diff --git "a/assets/index-CHqn31rb.js" "b/assets/index-CHqn31rb.js" new file mode 100644--- /dev/null +++ "b/assets/index-CHqn31rb.js" @@ -0,0 +1,110 @@ +var Q1=Object.defineProperty;var tv=e=>{throw TypeError(e)};var J1=(e,t,n)=>t in e?Q1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Cn=(e,t,n)=>J1(e,typeof t!="symbol"?t+"":t,n),nv=(e,t,n)=>t.has(e)||tv("Cannot "+n);var Tl=(e,t,n)=>(nv(e,t,"read from private field"),n?n.call(e):t.get(e)),rv=(e,t,n)=>t.has(e)?tv("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),ov=(e,t,n,r)=>(nv(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const c of a.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&r(c)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();var Hr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function gc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Df={exports:{}},kl={},Mf={exports:{}},ct={};/** + * @license React + * react.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var iv;function Z1(){if(iv)return ct;iv=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),c=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.iterator;function m(W){return W===null||typeof W!="object"?null:(W=y&&W[y]||W["@@iterator"],typeof W=="function"?W:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,S={};function _(W,ie,be){this.props=W,this.context=ie,this.refs=S,this.updater=be||w}_.prototype.isReactComponent={},_.prototype.setState=function(W,ie){if(typeof W!="object"&&typeof W!="function"&&W!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,W,ie,"setState")},_.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};function P(){}P.prototype=_.prototype;function O(W,ie,be){this.props=W,this.context=ie,this.refs=S,this.updater=be||w}var R=O.prototype=new P;R.constructor=O,C(R,_.prototype),R.isPureReactComponent=!0;var N=Array.isArray,J=Object.prototype.hasOwnProperty,ce={current:null},G={key:!0,ref:!0,__self:!0,__source:!0};function te(W,ie,be){var Se,_e={},Oe=null,Be=null;if(ie!=null)for(Se in ie.ref!==void 0&&(Be=ie.ref),ie.key!==void 0&&(Oe=""+ie.key),ie)J.call(ie,Se)&&!G.hasOwnProperty(Se)&&(_e[Se]=ie[Se]);var Ae=arguments.length-2;if(Ae===1)_e.children=be;else if(1>>1,ie=V[W];if(0>>1;Ws(_e,Q))Oes(Be,_e)?(V[W]=Be,V[Oe]=Q,W=Oe):(V[W]=_e,V[Se]=Q,W=Se);else if(Oes(Be,Q))V[W]=Be,V[Oe]=Q,W=Oe;else break e}}return q}function s(V,q){var Q=V.sortIndex-q.sortIndex;return Q!==0?Q:V.id-q.id}if(typeof performance=="object"&&typeof performance.now=="function"){var a=performance;e.unstable_now=function(){return a.now()}}else{var c=Date,u=c.now();e.unstable_now=function(){return c.now()-u}}var h=[],f=[],g=1,y=null,m=3,w=!1,C=!1,S=!1,_=typeof setTimeout=="function"?setTimeout:null,P=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function R(V){for(var q=n(f);q!==null;){if(q.callback===null)r(f);else if(q.startTime<=V)r(f),q.sortIndex=q.expirationTime,t(h,q);else break;q=n(f)}}function N(V){if(S=!1,R(V),!C)if(n(h)!==null)C=!0,L(J);else{var q=n(f);q!==null&&K(N,q.startTime-V)}}function J(V,q){C=!1,S&&(S=!1,P(te),te=-1),w=!0;var Q=m;try{for(R(q),y=n(h);y!==null&&(!(y.expirationTime>q)||V&&!z());){var W=y.callback;if(typeof W=="function"){y.callback=null,m=y.priorityLevel;var ie=W(y.expirationTime<=q);q=e.unstable_now(),typeof ie=="function"?y.callback=ie:y===n(h)&&r(h),R(q)}else r(h);y=n(h)}if(y!==null)var be=!0;else{var Se=n(f);Se!==null&&K(N,Se.startTime-q),be=!1}return be}finally{y=null,m=Q,w=!1}}var ce=!1,G=null,te=-1,D=5,M=-1;function z(){return!(e.unstable_now()-MV||125W?(V.sortIndex=Q,t(f,V),n(h)===null&&V===n(f)&&(S?(P(te),te=-1):S=!0,K(N,Q-W))):(V.sortIndex=ie,t(h,V),C||w||(C=!0,L(J))),V},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(V){var q=m;return function(){var Q=m;m=q;try{return V.apply(this,arguments)}finally{m=Q}}}}(Lf)),Lf}var uv;function rb(){return uv||(uv=1,Ff.exports=nb()),Ff.exports}/** + * @license React + * react-dom.production.min.js + * + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var hv;function ob(){if(hv)return Mn;hv=1;var e=mc(),t=rb();function n(o){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+o,l=1;l"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,f=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,g={},y={};function m(o){return h.call(y,o)?!0:h.call(g,o)?!1:f.test(o)?y[o]=!0:(g[o]=!0,!1)}function w(o,i,l,p){if(l!==null&&l.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return p?!1:l!==null?!l.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function C(o,i,l,p){if(i===null||typeof i>"u"||w(o,i,l,p))return!0;if(p)return!1;if(l!==null)switch(l.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function S(o,i,l,p,x,E,I){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=p,this.attributeNamespace=x,this.mustUseProperty=l,this.propertyName=o,this.type=i,this.sanitizeURL=E,this.removeEmptyString=I}var _={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){_[o]=new S(o,0,!1,o,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var i=o[0];_[i]=new S(i,1,!1,o[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(o){_[o]=new S(o,2,!1,o.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){_[o]=new S(o,2,!1,o,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){_[o]=new S(o,3,!1,o.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(o){_[o]=new S(o,3,!0,o,null,!1,!1)}),["capture","download"].forEach(function(o){_[o]=new S(o,4,!1,o,null,!1,!1)}),["cols","rows","size","span"].forEach(function(o){_[o]=new S(o,6,!1,o,null,!1,!1)}),["rowSpan","start"].forEach(function(o){_[o]=new S(o,5,!1,o.toLowerCase(),null,!1,!1)});var P=/[\-:]([a-z])/g;function O(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var i=o.replace(P,O);_[i]=new S(i,1,!1,o,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var i=o.replace(P,O);_[i]=new S(i,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(o){var i=o.replace(P,O);_[i]=new S(i,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(o){_[o]=new S(o,1,!1,o.toLowerCase(),null,!1,!1)}),_.xlinkHref=new S("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(o){_[o]=new S(o,1,!1,o.toLowerCase(),null,!0,!0)});function R(o,i,l,p){var x=_.hasOwnProperty(i)?_[i]:null;(x!==null?x.type!==0:p||!(2X||x[I]!==E[X]){var ne=` +`+x[I].replace(" at new "," at ");return o.displayName&&ne.includes("")&&(ne=ne.replace("",o.displayName)),ne}while(1<=I&&0<=X);break}}}finally{be=!1,Error.prepareStackTrace=l}return(o=o?o.displayName||o.name:"")?ie(o):""}function _e(o){switch(o.tag){case 5:return ie(o.type);case 16:return ie("Lazy");case 13:return ie("Suspense");case 19:return ie("SuspenseList");case 0:case 2:case 15:return o=Se(o.type,!1),o;case 11:return o=Se(o.type.render,!1),o;case 1:return o=Se(o.type,!0),o;default:return""}}function Oe(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case G:return"Fragment";case ce:return"Portal";case D:return"Profiler";case te:return"StrictMode";case Y:return"Suspense";case $:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case z:return(o.displayName||"Context")+".Consumer";case M:return(o._context.displayName||"Context")+".Provider";case U:var i=o.render;return o=o.displayName,o||(o=i.displayName||i.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case F:return i=o.displayName||null,i!==null?i:Oe(o.type)||"Memo";case L:i=o._payload,o=o._init;try{return Oe(o(i))}catch{}}return null}function Be(o){var i=o.type;switch(o.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=i.render,o=o.displayName||o.name||"",i.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Oe(i);case 8:return i===te?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function Ae(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ce(o){var i=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Qe(o){var i=Ce(o)?"checked":"value",l=Object.getOwnPropertyDescriptor(o.constructor.prototype,i),p=""+o[i];if(!o.hasOwnProperty(i)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var x=l.get,E=l.set;return Object.defineProperty(o,i,{configurable:!0,get:function(){return x.call(this)},set:function(I){p=""+I,E.call(this,I)}}),Object.defineProperty(o,i,{enumerable:l.enumerable}),{getValue:function(){return p},setValue:function(I){p=""+I},stopTracking:function(){o._valueTracker=null,delete o[i]}}}}function tt(o){o._valueTracker||(o._valueTracker=Qe(o))}function Fe(o){if(!o)return!1;var i=o._valueTracker;if(!i)return!0;var l=i.getValue(),p="";return o&&(p=Ce(o)?o.checked?"true":"false":o.value),o=p,o!==l?(i.setValue(o),!0):!1}function it(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function gt(o,i){var l=i.checked;return Q({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:l??o._wrapperState.initialChecked})}function wt(o,i){var l=i.defaultValue==null?"":i.defaultValue,p=i.checked!=null?i.checked:i.defaultChecked;l=Ae(i.value!=null?i.value:l),o._wrapperState={initialChecked:p,initialValue:l,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function Zt(o,i){i=i.checked,i!=null&&R(o,"checked",i,!1)}function xo(o,i){Zt(o,i);var l=Ae(i.value),p=i.type;if(l!=null)p==="number"?(l===0&&o.value===""||o.value!=l)&&(o.value=""+l):o.value!==""+l&&(o.value=""+l);else if(p==="submit"||p==="reset"){o.removeAttribute("value");return}i.hasOwnProperty("value")?So(o,i.type,l):i.hasOwnProperty("defaultValue")&&So(o,i.type,Ae(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(o.defaultChecked=!!i.defaultChecked)}function ti(o,i,l){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var p=i.type;if(!(p!=="submit"&&p!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+o._wrapperState.initialValue,l||i===o.value||(o.value=i),o.defaultValue=i}l=o.name,l!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,l!==""&&(o.name=l)}function So(o,i,l){(i!=="number"||it(o.ownerDocument)!==o)&&(l==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+l&&(o.defaultValue=""+l))}var gn=Array.isArray;function Lt(o,i,l,p){if(o=o.options,i){i={};for(var x=0;x"+i.valueOf().toString()+"",i=tr.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;i.firstChild;)o.appendChild(i.firstChild)}});function nr(o,i){if(i){var l=o.firstChild;if(l&&l===o.lastChild&&l.nodeType===3){l.nodeValue=i;return}}o.textContent=i}var mn={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},ni=["Webkit","ms","Moz","O"];Object.keys(mn).forEach(function(o){ni.forEach(function(i){i=i+o.charAt(0).toUpperCase()+o.substring(1),mn[i]=mn[o]})});function ri(o,i,l){return i==null||typeof i=="boolean"||i===""?"":l||typeof i!="number"||i===0||mn.hasOwnProperty(o)&&mn[o]?(""+i).trim():i+"px"}function Fn(o,i){o=o.style;for(var l in i)if(i.hasOwnProperty(l)){var p=l.indexOf("--")===0,x=ri(l,i[l],p);l==="float"&&(l="cssFloat"),p?o.setProperty(l,x):o[l]=x}}var Ue=Q({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Sr(o,i){if(i){if(Ue[o]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(n(137,o));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(n(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(n(61))}if(i.style!=null&&typeof i.style!="object")throw Error(n(62))}}function Ln(o,i){if(o.indexOf("-")===-1)return typeof i.is=="string";switch(o){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Qr=null;function je(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var bo=null,Cr=null,rr=null;function Ki(o){if(o=pl(o)){if(typeof bo!="function")throw Error(n(280));var i=o.stateNode;i&&(i=Jc(i),bo(o.stateNode,o.type,i))}}function Eo(o){Cr?rr?rr.push(o):rr=[o]:Cr=o}function Us(){if(Cr){var o=Cr,i=rr;if(rr=Cr=null,Ki(o),i)for(o=0;o>>=0,o===0?32:31-(Ks(o)/Ys|0)|0}var ur=64,hr=4194304;function nn(o){switch(o&-o){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function no(o,i){var l=o.pendingLanes;if(l===0)return 0;var p=0,x=o.suspendedLanes,E=o.pingedLanes,I=l&268435455;if(I!==0){var X=I&~x;X!==0?p=nn(X):(E&=I,E!==0&&(p=nn(E)))}else I=l&~x,I!==0?p=nn(I):E!==0&&(p=nn(E));if(p===0)return 0;if(i!==0&&i!==p&&(i&x)===0&&(x=p&-p,E=i&-i,x>=E||x===16&&(E&4194240)!==0))return i;if((p&4)!==0&&(p|=l&16),i=o.entangledLanes,i!==0)for(o=o.entanglements,i&=p;0l;l++)i.push(o);return i}function wn(o,i,l){o.pendingLanes|=i,i!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,i=31-tn(i),o[i]=l}function Ji(o,i){var l=o.pendingLanes&~i;o.pendingLanes=i,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=i,o.mutableReadLanes&=i,o.entangledLanes&=i,i=o.entanglements;var p=o.eventTimes;for(o=o.expirationTimes;0=pi),Wc=" ",qc=!1;function us(o,i){switch(o){case"keyup":return zc.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function fr(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var xt=!1;function ha(o,i){switch(o){case"compositionend":return fr(i);case"keypress":return i.which!==32?null:(qc=!0,Wc);case"textInput":return o=i.data,o===Wc&&qc?null:o;default:return null}}function Rn(o,i){if(xt)return o==="compositionend"||!cs&&us(o,i)?(o=ra(),di=nl=oo=null,xt=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1=i)return{node:l,offset:i-o};o=p}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=oe(l)}}function fe(o,i){return o&&i?o===i?!0:o&&o.nodeType===3?!1:i&&i.nodeType===3?fe(o,i.parentNode):"contains"in o?o.contains(i):o.compareDocumentPosition?!!(o.compareDocumentPosition(i)&16):!1:!1}function le(){for(var o=window,i=it();i instanceof o.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)o=i.contentWindow;else break;i=it(o.document)}return i}function ge(o){var i=o&&o.nodeName&&o.nodeName.toLowerCase();return i&&(i==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||i==="textarea"||o.contentEditable==="true")}function ve(o){var i=le(),l=o.focusedElem,p=o.selectionRange;if(i!==l&&l&&l.ownerDocument&&fe(l.ownerDocument.documentElement,l)){if(p!==null&&ge(l)){if(i=p.start,o=p.end,o===void 0&&(o=i),"selectionStart"in l)l.selectionStart=i,l.selectionEnd=Math.min(o,l.value.length);else if(o=(i=l.ownerDocument||document)&&i.defaultView||window,o.getSelection){o=o.getSelection();var x=l.textContent.length,E=Math.min(p.start,x);p=p.end===void 0?E:Math.min(p.end,x),!o.extend&&E>p&&(x=p,p=E,E=x),x=ue(l,E);var I=ue(l,p);x&&I&&(o.rangeCount!==1||o.anchorNode!==x.node||o.anchorOffset!==x.offset||o.focusNode!==I.node||o.focusOffset!==I.offset)&&(i=i.createRange(),i.setStart(x.node,x.offset),o.removeAllRanges(),E>p?(o.addRange(i),o.extend(I.node,I.offset)):(i.setEnd(I.node,I.offset),o.addRange(i)))}}for(i=[],o=l;o=o.parentNode;)o.nodeType===1&&i.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof l.focus=="function"&&l.focus(),l=0;l=document.documentMode,xe=null,Te=null,Ie=null,ke=!1;function Ne(o,i,l){var p=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;ke||xe==null||xe!==it(p)||(p=xe,"selectionStart"in p&&ge(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Ie&&de(Ie,p)||(Ie=p,p=Yc(Te,"onSelect"),0ma||(o.current=Td[ma],Td[ma]=null,ma--)}function Pt(o,i){ma++,Td[ma]=o.current,o.current=i}var vi={},an=yi(vi),Tn=yi(!1),ps=vi;function ya(o,i){var l=o.type.contextTypes;if(!l)return vi;var p=o.stateNode;if(p&&p.__reactInternalMemoizedUnmaskedChildContext===i)return p.__reactInternalMemoizedMaskedChildContext;var x={},E;for(E in l)x[E]=i[E];return p&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=i,o.__reactInternalMemoizedMaskedChildContext=x),x}function kn(o){return o=o.childContextTypes,o!=null}function Zc(){Rt(Tn),Rt(an)}function bm(o,i,l){if(an.current!==vi)throw Error(n(168));Pt(an,i),Pt(Tn,l)}function Em(o,i,l){var p=o.stateNode;if(i=i.childContextTypes,typeof p.getChildContext!="function")return l;p=p.getChildContext();for(var x in p)if(!(x in i))throw Error(n(108,Be(o)||"Unknown",x));return Q({},l,p)}function eu(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||vi,ps=an.current,Pt(an,o),Pt(Tn,Tn.current),!0}function Pm(o,i,l){var p=o.stateNode;if(!p)throw Error(n(169));l?(o=Em(o,i,ps),p.__reactInternalMemoizedMergedChildContext=o,Rt(Tn),Rt(an),Pt(an,o)):Rt(Tn),Pt(Tn,l)}var Mo=null,tu=!1,kd=!1;function _m(o){Mo===null?Mo=[o]:Mo.push(o)}function m1(o){tu=!0,_m(o)}function wi(){if(!kd&&Mo!==null){kd=!0;var o=0,i=mt;try{var l=Mo;for(mt=1;o>=I,x-=I,Io=1<<32-tn(i)+x|l<et?(Yt=Xe,Xe=null):Yt=Xe.sibling;var pt=Ee(pe,Xe,me[et],Me);if(pt===null){Xe===null&&(Xe=Yt);break}o&&Xe&&pt.alternate===null&&i(pe,Xe),ae=E(pt,ae,et),Ye===null?qe=pt:Ye.sibling=pt,Ye=pt,Xe=Yt}if(et===me.length)return l(pe,Xe),kt&&ms(pe,et),qe;if(Xe===null){for(;etet?(Yt=Xe,Xe=null):Yt=Xe.sibling;var Ri=Ee(pe,Xe,pt.value,Me);if(Ri===null){Xe===null&&(Xe=Yt);break}o&&Xe&&Ri.alternate===null&&i(pe,Xe),ae=E(Ri,ae,et),Ye===null?qe=Ri:Ye.sibling=Ri,Ye=Ri,Xe=Yt}if(pt.done)return l(pe,Xe),kt&&ms(pe,et),qe;if(Xe===null){for(;!pt.done;et++,pt=me.next())pt=Re(pe,pt.value,Me),pt!==null&&(ae=E(pt,ae,et),Ye===null?qe=pt:Ye.sibling=pt,Ye=pt);return kt&&ms(pe,et),qe}for(Xe=p(pe,Xe);!pt.done;et++,pt=me.next())pt=Ve(Xe,pe,et,pt.value,Me),pt!==null&&(o&&pt.alternate!==null&&Xe.delete(pt.key===null?et:pt.key),ae=E(pt,ae,et),Ye===null?qe=pt:Ye.sibling=pt,Ye=pt);return o&&Xe.forEach(function(X1){return i(pe,X1)}),kt&&ms(pe,et),qe}function Bt(pe,ae,me,Me){if(typeof me=="object"&&me!==null&&me.type===G&&me.key===null&&(me=me.props.children),typeof me=="object"&&me!==null){switch(me.$$typeof){case J:e:{for(var qe=me.key,Ye=ae;Ye!==null;){if(Ye.key===qe){if(qe=me.type,qe===G){if(Ye.tag===7){l(pe,Ye.sibling),ae=x(Ye,me.props.children),ae.return=pe,pe=ae;break e}}else if(Ye.elementType===qe||typeof qe=="object"&&qe!==null&&qe.$$typeof===L&&Nm(qe)===Ye.type){l(pe,Ye.sibling),ae=x(Ye,me.props),ae.ref=gl(pe,Ye,me),ae.return=pe,pe=ae;break e}l(pe,Ye);break}else i(pe,Ye);Ye=Ye.sibling}me.type===G?(ae=Es(me.props.children,pe.mode,Me,me.key),ae.return=pe,pe=ae):(Me=Tu(me.type,me.key,me.props,null,pe.mode,Me),Me.ref=gl(pe,ae,me),Me.return=pe,pe=Me)}return I(pe);case ce:e:{for(Ye=me.key;ae!==null;){if(ae.key===Ye)if(ae.tag===4&&ae.stateNode.containerInfo===me.containerInfo&&ae.stateNode.implementation===me.implementation){l(pe,ae.sibling),ae=x(ae,me.children||[]),ae.return=pe,pe=ae;break e}else{l(pe,ae);break}else i(pe,ae);ae=ae.sibling}ae=Rf(me,pe.mode,Me),ae.return=pe,pe=ae}return I(pe);case L:return Ye=me._init,Bt(pe,ae,Ye(me._payload),Me)}if(gn(me))return He(pe,ae,me,Me);if(q(me))return We(pe,ae,me,Me);iu(pe,me)}return typeof me=="string"&&me!==""||typeof me=="number"?(me=""+me,ae!==null&&ae.tag===6?(l(pe,ae.sibling),ae=x(ae,me),ae.return=pe,pe=ae):(l(pe,ae),ae=Af(me,pe.mode,Me),ae.return=pe,pe=ae),I(pe)):l(pe,ae)}return Bt}var Sa=Dm(!0),Mm=Dm(!1),su=yi(null),au=null,Ca=null,Fd=null;function Ld(){Fd=Ca=au=null}function jd(o){var i=su.current;Rt(su),o._currentValue=i}function Bd(o,i,l){for(;o!==null;){var p=o.alternate;if((o.childLanes&i)!==i?(o.childLanes|=i,p!==null&&(p.childLanes|=i)):p!==null&&(p.childLanes&i)!==i&&(p.childLanes|=i),o===l)break;o=o.return}}function ba(o,i){au=o,Fd=Ca=null,o=o.dependencies,o!==null&&o.firstContext!==null&&((o.lanes&i)!==0&&(On=!0),o.firstContext=null)}function mr(o){var i=o._currentValue;if(Fd!==o)if(o={context:o,memoizedValue:i,next:null},Ca===null){if(au===null)throw Error(n(308));Ca=o,au.dependencies={lanes:0,firstContext:o}}else Ca=Ca.next=o;return i}var ys=null;function $d(o){ys===null?ys=[o]:ys.push(o)}function Im(o,i,l,p){var x=i.interleaved;return x===null?(l.next=l,$d(i)):(l.next=x.next,x.next=l),i.interleaved=l,Lo(o,p)}function Lo(o,i){o.lanes|=i;var l=o.alternate;for(l!==null&&(l.lanes|=i),l=o,o=o.return;o!==null;)o.childLanes|=i,l=o.alternate,l!==null&&(l.childLanes|=i),l=o,o=o.return;return l.tag===3?l.stateNode:null}var xi=!1;function Vd(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Fm(o,i){o=o.updateQueue,i.updateQueue===o&&(i.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function jo(o,i){return{eventTime:o,lane:i,tag:0,payload:null,callback:null,next:null}}function Si(o,i,l){var p=o.updateQueue;if(p===null)return null;if(p=p.shared,(ft&2)!==0){var x=p.pending;return x===null?i.next=i:(i.next=x.next,x.next=i),p.pending=i,Lo(o,l)}return x=p.interleaved,x===null?(i.next=i,$d(p)):(i.next=x.next,x.next=i),p.interleaved=i,Lo(o,l)}function lu(o,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194240)!==0)){var p=i.lanes;p&=o.pendingLanes,l|=p,i.lanes=l,Zs(o,l)}}function Lm(o,i){var l=o.updateQueue,p=o.alternate;if(p!==null&&(p=p.updateQueue,l===p)){var x=null,E=null;if(l=l.firstBaseUpdate,l!==null){do{var I={eventTime:l.eventTime,lane:l.lane,tag:l.tag,payload:l.payload,callback:l.callback,next:null};E===null?x=E=I:E=E.next=I,l=l.next}while(l!==null);E===null?x=E=i:E=E.next=i}else x=E=i;l={baseState:p.baseState,firstBaseUpdate:x,lastBaseUpdate:E,shared:p.shared,effects:p.effects},o.updateQueue=l;return}o=l.lastBaseUpdate,o===null?l.firstBaseUpdate=i:o.next=i,l.lastBaseUpdate=i}function cu(o,i,l,p){var x=o.updateQueue;xi=!1;var E=x.firstBaseUpdate,I=x.lastBaseUpdate,X=x.shared.pending;if(X!==null){x.shared.pending=null;var ne=X,ye=ne.next;ne.next=null,I===null?E=ye:I.next=ye,I=ne;var Pe=o.alternate;Pe!==null&&(Pe=Pe.updateQueue,X=Pe.lastBaseUpdate,X!==I&&(X===null?Pe.firstBaseUpdate=ye:X.next=ye,Pe.lastBaseUpdate=ne))}if(E!==null){var Re=x.baseState;I=0,Pe=ye=ne=null,X=E;do{var Ee=X.lane,Ve=X.eventTime;if((p&Ee)===Ee){Pe!==null&&(Pe=Pe.next={eventTime:Ve,lane:0,tag:X.tag,payload:X.payload,callback:X.callback,next:null});e:{var He=o,We=X;switch(Ee=i,Ve=l,We.tag){case 1:if(He=We.payload,typeof He=="function"){Re=He.call(Ve,Re,Ee);break e}Re=He;break e;case 3:He.flags=He.flags&-65537|128;case 0:if(He=We.payload,Ee=typeof He=="function"?He.call(Ve,Re,Ee):He,Ee==null)break e;Re=Q({},Re,Ee);break e;case 2:xi=!0}}X.callback!==null&&X.lane!==0&&(o.flags|=64,Ee=x.effects,Ee===null?x.effects=[X]:Ee.push(X))}else Ve={eventTime:Ve,lane:Ee,tag:X.tag,payload:X.payload,callback:X.callback,next:null},Pe===null?(ye=Pe=Ve,ne=Re):Pe=Pe.next=Ve,I|=Ee;if(X=X.next,X===null){if(X=x.shared.pending,X===null)break;Ee=X,X=Ee.next,Ee.next=null,x.lastBaseUpdate=Ee,x.shared.pending=null}}while(!0);if(Pe===null&&(ne=Re),x.baseState=ne,x.firstBaseUpdate=ye,x.lastBaseUpdate=Pe,i=x.shared.interleaved,i!==null){x=i;do I|=x.lane,x=x.next;while(x!==i)}else E===null&&(x.shared.lanes=0);xs|=I,o.lanes=I,o.memoizedState=Re}}function jm(o,i,l){if(o=i.effects,i.effects=null,o!==null)for(i=0;il?l:4,o(!0);var p=qd.transition;qd.transition={};try{o(!1),i()}finally{mt=l,qd.transition=p}}function ry(){return yr().memoizedState}function x1(o,i,l){var p=Pi(o);if(l={lane:p,action:l,hasEagerState:!1,eagerState:null,next:null},oy(o))iy(i,l);else if(l=Im(o,i,l,p),l!==null){var x=Sn();Lr(l,o,p,x),sy(l,i,p)}}function S1(o,i,l){var p=Pi(o),x={lane:p,action:l,hasEagerState:!1,eagerState:null,next:null};if(oy(o))iy(i,x);else{var E=o.alternate;if(o.lanes===0&&(E===null||E.lanes===0)&&(E=i.lastRenderedReducer,E!==null))try{var I=i.lastRenderedState,X=E(I,l);if(x.hasEagerState=!0,x.eagerState=X,ee(X,I)){var ne=i.interleaved;ne===null?(x.next=x,$d(i)):(x.next=ne.next,ne.next=x),i.interleaved=x;return}}catch{}finally{}l=Im(o,i,x,p),l!==null&&(x=Sn(),Lr(l,o,p,x),sy(l,i,p))}}function oy(o){var i=o.alternate;return o===Nt||i!==null&&i===Nt}function iy(o,i){wl=du=!0;var l=o.pending;l===null?i.next=i:(i.next=l.next,l.next=i),o.pending=i}function sy(o,i,l){if((l&4194240)!==0){var p=i.lanes;p&=o.pendingLanes,l|=p,i.lanes=l,Zs(o,l)}}var gu={readContext:mr,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useInsertionEffect:ln,useLayoutEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useMutableSource:ln,useSyncExternalStore:ln,useId:ln,unstable_isNewReconciler:!1},C1={readContext:mr,useCallback:function(o,i){return lo().memoizedState=[o,i===void 0?null:i],o},useContext:mr,useEffect:Ym,useImperativeHandle:function(o,i,l){return l=l!=null?l.concat([o]):null,fu(4194308,4,Jm.bind(null,i,o),l)},useLayoutEffect:function(o,i){return fu(4194308,4,o,i)},useInsertionEffect:function(o,i){return fu(4,2,o,i)},useMemo:function(o,i){var l=lo();return i=i===void 0?null:i,o=o(),l.memoizedState=[o,i],o},useReducer:function(o,i,l){var p=lo();return i=l!==void 0?l(i):i,p.memoizedState=p.baseState=i,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:i},p.queue=o,o=o.dispatch=x1.bind(null,Nt,o),[p.memoizedState,o]},useRef:function(o){var i=lo();return o={current:o},i.memoizedState=o},useState:Gm,useDebugValue:Zd,useDeferredValue:function(o){return lo().memoizedState=o},useTransition:function(){var o=Gm(!1),i=o[0];return o=w1.bind(null,o[1]),lo().memoizedState=o,[i,o]},useMutableSource:function(){},useSyncExternalStore:function(o,i,l){var p=Nt,x=lo();if(kt){if(l===void 0)throw Error(n(407));l=l()}else{if(l=i(),Kt===null)throw Error(n(349));(ws&30)!==0||zm(p,i,l)}x.memoizedState=l;var E={value:l,getSnapshot:i};return x.queue=E,Ym(Um.bind(null,p,E,o),[o]),p.flags|=2048,Cl(9,Hm.bind(null,p,E,l,i),void 0,null),l},useId:function(){var o=lo(),i=Kt.identifierPrefix;if(kt){var l=Fo,p=Io;l=(p&~(1<<32-tn(p)-1)).toString(32)+l,i=":"+i+"R"+l,l=xl++,0<\/script>",o=o.removeChild(o.firstChild)):typeof p.is=="string"?o=I.createElement(l,{is:p.is}):(o=I.createElement(l),l==="select"&&(I=o,p.multiple?I.multiple=!0:p.size&&(I.size=p.size))):o=I.createElementNS(o,l),o[so]=i,o[fl]=p,_y(o,i,!1,!1),i.stateNode=o;e:{switch(I=Ln(l,p),l){case"dialog":At("cancel",o),At("close",o),x=p;break;case"iframe":case"object":case"embed":At("load",o),x=p;break;case"video":case"audio":for(x=0;xRa&&(i.flags|=128,p=!0,bl(E,!1),i.lanes=4194304)}else{if(!p)if(o=uu(I),o!==null){if(i.flags|=128,p=!0,l=o.updateQueue,l!==null&&(i.updateQueue=l,i.flags|=4),bl(E,!0),E.tail===null&&E.tailMode==="hidden"&&!I.alternate&&!kt)return cn(i),null}else 2*Et()-E.renderingStartTime>Ra&&l!==1073741824&&(i.flags|=128,p=!0,bl(E,!1),i.lanes=4194304);E.isBackwards?(I.sibling=i.child,i.child=I):(l=E.last,l!==null?l.sibling=I:i.child=I,E.last=I)}return E.tail!==null?(i=E.tail,E.rendering=i,E.tail=i.sibling,E.renderingStartTime=Et(),i.sibling=null,l=Ot.current,Pt(Ot,p?l&1|2:l&1),i):(cn(i),null);case 22:case 23:return Ef(),p=i.memoizedState!==null,o!==null&&o.memoizedState!==null!==p&&(i.flags|=8192),p&&(i.mode&1)!==0?(qn&1073741824)!==0&&(cn(i),i.subtreeFlags&6&&(i.flags|=8192)):cn(i),null;case 24:return null;case 25:return null}throw Error(n(156,i.tag))}function k1(o,i){switch(Nd(i),i.tag){case 1:return kn(i.type)&&Zc(),o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 3:return Ea(),Rt(Tn),Rt(an),Wd(),o=i.flags,(o&65536)!==0&&(o&128)===0?(i.flags=o&-65537|128,i):null;case 5:return Hd(i),null;case 13:if(Rt(Ot),o=i.memoizedState,o!==null&&o.dehydrated!==null){if(i.alternate===null)throw Error(n(340));xa()}return o=i.flags,o&65536?(i.flags=o&-65537|128,i):null;case 19:return Rt(Ot),null;case 4:return Ea(),null;case 10:return jd(i.type._context),null;case 22:case 23:return Ef(),null;case 24:return null;default:return null}}var wu=!1,un=!1,O1=typeof WeakSet=="function"?WeakSet:Set,ze=null;function _a(o,i){var l=o.ref;if(l!==null)if(typeof l=="function")try{l(null)}catch(p){It(o,i,p)}else l.current=null}function df(o,i,l){try{l()}catch(p){It(o,i,p)}}var Ty=!1;function N1(o,i){if(bd=ro,o=le(),ge(o)){if("selectionStart"in o)var l={start:o.selectionStart,end:o.selectionEnd};else e:{l=(l=o.ownerDocument)&&l.defaultView||window;var p=l.getSelection&&l.getSelection();if(p&&p.rangeCount!==0){l=p.anchorNode;var x=p.anchorOffset,E=p.focusNode;p=p.focusOffset;try{l.nodeType,E.nodeType}catch{l=null;break e}var I=0,X=-1,ne=-1,ye=0,Pe=0,Re=o,Ee=null;t:for(;;){for(var Ve;Re!==l||x!==0&&Re.nodeType!==3||(X=I+x),Re!==E||p!==0&&Re.nodeType!==3||(ne=I+p),Re.nodeType===3&&(I+=Re.nodeValue.length),(Ve=Re.firstChild)!==null;)Ee=Re,Re=Ve;for(;;){if(Re===o)break t;if(Ee===l&&++ye===x&&(X=I),Ee===E&&++Pe===p&&(ne=I),(Ve=Re.nextSibling)!==null)break;Re=Ee,Ee=Re.parentNode}Re=Ve}l=X===-1||ne===-1?null:{start:X,end:ne}}else l=null}l=l||{start:0,end:0}}else l=null;for(Ed={focusedElem:o,selectionRange:l},ro=!1,ze=i;ze!==null;)if(i=ze,o=i.child,(i.subtreeFlags&1028)!==0&&o!==null)o.return=i,ze=o;else for(;ze!==null;){i=ze;try{var He=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(He!==null){var We=He.memoizedProps,Bt=He.memoizedState,pe=i.stateNode,ae=pe.getSnapshotBeforeUpdate(i.elementType===i.type?We:Mr(i.type,We),Bt);pe.__reactInternalSnapshotBeforeUpdate=ae}break;case 3:var me=i.stateNode.containerInfo;me.nodeType===1?me.textContent="":me.nodeType===9&&me.documentElement&&me.removeChild(me.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(Me){It(i,i.return,Me)}if(o=i.sibling,o!==null){o.return=i.return,ze=o;break}ze=i.return}return He=Ty,Ty=!1,He}function El(o,i,l){var p=i.updateQueue;if(p=p!==null?p.lastEffect:null,p!==null){var x=p=p.next;do{if((x.tag&o)===o){var E=x.destroy;x.destroy=void 0,E!==void 0&&df(i,l,E)}x=x.next}while(x!==p)}}function xu(o,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var l=i=i.next;do{if((l.tag&o)===o){var p=l.create;l.destroy=p()}l=l.next}while(l!==i)}}function ff(o){var i=o.ref;if(i!==null){var l=o.stateNode;switch(o.tag){case 5:o=l;break;default:o=l}typeof i=="function"?i(o):i.current=o}}function ky(o){var i=o.alternate;i!==null&&(o.alternate=null,ky(i)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(i=o.stateNode,i!==null&&(delete i[so],delete i[fl],delete i[Rd],delete i[p1],delete i[g1])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Oy(o){return o.tag===5||o.tag===3||o.tag===4}function Ny(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Oy(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function pf(o,i,l){var p=o.tag;if(p===5||p===6)o=o.stateNode,i?l.nodeType===8?l.parentNode.insertBefore(o,i):l.insertBefore(o,i):(l.nodeType===8?(i=l.parentNode,i.insertBefore(o,l)):(i=l,i.appendChild(o)),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=Qc));else if(p!==4&&(o=o.child,o!==null))for(pf(o,i,l),o=o.sibling;o!==null;)pf(o,i,l),o=o.sibling}function gf(o,i,l){var p=o.tag;if(p===5||p===6)o=o.stateNode,i?l.insertBefore(o,i):l.appendChild(o);else if(p!==4&&(o=o.child,o!==null))for(gf(o,i,l),o=o.sibling;o!==null;)gf(o,i,l),o=o.sibling}var Qt=null,Ir=!1;function Ci(o,i,l){for(l=l.child;l!==null;)Dy(o,i,l),l=l.sibling}function Dy(o,i,l){if(vn&&typeof vn.onCommitFiberUnmount=="function")try{vn.onCommitFiberUnmount(Ar,l)}catch{}switch(l.tag){case 5:un||_a(l,i);case 6:var p=Qt,x=Ir;Qt=null,Ci(o,i,l),Qt=p,Ir=x,Qt!==null&&(Ir?(o=Qt,l=l.stateNode,o.nodeType===8?o.parentNode.removeChild(l):o.removeChild(l)):Qt.removeChild(l.stateNode));break;case 18:Qt!==null&&(Ir?(o=Qt,l=l.stateNode,o.nodeType===8?Ad(o.parentNode,l):o.nodeType===1&&Ad(o,l),ci(o)):Ad(Qt,l.stateNode));break;case 4:p=Qt,x=Ir,Qt=l.stateNode.containerInfo,Ir=!0,Ci(o,i,l),Qt=p,Ir=x;break;case 0:case 11:case 14:case 15:if(!un&&(p=l.updateQueue,p!==null&&(p=p.lastEffect,p!==null))){x=p=p.next;do{var E=x,I=E.destroy;E=E.tag,I!==void 0&&((E&2)!==0||(E&4)!==0)&&df(l,i,I),x=x.next}while(x!==p)}Ci(o,i,l);break;case 1:if(!un&&(_a(l,i),p=l.stateNode,typeof p.componentWillUnmount=="function"))try{p.props=l.memoizedProps,p.state=l.memoizedState,p.componentWillUnmount()}catch(X){It(l,i,X)}Ci(o,i,l);break;case 21:Ci(o,i,l);break;case 22:l.mode&1?(un=(p=un)||l.memoizedState!==null,Ci(o,i,l),un=p):Ci(o,i,l);break;default:Ci(o,i,l)}}function My(o){var i=o.updateQueue;if(i!==null){o.updateQueue=null;var l=o.stateNode;l===null&&(l=o.stateNode=new O1),i.forEach(function(p){var x=V1.bind(null,o,p);l.has(p)||(l.add(p),p.then(x,x))})}}function Fr(o,i){var l=i.deletions;if(l!==null)for(var p=0;px&&(x=I),p&=~E}if(p=x,p=Et()-p,p=(120>p?120:480>p?480:1080>p?1080:1920>p?1920:3e3>p?3e3:4320>p?4320:1960*M1(p/1960))-p,10o?16:o,Ei===null)var p=!1;else{if(o=Ei,Ei=null,Pu=0,(ft&6)!==0)throw Error(n(331));var x=ft;for(ft|=4,ze=o.current;ze!==null;){var E=ze,I=E.child;if((ze.flags&16)!==0){var X=E.deletions;if(X!==null){for(var ne=0;neEt()-vf?Cs(o,0):yf|=l),Dn(o,i)}function Gy(o,i){i===0&&((o.mode&1)===0?i=1:(i=hr,hr<<=1,(hr&130023424)===0&&(hr=4194304)));var l=Sn();o=Lo(o,i),o!==null&&(wn(o,i,l),Dn(o,l))}function $1(o){var i=o.memoizedState,l=0;i!==null&&(l=i.retryLane),Gy(o,l)}function V1(o,i){var l=0;switch(o.tag){case 13:var p=o.stateNode,x=o.memoizedState;x!==null&&(l=x.retryLane);break;case 19:p=o.stateNode;break;default:throw Error(n(314))}p!==null&&p.delete(i),Gy(o,l)}var Ky;Ky=function(o,i,l){if(o!==null)if(o.memoizedProps!==i.pendingProps||Tn.current)On=!0;else{if((o.lanes&l)===0&&(i.flags&128)===0)return On=!1,R1(o,i,l);On=(o.flags&131072)!==0}else On=!1,kt&&(i.flags&1048576)!==0&&Am(i,ru,i.index);switch(i.lanes=0,i.tag){case 2:var p=i.type;vu(o,i),o=i.pendingProps;var x=ya(i,an.current);ba(i,l),x=Kd(null,i,p,o,x,l);var E=Yd();return i.flags|=1,typeof x=="object"&&x!==null&&typeof x.render=="function"&&x.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,kn(p)?(E=!0,eu(i)):E=!1,i.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,Vd(i),x.updater=mu,i.stateNode=x,x._reactInternals=i,tf(i,p,o,l),i=sf(null,i,p,!0,E,l)):(i.tag=0,kt&&E&&Od(i),xn(null,i,x,l),i=i.child),i;case 16:p=i.elementType;e:{switch(vu(o,i),o=i.pendingProps,x=p._init,p=x(p._payload),i.type=p,x=i.tag=H1(p),o=Mr(p,o),x){case 0:i=of(null,i,p,o,l);break e;case 1:i=xy(null,i,p,o,l);break e;case 11:i=gy(null,i,p,o,l);break e;case 14:i=my(null,i,p,Mr(p.type,o),l);break e}throw Error(n(306,p,""))}return i;case 0:return p=i.type,x=i.pendingProps,x=i.elementType===p?x:Mr(p,x),of(o,i,p,x,l);case 1:return p=i.type,x=i.pendingProps,x=i.elementType===p?x:Mr(p,x),xy(o,i,p,x,l);case 3:e:{if(Sy(i),o===null)throw Error(n(387));p=i.pendingProps,E=i.memoizedState,x=E.element,Fm(o,i),cu(i,p,null,l);var I=i.memoizedState;if(p=I.element,E.isDehydrated)if(E={element:p,isDehydrated:!1,cache:I.cache,pendingSuspenseBoundaries:I.pendingSuspenseBoundaries,transitions:I.transitions},i.updateQueue.baseState=E,i.memoizedState=E,i.flags&256){x=Pa(Error(n(423)),i),i=Cy(o,i,p,l,x);break e}else if(p!==x){x=Pa(Error(n(424)),i),i=Cy(o,i,p,l,x);break e}else for(Wn=mi(i.stateNode.containerInfo.firstChild),Un=i,kt=!0,Dr=null,l=Mm(i,null,p,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(xa(),p===x){i=Bo(o,i,l);break e}xn(o,i,p,l)}i=i.child}return i;case 5:return Bm(i),o===null&&Md(i),p=i.type,x=i.pendingProps,E=o!==null?o.memoizedProps:null,I=x.children,Pd(p,x)?I=null:E!==null&&Pd(p,E)&&(i.flags|=32),wy(o,i),xn(o,i,I,l),i.child;case 6:return o===null&&Md(i),null;case 13:return by(o,i,l);case 4:return zd(i,i.stateNode.containerInfo),p=i.pendingProps,o===null?i.child=Sa(i,null,p,l):xn(o,i,p,l),i.child;case 11:return p=i.type,x=i.pendingProps,x=i.elementType===p?x:Mr(p,x),gy(o,i,p,x,l);case 7:return xn(o,i,i.pendingProps,l),i.child;case 8:return xn(o,i,i.pendingProps.children,l),i.child;case 12:return xn(o,i,i.pendingProps.children,l),i.child;case 10:e:{if(p=i.type._context,x=i.pendingProps,E=i.memoizedProps,I=x.value,Pt(su,p._currentValue),p._currentValue=I,E!==null)if(ee(E.value,I)){if(E.children===x.children&&!Tn.current){i=Bo(o,i,l);break e}}else for(E=i.child,E!==null&&(E.return=i);E!==null;){var X=E.dependencies;if(X!==null){I=E.child;for(var ne=X.firstContext;ne!==null;){if(ne.context===p){if(E.tag===1){ne=jo(-1,l&-l),ne.tag=2;var ye=E.updateQueue;if(ye!==null){ye=ye.shared;var Pe=ye.pending;Pe===null?ne.next=ne:(ne.next=Pe.next,Pe.next=ne),ye.pending=ne}}E.lanes|=l,ne=E.alternate,ne!==null&&(ne.lanes|=l),Bd(E.return,l,i),X.lanes|=l;break}ne=ne.next}}else if(E.tag===10)I=E.type===i.type?null:E.child;else if(E.tag===18){if(I=E.return,I===null)throw Error(n(341));I.lanes|=l,X=I.alternate,X!==null&&(X.lanes|=l),Bd(I,l,i),I=E.sibling}else I=E.child;if(I!==null)I.return=E;else for(I=E;I!==null;){if(I===i){I=null;break}if(E=I.sibling,E!==null){E.return=I.return,I=E;break}I=I.return}E=I}xn(o,i,x.children,l),i=i.child}return i;case 9:return x=i.type,p=i.pendingProps.children,ba(i,l),x=mr(x),p=p(x),i.flags|=1,xn(o,i,p,l),i.child;case 14:return p=i.type,x=Mr(p,i.pendingProps),x=Mr(p.type,x),my(o,i,p,x,l);case 15:return yy(o,i,i.type,i.pendingProps,l);case 17:return p=i.type,x=i.pendingProps,x=i.elementType===p?x:Mr(p,x),vu(o,i),i.tag=1,kn(p)?(o=!0,eu(i)):o=!1,ba(i,l),ly(i,p,x),tf(i,p,x,l),sf(null,i,p,!0,o,l);case 19:return Py(o,i,l);case 22:return vy(o,i,l)}throw Error(n(156,i.tag))};function Yy(o,i){return ii(o,i)}function z1(o,i,l,p){this.tag=o,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function wr(o,i,l,p){return new z1(o,i,l,p)}function _f(o){return o=o.prototype,!(!o||!o.isReactComponent)}function H1(o){if(typeof o=="function")return _f(o)?1:0;if(o!=null){if(o=o.$$typeof,o===U)return 11;if(o===F)return 14}return 2}function Ai(o,i){var l=o.alternate;return l===null?(l=wr(o.tag,i,o.key,o.mode),l.elementType=o.elementType,l.type=o.type,l.stateNode=o.stateNode,l.alternate=o,o.alternate=l):(l.pendingProps=i,l.type=o.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=o.flags&14680064,l.childLanes=o.childLanes,l.lanes=o.lanes,l.child=o.child,l.memoizedProps=o.memoizedProps,l.memoizedState=o.memoizedState,l.updateQueue=o.updateQueue,i=o.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=o.sibling,l.index=o.index,l.ref=o.ref,l}function Tu(o,i,l,p,x,E){var I=2;if(p=o,typeof o=="function")_f(o)&&(I=1);else if(typeof o=="string")I=5;else e:switch(o){case G:return Es(l.children,x,E,i);case te:I=8,x|=8;break;case D:return o=wr(12,l,i,x|2),o.elementType=D,o.lanes=E,o;case Y:return o=wr(13,l,i,x),o.elementType=Y,o.lanes=E,o;case $:return o=wr(19,l,i,x),o.elementType=$,o.lanes=E,o;case K:return ku(l,x,E,i);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case M:I=10;break e;case z:I=9;break e;case U:I=11;break e;case F:I=14;break e;case L:I=16,p=null;break e}throw Error(n(130,o==null?o:typeof o,""))}return i=wr(I,l,i,x),i.elementType=o,i.type=p,i.lanes=E,i}function Es(o,i,l,p){return o=wr(7,o,p,i),o.lanes=l,o}function ku(o,i,l,p){return o=wr(22,o,p,i),o.elementType=K,o.lanes=l,o.stateNode={isHidden:!1},o}function Af(o,i,l){return o=wr(6,o,null,i),o.lanes=l,o}function Rf(o,i,l){return i=wr(4,o.children!==null?o.children:[],o.key,i),i.lanes=l,i.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},i}function U1(o,i,l,p,x){this.tag=i,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Js(0),this.expirationTimes=Js(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Js(0),this.identifierPrefix=p,this.onRecoverableError=x,this.mutableSourceEagerHydrationData=null}function Tf(o,i,l,p,x,E,I,X,ne){return o=new U1(o,i,l,X,ne),i===1?(i=1,E===!0&&(i|=8)):i=0,E=wr(3,null,null,i),o.current=E,E.stateNode=o,E.memoizedState={element:p,isDehydrated:l,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vd(E),o}function W1(o,i,l){var p=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),If.exports=ob(),If.exports}var fv;function ib(){if(fv)return Lu;fv=1;var e=Ow();return Lu.createRoot=e.createRoot,Lu.hydrateRoot=e.hydrateRoot,Lu}var sb=ib();const pv=e=>{let t;const n=new Set,r=(f,g)=>{const y=typeof f=="function"?f(t):f;if(!Object.is(y,t)){const m=t;t=g??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(w=>w(t,m))}},s=()=>t,u={setState:r,getState:s,getInitialState:()=>h,subscribe:f=>(n.add(f),()=>n.delete(f))},h=t=e(r,s,u);return u},ab=e=>e?pv(e):pv,lb=e=>e;function cb(e,t=lb){const n=fn.useSyncExternalStore(e.subscribe,()=>t(e.getState()),()=>t(e.getInitialState()));return fn.useDebugValue(n),n}const ub=e=>{const t=ab(e),n=r=>cb(t,r);return Object.assign(n,t),n},hb=e=>ub;function Vt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n{}};function Fh(){for(var e=0,t=arguments.length,n={},r;e=0&&(r=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}ih.prototype=Fh.prototype={constructor:ih,on:function(e,t){var n=this._,r=fb(e+"",n),s,a=-1,c=r.length;if(arguments.length<2){for(;++a0)for(var n=new Array(s),r=0,s,a;r=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),mv.hasOwnProperty(t)?{space:mv[t],local:e}:e}function gb(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===_p&&t.documentElement.namespaceURI===_p?t.createElement(e):t.createElementNS(n,e)}}function mb(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Nw(e){var t=Lh(e);return(t.local?mb:gb)(t)}function yb(){}function pg(e){return e==null?yb:function(){return this.querySelector(e)}}function vb(e){typeof e!="function"&&(e=pg(e));for(var t=this._groups,n=t.length,r=new Array(n),s=0;s=R&&(R=O+1);!(J=_[R])&&++R=0;)(c=r[s])&&(a&&c.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(c,a),a=c);return this}function Hb(e){e||(e=Ub);function t(y,m){return y&&m?e(y.__data__,m.__data__):!y-!m}for(var n=this._groups,r=n.length,s=new Array(r),a=0;at?1:e>=t?0:NaN}function Wb(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function qb(){return Array.from(this)}function Gb(){for(var e=this._groups,t=0,n=e.length;t1?this.each((t==null?oE:typeof t=="function"?sE:iE)(e,t,n??"")):ja(this.node(),e)}function ja(e,t){return e.style.getPropertyValue(t)||Lw(e).getComputedStyle(e,null).getPropertyValue(t)}function lE(e){return function(){delete this[e]}}function cE(e,t){return function(){this[e]=t}}function uE(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function hE(e,t){return arguments.length>1?this.each((t==null?lE:typeof t=="function"?uE:cE)(e,t)):this.node()[e]}function jw(e){return e.trim().split(/^|\s+/)}function gg(e){return e.classList||new Bw(e)}function Bw(e){this._node=e,this._names=jw(e.getAttribute("class")||"")}Bw.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function $w(e,t){for(var n=gg(e),r=-1,s=t.length;++r=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function BE(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,s=t.length,a;n()=>e;function Ap(e,{sourceEvent:t,subject:n,target:r,identifier:s,active:a,x:c,y:u,dx:h,dy:f,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:u,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:f,enumerable:!0,configurable:!0},_:{value:g}})}Ap.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function YE(e){return!e.ctrlKey&&!e.button}function XE(){return this.parentNode}function QE(e,t){return t??{x:e.x,y:e.y}}function JE(){return navigator.maxTouchPoints||"ontouchstart"in this}function qw(){var e=YE,t=XE,n=QE,r=JE,s={},a=Fh("start","drag","end"),c=0,u,h,f,g,y=0;function m(N){N.on("mousedown.drag",w).filter(r).on("touchstart.drag",_).on("touchmove.drag",P,KE).on("touchend.drag touchcancel.drag",O).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(N,J){if(!(g||!e.call(this,N,J))){var ce=R(this,t.call(this,N,J),N,J,"mouse");ce&&(Kn(N.view).on("mousemove.drag",C,Ql).on("mouseup.drag",S,Ql),Uw(N.view),jf(N),f=!1,u=N.clientX,h=N.clientY,ce("start",N))}}function C(N){if(Ia(N),!f){var J=N.clientX-u,ce=N.clientY-h;f=J*J+ce*ce>y}s.mouse("drag",N)}function S(N){Kn(N.view).on("mousemove.drag mouseup.drag",null),Ww(N.view,f),Ia(N),s.mouse("end",N)}function _(N,J){if(e.call(this,N,J)){var ce=N.changedTouches,G=t.call(this,N,J),te=ce.length,D,M;for(D=0;D>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Bu(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Bu(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=eP.exec(e))?new In(t[1],t[2],t[3],1):(t=tP.exec(e))?new In(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=nP.exec(e))?Bu(t[1],t[2],t[3],t[4]):(t=rP.exec(e))?Bu(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=oP.exec(e))?bv(t[1],t[2]/100,t[3]/100,1):(t=iP.exec(e))?bv(t[1],t[2]/100,t[3]/100,t[4]):yv.hasOwnProperty(e)?xv(yv[e]):e==="transparent"?new In(NaN,NaN,NaN,0):null}function xv(e){return new In(e>>16&255,e>>8&255,e&255,1)}function Bu(e,t,n,r){return r<=0&&(e=t=n=NaN),new In(e,t,n,r)}function lP(e){return e instanceof vc||(e=ec(e)),e?(e=e.rgb(),new In(e.r,e.g,e.b,e.opacity)):new In}function Rp(e,t,n,r){return arguments.length===1?lP(e):new In(e,t,n,r??1)}function In(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}mg(In,Rp,Gw(vc,{brighter(e){return e=e==null?vh:Math.pow(vh,e),new In(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Jl:Math.pow(Jl,e),new In(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new In(Ms(this.r),Ms(this.g),Ms(this.b),wh(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:Sv,formatHex:Sv,formatHex8:cP,formatRgb:Cv,toString:Cv}));function Sv(){return`#${Ns(this.r)}${Ns(this.g)}${Ns(this.b)}`}function cP(){return`#${Ns(this.r)}${Ns(this.g)}${Ns(this.b)}${Ns((isNaN(this.opacity)?1:this.opacity)*255)}`}function Cv(){const e=wh(this.opacity);return`${e===1?"rgb(":"rgba("}${Ms(this.r)}, ${Ms(this.g)}, ${Ms(this.b)}${e===1?")":`, ${e})`}`}function wh(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Ms(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Ns(e){return e=Ms(e),(e<16?"0":"")+e.toString(16)}function bv(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Vr(e,t,n,r)}function Kw(e){if(e instanceof Vr)return new Vr(e.h,e.s,e.l,e.opacity);if(e instanceof vc||(e=ec(e)),!e)return new Vr;if(e instanceof Vr)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,s=Math.min(t,n,r),a=Math.max(t,n,r),c=NaN,u=a-s,h=(a+s)/2;return u?(t===a?c=(n-r)/u+(n0&&h<1?0:c,new Vr(c,u,h,e.opacity)}function uP(e,t,n,r){return arguments.length===1?Kw(e):new Vr(e,t,n,r??1)}function Vr(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}mg(Vr,uP,Gw(vc,{brighter(e){return e=e==null?vh:Math.pow(vh,e),new Vr(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Jl:Math.pow(Jl,e),new Vr(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,s=2*n-r;return new In(Bf(e>=240?e-240:e+120,s,r),Bf(e,s,r),Bf(e<120?e+240:e-120,s,r),this.opacity)},clamp(){return new Vr(Ev(this.h),$u(this.s),$u(this.l),wh(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=wh(this.opacity);return`${e===1?"hsl(":"hsla("}${Ev(this.h)}, ${$u(this.s)*100}%, ${$u(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Ev(e){return e=(e||0)%360,e<0?e+360:e}function $u(e){return Math.max(0,Math.min(1,e||0))}function Bf(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const Yw=e=>()=>e;function hP(e,t){return function(n){return e+n*t}}function dP(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function fP(e){return(e=+e)==1?Xw:function(t,n){return n-t?dP(t,n,e):Yw(isNaN(t)?n:t)}}function Xw(e,t){var n=t-e;return n?hP(e,n):Yw(isNaN(e)?t:e)}const Pv=function e(t){var n=fP(t);function r(s,a){var c=n((s=Rp(s)).r,(a=Rp(a)).r),u=n(s.g,a.g),h=n(s.b,a.b),f=Xw(s.opacity,a.opacity);return function(g){return s.r=c(g),s.g=u(g),s.b=h(g),s.opacity=f(g),s+""}}return r.gamma=e,r}(1);function Ni(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var Tp=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,$f=new RegExp(Tp.source,"g");function pP(e){return function(){return e}}function gP(e){return function(t){return e(t)+""}}function mP(e,t){var n=Tp.lastIndex=$f.lastIndex=0,r,s,a,c=-1,u=[],h=[];for(e=e+"",t=t+"";(r=Tp.exec(e))&&(s=$f.exec(t));)(a=s.index)>n&&(a=t.slice(n,a),u[c]?u[c]+=a:u[++c]=a),(r=r[0])===(s=s[0])?u[c]?u[c]+=s:u[++c]=s:(u[++c]=null,h.push({i:c,x:Ni(r,s)})),n=$f.lastIndex;return n180?g+=360:g-f>180&&(f+=360),m.push({i:y.push(s(y)+"rotate(",null,r)-2,x:Ni(f,g)})):g&&y.push(s(y)+"rotate("+g+r)}function u(f,g,y,m){f!==g?m.push({i:y.push(s(y)+"skewX(",null,r)-2,x:Ni(f,g)}):g&&y.push(s(y)+"skewX("+g+r)}function h(f,g,y,m,w,C){if(f!==y||g!==m){var S=w.push(s(w)+"scale(",null,",",null,")");C.push({i:S-4,x:Ni(f,y)},{i:S-2,x:Ni(g,m)})}else(y!==1||m!==1)&&w.push(s(w)+"scale("+y+","+m+")")}return function(f,g){var y=[],m=[];return f=e(f),g=e(g),a(f.translateX,f.translateY,g.translateX,g.translateY,y,m),c(f.rotate,g.rotate,y,m),u(f.skewX,g.skewX,y,m),h(f.scaleX,f.scaleY,g.scaleX,g.scaleY,y,m),f=g=null,function(w){for(var C=-1,S=m.length,_;++C=0&&e._call.call(void 0,t),e=e._next;--Ba}function Rv(){js=(Sh=tc.now())+jh,Ba=Ul=0;try{_P()}finally{Ba=0,RP(),js=0}}function AP(){var e=tc.now(),t=e-Sh;t>Zw&&(jh-=t,Sh=e)}function RP(){for(var e,t=xh,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:xh=n);Wl=e,Op(r)}function Op(e){if(!Ba){Ul&&(Ul=clearTimeout(Ul));var t=e-js;t>24?(e<1/0&&(Ul=setTimeout(Rv,e-tc.now()-jh)),Ol&&(Ol=clearInterval(Ol))):(Ol||(Sh=tc.now(),Ol=setInterval(AP,Zw)),Ba=1,ex(Rv))}}function Tv(e,t,n){var r=new Ch;return t=t==null?0:+t,r.restart(s=>{r.stop(),e(s+t)},t,n),r}var TP=Fh("start","end","cancel","interrupt"),kP=[],nx=0,kv=1,Np=2,sh=3,Ov=4,Dp=5,ah=6;function Bh(e,t,n,r,s,a){var c=e.__transition;if(!c)e.__transition={};else if(n in c)return;OP(e,n,{name:t,index:r,group:s,on:TP,tween:kP,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:nx})}function vg(e,t){var n=Kr(e,t);if(n.state>nx)throw new Error("too late; already scheduled");return n}function mo(e,t){var n=Kr(e,t);if(n.state>sh)throw new Error("too late; already running");return n}function Kr(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function OP(e,t,n){var r=e.__transition,s;r[t]=n,n.timer=tx(a,0,n.time);function a(f){n.state=kv,n.timer.restart(c,n.delay,n.time),n.delay<=f&&c(f-n.delay)}function c(f){var g,y,m,w;if(n.state!==kv)return h();for(g in r)if(w=r[g],w.name===n.name){if(w.state===sh)return Tv(c);w.state===Ov?(w.state=ah,w.timer.stop(),w.on.call("interrupt",e,e.__data__,w.index,w.group),delete r[g]):+gNp&&r.state=0&&(t=t.slice(0,n)),!t||t==="start"})}function a_(e,t,n){var r,s,a=s_(t)?vg:mo;return function(){var c=a(this,e),u=c.on;u!==r&&(s=(r=u).copy()).on(t,n),c.on=s}}function l_(e,t){var n=this._id;return arguments.length<2?Kr(this.node(),n).on.on(e):this.each(a_(n,e,t))}function c_(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function u_(){return this.on("end.remove",c_(this._id))}function h_(e){var t=this._name,n=this._id;typeof e!="function"&&(e=pg(e));for(var r=this._groups,s=r.length,a=new Array(s),c=0;c()=>e;function F_(e,{sourceEvent:t,target:n,transform:r,dispatch:s}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:s}})}function qo(e,t,n){this.k=e,this.x=t,this.y=n}qo.prototype={constructor:qo,scale:function(e){return e===1?this:new qo(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new qo(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var $h=new qo(1,0,0);sx.prototype=qo.prototype;function sx(e){for(;!e.__zoom;)if(!(e=e.parentNode))return $h;return e.__zoom}function Vf(e){e.stopImmediatePropagation()}function Nl(e){e.preventDefault(),e.stopImmediatePropagation()}function L_(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function j_(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function Nv(){return this.__zoom||$h}function B_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function $_(){return navigator.maxTouchPoints||"ontouchstart"in this}function V_(e,t,n){var r=e.invertX(t[0][0])-n[0][0],s=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],c=e.invertY(t[1][1])-n[1][1];return e.translate(s>r?(r+s)/2:Math.min(0,r)||Math.max(0,s),c>a?(a+c)/2:Math.min(0,a)||Math.max(0,c))}function ax(){var e=L_,t=j_,n=V_,r=B_,s=$_,a=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,h=EP,f=Fh("start","zoom","end"),g,y,m,w=500,C=150,S=0,_=10;function P($){$.property("__zoom",Nv).on("wheel.zoom",te,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",M).filter(s).on("touchstart.zoom",z).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}P.transform=function($,F,L,K){var V=$.selection?$.selection():$;V.property("__zoom",Nv),$!==V?J($,F,L,K):V.interrupt().each(function(){ce(this,arguments).event(K).start().zoom(null,typeof F=="function"?F.apply(this,arguments):F).end()})},P.scaleBy=function($,F,L,K){P.scaleTo($,function(){var V=this.__zoom.k,q=typeof F=="function"?F.apply(this,arguments):F;return V*q},L,K)},P.scaleTo=function($,F,L,K){P.transform($,function(){var V=t.apply(this,arguments),q=this.__zoom,Q=L==null?N(V):typeof L=="function"?L.apply(this,arguments):L,W=q.invert(Q),ie=typeof F=="function"?F.apply(this,arguments):F;return n(R(O(q,ie),Q,W),V,c)},L,K)},P.translateBy=function($,F,L,K){P.transform($,function(){return n(this.__zoom.translate(typeof F=="function"?F.apply(this,arguments):F,typeof L=="function"?L.apply(this,arguments):L),t.apply(this,arguments),c)},null,K)},P.translateTo=function($,F,L,K,V){P.transform($,function(){var q=t.apply(this,arguments),Q=this.__zoom,W=K==null?N(q):typeof K=="function"?K.apply(this,arguments):K;return n($h.translate(W[0],W[1]).scale(Q.k).translate(typeof F=="function"?-F.apply(this,arguments):-F,typeof L=="function"?-L.apply(this,arguments):-L),q,c)},K,V)};function O($,F){return F=Math.max(a[0],Math.min(a[1],F)),F===$.k?$:new qo(F,$.x,$.y)}function R($,F,L){var K=F[0]-L[0]*$.k,V=F[1]-L[1]*$.k;return K===$.x&&V===$.y?$:new qo($.k,K,V)}function N($){return[(+$[0][0]+ +$[1][0])/2,(+$[0][1]+ +$[1][1])/2]}function J($,F,L,K){$.on("start.zoom",function(){ce(this,arguments).event(K).start()}).on("interrupt.zoom end.zoom",function(){ce(this,arguments).event(K).end()}).tween("zoom",function(){var V=this,q=arguments,Q=ce(V,q).event(K),W=t.apply(V,q),ie=L==null?N(W):typeof L=="function"?L.apply(V,q):L,be=Math.max(W[1][0]-W[0][0],W[1][1]-W[0][1]),Se=V.__zoom,_e=typeof F=="function"?F.apply(V,q):F,Oe=h(Se.invert(ie).concat(be/Se.k),_e.invert(ie).concat(be/_e.k));return function(Be){if(Be===1)Be=_e;else{var Ae=Oe(Be),Ce=be/Ae[2];Be=new qo(Ce,ie[0]-Ae[0]*Ce,ie[1]-Ae[1]*Ce)}Q.zoom(null,Be)}})}function ce($,F,L){return!L&&$.__zooming||new G($,F)}function G($,F){this.that=$,this.args=F,this.active=0,this.sourceEvent=null,this.extent=t.apply($,F),this.taps=0}G.prototype={event:function($){return $&&(this.sourceEvent=$),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function($,F){return this.mouse&&$!=="mouse"&&(this.mouse[1]=F.invert(this.mouse[0])),this.touch0&&$!=="touch"&&(this.touch0[1]=F.invert(this.touch0[0])),this.touch1&&$!=="touch"&&(this.touch1[1]=F.invert(this.touch1[0])),this.that.__zoom=F,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function($){var F=Kn(this.that).datum();f.call($,this.that,new F_($,{sourceEvent:this.sourceEvent,target:P,transform:this.that.__zoom,dispatch:f}),F)}};function te($,...F){if(!e.apply(this,arguments))return;var L=ce(this,F).event($),K=this.__zoom,V=Math.max(a[0],Math.min(a[1],K.k*Math.pow(2,r.apply(this,arguments)))),q=Br($);if(L.wheel)(L.mouse[0][0]!==q[0]||L.mouse[0][1]!==q[1])&&(L.mouse[1]=K.invert(L.mouse[0]=q)),clearTimeout(L.wheel);else{if(K.k===V)return;L.mouse=[q,K.invert(q)],lh(this),L.start()}Nl($),L.wheel=setTimeout(Q,C),L.zoom("mouse",n(R(O(K,V),L.mouse[0],L.mouse[1]),L.extent,c));function Q(){L.wheel=null,L.end()}}function D($,...F){if(m||!e.apply(this,arguments))return;var L=$.currentTarget,K=ce(this,F,!0).event($),V=Kn($.view).on("mousemove.zoom",ie,!0).on("mouseup.zoom",be,!0),q=Br($,L),Q=$.clientX,W=$.clientY;Uw($.view),Vf($),K.mouse=[q,this.__zoom.invert(q)],lh(this),K.start();function ie(Se){if(Nl(Se),!K.moved){var _e=Se.clientX-Q,Oe=Se.clientY-W;K.moved=_e*_e+Oe*Oe>S}K.event(Se).zoom("mouse",n(R(K.that.__zoom,K.mouse[0]=Br(Se,L),K.mouse[1]),K.extent,c))}function be(Se){V.on("mousemove.zoom mouseup.zoom",null),Ww(Se.view,K.moved),Nl(Se),K.event(Se).end()}}function M($,...F){if(e.apply(this,arguments)){var L=this.__zoom,K=Br($.changedTouches?$.changedTouches[0]:$,this),V=L.invert(K),q=L.k*($.shiftKey?.5:2),Q=n(R(O(L,q),K,V),t.apply(this,F),c);Nl($),u>0?Kn(this).transition().duration(u).call(J,Q,K,$):Kn(this).call(P.transform,Q,K,$)}}function z($,...F){if(e.apply(this,arguments)){var L=$.touches,K=L.length,V=ce(this,F,$.changedTouches.length===K).event($),q,Q,W,ie;for(Vf($),Q=0;Q"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID."},nc=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],lx=["Enter"," ","Escape"];var $a;(function(e){e.Strict="strict",e.Loose="loose"})($a||($a={}));var Is;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Is||(Is={}));var rc;(function(e){e.Partial="partial",e.Full="full"})(rc||(rc={}));const cx={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Di;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Di||(Di={}));var bh;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(bh||(bh={}));var Ke;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ke||(Ke={}));const Dv={[Ke.Left]:Ke.Right,[Ke.Right]:Ke.Left,[Ke.Top]:Ke.Bottom,[Ke.Bottom]:Ke.Top};function z_(e,t){if(!e&&!t)return!0;if(!e||!t||e.size!==t.size)return!1;if(!e.size&&!t.size)return!0;for(const n of e.keys())if(!t.has(n))return!1;return!0}function Mv(e,t,n){if(!n)return;const r=[];e.forEach((s,a)=>{t!=null&&t.has(a)||r.push(s)}),r.length&&n(r)}function ux(e){return e===null?null:e?"valid":"invalid"}const hx=e=>"id"in e&&"source"in e&&"target"in e,H_=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),xg=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),U_=(e,t,n)=>{if(!e.id)return[];const r=new Set;return n.forEach(s=>{s.target===e.id&&r.add(s.source)}),t.filter(s=>r.has(s.id))},wc=(e,t=[0,0])=>{const{width:n,height:r}=Zo(e),s=e.origin??t,a=n*s[0],c=r*s[1];return{x:e.position.x-a,y:e.position.y-c}},W_=(e,t={nodeOrigin:[0,0],nodeLookup:void 0})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,s)=>{const a=typeof s=="string";let c=!t.nodeLookup&&!a?s:void 0;t.nodeLookup&&(c=a?t.nodeLookup.get(s):xg(s)?s:t.nodeLookup.get(s.id));const u=c?Eh(c,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Vh(r,u)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return zh(n)},xc=(e,t={})=>{if(e.size===0)return{x:0,y:0,width:0,height:0};let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0};return e.forEach(r=>{if(t.filter===void 0||t.filter(r)){const s=Eh(r);n=Vh(n,s)}}),zh(n)},dx=(e,t,[n,r,s]=[0,0,1],a=!1,c=!1)=>{const u={...Sc(t,[n,r,s]),width:t.width/s,height:t.height/s},h=[];for(const f of e.values()){const{measured:g,selectable:y=!0,hidden:m=!1}=f;if(c&&!y||m)continue;const w=g.width??f.width??f.initialWidth??null,C=g.height??f.height??f.initialHeight??null,S=oc(u,za(f)),_=(w??0)*(C??0),P=a&&S>0;(!f.internals.handleBounds||P||S>=_||f.dragging)&&h.push(f)}return h},q_=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Mp(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!s.hidden)&&(!r||r.has(s.id))&&n.set(s.id,s)}),n}async function Ip({nodes:e,width:t,height:n,panZoom:r,minZoom:s,maxZoom:a},c){if(e.size===0)return Promise.resolve(!1);const u=xc(e),h=Sg(u,t,n,(c==null?void 0:c.minZoom)??s,(c==null?void 0:c.maxZoom)??a,(c==null?void 0:c.padding)??.1);return await r.setViewport(h,{duration:c==null?void 0:c.duration}),Promise.resolve(!0)}function fx({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:s,onError:a}){const c=n.get(e),u=c.parentId?n.get(c.parentId):void 0,{x:h,y:f}=u?u.internals.positionAbsolute:{x:0,y:0},g=c.origin??r;let y=s;if(c.extent==="parent"&&!c.expandParent)if(!u)a==null||a("005",yo.error005());else{const w=u.measured.width,C=u.measured.height;w&&C&&(y=[[h,f],[h+w,f+C]])}else u&&Ha(c.extent)&&(y=[[c.extent[0][0]+h,c.extent[0][1]+f],[c.extent[1][0]+h,c.extent[1][1]+f]]);const m=Ha(y)?Bs(t,y,c.measured):t;return{position:{x:m.x-h+c.measured.width*g[0],y:m.y-f+c.measured.height*g[1]},positionAbsolute:m}}async function G_({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:s}){const a=new Set(e.map(m=>m.id)),c=[];for(const m of n){if(m.deletable===!1)continue;const w=a.has(m.id),C=!w&&m.parentId&&c.find(S=>S.id===m.parentId);(w||C)&&c.push(m)}const u=new Set(t.map(m=>m.id)),h=r.filter(m=>m.deletable!==!1),g=q_(c,h);for(const m of h)u.has(m.id)&&!g.find(C=>C.id===m.id)&&g.push(m);if(!s)return{edges:g,nodes:c};const y=await s({nodes:c,edges:g});return typeof y=="boolean"?y?{edges:g,nodes:c}:{edges:[],nodes:[]}:y}const Va=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Bs=(e={x:0,y:0},t,n)=>({x:Va(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Va(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function px(e,t,n){const{width:r,height:s}=Zo(n),{x:a,y:c}=n.internals.positionAbsolute;return Bs(e,[[a,c],[a+r,c+s]],t)}const Iv=(e,t,n)=>en?-Va(Math.abs(e-n),1,t)/t:0,gx=(e,t,n=15,r=40)=>{const s=Iv(e.x,r,t.width-r)*n,a=Iv(e.y,r,t.height-r)*n;return[s,a]},Vh=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Fp=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),zh=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),za=(e,t=[0,0])=>{var s,a;const{x:n,y:r}=xg(e)?e.internals.positionAbsolute:wc(e,t);return{x:n,y:r,width:((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0,height:((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0}},Eh=(e,t=[0,0])=>{var s,a;const{x:n,y:r}=xg(e)?e.internals.positionAbsolute:wc(e,t);return{x:n,y:r,x2:n+(((s=e.measured)==null?void 0:s.width)??e.width??e.initialWidth??0),y2:r+(((a=e.measured)==null?void 0:a.height)??e.height??e.initialHeight??0)}},mx=(e,t)=>zh(Vh(Fp(e),Fp(t))),oc=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Fv=e=>Ur(e.width)&&Ur(e.height)&&Ur(e.x)&&Ur(e.y),Ur=e=>!isNaN(e)&&isFinite(e),K_=(e,t)=>{},Hh=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Sc=({x:e,y:t},[n,r,s],a=!1,c=[1,1])=>{const u={x:(e-n)/s,y:(t-r)/s};return a?Hh(u,c):u},yx=({x:e,y:t},[n,r,s])=>({x:e*s+n,y:t*s+r}),Sg=(e,t,n,r,s,a)=>{const c=t/(e.width*(1+a)),u=n/(e.height*(1+a)),h=Math.min(c,u),f=Va(h,r,s),g=e.x+e.width/2,y=e.y+e.height/2,m=t/2-g*f,w=n/2-y*f;return{x:m,y:w,zoom:f}},Ph=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function Ha(e){return e!==void 0&&e!=="parent"}function Zo(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function vx(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function wx(e,t={width:0,height:0},n,r,s){const a={...e},c=r.get(n);if(c){const u=c.origin||s;a.x+=c.internals.positionAbsolute.x-(t.width??0)*u[0],a.y+=c.internals.positionAbsolute.y-(t.height??0)*u[1]}return a}function Lv(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Gl(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:s}){const{x:a,y:c}=Ko(e),u=Sc({x:a-((s==null?void 0:s.left)??0),y:c-((s==null?void 0:s.top)??0)},r),{x:h,y:f}=n?Hh(u,t):u;return{xSnapped:h,ySnapped:f,...u}}const Uh=e=>({width:e.offsetWidth,height:e.offsetHeight}),xx=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Y_=["INPUT","SELECT","TEXTAREA"];function Lp(e){var r,s;const t=((s=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:s[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Y_.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Sx=e=>"clientX"in e,Ko=(e,t)=>{var a,c;const n=Sx(e),r=n?e.clientX:(a=e.touches)==null?void 0:a[0].clientX,s=n?e.clientY:(c=e.touches)==null?void 0:c[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:s-((t==null?void 0:t.top)??0)}},jv=(e,t,n,r,s)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(c=>{const u=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:e,nodeId:s,position:c.getAttribute("data-handlepos"),x:(u.left-n.left)/r,y:(u.top-n.top)/r,...Uh(c)}})};function Cx({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:c,targetControlY:u}){const h=e*.125+s*.375+c*.375+n*.125,f=t*.125+a*.375+u*.375+r*.125,g=Math.abs(h-e),y=Math.abs(f-t);return[h,f,g,y]}function Hu(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Bv({pos:e,x1:t,y1:n,x2:r,y2:s,c:a}){switch(e){case Ke.Left:return[t-Hu(t-r,a),n];case Ke.Right:return[t+Hu(r-t,a),n];case Ke.Top:return[t,n-Hu(n-s,a)];case Ke.Bottom:return[t,n+Hu(s-n,a)]}}function bx({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:r,targetY:s,targetPosition:a=Ke.Top,curvature:c=.25}){const[u,h]=Bv({pos:n,x1:e,y1:t,x2:r,y2:s,c}),[f,g]=Bv({pos:a,x1:r,y1:s,x2:e,y2:t,c}),[y,m,w,C]=Cx({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:u,sourceControlY:h,targetControlX:f,targetControlY:g});return[`M${e},${t} C${u},${h} ${f},${g} ${r},${s}`,y,m,w,C]}function Ex({sourceX:e,sourceY:t,targetX:n,targetY:r}){const s=Math.abs(n-e)/2,a=n0}const J_=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Z_=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),jp=(e,t)=>{if(!e.source||!e.target)return t;let n;return hx(e)?n={...e}:n={...e,id:J_(e)},Z_(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function Px({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[s,a,c,u]=Ex({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,s,a,c,u]}const $v={[Ke.Left]:{x:-1,y:0},[Ke.Right]:{x:1,y:0},[Ke.Top]:{x:0,y:-1},[Ke.Bottom]:{x:0,y:1}},eA=({source:e,sourcePosition:t=Ke.Bottom,target:n})=>t===Ke.Left||t===Ke.Right?e.xMath.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function tA({source:e,sourcePosition:t=Ke.Bottom,target:n,targetPosition:r=Ke.Top,center:s,offset:a}){const c=$v[t],u=$v[r],h={x:e.x+c.x*a,y:e.y+c.y*a},f={x:n.x+u.x*a,y:n.y+u.y*a},g=eA({source:h,sourcePosition:t,target:f}),y=g.x!==0?"x":"y",m=g[y];let w=[],C,S;const _={x:0,y:0},P={x:0,y:0},[O,R,N,J]=Ex({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[y]*u[y]===-1){C=s.x??O,S=s.y??R;const G=[{x:C,y:h.y},{x:C,y:f.y}],te=[{x:h.x,y:S},{x:f.x,y:S}];c[y]===m?w=y==="x"?G:te:w=y==="x"?te:G}else{const G=[{x:h.x,y:f.y}],te=[{x:f.x,y:h.y}];if(y==="x"?w=c.x===m?te:G:w=c.y===m?G:te,t===r){const Y=Math.abs(e[y]-n[y]);if(Y<=a){const $=Math.min(a-1,a-Y);c[y]===m?_[y]=(h[y]>e[y]?-1:1)*$:P[y]=(f[y]>n[y]?-1:1)*$}}if(t!==r){const Y=y==="x"?"y":"x",$=c[y]===u[Y],F=h[Y]>f[Y],L=h[Y]=U?(C=(D.x+M.x)/2,S=w[0].y):(C=w[0].x,S=(D.y+M.y)/2)}return[[e,{x:h.x+_.x,y:h.y+_.y},...w,{x:f.x+P.x,y:f.y+P.y},n],C,S,N,J]}function nA(e,t,n,r){const s=Math.min(Vv(e,t)/2,Vv(t,n)/2,r),{x:a,y:c}=t;if(e.x===a&&a===n.x||e.y===c&&c===n.y)return`L${a} ${c}`;if(e.y===c){const f=e.x{let R="";return O>0&&On.id===t):e[0])||null}function $p(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function oA(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:s}){const a=new Set;return e.reduce((c,u)=>([u.markerStart||r,u.markerEnd||s].forEach(h=>{if(h&&typeof h=="object"){const f=$p(h,t);a.has(f)||(c.push({id:f,color:h.color||n,...h}),a.add(f))}}),c),[]).sort((c,u)=>c.id.localeCompare(u.id))}const Cg={nodeOrigin:[0,0],nodeExtent:nc,elevateNodesOnSelect:!0,defaults:{}},iA={...Cg,checkEquality:!0};function bg(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function sA(e,t,n){const r=bg(Cg,n);for(const s of e.values())if(s.parentId)Eg(s,e,t,r);else{const a=wc(s,r.nodeOrigin),c=Ha(s.extent)?s.extent:r.nodeExtent,u=Bs(a,c,Zo(s));s.internals.positionAbsolute=u}}function Vp(e,t,n,r){var u,h;const s=bg(iA,r),a=new Map(t),c=s!=null&&s.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const f of e){let g=a.get(f.id);if(s.checkEquality&&f===(g==null?void 0:g.internals.userNode))t.set(f.id,g);else{const y=wc(f,s.nodeOrigin),m=Ha(f.extent)?f.extent:s.nodeExtent,w=Bs(y,m,Zo(f));g={...s.defaults,...f,measured:{width:(u=f.measured)==null?void 0:u.width,height:(h=f.measured)==null?void 0:h.height},internals:{positionAbsolute:w,handleBounds:f.measured?g==null?void 0:g.internals.handleBounds:void 0,z:_x(f,c),userNode:f}},t.set(f.id,g)}f.parentId&&Eg(g,t,n,r)}}function aA(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Eg(e,t,n,r){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:c}=bg(Cg,r),u=e.parentId,h=t.get(u);if(!h){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}aA(e,n);const f=s?1e3:0,{x:g,y,z:m}=lA(e,h,a,c,f),{positionAbsolute:w}=e.internals,C=g!==w.x||y!==w.y;(C||m!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:C?{x:g,y}:w,z:m}})}function _x(e,t){return(Ur(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function lA(e,t,n,r,s){const{x:a,y:c}=t.internals.positionAbsolute,u=Zo(e),h=wc(e,n),f=Ha(e.extent)?Bs(h,e.extent,u):h;let g=Bs({x:a+f.x,y:c+f.y},r,u);e.extent==="parent"&&(g=px(g,u,t));const y=_x(e,s),m=t.internals.z??0;return{x:g.x,y:g.y,z:m>y?m:y}}function Pg(e,t,n,r=[0,0]){var c;const s=[],a=new Map;for(const u of e){const h=t.get(u.parentId);if(!h)continue;const f=((c=a.get(u.parentId))==null?void 0:c.expandedRect)??za(h),g=mx(f,u.rect);a.set(u.parentId,{expandedRect:g,parent:h})}return a.size>0&&a.forEach(({expandedRect:u,parent:h},f)=>{var R;const g=h.internals.positionAbsolute,y=Zo(h),m=h.origin??r,w=u.x0||C>0||P||O)&&(s.push({id:f,type:"position",position:{x:h.position.x-w+P,y:h.position.y-C+O}}),(R=n.get(f))==null||R.forEach(N=>{e.some(J=>J.id===N.id)||s.push({id:N.id,type:"position",position:{x:N.position.x+w,y:N.position.y+C}})})),(y.width0){const m=Pg(y,t,n,s);h.push(...m)}return{changes:h,updatedInternals:u}}async function uA({delta:e,panZoom:t,transform:n,translateExtent:r,width:s,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const c=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,a]],r),u=!!c&&(c.x!==n[0]||c.y!==n[1]||c.k!==n[2]);return Promise.resolve(u)}function Wv(e,t,n,r,s,a){let c=s;const u=r.get(c)||new Map;r.set(c,u.set(n,t)),c=`${s}-${e}`;const h=r.get(c)||new Map;if(r.set(c,h.set(n,t)),a){c=`${s}-${e}-${a}`;const f=r.get(c)||new Map;r.set(c,f.set(n,t))}}function Ax(e,t,n){e.clear(),t.clear();for(const r of n){const{source:s,target:a,sourceHandle:c=null,targetHandle:u=null}=r,h={edgeId:r.id,source:s,target:a,sourceHandle:c,targetHandle:u},f=`${s}-${c}--${a}-${u}`,g=`${a}-${u}--${s}-${c}`;Wv("source",h,g,e,s,c),Wv("target",h,f,e,a,u),t.set(r.id,r)}}function Rx(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Rx(n,t):!1}function qv(e,t,n){var s;let r=e;do{if((s=r==null?void 0:r.matches)!=null&&s.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function hA(e,t,n,r){const s=new Map;for(const[a,c]of e)if((c.selected||c.id===r)&&(!c.parentId||!Rx(c,e))&&(c.draggable||t&&typeof c.draggable>"u")){const u=e.get(a);u&&s.set(a,{id:a,position:u.position||{x:0,y:0},distance:{x:n.x-u.internals.positionAbsolute.x,y:n.y-u.internals.positionAbsolute.y},extent:u.extent,parentId:u.parentId,origin:u.origin,expandParent:u.expandParent,internals:{positionAbsolute:u.internals.positionAbsolute||{x:0,y:0}},measured:{width:u.measured.width??0,height:u.measured.height??0}})}return s}function zf({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var c,u,h;const s=[];for(const[f,g]of t){const y=(c=n.get(f))==null?void 0:c.internals.userNode;y&&s.push({...y,position:g.position,dragging:r})}if(!e)return[s[0],s];const a=(u=n.get(e))==null?void 0:u.internals.userNode;return[a?{...a,position:((h=t.get(e))==null?void 0:h.position)||a.position,dragging:r}:s[0],s]}function dA({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:s}){let a={x:null,y:null},c=0,u=new Map,h=!1,f={x:0,y:0},g=null,y=!1,m=null,w=!1;function C({noDragClassName:_,handleSelector:P,domNode:O,isSelectable:R,nodeId:N,nodeClickDistance:J=0}){m=Kn(O);function ce({x:M,y:z},U){const{nodeLookup:Y,nodeExtent:$,snapGrid:F,snapToGrid:L,nodeOrigin:K,onNodeDrag:V,onSelectionDrag:q,onError:Q,updateNodePositions:W}=t();a={x:M,y:z};let ie=!1,be={x:0,y:0,x2:0,y2:0};if(u.size>1&&$){const Se=xc(u);be=Fp(Se)}for(const[Se,_e]of u){if(!Y.has(Se))continue;let Oe={x:M-_e.distance.x,y:z-_e.distance.y};L&&(Oe=Hh(Oe,F));let Be=[[$[0][0],$[0][1]],[$[1][0],$[1][1]]];if(u.size>1&&$&&!_e.extent){const{positionAbsolute:Qe}=_e.internals,tt=Qe.x-be.x+$[0][0],Fe=Qe.x+_e.measured.width-be.x2+$[1][0],it=Qe.y-be.y+$[0][1],gt=Qe.y+_e.measured.height-be.y2+$[1][1];Be=[[tt,it],[Fe,gt]]}const{position:Ae,positionAbsolute:Ce}=fx({nodeId:Se,nextPosition:Oe,nodeLookup:Y,nodeExtent:Be,nodeOrigin:K,onError:Q});ie=ie||_e.position.x!==Ae.x||_e.position.y!==Ae.y,_e.position=Ae,_e.internals.positionAbsolute=Ce}if(ie&&(W(u,!0),U&&(r||V||!N&&q))){const[Se,_e]=zf({nodeId:N,dragItems:u,nodeLookup:Y});r==null||r(U,u,Se,_e),V==null||V(U,Se,_e),N||q==null||q(U,_e)}}async function G(){if(!g)return;const{transform:M,panBy:z,autoPanSpeed:U}=t(),[Y,$]=gx(f,g,U);(Y!==0||$!==0)&&(a.x=(a.x??0)-Y/M[2],a.y=(a.y??0)-$/M[2],await z({x:Y,y:$})&&ce(a,null)),c=requestAnimationFrame(G)}function te(M){var ie;const{nodeLookup:z,multiSelectionActive:U,nodesDraggable:Y,transform:$,snapGrid:F,snapToGrid:L,selectNodesOnDrag:K,onNodeDragStart:V,onSelectionDragStart:q,unselectNodesAndEdges:Q}=t();y=!0,(!K||!R)&&!U&&N&&((ie=z.get(N))!=null&&ie.selected||Q()),R&&K&&N&&(e==null||e(N));const W=Gl(M.sourceEvent,{transform:$,snapGrid:F,snapToGrid:L,containerBounds:g});if(a=W,u=hA(z,Y,W,N),u.size>0&&(n||V||!N&&q)){const[be,Se]=zf({nodeId:N,dragItems:u,nodeLookup:z});n==null||n(M.sourceEvent,u,be,Se),V==null||V(M.sourceEvent,be,Se),N||q==null||q(M.sourceEvent,Se)}}const D=qw().clickDistance(J).on("start",M=>{const{domNode:z,nodeDragThreshold:U,transform:Y,snapGrid:$,snapToGrid:F}=t();g=(z==null?void 0:z.getBoundingClientRect())||null,w=!1,U===0&&te(M),a=Gl(M.sourceEvent,{transform:Y,snapGrid:$,snapToGrid:F,containerBounds:g}),f=Ko(M.sourceEvent,g)}).on("drag",M=>{const{autoPanOnNodeDrag:z,transform:U,snapGrid:Y,snapToGrid:$,nodeDragThreshold:F,nodeLookup:L}=t(),K=Gl(M.sourceEvent,{transform:U,snapGrid:Y,snapToGrid:$,containerBounds:g});if((M.sourceEvent.type==="touchmove"&&M.sourceEvent.touches.length>1||N&&!L.has(N))&&(w=!0),!w){if(!h&&z&&y&&(h=!0,G()),!y){const V=K.xSnapped-(a.x??0),q=K.ySnapped-(a.y??0);Math.sqrt(V*V+q*q)>F&&te(M)}(a.x!==K.xSnapped||a.y!==K.ySnapped)&&u&&y&&(f=Ko(M.sourceEvent,g),ce(K,M.sourceEvent))}}).on("end",M=>{if(!(!y||w)&&(h=!1,y=!1,cancelAnimationFrame(c),u.size>0)){const{nodeLookup:z,updateNodePositions:U,onNodeDragStop:Y,onSelectionDragStop:$}=t();if(U(u,!1),s||Y||!N&&$){const[F,L]=zf({nodeId:N,dragItems:u,nodeLookup:z,dragging:!1});s==null||s(M.sourceEvent,u,F,L),Y==null||Y(M.sourceEvent,F,L),N||$==null||$(M.sourceEvent,L)}}}).filter(M=>{const z=M.target;return!M.button&&(!_||!qv(z,`.${_}`,O))&&(!P||qv(z,P,O))});m.call(D)}function S(){m==null||m.on(".drag",null)}return{update:C,destroy:S}}function fA(e,t,n){const r=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())oc(s,za(a))>0&&r.push(a);return r}const pA=250;function gA(e,t,n,r){var u,h;let s=[],a=1/0;const c=fA(e,n,t+pA);for(const f of c){const g=[...((u=f.internals.handleBounds)==null?void 0:u.source)??[],...((h=f.internals.handleBounds)==null?void 0:h.target)??[]];for(const y of g){if(r.nodeId===y.nodeId&&r.type===y.type&&r.id===y.id)continue;const{x:m,y:w}=ic(f,y,y.position,!0),C=Math.sqrt(Math.pow(m-e.x,2)+Math.pow(w-e.y,2));C>t||(C1){const f=r.type==="source"?"target":"source";return s.find(g=>g.type===f)??s[0]}return s[0]}function Tx(e,t,n,r,s,a=!1){var f,g,y;const c=r.get(e);if(!c)return null;const u=s==="strict"?(f=c.internals.handleBounds)==null?void 0:f[t]:[...((g=c.internals.handleBounds)==null?void 0:g.source)??[],...((y=c.internals.handleBounds)==null?void 0:y.target)??[]],h=(n?u==null?void 0:u.find(m=>m.id===n):u==null?void 0:u[0])??null;return h&&a?{...h,...ic(c,h,h.position,!0)}:h}function kx(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function mA(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Ox=()=>!0;function yA(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:s,edgeUpdaterType:a,isTarget:c,domNode:u,nodeLookup:h,lib:f,autoPanOnConnect:g,flowId:y,panBy:m,cancelConnection:w,onConnectStart:C,onConnect:S,onConnectEnd:_,isValidConnection:P=Ox,onReconnectEnd:O,updateConnection:R,getTransform:N,getFromHandle:J,autoPanSpeed:ce}){const G=xx(e.target);let te=0,D;const{x:M,y:z}=Ko(e),U=G==null?void 0:G.elementFromPoint(M,z),Y=kx(a,U),$=u==null?void 0:u.getBoundingClientRect();if(!$||!Y)return;const F=Tx(s,Y,r,h,t);if(!F)return;let L=Ko(e,$),K=!1,V=null,q=!1,Q=null;function W(){if(!g||!$)return;const[Ce,Qe]=gx(L,$,ce);m({x:Ce,y:Qe}),te=requestAnimationFrame(W)}const ie={...F,nodeId:s,type:Y,position:F.position},be=h.get(s),_e={inProgress:!0,isValid:null,from:ic(be,ie,Ke.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:be,to:L,toHandle:null,toPosition:Dv[ie.position],toNode:null};R(_e);let Oe=_e;C==null||C(e,{nodeId:s,handleId:r,handleType:Y});function Be(Ce){if(!J()||!ie){Ae(Ce);return}const Qe=N();L=Ko(Ce,$),D=gA(Sc(L,Qe,!1,[1,1]),n,h,ie),K||(W(),K=!0);const tt=Nx(Ce,{handle:D,connectionMode:t,fromNodeId:s,fromHandleId:r,fromType:c?"target":"source",isValidConnection:P,doc:G,lib:f,flowId:y,nodeLookup:h});Q=tt.handleDomNode,V=tt.connection,q=mA(!!D,tt.isValid);const Fe={...Oe,isValid:q,to:D&&q?yx({x:D.x,y:D.y},Qe):L,toHandle:tt.toHandle,toPosition:q&&tt.toHandle?tt.toHandle.position:Dv[ie.position],toNode:tt.toHandle?h.get(tt.toHandle.nodeId):null};q&&D&&Oe.toHandle&&Fe.toHandle&&Oe.toHandle.type===Fe.toHandle.type&&Oe.toHandle.nodeId===Fe.toHandle.nodeId&&Oe.toHandle.id===Fe.toHandle.id&&Oe.to.x===Fe.to.x&&Oe.to.y===Fe.to.y||(R(Fe),Oe=Fe)}function Ae(Ce){(D||Q)&&V&&q&&(S==null||S(V));const{inProgress:Qe,...tt}=Oe,Fe={...tt,toPosition:Oe.toHandle?Oe.toPosition:null};_==null||_(Ce,Fe),a&&(O==null||O(Ce,Fe)),w(),cancelAnimationFrame(te),K=!1,q=!1,V=null,Q=null,G.removeEventListener("mousemove",Be),G.removeEventListener("mouseup",Ae),G.removeEventListener("touchmove",Be),G.removeEventListener("touchend",Ae)}G.addEventListener("mousemove",Be),G.addEventListener("mouseup",Ae),G.addEventListener("touchmove",Be),G.addEventListener("touchend",Ae)}function Nx(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:s,fromType:a,doc:c,lib:u,flowId:h,isValidConnection:f=Ox,nodeLookup:g}){const y=a==="target",m=t?c.querySelector(`.${u}-flow__handle[data-id="${h}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:w,y:C}=Ko(e),S=c.elementFromPoint(w,C),_=S!=null&&S.classList.contains(`${u}-flow__handle`)?S:m,P={handleDomNode:_,isValid:!1,connection:null,toHandle:null};if(_){const O=kx(void 0,_),R=_.getAttribute("data-nodeid"),N=_.getAttribute("data-handleid"),J=_.classList.contains("connectable"),ce=_.classList.contains("connectableend");if(!R||!O)return P;const G={source:y?R:r,sourceHandle:y?N:s,target:y?r:R,targetHandle:y?s:N};P.connection=G;const D=J&&ce&&(n===$a.Strict?y&&O==="source"||!y&&O==="target":R!==r||N!==s);P.isValid=D&&f(G),P.toHandle=Tx(R,O,N,g,n,!1)}return P}const zp={onPointerDown:yA,isValid:Nx};function vA({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const s=Kn(e);function a({translateExtent:u,width:h,height:f,zoomStep:g=10,pannable:y=!0,zoomable:m=!0,inversePan:w=!1}){const C=R=>{const N=n();if(R.sourceEvent.type!=="wheel"||!t)return;const J=-R.sourceEvent.deltaY*(R.sourceEvent.deltaMode===1?.05:R.sourceEvent.deltaMode?1:.002)*g,ce=N[2]*Math.pow(2,J);t.scaleTo(ce)};let S=[0,0];const _=R=>{(R.sourceEvent.type==="mousedown"||R.sourceEvent.type==="touchstart")&&(S=[R.sourceEvent.clientX??R.sourceEvent.touches[0].clientX,R.sourceEvent.clientY??R.sourceEvent.touches[0].clientY])},P=R=>{const N=n();if(R.sourceEvent.type!=="mousemove"&&R.sourceEvent.type!=="touchmove"||!t)return;const J=[R.sourceEvent.clientX??R.sourceEvent.touches[0].clientX,R.sourceEvent.clientY??R.sourceEvent.touches[0].clientY],ce=[J[0]-S[0],J[1]-S[1]];S=J;const G=r()*Math.max(N[2],Math.log(N[2]))*(w?-1:1),te={x:N[0]-ce[0]*G,y:N[1]-ce[1]*G},D=[[0,0],[h,f]];t.setViewportConstrained({x:te.x,y:te.y,zoom:N[2]},D,u)},O=ax().on("start",_).on("zoom",y?P:null).on("zoom.wheel",m?C:null);s.call(O,{})}function c(){s.on("zoom",null)}return{update:a,destroy:c,pointer:Br}}const wA=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Wh=e=>({x:e.x,y:e.y,zoom:e.k}),Hf=({x:e,y:t,zoom:n})=>$h.translate(e,t).scale(n),Da=(e,t)=>e.target.closest(`.${t}`),Dx=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),Uf=(e,t=0,n=()=>{})=>{const r=typeof t=="number"&&t>0;return r||n(),r?e.transition().duration(t).on("end",n):e},Mx=e=>{const t=e.ctrlKey&&Ph()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function xA({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:s,panOnScrollSpeed:a,zoomOnPinch:c,onPanZoomStart:u,onPanZoom:h,onPanZoomEnd:f}){return g=>{if(Da(g,t))return!1;g.preventDefault(),g.stopImmediatePropagation();const y=n.property("__zoom").k||1;if(g.ctrlKey&&c){const _=Br(g),P=Mx(g),O=y*Math.pow(2,P);r.scaleTo(n,O,_,g);return}const m=g.deltaMode===1?20:1;let w=s===Is.Vertical?0:g.deltaX*m,C=s===Is.Horizontal?0:g.deltaY*m;!Ph()&&g.shiftKey&&s!==Is.Vertical&&(w=g.deltaY*m,C=0),r.translateBy(n,-(w/y)*a,-(C/y)*a,{internal:!0});const S=Wh(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,u==null||u(g,S)),e.isPanScrolling&&(h==null||h(g,S),e.panScrollTimeout=setTimeout(()=>{f==null||f(g,S),e.isPanScrolling=!1},150))}}function SA({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,s){if(!t&&r.type==="wheel"&&!r.ctrlKey||Da(r,e))return null;r.preventDefault(),n.call(this,r,s)}}function CA({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var a,c,u;if((a=r.sourceEvent)!=null&&a.internal)return;const s=Wh(r.transform);e.mouseButton=((c=r.sourceEvent)==null?void 0:c.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=s,((u=r.sourceEvent)==null?void 0:u.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,s))}}function bA({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:s}){return a=>{var c,u;e.usedRightMouseButton=!!(n&&Dx(t,e.mouseButton??0)),(c=a.sourceEvent)!=null&&c.sync||r([a.transform.x,a.transform.y,a.transform.k]),s&&!((u=a.sourceEvent)!=null&&u.internal)&&(s==null||s(a.sourceEvent,Wh(a.transform)))}}function EA({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:s,onPaneContextMenu:a}){return c=>{var u;if(!((u=c.sourceEvent)!=null&&u.internal)&&(e.isZoomingOrPanning=!1,a&&Dx(t,e.mouseButton??0)&&!e.usedRightMouseButton&&c.sourceEvent&&a(c.sourceEvent),e.usedRightMouseButton=!1,r(!1),s&&wA(e.prevViewport,c.transform))){const h=Wh(c.transform);e.prevViewport=h,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s==null||s(c.sourceEvent,h)},n?150:0)}}}function PA({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:s,zoomOnDoubleClick:a,userSelectionActive:c,noWheelClassName:u,noPanClassName:h,lib:f}){return g=>{var C;const y=e||t,m=n&&g.ctrlKey;if(g.button===1&&g.type==="mousedown"&&(Da(g,`${f}-flow__node`)||Da(g,`${f}-flow__edge`)))return!0;if(!r&&!y&&!s&&!a&&!n||c||Da(g,u)&&g.type==="wheel"||Da(g,h)&&(g.type!=="wheel"||s&&g.type==="wheel"&&!e)||!n&&g.ctrlKey&&g.type==="wheel")return!1;if(!n&&g.type==="touchstart"&&((C=g.touches)==null?void 0:C.length)>1)return g.preventDefault(),!1;if(!y&&!s&&!m&&g.type==="wheel"||!r&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(r)&&!r.includes(g.button)&&g.type==="mousedown")return!1;const w=Array.isArray(r)&&r.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||g.type==="wheel")&&w}}function _A({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:r,translateExtent:s,viewport:a,onPanZoom:c,onPanZoomStart:u,onPanZoomEnd:h,onDraggingChange:f}){const g={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},y=e.getBoundingClientRect(),m=ax().clickDistance(!Ur(r)||r<0?0:r).scaleExtent([t,n]).translateExtent(s),w=Kn(e).call(m);R({x:a.x,y:a.y,zoom:Va(a.zoom,t,n)},[[0,0],[y.width,y.height]],s);const C=w.on("wheel.zoom"),S=w.on("dblclick.zoom");m.wheelDelta(Mx);function _(U,Y){return w?new Promise($=>{m==null||m.transform(Uf(w,Y==null?void 0:Y.duration,()=>$(!0)),U)}):Promise.resolve(!1)}function P({noWheelClassName:U,noPanClassName:Y,onPaneContextMenu:$,userSelectionActive:F,panOnScroll:L,panOnDrag:K,panOnScrollMode:V,panOnScrollSpeed:q,preventScrolling:Q,zoomOnPinch:W,zoomOnScroll:ie,zoomOnDoubleClick:be,zoomActivationKeyPressed:Se,lib:_e,onTransformChange:Oe}){F&&!g.isZoomingOrPanning&&O();const Ae=L&&!Se&&!F?xA({zoomPanValues:g,noWheelClassName:U,d3Selection:w,d3Zoom:m,panOnScrollMode:V,panOnScrollSpeed:q,zoomOnPinch:W,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:h}):SA({noWheelClassName:U,preventScrolling:Q,d3ZoomHandler:C});if(w.on("wheel.zoom",Ae,{passive:!1}),!F){const Qe=CA({zoomPanValues:g,onDraggingChange:f,onPanZoomStart:u});m.on("start",Qe);const tt=bA({zoomPanValues:g,panOnDrag:K,onPaneContextMenu:!!$,onPanZoom:c,onTransformChange:Oe});m.on("zoom",tt);const Fe=EA({zoomPanValues:g,panOnDrag:K,panOnScroll:L,onPaneContextMenu:$,onPanZoomEnd:h,onDraggingChange:f});m.on("end",Fe)}const Ce=PA({zoomActivationKeyPressed:Se,panOnDrag:K,zoomOnScroll:ie,panOnScroll:L,zoomOnDoubleClick:be,zoomOnPinch:W,userSelectionActive:F,noPanClassName:Y,noWheelClassName:U,lib:_e});m.filter(Ce),be?w.on("dblclick.zoom",S):w.on("dblclick.zoom",null)}function O(){m.on("zoom",null)}async function R(U,Y,$){const F=Hf(U),L=m==null?void 0:m.constrain()(F,Y,$);return L&&await _(L),new Promise(K=>K(L))}async function N(U,Y){const $=Hf(U);return await _($,Y),new Promise(F=>F($))}function J(U){if(w){const Y=Hf(U),$=w.property("__zoom");($.k!==U.zoom||$.x!==U.x||$.y!==U.y)&&(m==null||m.transform(w,Y,null,{sync:!0}))}}function ce(){const U=w?sx(w.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function G(U,Y){return w?new Promise($=>{m==null||m.scaleTo(Uf(w,Y==null?void 0:Y.duration,()=>$(!0)),U)}):Promise.resolve(!1)}function te(U,Y){return w?new Promise($=>{m==null||m.scaleBy(Uf(w,Y==null?void 0:Y.duration,()=>$(!0)),U)}):Promise.resolve(!1)}function D(U){m==null||m.scaleExtent(U)}function M(U){m==null||m.translateExtent(U)}function z(U){const Y=!Ur(U)||U<0?0:U;m==null||m.clickDistance(Y)}return{update:P,destroy:O,setViewport:N,setViewportConstrained:R,getViewport:ce,scaleTo:G,scaleBy:te,setScaleExtent:D,setTranslateExtent:M,syncViewport:J,setClickDistance:z}}var Kl;(function(e){e.Line="line",e.Handle="handle"})(Kl||(Kl={}));function AA({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:s,affectsY:a}){const c=e-t,u=n-r,h=[c>0?1:c<0?-1:0,u>0?1:u<0?-1:0];return c&&s&&(h[0]=h[0]*-1),u&&a&&(h[1]=h[1]*-1),h}function RA(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:s}}function Ti(e,t){return Math.max(0,t-e)}function ki(e,t){return Math.max(0,e-t)}function Uu(e,t,n){return Math.max(0,t-e,e-n)}function Gv(e,t){return e?!t:t}function TA(e,t,n,r,s,a,c,u){let{affectsX:h,affectsY:f}=t;const{isHorizontal:g,isVertical:y}=t,m=g&&y,{xSnapped:w,ySnapped:C}=n,{minWidth:S,maxWidth:_,minHeight:P,maxHeight:O}=r,{x:R,y:N,width:J,height:ce,aspectRatio:G}=e;let te=Math.floor(g?w-e.pointerX:0),D=Math.floor(y?C-e.pointerY:0);const M=J+(h?-te:te),z=ce+(f?-D:D),U=-a[0]*J,Y=-a[1]*ce;let $=Uu(M,S,_),F=Uu(z,P,O);if(c){let V=0,q=0;h&&te<0?V=Ti(R+te+U,c[0][0]):!h&&te>0&&(V=ki(R+M+U,c[1][0])),f&&D<0?q=Ti(N+D+Y,c[0][1]):!f&&D>0&&(q=ki(N+z+Y,c[1][1])),$=Math.max($,V),F=Math.max(F,q)}if(u){let V=0,q=0;h&&te>0?V=ki(R+te,u[0][0]):!h&&te<0&&(V=Ti(R+M,u[1][0])),f&&D>0?q=ki(N+D,u[0][1]):!f&&D<0&&(q=Ti(N+z,u[1][1])),$=Math.max($,V),F=Math.max(F,q)}if(s){if(g){const V=Uu(M/G,P,O)*G;if($=Math.max($,V),c){let q=0;!h&&!f||h&&!f&&m?q=ki(N+Y+M/G,c[1][1])*G:q=Ti(N+Y+(h?te:-te)/G,c[0][1])*G,$=Math.max($,q)}if(u){let q=0;!h&&!f||h&&!f&&m?q=Ti(N+M/G,u[1][1])*G:q=ki(N+(h?te:-te)/G,u[0][1])*G,$=Math.max($,q)}}if(y){const V=Uu(z*G,S,_)/G;if(F=Math.max(F,V),c){let q=0;!h&&!f||f&&!h&&m?q=ki(R+z*G+U,c[1][0])/G:q=Ti(R+(f?D:-D)*G+U,c[0][0])/G,F=Math.max(F,q)}if(u){let q=0;!h&&!f||f&&!h&&m?q=Ti(R+z*G,u[1][0])/G:q=ki(R+(f?D:-D)*G,u[0][0])/G,F=Math.max(F,q)}}}D=D+(D<0?F:-F),te=te+(te<0?$:-$),s&&(m?M>z*G?D=(Gv(h,f)?-te:te)/G:te=(Gv(h,f)?-D:D)*G:g?(D=te/G,f=h):(te=D*G,h=f));const L=h?R+te:R,K=f?N+D:N;return{width:J+(h?-te:te),height:ce+(f?-D:D),x:a[0]*te*(h?-1:1)+L,y:a[1]*D*(f?-1:1)+K}}const Ix={width:0,height:0,x:0,y:0},kA={...Ix,pointerX:0,pointerY:0,aspectRatio:1};function OA(e){return[[0,0],[e.measured.width,e.measured.height]]}function NA(e,t,n){const r=t.position.x+e.position.x,s=t.position.y+e.position.y,a=e.measured.width??0,c=e.measured.height??0,u=n[0]*a,h=n[1]*c;return[[r-u,s-h],[r+a-u,s+c-h]]}function DA({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:s}){const a=Kn(e);function c({controlPosition:h,boundaries:f,keepAspectRatio:g,onResizeStart:y,onResize:m,onResizeEnd:w,shouldResize:C}){let S={...Ix},_={...kA};const P=RA(h);let O,R=null,N=[],J,ce,G;const te=qw().on("start",D=>{const{nodeLookup:M,transform:z,snapGrid:U,snapToGrid:Y,nodeOrigin:$,paneDomNode:F}=n();if(O=M.get(t),!O)return;R=(F==null?void 0:F.getBoundingClientRect())??null;const{xSnapped:L,ySnapped:K}=Gl(D.sourceEvent,{transform:z,snapGrid:U,snapToGrid:Y,containerBounds:R});S={width:O.measured.width??0,height:O.measured.height??0,x:O.position.x??0,y:O.position.y??0},_={...S,pointerX:L,pointerY:K,aspectRatio:S.width/S.height},J=void 0,O.parentId&&(O.extent==="parent"||O.expandParent)&&(J=M.get(O.parentId),ce=J&&O.extent==="parent"?OA(J):void 0),N=[],G=void 0;for(const[V,q]of M)if(q.parentId===t&&(N.push({id:V,position:{...q.position},extent:q.extent}),q.extent==="parent"||q.expandParent)){const Q=NA(q,O,q.origin??$);G?G=[[Math.min(Q[0][0],G[0][0]),Math.min(Q[0][1],G[0][1])],[Math.max(Q[1][0],G[1][0]),Math.max(Q[1][1],G[1][1])]]:G=Q}y==null||y(D,{...S})}).on("drag",D=>{const{transform:M,snapGrid:z,snapToGrid:U,nodeOrigin:Y}=n(),$=Gl(D.sourceEvent,{transform:M,snapGrid:z,snapToGrid:U,containerBounds:R}),F=[];if(!O)return;const{x:L,y:K,width:V,height:q}=S,Q={},W=O.origin??Y,{width:ie,height:be,x:Se,y:_e}=TA(_,P,$,f,g,W,ce,G),Oe=ie!==V,Be=be!==q,Ae=Se!==L&&Oe,Ce=_e!==K&&Be;if(!Ae&&!Ce&&!Oe&&!Be)return;if((Ae||Ce||W[0]===1||W[1]===1)&&(Q.x=Ae?Se:S.x,Q.y=Ce?_e:S.y,S.x=Q.x,S.y=Q.y,N.length>0)){const it=Se-L,gt=_e-K;for(const wt of N)wt.position={x:wt.position.x-it+W[0]*(ie-V),y:wt.position.y-gt+W[1]*(be-q)},F.push(wt)}if((Oe||Be)&&(Q.width=Oe?ie:S.width,Q.height=Be?be:S.height,S.width=Q.width,S.height=Q.height),J&&O.expandParent){const it=W[0]*(Q.width??0);Q.x&&Q.x{w==null||w(D,{...S}),s==null||s()});a.call(te)}function u(){a.on(".drag",null)}return{update:c,destroy:u}}var Wf={exports:{}},qf={},Gf={exports:{}},Kf={};/** + * @license React + * use-sync-external-store-shim.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Kv;function MA(){if(Kv)return Kf;Kv=1;var e=mc();function t(y,m){return y===m&&(y!==0||1/y===1/m)||y!==y&&m!==m}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,a=e.useLayoutEffect,c=e.useDebugValue;function u(y,m){var w=m(),C=r({inst:{value:w,getSnapshot:m}}),S=C[0].inst,_=C[1];return a(function(){S.value=w,S.getSnapshot=m,h(S)&&_({inst:S})},[y,w,m]),s(function(){return h(S)&&_({inst:S}),y(function(){h(S)&&_({inst:S})})},[y]),c(w),w}function h(y){var m=y.getSnapshot;y=y.value;try{var w=m();return!n(y,w)}catch{return!0}}function f(y,m){return m()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:u;return Kf.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,Kf}var Yv;function IA(){return Yv||(Yv=1,Gf.exports=MA()),Gf.exports}/** + * @license React + * use-sync-external-store-shim/with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Xv;function FA(){if(Xv)return qf;Xv=1;var e=mc(),t=IA();function n(f,g){return f===g&&(f!==0||1/f===1/g)||f!==f&&g!==g}var r=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,a=e.useRef,c=e.useEffect,u=e.useMemo,h=e.useDebugValue;return qf.useSyncExternalStoreWithSelector=function(f,g,y,m,w){var C=a(null);if(C.current===null){var S={hasValue:!1,value:null};C.current=S}else S=C.current;C=u(function(){function P(ce){if(!O){if(O=!0,R=ce,ce=m(ce),w!==void 0&&S.hasValue){var G=S.value;if(w(G,ce))return N=G}return N=ce}if(G=N,r(R,ce))return G;var te=m(ce);return w!==void 0&&w(G,te)?(R=ce,G):(R=ce,N=te)}var O=!1,R,N,J=y===void 0?null:y;return[function(){return P(g())},J===null?void 0:function(){return P(J())}]},[g,y,m,w]);var _=s(f,C[0],C[1]);return c(function(){S.hasValue=!0,S.value=_},[_]),h(_),_},qf}var Qv;function LA(){return Qv||(Qv=1,Wf.exports=FA()),Wf.exports}var jA=LA();const BA=gc(jA),$A={},Jv=e=>{let t;const n=new Set,r=(g,y)=>{const m=typeof g=="function"?g(t):g;if(!Object.is(m,t)){const w=t;t=y??(typeof m!="object"||m===null)?m:Object.assign({},t,m),n.forEach(C=>C(t,w))}},s=()=>t,h={setState:r,getState:s,getInitialState:()=>f,subscribe:g=>(n.add(g),()=>n.delete(g)),destroy:()=>{($A?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},f=t=e(r,s,h);return h},VA=e=>e?Jv(e):Jv,{useDebugValue:zA}=fn,{useSyncExternalStoreWithSelector:HA}=BA,UA=e=>e;function Fx(e,t=UA,n){const r=HA(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return zA(r),r}const Zv=(e,t)=>{const n=VA(e),r=(s,a=t)=>Fx(n,s,a);return Object.assign(r,n),r},WA=(e,t)=>e?Zv(e,t):Zv;function Ft(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,s]of e)if(!Object.is(s,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var qA=Ow();const qh=B.createContext(null),GA=qh.Provider,Lx=yo.error001();function dt(e,t){const n=B.useContext(qh);if(n===null)throw new Error(Lx);return Fx(n,e,t)}function _t(){const e=B.useContext(qh);if(e===null)throw new Error(Lx);return B.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const e0={display:"none"},KA={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},jx="react-flow__node-desc",Bx="react-flow__edge-desc",YA="react-flow__aria-live",XA=e=>e.ariaLiveMessage;function QA({rfId:e}){const t=dt(XA);return T.jsx("div",{id:`${YA}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:KA,children:t})}function JA({rfId:e,disableKeyboardA11y:t}){return T.jsxs(T.Fragment,{children:[T.jsxs("div",{id:`${jx}-${e}`,style:e0,children:["Press enter or space to select a node.",!t&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "]}),T.jsx("div",{id:`${Bx}-${e}`,style:e0,children:"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."}),!t&&T.jsx(QA,{rfId:e})]})}const ZA=e=>e.userSelectionActive?"none":"all",_g=B.forwardRef(({position:e="top-left",children:t,className:n,style:r,...s},a)=>{const c=dt(ZA),u=`${e}`.split("-");return T.jsx("div",{className:Vt(["react-flow__panel",n,...u]),style:{...r,pointerEvents:c},ref:a,...s,children:t})});function eR({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:T.jsx(_g,{position:t,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:T.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const tR=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Wu=e=>e.id;function nR(e,t){return Ft(e.selectedNodes.map(Wu),t.selectedNodes.map(Wu))&&Ft(e.selectedEdges.map(Wu),t.selectedEdges.map(Wu))}function rR({onSelectionChange:e}){const t=_t(),{selectedNodes:n,selectedEdges:r}=dt(tR,nR);return B.useEffect(()=>{const s={nodes:n,edges:r};e==null||e(s),t.getState().onSelectionChangeHandlers.forEach(a=>a(s))},[n,r,e]),null}const oR=e=>!!e.onSelectionChangeHandlers;function iR({onSelectionChange:e}){const t=dt(oR);return e||t?T.jsx(rR,{onSelectionChange:e}):null}const $x=[0,0],sR={x:0,y:0,zoom:1},aR=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance"],t0=[...aR,"rfId"],lR=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setPaneClickDistance:e.setPaneClickDistance}),n0={translateExtent:nc,nodeOrigin:$x,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function cR(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:s,setTranslateExtent:a,setNodeExtent:c,reset:u,setDefaultNodesAndEdges:h,setPaneClickDistance:f}=dt(lR,Ft),g=_t();B.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{y.current=n0,u()}),[]);const y=B.useRef(n0);return B.useEffect(()=>{for(const m of t0){const w=e[m],C=y.current[m];w!==C&&(typeof e[m]>"u"||(m==="nodes"?t(w):m==="edges"?n(w):m==="minZoom"?r(w):m==="maxZoom"?s(w):m==="translateExtent"?a(w):m==="nodeExtent"?c(w):m==="paneClickDistance"?f(w):m==="fitView"?g.setState({fitViewOnInit:w}):m==="fitViewOptions"?g.setState({fitViewOnInitOptions:w}):g.setState({[m]:w})))}y.current=e},t0.map(m=>e[m])),null}function r0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function uR(e){var r;const[t,n]=B.useState(e==="system"?null:e);return B.useEffect(()=>{if(e!=="system"){n(e);return}const s=r0(),a=()=>n(s!=null&&s.matches?"dark":"light");return a(),s==null||s.addEventListener("change",a),()=>{s==null||s.removeEventListener("change",a)}},[e]),t!==null?t:(r=r0())!=null&&r.matches?"dark":"light"}const o0=typeof document<"u"?document:null;function sc(e=null,t={target:o0,actInsideInputWithModifier:!0}){const[n,r]=B.useState(!1),s=B.useRef(!1),a=B.useRef(new Set([])),[c,u]=B.useMemo(()=>{if(e!==null){const f=(Array.isArray(e)?e:[e]).filter(y=>typeof y=="string").map(y=>y.replace("+",` +`).replace(` + +`,` ++`).split(` +`)),g=f.reduce((y,m)=>y.concat(...m),[]);return[f,g]}return[[],[]]},[e]);return B.useEffect(()=>{const h=(t==null?void 0:t.target)||o0;if(e!==null){const f=m=>{if(s.current=m.ctrlKey||m.metaKey||m.shiftKey,(!s.current||s.current&&!t.actInsideInputWithModifier)&&Lp(m))return!1;const C=s0(m.code,u);a.current.add(m[C]),i0(c,a.current,!1)&&(m.preventDefault(),r(!0))},g=m=>{if((!s.current||s.current&&!t.actInsideInputWithModifier)&&Lp(m))return!1;const C=s0(m.code,u);i0(c,a.current,!0)?(r(!1),a.current.clear()):a.current.delete(m[C]),m.key==="Meta"&&a.current.clear(),s.current=!1},y=()=>{a.current.clear(),r(!1)};return h==null||h.addEventListener("keydown",f),h==null||h.addEventListener("keyup",g),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{h==null||h.removeEventListener("keydown",f),h==null||h.removeEventListener("keyup",g),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[e,r]),n}function i0(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(s=>t.has(s)))}function s0(e,t){return t.includes(e)?"code":"key"}const hR=()=>{const e=_t();return B.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t==null?void 0:t.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,s,a],panZoom:c}=e.getState();return c?(await c.setViewport({x:t.x??r,y:t.y??s,zoom:t.zoom??a},{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>{const{nodeLookup:n,minZoom:r,maxZoom:s,panZoom:a,domNode:c}=e.getState();if(!a||!c)return Promise.resolve(!1);const u=Mp(n,t),{width:h,height:f}=Uh(c);return Ip({nodes:u,width:h,height:f,minZoom:r,maxZoom:s,panZoom:a},t)},setCenter:async(t,n,r)=>{const{width:s,height:a,maxZoom:c,panZoom:u}=e.getState(),h=typeof(r==null?void 0:r.zoom)<"u"?r.zoom:c,f=s/2-t*h,g=a/2-n*h;return u?(await u.setViewport({x:f,y:g,zoom:h},{duration:r==null?void 0:r.duration}),Promise.resolve(!0)):Promise.resolve(!1)},fitBounds:async(t,n)=>{const{width:r,height:s,minZoom:a,maxZoom:c,panZoom:u}=e.getState(),h=Sg(t,r,s,a,c,(n==null?void 0:n.padding)??.1);return u?(await u.setViewport(h,{duration:n==null?void 0:n.duration}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={snapToGrid:!0})=>{const{transform:r,snapGrid:s,domNode:a}=e.getState();if(!a)return t;const{x:c,y:u}=a.getBoundingClientRect(),h={x:t.x-c,y:t.y-u};return Sc(h,r,n.snapToGrid,s)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:s,y:a}=r.getBoundingClientRect(),c=yx(t,n);return{x:c.x+s,y:c.y+a}}}),[])};function Vx(e,t){const n=[],r=new Map,s=[];for(const a of e)if(a.type==="add"){s.push(a);continue}else if(a.type==="remove"||a.type==="replace")r.set(a.id,[a]);else{const c=r.get(a.id);c?c.push(a):r.set(a.id,[a])}for(const a of t){const c=r.get(a.id);if(!c){n.push(a);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){n.push({...c[0].item});continue}const u={...a};for(const h of c)dR(h,u);n.push(u)}return s.length&&s.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function dR(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured??(t.measured={}),t.measured.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&(t.width=e.dimensions.width,t.height=e.dimensions.height)),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function zx(e,t){return Vx(e,t)}function Hx(e,t){return Vx(e,t)}function Rs(e,t){return{id:e,type:"select",selected:t}}function Ma(e,t=new Set,n=!1){const r=[];for(const[s,a]of e){const c=t.has(s);!(a.selected===void 0&&!c)&&a.selected!==c&&(n&&(a.selected=c),r.push(Rs(a.id,c)))}return r}function a0({items:e=[],lookup:t}){var s;const n=[],r=new Map(e.map(a=>[a.id,a]));for(const[a,c]of e.entries()){const u=t.get(c.id),h=((s=u==null?void 0:u.internals)==null?void 0:s.userNode)??u;h!==void 0&&h!==c&&n.push({id:c.id,item:c,type:"replace"}),h===void 0&&n.push({item:c,type:"add",index:a})}for(const[a]of t)r.get(a)===void 0&&n.push({id:a,type:"remove"});return n}function l0(e){return{id:e.id,type:"remove"}}const c0=e=>H_(e),fR=e=>hx(e);function Ux(e){return B.forwardRef(e)}const pR=typeof window<"u"?B.useLayoutEffect:B.useEffect;function u0(e){const[t,n]=B.useState(BigInt(0)),[r]=B.useState(()=>gR(()=>n(s=>s+BigInt(1))));return pR(()=>{const s=r.get();s.length&&(e(s),r.reset())},[t]),r}function gR(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Wx=B.createContext(null);function mR({children:e}){const t=_t(),n=B.useCallback(u=>{const{nodes:h=[],setNodes:f,hasDefaultNodes:g,onNodesChange:y,nodeLookup:m}=t.getState();let w=h;for(const C of u)w=typeof C=="function"?C(w):C;g?f(w):y&&y(a0({items:w,lookup:m}))},[]),r=u0(n),s=B.useCallback(u=>{const{edges:h=[],setEdges:f,hasDefaultEdges:g,onEdgesChange:y,edgeLookup:m}=t.getState();let w=h;for(const C of u)w=typeof C=="function"?C(w):C;g?f(w):y&&y(a0({items:w,lookup:m}))},[]),a=u0(s),c=B.useMemo(()=>({nodeQueue:r,edgeQueue:a}),[]);return T.jsx(Wx.Provider,{value:c,children:e})}function yR(){const e=B.useContext(Wx);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const vR=e=>!!e.panZoom;function Gh(){const e=hR(),t=_t(),n=yR(),r=dt(vR),s=B.useMemo(()=>{const a=y=>t.getState().nodeLookup.get(y),c=y=>{n.nodeQueue.push(y)},u=y=>{n.edgeQueue.push(y)},h=y=>{var P,O;const{nodeLookup:m,nodeOrigin:w}=t.getState(),C=c0(y)?y:m.get(y.id),S=C.parentId?wx(C.position,C.measured,C.parentId,m,w):C.position,_={...C,position:S,width:((P=C.measured)==null?void 0:P.width)??C.width,height:((O=C.measured)==null?void 0:O.height)??C.height};return za(_)},f=(y,m,w={replace:!1})=>{c(C=>C.map(S=>{if(S.id===y){const _=typeof m=="function"?m(S):m;return w.replace&&c0(_)?_:{...S,..._}}return S}))},g=(y,m,w={replace:!1})=>{u(C=>C.map(S=>{if(S.id===y){const _=typeof m=="function"?m(S):m;return w.replace&&fR(_)?_:{...S,..._}}return S}))};return{getNodes:()=>t.getState().nodes.map(y=>({...y})),getNode:y=>{var m;return(m=a(y))==null?void 0:m.internals.userNode},getInternalNode:a,getEdges:()=>{const{edges:y=[]}=t.getState();return y.map(m=>({...m}))},getEdge:y=>t.getState().edgeLookup.get(y),setNodes:c,setEdges:u,addNodes:y=>{const m=Array.isArray(y)?y:[y];n.nodeQueue.push(w=>[...w,...m])},addEdges:y=>{const m=Array.isArray(y)?y:[y];n.edgeQueue.push(w=>[...w,...m])},toObject:()=>{const{nodes:y=[],edges:m=[],transform:w}=t.getState(),[C,S,_]=w;return{nodes:y.map(P=>({...P})),edges:m.map(P=>({...P})),viewport:{x:C,y:S,zoom:_}}},deleteElements:async({nodes:y=[],edges:m=[]})=>{const{nodes:w,edges:C,onNodesDelete:S,onEdgesDelete:_,triggerNodeChanges:P,triggerEdgeChanges:O,onDelete:R,onBeforeDelete:N}=t.getState(),{nodes:J,edges:ce}=await G_({nodesToRemove:y,edgesToRemove:m,nodes:w,edges:C,onBeforeDelete:N}),G=ce.length>0,te=J.length>0;if(G){const D=ce.map(l0);_==null||_(ce),O(D)}if(te){const D=J.map(l0);S==null||S(J),P(D)}return(te||G)&&(R==null||R({nodes:J,edges:ce})),{deletedNodes:J,deletedEdges:ce}},getIntersectingNodes:(y,m=!0,w)=>{const C=Fv(y),S=C?y:h(y),_=w!==void 0;return S?(w||t.getState().nodes).filter(P=>{const O=t.getState().nodeLookup.get(P.id);if(O&&!C&&(P.id===y.id||!O.internals.positionAbsolute))return!1;const R=za(_?P:O),N=oc(R,S);return m&&N>0||N>=S.width*S.height}):[]},isNodeIntersecting:(y,m,w=!0)=>{const S=Fv(y)?y:h(y);if(!S)return!1;const _=oc(S,m);return w&&_>0||_>=S.width*S.height},updateNode:f,updateNodeData:(y,m,w={replace:!1})=>{f(y,C=>{const S=typeof m=="function"?m(C):m;return w.replace?{...C,data:S}:{...C,data:{...C.data,...S}}},w)},updateEdge:g,updateEdgeData:(y,m,w={replace:!1})=>{g(y,C=>{const S=typeof m=="function"?m(C):m;return w.replace?{...C,data:S}:{...C,data:{...C.data,...S}}},w)},getNodesBounds:y=>{const{nodeLookup:m,nodeOrigin:w}=t.getState();return W_(y,{nodeLookup:m,nodeOrigin:w})},getHandleConnections:({type:y,id:m,nodeId:w})=>{var C;return Array.from(((C=t.getState().connectionLookup.get(`${w}-${y}${m?`-${m}`:""}`))==null?void 0:C.values())??[])},getNodeConnections:({type:y,handleId:m,nodeId:w})=>{var C;return Array.from(((C=t.getState().connectionLookup.get(`${w}${y?m?`-${y}-${m}`:`-${y}`:""}`))==null?void 0:C.values())??[])}}},[]);return B.useMemo(()=>({...s,...e,viewportInitialized:r}),[r])}const h0=e=>e.selected,wR={actInsideInputWithModifier:!1},xR=typeof window<"u"?window:void 0;function SR({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=_t(),{deleteElements:r}=Gh(),s=sc(e,wR),a=sc(t,{target:xR});B.useEffect(()=>{if(s){const{edges:c,nodes:u}=n.getState();r({nodes:u.filter(h0),edges:c.filter(h0)}),n.setState({nodesSelectionActive:!1})}},[s]),B.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function CR(e){const t=_t();B.useEffect(()=>{const n=()=>{var s,a;if(!e.current)return!1;const r=Uh(e.current);(r.height===0||r.width===0)&&((a=(s=t.getState()).onError)==null||a.call(s,"004",yo.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Kh={position:"absolute",width:"100%",height:"100%",top:0,left:0},bR=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function ER({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:s=.5,panOnScrollMode:a=Is.Free,zoomOnDoubleClick:c=!0,panOnDrag:u=!0,defaultViewport:h,translateExtent:f,minZoom:g,maxZoom:y,zoomActivationKeyCode:m,preventScrolling:w=!0,children:C,noWheelClassName:S,noPanClassName:_,onViewportChange:P,isControlledViewport:O,paneClickDistance:R}){const N=_t(),J=B.useRef(null),{userSelectionActive:ce,lib:G}=dt(bR,Ft),te=sc(m),D=B.useRef();CR(J);const M=B.useCallback(z=>{P==null||P({x:z[0],y:z[1],zoom:z[2]}),O||N.setState({transform:z})},[P,O]);return B.useEffect(()=>{if(J.current){D.current=_A({domNode:J.current,minZoom:g,maxZoom:y,translateExtent:f,viewport:h,paneClickDistance:R,onDraggingChange:$=>N.setState({paneDragging:$}),onPanZoomStart:($,F)=>{const{onViewportChangeStart:L,onMoveStart:K}=N.getState();K==null||K($,F),L==null||L(F)},onPanZoom:($,F)=>{const{onViewportChange:L,onMove:K}=N.getState();K==null||K($,F),L==null||L(F)},onPanZoomEnd:($,F)=>{const{onViewportChangeEnd:L,onMoveEnd:K}=N.getState();K==null||K($,F),L==null||L(F)}});const{x:z,y:U,zoom:Y}=D.current.getViewport();return N.setState({panZoom:D.current,transform:[z,U,Y],domNode:J.current.closest(".react-flow")}),()=>{var $;($=D.current)==null||$.destroy()}}},[]),B.useEffect(()=>{var z;(z=D.current)==null||z.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:s,panOnScrollMode:a,zoomOnDoubleClick:c,panOnDrag:u,zoomActivationKeyPressed:te,preventScrolling:w,noPanClassName:_,userSelectionActive:ce,noWheelClassName:S,lib:G,onTransformChange:M})},[e,t,n,r,s,a,c,u,te,w,_,ce,S,G,M]),T.jsx("div",{className:"react-flow__renderer",ref:J,style:Kh,children:C})}const PR=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function _R(){const{userSelectionActive:e,userSelectionRect:t}=dt(PR,Ft);return e&&t?T.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Yf=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},AR=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging});function RR({isSelecting:e,selectionKeyPressed:t,selectionMode:n=rc.Full,panOnDrag:r,selectionOnDrag:s,onSelectionStart:a,onSelectionEnd:c,onPaneClick:u,onPaneContextMenu:h,onPaneScroll:f,onPaneMouseEnter:g,onPaneMouseMove:y,onPaneMouseLeave:m,children:w}){const C=_t(),{userSelectionActive:S,elementsSelectable:_,dragging:P}=dt(AR,Ft),O=_&&(e||S),R=B.useRef(null),N=B.useRef(),J=B.useRef(new Set),ce=B.useRef(new Set),G=B.useRef(!1),te=B.useRef(!1),D=L=>{if(G.current){G.current=!1;return}u==null||u(L),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},M=L=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){L.preventDefault();return}h==null||h(L)},z=f?L=>f(L):void 0,U=L=>{var W,ie;const{resetSelectedElements:K,domNode:V}=C.getState();if(N.current=V==null?void 0:V.getBoundingClientRect(),!_||!e||L.button!==0||L.target!==R.current||!N.current)return;(ie=(W=L.target)==null?void 0:W.setPointerCapture)==null||ie.call(W,L.pointerId),te.current=!0,G.current=!1;const{x:q,y:Q}=Ko(L.nativeEvent,N.current);K(),C.setState({userSelectionRect:{width:0,height:0,startX:q,startY:Q,x:q,y:Q}}),a==null||a(L)},Y=L=>{const{userSelectionRect:K,transform:V,nodeLookup:q,edgeLookup:Q,connectionLookup:W,triggerNodeChanges:ie,triggerEdgeChanges:be,defaultEdgeOptions:Se}=C.getState();if(!N.current||!K)return;G.current=!0;const{x:_e,y:Oe}=Ko(L.nativeEvent,N.current),{startX:Be,startY:Ae}=K,Ce={startX:Be,startY:Ae,x:_eit.id)),ce.current=new Set;const Fe=(Se==null?void 0:Se.selectable)??!0;for(const it of J.current){const gt=W.get(it);if(gt)for(const{edgeId:wt}of gt.values()){const Zt=Q.get(wt);Zt&&(Zt.selectable??Fe)&&ce.current.add(wt)}}if(!Lv(Qe,J.current)){const it=Ma(q,J.current,!0);ie(it)}if(!Lv(tt,ce.current)){const it=Ma(Q,ce.current);be(it)}C.setState({userSelectionRect:Ce,userSelectionActive:!0,nodesSelectionActive:!1})},$=L=>{var V,q;if(L.button!==0||!te.current)return;(q=(V=L.target)==null?void 0:V.releasePointerCapture)==null||q.call(V,L.pointerId);const{userSelectionRect:K}=C.getState();!S&&K&&L.target===R.current&&(D==null||D(L)),C.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:J.current.size>0}),c==null||c(L),(t||s)&&(G.current=!1),te.current=!1},F=r===!0||Array.isArray(r)&&r.includes(0);return T.jsxs("div",{className:Vt(["react-flow__pane",{draggable:F,dragging:P,selection:e}]),onClick:O?void 0:Yf(D,R),onContextMenu:Yf(M,R),onWheel:Yf(z,R),onPointerEnter:O?void 0:g,onPointerDown:O?U:y,onPointerMove:O?Y:y,onPointerUp:O?$:void 0,onPointerLeave:m,ref:R,style:Kh,children:[w,T.jsx(_R,{})]})}function Hp({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:s,unselectNodesAndEdges:a,multiSelectionActive:c,nodeLookup:u,onError:h}=t.getState(),f=u.get(e);if(!f){h==null||h("012",yo.error012(e));return}t.setState({nodesSelectionActive:!1}),f.selected?(n||f.selected&&c)&&(a({nodes:[f],edges:[]}),requestAnimationFrame(()=>{var g;return(g=r==null?void 0:r.current)==null?void 0:g.blur()})):s([e])}function qx({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:s,isSelectable:a,nodeClickDistance:c}){const u=_t(),[h,f]=B.useState(!1),g=B.useRef();return B.useEffect(()=>{g.current=dA({getStoreItems:()=>u.getState(),onNodeMouseDown:y=>{Hp({id:y,store:u,nodeRef:e})},onDragStart:()=>{f(!0)},onDragStop:()=>{f(!1)}})},[]),B.useEffect(()=>{var y,m;if(t)(y=g.current)==null||y.destroy();else if(e.current)return(m=g.current)==null||m.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:a,nodeId:s,nodeClickDistance:c}),()=>{var w;(w=g.current)==null||w.destroy()}},[n,r,t,a,e,s]),h}const TR=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Gx(){const e=_t();return B.useCallback(n=>{const{nodeExtent:r,snapToGrid:s,snapGrid:a,nodesDraggable:c,onError:u,updateNodePositions:h,nodeLookup:f,nodeOrigin:g}=e.getState(),y=new Map,m=TR(c),w=s?a[0]:5,C=s?a[1]:5,S=n.direction.x*w*n.factor,_=n.direction.y*C*n.factor;for(const[,P]of f){if(!m(P))continue;let O={x:P.internals.positionAbsolute.x+S,y:P.internals.positionAbsolute.y+_};s&&(O=Hh(O,a));const{position:R,positionAbsolute:N}=fx({nodeId:P.id,nextPosition:O,nodeLookup:f,nodeExtent:r,nodeOrigin:g,onError:u});P.position=R,P.internals.positionAbsolute=N,y.set(P.id,P)}h(y)},[])}const Ag=B.createContext(null),kR=Ag.Provider;Ag.Consumer;const Yh=()=>B.useContext(Ag),OR=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),NR=(e,t,n)=>r=>{const{connectionClickStartHandle:s,connectionMode:a,connection:c}=r,{fromHandle:u,toHandle:h,isValid:f}=c,g=(h==null?void 0:h.nodeId)===e&&(h==null?void 0:h.id)===t&&(h==null?void 0:h.type)===n;return{connectingFrom:(u==null?void 0:u.nodeId)===e&&(u==null?void 0:u.id)===t&&(u==null?void 0:u.type)===n,connectingTo:g,clickConnecting:(s==null?void 0:s.nodeId)===e&&(s==null?void 0:s.id)===t&&(s==null?void 0:s.type)===n,isPossibleEndHandle:a===$a.Strict?(u==null?void 0:u.type)!==n:e!==(u==null?void 0:u.nodeId)||t!==(u==null?void 0:u.id),connectionInProcess:!!u,valid:g&&f}};function DR({type:e="source",position:t=Ke.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:s=!0,isConnectableEnd:a=!0,id:c,onConnect:u,children:h,className:f,onMouseDown:g,onTouchStart:y,...m},w){var $,F;const C=c||null,S=e==="target",_=_t(),P=Yh(),{connectOnClick:O,noPanClassName:R,rfId:N}=dt(OR,Ft),{connectingFrom:J,connectingTo:ce,clickConnecting:G,isPossibleEndHandle:te,connectionInProcess:D,valid:M}=dt(NR(P,C,e),Ft);P||(F=($=_.getState()).onError)==null||F.call($,"010",yo.error010());const z=L=>{const{defaultEdgeOptions:K,onConnect:V,hasDefaultEdges:q}=_.getState(),Q={...K,...L};if(q){const{edges:W,setEdges:ie}=_.getState();ie(jp(Q,W))}V==null||V(Q),u==null||u(Q)},U=L=>{if(!P)return;const K=Sx(L.nativeEvent);if(s&&(K&&L.button===0||!K)){const V=_.getState();zp.onPointerDown(L.nativeEvent,{autoPanOnConnect:V.autoPanOnConnect,connectionMode:V.connectionMode,connectionRadius:V.connectionRadius,domNode:V.domNode,nodeLookup:V.nodeLookup,lib:V.lib,isTarget:S,handleId:C,nodeId:P,flowId:V.rfId,panBy:V.panBy,cancelConnection:V.cancelConnection,onConnectStart:V.onConnectStart,onConnectEnd:V.onConnectEnd,updateConnection:V.updateConnection,onConnect:z,isValidConnection:n||V.isValidConnection,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,autoPanSpeed:V.autoPanSpeed})}K?g==null||g(L):y==null||y(L)},Y=L=>{const{onClickConnectStart:K,onClickConnectEnd:V,connectionClickStartHandle:q,connectionMode:Q,isValidConnection:W,lib:ie,rfId:be,nodeLookup:Se,connection:_e}=_.getState();if(!P||!q&&!s)return;if(!q){K==null||K(L.nativeEvent,{nodeId:P,handleId:C,handleType:e}),_.setState({connectionClickStartHandle:{nodeId:P,type:e,id:C}});return}const Oe=xx(L.target),Be=n||W,{connection:Ae,isValid:Ce}=zp.isValid(L.nativeEvent,{handle:{nodeId:P,id:C,type:e},connectionMode:Q,fromNodeId:q.nodeId,fromHandleId:q.id||null,fromType:q.type,isValidConnection:Be,flowId:be,doc:Oe,lib:ie,nodeLookup:Se});Ce&&Ae&&z(Ae);const Qe=structuredClone(_e);delete Qe.inProgress,Qe.toPosition=Qe.toHandle?Qe.toHandle.position:null,V==null||V(L,Qe),_.setState({connectionClickStartHandle:null})};return T.jsx("div",{"data-handleid":C,"data-nodeid":P,"data-handlepos":t,"data-id":`${N}-${P}-${C}-${e}`,className:Vt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",R,f,{source:!S,target:S,connectable:r,connectablestart:s,connectableend:a,clickconnecting:G,connectingfrom:J,connectingto:ce,valid:M,connectionindicator:r&&(!D||te)&&(D?a:s)}]),onMouseDown:U,onTouchStart:U,onClick:O?Y:void 0,ref:w,...m,children:h})}const ac=B.memo(Ux(DR));function MR({data:e,isConnectable:t,sourcePosition:n=Ke.Bottom}){return T.jsxs(T.Fragment,{children:[e==null?void 0:e.label,T.jsx(ac,{type:"source",position:n,isConnectable:t})]})}function IR({data:e,isConnectable:t,targetPosition:n=Ke.Top,sourcePosition:r=Ke.Bottom}){return T.jsxs(T.Fragment,{children:[T.jsx(ac,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,T.jsx(ac,{type:"source",position:r,isConnectable:t})]})}function FR(){return null}function LR({data:e,isConnectable:t,targetPosition:n=Ke.Top}){return T.jsxs(T.Fragment,{children:[T.jsx(ac,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const _h={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},d0={input:MR,default:IR,output:LR,group:FR};function jR(e){var t,n,r,s;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((s=e.style)==null?void 0:s.height)}}const BR=e=>{const{width:t,height:n,x:r,y:s}=xc(e.nodeLookup,{filter:a=>!!a.selected});return{width:Ur(t)?t:null,height:Ur(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${s}px)`}};function $R({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=_t(),{width:s,height:a,transformString:c,userSelectionActive:u}=dt(BR,Ft),h=Gx(),f=B.useRef(null);if(B.useEffect(()=>{var m;n||(m=f.current)==null||m.focus({preventScroll:!0})},[n]),qx({nodeRef:f}),u||!s||!a)return null;const g=e?m=>{const w=r.getState().nodes.filter(C=>C.selected);e(m,w)}:void 0,y=m=>{Object.prototype.hasOwnProperty.call(_h,m.key)&&(m.preventDefault(),h({direction:_h[m.key],factor:m.shiftKey?4:1}))};return T.jsx("div",{className:Vt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:c},children:T.jsx("div",{ref:f,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:y,style:{width:s,height:a}})})}const f0=typeof window<"u"?window:void 0,VR=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Kx({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:a,onPaneScroll:c,paneClickDistance:u,deleteKeyCode:h,selectionKeyCode:f,selectionOnDrag:g,selectionMode:y,onSelectionStart:m,onSelectionEnd:w,multiSelectionKeyCode:C,panActivationKeyCode:S,zoomActivationKeyCode:_,elementsSelectable:P,zoomOnScroll:O,zoomOnPinch:R,panOnScroll:N,panOnScrollSpeed:J,panOnScrollMode:ce,zoomOnDoubleClick:G,panOnDrag:te,defaultViewport:D,translateExtent:M,minZoom:z,maxZoom:U,preventScrolling:Y,onSelectionContextMenu:$,noWheelClassName:F,noPanClassName:L,disableKeyboardA11y:K,onViewportChange:V,isControlledViewport:q}){const{nodesSelectionActive:Q,userSelectionActive:W}=dt(VR),ie=sc(f,{target:f0}),be=sc(S,{target:f0}),Se=be||te,_e=be||N,Oe=g&&Se!==!0,Be=ie||W||Oe;return SR({deleteKeyCode:h,multiSelectionKeyCode:C}),T.jsx(ER,{onPaneContextMenu:a,elementsSelectable:P,zoomOnScroll:O,zoomOnPinch:R,panOnScroll:_e,panOnScrollSpeed:J,panOnScrollMode:ce,zoomOnDoubleClick:G,panOnDrag:!ie&&Se,defaultViewport:D,translateExtent:M,minZoom:z,maxZoom:U,zoomActivationKeyCode:_,preventScrolling:Y,noWheelClassName:F,noPanClassName:L,onViewportChange:V,isControlledViewport:q,paneClickDistance:u,children:T.jsxs(RR,{onSelectionStart:m,onSelectionEnd:w,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:s,onPaneContextMenu:a,onPaneScroll:c,panOnDrag:Se,isSelecting:!!Be,selectionMode:y,selectionKeyPressed:ie,selectionOnDrag:Oe,children:[e,Q&&T.jsx($R,{onSelectionContextMenu:$,noPanClassName:L,disableKeyboardA11y:K})]})})}Kx.displayName="FlowRenderer";const zR=B.memo(Kx),HR=e=>t=>e?dx(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function UR(e){return dt(B.useCallback(HR(e),[e]),Ft)}const WR=e=>e.updateNodeInternals;function qR(){const e=dt(WR),[t]=B.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(s=>{const a=s.target.getAttribute("data-id");r.set(a,{id:a,nodeElement:s.target,force:!0})}),e(r)}));return B.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function GR({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const s=_t(),a=B.useRef(null),c=B.useRef(null),u=B.useRef(e.sourcePosition),h=B.useRef(e.targetPosition),f=B.useRef(t),g=n&&!!e.internals.handleBounds;return B.useEffect(()=>{a.current&&!e.hidden&&(!g||c.current!==a.current)&&(c.current&&(r==null||r.unobserve(c.current)),r==null||r.observe(a.current),c.current=a.current)},[g,e.hidden]),B.useEffect(()=>()=>{c.current&&(r==null||r.unobserve(c.current),c.current=null)},[]),B.useEffect(()=>{if(a.current){const y=f.current!==t,m=u.current!==e.sourcePosition,w=h.current!==e.targetPosition;(y||m||w)&&(f.current=t,u.current=e.sourcePosition,h.current=e.targetPosition,s.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:a.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),a}function KR({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:s,onContextMenu:a,onDoubleClick:c,nodesDraggable:u,elementsSelectable:h,nodesConnectable:f,nodesFocusable:g,resizeObserver:y,noDragClassName:m,noPanClassName:w,disableKeyboardA11y:C,rfId:S,nodeTypes:_,nodeExtent:P,nodeClickDistance:O,onError:R}){const{node:N,internals:J,isParent:ce}=dt(Ae=>{const Ce=Ae.nodeLookup.get(e),Qe=Ae.parentLookup.has(e);return{node:Ce,internals:Ce.internals,isParent:Qe}},Ft);let G=N.type||"default",te=(_==null?void 0:_[G])||d0[G];te===void 0&&(R==null||R("003",yo.error003(G)),G="default",te=d0.default);const D=!!(N.draggable||u&&typeof N.draggable>"u"),M=!!(N.selectable||h&&typeof N.selectable>"u"),z=!!(N.connectable||f&&typeof N.connectable>"u"),U=!!(N.focusable||g&&typeof N.focusable>"u"),Y=_t(),$=vx(N),F=GR({node:N,nodeType:G,hasDimensions:$,resizeObserver:y}),L=qx({nodeRef:F,disabled:N.hidden||!D,noDragClassName:m,handleSelector:N.dragHandle,nodeId:e,isSelectable:M,nodeClickDistance:O}),K=Gx();if(N.hidden)return null;const V=Zo(N),q=jR(N),Q=M||D||t||n||r||s,W=n?Ae=>n(Ae,{...J.userNode}):void 0,ie=r?Ae=>r(Ae,{...J.userNode}):void 0,be=s?Ae=>s(Ae,{...J.userNode}):void 0,Se=a?Ae=>a(Ae,{...J.userNode}):void 0,_e=c?Ae=>c(Ae,{...J.userNode}):void 0,Oe=Ae=>{const{selectNodesOnDrag:Ce,nodeDragThreshold:Qe}=Y.getState();M&&(!Ce||!D||Qe>0)&&Hp({id:e,store:Y,nodeRef:F}),t&&t(Ae,{...J.userNode})},Be=Ae=>{if(!(Lp(Ae.nativeEvent)||C))if(lx.includes(Ae.key)&&M){const Ce=Ae.key==="Escape";Hp({id:e,store:Y,unselect:Ce,nodeRef:F})}else D&&N.selected&&Object.prototype.hasOwnProperty.call(_h,Ae.key)&&(Ae.preventDefault(),Y.setState({ariaLiveMessage:`Moved selected node ${Ae.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~J.positionAbsolute.x}, y: ${~~J.positionAbsolute.y}`}),K({direction:_h[Ae.key],factor:Ae.shiftKey?4:1}))};return T.jsx("div",{className:Vt(["react-flow__node",`react-flow__node-${G}`,{[w]:D},N.className,{selected:N.selected,selectable:M,parent:ce,draggable:D,dragging:L}]),ref:F,style:{zIndex:J.z,transform:`translate(${J.positionAbsolute.x}px,${J.positionAbsolute.y}px)`,pointerEvents:Q?"all":"none",visibility:$?"visible":"hidden",...N.style,...q},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:W,onMouseMove:ie,onMouseLeave:be,onContextMenu:Se,onClick:Oe,onDoubleClick:_e,onKeyDown:U?Be:void 0,tabIndex:U?0:void 0,role:U?"button":void 0,"aria-describedby":C?void 0:`${jx}-${S}`,"aria-label":N.ariaLabel,children:T.jsx(kR,{value:e,children:T.jsx(te,{id:e,data:N.data,type:G,positionAbsoluteX:J.positionAbsolute.x,positionAbsoluteY:J.positionAbsolute.y,selected:N.selected??!1,selectable:M,draggable:D,deletable:N.deletable??!0,isConnectable:z,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:L,dragHandle:N.dragHandle,zIndex:J.z,parentId:N.parentId,...V})})})}const YR=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Yx(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,onError:a}=dt(YR,Ft),c=UR(e.onlyRenderVisibleElements),u=qR();return T.jsx("div",{className:"react-flow__nodes",style:Kh,children:c.map(h=>T.jsx(KR,{id:h,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:u,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:a},h))})}Yx.displayName="NodeRenderer";const XR=B.memo(Yx);function QR(e){return dt(B.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const r=[];if(n.width&&n.height)for(const s of n.edges){const a=n.nodeLookup.get(s.source),c=n.nodeLookup.get(s.target);a&&c&&Q_({sourceNode:a,targetNode:c,width:n.width,height:n.height,transform:n.transform})&&r.push(s.id)}return r},[e]),Ft)}const JR=({color:e="none",strokeWidth:t=1})=>T.jsx("polyline",{style:{stroke:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),ZR=({color:e="none",strokeWidth:t=1})=>T.jsx("polyline",{style:{stroke:e,fill:e,strokeWidth:t},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"}),p0={[bh.Arrow]:JR,[bh.ArrowClosed]:ZR};function eT(e){const t=_t();return B.useMemo(()=>{var s,a;return Object.prototype.hasOwnProperty.call(p0,e)?p0[e]:((a=(s=t.getState()).onError)==null||a.call(s,"009",yo.error009(e)),null)},[e])}const tT=({id:e,type:t,color:n,width:r=12.5,height:s=12.5,markerUnits:a="strokeWidth",strokeWidth:c,orient:u="auto-start-reverse"})=>{const h=eT(t);return h?T.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:u,refX:"0",refY:"0",children:T.jsx(h,{color:n,strokeWidth:c})}):null},Xx=({defaultColor:e,rfId:t})=>{const n=dt(a=>a.edges),r=dt(a=>a.defaultEdgeOptions),s=B.useMemo(()=>oA(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return s.length?T.jsx("svg",{className:"react-flow__marker",children:T.jsx("defs",{children:s.map(a=>T.jsx(tT,{id:a.id,type:a.type,color:a.color,width:a.width,height:a.height,markerUnits:a.markerUnits,strokeWidth:a.strokeWidth,orient:a.orient},a.id))})}):null};Xx.displayName="MarkerDefinitions";var nT=B.memo(Xx);function Qx({x:e,y:t,label:n,labelStyle:r={},labelShowBg:s=!0,labelBgStyle:a={},labelBgPadding:c=[2,4],labelBgBorderRadius:u=2,children:h,className:f,...g}){const[y,m]=B.useState({x:1,y:0,width:0,height:0}),w=Vt(["react-flow__edge-textwrapper",f]),C=B.useRef(null);return B.useEffect(()=>{if(C.current){const S=C.current.getBBox();m({x:S.x,y:S.y,width:S.width,height:S.height})}},[n]),typeof n>"u"||!n?null:T.jsxs("g",{transform:`translate(${e-y.width/2} ${t-y.height/2})`,className:w,visibility:y.width?"visible":"hidden",...g,children:[s&&T.jsx("rect",{width:y.width+2*c[0],x:-c[0],y:-c[1],height:y.height+2*c[1],className:"react-flow__edge-textbg",style:a,rx:u,ry:u}),T.jsx("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:C,style:r,children:n}),h]})}Qx.displayName="EdgeText";const rT=B.memo(Qx);function Xh({path:e,labelX:t,labelY:n,label:r,labelStyle:s,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:h,interactionWidth:f=20,...g}){return T.jsxs(T.Fragment,{children:[T.jsx("path",{...g,d:e,fill:"none",className:Vt(["react-flow__edge-path",g.className])}),f&&T.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:f,className:"react-flow__edge-interaction"}),r&&Ur(t)&&Ur(n)?T.jsx(rT,{x:t,y:n,label:r,labelStyle:s,labelShowBg:a,labelBgStyle:c,labelBgPadding:u,labelBgBorderRadius:h}):null]})}function g0({pos:e,x1:t,y1:n,x2:r,y2:s}){return e===Ke.Left||e===Ke.Right?[.5*(t+r),n]:[t,.5*(n+s)]}function Jx({sourceX:e,sourceY:t,sourcePosition:n=Ke.Bottom,targetX:r,targetY:s,targetPosition:a=Ke.Top}){const[c,u]=g0({pos:n,x1:e,y1:t,x2:r,y2:s}),[h,f]=g0({pos:a,x1:r,y1:s,x2:e,y2:t}),[g,y,m,w]=Cx({sourceX:e,sourceY:t,targetX:r,targetY:s,sourceControlX:c,sourceControlY:u,targetControlX:h,targetControlY:f});return[`M${e},${t} C${c},${u} ${h},${f} ${r},${s}`,g,y,m,w]}function Zx(e){return B.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:a,sourcePosition:c=Ke.Bottom,targetPosition:u=Ke.Top,label:h,labelStyle:f,labelShowBg:g,labelBgStyle:y,labelBgPadding:m,labelBgBorderRadius:w,style:C,markerEnd:S,markerStart:_,interactionWidth:P})=>{const[O,R,N]=Jx({sourceX:n,sourceY:r,sourcePosition:c,targetX:s,targetY:a,targetPosition:u}),J=e.isInternal?void 0:t;return T.jsx(Xh,{id:J,path:O,labelX:R,labelY:N,label:h,labelStyle:f,labelShowBg:g,labelBgStyle:y,labelBgPadding:m,labelBgBorderRadius:w,style:C,markerEnd:S,markerStart:_,interactionWidth:P})})}const oT=Zx({isInternal:!1}),eS=Zx({isInternal:!0});oT.displayName="SimpleBezierEdge";eS.displayName="SimpleBezierEdgeInternal";function tS(e){return B.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:a,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:y,style:m,sourcePosition:w=Ke.Bottom,targetPosition:C=Ke.Top,markerEnd:S,markerStart:_,pathOptions:P,interactionWidth:O})=>{const[R,N,J]=Bp({sourceX:n,sourceY:r,sourcePosition:w,targetX:s,targetY:a,targetPosition:C,borderRadius:P==null?void 0:P.borderRadius,offset:P==null?void 0:P.offset}),ce=e.isInternal?void 0:t;return T.jsx(Xh,{id:ce,path:R,labelX:N,labelY:J,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:y,style:m,markerEnd:S,markerStart:_,interactionWidth:O})})}const nS=tS({isInternal:!1}),rS=tS({isInternal:!0});nS.displayName="SmoothStepEdge";rS.displayName="SmoothStepEdgeInternal";function oS(e){return B.memo(({id:t,...n})=>{var s;const r=e.isInternal?void 0:t;return T.jsx(nS,{...n,id:r,pathOptions:B.useMemo(()=>{var a;return{borderRadius:0,offset:(a=n.pathOptions)==null?void 0:a.offset}},[(s=n.pathOptions)==null?void 0:s.offset])})})}const iT=oS({isInternal:!1}),iS=oS({isInternal:!0});iT.displayName="StepEdge";iS.displayName="StepEdgeInternal";function sS(e){return B.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:a,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:y,style:m,markerEnd:w,markerStart:C,interactionWidth:S})=>{const[_,P,O]=Px({sourceX:n,sourceY:r,targetX:s,targetY:a}),R=e.isInternal?void 0:t;return T.jsx(Xh,{id:R,path:_,labelX:P,labelY:O,label:c,labelStyle:u,labelShowBg:h,labelBgStyle:f,labelBgPadding:g,labelBgBorderRadius:y,style:m,markerEnd:w,markerStart:C,interactionWidth:S})})}const sT=sS({isInternal:!1}),aS=sS({isInternal:!0});sT.displayName="StraightEdge";aS.displayName="StraightEdgeInternal";function lS(e){return B.memo(({id:t,sourceX:n,sourceY:r,targetX:s,targetY:a,sourcePosition:c=Ke.Bottom,targetPosition:u=Ke.Top,label:h,labelStyle:f,labelShowBg:g,labelBgStyle:y,labelBgPadding:m,labelBgBorderRadius:w,style:C,markerEnd:S,markerStart:_,pathOptions:P,interactionWidth:O})=>{const[R,N,J]=bx({sourceX:n,sourceY:r,sourcePosition:c,targetX:s,targetY:a,targetPosition:u,curvature:P==null?void 0:P.curvature}),ce=e.isInternal?void 0:t;return T.jsx(Xh,{id:ce,path:R,labelX:N,labelY:J,label:h,labelStyle:f,labelShowBg:g,labelBgStyle:y,labelBgPadding:m,labelBgBorderRadius:w,style:C,markerEnd:S,markerStart:_,interactionWidth:O})})}const aT=lS({isInternal:!1}),cS=lS({isInternal:!0});aT.displayName="BezierEdge";cS.displayName="BezierEdgeInternal";const m0={default:cS,straight:aS,step:iS,smoothstep:rS,simplebezier:eS},y0={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},lT=(e,t,n)=>n===Ke.Left?e-t:n===Ke.Right?e+t:e,cT=(e,t,n)=>n===Ke.Top?e-t:n===Ke.Bottom?e+t:e,v0="react-flow__edgeupdater";function w0({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:s,onMouseEnter:a,onMouseOut:c,type:u}){return T.jsx("circle",{onMouseDown:s,onMouseEnter:a,onMouseOut:c,className:Vt([v0,`${v0}-${u}`]),cx:lT(t,r,e),cy:cT(n,r,e),r,stroke:"transparent",fill:"transparent"})}function uT({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:s,targetX:a,targetY:c,sourcePosition:u,targetPosition:h,onReconnect:f,onReconnectStart:g,onReconnectEnd:y,setReconnecting:m,setUpdateHover:w}){const C=_t(),S=(N,J)=>{if(N.button!==0)return;const{autoPanOnConnect:ce,domNode:G,isValidConnection:te,connectionMode:D,connectionRadius:M,lib:z,onConnectStart:U,onConnectEnd:Y,cancelConnection:$,nodeLookup:F,rfId:L,panBy:K,updateConnection:V}=C.getState(),q=J.type==="target";m(!0),g==null||g(N,n,J.type);const Q=(ie,be)=>{m(!1),y==null||y(ie,n,J.type,be)},W=ie=>f==null?void 0:f(n,ie);zp.onPointerDown(N.nativeEvent,{autoPanOnConnect:ce,connectionMode:D,connectionRadius:M,domNode:G,handleId:J.id,nodeId:J.nodeId,nodeLookup:F,isTarget:q,edgeUpdaterType:J.type,lib:z,flowId:L,cancelConnection:$,panBy:K,isValidConnection:te,onConnect:W,onConnectStart:U,onConnectEnd:Y,onReconnectEnd:Q,updateConnection:V,getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle})},_=N=>S(N,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),P=N=>S(N,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),O=()=>w(!0),R=()=>w(!1);return T.jsxs(T.Fragment,{children:[(e===!0||e==="source")&&T.jsx(w0,{position:u,centerX:r,centerY:s,radius:t,onMouseDown:_,onMouseEnter:O,onMouseOut:R,type:"source"}),(e===!0||e==="target")&&T.jsx(w0,{position:h,centerX:a,centerY:c,radius:t,onMouseDown:P,onMouseEnter:O,onMouseOut:R,type:"target"})]})}function hT({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:s,onDoubleClick:a,onContextMenu:c,onMouseEnter:u,onMouseMove:h,onMouseLeave:f,reconnectRadius:g,onReconnect:y,onReconnectStart:m,onReconnectEnd:w,rfId:C,edgeTypes:S,noPanClassName:_,onError:P,disableKeyboardA11y:O}){let R=dt(Fe=>Fe.edgeLookup.get(e));const N=dt(Fe=>Fe.defaultEdgeOptions);R=N?{...N,...R}:R;let J=R.type||"default",ce=(S==null?void 0:S[J])||m0[J];ce===void 0&&(P==null||P("011",yo.error011(J)),J="default",ce=m0.default);const G=!!(R.focusable||t&&typeof R.focusable>"u"),te=typeof y<"u"&&(R.reconnectable||n&&typeof R.reconnectable>"u"),D=!!(R.selectable||r&&typeof R.selectable>"u"),M=B.useRef(null),[z,U]=B.useState(!1),[Y,$]=B.useState(!1),F=_t(),{zIndex:L,sourceX:K,sourceY:V,targetX:q,targetY:Q,sourcePosition:W,targetPosition:ie}=dt(B.useCallback(Fe=>{const it=Fe.nodeLookup.get(R.source),gt=Fe.nodeLookup.get(R.target);if(!it||!gt)return{zIndex:R.zIndex,...y0};const wt=rA({id:e,sourceNode:it,targetNode:gt,sourceHandle:R.sourceHandle||null,targetHandle:R.targetHandle||null,connectionMode:Fe.connectionMode,onError:P});return{zIndex:X_({selected:R.selected,zIndex:R.zIndex,sourceNode:it,targetNode:gt,elevateOnSelect:Fe.elevateEdgesOnSelect}),...wt||y0}},[R.source,R.target,R.sourceHandle,R.targetHandle,R.selected,R.zIndex]),Ft),be=B.useMemo(()=>R.markerStart?`url('#${$p(R.markerStart,C)}')`:void 0,[R.markerStart,C]),Se=B.useMemo(()=>R.markerEnd?`url('#${$p(R.markerEnd,C)}')`:void 0,[R.markerEnd,C]);if(R.hidden||K===null||V===null||q===null||Q===null)return null;const _e=Fe=>{var Zt;const{addSelectedEdges:it,unselectNodesAndEdges:gt,multiSelectionActive:wt}=F.getState();D&&(F.setState({nodesSelectionActive:!1}),R.selected&&wt?(gt({nodes:[],edges:[R]}),(Zt=M.current)==null||Zt.blur()):it([e])),s&&s(Fe,R)},Oe=a?Fe=>{a(Fe,{...R})}:void 0,Be=c?Fe=>{c(Fe,{...R})}:void 0,Ae=u?Fe=>{u(Fe,{...R})}:void 0,Ce=h?Fe=>{h(Fe,{...R})}:void 0,Qe=f?Fe=>{f(Fe,{...R})}:void 0,tt=Fe=>{var it;if(!O&&lx.includes(Fe.key)&&D){const{unselectNodesAndEdges:gt,addSelectedEdges:wt}=F.getState();Fe.key==="Escape"?((it=M.current)==null||it.blur(),gt({edges:[R]})):wt([e])}};return T.jsx("svg",{style:{zIndex:L},children:T.jsxs("g",{className:Vt(["react-flow__edge",`react-flow__edge-${J}`,R.className,_,{selected:R.selected,animated:R.animated,inactive:!D&&!s,updating:z,selectable:D}]),onClick:_e,onDoubleClick:Oe,onContextMenu:Be,onMouseEnter:Ae,onMouseMove:Ce,onMouseLeave:Qe,onKeyDown:G?tt:void 0,tabIndex:G?0:void 0,role:G?"button":"img","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":R.ariaLabel===null?void 0:R.ariaLabel||`Edge from ${R.source} to ${R.target}`,"aria-describedby":G?`${Bx}-${C}`:void 0,ref:M,children:[!Y&&T.jsx(ce,{id:e,source:R.source,target:R.target,type:R.type,selected:R.selected,animated:R.animated,selectable:D,deletable:R.deletable??!0,label:R.label,labelStyle:R.labelStyle,labelShowBg:R.labelShowBg,labelBgStyle:R.labelBgStyle,labelBgPadding:R.labelBgPadding,labelBgBorderRadius:R.labelBgBorderRadius,sourceX:K,sourceY:V,targetX:q,targetY:Q,sourcePosition:W,targetPosition:ie,data:R.data,style:R.style,sourceHandleId:R.sourceHandle,targetHandleId:R.targetHandle,markerStart:be,markerEnd:Se,pathOptions:"pathOptions"in R?R.pathOptions:void 0,interactionWidth:R.interactionWidth}),te&&T.jsx(uT,{edge:R,isReconnectable:te,reconnectRadius:g,onReconnect:y,onReconnectStart:m,onReconnectEnd:w,sourceX:K,sourceY:V,targetX:q,targetY:Q,sourcePosition:W,targetPosition:ie,setUpdateHover:U,setReconnecting:$})]})})}const dT=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function uS({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:s,onReconnect:a,onEdgeContextMenu:c,onEdgeMouseEnter:u,onEdgeMouseMove:h,onEdgeMouseLeave:f,onEdgeClick:g,reconnectRadius:y,onEdgeDoubleClick:m,onReconnectStart:w,onReconnectEnd:C,disableKeyboardA11y:S}){const{edgesFocusable:_,edgesReconnectable:P,elementsSelectable:O,onError:R}=dt(dT,Ft),N=QR(t);return T.jsxs("div",{className:"react-flow__edges",children:[T.jsx(nT,{defaultColor:e,rfId:n}),N.map(J=>T.jsx(hT,{id:J,edgesFocusable:_,edgesReconnectable:P,elementsSelectable:O,noPanClassName:s,onReconnect:a,onContextMenu:c,onMouseEnter:u,onMouseMove:h,onMouseLeave:f,onClick:g,reconnectRadius:y,onDoubleClick:m,onReconnectStart:w,onReconnectEnd:C,rfId:n,onError:R,edgeTypes:r,disableKeyboardA11y:S},J))]})}uS.displayName="EdgeRenderer";const fT=B.memo(uS),pT=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function gT({children:e}){const t=dt(pT);return T.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function mT(e){const t=Gh(),n=B.useRef(!1);B.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const yT=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function vT(e){const t=dt(yT),n=_t();return B.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function wT(e){return e.connection.inProgress?{...e.connection,to:Sc(e.connection.to,e.transform)}:{...e.connection}}function xT(e){return wT}function ST(e){const t=xT();return dt(t,Ft)}const CT=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function bT({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:s,width:a,height:c,isValid:u,inProgress:h}=dt(CT,Ft);return!(a&&s&&h)?null:T.jsx("svg",{style:e,width:a,height:c,className:"react-flow__connectionline react-flow__container",children:T.jsx("g",{className:Vt(["react-flow__connection",ux(u)]),children:T.jsx(hS,{style:t,type:n,CustomComponent:r,isValid:u})})})}const hS=({style:e,type:t=Di.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:s,from:a,fromNode:c,fromHandle:u,fromPosition:h,to:f,toNode:g,toHandle:y,toPosition:m}=ST();if(!s)return;if(n)return T.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:c,fromHandle:u,fromX:a.x,fromY:a.y,toX:f.x,toY:f.y,fromPosition:h,toPosition:m,connectionStatus:ux(r),toNode:g,toHandle:y});let w="";const C={sourceX:a.x,sourceY:a.y,sourcePosition:h,targetX:f.x,targetY:f.y,targetPosition:m};switch(t){case Di.Bezier:[w]=bx(C);break;case Di.SimpleBezier:[w]=Jx(C);break;case Di.Step:[w]=Bp({...C,borderRadius:0});break;case Di.SmoothStep:[w]=Bp(C);break;default:[w]=Px(C)}return T.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:e})};hS.displayName="ConnectionLine";const ET={};function x0(e=ET){B.useRef(e),_t(),B.useEffect(()=>{},[e])}function PT(){_t(),B.useRef(!1),B.useEffect(()=>{},[])}function dS({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:s,onNodeDoubleClick:a,onEdgeDoubleClick:c,onNodeMouseEnter:u,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:g,onSelectionContextMenu:y,onSelectionStart:m,onSelectionEnd:w,connectionLineType:C,connectionLineStyle:S,connectionLineComponent:_,connectionLineContainerStyle:P,selectionKeyCode:O,selectionOnDrag:R,selectionMode:N,multiSelectionKeyCode:J,panActivationKeyCode:ce,zoomActivationKeyCode:G,deleteKeyCode:te,onlyRenderVisibleElements:D,elementsSelectable:M,defaultViewport:z,translateExtent:U,minZoom:Y,maxZoom:$,preventScrolling:F,defaultMarkerColor:L,zoomOnScroll:K,zoomOnPinch:V,panOnScroll:q,panOnScrollSpeed:Q,panOnScrollMode:W,zoomOnDoubleClick:ie,panOnDrag:be,onPaneClick:Se,onPaneMouseEnter:_e,onPaneMouseMove:Oe,onPaneMouseLeave:Be,onPaneScroll:Ae,onPaneContextMenu:Ce,paneClickDistance:Qe,nodeClickDistance:tt,onEdgeContextMenu:Fe,onEdgeMouseEnter:it,onEdgeMouseMove:gt,onEdgeMouseLeave:wt,reconnectRadius:Zt,onReconnect:xo,onReconnectStart:ti,onReconnectEnd:So,noDragClassName:gn,noWheelClassName:Lt,noPanClassName:Zn,disableKeyboardA11y:Pn,nodeExtent:Co,rfId:_n,viewport:en,onViewportChange:er}){return x0(e),x0(t),PT(),mT(n),vT(en),T.jsx(zR,{onPaneClick:Se,onPaneMouseEnter:_e,onPaneMouseMove:Oe,onPaneMouseLeave:Be,onPaneContextMenu:Ce,onPaneScroll:Ae,paneClickDistance:Qe,deleteKeyCode:te,selectionKeyCode:O,selectionOnDrag:R,selectionMode:N,onSelectionStart:m,onSelectionEnd:w,multiSelectionKeyCode:J,panActivationKeyCode:ce,zoomActivationKeyCode:G,elementsSelectable:M,zoomOnScroll:K,zoomOnPinch:V,zoomOnDoubleClick:ie,panOnScroll:q,panOnScrollSpeed:Q,panOnScrollMode:W,panOnDrag:be,defaultViewport:z,translateExtent:U,minZoom:Y,maxZoom:$,onSelectionContextMenu:y,preventScrolling:F,noDragClassName:gn,noWheelClassName:Lt,noPanClassName:Zn,disableKeyboardA11y:Pn,onViewportChange:er,isControlledViewport:!!en,children:T.jsxs(gT,{children:[T.jsx(fT,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:c,onReconnect:xo,onReconnectStart:ti,onReconnectEnd:So,onlyRenderVisibleElements:D,onEdgeContextMenu:Fe,onEdgeMouseEnter:it,onEdgeMouseMove:gt,onEdgeMouseLeave:wt,reconnectRadius:Zt,defaultMarkerColor:L,noPanClassName:Zn,disableKeyboardA11y:Pn,rfId:_n}),T.jsx(bT,{style:S,type:C,component:_,containerStyle:P}),T.jsx("div",{className:"react-flow__edgelabel-renderer"}),T.jsx(XR,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:a,onNodeMouseEnter:u,onNodeMouseMove:h,onNodeMouseLeave:f,onNodeContextMenu:g,nodeClickDistance:tt,onlyRenderVisibleElements:D,noPanClassName:Zn,noDragClassName:gn,disableKeyboardA11y:Pn,nodeExtent:Co,rfId:_n}),T.jsx("div",{className:"react-flow__viewport-portal"})]})})}dS.displayName="GraphView";const _T=B.memo(dS),S0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:a,fitView:c,nodeOrigin:u,nodeExtent:h}={})=>{const f=new Map,g=new Map,y=new Map,m=new Map,w=r??t??[],C=n??e??[],S=u??[0,0],_=h??nc;Ax(y,m,w),Vp(C,f,g,{nodeOrigin:S,nodeExtent:_,elevateNodesOnSelect:!1});let P=[0,0,1];if(c&&s&&a){const O=xc(f,{filter:ce=>!!((ce.width||ce.initialWidth)&&(ce.height||ce.initialHeight))}),{x:R,y:N,zoom:J}=Sg(O,s,a,.5,2,.1);P=[R,N,J]}return{rfId:"1",width:0,height:0,transform:P,nodes:C,nodeLookup:f,parentLookup:g,edges:w,edgeLookup:m,connectionLookup:y,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:.5,maxZoom:2,translateExtent:nc,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:$a.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:S,nodeDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,fitViewOnInit:!1,fitViewDone:!1,fitViewOnInitOptions:void 0,selectNodesOnDrag:!0,multiSelectionActive:!1,connection:{...cx},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanSpeed:15,connectionRadius:20,onError:K_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1}},AT=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:a,fitView:c,nodeOrigin:u,nodeExtent:h})=>WA((f,g)=>({...S0({nodes:e,edges:t,width:s,height:a,fitView:c,nodeOrigin:u,nodeExtent:h,defaultNodes:n,defaultEdges:r}),setNodes:y=>{const{nodeLookup:m,parentLookup:w,nodeOrigin:C,elevateNodesOnSelect:S}=g();Vp(y,m,w,{nodeOrigin:C,nodeExtent:h,elevateNodesOnSelect:S,checkEquality:!0}),f({nodes:y})},setEdges:y=>{const{connectionLookup:m,edgeLookup:w}=g();Ax(m,w,y),f({edges:y})},setDefaultNodesAndEdges:(y,m)=>{if(y){const{setNodes:w}=g();w(y),f({hasDefaultNodes:!0})}if(m){const{setEdges:w}=g();w(m),f({hasDefaultEdges:!0})}},updateNodeInternals:(y,m={triggerFitView:!0})=>{const{triggerNodeChanges:w,nodeLookup:C,parentLookup:S,fitViewOnInit:_,fitViewDone:P,fitViewOnInitOptions:O,domNode:R,nodeOrigin:N,nodeExtent:J,debug:ce,fitViewSync:G}=g(),{changes:te,updatedInternals:D}=cA(y,C,S,R,N,J);if(D){if(sA(C,S,{nodeOrigin:N,nodeExtent:J}),m.triggerFitView){let M=P;!P&&_&&(M=G({...O,nodes:O==null?void 0:O.nodes})),f({fitViewDone:M})}else f({});(te==null?void 0:te.length)>0&&(ce&&console.log("React Flow: trigger node changes",te),w==null||w(te))}},updateNodePositions:(y,m=!1)=>{const w=[],C=[];for(const[S,_]of y){const P=!!(_!=null&&_.expandParent&&(_!=null&&_.parentId)&&(_!=null&&_.position)),O={id:S,type:"position",position:P?{x:Math.max(0,_.position.x),y:Math.max(0,_.position.y)}:_.position,dragging:m};P&&w.push({id:S,parentId:_.parentId,rect:{..._.internals.positionAbsolute,width:_.measured.width,height:_.measured.height}}),C.push(O)}if(w.length>0){const{nodeLookup:S,parentLookup:_,nodeOrigin:P}=g(),O=Pg(w,S,_,P);C.push(...O)}g().triggerNodeChanges(C)},triggerNodeChanges:y=>{const{onNodesChange:m,setNodes:w,nodes:C,hasDefaultNodes:S,debug:_}=g();if(y!=null&&y.length){if(S){const P=zx(y,C);w(P)}_&&console.log("React Flow: trigger node changes",y),m==null||m(y)}},triggerEdgeChanges:y=>{const{onEdgesChange:m,setEdges:w,edges:C,hasDefaultEdges:S,debug:_}=g();if(y!=null&&y.length){if(S){const P=Hx(y,C);w(P)}_&&console.log("React Flow: trigger edge changes",y),m==null||m(y)}},addSelectedNodes:y=>{const{multiSelectionActive:m,edgeLookup:w,nodeLookup:C,triggerNodeChanges:S,triggerEdgeChanges:_}=g();if(m){const P=y.map(O=>Rs(O,!0));S(P);return}S(Ma(C,new Set([...y]),!0)),_(Ma(w))},addSelectedEdges:y=>{const{multiSelectionActive:m,edgeLookup:w,nodeLookup:C,triggerNodeChanges:S,triggerEdgeChanges:_}=g();if(m){const P=y.map(O=>Rs(O,!0));_(P);return}_(Ma(w,new Set([...y]))),S(Ma(C,new Set,!0))},unselectNodesAndEdges:({nodes:y,edges:m}={})=>{const{edges:w,nodes:C,nodeLookup:S,triggerNodeChanges:_,triggerEdgeChanges:P}=g(),O=y||C,R=m||w,N=O.map(ce=>{const G=S.get(ce.id);return G&&(G.selected=!1),Rs(ce.id,!1)}),J=R.map(ce=>Rs(ce.id,!1));_(N),P(J)},setMinZoom:y=>{const{panZoom:m,maxZoom:w}=g();m==null||m.setScaleExtent([y,w]),f({minZoom:y})},setMaxZoom:y=>{const{panZoom:m,minZoom:w}=g();m==null||m.setScaleExtent([w,y]),f({maxZoom:y})},setTranslateExtent:y=>{var m;(m=g().panZoom)==null||m.setTranslateExtent(y),f({translateExtent:y})},setPaneClickDistance:y=>{var m;(m=g().panZoom)==null||m.setClickDistance(y)},resetSelectedElements:()=>{const{edges:y,nodes:m,triggerNodeChanges:w,triggerEdgeChanges:C}=g(),S=m.reduce((P,O)=>O.selected?[...P,Rs(O.id,!1)]:P,[]),_=y.reduce((P,O)=>O.selected?[...P,Rs(O.id,!1)]:P,[]);w(S),C(_)},setNodeExtent:y=>{const{nodes:m,nodeLookup:w,parentLookup:C,nodeOrigin:S,elevateNodesOnSelect:_,nodeExtent:P}=g();y[0][0]===P[0][0]&&y[0][1]===P[0][1]&&y[1][0]===P[1][0]&&y[1][1]===P[1][1]||(Vp(m,w,C,{nodeOrigin:S,nodeExtent:y,elevateNodesOnSelect:_,checkEquality:!1}),f({nodeExtent:y}))},panBy:y=>{const{transform:m,width:w,height:C,panZoom:S,translateExtent:_}=g();return uA({delta:y,panZoom:S,transform:m,translateExtent:_,width:w,height:C})},fitView:y=>{const{panZoom:m,width:w,height:C,minZoom:S,maxZoom:_,nodeLookup:P}=g();if(!m)return Promise.resolve(!1);const O=Mp(P,y);return Ip({nodes:O,width:w,height:C,panZoom:m,minZoom:S,maxZoom:_},y)},fitViewSync:y=>{const{panZoom:m,width:w,height:C,minZoom:S,maxZoom:_,nodeLookup:P}=g();if(!m)return!1;const O=Mp(P,y);return Ip({nodes:O,width:w,height:C,panZoom:m,minZoom:S,maxZoom:_},y),O.size>0},cancelConnection:()=>{f({connection:{...cx}})},updateConnection:y=>{f({connection:y})},reset:()=>f({...S0()})}),Object.is);function fS({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:s,initialHeight:a,fitView:c,nodeOrigin:u,nodeExtent:h,children:f}){const[g]=B.useState(()=>AT({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:s,height:a,fitView:c,nodeOrigin:u,nodeExtent:h}));return T.jsx(GA,{value:g,children:T.jsx(mR,{children:f})})}function RT({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:s,width:a,height:c,fitView:u,nodeOrigin:h,nodeExtent:f}){return B.useContext(qh)?T.jsx(T.Fragment,{children:e}):T.jsx(fS,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:s,initialWidth:a,initialHeight:c,fitView:u,nodeOrigin:h,nodeExtent:f,children:e})}const TT={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function kT({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:s,nodeTypes:a,edgeTypes:c,onNodeClick:u,onEdgeClick:h,onInit:f,onMove:g,onMoveStart:y,onMoveEnd:m,onConnect:w,onConnectStart:C,onConnectEnd:S,onClickConnectStart:_,onClickConnectEnd:P,onNodeMouseEnter:O,onNodeMouseMove:R,onNodeMouseLeave:N,onNodeContextMenu:J,onNodeDoubleClick:ce,onNodeDragStart:G,onNodeDrag:te,onNodeDragStop:D,onNodesDelete:M,onEdgesDelete:z,onDelete:U,onSelectionChange:Y,onSelectionDragStart:$,onSelectionDrag:F,onSelectionDragStop:L,onSelectionContextMenu:K,onSelectionStart:V,onSelectionEnd:q,onBeforeDelete:Q,connectionMode:W,connectionLineType:ie=Di.Bezier,connectionLineStyle:be,connectionLineComponent:Se,connectionLineContainerStyle:_e,deleteKeyCode:Oe="Backspace",selectionKeyCode:Be="Shift",selectionOnDrag:Ae=!1,selectionMode:Ce=rc.Full,panActivationKeyCode:Qe="Space",multiSelectionKeyCode:tt=Ph()?"Meta":"Control",zoomActivationKeyCode:Fe=Ph()?"Meta":"Control",snapToGrid:it,snapGrid:gt,onlyRenderVisibleElements:wt=!1,selectNodesOnDrag:Zt,nodesDraggable:xo,nodesConnectable:ti,nodesFocusable:So,nodeOrigin:gn=$x,edgesFocusable:Lt,edgesReconnectable:Zn,elementsSelectable:Pn=!0,defaultViewport:Co=sR,minZoom:_n=.5,maxZoom:en=2,translateExtent:er=nc,preventScrolling:tr=!0,nodeExtent:Xr,defaultMarkerColor:nr="#b1b1b7",zoomOnScroll:mn=!0,zoomOnPinch:ni=!0,panOnScroll:ri=!1,panOnScrollSpeed:Fn=.5,panOnScrollMode:Ue=Is.Free,zoomOnDoubleClick:Sr=!0,panOnDrag:Ln=!0,onPaneClick:Qr,onPaneMouseEnter:je,onPaneMouseMove:bo,onPaneMouseLeave:Cr,onPaneScroll:rr,onPaneContextMenu:Ki,paneClickDistance:Eo=0,nodeClickDistance:Us=0,children:Ws,onReconnect:br,onReconnectStart:or,onReconnectEnd:oi,onEdgeContextMenu:ir,onEdgeDoubleClick:yt,onEdgeMouseEnter:Ct,onEdgeMouseMove:Ja,onEdgeMouseLeave:sr,reconnectRadius:Er=10,onNodesChange:Pr,onEdgesChange:Yi,noDragClassName:ar="nodrag",noWheelClassName:Jr="nowheel",noPanClassName:jn="nopan",fitView:yn,fitViewOptions:qs,connectOnClick:Bn,attributionPosition:Gs,proOptions:lr,defaultEdgeOptions:Xi,elevateNodesOnSelect:ii,elevateEdgesOnSelect:bt,disableKeyboardA11y:cr=!1,autoPanOnConnect:$n,autoPanOnNodeDrag:Et,autoPanSpeed:Zr,connectionRadius:eo,isValidConnection:si,onError:to,style:_r,id:ai,nodeDragThreshold:Ar,viewport:vn,onViewportChange:lt,width:tn,height:Ks,colorMode:Ys="light",debug:vt,...ur},hr){const nn=ai||"1",no=uR(Ys);return T.jsx("div",{"data-testid":"rf__wrapper",...ur,style:{..._r,...TT},ref:hr,className:Vt(["react-flow",s,no]),id:ai,children:T.jsxs(RT,{nodes:e,edges:t,width:tn,height:Ks,fitView:yn,nodeOrigin:gn,nodeExtent:Xr,children:[T.jsx(_T,{onInit:f,onNodeClick:u,onEdgeClick:h,onNodeMouseEnter:O,onNodeMouseMove:R,onNodeMouseLeave:N,onNodeContextMenu:J,onNodeDoubleClick:ce,nodeTypes:a,edgeTypes:c,connectionLineType:ie,connectionLineStyle:be,connectionLineComponent:Se,connectionLineContainerStyle:_e,selectionKeyCode:Be,selectionOnDrag:Ae,selectionMode:Ce,deleteKeyCode:Oe,multiSelectionKeyCode:tt,panActivationKeyCode:Qe,zoomActivationKeyCode:Fe,onlyRenderVisibleElements:wt,defaultViewport:Co,translateExtent:er,minZoom:_n,maxZoom:en,preventScrolling:tr,zoomOnScroll:mn,zoomOnPinch:ni,zoomOnDoubleClick:Sr,panOnScroll:ri,panOnScrollSpeed:Fn,panOnScrollMode:Ue,panOnDrag:Ln,onPaneClick:Qr,onPaneMouseEnter:je,onPaneMouseMove:bo,onPaneMouseLeave:Cr,onPaneScroll:rr,onPaneContextMenu:Ki,paneClickDistance:Eo,nodeClickDistance:Us,onSelectionContextMenu:K,onSelectionStart:V,onSelectionEnd:q,onReconnect:br,onReconnectStart:or,onReconnectEnd:oi,onEdgeContextMenu:ir,onEdgeDoubleClick:yt,onEdgeMouseEnter:Ct,onEdgeMouseMove:Ja,onEdgeMouseLeave:sr,reconnectRadius:Er,defaultMarkerColor:nr,noDragClassName:ar,noWheelClassName:Jr,noPanClassName:jn,rfId:nn,disableKeyboardA11y:cr,nodeExtent:Xr,viewport:vn,onViewportChange:lt}),T.jsx(cR,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:w,onConnectStart:C,onConnectEnd:S,onClickConnectStart:_,onClickConnectEnd:P,nodesDraggable:xo,nodesConnectable:ti,nodesFocusable:So,edgesFocusable:Lt,edgesReconnectable:Zn,elementsSelectable:Pn,elevateNodesOnSelect:ii,elevateEdgesOnSelect:bt,minZoom:_n,maxZoom:en,nodeExtent:Xr,onNodesChange:Pr,onEdgesChange:Yi,snapToGrid:it,snapGrid:gt,connectionMode:W,translateExtent:er,connectOnClick:Bn,defaultEdgeOptions:Xi,fitView:yn,fitViewOptions:qs,onNodesDelete:M,onEdgesDelete:z,onDelete:U,onNodeDragStart:G,onNodeDrag:te,onNodeDragStop:D,onSelectionDrag:F,onSelectionDragStart:$,onSelectionDragStop:L,onMove:g,onMoveStart:y,onMoveEnd:m,noPanClassName:jn,nodeOrigin:gn,rfId:nn,autoPanOnConnect:$n,autoPanOnNodeDrag:Et,autoPanSpeed:Zr,onError:to,connectionRadius:eo,isValidConnection:si,selectNodesOnDrag:Zt,nodeDragThreshold:Ar,onBeforeDelete:Q,paneClickDistance:Eo,debug:vt}),T.jsx(iR,{onSelectionChange:Y}),Ws,T.jsx(eR,{proOptions:lr,position:Gs}),T.jsx(JA,{rfId:nn,disableKeyboardA11y:cr})]})})}var OT=Ux(kT);function NT(){const e=_t();return B.useCallback(t=>{const{domNode:n,updateNodeInternals:r}=e.getState(),s=Array.isArray(t)?t:[t],a=new Map;s.forEach(c=>{const u=n==null?void 0:n.querySelector(`.react-flow__node[data-id="${c}"]`);u&&a.set(c,{id:c,nodeElement:u,force:!0})}),requestAnimationFrame(()=>r(a,{triggerFitView:!1}))},[])}function DT({onStart:e,onChange:t,onEnd:n}){const r=_t();B.useEffect(()=>{r.setState({onViewportChangeStart:e})},[e]),B.useEffect(()=>{r.setState({onViewportChange:t})},[t]),B.useEffect(()=>{r.setState({onViewportChangeEnd:n})},[n])}const MT=yo.error014();function IT({id:e,handleType:t,handleId:n,onConnect:r,onDisconnect:s}={}){const a=Yh(),c=e??a;if(!c)throw new Error(MT);const u=B.useRef(null),h=dt(f=>f.connectionLookup.get(`${c}${t?n?`-${t}-${n}`:`-${t}`:""}`),z_);return B.useEffect(()=>{if(u.current&&u.current!==h){const f=h??new Map;Mv(u.current,f,s),Mv(f,u.current,r)}u.current=h??new Map},[h,r,s]),B.useMemo(()=>Array.from((h==null?void 0:h.values())??[]),[h])}function FT({dimensions:e,lineWidth:t,variant:n,className:r}){return T.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Vt(["react-flow__background-pattern",n,r])})}function LT({radius:e,className:t}){return T.jsx("circle",{cx:e,cy:e,r:e,className:Vt(["react-flow__background-pattern","dots",t])})}var Fi;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Fi||(Fi={}));const jT={[Fi.Dots]:1,[Fi.Lines]:1,[Fi.Cross]:6},BT=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function pS({id:e,variant:t=Fi.Dots,gap:n=20,size:r,lineWidth:s=1,offset:a=0,color:c,bgColor:u,style:h,className:f,patternClassName:g}){const y=B.useRef(null),{transform:m,patternId:w}=dt(BT,Ft),C=r||jT[t],S=t===Fi.Dots,_=t===Fi.Cross,P=Array.isArray(n)?n:[n,n],O=[P[0]*m[2]||1,P[1]*m[2]||1],R=C*m[2],N=Array.isArray(a)?a:[a,a],J=_?[R,R]:O,ce=[N[0]*m[2]||1+J[0]/2,N[1]*m[2]||1+J[1]/2],G=`${w}${e||""}`;return T.jsxs("svg",{className:Vt(["react-flow__background",f]),style:{...h,...Kh,"--xy-background-color-props":u,"--xy-background-pattern-color-props":c},ref:y,"data-testid":"rf__background",children:[T.jsx("pattern",{id:G,x:m[0]%O[0],y:m[1]%O[1],width:O[0],height:O[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${ce[0]},-${ce[1]})`,children:S?T.jsx(LT,{radius:R/2,className:g}):T.jsx(FT,{dimensions:J,lineWidth:s,variant:t,className:g})}),T.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${G})`})]})}pS.displayName="Background";const $T=B.memo(pS);function VT(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:T.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function zT(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:T.jsx("path",{d:"M0 0h32v4.2H0z"})})}function HT(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:T.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function UT(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:T.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function WT(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:T.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function qu({children:e,className:t,...n}){return T.jsx("button",{type:"button",className:Vt(["react-flow__controls-button",t]),...n,children:e})}const qT=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom});function gS({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:s,onZoomIn:a,onZoomOut:c,onFitView:u,onInteractiveChange:h,className:f,children:g,position:y="bottom-left",orientation:m="vertical","aria-label":w="React Flow controls"}){const C=_t(),{isInteractive:S,minZoomReached:_,maxZoomReached:P}=dt(qT,Ft),{zoomIn:O,zoomOut:R,fitView:N}=Gh(),J=()=>{O(),a==null||a()},ce=()=>{R(),c==null||c()},G=()=>{N(s),u==null||u()},te=()=>{C.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),h==null||h(!S)},D=m==="horizontal"?"horizontal":"vertical";return T.jsxs(_g,{className:Vt(["react-flow__controls",D,f]),position:y,style:e,"data-testid":"rf__controls","aria-label":w,children:[t&&T.jsxs(T.Fragment,{children:[T.jsx(qu,{onClick:J,className:"react-flow__controls-zoomin",title:"zoom in","aria-label":"zoom in",disabled:P,children:T.jsx(VT,{})}),T.jsx(qu,{onClick:ce,className:"react-flow__controls-zoomout",title:"zoom out","aria-label":"zoom out",disabled:_,children:T.jsx(zT,{})})]}),n&&T.jsx(qu,{className:"react-flow__controls-fitview",onClick:G,title:"fit view","aria-label":"fit view",children:T.jsx(HT,{})}),r&&T.jsx(qu,{className:"react-flow__controls-interactive",onClick:te,title:"toggle interactivity","aria-label":"toggle interactivity",children:S?T.jsx(WT,{}):T.jsx(UT,{})}),g]})}gS.displayName="Controls";const GT=B.memo(gS);function KT({id:e,x:t,y:n,width:r,height:s,style:a,color:c,strokeColor:u,strokeWidth:h,className:f,borderRadius:g,shapeRendering:y,selected:m,onClick:w}){const{background:C,backgroundColor:S}=a||{},_=c||C||S;return T.jsx("rect",{className:Vt(["react-flow__minimap-node",{selected:m},f]),x:t,y:n,rx:g,ry:g,width:r,height:s,style:{fill:_,stroke:u,strokeWidth:h},shapeRendering:y,onClick:w?P=>w(P,e):void 0})}const YT=B.memo(KT),XT=e=>e.nodes.map(t=>t.id),Xf=e=>e instanceof Function?e:()=>e;function QT({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:s,nodeComponent:a=YT,onClick:c}){const u=dt(XT,Ft),h=Xf(t),f=Xf(e),g=Xf(n),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return T.jsx(T.Fragment,{children:u.map(m=>T.jsx(ZT,{id:m,nodeColorFunc:h,nodeStrokeColorFunc:f,nodeClassNameFunc:g,nodeBorderRadius:r,nodeStrokeWidth:s,NodeComponent:a,onClick:c,shapeRendering:y},m))})}function JT({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:s,nodeStrokeWidth:a,shapeRendering:c,NodeComponent:u,onClick:h}){const{node:f,x:g,y,width:m,height:w}=dt(C=>{const S=C.nodeLookup.get(e),{x:_,y:P}=S.internals.positionAbsolute,{width:O,height:R}=Zo(S);return{node:S,x:_,y:P,width:O,height:R}},Ft);return!f||f.hidden||!vx(f)?null:T.jsx(u,{x:g,y,width:m,height:w,style:f.style,selected:!!f.selected,className:r(f),color:t(f),borderRadius:s,strokeColor:n(f),strokeWidth:a,shapeRendering:c,onClick:h,id:f.id})}const ZT=B.memo(JT);var ek=B.memo(QT);const tk=200,nk=150,rk=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?mx(xc(e.nodeLookup),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height}},ok="react-flow__minimap-desc";function mS({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:s="",nodeBorderRadius:a=5,nodeStrokeWidth:c,nodeComponent:u,bgColor:h,maskColor:f,maskStrokeColor:g,maskStrokeWidth:y,position:m="bottom-right",onClick:w,onNodeClick:C,pannable:S=!1,zoomable:_=!1,ariaLabel:P="React Flow mini map",inversePan:O,zoomStep:R=10,offsetScale:N=5}){const J=_t(),ce=B.useRef(null),{boundingRect:G,viewBB:te,rfId:D,panZoom:M,translateExtent:z,flowWidth:U,flowHeight:Y}=dt(rk,Ft),$=(e==null?void 0:e.width)??tk,F=(e==null?void 0:e.height)??nk,L=G.width/$,K=G.height/F,V=Math.max(L,K),q=V*$,Q=V*F,W=N*V,ie=G.x-(q-G.width)/2-W,be=G.y-(Q-G.height)/2-W,Se=q+W*2,_e=Q+W*2,Oe=`${ok}-${D}`,Be=B.useRef(0),Ae=B.useRef();Be.current=V,B.useEffect(()=>{if(ce.current&&M)return Ae.current=vA({domNode:ce.current,panZoom:M,getTransform:()=>J.getState().transform,getViewScale:()=>Be.current}),()=>{var tt;(tt=Ae.current)==null||tt.destroy()}},[M]),B.useEffect(()=>{var tt;(tt=Ae.current)==null||tt.update({translateExtent:z,width:U,height:Y,inversePan:O,pannable:S,zoomStep:R,zoomable:_})},[S,_,O,R,z,U,Y]);const Ce=w?tt=>{var gt;const[Fe,it]=((gt=Ae.current)==null?void 0:gt.pointer(tt))||[0,0];w(tt,{x:Fe,y:it})}:void 0,Qe=C?B.useCallback((tt,Fe)=>{const it=J.getState().nodeLookup.get(Fe);C(tt,it)},[]):void 0;return T.jsx(_g,{position:m,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof y=="number"?y*V:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="string"?c:void 0},className:Vt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:T.jsxs("svg",{width:$,height:F,viewBox:`${ie} ${be} ${Se} ${_e}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Oe,ref:ce,onClick:Ce,children:[P&&T.jsx("title",{id:Oe,children:P}),T.jsx(ek,{onClick:Qe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:s,nodeStrokeWidth:c,nodeComponent:u}),T.jsx("path",{className:"react-flow__minimap-mask",d:`M${ie-W},${be-W}h${Se+W*2}v${_e+W*2}h${-Se-W*2}z + M${te.x},${te.y}h${te.width}v${te.height}h${-te.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}mS.displayName="MiniMap";B.memo(mS);function ik({nodeId:e,position:t,variant:n=Kl.Handle,className:r,style:s={},children:a,color:c,minWidth:u=10,minHeight:h=10,maxWidth:f=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:y=!1,shouldResize:m,onResizeStart:w,onResize:C,onResizeEnd:S}){const _=Yh(),P=typeof e=="string"?e:_,O=_t(),R=B.useRef(null),N=n===Kl.Line?"right":"bottom-right",J=t??N,ce=B.useRef(null);B.useEffect(()=>{if(!(!R.current||!P))return ce.current||(ce.current=DA({domNode:R.current,nodeId:P,getStoreItems:()=>{const{nodeLookup:M,transform:z,snapGrid:U,snapToGrid:Y,nodeOrigin:$,domNode:F}=O.getState();return{nodeLookup:M,transform:z,snapGrid:U,snapToGrid:Y,nodeOrigin:$,paneDomNode:F}},onChange:(M,z)=>{const{triggerNodeChanges:U,nodeLookup:Y,parentLookup:$,nodeOrigin:F}=O.getState(),L=[],K={x:M.x,y:M.y},V=Y.get(P);if(V&&V.expandParent&&V.parentId){const q=V.origin??F,Q=M.width??V.measured.width,W=M.height??V.measured.height,ie={id:V.id,parentId:V.parentId,rect:{width:Q,height:W,...wx({x:M.x??V.position.x,y:M.y??V.position.y},{width:Q,height:W},V.parentId,Y,q)}},be=Pg([ie],Y,$,F);L.push(...be),K.x=M.x?Math.max(q[0]*Q,M.x):void 0,K.y=M.y?Math.max(q[1]*W,M.y):void 0}if(K.x!==void 0&&K.y!==void 0){const q={id:P,type:"position",position:{...K}};L.push(q)}if(M.width!==void 0&&M.height!==void 0){const q={id:P,type:"dimensions",resizing:!0,setAttributes:!0,dimensions:{width:M.width,height:M.height}};L.push(q)}for(const q of z){const Q={...q,type:"position"};L.push(Q)}U(L)},onEnd:()=>{const M={id:P,type:"dimensions",resizing:!1};O.getState().triggerNodeChanges([M])}})),ce.current.update({controlPosition:J,boundaries:{minWidth:u,minHeight:h,maxWidth:f,maxHeight:g},keepAspectRatio:y,onResizeStart:w,onResize:C,onResizeEnd:S,shouldResize:m}),()=>{var M;(M=ce.current)==null||M.destroy()}},[J,u,h,f,g,y,w,C,S,m]);const G=J.split("-"),te=n===Kl.Line?"borderColor":"backgroundColor",D=c?{...s,[te]:c}:s;return T.jsx("div",{className:Vt(["react-flow__resize-control","nodrag",...G,n,r]),ref:R,style:D,children:a})}B.memo(ik);function yS(e,t){let n;try{n=e()}catch{return}return{getItem:s=>{var a;const c=h=>h===null?null:JSON.parse(h,void 0),u=(a=n.getItem(s))!=null?a:null;return u instanceof Promise?u.then(c):c(u)},setItem:(s,a)=>n.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>n.removeItem(s)}}const Up=e=>t=>{try{const n=e(t);return n instanceof Promise?n:{then(r){return Up(r)(n)},catch(r){return this}}}catch(n){return{then(r){return this},catch(r){return Up(r)(n)}}}},sk=(e,t)=>(n,r,s)=>{let a={storage:yS(()=>localStorage),partialize:S=>S,version:0,merge:(S,_)=>({..._,...S}),...t},c=!1;const u=new Set,h=new Set;let f=a.storage;if(!f)return e((...S)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),n(...S)},r,s);const g=()=>{const S=a.partialize({...r()});return f.setItem(a.name,{state:S,version:a.version})},y=s.setState;s.setState=(S,_)=>{y(S,_),g()};const m=e((...S)=>{n(...S),g()},r,s);s.getInitialState=()=>m;let w;const C=()=>{var S,_;if(!f)return;c=!1,u.forEach(O=>{var R;return O((R=r())!=null?R:m)});const P=((_=a.onRehydrateStorage)==null?void 0:_.call(a,(S=r())!=null?S:m))||void 0;return Up(f.getItem.bind(f))(a.name).then(O=>{if(O)if(typeof O.version=="number"&&O.version!==a.version){if(a.migrate){const R=a.migrate(O.state,O.version);return R instanceof Promise?R.then(N=>[!0,N]):[!0,R]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,O.state];return[!1,void 0]}).then(O=>{var R;const[N,J]=O;if(w=a.merge(J,(R=r())!=null?R:m),n(w,!0),N)return g()}).then(()=>{P==null||P(w,void 0),w=r(),c=!0,h.forEach(O=>O(w))}).catch(O=>{P==null||P(void 0,O)})};return s.persist={setOptions:S=>{a={...a,...S},S.storage&&(f=S.storage)},clearStorage:()=>{f==null||f.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>C(),hasHydrated:()=>c,onHydrate:S=>(u.add(S),()=>{u.delete(S)}),onFinishHydration:S=>(h.add(S),()=>{h.delete(S)})},a.skipHydration||C(),w||m},ak=sk,C0=e=>Symbol.iterator in e,b0=e=>"entries"in e,E0=(e,t)=>{const n=e instanceof Map?e:new Map(e.entries()),r=t instanceof Map?t:new Map(t.entries());if(n.size!==r.size)return!1;for(const[s,a]of n)if(!Object.is(a,r.get(s)))return!1;return!0},lk=(e,t)=>{const n=e[Symbol.iterator](),r=t[Symbol.iterator]();let s=n.next(),a=r.next();for(;!s.done&&!a.done;){if(!Object.is(s.value,a.value))return!1;s=n.next(),a=r.next()}return!!s.done&&!!a.done};function ck(e,t){return Object.is(e,t)?!0:typeof e!="object"||e===null||typeof t!="object"||t===null?!1:!C0(e)||!C0(t)?E0({entries:()=>Object.entries(e)},{entries:()=>Object.entries(t)}):b0(e)&&b0(t)?E0(e,t):lk(e,t)}function vS(e){const t=fn.useRef(void 0);return n=>{const r=e(n);return ck(t.current,r)?t.current:t.current=r}}const P0={x:0,y:0,zoom:.5},_0=hb()(ak((e,t)=>({flows:{},flowMetadata:{},currentFlowId:"",nodeTypes:{},createFlow:(n,r,s,a)=>{e(c=>({flows:{...c.flows,[n]:{nodes:s,edges:a,viewport:P0}},currentFlowId:n,flowMetadata:{...c.flowMetadata,[n]:r}}))},updateFlowMetadata:(n,r)=>{t().flows[n]&&e(s=>({flowMetadata:{...s.flowMetadata,[n]:{...s.flowMetadata[n],...r}}}))},setCurrentFlow:n=>{t().flows[n]&&e({currentFlowId:n})},updateNodeTypes:n=>{e({nodeTypes:n})},renameCurrentFlow:n=>{const{currentFlowId:r,flows:s}=t();if(!s[r])return;const a={...s,[n]:s[r]};delete a[r],e({flows:a,currentFlowId:n})},deleteFlow:n=>{e(r=>{const s={...r.flows},a={...r.flowMetadata};return delete s[n],delete a[n],{flows:s,flowMetadata:a,currentFlowId:Object.keys(s)[0]||""}})},currentFlow:()=>t().flows[t().currentFlowId]||null,onNodesChange:n=>{e(r=>{const s=r.flows[r.currentFlowId];return s?{flows:{...r.flows,[r.currentFlowId]:{...s,nodes:zx(n,s.nodes)}}}:{}})},onEdgesChange:n=>{e(r=>{const s=r.flows[r.currentFlowId];return s?{flows:{...r.flows,[r.currentFlowId]:{...s,edges:Hx(n,s.edges)}}}:{}})},onConnect:n=>{const{currentFlowId:r,flows:s}=t();s[r]&&e({flows:{...s,[r]:{...s[r],edges:jp({...n,type:"smoothstep"},s[r].edges)}}})},setNodes:n=>{const{currentFlowId:r,flows:s}=t();s[r]&&e({flows:{...s,[r]:{...s[r],nodes:n}}})},setEdges:n=>{const{currentFlowId:r,flows:s}=t();s[r]&&e({flows:{...s,[r]:{...s[r],edges:n}}})},addEdge:n=>{const{currentFlowId:r,flows:s}=t();s[r]&&e({flows:{...s,[r]:{...s[r],edges:jp({...n,type:"smoothstep"},s[r].edges)}}})},setViewport:n=>{e(r=>{const s=r.flows[r.currentFlowId];return s?{flows:{...r.flows,[r.currentFlowId]:{...s,viewport:n}}}:{}})},clearState:()=>{const{currentFlowId:n,flows:r}=t();r[n]&&e({flows:{...r,[n]:{nodes:[],edges:[],viewport:P0}}})},addNode:n=>{const{currentFlowId:r,flows:s}=t();s[r]&&e({flows:{...s,[r]:{...s[r],nodes:[...s[r].nodes,n]}}})},removeNode:n=>{const{currentFlowId:r,flows:s}=t();s[r]&&e({flows:{...s,[r]:{...s[r],nodes:s[r].nodes.filter(a=>a.id!==n)}}})},updateNodePosition:(n,r)=>{const{currentFlowId:s,flows:a}=t();a[s]&&e({flows:{...a,[s]:{...a[s],nodes:a[s].nodes.map(c=>c.id===n?{...c,position:r}:c)}}})},updateNodeData:(n,r)=>{const{currentFlowId:s,flows:a}=t();a[s]&&e({flows:{...a,[s]:{...a[s],nodes:a[s].nodes.map(c=>c.id===n?{...c,data:{...c.data,...r}}:c)}}})}}),{name:"multi-flow-state",storage:yS(()=>localStorage),partialize:e=>({flows:e.flows,currentFlowId:e.currentFlowId,flowMetadata:e.flowMetadata})})),wS=e=>({flows:e.flows,currentFlowId:e.currentFlowId,flowMetadata:e.flowMetadata,updateFlowMetadata:e.updateFlowMetadata,createFlow:e.createFlow,setCurrentFlow:e.setCurrentFlow,renameCurrentFlow:e.renameCurrentFlow,deleteFlow:e.deleteFlow,currentFlow:e.currentFlow,onNodesChange:e.onNodesChange,onEdgesChange:e.onEdgesChange,onConnect:e.onConnect,addNode:e.addNode,updateNodePosition:e.updateNodePosition,addEdge:e.addEdge,setViewport:e.setViewport,clearStore:e.clearStore,updateNodeData:e.updateNodeData,updateNodeTypes:e.updateNodeTypes,nodeTypes:e.nodeTypes,setNodes:e.setNodes,setEdges:e.setEdges}),uk=e=>({nodes:e.flows[e.currentFlowId].nodes,edges:e.flows[e.currentFlowId].edges,viewport:e.flows[e.currentFlowId].viewport,onNodesChange:e.onNodesChange,onEdgesChange:e.onEdgesChange,onConnect:e.onConnect,addNode:e.addNode,updateNodePosition:e.updateNodePosition,addEdge:e.addEdge,setViewport:e.setViewport,updateNodeData:e.updateNodeData,updateNodeTypes:e.updateNodeTypes,nodeTypes:e.nodeTypes,setNodes:e.setNodes,setEdges:e.setEdges}),Cc=()=>{const e=yL(),t=_0(vS(wS));return e!=null&&e.isParent?uk(t):_0()},hk=Symbol(),Rg=Symbol(),ql="a",xS="f",A0="p",SS="c",CS="t",bS="h",ch="w",ES="o",PS="k";let dk=(e,t)=>new Proxy(e,t);const Wp=Object.getPrototypeOf,qp=new WeakMap,_S=e=>e&&(qp.has(e)?qp.get(e):Wp(e)===Object.prototype||Wp(e)===Array.prototype),R0=e=>typeof e=="object"&&e!==null,fk=e=>Object.values(Object.getOwnPropertyDescriptors(e)).some(t=>!t.configurable&&!t.writable),pk=e=>{if(Array.isArray(e))return Array.from(e);const t=Object.getOwnPropertyDescriptors(e);return Object.values(t).forEach(n=>{n.configurable=!0}),Object.create(Wp(e),t)},gk=(e,t)=>{const n={[xS]:t};let r=!1;const s=(u,h)=>{if(!r){let f=n[ql].get(e);if(f||(f={},n[ql].set(e,f)),u===ch)f[ch]=!0;else{let g=f[u];g||(g=new Set,f[u]=g),g.add(h)}}},a=()=>{r=!0,n[ql].delete(e)},c={get(u,h){return h===Rg?e:(s(PS,h),RS(Reflect.get(u,h),n[ql],n[SS],n[CS]))},has(u,h){return h===hk?(a(),!0):(s(bS,h),Reflect.has(u,h))},getOwnPropertyDescriptor(u,h){return s(ES,h),Reflect.getOwnPropertyDescriptor(u,h)},ownKeys(u){return s(ch),Reflect.ownKeys(u)}};return t&&(c.set=c.deleteProperty=()=>!1),[c,n]},AS=e=>e[Rg]||e,RS=(e,t,n,r)=>{if(!_S(e))return e;let s=r&&r.get(e);if(!s){const h=AS(e);fk(h)?s=[h,pk(h)]:s=[h],r==null||r.set(e,s)}const[a,c]=s;let u=n&&n.get(a);return(!u||u[1][xS]!==!!c)&&(u=gk(a,!!c),u[1][A0]=dk(c||a,u[0]),n&&n.set(a,u)),u[1][ql]=t,u[1][SS]=n,u[1][CS]=r,u[1][A0]},mk=(e,t)=>{const n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);return n.length!==r.length||n.some((s,a)=>s!==r[a])},TS=(e,t,n,r,s=Object.is)=>{if(s(e,t))return!1;if(!R0(e)||!R0(t))return!0;const a=n.get(AS(e));if(!a)return!0;if(r){if(r.get(e)===t)return!1;r.set(e,t)}let c=null;for(const u of a[bS]||[])if(c=Reflect.has(e,u)!==Reflect.has(t,u),c)return c;if(a[ch]===!0){if(c=mk(e,t),c)return c}else for(const u of a[ES]||[]){const h=!!Reflect.getOwnPropertyDescriptor(e,u),f=!!Reflect.getOwnPropertyDescriptor(t,u);if(c=h!==f,c)return c}for(const u of a[PS]||[])if(c=TS(e[u],t[u],n,r,s),c)return c;if(c===null)throw new Error("invalid used");return c},yk=e=>_S(e)&&e[Rg]||null,T0=(e,t=!0)=>{qp.set(e,t)};function vk(){if(typeof globalThis<"u")return globalThis;if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global}function Tg(e,t){const n=vk();return n?(n[e]||(n[e]=t()),n[e]):t()}var Yl=Tg("__zag__refSet",()=>new WeakSet),wk=e=>typeof e=="object"&&e!==null&&"$$typeof"in e&&"props"in e,xk=e=>typeof e=="object"&&e!==null&&"__v_isVNode"in e,Sk=e=>typeof e=="object"&&e!==null&&"nodeType"in e&&typeof e.nodeName=="string",Ck=e=>wk(e)||xk(e)||Sk(e),Gp=e=>e!==null&&typeof e=="object",Kp=e=>Gp(e)&&!Yl.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!Ck(e)&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer)&&!(e instanceof Promise);function k0(e,t,n){typeof n.value=="object"&&!Kp(n.value)&&(n.value=Ds(n.value)),!n.enumerable||n.get||n.set||!n.configurable||!n.writable||t==="__proto__"?Object.defineProperty(e,t,n):e[t]=n.value}function Ds(e){if(typeof e!="object")return e;var t=0,n,r,s,a=Object.prototype.toString.call(e);if(a==="[object Object]"?s=Object.create(Object.getPrototypeOf(e)||null):a==="[object Array]"?s=Array(e.length):a==="[object Set]"?(s=new Set,e.forEach(function(c){s.add(Ds(c))})):a==="[object Map]"?(s=new Map,e.forEach(function(c,u){s.set(Ds(u),Ds(c))})):a==="[object Date]"?s=new Date(+e):a==="[object RegExp]"?s=new RegExp(e.source,e.flags):a==="[object DataView]"?s=new e.constructor(Ds(e.buffer)):a==="[object ArrayBuffer]"?s=e.slice(0):a==="[object Blob]"?s=e.slice():a.slice(-6)==="Array]"&&(s=new e.constructor(e)),s){for(r=Object.getOwnPropertySymbols(e);tnew WeakMap),bk=(e=Object.is,t=(u,h)=>new Proxy(u,h),n=new WeakMap,r=(u,h)=>{const f=n.get(u);if((f==null?void 0:f[0])===h)return f[1];const g=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u));return T0(g,!0),n.set(u,[h,g]),Reflect.ownKeys(u).forEach(y=>{const m=Reflect.get(u,y);Yl.has(m)?(T0(m,!1),g[y]=m):Os.has(m)?g[y]=Mi(m):g[y]=m}),Object.freeze(g)},s=new WeakMap,a=[1,1],c=u=>{if(!Gp(u))throw new Error("object required");const h=s.get(u);if(h)return h;let f=a[0];const g=new Set,y=(G,te=++a[0])=>{f!==te&&(f=te,g.forEach(D=>D(G,te)))};let m=a[1];const w=(G=++a[1])=>(m!==G&&!g.size&&(m=G,S.forEach(([te])=>{const D=te[1](G);D>f&&(f=D)})),f),C=G=>(te,D)=>{const M=[...te];M[1]=[G,...M[1]],y(M,D)},S=new Map,_=(G,te)=>{if(g.size){const D=te[3](C(G));S.set(G,[te,D])}else S.set(G,[te])},P=G=>{var D;const te=S.get(G);te&&(S.delete(G),(D=te[1])==null||D.call(te))},O=G=>(g.add(G),g.size===1&&S.forEach(([D,M],z)=>{const U=D[3](C(z));S.set(z,[D,U])}),()=>{g.delete(G),g.size===0&&S.forEach(([D,M],z)=>{M&&(M(),S.set(z,[D]))})}),R=Array.isArray(u)?[]:Object.create(Object.getPrototypeOf(u)),J=t(R,{deleteProperty(G,te){const D=Reflect.get(G,te);P(te);const M=Reflect.deleteProperty(G,te);return M&&y(["delete",[te],D]),M},set(G,te,D,M){var $;const z=Reflect.has(G,te),U=Reflect.get(G,te,M);if(z&&(e(U,D)||s.has(D)&&e(U,s.get(D))))return!0;P(te),Gp(D)&&(D=yk(D)||D);let Y=D;if(!(($=Object.getOwnPropertyDescriptor(G,te))!=null&&$.set)){!Os.has(D)&&Kp(D)&&(Y=kg(D));const F=!Yl.has(Y)&&Os.get(Y);F&&_(te,F)}return Reflect.set(G,te,Y,M),y(["set",[te],D,U]),!0}});s.set(u,J);const ce=[R,w,r,O];return Os.set(J,ce),Reflect.ownKeys(u).forEach(G=>{const te=Object.getOwnPropertyDescriptor(u,G);te.get||te.set?Object.defineProperty(R,G,te):J[G]=u[G]}),J})=>[c,Os,Yl,e,t,Kp,n,r,s,a],[Ek]=bk();function kg(e={}){return Ek(e)}function Yp(e,t,n){const r=Os.get(e);let s;const a=[],c=r[3];let u=!1;const f=c(g=>{if(a.push(g),n){t(a.splice(0));return}s||(s=Promise.resolve().then(()=>{s=void 0,u&&t(a.splice(0))}))});return u=!0,()=>{u=!1,f()}}function Mi(e){const t=Os.get(e),[n,r,s]=t;return s(n,r())}function Ah(e){return Yl.add(e),e}function Pk(e,t){Object.keys(t).forEach(s=>{if(Object.getOwnPropertyDescriptor(e,s))throw new Error("object property already defined");const a=t[s],{get:c,set:u}=typeof a=="function"?{get:a}:a,h={};h.get=()=>c(Mi(r)),u&&(h.set=f=>u(r,f)),Object.defineProperty(e,s,h)});const r=kg(e);return r}var _k=e=>e[0],Ak=e=>e[e.length-1];function Rk(e){for(;e.length>0;)e.pop();return e}var O0=e=>(e==null?void 0:e.constructor.name)==="Array",Tk=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof(e==null?void 0:e.isEqual)=="function"&&typeof(t==null?void 0:t.isEqual)=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(O0(e)&&O0(t))return Tk(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),r=n.length;for(let s=0;s(typeof e=="function"?e(...t):e)??void 0,Wo=e=>e,kS=()=>{},Qp=(...e)=>(...t)=>{e.forEach(function(n){n==null||n(...t)})},N0=(()=>{let e=0;return()=>(e++,e.toString(36))})(),Rh=e=>Array.isArray(e),OS=e=>e!=null&&typeof e=="object",uh=e=>OS(e)&&!Rh(e),Og=e=>typeof e=="number"&&!Number.isNaN(e),Yn=e=>typeof e=="string",cc=e=>typeof e=="function",kk=e=>e==null,NS=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),Ok=e=>Object.prototype.toString.call(e),DS=Function.prototype.toString,Nk=DS.call(Object),Gu=e=>{if(!OS(e)||Ok(e)!="[object Object]")return!1;const t=Object.getPrototypeOf(e);if(t===null)return!0;const n=NS(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&DS.call(n)==Nk};function qi(e){if(!Dk(e)||e===void 0)return e;const t=Reflect.ownKeys(e).filter(r=>typeof r=="string"),n={};for(const r of t){const s=e[r];s!==void 0&&(n[r]=qi(s))}return n}var Dk=e=>e&&typeof e=="object"&&e.constructor===Object;function hh(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}function dh(...e){e.length===1?e[0]:e[1],e.length===2&&e[0]}var Mk=Object.defineProperty,Ik=(e,t,n)=>t in e?Mk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Ge=(e,t,n)=>Ik(e,typeof t!="symbol"?t+"":t,n);function MS(e,...t){if(!Gu(e))throw new TypeError("Source argument must be a plain object");for(const n of t){if(!Gu(n))continue;const r=qi(n);for(const s in r){if(!Object.prototype.hasOwnProperty.call(r,s)||s==="__proto__"||s==="constructor"||s==="prototype")continue;const a=e[s],c=n[s];Gu(c)?e[s]=Gu(a)?MS(a,c):{...c}:e[s]=c}}return e}function jr(e){return Yn(e)?{type:e}:e}function Oi(e){return e?Rh(e)?e.slice():[e]:[]}function IS(e){return uh(e)&&e.predicate!=null}var Fk=()=>!0;function FS(e,t,n,r){return s=>{var a;return Yn(s)?!!((a=e[s])!=null&&a.call(e,t,n,r)):cc(s)?s(t,n,r):s.predicate(e)(t,n,r)}}function Lk(...e){return{predicate:t=>(n,r,s)=>e.map(FS(t,n,r,s)).every(Boolean)}}function jk(e){return{predicate:t=>(n,r,s)=>!FS(t,n,r,s)(e)}}var LS={and:Lk,not:jk};function jS(e,t){return e=e??Fk,(n,r,s)=>{if(Yn(e)){const a=t[e];return cc(a)?a(n,r,s):a}return IS(e)?e.predicate(t)(n,r,s):e==null?void 0:e(n,r,s)}}function Qf(e,t){return(n,r,s)=>IS(e)?e.predicate(t)(n,r,s):e}function Bk(e){var a,c;const t=e.computed??Wo({}),n=e.context??Wo({}),r=e.initial?(c=(a=e.states)==null?void 0:a[e.initial])==null?void 0:c.tags:[],s=kg({value:e.initial??"",previousValue:"",event:Wo({}),previousEvent:Wo({}),context:Pk(n,t),done:!1,tags:r??[],hasTag(u){return this.tags.includes(u)},matches(...u){return u.includes(this.value)},can(u){return Wo(this).nextEvents.includes(u)},get nextEvents(){var f,g;const u=((g=(f=e.states)==null?void 0:f[this.value])==null?void 0:g.on)??{},h=(e==null?void 0:e.on)??{};return Object.keys({...u,...h})},get changed(){return this.event.value==="machine.init"||!this.previousValue?!1:this.value!==this.previousValue}});return Wo(s)}function Dl(e,t){return(n,r)=>{if(Og(e))return e;if(cc(e))return e(n,r);if(Yn(e)){const s=Number.parseFloat(e);if(!Number.isNaN(s))return s;if(t){const a=t==null?void 0:t[e];return dh(a==null,`[@zag-js/core > determine-delay] Cannot determine delay for \`${e}\`. It doesn't exist in \`options.delays\``),cc(a)?a(n,r):a}}}}function $k(e){return Yn(e)?{target:e}:e}function Vk(e,t){return(n,r,s)=>Oi(e).map($k).find(a=>jS(a.guard,t)(n,r,s)??a.target??a.actions)}var zk=class{constructor(e,t){var n,r,s,a,c;Ge(this,"status","Not Started"),Ge(this,"state"),Ge(this,"initialState"),Ge(this,"initialContext"),Ge(this,"id"),Ge(this,"type","machine"),Ge(this,"activityEvents",new Map),Ge(this,"delayedEvents",new Map),Ge(this,"stateListeners",new Set),Ge(this,"doneListeners",new Set),Ge(this,"contextWatchers",new Set),Ge(this,"removeStateListener",kS),Ge(this,"parent"),Ge(this,"children",new Map),Ge(this,"guardMap"),Ge(this,"actionMap"),Ge(this,"delayMap"),Ge(this,"activityMap"),Ge(this,"sync"),Ge(this,"options"),Ge(this,"config"),Ge(this,"_created",()=>{if(!this.config.created)return;const u=jr("machine.created");this.executeActions(this.config.created,u)}),Ge(this,"start",u=>{if(this.state.value="",this.state.tags=[],this.status==="Running")return this;this.status="Running",this.removeStateListener=Yp(this.state,()=>{this.stateListeners.forEach(w=>{w(this.stateSnapshot)})},this.sync),this.setupContextWatchers(),this.executeActivities(jr("machine.start"),Oi(this.config.activities),"machine.start"),this.executeActions(this.config.entry,jr("machine.start"));const h=jr("machine.init"),f=uh(u)?u.value:u,g=uh(u)?u.context:void 0;g&&this.setContext(g);const y={target:f??this.config.initial},m=this.getNextStateInfo(y,h);return this.initialState=m,this.performStateChangeEffects(this.state.value,m,h),this}),Ge(this,"setupContextWatchers",()=>{const{watch:u}=this.config;if(!u)return;let h=Mi(this.state.context);const f=Yp(this.state.context,()=>{var y;const g=Mi(this.state.context);for(const[m,w]of Object.entries(u))(((y=this.options.compareFns)==null?void 0:y[m])??Object.is)(h[m],g[m])||this.executeActions(w,this.state.event);h=g});this.contextWatchers.add(f)}),Ge(this,"stop",()=>{if(this.status!=="Stopped")return this.performExitEffects(this.state.value,jr("machine.stop")),this.executeActions(this.config.exit,jr("machine.stop")),this.setState(""),this.setEvent("machine.stop"),this.stopStateListeners(),this.stopChildren(),this.stopActivities(),this.stopDelayedEvents(),this.stopContextWatchers(),this.status="Stopped",this}),Ge(this,"stopStateListeners",()=>{this.removeStateListener(),this.stateListeners.clear()}),Ge(this,"stopContextWatchers",()=>{this.contextWatchers.forEach(u=>u()),this.contextWatchers.clear()}),Ge(this,"stopDelayedEvents",()=>{this.delayedEvents.forEach(u=>{u.forEach(h=>h())}),this.delayedEvents.clear()}),Ge(this,"stopActivities",u=>{var h,f;u?((h=this.activityEvents.get(u))==null||h.forEach(g=>g()),(f=this.activityEvents.get(u))==null||f.clear(),this.activityEvents.delete(u)):(this.activityEvents.forEach(g=>{g.forEach(y=>y()),g.clear()}),this.activityEvents.clear())}),Ge(this,"sendChild",(u,h)=>{const f=jr(u),g=Xp(h,this.contextSnapshot),y=this.children.get(g);y||dh(`[@zag-js/core] Cannot send '${f.type}' event to unknown child`),y.send(f)}),Ge(this,"stopChild",u=>{this.children.has(u)||dh(`[@zag-js/core > stop-child] Cannot stop unknown child ${u}`),this.children.get(u).stop(),this.children.delete(u)}),Ge(this,"removeChild",u=>{this.children.delete(u)}),Ge(this,"stopChildren",()=>{this.children.forEach(u=>u.stop()),this.children.clear()}),Ge(this,"setParent",u=>{this.parent=u}),Ge(this,"spawn",(u,h)=>{const f=Xp(u);return h&&(f.id=h),f.type="machine.actor",f.setParent(this),this.children.set(f.id,Wo(f)),f.onDone(()=>{this.removeChild(f.id)}).start(),Wo(Ah(f))}),Ge(this,"stopActivity",u=>{var f;if(!this.state.value)return;const h=this.activityEvents.get(this.state.value);(f=h==null?void 0:h.get(u))==null||f(),h==null||h.delete(u)}),Ge(this,"addActivityCleanup",(u,h,f)=>{var g;u&&(this.activityEvents.has(u)?(g=this.activityEvents.get(u))==null||g.set(h,f):this.activityEvents.set(u,new Map([[h,f]])))}),Ge(this,"setState",u=>{this.state.previousValue=this.state.value,this.state.value=u;const h=this.getStateNode(u);u==null?Rk(this.state.tags):this.state.tags=Oi(h==null?void 0:h.tags)}),Ge(this,"setContext",u=>{u&&MS(this.state.context,u)}),Ge(this,"setOptions",u=>{const h=qi(u);this.actionMap={...this.actionMap,...h.actions},this.delayMap={...this.delayMap,...h.delays},this.activityMap={...this.activityMap,...h.activities},this.guardMap={...this.guardMap,...h.guards}}),Ge(this,"getStateNode",u=>{var h;if(u)return(h=this.config.states)==null?void 0:h[u]}),Ge(this,"getNextStateInfo",(u,h)=>{const f=this.determineTransition(u,h),g=!(f!=null&&f.target),y=(f==null?void 0:f.target)??this.state.value,m=this.state.value!==y,w=this.getStateNode(y),S={reenter:!g&&!m&&!(f!=null&&f.internal),transition:f,stateNode:w,target:y,changed:m};return this.log("NextState:",`[${h.type}]`,this.state.value,"---->",S.target),S}),Ge(this,"getAfterActions",(u,h)=>{let f;const g=this.state.value;return{entry:()=>{f=globalThis.setTimeout(()=>{const y=this.getNextStateInfo(u,this.state.event);this.performStateChangeEffects(g,y,this.state.event)},h)},exit:()=>{globalThis.clearTimeout(f)}}}),Ge(this,"getDelayedEventActions",u=>{const h=this.getStateNode(u),f=this.state.event;if(!h||!h.after)return;const g=[],y=[];if(Rh(h.after)){const m=this.determineTransition(h.after,f);if(!m)return;if(!NS(m,"delay"))throw new Error(`[@zag-js/core > after] Delay is required for after transition: ${JSON.stringify(m)}`);const C=Dl(m.delay,this.delayMap)(this.contextSnapshot,f),S=this.getAfterActions(m,C);return g.push(S.entry),y.push(S.exit),{entries:g,exits:y}}if(uh(h.after))for(const m in h.after){const w=h.after[m],S=Dl(m,this.delayMap)(this.contextSnapshot,f),_=this.getAfterActions(w,S);g.push(_.entry),y.push(_.exit)}return{entries:g,exits:y}}),Ge(this,"executeActions",(u,h)=>{var g;const f=Qf(u,this.guardMap)(this.contextSnapshot,h,this.guardMeta);for(const y of Oi(f)){const m=Yn(y)?(g=this.actionMap)==null?void 0:g[y]:y;hh(Yn(y)&&!m,`[@zag-js/core > execute-actions] No implementation found for action: \`${y}\``),m==null||m(this.state.context,h,this.meta)}}),Ge(this,"executeActivities",(u,h,f)=>{var g;for(const y of h){const m=Yn(y)?(g=this.activityMap)==null?void 0:g[y]:y;if(!m){hh(`[@zag-js/core > execute-activity] No implementation found for activity: \`${y}\``);continue}const w=m(this.state.context,u,this.meta);if(w){const C=Yn(y)?y:y.name||N0();this.addActivityCleanup(f??this.state.value,C,w)}}}),Ge(this,"createEveryActivities",(u,h)=>{if(u)if(Rh(u)){const f=Oi(u).find(w=>{const C=w.delay,_=Dl(C,this.delayMap)(this.contextSnapshot,this.state.event);return jS(w.guard,this.guardMap)(this.contextSnapshot,this.state.event,this.guardMeta)??_!=null});if(!f)return;const y=Dl(f.delay,this.delayMap)(this.contextSnapshot,this.state.event);h(()=>{const w=globalThis.setInterval(()=>{this.executeActions(f.actions,this.state.event)},y);return()=>{globalThis.clearInterval(w)}})}else for(const f in u){const g=u==null?void 0:u[f],m=Dl(f,this.delayMap)(this.contextSnapshot,this.state.event);h(()=>{const C=globalThis.setInterval(()=>{this.executeActions(g,this.state.event)},m);return()=>{globalThis.clearInterval(C)}})}}),Ge(this,"setEvent",u=>{this.state.previousEvent=this.state.event,this.state.event=Ah(jr(u))}),Ge(this,"performExitEffects",(u,h)=>{const f=this.state.value;if(f==="")return;const g=u?this.getStateNode(u):void 0;this.stopActivities(f);const y=Qf(g==null?void 0:g.exit,this.guardMap)(this.contextSnapshot,h,this.guardMeta),m=Oi(y),w=this.delayedEvents.get(f);w&&m.push(...w),this.executeActions(m,h),this.delayedEvents.delete(f)}),Ge(this,"performEntryEffects",(u,h)=>{const f=this.getStateNode(u),g=Oi(f==null?void 0:f.activities);this.createEveryActivities(f==null?void 0:f.every,C=>{g.unshift(C)}),g.length>0&&this.executeActivities(h,g);const y=Qf(f==null?void 0:f.entry,this.guardMap)(this.contextSnapshot,h,this.guardMeta),m=Oi(y),w=this.getDelayedEventActions(u);f!=null&&f.after&&w&&(this.delayedEvents.set(u,w==null?void 0:w.exits),m.push(...w.entries)),this.executeActions(m,h),(f==null?void 0:f.type)==="final"&&(this.state.done=!0,this.doneListeners.forEach(C=>{C(this.stateSnapshot)}),this.stop())}),Ge(this,"performTransitionEffects",(u,h)=>{const f=this.determineTransition(u,h);this.executeActions(f==null?void 0:f.actions,h)}),Ge(this,"performStateChangeEffects",(u,h,f)=>{this.setEvent(f);const g=h.changed||h.reenter;g&&this.performExitEffects(u,f),this.performTransitionEffects(h.transition,f),this.setState(h.target),g&&this.performEntryEffects(h.target,f)}),Ge(this,"determineTransition",(u,h)=>{const f=Vk(u,this.guardMap);return f==null?void 0:f(this.contextSnapshot,h,this.guardMeta)}),Ge(this,"sendParent",u=>{var f;this.parent||dh("[@zag-js/core > send-parent] Cannot send event to an unknown parent");const h=jr(u);(f=this.parent)==null||f.send(h)}),Ge(this,"log",(...u)=>{}),Ge(this,"send",u=>{const h=jr(u);this.transition(this.state.value,h)}),Ge(this,"transition",(u,h)=>{var w,C;const f=Yn(u)?this.getStateNode(u):u==null?void 0:u.stateNode,g=jr(h);if(!f&&!this.config.on){const S=this.status==="Stopped"?"[@zag-js/core > transition] Cannot transition a stopped machine":`[@zag-js/core > transition] State does not have a definition for \`state\`: ${u}, \`event\`: ${g.type}`;hh(S);return}const y=((w=f==null?void 0:f.on)==null?void 0:w[g.type])??((C=this.config.on)==null?void 0:C[g.type]),m=this.getNextStateInfo(y,g);return this.performStateChangeEffects(this.state.value,m,g),m.stateNode}),Ge(this,"subscribe",u=>(this.stateListeners.add(u),this.status==="Running"&&u(this.stateSnapshot),()=>{this.stateListeners.delete(u)})),Ge(this,"onDone",u=>(this.doneListeners.add(u),this)),Ge(this,"onTransition",u=>(this.stateListeners.add(u),this.status==="Running"&&u(this.stateSnapshot),this)),this.config=Ds(e),this.options=Ds(t??{}),this.id=this.config.id??`machine-${N0()}`,this.guardMap=((n=this.options)==null?void 0:n.guards)??{},this.actionMap=((r=this.options)==null?void 0:r.actions)??{},this.delayMap=((s=this.options)==null?void 0:s.delays)??{},this.activityMap=((a=this.options)==null?void 0:a.activities)??{},this.sync=((c=this.options)==null?void 0:c.sync)??!1,this.state=Bk(this.config),this.initialContext=Mi(this.state.context)}get stateSnapshot(){return Wo(Mi(this.state))}getState(){return this.stateSnapshot}get contextSnapshot(){return this.stateSnapshot.context}get self(){const e=this;return{id:this.id,send:this.send.bind(this),sendParent:this.sendParent.bind(this),sendChild:this.sendChild.bind(this),stop:this.stop.bind(this),stopChild:this.stopChild.bind(this),spawn:this.spawn.bind(this),stopActivity:this.stopActivity.bind(this),get state(){return e.stateSnapshot},get initialContext(){return e.initialContext},get initialState(){var t;return((t=e.initialState)==null?void 0:t.target)??""}}}get meta(){var e;return{state:this.stateSnapshot,guards:this.guardMap,send:this.send.bind(this),self:this.self,initialContext:this.initialContext,initialState:((e=this.initialState)==null?void 0:e.target)??"",getState:()=>this.stateSnapshot,getAction:t=>this.actionMap[t],getGuard:t=>this.guardMap[t]}}get guardMeta(){return{state:this.stateSnapshot}}get[Symbol.toStringTag](){return"Machine"}getHydrationState(){const e=this.getState();return{value:e.value,tags:e.tags}}},bc=(e,t)=>new zk(e,t),Hk=(...e)=>e.map(t=>{var n;return(n=t==null?void 0:t.trim)==null?void 0:n.call(t)}).filter(Boolean).join(" "),Uk=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g,D0=e=>{const t={};let n;for(;n=Uk.exec(e);)t[n[1]]=n[2];return t},Wk=(e,t)=>{if(Yn(e)){if(Yn(t))return`${e};${t}`;e=D0(e)}else Yn(t)&&(t=D0(t));return Object.assign({},e??{},t??{})};function Xt(...e){let t={};for(let n of e){for(let r in t){if(r.startsWith("on")&&typeof t[r]=="function"&&typeof n[r]=="function"){t[r]=Qp(n[r],t[r]);continue}if(r==="className"||r==="class"){t[r]=Hk(t[r],n[r]);continue}if(r==="style"){t[r]=Wk(t[r],n[r]);continue}t[r]=n[r]!==void 0?n[r]:t[r]}for(let r in n)t[r]===void 0&&(t[r]=n[r])}return t}function qk(e){return new Proxy({},{get(){return e}})}var zs=()=>e=>Array.from(new Set(e)),Qh=qk(e=>e),M0=e=>(e==null?void 0:e.constructor.name)==="Array",Gk=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n{if(Object.is(e,t))return!0;if(e==null&&t!=null||e!=null&&t==null)return!1;if(typeof(e==null?void 0:e.isEqual)=="function"&&typeof(t==null?void 0:t.isEqual)=="function")return e.isEqual(t);if(typeof e=="function"&&typeof t=="function")return e.toString()===t.toString();if(M0(e)&&M0(t))return Gk(Array.from(e),Array.from(t));if(typeof e!="object"||typeof t!="object")return!1;const n=Object.keys(t??Object.create(null)),r=n.length;for(let s=0;stypeof r=="string"),n={};for(const r of t){const s=e[r];s!==void 0&&(n[r]=BS(s))}return n}var Yk=e=>e&&typeof e=="object"&&e.constructor===Object;function Xk(e,t){const n=B.useRef(!1),r=B.useRef(!1);B.useEffect(()=>{if(n.current&&r.current)return e();r.current=!0},t),B.useEffect(()=>(n.current=!0,()=>{n.current=!1}),[])}var Qk=Tg("__zag__targetCache",()=>new WeakMap);function Jk(e,t){const{actions:n,context:r,sync:s}=t??{},a=B.useRef(void 0),c=B.useRef(void 0),u=B.useSyncExternalStore(B.useCallback(y=>Yp(e.state,y,s),[s]),()=>{const y=Mi(e.state);try{if(a.current&&c.current&&!TS(a.current,y,c.current,new WeakMap))return a.current}catch{}return y},()=>Mi(e.state));e.setOptions({actions:n});const h=B.useMemo(()=>BS(r??{}),[r]);Xk(()=>{const y=Object.entries(h),m=e.contextSnapshot??{};y.map(([S,_])=>({key:S,curr:_,prev:m[S],equal:Ng(m[S],_)})).every(({equal:S})=>S)||e.setContext(h)},[h]);const f=new WeakMap;B.useEffect(()=>{a.current=u,c.current=f});const g=B.useMemo(()=>new WeakMap,[]);return RS(u,f,g,Qk)}function Zk(e){const t=B.useRef(void 0);return t.current||(t.current={v:e()}),t.current.v}var eO=typeof document<"u"?B.useLayoutEffect:B.useEffect;function tO(e,t){const{state:n,context:r}=t??{},s=Zk(()=>{const c=typeof e=="function"?e():e;return r&&c.setContext(r),c._created(),c}),a=B.useRef(void 0);return eO(()=>{const c=n??a.current;return s.start(c),()=>{s.stop()}},[]),s}function Ec(e,t){const n=tO(e,t);return[Jk(n,t),n.send,n]}function nO(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function Pc(...e){return t=>{for(const n of e)nO(n,t)}}function rO(e){var r,s;let t=(r=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:r.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(s=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:s.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const Jf=e=>{const t=B.memo(B.forwardRef((n,r)=>{const{asChild:s,children:a,...c}=n;if(!s)return B.createElement(e,{...c,ref:r},a);const u=B.Children.only(a);if(!B.isValidElement(u))return null;const h=rO(u);return B.cloneElement(u,{...Xt(c,u.props),ref:r?Pc(r,h):h})}));return t.displayName=e.displayName||e.name,t},oO=()=>{const e=new Map;return new Proxy(Jf,{apply(t,n,r){return Jf(r[0])},get(t,n){const r=n;return e.has(r)||e.set(r,Jf(r)),e.get(r)}})},En=oO();function iO(e,t){return`${e} returned \`undefined\`. Seems you forgot to wrap component within ${t}`}function Hs(e={}){const{name:t,strict:n=!0,hookName:r="useContext",providerName:s="Provider",errorMessage:a,defaultValue:c}=e,u=B.createContext(c);u.displayName=t;function h(){var g;const f=B.useContext(u);if(!f&&n){const y=new Error(a??iO(r,s));throw y.name="ContextError",(g=Error.captureStackTrace)==null||g.call(Error,y,h),y}return f}return[u.Provider,h,u]}const[sO,_c]=Hs({name:"HoverCardContext",hookName:"useHoverCardContext",providerName:""}),$S=B.forwardRef((e,t)=>{const n=_c(),r=Xt(n.getArrowProps(),e);return T.jsx(En.div,{...r,ref:t})});$S.displayName="HoverCardArrow";const VS=B.forwardRef((e,t)=>{const n=_c(),r=Xt(n.getArrowTipProps(),e);return T.jsx(En.div,{...r,ref:t})});VS.displayName="HoverCardArrowTip";const[Dg,Jh]=Hs({name:"PresenceContext",hookName:"usePresenceContext",providerName:""}),zS=B.forwardRef((e,t)=>{const n=_c(),r=Jh(),s=Xt(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:T.jsx(En.div,{...s,ref:Pc(r.ref,t)})});zS.displayName="HoverCardContent";const HS=B.forwardRef((e,t)=>{const n=_c(),r=Xt(n.getPositionerProps(),e);return Jh().unmounted?null:T.jsx(En.div,{...r,ref:t})});HS.displayName="HoverCardPositioner";const Ac=()=>(e,t)=>t.reduce((n,r)=>{const[s,a]=n,c=r;return a[c]!==void 0&&(s[c]=a[c]),delete a[c],[s,a]},[{},{...e}]),US=e=>Ac()(e,["immediate","lazyMount","onExitComplete","present","unmountOnExit"]);function aO(e,t,n){const r=e.matches("mounted","unmountSuspended");return{skip:!e.context.initial&&r,present:r,setNode(s){s&&t({type:"NODE.SET",node:s})},unmount(){t({type:"UNMOUNT"})}}}function lO(e){return bc({initial:e.present?"mounted":"unmounted",context:{node:null,styles:null,unmountAnimationName:null,prevAnimationName:null,present:!1,initial:!1,...e},exit:["clearInitial","cleanupNode"],watch:{present:["setInitial","syncPresence"]},on:{"NODE.SET":{actions:["setNode","setStyles"]}},states:{mounted:{on:{UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]},"UNMOUNT.SUSPEND":"unmountSuspended"}},unmountSuspended:{activities:["trackAnimationEvents"],after:{ANIMATION_DURATION:{target:"unmounted",actions:["invokeOnExitComplete"]}},on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]},UNMOUNT:{target:"unmounted",actions:["invokeOnExitComplete"]}}},unmounted:{entry:["clearPrevAnimationName"],on:{MOUNT:{target:"mounted",actions:["setPrevAnimationName"]}}}}},{delays:{ANIMATION_DURATION(t){var n,r;return I0((n=t.styles)==null?void 0:n.animationDuration)+I0((r=t.styles)==null?void 0:r.animationDelay)+cO}},actions:{setInitial(t){t.initial=!0},clearInitial(t){t.initial=!1},cleanupNode(t){t.node=null,t.styles=null},invokeOnExitComplete(t){var n;(n=t.onExitComplete)==null||n.call(t)},setNode(t,n){t.node=Ah(n.node)},setStyles(t,n){const r=n.node.ownerDocument.defaultView||window;t.styles=Ah(r.getComputedStyle(n.node))},syncPresence(t,n,{send:r}){var c;if(t.present){r({type:"MOUNT",src:"presence.changed"});return}if(!t.present&&((c=t.node)==null?void 0:c.ownerDocument.visibilityState)==="hidden"){r({type:"UNMOUNT",src:"visibilitychange"});return}const s=Ku(t.styles);(t.immediate?queueMicrotask:requestAnimationFrame)(()=>{var u,h;t.unmountAnimationName=s,s==="none"||s===t.prevAnimationName||((u=t.styles)==null?void 0:u.display)==="none"||((h=t.styles)==null?void 0:h.animationDuration)==="0s"?r({type:"UNMOUNT",src:"presence.changed"}):r({type:"UNMOUNT.SUSPEND"})})},setPrevAnimationName(t){(t.immediate?queueMicrotask:requestAnimationFrame)(()=>{t.prevAnimationName=Ku(t.styles)})},clearPrevAnimationName(t){t.prevAnimationName=null}},activities:{trackAnimationEvents(t,n,{send:r}){const s=t.node;if(!s)return;const a=u=>{var f,g;(((g=(f=u.composedPath)==null?void 0:f.call(u))==null?void 0:g[0])??u.target)===s&&(t.prevAnimationName=Ku(t.styles))},c=u=>{var g,y;const h=Ku(t.styles);(((y=(g=u.composedPath)==null?void 0:g.call(u))==null?void 0:y[0])??u.target)===s&&h===t.unmountAnimationName&&r({type:"UNMOUNT",src:"animationend"})};return s.addEventListener("animationstart",a),s.addEventListener("animationcancel",c),s.addEventListener("animationend",c),()=>{s.removeEventListener("animationstart",a),s.removeEventListener("animationcancel",c),s.removeEventListener("animationend",c)}}}})}function Ku(e){return(e==null?void 0:e.animationName)||"none"}function I0(e){return parseFloat(e||"0")*1e3}var cO=16.667;zs()(["onExitComplete","present","immediate"]);function Li(e,t={}){const{sync:n=!1}=t,r=uO(e);return B.useCallback((...s)=>{var a;return n?queueMicrotask(()=>{var c;return(c=r.current)==null?void 0:c.call(r,...s)}):(a=r.current)==null?void 0:a.call(r,...s)},[n,r])}function uO(e){const t=B.useRef(e);return t.current=e,t}const Zh=e=>{const{lazyMount:t,unmountOnExit:n,present:r,...s}=e,a=B.useRef(!1),c={...s,present:r,onExitComplete:Li(e.onExitComplete)},[u,h]=Ec(lO(c),{context:c}),f=aO(u,h);f.present&&(a.current=!0);const g=!f.present&&!a.current&&t||n&&!f.present&&a.current,y=()=>({"data-state":r?"open":"closed",hidden:!f.present});return{ref:f.setNode,getPresenceProps:y,present:f.present,unmounted:g}};var Fs=(e,t=[])=>({parts:(...n)=>{if(hO(t))return Fs(e,n);throw new Error("createAnatomy().parts(...) should only be called once. Did you mean to use .extendWith(...) ?")},extendWith:(...n)=>Fs(e,[...t,...n]),rename:n=>Fs(n,t),keys:()=>t,build:()=>[...new Set(t)].reduce((n,r)=>Object.assign(n,{[r]:{selector:[`&[data-scope="${ka(e)}"][data-part="${ka(r)}"]`,`& [data-scope="${ka(e)}"][data-part="${ka(r)}"]`].join(", "),attrs:{"data-scope":ka(e),"data-part":ka(r)}}}),{})}),ka=e=>e.replace(/([A-Z])([A-Z])/g,"$1-$2").replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase(),hO=e=>e.length===0;const dO=["top","right","bottom","left"],Vi=Math.min,Gn=Math.max,Th=Math.round,Yu=Math.floor,fo=e=>({x:e,y:e}),fO={left:"right",right:"left",bottom:"top",top:"bottom"},pO={start:"end",end:"start"};function Jp(e,t,n){return Gn(e,Vi(t,n))}function Qo(e,t){return typeof e=="function"?e(t):e}function Jo(e){return e.split("-")[0]}function Wa(e){return e.split("-")[1]}function Mg(e){return e==="x"?"y":"x"}function Ig(e){return e==="y"?"height":"width"}function zi(e){return["top","bottom"].includes(Jo(e))?"y":"x"}function Fg(e){return Mg(zi(e))}function gO(e,t,n){n===void 0&&(n=!1);const r=Wa(e),s=Fg(e),a=Ig(s);let c=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(c=kh(c)),[c,kh(c)]}function mO(e){const t=kh(e);return[Zp(e),t,Zp(t)]}function Zp(e){return e.replace(/start|end/g,t=>pO[t])}function yO(e,t,n){const r=["left","right"],s=["right","left"],a=["top","bottom"],c=["bottom","top"];switch(e){case"top":case"bottom":return n?t?s:r:t?r:s;case"left":case"right":return t?a:c;default:return[]}}function vO(e,t,n,r){const s=Wa(e);let a=yO(Jo(e),n==="start",r);return s&&(a=a.map(c=>c+"-"+s),t&&(a=a.concat(a.map(Zp)))),a}function kh(e){return e.replace(/left|right|bottom|top/g,t=>fO[t])}function wO(e){return{top:0,right:0,bottom:0,left:0,...e}}function WS(e){return typeof e!="number"?wO(e):{top:e,right:e,bottom:e,left:e}}function Oh(e){const{x:t,y:n,width:r,height:s}=e;return{width:r,height:s,top:n,left:t,right:t+r,bottom:n+s,x:t,y:n}}function F0(e,t,n){let{reference:r,floating:s}=e;const a=zi(t),c=Fg(t),u=Ig(c),h=Jo(t),f=a==="y",g=r.x+r.width/2-s.width/2,y=r.y+r.height/2-s.height/2,m=r[u]/2-s[u]/2;let w;switch(h){case"top":w={x:g,y:r.y-s.height};break;case"bottom":w={x:g,y:r.y+r.height};break;case"right":w={x:r.x+r.width,y};break;case"left":w={x:r.x-s.width,y};break;default:w={x:r.x,y:r.y}}switch(Wa(t)){case"start":w[c]-=m*(n&&f?-1:1);break;case"end":w[c]+=m*(n&&f?-1:1);break}return w}const xO=async(e,t,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:a=[],platform:c}=n,u=a.filter(Boolean),h=await(c.isRTL==null?void 0:c.isRTL(t));let f=await c.getElementRects({reference:e,floating:t,strategy:s}),{x:g,y}=F0(f,r,h),m=r,w={},C=0;for(let S=0;S({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:s,rects:a,platform:c,elements:u,middlewareData:h}=t,{element:f,padding:g=0}=Qo(e,t)||{};if(f==null)return{};const y=WS(g),m={x:n,y:r},w=Fg(s),C=Ig(w),S=await c.getDimensions(f),_=w==="y",P=_?"top":"left",O=_?"bottom":"right",R=_?"clientHeight":"clientWidth",N=a.reference[C]+a.reference[w]-m[w]-a.floating[C],J=m[w]-a.reference[w],ce=await(c.getOffsetParent==null?void 0:c.getOffsetParent(f));let G=ce?ce[R]:0;(!G||!await(c.isElement==null?void 0:c.isElement(ce)))&&(G=u.floating[R]||a.floating[C]);const te=N/2-J/2,D=G/2-S[C]/2-1,M=Vi(y[P],D),z=Vi(y[O],D),U=M,Y=G-S[C]-z,$=G/2-S[C]/2+te,F=Jp(U,$,Y),L=!h.arrow&&Wa(s)!=null&&$!==F&&a.reference[C]/2-($$<=0)){var z,U;const $=(((z=a.flip)==null?void 0:z.index)||0)+1,F=G[$];if(F)return{data:{index:$,overflows:M},reset:{placement:F}};let L=(U=M.filter(K=>K.overflows[0]<=0).sort((K,V)=>K.overflows[1]-V.overflows[1])[0])==null?void 0:U.placement;if(!L)switch(w){case"bestFit":{var Y;const K=(Y=M.filter(V=>{if(ce){const q=zi(V.placement);return q===O||q==="y"}return!0}).map(V=>[V.placement,V.overflows.filter(q=>q>0).reduce((q,Q)=>q+Q,0)]).sort((V,q)=>V[1]-q[1])[0])==null?void 0:Y[0];K&&(L=K);break}case"initialPlacement":L=u;break}if(s!==L)return{reset:{placement:L}}}return{}}}};function L0(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function j0(e){return dO.some(t=>e[t]>=0)}const bO=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...s}=Qo(e,t);switch(r){case"referenceHidden":{const a=await uc(t,{...s,elementContext:"reference"}),c=L0(a,n.reference);return{data:{referenceHiddenOffsets:c,referenceHidden:j0(c)}}}case"escaped":{const a=await uc(t,{...s,altBoundary:!0}),c=L0(a,n.floating);return{data:{escapedOffsets:c,escaped:j0(c)}}}default:return{}}}}};async function EO(e,t){const{placement:n,platform:r,elements:s}=e,a=await(r.isRTL==null?void 0:r.isRTL(s.floating)),c=Jo(n),u=Wa(n),h=zi(n)==="y",f=["left","top"].includes(c)?-1:1,g=a&&h?-1:1,y=Qo(t,e);let{mainAxis:m,crossAxis:w,alignmentAxis:C}=typeof y=="number"?{mainAxis:y,crossAxis:0,alignmentAxis:null}:{mainAxis:y.mainAxis||0,crossAxis:y.crossAxis||0,alignmentAxis:y.alignmentAxis};return u&&typeof C=="number"&&(w=u==="end"?C*-1:C),h?{x:w*g,y:m*f}:{x:m*f,y:w*g}}const PO=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:s,y:a,placement:c,middlewareData:u}=t,h=await EO(t,e);return c===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:s+h.x,y:a+h.y,data:{...h,placement:c}}}}},_O=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:s}=t,{mainAxis:a=!0,crossAxis:c=!1,limiter:u={fn:_=>{let{x:P,y:O}=_;return{x:P,y:O}}},...h}=Qo(e,t),f={x:n,y:r},g=await uc(t,h),y=zi(Jo(s)),m=Mg(y);let w=f[m],C=f[y];if(a){const _=m==="y"?"top":"left",P=m==="y"?"bottom":"right",O=w+g[_],R=w-g[P];w=Jp(O,w,R)}if(c){const _=y==="y"?"top":"left",P=y==="y"?"bottom":"right",O=C+g[_],R=C-g[P];C=Jp(O,C,R)}const S=u.fn({...t,[m]:w,[y]:C});return{...S,data:{x:S.x-n,y:S.y-r,enabled:{[m]:a,[y]:c}}}}}},AO=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:s,rects:a,middlewareData:c}=t,{offset:u=0,mainAxis:h=!0,crossAxis:f=!0}=Qo(e,t),g={x:n,y:r},y=zi(s),m=Mg(y);let w=g[m],C=g[y];const S=Qo(u,t),_=typeof S=="number"?{mainAxis:S,crossAxis:0}:{mainAxis:0,crossAxis:0,...S};if(h){const R=m==="y"?"height":"width",N=a.reference[m]-a.floating[R]+_.mainAxis,J=a.reference[m]+a.reference[R]-_.mainAxis;wJ&&(w=J)}if(f){var P,O;const R=m==="y"?"width":"height",N=["top","left"].includes(Jo(s)),J=a.reference[y]-a.floating[R]+(N&&((P=c.offset)==null?void 0:P[y])||0)+(N?0:_.crossAxis),ce=a.reference[y]+a.reference[R]+(N?0:((O=c.offset)==null?void 0:O[y])||0)-(N?_.crossAxis:0);Cce&&(C=ce)}return{[m]:w,[y]:C}}}},RO=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:s,rects:a,platform:c,elements:u}=t,{apply:h=()=>{},...f}=Qo(e,t),g=await uc(t,f),y=Jo(s),m=Wa(s),w=zi(s)==="y",{width:C,height:S}=a.floating;let _,P;y==="top"||y==="bottom"?(_=y,P=m===(await(c.isRTL==null?void 0:c.isRTL(u.floating))?"start":"end")?"left":"right"):(P=y,_=m==="end"?"top":"bottom");const O=S-g.top-g.bottom,R=C-g.left-g.right,N=Vi(S-g[_],O),J=Vi(C-g[P],R),ce=!t.middlewareData.shift;let G=N,te=J;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(te=R),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(G=O),ce&&!m){const M=Gn(g.left,0),z=Gn(g.right,0),U=Gn(g.top,0),Y=Gn(g.bottom,0);w?te=C-2*(M!==0||z!==0?M+z:Gn(g.left,g.right)):G=S-2*(U!==0||Y!==0?U+Y:Gn(g.top,g.bottom))}await h({...t,availableWidth:te,availableHeight:G});const D=await c.getDimensions(u.floating);return C!==D.width||S!==D.height?{reset:{rects:!0}}:{}}}};function ed(){return typeof window<"u"}function qa(e){return qS(e)?(e.nodeName||"").toLowerCase():"#document"}function Xn(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function vo(e){var t;return(t=(qS(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function qS(e){return ed()?e instanceof Node||e instanceof Xn(e).Node:!1}function qr(e){return ed()?e instanceof Element||e instanceof Xn(e).Element:!1}function po(e){return ed()?e instanceof HTMLElement||e instanceof Xn(e).HTMLElement:!1}function B0(e){return!ed()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Xn(e).ShadowRoot}function Rc(e){const{overflow:t,overflowX:n,overflowY:r,display:s}=Gr(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(s)}function TO(e){return["table","td","th"].includes(qa(e))}function td(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch{return!1}})}function Lg(e){const t=jg(),n=qr(e)?Gr(e):e;return["transform","translate","scale","rotate","perspective"].some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function kO(e){let t=Hi(e);for(;po(t)&&!Ua(t);){if(Lg(t))return t;if(td(t))return null;t=Hi(t)}return null}function jg(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Ua(e){return["html","body","#document"].includes(qa(e))}function Gr(e){return Xn(e).getComputedStyle(e)}function nd(e){return qr(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Hi(e){if(qa(e)==="html")return e;const t=e.assignedSlot||e.parentNode||B0(e)&&e.host||vo(e);return B0(t)?t.host:t}function GS(e){const t=Hi(e);return Ua(t)?e.ownerDocument?e.ownerDocument.body:e.body:po(t)&&Rc(t)?t:GS(t)}function hc(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=GS(e),a=s===((r=e.ownerDocument)==null?void 0:r.body),c=Xn(s);if(a){const u=eg(c);return t.concat(c,c.visualViewport||[],Rc(s)?s:[],u&&n?hc(u):[])}return t.concat(s,hc(s,[],n))}function eg(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function KS(e){const t=Gr(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const s=po(e),a=s?e.offsetWidth:n,c=s?e.offsetHeight:r,u=Th(n)!==a||Th(r)!==c;return u&&(n=a,r=c),{width:n,height:r,$:u}}function Bg(e){return qr(e)?e:e.contextElement}function La(e){const t=Bg(e);if(!po(t))return fo(1);const n=t.getBoundingClientRect(),{width:r,height:s,$:a}=KS(t);let c=(a?Th(n.width):n.width)/r,u=(a?Th(n.height):n.height)/s;return(!c||!Number.isFinite(c))&&(c=1),(!u||!Number.isFinite(u))&&(u=1),{x:c,y:u}}const OO=fo(0);function YS(e){const t=Xn(e);return!jg()||!t.visualViewport?OO:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function NO(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Xn(e)?!1:t}function $s(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=Bg(e);let c=fo(1);t&&(r?qr(r)&&(c=La(r)):c=La(e));const u=NO(a,n,r)?YS(a):fo(0);let h=(s.left+u.x)/c.x,f=(s.top+u.y)/c.y,g=s.width/c.x,y=s.height/c.y;if(a){const m=Xn(a),w=r&&qr(r)?Xn(r):r;let C=m,S=eg(C);for(;S&&r&&w!==C;){const _=La(S),P=S.getBoundingClientRect(),O=Gr(S),R=P.left+(S.clientLeft+parseFloat(O.paddingLeft))*_.x,N=P.top+(S.clientTop+parseFloat(O.paddingTop))*_.y;h*=_.x,f*=_.y,g*=_.x,y*=_.y,h+=R,f+=N,C=Xn(S),S=eg(C)}}return Oh({width:g,height:y,x:h,y:f})}function $g(e,t){const n=nd(e).scrollLeft;return t?t.left+n:$s(vo(e)).left+n}function XS(e,t,n){n===void 0&&(n=!1);const r=e.getBoundingClientRect(),s=r.left+t.scrollLeft-(n?0:$g(e,r)),a=r.top+t.scrollTop;return{x:s,y:a}}function DO(e){let{elements:t,rect:n,offsetParent:r,strategy:s}=e;const a=s==="fixed",c=vo(r),u=t?td(t.floating):!1;if(r===c||u&&a)return n;let h={scrollLeft:0,scrollTop:0},f=fo(1);const g=fo(0),y=po(r);if((y||!y&&!a)&&((qa(r)!=="body"||Rc(c))&&(h=nd(r)),po(r))){const w=$s(r);f=La(r),g.x=w.x+r.clientLeft,g.y=w.y+r.clientTop}const m=c&&!y&&!a?XS(c,h,!0):fo(0);return{width:n.width*f.x,height:n.height*f.y,x:n.x*f.x-h.scrollLeft*f.x+g.x+m.x,y:n.y*f.y-h.scrollTop*f.y+g.y+m.y}}function MO(e){return Array.from(e.getClientRects())}function IO(e){const t=vo(e),n=nd(e),r=e.ownerDocument.body,s=Gn(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=Gn(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let c=-n.scrollLeft+$g(e);const u=-n.scrollTop;return Gr(r).direction==="rtl"&&(c+=Gn(t.clientWidth,r.clientWidth)-s),{width:s,height:a,x:c,y:u}}function FO(e,t){const n=Xn(e),r=vo(e),s=n.visualViewport;let a=r.clientWidth,c=r.clientHeight,u=0,h=0;if(s){a=s.width,c=s.height;const f=jg();(!f||f&&t==="fixed")&&(u=s.offsetLeft,h=s.offsetTop)}return{width:a,height:c,x:u,y:h}}function LO(e,t){const n=$s(e,!0,t==="fixed"),r=n.top+e.clientTop,s=n.left+e.clientLeft,a=po(e)?La(e):fo(1),c=e.clientWidth*a.x,u=e.clientHeight*a.y,h=s*a.x,f=r*a.y;return{width:c,height:u,x:h,y:f}}function $0(e,t,n){let r;if(t==="viewport")r=FO(e,n);else if(t==="document")r=IO(vo(e));else if(qr(t))r=LO(t,n);else{const s=YS(e);r={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return Oh(r)}function QS(e,t){const n=Hi(e);return n===t||!qr(n)||Ua(n)?!1:Gr(n).position==="fixed"||QS(n,t)}function jO(e,t){const n=t.get(e);if(n)return n;let r=hc(e,[],!1).filter(u=>qr(u)&&qa(u)!=="body"),s=null;const a=Gr(e).position==="fixed";let c=a?Hi(e):e;for(;qr(c)&&!Ua(c);){const u=Gr(c),h=Lg(c);!h&&u.position==="fixed"&&(s=null),(a?!h&&!s:!h&&u.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||Rc(c)&&!h&&QS(e,c))?r=r.filter(g=>g!==c):s=u,c=Hi(c)}return t.set(e,r),r}function BO(e){let{element:t,boundary:n,rootBoundary:r,strategy:s}=e;const c=[...n==="clippingAncestors"?td(t)?[]:jO(t,this._c):[].concat(n),r],u=c[0],h=c.reduce((f,g)=>{const y=$0(t,g,s);return f.top=Gn(y.top,f.top),f.right=Vi(y.right,f.right),f.bottom=Vi(y.bottom,f.bottom),f.left=Gn(y.left,f.left),f},$0(t,u,s));return{width:h.right-h.left,height:h.bottom-h.top,x:h.left,y:h.top}}function $O(e){const{width:t,height:n}=KS(e);return{width:t,height:n}}function VO(e,t,n){const r=po(t),s=vo(t),a=n==="fixed",c=$s(e,!0,a,t);let u={scrollLeft:0,scrollTop:0};const h=fo(0);if(r||!r&&!a)if((qa(t)!=="body"||Rc(s))&&(u=nd(t)),r){const m=$s(t,!0,a,t);h.x=m.x+t.clientLeft,h.y=m.y+t.clientTop}else s&&(h.x=$g(s));const f=s&&!r&&!a?XS(s,u):fo(0),g=c.left+u.scrollLeft-h.x-f.x,y=c.top+u.scrollTop-h.y-f.y;return{x:g,y,width:c.width,height:c.height}}function Zf(e){return Gr(e).position==="static"}function V0(e,t){if(!po(e)||Gr(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return vo(e)===n&&(n=n.ownerDocument.body),n}function JS(e,t){const n=Xn(e);if(td(e))return n;if(!po(e)){let s=Hi(e);for(;s&&!Ua(s);){if(qr(s)&&!Zf(s))return s;s=Hi(s)}return n}let r=V0(e,t);for(;r&&TO(r)&&Zf(r);)r=V0(r,t);return r&&Ua(r)&&Zf(r)&&!Lg(r)?n:r||kO(e)||n}const zO=async function(e){const t=this.getOffsetParent||JS,n=this.getDimensions,r=await n(e.floating);return{reference:VO(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function HO(e){return Gr(e).direction==="rtl"}const UO={convertOffsetParentRelativeRectToViewportRelativeRect:DO,getDocumentElement:vo,getClippingRect:BO,getOffsetParent:JS,getElementRects:zO,getClientRects:MO,getDimensions:$O,getScale:La,isElement:qr,isRTL:HO};function ZS(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function WO(e,t){let n=null,r;const s=vo(e);function a(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function c(u,h){u===void 0&&(u=!1),h===void 0&&(h=1),a();const f=e.getBoundingClientRect(),{left:g,top:y,width:m,height:w}=f;if(u||t(),!m||!w)return;const C=Yu(y),S=Yu(s.clientWidth-(g+m)),_=Yu(s.clientHeight-(y+w)),P=Yu(g),R={rootMargin:-C+"px "+-S+"px "+-_+"px "+-P+"px",threshold:Gn(0,Vi(1,h))||1};let N=!0;function J(ce){const G=ce[0].intersectionRatio;if(G!==h){if(!N)return c();G?c(!1,G):r=setTimeout(()=>{c(!1,1e-7)},1e3)}G===1&&!ZS(f,e.getBoundingClientRect())&&c(),N=!1}try{n=new IntersectionObserver(J,{...R,root:s.ownerDocument})}catch{n=new IntersectionObserver(J,R)}n.observe(e)}return c(!0),a}function qO(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:c=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:h=!1}=r,f=Bg(e),g=s||a?[...f?hc(f):[],...hc(t)]:[];g.forEach(P=>{s&&P.addEventListener("scroll",n,{passive:!0}),a&&P.addEventListener("resize",n)});const y=f&&u?WO(f,n):null;let m=-1,w=null;c&&(w=new ResizeObserver(P=>{let[O]=P;O&&O.target===f&&w&&(w.unobserve(t),cancelAnimationFrame(m),m=requestAnimationFrame(()=>{var R;(R=w)==null||R.observe(t)})),n()}),f&&!h&&w.observe(f),w.observe(t));let C,S=h?$s(e):null;h&&_();function _(){const P=$s(e);S&&!ZS(S,P)&&n(),S=P,C=requestAnimationFrame(_)}return n(),()=>{var P;g.forEach(O=>{s&&O.removeEventListener("scroll",n),a&&O.removeEventListener("resize",n)}),y==null||y(),(P=w)==null||P.disconnect(),w=null,h&&cancelAnimationFrame(C)}}const GO=PO,KO=_O,YO=CO,XO=RO,QO=bO,JO=SO,ZO=AO,eN=(e,t,n)=>{const r=new Map,s={platform:UO,...n},a={...s.platform,_c:r};return xO(e,t,{...s,platform:a})};var rd=e=>typeof e=="object"&&e!==null,Ps=e=>e?"":void 0,tN=1,nN=9,rN=11,pn=e=>rd(e)&&e.nodeType===tN&&typeof e.nodeName=="string",Vg=e=>rd(e)&&e.nodeType===nN,oN=e=>rd(e)&&e===e.window,eC=e=>pn(e)?e.localName||"":"#document";function iN(e){return["html","body","#document"].includes(eC(e))}var sN=e=>rd(e)&&e.nodeType!==void 0,dc=e=>sN(e)&&e.nodeType===rN&&"host"in e,aN=e=>pn(e)&&e.localName==="input",lN=e=>!!(e!=null&&e.matches("a[href]")),cN=e=>pn(e)?e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0:!1,uN=/(textarea|select)/;function hN(e){if(e==null||!pn(e))return!1;try{return aN(e)&&e.selectionStart!=null||uN.test(e.localName)||e.isContentEditable||e.getAttribute("contenteditable")==="true"||e.getAttribute("contenteditable")===""}catch{return!1}}function fc(e,t){var r;if(!e||!t||!pn(e)||!pn(t))return!1;const n=(r=t.getRootNode)==null?void 0:r.call(t);if(e===t||e.contains(t))return!0;if(n&&dc(n)){let s=t;for(;s;){if(e===s)return!0;s=s.parentNode||s.host}}return!1}function ei(e){return Vg(e)?e:oN(e)?e.document:(e==null?void 0:e.ownerDocument)??document}function dN(e){return ei(e).documentElement}function Ga(e){var t;return dc(e)?Ga(e.host):Vg(e)?e.defaultView??window:pn(e)?((t=e.ownerDocument)==null?void 0:t.defaultView)??window:window}function tC(e){let t=e.activeElement;for(;t!=null&&t.shadowRoot;){const n=t.shadowRoot.activeElement;if(n===t)break;t=n}return t}function fN(e){if(eC(e)==="html")return e;const t=e.assignedSlot||e.parentNode||dc(e)&&e.host||dN(e);return dc(t)?t.host:t}var ep=new WeakMap;function nC(e){return ep.has(e)||ep.set(e,Ga(e).getComputedStyle(e)),ep.get(e)}var zg=()=>typeof document<"u";function pN(){const e=navigator.userAgentData;return(e==null?void 0:e.platform)??navigator.platform}function gN(){const e=navigator.userAgentData;return e&&Array.isArray(e.brands)?e.brands.map(({brand:t,version:n})=>`${t}/${n}`).join(" "):navigator.userAgent}var Hg=e=>zg()&&e.test(pN()),mN=e=>zg()&&e.test(gN()),yN=e=>zg()&&e.test(navigator.vendor),vN=()=>Hg(/^Mac/),wN=()=>SN()&&yN(/apple/i),xN=()=>mN(/firefox\//i),SN=()=>Hg(/mac|iphone|ipad|ipod/i),CN=()=>Hg(/iP(hone|ad|od)|iOS/);function bN(e){var t,n,r;return((t=e.composedPath)==null?void 0:t.call(e))??((r=(n=e.nativeEvent)==null?void 0:n.composedPath)==null?void 0:r.call(n))}function Go(e){const t=bN(e);return(t==null?void 0:t[0])??e.target}var EN=e=>fc(e.currentTarget,Go(e));function PN(e){return TN(e).isComposing}var _N=e=>e.button===2||vN()&&e.ctrlKey&&e.button===0,AN={Up:"ArrowUp",Down:"ArrowDown",Esc:"Escape"," ":"Space",",":"Comma",Left:"ArrowLeft",Right:"ArrowRight"},z0={ArrowLeft:"ArrowRight",ArrowRight:"ArrowLeft"};function RN(e,t={}){const{dir:n="ltr",orientation:r="horizontal"}=t;let s=e.key;return s=AN[s]??s,n==="rtl"&&r==="horizontal"&&s in z0&&(s=z0[s]),s}function TN(e){return e.nativeEvent??e}var uo=(e,t,n,r)=>{const s=typeof e=="function"?e():e;return s==null||s.addEventListener(t,n,r),()=>{s==null||s.removeEventListener(t,n,r)}};function kN(e,t){const{type:n="HTMLInputElement",property:r="value"}=t,s=Ga(e)[n].prototype;return Object.getOwnPropertyDescriptor(s,r)??{}}function ON(e){if(e.localName==="input")return"HTMLInputElement";if(e.localName==="textarea")return"HTMLTextAreaElement";if(e.localName==="select")return"HTMLSelectElement"}function NN(e,t,n="value"){var s;const r=ON(e);r&&((s=kN(e,{type:r,property:n}).set)==null||s.call(e,t)),e.setAttribute(n,t)}var rC=e=>pn(e)&&e.tagName==="IFRAME",DN=e=>!Number.isNaN(parseInt(e.getAttribute("tabindex")||"0",10)),MN=e=>parseInt(e.getAttribute("tabindex")||"0",10)<0,Ug="input:not([type='hidden']):not([disabled]), select:not([disabled]), textarea:not([disabled]), a[href], button:not([disabled]), [tabindex], iframe, object, embed, area[href], audio[controls], video[controls], [contenteditable]:not([contenteditable='false']), details > summary:first-of-type",Wg=(e,t=!1)=>{if(!e)return[];const n=Array.from(e.querySelectorAll(Ug));(t==!0||t=="if-empty"&&n.length===0)&&pn(e)&&ji(e)&&n.unshift(e);const s=n.filter(ji);return s.forEach((a,c)=>{if(rC(a)&&a.contentDocument){const u=a.contentDocument.body;s.splice(c,1,...Wg(u))}}),s};function ji(e){return!e||e.closest("[inert]")?!1:e.matches(Ug)&&cN(e)}function oC(e,t){if(!e)return[];const r=Array.from(e.querySelectorAll(Ug)).filter(Ts);return r.forEach((s,a)=>{if(rC(s)&&s.contentDocument){const c=s.contentDocument.body,u=oC(c);r.splice(a,1,...u)}}),r.length,r}function Ts(e){return e!=null&&e.tabIndex>0?!0:ji(e)&&!MN(e)}function Ml(e){return e.tabIndex<0&&(/^(audio|video|details)$/.test(e.localName)||hN(e))&&!DN(e)?0:e.tabIndex}function H0(e){const t=new Set;function n(r){const s=globalThis.requestAnimationFrame(r);t.add(()=>globalThis.cancelAnimationFrame(s))}return n(()=>n(e)),function(){t.forEach(s=>s())}}function bn(e){const t=globalThis.requestAnimationFrame(e);return()=>{globalThis.cancelAnimationFrame(t)}}function IN(e,t,n){const r=bn(()=>{e.removeEventListener(t,s,!0),n()}),s=()=>{r(),n()};return e.addEventListener(t,s,{once:!0,capture:!0}),r}function FN(e){const t=()=>e.click();xN()?IN(e,"keyup",t):queueMicrotask(t)}function tg(e){const t=fN(e);return iN(t)?ei(t).body:pn(t)&&jN(t)?t:tg(t)}var LN=/auto|scroll|overlay|hidden|clip/;function jN(e){const t=Ga(e),{overflow:n,overflowX:r,overflowY:s,display:a}=t.getComputedStyle(e);return LN.test(n+s+r)&&!["inline","contents"].includes(a)}function BN(e,t){return Array.from((e==null?void 0:e.querySelectorAll(t))??[])}var iC=e=>e.id;function sC(e,t,n=iC){return e.find(r=>n(r)===t)}function aC(e,t,n=iC){const r=sC(e,t,n);return r?e.indexOf(r):-1}function $N(e,t,n=!0){let r=aC(e,t);return r=n?(r+1)%e.length:Math.min(r+1,e.length-1),e[r]}function VN(e,t,n=!0){let r=aC(e,t);return r===-1?n?e[e.length-1]:null:(r=n?(r-1+e.length)%e.length:Math.max(0,r-1),e[r])}function od(e){const t={getRootNode:n=>{var r;return((r=n.getRootNode)==null?void 0:r.call(n))??document},getDoc:n=>ei(t.getRootNode(n)),getWin:n=>t.getDoc(n).defaultView??window,getActiveElement:n=>tC(t.getRootNode(n)),isActiveElement:(n,r)=>r===t.getActiveElement(n),getById:(n,r)=>t.getRootNode(n).getElementById(r),setValue:(n,r)=>{n==null||r==null||NN(n,r.toString())}};return{...t,...e}}var tp=new WeakMap;function zN(e,t,n){tp.has(e)||tp.set(e,new Map);const r=tp.get(e),s=r.get(t);if(!s)return r.set(t,n()),()=>{var u;(u=r.get(t))==null||u(),r.delete(t)};const a=n(),c=()=>{a(),s(),r.delete(t)};return r.set(t,c),()=>{r.get(t)===c&&(a(),r.set(t,s))}}function HN(e,t){return e?zN(e,"style",()=>{const r=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=r}}):()=>{}}var UN=1e3/60;function WN(e,t){const n=e();if(pn(n)&&n.isConnected)return t(n),()=>{};{const r=setInterval(()=>{const s=e();pn(s)&&s.isConnected&&(t(s),clearInterval(r))},UN);return()=>clearInterval(r)}}function qN(e,t){const n=[];return e==null||e.forEach(r=>{const s=WN(r,t);n.push(s)}),()=>{n.forEach(r=>r())}}function U0(e=0,t=0,n=0,r=0){if(typeof DOMRect=="function")return new DOMRect(e,t,n,r);const s={x:e,y:t,width:n,height:r,top:t,right:e+n,bottom:t+r,left:e};return{...s,toJSON:()=>s}}function GN(e){if(!e)return U0();const{x:t,y:n,width:r,height:s}=e;return U0(t,n,r,s)}function KN(e,t){return{contextElement:pn(e)?e:void 0,getBoundingClientRect:()=>{const n=e,r=t==null?void 0:t(n);return r||!n?GN(r):n.getBoundingClientRect()}}}var Il=e=>({variable:e,reference:`var(${e})`}),Ho={arrowSize:Il("--arrow-size"),arrowSizeHalf:Il("--arrow-size-half"),arrowBg:Il("--arrow-background"),transformOrigin:Il("--transform-origin"),arrowOffset:Il("--arrow-offset")},YN=e=>({top:"bottom center","top-start":e?`${e.x}px bottom`:"left bottom","top-end":e?`${e.x}px bottom`:"right bottom",bottom:"top center","bottom-start":e?`${e.x}px top`:"top left","bottom-end":e?`${e.x}px top`:"top right",left:"right center","left-start":e?`right ${e.y}px`:"right top","left-end":e?`right ${e.y}px`:"right bottom",right:"left center","right-start":e?`left ${e.y}px`:"left top","right-end":e?`left ${e.y}px`:"left bottom"}),XN={name:"transformOrigin",fn({placement:e,elements:t,middlewareData:n}){const{arrow:r}=n,s=YN(r)[e],{floating:a}=t;return a.style.setProperty(Ho.transformOrigin.variable,s),{data:{transformOrigin:s}}}},QN={name:"rects",fn({rects:e}){return{data:e}}},JN=e=>{if(e)return{name:"shiftArrow",fn({placement:t,middlewareData:n}){if(!n.arrow)return{};const{x:r,y:s}=n.arrow,a=t.split("-")[0];return Object.assign(e.style,{left:r!=null?`${r}px`:"",top:s!=null?`${s}px`:"",[a]:`calc(100% + ${Ho.arrowOffset.reference})`}),{}}}};function ZN(e){const[t,n]=e.split("-");return{side:t,align:n,hasAlign:n!=null}}var eD={strategy:"absolute",placement:"bottom",listeners:!0,gutter:8,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,overflowPadding:8,arrowPadding:4};function W0(e,t){const n=e.devicePixelRatio||1;return Math.round(t*n)/n}function lC(e){return Xp(e.boundary)}function tD(e,t){if(e)return JO({element:e,padding:t.arrowPadding})}function nD(e,t){if(!kk(t.offset??t.gutter))return GO(({placement:n})=>{var f,g;const r=((e==null?void 0:e.clientHeight)||0)/2,s=((f=t.offset)==null?void 0:f.mainAxis)??t.gutter,a=typeof s=="number"?s+r:s??r,{hasAlign:c}=ZN(n),u=c?void 0:t.shift,h=((g=t.offset)==null?void 0:g.crossAxis)??u;return qi({crossAxis:h,mainAxis:a,alignmentAxis:t.shift})})}function rD(e){if(e.flip)return YO({boundary:lC(e),padding:e.overflowPadding,fallbackPlacements:e.flip===!0?void 0:e.flip})}function oD(e){if(!(!e.slide&&!e.overlap))return KO({boundary:lC(e),mainAxis:e.slide,crossAxis:e.overlap,padding:e.overflowPadding,limiter:ZO()})}function iD(e){return XO({padding:e.overflowPadding,apply({elements:t,rects:n,availableHeight:r,availableWidth:s}){const a=t.floating,c=Math.round(n.reference.width);s=Math.floor(s),r=Math.floor(r),a.style.setProperty("--reference-width",`${c}px`),a.style.setProperty("--available-width",`${s}px`),a.style.setProperty("--available-height",`${r}px`)}})}function sD(e){var t;if(e.hideWhenDetached)return QO({strategy:"referenceHidden",boundary:((t=e.boundary)==null?void 0:t.call(e))??"clippingAncestors"})}function aD(e){return e?e===!0?{ancestorResize:!0,ancestorScroll:!0,elementResize:!0,layoutShift:!0}:e:{}}function lD(e,t,n={}){const r=KN(e,n.getAnchorRect);if(!t||!r)return;const s=Object.assign({},eD,n),a=t.querySelector("[data-part=arrow]"),c=[nD(a,s),rD(s),oD(s),tD(a,s),JN(a),XN,iD(s),sD(s),QN],{placement:u,strategy:h,onComplete:f,onPositioned:g}=s,y=async()=>{var N;if(!r||!t)return;const S=await eN(r,t,{placement:u,middleware:c,strategy:h});f==null||f(S),g==null||g({placed:!0});const _=Ga(t),P=W0(_,S.x),O=W0(_,S.y);t.style.setProperty("--x",`${P}px`),t.style.setProperty("--y",`${O}px`),s.hideWhenDetached&&(((N=S.middlewareData.hide)==null?void 0:N.referenceHidden)?(t.style.setProperty("visibility","hidden"),t.style.setProperty("pointer-events","none")):(t.style.removeProperty("visibility"),t.style.removeProperty("pointer-events")));const R=t.firstElementChild;if(R){const J=nC(R);t.style.setProperty("--z-index",J.zIndex)}},m=async()=>{n.updatePosition?(await n.updatePosition({updatePosition:y}),g==null||g({placed:!0})):await y()},w=aD(s.listeners),C=s.listeners?qO(r,t,m,w):kS;return m(),()=>{C==null||C(),g==null||g({placed:!1})}}function q0(e,t,n={}){const{defer:r,...s}=n,a=r?bn:u=>u(),c=[];return c.push(a(()=>{const u=typeof e=="function"?e():e,h=typeof t=="function"?t():t;c.push(lD(u,h,s))})),()=>{c.forEach(u=>u==null?void 0:u())}}var cD={bottom:"rotate(45deg)",left:"rotate(135deg)",top:"rotate(225deg)",right:"rotate(315deg)"};function uD(e={}){const{placement:t,sameWidth:n,fitViewport:r,strategy:s="absolute"}=e;return{arrow:{position:"absolute",width:Ho.arrowSize.reference,height:Ho.arrowSize.reference,[Ho.arrowSizeHalf.variable]:`calc(${Ho.arrowSize.reference} / 2)`,[Ho.arrowOffset.variable]:`calc(${Ho.arrowSizeHalf.reference} * -1)`},arrowTip:{transform:t?cD[t.split("-")[0]]:void 0,background:Ho.arrowBg.reference,top:"0",left:"0",width:"100%",height:"100%",position:"absolute",zIndex:"inherit"},floating:{position:s,isolation:"isolate",minWidth:n?void 0:"max-content",width:n?"var(--reference-width)":void 0,maxWidth:r?"var(--available-width)":void 0,maxHeight:r?"var(--available-height)":void 0,top:"0px",left:"0px",transform:t?"translate3d(var(--x), var(--y), 0)":"translate3d(0, -100vh, 0)",zIndex:"var(--z-index)"}}}function hD(e){const t={each(n){var r;for(let s=0;s<((r=e.frames)==null?void 0:r.length);s+=1){const a=e.frames[s];a&&n(a)}},addEventListener(n,r,s){return t.each(a=>{try{a.document.addEventListener(n,r,s)}catch{}}),()=>{try{t.removeEventListener(n,r,s)}catch{}}},removeEventListener(n,r,s){t.each(a=>{try{a.document.removeEventListener(n,r,s)}catch{}})}};return t}function dD(e){const t=e.frameElement!=null?e.parent:null;return{addEventListener:(n,r,s)=>{try{t==null||t.addEventListener(n,r,s)}catch{}return()=>{try{t==null||t.removeEventListener(n,r,s)}catch{}}},removeEventListener:(n,r,s)=>{try{t==null||t.removeEventListener(n,r,s)}catch{}}}}var G0="pointerdown.outside",K0="focus.outside";function fD(e){for(const t of e)if(pn(t)&&ji(t))return!0;return!1}var cC=e=>"clientY"in e;function pD(e,t){if(!cC(t)||!e)return!1;const n=e.getBoundingClientRect();return n.width===0||n.height===0?!1:n.top<=t.clientY&&t.clientY<=n.top+n.height&&n.left<=t.clientX&&t.clientX<=n.left+n.width}function gD(e,t){return e.y<=t.y&&t.y<=e.y+e.height&&e.x<=t.x&&t.x<=e.x+e.width}function Y0(e,t){if(!t||!cC(e))return!1;const n=t.scrollHeight>t.clientHeight,r=n&&e.clientX>t.offsetLeft+t.clientWidth,s=t.scrollWidth>t.clientWidth,a=s&&e.clientY>t.offsetTop+t.clientHeight,c={x:t.offsetLeft,y:t.offsetTop,width:t.clientWidth+(n?16:0),height:t.clientHeight+(s?16:0)},u={x:e.clientX,y:e.clientY};return gD(c,u)?r||a:!1}function mD(e,t){const{exclude:n,onFocusOutside:r,onPointerDownOutside:s,onInteractOutside:a,defer:c}=t;if(!e)return;const u=ei(e),h=Ga(e),f=hD(h),g=dD(h);function y(P){const O=Go(P);if(!pn(O)||!O.isConnected||fc(e,O)||pD(e,P))return!1;const R=u.querySelector(`[aria-controls="${e.id}"]`);if(R){const J=tg(R);if(Y0(P,J))return!1}const N=tg(e);return Y0(P,N)?!1:!(n!=null&&n(O))}const m=new Set;function w(P){function O(){var J;const R=c?bn:ce=>ce(),N=((J=P.composedPath)==null?void 0:J.call(P))??[P.target];R(()=>{if(!(!e||!y(P))){if(s||a){const ce=Qp(s,a);e.addEventListener(G0,ce,{once:!0})}X0(e,G0,{bubbles:!1,cancelable:!0,detail:{originalEvent:P,contextmenu:_N(P),focusable:fD(N)}})}})}P.pointerType==="touch"?(m.forEach(R=>R()),m.add(uo(u,"click",O,{once:!0})),m.add(g.addEventListener("click",O,{once:!0})),m.add(f.addEventListener("click",O,{once:!0}))):O()}const C=new Set,S=setTimeout(()=>{C.add(uo(u,"pointerdown",w,!0)),C.add(g.addEventListener("pointerdown",w,!0)),C.add(f.addEventListener("pointerdown",w,!0))},0);function _(P){(c?bn:R=>R())(()=>{if(!(!e||!y(P))){if(r||a){const R=Qp(r,a);e.addEventListener(K0,R,{once:!0})}X0(e,K0,{bubbles:!1,cancelable:!0,detail:{originalEvent:P,contextmenu:!1,focusable:ji(Go(P))}})}})}return C.add(uo(u,"focusin",_,!0)),C.add(g.addEventListener("focusin",_,!0)),C.add(f.addEventListener("focusin",_,!0)),()=>{clearTimeout(S),m.forEach(P=>P()),C.forEach(P=>P())}}function yD(e,t){const{defer:n}=t,r=n?bn:a=>a(),s=[];return s.push(r(()=>{const a=typeof e=="function"?e():e;s.push(mD(a,t))})),()=>{s.forEach(a=>a==null?void 0:a())}}function X0(e,t,n){const r=e.ownerDocument.defaultView||window,s=new r.CustomEvent(t,n);return e.dispatchEvent(s)}function vD(e,t){const n=r=>{r.key==="Escape"&&(r.isComposing||t==null||t(r))};return uo(ei(e),"keydown",n,{capture:!0})}var $r={layers:[],branches:[],count(){return this.layers.length},pointerBlockingLayers(){return this.layers.filter(e=>e.pointerBlocking)},topMostPointerBlockingLayer(){return[...this.pointerBlockingLayers()].slice(-1)[0]},hasPointerBlockingLayer(){return this.pointerBlockingLayers().length>0},isBelowPointerBlockingLayer(e){var r;const t=this.indexOf(e),n=this.topMostPointerBlockingLayer()?this.indexOf((r=this.topMostPointerBlockingLayer())==null?void 0:r.node):-1;return tfc(n.node,t))},isInBranch(e){return Array.from(this.branches).some(t=>fc(t,e))},add(e){const t=this.layers.push(e);e.node.style.setProperty("--layer-index",`${t}`)},addBranch(e){this.branches.push(e)},remove(e){const t=this.indexOf(e);t<0||(tr.dismiss()),this.layers.splice(t,1),e.style.removeProperty("--layer-index"))},removeBranch(e){const t=this.branches.indexOf(e);t>=0&&this.branches.splice(t,1)},indexOf(e){return this.layers.findIndex(t=>t.node===e)},dismiss(e){var t;(t=this.layers[this.indexOf(e)])==null||t.dismiss()},clear(){this.remove(this.layers[0].node)}},Q0;function J0(){$r.layers.forEach(({node:e})=>{e.style.pointerEvents=$r.isBelowPointerBlockingLayer(e)?"none":"auto"})}function wD(e){e.style.pointerEvents=""}function xD(e,t){const n=ei(e),r=[];if($r.hasPointerBlockingLayer()&&!n.body.hasAttribute("data-inert")&&(Q0=document.body.style.pointerEvents,queueMicrotask(()=>{n.body.style.pointerEvents="none",n.body.setAttribute("data-inert","")})),t){const s=qN(t,a=>{r.push(HN(a,{pointerEvents:"auto"}))});r.push(s)}return()=>{$r.hasPointerBlockingLayer()||(queueMicrotask(()=>{n.body.style.pointerEvents=Q0,n.body.removeAttribute("data-inert"),n.body.style.length===0&&n.body.removeAttribute("style")}),r.forEach(s=>s()))}}function SD(e,t){if(!e){hh("[@zag-js/dismissable] node is `null` or `undefined`");return}const{onDismiss:n,pointerBlocking:r,exclude:s,debug:a}=t,c={dismiss:n,node:e,pointerBlocking:r};$r.add(c),J0();function u(m){var C,S;const w=Go(m.detail.originalEvent);$r.isBelowPointerBlockingLayer(e)||$r.isInBranch(w)||((C=t.onPointerDownOutside)==null||C.call(t,m),(S=t.onInteractOutside)==null||S.call(t,m),!m.defaultPrevented&&(a&&console.log("onPointerDownOutside:",m.detail.originalEvent),n==null||n()))}function h(m){var C,S;const w=Go(m.detail.originalEvent);$r.isInBranch(w)||((C=t.onFocusOutside)==null||C.call(t,m),(S=t.onInteractOutside)==null||S.call(t,m),!m.defaultPrevented&&(a&&console.log("onFocusOutside:",m.detail.originalEvent),n==null||n()))}function f(m){var w;$r.isTopMost(e)&&((w=t.onEscapeKeyDown)==null||w.call(t,m),!m.defaultPrevented&&n&&(m.preventDefault(),n()))}function g(m){var _;if(!e)return!1;const w=typeof s=="function"?s():s,C=Array.isArray(w)?w:[w],S=(_=t.persistentElements)==null?void 0:_.map(P=>P()).filter(pn);return S&&C.push(...S),C.some(P=>fc(P,m))||$r.isInNestedLayer(e,m)}const y=[r?xD(e,t.persistentElements):void 0,vD(e,f),yD(e,{exclude:g,onFocusOutside:h,onPointerDownOutside:u,defer:t.defer})];return()=>{$r.remove(e),J0(),wD(e),y.forEach(m=>m==null?void 0:m())}}function uC(e,t){const{defer:n}=t,r=n?bn:a=>a(),s=[];return s.push(r(()=>{const a=cc(e)?e():e;s.push(SD(a,t))})),()=>{s.forEach(a=>a==null?void 0:a())}}var CD=Fs("hoverCard").parts("arrow","arrowTip","trigger","positioner","content"),Fl=CD.build(),dn=od({getTriggerId:e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`hover-card:${e.id}:trigger`},getContentId:e=>{var t;return((t=e.ids)==null?void 0:t.content)??`hover-card:${e.id}:content`},getPositionerId:e=>{var t;return((t=e.ids)==null?void 0:t.positioner)??`hover-card:${e.id}:popper`},getArrowId:e=>{var t;return((t=e.ids)==null?void 0:t.arrow)??`hover-card:${e.id}:arrow`},getTriggerEl:e=>dn.getById(e,dn.getTriggerId(e)),getContentEl:e=>dn.getById(e,dn.getContentId(e)),getPositionerEl:e=>dn.getById(e,dn.getPositionerId(e))});function bD(e,t,n){const r=e.hasTag("open"),s=uD({...e.context.positioning,placement:e.context.currentPlacement});return{open:r,setOpen(a){a!==r&&t(a?"OPEN":"CLOSE")},reposition(a={}){t({type:"POSITIONING.SET",options:a})},getArrowProps(){return n.element({id:dn.getArrowId(e.context),...Fl.arrow.attrs,dir:e.context.dir,style:s.arrow})},getArrowTipProps(){return n.element({...Fl.arrowTip.attrs,dir:e.context.dir,style:s.arrowTip})},getTriggerProps(){return n.element({...Fl.trigger.attrs,dir:e.context.dir,"data-placement":e.context.currentPlacement,id:dn.getTriggerId(e.context),"data-state":r?"open":"closed",onPointerEnter(a){a.pointerType!=="touch"&&t({type:"POINTER_ENTER",src:"trigger"})},onPointerLeave(a){a.pointerType!=="touch"&&t({type:"POINTER_LEAVE",src:"trigger"})},onFocus(){t("TRIGGER_FOCUS")},onBlur(){t("TRIGGER_BLUR")}})},getPositionerProps(){return n.element({id:dn.getPositionerId(e.context),...Fl.positioner.attrs,dir:e.context.dir,style:s.floating})},getContentProps(){return n.element({...Fl.content.attrs,dir:e.context.dir,id:dn.getContentId(e.context),hidden:!r,"data-state":r?"open":"closed","data-placement":e.context.currentPlacement,onPointerEnter(a){a.pointerType!=="touch"&&t({type:"POINTER_ENTER",src:"content"})},onPointerLeave(a){a.pointerType!=="touch"&&t({type:"POINTER_LEAVE",src:"content"})}})}}}var{not:Xu,and:Z0}=LS;function ED(e){const t=qi(e);return bc({id:"hover-card",initial:t.open?"open":"closed",context:{openDelay:700,closeDelay:300,currentPlacement:void 0,...t,positioning:{placement:"bottom",...t.positioning}},watch:{open:["toggleVisibility"]},states:{closed:{tags:["closed"],entry:["clearIsPointer"],on:{"CONTROLLED.OPEN":"open",POINTER_ENTER:{target:"opening",actions:["setIsPointer"]},TRIGGER_FOCUS:"opening",OPEN:"opening"}},opening:{tags:["closed"],after:{OPEN_DELAY:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]},on:{"CONTROLLED.OPEN":"open","CONTROLLED.CLOSE":"closed",POINTER_LEAVE:[{guard:"isOpenControlled",actions:["invokeOnClose","toggleVisibility"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_BLUR:[{guard:Z0("isOpenControlled",Xu("isPointer")),actions:["invokeOnClose","toggleVisibility"]},{guard:Xu("isPointer"),target:"closed",actions:["invokeOnClose"]}],CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose","toggleVisibility"]},{target:"closed",actions:["invokeOnClose"]}]}},open:{tags:["open"],activities:["trackDismissableElement","trackPositioning"],on:{"CONTROLLED.CLOSE":"closed",POINTER_ENTER:{actions:["setIsPointer"]},POINTER_LEAVE:"closing",CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TRIGGER_BLUR:[{guard:Z0("isOpenControlled",Xu("isPointer")),actions:["invokeOnClose"]},{guard:Xu("isPointer"),target:"closed",actions:["invokeOnClose"]}],"POSITIONING.SET":{actions:"reposition"}}},closing:{tags:["open"],activities:["trackPositioning"],after:{CLOSE_DELAY:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]},on:{"CONTROLLED.CLOSE":"closed","CONTROLLED.OPEN":"open",POINTER_ENTER:{target:"open",actions:["setIsPointer"]}}}}},{delays:{OPEN_DELAY:n=>n.openDelay,CLOSE_DELAY:n=>n.closeDelay},guards:{isPointer:n=>!!n.isPointer,isOpenControlled:n=>!!n["open.controlled"]},activities:{trackPositioning(n){n.currentPlacement||(n.currentPlacement=n.positioning.placement);const r=()=>dn.getPositionerEl(n);return q0(dn.getTriggerEl(n),r,{...n.positioning,defer:!0,onComplete(s){n.currentPlacement=s.placement}})},trackDismissableElement(n,r,{send:s}){return uC(()=>dn.getContentEl(n),{defer:!0,exclude:[dn.getTriggerEl(n)],onDismiss(){s({type:"CLOSE",src:"interact-outside"})},onFocusOutside(c){c.preventDefault()}})}},actions:{invokeOnClose(n){var r;(r=n.onOpenChange)==null||r.call(n,{open:!1})},invokeOnOpen(n){var r;(r=n.onOpenChange)==null||r.call(n,{open:!0})},setIsPointer(n){n.isPointer=!0},clearIsPointer(n){n.isPointer=!1},reposition(n,r){const s=()=>dn.getPositionerEl(n);q0(dn.getTriggerEl(n),s,{...n.positioning,...r.options,defer:!0,listeners:!1,onComplete(a){n.currentPlacement=a.placement}})},toggleVisibility(n,r,{send:s}){queueMicrotask(()=>{s({type:n.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:r})})}}})}zs()(["closeDelay","dir","getRootNode","id","ids","onOpenChange","open.controlled","open","openDelay","positioning"]);const[_L,Tc]=Hs({name:"EnvironmentContext",hookName:"useEnvironmentContext",providerName:"",strict:!1,defaultValue:{getRootNode:()=>document,getDocument:()=>document,getWindow:()=>window}}),[AL,id]=Hs({name:"LocaleContext",hookName:"useLocaleContext",providerName:"",strict:!1,defaultValue:{dir:"ltr",locale:"en-US"}}),PD=(e={})=>{const{getRootNode:t}=Tc(),{dir:n}=id(),r={id:B.useId(),dir:n,getRootNode:t,open:e.defaultOpen,"open.controlled":e.open!==void 0,...e},s={...r,open:e.open,onOpenChange:Li(e.onOpenChange,{sync:!0})},[a,c]=Ec(ED(r),{context:s});return bD(a,c,Qh)},_D=e=>{const[t,{children:n,...r}]=US(e),s=PD(r),a=Zh(Xt({present:s.open},t));return T.jsx(sO,{value:s,children:T.jsx(Dg,{value:a,children:n})})},hC=B.forwardRef((e,t)=>{const n=_c(),r=Xt(n.getTriggerProps(),e);return T.jsx(En.button,{...r,ref:t})});hC.displayName="HoverCardTrigger";const qg=e=>{var h;const{children:t,disabled:n}=e,[r,s]=B.useState((h=e.container)==null?void 0:h.current),a=B.useSyncExternalStore(RD,()=>!1,()=>!0),{getRootNode:c}=Tc();if(B.useEffect(()=>{s(()=>{var f;return(f=e.container)==null?void 0:f.current})},[e.container]),a||n)return T.jsx(T.Fragment,{children:t});const u=r??AD(c);return T.jsx(T.Fragment,{children:B.Children.map(t,f=>qA.createPortal(f,u))})},AD=e=>{const t=e==null?void 0:e(),n=t.getRootNode();return dc(n)?n:ei(t).body},RD=()=>()=>{},[dC,fC]=Hs({name:"RenderStrategyContext",hookName:"useRenderStrategyContext",providerName:""}),pC=e=>Ac()(e,["lazyMount","unmountOnExit"]);function TD(e,t){const[n,r]=B.useState(e);return B.useEffect(()=>{const s=setTimeout(()=>{r(e)},t);return()=>{clearTimeout(s)}},[e,t]),n}const[kD,Gg]=Hs({name:"TabsContext",hookName:"useTabsContext",providerName:""}),Bi=B.forwardRef((e,t)=>{const[n,r]=Ac()(e,["value"]),s=Gg(),a=fC(),c=Zh({...a,present:TD(s.value===e.value,0),immediate:!0}),u=Xt(s.getContentProps(n),c.getPresenceProps(),r);return T.jsx(Dg,{value:c,children:c.unmounted?null:T.jsx(En.div,{...u,ref:Pc(c.ref,t)})})});Bi.displayName="TabContent";const sd=B.forwardRef((e,t)=>{const n=Gg(),r=Xt(n.getListProps(),e);return T.jsx(En.div,{...r,ref:t})});sd.displayName="TabList";const $i=B.forwardRef((e,t)=>{const[n,r]=Ac()(e,["disabled","value"]),s=Gg(),a=Xt(s.getTriggerProps(n),r);return T.jsx(En.button,{...a,ref:t})});$i.displayName="TabTrigger";var ng,ks=new Map,OD=e=>e.getBoundingClientRect();function ND(e,t){const{scope:n="rect",getRect:r=OD,onChange:s}=t,a=DD({scope:n,getRect:r}),c=ks.get(e);return c?(c.callbacks.push(s),s(r(e))):(ks.set(e,{rect:{},callbacks:[s]}),ks.size===1&&(ng=requestAnimationFrame(a))),function(){const h=ks.get(e);if(!h)return;const f=h.callbacks.indexOf(s);f>-1&&h.callbacks.splice(f,1),h.callbacks.length===0&&(ks.delete(e),ks.size===0&&cancelAnimationFrame(ng))}}function DD(e){const{scope:t,getRect:n}=e,r=ID(t);return function s(){const a=[];ks.forEach((c,u)=>{const h=n(u);r(c.rect,h)||(c.rect=h,a.push(c))}),a.forEach(c=>{c.callbacks.forEach(u=>u(c.rect))}),ng=requestAnimationFrame(s)}}var gC=(e,t)=>e.width===t.width&&e.height===t.height,mC=(e,t)=>e.top===t.top&&e.left===t.left,MD=(e,t)=>gC(e,t)&&mC(e,t);function ID(e){return e==="size"?gC:e==="position"?mC:MD}var FD=Fs("tabs").parts("root","list","trigger","content","indicator"),Ll=FD.build(),ot=od({getRootId:e=>{var t;return((t=e.ids)==null?void 0:t.root)??`tabs:${e.id}`},getListId:e=>{var t;return((t=e.ids)==null?void 0:t.list)??`tabs:${e.id}:list`},getContentId:(e,t)=>{var n;return((n=e.ids)==null?void 0:n.content)??`tabs:${e.id}:content-${t}`},getTriggerId:(e,t)=>{var n;return((n=e.ids)==null?void 0:n.trigger)??`tabs:${e.id}:trigger-${t}`},getIndicatorId:e=>{var t;return((t=e.ids)==null?void 0:t.indicator)??`tabs:${e.id}:indicator`},getListEl:e=>ot.getById(e,ot.getListId(e)),getContentEl:(e,t)=>ot.getById(e,ot.getContentId(e,t)),getTriggerEl:(e,t)=>ot.getById(e,ot.getTriggerId(e,t)),getIndicatorEl:e=>ot.getById(e,ot.getIndicatorId(e)),getElements:e=>{const n=`[role=tab][data-ownedby='${CSS.escape(ot.getListId(e))}']:not([disabled])`;return BN(ot.getListEl(e),n)},getFirstTriggerEl:e=>_k(ot.getElements(e)),getLastTriggerEl:e=>Ak(ot.getElements(e)),getNextTriggerEl:(e,t)=>$N(ot.getElements(e),ot.getTriggerId(e,t),e.loopFocus),getPrevTriggerEl:(e,t)=>VN(ot.getElements(e),ot.getTriggerId(e,t),e.loopFocus),getSelectedContentEl:e=>{if(e.value)return ot.getContentEl(e,e.value)},getSelectedTriggerEl:e=>{if(e.value)return ot.getTriggerEl(e,e.value)},getOffsetRect:e=>({left:(e==null?void 0:e.offsetLeft)??0,top:(e==null?void 0:e.offsetTop)??0,width:(e==null?void 0:e.offsetWidth)??0,height:(e==null?void 0:e.offsetHeight)??0}),getRectById:(e,t)=>{const n=sC(ot.getElements(e),ot.getTriggerId(e,t));return ot.resolveRect(ot.getOffsetRect(n))},resolveRect:e=>({width:`${e.width}px`,height:`${e.height}px`,left:`${e.left}px`,top:`${e.top}px`})});function LD(e,t,n){const r=e.context.translations,s=e.matches("focused"),a=e.context.orientation==="vertical",c=e.context.orientation==="horizontal",u=e.context.composite,h=e.context.indicatorState;function f(g){return{selected:e.context.value===g.value,focused:e.context.focusedValue===g.value,disabled:!!g.disabled}}return{value:e.context.value,focusedValue:e.context.focusedValue,setValue(g){t({type:"SET_VALUE",value:g})},clearValue(){t({type:"CLEAR_VALUE"})},setIndicatorRect(g){const y=ot.getTriggerId(e.context,g);t({type:"SET_INDICATOR_RECT",id:y})},syncTabIndex(){t("SYNC_TAB_INDEX")},selectNext(g){t({type:"TAB_FOCUS",value:g,src:"selectNext"}),t({type:"ARROW_NEXT",src:"selectNext"})},selectPrev(g){t({type:"TAB_FOCUS",value:g,src:"selectPrev"}),t({type:"ARROW_PREV",src:"selectPrev"})},focus(){var g;(g=ot.getSelectedTriggerEl(e.context))==null||g.focus()},getRootProps(){return n.element({...Ll.root.attrs,id:ot.getRootId(e.context),"data-orientation":e.context.orientation,"data-focus":Ps(s),dir:e.context.dir})},getListProps(){return n.element({...Ll.list.attrs,id:ot.getListId(e.context),role:"tablist",dir:e.context.dir,"data-focus":Ps(s),"aria-orientation":e.context.orientation,"data-orientation":e.context.orientation,"aria-label":r==null?void 0:r.listLabel,onKeyDown(g){if(g.defaultPrevented||!EN(g)||PN(g))return;const y={ArrowDown(){c||t({type:"ARROW_NEXT",key:"ArrowDown"})},ArrowUp(){c||t({type:"ARROW_PREV",key:"ArrowUp"})},ArrowLeft(){a||t({type:"ARROW_PREV",key:"ArrowLeft"})},ArrowRight(){a||t({type:"ARROW_NEXT",key:"ArrowRight"})},Home(){t("HOME")},End(){t("END")},Enter(){t({type:"ENTER"})}};let m=RN(g,e.context);const w=y[m];w&&(g.preventDefault(),w(g))}})},getTriggerState:f,getTriggerProps(g){const{value:y,disabled:m}=g,w=f(g);return n.button({...Ll.trigger.attrs,role:"tab",type:"button",disabled:m,dir:e.context.dir,"data-orientation":e.context.orientation,"data-disabled":Ps(m),"aria-disabled":m,"data-value":y,"aria-selected":w.selected,"data-selected":Ps(w.selected),"data-focus":Ps(w.focused),"aria-controls":w.selected?ot.getContentId(e.context,y):void 0,"data-ownedby":ot.getListId(e.context),"data-ssr":Ps(e.context.ssr),id:ot.getTriggerId(e.context,y),tabIndex:w.selected&&u?0:-1,onFocus(){t({type:"TAB_FOCUS",value:y})},onBlur(C){const S=C.relatedTarget;(S==null?void 0:S.getAttribute("role"))!=="tab"&&t({type:"TAB_BLUR"})},onClick(C){C.defaultPrevented||m||(wN()&&C.currentTarget.focus(),t({type:"TAB_CLICK",value:y}))}})},getContentProps(g){const{value:y}=g,m=e.context.value===y;return n.element({...Ll.content.attrs,dir:e.context.dir,id:ot.getContentId(e.context,y),tabIndex:u?0:-1,"aria-labelledby":ot.getTriggerId(e.context,y),role:"tabpanel","data-ownedby":ot.getListId(e.context),"data-selected":Ps(m),"data-orientation":e.context.orientation,hidden:!m})},getIndicatorProps(){var g,y,m,w;return n.element({id:ot.getIndicatorId(e.context),...Ll.indicator.attrs,dir:e.context.dir,"data-orientation":e.context.orientation,style:{"--transition-property":"left, right, top, bottom, width, height","--left":(g=h.rect)==null?void 0:g.left,"--top":(y=h.rect)==null?void 0:y.top,"--width":(m=h.rect)==null?void 0:m.width,"--height":(w=h.rect)==null?void 0:w.height,position:"absolute",willChange:"var(--transition-property)",transitionProperty:"var(--transition-property)",transitionDuration:h.transition?"var(--transition-duration, 150ms)":"0ms",transitionTimingFunction:"var(--transition-timing-function)",[c?"left":"top"]:c?"var(--left)":"var(--top)"}})}}}var{not:jD}=LS;function BD(e){const t=qi(e);return bc({initial:"idle",context:{dir:"ltr",orientation:"horizontal",activationMode:"automatic",value:null,loopFocus:!0,composite:!0,navigate(n){FN(n.node)},...t,focusedValue:t.value??null,ssr:!0,indicatorState:{rendered:!1,transition:!1,rect:{left:"0px",top:"0px",width:"0px",height:"0px"}}},watch:{value:["allowIndicatorTransition","syncIndicatorRect","syncTabIndex","navigateIfNeeded"],dir:["syncIndicatorRect"],orientation:["syncIndicatorRect"]},on:{SET_VALUE:{actions:"setValue"},CLEAR_VALUE:{actions:"clearValue"},SET_INDICATOR_RECT:{actions:"setIndicatorRect"},SYNC_TAB_INDEX:{actions:"syncTabIndex"}},created:["syncFocusedValue"],entry:["checkRenderedElements","syncIndicatorRect","syncTabIndex","syncSsr"],exit:["cleanupObserver"],states:{idle:{on:{TAB_FOCUS:{target:"focused",actions:"setFocusedValue"},TAB_CLICK:{target:"focused",actions:["setFocusedValue","setValue"]}}},focused:{on:{TAB_CLICK:{target:"focused",actions:["setFocusedValue","setValue"]},ARROW_PREV:[{guard:"selectOnFocus",actions:["focusPrevTab","selectFocusedTab"]},{actions:"focusPrevTab"}],ARROW_NEXT:[{guard:"selectOnFocus",actions:["focusNextTab","selectFocusedTab"]},{actions:"focusNextTab"}],HOME:[{guard:"selectOnFocus",actions:["focusFirstTab","selectFocusedTab"]},{actions:"focusFirstTab"}],END:[{guard:"selectOnFocus",actions:["focusLastTab","selectFocusedTab"]},{actions:"focusLastTab"}],ENTER:{guard:jD("selectOnFocus"),actions:"selectFocusedTab"},TAB_FOCUS:{actions:["setFocusedValue"]},TAB_BLUR:{target:"idle",actions:"clearFocusedValue"}}}}},{guards:{selectOnFocus:n=>n.activationMode==="automatic"},actions:{syncFocusedValue(n){n.value!=null&&n.focusedValue==null&&(n.focusedValue=n.value)},selectFocusedTab(n){bn(()=>{const s=n.deselectable&&n.value===n.focusedValue?null:n.focusedValue;_s.value(n,s)})},setFocusedValue(n,r){r.value!=null&&_s.focusedValue(n,r.value)},clearFocusedValue(n){_s.focusedValue(n,null)},setValue(n,r){const a=n.deselectable&&n.value===n.focusedValue?null:r.value;_s.value(n,a)},clearValue(n){_s.value(n,null)},focusFirstTab(n){bn(()=>{var r;(r=ot.getFirstTriggerEl(n))==null||r.focus()})},focusLastTab(n){bn(()=>{var r;(r=ot.getLastTriggerEl(n))==null||r.focus()})},focusNextTab(n){if(!n.focusedValue)return;const r=ot.getNextTriggerEl(n,n.focusedValue);bn(()=>{n.composite?r==null||r.focus():(r==null?void 0:r.dataset.value)!=null&&_s.focusedValue(n,r.dataset.value)})},focusPrevTab(n){if(!n.focusedValue)return;const r=ot.getPrevTriggerEl(n,n.focusedValue);bn(()=>{n.composite?r==null||r.focus():(r==null?void 0:r.dataset.value)!=null&&_s.focusedValue(n,r.dataset.value)})},checkRenderedElements(n){n.indicatorState.rendered=!!ot.getIndicatorEl(n)},syncTabIndex(n){bn(()=>{const r=ot.getSelectedContentEl(n);if(!r)return;Wg(r).length>0?r.removeAttribute("tabindex"):r.setAttribute("tabindex","0")})},cleanupObserver(n){var r;(r=n.indicatorCleanup)==null||r.call(n)},allowIndicatorTransition(n){n.indicatorState.transition=!0},setIndicatorRect(n,r){const s=r.id??n.value;!n.indicatorState.rendered||!s||!ot.getTriggerEl(n,s)||(n.indicatorState.rect=ot.getRectById(n,s),H0(()=>{n.indicatorState.transition=!1}))},syncSsr(n){n.ssr=!1},syncIndicatorRect(n){var a;(a=n.indicatorCleanup)==null||a.call(n);const r=n.value;if(!n.indicatorState.rendered||!r)return;const s=ot.getSelectedTriggerEl(n);s&&(n.indicatorCleanup=ND(s,{getRect(c){return ot.getOffsetRect(c)},onChange(c){n.indicatorState.rect=ot.resolveRect(c),H0(()=>{n.indicatorState.transition=!1})}}))},navigateIfNeeded(n){const r=ot.getSelectedTriggerEl(n);lN(r)&&n.navigate({value:n.value,node:r})}}})}var ew={change:e=>{var t;e.value!=null&&((t=e.onValueChange)==null||t.call(e,{value:e.value}))},focusChange:e=>{var t;e.focusedValue!=null&&((t=e.onFocusChange)==null||t.call(e,{focusedValue:e.focusedValue}))}},_s={value:(e,t)=>{lc(t,e.value)||(e.value=t,ew.change(e))},focusedValue:(e,t)=>{lc(t,e.focusedValue)||(e.focusedValue=t,ew.focusChange(e))}};zs()(["activationMode","composite","deselectable","dir","getRootNode","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value"]);zs()(["disabled","value"]);zs()(["value"]);const $D=(e={})=>{const{getRootNode:t}=Tc(),{dir:n}=id(),r={id:B.useId(),dir:n,getRootNode:t,value:e.defaultValue,...e},s={...r,value:e.value,onValueChange:Li(e.onValueChange,{sync:!0}),onFocusChange:Li(e.onFocusChange)},[a,c]=Ec(BD(r),{context:s});return LD(a,c,Qh)},ad=B.forwardRef((e,t)=>{const[n,r]=pC(e),[s,a]=Ac()(r,["activationMode","composite","defaultValue","deselectable","id","ids","loopFocus","navigate","onFocusChange","onValueChange","orientation","translations","value"]),c=$D(s),u=Xt(c.getRootProps(),a);return T.jsx(kD,{value:c,children:T.jsx(dC,{value:n,children:T.jsx(En.div,{...u,ref:t})})})});ad.displayName="TabsRoot";var yC={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},tw=fn.createContext&&fn.createContext(yC),VD=["attr","size","title"];function zD(e,t){if(e==null)return{};var n=HD(e,t),r,s;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function HD(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Nh(){return Nh=Object.assign?Object.assign.bind():function(e){for(var t=1;tfn.createElement(t.tag,Dh({key:n},t.attr),vC(t.child)))}function xr(e){return t=>fn.createElement(GD,Nh({attr:Dh({},e.attr)},t),vC(e.child))}function GD(e){var t=n=>{var{attr:r,size:s,title:a}=e,c=zD(e,VD),u=s||n.size||"1em",h;return n.className&&(h=n.className),e.className&&(h=(h?h+" ":"")+e.className),fn.createElement("svg",Nh({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,c,{className:h,style:Dh(Dh({color:e.color||n.color},n.style),e.style),height:u,width:u,xmlns:"http://www.w3.org/2000/svg"}),a&&fn.createElement("title",null,a),e.children)};return tw!==void 0?fn.createElement(tw.Consumer,null,n=>t(n)):t(yC)}function KD(e){return xr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(e)}function YD(e){return xr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20.5 11H19V7c0-1.1-.9-2-2-2h-4V3.5a2.5 2.5 0 0 0-5 0V5H4c-1.1 0-1.99.9-1.99 2v3.8H3.5c1.49 0 2.7 1.21 2.7 2.7s-1.21 2.7-2.7 2.7H2V20c0 1.1.9 2 2 2h3.8v-1.5c0-1.49 1.21-2.7 2.7-2.7 1.49 0 2.7 1.21 2.7 2.7V22H17c1.1 0 2-.9 2-2v-4h1.5a2.5 2.5 0 0 0 0-5z"},child:[]}]})(e)}function XD(e){return xr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M13 3a9 9 0 0 0-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42A8.954 8.954 0 0 0 13 21a9 9 0 0 0 0-18zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"},child:[]}]})(e)}function QD(e){return xr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M11 7h2v2h-2V7zm0 4h2v6h-2v-6zm1-9C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8z"},child:[]}]})(e)}function JD(e){return xr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm16-4H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-1 9H9V9h10v2zm-4 4H9v-2h6v2zm4-8H9V5h10v2z"},child:[]}]})(e)}function ZD(e){return xr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M18.41 5.8 17.2 4.59c-.78-.78-2.05-.78-2.83 0l-2.68 2.68L3 15.96V20h4.04l8.74-8.74 2.63-2.63c.79-.78.79-2.05 0-2.83zM6.21 18H5v-1.21l8.66-8.66 1.21 1.21L6.21 18zM11 20l4-4h6v4H11z"},child:[]}]})(e)}function eM(e){return xr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 17.27 18.18 21l-1.64-7.03L22 9.24l-7.19-.61L12 2 9.19 8.63 2 9.24l5.46 4.73L5.82 21z"},child:[]}]})(e)}function tM(e){return xr({attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M19.88 18.47c.44-.7.7-1.51.7-2.39 0-2.49-2.01-4.5-4.5-4.5s-4.5 2.01-4.5 4.5 2.01 4.5 4.49 4.5c.88 0 1.7-.26 2.39-.7L21.58 23 23 21.58l-3.12-3.11zm-3.8.11a2.5 2.5 0 0 1 0-5 2.5 2.5 0 0 1 0 5zm-.36-8.5c-.74.02-1.45.18-2.1.45l-.55-.83-3.8 6.18-3.01-3.52-3.63 5.81L1 17l5-8 3 3.5L13 6l2.72 4.08zm2.59.5c-.64-.28-1.33-.45-2.05-.49L21.38 2 23 3.18l-4.69 7.4z"},child:[]}]})(e)}function wC(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t{const[s,a]=B.useState("favorites"),c=["OpenAlex-sink","Search Fields","Open Access","Publication","Authorship","Concepts"];let u=e.slice(10)??[];return T.jsxs(ad,{value:s,onValueChange:h=>a(h.value),className:"mh-60 w-30 translate-x-1/2",children:[T.jsxs(sd,{className:"flex stretch",children:[T.jsx($i,{value:"favorites",className:`tabTrigger ${s==="favorites"?"bg-gray-50":"!bg-gray-200"}`,children:T.jsx(eM,{className:"w-3 h-3"})}),T.jsx($i,{value:"recent",className:`tabTrigger ${s==="recent"?"bg-gray-50":"!bg-gray-200"}`,children:T.jsx(XD,{className:"w-3 h-3"})})]}),T.jsx(Bi,{value:"recent",className:"tabContent !height-[20px]",children:u.map((h,f)=>T.jsx("div",{onClick:()=>r(n,h),className:"hover:bg-white p-1 cursor-pointer",children:h},f))}),T.jsx(Bi,{value:"favorites",className:"tabContent !height-[20px]",children:c.map((h,f)=>T.jsx("div",{onClick:()=>r(n,h),className:"hover:bg-white p-1 cursor-pointer",children:h},f))})]})},rM=({children:e,handlePosition:t,createNode:n,recentNodeTypes:r,nodeTypes:s})=>T.jsxs(_D,{children:[T.jsx(hC,{children:e}),T.jsx(qg,{children:T.jsx(HS,{children:T.jsxs(zS,{children:[T.jsx($S,{children:T.jsx(VS,{})}),T.jsx(nM,{handlePosition:t,createNode:n,recentNodeTypes:r,nodeTypes:s})]})})})]}),oM=({handleId:e,position:t,type:n,id:r,connectState:s,createNode:a,recentNodeTypes:c,nodeTypes:u})=>{const[h,f]=B.useState(!1);Kg("flex",{"pr-10":e==="incomingL","pb-10":e==="incomingT","pl-10":e==="outgoingR","pt-10":e==="outgoingB"});const g=B.useMemo(()=>s==="connectable"?{borderColor:h?"blue":"black",opacity:h?.6:.5,backgroundColor:"white",borderRadius:"0.5rem",width:"3rem",height:"3rem",display:"flex",justifyContent:"center",alignItems:"center",fontSize:"1.5rem",color:"grey",transition:"all 0.2s ease-in-out"}:{},[s,h]);return T.jsx(ac,{style:g,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),type:n,position:t,id:e,children:s==="connectable"&&T.jsx(rM,{handlePosition:t,createNode:a,recentNodeTypes:c,nodeTypes:u,children:T.jsx("div",{className:"w-[2rem] text-black text-bold h-[2rem] border-1 border-gray-200 hover:border-blue-600 text-2xl rounded-md justify-center hover:bg-blue-200",children:"+"})})})},xC=B.createContext(null),iM=({children:e,incoming:t,outgoing:n})=>{const r=Yh(),s=IT({id:r}),a=NT(),{nodes:c,nodeTypes:u}=Cc(),h=[...new Set(c.map(S=>S.name))].slice(-10),f=B.useContext(xC),g=(S,_)=>{f(r,S,_)},y=B.useMemo(()=>{const S={},_=P=>s.some(O=>O.targetHandle===P&&O.target===r||O.sourceHandle===P&&O.source===r);return S.l=_("incomingL")?"connected":"connectable",S.t=_("incomingT")?"connected":"connectable",S.b=_("outgoingB")?"connected":"connectable",S.r=_("outgoingR")?"connected":"connectable",S.l==="connected"&&(S.t="disabled"),S.t==="connected"&&(S.l="disabled"),S.r==="connected"&&(S.b="disabled"),S.b==="connected"&&(S.r="disabled"),S},[s,r]),m=[{position:Ke.Left,type:"target",id:"incomingL",p:"l"},{position:Ke.Right,type:"source",id:"outgoingR",p:"r"},{position:Ke.Top,type:"target",id:"incomingT",p:"t"},{position:Ke.Bottom,type:"source",id:"outgoingB",p:"b"}],w=B.useMemo(()=>m.map(({position:S,type:_,id:P,p:O})=>{const R=y[O];return a(r),_==="target"&&t||_==="source"&&n?T.jsx(oM,{position:S,type:_,handleId:P,createNode:g,connectState:R,nodeTypes:u,recentNodeTypes:h},P):T.jsx("div",{})}),[s,y]),C=fn.useMemo(()=>e,[e]);return T.jsxs("div",{className:"relative flex flex-col items-center",children:[T.jsx("div",{className:`absolute top-1/2 transform -translate-y-1/2 + ${y.l!=="connected"?"left-[-50px]":"left-[-0px]"} + ${y.l!=="connectable"?"[visibility:hidden]":""}`,children:w[0]}),T.jsxs("div",{className:"flex",children:[T.jsx("div",{className:`absolute left-1/2 transform -translate-y-1/2 + ${y.t!=="connected"?"top-[-50px]":"top-[-0px]"} + ${y.t!=="connectable"?"[visibility:hidden]":""}`,children:w[2]}),T.jsx("div",{className:"node-container",children:C}),T.jsx("div",{className:`absolute left-1/2 transform -translate-x-1/2 + ${y.b!=="connected"?"bottom-[-50px]":"bottom-[0px]"} + ${y.b!=="connectable"?"[visibility:hidden]":""}`,children:w[3]})]}),T.jsx("div",{className:`absolute top-1/2 transform -translate-y-1/2 + ${y.r!=="connected"?"right-[-50px]":"right-[-0px]"} + ${y.r!=="connectable"?"[visibility:hidden]":""}`,children:w[1]})]})},SC=fn.memo(iM),sM=({type:e,children:t,group:n})=>T.jsx(SC,{incoming:!1,outgoing:!0,children:T.jsxs("div",{className:"flex absoluterow",children:[T.jsx("div",{className:"node-group bold bg-blue-200",children:n}),T.jsxs("div",{className:"node-content !w-[400px]",children:[T.jsx("h1",{className:"node-title",children:e}),T.jsx("div",{className:"flex",children:t})]})]})}),Ka=({id:e,data:t})=>{const{updateNodeData:n}=Cc(),r=B.useCallback(s=>{n(e,{filter_value:s.target.value,filter:"abstract.search"})},[e,n]);return T.jsx(sM,{type:"Open Alex",group:Ka.group,children:T.jsxs("div",{className:"flex flex-row text-2xl w-[40vw]",children:[T.jsx("p",{children:"Base Term"}),T.jsx("input",{placeholder:"",className:"filter-input",value:t.filter_value||"",onChange:r})]})},e)};Ka.source="OpenAlex";Ka.group="Repository";Ka.label="base_term";Ka.type="Input";const aM=Object.freeze(Object.defineProperty({__proto__:null,default:Ka},Symbol.toStringTag,{value:"Module"})),lM=({type:e,children:t,group:n})=>T.jsx(SC,{incoming:!0,outgoing:!0,children:T.jsxs("div",{className:"flex",children:[T.jsx("div",{className:"node-group bold bg-fuchsia-200",children:e}),T.jsx("div",{className:"flex flex-col w-[240px] h-[120px]",children:t})]})}),cM=fn.memo(lM),CC=(e,t,n,r=new Set)=>{const s=t.find(c=>c.id===e);return!s||r.has(e)?[]:(r.add(e),U_(s,t,n).reduce((c,u)=>[...c,u,...CC(u.id,t,n,r)],[]))};function uM(e){const t=e.split(" ");if(t.length===1)return{givenName:"",familyName:t[0]};const n=t.pop()||"";return{givenName:t.join(" "),familyName:n}}function hM(e){return{article:"JournalArticle",book:"Book","book-chapter":"BookChapter","conference-paper":"ConferencePaper",dataset:"Dataset",preprint:"Preprint"}[e]||"Other"}function dM(e){return!e||!e.length?[]:e.map(t=>({subject:t.display_name,schemeUri:t.wikidata||"",valueUri:t.id,subjectScheme:"OpenAlex",lang:"en",classificationCode:t.id.split("/").pop()||""}))}function fM(e){const t=[];return e.openalex&&t.push({alternateIdentifier:e.openalex,alternateIdentifierType:"OpenAlex"}),e.mag&&t.push({alternateIdentifier:e.mag.toString(),alternateIdentifierType:"MAG"}),e.pmid&&t.push({alternateIdentifier:e.pmid,alternateIdentifierType:"PMID"}),e.pmcid&&t.push({alternateIdentifier:e.pmcid,alternateIdentifierType:"PMCID"}),t}function pM(e){return!e||!e.length?[]:e.map(t=>({relationType:"References",relatedIdentifier:t,relatedIdentifierType:"URL",resourceTypeGeneral:"JournalArticle"}))}function gM(e){return!e||!e.length?[]:e.map(t=>({funderName:t.funder_display_name,funderIdentifier:t.funder,funderIdentifierType:"ROR",awardNumber:t.award_id||"",awardTitle:"",awardUri:"",schemeURI:""}))}function mM(e){if(!e)return"";const t=Object.keys(e);Object.values(e).flat();const n=t.flatMap(r=>e[r].map(a=>({word:r,position:a})));return n.sort((r,s)=>r.position-s.position),n.map(r=>r.word).join(" ")}function yM(e){var c,u,h,f;const t=e.authorships.map(g=>{var w;const{givenName:y,familyName:m}=uM(g.author.display_name);return{name:g.author.display_name,nameType:"Personal",givenName:y,familyName:m,nameIdentifiers:g.author.orcid?[{nameIdentifier:g.author.orcid,nameIdentifierScheme:"ORCID",schemeUri:"https://orcid.org"}]:[],affiliation:((w=g.institutions)==null?void 0:w.map(C=>({name:C.display_name,affiliationIdentifier:C.id,affiliationIdentifierScheme:"OpenAlex",schemeUri:C.ror||""})))||[],language:"en"}}),n=((c=e.primary_location)==null?void 0:c.source.display_name)||"",r=((u=e.primary_location)==null?void 0:u.source.id)||"",s={rights:e.open_access.is_oa?`Open Access (${e.open_access.oa_status})`:"Closed Access",rightsUri:e.open_access.oa_url||"",schemeUri:"",rightsIdentifier:((h=e.primary_location)==null?void 0:h.license)||"",rightsIdentifierScheme:"License",lang:"en"};return{id:e.id,Identifier:{identifier:e.doi||e.id,identifierType:"DOI"},Creators:t,Titles:[{title:e.title,lang:"en"}],Publisher:{name:n,publisherIdentifier:r,publisherIdentifierScheme:"OpenAlex",schemeURI:""},PublicationYear:e.publication_year.toString(),Subjects:dM(e.concepts),Contributors:[],Dates:[{date:e.publication_date||e.created_date,dateType:"Issued",dateInformation:"Publication date"},{date:e.updated_date,dateType:"Updated",dateInformation:"Last updated in OpenAlex"}],Language:e.language||"en",ResourceType:{resourceType:e.type,resourceTypeGeneral:hM(e.type)},AlternateIdentifiers:fM(e.ids),RelatedIdentifiers:pM(e.referenced_works),Sizes:[],Format:"",Version:((f=e.primary_location)==null?void 0:f.version)||"",Rights:s,Description:e.abstract_inverted_index?[{description:mM(e.abstract_inverted_index),descriptionType:"Abstract",lang:"en"}]:[],GeoLocation:[],FundingReferences:gM(e.grants),RelatedItems:[]}}function vM(e){try{return yM(e)}catch(t){throw console.error("Error processing OpenAlex file:",t),t}}var fh={exports:{}},wM=fh.exports,rw;function xM(){return rw||(rw=1,function(e,t){(function(n,r){e.exports=r()})(wM,function(){var n=function(d,v){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,A){b.__proto__=A}||function(b,A){for(var k in A)Object.prototype.hasOwnProperty.call(A,k)&&(b[k]=A[k])})(d,v)},r=function(){return(r=Object.assign||function(d){for(var v,b=1,A=arguments.length;b"u"||a.Promise||(a.Promise=Promise);var f=Object.getPrototypeOf,g={}.hasOwnProperty;function y(d,v){return g.call(d,v)}function m(d,v){typeof v=="function"&&(v=v(f(d))),(typeof Reflect>"u"?c:Reflect.ownKeys)(v).forEach(function(b){C(d,b,v[b])})}var w=Object.defineProperty;function C(d,v,b,A){w(d,v,h(b&&y(b,"get")&&typeof b.get=="function"?{get:b.get,set:b.set,configurable:!0}:{value:b,configurable:!0,writable:!0},A))}function S(d){return{from:function(v){return d.prototype=Object.create(v.prototype),C(d.prototype,"constructor",d),{extend:m.bind(null,d.prototype)}}}}var _=Object.getOwnPropertyDescriptor,P=[].slice;function O(d,v,b){return P.call(d,v,b)}function R(d,v){return v(d)}function N(d){if(!d)throw new Error("Assertion Failed")}function J(d){a.setImmediate?setImmediate(d):setTimeout(d,0)}function ce(d,v){if(typeof v=="string"&&y(d,v))return d[v];if(!v)return d;if(typeof v!="string"){for(var b=[],A=0,k=v.length;A"u"?[]:function(){var d=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[d,f(d),d];var v=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[v,f(v),d]}(),_n=wn[0],Rn=wn[1],wn=wn[2],Rn=Rn&&Rn.then,en=_n&&_n.constructor,er=!!wn,tr=function(d,v){Sr.push([d,v]),nr&&(queueMicrotask(Ws),nr=!1)},Xr=!0,nr=!0,mn=[],ni=[],ri=it,Fn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Fe,pgp:!1,env:{},finalize:Fe},Ue=Fn,Sr=[],Ln=0,Qr=[];function je(d){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var v=this._PSD=Ue;if(typeof d!="function"){if(d!==Pn)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&rr(this,this._value))}this._state=null,this._value=null,++v.ref,function b(A,k){try{k(function(j){if(A._state===null){if(j===A)throw new TypeError("A promise cannot be resolved with itself.");var H=A._lib&&br();j&&typeof j.then=="function"?b(A,function(Z,re){j instanceof je?j._then(Z,re):j.then(Z,re)}):(A._state=!0,A._value=j,Ki(A)),H&&or()}},rr.bind(null,A))}catch(j){rr(A,j)}}(this,d)}var bo={get:function(){var d=Ue,v=Pr;function b(A,k){var j=this,H=!d.global&&(d!==Ue||v!==Pr),Z=H&&!jn(),re=new je(function(se,he){Eo(j,new Cr(Xi(A,d,H,Z),Xi(k,d,H,Z),se,he,d))});return this._consoleTask&&(re._consoleTask=this._consoleTask),re}return b.prototype=Pn,b},set:function(d){C(this,"then",d&&d.prototype===Pn?bo:{get:function(){return d},set:bo.set})}};function Cr(d,v,b,A,k){this.onFulfilled=typeof d=="function"?d:null,this.onRejected=typeof v=="function"?v:null,this.resolve=b,this.reject=A,this.psd=k}function rr(d,v){var b,A;ni.push(v),d._state===null&&(b=d._lib&&br(),v=ri(v),d._state=!1,d._value=v,A=d,mn.some(function(k){return k._value===A._value})||mn.push(A),Ki(d),b&&or())}function Ki(d){var v=d._listeners;d._listeners=[];for(var b=0,A=v.length;b.",Et="String expected.",Zr=[],eo="__dbnames",si="readonly",to="readwrite";function _r(d,v){return d?v?function(){return d.apply(this,arguments)&&v.apply(this,arguments)}:d:v}var ai={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Ar(d){return typeof d!="string"||/\./.test(d)?function(v){return v}:function(v){return v[d]===void 0&&d in v&&delete(v=Y(v))[d],v}}function vn(){throw Ce.Type()}function lt(d,v){try{var b=tn(d),A=tn(v);if(b!==A)return b==="Array"?1:A==="Array"?-1:b==="binary"?1:A==="binary"?-1:b==="string"?1:A==="string"?-1:b==="Date"?1:A!=="Date"?NaN:-1;switch(b){case"number":case"Date":case"string":return vwe+xe&&ge(we+he)})})}var ve=nn(b)&&b.limit===1/0&&(typeof d!="function"||d===ea)&&{index:b.index,range:b.range};return ge(0).then(function(){if(0=de})).length!==0?(he.forEach(function(ge){fe.push(function(){var ve=le,we=ge._cfg.dbschema;qt(ee,ve,ue),qt(ee,we,ue),le=ee._dbSchema=we;var xe=di(ve,we);xe.add.forEach(function(Le){ra(ue,Le[0],Le[1].primKey,Le[1].indexes)}),xe.change.forEach(function(Le){if(Le.recreate)throw new Ce.Upgrade("Not yet support for changing primary key");var De=ue.objectStore(Le.name);Le.add.forEach(function($e){return Ro(De,$e)}),Le.change.forEach(function($e){De.deleteIndex($e.name),Ro(De,$e)}),Le.del.forEach(function($e){return De.deleteIndex($e)})});var Te=ge._cfg.contentUpgrade;if(Te&&ge._cfg.version>de){hi(ee,ue),oe._memoizedTables={};var Ie=te(we);xe.del.forEach(function(Le){Ie[Le]=ve[Le]}),ns(ee,[ee.Transaction.prototype]),Ao(ee,[ee.Transaction.prototype],c(Ie),Ie),oe.schema=Ie;var ke,Ne=W(Te);return Ne&&Jr(),xe=je.follow(function(){var Le;(ke=Te(oe))&&Ne&&(Le=jn.bind(null,null),ke.then(Le,Le))}),ke&&typeof ke.then=="function"?je.resolve(ke):xe.then(function(){return ke})}}),fe.push(function(ve){var we,xe,Te=ge._cfg.dbschema;we=Te,xe=ve,[].slice.call(xe.db.objectStoreNames).forEach(function(Ie){return we[Ie]==null&&xe.db.deleteObjectStore(Ie)}),ns(ee,[ee.Transaction.prototype]),Ao(ee,[ee.Transaction.prototype],ee._storeNames,ee._dbSchema),oe.schema=ee._dbSchema}),fe.push(function(ve){ee.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(ee.idbdb.version/10)===ge._cfg.version?(ee.idbdb.deleteObjectStore("$meta"),delete ee._dbSchema.$meta,ee._storeNames=ee._storeNames.filter(function(we){return we!=="$meta"})):ve.objectStore("$meta").put(ge._cfg.version,"version"))})}),function ge(){return fe.length?je.resolve(fe.shift()(oe.idbtrans)).then(ge):je.resolve()}().then(function(){rs(le,ue)})):je.resolve();var ee,de,oe,ue,fe,le}).catch(H)):(c(k).forEach(function(he){ra(b,he,k[he].primKey,k[he].indexes)}),hi(d,b),void je.follow(function(){return d.on.populate.fire(j)}).catch(H));var re,se})}function nl(d,v){rs(d._dbSchema,v),v.db.version%10!=0||v.objectStoreNames.contains("$meta")||v.db.createObjectStore("$meta").add(Math.ceil(v.db.version/10-1),"version");var b=os(0,d.idbdb,v);qt(d,d._dbSchema,v);for(var A=0,k=di(b,d._dbSchema).change;AMath.pow(2,62)?0:le.oldVersion,ee=le<1,d.idbdb=fe.result,j&&nl(d,he),oo(d,le/10,he,oe))},oe),fe.onsuccess=yt(function(){he=null;var le,ge,ve,we,xe,Te=d.idbdb=fe.result,Ie=O(Te.objectStoreNames);if(0"u"?je.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(de){function oe(){return indexedDB.databases().finally(de)}re=setInterval(oe,100),oe()}).finally(function(){return clearInterval(re)}):Promise.resolve()).then(Z)]).then(function(){return H(),v.onReadyBeingFired=[],je.resolve(ss(function(){return d.on.ready.fire(d.vip)})).then(function de(){if(0v.limit?de.length=v.limit:d.length===v.limit&&de.length=ge.limit&&(!ge.values||Te.req.values)&&Uc(Te.req.query.range,ge.query.range)}),!1,ve,we];case"count":return xe=we.find(function(Te){return Hc(Te.req.query.range,ge.query.range)}),[xe,!!xe,ve,we]}}(v,b,"query",j),he=se[0],ee=se[1],de=se[2],oe=se[3];return he&&ee?he.obsSet=j.obsSet:(ee=A.query(j).then(function(ue){var fe=ue.result;if(he&&(he.res=fe),H){for(var le=0,ge=fe.length;le{async function c(){try{r(!0);const u=new CM;t(u),a(null)}catch(u){console.error("Database initialization failed:",u),a(u instanceof Error?u:new Error("Unknown database error"))}finally{r(!1)}}c()},[]),{db:e,isLoading:n,error:s}}var bM=Fs("progress").parts("root","label","track","range","valueText","view","circle","circleTrack","circleRange"),zo=bM.build(),Qu=od({getRootId:e=>{var t;return((t=e.ids)==null?void 0:t.root)??`progress-${e.id}`},getTrackId:e=>{var t;return((t=e.ids)==null?void 0:t.track)??`progress-${e.id}-track`},getLabelId:e=>{var t;return((t=e.ids)==null?void 0:t.label)??`progress-${e.id}-label`},getCircleId:e=>{var t;return((t=e.ids)==null?void 0:t.circle)??`progress-${e.id}-circle`}});function EM(e,t,n){const r=e.context.percent,s=e.context.isIndeterminate?"":`${r}%`,a=e.context.max,c=e.context.min,u=e.context.orientation,h=e.context.translations,f=e.context.isIndeterminate,g=e.context.value,y=h.value({value:g,max:a,percent:r,min:c}),m=PM(g,a),w={role:"progressbar","aria-label":y,"data-max":a,"aria-valuemin":c,"aria-valuemax":a,"aria-valuenow":g??void 0,"data-orientation":u,"data-state":m},C=_M(e.context);return{value:g,valueAsString:y,min:c,max:a,percent:r,percentAsString:s,indeterminate:f,setValue(S){t({type:"VALUE.SET",value:S})},setToMax(){t({type:"VALUE.SET",value:a})},setToMin(){t({type:"VALUE.SET",value:c})},getRootProps(){return n.element({dir:e.context.dir,...zo.root.attrs,id:Qu.getRootId(e.context),"data-max":a,"data-value":g??void 0,"data-state":m,"data-orientation":u,style:{"--percent":f?void 0:r}})},getLabelProps(){return n.element({dir:e.context.dir,id:Qu.getLabelId(e.context),...zo.label.attrs,"data-orientation":u})},getValueTextProps(){return n.element({dir:e.context.dir,"aria-live":"polite",...zo.valueText.attrs})},getTrackProps(){return n.element({dir:e.context.dir,id:Qu.getTrackId(e.context),...zo.track.attrs,...w})},getRangeProps(){return n.element({dir:e.context.dir,...zo.range.attrs,"data-orientation":u,"data-state":m,style:{[e.context.isHorizontal?"width":"height"]:f?void 0:`${r}%`}})},getCircleProps(){return n.element({dir:e.context.dir,id:Qu.getCircleId(e.context),...zo.circle.attrs,...w,...C.root})},getCircleTrackProps(){return n.element({dir:e.context.dir,"data-orientation":u,...zo.circleTrack.attrs,...C.track})},getCircleRangeProps(){return n.element({dir:e.context.dir,...zo.circleRange.attrs,...C.range,"data-state":m})},getViewProps(S){return n.element({dir:e.context.dir,...zo.view.attrs,"data-state":S.state,hidden:S.state!==m})}}}function PM(e,t){return e==null?"indeterminate":e===t?"complete":"loading"}function _M(e){const t={style:{"--radius":"calc(var(--size) / 2 - var(--thickness) / 2)",cx:"calc(var(--size) / 2)",cy:"calc(var(--size) / 2)",r:"var(--radius)",fill:"transparent",strokeWidth:"var(--thickness)"}};return{root:{style:{width:"var(--size)",height:"var(--size)"}},track:t,range:{opacity:e.value===0?0:void 0,style:{...t.style,"--percent":e.percent,"--circumference":"calc(2 * 3.14159 * var(--radius))","--offset":"calc(var(--circumference) * (100 - var(--percent)) / 100)",strokeDashoffset:"calc(var(--circumference) * ((100 - var(--percent)) / 100))",strokeDasharray:e.isIndeterminate?void 0:"var(--circumference)",transformOrigin:"center",transform:"rotate(-90deg)"}}}}function AM(e,t){return e+(t-e)/2}function RM(e){const t=qi(e);return bc({id:"progress",initial:"idle",context:{max:t.max??100,min:t.min??0,value:AM(t.min??0,t.max??100),orientation:"horizontal",translations:{value:({percent:n})=>n===-1?"loading...":`${n} percent`,...t.translations},...t},created:["validateContext"],computed:{isIndeterminate:n=>n.value===null,percent(n){return Og(n.value)?Math.round((n.value-n.min)/(n.max-n.min)*100):-1},isAtMax:n=>n.value===n.max,isHorizontal:n=>n.orientation==="horizontal",isRtl:n=>n.dir==="rtl"},states:{idle:{on:{"VALUE.SET":{actions:["setValue"]}}}}},{actions:{setValue:(n,r)=>{OM.value(n,r.value)},validateContext:n=>{if(n.value!=null){if(!Xg(n.max))throw new Error(`[progress] The max value passed \`${n.max}\` is not a valid number`);if(!TM(n.value,n.max))throw new Error(`[progress] The value passed \`${n.value}\` exceeds the max value \`${n.max}\``);if(!kM(n.value,n.min))throw new Error(`[progress] The value passed \`${n.value}\` exceeds the min value \`${n.min}\``)}}}})}function Xg(e){return Og(e)&&!isNaN(e)}function TM(e,t){return Xg(e)&&e<=t}function kM(e,t){return Xg(e)&&e>=t}var OM={value(e,t){var n;lc(e.value,t)||(e.value=t===null?null:Math.max(0,Math.min(t,e.max)),(n=e.onValueChange)==null||n.call(e,{value:t}))}};zs()(["dir","getRootNode","id","ids","max","min","orientation","translations","value","onValueChange"]);const NM=(e={})=>{const{getRootNode:t}=Tc(),{dir:n}=id(),r={id:B.useId(),dir:n,getRootNode:t,value:e.defaultValue,...e},s={...r,value:e.value,onValueChange:Li(e.onValueChange,{sync:!0})},[a,c]=Ec(RM(r),{context:s});return EM(a,c,Qh)},bC=({value:e=50,min:t=0,max:n=100,label:r="Progress"})=>(NM(),T.jsx("div",{className:"w-4 h-4 border-2 border-black border-b-transparent rounded-full animate-spin"})),Vs=({id:e})=>{const t="https://api.openalex.org/works?per-page=20&filter=",{nodes:n,edges:r}=Cc(),[s,a]=B.useState(),[c,u]=B.useState(!1),[h,f]=B.useState(),{db:g}=Yg(),[y,m]=B.useState(!1),w=async P=>{if(g)try{await g.metadata.add(P);const O=await g.metadata.toArray();m(!0)}catch(O){console.error("Error adding data:",O)}},C=()=>{u(!0);let R=_.map(N=>N.data).map(N=>N.filter+":"+N.filter_value).join(",");fetch(t+R).then(N=>{if(N.ok)return N.json();throw new Error("Something went wrong!")}).then(N=>{f(N)}).catch(N=>{console.error(N)})};function S(){if(h){let P=Object(h);if(a(P.meta.count),P.results[0])for(let O of P.results){const R=vM(O);w(R)}u(!1)}}B.useEffect(()=>S(),[h]);const _=B.useMemo(()=>CC(e,n,r),[n,r]);return T.jsx(cM,{type:Vs.name,group:Vs.group,children:T.jsxs("div",{className:"flex flex-col flex-grow items-stretch justify-between",children:[T.jsx("div",{className:"flex flex-grow justify-center items-center text-xl",children:c?T.jsx(bC,{}):`n = ${s?s.toLocaleString():"?"}`}),T.jsxs("div",{className:"flex flex-shrink flex-row justify-center border-t-2 rounded-b-md gap-4 text-2xl px-2 py-2 items-center",children:[T.jsx(tM,{className:"border-1 border-black rounded-sm text-4xl bg-green-100",onClick:()=>C()}),T.jsx(JD,{className:"border-1 border-black rounded-sm text-4xl"}),T.jsx(QD,{className:"border-1 border-black rounded-sm text-4xl"})]})]})},e)};Vs.source="OpenAlex";Vs.group="Repository";Vs.label="sink";Vs.type="Computation";const DM=Object.freeze(Object.defineProperty({__proto__:null,Loader:bC,default:Vs},Symbol.toStringTag,{value:"Module"})),EC="nodeRegistry",zr={};async function MM(){const e=Object.assign({"/src/flow/core/OpenAlex/nodes/BaseTermNode.jsx":aM,"/src/flow/core/OpenAlex/nodes/SinkNode.jsx":DM});for(const t in e){const n=e[t];if(n.default){const r=n.default;if(!r.name){console.warn(`Skipping invalid core node module: ${t}`);continue}iw(r.source+"-"+r.label,r||{});continue}if(n.factory){if(typeof n.factory!="function"){console.warn(`Skipping invalid factory in ${t}`);continue}const r=n.factory();if(!Array.isArray(r)){console.warn(`Factory in ${t} did not return an array of nodes.`);continue}r.forEach(s=>{if(!s||!s.label){console.warn(`Skipping invalid node in factory from ${t}`);return}iw(s.source+"-"+s.label,s.component||{})})}}}function IM(){const e=localStorage.getItem(EC);if(e)try{const t=JSON.parse(e);Object.keys(t).forEach(n=>{zr[n]&&(zr[n].config=t[n])})}catch(t){console.error("Failed to parse registry from storage:",t)}}function FM(){const e={};Object.keys(zr).forEach(t=>{e[t]=zr[t].config});try{localStorage.setItem(EC,JSON.stringify(e,null,2))}catch(t){console.error("Failed to save registry to storage:",t)}}function iw(e,t,n={}){zr[e]?(zr[e].config={...zr[e].config,...n},zr[e].component=t):zr[e]={component:t,config:n},FM()}function LM(){const e={};return Object.keys(zr).forEach(t=>{e[t]=zr[t].component}),e}async function jM(){IM(),await MM()}const BM="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";let og=(e=21)=>{let t="",n=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=BM[n[e]&63];return t};const $M=({title:e,children:t,footer:n,onClick:r,className:s=""})=>T.jsxs("div",{onClickCapture:r,className:Kg("h-50 w-100 bg-white p-4 rounded-lg shadow-md flex flex-col",s),children:[T.jsx("div",{className:"font-semibold text-lg border-b pb-2",children:e}),T.jsx("div",{className:"flex-1 flex py-4",children:t}),n&&T.jsx("div",{className:"border-t pt-2 text-sm text-gray-600",children:n})]});function VM(e){return xr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 294.1L383 167c9.4-9.4 24.6-9.4 33.9 0s9.3 24.6 0 34L273 345c-9.1 9.1-23.7 9.3-33.1.7L95 201.1c-4.7-4.7-7-10.9-7-17s2.3-12.3 7-17c9.4-9.4 24.6-9.4 33.9 0l127.1 127z"},child:[]}]})(e)}function zM(e){return xr({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416.3 256c0-21 13.1-38.9 31.7-46.1-4.9-20.5-13-39.7-23.7-57.1-6.4 2.8-13.2 4.3-20.1 4.3-12.6 0-25.2-4.8-34.9-14.4-14.9-14.9-18.2-36.8-10.2-55-17.3-10.7-36.6-18.8-57-23.7C295 82.5 277 95.7 256 95.7S217 82.5 209.9 64c-20.5 4.9-39.7 13-57.1 23.7 8.1 18.1 4.7 40.1-10.2 55-9.6 9.6-22.3 14.4-34.9 14.4-6.9 0-13.7-1.4-20.1-4.3C77 170.3 68.9 189.5 64 210c18.5 7.1 31.7 25 31.7 46.1 0 21-13.1 38.9-31.6 46.1 4.9 20.5 13 39.7 23.7 57.1 6.4-2.8 13.2-4.2 20-4.2 12.6 0 25.2 4.8 34.9 14.4 14.8 14.8 18.2 36.8 10.2 54.9 17.4 10.7 36.7 18.8 57.1 23.7 7.1-18.5 25-31.6 46-31.6s38.9 13.1 46 31.6c20.5-4.9 39.7-13 57.1-23.7-8-18.1-4.6-40 10.2-54.9 9.6-9.6 22.2-14.4 34.9-14.4 6.8 0 13.7 1.4 20 4.2 10.7-17.4 18.8-36.7 23.7-57.1-18.4-7.2-31.6-25.1-31.6-46.2zm-159.4 79.9c-44.3 0-80-35.9-80-80s35.7-80 80-80 80 35.9 80 80-35.7 80-80 80z"},child:[]}]})(e)}const HM=({id:e,description:t,name:n,onClick:r,onSaveEdit:s,setShowDialogue:a,className:c,flowID:u})=>{const[h,f]=B.useState(n),[g,y]=B.useState(t),[m,w]=B.useState(!1),[C,S]=B.useState(!0),_=B.useCallback(()=>{(!m||C)&&r()});return T.jsxs("div",{className:Kg("flex flex-col w-full bg-white p-4 rounded-lg shadow-md",{"cursor-pointer hover:bg-blue-200/40":C},c),onClick:_,children:[T.jsxs("div",{className:"flex justify-between font-semibold text-md border-b pb-2",children:[T.jsxs("div",{className:"self-start h-auto min-h-[1rem] break-words overflow-hidden",children:[!m&&h,m&&T.jsx("input",{className:"text-blue-200 border-1 border-gray-200",value:h,onChange:P=>f(P.target.value)},"nameInput")]}),T.jsxs("div",{className:"flex flex-row rounded-md",onMouseOver:()=>{S(!1)},onMouseOutCapture:()=>{m||S(!0)},children:[T.jsx(zM,{className:"w-6 h-6 hover:bg-blue-200/40 p-1"}),!C&&T.jsx(ZD,{className:"w-6 h-6 hover:bg-blue-200/40 p-1",onClick:P=>{P.stopPropagation(),w(!m)}}),!C&&T.jsx(KD,{onClick:P=>{P.stopPropagation(),a(!0)},className:"w-6 h-6 hover:bg-blue-200/40 p-1"})]})]}),T.jsx("div",{className:"flex break-words overflow-hidden h-full min-h-[rem]",children:T.jsxs("div",{className:"break-words overflow-hidden",children:[!m&&g,m&&T.jsx("textarea",{className:"w-full h-full text-blue-200 border-1 border-gray-200",value:g,onChange:P=>y(P.target.value)},"descriptionInput")]})}),T.jsxs("div",{className:"text-xs text-gray-400 justify-content-end",children:["ID: ",u]})]})},[UM,Ya]=Hs({name:"DialogContext",hookName:"useDialogContext",providerName:""}),Qg=B.forwardRef((e,t)=>{const n=Ya(),r=fC(),s=Zh({...r,present:n.open}),a=Xt(n.getBackdropProps(),s.getPresenceProps(),e);return s.unmounted?null:T.jsx(En.div,{...a,ref:Pc(s.ref,t)})});Qg.displayName="DialogBackdrop";const Jg=B.forwardRef((e,t)=>{const n=Ya(),r=Xt(n.getCloseTriggerProps(),e);return T.jsx(En.button,{...r,ref:t})});Jg.displayName="DialogCloseTrigger";const Zg=B.forwardRef((e,t)=>{const n=Ya(),r=Jh(),s=Xt(n.getContentProps(),r.getPresenceProps(),e);return r.unmounted?null:T.jsx(En.div,{...s,ref:Pc(r.ref,t)})});Zg.displayName="DialogContent";const em=B.forwardRef((e,t)=>{const n=Ya(),r=Xt(n.getDescriptionProps(),e);return T.jsx(En.div,{...r,ref:t})});em.displayName="DialogDescription";const tm=B.forwardRef((e,t)=>{const n=Ya(),r=Xt(n.getPositionerProps(),e);return Jh().unmounted?null:T.jsx(En.div,{...r,ref:t})});tm.displayName="DialogPositioner";var Oa=new WeakMap,Ju=new WeakMap,Zu={},np=0,PC=e=>e&&(e.host||PC(e.parentNode)),WM=(e,t)=>t.map(n=>{if(e.contains(n))return n;const r=PC(n);return r&&e.contains(r)?r:(console.error("[zag-js > ariaHidden] target",n,"in not contained inside",e,". Doing nothing"),null)}).filter(n=>!!n),qM=e=>e.localName==="next-route-announcer"||e.localName==="script"||e.hasAttribute("aria-live")?!0:e.matches("[data-live-announcer]"),GM=(e,t)=>{const{parentNode:n,markerName:r,controlAttribute:s,explicitBooleanValue:a}=t,c=WM(n,Array.isArray(e)?e:[e]);Zu[r]||(Zu[r]=new WeakMap);const u=Zu[r],h=[],f=new Set,g=new Set(c),y=w=>{!w||f.has(w)||(f.add(w),y(w.parentNode))};c.forEach(y);const m=w=>{!w||g.has(w)||Array.prototype.forEach.call(w.children,C=>{if(f.has(C))m(C);else try{if(qM(C))return;const S=C.getAttribute(s),_=a?S==="true":S!==null&&S!=="false",P=(Oa.get(C)||0)+1,O=(u.get(C)||0)+1;Oa.set(C,P),u.set(C,O),h.push(C),P===1&&_&&Ju.set(C,!0),O===1&&C.setAttribute(r,""),_||C.setAttribute(s,a?"true":"")}catch(S){console.error("[zag-js > ariaHidden] cannot operate on ",C,S)}})};return m(n),f.clear(),np++,()=>{h.forEach(w=>{const C=Oa.get(w)-1,S=u.get(w)-1;Oa.set(w,C),u.set(w,S),C||(Ju.has(w)||w.removeAttribute(s),Ju.delete(w)),S||w.removeAttribute(r)}),np--,np||(Oa=new WeakMap,Oa=new WeakMap,Ju=new WeakMap,Zu={})}},KM=e=>(Array.isArray(e)?e[0]:e).ownerDocument.body,YM=(e,t=KM(e),n="data-aria-hidden")=>{if(t)return GM(e,{parentNode:t,markerName:n,controlAttribute:"aria-hidden",explicitBooleanValue:!0})},XM=e=>{const t=requestAnimationFrame(()=>e());return()=>cancelAnimationFrame(t)};function QM(e,t={}){const{defer:n=!0}=t,r=n?XM:a=>a(),s=[];return s.push(r(()=>{const c=(typeof e=="function"?e():e).filter(Boolean);c.length!==0&&s.push(YM(c))})),()=>{s.forEach(a=>a==null?void 0:a())}}var JM=Object.defineProperty,ZM=(e,t,n)=>t in e?JM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,Dt=(e,t,n)=>ZM(e,typeof t!="symbol"?t+"":t,n),sw={activateTrap(e,t){if(e.length>0){const r=e[e.length-1];r!==t&&r.pause()}const n=e.indexOf(t);n===-1||e.splice(n,1),e.push(t)},deactivateTrap(e,t){const n=e.indexOf(t);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},eI=[],tI=class{constructor(e,t){Dt(this,"trapStack"),Dt(this,"config"),Dt(this,"doc"),Dt(this,"state",{containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0}),Dt(this,"listenerCleanups",[]),Dt(this,"handleFocus",r=>{const s=Go(r),a=this.findContainerIndex(s,r)>=0;if(a||Vg(s))a&&(this.state.mostRecentlyFocusedNode=s);else{r.stopImmediatePropagation();let c,u=!0;if(this.state.mostRecentlyFocusedNode)if(Ml(this.state.mostRecentlyFocusedNode)>0){const h=this.findContainerIndex(this.state.mostRecentlyFocusedNode),{tabbableNodes:f}=this.state.containerGroups[h];if(f.length>0){const g=f.findIndex(y=>y===this.state.mostRecentlyFocusedNode);g>=0&&(this.config.isKeyForward(this.state.recentNavEvent)?g+1=0&&(c=f[g-1],u=!1))}}else this.state.containerGroups.some(h=>h.tabbableNodes.some(f=>Ml(f)>0))||(u=!1);else u=!1;u&&(c=this.findNextNavNode({target:this.state.mostRecentlyFocusedNode,isBackward:this.config.isKeyBackward(this.state.recentNavEvent)})),c?this.tryFocus(c):this.tryFocus(this.state.mostRecentlyFocusedNode||this.getInitialFocusNode())}this.state.recentNavEvent=void 0}),Dt(this,"handlePointerDown",r=>{const s=Go(r);if(!(this.findContainerIndex(s,r)>=0)){if(Bl(this.config.clickOutsideDeactivates,r)){this.deactivate({returnFocus:this.config.returnFocusOnDeactivate});return}Bl(this.config.allowOutsideClick,r)||r.preventDefault()}}),Dt(this,"handleClick",r=>{const s=Go(r);this.findContainerIndex(s,r)>=0||Bl(this.config.clickOutsideDeactivates,r)||Bl(this.config.allowOutsideClick,r)||(r.preventDefault(),r.stopImmediatePropagation())}),Dt(this,"handleTabKey",r=>{if(this.config.isKeyForward(r)||this.config.isKeyBackward(r)){this.state.recentNavEvent=r;const s=this.config.isKeyBackward(r),a=this.findNextNavNode({event:r,isBackward:s});if(!a)return;jl(r)&&r.preventDefault(),this.tryFocus(a)}}),Dt(this,"handleEscapeKey",r=>{nI(r)&&Bl(this.config.escapeDeactivates,r)!==!1&&(r.preventDefault(),this.deactivate())}),Dt(this,"_mutationObserver"),Dt(this,"setupMutationObserver",()=>{const r=this.doc.defaultView||window;this._mutationObserver=new r.MutationObserver(s=>{s.some(c=>Array.from(c.removedNodes).some(h=>h===this.state.mostRecentlyFocusedNode))&&this.tryFocus(this.getInitialFocusNode())})}),Dt(this,"updateObservedNodes",()=>{var r;(r=this._mutationObserver)==null||r.disconnect(),this.state.active&&!this.state.paused&&this.state.containers.map(s=>{var a;(a=this._mutationObserver)==null||a.observe(s,{subtree:!0,childList:!0})})}),Dt(this,"getInitialFocusNode",()=>{let r=this.getNodeForOption("initialFocus",{hasFallback:!0});if(r===!1)return!1;if(r===void 0||r&&!ji(r))if(this.findContainerIndex(this.doc.activeElement)>=0)r=this.doc.activeElement;else{const s=this.state.tabbableGroups[0];r=s&&s.firstTabbableNode||this.getNodeForOption("fallbackFocus")}else r===null&&(r=this.getNodeForOption("fallbackFocus"));if(!r)throw new Error("Your focus-trap needs to have at least one focusable element");return r.isConnected||(r=this.getNodeForOption("fallbackFocus")),r}),Dt(this,"tryFocus",r=>{if(r!==!1&&r!==tC(this.doc)){if(!r||!r.focus){this.tryFocus(this.getInitialFocusNode());return}r.focus({preventScroll:!!this.config.preventScroll}),this.state.mostRecentlyFocusedNode=r,rI(r)&&r.select()}}),Dt(this,"deactivate",r=>{if(!this.state.active)return this;const s={onDeactivate:this.config.onDeactivate,onPostDeactivate:this.config.onPostDeactivate,checkCanReturnFocus:this.config.checkCanReturnFocus,...r};clearTimeout(this.state.delayInitialFocusTimer),this.state.delayInitialFocusTimer=void 0,this.removeListeners(),this.state.active=!1,this.state.paused=!1,this.updateObservedNodes(),sw.deactivateTrap(this.trapStack,this);const a=this.getOption(s,"onDeactivate"),c=this.getOption(s,"onPostDeactivate"),u=this.getOption(s,"checkCanReturnFocus"),h=this.getOption(s,"returnFocus","returnFocusOnDeactivate");a==null||a();const f=()=>{aw(()=>{if(h){const g=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);this.tryFocus(g)}c==null||c()})};if(h&&u){const g=this.getReturnFocusNode(this.state.nodeFocusedBeforeActivation);return u(g).then(f,f),this}return f(),this}),Dt(this,"pause",r=>{if(this.state.paused||!this.state.active)return this;const s=this.getOption(r,"onPause"),a=this.getOption(r,"onPostPause");return this.state.paused=!0,s==null||s(),this.removeListeners(),this.updateObservedNodes(),a==null||a(),this}),Dt(this,"unpause",r=>{if(!this.state.paused||!this.state.active)return this;const s=this.getOption(r,"onUnpause"),a=this.getOption(r,"onPostUnpause");return this.state.paused=!1,s==null||s(),this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),a==null||a(),this}),Dt(this,"updateContainerElements",r=>(this.state.containers=Array.isArray(r)?r.filter(Boolean):[r].filter(Boolean),this.state.active&&this.updateTabbableNodes(),this.updateObservedNodes(),this)),Dt(this,"getReturnFocusNode",r=>{const s=this.getNodeForOption("setReturnFocus",{params:[r]});return s||(s===!1?!1:r)}),Dt(this,"getOption",(r,s,a)=>r&&r[s]!==void 0?r[s]:this.config[a||s]),Dt(this,"getNodeForOption",(r,{hasFallback:s=!1,params:a=[]}={})=>{let c=this.config[r];if(typeof c=="function"&&(c=c(...a)),c===!0&&(c=void 0),!c){if(c===void 0||c===!1)return c;throw new Error(`\`${r}\` was specified but was not a node, or did not return a node`)}let u=c;if(typeof c=="string"){try{u=this.doc.querySelector(c)}catch(h){throw new Error(`\`${r}\` appears to be an invalid selector; error="${h.message}"`)}if(!u&&!s)throw new Error(`\`${r}\` as selector refers to no known node`)}return u}),Dt(this,"findNextNavNode",r=>{const{event:s,isBackward:a=!1}=r,c=r.target||Go(s);this.updateTabbableNodes();let u=null;if(this.state.tabbableGroups.length>0){const h=this.findContainerIndex(c,s),f=h>=0?this.state.containerGroups[h]:void 0;if(h<0)a?u=this.state.tabbableGroups[this.state.tabbableGroups.length-1].lastTabbableNode:u=this.state.tabbableGroups[0].firstTabbableNode;else if(a){let g=this.state.tabbableGroups.findIndex(({firstTabbableNode:y})=>c===y);if(g<0&&((f==null?void 0:f.container)===c||ji(c)&&!Ts(c)&&!(f!=null&&f.nextTabbableNode(c,!1)))&&(g=h),g>=0){const y=g===0?this.state.tabbableGroups.length-1:g-1,m=this.state.tabbableGroups[y];u=Ml(c)>=0?m.lastTabbableNode:m.lastDomTabbableNode}else jl(s)||(u=f==null?void 0:f.nextTabbableNode(c,!1))}else{let g=this.state.tabbableGroups.findIndex(({lastTabbableNode:y})=>c===y);if(g<0&&((f==null?void 0:f.container)===c||ji(c)&&!Ts(c)&&!(f!=null&&f.nextTabbableNode(c)))&&(g=h),g>=0){const y=g===this.state.tabbableGroups.length-1?0:g+1,m=this.state.tabbableGroups[y];u=Ml(c)>=0?m.firstTabbableNode:m.firstDomTabbableNode}else jl(s)||(u=f==null?void 0:f.nextTabbableNode(c))}}else u=this.getNodeForOption("fallbackFocus");return u}),this.trapStack=t.trapStack||eI;const n={returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward(r){return jl(r)&&!r.shiftKey},isKeyBackward(r){return jl(r)&&r.shiftKey},...t};this.doc=n.document||ei(Array.isArray(e)?e[0]:e),this.config=n,this.updateContainerElements(e),this.setupMutationObserver()}get active(){return this.state.active}get paused(){return this.state.paused}findContainerIndex(e,t){const n=typeof(t==null?void 0:t.composedPath)=="function"?t.composedPath():void 0;return this.state.containerGroups.findIndex(({container:r,tabbableNodes:s})=>r.contains(e)||(n==null?void 0:n.includes(r))||s.find(a=>a===e))}updateTabbableNodes(){if(this.state.containerGroups=this.state.containers.map(e=>{const t=oC(e),n=Wg(e),r=t.length>0?t[0]:void 0,s=t.length>0?t[t.length-1]:void 0,a=n.find(f=>Ts(f)),c=n.slice().reverse().find(f=>Ts(f)),u=!!t.find(f=>Ml(f)>0);function h(f,g=!0){const y=t.indexOf(f);return y<0?g?n.slice(n.indexOf(f)+1).find(m=>Ts(m)):n.slice(0,n.indexOf(f)).reverse().find(m=>Ts(m)):t[y+(g?1:-1)]}return{container:e,tabbableNodes:t,focusableNodes:n,posTabIndexesFound:u,firstTabbableNode:r,lastTabbableNode:s,firstDomTabbableNode:a,lastDomTabbableNode:c,nextTabbableNode:h}}),this.state.tabbableGroups=this.state.containerGroups.filter(e=>e.tabbableNodes.length>0),this.state.tabbableGroups.length<=0&&!this.getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(this.state.containerGroups.find(e=>e.posTabIndexesFound)&&this.state.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")}addListeners(){if(this.state.active)return sw.activateTrap(this.trapStack,this),this.state.delayInitialFocusTimer=this.config.delayInitialFocus?aw(()=>{this.tryFocus(this.getInitialFocusNode())}):this.tryFocus(this.getInitialFocusNode()),this.listenerCleanups.push(uo(this.doc,"focusin",this.handleFocus,!0),uo(this.doc,"mousedown",this.handlePointerDown,{capture:!0,passive:!1}),uo(this.doc,"touchstart",this.handlePointerDown,{capture:!0,passive:!1}),uo(this.doc,"click",this.handleClick,{capture:!0,passive:!1}),uo(this.doc,"keydown",this.handleTabKey,{capture:!0,passive:!1}),uo(this.doc,"keydown",this.handleEscapeKey)),this}removeListeners(){if(this.state.active)return this.listenerCleanups.forEach(e=>e()),this.listenerCleanups=[],this}activate(e){if(this.state.active)return this;const t=this.getOption(e,"onActivate"),n=this.getOption(e,"onPostActivate"),r=this.getOption(e,"checkCanFocusTrap");r||this.updateTabbableNodes(),this.state.active=!0,this.state.paused=!1,this.state.nodeFocusedBeforeActivation=this.doc.activeElement||null,t==null||t();const s=()=>{r&&this.updateTabbableNodes(),this.addListeners(),this.updateObservedNodes(),n==null||n()};return r?(r(this.state.containers.concat()).then(s,s),this):(s(),this)}},jl=e=>e.key==="Tab",Bl=(e,...t)=>typeof e=="function"?e(...t):e,nI=e=>!e.isComposing&&e.key==="Escape",aw=e=>setTimeout(e,0),rI=e=>e.localName==="input"&&"select"in e&&typeof e.select=="function";function oI(e,t={}){let n;const r=bn(()=>{const s=typeof e=="function"?e():e;if(s){n=new tI(s,{escapeDeactivates:!1,allowOutsideClick:!0,preventScroll:!0,returnFocusOnDeactivate:!0,delayInitialFocus:!1,fallbackFocus:s,...t,document:ei(s)});try{n.activate()}catch{}}});return function(){n==null||n.deactivate(),r()}}var rp="data-scroll-lock";function lw(e,t){if(!e)return;const n=Object.keys(t).reduce((r,s)=>(r[s]=e.style.getPropertyValue(s),r),{});return Object.assign(e.style,t),()=>{Object.assign(e.style,n)}}function iI(e,t,n){if(!e)return;const r=e.style.getPropertyValue(t);return e.style.setProperty(t,n),()=>{r?e.style.setProperty(t,r):e.style.removeProperty(t)}}function sI(e){const t=e.getBoundingClientRect().left;return Math.round(t)+e.scrollLeft?"paddingLeft":"paddingRight"}function aI(e){const t=e??document,n=t.defaultView??window,{documentElement:r,body:s}=t;if(s.hasAttribute(rp))return;s.setAttribute(rp,"");const c=n.innerWidth-r.clientWidth,u=()=>iI(r,"--scrollbar-width",`${c}px`),h=sI(r),f=()=>lw(s,{overflow:"hidden",[h]:`${c}px`}),g=()=>{const{scrollX:m,scrollY:w,visualViewport:C}=n,S=(C==null?void 0:C.offsetLeft)??0,_=(C==null?void 0:C.offsetTop)??0,P=lw(s,{position:"fixed",overflow:"hidden",top:`${-(w-Math.floor(_))}px`,left:`${-(m-Math.floor(S))}px`,right:"0",[h]:`${c}px`});return()=>{P==null||P(),n.scrollTo({left:m,top:w,behavior:"instant"})}},y=[u(),CN()?g():f()];return()=>{y.forEach(m=>m==null?void 0:m()),s.removeAttribute(rp)}}var lI=Fs("dialog").parts("trigger","backdrop","positioner","content","title","description","closeTrigger"),As=lI.build(),ht=od({getPositionerId:e=>{var t;return((t=e.ids)==null?void 0:t.positioner)??`dialog:${e.id}:positioner`},getBackdropId:e=>{var t;return((t=e.ids)==null?void 0:t.backdrop)??`dialog:${e.id}:backdrop`},getContentId:e=>{var t;return((t=e.ids)==null?void 0:t.content)??`dialog:${e.id}:content`},getTriggerId:e=>{var t;return((t=e.ids)==null?void 0:t.trigger)??`dialog:${e.id}:trigger`},getTitleId:e=>{var t;return((t=e.ids)==null?void 0:t.title)??`dialog:${e.id}:title`},getDescriptionId:e=>{var t;return((t=e.ids)==null?void 0:t.description)??`dialog:${e.id}:description`},getCloseTriggerId:e=>{var t;return((t=e.ids)==null?void 0:t.closeTrigger)??`dialog:${e.id}:close`},getContentEl:e=>ht.getById(e,ht.getContentId(e)),getPositionerEl:e=>ht.getById(e,ht.getPositionerId(e)),getBackdropEl:e=>ht.getById(e,ht.getBackdropId(e)),getTriggerEl:e=>ht.getById(e,ht.getTriggerId(e)),getTitleEl:e=>ht.getById(e,ht.getTitleId(e)),getDescriptionEl:e=>ht.getById(e,ht.getDescriptionId(e)),getCloseTriggerEl:e=>ht.getById(e,ht.getCloseTriggerId(e))});function cI(e,t,n){const r=e.context["aria-label"],s=e.matches("open"),a=e.context.renderedElements;return{open:s,setOpen(c){c!==s&&t(c?"OPEN":"CLOSE")},getTriggerProps(){return n.button({...As.trigger.attrs,dir:e.context.dir,id:ht.getTriggerId(e.context),"aria-haspopup":"dialog",type:"button","aria-expanded":s,"data-state":s?"open":"closed","aria-controls":ht.getContentId(e.context),onClick(c){c.defaultPrevented||t("TOGGLE")}})},getBackdropProps(){return n.element({...As.backdrop.attrs,dir:e.context.dir,hidden:!s,id:ht.getBackdropId(e.context),"data-state":s?"open":"closed"})},getPositionerProps(){return n.element({...As.positioner.attrs,dir:e.context.dir,id:ht.getPositionerId(e.context),style:{pointerEvents:s?void 0:"none"}})},getContentProps(){return n.element({...As.content.attrs,dir:e.context.dir,role:e.context.role,hidden:!s,id:ht.getContentId(e.context),tabIndex:-1,"data-state":s?"open":"closed","aria-modal":!0,"aria-label":r||void 0,"aria-labelledby":r||!a.title?void 0:ht.getTitleId(e.context),"aria-describedby":a.description?ht.getDescriptionId(e.context):void 0})},getTitleProps(){return n.element({...As.title.attrs,dir:e.context.dir,id:ht.getTitleId(e.context)})},getDescriptionProps(){return n.element({...As.description.attrs,dir:e.context.dir,id:ht.getDescriptionId(e.context)})},getCloseTriggerProps(){return n.button({...As.closeTrigger.attrs,dir:e.context.dir,id:ht.getCloseTriggerId(e.context),type:"button",onClick(c){c.defaultPrevented||(c.stopPropagation(),t("CLOSE"))}})}}}function uI(e){const t=qi(e);return bc({id:"dialog",initial:t.open?"open":"closed",context:{role:"dialog",renderedElements:{title:!0,description:!0},modal:!0,trapFocus:!0,preventScroll:!0,closeOnInteractOutside:!0,closeOnEscape:!0,restoreFocus:!0,...t},created:["setAlertDialogProps"],watch:{open:["toggleVisibility"]},states:{open:{entry:["checkRenderedElements","syncZIndex"],activities:["trackDismissableElement","trapFocus","preventScroll","hideContentBelow"],on:{"CONTROLLED.CLOSE":{target:"closed"},CLOSE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnClose"]},{target:"closed",actions:["invokeOnClose"]}]}},closed:{on:{"CONTROLLED.OPEN":{target:"open"},OPEN:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}],TOGGLE:[{guard:"isOpenControlled",actions:["invokeOnOpen"]},{target:"open",actions:["invokeOnOpen"]}]}}}},{guards:{isOpenControlled:n=>!!n["open.controlled"]},activities:{trackDismissableElement(n,r,{send:s}){return uC(()=>ht.getContentEl(n),{defer:!0,pointerBlocking:n.modal,exclude:[ht.getTriggerEl(n)],onInteractOutside(c){var u;(u=n.onInteractOutside)==null||u.call(n,c),n.closeOnInteractOutside||c.preventDefault()},persistentElements:n.persistentElements,onFocusOutside:n.onFocusOutside,onPointerDownOutside:n.onPointerDownOutside,onEscapeKeyDown(c){var u;(u=n.onEscapeKeyDown)==null||u.call(n,c),n.closeOnEscape||c.preventDefault()},onDismiss(){s({type:"CLOSE",src:"interact-outside"})}})},preventScroll(n){if(n.preventScroll)return aI(ht.getDoc(n))},trapFocus(n){return!n.trapFocus||!n.modal?void 0:oI(()=>ht.getContentEl(n),{preventScroll:!0,returnFocusOnDeactivate:!!n.restoreFocus,initialFocus:n.initialFocusEl,setReturnFocus:s=>{var a;return((a=n.finalFocusEl)==null?void 0:a.call(n))??s}})},hideContentBelow(n){return n.modal?QM(()=>[ht.getContentEl(n)],{defer:!0}):void 0}},actions:{setAlertDialogProps(n){n.role==="alertdialog"&&(n.initialFocusEl||(n.initialFocusEl=()=>ht.getCloseTriggerEl(n)),n.closeOnInteractOutside=!1)},checkRenderedElements(n){bn(()=>{n.renderedElements.title=!!ht.getTitleEl(n),n.renderedElements.description=!!ht.getDescriptionEl(n)})},syncZIndex(n){bn(()=>{const r=ht.getContentEl(n);if(!r)return;const s=nC(r);[ht.getPositionerEl(n),ht.getBackdropEl(n)].forEach(c=>{c==null||c.style.setProperty("--z-index",s.zIndex)})})},invokeOnClose(n){var r;(r=n.onOpenChange)==null||r.call(n,{open:!1})},invokeOnOpen(n){var r;(r=n.onOpenChange)==null||r.call(n,{open:!0})},toggleVisibility(n,r,{send:s}){s({type:n.open?"CONTROLLED.OPEN":"CONTROLLED.CLOSE",previousEvent:r})}}})}zs()(["aria-label","closeOnEscape","closeOnInteractOutside","dir","finalFocusEl","getRootNode","getRootNode","id","id","ids","initialFocusEl","modal","onEscapeKeyDown","onFocusOutside","onInteractOutside","onOpenChange","onPointerDownOutside","open.controlled","open","persistentElements","preventScroll","restoreFocus","role","trapFocus"]);const hI=(e={})=>{const{getRootNode:t}=Tc(),{dir:n}=id(),r={id:B.useId(),getRootNode:t,dir:n,open:e.defaultOpen,"open.controlled":e.open!==void 0,...e},s={...r,open:e.open,onOpenChange:Li(e.onOpenChange,{sync:!0}),onEscapeKeyDown:Li(e.onEscapeKeyDown),onInteractOutside:Li(e.onInteractOutside)},[a,c]=Ec(uI(r),{context:s});return cI(a,c,Qh)},_C=e=>{const[t,{children:n,...r}]=US(e),[s]=pC(t),a=hI(r),c=Zh(Xt({present:a.open},t));return T.jsx(UM,{value:a,children:T.jsx(dC,{value:s,children:T.jsx(Dg,{value:c,children:n})})})},nm=B.forwardRef((e,t)=>{const n=Ya(),r=Xt(n.getTitleProps(),e);return T.jsx(En.h2,{...r,ref:t})});nm.displayName="DialogTitle";const dI=({showDialogue:e,setShowDialogue:t,onDelete:n,flowForDel:r})=>T.jsx(_C,{className:"relative z-50",open:e,onOpenChange:s=>t(s.open),children:T.jsxs(qg,{children:[T.jsx(Qg,{className:"fixed inset-0 bg-black opacity-50"}),T.jsx(tm,{className:"fixed top-0 left-1/2 transform -translate-x-1/2 mt-10 z-50",children:T.jsxs(Zg,{className:"bg-white p-6 rounded-lg shadow-lg w-96",children:[T.jsxs(nm,{className:"text-xl font-semibold",children:["Delete ",r,"?"]}),T.jsx(em,{className:"text-gray-700 mt-2",children:"Are you sure you want to delete this research flow?"}),T.jsxs("div",{className:"mt-4 flex flex-col gap-6",children:[T.jsx("button",{onClick:s=>{s.stopPropagation(),n()},className:"bg-gray-100 text-black rounded hover:bg-gray-200 w-40",children:"Delete Research Flow"}),T.jsx(Jg,{className:"bg-gray-300 py-2 px-4 rounded hover:bg-gray-400",children:"Cancel"})]})]})})]})}),AC=({title:e="Dialog Title",closeText:t="Close",contentClassName:n="",backdropClassName:r="",submitButton:s=null,isOpen:a=!1,setIsOpen:c=()=>{},children:u})=>T.jsx(_C,{open:a,onOpenChange:h=>c(h.open),children:T.jsxs(qg,{children:[T.jsx(Qg,{className:`fixed inset-0 bg-black opacity-20 ${r}`}),T.jsx(tm,{className:"fixed inset-0 flex justify-center items-center",children:T.jsxs(Zg,{className:`bg-white p-6 rounded-lg shadow-xl w-96 ${n}`,children:[T.jsx(nm,{className:"text-xl font-semibold text-gray-800",children:e}),u,T.jsx(em,{}),T.jsxs("div",{className:"mt-4 flex justify-between items-center",children:[T.jsx(Jg,{className:"cancel-button",children:t}),u&&T.jsx("div",{children:s})]})]})})]})}),fI=({nodeMenuVisible:e,setNodeMenuVisible:t})=>(B.useCallback(),T.jsx(AC,{isOpen:e,setIsOpen:t,closeText:"Close",title:"Add Node",children:T.jsx("div",{className:"flex flex-col mt-2 gap-2"})}));jM();const op=LM(),pI=({nodesIn:e,edgesIn:t,...n})=>{const r=B.useRef(null),{viewport:s,onNodesChange:a,onEdgesChange:c,onConnect:u,addNode:h,updateNodePosition:f,addEdge:g,setViewport:y,clearStore:m,updateNodeTypes:w,nodeTypes:C,setNodes:S,setEdges:_}=Cc();B.useMemo(()=>w(Object.keys(op)),[]);const P=e,O=t,[R,N]=B.useState(!1),J=Gh(),ce=B.useCallback((G,te,D)=>{if(!Object.keys(op).includes(D))return;let M=J.getNodes().find(V=>V.id==G),z=M.position.x,U=M.position.y;const Y=M.measured.width,$=M.measured.height,F=40,L=40,K=og();te==="right"&&(z=z+F+Y),te==="left"&&(z=z-F-Y),te==="top"&&(U=U-L-$),te==="bottom"&&(U=U+L+$),h({id:K,type:D,position:{x:z,y:U},data:{}}),te==="left"&&g({source:K,sourceHandle:"outgoingR",target:G,targetHandle:"incomingL"}),te==="right"&&g({source:G,sourceHandle:"outgoingR",target:K,targetHandle:"incomingL"}),te==="top"&&g({source:K,sourceHandle:"outgoingB",target:G,targetHandle:"incomingT"}),te==="bottom"&&g({id:og(),source:G,sourceHandle:"outgoingB",target:K,targetHandle:"incomingT"})});return DT({onEnd:G=>y(G)}),T.jsxs("div",{className:"flow",children:[T.jsx(fI,{nodeMenuVisible:R,setNodeMenuVisible:N}),T.jsx("div",{ref:r,className:"reactflow-wrapper",children:T.jsx(xC.Provider,{value:ce,children:T.jsxs(OT,{nodes:P,defaultViewport:s,edges:O,nodeTypes:op,onNodesChange:a,onEdgesChange:c,onConnect:u,nodeOrigin:[.5,.5],snapToGrid:!0,snapGrid:[16,16],minZoom:.2,connectionLineType:"smoothstep",children:[T.jsx(GT,{}),T.jsx($T,{gap:16})]})})})]})};class gI extends B.Component{constructor(t){super(t),this.state={hasError:!1,errorMessage:""}}static getDerivedStateFromError(t){return{hasError:!0,errorMessage:t.toString()}}componentDidCatch(t,n){console.error("ErrorBoundary caught an error:",t,n)}render(){return this.state.hasError?T.jsxs("div",{style:{padding:"20px",color:"red",backgroundColor:"#ffe6e6"},children:[T.jsx("h2",{children:"Something went wrong."}),T.jsx("p",{children:this.state.errorMessage})]}):this.props.children}}B.createContext([null,e=>{}]);B.createContext(null);const mI=({nodes:e,edges:t})=>{const[n,r]=B.useState();return T.jsx(T.Fragment,{children:T.jsx(gI,{children:T.jsx(fS,{children:T.jsx(pI,{nodesIn:e,edgesIn:t})})})})};var $l={},cw;function yI(){if(cw)return $l;cw=1,Object.defineProperty($l,"__esModule",{value:!0}),$l.parse=c,$l.serialize=f;const e=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,t=/^[\u0021-\u003A\u003C-\u007E]*$/,n=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,s=Object.prototype.toString,a=(()=>{const m=function(){};return m.prototype=Object.create(null),m})();function c(m,w){const C=new a,S=m.length;if(S<2)return C;const _=(w==null?void 0:w.decode)||g;let P=0;do{const O=m.indexOf("=",P);if(O===-1)break;const R=m.indexOf(";",P),N=R===-1?S:R;if(O>N){P=m.lastIndexOf(";",O-1)+1;continue}const J=u(m,P,O),ce=h(m,O,J),G=m.slice(J,ce);if(C[G]===void 0){let te=u(m,O+1,N),D=h(m,N,te);const M=_(m.slice(te,D));C[G]=M}P=N+1}while(PC;){const S=m.charCodeAt(--w);if(S!==32&&S!==9)return w+1}return C}function f(m,w,C){const S=(C==null?void 0:C.encode)||encodeURIComponent;if(!e.test(m))throw new TypeError(`argument name is invalid: ${m}`);const _=S(w);if(!t.test(_))throw new TypeError(`argument val is invalid: ${w}`);let P=m+"="+_;if(!C)return P;if(C.maxAge!==void 0){if(!Number.isInteger(C.maxAge))throw new TypeError(`option maxAge is invalid: ${C.maxAge}`);P+="; Max-Age="+C.maxAge}if(C.domain){if(!n.test(C.domain))throw new TypeError(`option domain is invalid: ${C.domain}`);P+="; Domain="+C.domain}if(C.path){if(!r.test(C.path))throw new TypeError(`option path is invalid: ${C.path}`);P+="; Path="+C.path}if(C.expires){if(!y(C.expires)||!Number.isFinite(C.expires.valueOf()))throw new TypeError(`option expires is invalid: ${C.expires}`);P+="; Expires="+C.expires.toUTCString()}if(C.httpOnly&&(P+="; HttpOnly"),C.secure&&(P+="; Secure"),C.partitioned&&(P+="; Partitioned"),C.priority)switch(typeof C.priority=="string"?C.priority.toLowerCase():void 0){case"low":P+="; Priority=Low";break;case"medium":P+="; Priority=Medium";break;case"high":P+="; Priority=High";break;default:throw new TypeError(`option priority is invalid: ${C.priority}`)}if(C.sameSite)switch(typeof C.sameSite=="string"?C.sameSite.toLowerCase():C.sameSite){case!0:case"strict":P+="; SameSite=Strict";break;case"lax":P+="; SameSite=Lax";break;case"none":P+="; SameSite=None";break;default:throw new TypeError(`option sameSite is invalid: ${C.sameSite}`)}return P}function g(m){if(m.indexOf("%")===-1)return m;try{return decodeURIComponent(m)}catch{return m}}function y(m){return s.call(m)==="[object Date]"}return $l}yI();/** + * react-router v7.1.5 + * + * Copyright (c) Remix Software Inc. + * + * This source code is licensed under the MIT license found in the + * LICENSE.md file in the root directory of this source tree. + * + * @license MIT + */var uw="popstate";function vI(e={}){function t(r,s){let{pathname:a,search:c,hash:u}=r.location;return ig("",{pathname:a,search:c,hash:u},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function n(r,s){return typeof s=="string"?s:pc(s)}return xI(t,n,null,e)}function Mt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function go(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function wI(){return Math.random().toString(36).substring(2,10)}function hw(e,t){return{usr:e.state,key:e.key,idx:t}}function ig(e,t,n=null,r){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Xa(t):t,state:n,key:t&&t.key||r||wI()}}function pc({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Xa(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function xI(e,t,n,r={}){let{window:s=document.defaultView,v5Compat:a=!1}=r,c=s.history,u="POP",h=null,f=g();f==null&&(f=0,c.replaceState({...c.state,idx:f},""));function g(){return(c.state||{idx:null}).idx}function y(){u="POP";let _=g(),P=_==null?null:_-f;f=_,h&&h({action:u,location:S.location,delta:P})}function m(_,P){u="PUSH";let O=ig(S.location,_,P);f=g()+1;let R=hw(O,f),N=S.createHref(O);try{c.pushState(R,"",N)}catch(J){if(J instanceof DOMException&&J.name==="DataCloneError")throw J;s.location.assign(N)}a&&h&&h({action:u,location:S.location,delta:1})}function w(_,P){u="REPLACE";let O=ig(S.location,_,P);f=g();let R=hw(O,f),N=S.createHref(O);c.replaceState(R,"",N),a&&h&&h({action:u,location:S.location,delta:0})}function C(_){let P=s.location.origin!=="null"?s.location.origin:s.location.href,O=typeof _=="string"?_:pc(_);return O=O.replace(/ $/,"%20"),Mt(P,`No window.location.(origin|href) available to create URL for href: ${O}`),new URL(O,P)}let S={get action(){return u},get location(){return e(s,c)},listen(_){if(h)throw new Error("A history only accepts one active listener");return s.addEventListener(uw,y),h=_,()=>{s.removeEventListener(uw,y),h=null}},createHref(_){return t(s,_)},createURL:C,encodeLocation(_){let P=C(_);return{pathname:P.pathname,search:P.search,hash:P.hash}},push:m,replace:w,go(_){return c.go(_)}};return S}function RC(e,t,n="/"){return SI(e,t,n,!1)}function SI(e,t,n,r){let s=typeof t=="string"?Xa(t):t,a=Ui(s.pathname||"/",n);if(a==null)return null;let c=TC(e);CI(c);let u=null;for(let h=0;u==null&&h{let h={relativePath:u===void 0?a.path||"":u,caseSensitive:a.caseSensitive===!0,childrenIndex:c,route:a};h.relativePath.startsWith("/")&&(Mt(h.relativePath.startsWith(r),`Absolute route path "${h.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(r.length));let f=Yo([r,h.relativePath]),g=n.concat(h);a.children&&a.children.length>0&&(Mt(a.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),TC(a.children,t,g,f)),!(a.path==null&&!a.index)&&t.push({path:f,score:TI(f,a.index),routesMeta:g})};return e.forEach((a,c)=>{var u;if(a.path===""||!((u=a.path)!=null&&u.includes("?")))s(a,c);else for(let h of kC(a.path))s(a,c,h)}),t}function kC(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,s=n.endsWith("?"),a=n.replace(/\?$/,"");if(r.length===0)return s?[a,""]:[a];let c=kC(r.join("/")),u=[];return u.push(...c.map(h=>h===""?a:[a,h].join("/"))),s&&u.push(...c),u.map(h=>e.startsWith("/")&&h===""?"/":h)}function CI(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:kI(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var bI=/^:[\w-]+$/,EI=3,PI=2,_I=1,AI=10,RI=-2,dw=e=>e==="*";function TI(e,t){let n=e.split("/"),r=n.length;return n.some(dw)&&(r+=RI),t&&(r+=PI),n.filter(s=>!dw(s)).reduce((s,a)=>s+(bI.test(a)?EI:a===""?_I:AI),r)}function kI(e,t){return e.length===t.length&&e.slice(0,-1).every((r,s)=>r===t[s])?e[e.length-1]-t[t.length-1]:0}function OI(e,t,n=!1){let{routesMeta:r}=e,s={},a="/",c=[];for(let u=0;u{if(g==="*"){let C=u[m]||"";c=a.slice(0,a.length-C.length).replace(/(.)\/+$/,"$1")}const w=u[m];return y&&!w?f[g]=void 0:f[g]=(w||"").replace(/%2F/g,"/"),f},{}),pathname:a,pathnameBase:c,pattern:e}}function NI(e,t=!1,n=!0){go(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],s="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(c,u,h)=>(r.push({paramName:u,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)"));return e.endsWith("*")?(r.push({paramName:"*"}),s+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":e!==""&&e!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),r]}function DI(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return go(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Ui(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}function MI(e,t="/"){let{pathname:n,search:r="",hash:s=""}=typeof e=="string"?Xa(e):e;return{pathname:n?n.startsWith("/")?n:II(n,t):t,search:jI(r),hash:BI(s)}}function II(e,t){let n=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function ip(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function FI(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function OC(e){let t=FI(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function NC(e,t,n,r=!1){let s;typeof e=="string"?s=Xa(e):(s={...e},Mt(!s.pathname||!s.pathname.includes("?"),ip("?","pathname","search",s)),Mt(!s.pathname||!s.pathname.includes("#"),ip("#","pathname","hash",s)),Mt(!s.search||!s.search.includes("#"),ip("#","search","hash",s)));let a=e===""||s.pathname==="",c=a?"/":s.pathname,u;if(c==null)u=n;else{let y=t.length-1;if(!r&&c.startsWith("..")){let m=c.split("/");for(;m[0]==="..";)m.shift(),y-=1;s.pathname=m.join("/")}u=y>=0?t[y]:"/"}let h=MI(s,u),f=c&&c!=="/"&&c.endsWith("/"),g=(a||c===".")&&n.endsWith("/");return!h.pathname.endsWith("/")&&(f||g)&&(h.pathname+="/"),h}var Yo=e=>e.join("/").replace(/\/\/+/g,"/"),LI=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),jI=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,BI=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function $I(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var DC=["POST","PUT","PATCH","DELETE"];new Set(DC);var VI=["GET",...DC];new Set(VI);var Qa=B.createContext(null);Qa.displayName="DataRouter";var ld=B.createContext(null);ld.displayName="DataRouterState";var MC=B.createContext({isTransitioning:!1});MC.displayName="ViewTransition";var zI=B.createContext(new Map);zI.displayName="Fetchers";var HI=B.createContext(null);HI.displayName="Await";var wo=B.createContext(null);wo.displayName="Navigation";var kc=B.createContext(null);kc.displayName="Location";var Yr=B.createContext({outlet:null,matches:[],isDataRoute:!1});Yr.displayName="Route";var rm=B.createContext(null);rm.displayName="RouteError";function UI(e,{relative:t}={}){Mt(Oc(),"useHref() may be used only in the context of a component.");let{basename:n,navigator:r}=B.useContext(wo),{hash:s,pathname:a,search:c}=Nc(e,{relative:t}),u=a;return n!=="/"&&(u=a==="/"?n:Yo([n,a])),r.createHref({pathname:u,search:c,hash:s})}function Oc(){return B.useContext(kc)!=null}function Gi(){return Mt(Oc(),"useLocation() may be used only in the context of a component."),B.useContext(kc).location}var IC="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function FC(e){B.useContext(wo).static||B.useLayoutEffect(e)}function om(){let{isDataRoute:e}=B.useContext(Yr);return e?s2():WI()}function WI(){Mt(Oc(),"useNavigate() may be used only in the context of a component.");let e=B.useContext(Qa),{basename:t,navigator:n}=B.useContext(wo),{matches:r}=B.useContext(Yr),{pathname:s}=Gi(),a=JSON.stringify(OC(r)),c=B.useRef(!1);return FC(()=>{c.current=!0}),B.useCallback((h,f={})=>{if(go(c.current,IC),!c.current)return;if(typeof h=="number"){n.go(h);return}let g=NC(h,JSON.parse(a),s,f.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:Yo([t,g.pathname])),(f.replace?n.replace:n.push)(g,f.state,f)},[t,n,a,s,e])}var qI=B.createContext(null);function GI(e){let t=B.useContext(Yr).outlet;return t&&B.createElement(qI.Provider,{value:e},t)}function KI(){let{matches:e}=B.useContext(Yr),t=e[e.length-1];return t?t.params:{}}function Nc(e,{relative:t}={}){let{matches:n}=B.useContext(Yr),{pathname:r}=Gi(),s=JSON.stringify(OC(n));return B.useMemo(()=>NC(e,JSON.parse(s),r,t==="path"),[e,s,r,t])}function YI(e,t){return LC(e,t)}function LC(e,t,n,r){var O;Mt(Oc(),"useRoutes() may be used only in the context of a component.");let{navigator:s,static:a}=B.useContext(wo),{matches:c}=B.useContext(Yr),u=c[c.length-1],h=u?u.params:{},f=u?u.pathname:"/",g=u?u.pathnameBase:"/",y=u&&u.route;{let R=y&&y.path||"";jC(f,!y||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${f}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + +Please change the parent to .`)}let m=Gi(),w;if(t){let R=typeof t=="string"?Xa(t):t;Mt(g==="/"||((O=R.pathname)==null?void 0:O.startsWith(g)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${g}" but pathname "${R.pathname}" was given in the \`location\` prop.`),w=R}else w=m;let C=w.pathname||"/",S=C;if(g!=="/"){let R=g.replace(/^\//,"").split("/");S="/"+C.replace(/^\//,"").split("/").slice(R.length).join("/")}let _=!a&&n&&n.matches&&n.matches.length>0?n.matches:RC(e,{pathname:S});go(y||_!=null,`No routes matched location "${w.pathname}${w.search}${w.hash}" `),go(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${w.pathname}${w.search}${w.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let P=e2(_&&_.map(R=>Object.assign({},R,{params:Object.assign({},h,R.params),pathname:Yo([g,s.encodeLocation?s.encodeLocation(R.pathname).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?g:Yo([g,s.encodeLocation?s.encodeLocation(R.pathnameBase).pathname:R.pathnameBase])})),c,n,r);return t&&P?B.createElement(kc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...w},navigationType:"POP"}},P):P}function XI(){let e=i2(),t=$I(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:r},a={padding:"2px 4px",backgroundColor:r},c=null;return console.error("Error handled by React Router default ErrorBoundary:",e),c=B.createElement(B.Fragment,null,B.createElement("p",null,"💿 Hey developer 👋"),B.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",B.createElement("code",{style:a},"ErrorBoundary")," or"," ",B.createElement("code",{style:a},"errorElement")," prop on your route.")),B.createElement(B.Fragment,null,B.createElement("h2",null,"Unexpected Application Error!"),B.createElement("h3",{style:{fontStyle:"italic"}},t),n?B.createElement("pre",{style:s},n):null,c)}var QI=B.createElement(XI,null),JI=class extends B.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?B.createElement(Yr.Provider,{value:this.props.routeContext},B.createElement(rm.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function ZI({routeContext:e,match:t,children:n}){let r=B.useContext(Qa);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),B.createElement(Yr.Provider,{value:e},n)}function e2(e,t=[],n=null,r=null){if(e==null){if(!n)return null;if(n.errors)e=n.matches;else if(t.length===0&&!n.initialized&&n.matches.length>0)e=n.matches;else return null}let s=e,a=n==null?void 0:n.errors;if(a!=null){let h=s.findIndex(f=>f.route.id&&(a==null?void 0:a[f.route.id])!==void 0);Mt(h>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(",")}`),s=s.slice(0,Math.min(s.length,h+1))}let c=!1,u=-1;if(n)for(let h=0;h=0?s=s.slice(0,u+1):s=[s[0]];break}}}return s.reduceRight((h,f,g)=>{let y,m=!1,w=null,C=null;n&&(y=a&&f.route.id?a[f.route.id]:void 0,w=f.route.errorElement||QI,c&&(u<0&&g===0?(jC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),m=!0,C=null):u===g&&(m=!0,C=f.route.hydrateFallbackElement||null)));let S=t.concat(s.slice(0,g+1)),_=()=>{let P;return y?P=w:m?P=C:f.route.Component?P=B.createElement(f.route.Component,null):f.route.element?P=f.route.element:P=h,B.createElement(ZI,{match:f,routeContext:{outlet:h,matches:S,isDataRoute:n!=null},children:P})};return n&&(f.route.ErrorBoundary||f.route.errorElement||g===0)?B.createElement(JI,{location:n.location,revalidation:n.revalidation,component:w,error:y,children:_(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):_()},null)}function im(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function t2(e){let t=B.useContext(Qa);return Mt(t,im(e)),t}function n2(e){let t=B.useContext(ld);return Mt(t,im(e)),t}function r2(e){let t=B.useContext(Yr);return Mt(t,im(e)),t}function sm(e){let t=r2(e),n=t.matches[t.matches.length-1];return Mt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function o2(){return sm("useRouteId")}function i2(){var r;let e=B.useContext(rm),t=n2("useRouteError"),n=sm("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function s2(){let{router:e}=t2("useNavigate"),t=sm("useNavigate"),n=B.useRef(!1);return FC(()=>{n.current=!0}),B.useCallback(async(s,a={})=>{go(n.current,IC),n.current&&(typeof s=="number"?e.navigate(s):await e.navigate(s,{fromRouteId:t,...a}))},[e,t])}var fw={};function jC(e,t,n){!t&&!fw[e]&&(fw[e]=!0,go(!1,n))}B.memo(a2);function a2({routes:e,future:t,state:n}){return LC(e,void 0,n,t)}function BC(e){return GI(e.context)}function Na(e){Mt(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function l2({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:s,static:a=!1}){Mt(!Oc(),"You cannot render a inside another . You should never have more than one in your app.");let c=e.replace(/^\/*/,"/"),u=B.useMemo(()=>({basename:c,navigator:s,static:a,future:{}}),[c,s,a]);typeof n=="string"&&(n=Xa(n));let{pathname:h="/",search:f="",hash:g="",state:y=null,key:m="default"}=n,w=B.useMemo(()=>{let C=Ui(h,c);return C==null?null:{location:{pathname:C,search:f,hash:g,state:y,key:m},navigationType:r}},[c,h,f,g,y,m,r]);return go(w!=null,` is not able to match the URL "${h}${f}${g}" because it does not start with the basename, so the won't render anything.`),w==null?null:B.createElement(wo.Provider,{value:u},B.createElement(kc.Provider,{children:t,value:w}))}function c2({children:e,location:t}){return YI(sg(e),t)}function sg(e,t=[]){let n=[];return B.Children.forEach(e,(r,s)=>{if(!B.isValidElement(r))return;let a=[...t,s];if(r.type===B.Fragment){n.push.apply(n,sg(r.props.children,a));return}Mt(r.type===Na,`[${typeof r.type=="string"?r.type:r.type.name}] is not a component. All component children of must be a or `),Mt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let c={id:r.props.id||a.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(c.children=sg(r.props.children,a)),n.push(c)}),n}var ph="get",gh="application/x-www-form-urlencoded";function cd(e){return e!=null&&typeof e.tagName=="string"}function u2(e){return cd(e)&&e.tagName.toLowerCase()==="button"}function h2(e){return cd(e)&&e.tagName.toLowerCase()==="form"}function d2(e){return cd(e)&&e.tagName.toLowerCase()==="input"}function f2(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function p2(e,t){return e.button===0&&(!t||t==="_self")&&!f2(e)}var eh=null;function g2(){if(eh===null)try{new FormData(document.createElement("form"),0),eh=!1}catch{eh=!0}return eh}var m2=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function sp(e){return e!=null&&!m2.has(e)?(go(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${gh}"`),null):e}function y2(e,t){let n,r,s,a,c;if(h2(e)){let u=e.getAttribute("action");r=u?Ui(u,t):null,n=e.getAttribute("method")||ph,s=sp(e.getAttribute("enctype"))||gh,a=new FormData(e)}else if(u2(e)||d2(e)&&(e.type==="submit"||e.type==="image")){let u=e.form;if(u==null)throw new Error('Cannot submit a