@theclearsky/react-blender-nodes 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- (function(ee,O){typeof exports=="object"&&typeof module<"u"?O(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],O):(ee=typeof globalThis<"u"?globalThis:ee||self,O(ee["react-blender-nodes"]={},ee.React,ee.ReactDOM))})(this,function(ee,O,Tu){"use strict";function Di(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const U=Di(O),Mu=Di(Tu);function Au(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Pn={exports:{}},Yt={};/**
1
+ (function(pe,z){typeof exports=="object"&&typeof module<"u"?z(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],z):(pe=typeof globalThis<"u"?globalThis:pe||self,z(pe["react-blender-nodes"]={},pe.React,pe.ReactDOM))})(this,function(pe,z,Hd){"use strict";function zd(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const o=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,o.get?o:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const L=zd(z),cs=zd(Hd);var us=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vd(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fs={exports:{}},Ho={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Ri;function Pu(){if(Ri)return Yt;Ri=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(o,r,i){var s=null;if(i!==void 0&&(s=""+i),r.key!==void 0&&(s=""+r.key),"key"in r){i={};for(var a in r)a!=="key"&&(i[a]=r[a])}else i=r;return r=i.ref,{$$typeof:e,type:o,key:s,ref:r!==void 0?r:null,props:i}}return Yt.Fragment=t,Yt.jsx=n,Yt.jsxs=n,Yt}var Xt={};/**
9
+ */var Wd;function Ew(){if(Wd)return Ho;Wd=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(o,s,a){var l=null;if(a!==void 0&&(l=""+a),s.key!==void 0&&(l=""+s.key),"key"in s){a={};for(var c in s)c!=="key"&&(a[c]=s[c])}else a=s;return s=a.ref,{$$typeof:e,type:o,key:l,ref:s!==void 0?s:null,props:a}}return Ho.Fragment=t,Ho.jsx=n,Ho.jsxs=n,Ho}var zo={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,12 +14,12 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Li;function Iu(){return Li||(Li=1,process.env.NODE_ENV!=="production"&&function(){function e(_){if(_==null)return null;if(typeof _=="function")return _.$$typeof===H?null:_.displayName||_.name||null;if(typeof _=="string")return _;switch(_){case g:return"Fragment";case b:return"Profiler";case x:return"StrictMode";case k:return"Suspense";case N:return"SuspenseList";case L:return"Activity"}if(typeof _=="object")switch(typeof _.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),_.$$typeof){case p:return"Portal";case m:return(_.displayName||"Context")+".Provider";case v:return(_._context.displayName||"Context")+".Consumer";case w:var D=_.render;return _=_.displayName,_||(_=D.displayName||D.name||"",_=_!==""?"ForwardRef("+_+")":"ForwardRef"),_;case P:return D=_.displayName||null,D!==null?D:e(_.type)||"Memo";case M:D=_._payload,_=_._init;try{return e(_(D))}catch{}}return null}function t(_){return""+_}function n(_){try{t(_);var D=!1}catch{D=!0}if(D){D=console;var z=D.error,F=typeof Symbol=="function"&&Symbol.toStringTag&&_[Symbol.toStringTag]||_.constructor.name||"Object";return z.call(D,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",F),t(_)}}function o(_){if(_===g)return"<>";if(typeof _=="object"&&_!==null&&_.$$typeof===M)return"<...>";try{var D=e(_);return D?"<"+D+">":"<...>"}catch{return"<...>"}}function r(){var _=j.A;return _===null?null:_.getOwner()}function i(){return Error("react-stack-top-frame")}function s(_){if(R.call(_,"key")){var D=Object.getOwnPropertyDescriptor(_,"key").get;if(D&&D.isReactWarning)return!1}return _.key!==void 0}function a(_,D){function z(){A||(A=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",D))}z.isReactWarning=!0,Object.defineProperty(_,"key",{get:z,configurable:!0})}function c(){var _=e(this.type);return T[_]||(T[_]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),_=this.props.ref,_!==void 0?_:null}function l(_,D,z,F,B,Y,K,W){return z=Y.ref,_={$$typeof:f,type:_,key:D,props:Y,_owner:B},(z!==void 0?z:null)!==null?Object.defineProperty(_,"ref",{enumerable:!1,get:c}):Object.defineProperty(_,"ref",{enumerable:!1,value:null}),_._store={},Object.defineProperty(_._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(_,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(_,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:K}),Object.defineProperty(_,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:W}),Object.freeze&&(Object.freeze(_.props),Object.freeze(_)),_}function u(_,D,z,F,B,Y,K,W){var V=D.children;if(V!==void 0)if(F)if($(V)){for(F=0;F<V.length;F++)h(V[F]);Object.freeze&&Object.freeze(V)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else h(V);if(R.call(D,"key")){V=e(_);var X=Object.keys(D).filter(function(te){return te!=="key"});F=0<X.length?"{key: someKey, "+X.join(": ..., ")+": ...}":"{key: someKey}",I[V+F]||(X=0<X.length?"{"+X.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
17
+ */var jd;function Cw(){return jd||(jd=1,process.env.NODE_ENV!=="production"&&function(){function e($){if($==null)return null;if(typeof $=="function")return $.$$typeof===K?null:$.displayName||$.name||null;if(typeof $=="string")return $;switch($){case v:return"Fragment";case _:return"Profiler";case b:return"StrictMode";case O:return"Suspense";case k:return"SuspenseList";case V:return"Activity"}if(typeof $=="object")switch(typeof $.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),$.$$typeof){case x:return"Portal";case w:return($.displayName||"Context")+".Provider";case N:return($._context.displayName||"Context")+".Consumer";case E:var G=$.render;return $=$.displayName,$||($=G.displayName||G.name||"",$=$!==""?"ForwardRef("+$+")":"ForwardRef"),$;case M:return G=$.displayName||null,G!==null?G:e($.type)||"Memo";case D:G=$._payload,$=$._init;try{return e($(G))}catch{}}return null}function t($){return""+$}function n($){try{t($);var G=!1}catch{G=!0}if(G){G=console;var J=G.error,re=typeof Symbol=="function"&&Symbol.toStringTag&&$[Symbol.toStringTag]||$.constructor.name||"Object";return J.call(G,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",re),t($)}}function o($){if($===v)return"<>";if(typeof $=="object"&&$!==null&&$.$$typeof===D)return"<...>";try{var G=e($);return G?"<"+G+">":"<...>"}catch{return"<...>"}}function s(){var $=Z.A;return $===null?null:$.getOwner()}function a(){return Error("react-stack-top-frame")}function l($){if(U.call($,"key")){var G=Object.getOwnPropertyDescriptor($,"key").get;if(G&&G.isReactWarning)return!1}return $.key!==void 0}function c($,G){function J(){H||(H=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",G))}J.isReactWarning=!0,Object.defineProperty($,"key",{get:J,configurable:!0})}function f(){var $=e(this.type);return B[$]||(B[$]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),$=this.props.ref,$!==void 0?$:null}function d($,G,J,re,se,ce,ge,te){return J=ce.ref,$={$$typeof:m,type:$,key:G,props:ce,_owner:se},(J!==void 0?J:null)!==null?Object.defineProperty($,"ref",{enumerable:!1,get:f}):Object.defineProperty($,"ref",{enumerable:!1,value:null}),$._store={},Object.defineProperty($._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty($,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty($,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ge}),Object.defineProperty($,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:te}),Object.freeze&&(Object.freeze($.props),Object.freeze($)),$}function h($,G,J,re,se,ce,ge,te){var Q=G.children;if(Q!==void 0)if(re)if(q(Q)){for(re=0;re<Q.length;re++)g(Q[re]);Object.freeze&&Object.freeze(Q)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(Q);if(U.call(G,"key")){Q=e($);var ae=Object.keys(G).filter(function(de){return de!=="key"});re=0<ae.length?"{key: someKey, "+ae.join(": ..., ")+": ...}":"{key: someKey}",W[Q+re]||(ae=0<ae.length?"{"+ae.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
18
18
  let props = %s;
19
19
  <%s {...props} />
20
20
  React keys must be passed directly to JSX without using spread:
21
21
  let props = %s;
22
- <%s key={someKey} {...props} />`,F,V,X,V),I[V+F]=!0)}if(V=null,z!==void 0&&(n(z),V=""+z),s(D)&&(n(D.key),V=""+D.key),"key"in D){z={};for(var J in D)J!=="key"&&(z[J]=D[J])}else z=D;return V&&a(z,typeof _=="function"?_.displayName||_.name||"Unknown":_),l(_,V,Y,B,r(),z,K,W)}function h(_){typeof _=="object"&&_!==null&&_.$$typeof===f&&_._store&&(_._store.validated=1)}var d=O,f=Symbol.for("react.transitional.element"),p=Symbol.for("react.portal"),g=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),v=Symbol.for("react.consumer"),m=Symbol.for("react.context"),w=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),M=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),H=Symbol.for("react.client.reference"),j=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=Object.prototype.hasOwnProperty,$=Array.isArray,y=console.createTask?console.createTask:function(){return null};d={react_stack_bottom_frame:function(_){return _()}};var A,T={},S=d.react_stack_bottom_frame.bind(d,i)(),E=y(o(i)),I={};Xt.Fragment=g,Xt.jsx=function(_,D,z,F,B){var Y=1e4>j.recentlyCreatedOwnerStacks++;return u(_,D,z,!1,F,B,Y?Error("react-stack-top-frame"):S,Y?y(o(_)):E)},Xt.jsxs=function(_,D,z,F,B){var Y=1e4>j.recentlyCreatedOwnerStacks++;return u(_,D,z,!0,F,B,Y?Error("react-stack-top-frame"):S,Y?y(o(_)):E)}}()),Xt}var $i;function Ou(){return $i||($i=1,process.env.NODE_ENV==="production"?Pn.exports=Pu():Pn.exports=Iu()),Pn.exports}var C=Ou();function zi(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Du(...e){return t=>{let n=!1;const o=e.map(r=>{const i=zi(r,t);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let r=0;r<o.length;r++){const i=o[r];typeof i=="function"?i():zi(e[r],null)}}}}function Ru(e){const t=$u(e),n=U.forwardRef((o,r)=>{const{children:i,...s}=o,a=U.Children.toArray(i),c=a.find(Hu);if(c){const l=c.props.children,u=a.map(h=>h===c?U.Children.count(l)>1?U.Children.only(null):U.isValidElement(l)?l.props.children:null:h);return C.jsx(t,{...s,ref:r,children:U.isValidElement(l)?U.cloneElement(l,void 0,u):null})}return C.jsx(t,{...s,ref:r,children:i})});return n.displayName=`${e}.Slot`,n}var Lu=Ru("Slot");function $u(e){const t=U.forwardRef((n,o)=>{const{children:r,...i}=n;if(U.isValidElement(r)){const s=Vu(r),a=ju(i,r.props);return r.type!==U.Fragment&&(a.ref=o?Du(o,s):s),U.cloneElement(r,a)}return U.Children.count(r)>1?U.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var zu=Symbol("radix.slottable");function Hu(e){return U.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===zu}function ju(e,t){const n={...t};for(const o in t){const r=e[o],i=t[o];/^on[A-Z]/.test(o)?r&&i?n[o]=(...a)=>{const c=i(...a);return r(...a),c}:r&&(n[o]=r):o==="style"?n[o]={...r,...i}:o==="className"&&(n[o]=[r,i].filter(Boolean).join(" "))}return{...e,...n}}function Vu(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Hi(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var r=e.length;for(t=0;t<r;t++)e[t]&&(n=Hi(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function ji(){for(var e,t,n=0,o="",r=arguments.length;n<r;n++)(e=arguments[n])&&(t=Hi(e))&&(o&&(o+=" "),o+=t);return o}const Vi=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Fi=ji,Fu=(e,t)=>n=>{var o;if(t?.variants==null)return Fi(e,n?.class,n?.className);const{variants:r,defaultVariants:i}=t,s=Object.keys(r).map(l=>{const u=n?.[l],h=i?.[l];if(u===null)return null;const d=Vi(u)||Vi(h);return r[l][d]}),a=n&&Object.entries(n).reduce((l,u)=>{let[h,d]=u;return d===void 0||(l[h]=d),l},{}),c=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((l,u)=>{let{class:h,className:d,...f}=u;return Object.entries(f).every(p=>{let[g,x]=p;return Array.isArray(x)?x.includes({...i,...a}[g]):{...i,...a}[g]===x})?[...l,h,d]:l},[]);return Fi(e,s,c,n?.class,n?.className)},Jo="-",Bu=e=>{const t=Yu(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:s=>{const a=s.split(Jo);return a[0]===""&&a.length!==1&&a.shift(),Bi(a,t)||Wu(s)},getConflictingClassGroupIds:(s,a)=>{const c=n[s]||[];return a&&o[s]?[...c,...o[s]]:c}}},Bi=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),r=o?Bi(e.slice(1),o):void 0;if(r)return r;if(t.validators.length===0)return;const i=e.join(Jo);return t.validators.find(({validator:s})=>s(i))?.classGroupId},Wi=/^\[(.+)\]$/,Wu=e=>{if(Wi.test(e)){const t=Wi.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Yu=e=>{const{theme:t,classGroups:n}=e,o={nextPart:new Map,validators:[]};for(const r in n)er(n[r],o,r,t);return o},er=(e,t,n,o)=>{e.forEach(r=>{if(typeof r=="string"){const i=r===""?t:Yi(t,r);i.classGroupId=n;return}if(typeof r=="function"){if(Xu(r)){er(r(o),t,n,o);return}t.validators.push({validator:r,classGroupId:n});return}Object.entries(r).forEach(([i,s])=>{er(s,Yi(t,i),n,o)})})},Yi=(e,t)=>{let n=e;return t.split(Jo).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},Xu=e=>e.isThemeGetter,Uu=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const r=(i,s)=>{n.set(i,s),t++,t>e&&(t=0,o=n,n=new Map)};return{get(i){let s=n.get(i);if(s!==void 0)return s;if((s=o.get(i))!==void 0)return r(i,s),s},set(i,s){n.has(i)?n.set(i,s):r(i,s)}}},tr="!",nr=":",Gu=nr.length,qu=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=r=>{const i=[];let s=0,a=0,c=0,l;for(let p=0;p<r.length;p++){let g=r[p];if(s===0&&a===0){if(g===nr){i.push(r.slice(c,p)),c=p+Gu;continue}if(g==="/"){l=p;continue}}g==="["?s++:g==="]"?s--:g==="("?a++:g===")"&&a--}const u=i.length===0?r:r.substring(c),h=Zu(u),d=h!==u,f=l&&l>c?l-c:void 0;return{modifiers:i,hasImportantModifier:d,baseClassName:h,maybePostfixModifierPosition:f}};if(t){const r=t+nr,i=o;o=s=>s.startsWith(r)?i(s.substring(r.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:s,maybePostfixModifierPosition:void 0}}if(n){const r=o;o=i=>n({className:i,parseClassName:r})}return o},Zu=e=>e.endsWith(tr)?e.substring(0,e.length-1):e.startsWith(tr)?e.substring(1):e,Ku=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const r=[];let i=[];return o.forEach(s=>{s[0]==="["||t[s]?(r.push(...i.sort(),s),i=[]):i.push(s)}),r.push(...i.sort()),r}},Qu=e=>({cache:Uu(e.cacheSize),parseClassName:qu(e),sortModifiers:Ku(e),...Bu(e)}),Ju=/\s+/,ed=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:r,sortModifiers:i}=t,s=[],a=e.trim().split(Ju);let c="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{isExternal:h,modifiers:d,hasImportantModifier:f,baseClassName:p,maybePostfixModifierPosition:g}=n(u);if(h){c=u+(c.length>0?" "+c:c);continue}let x=!!g,b=o(x?p.substring(0,g):p);if(!b){if(!x){c=u+(c.length>0?" "+c:c);continue}if(b=o(p),!b){c=u+(c.length>0?" "+c:c);continue}x=!1}const v=i(d).join(":"),m=f?v+tr:v,w=m+b;if(s.includes(w))continue;s.push(w);const k=r(b,x);for(let N=0;N<k.length;++N){const P=k[N];s.push(m+P)}c=u+(c.length>0?" "+c:c)}return c};function td(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=Xi(t))&&(o&&(o+=" "),o+=n);return o}const Xi=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=Xi(e[o]))&&(n&&(n+=" "),n+=t);return n};function nd(e,...t){let n,o,r,i=s;function s(c){const l=t.reduce((u,h)=>h(u),e());return n=Qu(l),o=n.cache.get,r=n.cache.set,i=a,a(c)}function a(c){const l=o(c);if(l)return l;const u=ed(c,n);return r(c,u),u}return function(){return i(td.apply(null,arguments))}}const he=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},Ui=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,Gi=/^\((?:(\w[\w-]*):)?(.+)\)$/i,od=/^\d+\/\d+$/,rd=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,id=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,sd=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,ad=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,cd=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,xt=e=>od.test(e),re=e=>!!e&&!Number.isNaN(Number(e)),qe=e=>!!e&&Number.isInteger(Number(e)),or=e=>e.endsWith("%")&&re(e.slice(0,-1)),Fe=e=>rd.test(e),ld=()=>!0,ud=e=>id.test(e)&&!sd.test(e),qi=()=>!1,dd=e=>ad.test(e),fd=e=>cd.test(e),hd=e=>!G(e)&&!q(e),pd=e=>wt(e,es,qi),G=e=>Ui.test(e),nt=e=>wt(e,ts,ud),rr=e=>wt(e,wd,re),Zi=e=>wt(e,Qi,qi),gd=e=>wt(e,Ji,fd),In=e=>wt(e,ns,dd),q=e=>Gi.test(e),Ut=e=>bt(e,ts),md=e=>bt(e,bd),Ki=e=>bt(e,Qi),yd=e=>bt(e,es),xd=e=>bt(e,Ji),On=e=>bt(e,ns,!0),wt=(e,t,n)=>{const o=Ui.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},bt=(e,t,n=!1)=>{const o=Gi.exec(e);return o?o[1]?t(o[1]):n:!1},Qi=e=>e==="position"||e==="percentage",Ji=e=>e==="image"||e==="url",es=e=>e==="length"||e==="size"||e==="bg-size",ts=e=>e==="length",wd=e=>e==="number",bd=e=>e==="family-name",ns=e=>e==="shadow",vd=nd(()=>{const e=he("color"),t=he("font"),n=he("text"),o=he("font-weight"),r=he("tracking"),i=he("leading"),s=he("breakpoint"),a=he("container"),c=he("spacing"),l=he("radius"),u=he("shadow"),h=he("inset-shadow"),d=he("text-shadow"),f=he("drop-shadow"),p=he("blur"),g=he("perspective"),x=he("aspect"),b=he("ease"),v=he("animate"),m=()=>["auto","avoid","all","avoid-page","page","left","right","column"],w=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],k=()=>[...w(),q,G],N=()=>["auto","hidden","clip","visible","scroll"],P=()=>["auto","contain","none"],M=()=>[q,G,c],L=()=>[xt,"full","auto",...M()],H=()=>[qe,"none","subgrid",q,G],j=()=>["auto",{span:["full",qe,q,G]},qe,q,G],R=()=>[qe,"auto",q,G],$=()=>["auto","min","max","fr",q,G],y=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],A=()=>["start","end","center","stretch","center-safe","end-safe"],T=()=>["auto",...M()],S=()=>[xt,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...M()],E=()=>[e,q,G],I=()=>[...w(),Ki,Zi,{position:[q,G]}],_=()=>["no-repeat",{repeat:["","x","y","space","round"]}],D=()=>["auto","cover","contain",yd,pd,{size:[q,G]}],z=()=>[or,Ut,nt],F=()=>["","none","full",l,q,G],B=()=>["",re,Ut,nt],Y=()=>["solid","dashed","dotted","double"],K=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],W=()=>[re,or,Ki,Zi],V=()=>["","none",p,q,G],X=()=>["none",re,q,G],J=()=>["none",re,q,G],te=()=>[re,q,G],Z=()=>[xt,"full",...M()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Fe],breakpoint:[Fe],color:[ld],container:[Fe],"drop-shadow":[Fe],ease:["in","out","in-out"],font:[hd],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Fe],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Fe],shadow:[Fe],spacing:["px",re],text:[Fe],"text-shadow":[Fe],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",xt,G,q,x]}],container:["container"],columns:[{columns:[re,G,q,a]}],"break-after":[{"break-after":m()}],"break-before":[{"break-before":m()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:k()}],overflow:[{overflow:N()}],"overflow-x":[{"overflow-x":N()}],"overflow-y":[{"overflow-y":N()}],overscroll:[{overscroll:P()}],"overscroll-x":[{"overscroll-x":P()}],"overscroll-y":[{"overscroll-y":P()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:L()}],"inset-x":[{"inset-x":L()}],"inset-y":[{"inset-y":L()}],start:[{start:L()}],end:[{end:L()}],top:[{top:L()}],right:[{right:L()}],bottom:[{bottom:L()}],left:[{left:L()}],visibility:["visible","invisible","collapse"],z:[{z:[qe,"auto",q,G]}],basis:[{basis:[xt,"full","auto",a,...M()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[re,xt,"auto","initial","none",G]}],grow:[{grow:["",re,q,G]}],shrink:[{shrink:["",re,q,G]}],order:[{order:[qe,"first","last","none",q,G]}],"grid-cols":[{"grid-cols":H()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":R()}],"col-end":[{"col-end":R()}],"grid-rows":[{"grid-rows":H()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":R()}],"row-end":[{"row-end":R()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":$()}],"auto-rows":[{"auto-rows":$()}],gap:[{gap:M()}],"gap-x":[{"gap-x":M()}],"gap-y":[{"gap-y":M()}],"justify-content":[{justify:[...y(),"normal"]}],"justify-items":[{"justify-items":[...A(),"normal"]}],"justify-self":[{"justify-self":["auto",...A()]}],"align-content":[{content:["normal",...y()]}],"align-items":[{items:[...A(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...A(),{baseline:["","last"]}]}],"place-content":[{"place-content":y()}],"place-items":[{"place-items":[...A(),"baseline"]}],"place-self":[{"place-self":["auto",...A()]}],p:[{p:M()}],px:[{px:M()}],py:[{py:M()}],ps:[{ps:M()}],pe:[{pe:M()}],pt:[{pt:M()}],pr:[{pr:M()}],pb:[{pb:M()}],pl:[{pl:M()}],m:[{m:T()}],mx:[{mx:T()}],my:[{my:T()}],ms:[{ms:T()}],me:[{me:T()}],mt:[{mt:T()}],mr:[{mr:T()}],mb:[{mb:T()}],ml:[{ml:T()}],"space-x":[{"space-x":M()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":M()}],"space-y-reverse":["space-y-reverse"],size:[{size:S()}],w:[{w:[a,"screen",...S()]}],"min-w":[{"min-w":[a,"screen","none",...S()]}],"max-w":[{"max-w":[a,"screen","none","prose",{screen:[s]},...S()]}],h:[{h:["screen","lh",...S()]}],"min-h":[{"min-h":["screen","lh","none",...S()]}],"max-h":[{"max-h":["screen","lh",...S()]}],"font-size":[{text:["base",n,Ut,nt]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,q,rr]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",or,G]}],"font-family":[{font:[md,G,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[r,q,G]}],"line-clamp":[{"line-clamp":[re,"none",q,rr]}],leading:[{leading:[i,...M()]}],"list-image":[{"list-image":["none",q,G]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",q,G]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:E()}],"text-color":[{text:E()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...Y(),"wavy"]}],"text-decoration-thickness":[{decoration:[re,"from-font","auto",q,nt]}],"text-decoration-color":[{decoration:E()}],"underline-offset":[{"underline-offset":[re,"auto",q,G]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:M()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",q,G]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",q,G]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:I()}],"bg-repeat":[{bg:_()}],"bg-size":[{bg:D()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},qe,q,G],radial:["",q,G],conic:[qe,q,G]},xd,gd]}],"bg-color":[{bg:E()}],"gradient-from-pos":[{from:z()}],"gradient-via-pos":[{via:z()}],"gradient-to-pos":[{to:z()}],"gradient-from":[{from:E()}],"gradient-via":[{via:E()}],"gradient-to":[{to:E()}],rounded:[{rounded:F()}],"rounded-s":[{"rounded-s":F()}],"rounded-e":[{"rounded-e":F()}],"rounded-t":[{"rounded-t":F()}],"rounded-r":[{"rounded-r":F()}],"rounded-b":[{"rounded-b":F()}],"rounded-l":[{"rounded-l":F()}],"rounded-ss":[{"rounded-ss":F()}],"rounded-se":[{"rounded-se":F()}],"rounded-ee":[{"rounded-ee":F()}],"rounded-es":[{"rounded-es":F()}],"rounded-tl":[{"rounded-tl":F()}],"rounded-tr":[{"rounded-tr":F()}],"rounded-br":[{"rounded-br":F()}],"rounded-bl":[{"rounded-bl":F()}],"border-w":[{border:B()}],"border-w-x":[{"border-x":B()}],"border-w-y":[{"border-y":B()}],"border-w-s":[{"border-s":B()}],"border-w-e":[{"border-e":B()}],"border-w-t":[{"border-t":B()}],"border-w-r":[{"border-r":B()}],"border-w-b":[{"border-b":B()}],"border-w-l":[{"border-l":B()}],"divide-x":[{"divide-x":B()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":B()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...Y(),"hidden","none"]}],"divide-style":[{divide:[...Y(),"hidden","none"]}],"border-color":[{border:E()}],"border-color-x":[{"border-x":E()}],"border-color-y":[{"border-y":E()}],"border-color-s":[{"border-s":E()}],"border-color-e":[{"border-e":E()}],"border-color-t":[{"border-t":E()}],"border-color-r":[{"border-r":E()}],"border-color-b":[{"border-b":E()}],"border-color-l":[{"border-l":E()}],"divide-color":[{divide:E()}],"outline-style":[{outline:[...Y(),"none","hidden"]}],"outline-offset":[{"outline-offset":[re,q,G]}],"outline-w":[{outline:["",re,Ut,nt]}],"outline-color":[{outline:E()}],shadow:[{shadow:["","none",u,On,In]}],"shadow-color":[{shadow:E()}],"inset-shadow":[{"inset-shadow":["none",h,On,In]}],"inset-shadow-color":[{"inset-shadow":E()}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:E()}],"ring-offset-w":[{"ring-offset":[re,nt]}],"ring-offset-color":[{"ring-offset":E()}],"inset-ring-w":[{"inset-ring":B()}],"inset-ring-color":[{"inset-ring":E()}],"text-shadow":[{"text-shadow":["none",d,On,In]}],"text-shadow-color":[{"text-shadow":E()}],opacity:[{opacity:[re,q,G]}],"mix-blend":[{"mix-blend":[...K(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":K()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[re]}],"mask-image-linear-from-pos":[{"mask-linear-from":W()}],"mask-image-linear-to-pos":[{"mask-linear-to":W()}],"mask-image-linear-from-color":[{"mask-linear-from":E()}],"mask-image-linear-to-color":[{"mask-linear-to":E()}],"mask-image-t-from-pos":[{"mask-t-from":W()}],"mask-image-t-to-pos":[{"mask-t-to":W()}],"mask-image-t-from-color":[{"mask-t-from":E()}],"mask-image-t-to-color":[{"mask-t-to":E()}],"mask-image-r-from-pos":[{"mask-r-from":W()}],"mask-image-r-to-pos":[{"mask-r-to":W()}],"mask-image-r-from-color":[{"mask-r-from":E()}],"mask-image-r-to-color":[{"mask-r-to":E()}],"mask-image-b-from-pos":[{"mask-b-from":W()}],"mask-image-b-to-pos":[{"mask-b-to":W()}],"mask-image-b-from-color":[{"mask-b-from":E()}],"mask-image-b-to-color":[{"mask-b-to":E()}],"mask-image-l-from-pos":[{"mask-l-from":W()}],"mask-image-l-to-pos":[{"mask-l-to":W()}],"mask-image-l-from-color":[{"mask-l-from":E()}],"mask-image-l-to-color":[{"mask-l-to":E()}],"mask-image-x-from-pos":[{"mask-x-from":W()}],"mask-image-x-to-pos":[{"mask-x-to":W()}],"mask-image-x-from-color":[{"mask-x-from":E()}],"mask-image-x-to-color":[{"mask-x-to":E()}],"mask-image-y-from-pos":[{"mask-y-from":W()}],"mask-image-y-to-pos":[{"mask-y-to":W()}],"mask-image-y-from-color":[{"mask-y-from":E()}],"mask-image-y-to-color":[{"mask-y-to":E()}],"mask-image-radial":[{"mask-radial":[q,G]}],"mask-image-radial-from-pos":[{"mask-radial-from":W()}],"mask-image-radial-to-pos":[{"mask-radial-to":W()}],"mask-image-radial-from-color":[{"mask-radial-from":E()}],"mask-image-radial-to-color":[{"mask-radial-to":E()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":w()}],"mask-image-conic-pos":[{"mask-conic":[re]}],"mask-image-conic-from-pos":[{"mask-conic-from":W()}],"mask-image-conic-to-pos":[{"mask-conic-to":W()}],"mask-image-conic-from-color":[{"mask-conic-from":E()}],"mask-image-conic-to-color":[{"mask-conic-to":E()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:I()}],"mask-repeat":[{mask:_()}],"mask-size":[{mask:D()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",q,G]}],filter:[{filter:["","none",q,G]}],blur:[{blur:V()}],brightness:[{brightness:[re,q,G]}],contrast:[{contrast:[re,q,G]}],"drop-shadow":[{"drop-shadow":["","none",f,On,In]}],"drop-shadow-color":[{"drop-shadow":E()}],grayscale:[{grayscale:["",re,q,G]}],"hue-rotate":[{"hue-rotate":[re,q,G]}],invert:[{invert:["",re,q,G]}],saturate:[{saturate:[re,q,G]}],sepia:[{sepia:["",re,q,G]}],"backdrop-filter":[{"backdrop-filter":["","none",q,G]}],"backdrop-blur":[{"backdrop-blur":V()}],"backdrop-brightness":[{"backdrop-brightness":[re,q,G]}],"backdrop-contrast":[{"backdrop-contrast":[re,q,G]}],"backdrop-grayscale":[{"backdrop-grayscale":["",re,q,G]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[re,q,G]}],"backdrop-invert":[{"backdrop-invert":["",re,q,G]}],"backdrop-opacity":[{"backdrop-opacity":[re,q,G]}],"backdrop-saturate":[{"backdrop-saturate":[re,q,G]}],"backdrop-sepia":[{"backdrop-sepia":["",re,q,G]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":M()}],"border-spacing-x":[{"border-spacing-x":M()}],"border-spacing-y":[{"border-spacing-y":M()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",q,G]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[re,"initial",q,G]}],ease:[{ease:["linear","initial",b,q,G]}],delay:[{delay:[re,q,G]}],animate:[{animate:["none",v,q,G]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,q,G]}],"perspective-origin":[{"perspective-origin":k()}],rotate:[{rotate:X()}],"rotate-x":[{"rotate-x":X()}],"rotate-y":[{"rotate-y":X()}],"rotate-z":[{"rotate-z":X()}],scale:[{scale:J()}],"scale-x":[{"scale-x":J()}],"scale-y":[{"scale-y":J()}],"scale-z":[{"scale-z":J()}],"scale-3d":["scale-3d"],skew:[{skew:te()}],"skew-x":[{"skew-x":te()}],"skew-y":[{"skew-y":te()}],transform:[{transform:[q,G,"","none","gpu","cpu"]}],"transform-origin":[{origin:k()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:Z()}],"translate-x":[{"translate-x":Z()}],"translate-y":[{"translate-y":Z()}],"translate-z":[{"translate-z":Z()}],"translate-none":["translate-none"],accent:[{accent:E()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:E()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",q,G]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":M()}],"scroll-mx":[{"scroll-mx":M()}],"scroll-my":[{"scroll-my":M()}],"scroll-ms":[{"scroll-ms":M()}],"scroll-me":[{"scroll-me":M()}],"scroll-mt":[{"scroll-mt":M()}],"scroll-mr":[{"scroll-mr":M()}],"scroll-mb":[{"scroll-mb":M()}],"scroll-ml":[{"scroll-ml":M()}],"scroll-p":[{"scroll-p":M()}],"scroll-px":[{"scroll-px":M()}],"scroll-py":[{"scroll-py":M()}],"scroll-ps":[{"scroll-ps":M()}],"scroll-pe":[{"scroll-pe":M()}],"scroll-pt":[{"scroll-pt":M()}],"scroll-pr":[{"scroll-pr":M()}],"scroll-pb":[{"scroll-pb":M()}],"scroll-pl":[{"scroll-pl":M()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",q,G]}],fill:[{fill:["none",...E()]}],"stroke-w":[{stroke:[re,Ut,nt,rr]}],stroke:[{stroke:["none",...E()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function se(...e){return vd(ji(e))}const Ed=Fu("inline-flex items-center justify-center gap-2 py-2 px-4 rounded-md transition-all text-[27px] leading-[27px] font-main whitespace-nowrap text-primary-white disabled:cursor-not-allowed outline-none focus-visible:outline-none border",{variants:{color:{dark:"bg-secondary-black border-secondary-dark-gray",lightNonPriority:"bg-primary-gray border-transparent",lightPriority:"bg-primary-gray border-transparent",lightParentGroupBasedHover:"bg-primary-gray border-transparent"},applyHoverStyles:{true:"",false:""}},defaultVariants:{color:"dark",applyHoverStyles:!0},compoundVariants:[{color:"dark",applyHoverStyles:!0,className:"hover:bg-primary-dark-gray"},{color:"lightNonPriority",applyHoverStyles:!0,className:"hover:bg-secondary-light-gray-as-transparent-overlay-over-primary-gray"},{color:"lightPriority",applyHoverStyles:!0,className:"hover:bg-primary-light-gray-as-transparent-overlay-over-primary-gray"},{color:"lightParentGroupBasedHover",applyHoverStyles:!0,className:"hover:bg-primary-light-gray-as-transparent-overlay-over-primary-gray group-hover/lightParentGroupBasedHover:bg-secondary-light-gray-as-transparent-overlay-over-primary-gray"}]}),vt=O.forwardRef(({className:e,color:t,asChild:n=!1,applyHoverStyles:o,...r},i)=>{const s=n?Lu:"button";return C.jsx(s,{ref:i,"data-slot":"button",className:se(Ed({color:t,className:e,applyHoverStyles:o})),...r})});vt.displayName="Button";function ir(e,t,n,o=!1,r=!1){if(t>n){const i=t;t=n,n=i}return(o?e>=t:e>t)&&(r?e<=n:e<n)}function os(e,t,n=!1,o=!1){return ir(e.x,t.left,t.right,n)&&ir(e.y,t.top,t.bottom,o)}function rs(e){const t=e.startsWith("-"),n=e.replaceAll(/[^0-9\.]/g,""),o=n.indexOf(".");let r=0;if(o===-1)r=Number(n);else{const i=n.substring(0,o).replaceAll(/[^0-9]/g,""),s=n.substring(o+1).replaceAll(/[^0-9]/g,"");r=+(i+"."+s)}return t&&(r=-r),r}function sr(e,t){return e.toFixed(t).replace(/[0]+$/,"").replace(/\.$/,"")}const Oe=["string","number","complex","noEquivalent","inferFromConnection"],is={[Oe[0]]:Oe[0],[Oe[1]]:Oe[1],[Oe[2]]:Oe[2],[Oe[3]]:Oe[3],[Oe[4]]:Oe[4]};function _d(e){return!!is[e]}function Sd(e){return e}function Cd(e,t){return e in t}function Nd(e){return e}function kd(e){return e}function Td(e){return e}var ss=Symbol.for("immer-nothing"),as=Symbol.for("immer-draftable"),we=Symbol.for("immer-state"),Md=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function me(e,...t){if(process.env.NODE_ENV!=="production"){const n=Md[e],o=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${o}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Et=Object.getPrototypeOf;function _t(e){return!!e&&!!e[we]}function ot(e){return e?cs(e)||Array.isArray(e)||!!e[as]||!!e.constructor?.[as]||Gt(e)||Ln(e):!1}var Ad=Object.prototype.constructor.toString();function cs(e){if(!e||typeof e!="object")return!1;const t=Et(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===Ad}function Dn(e,t){Rn(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,o)=>t(o,n,e))}function Rn(e){const t=e[we];return t?t.type_:Array.isArray(e)?1:Gt(e)?2:Ln(e)?3:0}function ar(e,t){return Rn(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function ls(e,t,n){const o=Rn(e);o===2?e.set(t,n):o===3?e.add(n):e[t]=n}function Pd(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function Gt(e){return e instanceof Map}function Ln(e){return e instanceof Set}function rt(e){return e.copy_||e.base_}function cr(e,t){if(Gt(e))return new Map(e);if(Ln(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=cs(e);if(t===!0||t==="class_only"&&!n){const o=Object.getOwnPropertyDescriptors(e);delete o[we];let r=Reflect.ownKeys(o);for(let i=0;i<r.length;i++){const s=r[i],a=o[s];a.writable===!1&&(a.writable=!0,a.configurable=!0),(a.get||a.set)&&(o[s]={configurable:!0,writable:!0,enumerable:a.enumerable,value:e[s]})}return Object.create(Et(e),o)}else{const o=Et(e);if(o!==null&&n)return{...e};const r=Object.create(o);return Object.assign(r,e)}}function lr(e,t=!1){return zn(e)||_t(e)||!ot(e)||(Rn(e)>1&&Object.defineProperties(e,{set:{value:$n},add:{value:$n},clear:{value:$n},delete:{value:$n}}),Object.freeze(e),t&&Object.values(e).forEach(n=>lr(n,!0))),e}function $n(){me(2)}function zn(e){return Object.isFrozen(e)}var Id={};function it(e){const t=Id[e];return t||me(0,e),t}var qt;function us(){return qt}function Od(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function ds(e,t){t&&(it("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function ur(e){dr(e),e.drafts_.forEach(Dd),e.drafts_=null}function dr(e){e===qt&&(qt=e.parent_)}function fs(e){return qt=Od(qt,e)}function Dd(e){const t=e[we];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function hs(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[we].modified_&&(ur(t),me(4)),ot(e)&&(e=Hn(t,e),t.parent_||jn(t,e)),t.patches_&&it("Patches").generateReplacementPatches_(n[we].base_,e,t.patches_,t.inversePatches_)):e=Hn(t,n,[]),ur(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==ss?e:void 0}function Hn(e,t,n){if(zn(t))return t;const o=t[we];if(!o)return Dn(t,(r,i)=>ps(e,o,t,r,i,n)),t;if(o.scope_!==e)return t;if(!o.modified_)return jn(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const r=o.copy_;let i=r,s=!1;o.type_===3&&(i=new Set(r),r.clear(),s=!0),Dn(i,(a,c)=>ps(e,o,r,a,c,n,s)),jn(e,r,!1),n&&e.patches_&&it("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function ps(e,t,n,o,r,i,s){if(process.env.NODE_ENV!=="production"&&r===n&&me(5),_t(r)){const a=i&&t&&t.type_!==3&&!ar(t.assigned_,o)?i.concat(o):void 0,c=Hn(e,r,a);if(ls(n,o,c),_t(c))e.canAutoFreeze_=!1;else return}else s&&n.add(r);if(ot(r)&&!zn(r)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;Hn(e,r),(!t||!t.scope_.parent_)&&typeof o!="symbol"&&(Gt(n)?n.has(o):Object.prototype.propertyIsEnumerable.call(n,o))&&jn(e,r)}}function jn(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&lr(t,n)}function Rd(e,t){const n=Array.isArray(e),o={type_:n?1:0,scope_:t?t.scope_:us(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let r=o,i=fr;n&&(r=[o],i=Zt);const{revoke:s,proxy:a}=Proxy.revocable(r,i);return o.draft_=a,o.revoke_=s,a}var fr={get(e,t){if(t===we)return e;const n=rt(e);if(!ar(n,t))return Ld(e,n,t);const o=n[t];return e.finalized_||!ot(o)?o:o===hr(e.base_,t)?(gr(e),e.copy_[t]=mr(o,e)):o},has(e,t){return t in rt(e)},ownKeys(e){return Reflect.ownKeys(rt(e))},set(e,t,n){const o=gs(rt(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const r=hr(rt(e),t),i=r?.[we];if(i&&i.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(Pd(n,r)&&(n!==void 0||ar(e.base_,t)))return!0;gr(e),pr(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return hr(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,gr(e),pr(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=rt(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:o.enumerable,value:n[t]}},defineProperty(){me(11)},getPrototypeOf(e){return Et(e.base_)},setPrototypeOf(){me(12)}},Zt={};Dn(fr,(e,t)=>{Zt[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Zt.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&me(13),Zt.set.call(this,e,t,void 0)},Zt.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&me(14),fr.set.call(this,e[0],t,n,e[0])};function hr(e,t){const n=e[we];return(n?rt(n):e)[t]}function Ld(e,t,n){const o=gs(t,n);return o?"value"in o?o.value:o.get?.call(e.draft_):void 0}function gs(e,t){if(!(t in e))return;let n=Et(e);for(;n;){const o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=Et(n)}}function pr(e){e.modified_||(e.modified_=!0,e.parent_&&pr(e.parent_))}function gr(e){e.copy_||(e.copy_=cr(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var $d=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,o)=>{if(typeof t=="function"&&typeof n!="function"){const i=n;n=t;const s=this;return function(c=i,...l){return s.produce(c,u=>n.call(this,u,...l))}}typeof n!="function"&&me(6),o!==void 0&&typeof o!="function"&&me(7);let r;if(ot(t)){const i=fs(this),s=mr(t,void 0);let a=!0;try{r=n(s),a=!1}finally{a?ur(i):dr(i)}return ds(i,o),hs(r,i)}else if(!t||typeof t!="object"){if(r=n(t),r===void 0&&(r=t),r===ss&&(r=void 0),this.autoFreeze_&&lr(r,!0),o){const i=[],s=[];it("Patches").generateReplacementPatches_(t,r,i,s),o(i,s)}return r}else me(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(s,...a)=>this.produceWithPatches(s,c=>t(c,...a));let o,r;return[this.produce(t,n,(s,a)=>{o=s,r=a}),o,r]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){ot(e)||me(8),_t(e)&&(e=zd(e));const t=fs(this),n=mr(e,void 0);return n[we].isManual_=!0,dr(t),n}finishDraft(e,t){const n=e&&e[we];(!n||!n.isManual_)&&me(9);const{scope_:o}=n;return ds(o,t),hs(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const r=t[n];if(r.path.length===0&&r.op==="replace"){e=r.value;break}}n>-1&&(t=t.slice(n+1));const o=it("Patches").applyPatches_;return _t(e)?o(e,t):this.produce(e,r=>o(r,t))}};function mr(e,t){const n=Gt(e)?it("MapSet").proxyMap_(e,t):Ln(e)?it("MapSet").proxySet_(e,t):Rd(e,t);return(t?t.scope_:us()).drafts_.push(n),n}function zd(e){return _t(e)||me(10,e),ms(e)}function ms(e){if(!ot(e)||zn(e))return e;const t=e[we];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=cr(e,t.scope_.immer_.useStrictShallowCopy_)}else n=cr(e,!0);return Dn(n,(o,r)=>{ls(n,o,ms(r))}),t&&(t.finalized_=!1),n}var Hd=new $d,jd=Hd.produce;function St(e){const t=[];for(let o=0;o<Math.floor(e/8);o++)t.push(Math.random().toString(36).substring(2,10));return t.push(Math.random().toString(36).substring(2,e%8+2)),t.join("")}function fe(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)(o=fe(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Vd={value:()=>{}};function Vn(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new Fn(n)}function Fn(e){this._=e}function Fd(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",r=n.indexOf(".");if(r>=0&&(o=n.slice(r+1),n=n.slice(0,r)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}Fn.prototype=Vn.prototype={constructor:Fn,on:function(e,t){var n=this._,o=Fd(e+"",n),r,i=-1,s=o.length;if(arguments.length<2){for(;++i<s;)if((r=(e=o[i]).type)&&(r=Bd(n[r],e.name)))return r;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(r=(e=o[i]).type)n[r]=ys(n[r],e.name,t);else if(t==null)for(r in n)n[r]=ys(n[r],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new Fn(e)},call:function(e,t){if((r=arguments.length-2)>0)for(var n=new Array(r),o=0,r,i;o<r;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],o=0,r=i.length;o<r;++o)i[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],r=0,i=o.length;r<i;++r)o[r].value.apply(t,n)}};function Bd(e,t){for(var n=0,o=e.length,r;n<o;++n)if((r=e[n]).name===t)return r.value}function ys(e,t,n){for(var o=0,r=e.length;o<r;++o)if(e[o].name===t){e[o]=Vd,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var yr="http://www.w3.org/1999/xhtml";const xs={svg:"http://www.w3.org/2000/svg",xhtml:yr,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Bn(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),xs.hasOwnProperty(t)?{space:xs[t],local:e}:e}function Wd(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===yr&&t.documentElement.namespaceURI===yr?t.createElement(e):t.createElementNS(n,e)}}function Yd(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function ws(e){var t=Bn(e);return(t.local?Yd:Wd)(t)}function Xd(){}function xr(e){return e==null?Xd:function(){return this.querySelector(e)}}function Ud(e){typeof e!="function"&&(e=xr(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=new Array(s),c,l,u=0;u<s;++u)(c=i[u])&&(l=e.call(c,c.__data__,u,i))&&("__data__"in c&&(l.__data__=c.__data__),a[u]=l);return new be(o,this._parents)}function Gd(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function qd(){return[]}function bs(e){return e==null?qd:function(){return this.querySelectorAll(e)}}function Zd(e){return function(){return Gd(e.apply(this,arguments))}}function Kd(e){typeof e=="function"?e=Zd(e):e=bs(e);for(var t=this._groups,n=t.length,o=[],r=[],i=0;i<n;++i)for(var s=t[i],a=s.length,c,l=0;l<a;++l)(c=s[l])&&(o.push(e.call(c,c.__data__,l,s)),r.push(c));return new be(o,r)}function vs(e){return function(){return this.matches(e)}}function Es(e){return function(t){return t.matches(e)}}var Qd=Array.prototype.find;function Jd(e){return function(){return Qd.call(this.children,e)}}function ef(){return this.firstElementChild}function tf(e){return this.select(e==null?ef:Jd(typeof e=="function"?e:Es(e)))}var nf=Array.prototype.filter;function of(){return Array.from(this.children)}function rf(e){return function(){return nf.call(this.children,e)}}function sf(e){return this.selectAll(e==null?of:rf(typeof e=="function"?e:Es(e)))}function af(e){typeof e!="function"&&(e=vs(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],c,l=0;l<s;++l)(c=i[l])&&e.call(c,c.__data__,l,i)&&a.push(c);return new be(o,this._parents)}function _s(e){return new Array(e.length)}function cf(){return new be(this._enter||this._groups.map(_s),this._parents)}function Wn(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Wn.prototype={constructor:Wn,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function lf(e){return function(){return e}}function uf(e,t,n,o,r,i){for(var s=0,a,c=t.length,l=i.length;s<l;++s)(a=t[s])?(a.__data__=i[s],o[s]=a):n[s]=new Wn(e,i[s]);for(;s<c;++s)(a=t[s])&&(r[s]=a)}function df(e,t,n,o,r,i,s){var a,c,l=new Map,u=t.length,h=i.length,d=new Array(u),f;for(a=0;a<u;++a)(c=t[a])&&(d[a]=f=s.call(c,c.__data__,a,t)+"",l.has(f)?r[a]=c:l.set(f,c));for(a=0;a<h;++a)f=s.call(e,i[a],a,i)+"",(c=l.get(f))?(o[a]=c,c.__data__=i[a],l.delete(f)):n[a]=new Wn(e,i[a]);for(a=0;a<u;++a)(c=t[a])&&l.get(d[a])===c&&(r[a]=c)}function ff(e){return e.__data__}function hf(e,t){if(!arguments.length)return Array.from(this,ff);var n=t?df:uf,o=this._parents,r=this._groups;typeof e!="function"&&(e=lf(e));for(var i=r.length,s=new Array(i),a=new Array(i),c=new Array(i),l=0;l<i;++l){var u=o[l],h=r[l],d=h.length,f=pf(e.call(u,u&&u.__data__,l,o)),p=f.length,g=a[l]=new Array(p),x=s[l]=new Array(p),b=c[l]=new Array(d);n(u,h,g,x,b,f,t);for(var v=0,m=0,w,k;v<p;++v)if(w=g[v]){for(v>=m&&(m=v+1);!(k=x[m])&&++m<p;);w._next=k||null}}return s=new be(s,o),s._enter=a,s._exit=c,s}function pf(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function gf(){return new be(this._exit||this._groups.map(_s),this._parents)}function mf(e,t,n){var o=this.enter(),r=this,i=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(r=t(r),r&&(r=r.selection())),n==null?i.remove():n(i),o&&r?o.merge(r).order():r}function yf(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,r=n.length,i=o.length,s=Math.min(r,i),a=new Array(r),c=0;c<s;++c)for(var l=n[c],u=o[c],h=l.length,d=a[c]=new Array(h),f,p=0;p<h;++p)(f=l[p]||u[p])&&(d[p]=f);for(;c<r;++c)a[c]=n[c];return new be(a,this._parents)}function xf(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],r=o.length-1,i=o[r],s;--r>=0;)(s=o[r])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function wf(e){e||(e=bf);function t(h,d){return h&&d?e(h.__data__,d.__data__):!h-!d}for(var n=this._groups,o=n.length,r=new Array(o),i=0;i<o;++i){for(var s=n[i],a=s.length,c=r[i]=new Array(a),l,u=0;u<a;++u)(l=s[u])&&(c[u]=l);c.sort(t)}return new be(r,this._parents).order()}function bf(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function vf(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function Ef(){return Array.from(this)}function _f(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length;r<i;++r){var s=o[r];if(s)return s}return null}function Sf(){let e=0;for(const t of this)++e;return e}function Cf(){return!this.node()}function Nf(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var r=t[n],i=0,s=r.length,a;i<s;++i)(a=r[i])&&e.call(a,a.__data__,i,r);return this}function kf(e){return function(){this.removeAttribute(e)}}function Tf(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Mf(e,t){return function(){this.setAttribute(e,t)}}function Af(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function Pf(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function If(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function Of(e,t){var n=Bn(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?Tf:kf:typeof t=="function"?n.local?If:Pf:n.local?Af:Mf)(n,t))}function Ss(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Df(e){return function(){this.style.removeProperty(e)}}function Rf(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Lf(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function $f(e,t,n){return arguments.length>1?this.each((t==null?Df:typeof t=="function"?Lf:Rf)(e,t,n??"")):Ct(this.node(),e)}function Ct(e,t){return e.style.getPropertyValue(t)||Ss(e).getComputedStyle(e,null).getPropertyValue(t)}function zf(e){return function(){delete this[e]}}function Hf(e,t){return function(){this[e]=t}}function jf(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function Vf(e,t){return arguments.length>1?this.each((t==null?zf:typeof t=="function"?jf:Hf)(e,t)):this.node()[e]}function Cs(e){return e.trim().split(/^|\s+/)}function wr(e){return e.classList||new Ns(e)}function Ns(e){this._node=e,this._names=Cs(e.getAttribute("class")||"")}Ns.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 ks(e,t){for(var n=wr(e),o=-1,r=t.length;++o<r;)n.add(t[o])}function Ts(e,t){for(var n=wr(e),o=-1,r=t.length;++o<r;)n.remove(t[o])}function Ff(e){return function(){ks(this,e)}}function Bf(e){return function(){Ts(this,e)}}function Wf(e,t){return function(){(t.apply(this,arguments)?ks:Ts)(this,e)}}function Yf(e,t){var n=Cs(e+"");if(arguments.length<2){for(var o=wr(this.node()),r=-1,i=n.length;++r<i;)if(!o.contains(n[r]))return!1;return!0}return this.each((typeof t=="function"?Wf:t?Ff:Bf)(n,t))}function Xf(){this.textContent=""}function Uf(e){return function(){this.textContent=e}}function Gf(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function qf(e){return arguments.length?this.each(e==null?Xf:(typeof e=="function"?Gf:Uf)(e)):this.node().textContent}function Zf(){this.innerHTML=""}function Kf(e){return function(){this.innerHTML=e}}function Qf(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function Jf(e){return arguments.length?this.each(e==null?Zf:(typeof e=="function"?Qf:Kf)(e)):this.node().innerHTML}function eh(){this.nextSibling&&this.parentNode.appendChild(this)}function th(){return this.each(eh)}function nh(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function oh(){return this.each(nh)}function rh(e){var t=typeof e=="function"?e:ws(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function ih(){return null}function sh(e,t){var n=typeof e=="function"?e:ws(e),o=t==null?ih:typeof t=="function"?t:xr(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function ah(){var e=this.parentNode;e&&e.removeChild(this)}function ch(){return this.each(ah)}function lh(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function uh(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function dh(e){return this.select(e?uh:lh)}function fh(e){return arguments.length?this.property("__data__",e):this.node().__data__}function hh(e){return function(t){e.call(this,t,this.__data__)}}function ph(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function gh(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,r=t.length,i;n<r;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++o]=i;++o?t.length=o:delete this.__on}}}function mh(e,t,n){return function(){var o=this.__on,r,i=hh(t);if(o){for(var s=0,a=o.length;s<a;++s)if((r=o[s]).type===e.type&&r.name===e.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),r.value=t;return}}this.addEventListener(e.type,i,n),r={type:e.type,name:e.name,value:t,listener:i,options:n},o?o.push(r):this.__on=[r]}}function yh(e,t,n){var o=ph(e+""),r,i=o.length,s;if(arguments.length<2){var a=this.node().__on;if(a){for(var c=0,l=a.length,u;c<l;++c)for(r=0,u=a[c];r<i;++r)if((s=o[r]).type===u.type&&s.name===u.name)return u.value}return}for(a=t?mh:gh,r=0;r<i;++r)this.each(a(o[r],t,n));return this}function Ms(e,t,n){var o=Ss(e),r=o.CustomEvent;typeof r=="function"?r=new r(t,n):(r=o.document.createEvent("Event"),n?(r.initEvent(t,n.bubbles,n.cancelable),r.detail=n.detail):r.initEvent(t,!1,!1)),e.dispatchEvent(r)}function xh(e,t){return function(){return Ms(this,e,t)}}function wh(e,t){return function(){return Ms(this,e,t.apply(this,arguments))}}function bh(e,t){return this.each((typeof t=="function"?wh:xh)(e,t))}function*vh(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],r=0,i=o.length,s;r<i;++r)(s=o[r])&&(yield s)}var As=[null];function be(e,t){this._groups=e,this._parents=t}function Kt(){return new be([[document.documentElement]],As)}function Eh(){return this}be.prototype=Kt.prototype={constructor:be,select:Ud,selectAll:Kd,selectChild:tf,selectChildren:sf,filter:af,data:hf,enter:cf,exit:gf,join:mf,merge:yf,selection:Eh,order:xf,sort:wf,call:vf,nodes:Ef,node:_f,size:Sf,empty:Cf,each:Nf,attr:Of,style:$f,property:Vf,classed:Yf,text:qf,html:Jf,raise:th,lower:oh,append:rh,insert:sh,remove:ch,clone:dh,datum:fh,on:yh,dispatch:bh,[Symbol.iterator]:vh};function ve(e){return typeof e=="string"?new be([[document.querySelector(e)]],[document.documentElement]):new be([[e]],As)}function _h(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Ne(e,t){if(e=_h(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var r=t.getBoundingClientRect();return[e.clientX-r.left-t.clientLeft,e.clientY-r.top-t.clientTop]}}return[e.pageX,e.pageY]}const Sh={passive:!1},Qt={capture:!0,passive:!1};function br(e){e.stopImmediatePropagation()}function Nt(e){e.preventDefault(),e.stopImmediatePropagation()}function Ps(e){var t=e.document.documentElement,n=ve(e).on("dragstart.drag",Nt,Qt);"onselectstart"in t?n.on("selectstart.drag",Nt,Qt):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Is(e,t){var n=e.document.documentElement,o=ve(e).on("dragstart.drag",null);t&&(o.on("click.drag",Nt,Qt),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Yn=e=>()=>e;function vr(e,{sourceEvent:t,subject:n,target:o,identifier:r,active:i,x:s,y:a,dx:c,dy:l,dispatch:u}){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:o,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:s,enumerable:!0,configurable:!0},y:{value:a,enumerable:!0,configurable:!0},dx:{value:c,enumerable:!0,configurable:!0},dy:{value:l,enumerable:!0,configurable:!0},_:{value:u}})}vr.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function Ch(e){return!e.ctrlKey&&!e.button}function Nh(){return this.parentNode}function kh(e,t){return t??{x:e.x,y:e.y}}function Th(){return navigator.maxTouchPoints||"ontouchstart"in this}function Os(){var e=Ch,t=Nh,n=kh,o=Th,r={},i=Vn("start","drag","end"),s=0,a,c,l,u,h=0;function d(w){w.on("mousedown.drag",f).filter(o).on("touchstart.drag",x).on("touchmove.drag",b,Sh).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function f(w,k){if(!(u||!e.call(this,w,k))){var N=m(this,t.call(this,w,k),w,k,"mouse");N&&(ve(w.view).on("mousemove.drag",p,Qt).on("mouseup.drag",g,Qt),Ps(w.view),br(w),l=!1,a=w.clientX,c=w.clientY,N("start",w))}}function p(w){if(Nt(w),!l){var k=w.clientX-a,N=w.clientY-c;l=k*k+N*N>h}r.mouse("drag",w)}function g(w){ve(w.view).on("mousemove.drag mouseup.drag",null),Is(w.view,l),Nt(w),r.mouse("end",w)}function x(w,k){if(e.call(this,w,k)){var N=w.changedTouches,P=t.call(this,w,k),M=N.length,L,H;for(L=0;L<M;++L)(H=m(this,P,w,k,N[L].identifier,N[L]))&&(br(w),H("start",w,N[L]))}}function b(w){var k=w.changedTouches,N=k.length,P,M;for(P=0;P<N;++P)(M=r[k[P].identifier])&&(Nt(w),M("drag",w,k[P]))}function v(w){var k=w.changedTouches,N=k.length,P,M;for(u&&clearTimeout(u),u=setTimeout(function(){u=null},500),P=0;P<N;++P)(M=r[k[P].identifier])&&(br(w),M("end",w,k[P]))}function m(w,k,N,P,M,L){var H=i.copy(),j=Ne(L||N,k),R,$,y;if((y=n.call(w,new vr("beforestart",{sourceEvent:N,target:d,identifier:M,active:s,x:j[0],y:j[1],dx:0,dy:0,dispatch:H}),P))!=null)return R=y.x-j[0]||0,$=y.y-j[1]||0,function A(T,S,E){var I=j,_;switch(T){case"start":r[M]=A,_=s++;break;case"end":delete r[M],--s;case"drag":j=Ne(E||S,k),_=s;break}H.call(T,w,new vr(T,{sourceEvent:S,subject:y,target:d,identifier:M,active:_,x:j[0]+R,y:j[1]+$,dx:j[0]-I[0],dy:j[1]-I[1],dispatch:H}),P)}}return d.filter=function(w){return arguments.length?(e=typeof w=="function"?w:Yn(!!w),d):e},d.container=function(w){return arguments.length?(t=typeof w=="function"?w:Yn(w),d):t},d.subject=function(w){return arguments.length?(n=typeof w=="function"?w:Yn(w),d):n},d.touchable=function(w){return arguments.length?(o=typeof w=="function"?w:Yn(!!w),d):o},d.on=function(){var w=i.on.apply(i,arguments);return w===i?d:w},d.clickDistance=function(w){return arguments.length?(h=(w=+w)*w,d):Math.sqrt(h)},d}function Er(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ds(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Jt(){}var en=.7,Xn=1/en,kt="\\s*([+-]?\\d+)\\s*",tn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",De="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Mh=/^#([0-9a-f]{3,8})$/,Ah=new RegExp(`^rgb\\(${kt},${kt},${kt}\\)$`),Ph=new RegExp(`^rgb\\(${De},${De},${De}\\)$`),Ih=new RegExp(`^rgba\\(${kt},${kt},${kt},${tn}\\)$`),Oh=new RegExp(`^rgba\\(${De},${De},${De},${tn}\\)$`),Dh=new RegExp(`^hsl\\(${tn},${De},${De}\\)$`),Rh=new RegExp(`^hsla\\(${tn},${De},${De},${tn}\\)$`),Rs={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Er(Jt,st,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Ls,formatHex:Ls,formatHex8:Lh,formatHsl:$h,formatRgb:$s,toString:$s});function Ls(){return this.rgb().formatHex()}function Lh(){return this.rgb().formatHex8()}function $h(){return Fs(this).formatHsl()}function $s(){return this.rgb().formatRgb()}function st(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Mh.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?zs(t):n===3?new ye(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Un(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Un(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=Ah.exec(e))?new ye(t[1],t[2],t[3],1):(t=Ph.exec(e))?new ye(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Ih.exec(e))?Un(t[1],t[2],t[3],t[4]):(t=Oh.exec(e))?Un(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Dh.exec(e))?Vs(t[1],t[2]/100,t[3]/100,1):(t=Rh.exec(e))?Vs(t[1],t[2]/100,t[3]/100,t[4]):Rs.hasOwnProperty(e)?zs(Rs[e]):e==="transparent"?new ye(NaN,NaN,NaN,0):null}function zs(e){return new ye(e>>16&255,e>>8&255,e&255,1)}function Un(e,t,n,o){return o<=0&&(e=t=n=NaN),new ye(e,t,n,o)}function zh(e){return e instanceof Jt||(e=st(e)),e?(e=e.rgb(),new ye(e.r,e.g,e.b,e.opacity)):new ye}function _r(e,t,n,o){return arguments.length===1?zh(e):new ye(e,t,n,o??1)}function ye(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}Er(ye,_r,Ds(Jt,{brighter(e){return e=e==null?Xn:Math.pow(Xn,e),new ye(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?en:Math.pow(en,e),new ye(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new ye(at(this.r),at(this.g),at(this.b),Gn(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:Hs,formatHex:Hs,formatHex8:Hh,formatRgb:js,toString:js}));function Hs(){return`#${ct(this.r)}${ct(this.g)}${ct(this.b)}`}function Hh(){return`#${ct(this.r)}${ct(this.g)}${ct(this.b)}${ct((isNaN(this.opacity)?1:this.opacity)*255)}`}function js(){const e=Gn(this.opacity);return`${e===1?"rgb(":"rgba("}${at(this.r)}, ${at(this.g)}, ${at(this.b)}${e===1?")":`, ${e})`}`}function Gn(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function at(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ct(e){return e=at(e),(e<16?"0":"")+e.toString(16)}function Vs(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new ke(e,t,n,o)}function Fs(e){if(e instanceof ke)return new ke(e.h,e.s,e.l,e.opacity);if(e instanceof Jt||(e=st(e)),!e)return new ke;if(e instanceof ke)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,r=Math.min(t,n,o),i=Math.max(t,n,o),s=NaN,a=i-r,c=(i+r)/2;return a?(t===i?s=(n-o)/a+(n<o)*6:n===i?s=(o-t)/a+2:s=(t-n)/a+4,a/=c<.5?i+r:2-i-r,s*=60):a=c>0&&c<1?0:s,new ke(s,a,c,e.opacity)}function jh(e,t,n,o){return arguments.length===1?Fs(e):new ke(e,t,n,o??1)}function ke(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}Er(ke,jh,Ds(Jt,{brighter(e){return e=e==null?Xn:Math.pow(Xn,e),new ke(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?en:Math.pow(en,e),new ke(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,o=n+(n<.5?n:1-n)*t,r=2*n-o;return new ye(Sr(e>=240?e-240:e+120,r,o),Sr(e,r,o),Sr(e<120?e+240:e-120,r,o),this.opacity)},clamp(){return new ke(Bs(this.h),qn(this.s),qn(this.l),Gn(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=Gn(this.opacity);return`${e===1?"hsl(":"hsla("}${Bs(this.h)}, ${qn(this.s)*100}%, ${qn(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Bs(e){return e=(e||0)%360,e<0?e+360:e}function qn(e){return Math.max(0,Math.min(1,e||0))}function Sr(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 Cr=e=>()=>e;function Vh(e,t){return function(n){return e+n*t}}function Fh(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function Bh(e){return(e=+e)==1?Ws:function(t,n){return n-t?Fh(t,n,e):Cr(isNaN(t)?n:t)}}function Ws(e,t){var n=t-e;return n?Vh(e,n):Cr(isNaN(e)?t:e)}const Zn=function e(t){var n=Bh(t);function o(r,i){var s=n((r=_r(r)).r,(i=_r(i)).r),a=n(r.g,i.g),c=n(r.b,i.b),l=Ws(r.opacity,i.opacity);return function(u){return r.r=s(u),r.g=a(u),r.b=c(u),r.opacity=l(u),r+""}}return o.gamma=e,o}(1);function Wh(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),r;return function(i){for(r=0;r<n;++r)o[r]=e[r]*(1-i)+t[r]*i;return o}}function Yh(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function Xh(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,r=new Array(o),i=new Array(n),s;for(s=0;s<o;++s)r[s]=nn(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(a){for(s=0;s<o;++s)i[s]=r[s](a);return i}}function Uh(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function Re(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function Gh(e,t){var n={},o={},r;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(r in t)r in e?n[r]=nn(e[r],t[r]):o[r]=t[r];return function(i){for(r in n)o[r]=n[r](i);return o}}var Nr=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,kr=new RegExp(Nr.source,"g");function qh(e){return function(){return e}}function Zh(e){return function(t){return e(t)+""}}function Ys(e,t){var n=Nr.lastIndex=kr.lastIndex=0,o,r,i,s=-1,a=[],c=[];for(e=e+"",t=t+"";(o=Nr.exec(e))&&(r=kr.exec(t));)(i=r.index)>n&&(i=t.slice(n,i),a[s]?a[s]+=i:a[++s]=i),(o=o[0])===(r=r[0])?a[s]?a[s]+=r:a[++s]=r:(a[++s]=null,c.push({i:s,x:Re(o,r)})),n=kr.lastIndex;return n<t.length&&(i=t.slice(n),a[s]?a[s]+=i:a[++s]=i),a.length<2?c[0]?Zh(c[0].x):qh(t):(t=c.length,function(l){for(var u=0,h;u<t;++u)a[(h=c[u]).i]=h.x(l);return a.join("")})}function nn(e,t){var n=typeof t,o;return t==null||n==="boolean"?Cr(t):(n==="number"?Re:n==="string"?(o=st(t))?(t=o,Zn):Ys:t instanceof st?Zn:t instanceof Date?Uh:Yh(t)?Wh:Array.isArray(t)?Xh:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?Gh:Re)(e,t)}var Xs=180/Math.PI,Tr={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Us(e,t,n,o,r,i){var s,a,c;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(c=e*n+t*o)&&(n-=e*c,o-=t*c),(a=Math.sqrt(n*n+o*o))&&(n/=a,o/=a,c/=a),e*o<t*n&&(e=-e,t=-t,c=-c,s=-s),{translateX:r,translateY:i,rotate:Math.atan2(t,e)*Xs,skewX:Math.atan(c)*Xs,scaleX:s,scaleY:a}}var Kn;function Kh(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Tr:Us(t.a,t.b,t.c,t.d,t.e,t.f)}function Qh(e){return e==null||(Kn||(Kn=document.createElementNS("http://www.w3.org/2000/svg","g")),Kn.setAttribute("transform",e),!(e=Kn.transform.baseVal.consolidate()))?Tr:(e=e.matrix,Us(e.a,e.b,e.c,e.d,e.e,e.f))}function Gs(e,t,n,o){function r(l){return l.length?l.pop()+" ":""}function i(l,u,h,d,f,p){if(l!==h||u!==d){var g=f.push("translate(",null,t,null,n);p.push({i:g-4,x:Re(l,h)},{i:g-2,x:Re(u,d)})}else(h||d)&&f.push("translate("+h+t+d+n)}function s(l,u,h,d){l!==u?(l-u>180?u+=360:u-l>180&&(l+=360),d.push({i:h.push(r(h)+"rotate(",null,o)-2,x:Re(l,u)})):u&&h.push(r(h)+"rotate("+u+o)}function a(l,u,h,d){l!==u?d.push({i:h.push(r(h)+"skewX(",null,o)-2,x:Re(l,u)}):u&&h.push(r(h)+"skewX("+u+o)}function c(l,u,h,d,f,p){if(l!==h||u!==d){var g=f.push(r(f)+"scale(",null,",",null,")");p.push({i:g-4,x:Re(l,h)},{i:g-2,x:Re(u,d)})}else(h!==1||d!==1)&&f.push(r(f)+"scale("+h+","+d+")")}return function(l,u){var h=[],d=[];return l=e(l),u=e(u),i(l.translateX,l.translateY,u.translateX,u.translateY,h,d),s(l.rotate,u.rotate,h,d),a(l.skewX,u.skewX,h,d),c(l.scaleX,l.scaleY,u.scaleX,u.scaleY,h,d),l=u=null,function(f){for(var p=-1,g=d.length,x;++p<g;)h[(x=d[p]).i]=x.x(f);return h.join("")}}}var Jh=Gs(Kh,"px, ","px)","deg)"),ep=Gs(Qh,", ",")",")"),tp=1e-12;function qs(e){return((e=Math.exp(e))+1/e)/2}function np(e){return((e=Math.exp(e))-1/e)/2}function op(e){return((e=Math.exp(2*e))-1)/(e+1)}const Qn=function e(t,n,o){function r(i,s){var a=i[0],c=i[1],l=i[2],u=s[0],h=s[1],d=s[2],f=u-a,p=h-c,g=f*f+p*p,x,b;if(g<tp)b=Math.log(d/l)/t,x=function(P){return[a+P*f,c+P*p,l*Math.exp(t*P*b)]};else{var v=Math.sqrt(g),m=(d*d-l*l+o*g)/(2*l*n*v),w=(d*d-l*l-o*g)/(2*d*n*v),k=Math.log(Math.sqrt(m*m+1)-m),N=Math.log(Math.sqrt(w*w+1)-w);b=(N-k)/t,x=function(P){var M=P*b,L=qs(k),H=l/(n*v)*(L*op(t*M+k)-np(k));return[a+H*f,c+H*p,l*L/qs(t*M+k)]}}return x.duration=b*1e3*t/Math.SQRT2,x}return r.rho=function(i){var s=Math.max(.001,+i),a=s*s,c=a*a;return e(s,a,c)},r}(Math.SQRT2,2,4);var Tt=0,on=0,rn=0,Zs=1e3,Jn,sn,eo=0,lt=0,to=0,an=typeof performance=="object"&&performance.now?performance:Date,Ks=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Mr(){return lt||(Ks(rp),lt=an.now()+to)}function rp(){lt=0}function no(){this._call=this._time=this._next=null}no.prototype=Qs.prototype={constructor:no,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Mr():+n)+(t==null?0:+t),!this._next&&sn!==this&&(sn?sn._next=this:Jn=this,sn=this),this._call=e,this._time=n,Ar()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ar())}};function Qs(e,t,n){var o=new no;return o.restart(e,t,n),o}function ip(){Mr(),++Tt;for(var e=Jn,t;e;)(t=lt-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Tt}function Js(){lt=(eo=an.now())+to,Tt=on=0;try{ip()}finally{Tt=0,ap(),lt=0}}function sp(){var e=an.now(),t=e-eo;t>Zs&&(to-=t,eo=e)}function ap(){for(var e,t=Jn,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Jn=n);sn=e,Ar(o)}function Ar(e){if(!Tt){on&&(on=clearTimeout(on));var t=e-lt;t>24?(e<1/0&&(on=setTimeout(Js,e-an.now()-to)),rn&&(rn=clearInterval(rn))):(rn||(eo=an.now(),rn=setInterval(sp,Zs)),Tt=1,Ks(Js))}}function ea(e,t,n){var o=new no;return t=t==null?0:+t,o.restart(r=>{o.stop(),e(r+t)},t,n),o}var cp=Vn("start","end","cancel","interrupt"),lp=[],ta=0,na=1,Pr=2,oo=3,oa=4,Ir=5,ro=6;function io(e,t,n,o,r,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;up(e,n,{name:t,index:o,group:r,on:cp,tween:lp,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:ta})}function Or(e,t){var n=Te(e,t);if(n.state>ta)throw new Error("too late; already scheduled");return n}function Le(e,t){var n=Te(e,t);if(n.state>oo)throw new Error("too late; already running");return n}function Te(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function up(e,t,n){var o=e.__transition,r;o[t]=n,n.timer=Qs(i,0,n.time);function i(l){n.state=na,n.timer.restart(s,n.delay,n.time),n.delay<=l&&s(l-n.delay)}function s(l){var u,h,d,f;if(n.state!==na)return c();for(u in o)if(f=o[u],f.name===n.name){if(f.state===oo)return ea(s);f.state===oa?(f.state=ro,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[u]):+u<t&&(f.state=ro,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[u])}if(ea(function(){n.state===oo&&(n.state=oa,n.timer.restart(a,n.delay,n.time),a(l))}),n.state=Pr,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Pr){for(n.state=oo,r=new Array(d=n.tween.length),u=0,h=-1;u<d;++u)(f=n.tween[u].value.call(e,e.__data__,n.index,n.group))&&(r[++h]=f);r.length=h+1}}function a(l){for(var u=l<n.duration?n.ease.call(null,l/n.duration):(n.timer.restart(c),n.state=Ir,1),h=-1,d=r.length;++h<d;)r[h].call(e,u);n.state===Ir&&(n.on.call("end",e,e.__data__,n.index,n.group),c())}function c(){n.state=ro,n.timer.stop(),delete o[t];for(var l in o)return;delete e.__transition}}function so(e,t){var n=e.__transition,o,r,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((o=n[s]).name!==t){i=!1;continue}r=o.state>Pr&&o.state<Ir,o.state=ro,o.timer.stop(),o.on.call(r?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[s]}i&&delete e.__transition}}function dp(e){return this.each(function(){so(this,e)})}function fp(e,t){var n,o;return function(){var r=Le(this,e),i=r.tween;if(i!==n){o=n=i;for(var s=0,a=o.length;s<a;++s)if(o[s].name===t){o=o.slice(),o.splice(s,1);break}}r.tween=o}}function hp(e,t,n){var o,r;if(typeof n!="function")throw new Error;return function(){var i=Le(this,e),s=i.tween;if(s!==o){r=(o=s).slice();for(var a={name:t,value:n},c=0,l=r.length;c<l;++c)if(r[c].name===t){r[c]=a;break}c===l&&r.push(a)}i.tween=r}}function pp(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Te(this.node(),n).tween,r=0,i=o.length,s;r<i;++r)if((s=o[r]).name===e)return s.value;return null}return this.each((t==null?fp:hp)(n,e,t))}function Dr(e,t,n){var o=e._id;return e.each(function(){var r=Le(this,o);(r.value||(r.value={}))[t]=n.apply(this,arguments)}),function(r){return Te(r,o).value[t]}}function ra(e,t){var n;return(typeof t=="number"?Re:t instanceof st?Zn:(n=st(t))?(t=n,Zn):Ys)(e,t)}function gp(e){return function(){this.removeAttribute(e)}}function mp(e){return function(){this.removeAttributeNS(e.space,e.local)}}function yp(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttribute(e);return s===r?null:s===o?i:i=t(o=s,n)}}function xp(e,t,n){var o,r=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===r?null:s===o?i:i=t(o=s,n)}}function wp(e,t,n){var o,r,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttribute(e):(s=this.getAttribute(e),c=a+"",s===c?null:s===o&&c===r?i:(r=c,i=t(o=s,a)))}}function bp(e,t,n){var o,r,i;return function(){var s,a=n(this),c;return a==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),c=a+"",s===c?null:s===o&&c===r?i:(r=c,i=t(o=s,a)))}}function vp(e,t){var n=Bn(e),o=n==="transform"?ep:ra;return this.attrTween(e,typeof t=="function"?(n.local?bp:wp)(n,o,Dr(this,"attr."+e,t)):t==null?(n.local?mp:gp)(n):(n.local?xp:yp)(n,o,t))}function Ep(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function _p(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function Sp(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&_p(e,i)),n}return r._value=t,r}function Cp(e,t){var n,o;function r(){var i=t.apply(this,arguments);return i!==o&&(n=(o=i)&&Ep(e,i)),n}return r._value=t,r}function Np(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=Bn(e);return this.tween(n,(o.local?Sp:Cp)(o,t))}function kp(e,t){return function(){Or(this,e).delay=+t.apply(this,arguments)}}function Tp(e,t){return t=+t,function(){Or(this,e).delay=t}}function Mp(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?kp:Tp)(t,e)):Te(this.node(),t).delay}function Ap(e,t){return function(){Le(this,e).duration=+t.apply(this,arguments)}}function Pp(e,t){return t=+t,function(){Le(this,e).duration=t}}function Ip(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?Ap:Pp)(t,e)):Te(this.node(),t).duration}function Op(e,t){if(typeof t!="function")throw new Error;return function(){Le(this,e).ease=t}}function Dp(e){var t=this._id;return arguments.length?this.each(Op(t,e)):Te(this.node(),t).ease}function Rp(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;Le(this,e).ease=n}}function Lp(e){if(typeof e!="function")throw new Error;return this.each(Rp(this._id,e))}function $p(e){typeof e!="function"&&(e=vs(e));for(var t=this._groups,n=t.length,o=new Array(n),r=0;r<n;++r)for(var i=t[r],s=i.length,a=o[r]=[],c,l=0;l<s;++l)(c=i[l])&&e.call(c,c.__data__,l,i)&&a.push(c);return new Be(o,this._parents,this._name,this._id)}function zp(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,r=n.length,i=Math.min(o,r),s=new Array(o),a=0;a<i;++a)for(var c=t[a],l=n[a],u=c.length,h=s[a]=new Array(u),d,f=0;f<u;++f)(d=c[f]||l[f])&&(h[f]=d);for(;a<o;++a)s[a]=t[a];return new Be(s,this._parents,this._name,this._id)}function Hp(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function jp(e,t,n){var o,r,i=Hp(t)?Or:Le;return function(){var s=i(this,e),a=s.on;a!==o&&(r=(o=a).copy()).on(t,n),s.on=r}}function Vp(e,t){var n=this._id;return arguments.length<2?Te(this.node(),n).on.on(e):this.each(jp(n,e,t))}function Fp(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function Bp(){return this.on("end.remove",Fp(this._id))}function Wp(e){var t=this._name,n=this._id;typeof e!="function"&&(e=xr(e));for(var o=this._groups,r=o.length,i=new Array(r),s=0;s<r;++s)for(var a=o[s],c=a.length,l=i[s]=new Array(c),u,h,d=0;d<c;++d)(u=a[d])&&(h=e.call(u,u.__data__,d,a))&&("__data__"in u&&(h.__data__=u.__data__),l[d]=h,io(l[d],t,n,d,l,Te(u,n)));return new Be(i,this._parents,t,n)}function Yp(e){var t=this._name,n=this._id;typeof e!="function"&&(e=bs(e));for(var o=this._groups,r=o.length,i=[],s=[],a=0;a<r;++a)for(var c=o[a],l=c.length,u,h=0;h<l;++h)if(u=c[h]){for(var d=e.call(u,u.__data__,h,c),f,p=Te(u,n),g=0,x=d.length;g<x;++g)(f=d[g])&&io(f,t,n,g,d,p);i.push(d),s.push(u)}return new Be(i,s,t,n)}var Xp=Kt.prototype.constructor;function Up(){return new Xp(this._groups,this._parents)}function Gp(e,t){var n,o,r;return function(){var i=Ct(this,e),s=(this.style.removeProperty(e),Ct(this,e));return i===s?null:i===n&&s===o?r:r=t(n=i,o=s)}}function ia(e){return function(){this.style.removeProperty(e)}}function qp(e,t,n){var o,r=n+"",i;return function(){var s=Ct(this,e);return s===r?null:s===o?i:i=t(o=s,n)}}function Zp(e,t,n){var o,r,i;return function(){var s=Ct(this,e),a=n(this),c=a+"";return a==null&&(c=a=(this.style.removeProperty(e),Ct(this,e))),s===c?null:s===o&&c===r?i:(r=c,i=t(o=s,a))}}function Kp(e,t){var n,o,r,i="style."+t,s="end."+i,a;return function(){var c=Le(this,e),l=c.on,u=c.value[i]==null?a||(a=ia(t)):void 0;(l!==n||r!==u)&&(o=(n=l).copy()).on(s,r=u),c.on=o}}function Qp(e,t,n){var o=(e+="")=="transform"?Jh:ra;return t==null?this.styleTween(e,Gp(e,o)).on("end.style."+e,ia(e)):typeof t=="function"?this.styleTween(e,Zp(e,o,Dr(this,"style."+e,t))).each(Kp(this._id,e)):this.styleTween(e,qp(e,o,t),n).on("end.style."+e,null)}function Jp(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function eg(e,t,n){var o,r;function i(){var s=t.apply(this,arguments);return s!==r&&(o=(r=s)&&Jp(e,s,n)),o}return i._value=t,i}function tg(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,eg(e,t,n??""))}function ng(e){return function(){this.textContent=e}}function og(e){return function(){var t=e(this);this.textContent=t??""}}function rg(e){return this.tween("text",typeof e=="function"?og(Dr(this,"text",e)):ng(e==null?"":e+""))}function ig(e){return function(t){this.textContent=e.call(this,t)}}function sg(e){var t,n;function o(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&ig(r)),t}return o._value=e,o}function ag(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,sg(e))}function cg(){for(var e=this._name,t=this._id,n=sa(),o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,c,l=0;l<a;++l)if(c=s[l]){var u=Te(c,t);io(c,e,n,l,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new Be(o,this._parents,e,n)}function lg(){var e,t,n=this,o=n._id,r=n.size();return new Promise(function(i,s){var a={value:s},c={value:function(){--r===0&&i()}};n.each(function(){var l=Le(this,o),u=l.on;u!==e&&(t=(e=u).copy(),t._.cancel.push(a),t._.interrupt.push(a),t._.end.push(c)),l.on=t}),r===0&&i()})}var ug=0;function Be(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function sa(){return++ug}var We=Kt.prototype;Be.prototype={constructor:Be,select:Wp,selectAll:Yp,selectChild:We.selectChild,selectChildren:We.selectChildren,filter:$p,merge:zp,selection:Up,transition:cg,call:We.call,nodes:We.nodes,node:We.node,size:We.size,empty:We.empty,each:We.each,on:Vp,attr:vp,attrTween:Np,style:Qp,styleTween:tg,text:rg,textTween:ag,remove:Bp,tween:pp,delay:Mp,duration:Ip,ease:Dp,easeVarying:Lp,end:lg,[Symbol.iterator]:We[Symbol.iterator]};function dg(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var fg={time:null,delay:0,duration:250,ease:dg};function hg(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function pg(e){var t,n;e instanceof Be?(t=e._id,e=e._name):(t=sa(),(n=fg).time=Mr(),e=e==null?null:e+"");for(var o=this._groups,r=o.length,i=0;i<r;++i)for(var s=o[i],a=s.length,c,l=0;l<a;++l)(c=s[l])&&io(c,e,t,l,s,n||hg(c,t));return new Be(o,this._parents,e,t)}Kt.prototype.interrupt=dp,Kt.prototype.transition=pg;const ao=e=>()=>e;function gg(e,{sourceEvent:t,target:n,transform:o,dispatch:r}){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:o,enumerable:!0,configurable:!0},_:{value:r}})}function Ye(e,t,n){this.k=e,this.x=t,this.y=n}Ye.prototype={constructor:Ye,scale:function(e){return e===1?this:new Ye(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Ye(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 co=new Ye(1,0,0);aa.prototype=Ye.prototype;function aa(e){for(;!e.__zoom;)if(!(e=e.parentNode))return co;return e.__zoom}function Rr(e){e.stopImmediatePropagation()}function cn(e){e.preventDefault(),e.stopImmediatePropagation()}function mg(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function yg(){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 ca(){return this.__zoom||co}function xg(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function wg(){return navigator.maxTouchPoints||"ontouchstart"in this}function bg(e,t,n){var o=e.invertX(t[0][0])-n[0][0],r=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],s=e.invertY(t[1][1])-n[1][1];return e.translate(r>o?(o+r)/2:Math.min(0,o)||Math.max(0,r),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function la(){var e=mg,t=yg,n=bg,o=xg,r=wg,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],a=250,c=Qn,l=Vn("start","zoom","end"),u,h,d,f=500,p=150,g=0,x=10;function b(y){y.property("__zoom",ca).on("wheel.zoom",M,{passive:!1}).on("mousedown.zoom",L).on("dblclick.zoom",H).filter(r).on("touchstart.zoom",j).on("touchmove.zoom",R).on("touchend.zoom touchcancel.zoom",$).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}b.transform=function(y,A,T,S){var E=y.selection?y.selection():y;E.property("__zoom",ca),y!==E?k(y,A,T,S):E.interrupt().each(function(){N(this,arguments).event(S).start().zoom(null,typeof A=="function"?A.apply(this,arguments):A).end()})},b.scaleBy=function(y,A,T,S){b.scaleTo(y,function(){var E=this.__zoom.k,I=typeof A=="function"?A.apply(this,arguments):A;return E*I},T,S)},b.scaleTo=function(y,A,T,S){b.transform(y,function(){var E=t.apply(this,arguments),I=this.__zoom,_=T==null?w(E):typeof T=="function"?T.apply(this,arguments):T,D=I.invert(_),z=typeof A=="function"?A.apply(this,arguments):A;return n(m(v(I,z),_,D),E,s)},T,S)},b.translateBy=function(y,A,T,S){b.transform(y,function(){return n(this.__zoom.translate(typeof A=="function"?A.apply(this,arguments):A,typeof T=="function"?T.apply(this,arguments):T),t.apply(this,arguments),s)},null,S)},b.translateTo=function(y,A,T,S,E){b.transform(y,function(){var I=t.apply(this,arguments),_=this.__zoom,D=S==null?w(I):typeof S=="function"?S.apply(this,arguments):S;return n(co.translate(D[0],D[1]).scale(_.k).translate(typeof A=="function"?-A.apply(this,arguments):-A,typeof T=="function"?-T.apply(this,arguments):-T),I,s)},S,E)};function v(y,A){return A=Math.max(i[0],Math.min(i[1],A)),A===y.k?y:new Ye(A,y.x,y.y)}function m(y,A,T){var S=A[0]-T[0]*y.k,E=A[1]-T[1]*y.k;return S===y.x&&E===y.y?y:new Ye(y.k,S,E)}function w(y){return[(+y[0][0]+ +y[1][0])/2,(+y[0][1]+ +y[1][1])/2]}function k(y,A,T,S){y.on("start.zoom",function(){N(this,arguments).event(S).start()}).on("interrupt.zoom end.zoom",function(){N(this,arguments).event(S).end()}).tween("zoom",function(){var E=this,I=arguments,_=N(E,I).event(S),D=t.apply(E,I),z=T==null?w(D):typeof T=="function"?T.apply(E,I):T,F=Math.max(D[1][0]-D[0][0],D[1][1]-D[0][1]),B=E.__zoom,Y=typeof A=="function"?A.apply(E,I):A,K=c(B.invert(z).concat(F/B.k),Y.invert(z).concat(F/Y.k));return function(W){if(W===1)W=Y;else{var V=K(W),X=F/V[2];W=new Ye(X,z[0]-V[0]*X,z[1]-V[1]*X)}_.zoom(null,W)}})}function N(y,A,T){return!T&&y.__zooming||new P(y,A)}function P(y,A){this.that=y,this.args=A,this.active=0,this.sourceEvent=null,this.extent=t.apply(y,A),this.taps=0}P.prototype={event:function(y){return y&&(this.sourceEvent=y),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(y,A){return this.mouse&&y!=="mouse"&&(this.mouse[1]=A.invert(this.mouse[0])),this.touch0&&y!=="touch"&&(this.touch0[1]=A.invert(this.touch0[0])),this.touch1&&y!=="touch"&&(this.touch1[1]=A.invert(this.touch1[0])),this.that.__zoom=A,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(y){var A=ve(this.that).datum();l.call(y,this.that,new gg(y,{sourceEvent:this.sourceEvent,target:b,transform:this.that.__zoom,dispatch:l}),A)}};function M(y,...A){if(!e.apply(this,arguments))return;var T=N(this,A).event(y),S=this.__zoom,E=Math.max(i[0],Math.min(i[1],S.k*Math.pow(2,o.apply(this,arguments)))),I=Ne(y);if(T.wheel)(T.mouse[0][0]!==I[0]||T.mouse[0][1]!==I[1])&&(T.mouse[1]=S.invert(T.mouse[0]=I)),clearTimeout(T.wheel);else{if(S.k===E)return;T.mouse=[I,S.invert(I)],so(this),T.start()}cn(y),T.wheel=setTimeout(_,p),T.zoom("mouse",n(m(v(S,E),T.mouse[0],T.mouse[1]),T.extent,s));function _(){T.wheel=null,T.end()}}function L(y,...A){if(d||!e.apply(this,arguments))return;var T=y.currentTarget,S=N(this,A,!0).event(y),E=ve(y.view).on("mousemove.zoom",z,!0).on("mouseup.zoom",F,!0),I=Ne(y,T),_=y.clientX,D=y.clientY;Ps(y.view),Rr(y),S.mouse=[I,this.__zoom.invert(I)],so(this),S.start();function z(B){if(cn(B),!S.moved){var Y=B.clientX-_,K=B.clientY-D;S.moved=Y*Y+K*K>g}S.event(B).zoom("mouse",n(m(S.that.__zoom,S.mouse[0]=Ne(B,T),S.mouse[1]),S.extent,s))}function F(B){E.on("mousemove.zoom mouseup.zoom",null),Is(B.view,S.moved),cn(B),S.event(B).end()}}function H(y,...A){if(e.apply(this,arguments)){var T=this.__zoom,S=Ne(y.changedTouches?y.changedTouches[0]:y,this),E=T.invert(S),I=T.k*(y.shiftKey?.5:2),_=n(m(v(T,I),S,E),t.apply(this,A),s);cn(y),a>0?ve(this).transition().duration(a).call(k,_,S,y):ve(this).call(b.transform,_,S,y)}}function j(y,...A){if(e.apply(this,arguments)){var T=y.touches,S=T.length,E=N(this,A,y.changedTouches.length===S).event(y),I,_,D,z;for(Rr(y),_=0;_<S;++_)D=T[_],z=Ne(D,this),z=[z,this.__zoom.invert(z),D.identifier],E.touch0?!E.touch1&&E.touch0[2]!==z[2]&&(E.touch1=z,E.taps=0):(E.touch0=z,I=!0,E.taps=1+!!u);u&&(u=clearTimeout(u)),I&&(E.taps<2&&(h=z[0],u=setTimeout(function(){u=null},f)),so(this),E.start())}}function R(y,...A){if(this.__zooming){var T=N(this,A).event(y),S=y.changedTouches,E=S.length,I,_,D,z;for(cn(y),I=0;I<E;++I)_=S[I],D=Ne(_,this),T.touch0&&T.touch0[2]===_.identifier?T.touch0[0]=D:T.touch1&&T.touch1[2]===_.identifier&&(T.touch1[0]=D);if(_=T.that.__zoom,T.touch1){var F=T.touch0[0],B=T.touch0[1],Y=T.touch1[0],K=T.touch1[1],W=(W=Y[0]-F[0])*W+(W=Y[1]-F[1])*W,V=(V=K[0]-B[0])*V+(V=K[1]-B[1])*V;_=v(_,Math.sqrt(W/V)),D=[(F[0]+Y[0])/2,(F[1]+Y[1])/2],z=[(B[0]+K[0])/2,(B[1]+K[1])/2]}else if(T.touch0)D=T.touch0[0],z=T.touch0[1];else return;T.zoom("touch",n(m(_,D,z),T.extent,s))}}function $(y,...A){if(this.__zooming){var T=N(this,A).event(y),S=y.changedTouches,E=S.length,I,_;for(Rr(y),d&&clearTimeout(d),d=setTimeout(function(){d=null},f),I=0;I<E;++I)_=S[I],T.touch0&&T.touch0[2]===_.identifier?delete T.touch0:T.touch1&&T.touch1[2]===_.identifier&&delete T.touch1;if(T.touch1&&!T.touch0&&(T.touch0=T.touch1,delete T.touch1),T.touch0)T.touch0[1]=this.__zoom.invert(T.touch0[0]);else if(T.end(),T.taps===2&&(_=Ne(_,this),Math.hypot(h[0]-_[0],h[1]-_[1])<x)){var D=ve(this).on("dblclick.zoom");D&&D.apply(this,arguments)}}}return b.wheelDelta=function(y){return arguments.length?(o=typeof y=="function"?y:ao(+y),b):o},b.filter=function(y){return arguments.length?(e=typeof y=="function"?y:ao(!!y),b):e},b.touchable=function(y){return arguments.length?(r=typeof y=="function"?y:ao(!!y),b):r},b.extent=function(y){return arguments.length?(t=typeof y=="function"?y:ao([[+y[0][0],+y[0][1]],[+y[1][0],+y[1][1]]]),b):t},b.scaleExtent=function(y){return arguments.length?(i[0]=+y[0],i[1]=+y[1],b):[i[0],i[1]]},b.translateExtent=function(y){return arguments.length?(s[0][0]=+y[0][0],s[1][0]=+y[1][0],s[0][1]=+y[0][1],s[1][1]=+y[1][1],b):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},b.constrain=function(y){return arguments.length?(n=y,b):n},b.duration=function(y){return arguments.length?(a=+y,b):a},b.interpolate=function(y){return arguments.length?(c=y,b):c},b.on=function(){var y=l.on.apply(l,arguments);return y===l?b:y},b.clickDistance=function(y){return arguments.length?(g=(y=+y)*y,b):Math.sqrt(g)},b.tapDistance=function(y){return arguments.length?(x=+y,b):x},b}const xe={error001:()=>"[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:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", 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.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ln=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],ua=["Enter"," ","Escape"],da={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Mt;(function(e){e.Strict="strict",e.Loose="loose"})(Mt||(Mt={}));var ut;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(ut||(ut={}));var At;(function(e){e.Partial="partial",e.Full="full"})(At||(At={}));const fa={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Ze;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Ze||(Ze={}));var lo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(lo||(lo={}));var Q;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Q||(Q={}));const ha={[Q.Left]:Q.Right,[Q.Right]:Q.Left,[Q.Top]:Q.Bottom,[Q.Bottom]:Q.Top};function vg(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 pa(e,t,n){if(!n)return;const o=[];e.forEach((r,i)=>{t?.has(i)||o.push(r)}),o.length&&n(o)}function ga(e){return e===null?null:e?"valid":"invalid"}const ma=e=>"id"in e&&"source"in e&&"target"in e,Eg=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Lr=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),_g=(e,t,n)=>{if(!e.id)return[];const o=new Set;return n.forEach(r=>{r.source===e.id&&o.add(r.target)}),t.filter(r=>o.has(r.id))},un=(e,t=[0,0])=>{const{width:n,height:o}=Xe(e),r=e.origin??t,i=n*r[0],s=o*r[1];return{x:e.position.x-i,y:e.position.y-s}},Sg=(e,t={nodeOrigin:[0,0]})=>{if(process.env.NODE_ENV==="development"&&!t.nodeLookup&&console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((o,r)=>{const i=typeof r=="string";let s=!t.nodeLookup&&!i?r:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(r):Lr(r)?r:t.nodeLookup.get(r.id));const a=s?ho(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return uo(o,a)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return fo(n)},dn=(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(o=>{if(t.filter===void 0||t.filter(o)){const r=ho(o);n=uo(n,r)}}),fo(n)},$r=(e,t,[n,o,r]=[0,0,1],i=!1,s=!1)=>{const a={...pn(t,[n,o,r]),width:t.width/r,height:t.height/r},c=[];for(const l of e.values()){const{measured:u,selectable:h=!0,hidden:d=!1}=l;if(s&&!h||d)continue;const f=u.width??l.width??l.initialWidth??null,p=u.height??l.height??l.initialHeight??null,g=fn(a,It(l)),x=(f??0)*(p??0),b=i&&g>0;(!l.internals.handleBounds||b||g>=x||l.dragging)&&c.push(l)}return c},zr=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function Cg(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(r=>r.id)):null;return e.forEach(r=>{r.measured.width&&r.measured.height&&(t?.includeHiddenNodes||!r.hidden)&&(!o||o.has(r.id))&&n.set(r.id,r)}),n}async function Ng({nodes:e,width:t,height:n,panZoom:o,minZoom:r,maxZoom:i},s){if(e.size===0)return Promise.resolve(!0);const a=Cg(e,s),c=dn(a),l=jr(c,t,n,s?.minZoom??r,s?.maxZoom??i,s?.padding??.1);return await o.setViewport(l,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),Promise.resolve(!0)}function ya({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:r,onError:i}){const s=n.get(e),a=s.parentId?n.get(s.parentId):void 0,{x:c,y:l}=a?a.internals.positionAbsolute:{x:0,y:0},u=s.origin??o;let h=s.extent||r;if(s.extent==="parent"&&!s.expandParent)if(!a)i?.("005",xe.error005());else{const f=a.measured.width,p=a.measured.height;f&&p&&(h=[[c,l],[c+f,l+p]])}else a&&Dt(s.extent)&&(h=[[s.extent[0][0]+c,s.extent[0][1]+l],[s.extent[1][0]+c,s.extent[1][1]+l]]);const d=Dt(h)?dt(t,h,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&i?.("015",xe.error015()),{position:{x:d.x-c+(s.measured.width??0)*u[0],y:d.y-l+(s.measured.height??0)*u[1]},positionAbsolute:d}}async function kg({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:r}){const i=new Set(e.map(d=>d.id)),s=[];for(const d of n){if(d.deletable===!1)continue;const f=i.has(d.id),p=!f&&d.parentId&&s.find(g=>g.id===d.parentId);(f||p)&&s.push(d)}const a=new Set(t.map(d=>d.id)),c=o.filter(d=>d.deletable!==!1),u=zr(s,c);for(const d of c)a.has(d.id)&&!u.find(p=>p.id===d.id)&&u.push(d);if(!r)return{edges:u,nodes:s};const h=await r({nodes:s,edges:u});return typeof h=="boolean"?h?{edges:u,nodes:s}:{edges:[],nodes:[]}:h}const Pt=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),dt=(e={x:0,y:0},t,n)=>({x:Pt(e.x,t[0][0],t[1][0]-(n?.width??0)),y:Pt(e.y,t[0][1],t[1][1]-(n?.height??0))});function xa(e,t,n){const{width:o,height:r}=Xe(n),{x:i,y:s}=n.internals.positionAbsolute;return dt(e,[[i,s],[i+o,s+r]],t)}const wa=(e,t,n)=>e<t?Pt(Math.abs(e-t),1,t)/t:e>n?-Pt(Math.abs(e-n),1,t)/t:0,ba=(e,t,n=15,o=40)=>{const r=wa(e.x,o,t.width-o)*n,i=wa(e.y,o,t.height-o)*n;return[r,i]},uo=(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)}),Hr=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),fo=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),It=(e,t=[0,0])=>{const{x:n,y:o}=Lr(e)?e.internals.positionAbsolute:un(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},ho=(e,t=[0,0])=>{const{x:n,y:o}=Lr(e)?e.internals.positionAbsolute:un(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},va=(e,t)=>fo(uo(Hr(e),Hr(t))),fn=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},Ea=e=>Me(e.width)&&Me(e.height)&&Me(e.x)&&Me(e.y),Me=e=>!isNaN(e)&&isFinite(e),_a=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},hn=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),pn=({x:e,y:t},[n,o,r],i=!1,s=[1,1])=>{const a={x:(e-n)/r,y:(t-o)/r};return i?hn(a,s):a},po=({x:e,y:t},[n,o,r])=>({x:e*r+n,y:t*r+o});function Ot(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Tg(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=Ot(e,n),r=Ot(e,t);return{top:o,right:r,bottom:o,left:r,x:r*2,y:o*2}}if(typeof e=="object"){const o=Ot(e.top??e.y??0,n),r=Ot(e.bottom??e.y??0,n),i=Ot(e.left??e.x??0,t),s=Ot(e.right??e.x??0,t);return{top:o,right:s,bottom:r,left:i,x:i+s,y:o+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Mg(e,t,n,o,r,i){const{x:s,y:a}=po(e,[t,n,o]),{x:c,y:l}=po({x:e.x+e.width,y:e.y+e.height},[t,n,o]),u=r-c,h=i-l;return{left:Math.floor(s),top:Math.floor(a),right:Math.floor(u),bottom:Math.floor(h)}}const jr=(e,t,n,o,r,i)=>{const s=Tg(i,t,n),a=(t-s.x)/e.width,c=(n-s.y)/e.height,l=Math.min(a,c),u=Pt(l,o,r),h=e.x+e.width/2,d=e.y+e.height/2,f=t/2-h*u,p=n/2-d*u,g=Mg(e,f,p,u,t,n),x={left:Math.min(g.left-s.left,0),top:Math.min(g.top-s.top,0),right:Math.min(g.right-s.right,0),bottom:Math.min(g.bottom-s.bottom,0)};return{x:f-x.left+x.right,y:p-x.top+x.bottom,zoom:u}},gn=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Dt(e){return e!=null&&e!=="parent"}function Xe(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Sa(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Ca(e,t={width:0,height:0},n,o,r){const i={...e},s=o.get(n);if(s){const a=s.origin||r;i.x+=s.internals.positionAbsolute.x-(t.width??0)*a[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*a[1]}return i}function Na(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Ag(){let e,t;return{promise:new Promise((o,r)=>{e=o,t=r}),resolve:e,reject:t}}function Pg(e){return{...da,...e||{}}}function mn(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:r}){const{x:i,y:s}=$e(e),a=pn({x:i-(r?.left??0),y:s-(r?.top??0)},o),{x:c,y:l}=n?hn(a,t):a;return{xSnapped:c,ySnapped:l,...a}}const Vr=e=>({width:e.offsetWidth,height:e.offsetHeight}),ka=e=>e?.getRootNode?.()||window?.document,Ig=["INPUT","SELECT","TEXTAREA"];function Ta(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:Ig.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Ma=e=>"clientX"in e,$e=(e,t)=>{const n=Ma(e),o=n?e.clientX:e.touches?.[0].clientX,r=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:r-(t?.top??0)}},Aa=(e,t,n,o,r)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const a=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:r,position:s.getAttribute("data-handlepos"),x:(a.left-n.left)/o,y:(a.top-n.top)/o,...Vr(s)}})};function Pa({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:r,sourceControlY:i,targetControlX:s,targetControlY:a}){const c=e*.125+r*.375+s*.375+n*.125,l=t*.125+i*.375+a*.375+o*.125,u=Math.abs(c-e),h=Math.abs(l-t);return[c,l,u,h]}function go(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function Ia({pos:e,x1:t,y1:n,x2:o,y2:r,c:i}){switch(e){case Q.Left:return[t-go(t-o,i),n];case Q.Right:return[t+go(o-t,i),n];case Q.Top:return[t,n-go(n-r,i)];case Q.Bottom:return[t,n+go(r-n,i)]}}function mo({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:o,targetY:r,targetPosition:i=Q.Top,curvature:s=.25}){const[a,c]=Ia({pos:n,x1:e,y1:t,x2:o,y2:r,c:s}),[l,u]=Ia({pos:i,x1:o,y1:r,x2:e,y2:t,c:s}),[h,d,f,p]=Pa({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:a,sourceControlY:c,targetControlX:l,targetControlY:u});return[`M${e},${t} C${a},${c} ${l},${u} ${o},${r}`,h,d,f,p]}function Oa({sourceX:e,sourceY:t,targetX:n,targetY:o}){const r=Math.abs(n-e)/2,i=n<e?n+r:n-r,s=Math.abs(o-t)/2,a=o<t?o+s:o-s;return[i,a,r,s]}function Og({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o,elevateOnSelect:r=!1}){if(o!==void 0)return o;const i=r&&n?1e3:0,s=Math.max(e.parentId?e.internals.z:0,t.parentId?t.internals.z:0);return i+s}function Dg({sourceNode:e,targetNode:t,width:n,height:o,transform:r}){const i=uo(ho(e),ho(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-r[0]/r[2],y:-r[1]/r[2],width:n/r[2],height:o/r[2]};return fn(s,fo(i))>0}const Rg=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,Lg=(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)),yo=(e,t)=>{if(!e.source||!e.target)return _a("006",xe.error006()),t;let n;return ma(e)?n={...e}:n={...e,id:Rg(e)},Lg(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function Da({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[r,i,s,a]=Oa({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,r,i,s,a]}const Ra={[Q.Left]:{x:-1,y:0},[Q.Right]:{x:1,y:0},[Q.Top]:{x:0,y:-1},[Q.Bottom]:{x:0,y:1}},$g=({source:e,sourcePosition:t=Q.Bottom,target:n})=>t===Q.Left||t===Q.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},La=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function zg({source:e,sourcePosition:t=Q.Bottom,target:n,targetPosition:o=Q.Top,center:r,offset:i,stepPosition:s}){const a=Ra[t],c=Ra[o],l={x:e.x+a.x*i,y:e.y+a.y*i},u={x:n.x+c.x*i,y:n.y+c.y*i},h=$g({source:l,sourcePosition:t,target:u}),d=h.x!==0?"x":"y",f=h[d];let p=[],g,x;const b={x:0,y:0},v={x:0,y:0},[,,m,w]=Oa({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*c[d]===-1){d==="x"?(g=r.x??l.x+(u.x-l.x)*s,x=r.y??(l.y+u.y)/2):(g=r.x??(l.x+u.x)/2,x=r.y??l.y+(u.y-l.y)*s);const N=[{x:g,y:l.y},{x:g,y:u.y}],P=[{x:l.x,y:x},{x:u.x,y:x}];a[d]===f?p=d==="x"?N:P:p=d==="x"?P:N}else{const N=[{x:l.x,y:u.y}],P=[{x:u.x,y:l.y}];if(d==="x"?p=a.x===f?P:N:p=a.y===f?N:P,t===o){const R=Math.abs(e[d]-n[d]);if(R<=i){const $=Math.min(i-1,i-R);a[d]===f?b[d]=(l[d]>e[d]?-1:1)*$:v[d]=(u[d]>n[d]?-1:1)*$}}if(t!==o){const R=d==="x"?"y":"x",$=a[d]===c[R],y=l[R]>u[R],A=l[R]<u[R];(a[d]===1&&(!$&&y||$&&A)||a[d]!==1&&(!$&&A||$&&y))&&(p=d==="x"?N:P)}const M={x:l.x+b.x,y:l.y+b.y},L={x:u.x+v.x,y:u.y+v.y},H=Math.max(Math.abs(M.x-p[0].x),Math.abs(L.x-p[0].x)),j=Math.max(Math.abs(M.y-p[0].y),Math.abs(L.y-p[0].y));H>=j?(g=(M.x+L.x)/2,x=p[0].y):(g=p[0].x,x=(M.y+L.y)/2)}return[[e,{x:l.x+b.x,y:l.y+b.y},...p,{x:u.x+v.x,y:u.y+v.y},n],g,x,m,w]}function Hg(e,t,n,o){const r=Math.min(La(e,t)/2,La(t,n)/2,o),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const l=e.x<n.x?-1:1,u=e.y<n.y?1:-1;return`L ${i+r*l},${s}Q ${i},${s} ${i},${s+r*u}`}const a=e.x<n.x?1:-1,c=e.y<n.y?-1:1;return`L ${i},${s+r*c}Q ${i},${s} ${i+r*a},${s}`}function Fr({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:o,targetY:r,targetPosition:i=Q.Top,borderRadius:s=5,centerX:a,centerY:c,offset:l=20,stepPosition:u=.5}){const[h,d,f,p,g]=zg({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:r},targetPosition:i,center:{x:a,y:c},offset:l,stepPosition:u});return[h.reduce((b,v,m)=>{let w="";return m>0&&m<h.length-1?w=Hg(h[m-1],v,h[m+1],s):w=`${m===0?"M":"L"}${v.x} ${v.y}`,b+=w,b},""),d,f,p,g]}function $a(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function jg(e){const{sourceNode:t,targetNode:n}=e;if(!$a(t)||!$a(n))return null;const o=t.internals.handleBounds||za(t.handles),r=n.internals.handleBounds||za(n.handles),i=Ha(o?.source??[],e.sourceHandle),s=Ha(e.connectionMode===Mt.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),e.targetHandle);if(!i||!s)return e.onError?.("008",xe.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const a=i?.position||Q.Bottom,c=s?.position||Q.Top,l=yn(t,i,a),u=yn(n,s,c);return{sourceX:l.x,sourceY:l.y,targetX:u.x,targetY:u.y,sourcePosition:a,targetPosition:c}}function za(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?t.push(o):o.type==="target"&&n.push(o);return{source:t,target:n}}function yn(e,t,n=Q.Left,o=!1){const r=(t?.x??0)+e.internals.positionAbsolute.x,i=(t?.y??0)+e.internals.positionAbsolute.y,{width:s,height:a}=t??Xe(e);if(o)return{x:r+s/2,y:i+a/2};switch(t?.position??n){case Q.Top:return{x:r+s/2,y:i};case Q.Right:return{x:r+s,y:i+a/2};case Q.Bottom:return{x:r+s/2,y:i+a};case Q.Left:return{x:r,y:i+a/2}}}function Ha(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Br(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function Vg(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:r}){const i=new Set;return e.reduce((s,a)=>([a.markerStart||o,a.markerEnd||r].forEach(c=>{if(c&&typeof c=="object"){const l=Br(c,t);i.has(l)||(s.push({id:l,color:c.color||n,...c}),i.add(l))}}),s),[]).sort((s,a)=>s.id.localeCompare(a.id))}const Wr={nodeOrigin:[0,0],nodeExtent:ln,elevateNodesOnSelect:!0,defaults:{}},Fg={...Wr,checkEquality:!0};function Yr(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function Bg(e,t,n){const o=Yr(Wr,n);for(const r of e.values())if(r.parentId)Ur(r,e,t,o);else{const i=un(r,o.nodeOrigin),s=Dt(r.extent)?r.extent:o.nodeExtent,a=dt(i,s,Xe(r));r.internals.positionAbsolute=a}}function Xr(e,t,n,o){const r=Yr(Fg,o);let i=e.length>0;const s=new Map(t),a=r?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const c of e){let l=s.get(c.id);if(r.checkEquality&&c===l?.internals.userNode)t.set(c.id,l);else{const u=un(c,r.nodeOrigin),h=Dt(c.extent)?c.extent:r.nodeExtent,d=dt(u,h,Xe(c));l={...r.defaults,...c,measured:{width:c.measured?.width,height:c.measured?.height},internals:{positionAbsolute:d,handleBounds:c.measured?l?.internals.handleBounds:void 0,z:ja(c,a),userNode:c}},t.set(c.id,l)}(l.measured===void 0||l.measured.width===void 0||l.measured.height===void 0)&&!l.hidden&&(i=!1),c.parentId&&Ur(l,t,n,o)}return i}function Wg(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 Ur(e,t,n,o){const{elevateNodesOnSelect:r,nodeOrigin:i,nodeExtent:s}=Yr(Wr,o),a=e.parentId,c=t.get(a);if(!c){console.warn(`Parent node ${a} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Wg(e,n);const l=r?1e3:0,{x:u,y:h,z:d}=Yg(e,c,i,s,l),{positionAbsolute:f}=e.internals,p=u!==f.x||h!==f.y;(p||d!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:p?{x:u,y:h}:f,z:d}})}function ja(e,t){return(Me(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function Yg(e,t,n,o,r){const{x:i,y:s}=t.internals.positionAbsolute,a=Xe(e),c=un(e,n),l=Dt(e.extent)?dt(c,e.extent,a):c;let u=dt({x:i+l.x,y:s+l.y},o,a);e.extent==="parent"&&(u=xa(u,a,t));const h=ja(e,r),d=t.internals.z??0;return{x:u.x,y:u.y,z:d>=h?d+1:h}}function Gr(e,t,n,o=[0,0]){const r=[],i=new Map;for(const s of e){const a=t.get(s.parentId);if(!a)continue;const c=i.get(s.parentId)?.expandedRect??It(a),l=va(c,s.rect);i.set(s.parentId,{expandedRect:l,parent:a})}return i.size>0&&i.forEach(({expandedRect:s,parent:a},c)=>{const l=a.internals.positionAbsolute,u=Xe(a),h=a.origin??o,d=s.x<l.x?Math.round(Math.abs(l.x-s.x)):0,f=s.y<l.y?Math.round(Math.abs(l.y-s.y)):0,p=Math.max(u.width,Math.round(s.width)),g=Math.max(u.height,Math.round(s.height)),x=(p-u.width)*h[0],b=(g-u.height)*h[1];(d>0||f>0||x||b)&&(r.push({id:c,type:"position",position:{x:a.position.x-d+x,y:a.position.y-f+b}}),n.get(c)?.forEach(v=>{e.some(m=>m.id===v.id)||r.push({id:v.id,type:"position",position:{x:v.position.x+d,y:v.position.y+f}})})),(u.width<s.width||u.height<s.height||d||f)&&r.push({id:c,type:"dimensions",setAttributes:!0,dimensions:{width:p+(d?h[0]*d-x:0),height:g+(f?h[1]*f-b:0)}})}),r}function Xg(e,t,n,o,r,i){const s=o?.querySelector(".xyflow__viewport");let a=!1;if(!s)return{changes:[],updatedInternals:a};const c=[],l=window.getComputedStyle(s),{m22:u}=new window.DOMMatrixReadOnly(l.transform),h=[];for(const d of e.values()){const f=t.get(d.id);if(!f)continue;if(f.hidden){t.set(f.id,{...f,internals:{...f.internals,handleBounds:void 0}}),a=!0;continue}const p=Vr(d.nodeElement),g=f.measured.width!==p.width||f.measured.height!==p.height;if(!!(p.width&&p.height&&(g||!f.internals.handleBounds||d.force))){const b=d.nodeElement.getBoundingClientRect(),v=Dt(f.extent)?f.extent:i;let{positionAbsolute:m}=f.internals;f.parentId&&f.extent==="parent"?m=xa(m,p,t.get(f.parentId)):v&&(m=dt(m,v,p));const w={...f,measured:p,internals:{...f.internals,positionAbsolute:m,handleBounds:{source:Aa("source",d.nodeElement,b,u,f.id),target:Aa("target",d.nodeElement,b,u,f.id)}}};t.set(f.id,w),f.parentId&&Ur(w,t,n,{nodeOrigin:r}),a=!0,g&&(c.push({id:f.id,type:"dimensions",dimensions:p}),f.expandParent&&f.parentId&&h.push({id:f.id,parentId:f.parentId,rect:It(w,r)}))}}if(h.length>0){const d=Gr(h,t,n,r);c.push(...d)}return{changes:c,updatedInternals:a}}async function Ug({delta:e,panZoom:t,transform:n,translateExtent:o,width:r,height:i}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[r,i]],o),a=!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2]);return Promise.resolve(a)}function Va(e,t,n,o,r,i){let s=r;const a=o.get(s)||new Map;o.set(s,a.set(n,t)),s=`${r}-${e}`;const c=o.get(s)||new Map;if(o.set(s,c.set(n,t)),i){s=`${r}-${e}-${i}`;const l=o.get(s)||new Map;o.set(s,l.set(n,t))}}function Fa(e,t,n){e.clear(),t.clear();for(const o of n){const{source:r,target:i,sourceHandle:s=null,targetHandle:a=null}=o,c={edgeId:o.id,source:r,target:i,sourceHandle:s,targetHandle:a},l=`${r}-${s}--${i}-${a}`,u=`${i}-${a}--${r}-${s}`;Va("source",c,u,e,r,s),Va("target",c,l,e,i,a),t.set(o.id,o)}}function Gg(e,t){if(e===null||t===null)return!1;const n=Array.isArray(e)?e:[e],o=Array.isArray(t)?t:[t];if(n.length!==o.length)return!1;for(let r=0;r<n.length;r++)if(n[r].id!==o[r].id||n[r].type!==o[r].type||!Object.is(n[r].data,o[r].data))return!1;return!0}function Ba(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Ba(n,t):!1}function Wa(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function qg(e,t,n,o){const r=new Map;for(const[i,s]of e)if((s.selected||s.id===o)&&(!s.parentId||!Ba(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const a=e.get(i);a&&r.set(i,{id:i,position:a.position||{x:0,y:0},distance:{x:n.x-a.internals.positionAbsolute.x,y:n.y-a.internals.positionAbsolute.y},extent:a.extent,parentId:a.parentId,origin:a.origin,expandParent:a.expandParent,internals:{positionAbsolute:a.internals.positionAbsolute||{x:0,y:0}},measured:{width:a.measured.width??0,height:a.measured.height??0}})}return r}function qr({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const r=[];for(const[s,a]of t){const c=n.get(s)?.internals.userNode;c&&r.push({...c,position:a.position,dragging:o})}if(!e)return[r[0],r];const i=n.get(e)?.internals.userNode;return[i?{...i,position:t.get(e)?.position||i.position,dragging:o}:r[0],r]}function Zg({dragItems:e,snapGrid:t,x:n,y:o}){const r=e.values().next().value;if(!r)return null;const i={x:n-r.distance.x,y:o-r.distance.y},s=hn(i,t);return{x:s.x-i.x,y:s.y-i.y}}function Kg({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:r}){let i={x:null,y:null},s=0,a=new Map,c=!1,l={x:0,y:0},u=null,h=!1,d=null,f=!1,p=!1,g=null;function x({noDragClassName:v,handleSelector:m,domNode:w,isSelectable:k,nodeId:N,nodeClickDistance:P=0}){d=ve(w);function M({x:R,y:$}){const{nodeLookup:y,nodeExtent:A,snapGrid:T,snapToGrid:S,nodeOrigin:E,onNodeDrag:I,onSelectionDrag:_,onError:D,updateNodePositions:z}=t();i={x:R,y:$};let F=!1;const B=a.size>1,Y=B&&A?Hr(dn(a)):null,K=B&&S?Zg({dragItems:a,snapGrid:T,x:R,y:$}):null;for(const[W,V]of a){if(!y.has(W))continue;let X={x:R-V.distance.x,y:$-V.distance.y};S&&(X=K?{x:Math.round(X.x+K.x),y:Math.round(X.y+K.y)}:hn(X,T));let J=null;if(B&&A&&!V.extent&&Y){const{positionAbsolute:oe}=V.internals,ne=oe.x-Y.x+A[0][0],ue=oe.x+V.measured.width-Y.x2+A[1][0],ge=oe.y-Y.y+A[0][1],Ie=oe.y+V.measured.height-Y.y2+A[1][1];J=[[ne,ge],[ue,Ie]]}const{position:te,positionAbsolute:Z}=ya({nodeId:W,nextPosition:X,nodeLookup:y,nodeExtent:J||A,nodeOrigin:E,onError:D});F=F||V.position.x!==te.x||V.position.y!==te.y,V.position=te,V.internals.positionAbsolute=Z}if(p=p||F,!!F&&(z(a,!0),g&&(o||I||!N&&_))){const[W,V]=qr({nodeId:N,dragItems:a,nodeLookup:y});o?.(g,a,W,V),I?.(g,W,V),N||_?.(g,V)}}async function L(){if(!u)return;const{transform:R,panBy:$,autoPanSpeed:y,autoPanOnNodeDrag:A}=t();if(!A){c=!1,cancelAnimationFrame(s);return}const[T,S]=ba(l,u,y);(T!==0||S!==0)&&(i.x=(i.x??0)-T/R[2],i.y=(i.y??0)-S/R[2],await $({x:T,y:S})&&M(i)),s=requestAnimationFrame(L)}function H(R){const{nodeLookup:$,multiSelectionActive:y,nodesDraggable:A,transform:T,snapGrid:S,snapToGrid:E,selectNodesOnDrag:I,onNodeDragStart:_,onSelectionDragStart:D,unselectNodesAndEdges:z}=t();h=!0,(!I||!k)&&!y&&N&&($.get(N)?.selected||z()),k&&I&&N&&e?.(N);const F=mn(R.sourceEvent,{transform:T,snapGrid:S,snapToGrid:E,containerBounds:u});if(i=F,a=qg($,A,F,N),a.size>0&&(n||_||!N&&D)){const[B,Y]=qr({nodeId:N,dragItems:a,nodeLookup:$});n?.(R.sourceEvent,a,B,Y),_?.(R.sourceEvent,B,Y),N||D?.(R.sourceEvent,Y)}}const j=Os().clickDistance(P).on("start",R=>{const{domNode:$,nodeDragThreshold:y,transform:A,snapGrid:T,snapToGrid:S}=t();u=$?.getBoundingClientRect()||null,f=!1,p=!1,g=R.sourceEvent,y===0&&H(R),i=mn(R.sourceEvent,{transform:A,snapGrid:T,snapToGrid:S,containerBounds:u}),l=$e(R.sourceEvent,u)}).on("drag",R=>{const{autoPanOnNodeDrag:$,transform:y,snapGrid:A,snapToGrid:T,nodeDragThreshold:S,nodeLookup:E}=t(),I=mn(R.sourceEvent,{transform:y,snapGrid:A,snapToGrid:T,containerBounds:u});if(g=R.sourceEvent,(R.sourceEvent.type==="touchmove"&&R.sourceEvent.touches.length>1||N&&!E.has(N))&&(f=!0),!f){if(!c&&$&&h&&(c=!0,L()),!h){const _=I.xSnapped-(i.x??0),D=I.ySnapped-(i.y??0);Math.sqrt(_*_+D*D)>S&&H(R)}(i.x!==I.xSnapped||i.y!==I.ySnapped)&&a&&h&&(l=$e(R.sourceEvent,u),M(I))}}).on("end",R=>{if(!(!h||f)&&(c=!1,h=!1,cancelAnimationFrame(s),a.size>0)){const{nodeLookup:$,updateNodePositions:y,onNodeDragStop:A,onSelectionDragStop:T}=t();if(p&&(y(a,!1),p=!1),r||A||!N&&T){const[S,E]=qr({nodeId:N,dragItems:a,nodeLookup:$,dragging:!1});r?.(R.sourceEvent,a,S,E),A?.(R.sourceEvent,S,E),N||T?.(R.sourceEvent,E)}}}).filter(R=>{const $=R.target;return!R.button&&(!v||!Wa($,`.${v}`,w))&&(!m||Wa($,m,w))});d.call(j)}function b(){d?.on(".drag",null)}return{update:x,destroy:b}}function Qg(e,t,n){const o=[],r={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())fn(r,It(i))>0&&o.push(i);return o}const Jg=250;function em(e,t,n,o){let r=[],i=1/0;const s=Qg(e,n,t+Jg);for(const a of s){const c=[...a.internals.handleBounds?.source??[],...a.internals.handleBounds?.target??[]];for(const l of c){if(o.nodeId===l.nodeId&&o.type===l.type&&o.id===l.id)continue;const{x:u,y:h}=yn(a,l,l.position,!0),d=Math.sqrt(Math.pow(u-e.x,2)+Math.pow(h-e.y,2));d>t||(d<i?(r=[{...l,x:u,y:h}],i=d):d===i&&r.push({...l,x:u,y:h}))}}if(!r.length)return null;if(r.length>1){const a=o.type==="source"?"target":"source";return r.find(c=>c.type===a)??r[0]}return r[0]}function Ya(e,t,n,o,r,i=!1){const s=o.get(e);if(!s)return null;const a=r==="strict"?s.internals.handleBounds?.[t]:[...s.internals.handleBounds?.source??[],...s.internals.handleBounds?.target??[]],c=(n?a?.find(l=>l.id===n):a?.[0])??null;return c&&i?{...c,...yn(s,c,c.position,!0)}:c}function Xa(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function tm(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const Ua=()=>!0;function nm(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:r,edgeUpdaterType:i,isTarget:s,domNode:a,nodeLookup:c,lib:l,autoPanOnConnect:u,flowId:h,panBy:d,cancelConnection:f,onConnectStart:p,onConnect:g,onConnectEnd:x,isValidConnection:b=Ua,onReconnectEnd:v,updateConnection:m,getTransform:w,getFromHandle:k,autoPanSpeed:N,dragThreshold:P=1,handleDomNode:M}){const L=ka(e.target);let H=0,j;const{x:R,y:$}=$e(e),y=Xa(i,M),A=a?.getBoundingClientRect();let T=!1;if(!A||!y)return;const S=Ya(r,y,o,c,t);if(!S)return;let E=$e(e,A),I=!1,_=null,D=!1,z=null;function F(){if(!u||!A)return;const[te,Z]=ba(E,A,N);d({x:te,y:Z}),H=requestAnimationFrame(F)}const B={...S,nodeId:r,type:y,position:S.position},Y=c.get(r);let W={inProgress:!0,isValid:null,from:yn(Y,B,Q.Left,!0),fromHandle:B,fromPosition:B.position,fromNode:Y,to:E,toHandle:null,toPosition:ha[B.position],toNode:null};function V(){T=!0,m(W),p?.(e,{nodeId:r,handleId:o,handleType:y})}P===0&&V();function X(te){if(!T){const{x:ue,y:ge}=$e(te),Ie=ue-R,Bt=ge-$;if(!(Ie*Ie+Bt*Bt>P*P))return;V()}if(!k()||!B){J(te);return}const Z=w();E=$e(te,A),j=em(pn(E,Z,!1,[1,1]),n,c,B),I||(F(),I=!0);const oe=Ga(te,{handle:j,connectionMode:t,fromNodeId:r,fromHandleId:o,fromType:s?"target":"source",isValidConnection:b,doc:L,lib:l,flowId:h,nodeLookup:c});z=oe.handleDomNode,_=oe.connection,D=tm(!!j,oe.isValid);const ne={...W,isValid:D,to:oe.toHandle&&D?po({x:oe.toHandle.x,y:oe.toHandle.y},Z):E,toHandle:oe.toHandle,toPosition:D&&oe.toHandle?oe.toHandle.position:ha[B.position],toNode:oe.toHandle?c.get(oe.toHandle.nodeId):null};D&&j&&W.toHandle&&ne.toHandle&&W.toHandle.type===ne.toHandle.type&&W.toHandle.nodeId===ne.toHandle.nodeId&&W.toHandle.id===ne.toHandle.id&&W.to.x===ne.to.x&&W.to.y===ne.to.y||(m(ne),W=ne)}function J(te){if(T){(j||z)&&_&&D&&g?.(_);const{inProgress:Z,...oe}=W,ne={...oe,toPosition:W.toHandle?W.toPosition:null};x?.(te,ne),i&&v?.(te,ne)}f(),cancelAnimationFrame(H),I=!1,D=!1,_=null,z=null,L.removeEventListener("mousemove",X),L.removeEventListener("mouseup",J),L.removeEventListener("touchmove",X),L.removeEventListener("touchend",J)}L.addEventListener("mousemove",X),L.addEventListener("mouseup",J),L.addEventListener("touchmove",X),L.addEventListener("touchend",J)}function Ga(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:r,fromType:i,doc:s,lib:a,flowId:c,isValidConnection:l=Ua,nodeLookup:u}){const h=i==="target",d=t?s.querySelector(`.${a}-flow__handle[data-id="${c}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:f,y:p}=$e(e),g=s.elementFromPoint(f,p),x=g?.classList.contains(`${a}-flow__handle`)?g:d,b={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const v=Xa(void 0,x),m=x.getAttribute("data-nodeid"),w=x.getAttribute("data-handleid"),k=x.classList.contains("connectable"),N=x.classList.contains("connectableend");if(!m||!v)return b;const P={source:h?m:o,sourceHandle:h?w:r,target:h?o:m,targetHandle:h?r:w};b.connection=P;const L=k&&N&&(n===Mt.Strict?h&&v==="source"||!h&&v==="target":m!==o||w!==r);b.isValid=L&&l(P),b.toHandle=Ya(m,v,w,u,n,!0)}return b}const Zr={onPointerDown:nm,isValid:Ga};function om({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const r=ve(e);function i({translateExtent:a,width:c,height:l,zoomStep:u=1,pannable:h=!0,zoomable:d=!0,inversePan:f=!1}){const p=m=>{if(m.sourceEvent.type!=="wheel"||!t)return;const w=n(),k=m.sourceEvent.ctrlKey&&gn()?10:1,N=-m.sourceEvent.deltaY*(m.sourceEvent.deltaMode===1?.05:m.sourceEvent.deltaMode?1:.002)*u,P=w[2]*Math.pow(2,N*k);t.scaleTo(P)};let g=[0,0];const x=m=>{(m.sourceEvent.type==="mousedown"||m.sourceEvent.type==="touchstart")&&(g=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY])},b=m=>{const w=n();if(m.sourceEvent.type!=="mousemove"&&m.sourceEvent.type!=="touchmove"||!t)return;const k=[m.sourceEvent.clientX??m.sourceEvent.touches[0].clientX,m.sourceEvent.clientY??m.sourceEvent.touches[0].clientY],N=[k[0]-g[0],k[1]-g[1]];g=k;const P=o()*Math.max(w[2],Math.log(w[2]))*(f?-1:1),M={x:w[0]-N[0]*P,y:w[1]-N[1]*P},L=[[0,0],[c,l]];t.setViewportConstrained({x:M.x,y:M.y,zoom:w[2]},L,a)},v=la().on("start",x).on("zoom",h?b:null).on("zoom.wheel",d?p:null);r.call(v,{})}function s(){r.on("zoom",null)}return{update:i,destroy:s,pointer:Ne}}const rm=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,xo=e=>({x:e.x,y:e.y,zoom:e.k}),Kr=({x:e,y:t,zoom:n})=>co.translate(e,t).scale(n),Rt=(e,t)=>e.target.closest(`.${t}`),qa=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),im=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Qr=(e,t=0,n=im,o=()=>{})=>{const r=typeof t=="number"&&t>0;return r||o(),r?e.transition().duration(t).ease(n).on("end",o):e},Za=e=>{const t=e.ctrlKey&&gn()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function sm({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:r,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:a,onPanZoom:c,onPanZoomEnd:l}){return u=>{if(Rt(u,t))return!1;u.preventDefault(),u.stopImmediatePropagation();const h=n.property("__zoom").k||1;if(u.ctrlKey&&s){const x=Ne(u),b=Za(u),v=h*Math.pow(2,b);o.scaleTo(n,v,x,u);return}const d=u.deltaMode===1?20:1;let f=r===ut.Vertical?0:u.deltaX*d,p=r===ut.Horizontal?0:u.deltaY*d;!gn()&&u.shiftKey&&r!==ut.Vertical&&(f=u.deltaY*d,p=0),o.translateBy(n,-(f/h)*i,-(p/h)*i,{internal:!0});const g=xo(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,a?.(u,g)),e.isPanScrolling&&(c?.(u,g),e.panScrollTimeout=setTimeout(()=>{l?.(u,g),e.isPanScrolling=!1},150))}}function am({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,r){const i=o.type==="wheel",s=!t&&i&&!o.ctrlKey,a=Rt(o,e);if(o.ctrlKey&&i&&a&&o.preventDefault(),s||a)return null;o.preventDefault(),n.call(this,o,r)}}function cm({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const r=xo(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=r,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,r)}}function lm({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:r}){return i=>{e.usedRightMouseButton=!!(n&&qa(t,e.mouseButton??0)),i.sourceEvent?.sync||o([i.transform.x,i.transform.y,i.transform.k]),r&&!i.sourceEvent?.internal&&r?.(i.sourceEvent,xo(i.transform))}}function um({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:r,onPaneContextMenu:i}){return s=>{if(!s.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,i&&qa(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,o(!1),r&&rm(e.prevViewport,s.transform))){const a=xo(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{r?.(s.sourceEvent,a)},n?150:0)}}}function dm({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:o,panOnScroll:r,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:a,noPanClassName:c,lib:l}){return u=>{const h=e||t,d=n&&u.ctrlKey;if(u.button===1&&u.type==="mousedown"&&(Rt(u,`${l}-flow__node`)||Rt(u,`${l}-flow__edge`)))return!0;if(!o&&!h&&!r&&!i&&!n||s||Rt(u,a)&&u.type==="wheel"||Rt(u,c)&&(u.type!=="wheel"||r&&u.type==="wheel"&&!e)||!n&&u.ctrlKey&&u.type==="wheel")return!1;if(!n&&u.type==="touchstart"&&u.touches?.length>1)return u.preventDefault(),!1;if(!h&&!r&&!d&&u.type==="wheel"||!o&&(u.type==="mousedown"||u.type==="touchstart")||Array.isArray(o)&&!o.includes(u.button)&&u.type==="mousedown")return!1;const f=Array.isArray(o)&&o.includes(u.button)||!u.button||u.button<=1;return(!u.ctrlKey||u.type==="wheel")&&f}}function fm({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:o,translateExtent:r,viewport:i,onPanZoom:s,onPanZoomStart:a,onPanZoomEnd:c,onDraggingChange:l}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},h=e.getBoundingClientRect(),d=la().clickDistance(!Me(o)||o<0?0:o).scaleExtent([t,n]).translateExtent(r),f=ve(e).call(d);m({x:i.x,y:i.y,zoom:Pt(i.zoom,t,n)},[[0,0],[h.width,h.height]],r);const p=f.on("wheel.zoom"),g=f.on("dblclick.zoom");d.wheelDelta(Za);function x(R,$){return f?new Promise(y=>{d?.interpolate($?.interpolate==="linear"?nn:Qn).transform(Qr(f,$?.duration,$?.ease,()=>y(!0)),R)}):Promise.resolve(!1)}function b({noWheelClassName:R,noPanClassName:$,onPaneContextMenu:y,userSelectionActive:A,panOnScroll:T,panOnDrag:S,panOnScrollMode:E,panOnScrollSpeed:I,preventScrolling:_,zoomOnPinch:D,zoomOnScroll:z,zoomOnDoubleClick:F,zoomActivationKeyPressed:B,lib:Y,onTransformChange:K}){A&&!u.isZoomingOrPanning&&v();const V=T&&!B&&!A?sm({zoomPanValues:u,noWheelClassName:R,d3Selection:f,d3Zoom:d,panOnScrollMode:E,panOnScrollSpeed:I,zoomOnPinch:D,onPanZoomStart:a,onPanZoom:s,onPanZoomEnd:c}):am({noWheelClassName:R,preventScrolling:_,d3ZoomHandler:p});if(f.on("wheel.zoom",V,{passive:!1}),!A){const J=cm({zoomPanValues:u,onDraggingChange:l,onPanZoomStart:a});d.on("start",J);const te=lm({zoomPanValues:u,panOnDrag:S,onPaneContextMenu:!!y,onPanZoom:s,onTransformChange:K});d.on("zoom",te);const Z=um({zoomPanValues:u,panOnDrag:S,panOnScroll:T,onPaneContextMenu:y,onPanZoomEnd:c,onDraggingChange:l});d.on("end",Z)}const X=dm({zoomActivationKeyPressed:B,panOnDrag:S,zoomOnScroll:z,panOnScroll:T,zoomOnDoubleClick:F,zoomOnPinch:D,userSelectionActive:A,noPanClassName:$,noWheelClassName:R,lib:Y});d.filter(X),F?f.on("dblclick.zoom",g):f.on("dblclick.zoom",null)}function v(){d.on("zoom",null)}async function m(R,$,y){const A=Kr(R),T=d?.constrain()(A,$,y);return T&&await x(T),new Promise(S=>S(T))}async function w(R,$){const y=Kr(R);return await x(y,$),new Promise(A=>A(y))}function k(R){if(f){const $=Kr(R),y=f.property("__zoom");(y.k!==R.zoom||y.x!==R.x||y.y!==R.y)&&d?.transform(f,$,null,{sync:!0})}}function N(){const R=f?aa(f.node()):{x:0,y:0,k:1};return{x:R.x,y:R.y,zoom:R.k}}function P(R,$){return f?new Promise(y=>{d?.interpolate($?.interpolate==="linear"?nn:Qn).scaleTo(Qr(f,$?.duration,$?.ease,()=>y(!0)),R)}):Promise.resolve(!1)}function M(R,$){return f?new Promise(y=>{d?.interpolate($?.interpolate==="linear"?nn:Qn).scaleBy(Qr(f,$?.duration,$?.ease,()=>y(!0)),R)}):Promise.resolve(!1)}function L(R){d?.scaleExtent(R)}function H(R){d?.translateExtent(R)}function j(R){const $=!Me(R)||R<0?0:R;d?.clickDistance($)}return{update:b,destroy:v,setViewport:w,setViewportConstrained:m,getViewport:N,scaleTo:P,scaleBy:M,setScaleExtent:L,setTranslateExtent:H,syncViewport:k,setClickDistance:j}}var ft;(function(e){e.Line="line",e.Handle="handle"})(ft||(ft={}));function hm({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:r,affectsY:i}){const s=e-t,a=n-o,c=[s>0?1:s<0?-1:0,a>0?1:a<0?-1:0];return s&&r&&(c[0]=c[0]*-1),a&&i&&(c[1]=c[1]*-1),c}function pm(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),r=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:r}}function Ke(e,t){return Math.max(0,t-e)}function Qe(e,t){return Math.max(0,e-t)}function wo(e,t,n){return Math.max(0,t-e,e-n)}function Ka(e,t){return e?!t:t}function gm(e,t,n,o,r,i,s,a){let{affectsX:c,affectsY:l}=t;const{isHorizontal:u,isVertical:h}=t,d=u&&h,{xSnapped:f,ySnapped:p}=n,{minWidth:g,maxWidth:x,minHeight:b,maxHeight:v}=o,{x:m,y:w,width:k,height:N,aspectRatio:P}=e;let M=Math.floor(u?f-e.pointerX:0),L=Math.floor(h?p-e.pointerY:0);const H=k+(c?-M:M),j=N+(l?-L:L),R=-i[0]*k,$=-i[1]*N;let y=wo(H,g,x),A=wo(j,b,v);if(s){let E=0,I=0;c&&M<0?E=Ke(m+M+R,s[0][0]):!c&&M>0&&(E=Qe(m+H+R,s[1][0])),l&&L<0?I=Ke(w+L+$,s[0][1]):!l&&L>0&&(I=Qe(w+j+$,s[1][1])),y=Math.max(y,E),A=Math.max(A,I)}if(a){let E=0,I=0;c&&M>0?E=Qe(m+M,a[0][0]):!c&&M<0&&(E=Ke(m+H,a[1][0])),l&&L>0?I=Qe(w+L,a[0][1]):!l&&L<0&&(I=Ke(w+j,a[1][1])),y=Math.max(y,E),A=Math.max(A,I)}if(r){if(u){const E=wo(H/P,b,v)*P;if(y=Math.max(y,E),s){let I=0;!c&&!l||c&&!l&&d?I=Qe(w+$+H/P,s[1][1])*P:I=Ke(w+$+(c?M:-M)/P,s[0][1])*P,y=Math.max(y,I)}if(a){let I=0;!c&&!l||c&&!l&&d?I=Ke(w+H/P,a[1][1])*P:I=Qe(w+(c?M:-M)/P,a[0][1])*P,y=Math.max(y,I)}}if(h){const E=wo(j*P,g,x)/P;if(A=Math.max(A,E),s){let I=0;!c&&!l||l&&!c&&d?I=Qe(m+j*P+R,s[1][0])/P:I=Ke(m+(l?L:-L)*P+R,s[0][0])/P,A=Math.max(A,I)}if(a){let I=0;!c&&!l||l&&!c&&d?I=Ke(m+j*P,a[1][0])/P:I=Qe(m+(l?L:-L)*P,a[0][0])/P,A=Math.max(A,I)}}}L=L+(L<0?A:-A),M=M+(M<0?y:-y),r&&(d?H>j*P?L=(Ka(c,l)?-M:M)/P:M=(Ka(c,l)?-L:L)*P:u?(L=M/P,l=c):(M=L*P,c=l));const T=c?m+M:m,S=l?w+L:w;return{width:k+(c?-M:M),height:N+(l?-L:L),x:i[0]*M*(c?-1:1)+T,y:i[1]*L*(l?-1:1)+S}}const Qa={width:0,height:0,x:0,y:0},mm={...Qa,pointerX:0,pointerY:0,aspectRatio:1};function ym(e){return[[0,0],[e.measured.width,e.measured.height]]}function xm(e,t,n){const o=t.position.x+e.position.x,r=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,a=n[0]*i,c=n[1]*s;return[[o-a,r-c],[o+i-a,r+s-c]]}function wm({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:r}){const i=ve(e);function s({controlPosition:c,boundaries:l,keepAspectRatio:u,resizeDirection:h,onResizeStart:d,onResize:f,onResizeEnd:p,shouldResize:g}){let x={...Qa},b={...mm};const v=pm(c);let m,w=null,k=[],N,P,M;const L=Os().on("start",H=>{const{nodeLookup:j,transform:R,snapGrid:$,snapToGrid:y,nodeOrigin:A,paneDomNode:T}=n();if(m=j.get(t),!m)return;w=T?.getBoundingClientRect()??null;const{xSnapped:S,ySnapped:E}=mn(H.sourceEvent,{transform:R,snapGrid:$,snapToGrid:y,containerBounds:w});x={width:m.measured.width??0,height:m.measured.height??0,x:m.position.x??0,y:m.position.y??0},b={...x,pointerX:S,pointerY:E,aspectRatio:x.width/x.height},N=void 0,m.parentId&&(m.extent==="parent"||m.expandParent)&&(N=j.get(m.parentId),P=N&&m.extent==="parent"?ym(N):void 0),k=[],M=void 0;for(const[I,_]of j)if(_.parentId===t&&(k.push({id:I,position:{..._.position},extent:_.extent}),_.extent==="parent"||_.expandParent)){const D=xm(_,m,_.origin??A);M?M=[[Math.min(D[0][0],M[0][0]),Math.min(D[0][1],M[0][1])],[Math.max(D[1][0],M[1][0]),Math.max(D[1][1],M[1][1])]]:M=D}d?.(H,{...x})}).on("drag",H=>{const{transform:j,snapGrid:R,snapToGrid:$,nodeOrigin:y}=n(),A=mn(H.sourceEvent,{transform:j,snapGrid:R,snapToGrid:$,containerBounds:w}),T=[];if(!m)return;const{x:S,y:E,width:I,height:_}=x,D={},z=m.origin??y,{width:F,height:B,x:Y,y:K}=gm(b,v,A,l,u,z,P,M),W=F!==I,V=B!==_,X=Y!==S&&W,J=K!==E&&V;if(!X&&!J&&!W&&!V)return;if((X||J||z[0]===1||z[1]===1)&&(D.x=X?Y:x.x,D.y=J?K:x.y,x.x=D.x,x.y=D.y,k.length>0)){const ne=Y-S,ue=K-E;for(const ge of k)ge.position={x:ge.position.x-ne+z[0]*(F-I),y:ge.position.y-ue+z[1]*(B-_)},T.push(ge)}if((W||V)&&(D.width=W&&(!h||h==="horizontal")?F:x.width,D.height=V&&(!h||h==="vertical")?B:x.height,x.width=D.width,x.height=D.height),N&&m.expandParent){const ne=z[0]*(D.width??0);D.x&&D.x<ne&&(x.x=ne,b.x=b.x-(D.x-ne));const ue=z[1]*(D.height??0);D.y&&D.y<ue&&(x.y=ue,b.y=b.y-(D.y-ue))}const te=hm({width:x.width,prevWidth:I,height:x.height,prevHeight:_,affectsX:v.affectsX,affectsY:v.affectsY}),Z={...x,direction:te};g?.(H,Z)!==!1&&(f?.(H,Z),o(D,T))}).on("end",H=>{p?.(H,{...x}),r?.({...x})});i.call(L)}function a(){i.on(".drag",null)}return{update:s,destroy:a}}var bo={exports:{}},Jr={},vo={exports:{}},ei={};/**
22
+ <%s key={someKey} {...props} />`,re,Q,ae,Q),W[Q+re]=!0)}if(Q=null,J!==void 0&&(n(J),Q=""+J),l(G)&&(n(G.key),Q=""+G.key),"key"in G){J={};for(var fe in G)fe!=="key"&&(J[fe]=G[fe])}else J=G;return Q&&c(J,typeof $=="function"?$.displayName||$.name||"Unknown":$),d($,Q,ce,se,s(),J,ge,te)}function g($){typeof $=="object"&&$!==null&&$.$$typeof===m&&$._store&&($._store.validated=1)}var p=z,m=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),w=Symbol.for("react.context"),E=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),M=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),K=Symbol.for("react.client.reference"),Z=p.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=Object.prototype.hasOwnProperty,q=Array.isArray,C=console.createTask?console.createTask:function(){return null};p={react_stack_bottom_frame:function($){return $()}};var H,B={},R=p.react_stack_bottom_frame.bind(p,a)(),P=C(o(a)),W={};zo.Fragment=v,zo.jsx=function($,G,J,re,se){var ce=1e4>Z.recentlyCreatedOwnerStacks++;return h($,G,J,!1,re,se,ce?Error("react-stack-top-frame"):R,ce?C(o($)):P)},zo.jsxs=function($,G,J,re,se){var ce=1e4>Z.recentlyCreatedOwnerStacks++;return h($,G,J,!0,re,se,ce?Error("react-stack-top-frame"):R,ce?C(o($)):P)}}()),zo}var Ud;function Nw(){return Ud||(Ud=1,process.env.NODE_ENV==="production"?fs.exports=Ew():fs.exports=Cw()),fs.exports}var T=Nw();function Gd(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Yd(...e){return t=>{let n=!1;const o=e.map(s=>{const a=Gd(s,t);return!n&&typeof a=="function"&&(n=!0),a});if(n)return()=>{for(let s=0;s<o.length;s++){const a=o[s];typeof a=="function"?a():Gd(e[s],null)}}}}function ut(...e){return L.useCallback(Yd(...e),e)}function Vo(e){const t=Aw(e),n=L.forwardRef((o,s)=>{const{children:a,...l}=o,c=L.Children.toArray(a),f=c.find(Ow);if(f){const d=f.props.children,h=c.map(g=>g===f?L.Children.count(d)>1?L.Children.only(null):L.isValidElement(d)?d.props.children:null:g);return T.jsx(t,{...l,ref:s,children:L.isValidElement(d)?L.cloneElement(d,void 0,h):null})}return T.jsx(t,{...l,ref:s,children:a})});return n.displayName=`${e}.Slot`,n}var Tw=Vo("Slot");function Aw(e){const t=L.forwardRef((n,o)=>{const{children:s,...a}=n;if(L.isValidElement(s)){const l=kw(s),c=Pw(a,s.props);return s.type!==L.Fragment&&(c.ref=o?Yd(o,l):l),L.cloneElement(s,c)}return L.Children.count(s)>1?L.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Iw=Symbol("radix.slottable");function Ow(e){return L.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Iw}function Pw(e,t){const n={...t};for(const o in t){const s=e[o],a=t[o];/^on[A-Z]/.test(o)?s&&a?n[o]=(...c)=>{const f=a(...c);return s(...c),f}:s&&(n[o]=s):o==="style"?n[o]={...s,...a}:o==="className"&&(n[o]=[s,a].filter(Boolean).join(" "))}return{...e,...n}}function kw(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function Xd(e){var t,n,o="";if(typeof e=="string"||typeof e=="number")o+=e;else if(typeof e=="object")if(Array.isArray(e)){var s=e.length;for(t=0;t<s;t++)e[t]&&(n=Xd(e[t]))&&(o&&(o+=" "),o+=n)}else for(n in e)e[n]&&(o&&(o+=" "),o+=n);return o}function qd(){for(var e,t,n=0,o="",s=arguments.length;n<s;n++)(e=arguments[n])&&(t=Xd(e))&&(o&&(o+=" "),o+=t);return o}const Kd=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,Zd=qd,Mw=(e,t)=>n=>{var o;if(t?.variants==null)return Zd(e,n?.class,n?.className);const{variants:s,defaultVariants:a}=t,l=Object.keys(s).map(d=>{const h=n?.[d],g=a?.[d];if(h===null)return null;const p=Kd(h)||Kd(g);return s[d][p]}),c=n&&Object.entries(n).reduce((d,h)=>{let[g,p]=h;return p===void 0||(d[g]=p),d},{}),f=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((d,h)=>{let{class:g,className:p,...m}=h;return Object.entries(m).every(x=>{let[v,b]=x;return Array.isArray(b)?b.includes({...a,...c}[v]):{...a,...c}[v]===b})?[...d,g,p]:d},[]);return Zd(e,l,f,n?.class,n?.className)},Hl="-",Rw=e=>{const t=Lw(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:o}=e;return{getClassGroupId:l=>{const c=l.split(Hl);return c[0]===""&&c.length!==1&&c.shift(),Qd(c,t)||Dw(l)},getConflictingClassGroupIds:(l,c)=>{const f=n[l]||[];return c&&o[l]?[...f,...o[l]]:f}}},Qd=(e,t)=>{if(e.length===0)return t.classGroupId;const n=e[0],o=t.nextPart.get(n),s=o?Qd(e.slice(1),o):void 0;if(s)return s;if(t.validators.length===0)return;const a=e.join(Hl);return t.validators.find(({validator:l})=>l(a))?.classGroupId},Jd=/^\[(.+)\]$/,Dw=e=>{if(Jd.test(e)){const t=Jd.exec(e)[1],n=t?.substring(0,t.indexOf(":"));if(n)return"arbitrary.."+n}},Lw=e=>{const{theme:t,classGroups:n}=e,o={nextPart:new Map,validators:[]};for(const s in n)zl(n[s],o,s,t);return o},zl=(e,t,n,o)=>{e.forEach(s=>{if(typeof s=="string"){const a=s===""?t:eh(t,s);a.classGroupId=n;return}if(typeof s=="function"){if($w(s)){zl(s(o),t,n,o);return}t.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([a,l])=>{zl(l,eh(t,a),n,o)})})},eh=(e,t)=>{let n=e;return t.split(Hl).forEach(o=>{n.nextPart.has(o)||n.nextPart.set(o,{nextPart:new Map,validators:[]}),n=n.nextPart.get(o)}),n},$w=e=>e.isThemeGetter,Bw=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=new Map,o=new Map;const s=(a,l)=>{n.set(a,l),t++,t>e&&(t=0,o=n,n=new Map)};return{get(a){let l=n.get(a);if(l!==void 0)return l;if((l=o.get(a))!==void 0)return s(a,l),l},set(a,l){n.has(a)?n.set(a,l):s(a,l)}}},Vl="!",Wl=":",Fw=Wl.length,Hw=e=>{const{prefix:t,experimentalParseClassName:n}=e;let o=s=>{const a=[];let l=0,c=0,f=0,d;for(let x=0;x<s.length;x++){let v=s[x];if(l===0&&c===0){if(v===Wl){a.push(s.slice(f,x)),f=x+Fw;continue}if(v==="/"){d=x;continue}}v==="["?l++:v==="]"?l--:v==="("?c++:v===")"&&c--}const h=a.length===0?s:s.substring(f),g=zw(h),p=g!==h,m=d&&d>f?d-f:void 0;return{modifiers:a,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:m}};if(t){const s=t+Wl,a=o;o=l=>l.startsWith(s)?a(l.substring(s.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:l,maybePostfixModifierPosition:void 0}}if(n){const s=o;o=a=>n({className:a,parseClassName:s})}return o},zw=e=>e.endsWith(Vl)?e.substring(0,e.length-1):e.startsWith(Vl)?e.substring(1):e,Vw=e=>{const t=Object.fromEntries(e.orderSensitiveModifiers.map(o=>[o,!0]));return o=>{if(o.length<=1)return o;const s=[];let a=[];return o.forEach(l=>{l[0]==="["||t[l]?(s.push(...a.sort(),l),a=[]):a.push(l)}),s.push(...a.sort()),s}},Ww=e=>({cache:Bw(e.cacheSize),parseClassName:Hw(e),sortModifiers:Vw(e),...Rw(e)}),jw=/\s+/,Uw=(e,t)=>{const{parseClassName:n,getClassGroupId:o,getConflictingClassGroupIds:s,sortModifiers:a}=t,l=[],c=e.trim().split(jw);let f="";for(let d=c.length-1;d>=0;d-=1){const h=c[d],{isExternal:g,modifiers:p,hasImportantModifier:m,baseClassName:x,maybePostfixModifierPosition:v}=n(h);if(g){f=h+(f.length>0?" "+f:f);continue}let b=!!v,_=o(b?x.substring(0,v):x);if(!_){if(!b){f=h+(f.length>0?" "+f:f);continue}if(_=o(x),!_){f=h+(f.length>0?" "+f:f);continue}b=!1}const N=a(p).join(":"),w=m?N+Vl:N,E=w+_;if(l.includes(E))continue;l.push(E);const O=s(_,b);for(let k=0;k<O.length;++k){const M=O[k];l.push(w+M)}f=h+(f.length>0?" "+f:f)}return f};function Gw(){let e=0,t,n,o="";for(;e<arguments.length;)(t=arguments[e++])&&(n=th(t))&&(o&&(o+=" "),o+=n);return o}const th=e=>{if(typeof e=="string")return e;let t,n="";for(let o=0;o<e.length;o++)e[o]&&(t=th(e[o]))&&(n&&(n+=" "),n+=t);return n};function Yw(e,...t){let n,o,s,a=l;function l(f){const d=t.reduce((h,g)=>g(h),e());return n=Ww(d),o=n.cache.get,s=n.cache.set,a=c,c(f)}function c(f){const d=o(f);if(d)return d;const h=Uw(f,n);return s(f,h),h}return function(){return a(Gw.apply(null,arguments))}}const it=e=>{const t=n=>n[e]||[];return t.isThemeGetter=!0,t},nh=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,rh=/^\((?:(\w[\w-]*):)?(.+)\)$/i,Xw=/^\d+\/\d+$/,qw=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,Kw=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,Zw=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Qw=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Jw=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Gr=e=>Xw.test(e),Pe=e=>!!e&&!Number.isNaN(Number(e)),Kn=e=>!!e&&Number.isInteger(Number(e)),jl=e=>e.endsWith("%")&&Pe(e.slice(0,-1)),Tn=e=>qw.test(e),eb=()=>!0,tb=e=>Kw.test(e)&&!Zw.test(e),oh=()=>!1,nb=e=>Qw.test(e),rb=e=>Jw.test(e),ob=e=>!ve(e)&&!xe(e),ib=e=>Yr(e,ch,oh),ve=e=>nh.test(e),vr=e=>Yr(e,uh,tb),Ul=e=>Yr(e,ub,Pe),ih=e=>Yr(e,ah,oh),sb=e=>Yr(e,lh,rb),ds=e=>Yr(e,fh,nb),xe=e=>rh.test(e),Wo=e=>Xr(e,uh),ab=e=>Xr(e,fb),sh=e=>Xr(e,ah),lb=e=>Xr(e,ch),cb=e=>Xr(e,lh),hs=e=>Xr(e,fh,!0),Yr=(e,t,n)=>{const o=nh.exec(e);return o?o[1]?t(o[1]):n(o[2]):!1},Xr=(e,t,n=!1)=>{const o=rh.exec(e);return o?o[1]?t(o[1]):n:!1},ah=e=>e==="position"||e==="percentage",lh=e=>e==="image"||e==="url",ch=e=>e==="length"||e==="size"||e==="bg-size",uh=e=>e==="length",ub=e=>e==="number",fb=e=>e==="family-name",fh=e=>e==="shadow",db=Yw(()=>{const e=it("color"),t=it("font"),n=it("text"),o=it("font-weight"),s=it("tracking"),a=it("leading"),l=it("breakpoint"),c=it("container"),f=it("spacing"),d=it("radius"),h=it("shadow"),g=it("inset-shadow"),p=it("text-shadow"),m=it("drop-shadow"),x=it("blur"),v=it("perspective"),b=it("aspect"),_=it("ease"),N=it("animate"),w=()=>["auto","avoid","all","avoid-page","page","left","right","column"],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],O=()=>[...E(),xe,ve],k=()=>["auto","hidden","clip","visible","scroll"],M=()=>["auto","contain","none"],D=()=>[xe,ve,f],V=()=>[Gr,"full","auto",...D()],K=()=>[Kn,"none","subgrid",xe,ve],Z=()=>["auto",{span:["full",Kn,xe,ve]},Kn,xe,ve],U=()=>[Kn,"auto",xe,ve],q=()=>["auto","min","max","fr",xe,ve],C=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],H=()=>["start","end","center","stretch","center-safe","end-safe"],B=()=>["auto",...D()],R=()=>[Gr,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...D()],P=()=>[e,xe,ve],W=()=>[...E(),sh,ih,{position:[xe,ve]}],$=()=>["no-repeat",{repeat:["","x","y","space","round"]}],G=()=>["auto","cover","contain",lb,ib,{size:[xe,ve]}],J=()=>[jl,Wo,vr],re=()=>["","none","full",d,xe,ve],se=()=>["",Pe,Wo,vr],ce=()=>["solid","dashed","dotted","double"],ge=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],te=()=>[Pe,jl,sh,ih],Q=()=>["","none",x,xe,ve],ae=()=>["none",Pe,xe,ve],fe=()=>["none",Pe,xe,ve],de=()=>[Pe,xe,ve],ue=()=>[Gr,"full",...D()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Tn],breakpoint:[Tn],color:[eb],container:[Tn],"drop-shadow":[Tn],ease:["in","out","in-out"],font:[ob],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Tn],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Tn],shadow:[Tn],spacing:["px",Pe],text:[Tn],"text-shadow":[Tn],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Gr,ve,xe,b]}],container:["container"],columns:[{columns:[Pe,ve,xe,c]}],"break-after":[{"break-after":w()}],"break-before":[{"break-before":w()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:O()}],overflow:[{overflow:k()}],"overflow-x":[{"overflow-x":k()}],"overflow-y":[{"overflow-y":k()}],overscroll:[{overscroll:M()}],"overscroll-x":[{"overscroll-x":M()}],"overscroll-y":[{"overscroll-y":M()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{start:V()}],end:[{end:V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[Kn,"auto",xe,ve]}],basis:[{basis:[Gr,"full","auto",c,...D()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Pe,Gr,"auto","initial","none",ve]}],grow:[{grow:["",Pe,xe,ve]}],shrink:[{shrink:["",Pe,xe,ve]}],order:[{order:[Kn,"first","last","none",xe,ve]}],"grid-cols":[{"grid-cols":K()}],"col-start-end":[{col:Z()}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":K()}],"row-start-end":[{row:Z()}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":q()}],"auto-rows":[{"auto-rows":q()}],gap:[{gap:D()}],"gap-x":[{"gap-x":D()}],"gap-y":[{"gap-y":D()}],"justify-content":[{justify:[...C(),"normal"]}],"justify-items":[{"justify-items":[...H(),"normal"]}],"justify-self":[{"justify-self":["auto",...H()]}],"align-content":[{content:["normal",...C()]}],"align-items":[{items:[...H(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...H(),{baseline:["","last"]}]}],"place-content":[{"place-content":C()}],"place-items":[{"place-items":[...H(),"baseline"]}],"place-self":[{"place-self":["auto",...H()]}],p:[{p:D()}],px:[{px:D()}],py:[{py:D()}],ps:[{ps:D()}],pe:[{pe:D()}],pt:[{pt:D()}],pr:[{pr:D()}],pb:[{pb:D()}],pl:[{pl:D()}],m:[{m:B()}],mx:[{mx:B()}],my:[{my:B()}],ms:[{ms:B()}],me:[{me:B()}],mt:[{mt:B()}],mr:[{mr:B()}],mb:[{mb:B()}],ml:[{ml:B()}],"space-x":[{"space-x":D()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":D()}],"space-y-reverse":["space-y-reverse"],size:[{size:R()}],w:[{w:[c,"screen",...R()]}],"min-w":[{"min-w":[c,"screen","none",...R()]}],"max-w":[{"max-w":[c,"screen","none","prose",{screen:[l]},...R()]}],h:[{h:["screen","lh",...R()]}],"min-h":[{"min-h":["screen","lh","none",...R()]}],"max-h":[{"max-h":["screen","lh",...R()]}],"font-size":[{text:["base",n,Wo,vr]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[o,xe,Ul]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",jl,ve]}],"font-family":[{font:[ab,ve,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[s,xe,ve]}],"line-clamp":[{"line-clamp":[Pe,"none",xe,Ul]}],leading:[{leading:[a,...D()]}],"list-image":[{"list-image":["none",xe,ve]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",xe,ve]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:P()}],"text-color":[{text:P()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ce(),"wavy"]}],"text-decoration-thickness":[{decoration:[Pe,"from-font","auto",xe,vr]}],"text-decoration-color":[{decoration:P()}],"underline-offset":[{"underline-offset":[Pe,"auto",xe,ve]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:D()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",xe,ve]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",xe,ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:W()}],"bg-repeat":[{bg:$()}],"bg-size":[{bg:G()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},Kn,xe,ve],radial:["",xe,ve],conic:[Kn,xe,ve]},cb,sb]}],"bg-color":[{bg:P()}],"gradient-from-pos":[{from:J()}],"gradient-via-pos":[{via:J()}],"gradient-to-pos":[{to:J()}],"gradient-from":[{from:P()}],"gradient-via":[{via:P()}],"gradient-to":[{to:P()}],rounded:[{rounded:re()}],"rounded-s":[{"rounded-s":re()}],"rounded-e":[{"rounded-e":re()}],"rounded-t":[{"rounded-t":re()}],"rounded-r":[{"rounded-r":re()}],"rounded-b":[{"rounded-b":re()}],"rounded-l":[{"rounded-l":re()}],"rounded-ss":[{"rounded-ss":re()}],"rounded-se":[{"rounded-se":re()}],"rounded-ee":[{"rounded-ee":re()}],"rounded-es":[{"rounded-es":re()}],"rounded-tl":[{"rounded-tl":re()}],"rounded-tr":[{"rounded-tr":re()}],"rounded-br":[{"rounded-br":re()}],"rounded-bl":[{"rounded-bl":re()}],"border-w":[{border:se()}],"border-w-x":[{"border-x":se()}],"border-w-y":[{"border-y":se()}],"border-w-s":[{"border-s":se()}],"border-w-e":[{"border-e":se()}],"border-w-t":[{"border-t":se()}],"border-w-r":[{"border-r":se()}],"border-w-b":[{"border-b":se()}],"border-w-l":[{"border-l":se()}],"divide-x":[{"divide-x":se()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":se()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ce(),"hidden","none"]}],"divide-style":[{divide:[...ce(),"hidden","none"]}],"border-color":[{border:P()}],"border-color-x":[{"border-x":P()}],"border-color-y":[{"border-y":P()}],"border-color-s":[{"border-s":P()}],"border-color-e":[{"border-e":P()}],"border-color-t":[{"border-t":P()}],"border-color-r":[{"border-r":P()}],"border-color-b":[{"border-b":P()}],"border-color-l":[{"border-l":P()}],"divide-color":[{divide:P()}],"outline-style":[{outline:[...ce(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Pe,xe,ve]}],"outline-w":[{outline:["",Pe,Wo,vr]}],"outline-color":[{outline:P()}],shadow:[{shadow:["","none",h,hs,ds]}],"shadow-color":[{shadow:P()}],"inset-shadow":[{"inset-shadow":["none",g,hs,ds]}],"inset-shadow-color":[{"inset-shadow":P()}],"ring-w":[{ring:se()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:P()}],"ring-offset-w":[{"ring-offset":[Pe,vr]}],"ring-offset-color":[{"ring-offset":P()}],"inset-ring-w":[{"inset-ring":se()}],"inset-ring-color":[{"inset-ring":P()}],"text-shadow":[{"text-shadow":["none",p,hs,ds]}],"text-shadow-color":[{"text-shadow":P()}],opacity:[{opacity:[Pe,xe,ve]}],"mix-blend":[{"mix-blend":[...ge(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":ge()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Pe]}],"mask-image-linear-from-pos":[{"mask-linear-from":te()}],"mask-image-linear-to-pos":[{"mask-linear-to":te()}],"mask-image-linear-from-color":[{"mask-linear-from":P()}],"mask-image-linear-to-color":[{"mask-linear-to":P()}],"mask-image-t-from-pos":[{"mask-t-from":te()}],"mask-image-t-to-pos":[{"mask-t-to":te()}],"mask-image-t-from-color":[{"mask-t-from":P()}],"mask-image-t-to-color":[{"mask-t-to":P()}],"mask-image-r-from-pos":[{"mask-r-from":te()}],"mask-image-r-to-pos":[{"mask-r-to":te()}],"mask-image-r-from-color":[{"mask-r-from":P()}],"mask-image-r-to-color":[{"mask-r-to":P()}],"mask-image-b-from-pos":[{"mask-b-from":te()}],"mask-image-b-to-pos":[{"mask-b-to":te()}],"mask-image-b-from-color":[{"mask-b-from":P()}],"mask-image-b-to-color":[{"mask-b-to":P()}],"mask-image-l-from-pos":[{"mask-l-from":te()}],"mask-image-l-to-pos":[{"mask-l-to":te()}],"mask-image-l-from-color":[{"mask-l-from":P()}],"mask-image-l-to-color":[{"mask-l-to":P()}],"mask-image-x-from-pos":[{"mask-x-from":te()}],"mask-image-x-to-pos":[{"mask-x-to":te()}],"mask-image-x-from-color":[{"mask-x-from":P()}],"mask-image-x-to-color":[{"mask-x-to":P()}],"mask-image-y-from-pos":[{"mask-y-from":te()}],"mask-image-y-to-pos":[{"mask-y-to":te()}],"mask-image-y-from-color":[{"mask-y-from":P()}],"mask-image-y-to-color":[{"mask-y-to":P()}],"mask-image-radial":[{"mask-radial":[xe,ve]}],"mask-image-radial-from-pos":[{"mask-radial-from":te()}],"mask-image-radial-to-pos":[{"mask-radial-to":te()}],"mask-image-radial-from-color":[{"mask-radial-from":P()}],"mask-image-radial-to-color":[{"mask-radial-to":P()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":E()}],"mask-image-conic-pos":[{"mask-conic":[Pe]}],"mask-image-conic-from-pos":[{"mask-conic-from":te()}],"mask-image-conic-to-pos":[{"mask-conic-to":te()}],"mask-image-conic-from-color":[{"mask-conic-from":P()}],"mask-image-conic-to-color":[{"mask-conic-to":P()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:W()}],"mask-repeat":[{mask:$()}],"mask-size":[{mask:G()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",xe,ve]}],filter:[{filter:["","none",xe,ve]}],blur:[{blur:Q()}],brightness:[{brightness:[Pe,xe,ve]}],contrast:[{contrast:[Pe,xe,ve]}],"drop-shadow":[{"drop-shadow":["","none",m,hs,ds]}],"drop-shadow-color":[{"drop-shadow":P()}],grayscale:[{grayscale:["",Pe,xe,ve]}],"hue-rotate":[{"hue-rotate":[Pe,xe,ve]}],invert:[{invert:["",Pe,xe,ve]}],saturate:[{saturate:[Pe,xe,ve]}],sepia:[{sepia:["",Pe,xe,ve]}],"backdrop-filter":[{"backdrop-filter":["","none",xe,ve]}],"backdrop-blur":[{"backdrop-blur":Q()}],"backdrop-brightness":[{"backdrop-brightness":[Pe,xe,ve]}],"backdrop-contrast":[{"backdrop-contrast":[Pe,xe,ve]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Pe,xe,ve]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Pe,xe,ve]}],"backdrop-invert":[{"backdrop-invert":["",Pe,xe,ve]}],"backdrop-opacity":[{"backdrop-opacity":[Pe,xe,ve]}],"backdrop-saturate":[{"backdrop-saturate":[Pe,xe,ve]}],"backdrop-sepia":[{"backdrop-sepia":["",Pe,xe,ve]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":D()}],"border-spacing-x":[{"border-spacing-x":D()}],"border-spacing-y":[{"border-spacing-y":D()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",xe,ve]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Pe,"initial",xe,ve]}],ease:[{ease:["linear","initial",_,xe,ve]}],delay:[{delay:[Pe,xe,ve]}],animate:[{animate:["none",N,xe,ve]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[v,xe,ve]}],"perspective-origin":[{"perspective-origin":O()}],rotate:[{rotate:ae()}],"rotate-x":[{"rotate-x":ae()}],"rotate-y":[{"rotate-y":ae()}],"rotate-z":[{"rotate-z":ae()}],scale:[{scale:fe()}],"scale-x":[{"scale-x":fe()}],"scale-y":[{"scale-y":fe()}],"scale-z":[{"scale-z":fe()}],"scale-3d":["scale-3d"],skew:[{skew:de()}],"skew-x":[{"skew-x":de()}],"skew-y":[{"skew-y":de()}],transform:[{transform:[xe,ve,"","none","gpu","cpu"]}],"transform-origin":[{origin:O()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:ue()}],"translate-x":[{"translate-x":ue()}],"translate-y":[{"translate-y":ue()}],"translate-z":[{"translate-z":ue()}],"translate-none":["translate-none"],accent:[{accent:P()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:P()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",xe,ve]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":D()}],"scroll-mx":[{"scroll-mx":D()}],"scroll-my":[{"scroll-my":D()}],"scroll-ms":[{"scroll-ms":D()}],"scroll-me":[{"scroll-me":D()}],"scroll-mt":[{"scroll-mt":D()}],"scroll-mr":[{"scroll-mr":D()}],"scroll-mb":[{"scroll-mb":D()}],"scroll-ml":[{"scroll-ml":D()}],"scroll-p":[{"scroll-p":D()}],"scroll-px":[{"scroll-px":D()}],"scroll-py":[{"scroll-py":D()}],"scroll-ps":[{"scroll-ps":D()}],"scroll-pe":[{"scroll-pe":D()}],"scroll-pt":[{"scroll-pt":D()}],"scroll-pr":[{"scroll-pr":D()}],"scroll-pb":[{"scroll-pb":D()}],"scroll-pl":[{"scroll-pl":D()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",xe,ve]}],fill:[{fill:["none",...P()]}],"stroke-w":[{stroke:[Pe,Wo,vr,Ul]}],stroke:[{stroke:["none",...P()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function Ne(...e){return db(qd(e))}const hb=Mw("inline-flex items-center justify-center gap-2 cursor-pointer py-2 px-4 rounded-md transition-all text-[27px] leading-[27px] font-main whitespace-nowrap text-primary-white disabled:cursor-not-allowed disabled:bg-secondary-dark-gray disabled:opacity-50 outline-none focus-visible:outline-none border",{variants:{color:{dark:"bg-secondary-black border-secondary-dark-gray",lightNonPriority:"bg-primary-gray border-transparent",lightPriority:"bg-primary-gray border-transparent",lightParentGroupBasedHover:"bg-primary-gray border-transparent"},applyHoverStyles:{true:"",false:""}},defaultVariants:{color:"dark",applyHoverStyles:!0},compoundVariants:[{color:"dark",applyHoverStyles:!0,className:"hover:bg-primary-dark-gray"},{color:"lightNonPriority",applyHoverStyles:!0,className:"hover:bg-secondary-light-gray-as-transparent-overlay-over-primary-gray"},{color:"lightPriority",applyHoverStyles:!0,className:"hover:bg-primary-light-gray-as-transparent-overlay-over-primary-gray"},{color:"lightParentGroupBasedHover",applyHoverStyles:!0,className:"hover:bg-primary-light-gray-as-transparent-overlay-over-primary-gray group-hover/lightParentGroupBasedHover:bg-secondary-light-gray-as-transparent-overlay-over-primary-gray"}]}),An=z.forwardRef(({className:e,color:t,asChild:n=!1,applyHoverStyles:o,...s},a)=>{const l=n?Tw:"button";return T.jsx(l,{ref:a,"data-slot":"button",className:Ne(hb({color:t,className:e,applyHoverStyles:o})),...s})});An.displayName="Button";function Gl(e,t,n,o=!1,s=!1){if(t>n){const a=t;t=n,n=a}return(o?e>=t:e>t)&&(s?e<=n:e<n)}function dh(e,t,n=!1,o=!1){return Gl(e.x,t.left,t.right,n)&&Gl(e.y,t.top,t.bottom,o)}function hh(e){const t=e.startsWith("-"),n=e.replaceAll(/[^0-9\.]/g,""),o=n.indexOf(".");let s=0;if(o===-1)s=Number(n);else{const a=n.substring(0,o).replaceAll(/[^0-9]/g,""),l=n.substring(o+1).replaceAll(/[^0-9]/g,"");s=+(a+"."+l)}return t&&(s=-s),s}function Yl(e,t){return e.toFixed(t).replace(/[0]+$/,"").replace(/\.$/,"")}const cn=["string","number","complex","noEquivalent","inferFromConnection"],ph={[cn[0]]:cn[0],[cn[1]]:cn[1],[cn[2]]:cn[2],[cn[3]]:cn[3],[cn[4]]:cn[4]};function pb(e){return!!ph[e]}function gb(e){return e}function mb(e,t){return e in t}function yb(e){return e}function vb(e){return e}function xb(e){return e}var gh=Symbol.for("immer-nothing"),mh=Symbol.for("immer-draftable"),At=Symbol.for("immer-state"),wb=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function wt(e,...t){if(process.env.NODE_ENV!=="production"){const n=wb[e],o=typeof n=="function"?n.apply(null,t):n;throw new Error(`[Immer] ${o}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var qr=Object.getPrototypeOf;function Kr(e){return!!e&&!!e[At]}function xr(e){return e?yh(e)||Array.isArray(e)||!!e[mh]||!!e.constructor?.[mh]||jo(e)||ms(e):!1}var bb=Object.prototype.constructor.toString();function yh(e){if(!e||typeof e!="object")return!1;const t=qr(e);if(t===null)return!0;const n=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return n===Object?!0:typeof n=="function"&&Function.toString.call(n)===bb}function ps(e,t){gs(e)===0?Reflect.ownKeys(e).forEach(n=>{t(n,e[n],e)}):e.forEach((n,o)=>t(o,n,e))}function gs(e){const t=e[At];return t?t.type_:Array.isArray(e)?1:jo(e)?2:ms(e)?3:0}function Xl(e,t){return gs(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function vh(e,t,n){const o=gs(e);o===2?e.set(t,n):o===3?e.add(n):e[t]=n}function _b(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function jo(e){return e instanceof Map}function ms(e){return e instanceof Set}function wr(e){return e.copy_||e.base_}function ql(e,t){if(jo(e))return new Map(e);if(ms(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const n=yh(e);if(t===!0||t==="class_only"&&!n){const o=Object.getOwnPropertyDescriptors(e);delete o[At];let s=Reflect.ownKeys(o);for(let a=0;a<s.length;a++){const l=s[a],c=o[l];c.writable===!1&&(c.writable=!0,c.configurable=!0),(c.get||c.set)&&(o[l]={configurable:!0,writable:!0,enumerable:c.enumerable,value:e[l]})}return Object.create(qr(e),o)}else{const o=qr(e);if(o!==null&&n)return{...e};const s=Object.create(o);return Object.assign(s,e)}}function Kl(e,t=!1){return vs(e)||Kr(e)||!xr(e)||(gs(e)>1&&Object.defineProperties(e,{set:{value:ys},add:{value:ys},clear:{value:ys},delete:{value:ys}}),Object.freeze(e),t&&Object.values(e).forEach(n=>Kl(n,!0))),e}function ys(){wt(2)}function vs(e){return Object.isFrozen(e)}var Sb={};function br(e){const t=Sb[e];return t||wt(0,e),t}var Uo;function xh(){return Uo}function Eb(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function wh(e,t){t&&(br("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function Zl(e){Ql(e),e.drafts_.forEach(Cb),e.drafts_=null}function Ql(e){e===Uo&&(Uo=e.parent_)}function bh(e){return Uo=Eb(Uo,e)}function Cb(e){const t=e[At];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function _h(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];return e!==void 0&&e!==n?(n[At].modified_&&(Zl(t),wt(4)),xr(e)&&(e=xs(t,e),t.parent_||ws(t,e)),t.patches_&&br("Patches").generateReplacementPatches_(n[At].base_,e,t.patches_,t.inversePatches_)):e=xs(t,n,[]),Zl(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==gh?e:void 0}function xs(e,t,n){if(vs(t))return t;const o=t[At];if(!o)return ps(t,(s,a)=>Sh(e,o,t,s,a,n)),t;if(o.scope_!==e)return t;if(!o.modified_)return ws(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const s=o.copy_;let a=s,l=!1;o.type_===3&&(a=new Set(s),s.clear(),l=!0),ps(a,(c,f)=>Sh(e,o,s,c,f,n,l)),ws(e,s,!1),n&&e.patches_&&br("Patches").generatePatches_(o,n,e.patches_,e.inversePatches_)}return o.copy_}function Sh(e,t,n,o,s,a,l){if(process.env.NODE_ENV!=="production"&&s===n&&wt(5),Kr(s)){const c=a&&t&&t.type_!==3&&!Xl(t.assigned_,o)?a.concat(o):void 0,f=xs(e,s,c);if(vh(n,o,f),Kr(f))e.canAutoFreeze_=!1;else return}else l&&n.add(s);if(xr(s)&&!vs(s)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;xs(e,s),(!t||!t.scope_.parent_)&&typeof o!="symbol"&&(jo(n)?n.has(o):Object.prototype.propertyIsEnumerable.call(n,o))&&ws(e,s)}}function ws(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&Kl(t,n)}function Nb(e,t){const n=Array.isArray(e),o={type_:n?1:0,scope_:t?t.scope_:xh(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let s=o,a=Jl;n&&(s=[o],a=Go);const{revoke:l,proxy:c}=Proxy.revocable(s,a);return o.draft_=c,o.revoke_=l,c}var Jl={get(e,t){if(t===At)return e;const n=wr(e);if(!Xl(n,t))return Tb(e,n,t);const o=n[t];return e.finalized_||!xr(o)?o:o===ec(e.base_,t)?(nc(e),e.copy_[t]=rc(o,e)):o},has(e,t){return t in wr(e)},ownKeys(e){return Reflect.ownKeys(wr(e))},set(e,t,n){const o=Eh(wr(e),t);if(o?.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const s=ec(wr(e),t),a=s?.[At];if(a&&a.base_===n)return e.copy_[t]=n,e.assigned_[t]=!1,!0;if(_b(n,s)&&(n!==void 0||Xl(e.base_,t)))return!0;nc(e),tc(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_[t]=!0),!0},deleteProperty(e,t){return ec(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,nc(e),tc(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=wr(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:o.enumerable,value:n[t]}},defineProperty(){wt(11)},getPrototypeOf(e){return qr(e.base_)},setPrototypeOf(){wt(12)}},Go={};ps(Jl,(e,t)=>{Go[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),Go.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&wt(13),Go.set.call(this,e,t,void 0)},Go.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&wt(14),Jl.set.call(this,e[0],t,n,e[0])};function ec(e,t){const n=e[At];return(n?wr(n):e)[t]}function Tb(e,t,n){const o=Eh(t,n);return o?"value"in o?o.value:o.get?.call(e.draft_):void 0}function Eh(e,t){if(!(t in e))return;let n=qr(e);for(;n;){const o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=qr(n)}}function tc(e){e.modified_||(e.modified_=!0,e.parent_&&tc(e.parent_))}function nc(e){e.copy_||(e.copy_=ql(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Ab=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(t,n,o)=>{if(typeof t=="function"&&typeof n!="function"){const a=n;n=t;const l=this;return function(f=a,...d){return l.produce(f,h=>n.call(this,h,...d))}}typeof n!="function"&&wt(6),o!==void 0&&typeof o!="function"&&wt(7);let s;if(xr(t)){const a=bh(this),l=rc(t,void 0);let c=!0;try{s=n(l),c=!1}finally{c?Zl(a):Ql(a)}return wh(a,o),_h(s,a)}else if(!t||typeof t!="object"){if(s=n(t),s===void 0&&(s=t),s===gh&&(s=void 0),this.autoFreeze_&&Kl(s,!0),o){const a=[],l=[];br("Patches").generateReplacementPatches_(t,s,a,l),o(a,l)}return s}else wt(1,t)},this.produceWithPatches=(t,n)=>{if(typeof t=="function")return(l,...c)=>this.produceWithPatches(l,f=>t(f,...c));let o,s;return[this.produce(t,n,(l,c)=>{o=l,s=c}),o,s]},typeof e?.autoFreeze=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof e?.useStrictShallowCopy=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){xr(e)||wt(8),Kr(e)&&(e=Ib(e));const t=bh(this),n=rc(e,void 0);return n[At].isManual_=!0,Ql(t),n}finishDraft(e,t){const n=e&&e[At];(!n||!n.isManual_)&&wt(9);const{scope_:o}=n;return wh(o,t),_h(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const s=t[n];if(s.path.length===0&&s.op==="replace"){e=s.value;break}}n>-1&&(t=t.slice(n+1));const o=br("Patches").applyPatches_;return Kr(e)?o(e,t):this.produce(e,s=>o(s,t))}};function rc(e,t){const n=jo(e)?br("MapSet").proxyMap_(e,t):ms(e)?br("MapSet").proxySet_(e,t):Nb(e,t);return(t?t.scope_:xh()).drafts_.push(n),n}function Ib(e){return Kr(e)||wt(10,e),Ch(e)}function Ch(e){if(!xr(e)||vs(e))return e;const t=e[At];let n;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=ql(e,t.scope_.immer_.useStrictShallowCopy_)}else n=ql(e,!0);return ps(n,(o,s)=>{vh(n,o,Ch(s))}),t&&(t.finalized_=!1),n}var Ob=new Ab,Yo=Ob.produce;function un(e){const t=[];for(let o=0;o<Math.floor(e/8);o++)t.push(Math.random().toString(36).substring(2,10));return e%8>0&&t.push(Math.random().toString(36).substring(2,e%8+2)),t.join("")}function nt(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,o;n<e.length;n++)(o=nt(e[n]))!==""&&(t+=(t&&" ")+o);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var Pb={value:()=>{}};function bs(){for(var e=0,t=arguments.length,n={},o;e<t;++e){if(!(o=arguments[e]+"")||o in n||/[\s.]/.test(o))throw new Error("illegal type: "+o);n[o]=[]}return new _s(n)}function _s(e){this._=e}function kb(e,t){return e.trim().split(/^|\s+/).map(function(n){var o="",s=n.indexOf(".");if(s>=0&&(o=n.slice(s+1),n=n.slice(0,s)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:o}})}_s.prototype=bs.prototype={constructor:_s,on:function(e,t){var n=this._,o=kb(e+"",n),s,a=-1,l=o.length;if(arguments.length<2){for(;++a<l;)if((s=(e=o[a]).type)&&(s=Mb(n[s],e.name)))return s;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++a<l;)if(s=(e=o[a]).type)n[s]=Nh(n[s],e.name,t);else if(t==null)for(s in n)n[s]=Nh(n[s],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new _s(e)},call:function(e,t){if((s=arguments.length-2)>0)for(var n=new Array(s),o=0,s,a;o<s;++o)n[o]=arguments[o+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=this._[e],o=0,s=a.length;o<s;++o)a[o].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var o=this._[e],s=0,a=o.length;s<a;++s)o[s].value.apply(t,n)}};function Mb(e,t){for(var n=0,o=e.length,s;n<o;++n)if((s=e[n]).name===t)return s.value}function Nh(e,t,n){for(var o=0,s=e.length;o<s;++o)if(e[o].name===t){e[o]=Pb,e=e.slice(0,o).concat(e.slice(o+1));break}return n!=null&&e.push({name:t,value:n}),e}var oc="http://www.w3.org/1999/xhtml";const Th={svg:"http://www.w3.org/2000/svg",xhtml:oc,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Ss(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Th.hasOwnProperty(t)?{space:Th[t],local:e}:e}function Rb(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===oc&&t.documentElement.namespaceURI===oc?t.createElement(e):t.createElementNS(n,e)}}function Db(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Ah(e){var t=Ss(e);return(t.local?Db:Rb)(t)}function Lb(){}function ic(e){return e==null?Lb:function(){return this.querySelector(e)}}function $b(e){typeof e!="function"&&(e=ic(e));for(var t=this._groups,n=t.length,o=new Array(n),s=0;s<n;++s)for(var a=t[s],l=a.length,c=o[s]=new Array(l),f,d,h=0;h<l;++h)(f=a[h])&&(d=e.call(f,f.__data__,h,a))&&("__data__"in f&&(d.__data__=f.__data__),c[h]=d);return new It(o,this._parents)}function Bb(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Fb(){return[]}function Ih(e){return e==null?Fb:function(){return this.querySelectorAll(e)}}function Hb(e){return function(){return Bb(e.apply(this,arguments))}}function zb(e){typeof e=="function"?e=Hb(e):e=Ih(e);for(var t=this._groups,n=t.length,o=[],s=[],a=0;a<n;++a)for(var l=t[a],c=l.length,f,d=0;d<c;++d)(f=l[d])&&(o.push(e.call(f,f.__data__,d,l)),s.push(f));return new It(o,s)}function Oh(e){return function(){return this.matches(e)}}function Ph(e){return function(t){return t.matches(e)}}var Vb=Array.prototype.find;function Wb(e){return function(){return Vb.call(this.children,e)}}function jb(){return this.firstElementChild}function Ub(e){return this.select(e==null?jb:Wb(typeof e=="function"?e:Ph(e)))}var Gb=Array.prototype.filter;function Yb(){return Array.from(this.children)}function Xb(e){return function(){return Gb.call(this.children,e)}}function qb(e){return this.selectAll(e==null?Yb:Xb(typeof e=="function"?e:Ph(e)))}function Kb(e){typeof e!="function"&&(e=Oh(e));for(var t=this._groups,n=t.length,o=new Array(n),s=0;s<n;++s)for(var a=t[s],l=a.length,c=o[s]=[],f,d=0;d<l;++d)(f=a[d])&&e.call(f,f.__data__,d,a)&&c.push(f);return new It(o,this._parents)}function kh(e){return new Array(e.length)}function Zb(){return new It(this._enter||this._groups.map(kh),this._parents)}function Es(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}Es.prototype={constructor:Es,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Qb(e){return function(){return e}}function Jb(e,t,n,o,s,a){for(var l=0,c,f=t.length,d=a.length;l<d;++l)(c=t[l])?(c.__data__=a[l],o[l]=c):n[l]=new Es(e,a[l]);for(;l<f;++l)(c=t[l])&&(s[l]=c)}function e_(e,t,n,o,s,a,l){var c,f,d=new Map,h=t.length,g=a.length,p=new Array(h),m;for(c=0;c<h;++c)(f=t[c])&&(p[c]=m=l.call(f,f.__data__,c,t)+"",d.has(m)?s[c]=f:d.set(m,f));for(c=0;c<g;++c)m=l.call(e,a[c],c,a)+"",(f=d.get(m))?(o[c]=f,f.__data__=a[c],d.delete(m)):n[c]=new Es(e,a[c]);for(c=0;c<h;++c)(f=t[c])&&d.get(p[c])===f&&(s[c]=f)}function t_(e){return e.__data__}function n_(e,t){if(!arguments.length)return Array.from(this,t_);var n=t?e_:Jb,o=this._parents,s=this._groups;typeof e!="function"&&(e=Qb(e));for(var a=s.length,l=new Array(a),c=new Array(a),f=new Array(a),d=0;d<a;++d){var h=o[d],g=s[d],p=g.length,m=r_(e.call(h,h&&h.__data__,d,o)),x=m.length,v=c[d]=new Array(x),b=l[d]=new Array(x),_=f[d]=new Array(p);n(h,g,v,b,_,m,t);for(var N=0,w=0,E,O;N<x;++N)if(E=v[N]){for(N>=w&&(w=N+1);!(O=b[w])&&++w<x;);E._next=O||null}}return l=new It(l,o),l._enter=c,l._exit=f,l}function r_(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function o_(){return new It(this._exit||this._groups.map(kh),this._parents)}function i_(e,t,n){var o=this.enter(),s=this,a=this.exit();return typeof e=="function"?(o=e(o),o&&(o=o.selection())):o=o.append(e+""),t!=null&&(s=t(s),s&&(s=s.selection())),n==null?a.remove():n(a),o&&s?o.merge(s).order():s}function s_(e){for(var t=e.selection?e.selection():e,n=this._groups,o=t._groups,s=n.length,a=o.length,l=Math.min(s,a),c=new Array(s),f=0;f<l;++f)for(var d=n[f],h=o[f],g=d.length,p=c[f]=new Array(g),m,x=0;x<g;++x)(m=d[x]||h[x])&&(p[x]=m);for(;f<s;++f)c[f]=n[f];return new It(c,this._parents)}function a_(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var o=e[t],s=o.length-1,a=o[s],l;--s>=0;)(l=o[s])&&(a&&l.compareDocumentPosition(a)^4&&a.parentNode.insertBefore(l,a),a=l);return this}function l_(e){e||(e=c_);function t(g,p){return g&&p?e(g.__data__,p.__data__):!g-!p}for(var n=this._groups,o=n.length,s=new Array(o),a=0;a<o;++a){for(var l=n[a],c=l.length,f=s[a]=new Array(c),d,h=0;h<c;++h)(d=l[h])&&(f[h]=d);f.sort(t)}return new It(s,this._parents).order()}function c_(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function u_(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function f_(){return Array.from(this)}function d_(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],s=0,a=o.length;s<a;++s){var l=o[s];if(l)return l}return null}function h_(){let e=0;for(const t of this)++e;return e}function p_(){return!this.node()}function g_(e){for(var t=this._groups,n=0,o=t.length;n<o;++n)for(var s=t[n],a=0,l=s.length,c;a<l;++a)(c=s[a])&&e.call(c,c.__data__,a,s);return this}function m_(e){return function(){this.removeAttribute(e)}}function y_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function v_(e,t){return function(){this.setAttribute(e,t)}}function x_(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function w_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function b_(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function __(e,t){var n=Ss(e);if(arguments.length<2){var o=this.node();return n.local?o.getAttributeNS(n.space,n.local):o.getAttribute(n)}return this.each((t==null?n.local?y_:m_:typeof t=="function"?n.local?b_:w_:n.local?x_:v_)(n,t))}function Mh(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function S_(e){return function(){this.style.removeProperty(e)}}function E_(e,t,n){return function(){this.style.setProperty(e,t,n)}}function C_(e,t,n){return function(){var o=t.apply(this,arguments);o==null?this.style.removeProperty(e):this.style.setProperty(e,o,n)}}function N_(e,t,n){return arguments.length>1?this.each((t==null?S_:typeof t=="function"?C_:E_)(e,t,n??"")):Zr(this.node(),e)}function Zr(e,t){return e.style.getPropertyValue(t)||Mh(e).getComputedStyle(e,null).getPropertyValue(t)}function T_(e){return function(){delete this[e]}}function A_(e,t){return function(){this[e]=t}}function I_(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function O_(e,t){return arguments.length>1?this.each((t==null?T_:typeof t=="function"?I_:A_)(e,t)):this.node()[e]}function Rh(e){return e.trim().split(/^|\s+/)}function sc(e){return e.classList||new Dh(e)}function Dh(e){this._node=e,this._names=Rh(e.getAttribute("class")||"")}Dh.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 Lh(e,t){for(var n=sc(e),o=-1,s=t.length;++o<s;)n.add(t[o])}function $h(e,t){for(var n=sc(e),o=-1,s=t.length;++o<s;)n.remove(t[o])}function P_(e){return function(){Lh(this,e)}}function k_(e){return function(){$h(this,e)}}function M_(e,t){return function(){(t.apply(this,arguments)?Lh:$h)(this,e)}}function R_(e,t){var n=Rh(e+"");if(arguments.length<2){for(var o=sc(this.node()),s=-1,a=n.length;++s<a;)if(!o.contains(n[s]))return!1;return!0}return this.each((typeof t=="function"?M_:t?P_:k_)(n,t))}function D_(){this.textContent=""}function L_(e){return function(){this.textContent=e}}function $_(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function B_(e){return arguments.length?this.each(e==null?D_:(typeof e=="function"?$_:L_)(e)):this.node().textContent}function F_(){this.innerHTML=""}function H_(e){return function(){this.innerHTML=e}}function z_(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function V_(e){return arguments.length?this.each(e==null?F_:(typeof e=="function"?z_:H_)(e)):this.node().innerHTML}function W_(){this.nextSibling&&this.parentNode.appendChild(this)}function j_(){return this.each(W_)}function U_(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function G_(){return this.each(U_)}function Y_(e){var t=typeof e=="function"?e:Ah(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function X_(){return null}function q_(e,t){var n=typeof e=="function"?e:Ah(e),o=t==null?X_:typeof t=="function"?t:ic(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),o.apply(this,arguments)||null)})}function K_(){var e=this.parentNode;e&&e.removeChild(this)}function Z_(){return this.each(K_)}function Q_(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function J_(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function e1(e){return this.select(e?J_:Q_)}function t1(e){return arguments.length?this.property("__data__",e):this.node().__data__}function n1(e){return function(t){e.call(this,t,this.__data__)}}function r1(e){return e.trim().split(/^|\s+/).map(function(t){var n="",o=t.indexOf(".");return o>=0&&(n=t.slice(o+1),t=t.slice(0,o)),{type:t,name:n}})}function o1(e){return function(){var t=this.__on;if(t){for(var n=0,o=-1,s=t.length,a;n<s;++n)a=t[n],(!e.type||a.type===e.type)&&a.name===e.name?this.removeEventListener(a.type,a.listener,a.options):t[++o]=a;++o?t.length=o:delete this.__on}}}function i1(e,t,n){return function(){var o=this.__on,s,a=n1(t);if(o){for(var l=0,c=o.length;l<c;++l)if((s=o[l]).type===e.type&&s.name===e.name){this.removeEventListener(s.type,s.listener,s.options),this.addEventListener(s.type,s.listener=a,s.options=n),s.value=t;return}}this.addEventListener(e.type,a,n),s={type:e.type,name:e.name,value:t,listener:a,options:n},o?o.push(s):this.__on=[s]}}function s1(e,t,n){var o=r1(e+""),s,a=o.length,l;if(arguments.length<2){var c=this.node().__on;if(c){for(var f=0,d=c.length,h;f<d;++f)for(s=0,h=c[f];s<a;++s)if((l=o[s]).type===h.type&&l.name===h.name)return h.value}return}for(c=t?i1:o1,s=0;s<a;++s)this.each(c(o[s],t,n));return this}function Bh(e,t,n){var o=Mh(e),s=o.CustomEvent;typeof s=="function"?s=new s(t,n):(s=o.document.createEvent("Event"),n?(s.initEvent(t,n.bubbles,n.cancelable),s.detail=n.detail):s.initEvent(t,!1,!1)),e.dispatchEvent(s)}function a1(e,t){return function(){return Bh(this,e,t)}}function l1(e,t){return function(){return Bh(this,e,t.apply(this,arguments))}}function c1(e,t){return this.each((typeof t=="function"?l1:a1)(e,t))}function*u1(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var o=e[t],s=0,a=o.length,l;s<a;++s)(l=o[s])&&(yield l)}var Fh=[null];function It(e,t){this._groups=e,this._parents=t}function Xo(){return new It([[document.documentElement]],Fh)}function f1(){return this}It.prototype=Xo.prototype={constructor:It,select:$b,selectAll:zb,selectChild:Ub,selectChildren:qb,filter:Kb,data:n_,enter:Zb,exit:o_,join:i_,merge:s_,selection:f1,order:a_,sort:l_,call:u_,nodes:f_,node:d_,size:h_,empty:p_,each:g_,attr:__,style:N_,property:O_,classed:R_,text:B_,html:V_,raise:j_,lower:G_,append:Y_,insert:q_,remove:Z_,clone:e1,datum:t1,on:s1,dispatch:c1,[Symbol.iterator]:u1};function Ot(e){return typeof e=="string"?new It([[document.querySelector(e)]],[document.documentElement]):new It([[e]],Fh)}function d1(e){let t;for(;t=e.sourceEvent;)e=t;return e}function Kt(e,t){if(e=d1(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var o=n.createSVGPoint();return o.x=e.clientX,o.y=e.clientY,o=o.matrixTransform(t.getScreenCTM().inverse()),[o.x,o.y]}if(t.getBoundingClientRect){var s=t.getBoundingClientRect();return[e.clientX-s.left-t.clientLeft,e.clientY-s.top-t.clientTop]}}return[e.pageX,e.pageY]}const h1={passive:!1},qo={capture:!0,passive:!1};function ac(e){e.stopImmediatePropagation()}function Qr(e){e.preventDefault(),e.stopImmediatePropagation()}function Hh(e){var t=e.document.documentElement,n=Ot(e).on("dragstart.drag",Qr,qo);"onselectstart"in t?n.on("selectstart.drag",Qr,qo):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function zh(e,t){var n=e.document.documentElement,o=Ot(e).on("dragstart.drag",null);t&&(o.on("click.drag",Qr,qo),setTimeout(function(){o.on("click.drag",null)},0)),"onselectstart"in n?o.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const Cs=e=>()=>e;function lc(e,{sourceEvent:t,subject:n,target:o,identifier:s,active:a,x:l,y:c,dx:f,dy:d,dispatch:h}){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:o,enumerable:!0,configurable:!0},identifier:{value:s,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:c,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:d,enumerable:!0,configurable:!0},_:{value:h}})}lc.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function p1(e){return!e.ctrlKey&&!e.button}function g1(){return this.parentNode}function m1(e,t){return t??{x:e.x,y:e.y}}function y1(){return navigator.maxTouchPoints||"ontouchstart"in this}function Vh(){var e=p1,t=g1,n=m1,o=y1,s={},a=bs("start","drag","end"),l=0,c,f,d,h,g=0;function p(E){E.on("mousedown.drag",m).filter(o).on("touchstart.drag",b).on("touchmove.drag",_,h1).on("touchend.drag touchcancel.drag",N).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function m(E,O){if(!(h||!e.call(this,E,O))){var k=w(this,t.call(this,E,O),E,O,"mouse");k&&(Ot(E.view).on("mousemove.drag",x,qo).on("mouseup.drag",v,qo),Hh(E.view),ac(E),d=!1,c=E.clientX,f=E.clientY,k("start",E))}}function x(E){if(Qr(E),!d){var O=E.clientX-c,k=E.clientY-f;d=O*O+k*k>g}s.mouse("drag",E)}function v(E){Ot(E.view).on("mousemove.drag mouseup.drag",null),zh(E.view,d),Qr(E),s.mouse("end",E)}function b(E,O){if(e.call(this,E,O)){var k=E.changedTouches,M=t.call(this,E,O),D=k.length,V,K;for(V=0;V<D;++V)(K=w(this,M,E,O,k[V].identifier,k[V]))&&(ac(E),K("start",E,k[V]))}}function _(E){var O=E.changedTouches,k=O.length,M,D;for(M=0;M<k;++M)(D=s[O[M].identifier])&&(Qr(E),D("drag",E,O[M]))}function N(E){var O=E.changedTouches,k=O.length,M,D;for(h&&clearTimeout(h),h=setTimeout(function(){h=null},500),M=0;M<k;++M)(D=s[O[M].identifier])&&(ac(E),D("end",E,O[M]))}function w(E,O,k,M,D,V){var K=a.copy(),Z=Kt(V||k,O),U,q,C;if((C=n.call(E,new lc("beforestart",{sourceEvent:k,target:p,identifier:D,active:l,x:Z[0],y:Z[1],dx:0,dy:0,dispatch:K}),M))!=null)return U=C.x-Z[0]||0,q=C.y-Z[1]||0,function H(B,R,P){var W=Z,$;switch(B){case"start":s[D]=H,$=l++;break;case"end":delete s[D],--l;case"drag":Z=Kt(P||R,O),$=l;break}K.call(B,E,new lc(B,{sourceEvent:R,subject:C,target:p,identifier:D,active:$,x:Z[0]+U,y:Z[1]+q,dx:Z[0]-W[0],dy:Z[1]-W[1],dispatch:K}),M)}}return p.filter=function(E){return arguments.length?(e=typeof E=="function"?E:Cs(!!E),p):e},p.container=function(E){return arguments.length?(t=typeof E=="function"?E:Cs(E),p):t},p.subject=function(E){return arguments.length?(n=typeof E=="function"?E:Cs(E),p):n},p.touchable=function(E){return arguments.length?(o=typeof E=="function"?E:Cs(!!E),p):o},p.on=function(){var E=a.on.apply(a,arguments);return E===a?p:E},p.clickDistance=function(E){return arguments.length?(g=(E=+E)*E,p):Math.sqrt(g)},p}function cc(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Wh(e,t){var n=Object.create(e.prototype);for(var o in t)n[o]=t[o];return n}function Ko(){}var Zo=.7,Ns=1/Zo,Jr="\\s*([+-]?\\d+)\\s*",Qo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",fn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",v1=/^#([0-9a-f]{3,8})$/,x1=new RegExp(`^rgb\\(${Jr},${Jr},${Jr}\\)$`),w1=new RegExp(`^rgb\\(${fn},${fn},${fn}\\)$`),b1=new RegExp(`^rgba\\(${Jr},${Jr},${Jr},${Qo}\\)$`),_1=new RegExp(`^rgba\\(${fn},${fn},${fn},${Qo}\\)$`),S1=new RegExp(`^hsl\\(${Qo},${fn},${fn}\\)$`),E1=new RegExp(`^hsla\\(${Qo},${fn},${fn},${Qo}\\)$`),jh={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};cc(Ko,_r,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Uh,formatHex:Uh,formatHex8:C1,formatHsl:N1,formatRgb:Gh,toString:Gh});function Uh(){return this.rgb().formatHex()}function C1(){return this.rgb().formatHex8()}function N1(){return Zh(this).formatHsl()}function Gh(){return this.rgb().formatRgb()}function _r(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=v1.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?Yh(t):n===3?new bt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Ts(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Ts(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=x1.exec(e))?new bt(t[1],t[2],t[3],1):(t=w1.exec(e))?new bt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=b1.exec(e))?Ts(t[1],t[2],t[3],t[4]):(t=_1.exec(e))?Ts(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=S1.exec(e))?Kh(t[1],t[2]/100,t[3]/100,1):(t=E1.exec(e))?Kh(t[1],t[2]/100,t[3]/100,t[4]):jh.hasOwnProperty(e)?Yh(jh[e]):e==="transparent"?new bt(NaN,NaN,NaN,0):null}function Yh(e){return new bt(e>>16&255,e>>8&255,e&255,1)}function Ts(e,t,n,o){return o<=0&&(e=t=n=NaN),new bt(e,t,n,o)}function T1(e){return e instanceof Ko||(e=_r(e)),e?(e=e.rgb(),new bt(e.r,e.g,e.b,e.opacity)):new bt}function uc(e,t,n,o){return arguments.length===1?T1(e):new bt(e,t,n,o??1)}function bt(e,t,n,o){this.r=+e,this.g=+t,this.b=+n,this.opacity=+o}cc(bt,uc,Wh(Ko,{brighter(e){return e=e==null?Ns:Math.pow(Ns,e),new bt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Zo:Math.pow(Zo,e),new bt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new bt(Sr(this.r),Sr(this.g),Sr(this.b),As(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:Xh,formatHex:Xh,formatHex8:A1,formatRgb:qh,toString:qh}));function Xh(){return`#${Er(this.r)}${Er(this.g)}${Er(this.b)}`}function A1(){return`#${Er(this.r)}${Er(this.g)}${Er(this.b)}${Er((isNaN(this.opacity)?1:this.opacity)*255)}`}function qh(){const e=As(this.opacity);return`${e===1?"rgb(":"rgba("}${Sr(this.r)}, ${Sr(this.g)}, ${Sr(this.b)}${e===1?")":`, ${e})`}`}function As(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Sr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Er(e){return e=Sr(e),(e<16?"0":"")+e.toString(16)}function Kh(e,t,n,o){return o<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Zt(e,t,n,o)}function Zh(e){if(e instanceof Zt)return new Zt(e.h,e.s,e.l,e.opacity);if(e instanceof Ko||(e=_r(e)),!e)return new Zt;if(e instanceof Zt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,o=e.b/255,s=Math.min(t,n,o),a=Math.max(t,n,o),l=NaN,c=a-s,f=(a+s)/2;return c?(t===a?l=(n-o)/c+(n<o)*6:n===a?l=(o-t)/c+2:l=(t-n)/c+4,c/=f<.5?a+s:2-a-s,l*=60):c=f>0&&f<1?0:l,new Zt(l,c,f,e.opacity)}function I1(e,t,n,o){return arguments.length===1?Zh(e):new Zt(e,t,n,o??1)}function Zt(e,t,n,o){this.h=+e,this.s=+t,this.l=+n,this.opacity=+o}cc(Zt,I1,Wh(Ko,{brighter(e){return e=e==null?Ns:Math.pow(Ns,e),new Zt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Zo:Math.pow(Zo,e),new Zt(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,o=n+(n<.5?n:1-n)*t,s=2*n-o;return new bt(fc(e>=240?e-240:e+120,s,o),fc(e,s,o),fc(e<120?e+240:e-120,s,o),this.opacity)},clamp(){return new Zt(Qh(this.h),Is(this.s),Is(this.l),As(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=As(this.opacity);return`${e===1?"hsl(":"hsla("}${Qh(this.h)}, ${Is(this.s)*100}%, ${Is(this.l)*100}%${e===1?")":`, ${e})`}`}}));function Qh(e){return e=(e||0)%360,e<0?e+360:e}function Is(e){return Math.max(0,Math.min(1,e||0))}function fc(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 dc=e=>()=>e;function O1(e,t){return function(n){return e+n*t}}function P1(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(o){return Math.pow(e+o*t,n)}}function k1(e){return(e=+e)==1?Jh:function(t,n){return n-t?P1(t,n,e):dc(isNaN(t)?n:t)}}function Jh(e,t){var n=t-e;return n?O1(e,n):dc(isNaN(e)?t:e)}const Os=function e(t){var n=k1(t);function o(s,a){var l=n((s=uc(s)).r,(a=uc(a)).r),c=n(s.g,a.g),f=n(s.b,a.b),d=Jh(s.opacity,a.opacity);return function(h){return s.r=l(h),s.g=c(h),s.b=f(h),s.opacity=d(h),s+""}}return o.gamma=e,o}(1);function M1(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,o=t.slice(),s;return function(a){for(s=0;s<n;++s)o[s]=e[s]*(1-a)+t[s]*a;return o}}function R1(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function D1(e,t){var n=t?t.length:0,o=e?Math.min(n,e.length):0,s=new Array(o),a=new Array(n),l;for(l=0;l<o;++l)s[l]=Jo(e[l],t[l]);for(;l<n;++l)a[l]=t[l];return function(c){for(l=0;l<o;++l)a[l]=s[l](c);return a}}function L1(e,t){var n=new Date;return e=+e,t=+t,function(o){return n.setTime(e*(1-o)+t*o),n}}function dn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function $1(e,t){var n={},o={},s;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(s in t)s in e?n[s]=Jo(e[s],t[s]):o[s]=t[s];return function(a){for(s in n)o[s]=n[s](a);return o}}var hc=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,pc=new RegExp(hc.source,"g");function B1(e){return function(){return e}}function F1(e){return function(t){return e(t)+""}}function ep(e,t){var n=hc.lastIndex=pc.lastIndex=0,o,s,a,l=-1,c=[],f=[];for(e=e+"",t=t+"";(o=hc.exec(e))&&(s=pc.exec(t));)(a=s.index)>n&&(a=t.slice(n,a),c[l]?c[l]+=a:c[++l]=a),(o=o[0])===(s=s[0])?c[l]?c[l]+=s:c[++l]=s:(c[++l]=null,f.push({i:l,x:dn(o,s)})),n=pc.lastIndex;return n<t.length&&(a=t.slice(n),c[l]?c[l]+=a:c[++l]=a),c.length<2?f[0]?F1(f[0].x):B1(t):(t=f.length,function(d){for(var h=0,g;h<t;++h)c[(g=f[h]).i]=g.x(d);return c.join("")})}function Jo(e,t){var n=typeof t,o;return t==null||n==="boolean"?dc(t):(n==="number"?dn:n==="string"?(o=_r(t))?(t=o,Os):ep:t instanceof _r?Os:t instanceof Date?L1:R1(t)?M1:Array.isArray(t)?D1:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?$1:dn)(e,t)}var tp=180/Math.PI,gc={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function np(e,t,n,o,s,a){var l,c,f;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(f=e*n+t*o)&&(n-=e*f,o-=t*f),(c=Math.sqrt(n*n+o*o))&&(n/=c,o/=c,f/=c),e*o<t*n&&(e=-e,t=-t,f=-f,l=-l),{translateX:s,translateY:a,rotate:Math.atan2(t,e)*tp,skewX:Math.atan(f)*tp,scaleX:l,scaleY:c}}var Ps;function H1(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?gc:np(t.a,t.b,t.c,t.d,t.e,t.f)}function z1(e){return e==null||(Ps||(Ps=document.createElementNS("http://www.w3.org/2000/svg","g")),Ps.setAttribute("transform",e),!(e=Ps.transform.baseVal.consolidate()))?gc:(e=e.matrix,np(e.a,e.b,e.c,e.d,e.e,e.f))}function rp(e,t,n,o){function s(d){return d.length?d.pop()+" ":""}function a(d,h,g,p,m,x){if(d!==g||h!==p){var v=m.push("translate(",null,t,null,n);x.push({i:v-4,x:dn(d,g)},{i:v-2,x:dn(h,p)})}else(g||p)&&m.push("translate("+g+t+p+n)}function l(d,h,g,p){d!==h?(d-h>180?h+=360:h-d>180&&(d+=360),p.push({i:g.push(s(g)+"rotate(",null,o)-2,x:dn(d,h)})):h&&g.push(s(g)+"rotate("+h+o)}function c(d,h,g,p){d!==h?p.push({i:g.push(s(g)+"skewX(",null,o)-2,x:dn(d,h)}):h&&g.push(s(g)+"skewX("+h+o)}function f(d,h,g,p,m,x){if(d!==g||h!==p){var v=m.push(s(m)+"scale(",null,",",null,")");x.push({i:v-4,x:dn(d,g)},{i:v-2,x:dn(h,p)})}else(g!==1||p!==1)&&m.push(s(m)+"scale("+g+","+p+")")}return function(d,h){var g=[],p=[];return d=e(d),h=e(h),a(d.translateX,d.translateY,h.translateX,h.translateY,g,p),l(d.rotate,h.rotate,g,p),c(d.skewX,h.skewX,g,p),f(d.scaleX,d.scaleY,h.scaleX,h.scaleY,g,p),d=h=null,function(m){for(var x=-1,v=p.length,b;++x<v;)g[(b=p[x]).i]=b.x(m);return g.join("")}}}var V1=rp(H1,"px, ","px)","deg)"),W1=rp(z1,", ",")",")"),j1=1e-12;function op(e){return((e=Math.exp(e))+1/e)/2}function U1(e){return((e=Math.exp(e))-1/e)/2}function G1(e){return((e=Math.exp(2*e))-1)/(e+1)}const ks=function e(t,n,o){function s(a,l){var c=a[0],f=a[1],d=a[2],h=l[0],g=l[1],p=l[2],m=h-c,x=g-f,v=m*m+x*x,b,_;if(v<j1)_=Math.log(p/d)/t,b=function(M){return[c+M*m,f+M*x,d*Math.exp(t*M*_)]};else{var N=Math.sqrt(v),w=(p*p-d*d+o*v)/(2*d*n*N),E=(p*p-d*d-o*v)/(2*p*n*N),O=Math.log(Math.sqrt(w*w+1)-w),k=Math.log(Math.sqrt(E*E+1)-E);_=(k-O)/t,b=function(M){var D=M*_,V=op(O),K=d/(n*N)*(V*G1(t*D+O)-U1(O));return[c+K*m,f+K*x,d*V/op(t*D+O)]}}return b.duration=_*1e3*t/Math.SQRT2,b}return s.rho=function(a){var l=Math.max(.001,+a),c=l*l,f=c*c;return e(l,c,f)},s}(Math.SQRT2,2,4);var eo=0,ei=0,ti=0,ip=1e3,Ms,ni,Rs=0,Cr=0,Ds=0,ri=typeof performance=="object"&&performance.now?performance:Date,sp=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function mc(){return Cr||(sp(Y1),Cr=ri.now()+Ds)}function Y1(){Cr=0}function Ls(){this._call=this._time=this._next=null}Ls.prototype=ap.prototype={constructor:Ls,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?mc():+n)+(t==null?0:+t),!this._next&&ni!==this&&(ni?ni._next=this:Ms=this,ni=this),this._call=e,this._time=n,yc()},stop:function(){this._call&&(this._call=null,this._time=1/0,yc())}};function ap(e,t,n){var o=new Ls;return o.restart(e,t,n),o}function X1(){mc(),++eo;for(var e=Ms,t;e;)(t=Cr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--eo}function lp(){Cr=(Rs=ri.now())+Ds,eo=ei=0;try{X1()}finally{eo=0,K1(),Cr=0}}function q1(){var e=ri.now(),t=e-Rs;t>ip&&(Ds-=t,Rs=e)}function K1(){for(var e,t=Ms,n,o=1/0;t;)t._call?(o>t._time&&(o=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Ms=n);ni=e,yc(o)}function yc(e){if(!eo){ei&&(ei=clearTimeout(ei));var t=e-Cr;t>24?(e<1/0&&(ei=setTimeout(lp,e-ri.now()-Ds)),ti&&(ti=clearInterval(ti))):(ti||(Rs=ri.now(),ti=setInterval(q1,ip)),eo=1,sp(lp))}}function cp(e,t,n){var o=new Ls;return t=t==null?0:+t,o.restart(s=>{o.stop(),e(s+t)},t,n),o}var Z1=bs("start","end","cancel","interrupt"),Q1=[],up=0,fp=1,vc=2,$s=3,dp=4,xc=5,Bs=6;function Fs(e,t,n,o,s,a){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;J1(e,n,{name:t,index:o,group:s,on:Z1,tween:Q1,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:up})}function wc(e,t){var n=Qt(e,t);if(n.state>up)throw new Error("too late; already scheduled");return n}function hn(e,t){var n=Qt(e,t);if(n.state>$s)throw new Error("too late; already running");return n}function Qt(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function J1(e,t,n){var o=e.__transition,s;o[t]=n,n.timer=ap(a,0,n.time);function a(d){n.state=fp,n.timer.restart(l,n.delay,n.time),n.delay<=d&&l(d-n.delay)}function l(d){var h,g,p,m;if(n.state!==fp)return f();for(h in o)if(m=o[h],m.name===n.name){if(m.state===$s)return cp(l);m.state===dp?(m.state=Bs,m.timer.stop(),m.on.call("interrupt",e,e.__data__,m.index,m.group),delete o[h]):+h<t&&(m.state=Bs,m.timer.stop(),m.on.call("cancel",e,e.__data__,m.index,m.group),delete o[h])}if(cp(function(){n.state===$s&&(n.state=dp,n.timer.restart(c,n.delay,n.time),c(d))}),n.state=vc,n.on.call("start",e,e.__data__,n.index,n.group),n.state===vc){for(n.state=$s,s=new Array(p=n.tween.length),h=0,g=-1;h<p;++h)(m=n.tween[h].value.call(e,e.__data__,n.index,n.group))&&(s[++g]=m);s.length=g+1}}function c(d){for(var h=d<n.duration?n.ease.call(null,d/n.duration):(n.timer.restart(f),n.state=xc,1),g=-1,p=s.length;++g<p;)s[g].call(e,h);n.state===xc&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=Bs,n.timer.stop(),delete o[t];for(var d in o)return;delete e.__transition}}function Hs(e,t){var n=e.__transition,o,s,a=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((o=n[l]).name!==t){a=!1;continue}s=o.state>vc&&o.state<xc,o.state=Bs,o.timer.stop(),o.on.call(s?"interrupt":"cancel",e,e.__data__,o.index,o.group),delete n[l]}a&&delete e.__transition}}function eS(e){return this.each(function(){Hs(this,e)})}function tS(e,t){var n,o;return function(){var s=hn(this,e),a=s.tween;if(a!==n){o=n=a;for(var l=0,c=o.length;l<c;++l)if(o[l].name===t){o=o.slice(),o.splice(l,1);break}}s.tween=o}}function nS(e,t,n){var o,s;if(typeof n!="function")throw new Error;return function(){var a=hn(this,e),l=a.tween;if(l!==o){s=(o=l).slice();for(var c={name:t,value:n},f=0,d=s.length;f<d;++f)if(s[f].name===t){s[f]=c;break}f===d&&s.push(c)}a.tween=s}}function rS(e,t){var n=this._id;if(e+="",arguments.length<2){for(var o=Qt(this.node(),n).tween,s=0,a=o.length,l;s<a;++s)if((l=o[s]).name===e)return l.value;return null}return this.each((t==null?tS:nS)(n,e,t))}function bc(e,t,n){var o=e._id;return e.each(function(){var s=hn(this,o);(s.value||(s.value={}))[t]=n.apply(this,arguments)}),function(s){return Qt(s,o).value[t]}}function hp(e,t){var n;return(typeof t=="number"?dn:t instanceof _r?Os:(n=_r(t))?(t=n,Os):ep)(e,t)}function oS(e){return function(){this.removeAttribute(e)}}function iS(e){return function(){this.removeAttributeNS(e.space,e.local)}}function sS(e,t,n){var o,s=n+"",a;return function(){var l=this.getAttribute(e);return l===s?null:l===o?a:a=t(o=l,n)}}function aS(e,t,n){var o,s=n+"",a;return function(){var l=this.getAttributeNS(e.space,e.local);return l===s?null:l===o?a:a=t(o=l,n)}}function lS(e,t,n){var o,s,a;return function(){var l,c=n(this),f;return c==null?void this.removeAttribute(e):(l=this.getAttribute(e),f=c+"",l===f?null:l===o&&f===s?a:(s=f,a=t(o=l,c)))}}function cS(e,t,n){var o,s,a;return function(){var l,c=n(this),f;return c==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),f=c+"",l===f?null:l===o&&f===s?a:(s=f,a=t(o=l,c)))}}function uS(e,t){var n=Ss(e),o=n==="transform"?W1:hp;return this.attrTween(e,typeof t=="function"?(n.local?cS:lS)(n,o,bc(this,"attr."+e,t)):t==null?(n.local?iS:oS)(n):(n.local?aS:sS)(n,o,t))}function fS(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function dS(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function hS(e,t){var n,o;function s(){var a=t.apply(this,arguments);return a!==o&&(n=(o=a)&&dS(e,a)),n}return s._value=t,s}function pS(e,t){var n,o;function s(){var a=t.apply(this,arguments);return a!==o&&(n=(o=a)&&fS(e,a)),n}return s._value=t,s}function gS(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var o=Ss(e);return this.tween(n,(o.local?hS:pS)(o,t))}function mS(e,t){return function(){wc(this,e).delay=+t.apply(this,arguments)}}function yS(e,t){return t=+t,function(){wc(this,e).delay=t}}function vS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?mS:yS)(t,e)):Qt(this.node(),t).delay}function xS(e,t){return function(){hn(this,e).duration=+t.apply(this,arguments)}}function wS(e,t){return t=+t,function(){hn(this,e).duration=t}}function bS(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?xS:wS)(t,e)):Qt(this.node(),t).duration}function _S(e,t){if(typeof t!="function")throw new Error;return function(){hn(this,e).ease=t}}function SS(e){var t=this._id;return arguments.length?this.each(_S(t,e)):Qt(this.node(),t).ease}function ES(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;hn(this,e).ease=n}}function CS(e){if(typeof e!="function")throw new Error;return this.each(ES(this._id,e))}function NS(e){typeof e!="function"&&(e=Oh(e));for(var t=this._groups,n=t.length,o=new Array(n),s=0;s<n;++s)for(var a=t[s],l=a.length,c=o[s]=[],f,d=0;d<l;++d)(f=a[d])&&e.call(f,f.__data__,d,a)&&c.push(f);return new In(o,this._parents,this._name,this._id)}function TS(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,o=t.length,s=n.length,a=Math.min(o,s),l=new Array(o),c=0;c<a;++c)for(var f=t[c],d=n[c],h=f.length,g=l[c]=new Array(h),p,m=0;m<h;++m)(p=f[m]||d[m])&&(g[m]=p);for(;c<o;++c)l[c]=t[c];return new In(l,this._parents,this._name,this._id)}function AS(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function IS(e,t,n){var o,s,a=AS(t)?wc:hn;return function(){var l=a(this,e),c=l.on;c!==o&&(s=(o=c).copy()).on(t,n),l.on=s}}function OS(e,t){var n=this._id;return arguments.length<2?Qt(this.node(),n).on.on(e):this.each(IS(n,e,t))}function PS(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function kS(){return this.on("end.remove",PS(this._id))}function MS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=ic(e));for(var o=this._groups,s=o.length,a=new Array(s),l=0;l<s;++l)for(var c=o[l],f=c.length,d=a[l]=new Array(f),h,g,p=0;p<f;++p)(h=c[p])&&(g=e.call(h,h.__data__,p,c))&&("__data__"in h&&(g.__data__=h.__data__),d[p]=g,Fs(d[p],t,n,p,d,Qt(h,n)));return new In(a,this._parents,t,n)}function RS(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Ih(e));for(var o=this._groups,s=o.length,a=[],l=[],c=0;c<s;++c)for(var f=o[c],d=f.length,h,g=0;g<d;++g)if(h=f[g]){for(var p=e.call(h,h.__data__,g,f),m,x=Qt(h,n),v=0,b=p.length;v<b;++v)(m=p[v])&&Fs(m,t,n,v,p,x);a.push(p),l.push(h)}return new In(a,l,t,n)}var DS=Xo.prototype.constructor;function LS(){return new DS(this._groups,this._parents)}function $S(e,t){var n,o,s;return function(){var a=Zr(this,e),l=(this.style.removeProperty(e),Zr(this,e));return a===l?null:a===n&&l===o?s:s=t(n=a,o=l)}}function pp(e){return function(){this.style.removeProperty(e)}}function BS(e,t,n){var o,s=n+"",a;return function(){var l=Zr(this,e);return l===s?null:l===o?a:a=t(o=l,n)}}function FS(e,t,n){var o,s,a;return function(){var l=Zr(this,e),c=n(this),f=c+"";return c==null&&(f=c=(this.style.removeProperty(e),Zr(this,e))),l===f?null:l===o&&f===s?a:(s=f,a=t(o=l,c))}}function HS(e,t){var n,o,s,a="style."+t,l="end."+a,c;return function(){var f=hn(this,e),d=f.on,h=f.value[a]==null?c||(c=pp(t)):void 0;(d!==n||s!==h)&&(o=(n=d).copy()).on(l,s=h),f.on=o}}function zS(e,t,n){var o=(e+="")=="transform"?V1:hp;return t==null?this.styleTween(e,$S(e,o)).on("end.style."+e,pp(e)):typeof t=="function"?this.styleTween(e,FS(e,o,bc(this,"style."+e,t))).each(HS(this._id,e)):this.styleTween(e,BS(e,o,t),n).on("end.style."+e,null)}function VS(e,t,n){return function(o){this.style.setProperty(e,t.call(this,o),n)}}function WS(e,t,n){var o,s;function a(){var l=t.apply(this,arguments);return l!==s&&(o=(s=l)&&VS(e,l,n)),o}return a._value=t,a}function jS(e,t,n){var o="style."+(e+="");if(arguments.length<2)return(o=this.tween(o))&&o._value;if(t==null)return this.tween(o,null);if(typeof t!="function")throw new Error;return this.tween(o,WS(e,t,n??""))}function US(e){return function(){this.textContent=e}}function GS(e){return function(){var t=e(this);this.textContent=t??""}}function YS(e){return this.tween("text",typeof e=="function"?GS(bc(this,"text",e)):US(e==null?"":e+""))}function XS(e){return function(t){this.textContent=e.call(this,t)}}function qS(e){var t,n;function o(){var s=e.apply(this,arguments);return s!==n&&(t=(n=s)&&XS(s)),t}return o._value=e,o}function KS(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,qS(e))}function ZS(){for(var e=this._name,t=this._id,n=gp(),o=this._groups,s=o.length,a=0;a<s;++a)for(var l=o[a],c=l.length,f,d=0;d<c;++d)if(f=l[d]){var h=Qt(f,t);Fs(f,e,n,d,l,{time:h.time+h.delay+h.duration,delay:0,duration:h.duration,ease:h.ease})}return new In(o,this._parents,e,n)}function QS(){var e,t,n=this,o=n._id,s=n.size();return new Promise(function(a,l){var c={value:l},f={value:function(){--s===0&&a()}};n.each(function(){var d=hn(this,o),h=d.on;h!==e&&(t=(e=h).copy(),t._.cancel.push(c),t._.interrupt.push(c),t._.end.push(f)),d.on=t}),s===0&&a()})}var JS=0;function In(e,t,n,o){this._groups=e,this._parents=t,this._name=n,this._id=o}function gp(){return++JS}var On=Xo.prototype;In.prototype={constructor:In,select:MS,selectAll:RS,selectChild:On.selectChild,selectChildren:On.selectChildren,filter:NS,merge:TS,selection:LS,transition:ZS,call:On.call,nodes:On.nodes,node:On.node,size:On.size,empty:On.empty,each:On.each,on:OS,attr:uS,attrTween:gS,style:zS,styleTween:jS,text:YS,textTween:KS,remove:kS,tween:rS,delay:vS,duration:bS,ease:SS,easeVarying:CS,end:QS,[Symbol.iterator]:On[Symbol.iterator]};function eE(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var tE={time:null,delay:0,duration:250,ease:eE};function nE(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function rE(e){var t,n;e instanceof In?(t=e._id,e=e._name):(t=gp(),(n=tE).time=mc(),e=e==null?null:e+"");for(var o=this._groups,s=o.length,a=0;a<s;++a)for(var l=o[a],c=l.length,f,d=0;d<c;++d)(f=l[d])&&Fs(f,e,t,d,l,n||nE(f,t));return new In(o,this._parents,e,t)}Xo.prototype.interrupt=eS,Xo.prototype.transition=rE;const zs=e=>()=>e;function oE(e,{sourceEvent:t,target:n,transform:o,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:o,enumerable:!0,configurable:!0},_:{value:s}})}function Pn(e,t,n){this.k=e,this.x=t,this.y=n}Pn.prototype={constructor:Pn,scale:function(e){return e===1?this:new Pn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new Pn(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 Vs=new Pn(1,0,0);mp.prototype=Pn.prototype;function mp(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Vs;return e.__zoom}function _c(e){e.stopImmediatePropagation()}function oi(e){e.preventDefault(),e.stopImmediatePropagation()}function iE(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function sE(){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 yp(){return this.__zoom||Vs}function aE(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function lE(){return navigator.maxTouchPoints||"ontouchstart"in this}function cE(e,t,n){var o=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],l=e.invertY(t[1][1])-n[1][1];return e.translate(s>o?(o+s)/2:Math.min(0,o)||Math.max(0,s),l>a?(a+l)/2:Math.min(0,a)||Math.max(0,l))}function vp(){var e=iE,t=sE,n=cE,o=aE,s=lE,a=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],c=250,f=ks,d=bs("start","zoom","end"),h,g,p,m=500,x=150,v=0,b=10;function _(C){C.property("__zoom",yp).on("wheel.zoom",D,{passive:!1}).on("mousedown.zoom",V).on("dblclick.zoom",K).filter(s).on("touchstart.zoom",Z).on("touchmove.zoom",U).on("touchend.zoom touchcancel.zoom",q).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}_.transform=function(C,H,B,R){var P=C.selection?C.selection():C;P.property("__zoom",yp),C!==P?O(C,H,B,R):P.interrupt().each(function(){k(this,arguments).event(R).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},_.scaleBy=function(C,H,B,R){_.scaleTo(C,function(){var P=this.__zoom.k,W=typeof H=="function"?H.apply(this,arguments):H;return P*W},B,R)},_.scaleTo=function(C,H,B,R){_.transform(C,function(){var P=t.apply(this,arguments),W=this.__zoom,$=B==null?E(P):typeof B=="function"?B.apply(this,arguments):B,G=W.invert($),J=typeof H=="function"?H.apply(this,arguments):H;return n(w(N(W,J),$,G),P,l)},B,R)},_.translateBy=function(C,H,B,R){_.transform(C,function(){return n(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof B=="function"?B.apply(this,arguments):B),t.apply(this,arguments),l)},null,R)},_.translateTo=function(C,H,B,R,P){_.transform(C,function(){var W=t.apply(this,arguments),$=this.__zoom,G=R==null?E(W):typeof R=="function"?R.apply(this,arguments):R;return n(Vs.translate(G[0],G[1]).scale($.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof B=="function"?-B.apply(this,arguments):-B),W,l)},R,P)};function N(C,H){return H=Math.max(a[0],Math.min(a[1],H)),H===C.k?C:new Pn(H,C.x,C.y)}function w(C,H,B){var R=H[0]-B[0]*C.k,P=H[1]-B[1]*C.k;return R===C.x&&P===C.y?C:new Pn(C.k,R,P)}function E(C){return[(+C[0][0]+ +C[1][0])/2,(+C[0][1]+ +C[1][1])/2]}function O(C,H,B,R){C.on("start.zoom",function(){k(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){k(this,arguments).event(R).end()}).tween("zoom",function(){var P=this,W=arguments,$=k(P,W).event(R),G=t.apply(P,W),J=B==null?E(G):typeof B=="function"?B.apply(P,W):B,re=Math.max(G[1][0]-G[0][0],G[1][1]-G[0][1]),se=P.__zoom,ce=typeof H=="function"?H.apply(P,W):H,ge=f(se.invert(J).concat(re/se.k),ce.invert(J).concat(re/ce.k));return function(te){if(te===1)te=ce;else{var Q=ge(te),ae=re/Q[2];te=new Pn(ae,J[0]-Q[0]*ae,J[1]-Q[1]*ae)}$.zoom(null,te)}})}function k(C,H,B){return!B&&C.__zooming||new M(C,H)}function M(C,H){this.that=C,this.args=H,this.active=0,this.sourceEvent=null,this.extent=t.apply(C,H),this.taps=0}M.prototype={event:function(C){return C&&(this.sourceEvent=C),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(C,H){return this.mouse&&C!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&C!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&C!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(C){var H=Ot(this.that).datum();d.call(C,this.that,new oE(C,{sourceEvent:this.sourceEvent,target:_,transform:this.that.__zoom,dispatch:d}),H)}};function D(C,...H){if(!e.apply(this,arguments))return;var B=k(this,H).event(C),R=this.__zoom,P=Math.max(a[0],Math.min(a[1],R.k*Math.pow(2,o.apply(this,arguments)))),W=Kt(C);if(B.wheel)(B.mouse[0][0]!==W[0]||B.mouse[0][1]!==W[1])&&(B.mouse[1]=R.invert(B.mouse[0]=W)),clearTimeout(B.wheel);else{if(R.k===P)return;B.mouse=[W,R.invert(W)],Hs(this),B.start()}oi(C),B.wheel=setTimeout($,x),B.zoom("mouse",n(w(N(R,P),B.mouse[0],B.mouse[1]),B.extent,l));function $(){B.wheel=null,B.end()}}function V(C,...H){if(p||!e.apply(this,arguments))return;var B=C.currentTarget,R=k(this,H,!0).event(C),P=Ot(C.view).on("mousemove.zoom",J,!0).on("mouseup.zoom",re,!0),W=Kt(C,B),$=C.clientX,G=C.clientY;Hh(C.view),_c(C),R.mouse=[W,this.__zoom.invert(W)],Hs(this),R.start();function J(se){if(oi(se),!R.moved){var ce=se.clientX-$,ge=se.clientY-G;R.moved=ce*ce+ge*ge>v}R.event(se).zoom("mouse",n(w(R.that.__zoom,R.mouse[0]=Kt(se,B),R.mouse[1]),R.extent,l))}function re(se){P.on("mousemove.zoom mouseup.zoom",null),zh(se.view,R.moved),oi(se),R.event(se).end()}}function K(C,...H){if(e.apply(this,arguments)){var B=this.__zoom,R=Kt(C.changedTouches?C.changedTouches[0]:C,this),P=B.invert(R),W=B.k*(C.shiftKey?.5:2),$=n(w(N(B,W),R,P),t.apply(this,H),l);oi(C),c>0?Ot(this).transition().duration(c).call(O,$,R,C):Ot(this).call(_.transform,$,R,C)}}function Z(C,...H){if(e.apply(this,arguments)){var B=C.touches,R=B.length,P=k(this,H,C.changedTouches.length===R).event(C),W,$,G,J;for(_c(C),$=0;$<R;++$)G=B[$],J=Kt(G,this),J=[J,this.__zoom.invert(J),G.identifier],P.touch0?!P.touch1&&P.touch0[2]!==J[2]&&(P.touch1=J,P.taps=0):(P.touch0=J,W=!0,P.taps=1+!!h);h&&(h=clearTimeout(h)),W&&(P.taps<2&&(g=J[0],h=setTimeout(function(){h=null},m)),Hs(this),P.start())}}function U(C,...H){if(this.__zooming){var B=k(this,H).event(C),R=C.changedTouches,P=R.length,W,$,G,J;for(oi(C),W=0;W<P;++W)$=R[W],G=Kt($,this),B.touch0&&B.touch0[2]===$.identifier?B.touch0[0]=G:B.touch1&&B.touch1[2]===$.identifier&&(B.touch1[0]=G);if($=B.that.__zoom,B.touch1){var re=B.touch0[0],se=B.touch0[1],ce=B.touch1[0],ge=B.touch1[1],te=(te=ce[0]-re[0])*te+(te=ce[1]-re[1])*te,Q=(Q=ge[0]-se[0])*Q+(Q=ge[1]-se[1])*Q;$=N($,Math.sqrt(te/Q)),G=[(re[0]+ce[0])/2,(re[1]+ce[1])/2],J=[(se[0]+ge[0])/2,(se[1]+ge[1])/2]}else if(B.touch0)G=B.touch0[0],J=B.touch0[1];else return;B.zoom("touch",n(w($,G,J),B.extent,l))}}function q(C,...H){if(this.__zooming){var B=k(this,H).event(C),R=C.changedTouches,P=R.length,W,$;for(_c(C),p&&clearTimeout(p),p=setTimeout(function(){p=null},m),W=0;W<P;++W)$=R[W],B.touch0&&B.touch0[2]===$.identifier?delete B.touch0:B.touch1&&B.touch1[2]===$.identifier&&delete B.touch1;if(B.touch1&&!B.touch0&&(B.touch0=B.touch1,delete B.touch1),B.touch0)B.touch0[1]=this.__zoom.invert(B.touch0[0]);else if(B.end(),B.taps===2&&($=Kt($,this),Math.hypot(g[0]-$[0],g[1]-$[1])<b)){var G=Ot(this).on("dblclick.zoom");G&&G.apply(this,arguments)}}}return _.wheelDelta=function(C){return arguments.length?(o=typeof C=="function"?C:zs(+C),_):o},_.filter=function(C){return arguments.length?(e=typeof C=="function"?C:zs(!!C),_):e},_.touchable=function(C){return arguments.length?(s=typeof C=="function"?C:zs(!!C),_):s},_.extent=function(C){return arguments.length?(t=typeof C=="function"?C:zs([[+C[0][0],+C[0][1]],[+C[1][0],+C[1][1]]]),_):t},_.scaleExtent=function(C){return arguments.length?(a[0]=+C[0],a[1]=+C[1],_):[a[0],a[1]]},_.translateExtent=function(C){return arguments.length?(l[0][0]=+C[0][0],l[1][0]=+C[1][0],l[0][1]=+C[0][1],l[1][1]=+C[1][1],_):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},_.constrain=function(C){return arguments.length?(n=C,_):n},_.duration=function(C){return arguments.length?(c=+C,_):c},_.interpolate=function(C){return arguments.length?(f=C,_):f},_.on=function(){var C=d.on.apply(d,arguments);return C===d?_:C},_.clickDistance=function(C){return arguments.length?(v=(C=+C)*C,_):Math.sqrt(v)},_.tapDistance=function(C){return arguments.length?(b=+C,_):b},_}const _t={error001:()=>"[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:o})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:o}", 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.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ii=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],xp=["Enter"," ","Escape"],wp={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var to;(function(e){e.Strict="strict",e.Loose="loose"})(to||(to={}));var Nr;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Nr||(Nr={}));var no;(function(e){e.Partial="partial",e.Full="full"})(no||(no={}));const bp={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null};var Zn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Zn||(Zn={}));var Ws;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Ws||(Ws={}));var be;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(be||(be={}));const _p={[be.Left]:be.Right,[be.Right]:be.Left,[be.Top]:be.Bottom,[be.Bottom]:be.Top};function uE(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 Sp(e,t,n){if(!n)return;const o=[];e.forEach((s,a)=>{t?.has(a)||o.push(s)}),o.length&&n(o)}function Ep(e){return e===null?null:e?"valid":"invalid"}const Cp=e=>"id"in e&&"source"in e&&"target"in e,fE=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Sc=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),dE=(e,t,n)=>{if(!e.id)return[];const o=new Set;return n.forEach(s=>{s.source===e.id&&o.add(s.target)}),t.filter(s=>o.has(s.id))},si=(e,t=[0,0])=>{const{width:n,height:o}=kn(e),s=e.origin??t,a=n*s[0],l=o*s[1];return{x:e.position.x-a,y:e.position.y-l}},hE=(e,t={nodeOrigin:[0,0]})=>{if(process.env.NODE_ENV==="development"&&!t.nodeLookup&&console.warn("Please use `getNodesBounds` from `useReactFlow`/`useSvelteFlow` hook to ensure correct values for sub flows. If not possible, you have to provide a nodeLookup to support sub flows."),e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((o,s)=>{const a=typeof s=="string";let l=!t.nodeLookup&&!a?s:void 0;t.nodeLookup&&(l=a?t.nodeLookup.get(s):Sc(s)?s:t.nodeLookup.get(s.id));const c=l?Gs(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return js(o,c)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Us(n)},ai=(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(o=>{if(t.filter===void 0||t.filter(o)){const s=Gs(o);n=js(n,s)}}),Us(n)},Ec=(e,t,[n,o,s]=[0,0,1],a=!1,l=!1)=>{const c={...ui(t,[n,o,s]),width:t.width/s,height:t.height/s},f=[];for(const d of e.values()){const{measured:h,selectable:g=!0,hidden:p=!1}=d;if(l&&!g||p)continue;const m=h.width??d.width??d.initialWidth??null,x=h.height??d.height??d.initialHeight??null,v=li(c,oo(d)),b=(m??0)*(x??0),_=a&&v>0;(!d.internals.handleBounds||_||v>=b||d.dragging)&&f.push(d)}return f},Cc=(e,t)=>{const n=new Set;return e.forEach(o=>{n.add(o.id)}),t.filter(o=>n.has(o.source)||n.has(o.target))};function pE(e,t){const n=new Map,o=t?.nodes?new Set(t.nodes.map(s=>s.id)):null;return e.forEach(s=>{s.measured.width&&s.measured.height&&(t?.includeHiddenNodes||!s.hidden)&&(!o||o.has(s.id))&&n.set(s.id,s)}),n}async function gE({nodes:e,width:t,height:n,panZoom:o,minZoom:s,maxZoom:a},l){if(e.size===0)return Promise.resolve(!0);const c=pE(e,l),f=ai(c),d=Tc(f,t,n,l?.minZoom??s,l?.maxZoom??a,l?.padding??.1);return await o.setViewport(d,{duration:l?.duration,ease:l?.ease,interpolate:l?.interpolate}),Promise.resolve(!0)}function Np({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:o=[0,0],nodeExtent:s,onError:a}){const l=n.get(e),c=l.parentId?n.get(l.parentId):void 0,{x:f,y:d}=c?c.internals.positionAbsolute:{x:0,y:0},h=l.origin??o;let g=l.extent||s;if(l.extent==="parent"&&!l.expandParent)if(!c)a?.("005",_t.error005());else{const m=c.measured.width,x=c.measured.height;m&&x&&(g=[[f,d],[f+m,d+x]])}else c&&so(l.extent)&&(g=[[l.extent[0][0]+f,l.extent[0][1]+d],[l.extent[1][0]+f,l.extent[1][1]+d]]);const p=so(g)?Tr(t,g,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&a?.("015",_t.error015()),{position:{x:p.x-f+(l.measured.width??0)*h[0],y:p.y-d+(l.measured.height??0)*h[1]},positionAbsolute:p}}async function mE({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:o,onBeforeDelete:s}){const a=new Set(e.map(p=>p.id)),l=[];for(const p of n){if(p.deletable===!1)continue;const m=a.has(p.id),x=!m&&p.parentId&&l.find(v=>v.id===p.parentId);(m||x)&&l.push(p)}const c=new Set(t.map(p=>p.id)),f=o.filter(p=>p.deletable!==!1),h=Cc(l,f);for(const p of f)c.has(p.id)&&!h.find(x=>x.id===p.id)&&h.push(p);if(!s)return{edges:h,nodes:l};const g=await s({nodes:l,edges:h});return typeof g=="boolean"?g?{edges:h,nodes:l}:{edges:[],nodes:[]}:g}const ro=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Tr=(e={x:0,y:0},t,n)=>({x:ro(e.x,t[0][0],t[1][0]-(n?.width??0)),y:ro(e.y,t[0][1],t[1][1]-(n?.height??0))});function Tp(e,t,n){const{width:o,height:s}=kn(n),{x:a,y:l}=n.internals.positionAbsolute;return Tr(e,[[a,l],[a+o,l+s]],t)}const Ap=(e,t,n)=>e<t?ro(Math.abs(e-t),1,t)/t:e>n?-ro(Math.abs(e-n),1,t)/t:0,Ip=(e,t,n=15,o=40)=>{const s=Ap(e.x,o,t.width-o)*n,a=Ap(e.y,o,t.height-o)*n;return[s,a]},js=(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)}),Nc=({x:e,y:t,width:n,height:o})=>({x:e,y:t,x2:e+n,y2:t+o}),Us=({x:e,y:t,x2:n,y2:o})=>({x:e,y:t,width:n-e,height:o-t}),oo=(e,t=[0,0])=>{const{x:n,y:o}=Sc(e)?e.internals.positionAbsolute:si(e,t);return{x:n,y:o,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},Gs=(e,t=[0,0])=>{const{x:n,y:o}=Sc(e)?e.internals.positionAbsolute:si(e,t);return{x:n,y:o,x2:n+(e.measured?.width??e.width??e.initialWidth??0),y2:o+(e.measured?.height??e.height??e.initialHeight??0)}},Op=(e,t)=>Us(js(Nc(e),Nc(t))),li=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),o=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*o)},Pp=e=>Jt(e.width)&&Jt(e.height)&&Jt(e.x)&&Jt(e.y),Jt=e=>!isNaN(e)&&isFinite(e),kp=(e,t)=>{process.env.NODE_ENV==="development"&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)},ci=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),ui=({x:e,y:t},[n,o,s],a=!1,l=[1,1])=>{const c={x:(e-n)/s,y:(t-o)/s};return a?ci(c,l):c},Ys=({x:e,y:t},[n,o,s])=>({x:e*s+n,y:t*s+o});function io(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`[React Flow] The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function yE(e,t,n){if(typeof e=="string"||typeof e=="number"){const o=io(e,n),s=io(e,t);return{top:o,right:s,bottom:o,left:s,x:s*2,y:o*2}}if(typeof e=="object"){const o=io(e.top??e.y??0,n),s=io(e.bottom??e.y??0,n),a=io(e.left??e.x??0,t),l=io(e.right??e.x??0,t);return{top:o,right:l,bottom:s,left:a,x:a+l,y:o+s}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function vE(e,t,n,o,s,a){const{x:l,y:c}=Ys(e,[t,n,o]),{x:f,y:d}=Ys({x:e.x+e.width,y:e.y+e.height},[t,n,o]),h=s-f,g=a-d;return{left:Math.floor(l),top:Math.floor(c),right:Math.floor(h),bottom:Math.floor(g)}}const Tc=(e,t,n,o,s,a)=>{const l=yE(a,t,n),c=(t-l.x)/e.width,f=(n-l.y)/e.height,d=Math.min(c,f),h=ro(d,o,s),g=e.x+e.width/2,p=e.y+e.height/2,m=t/2-g*h,x=n/2-p*h,v=vE(e,m,x,h,t,n),b={left:Math.min(v.left-l.left,0),top:Math.min(v.top-l.top,0),right:Math.min(v.right-l.right,0),bottom:Math.min(v.bottom-l.bottom,0)};return{x:m-b.left+b.right,y:x-b.top+b.bottom,zoom:h}},fi=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function so(e){return e!=null&&e!=="parent"}function kn(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Mp(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Rp(e,t={width:0,height:0},n,o,s){const a={...e},l=o.get(n);if(l){const c=l.origin||s;a.x+=l.internals.positionAbsolute.x-(t.width??0)*c[0],a.y+=l.internals.positionAbsolute.y-(t.height??0)*c[1]}return a}function Dp(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function xE(){let e,t;return{promise:new Promise((o,s)=>{e=o,t=s}),resolve:e,reject:t}}function wE(e){return{...wp,...e||{}}}function di(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:o,containerBounds:s}){const{x:a,y:l}=pn(e),c=ui({x:a-(s?.left??0),y:l-(s?.top??0)},o),{x:f,y:d}=n?ci(c,t):c;return{xSnapped:f,ySnapped:d,...c}}const Ac=e=>({width:e.offsetWidth,height:e.offsetHeight}),Lp=e=>e?.getRootNode?.()||window?.document,bE=["INPUT","SELECT","TEXTAREA"];function $p(e){const t=e.composedPath?.()?.[0]||e.target;return t?.nodeType!==1?!1:bE.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const Bp=e=>"clientX"in e,pn=(e,t)=>{const n=Bp(e),o=n?e.clientX:e.touches?.[0].clientX,s=n?e.clientY:e.touches?.[0].clientY;return{x:o-(t?.left??0),y:s-(t?.top??0)}},Fp=(e,t,n,o,s)=>{const a=t.querySelectorAll(`.${e}`);return!a||!a.length?null:Array.from(a).map(l=>{const c=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:s,position:l.getAttribute("data-handlepos"),x:(c.left-n.left)/o,y:(c.top-n.top)/o,...Ac(l)}})};function Hp({sourceX:e,sourceY:t,targetX:n,targetY:o,sourceControlX:s,sourceControlY:a,targetControlX:l,targetControlY:c}){const f=e*.125+s*.375+l*.375+n*.125,d=t*.125+a*.375+c*.375+o*.125,h=Math.abs(f-e),g=Math.abs(d-t);return[f,d,h,g]}function Xs(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function zp({pos:e,x1:t,y1:n,x2:o,y2:s,c:a}){switch(e){case be.Left:return[t-Xs(t-o,a),n];case be.Right:return[t+Xs(o-t,a),n];case be.Top:return[t,n-Xs(n-s,a)];case be.Bottom:return[t,n+Xs(s-n,a)]}}function qs({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:o,targetY:s,targetPosition:a=be.Top,curvature:l=.25}){const[c,f]=zp({pos:n,x1:e,y1:t,x2:o,y2:s,c:l}),[d,h]=zp({pos:a,x1:o,y1:s,x2:e,y2:t,c:l}),[g,p,m,x]=Hp({sourceX:e,sourceY:t,targetX:o,targetY:s,sourceControlX:c,sourceControlY:f,targetControlX:d,targetControlY:h});return[`M${e},${t} C${c},${f} ${d},${h} ${o},${s}`,g,p,m,x]}function Vp({sourceX:e,sourceY:t,targetX:n,targetY:o}){const s=Math.abs(n-e)/2,a=n<e?n+s:n-s,l=Math.abs(o-t)/2,c=o<t?o+l:o-l;return[a,c,s,l]}function _E({sourceNode:e,targetNode:t,selected:n=!1,zIndex:o,elevateOnSelect:s=!1}){if(o!==void 0)return o;const a=s&&n?1e3:0,l=Math.max(e.parentId?e.internals.z:0,t.parentId?t.internals.z:0);return a+l}function SE({sourceNode:e,targetNode:t,width:n,height:o,transform:s}){const a=js(Gs(e),Gs(t));a.x===a.x2&&(a.x2+=1),a.y===a.y2&&(a.y2+=1);const l={x:-s[0]/s[2],y:-s[1]/s[2],width:n/s[2],height:o/s[2]};return li(l,Us(a))>0}const EE=({source:e,sourceHandle:t,target:n,targetHandle:o})=>`xy-edge__${e}${t||""}-${n}${o||""}`,CE=(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)),Wp=(e,t)=>{if(!e.source||!e.target)return kp("006",_t.error006()),t;let n;return Cp(e)?n={...e}:n={...e,id:EE(e)},CE(n,t)?t:(n.sourceHandle===null&&delete n.sourceHandle,n.targetHandle===null&&delete n.targetHandle,t.concat(n))};function jp({sourceX:e,sourceY:t,targetX:n,targetY:o}){const[s,a,l,c]=Vp({sourceX:e,sourceY:t,targetX:n,targetY:o});return[`M ${e},${t}L ${n},${o}`,s,a,l,c]}const Up={[be.Left]:{x:-1,y:0},[be.Right]:{x:1,y:0},[be.Top]:{x:0,y:-1},[be.Bottom]:{x:0,y:1}},NE=({source:e,sourcePosition:t=be.Bottom,target:n})=>t===be.Left||t===be.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},Gp=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function TE({source:e,sourcePosition:t=be.Bottom,target:n,targetPosition:o=be.Top,center:s,offset:a,stepPosition:l}){const c=Up[t],f=Up[o],d={x:e.x+c.x*a,y:e.y+c.y*a},h={x:n.x+f.x*a,y:n.y+f.y*a},g=NE({source:d,sourcePosition:t,target:h}),p=g.x!==0?"x":"y",m=g[p];let x=[],v,b;const _={x:0,y:0},N={x:0,y:0},[,,w,E]=Vp({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(c[p]*f[p]===-1){p==="x"?(v=s.x??d.x+(h.x-d.x)*l,b=s.y??(d.y+h.y)/2):(v=s.x??(d.x+h.x)/2,b=s.y??d.y+(h.y-d.y)*l);const k=[{x:v,y:d.y},{x:v,y:h.y}],M=[{x:d.x,y:b},{x:h.x,y:b}];c[p]===m?x=p==="x"?k:M:x=p==="x"?M:k}else{const k=[{x:d.x,y:h.y}],M=[{x:h.x,y:d.y}];if(p==="x"?x=c.x===m?M:k:x=c.y===m?k:M,t===o){const U=Math.abs(e[p]-n[p]);if(U<=a){const q=Math.min(a-1,a-U);c[p]===m?_[p]=(d[p]>e[p]?-1:1)*q:N[p]=(h[p]>n[p]?-1:1)*q}}if(t!==o){const U=p==="x"?"y":"x",q=c[p]===f[U],C=d[U]>h[U],H=d[U]<h[U];(c[p]===1&&(!q&&C||q&&H)||c[p]!==1&&(!q&&H||q&&C))&&(x=p==="x"?k:M)}const D={x:d.x+_.x,y:d.y+_.y},V={x:h.x+N.x,y:h.y+N.y},K=Math.max(Math.abs(D.x-x[0].x),Math.abs(V.x-x[0].x)),Z=Math.max(Math.abs(D.y-x[0].y),Math.abs(V.y-x[0].y));K>=Z?(v=(D.x+V.x)/2,b=x[0].y):(v=x[0].x,b=(D.y+V.y)/2)}return[[e,{x:d.x+_.x,y:d.y+_.y},...x,{x:h.x+N.x,y:h.y+N.y},n],v,b,w,E]}function AE(e,t,n,o){const s=Math.min(Gp(e,t)/2,Gp(t,n)/2,o),{x:a,y:l}=t;if(e.x===a&&a===n.x||e.y===l&&l===n.y)return`L${a} ${l}`;if(e.y===l){const d=e.x<n.x?-1:1,h=e.y<n.y?1:-1;return`L ${a+s*d},${l}Q ${a},${l} ${a},${l+s*h}`}const c=e.x<n.x?1:-1,f=e.y<n.y?-1:1;return`L ${a},${l+s*f}Q ${a},${l} ${a+s*c},${l}`}function Ic({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:o,targetY:s,targetPosition:a=be.Top,borderRadius:l=5,centerX:c,centerY:f,offset:d=20,stepPosition:h=.5}){const[g,p,m,x,v]=TE({source:{x:e,y:t},sourcePosition:n,target:{x:o,y:s},targetPosition:a,center:{x:c,y:f},offset:d,stepPosition:h});return[g.reduce((_,N,w)=>{let E="";return w>0&&w<g.length-1?E=AE(g[w-1],N,g[w+1],l):E=`${w===0?"M":"L"}${N.x} ${N.y}`,_+=E,_},""),p,m,x,v]}function Yp(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function IE(e){const{sourceNode:t,targetNode:n}=e;if(!Yp(t)||!Yp(n))return null;const o=t.internals.handleBounds||Xp(t.handles),s=n.internals.handleBounds||Xp(n.handles),a=qp(o?.source??[],e.sourceHandle),l=qp(e.connectionMode===to.Strict?s?.target??[]:(s?.target??[]).concat(s?.source??[]),e.targetHandle);if(!a||!l)return e.onError?.("008",_t.error008(a?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const c=a?.position||be.Bottom,f=l?.position||be.Top,d=hi(t,a,c),h=hi(n,l,f);return{sourceX:d.x,sourceY:d.y,targetX:h.x,targetY:h.y,sourcePosition:c,targetPosition:f}}function Xp(e){if(!e)return null;const t=[],n=[];for(const o of e)o.width=o.width??1,o.height=o.height??1,o.type==="source"?t.push(o):o.type==="target"&&n.push(o);return{source:t,target:n}}function hi(e,t,n=be.Left,o=!1){const s=(t?.x??0)+e.internals.positionAbsolute.x,a=(t?.y??0)+e.internals.positionAbsolute.y,{width:l,height:c}=t??kn(e);if(o)return{x:s+l/2,y:a+c/2};switch(t?.position??n){case be.Top:return{x:s+l/2,y:a};case be.Right:return{x:s+l,y:a+c/2};case be.Bottom:return{x:s+l/2,y:a+c};case be.Left:return{x:s,y:a+c/2}}}function qp(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Oc(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(o=>`${o}=${e[o]}`).join("&")}`:""}function OE(e,{id:t,defaultColor:n,defaultMarkerStart:o,defaultMarkerEnd:s}){const a=new Set;return e.reduce((l,c)=>([c.markerStart||o,c.markerEnd||s].forEach(f=>{if(f&&typeof f=="object"){const d=Oc(f,t);a.has(d)||(l.push({id:d,color:f.color||n,...f}),a.add(d))}}),l),[]).sort((l,c)=>l.id.localeCompare(c.id))}const Pc={nodeOrigin:[0,0],nodeExtent:ii,elevateNodesOnSelect:!0,defaults:{}},PE={...Pc,checkEquality:!0};function kc(e,t){const n={...e};for(const o in t)t[o]!==void 0&&(n[o]=t[o]);return n}function kE(e,t,n){const o=kc(Pc,n);for(const s of e.values())if(s.parentId)Rc(s,e,t,o);else{const a=si(s,o.nodeOrigin),l=so(s.extent)?s.extent:o.nodeExtent,c=Tr(a,l,kn(s));s.internals.positionAbsolute=c}}function Mc(e,t,n,o){const s=kc(PE,o);let a=e.length>0;const l=new Map(t),c=s?.elevateNodesOnSelect?1e3:0;t.clear(),n.clear();for(const f of e){let d=l.get(f.id);if(s.checkEquality&&f===d?.internals.userNode)t.set(f.id,d);else{const h=si(f,s.nodeOrigin),g=so(f.extent)?f.extent:s.nodeExtent,p=Tr(h,g,kn(f));d={...s.defaults,...f,measured:{width:f.measured?.width,height:f.measured?.height},internals:{positionAbsolute:p,handleBounds:f.measured?d?.internals.handleBounds:void 0,z:Kp(f,c),userNode:f}},t.set(f.id,d)}(d.measured===void 0||d.measured.width===void 0||d.measured.height===void 0)&&!d.hidden&&(a=!1),f.parentId&&Rc(d,t,n,o)}return a}function ME(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 Rc(e,t,n,o){const{elevateNodesOnSelect:s,nodeOrigin:a,nodeExtent:l}=kc(Pc,o),c=e.parentId,f=t.get(c);if(!f){console.warn(`Parent node ${c} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}ME(e,n);const d=s?1e3:0,{x:h,y:g,z:p}=RE(e,f,a,l,d),{positionAbsolute:m}=e.internals,x=h!==m.x||g!==m.y;(x||p!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:h,y:g}:m,z:p}})}function Kp(e,t){return(Jt(e.zIndex)?e.zIndex:0)+(e.selected?t:0)}function RE(e,t,n,o,s){const{x:a,y:l}=t.internals.positionAbsolute,c=kn(e),f=si(e,n),d=so(e.extent)?Tr(f,e.extent,c):f;let h=Tr({x:a+d.x,y:l+d.y},o,c);e.extent==="parent"&&(h=Tp(h,c,t));const g=Kp(e,s),p=t.internals.z??0;return{x:h.x,y:h.y,z:p>=g?p+1:g}}function Dc(e,t,n,o=[0,0]){const s=[],a=new Map;for(const l of e){const c=t.get(l.parentId);if(!c)continue;const f=a.get(l.parentId)?.expandedRect??oo(c),d=Op(f,l.rect);a.set(l.parentId,{expandedRect:d,parent:c})}return a.size>0&&a.forEach(({expandedRect:l,parent:c},f)=>{const d=c.internals.positionAbsolute,h=kn(c),g=c.origin??o,p=l.x<d.x?Math.round(Math.abs(d.x-l.x)):0,m=l.y<d.y?Math.round(Math.abs(d.y-l.y)):0,x=Math.max(h.width,Math.round(l.width)),v=Math.max(h.height,Math.round(l.height)),b=(x-h.width)*g[0],_=(v-h.height)*g[1];(p>0||m>0||b||_)&&(s.push({id:f,type:"position",position:{x:c.position.x-p+b,y:c.position.y-m+_}}),n.get(f)?.forEach(N=>{e.some(w=>w.id===N.id)||s.push({id:N.id,type:"position",position:{x:N.position.x+p,y:N.position.y+m}})})),(h.width<l.width||h.height<l.height||p||m)&&s.push({id:f,type:"dimensions",setAttributes:!0,dimensions:{width:x+(p?g[0]*p-b:0),height:v+(m?g[1]*m-_:0)}})}),s}function DE(e,t,n,o,s,a){const l=o?.querySelector(".xyflow__viewport");let c=!1;if(!l)return{changes:[],updatedInternals:c};const f=[],d=window.getComputedStyle(l),{m22:h}=new window.DOMMatrixReadOnly(d.transform),g=[];for(const p of e.values()){const m=t.get(p.id);if(!m)continue;if(m.hidden){t.set(m.id,{...m,internals:{...m.internals,handleBounds:void 0}}),c=!0;continue}const x=Ac(p.nodeElement),v=m.measured.width!==x.width||m.measured.height!==x.height;if(!!(x.width&&x.height&&(v||!m.internals.handleBounds||p.force))){const _=p.nodeElement.getBoundingClientRect(),N=so(m.extent)?m.extent:a;let{positionAbsolute:w}=m.internals;m.parentId&&m.extent==="parent"?w=Tp(w,x,t.get(m.parentId)):N&&(w=Tr(w,N,x));const E={...m,measured:x,internals:{...m.internals,positionAbsolute:w,handleBounds:{source:Fp("source",p.nodeElement,_,h,m.id),target:Fp("target",p.nodeElement,_,h,m.id)}}};t.set(m.id,E),m.parentId&&Rc(E,t,n,{nodeOrigin:s}),c=!0,v&&(f.push({id:m.id,type:"dimensions",dimensions:x}),m.expandParent&&m.parentId&&g.push({id:m.id,parentId:m.parentId,rect:oo(E,s)}))}}if(g.length>0){const p=Dc(g,t,n,s);f.push(...p)}return{changes:f,updatedInternals:c}}async function LE({delta:e,panZoom:t,transform:n,translateExtent:o,width:s,height:a}){if(!t||!e.x&&!e.y)return Promise.resolve(!1);const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[s,a]],o),c=!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2]);return Promise.resolve(c)}function Zp(e,t,n,o,s,a){let l=s;const c=o.get(l)||new Map;o.set(l,c.set(n,t)),l=`${s}-${e}`;const f=o.get(l)||new Map;if(o.set(l,f.set(n,t)),a){l=`${s}-${e}-${a}`;const d=o.get(l)||new Map;o.set(l,d.set(n,t))}}function Qp(e,t,n){e.clear(),t.clear();for(const o of n){const{source:s,target:a,sourceHandle:l=null,targetHandle:c=null}=o,f={edgeId:o.id,source:s,target:a,sourceHandle:l,targetHandle:c},d=`${s}-${l}--${a}-${c}`,h=`${a}-${c}--${s}-${l}`;Zp("source",f,h,e,s,l),Zp("target",f,d,e,a,c),t.set(o.id,o)}}function $E(e,t){if(e===null||t===null)return!1;const n=Array.isArray(e)?e:[e],o=Array.isArray(t)?t:[t];if(n.length!==o.length)return!1;for(let s=0;s<n.length;s++)if(n[s].id!==o[s].id||n[s].type!==o[s].type||!Object.is(n[s].data,o[s].data))return!1;return!0}function Jp(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:Jp(n,t):!1}function eg(e,t,n){let o=e;do{if(o?.matches?.(t))return!0;if(o===n)return!1;o=o?.parentElement}while(o);return!1}function BE(e,t,n,o){const s=new Map;for(const[a,l]of e)if((l.selected||l.id===o)&&(!l.parentId||!Jp(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const c=e.get(a);c&&s.set(a,{id:a,position:c.position||{x:0,y:0},distance:{x:n.x-c.internals.positionAbsolute.x,y:n.y-c.internals.positionAbsolute.y},extent:c.extent,parentId:c.parentId,origin:c.origin,expandParent:c.expandParent,internals:{positionAbsolute:c.internals.positionAbsolute||{x:0,y:0}},measured:{width:c.measured.width??0,height:c.measured.height??0}})}return s}function Lc({nodeId:e,dragItems:t,nodeLookup:n,dragging:o=!0}){const s=[];for(const[l,c]of t){const f=n.get(l)?.internals.userNode;f&&s.push({...f,position:c.position,dragging:o})}if(!e)return[s[0],s];const a=n.get(e)?.internals.userNode;return[a?{...a,position:t.get(e)?.position||a.position,dragging:o}:s[0],s]}function FE({dragItems:e,snapGrid:t,x:n,y:o}){const s=e.values().next().value;if(!s)return null;const a={x:n-s.distance.x,y:o-s.distance.y},l=ci(a,t);return{x:l.x-a.x,y:l.y-a.y}}function HE({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:o,onDragStop:s}){let a={x:null,y:null},l=0,c=new Map,f=!1,d={x:0,y:0},h=null,g=!1,p=null,m=!1,x=!1,v=null;function b({noDragClassName:N,handleSelector:w,domNode:E,isSelectable:O,nodeId:k,nodeClickDistance:M=0}){p=Ot(E);function D({x:U,y:q}){const{nodeLookup:C,nodeExtent:H,snapGrid:B,snapToGrid:R,nodeOrigin:P,onNodeDrag:W,onSelectionDrag:$,onError:G,updateNodePositions:J}=t();a={x:U,y:q};let re=!1;const se=c.size>1,ce=se&&H?Nc(ai(c)):null,ge=se&&R?FE({dragItems:c,snapGrid:B,x:U,y:q}):null;for(const[te,Q]of c){if(!C.has(te))continue;let ae={x:U-Q.distance.x,y:q-Q.distance.y};R&&(ae=ge?{x:Math.round(ae.x+ge.x),y:Math.round(ae.y+ge.y)}:ci(ae,B));let fe=null;if(se&&H&&!Q.extent&&ce){const{positionAbsolute:_e}=Q.internals,ye=_e.x-ce.x+H[0][0],Le=_e.x+Q.measured.width-ce.x2+H[1][0],Ze=_e.y-ce.y+H[0][1],Ge=_e.y+Q.measured.height-ce.y2+H[1][1];fe=[[ye,Ze],[Le,Ge]]}const{position:de,positionAbsolute:ue}=Np({nodeId:te,nextPosition:ae,nodeLookup:C,nodeExtent:fe||H,nodeOrigin:P,onError:G});re=re||Q.position.x!==de.x||Q.position.y!==de.y,Q.position=de,Q.internals.positionAbsolute=ue}if(x=x||re,!!re&&(J(c,!0),v&&(o||W||!k&&$))){const[te,Q]=Lc({nodeId:k,dragItems:c,nodeLookup:C});o?.(v,c,te,Q),W?.(v,te,Q),k||$?.(v,Q)}}async function V(){if(!h)return;const{transform:U,panBy:q,autoPanSpeed:C,autoPanOnNodeDrag:H}=t();if(!H){f=!1,cancelAnimationFrame(l);return}const[B,R]=Ip(d,h,C);(B!==0||R!==0)&&(a.x=(a.x??0)-B/U[2],a.y=(a.y??0)-R/U[2],await q({x:B,y:R})&&D(a)),l=requestAnimationFrame(V)}function K(U){const{nodeLookup:q,multiSelectionActive:C,nodesDraggable:H,transform:B,snapGrid:R,snapToGrid:P,selectNodesOnDrag:W,onNodeDragStart:$,onSelectionDragStart:G,unselectNodesAndEdges:J}=t();g=!0,(!W||!O)&&!C&&k&&(q.get(k)?.selected||J()),O&&W&&k&&e?.(k);const re=di(U.sourceEvent,{transform:B,snapGrid:R,snapToGrid:P,containerBounds:h});if(a=re,c=BE(q,H,re,k),c.size>0&&(n||$||!k&&G)){const[se,ce]=Lc({nodeId:k,dragItems:c,nodeLookup:q});n?.(U.sourceEvent,c,se,ce),$?.(U.sourceEvent,se,ce),k||G?.(U.sourceEvent,ce)}}const Z=Vh().clickDistance(M).on("start",U=>{const{domNode:q,nodeDragThreshold:C,transform:H,snapGrid:B,snapToGrid:R}=t();h=q?.getBoundingClientRect()||null,m=!1,x=!1,v=U.sourceEvent,C===0&&K(U),a=di(U.sourceEvent,{transform:H,snapGrid:B,snapToGrid:R,containerBounds:h}),d=pn(U.sourceEvent,h)}).on("drag",U=>{const{autoPanOnNodeDrag:q,transform:C,snapGrid:H,snapToGrid:B,nodeDragThreshold:R,nodeLookup:P}=t(),W=di(U.sourceEvent,{transform:C,snapGrid:H,snapToGrid:B,containerBounds:h});if(v=U.sourceEvent,(U.sourceEvent.type==="touchmove"&&U.sourceEvent.touches.length>1||k&&!P.has(k))&&(m=!0),!m){if(!f&&q&&g&&(f=!0,V()),!g){const $=W.xSnapped-(a.x??0),G=W.ySnapped-(a.y??0);Math.sqrt($*$+G*G)>R&&K(U)}(a.x!==W.xSnapped||a.y!==W.ySnapped)&&c&&g&&(d=pn(U.sourceEvent,h),D(W))}}).on("end",U=>{if(!(!g||m)&&(f=!1,g=!1,cancelAnimationFrame(l),c.size>0)){const{nodeLookup:q,updateNodePositions:C,onNodeDragStop:H,onSelectionDragStop:B}=t();if(x&&(C(c,!1),x=!1),s||H||!k&&B){const[R,P]=Lc({nodeId:k,dragItems:c,nodeLookup:q,dragging:!1});s?.(U.sourceEvent,c,R,P),H?.(U.sourceEvent,R,P),k||B?.(U.sourceEvent,P)}}}).filter(U=>{const q=U.target;return!U.button&&(!N||!eg(q,`.${N}`,E))&&(!w||eg(q,w,E))});p.call(Z)}function _(){p?.on(".drag",null)}return{update:b,destroy:_}}function zE(e,t,n){const o=[],s={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const a of t.values())li(s,oo(a))>0&&o.push(a);return o}const VE=250;function WE(e,t,n,o){let s=[],a=1/0;const l=zE(e,n,t+VE);for(const c of l){const f=[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]];for(const d of f){if(o.nodeId===d.nodeId&&o.type===d.type&&o.id===d.id)continue;const{x:h,y:g}=hi(c,d,d.position,!0),p=Math.sqrt(Math.pow(h-e.x,2)+Math.pow(g-e.y,2));p>t||(p<a?(s=[{...d,x:h,y:g}],a=p):p===a&&s.push({...d,x:h,y:g}))}}if(!s.length)return null;if(s.length>1){const c=o.type==="source"?"target":"source";return s.find(f=>f.type===c)??s[0]}return s[0]}function tg(e,t,n,o,s,a=!1){const l=o.get(e);if(!l)return null;const c=s==="strict"?l.internals.handleBounds?.[t]:[...l.internals.handleBounds?.source??[],...l.internals.handleBounds?.target??[]],f=(n?c?.find(d=>d.id===n):c?.[0])??null;return f&&a?{...f,...hi(l,f,f.position,!0)}:f}function ng(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function jE(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const rg=()=>!0;function UE(e,{connectionMode:t,connectionRadius:n,handleId:o,nodeId:s,edgeUpdaterType:a,isTarget:l,domNode:c,nodeLookup:f,lib:d,autoPanOnConnect:h,flowId:g,panBy:p,cancelConnection:m,onConnectStart:x,onConnect:v,onConnectEnd:b,isValidConnection:_=rg,onReconnectEnd:N,updateConnection:w,getTransform:E,getFromHandle:O,autoPanSpeed:k,dragThreshold:M=1,handleDomNode:D}){const V=Lp(e.target);let K=0,Z;const{x:U,y:q}=pn(e),C=ng(a,D),H=c?.getBoundingClientRect();let B=!1;if(!H||!C)return;const R=tg(s,C,o,f,t);if(!R)return;let P=pn(e,H),W=!1,$=null,G=!1,J=null;function re(){if(!h||!H)return;const[de,ue]=Ip(P,H,k);p({x:de,y:ue}),K=requestAnimationFrame(re)}const se={...R,nodeId:s,type:C,position:R.position},ce=f.get(s);let te={inProgress:!0,isValid:null,from:hi(ce,se,be.Left,!0),fromHandle:se,fromPosition:se.position,fromNode:ce,to:P,toHandle:null,toPosition:_p[se.position],toNode:null};function Q(){B=!0,w(te),x?.(e,{nodeId:s,handleId:o,handleType:C})}M===0&&Q();function ae(de){if(!B){const{x:Le,y:Ze}=pn(de),Ge=Le-U,Fn=Ze-q;if(!(Ge*Ge+Fn*Fn>M*M))return;Q()}if(!O()||!se){fe(de);return}const ue=E();P=pn(de,H),Z=WE(ui(P,ue,!1,[1,1]),n,f,se),W||(re(),W=!0);const _e=og(de,{handle:Z,connectionMode:t,fromNodeId:s,fromHandleId:o,fromType:l?"target":"source",isValidConnection:_,doc:V,lib:d,flowId:g,nodeLookup:f});J=_e.handleDomNode,$=_e.connection,G=jE(!!Z,_e.isValid);const ye={...te,isValid:G,to:_e.toHandle&&G?Ys({x:_e.toHandle.x,y:_e.toHandle.y},ue):P,toHandle:_e.toHandle,toPosition:G&&_e.toHandle?_e.toHandle.position:_p[se.position],toNode:_e.toHandle?f.get(_e.toHandle.nodeId):null};G&&Z&&te.toHandle&&ye.toHandle&&te.toHandle.type===ye.toHandle.type&&te.toHandle.nodeId===ye.toHandle.nodeId&&te.toHandle.id===ye.toHandle.id&&te.to.x===ye.to.x&&te.to.y===ye.to.y||(w(ye),te=ye)}function fe(de){if(B){(Z||J)&&$&&G&&v?.($);const{inProgress:ue,..._e}=te,ye={..._e,toPosition:te.toHandle?te.toPosition:null};b?.(de,ye),a&&N?.(de,ye)}m(),cancelAnimationFrame(K),W=!1,G=!1,$=null,J=null,V.removeEventListener("mousemove",ae),V.removeEventListener("mouseup",fe),V.removeEventListener("touchmove",ae),V.removeEventListener("touchend",fe)}V.addEventListener("mousemove",ae),V.addEventListener("mouseup",fe),V.addEventListener("touchmove",ae),V.addEventListener("touchend",fe)}function og(e,{handle:t,connectionMode:n,fromNodeId:o,fromHandleId:s,fromType:a,doc:l,lib:c,flowId:f,isValidConnection:d=rg,nodeLookup:h}){const g=a==="target",p=t?l.querySelector(`.${c}-flow__handle[data-id="${f}-${t?.nodeId}-${t?.id}-${t?.type}"]`):null,{x:m,y:x}=pn(e),v=l.elementFromPoint(m,x),b=v?.classList.contains(`${c}-flow__handle`)?v:p,_={handleDomNode:b,isValid:!1,connection:null,toHandle:null};if(b){const N=ng(void 0,b),w=b.getAttribute("data-nodeid"),E=b.getAttribute("data-handleid"),O=b.classList.contains("connectable"),k=b.classList.contains("connectableend");if(!w||!N)return _;const M={source:g?w:o,sourceHandle:g?E:s,target:g?o:w,targetHandle:g?s:E};_.connection=M;const V=O&&k&&(n===to.Strict?g&&N==="source"||!g&&N==="target":w!==o||E!==s);_.isValid=V&&d(M),_.toHandle=tg(w,N,E,h,n,!0)}return _}const $c={onPointerDown:UE,isValid:og};function GE({domNode:e,panZoom:t,getTransform:n,getViewScale:o}){const s=Ot(e);function a({translateExtent:c,width:f,height:d,zoomStep:h=1,pannable:g=!0,zoomable:p=!0,inversePan:m=!1}){const x=w=>{if(w.sourceEvent.type!=="wheel"||!t)return;const E=n(),O=w.sourceEvent.ctrlKey&&fi()?10:1,k=-w.sourceEvent.deltaY*(w.sourceEvent.deltaMode===1?.05:w.sourceEvent.deltaMode?1:.002)*h,M=E[2]*Math.pow(2,k*O);t.scaleTo(M)};let v=[0,0];const b=w=>{(w.sourceEvent.type==="mousedown"||w.sourceEvent.type==="touchstart")&&(v=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY])},_=w=>{const E=n();if(w.sourceEvent.type!=="mousemove"&&w.sourceEvent.type!=="touchmove"||!t)return;const O=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY],k=[O[0]-v[0],O[1]-v[1]];v=O;const M=o()*Math.max(E[2],Math.log(E[2]))*(m?-1:1),D={x:E[0]-k[0]*M,y:E[1]-k[1]*M},V=[[0,0],[f,d]];t.setViewportConstrained({x:D.x,y:D.y,zoom:E[2]},V,c)},N=vp().on("start",b).on("zoom",g?_:null).on("zoom.wheel",p?x:null);s.call(N,{})}function l(){s.on("zoom",null)}return{update:a,destroy:l,pointer:Kt}}const YE=(e,t)=>e.x!==t.x||e.y!==t.y||e.zoom!==t.k,Ks=e=>({x:e.x,y:e.y,zoom:e.k}),Bc=({x:e,y:t,zoom:n})=>Vs.translate(e,t).scale(n),ao=(e,t)=>e.target.closest(`.${t}`),ig=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),XE=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Fc=(e,t=0,n=XE,o=()=>{})=>{const s=typeof t=="number"&&t>0;return s||o(),s?e.transition().duration(t).ease(n).on("end",o):e},sg=e=>{const t=e.ctrlKey&&fi()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function qE({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:o,panOnScrollMode:s,panOnScrollSpeed:a,zoomOnPinch:l,onPanZoomStart:c,onPanZoom:f,onPanZoomEnd:d}){return h=>{if(ao(h,t))return!1;h.preventDefault(),h.stopImmediatePropagation();const g=n.property("__zoom").k||1;if(h.ctrlKey&&l){const b=Kt(h),_=sg(h),N=g*Math.pow(2,_);o.scaleTo(n,N,b,h);return}const p=h.deltaMode===1?20:1;let m=s===Nr.Vertical?0:h.deltaX*p,x=s===Nr.Horizontal?0:h.deltaY*p;!fi()&&h.shiftKey&&s!==Nr.Vertical&&(m=h.deltaY*p,x=0),o.translateBy(n,-(m/g)*a,-(x/g)*a,{internal:!0});const v=Ks(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling||(e.isPanScrolling=!0,c?.(h,v)),e.isPanScrolling&&(f?.(h,v),e.panScrollTimeout=setTimeout(()=>{d?.(h,v),e.isPanScrolling=!1},150))}}function KE({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(o,s){const a=o.type==="wheel",l=!t&&a&&!o.ctrlKey,c=ao(o,e);if(o.ctrlKey&&a&&c&&o.preventDefault(),l||c)return null;o.preventDefault(),n.call(this,o,s)}}function ZE({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return o=>{if(o.sourceEvent?.internal)return;const s=Ks(o.transform);e.mouseButton=o.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=s,o.sourceEvent?.type==="mousedown"&&t(!0),n&&n?.(o.sourceEvent,s)}}function QE({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:o,onPanZoom:s}){return a=>{e.usedRightMouseButton=!!(n&&ig(t,e.mouseButton??0)),a.sourceEvent?.sync||o([a.transform.x,a.transform.y,a.transform.k]),s&&!a.sourceEvent?.internal&&s?.(a.sourceEvent,Ks(a.transform))}}function JE({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:o,onPanZoomEnd:s,onPaneContextMenu:a}){return l=>{if(!l.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,a&&ig(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&a(l.sourceEvent),e.usedRightMouseButton=!1,o(!1),s&&YE(e.prevViewport,l.transform))){const c=Ks(l.transform);e.prevViewport=c,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{s?.(l.sourceEvent,c)},n?150:0)}}}function eC({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:o,panOnScroll:s,zoomOnDoubleClick:a,userSelectionActive:l,noWheelClassName:c,noPanClassName:f,lib:d}){return h=>{const g=e||t,p=n&&h.ctrlKey;if(h.button===1&&h.type==="mousedown"&&(ao(h,`${d}-flow__node`)||ao(h,`${d}-flow__edge`)))return!0;if(!o&&!g&&!s&&!a&&!n||l||ao(h,c)&&h.type==="wheel"||ao(h,f)&&(h.type!=="wheel"||s&&h.type==="wheel"&&!e)||!n&&h.ctrlKey&&h.type==="wheel")return!1;if(!n&&h.type==="touchstart"&&h.touches?.length>1)return h.preventDefault(),!1;if(!g&&!s&&!p&&h.type==="wheel"||!o&&(h.type==="mousedown"||h.type==="touchstart")||Array.isArray(o)&&!o.includes(h.button)&&h.type==="mousedown")return!1;const m=Array.isArray(o)&&o.includes(h.button)||!h.button||h.button<=1;return(!h.ctrlKey||h.type==="wheel")&&m}}function tC({domNode:e,minZoom:t,maxZoom:n,paneClickDistance:o,translateExtent:s,viewport:a,onPanZoom:l,onPanZoomStart:c,onPanZoomEnd:f,onDraggingChange:d}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{x:0,y:0,zoom:0},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),p=vp().clickDistance(!Jt(o)||o<0?0:o).scaleExtent([t,n]).translateExtent(s),m=Ot(e).call(p);w({x:a.x,y:a.y,zoom:ro(a.zoom,t,n)},[[0,0],[g.width,g.height]],s);const x=m.on("wheel.zoom"),v=m.on("dblclick.zoom");p.wheelDelta(sg);function b(U,q){return m?new Promise(C=>{p?.interpolate(q?.interpolate==="linear"?Jo:ks).transform(Fc(m,q?.duration,q?.ease,()=>C(!0)),U)}):Promise.resolve(!1)}function _({noWheelClassName:U,noPanClassName:q,onPaneContextMenu:C,userSelectionActive:H,panOnScroll:B,panOnDrag:R,panOnScrollMode:P,panOnScrollSpeed:W,preventScrolling:$,zoomOnPinch:G,zoomOnScroll:J,zoomOnDoubleClick:re,zoomActivationKeyPressed:se,lib:ce,onTransformChange:ge}){H&&!h.isZoomingOrPanning&&N();const Q=B&&!se&&!H?qE({zoomPanValues:h,noWheelClassName:U,d3Selection:m,d3Zoom:p,panOnScrollMode:P,panOnScrollSpeed:W,zoomOnPinch:G,onPanZoomStart:c,onPanZoom:l,onPanZoomEnd:f}):KE({noWheelClassName:U,preventScrolling:$,d3ZoomHandler:x});if(m.on("wheel.zoom",Q,{passive:!1}),!H){const fe=ZE({zoomPanValues:h,onDraggingChange:d,onPanZoomStart:c});p.on("start",fe);const de=QE({zoomPanValues:h,panOnDrag:R,onPaneContextMenu:!!C,onPanZoom:l,onTransformChange:ge});p.on("zoom",de);const ue=JE({zoomPanValues:h,panOnDrag:R,panOnScroll:B,onPaneContextMenu:C,onPanZoomEnd:f,onDraggingChange:d});p.on("end",ue)}const ae=eC({zoomActivationKeyPressed:se,panOnDrag:R,zoomOnScroll:J,panOnScroll:B,zoomOnDoubleClick:re,zoomOnPinch:G,userSelectionActive:H,noPanClassName:q,noWheelClassName:U,lib:ce});p.filter(ae),re?m.on("dblclick.zoom",v):m.on("dblclick.zoom",null)}function N(){p.on("zoom",null)}async function w(U,q,C){const H=Bc(U),B=p?.constrain()(H,q,C);return B&&await b(B),new Promise(R=>R(B))}async function E(U,q){const C=Bc(U);return await b(C,q),new Promise(H=>H(C))}function O(U){if(m){const q=Bc(U),C=m.property("__zoom");(C.k!==U.zoom||C.x!==U.x||C.y!==U.y)&&p?.transform(m,q,null,{sync:!0})}}function k(){const U=m?mp(m.node()):{x:0,y:0,k:1};return{x:U.x,y:U.y,zoom:U.k}}function M(U,q){return m?new Promise(C=>{p?.interpolate(q?.interpolate==="linear"?Jo:ks).scaleTo(Fc(m,q?.duration,q?.ease,()=>C(!0)),U)}):Promise.resolve(!1)}function D(U,q){return m?new Promise(C=>{p?.interpolate(q?.interpolate==="linear"?Jo:ks).scaleBy(Fc(m,q?.duration,q?.ease,()=>C(!0)),U)}):Promise.resolve(!1)}function V(U){p?.scaleExtent(U)}function K(U){p?.translateExtent(U)}function Z(U){const q=!Jt(U)||U<0?0:U;p?.clickDistance(q)}return{update:_,destroy:N,setViewport:E,setViewportConstrained:w,getViewport:k,scaleTo:M,scaleBy:D,setScaleExtent:V,setTranslateExtent:K,syncViewport:O,setClickDistance:Z}}var Ar;(function(e){e.Line="line",e.Handle="handle"})(Ar||(Ar={}));function nC({width:e,prevWidth:t,height:n,prevHeight:o,affectsX:s,affectsY:a}){const l=e-t,c=n-o,f=[l>0?1:l<0?-1:0,c>0?1:c<0?-1:0];return l&&s&&(f[0]=f[0]*-1),c&&a&&(f[1]=f[1]*-1),f}function rC(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),o=e.includes("left"),s=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:o,affectsY:s}}function Qn(e,t){return Math.max(0,t-e)}function Jn(e,t){return Math.max(0,e-t)}function Zs(e,t,n){return Math.max(0,t-e,e-n)}function ag(e,t){return e?!t:t}function oC(e,t,n,o,s,a,l,c){let{affectsX:f,affectsY:d}=t;const{isHorizontal:h,isVertical:g}=t,p=h&&g,{xSnapped:m,ySnapped:x}=n,{minWidth:v,maxWidth:b,minHeight:_,maxHeight:N}=o,{x:w,y:E,width:O,height:k,aspectRatio:M}=e;let D=Math.floor(h?m-e.pointerX:0),V=Math.floor(g?x-e.pointerY:0);const K=O+(f?-D:D),Z=k+(d?-V:V),U=-a[0]*O,q=-a[1]*k;let C=Zs(K,v,b),H=Zs(Z,_,N);if(l){let P=0,W=0;f&&D<0?P=Qn(w+D+U,l[0][0]):!f&&D>0&&(P=Jn(w+K+U,l[1][0])),d&&V<0?W=Qn(E+V+q,l[0][1]):!d&&V>0&&(W=Jn(E+Z+q,l[1][1])),C=Math.max(C,P),H=Math.max(H,W)}if(c){let P=0,W=0;f&&D>0?P=Jn(w+D,c[0][0]):!f&&D<0&&(P=Qn(w+K,c[1][0])),d&&V>0?W=Jn(E+V,c[0][1]):!d&&V<0&&(W=Qn(E+Z,c[1][1])),C=Math.max(C,P),H=Math.max(H,W)}if(s){if(h){const P=Zs(K/M,_,N)*M;if(C=Math.max(C,P),l){let W=0;!f&&!d||f&&!d&&p?W=Jn(E+q+K/M,l[1][1])*M:W=Qn(E+q+(f?D:-D)/M,l[0][1])*M,C=Math.max(C,W)}if(c){let W=0;!f&&!d||f&&!d&&p?W=Qn(E+K/M,c[1][1])*M:W=Jn(E+(f?D:-D)/M,c[0][1])*M,C=Math.max(C,W)}}if(g){const P=Zs(Z*M,v,b)/M;if(H=Math.max(H,P),l){let W=0;!f&&!d||d&&!f&&p?W=Jn(w+Z*M+U,l[1][0])/M:W=Qn(w+(d?V:-V)*M+U,l[0][0])/M,H=Math.max(H,W)}if(c){let W=0;!f&&!d||d&&!f&&p?W=Qn(w+Z*M,c[1][0])/M:W=Jn(w+(d?V:-V)*M,c[0][0])/M,H=Math.max(H,W)}}}V=V+(V<0?H:-H),D=D+(D<0?C:-C),s&&(p?K>Z*M?V=(ag(f,d)?-D:D)/M:D=(ag(f,d)?-V:V)*M:h?(V=D/M,d=f):(D=V*M,f=d));const B=f?w+D:w,R=d?E+V:E;return{width:O+(f?-D:D),height:k+(d?-V:V),x:a[0]*D*(f?-1:1)+B,y:a[1]*V*(d?-1:1)+R}}const lg={width:0,height:0,x:0,y:0},iC={...lg,pointerX:0,pointerY:0,aspectRatio:1};function sC(e){return[[0,0],[e.measured.width,e.measured.height]]}function aC(e,t,n){const o=t.position.x+e.position.x,s=t.position.y+e.position.y,a=e.measured.width??0,l=e.measured.height??0,c=n[0]*a,f=n[1]*l;return[[o-c,s-f],[o+a-c,s+l-f]]}function lC({domNode:e,nodeId:t,getStoreItems:n,onChange:o,onEnd:s}){const a=Ot(e);function l({controlPosition:f,boundaries:d,keepAspectRatio:h,resizeDirection:g,onResizeStart:p,onResize:m,onResizeEnd:x,shouldResize:v}){let b={...lg},_={...iC};const N=rC(f);let w,E=null,O=[],k,M,D;const V=Vh().on("start",K=>{const{nodeLookup:Z,transform:U,snapGrid:q,snapToGrid:C,nodeOrigin:H,paneDomNode:B}=n();if(w=Z.get(t),!w)return;E=B?.getBoundingClientRect()??null;const{xSnapped:R,ySnapped:P}=di(K.sourceEvent,{transform:U,snapGrid:q,snapToGrid:C,containerBounds:E});b={width:w.measured.width??0,height:w.measured.height??0,x:w.position.x??0,y:w.position.y??0},_={...b,pointerX:R,pointerY:P,aspectRatio:b.width/b.height},k=void 0,w.parentId&&(w.extent==="parent"||w.expandParent)&&(k=Z.get(w.parentId),M=k&&w.extent==="parent"?sC(k):void 0),O=[],D=void 0;for(const[W,$]of Z)if($.parentId===t&&(O.push({id:W,position:{...$.position},extent:$.extent}),$.extent==="parent"||$.expandParent)){const G=aC($,w,$.origin??H);D?D=[[Math.min(G[0][0],D[0][0]),Math.min(G[0][1],D[0][1])],[Math.max(G[1][0],D[1][0]),Math.max(G[1][1],D[1][1])]]:D=G}p?.(K,{...b})}).on("drag",K=>{const{transform:Z,snapGrid:U,snapToGrid:q,nodeOrigin:C}=n(),H=di(K.sourceEvent,{transform:Z,snapGrid:U,snapToGrid:q,containerBounds:E}),B=[];if(!w)return;const{x:R,y:P,width:W,height:$}=b,G={},J=w.origin??C,{width:re,height:se,x:ce,y:ge}=oC(_,N,H,d,h,J,M,D),te=re!==W,Q=se!==$,ae=ce!==R&&te,fe=ge!==P&&Q;if(!ae&&!fe&&!te&&!Q)return;if((ae||fe||J[0]===1||J[1]===1)&&(G.x=ae?ce:b.x,G.y=fe?ge:b.y,b.x=G.x,b.y=G.y,O.length>0)){const ye=ce-R,Le=ge-P;for(const Ze of O)Ze.position={x:Ze.position.x-ye+J[0]*(re-W),y:Ze.position.y-Le+J[1]*(se-$)},B.push(Ze)}if((te||Q)&&(G.width=te&&(!g||g==="horizontal")?re:b.width,G.height=Q&&(!g||g==="vertical")?se:b.height,b.width=G.width,b.height=G.height),k&&w.expandParent){const ye=J[0]*(G.width??0);G.x&&G.x<ye&&(b.x=ye,_.x=_.x-(G.x-ye));const Le=J[1]*(G.height??0);G.y&&G.y<Le&&(b.y=Le,_.y=_.y-(G.y-Le))}const de=nC({width:b.width,prevWidth:W,height:b.height,prevHeight:$,affectsX:N.affectsX,affectsY:N.affectsY}),ue={...b,direction:de};v?.(K,ue)!==!1&&(m?.(K,ue),o(G,B))}).on("end",K=>{x?.(K,{...b}),s?.({...b})});a.call(V)}function c(){a.on(".drag",null)}return{update:l,destroy:c}}var Qs={exports:{}},Hc={},Js={exports:{}},zc={};/**
23
23
  * @license React
24
24
  * use-sync-external-store-shim.production.js
25
25
  *
@@ -27,7 +27,7 @@ React keys must be passed directly to JSX without using spread:
27
27
  *
28
28
  * This source code is licensed under the MIT license found in the
29
29
  * LICENSE file in the root directory of this source tree.
30
- */var Ja;function bm(){if(Ja)return ei;Ja=1;var e=O;function t(h,d){return h===d&&(h!==0||1/h===1/d)||h!==h&&d!==d}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,r=e.useEffect,i=e.useLayoutEffect,s=e.useDebugValue;function a(h,d){var f=d(),p=o({inst:{value:f,getSnapshot:d}}),g=p[0].inst,x=p[1];return i(function(){g.value=f,g.getSnapshot=d,c(g)&&x({inst:g})},[h,f,d]),r(function(){return c(g)&&x({inst:g}),h(function(){c(g)&&x({inst:g})})},[h]),s(f),f}function c(h){var d=h.getSnapshot;h=h.value;try{var f=d();return!n(h,f)}catch{return!0}}function l(h,d){return d()}var u=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?l:a;return ei.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:u,ei}var ti={};/**
30
+ */var cg;function cC(){if(cg)return zc;cg=1;var e=z;function t(g,p){return g===p&&(g!==0||1/g===1/p)||g!==g&&p!==p}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,s=e.useEffect,a=e.useLayoutEffect,l=e.useDebugValue;function c(g,p){var m=p(),x=o({inst:{value:m,getSnapshot:p}}),v=x[0].inst,b=x[1];return a(function(){v.value=m,v.getSnapshot=p,f(v)&&b({inst:v})},[g,m,p]),s(function(){return f(v)&&b({inst:v}),g(function(){f(v)&&b({inst:v})})},[g]),l(m),m}function f(g){var p=g.getSnapshot;g=g.value;try{var m=p();return!n(g,m)}catch{return!0}}function d(g,p){return p()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:c;return zc.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:h,zc}var Vc={};/**
31
31
  * @license React
32
32
  * use-sync-external-store-shim.development.js
33
33
  *
@@ -35,7 +35,7 @@ React keys must be passed directly to JSX without using spread:
35
35
  *
36
36
  * This source code is licensed under the MIT license found in the
37
37
  * LICENSE file in the root directory of this source tree.
38
- */var ec;function vm(){return ec||(ec=1,process.env.NODE_ENV!=="production"&&function(){function e(f,p){return f===p&&(f!==0||1/f===1/p)||f!==f&&p!==p}function t(f,p){u||r.startTransition===void 0||(u=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var g=p();if(!h){var x=p();i(g,x)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}x=s({inst:{value:g,getSnapshot:p}});var b=x[0].inst,v=x[1];return c(function(){b.value=g,b.getSnapshot=p,n(b)&&v({inst:b})},[f,g,p]),a(function(){return n(b)&&v({inst:b}),f(function(){n(b)&&v({inst:b})})},[f]),l(g),g}function n(f){var p=f.getSnapshot;f=f.value;try{var g=p();return!i(f,g)}catch{return!0}}function o(f,p){return p()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var r=O,i=typeof Object.is=="function"?Object.is:e,s=r.useState,a=r.useEffect,c=r.useLayoutEffect,l=r.useDebugValue,u=!1,h=!1,d=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?o:t;ti.useSyncExternalStore=r.useSyncExternalStore!==void 0?r.useSyncExternalStore:d,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ti}var tc;function nc(){return tc||(tc=1,process.env.NODE_ENV==="production"?vo.exports=bm():vo.exports=vm()),vo.exports}/**
38
+ */var ug;function uC(){return ug||(ug=1,process.env.NODE_ENV!=="production"&&function(){function e(m,x){return m===x&&(m!==0||1/m===1/x)||m!==m&&x!==x}function t(m,x){h||s.startTransition===void 0||(h=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var v=x();if(!g){var b=x();a(v,b)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),g=!0)}b=l({inst:{value:v,getSnapshot:x}});var _=b[0].inst,N=b[1];return f(function(){_.value=v,_.getSnapshot=x,n(_)&&N({inst:_})},[m,v,x]),c(function(){return n(_)&&N({inst:_}),m(function(){n(_)&&N({inst:_})})},[m]),d(v),v}function n(m){var x=m.getSnapshot;m=m.value;try{var v=x();return!a(m,v)}catch{return!0}}function o(m,x){return x()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var s=z,a=typeof Object.is=="function"?Object.is:e,l=s.useState,c=s.useEffect,f=s.useLayoutEffect,d=s.useDebugValue,h=!1,g=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?o:t;Vc.useSyncExternalStore=s.useSyncExternalStore!==void 0?s.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Vc}var fg;function dg(){return fg||(fg=1,process.env.NODE_ENV==="production"?Js.exports=cC():Js.exports=uC()),Js.exports}/**
39
39
  * @license React
40
40
  * use-sync-external-store-shim/with-selector.production.js
41
41
  *
@@ -43,7 +43,7 @@ React keys must be passed directly to JSX without using spread:
43
43
  *
44
44
  * This source code is licensed under the MIT license found in the
45
45
  * LICENSE file in the root directory of this source tree.
46
- */var oc;function Em(){if(oc)return Jr;oc=1;var e=O,t=nc();function n(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}var o=typeof Object.is=="function"?Object.is:n,r=t.useSyncExternalStore,i=e.useRef,s=e.useEffect,a=e.useMemo,c=e.useDebugValue;return Jr.useSyncExternalStoreWithSelector=function(l,u,h,d,f){var p=i(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=a(function(){function b(N){if(!v){if(v=!0,m=N,N=d(N),f!==void 0&&g.hasValue){var P=g.value;if(f(P,N))return w=P}return w=N}if(P=w,o(m,N))return P;var M=d(N);return f!==void 0&&f(P,M)?(m=N,P):(m=N,w=M)}var v=!1,m,w,k=h===void 0?null:h;return[function(){return b(u())},k===null?void 0:function(){return b(k())}]},[u,h,d,f]);var x=r(l,p[0],p[1]);return s(function(){g.hasValue=!0,g.value=x},[x]),c(x),x},Jr}var ni={};/**
46
+ */var hg;function fC(){if(hg)return Hc;hg=1;var e=z,t=dg();function n(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var o=typeof Object.is=="function"?Object.is:n,s=t.useSyncExternalStore,a=e.useRef,l=e.useEffect,c=e.useMemo,f=e.useDebugValue;return Hc.useSyncExternalStoreWithSelector=function(d,h,g,p,m){var x=a(null);if(x.current===null){var v={hasValue:!1,value:null};x.current=v}else v=x.current;x=c(function(){function _(k){if(!N){if(N=!0,w=k,k=p(k),m!==void 0&&v.hasValue){var M=v.value;if(m(M,k))return E=M}return E=k}if(M=E,o(w,k))return M;var D=p(k);return m!==void 0&&m(M,D)?(w=k,M):(w=k,E=D)}var N=!1,w,E,O=g===void 0?null:g;return[function(){return _(h())},O===null?void 0:function(){return _(O())}]},[h,g,p,m]);var b=s(d,x[0],x[1]);return l(function(){v.hasValue=!0,v.value=b},[b]),f(b),b},Hc}var Wc={};/**
47
47
  * @license React
48
48
  * use-sync-external-store-shim/with-selector.development.js
49
49
  *
@@ -51,57 +51,139 @@ React keys must be passed directly to JSX without using spread:
51
51
  *
52
52
  * This source code is licensed under the MIT license found in the
53
53
  * LICENSE file in the root directory of this source tree.
54
- */var rc;function _m(){return rc||(rc=1,process.env.NODE_ENV!=="production"&&function(){function e(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=O,n=nc(),o=typeof Object.is=="function"?Object.is:e,r=n.useSyncExternalStore,i=t.useRef,s=t.useEffect,a=t.useMemo,c=t.useDebugValue;ni.useSyncExternalStoreWithSelector=function(l,u,h,d,f){var p=i(null);if(p.current===null){var g={hasValue:!1,value:null};p.current=g}else g=p.current;p=a(function(){function b(N){if(!v){if(v=!0,m=N,N=d(N),f!==void 0&&g.hasValue){var P=g.value;if(f(P,N))return w=P}return w=N}if(P=w,o(m,N))return P;var M=d(N);return f!==void 0&&f(P,M)?(m=N,P):(m=N,w=M)}var v=!1,m,w,k=h===void 0?null:h;return[function(){return b(u())},k===null?void 0:function(){return b(k())}]},[u,h,d,f]);var x=r(l,p[0],p[1]);return s(function(){g.hasValue=!0,g.value=x},[x]),c(x),x},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),ni}var ic;function Sm(){return ic||(ic=1,process.env.NODE_ENV==="production"?bo.exports=Em():bo.exports=_m()),bo.exports}var Cm=Sm();const Nm=Au(Cm),km={},sc=e=>{let t;const n=new Set,o=(u,h)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const f=t;t=h??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(p=>p(t,f))}},r=()=>t,c={setState:o,getState:r,getInitialState:()=>l,subscribe:u=>(n.add(u),()=>n.delete(u)),destroy:()=>{(km?"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()}},l=t=e(o,r,c);return c},Tm=e=>e?sc(e):sc,{useDebugValue:Mm}=O,{useSyncExternalStoreWithSelector:Am}=Nm,Pm=e=>e;function ac(e,t=Pm,n){const o=Am(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return Mm(o),o}const cc=(e,t)=>{const n=Tm(e),o=(r,i=t)=>ac(n,r,i);return Object.assign(o,n),o},Im=(e,t)=>e?cc(e,t):cc;function de(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[o,r]of e)if(!Object.is(r,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const Eo=O.createContext(null),Om=Eo.Provider,lc=xe.error001();function ie(e,t){const n=O.useContext(Eo);if(n===null)throw new Error(lc);return ac(n,e,t)}function ce(){const e=O.useContext(Eo);if(e===null)throw new Error(lc);return O.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const uc={display:"none"},Dm={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},dc="react-flow__node-desc",fc="react-flow__edge-desc",Rm="react-flow__aria-live",Lm=e=>e.ariaLiveMessage,$m=e=>e.ariaLabelConfig;function zm({rfId:e}){const t=ie(Lm);return C.jsx("div",{id:`${Rm}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:Dm,children:t})}function Hm({rfId:e,disableKeyboardA11y:t}){const n=ie($m);return C.jsxs(C.Fragment,{children:[C.jsx("div",{id:`${dc}-${e}`,style:uc,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),C.jsx("div",{id:`${fc}-${e}`,style:uc,children:n["edge.a11yDescription.default"]}),!t&&C.jsx(zm,{rfId:e})]})}const _o=O.forwardRef(({position:e="top-left",children:t,className:n,style:o,...r},i)=>{const s=`${e}`.split("-");return C.jsx("div",{className:fe(["react-flow__panel",n,...s]),style:o,ref:i,...r,children:t})});_o.displayName="Panel";function jm({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:C.jsx(_o,{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:C.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const Vm=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},So=e=>e.id;function Fm(e,t){return de(e.selectedNodes.map(So),t.selectedNodes.map(So))&&de(e.selectedEdges.map(So),t.selectedEdges.map(So))}function Bm({onSelectionChange:e}){const t=ce(),{selectedNodes:n,selectedEdges:o}=ie(Vm,Fm);return O.useEffect(()=>{const r={nodes:n,edges:o};e?.(r),t.getState().onSelectionChangeHandlers.forEach(i=>i(r))},[n,o,e]),null}const Wm=e=>!!e.onSelectionChangeHandlers;function Ym({onSelectionChange:e}){const t=ie(Wm);return e||t?C.jsx(Bm,{onSelectionChange:e}):null}const hc=[0,0],Xm={x:0,y:0,zoom:1},pc=[...["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","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","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance","ariaLabelConfig"],"rfId"],Um=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}),gc={translateExtent:ln,nodeOrigin:hc,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function Gm(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:r,setTranslateExtent:i,setNodeExtent:s,reset:a,setDefaultNodesAndEdges:c,setPaneClickDistance:l}=ie(Um,de),u=ce();O.useEffect(()=>(c(e.defaultNodes,e.defaultEdges),()=>{h.current=gc,a()}),[]);const h=O.useRef(gc);return O.useEffect(()=>{for(const d of pc){const f=e[d],p=h.current[d];f!==p&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?o(f):d==="maxZoom"?r(f):d==="translateExtent"?i(f):d==="nodeExtent"?s(f):d==="paneClickDistance"?l(f):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:Pg(f)}):d==="fitView"?u.setState({fitViewQueued:f}):d==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[d]:f})))}h.current=e},pc.map(d=>e[d])),null}function mc(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function qm(e){const[t,n]=O.useState(e==="system"?null:e);return O.useEffect(()=>{if(e!=="system"){n(e);return}const o=mc(),r=()=>n(o?.matches?"dark":"light");return r(),o?.addEventListener("change",r),()=>{o?.removeEventListener("change",r)}},[e]),t!==null?t:mc()?.matches?"dark":"light"}const yc=typeof document<"u"?document:null;function xn(e=null,t={target:yc,actInsideInputWithModifier:!0}){const[n,o]=O.useState(!1),r=O.useRef(!1),i=O.useRef(new Set([])),[s,a]=O.useMemo(()=>{if(e!==null){const l=(Array.isArray(e)?e:[e]).filter(h=>typeof h=="string").map(h=>h.replace("+",`
54
+ */var pg;function dC(){return pg||(pg=1,process.env.NODE_ENV!=="production"&&function(){function e(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=z,n=dg(),o=typeof Object.is=="function"?Object.is:e,s=n.useSyncExternalStore,a=t.useRef,l=t.useEffect,c=t.useMemo,f=t.useDebugValue;Wc.useSyncExternalStoreWithSelector=function(d,h,g,p,m){var x=a(null);if(x.current===null){var v={hasValue:!1,value:null};x.current=v}else v=x.current;x=c(function(){function _(k){if(!N){if(N=!0,w=k,k=p(k),m!==void 0&&v.hasValue){var M=v.value;if(m(M,k))return E=M}return E=k}if(M=E,o(w,k))return M;var D=p(k);return m!==void 0&&m(M,D)?(w=k,M):(w=k,E=D)}var N=!1,w,E,O=g===void 0?null:g;return[function(){return _(h())},O===null?void 0:function(){return _(O())}]},[h,g,p,m]);var b=s(d,x[0],x[1]);return l(function(){v.hasValue=!0,v.value=b},[b]),f(b),b},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Wc}var gg;function hC(){return gg||(gg=1,process.env.NODE_ENV==="production"?Qs.exports=fC():Qs.exports=dC()),Qs.exports}var pC=hC();const gC=Vd(pC),mC={},mg=e=>{let t;const n=new Set,o=(h,g)=>{const p=typeof h=="function"?h(t):h;if(!Object.is(p,t)){const m=t;t=g??(typeof p!="object"||p===null)?p:Object.assign({},t,p),n.forEach(x=>x(t,m))}},s=()=>t,f={setState:o,getState:s,getInitialState:()=>d,subscribe:h=>(n.add(h),()=>n.delete(h)),destroy:()=>{(mC?"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()}},d=t=e(o,s,f);return f},yC=e=>e?mg(e):mg,{useDebugValue:vC}=z,{useSyncExternalStoreWithSelector:xC}=gC,wC=e=>e;function yg(e,t=wC,n){const o=xC(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return vC(o),o}const vg=(e,t)=>{const n=yC(e),o=(s,a=t)=>yg(n,s,a);return Object.assign(o,n),o},bC=(e,t)=>e?vg(e,t):vg;function qe(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[o,s]of e)if(!Object.is(s,t.get(o)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const o of e)if(!t.has(o))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const o of n)if(!Object.prototype.hasOwnProperty.call(t,o)||!Object.is(e[o],t[o]))return!1;return!0}const ea=z.createContext(null),_C=ea.Provider,xg=_t.error001();function Re(e,t){const n=z.useContext(ea);if(n===null)throw new Error(xg);return yg(n,e,t)}function je(){const e=z.useContext(ea);if(e===null)throw new Error(xg);return z.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const wg={display:"none"},SC={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},bg="react-flow__node-desc",_g="react-flow__edge-desc",EC="react-flow__aria-live",CC=e=>e.ariaLiveMessage,NC=e=>e.ariaLabelConfig;function TC({rfId:e}){const t=Re(CC);return T.jsx("div",{id:`${EC}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:SC,children:t})}function AC({rfId:e,disableKeyboardA11y:t}){const n=Re(NC);return T.jsxs(T.Fragment,{children:[T.jsx("div",{id:`${bg}-${e}`,style:wg,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),T.jsx("div",{id:`${_g}-${e}`,style:wg,children:n["edge.a11yDescription.default"]}),!t&&T.jsx(TC,{rfId:e})]})}const ta=z.forwardRef(({position:e="top-left",children:t,className:n,style:o,...s},a)=>{const l=`${e}`.split("-");return T.jsx("div",{className:nt(["react-flow__panel",n,...l]),style:o,ref:a,...s,children:t})});ta.displayName="Panel";function IC({proOptions:e,position:t="bottom-right"}){return e?.hideAttribution?null:T.jsx(ta,{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 OC=e=>{const t=[],n=[];for(const[,o]of e.nodeLookup)o.selected&&t.push(o.internals.userNode);for(const[,o]of e.edgeLookup)o.selected&&n.push(o);return{selectedNodes:t,selectedEdges:n}},na=e=>e.id;function PC(e,t){return qe(e.selectedNodes.map(na),t.selectedNodes.map(na))&&qe(e.selectedEdges.map(na),t.selectedEdges.map(na))}function kC({onSelectionChange:e}){const t=je(),{selectedNodes:n,selectedEdges:o}=Re(OC,PC);return z.useEffect(()=>{const s={nodes:n,edges:o};e?.(s),t.getState().onSelectionChangeHandlers.forEach(a=>a(s))},[n,o,e]),null}const MC=e=>!!e.onSelectionChangeHandlers;function RC({onSelectionChange:e}){const t=Re(MC);return e||t?T.jsx(kC,{onSelectionChange:e}):null}const Sg=[0,0],DC={x:0,y:0,zoom:1},Eg=[...["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","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","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","paneClickDistance","ariaLabelConfig"],"rfId"],LC=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}),Cg={translateExtent:ii,nodeOrigin:Sg,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1",paneClickDistance:0};function $C(e){const{setNodes:t,setEdges:n,setMinZoom:o,setMaxZoom:s,setTranslateExtent:a,setNodeExtent:l,reset:c,setDefaultNodesAndEdges:f,setPaneClickDistance:d}=Re(LC,qe),h=je();z.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{g.current=Cg,c()}),[]);const g=z.useRef(Cg);return z.useEffect(()=>{for(const p of Eg){const m=e[p],x=g.current[p];m!==x&&(typeof e[p]>"u"||(p==="nodes"?t(m):p==="edges"?n(m):p==="minZoom"?o(m):p==="maxZoom"?s(m):p==="translateExtent"?a(m):p==="nodeExtent"?l(m):p==="paneClickDistance"?d(m):p==="ariaLabelConfig"?h.setState({ariaLabelConfig:wE(m)}):p==="fitView"?h.setState({fitViewQueued:m}):p==="fitViewOptions"?h.setState({fitViewOptions:m}):h.setState({[p]:m})))}g.current=e},Eg.map(p=>e[p])),null}function Ng(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function BC(e){const[t,n]=z.useState(e==="system"?null:e);return z.useEffect(()=>{if(e!=="system"){n(e);return}const o=Ng(),s=()=>n(o?.matches?"dark":"light");return s(),o?.addEventListener("change",s),()=>{o?.removeEventListener("change",s)}},[e]),t!==null?t:Ng()?.matches?"dark":"light"}const Tg=typeof document<"u"?document:null;function pi(e=null,t={target:Tg,actInsideInputWithModifier:!0}){const[n,o]=z.useState(!1),s=z.useRef(!1),a=z.useRef(new Set([])),[l,c]=z.useMemo(()=>{if(e!==null){const d=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
55
55
  `).replace(`
56
56
 
57
57
  `,`
58
58
  +`).split(`
59
- `)),u=l.reduce((h,d)=>h.concat(...d),[]);return[l,u]}return[[],[]]},[e]);return O.useEffect(()=>{const c=t?.target??yc,l=t?.actInsideInputWithModifier??!0;if(e!==null){const u=f=>{if(r.current=f.ctrlKey||f.metaKey||f.shiftKey||f.altKey,(!r.current||r.current&&!l)&&Ta(f))return!1;const g=wc(f.code,a);if(i.current.add(f[g]),xc(s,i.current,!1)){const x=f.composedPath?.()?.[0]||f.target,b=x?.nodeName==="BUTTON"||x?.nodeName==="A";t.preventDefault!==!1&&(r.current||!b)&&f.preventDefault(),o(!0)}},h=f=>{const p=wc(f.code,a);xc(s,i.current,!0)?(o(!1),i.current.clear()):i.current.delete(f[p]),f.key==="Meta"&&i.current.clear(),r.current=!1},d=()=>{i.current.clear(),o(!1)};return c?.addEventListener("keydown",u),c?.addEventListener("keyup",h),window.addEventListener("blur",d),window.addEventListener("contextmenu",d),()=>{c?.removeEventListener("keydown",u),c?.removeEventListener("keyup",h),window.removeEventListener("blur",d),window.removeEventListener("contextmenu",d)}}},[e,o]),n}function xc(e,t,n){return e.filter(o=>n||o.length===t.size).some(o=>o.every(r=>t.has(r)))}function wc(e,t){return t.includes(e)?"code":"key"}const Zm=()=>{const e=ce();return O.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,r,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??o,y:t.y??r,zoom:t.zoom??i},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{const{width:o,height:r,minZoom:i,maxZoom:s,panZoom:a}=e.getState(),c=jr(t,o,r,i,s,n?.padding??.1);return a?(await a.setViewport(c,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:r,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:a,y:c}=s.getBoundingClientRect(),l={x:t.x-a,y:t.y-c},u=n.snapGrid??r,h=n.snapToGrid??i;return pn(l,o,h,u)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:r,y:i}=o.getBoundingClientRect(),s=po(t,n);return{x:s.x+r,y:s.y+i}}}),[])};function bc(e,t){const n=[],o=new Map,r=[];for(const i of e)if(i.type==="add"){r.push(i);continue}else if(i.type==="remove"||i.type==="replace")o.set(i.id,[i]);else{const s=o.get(i.id);s?s.push(i):o.set(i.id,[i])}for(const i of t){const s=o.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const a={...i};for(const c of s)Km(c,a);n.push(a)}return r.length&&r.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function Km(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.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function vc(e,t){return bc(e,t)}function wn(e,t){return bc(e,t)}function ht(e,t){return{id:e,type:"select",selected:t}}function Lt(e,t=new Set,n=!1){const o=[];for(const[r,i]of e){const s=t.has(r);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),o.push(ht(i.id,s)))}return o}function Ec({items:e=[],lookup:t}){const n=[],o=new Map(e.map(r=>[r.id,r]));for(const[r,i]of e.entries()){const s=t.get(i.id),a=s?.internals?.userNode??s;a!==void 0&&a!==i&&n.push({id:i.id,item:i,type:"replace"}),a===void 0&&n.push({item:i,type:"add",index:r})}for(const[r]of t)o.get(r)===void 0&&n.push({id:r,type:"remove"});return n}function _c(e){return{id:e.id,type:"remove"}}const Sc=e=>Eg(e),Qm=e=>ma(e);function Cc(e){return O.forwardRef(e)}const Jm=typeof window<"u"?O.useLayoutEffect:O.useEffect;function Nc(e){const[t,n]=O.useState(BigInt(0)),[o]=O.useState(()=>ey(()=>n(r=>r+BigInt(1))));return Jm(()=>{const r=o.get();r.length&&(e(r),o.reset())},[t]),o}function ey(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const kc=O.createContext(null);function ty({children:e}){const t=ce(),n=O.useCallback(a=>{const{nodes:c=[],setNodes:l,hasDefaultNodes:u,onNodesChange:h,nodeLookup:d,fitViewQueued:f}=t.getState();let p=c;for(const x of a)p=typeof x=="function"?x(p):x;const g=Ec({items:p,lookup:d});u&&l(p),g.length>0?h?.(g):f&&window.requestAnimationFrame(()=>{const{fitViewQueued:x,nodes:b,setNodes:v}=t.getState();x&&v(b)})},[]),o=Nc(n),r=O.useCallback(a=>{const{edges:c=[],setEdges:l,hasDefaultEdges:u,onEdgesChange:h,edgeLookup:d}=t.getState();let f=c;for(const p of a)f=typeof p=="function"?p(f):p;u?l(f):h&&h(Ec({items:f,lookup:d}))},[]),i=Nc(r),s=O.useMemo(()=>({nodeQueue:o,edgeQueue:i}),[]);return C.jsx(kc.Provider,{value:s,children:e})}function ny(){const e=O.useContext(kc);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const oy=e=>!!e.panZoom;function bn(){const e=Zm(),t=ce(),n=ny(),o=ie(oy),r=O.useMemo(()=>{const i=h=>t.getState().nodeLookup.get(h),s=h=>{n.nodeQueue.push(h)},a=h=>{n.edgeQueue.push(h)},c=h=>{const{nodeLookup:d,nodeOrigin:f}=t.getState(),p=Sc(h)?h:d.get(h.id),g=p.parentId?Ca(p.position,p.measured,p.parentId,d,f):p.position,x={...p,position:g,width:p.measured?.width??p.width,height:p.measured?.height??p.height};return It(x)},l=(h,d,f={replace:!1})=>{s(p=>p.map(g=>{if(g.id===h){const x=typeof d=="function"?d(g):d;return f.replace&&Sc(x)?x:{...g,...x}}return g}))},u=(h,d,f={replace:!1})=>{a(p=>p.map(g=>{if(g.id===h){const x=typeof d=="function"?d(g):d;return f.replace&&Qm(x)?x:{...g,...x}}return g}))};return{getNodes:()=>t.getState().nodes.map(h=>({...h})),getNode:h=>i(h)?.internals.userNode,getInternalNode:i,getEdges:()=>{const{edges:h=[]}=t.getState();return h.map(d=>({...d}))},getEdge:h=>t.getState().edgeLookup.get(h),setNodes:s,setEdges:a,addNodes:h=>{const d=Array.isArray(h)?h:[h];n.nodeQueue.push(f=>[...f,...d])},addEdges:h=>{const d=Array.isArray(h)?h:[h];n.edgeQueue.push(f=>[...f,...d])},toObject:()=>{const{nodes:h=[],edges:d=[],transform:f}=t.getState(),[p,g,x]=f;return{nodes:h.map(b=>({...b})),edges:d.map(b=>({...b})),viewport:{x:p,y:g,zoom:x}}},deleteElements:async({nodes:h=[],edges:d=[]})=>{const{nodes:f,edges:p,onNodesDelete:g,onEdgesDelete:x,triggerNodeChanges:b,triggerEdgeChanges:v,onDelete:m,onBeforeDelete:w}=t.getState(),{nodes:k,edges:N}=await kg({nodesToRemove:h,edgesToRemove:d,nodes:f,edges:p,onBeforeDelete:w}),P=N.length>0,M=k.length>0;if(P){const L=N.map(_c);x?.(N),v(L)}if(M){const L=k.map(_c);g?.(k),b(L)}return(M||P)&&m?.({nodes:k,edges:N}),{deletedNodes:k,deletedEdges:N}},getIntersectingNodes:(h,d=!0,f)=>{const p=Ea(h),g=p?h:c(h),x=f!==void 0;return g?(f||t.getState().nodes).filter(b=>{const v=t.getState().nodeLookup.get(b.id);if(v&&!p&&(b.id===h.id||!v.internals.positionAbsolute))return!1;const m=It(x?b:v),w=fn(m,g);return d&&w>0||w>=m.width*m.height||w>=g.width*g.height}):[]},isNodeIntersecting:(h,d,f=!0)=>{const g=Ea(h)?h:c(h);if(!g)return!1;const x=fn(g,d);return f&&x>0||x>=g.width*g.height},updateNode:l,updateNodeData:(h,d,f={replace:!1})=>{l(h,p=>{const g=typeof d=="function"?d(p):d;return f.replace?{...p,data:g}:{...p,data:{...p.data,...g}}},f)},updateEdge:u,updateEdgeData:(h,d,f={replace:!1})=>{u(h,p=>{const g=typeof d=="function"?d(p):d;return f.replace?{...p,data:g}:{...p,data:{...p.data,...g}}},f)},getNodesBounds:h=>{const{nodeLookup:d,nodeOrigin:f}=t.getState();return Sg(h,{nodeLookup:d,nodeOrigin:f})},getHandleConnections:({type:h,id:d,nodeId:f})=>Array.from(t.getState().connectionLookup.get(`${f}-${h}${d?`-${d}`:""}`)?.values()??[]),getNodeConnections:({type:h,handleId:d,nodeId:f})=>Array.from(t.getState().connectionLookup.get(`${f}${h?d?`-${h}-${d}`:`-${h}`:""}`)?.values()??[]),fitView:async h=>{const d=t.getState().fitViewResolver??Ag();return t.setState({fitViewQueued:!0,fitViewOptions:h,fitViewResolver:d}),n.nodeQueue.push(f=>[...f]),d.promise}}},[]);return O.useMemo(()=>({...r,...e,viewportInitialized:o}),[o])}const Tc=e=>e.selected,ry=typeof window<"u"?window:void 0;function iy({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=ce(),{deleteElements:o}=bn(),r=xn(e,{actInsideInputWithModifier:!1}),i=xn(t,{target:ry});O.useEffect(()=>{if(r){const{edges:s,nodes:a}=n.getState();o({nodes:a.filter(Tc),edges:s.filter(Tc)}),n.setState({nodesSelectionActive:!1})}},[r]),O.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function sy(e){const t=ce();O.useEffect(()=>{const n=()=>{if(!e.current)return!1;const o=Vr(e.current);(o.height===0||o.width===0)&&t.getState().onError?.("004",xe.error004()),t.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(e.current),()=>{window.removeEventListener("resize",n),o&&e.current&&o.unobserve(e.current)}}},[])}const Co={position:"absolute",width:"100%",height:"100%",top:0,left:0},ay=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function cy({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:r=.5,panOnScrollMode:i=ut.Free,zoomOnDoubleClick:s=!0,panOnDrag:a=!0,defaultViewport:c,translateExtent:l,minZoom:u,maxZoom:h,zoomActivationKeyCode:d,preventScrolling:f=!0,children:p,noWheelClassName:g,noPanClassName:x,onViewportChange:b,isControlledViewport:v,paneClickDistance:m}){const w=ce(),k=O.useRef(null),{userSelectionActive:N,lib:P}=ie(ay,de),M=xn(d),L=O.useRef();sy(k);const H=O.useCallback(j=>{b?.({x:j[0],y:j[1],zoom:j[2]}),v||w.setState({transform:j})},[b,v]);return O.useEffect(()=>{if(k.current){L.current=fm({domNode:k.current,minZoom:u,maxZoom:h,translateExtent:l,viewport:c,paneClickDistance:m,onDraggingChange:y=>w.setState({paneDragging:y}),onPanZoomStart:(y,A)=>{const{onViewportChangeStart:T,onMoveStart:S}=w.getState();S?.(y,A),T?.(A)},onPanZoom:(y,A)=>{const{onViewportChange:T,onMove:S}=w.getState();S?.(y,A),T?.(A)},onPanZoomEnd:(y,A)=>{const{onViewportChangeEnd:T,onMoveEnd:S}=w.getState();S?.(y,A),T?.(A)}});const{x:j,y:R,zoom:$}=L.current.getViewport();return w.setState({panZoom:L.current,transform:[j,R,$],domNode:k.current.closest(".react-flow")}),()=>{L.current?.destroy()}}},[]),O.useEffect(()=>{L.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:r,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:a,zoomActivationKeyPressed:M,preventScrolling:f,noPanClassName:x,userSelectionActive:N,noWheelClassName:g,lib:P,onTransformChange:H})},[e,t,n,o,r,i,s,a,M,f,x,N,g,P,H]),C.jsx("div",{className:"react-flow__renderer",ref:k,style:Co,children:p})}const ly=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function uy(){const{userSelectionActive:e,userSelectionRect:t}=ie(ly,de);return e&&t?C.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 oi=(e,t)=>n=>{n.target===t.current&&e?.(n)},dy=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function fy({isSelecting:e,selectionKeyPressed:t,selectionMode:n=At.Full,panOnDrag:o,selectionOnDrag:r,onSelectionStart:i,onSelectionEnd:s,onPaneClick:a,onPaneContextMenu:c,onPaneScroll:l,onPaneMouseEnter:u,onPaneMouseMove:h,onPaneMouseLeave:d,children:f}){const p=ce(),{userSelectionActive:g,elementsSelectable:x,dragging:b,connectionInProgress:v}=ie(dy,de),m=x&&(e||g),w=O.useRef(null),k=O.useRef(),N=O.useRef(new Set),P=O.useRef(new Set),M=O.useRef(!1),L=O.useRef(!1),H=S=>{if(M.current||v){M.current=!1;return}a?.(S),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},j=S=>{if(Array.isArray(o)&&o?.includes(2)){S.preventDefault();return}c?.(S)},R=l?S=>l(S):void 0,$=S=>{const{resetSelectedElements:E,domNode:I}=p.getState();if(k.current=I?.getBoundingClientRect(),!x||!e||S.button!==0||S.target!==w.current||!k.current)return;S.target?.setPointerCapture?.(S.pointerId),L.current=!0,M.current=!1;const{x:_,y:D}=$e(S.nativeEvent,k.current);E(),p.setState({userSelectionRect:{width:0,height:0,startX:_,startY:D,x:_,y:D}}),i?.(S)},y=S=>{const{userSelectionRect:E,transform:I,nodeLookup:_,edgeLookup:D,connectionLookup:z,triggerNodeChanges:F,triggerEdgeChanges:B,defaultEdgeOptions:Y}=p.getState();if(!k.current||!E)return;M.current=!0;const{x:K,y:W}=$e(S.nativeEvent,k.current),{startX:V,startY:X}=E,J={startX:V,startY:X,x:K<V?K:V,y:W<X?W:X,width:Math.abs(K-V),height:Math.abs(W-X)},te=N.current,Z=P.current;N.current=new Set($r(_,J,I,n===At.Partial,!0).map(ne=>ne.id)),P.current=new Set;const oe=Y?.selectable??!0;for(const ne of N.current){const ue=z.get(ne);if(ue)for(const{edgeId:ge}of ue.values()){const Ie=D.get(ge);Ie&&(Ie.selectable??oe)&&P.current.add(ge)}}if(!Na(te,N.current)){const ne=Lt(_,N.current,!0);F(ne)}if(!Na(Z,P.current)){const ne=Lt(D,P.current);B(ne)}p.setState({userSelectionRect:J,userSelectionActive:!0,nodesSelectionActive:!1})},A=S=>{if(S.button!==0||!L.current)return;S.target?.releasePointerCapture?.(S.pointerId);const{userSelectionRect:E}=p.getState();!g&&E&&S.target===w.current&&H?.(S),p.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:N.current.size>0}),s?.(S),(t||r)&&(M.current=!1),L.current=!1},T=o===!0||Array.isArray(o)&&o.includes(0);return C.jsxs("div",{className:fe(["react-flow__pane",{draggable:T,dragging:b,selection:e}]),onClick:m?void 0:oi(H,w),onContextMenu:oi(j,w),onWheel:oi(R,w),onPointerEnter:m?void 0:u,onPointerDown:m?$:h,onPointerMove:m?y:h,onPointerUp:m?A:void 0,onPointerLeave:d,ref:w,style:Co,children:[f,C.jsx(uy,{})]})}function ri({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:r,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:a,onError:c}=t.getState(),l=a.get(e);if(!l){c?.("012",xe.error012(e));return}t.setState({nodesSelectionActive:!1}),l.selected?(n||l.selected&&s)&&(i({nodes:[l],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):r([e])}function Mc({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:r,isSelectable:i,nodeClickDistance:s}){const a=ce(),[c,l]=O.useState(!1),u=O.useRef();return O.useEffect(()=>{u.current=Kg({getStoreItems:()=>a.getState(),onNodeMouseDown:h=>{ri({id:h,store:a,nodeRef:e})},onDragStart:()=>{l(!0)},onDragStop:()=>{l(!1)}})},[]),O.useEffect(()=>{if(t)u.current?.destroy();else if(e.current)return u.current?.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:i,nodeId:r,nodeClickDistance:s}),()=>{u.current?.destroy()}},[n,o,t,i,e,r]),c}const hy=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Ac(){const e=ce();return O.useCallback(n=>{const{nodeExtent:o,snapToGrid:r,snapGrid:i,nodesDraggable:s,onError:a,updateNodePositions:c,nodeLookup:l,nodeOrigin:u}=e.getState(),h=new Map,d=hy(s),f=r?i[0]:5,p=r?i[1]:5,g=n.direction.x*f*n.factor,x=n.direction.y*p*n.factor;for(const[,b]of l){if(!d(b))continue;let v={x:b.internals.positionAbsolute.x+g,y:b.internals.positionAbsolute.y+x};r&&(v=hn(v,i));const{position:m,positionAbsolute:w}=ya({nodeId:b.id,nextPosition:v,nodeLookup:l,nodeExtent:o,nodeOrigin:u,onError:a});b.position=m,b.internals.positionAbsolute=w,h.set(b.id,b)}c(h)},[])}const ii=O.createContext(null),py=ii.Provider;ii.Consumer;const No=()=>O.useContext(ii),gy=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),my=(e,t,n)=>o=>{const{connectionClickStartHandle:r,connectionMode:i,connection:s}=o,{fromHandle:a,toHandle:c,isValid:l}=s,u=c?.nodeId===e&&c?.id===t&&c?.type===n;return{connectingFrom:a?.nodeId===e&&a?.id===t&&a?.type===n,connectingTo:u,clickConnecting:r?.nodeId===e&&r?.id===t&&r?.type===n,isPossibleEndHandle:i===Mt.Strict?a?.type!==n:e!==a?.nodeId||t!==a?.id,connectionInProcess:!!a,clickConnectionInProcess:!!r,valid:u&&l}};function yy({type:e="source",position:t=Q.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:r=!0,isConnectableEnd:i=!0,id:s,onConnect:a,children:c,className:l,onMouseDown:u,onTouchStart:h,...d},f){const p=s||null,g=e==="target",x=ce(),b=No(),{connectOnClick:v,noPanClassName:m,rfId:w}=ie(gy,de),{connectingFrom:k,connectingTo:N,clickConnecting:P,isPossibleEndHandle:M,connectionInProcess:L,clickConnectionInProcess:H,valid:j}=ie(my(b,p,e),de);b||x.getState().onError?.("010",xe.error010());const R=A=>{const{defaultEdgeOptions:T,onConnect:S,hasDefaultEdges:E}=x.getState(),I={...T,...A};if(E){const{edges:_,setEdges:D}=x.getState();D(yo(I,_))}S?.(I),a?.(I)},$=A=>{if(!b)return;const T=Ma(A.nativeEvent);if(r&&(T&&A.button===0||!T)){const S=x.getState();Zr.onPointerDown(A.nativeEvent,{handleDomNode:A.currentTarget,autoPanOnConnect:S.autoPanOnConnect,connectionMode:S.connectionMode,connectionRadius:S.connectionRadius,domNode:S.domNode,nodeLookup:S.nodeLookup,lib:S.lib,isTarget:g,handleId:p,nodeId:b,flowId:S.rfId,panBy:S.panBy,cancelConnection:S.cancelConnection,onConnectStart:S.onConnectStart,onConnectEnd:S.onConnectEnd,updateConnection:S.updateConnection,onConnect:R,isValidConnection:n||S.isValidConnection,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:S.autoPanSpeed,dragThreshold:S.connectionDragThreshold})}T?u?.(A):h?.(A)},y=A=>{const{onClickConnectStart:T,onClickConnectEnd:S,connectionClickStartHandle:E,connectionMode:I,isValidConnection:_,lib:D,rfId:z,nodeLookup:F,connection:B}=x.getState();if(!b||!E&&!r)return;if(!E){T?.(A.nativeEvent,{nodeId:b,handleId:p,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:b,type:e,id:p}});return}const Y=ka(A.target),K=n||_,{connection:W,isValid:V}=Zr.isValid(A.nativeEvent,{handle:{nodeId:b,id:p,type:e},connectionMode:I,fromNodeId:E.nodeId,fromHandleId:E.id||null,fromType:E.type,isValidConnection:K,flowId:z,doc:Y,lib:D,nodeLookup:F});V&&W&&R(W);const X=structuredClone(B);delete X.inProgress,X.toPosition=X.toHandle?X.toHandle.position:null,S?.(A,X),x.setState({connectionClickStartHandle:null})};return C.jsx("div",{"data-handleid":p,"data-nodeid":b,"data-handlepos":t,"data-id":`${w}-${b}-${p}-${e}`,className:fe(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",m,l,{source:!g,target:g,connectable:o,connectablestart:r,connectableend:i,clickconnecting:P,connectingfrom:k,connectingto:N,valid:j,connectionindicator:o&&(!L||M)&&(L||H?i:r)}]),onMouseDown:$,onTouchStart:$,onClick:v?y:void 0,ref:f,...d,children:c})}const vn=O.memo(Cc(yy));function xy({data:e,isConnectable:t,sourcePosition:n=Q.Bottom}){return C.jsxs(C.Fragment,{children:[e?.label,C.jsx(vn,{type:"source",position:n,isConnectable:t})]})}function wy({data:e,isConnectable:t,targetPosition:n=Q.Top,sourcePosition:o=Q.Bottom}){return C.jsxs(C.Fragment,{children:[C.jsx(vn,{type:"target",position:n,isConnectable:t}),e?.label,C.jsx(vn,{type:"source",position:o,isConnectable:t})]})}function by(){return null}function vy({data:e,isConnectable:t,targetPosition:n=Q.Top}){return C.jsxs(C.Fragment,{children:[C.jsx(vn,{type:"target",position:n,isConnectable:t}),e?.label]})}const ko={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Pc={input:xy,default:wy,output:vy,group:by};function Ey(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const _y=e=>{const{width:t,height:n,x:o,y:r}=dn(e.nodeLookup,{filter:i=>!!i.selected});return{width:Me(t)?t:null,height:Me(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${r}px)`}};function Sy({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const o=ce(),{width:r,height:i,transformString:s,userSelectionActive:a}=ie(_y,de),c=Ac(),l=O.useRef(null);if(O.useEffect(()=>{n||l.current?.focus({preventScroll:!0})},[n]),Mc({nodeRef:l}),a||!r||!i)return null;const u=e?d=>{const f=o.getState().nodes.filter(p=>p.selected);e(d,f)}:void 0,h=d=>{Object.prototype.hasOwnProperty.call(ko,d.key)&&(d.preventDefault(),c({direction:ko[d.key],factor:d.shiftKey?4:1}))};return C.jsx("div",{className:fe(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:C.jsx("div",{ref:l,className:"react-flow__nodesselection-rect",onContextMenu:u,tabIndex:n?void 0:-1,onKeyDown:n?void 0:h,style:{width:r,height:i}})})}const Ic=typeof window<"u"?window:void 0,Cy=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Oc({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:a,deleteKeyCode:c,selectionKeyCode:l,selectionOnDrag:u,selectionMode:h,onSelectionStart:d,onSelectionEnd:f,multiSelectionKeyCode:p,panActivationKeyCode:g,zoomActivationKeyCode:x,elementsSelectable:b,zoomOnScroll:v,zoomOnPinch:m,panOnScroll:w,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:P,panOnDrag:M,defaultViewport:L,translateExtent:H,minZoom:j,maxZoom:R,preventScrolling:$,onSelectionContextMenu:y,noWheelClassName:A,noPanClassName:T,disableKeyboardA11y:S,onViewportChange:E,isControlledViewport:I}){const{nodesSelectionActive:_,userSelectionActive:D}=ie(Cy),z=xn(l,{target:Ic}),F=xn(g,{target:Ic}),B=F||M,Y=F||w,K=u&&B!==!0,W=z||D||K;return iy({deleteKeyCode:c,multiSelectionKeyCode:p}),C.jsx(cy,{onPaneContextMenu:i,elementsSelectable:b,zoomOnScroll:v,zoomOnPinch:m,panOnScroll:Y,panOnScrollSpeed:k,panOnScrollMode:N,zoomOnDoubleClick:P,panOnDrag:!z&&B,defaultViewport:L,translateExtent:H,minZoom:j,maxZoom:R,zoomActivationKeyCode:x,preventScrolling:$,noWheelClassName:A,noPanClassName:T,onViewportChange:E,isControlledViewport:I,paneClickDistance:a,children:C.jsxs(fy,{onSelectionStart:d,onSelectionEnd:f,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:r,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:B,isSelecting:!!W,selectionMode:h,selectionKeyPressed:z,selectionOnDrag:K,children:[e,_&&C.jsx(Sy,{onSelectionContextMenu:y,noPanClassName:T,disableKeyboardA11y:S})]})})}Oc.displayName="FlowRenderer";const Ny=O.memo(Oc),ky=e=>t=>e?$r(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 Ty(e){return ie(O.useCallback(ky(e),[e]),de)}const My=e=>e.updateNodeInternals;function Ay(){const e=ie(My),[t]=O.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(r=>{const i=r.target.getAttribute("data-id");o.set(i,{id:i,nodeElement:r.target,force:!0})}),e(o)}));return O.useEffect(()=>()=>{t?.disconnect()},[t]),t}function Py({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){const r=ce(),i=O.useRef(null),s=O.useRef(null),a=O.useRef(e.sourcePosition),c=O.useRef(e.targetPosition),l=O.useRef(t),u=n&&!!e.internals.handleBounds;return O.useEffect(()=>{i.current&&!e.hidden&&(!u||s.current!==i.current)&&(s.current&&o?.unobserve(s.current),o?.observe(i.current),s.current=i.current)},[u,e.hidden]),O.useEffect(()=>()=>{s.current&&(o?.unobserve(s.current),s.current=null)},[]),O.useEffect(()=>{if(i.current){const h=l.current!==t,d=a.current!==e.sourcePosition,f=c.current!==e.targetPosition;(h||d||f)&&(l.current=t,a.current=e.sourcePosition,c.current=e.targetPosition,r.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function Iy({id:e,onClick:t,onMouseEnter:n,onMouseMove:o,onMouseLeave:r,onContextMenu:i,onDoubleClick:s,nodesDraggable:a,elementsSelectable:c,nodesConnectable:l,nodesFocusable:u,resizeObserver:h,noDragClassName:d,noPanClassName:f,disableKeyboardA11y:p,rfId:g,nodeTypes:x,nodeClickDistance:b,onError:v}){const{node:m,internals:w,isParent:k}=ie(V=>{const X=V.nodeLookup.get(e),J=V.parentLookup.has(e);return{node:X,internals:X.internals,isParent:J}},de);let N=m.type||"default",P=x?.[N]||Pc[N];P===void 0&&(v?.("003",xe.error003(N)),N="default",P=x?.default||Pc.default);const M=!!(m.draggable||a&&typeof m.draggable>"u"),L=!!(m.selectable||c&&typeof m.selectable>"u"),H=!!(m.connectable||l&&typeof m.connectable>"u"),j=!!(m.focusable||u&&typeof m.focusable>"u"),R=ce(),$=Sa(m),y=Py({node:m,nodeType:N,hasDimensions:$,resizeObserver:h}),A=Mc({nodeRef:y,disabled:m.hidden||!M,noDragClassName:d,handleSelector:m.dragHandle,nodeId:e,isSelectable:L,nodeClickDistance:b}),T=Ac();if(m.hidden)return null;const S=Xe(m),E=Ey(m),I=L||M||t||n||o||r,_=n?V=>n(V,{...w.userNode}):void 0,D=o?V=>o(V,{...w.userNode}):void 0,z=r?V=>r(V,{...w.userNode}):void 0,F=i?V=>i(V,{...w.userNode}):void 0,B=s?V=>s(V,{...w.userNode}):void 0,Y=V=>{const{selectNodesOnDrag:X,nodeDragThreshold:J}=R.getState();L&&(!X||!M||J>0)&&ri({id:e,store:R,nodeRef:y}),t&&t(V,{...w.userNode})},K=V=>{if(!(Ta(V.nativeEvent)||p)){if(ua.includes(V.key)&&L){const X=V.key==="Escape";ri({id:e,store:R,unselect:X,nodeRef:y})}else if(M&&m.selected&&Object.prototype.hasOwnProperty.call(ko,V.key)){V.preventDefault();const{ariaLabelConfig:X}=R.getState();R.setState({ariaLiveMessage:X["node.a11yDescription.ariaLiveMessage"]({direction:V.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),T({direction:ko[V.key],factor:V.shiftKey?4:1})}}},W=()=>{if(p||!y.current?.matches(":focus-visible"))return;const{transform:V,width:X,height:J,autoPanOnNodeFocus:te,setCenter:Z}=R.getState();if(!te)return;$r(new Map([[e,m]]),{x:0,y:0,width:X,height:J},V,!0).length>0||Z(m.position.x+S.width/2,m.position.y+S.height/2,{zoom:V[2]})};return C.jsx("div",{className:fe(["react-flow__node",`react-flow__node-${N}`,{[f]:M},m.className,{selected:m.selected,selectable:L,parent:k,draggable:M,dragging:A}]),ref:y,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:$?"visible":"hidden",...m.style,...E},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:_,onMouseMove:D,onMouseLeave:z,onContextMenu:F,onClick:Y,onDoubleClick:B,onKeyDown:j?K:void 0,tabIndex:j?0:void 0,onFocus:j?W:void 0,role:m.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":p?void 0:`${dc}-${g}`,"aria-label":m.ariaLabel,...m.domAttributes,children:C.jsx(py,{value:e,children:C.jsx(P,{id:e,data:m.data,type:N,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:m.selected??!1,selectable:L,draggable:M,deletable:m.deletable??!0,isConnectable:H,sourcePosition:m.sourcePosition,targetPosition:m.targetPosition,dragging:A,dragHandle:m.dragHandle,zIndex:w.z,parentId:m.parentId,...S})})})}const Oy=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function Dc(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,onError:i}=ie(Oy,de),s=Ty(e.onlyRenderVisibleElements),a=Ay();return C.jsx("div",{className:"react-flow__nodes",style:Co,children:s.map(c=>C.jsx(Iy,{id:c,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:a,nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:i},c))})}Dc.displayName="NodeRenderer";const Dy=O.memo(Dc);function Ry(e){return ie(O.useCallback(n=>{if(!e)return n.edges.map(r=>r.id);const o=[];if(n.width&&n.height)for(const r of n.edges){const i=n.nodeLookup.get(r.source),s=n.nodeLookup.get(r.target);i&&s&&Dg({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&o.push(r.id)}return o},[e]),de)}const Ly=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return C.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},$y=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return C.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Rc={[lo.Arrow]:Ly,[lo.ArrowClosed]:$y};function zy(e){const t=ce();return O.useMemo(()=>Object.prototype.hasOwnProperty.call(Rc,e)?Rc[e]:(t.getState().onError?.("009",xe.error009(e)),null),[e])}const Hy=({id:e,type:t,color:n,width:o=12.5,height:r=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:a="auto-start-reverse"})=>{const c=zy(t);return c?C.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:a,refX:"0",refY:"0",children:C.jsx(c,{color:n,strokeWidth:s})}):null},Lc=({defaultColor:e,rfId:t})=>{const n=ie(i=>i.edges),o=ie(i=>i.defaultEdgeOptions),r=O.useMemo(()=>Vg(n,{id:t,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,t,e]);return r.length?C.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:C.jsx("defs",{children:r.map(i=>C.jsx(Hy,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};Lc.displayName="MarkerDefinitions";var jy=O.memo(Lc);function $c({x:e,y:t,label:n,labelStyle:o,labelShowBg:r=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:a=2,children:c,className:l,...u}){const[h,d]=O.useState({x:1,y:0,width:0,height:0}),f=fe(["react-flow__edge-textwrapper",l]),p=O.useRef(null);return O.useEffect(()=>{if(p.current){const g=p.current.getBBox();d({x:g.x,y:g.y,width:g.width,height:g.height})}},[n]),n?C.jsxs("g",{transform:`translate(${e-h.width/2} ${t-h.height/2})`,className:f,visibility:h.width?"visible":"hidden",...u,children:[r&&C.jsx("rect",{width:h.width+2*s[0],x:-s[0],y:-s[1],height:h.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:a,ry:a}),C.jsx("text",{className:"react-flow__edge-text",y:h.height/2,dy:"0.3em",ref:p,style:o,children:n}),c]}):null}$c.displayName="EdgeText";const Vy=O.memo($c);function $t({path:e,labelX:t,labelY:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:c,interactionWidth:l=20,...u}){return C.jsxs(C.Fragment,{children:[C.jsx("path",{...u,d:e,fill:"none",className:fe(["react-flow__edge-path",u.className])}),l?C.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:l,className:"react-flow__edge-interaction"}):null,o&&Me(t)&&Me(n)?C.jsx(Vy,{x:t,y:n,label:o,labelStyle:r,labelShowBg:i,labelBgStyle:s,labelBgPadding:a,labelBgBorderRadius:c}):null]})}function zc({pos:e,x1:t,y1:n,x2:o,y2:r}){return e===Q.Left||e===Q.Right?[.5*(t+o),n]:[t,.5*(n+r)]}function Hc({sourceX:e,sourceY:t,sourcePosition:n=Q.Bottom,targetX:o,targetY:r,targetPosition:i=Q.Top}){const[s,a]=zc({pos:n,x1:e,y1:t,x2:o,y2:r}),[c,l]=zc({pos:i,x1:o,y1:r,x2:e,y2:t}),[u,h,d,f]=Pa({sourceX:e,sourceY:t,targetX:o,targetY:r,sourceControlX:s,sourceControlY:a,targetControlX:c,targetControlY:l});return[`M${e},${t} C${s},${a} ${c},${l} ${o},${r}`,u,h,d,f]}function jc(e){return O.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s,targetPosition:a,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:h,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:g,markerStart:x,interactionWidth:b})=>{const[v,m,w]=Hc({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a}),k=e.isInternal?void 0:t;return C.jsx($t,{id:k,path:v,labelX:m,labelY:w,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:h,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:g,markerStart:x,interactionWidth:b})})}const Fy=jc({isInternal:!1}),Vc=jc({isInternal:!0});Fy.displayName="SimpleBezierEdge",Vc.displayName="SimpleBezierEdgeInternal";function Fc(e){return O.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:h,style:d,sourcePosition:f=Q.Bottom,targetPosition:p=Q.Top,markerEnd:g,markerStart:x,pathOptions:b,interactionWidth:v})=>{const[m,w,k]=Fr({sourceX:n,sourceY:o,sourcePosition:f,targetX:r,targetY:i,targetPosition:p,borderRadius:b?.borderRadius,offset:b?.offset,stepPosition:b?.stepPosition}),N=e.isInternal?void 0:t;return C.jsx($t,{id:N,path:m,labelX:w,labelY:k,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:h,style:d,markerEnd:g,markerStart:x,interactionWidth:v})})}const Bc=Fc({isInternal:!1}),Wc=Fc({isInternal:!0});Bc.displayName="SmoothStepEdge",Wc.displayName="SmoothStepEdgeInternal";function Yc(e){return O.memo(({id:t,...n})=>{const o=e.isInternal?void 0:t;return C.jsx(Bc,{...n,id:o,pathOptions:O.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const By=Yc({isInternal:!1}),Xc=Yc({isInternal:!0});By.displayName="StepEdge",Xc.displayName="StepEdgeInternal";function Uc(e){return O.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:h,style:d,markerEnd:f,markerStart:p,interactionWidth:g})=>{const[x,b,v]=Da({sourceX:n,sourceY:o,targetX:r,targetY:i}),m=e.isInternal?void 0:t;return C.jsx($t,{id:m,path:x,labelX:b,labelY:v,label:s,labelStyle:a,labelShowBg:c,labelBgStyle:l,labelBgPadding:u,labelBgBorderRadius:h,style:d,markerEnd:f,markerStart:p,interactionWidth:g})})}const Wy=Uc({isInternal:!1}),Gc=Uc({isInternal:!0});Wy.displayName="StraightEdge",Gc.displayName="StraightEdgeInternal";function qc(e){return O.memo(({id:t,sourceX:n,sourceY:o,targetX:r,targetY:i,sourcePosition:s=Q.Bottom,targetPosition:a=Q.Top,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:h,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:g,markerStart:x,pathOptions:b,interactionWidth:v})=>{const[m,w,k]=mo({sourceX:n,sourceY:o,sourcePosition:s,targetX:r,targetY:i,targetPosition:a,curvature:b?.curvature}),N=e.isInternal?void 0:t;return C.jsx($t,{id:N,path:m,labelX:w,labelY:k,label:c,labelStyle:l,labelShowBg:u,labelBgStyle:h,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:g,markerStart:x,interactionWidth:v})})}const Yy=qc({isInternal:!1}),Zc=qc({isInternal:!0});Yy.displayName="BezierEdge",Zc.displayName="BezierEdgeInternal";const Kc={default:Zc,straight:Gc,step:Xc,smoothstep:Wc,simplebezier:Vc},Qc={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},Xy=(e,t,n)=>n===Q.Left?e-t:n===Q.Right?e+t:e,Uy=(e,t,n)=>n===Q.Top?e-t:n===Q.Bottom?e+t:e,Jc="react-flow__edgeupdater";function el({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:r,onMouseEnter:i,onMouseOut:s,type:a}){return C.jsx("circle",{onMouseDown:r,onMouseEnter:i,onMouseOut:s,className:fe([Jc,`${Jc}-${a}`]),cx:Xy(t,o,e),cy:Uy(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function Gy({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:o,sourceY:r,targetX:i,targetY:s,sourcePosition:a,targetPosition:c,onReconnect:l,onReconnectStart:u,onReconnectEnd:h,setReconnecting:d,setUpdateHover:f}){const p=ce(),g=(w,k)=>{if(w.button!==0)return;const{autoPanOnConnect:N,domNode:P,isValidConnection:M,connectionMode:L,connectionRadius:H,lib:j,onConnectStart:R,onConnectEnd:$,cancelConnection:y,nodeLookup:A,rfId:T,panBy:S,updateConnection:E}=p.getState(),I=k.type==="target",_=(F,B)=>{d(!1),h?.(F,n,k.type,B)},D=F=>l?.(n,F),z=(F,B)=>{d(!0),u?.(w,n,k.type),R?.(F,B)};Zr.onPointerDown(w.nativeEvent,{autoPanOnConnect:N,connectionMode:L,connectionRadius:H,domNode:P,handleId:k.id,nodeId:k.nodeId,nodeLookup:A,isTarget:I,edgeUpdaterType:k.type,lib:j,flowId:T,cancelConnection:y,panBy:S,isValidConnection:M,onConnect:D,onConnectStart:z,onConnectEnd:$,onReconnectEnd:_,updateConnection:E,getTransform:()=>p.getState().transform,getFromHandle:()=>p.getState().connection.fromHandle,dragThreshold:p.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},x=w=>g(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),b=w=>g(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),v=()=>f(!0),m=()=>f(!1);return C.jsxs(C.Fragment,{children:[(e===!0||e==="source")&&C.jsx(el,{position:a,centerX:o,centerY:r,radius:t,onMouseDown:x,onMouseEnter:v,onMouseOut:m,type:"source"}),(e===!0||e==="target")&&C.jsx(el,{position:c,centerX:i,centerY:s,radius:t,onMouseDown:b,onMouseEnter:v,onMouseOut:m,type:"target"})]})}function qy({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:o,onClick:r,onDoubleClick:i,onContextMenu:s,onMouseEnter:a,onMouseMove:c,onMouseLeave:l,reconnectRadius:u,onReconnect:h,onReconnectStart:d,onReconnectEnd:f,rfId:p,edgeTypes:g,noPanClassName:x,onError:b,disableKeyboardA11y:v}){let m=ie(Z=>Z.edgeLookup.get(e));const w=ie(Z=>Z.defaultEdgeOptions);m=w?{...w,...m}:m;let k=m.type||"default",N=g?.[k]||Kc[k];N===void 0&&(b?.("011",xe.error011(k)),k="default",N=g?.default||Kc.default);const P=!!(m.focusable||t&&typeof m.focusable>"u"),M=typeof h<"u"&&(m.reconnectable||n&&typeof m.reconnectable>"u"),L=!!(m.selectable||o&&typeof m.selectable>"u"),H=O.useRef(null),[j,R]=O.useState(!1),[$,y]=O.useState(!1),A=ce(),{zIndex:T,sourceX:S,sourceY:E,targetX:I,targetY:_,sourcePosition:D,targetPosition:z}=ie(O.useCallback(Z=>{const oe=Z.nodeLookup.get(m.source),ne=Z.nodeLookup.get(m.target);if(!oe||!ne)return{zIndex:m.zIndex,...Qc};const ue=jg({id:e,sourceNode:oe,targetNode:ne,sourceHandle:m.sourceHandle||null,targetHandle:m.targetHandle||null,connectionMode:Z.connectionMode,onError:b});return{zIndex:Og({selected:m.selected,zIndex:m.zIndex,sourceNode:oe,targetNode:ne,elevateOnSelect:Z.elevateEdgesOnSelect}),...ue||Qc}},[m.source,m.target,m.sourceHandle,m.targetHandle,m.selected,m.zIndex]),de),F=O.useMemo(()=>m.markerStart?`url('#${Br(m.markerStart,p)}')`:void 0,[m.markerStart,p]),B=O.useMemo(()=>m.markerEnd?`url('#${Br(m.markerEnd,p)}')`:void 0,[m.markerEnd,p]);if(m.hidden||S===null||E===null||I===null||_===null)return null;const Y=Z=>{const{addSelectedEdges:oe,unselectNodesAndEdges:ne,multiSelectionActive:ue}=A.getState();L&&(A.setState({nodesSelectionActive:!1}),m.selected&&ue?(ne({nodes:[],edges:[m]}),H.current?.blur()):oe([e])),r&&r(Z,m)},K=i?Z=>{i(Z,{...m})}:void 0,W=s?Z=>{s(Z,{...m})}:void 0,V=a?Z=>{a(Z,{...m})}:void 0,X=c?Z=>{c(Z,{...m})}:void 0,J=l?Z=>{l(Z,{...m})}:void 0,te=Z=>{if(!v&&ua.includes(Z.key)&&L){const{unselectNodesAndEdges:oe,addSelectedEdges:ne}=A.getState();Z.key==="Escape"?(H.current?.blur(),oe({edges:[m]})):ne([e])}};return C.jsx("svg",{style:{zIndex:T},children:C.jsxs("g",{className:fe(["react-flow__edge",`react-flow__edge-${k}`,m.className,x,{selected:m.selected,animated:m.animated,inactive:!L&&!r,updating:j,selectable:L}]),onClick:Y,onDoubleClick:K,onContextMenu:W,onMouseEnter:V,onMouseMove:X,onMouseLeave:J,onKeyDown:P?te:void 0,tabIndex:P?0:void 0,role:m.ariaRole??(P?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":m.ariaLabel===null?void 0:m.ariaLabel||`Edge from ${m.source} to ${m.target}`,"aria-describedby":P?`${fc}-${p}`:void 0,ref:H,...m.domAttributes,children:[!$&&C.jsx(N,{id:e,source:m.source,target:m.target,type:m.type,selected:m.selected,animated:m.animated,selectable:L,deletable:m.deletable??!0,label:m.label,labelStyle:m.labelStyle,labelShowBg:m.labelShowBg,labelBgStyle:m.labelBgStyle,labelBgPadding:m.labelBgPadding,labelBgBorderRadius:m.labelBgBorderRadius,sourceX:S,sourceY:E,targetX:I,targetY:_,sourcePosition:D,targetPosition:z,data:m.data,style:m.style,sourceHandleId:m.sourceHandle,targetHandleId:m.targetHandle,markerStart:F,markerEnd:B,pathOptions:"pathOptions"in m?m.pathOptions:void 0,interactionWidth:m.interactionWidth}),M&&C.jsx(Gy,{edge:m,isReconnectable:M,reconnectRadius:u,onReconnect:h,onReconnectStart:d,onReconnectEnd:f,sourceX:S,sourceY:E,targetX:I,targetY:_,sourcePosition:D,targetPosition:z,setUpdateHover:R,setReconnecting:y})]})})}const Zy=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function tl({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:o,noPanClassName:r,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:a,onEdgeMouseMove:c,onEdgeMouseLeave:l,onEdgeClick:u,reconnectRadius:h,onEdgeDoubleClick:d,onReconnectStart:f,onReconnectEnd:p,disableKeyboardA11y:g}){const{edgesFocusable:x,edgesReconnectable:b,elementsSelectable:v,onError:m}=ie(Zy,de),w=Ry(t);return C.jsxs("div",{className:"react-flow__edges",children:[C.jsx(jy,{defaultColor:e,rfId:n}),w.map(k=>C.jsx(qy,{id:k,edgesFocusable:x,edgesReconnectable:b,elementsSelectable:v,noPanClassName:r,onReconnect:i,onContextMenu:s,onMouseEnter:a,onMouseMove:c,onMouseLeave:l,onClick:u,reconnectRadius:h,onDoubleClick:d,onReconnectStart:f,onReconnectEnd:p,rfId:n,onError:m,edgeTypes:o,disableKeyboardA11y:g},k))]})}tl.displayName="EdgeRenderer";const Ky=O.memo(tl),Qy=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Jy({children:e}){const t=ie(Qy);return C.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function e0(e){const t=bn(),n=O.useRef(!1);O.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const t0=e=>e.panZoom?.syncViewport;function n0(e){const t=ie(t0),n=ce();return O.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function o0(e){return e.connection.inProgress?{...e.connection,to:pn(e.connection.to,e.transform)}:{...e.connection}}function r0(e){return o0}function nl(e){const t=r0();return ie(t,de)}const i0=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function s0({containerStyle:e,style:t,type:n,component:o}){const{nodesConnectable:r,width:i,height:s,isValid:a,inProgress:c}=ie(i0,de);return!(i&&r&&c)?null:C.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:C.jsx("g",{className:fe(["react-flow__connection",ga(a)]),children:C.jsx(ol,{style:t,type:n,CustomComponent:o,isValid:a})})})}const ol=({style:e,type:t=Ze.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:r,from:i,fromNode:s,fromHandle:a,fromPosition:c,to:l,toNode:u,toHandle:h,toPosition:d}=nl();if(!r)return;if(n)return C.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:a,fromX:i.x,fromY:i.y,toX:l.x,toY:l.y,fromPosition:c,toPosition:d,connectionStatus:ga(o),toNode:u,toHandle:h});let f="";const p={sourceX:i.x,sourceY:i.y,sourcePosition:c,targetX:l.x,targetY:l.y,targetPosition:d};switch(t){case Ze.Bezier:[f]=mo(p);break;case Ze.SimpleBezier:[f]=Hc(p);break;case Ze.Step:[f]=Fr({...p,borderRadius:0});break;case Ze.SmoothStep:[f]=Fr(p);break;default:[f]=Da(p)}return C.jsx("path",{d:f,fill:"none",className:"react-flow__connection-path",style:e})};ol.displayName="ConnectionLine";const a0={};function rl(e=a0){const t=O.useRef(e),n=ce();O.useEffect(()=>{if(process.env.NODE_ENV==="development"){const o=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const r of o)if(t.current[r]!==e[r]){n.getState().onError?.("002",xe.error002());break}t.current=e}},[e])}function c0(){const e=ce(),t=O.useRef(!1);O.useEffect(()=>{if(process.env.NODE_ENV==="development"&&!t.current){const n=document.querySelector(".react-flow__pane");n&&window.getComputedStyle(n).zIndex!=="1"&&e.getState().onError?.("013",xe.error013("react")),t.current=!0}},[])}function il({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:o,onEdgeClick:r,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,onSelectionContextMenu:h,onSelectionStart:d,onSelectionEnd:f,connectionLineType:p,connectionLineStyle:g,connectionLineComponent:x,connectionLineContainerStyle:b,selectionKeyCode:v,selectionOnDrag:m,selectionMode:w,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:P,deleteKeyCode:M,onlyRenderVisibleElements:L,elementsSelectable:H,defaultViewport:j,translateExtent:R,minZoom:$,maxZoom:y,preventScrolling:A,defaultMarkerColor:T,zoomOnScroll:S,zoomOnPinch:E,panOnScroll:I,panOnScrollSpeed:_,panOnScrollMode:D,zoomOnDoubleClick:z,panOnDrag:F,onPaneClick:B,onPaneMouseEnter:Y,onPaneMouseMove:K,onPaneMouseLeave:W,onPaneScroll:V,onPaneContextMenu:X,paneClickDistance:J,nodeClickDistance:te,onEdgeContextMenu:Z,onEdgeMouseEnter:oe,onEdgeMouseMove:ne,onEdgeMouseLeave:ue,reconnectRadius:ge,onReconnect:Ie,onReconnectStart:Bt,onReconnectEnd:qo,noDragClassName:Zo,noWheelClassName:Ko,noPanClassName:Tn,disableKeyboardA11y:Mn,nodeExtent:Pi,rfId:Qo,viewport:Wt,onViewportChange:An}){return rl(e),rl(t),c0(),e0(n),n0(Wt),C.jsx(Ny,{onPaneClick:B,onPaneMouseEnter:Y,onPaneMouseMove:K,onPaneMouseLeave:W,onPaneContextMenu:X,onPaneScroll:V,paneClickDistance:J,deleteKeyCode:M,selectionKeyCode:v,selectionOnDrag:m,selectionMode:w,onSelectionStart:d,onSelectionEnd:f,multiSelectionKeyCode:k,panActivationKeyCode:N,zoomActivationKeyCode:P,elementsSelectable:H,zoomOnScroll:S,zoomOnPinch:E,zoomOnDoubleClick:z,panOnScroll:I,panOnScrollSpeed:_,panOnScrollMode:D,panOnDrag:F,defaultViewport:j,translateExtent:R,minZoom:$,maxZoom:y,onSelectionContextMenu:h,preventScrolling:A,noDragClassName:Zo,noWheelClassName:Ko,noPanClassName:Tn,disableKeyboardA11y:Mn,onViewportChange:An,isControlledViewport:!!Wt,children:C.jsxs(Jy,{children:[C.jsx(Ky,{edgeTypes:t,onEdgeClick:r,onEdgeDoubleClick:s,onReconnect:Ie,onReconnectStart:Bt,onReconnectEnd:qo,onlyRenderVisibleElements:L,onEdgeContextMenu:Z,onEdgeMouseEnter:oe,onEdgeMouseMove:ne,onEdgeMouseLeave:ue,reconnectRadius:ge,defaultMarkerColor:T,noPanClassName:Tn,disableKeyboardA11y:Mn,rfId:Qo}),C.jsx(s0,{style:g,type:p,component:x,containerStyle:b}),C.jsx("div",{className:"react-flow__edgelabel-renderer"}),C.jsx(Dy,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:i,onNodeMouseEnter:a,onNodeMouseMove:c,onNodeMouseLeave:l,onNodeContextMenu:u,nodeClickDistance:te,onlyRenderVisibleElements:L,noPanClassName:Tn,noDragClassName:Zo,disableKeyboardA11y:Mn,nodeExtent:Pi,rfId:Qo}),C.jsx("div",{className:"react-flow__viewport-portal"})]})})}il.displayName="GraphView";const l0=O.memo(il),sl=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:c=.5,maxZoom:l=2,nodeOrigin:u,nodeExtent:h}={})=>{const d=new Map,f=new Map,p=new Map,g=new Map,x=o??t??[],b=n??e??[],v=u??[0,0],m=h??ln;Fa(p,g,x);const w=Xr(b,d,f,{nodeOrigin:v,nodeExtent:m,elevateNodesOnSelect:!1});let k=[0,0,1];if(s&&r&&i){const N=dn(d,{filter:H=>!!((H.width||H.initialWidth)&&(H.height||H.initialHeight))}),{x:P,y:M,zoom:L}=jr(N,r,i,c,l,a?.padding??.1);k=[P,M,L]}return{rfId:"1",width:0,height:0,transform:k,nodes:b,nodesInitialized:w,nodeLookup:d,parentLookup:f,edges:x,edgeLookup:g,connectionLookup:p,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:c,maxZoom:l,translateExtent:ln,nodeExtent:m,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Mt.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:v,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:a,fitViewResolver:null,connection:{...fa},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:_a,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:da}},u0=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:h})=>Im((d,f)=>{async function p(){const{nodeLookup:g,panZoom:x,fitViewOptions:b,fitViewResolver:v,width:m,height:w,minZoom:k,maxZoom:N}=f();x&&(await Ng({nodes:g,width:m,height:w,panZoom:x,minZoom:k,maxZoom:N},b),v?.resolve(!0),d({fitViewResolver:null}))}return{...sl({nodes:e,edges:t,width:r,height:i,fitView:s,fitViewOptions:a,minZoom:c,maxZoom:l,nodeOrigin:u,nodeExtent:h,defaultNodes:n,defaultEdges:o}),setNodes:g=>{const{nodeLookup:x,parentLookup:b,nodeOrigin:v,elevateNodesOnSelect:m,fitViewQueued:w}=f(),k=Xr(g,x,b,{nodeOrigin:v,nodeExtent:h,elevateNodesOnSelect:m,checkEquality:!0});w&&k?(p(),d({nodes:g,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0})):d({nodes:g,nodesInitialized:k})},setEdges:g=>{const{connectionLookup:x,edgeLookup:b}=f();Fa(x,b,g),d({edges:g})},setDefaultNodesAndEdges:(g,x)=>{if(g){const{setNodes:b}=f();b(g),d({hasDefaultNodes:!0})}if(x){const{setEdges:b}=f();b(x),d({hasDefaultEdges:!0})}},updateNodeInternals:g=>{const{triggerNodeChanges:x,nodeLookup:b,parentLookup:v,domNode:m,nodeOrigin:w,nodeExtent:k,debug:N,fitViewQueued:P}=f(),{changes:M,updatedInternals:L}=Xg(g,b,v,m,w,k);L&&(Bg(b,v,{nodeOrigin:w,nodeExtent:k}),P?(p(),d({fitViewQueued:!1,fitViewOptions:void 0})):d({}),M?.length>0&&(N&&console.log("React Flow: trigger node changes",M),x?.(M)))},updateNodePositions:(g,x=!1)=>{const b=[],v=[],{nodeLookup:m,triggerNodeChanges:w}=f();for(const[k,N]of g){const P=m.get(k),M=!!(P?.expandParent&&P?.parentId&&N?.position),L={id:k,type:"position",position:M?{x:Math.max(0,N.position.x),y:Math.max(0,N.position.y)}:N.position,dragging:x};M&&P.parentId&&b.push({id:k,parentId:P.parentId,rect:{...N.internals.positionAbsolute,width:N.measured.width??0,height:N.measured.height??0}}),v.push(L)}if(b.length>0){const{parentLookup:k,nodeOrigin:N}=f(),P=Gr(b,m,k,N);v.push(...P)}w(v)},triggerNodeChanges:g=>{const{onNodesChange:x,setNodes:b,nodes:v,hasDefaultNodes:m,debug:w}=f();if(g?.length){if(m){const k=vc(g,v);b(k)}w&&console.log("React Flow: trigger node changes",g),x?.(g)}},triggerEdgeChanges:g=>{const{onEdgesChange:x,setEdges:b,edges:v,hasDefaultEdges:m,debug:w}=f();if(g?.length){if(m){const k=wn(g,v);b(k)}w&&console.log("React Flow: trigger edge changes",g),x?.(g)}},addSelectedNodes:g=>{const{multiSelectionActive:x,edgeLookup:b,nodeLookup:v,triggerNodeChanges:m,triggerEdgeChanges:w}=f();if(x){const k=g.map(N=>ht(N,!0));m(k);return}m(Lt(v,new Set([...g]),!0)),w(Lt(b))},addSelectedEdges:g=>{const{multiSelectionActive:x,edgeLookup:b,nodeLookup:v,triggerNodeChanges:m,triggerEdgeChanges:w}=f();if(x){const k=g.map(N=>ht(N,!0));w(k);return}w(Lt(b,new Set([...g]))),m(Lt(v,new Set,!0))},unselectNodesAndEdges:({nodes:g,edges:x}={})=>{const{edges:b,nodes:v,nodeLookup:m,triggerNodeChanges:w,triggerEdgeChanges:k}=f(),N=g||v,P=x||b,M=N.map(H=>{const j=m.get(H.id);return j&&(j.selected=!1),ht(H.id,!1)}),L=P.map(H=>ht(H.id,!1));w(M),k(L)},setMinZoom:g=>{const{panZoom:x,maxZoom:b}=f();x?.setScaleExtent([g,b]),d({minZoom:g})},setMaxZoom:g=>{const{panZoom:x,minZoom:b}=f();x?.setScaleExtent([b,g]),d({maxZoom:g})},setTranslateExtent:g=>{f().panZoom?.setTranslateExtent(g),d({translateExtent:g})},setPaneClickDistance:g=>{f().panZoom?.setClickDistance(g)},resetSelectedElements:()=>{const{edges:g,nodes:x,triggerNodeChanges:b,triggerEdgeChanges:v,elementsSelectable:m}=f();if(!m)return;const w=x.reduce((N,P)=>P.selected?[...N,ht(P.id,!1)]:N,[]),k=g.reduce((N,P)=>P.selected?[...N,ht(P.id,!1)]:N,[]);b(w),v(k)},setNodeExtent:g=>{const{nodes:x,nodeLookup:b,parentLookup:v,nodeOrigin:m,elevateNodesOnSelect:w,nodeExtent:k}=f();g[0][0]===k[0][0]&&g[0][1]===k[0][1]&&g[1][0]===k[1][0]&&g[1][1]===k[1][1]||(Xr(x,b,v,{nodeOrigin:m,nodeExtent:g,elevateNodesOnSelect:w,checkEquality:!1}),d({nodeExtent:g}))},panBy:g=>{const{transform:x,width:b,height:v,panZoom:m,translateExtent:w}=f();return Ug({delta:g,panZoom:m,transform:x,translateExtent:w,width:b,height:v})},setCenter:async(g,x,b)=>{const{width:v,height:m,maxZoom:w,panZoom:k}=f();if(!k)return Promise.resolve(!1);const N=typeof b?.zoom<"u"?b.zoom:w;return await k.setViewport({x:v/2-g*N,y:m/2-x*N,zoom:N},{duration:b?.duration,ease:b?.ease,interpolate:b?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{d({connection:{...fa}})},updateConnection:g=>{d({connection:g})},reset:()=>d({...sl()})}},Object.is);function al({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:o,initialWidth:r,initialHeight:i,initialMinZoom:s,initialMaxZoom:a,initialFitViewOptions:c,fitView:l,nodeOrigin:u,nodeExtent:h,children:d}){const[f]=O.useState(()=>u0({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:r,height:i,fitView:l,minZoom:s,maxZoom:a,fitViewOptions:c,nodeOrigin:u,nodeExtent:h}));return C.jsx(Om,{value:f,children:C.jsx(ty,{children:d})})}function d0({children:e,nodes:t,edges:n,defaultNodes:o,defaultEdges:r,width:i,height:s,fitView:a,fitViewOptions:c,minZoom:l,maxZoom:u,nodeOrigin:h,nodeExtent:d}){return O.useContext(Eo)?C.jsx(C.Fragment,{children:e}):C.jsx(al,{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:r,initialWidth:i,initialHeight:s,fitView:a,initialFitViewOptions:c,initialMinZoom:l,initialMaxZoom:u,nodeOrigin:h,nodeExtent:d,children:e})}const f0={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function h0({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:r,nodeTypes:i,edgeTypes:s,onNodeClick:a,onEdgeClick:c,onInit:l,onMove:u,onMoveStart:h,onMoveEnd:d,onConnect:f,onConnectStart:p,onConnectEnd:g,onClickConnectStart:x,onClickConnectEnd:b,onNodeMouseEnter:v,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:N,onNodeDragStart:P,onNodeDrag:M,onNodeDragStop:L,onNodesDelete:H,onEdgesDelete:j,onDelete:R,onSelectionChange:$,onSelectionDragStart:y,onSelectionDrag:A,onSelectionDragStop:T,onSelectionContextMenu:S,onSelectionStart:E,onSelectionEnd:I,onBeforeDelete:_,connectionMode:D,connectionLineType:z=Ze.Bezier,connectionLineStyle:F,connectionLineComponent:B,connectionLineContainerStyle:Y,deleteKeyCode:K="Backspace",selectionKeyCode:W="Shift",selectionOnDrag:V=!1,selectionMode:X=At.Full,panActivationKeyCode:J="Space",multiSelectionKeyCode:te=gn()?"Meta":"Control",zoomActivationKeyCode:Z=gn()?"Meta":"Control",snapToGrid:oe,snapGrid:ne,onlyRenderVisibleElements:ue=!1,selectNodesOnDrag:ge,nodesDraggable:Ie,autoPanOnNodeFocus:Bt,nodesConnectable:qo,nodesFocusable:Zo,nodeOrigin:Ko=hc,edgesFocusable:Tn,edgesReconnectable:Mn,elementsSelectable:Pi=!0,defaultViewport:Qo=Xm,minZoom:Wt=.5,maxZoom:An=2,translateExtent:wu=ln,preventScrolling:Rw=!0,nodeExtent:Ii,defaultMarkerColor:Lw="#b1b1b7",zoomOnScroll:$w=!0,zoomOnPinch:zw=!0,panOnScroll:Hw=!1,panOnScrollSpeed:jw=.5,panOnScrollMode:Vw=ut.Free,zoomOnDoubleClick:Fw=!0,panOnDrag:Bw=!0,onPaneClick:Ww,onPaneMouseEnter:Yw,onPaneMouseMove:Xw,onPaneMouseLeave:Uw,onPaneScroll:Gw,onPaneContextMenu:qw,paneClickDistance:bu=0,nodeClickDistance:Zw=0,children:Kw,onReconnect:Qw,onReconnectStart:Jw,onReconnectEnd:eb,onEdgeContextMenu:tb,onEdgeDoubleClick:nb,onEdgeMouseEnter:ob,onEdgeMouseMove:rb,onEdgeMouseLeave:ib,reconnectRadius:sb=10,onNodesChange:ab,onEdgesChange:cb,noDragClassName:lb="nodrag",noWheelClassName:ub="nowheel",noPanClassName:vu="nopan",fitView:Eu,fitViewOptions:_u,connectOnClick:db,attributionPosition:fb,proOptions:hb,defaultEdgeOptions:pb,elevateNodesOnSelect:gb,elevateEdgesOnSelect:mb,disableKeyboardA11y:Su=!1,autoPanOnConnect:yb,autoPanOnNodeDrag:xb,autoPanSpeed:wb,connectionRadius:bb,isValidConnection:vb,onError:Eb,style:_b,id:Cu,nodeDragThreshold:Sb,connectionDragThreshold:Cb,viewport:Nb,onViewportChange:kb,width:Tb,height:Mb,colorMode:Ab="light",debug:Pb,onScroll:Nu,ariaLabelConfig:Ib,...Ob},Db){const Oi=Cu||"1",Rb=qm(Ab),Lb=O.useCallback(ku=>{ku.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Nu?.(ku)},[Nu]);return C.jsx("div",{"data-testid":"rf__wrapper",...Ob,onScroll:Lb,style:{..._b,...f0},ref:Db,className:fe(["react-flow",r,Rb]),id:Cu,role:"application",children:C.jsxs(d0,{nodes:e,edges:t,width:Tb,height:Mb,fitView:Eu,fitViewOptions:_u,minZoom:Wt,maxZoom:An,nodeOrigin:Ko,nodeExtent:Ii,children:[C.jsx(l0,{onInit:l,onNodeClick:a,onEdgeClick:c,onNodeMouseEnter:v,onNodeMouseMove:m,onNodeMouseLeave:w,onNodeContextMenu:k,onNodeDoubleClick:N,nodeTypes:i,edgeTypes:s,connectionLineType:z,connectionLineStyle:F,connectionLineComponent:B,connectionLineContainerStyle:Y,selectionKeyCode:W,selectionOnDrag:V,selectionMode:X,deleteKeyCode:K,multiSelectionKeyCode:te,panActivationKeyCode:J,zoomActivationKeyCode:Z,onlyRenderVisibleElements:ue,defaultViewport:Qo,translateExtent:wu,minZoom:Wt,maxZoom:An,preventScrolling:Rw,zoomOnScroll:$w,zoomOnPinch:zw,zoomOnDoubleClick:Fw,panOnScroll:Hw,panOnScrollSpeed:jw,panOnScrollMode:Vw,panOnDrag:Bw,onPaneClick:Ww,onPaneMouseEnter:Yw,onPaneMouseMove:Xw,onPaneMouseLeave:Uw,onPaneScroll:Gw,onPaneContextMenu:qw,paneClickDistance:bu,nodeClickDistance:Zw,onSelectionContextMenu:S,onSelectionStart:E,onSelectionEnd:I,onReconnect:Qw,onReconnectStart:Jw,onReconnectEnd:eb,onEdgeContextMenu:tb,onEdgeDoubleClick:nb,onEdgeMouseEnter:ob,onEdgeMouseMove:rb,onEdgeMouseLeave:ib,reconnectRadius:sb,defaultMarkerColor:Lw,noDragClassName:lb,noWheelClassName:ub,noPanClassName:vu,rfId:Oi,disableKeyboardA11y:Su,nodeExtent:Ii,viewport:Nb,onViewportChange:kb}),C.jsx(Gm,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:f,onConnectStart:p,onConnectEnd:g,onClickConnectStart:x,onClickConnectEnd:b,nodesDraggable:Ie,autoPanOnNodeFocus:Bt,nodesConnectable:qo,nodesFocusable:Zo,edgesFocusable:Tn,edgesReconnectable:Mn,elementsSelectable:Pi,elevateNodesOnSelect:gb,elevateEdgesOnSelect:mb,minZoom:Wt,maxZoom:An,nodeExtent:Ii,onNodesChange:ab,onEdgesChange:cb,snapToGrid:oe,snapGrid:ne,connectionMode:D,translateExtent:wu,connectOnClick:db,defaultEdgeOptions:pb,fitView:Eu,fitViewOptions:_u,onNodesDelete:H,onEdgesDelete:j,onDelete:R,onNodeDragStart:P,onNodeDrag:M,onNodeDragStop:L,onSelectionDrag:A,onSelectionDragStart:y,onSelectionDragStop:T,onMove:u,onMoveStart:h,onMoveEnd:d,noPanClassName:vu,nodeOrigin:Ko,rfId:Oi,autoPanOnConnect:yb,autoPanOnNodeDrag:xb,autoPanSpeed:wb,onError:Eb,connectionRadius:bb,isValidConnection:vb,selectNodesOnDrag:ge,nodeDragThreshold:Sb,connectionDragThreshold:Cb,onBeforeDelete:_,paneClickDistance:bu,debug:Pb,ariaLabelConfig:Ib}),C.jsx(Ym,{onSelectionChange:$}),Kw,C.jsx(jm,{proOptions:hb,position:fb}),C.jsx(Hm,{rfId:Oi,disableKeyboardA11y:Su})]})})}var p0=Cc(h0);const g0=xe.error014();function m0({id:e,handleType:t,handleId:n,onConnect:o,onDisconnect:r}={}){const i=No(),s=e??i;if(!s)throw new Error(g0);const a=O.useRef(null),c=ie(l=>l.connectionLookup.get(`${s}${t?n?`-${t}-${n}`:`-${t}`:""}`),vg);return O.useEffect(()=>{if(a.current&&a.current!==c){const l=c??new Map;pa(a.current,l,r),pa(l,a.current,o)}a.current=c??new Map},[c,o,r]),O.useMemo(()=>Array.from(c?.values()??[]),[c])}function si(e){return ie(O.useCallback(n=>{const o=[],r=Array.isArray(e),i=r?e:[e];for(const s of i){const a=n.nodeLookup.get(s);a&&o.push({id:a.id,type:a.type,data:a.data})}return r?o:o[0]??null},[e]),Gg)}function y0({dimensions:e,lineWidth:t,variant:n,className:o}){return C.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:fe(["react-flow__background-pattern",n,o])})}function x0({radius:e,className:t}){return C.jsx("circle",{cx:e,cy:e,r:e,className:fe(["react-flow__background-pattern","dots",t])})}var Je;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Je||(Je={}));const w0={[Je.Dots]:1,[Je.Lines]:1,[Je.Cross]:6},b0=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function cl({id:e,variant:t=Je.Dots,gap:n=20,size:o,lineWidth:r=1,offset:i=0,color:s,bgColor:a,style:c,className:l,patternClassName:u}){const h=O.useRef(null),{transform:d,patternId:f}=ie(b0,de),p=o||w0[t],g=t===Je.Dots,x=t===Je.Cross,b=Array.isArray(n)?n:[n,n],v=[b[0]*d[2]||1,b[1]*d[2]||1],m=p*d[2],w=Array.isArray(i)?i:[i,i],k=x?[m,m]:v,N=[w[0]*d[2]||1+k[0]/2,w[1]*d[2]||1+k[1]/2],P=`${f}${e||""}`;return C.jsxs("svg",{className:fe(["react-flow__background",l]),style:{...c,...Co,"--xy-background-color-props":a,"--xy-background-pattern-color-props":s},ref:h,"data-testid":"rf__background",children:[C.jsx("pattern",{id:P,x:d[0]%v[0],y:d[1]%v[1],width:v[0],height:v[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${N[0]},-${N[1]})`,children:g?C.jsx(x0,{radius:m/2,className:u}):C.jsx(y0,{dimensions:k,lineWidth:r,variant:t,className:u})}),C.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${P})`})]})}cl.displayName="Background";const v0=O.memo(cl);function E0(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:C.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function _0(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:C.jsx("path",{d:"M0 0h32v4.2H0z"})})}function S0(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:C.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 C0(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:C.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 N0(){return C.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:C.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 To({children:e,className:t,...n}){return C.jsx("button",{type:"button",className:fe(["react-flow__controls-button",t]),...n,children:e})}const k0=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function ll({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:r,onZoomIn:i,onZoomOut:s,onFitView:a,onInteractiveChange:c,className:l,children:u,position:h="bottom-left",orientation:d="vertical","aria-label":f}){const p=ce(),{isInteractive:g,minZoomReached:x,maxZoomReached:b,ariaLabelConfig:v}=ie(k0,de),{zoomIn:m,zoomOut:w,fitView:k}=bn(),N=()=>{m(),i?.()},P=()=>{w(),s?.()},M=()=>{k(r),a?.()},L=()=>{p.setState({nodesDraggable:!g,nodesConnectable:!g,elementsSelectable:!g}),c?.(!g)},H=d==="horizontal"?"horizontal":"vertical";return C.jsxs(_o,{className:fe(["react-flow__controls",H,l]),position:h,style:e,"data-testid":"rf__controls","aria-label":f??v["controls.ariaLabel"],children:[t&&C.jsxs(C.Fragment,{children:[C.jsx(To,{onClick:N,className:"react-flow__controls-zoomin",title:v["controls.zoomIn.ariaLabel"],"aria-label":v["controls.zoomIn.ariaLabel"],disabled:b,children:C.jsx(E0,{})}),C.jsx(To,{onClick:P,className:"react-flow__controls-zoomout",title:v["controls.zoomOut.ariaLabel"],"aria-label":v["controls.zoomOut.ariaLabel"],disabled:x,children:C.jsx(_0,{})})]}),n&&C.jsx(To,{className:"react-flow__controls-fitview",onClick:M,title:v["controls.fitView.ariaLabel"],"aria-label":v["controls.fitView.ariaLabel"],children:C.jsx(S0,{})}),o&&C.jsx(To,{className:"react-flow__controls-interactive",onClick:L,title:v["controls.interactive.ariaLabel"],"aria-label":v["controls.interactive.ariaLabel"],children:g?C.jsx(N0,{}):C.jsx(C0,{})}),u]})}ll.displayName="Controls";const T0=O.memo(ll);function M0({id:e,x:t,y:n,width:o,height:r,style:i,color:s,strokeColor:a,strokeWidth:c,className:l,borderRadius:u,shapeRendering:h,selected:d,onClick:f}){const{background:p,backgroundColor:g}=i||{},x=s||p||g;return C.jsx("rect",{className:fe(["react-flow__minimap-node",{selected:d},l]),x:t,y:n,rx:u,ry:u,width:o,height:r,style:{fill:x,stroke:a,strokeWidth:c},shapeRendering:h,onClick:f?b=>f(b,e):void 0})}const A0=O.memo(M0),P0=e=>e.nodes.map(t=>t.id),ai=e=>e instanceof Function?e:()=>e;function I0({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:r,nodeComponent:i=A0,onClick:s}){const a=ie(P0,de),c=ai(t),l=ai(e),u=ai(n),h=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return C.jsx(C.Fragment,{children:a.map(d=>C.jsx(D0,{id:d,nodeColorFunc:c,nodeStrokeColorFunc:l,nodeClassNameFunc:u,nodeBorderRadius:o,nodeStrokeWidth:r,NodeComponent:i,onClick:s,shapeRendering:h},d))})}function O0({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:r,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:a,onClick:c}){const{node:l,x:u,y:h,width:d,height:f}=ie(p=>{const{internals:g}=p.nodeLookup.get(e),x=g.userNode,{x:b,y:v}=g.positionAbsolute,{width:m,height:w}=Xe(x);return{node:x,x:b,y:v,width:m,height:w}},de);return!l||l.hidden||!Sa(l)?null:C.jsx(a,{x:u,y:h,width:d,height:f,style:l.style,selected:!!l.selected,className:o(l),color:t(l),borderRadius:r,strokeColor:n(l),strokeWidth:i,shapeRendering:s,onClick:c,id:l.id})}const D0=O.memo(O0);var R0=O.memo(I0);const L0=200,$0=150,z0=e=>!e.hidden,H0=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?va(dn(e.nodeLookup,{filter:z0}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},j0="react-flow__minimap-desc";function ul({style:e,className:t,nodeStrokeColor:n,nodeColor:o,nodeClassName:r="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:a,bgColor:c,maskColor:l,maskStrokeColor:u,maskStrokeWidth:h,position:d="bottom-right",onClick:f,onNodeClick:p,pannable:g=!1,zoomable:x=!1,ariaLabel:b,inversePan:v,zoomStep:m=1,offsetScale:w=5}){const k=ce(),N=O.useRef(null),{boundingRect:P,viewBB:M,rfId:L,panZoom:H,translateExtent:j,flowWidth:R,flowHeight:$,ariaLabelConfig:y}=ie(H0,de),A=e?.width??L0,T=e?.height??$0,S=P.width/A,E=P.height/T,I=Math.max(S,E),_=I*A,D=I*T,z=w*I,F=P.x-(_-P.width)/2-z,B=P.y-(D-P.height)/2-z,Y=_+z*2,K=D+z*2,W=`${j0}-${L}`,V=O.useRef(0),X=O.useRef();V.current=I,O.useEffect(()=>{if(N.current&&H)return X.current=om({domNode:N.current,panZoom:H,getTransform:()=>k.getState().transform,getViewScale:()=>V.current}),()=>{X.current?.destroy()}},[H]),O.useEffect(()=>{X.current?.update({translateExtent:j,width:R,height:$,inversePan:v,pannable:g,zoomStep:m,zoomable:x})},[g,x,v,m,j,R,$]);const J=f?oe=>{const[ne,ue]=X.current?.pointer(oe)||[0,0];f(oe,{x:ne,y:ue})}:void 0,te=p?O.useCallback((oe,ne)=>{const ue=k.getState().nodeLookup.get(ne).internals.userNode;p(oe,ue)},[]):void 0,Z=b??y["minimap.ariaLabel"];return C.jsx(_o,{position:d,style:{...e,"--xy-minimap-background-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-background-color-props":typeof l=="string"?l:void 0,"--xy-minimap-mask-stroke-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-width-props":typeof h=="number"?h*I:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:fe(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:C.jsxs("svg",{width:A,height:T,viewBox:`${F} ${B} ${Y} ${K}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":W,ref:N,onClick:J,children:[Z&&C.jsx("title",{id:W,children:Z}),C.jsx(R0,{onClick:te,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:r,nodeStrokeWidth:s,nodeComponent:a}),C.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-z},${B-z}h${Y+z*2}v${K+z*2}h${-Y-z*2}z
60
- M${M.x},${M.y}h${M.width}v${M.height}h${-M.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ul.displayName="MiniMap";const V0=O.memo(ul),F0=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,B0={[ft.Line]:"right",[ft.Handle]:"bottom-right"};function W0({nodeId:e,position:t,variant:n=ft.Handle,className:o,style:r=void 0,children:i,color:s,minWidth:a=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:h=!1,resizeDirection:d,autoScale:f=!0,shouldResize:p,onResizeStart:g,onResize:x,onResizeEnd:b}){const v=No(),m=typeof e=="string"?e:v,w=ce(),k=O.useRef(null),N=n===ft.Handle,P=ie(O.useCallback(F0(N&&f),[N,f]),de),M=O.useRef(null),L=t??B0[n];O.useEffect(()=>{if(!(!k.current||!m))return M.current||(M.current=wm({domNode:k.current,nodeId:m,getStoreItems:()=>{const{nodeLookup:j,transform:R,snapGrid:$,snapToGrid:y,nodeOrigin:A,domNode:T}=w.getState();return{nodeLookup:j,transform:R,snapGrid:$,snapToGrid:y,nodeOrigin:A,paneDomNode:T}},onChange:(j,R)=>{const{triggerNodeChanges:$,nodeLookup:y,parentLookup:A,nodeOrigin:T}=w.getState(),S=[],E={x:j.x,y:j.y},I=y.get(m);if(I&&I.expandParent&&I.parentId){const _=I.origin??T,D=j.width??I.measured.width??0,z=j.height??I.measured.height??0,F={id:I.id,parentId:I.parentId,rect:{width:D,height:z,...Ca({x:j.x??I.position.x,y:j.y??I.position.y},{width:D,height:z},I.parentId,y,_)}},B=Gr([F],y,A,T);S.push(...B),E.x=j.x?Math.max(_[0]*D,j.x):void 0,E.y=j.y?Math.max(_[1]*z,j.y):void 0}if(E.x!==void 0&&E.y!==void 0){const _={id:m,type:"position",position:{...E}};S.push(_)}if(j.width!==void 0&&j.height!==void 0){const D={id:m,type:"dimensions",resizing:!0,setAttributes:d?d==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};S.push(D)}for(const _ of R){const D={..._,type:"position"};S.push(D)}$(S)},onEnd:({width:j,height:R})=>{const $={id:m,type:"dimensions",resizing:!1,dimensions:{width:j,height:R}};w.getState().triggerNodeChanges([$])}})),M.current.update({controlPosition:L,boundaries:{minWidth:a,minHeight:c,maxWidth:l,maxHeight:u},keepAspectRatio:h,resizeDirection:d,onResizeStart:g,onResize:x,onResizeEnd:b,shouldResize:p}),()=>{M.current?.destroy()}},[L,a,c,l,u,h,g,x,b,p]);const H=L.split("-");return C.jsx("div",{className:fe(["react-flow__resize-control","nodrag",...H,n,o]),ref:k,style:{...r,scale:P,...s&&{[N?"backgroundColor":"borderColor"]:s}},children:i})}const dl=O.memo(W0),ci=20;function pt(e,t){const n=t[e.dataType],o=e.allowInput??n.allowInput;return n.underlyingType==="number"?{id:St(ci),name:e.name,handleColor:n.color,allowInput:o,type:"number",handleShape:n.shape,dataType:{dataTypeObject:n,dataTypeUniqueId:e.dataType}}:{id:St(ci),name:e.name,handleColor:n.color,allowInput:n.underlyingType==="string"?o:!1,type:"string",handleShape:n.shape,dataType:{dataTypeObject:n,dataTypeUniqueId:e.dataType}}}function fl(e,t){const n=St(ci),o=e.inputs.map(r=>pt(r,t));return{id:n,name:e.name,inputs:o}}function li(e,t,n,o,r){const i=n[t],s=i.inputs.map(c=>"inputs"in c?fl(c,e):pt(c,e)),a=i.outputs.map(c=>pt(c,e));return{id:o,position:r,sourcePosition:Q.Right,targetPosition:Q.Left,type:"configurableNode",width:400,data:{name:i.name,headerColor:i.headerColor,inputs:s,outputs:a,nodeTypeUniqueId:t}}}function hl(e,t,n,o){const r=n[t];if(o)if(o.type==="input"){const i=r?.inputs?.[o.index1];if(!i)return;if(o.index2!==void 0&&"inputs"in i)return pt(i.inputs?.[o.index2],e);if(o.index2===void 0&&!("inputs"in i))return pt(i,e)}else return pt(r?.outputs?.[o.index1],e)}function Y0(e,t,n,o,r,i){if(!i.sourceHandle||!i.targetHandle)return{updatedNodes:e.nodes,validation:{isValid:!1,reason:"Source or target handle not found"}};const s=Ae(o,e.nodes[t].data),a=Ae(r,e.nodes[n].data),c=s?.dataType,l=a?.dataType,u=s?.inferredDataType,h=a?.inferredDataType;if(!c||!l)return{updatedNodes:e.nodes,validation:{isValid:!1,reason:"Source or target handle data type not found"}};if(c.dataTypeObject.underlyingType!=="inferFromConnection"&&l.dataTypeObject.underlyingType!=="inferFromConnection")return{updatedNodes:e.nodes,validation:{isValid:!0}};if(c.dataTypeObject.underlyingType==="inferFromConnection"&&l.dataTypeObject.underlyingType==="inferFromConnection"){if(!u&&!h)return{updatedNodes:e.nodes,validation:{isValid:!1,reason:"None of the handles are inferred, inference has no information to work with"}};if(u&&h)return{updatedNodes:e.nodes,validation:{isValid:!0}};if(u){const d=[...e.nodes];return d[n]={...e.nodes[n],data:zt(e.nodes[n].data,o,c.dataTypeUniqueId,{dataTypeToInferAs:u.dataTypeUniqueId,connectedNodeType:e.nodes[t].data.nodeTypeUniqueId,resetInferredType:!1},e.dataTypes,e.typeOfNodes)},{updatedNodes:d,validation:{isValid:!0}}}if(h){const d=[...e.nodes];return d[t]={...e.nodes[t],data:zt(e.nodes[t].data,r,l.dataTypeUniqueId,{dataTypeToInferAs:h.dataTypeUniqueId,connectedNodeType:e.nodes[n].data.nodeTypeUniqueId,resetInferredType:!1},e.dataTypes,e.typeOfNodes)},{updatedNodes:d,validation:{isValid:!0}}}}if(c.dataTypeObject.underlyingType==="inferFromConnection"){if(u)return{updatedNodes:e.nodes,validation:{isValid:!0}};const d=[...e.nodes];return d[t]={...e.nodes[t],data:zt(e.nodes[t].data,r,c.dataTypeUniqueId,{dataTypeToInferAs:l.dataTypeUniqueId,connectedNodeType:e.nodes[n].data.nodeTypeUniqueId,resetInferredType:!1},e.dataTypes,e.typeOfNodes)},{updatedNodes:d,validation:{isValid:!0}}}if(l.dataTypeObject.underlyingType==="inferFromConnection"){if(h)return{updatedNodes:e.nodes,validation:{isValid:!0}};const d=[...e.nodes];return d[n]={...e.nodes[n],data:zt(e.nodes[n].data,o,l.dataTypeUniqueId,{dataTypeToInferAs:c.dataTypeUniqueId,connectedNodeType:e.nodes[t].data.nodeTypeUniqueId,resetInferredType:!1},e.dataTypes,e.typeOfNodes)},{updatedNodes:d,validation:{isValid:!0}}}return{updatedNodes:e.nodes,validation:{isValid:!0}}}function X0(e,t,n,o,r,i){if(!i.sourceHandle||!i.targetHandle)return{validation:{isValid:!1,reason:"Source or target handle not found"}};const s=Ae(o,e.nodes[t].data),a=Ae(r,e.nodes[n].data),c=En(s),l=En(a);if(!c||!l)return{validation:{isValid:!1,reason:"Source or target handle data type not found"}};const u=c?.dataTypeObject.underlyingType==="complex",h=l?.dataTypeObject.underlyingType==="complex";return!u&&!h?{validation:{isValid:!0}}:u!==h?{validation:{isValid:!1,reason:"Can't connect complex types with non-complex types"}}:u&&h?c.dataTypeUniqueId===l.dataTypeUniqueId||JSON.stringify(c.dataTypeObject.complexSchema)===JSON.stringify(l.dataTypeObject.complexSchema)?{validation:{isValid:!0}}:{validation:{isValid:!1,reason:"Can't connect complex types with different types"}}:{validation:{isValid:!0}}}function U0(e,t,n,o,r,i){if(!i.sourceHandle||!i.targetHandle)return{validation:{isValid:!1,reason:"Source or target handle not found"}};const s=Ae(o,e.nodes[t].data),a=Ae(r,e.nodes[n].data),c=En(s),l=En(a);if(!c||!l)return{validation:{isValid:!1,reason:"Source or target handle data type not found"}};if(c.dataTypeUniqueId===l.dataTypeUniqueId)return{validation:{isValid:!0}};const h=e.allowedConversionsBetweenDataTypes?.[c.dataTypeUniqueId]?.[l.dataTypeUniqueId],d=c.dataTypeObject.underlyingType==="complex"&&l.dataTypeObject.underlyingType==="complex";return h||d&&e.allowConversionBetweenComplexTypesUnlessDisallowedByComplexTypeChecking?{validation:{isValid:!0}}:{validation:{isValid:!1,reason:`${c.dataTypeUniqueId} to ${l.dataTypeUniqueId} conversion is not allowed`}}}function G0(e,t,n,o,r,i){const s=e.nodes[t],a=e.nodes[n],c=Ae(o,s.data),l=Ae(r,a.data),u=c?.dataType,h=l?.dataType;if(!u||!h)return{updatedNodes:e.nodes,validation:{isValid:!1,reason:"Source or target handle data type not found"}};if(u.dataTypeObject.underlyingType!=="inferFromConnection"&&h.dataTypeObject.underlyingType!=="inferFromConnection")return{updatedNodes:e.nodes,validation:{isValid:!0}};let d=e.nodes;if(u.dataTypeObject.underlyingType==="inferFromConnection"){const f=zr([s],e.edges),{inputsAndIndices:p,outputsAndIndices:g}=di(s.data),x={};for(const v of p)v.input.dataType?.dataTypeUniqueId===u.dataTypeUniqueId&&(x[v.input.id]=!0);for(const v of g)v.output.dataType?.dataTypeUniqueId===u.dataTypeUniqueId&&(x[v.output.id]=!0);let b=!1;for(const v of f)if(v.id!==i.id&&!(!v.sourceHandle||!v.targetHandle)){if(x[v.sourceHandle]){b=!0;break}if(x[v.targetHandle]){b=!0;break}}b||(d=[...e.nodes],d[t]={...e.nodes[t],data:zt(e.nodes[t].data,o,u.dataTypeUniqueId,{dataTypeToInferAs:u.dataTypeUniqueId,connectedNodeType:e.nodes[t].data.nodeTypeUniqueId,resetInferredType:!0},e.dataTypes,e.typeOfNodes)})}if(h.dataTypeObject.underlyingType==="inferFromConnection"){const f=zr([a],e.edges),{inputsAndIndices:p,outputsAndIndices:g}=di(a.data),x={};for(const v of p)v.input.dataType?.dataTypeUniqueId===h.dataTypeUniqueId&&(x[v.input.id]=!0);for(const v of g)v.output.dataType?.dataTypeUniqueId===h.dataTypeUniqueId&&(x[v.output.id]=!0);let b=!1;for(const v of f)if(v.id!==i.id&&!(!v.sourceHandle||!v.targetHandle)){if(x[v.sourceHandle]){b=!0;break}if(x[v.targetHandle]){b=!0;break}}b||(d=[...e.nodes],d[n]={...e.nodes[n],data:zt(e.nodes[n].data,r,h.dataTypeUniqueId,{dataTypeToInferAs:h.dataTypeUniqueId,connectedNodeType:e.nodes[n].data.nodeTypeUniqueId,resetInferredType:!0},e.dataTypes,e.typeOfNodes)})}return{updatedNodes:d,validation:{isValid:!0}}}const q0=20;function pl(e,t,n,o,r){const i={id:St(q0),source:e,target:n,sourceHandle:t,targetHandle:o,type:"configurableEdge"};if(yo(i,r.edges)===r.edges)return{updatedNodes:r.nodes,updatedEdges:r.edges,validation:{isValid:!1,reason:"Edge already exists or was rejected by reactflow"}};if(!(r.enableTypeInference||r.enableComplexTypeChecking||r.allowedConversionsBetweenDataTypes))return{updatedNodes:r.nodes,updatedEdges:yo(i,r.edges),validation:{isValid:!0}};const a=r.nodes.findIndex(g=>g.id===e),c=r.nodes.findIndex(g=>g.id===n);if(a===-1||c===-1)return{updatedNodes:r.nodes,updatedEdges:r.edges,validation:{isValid:!1,reason:"Source or target node not found"}};const l=r.nodes[a],u=r.nodes[c],h=_n(t,l.data),d=_n(o,u.data);if(!h||!d)return{updatedNodes:r.nodes,updatedEdges:r.edges,validation:{isValid:!1,reason:"Source or target handle not found"}};let f=r.nodes,p={isValid:!0};if(r.enableTypeInference){const{updatedNodes:g,validation:x}=Y0(r,a,c,h,d,i);f=g,p=x}if(r.enableComplexTypeChecking&&p.isValid){const{validation:g}=X0({...r,nodes:f},a,c,h,d,i);p=g}if(r.allowedConversionsBetweenDataTypes&&p.isValid){const{validation:g}=U0({...r,nodes:f},a,c,h,d,i);p=g}return{updatedNodes:f,updatedEdges:yo(i,r.edges),validation:p}}function gl(e,t,n){if(wn([n],t.edges)===t.edges)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Edge already exists or was rejected by reactflow"}};if(!(t.enableTypeInference||t.enableComplexTypeChecking||t.allowedConversionsBetweenDataTypes))return{updatedNodes:t.nodes,updatedEdges:wn([n],t.edges),validation:{isValid:!0}};const r=t.nodes.findIndex(d=>d.id===e.source),i=t.nodes.findIndex(d=>d.id===e.target);if(r===-1||i===-1)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Source or target node not found"}};if(!e.sourceHandle||!e.targetHandle)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Source or target handle not found"}};const s=t.nodes[r],a=t.nodes[i],c=_n(e.sourceHandle,s.data),l=_n(e.targetHandle,a.data);if(!c||!l)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Source or target handle not found"}};let u=t.nodes,h={isValid:!0};if(t.enableTypeInference){const{updatedNodes:d,validation:f}=G0(t,r,i,c,l,e);u=d,h=f}return{updatedNodes:u,updatedEdges:wn([n],t.edges),validation:h}}function En(e){const t=e?.dataType,n=e?.inferredDataType;if(t)return t.dataTypeObject.underlyingType!=="inferFromConnection"?t:n||void 0}function ml(e,t,n){const o=e.nodes.find(i=>i.id===n);if(!o)return!1;if(o.id===t)return!0;const r=(i,s=new Set)=>{if(s.has(i.id))return!1;s.add(i.id);for(const a of _g(i,e.nodes,e.edges))if(a.id===t||r(a,s))return!0;return!1};return r(o)}const yl=20,Se=["ADD_NODE","ADD_NODE_AND_SELECT","UPDATE_NODE_BY_REACT_FLOW","UPDATE_EDGES_BY_REACT_FLOW","ADD_EDGE_BY_REACT_FLOW","UPDATE_INPUT_VALUE"],ze={[Se[0]]:Se[0],[Se[1]]:Se[1],[Se[2]]:Se[2],[Se[3]]:Se[3],[Se[4]]:Se[4],[Se[5]]:Se[5]};function xl(e,t){return jd(e,o=>{switch(t.type){case ze.ADD_NODE:const r=t.payload.type,i=St(yl),s=t.payload.position,a=li(o.dataTypes,r,o.typeOfNodes,i,s);o.nodes.push(a);break;case ze.ADD_NODE_AND_SELECT:const c=t.payload.type,l=St(yl),u=t.payload.position,h=li(o.dataTypes,c,o.typeOfNodes,l,u);o.nodes=o.nodes.map(w=>({...w,selected:!1})),o.nodes.push({...h,selected:!0});break;case ze.UPDATE_NODE_BY_REACT_FLOW:const d=t.payload.changes;o.nodes=vc(d,o.nodes);break;case ze.UPDATE_EDGES_BY_REACT_FLOW:const f=t.payload.changes;for(const w of f){if(w.type!=="remove"){o.edges=wn([w],o.edges);continue}const{id:k}=w,N=o.edges.find(M=>M.id===k);if(!N)continue;const P=gl(N,o,w);P.validation.isValid&&(o.edges=P.updatedEdges,o.nodes=P.updatedNodes)}break;case ze.ADD_EDGE_BY_REACT_FLOW:const p=t.payload.edge,{sourceHandle:g,targetHandle:x,source:b,target:v}=p;if(o.enableCycleChecking&&ml(o,b,v)||!b||!v||!g||!x)break;const m=pl(b,g,v,x,o);if(!m.validation.isValid)break;o.edges=m.updatedEdges,o.nodes=m.updatedNodes;break}})}function _n(e,t){const n=t?.inputs instanceof Array?t?.inputs:[],r=(t?.outputs instanceof Array?t?.outputs:[]).findIndex(a=>a.id===e);if(r!==-1)return{type:"output",index1:r,index2:void 0};let i;const s=n.findIndex(a=>{if("inputs"in a){const c=a.inputs.findIndex(l=>l.id===e);return c!==-1?(i=c,!0):!1}else return a.id===e});if(s!==-1)return{type:"input",index1:s,index2:i}}function Ae(e,t){if(e)if(e.type==="input"){const n=t?.inputs?.[e.index1];if(!n)return;if(e.index2!==void 0&&"inputs"in n)return n.inputs?.[e.index2];if(e.index2===void 0&&!("inputs"in n))return n}else return t?.outputs?.[e.index1]}function ui(e,t){const n=_n(e,t);return Ae(n,t)}function Z0(e,t,n){return t.map(o=>o.id===e?{...o,...n}:o)}function K0(e,t,n){return"inputs"in t?{...t,inputs:Z0(e,t.inputs,n)}:t.id===e?{...t,...n}:t}function wl(e,t,n){return{...t,inputs:(t.inputs||[]).map(r=>K0(e,r,n))}}function Q0(e,t,n){if(e.type!="input")return t;const o=Ae(e,t);if(!o)return t;const r={...o,...n},i=[...t.inputs||[]],s=t?.inputs?.[e.index1];if(!s)return t;if(e.index2!==void 0&&"inputs"in s){const c=[...s.inputs||[]];c[e.index2]=r,i[e.index1]={...s,inputs:c}}else e.index2===void 0&&!("inputs"in s)&&(i[e.index1]=r);return{...t,inputs:i}}function J0(e,t,n){if(e.type!="output")return t;const o=Ae(e,t);if(!o)return t;const r={...o,...n},i=[...t.outputs||[]];return i[e.index1]=r,{...t,outputs:i}}function ex(e){let t=[];return e.inputs?.forEach((n,o)=>{"inputs"in n?n.inputs.forEach((r,i)=>{t.push({input:r,handleIndices:{type:"input",index1:o,index2:i}})}):t.push({input:n,handleIndices:{type:"input",index1:o,index2:void 0}})}),t}function tx(e){let t=[];return e.outputs?.forEach((n,o)=>{t.push({output:n,handleIndices:{type:"output",index1:o,index2:void 0}})}),t}function di(e){return{inputsAndIndices:ex(e),outputsAndIndices:tx(e)}}function bl(e,t,n,o,r,i){const s=o?hl(r,o.connectedNodeType,i,n):void 0;let a;if(s){const{id:c,name:l,dataType:u,...h}=s;a=h}return t.type==="input"?Q0(t,e,{inferredDataType:o?.dataTypeToInferAs&&!o.resetInferredType?{dataTypeObject:r[o.dataTypeToInferAs],dataTypeUniqueId:o.dataTypeToInferAs}:void 0,...o?.dataTypeToInferAs&&a?a:{}}):J0(t,e,{inferredDataType:o?.dataTypeToInferAs&&!o.resetInferredType?{dataTypeObject:r[o.dataTypeToInferAs],dataTypeUniqueId:o.dataTypeToInferAs}:void 0,...o?.dataTypeToInferAs&&a?a:{}})}function zt(e,t,n,o,r,i){const{inputsAndIndices:s,outputsAndIndices:a}=di(e);let c=e;for(const l of s)l.input.dataType?.dataTypeUniqueId===n&&(c=bl(c,l.handleIndices,t,o,r,i));for(const l of a)l.output.dataType?.dataTypeUniqueId===n&&(c=bl(c,l.handleIndices,t,o,r,i));return c}const fi=O.forwardRef(({id:e,sourceX:t,sourceY:n,targetX:o,targetY:r,sourcePosition:i,targetPosition:s,...a},c)=>{const[l]=mo({sourceX:t,sourceY:n,sourcePosition:i,targetX:o,targetY:r,targetPosition:s}),u=ce(),[h,d]=O.useState(!0),f=O.useRef(null);O.useEffect(()=>{const P=u.getState().domNode;if(!P)return;const M=document.getElementById(e);if(!M)return;const L=new IntersectionObserver(H=>{const j=H.find(R=>R.target.id===e);j&&d(R=>j.isIntersecting)},{root:P,threshold:1,rootMargin:"20px"});return L.observe(M),f.current=L,()=>{f.current&&(f.current.disconnect(),f.current=null)}},[u.getState().domNode]);const p=si(a.source||""),g=O.useMemo(()=>!a.source||!p?void 0:ui(a.sourceHandleId||"",p?.data)?.handleColor??"#A1A1A1",[a.source,p]),x=si(a.target||""),b=O.useMemo(()=>!a.target||!x?void 0:ui(a.targetHandleId||"",x?.data)?.handleColor??"#A1A1A1",[a.target,x]),{label:v,labelStyle:m,markerStart:w,markerEnd:k,interactionWidth:N}=a;return C.jsxs(C.Fragment,{children:[C.jsx("defs",{children:C.jsxs("linearGradient",{id:`linear-gradient-edge-${e}`,x1:t,y1:n,x2:o,y2:r,gradientUnits:"userSpaceOnUse",children:[C.jsx("stop",{stopColor:g,offset:"0"}),C.jsx("stop",{stopColor:b,offset:"1"})]})}),C.jsx($t,{id:e,path:l,label:v,labelStyle:m,markerEnd:k,markerStart:w,interactionWidth:N,className:se("!stroke-7 in-[g.selected]:brightness-150",!h&&"opacity-25"),style:{stroke:`url(#${`linear-gradient-edge-${e}`})`},focusable:!0})]})});fi.displayName="ConfigurableEdge";function vl(e,t,n=!0,o=!1){const r=e!==null?"current"in e?e.current:e:null,i=O.useCallback(s=>{if(!r)return;let a=!0;if(n&&s.target instanceof Node&&!r.contains(s.target))a=!1;else if(o){const c="clientX"in s?{x:s.clientX,y:s.clientY}:{x:s.touches[0].clientX,y:s.touches[0].clientY},l=r.getBoundingClientRect();os(c,l)||(a=!1)}a||t()},[r,t,n,o]);O.useEffect(()=>(document.addEventListener("mousedown",i),document.addEventListener("touchstart",i),()=>{document.removeEventListener("mousedown",i),document.removeEventListener("touchstart",i)}),[r,i])}const Sn=O.forwardRef(({placeholder:e="Input",className:t,...n},o)=>{const r=O.useMemo(()=>n.allowOnlyNumbers&&n.value!==void 0?sr(n.value,n.numberOfDecimals??5):n.value?.toString(),[n.value,n.allowOnlyNumbers,n.numberOfDecimals]),[i,s]=O.useState(r??""),[a,c]=O.useState(null),l=n.value??i,[u,h]=O.useState(l.toString());function d(p){n.allowOnlyNumbers&&/[^0-9\.\-]/.test(p)||h(p)}function f(){if(n.allowOnlyNumbers){const p=rs(u||l.toString()),g=sr(p,n.numberOfDecimals??5);s(g),n.onChange?.(p),h(g)}else s(u),n.onChange?.(u),h(u)}return vl(a,()=>f()),C.jsx("input",{type:"text",className:se("h-[44px] rounded-md text-primary-white bg-primary-black font-main px-4 text-[27px] leading-[27px] outline-none focus-visible:!outline-none border-secondary-dark-gray border w-max min-w-0 placeholder:text-[#6B6B6B]",t),placeholder:e,size:5,ref:p=>{c(p),typeof o=="function"?o(p):o&&(o.current=p)},value:u,onChange:p=>d(p.target.value),onKeyDown:p=>{p.key==="Enter"&&f()},onMouseMove:p=>{p.preventDefault(),p.stopPropagation()},onBlur:p=>{p.preventDefault(),p.stopPropagation(),f()}})});Sn.displayName="Input";function El({nodeId:e,isVisible:t=!0,handleClassName:n,handleStyle:o,lineClassName:r,lineStyle:i,color:s,minWidth:a=10,minHeight:c=10,maxWidth:l=Number.MAX_VALUE,maxHeight:u=Number.MAX_VALUE,keepAspectRatio:h=!1,autoScale:d=!0,shouldResize:f,onResizeStart:p,onResize:g,onResizeEnd:x,linePosition:b=["left","right"],handlePosition:v=[],resizeDirection:m="horizontal"}){return t?C.jsxs(C.Fragment,{children:[b.map(w=>C.jsx(dl,{className:se("!border-none",w==="left"||w==="right"?"!w-4":"!h-4",r),style:i,nodeId:e,position:w,variant:ft.Line,color:s,minWidth:a,minHeight:c,maxWidth:l,maxHeight:u,onResizeStart:p,keepAspectRatio:h,autoScale:d,shouldResize:f,onResize:g,onResizeEnd:x,resizeDirection:m},w)),v.map(w=>C.jsx(dl,{className:n,style:o,nodeId:e,position:w,color:s,minWidth:a,minHeight:c,maxWidth:l,maxHeight:u,onResizeStart:p,keepAspectRatio:h,autoScale:d,shouldResize:f,onResize:g,onResizeEnd:x,resizeDirection:m},w))]}):null}function _l({onMove:e,onClick:t,clickThreshold:n=2,enabled:o=!0,preventDefaultAndStopPropagation:r=!0}={}){const[i,s]=O.useState(!1),[a,c]=O.useState(null),l=O.useRef(null),u=O.useRef(null),h=O.useCallback(d=>{c(d)},[]);return O.useEffect(()=>{if(!a||!o)return;const d=f=>{r&&(f.preventDefault(),f.stopPropagation()),l.current={x:f.clientX,y:f.clientY},u.current={width:a.clientWidth,height:a.clientHeight},s(!0);const p=x=>{r&&(x.preventDefault(),x.stopPropagation()),document.removeEventListener("mouseup",p),document.removeEventListener("mousemove",g),s(!1),l.current&&Math.sqrt((x.clientX-l.current.x)**2+(x.clientY-l.current.y)**2)<n&&t?.()},g=x=>{r&&(x.preventDefault(),x.stopPropagation());const b=x.movementX,v=x.movementY,m=u.current?.width||1,w=u.current?.height||1,k=b/m,N=v/w;e?.(b,v,k,N,m,w)};document.addEventListener("mouseup",p),document.addEventListener("mousemove",g)};return a.addEventListener("mousedown",d),()=>{a.removeEventListener("mousedown",d)}},[a,o,e,t,n,r]),{isDragging:i,dragRef:h}}/**
59
+ `)),h=d.reduce((g,p)=>g.concat(...p),[]);return[d,h]}return[[],[]]},[e]);return z.useEffect(()=>{const f=t?.target??Tg,d=t?.actInsideInputWithModifier??!0;if(e!==null){const h=m=>{if(s.current=m.ctrlKey||m.metaKey||m.shiftKey||m.altKey,(!s.current||s.current&&!d)&&$p(m))return!1;const v=Ig(m.code,c);if(a.current.add(m[v]),Ag(l,a.current,!1)){const b=m.composedPath?.()?.[0]||m.target,_=b?.nodeName==="BUTTON"||b?.nodeName==="A";t.preventDefault!==!1&&(s.current||!_)&&m.preventDefault(),o(!0)}},g=m=>{const x=Ig(m.code,c);Ag(l,a.current,!0)?(o(!1),a.current.clear()):a.current.delete(m[x]),m.key==="Meta"&&a.current.clear(),s.current=!1},p=()=>{a.current.clear(),o(!1)};return f?.addEventListener("keydown",h),f?.addEventListener("keyup",g),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{f?.removeEventListener("keydown",h),f?.removeEventListener("keyup",g),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[e,o]),n}function Ag(e,t,n){return e.filter(o=>n||o.length===t.size).some(o=>o.every(s=>t.has(s)))}function Ig(e,t){return t.includes(e)?"code":"key"}const FC=()=>{const e=je();return z.useMemo(()=>({zoomIn:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomOut:t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,{duration:t?.duration}):Promise.resolve(!1)},zoomTo:(t,n)=>{const{panZoom:o}=e.getState();return o?o.scaleTo(t,{duration:n?.duration}):Promise.resolve(!1)},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[o,s,a],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??o,y:t.y??s,zoom:t.zoom??a},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[t,n,o]=e.getState().transform;return{x:t,y:n,zoom:o}},setCenter:async(t,n,o)=>e.getState().setCenter(t,n,o),fitBounds:async(t,n)=>{const{width:o,height:s,minZoom:a,maxZoom:l,panZoom:c}=e.getState(),f=Tc(t,o,s,a,l,n?.padding??.1);return c?(await c.setViewport(f,{duration:n?.duration,ease:n?.ease,interpolate:n?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(t,n={})=>{const{transform:o,snapGrid:s,snapToGrid:a,domNode:l}=e.getState();if(!l)return t;const{x:c,y:f}=l.getBoundingClientRect(),d={x:t.x-c,y:t.y-f},h=n.snapGrid??s,g=n.snapToGrid??a;return ui(d,o,g,h)},flowToScreenPosition:t=>{const{transform:n,domNode:o}=e.getState();if(!o)return t;const{x:s,y:a}=o.getBoundingClientRect(),l=Ys(t,n);return{x:l.x+s,y:l.y+a}}}),[])};function Og(e,t){const n=[],o=new Map,s=[];for(const a of e)if(a.type==="add"){s.push(a);continue}else if(a.type==="remove"||a.type==="replace")o.set(a.id,[a]);else{const l=o.get(a.id);l?l.push(a):o.set(a.id,[a])}for(const a of t){const l=o.get(a.id);if(!l){n.push(a);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...a};for(const f of l)HC(f,c);n.push(c)}return s.length&&s.forEach(a=>{a.index!==void 0?n.splice(a.index,0,{...a.item}):n.push({...a.item})}),n}function HC(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.width=e.dimensions.width,t.measured.height=e.dimensions.height,e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Pg(e,t){return Og(e,t)}function gi(e,t){return Og(e,t)}function Ir(e,t){return{id:e,type:"select",selected:t}}function lo(e,t=new Set,n=!1){const o=[];for(const[s,a]of e){const l=t.has(s);!(a.selected===void 0&&!l)&&a.selected!==l&&(n&&(a.selected=l),o.push(Ir(a.id,l)))}return o}function kg({items:e=[],lookup:t}){const n=[],o=new Map(e.map(s=>[s.id,s]));for(const[s,a]of e.entries()){const l=t.get(a.id),c=l?.internals?.userNode??l;c!==void 0&&c!==a&&n.push({id:a.id,item:a,type:"replace"}),c===void 0&&n.push({item:a,type:"add",index:s})}for(const[s]of t)o.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function Mg(e){return{id:e.id,type:"remove"}}const Rg=e=>fE(e),zC=e=>Cp(e);function Dg(e){return z.forwardRef(e)}const VC=typeof window<"u"?z.useLayoutEffect:z.useEffect;function Lg(e){const[t,n]=z.useState(BigInt(0)),[o]=z.useState(()=>WC(()=>n(s=>s+BigInt(1))));return VC(()=>{const s=o.get();s.length&&(e(s),o.reset())},[t]),o}function WC(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const $g=z.createContext(null);function jC({children:e}){const t=je(),n=z.useCallback(c=>{const{nodes:f=[],setNodes:d,hasDefaultNodes:h,onNodesChange:g,nodeLookup:p,fitViewQueued:m}=t.getState();let x=f;for(const b of c)x=typeof b=="function"?b(x):b;const v=kg({items:x,lookup:p});h&&d(x),v.length>0?g?.(v):m&&window.requestAnimationFrame(()=>{const{fitViewQueued:b,nodes:_,setNodes:N}=t.getState();b&&N(_)})},[]),o=Lg(n),s=z.useCallback(c=>{const{edges:f=[],setEdges:d,hasDefaultEdges:h,onEdgesChange:g,edgeLookup:p}=t.getState();let m=f;for(const x of c)m=typeof x=="function"?x(m):x;h?d(m):g&&g(kg({items:m,lookup:p}))},[]),a=Lg(s),l=z.useMemo(()=>({nodeQueue:o,edgeQueue:a}),[]);return T.jsx($g.Provider,{value:l,children:e})}function UC(){const e=z.useContext($g);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const GC=e=>!!e.panZoom;function mi(){const e=FC(),t=je(),n=UC(),o=Re(GC),s=z.useMemo(()=>{const a=g=>t.getState().nodeLookup.get(g),l=g=>{n.nodeQueue.push(g)},c=g=>{n.edgeQueue.push(g)},f=g=>{const{nodeLookup:p,nodeOrigin:m}=t.getState(),x=Rg(g)?g:p.get(g.id),v=x.parentId?Rp(x.position,x.measured,x.parentId,p,m):x.position,b={...x,position:v,width:x.measured?.width??x.width,height:x.measured?.height??x.height};return oo(b)},d=(g,p,m={replace:!1})=>{l(x=>x.map(v=>{if(v.id===g){const b=typeof p=="function"?p(v):p;return m.replace&&Rg(b)?b:{...v,...b}}return v}))},h=(g,p,m={replace:!1})=>{c(x=>x.map(v=>{if(v.id===g){const b=typeof p=="function"?p(v):p;return m.replace&&zC(b)?b:{...v,...b}}return v}))};return{getNodes:()=>t.getState().nodes.map(g=>({...g})),getNode:g=>a(g)?.internals.userNode,getInternalNode:a,getEdges:()=>{const{edges:g=[]}=t.getState();return g.map(p=>({...p}))},getEdge:g=>t.getState().edgeLookup.get(g),setNodes:l,setEdges:c,addNodes:g=>{const p=Array.isArray(g)?g:[g];n.nodeQueue.push(m=>[...m,...p])},addEdges:g=>{const p=Array.isArray(g)?g:[g];n.edgeQueue.push(m=>[...m,...p])},toObject:()=>{const{nodes:g=[],edges:p=[],transform:m}=t.getState(),[x,v,b]=m;return{nodes:g.map(_=>({..._})),edges:p.map(_=>({..._})),viewport:{x,y:v,zoom:b}}},deleteElements:async({nodes:g=[],edges:p=[]})=>{const{nodes:m,edges:x,onNodesDelete:v,onEdgesDelete:b,triggerNodeChanges:_,triggerEdgeChanges:N,onDelete:w,onBeforeDelete:E}=t.getState(),{nodes:O,edges:k}=await mE({nodesToRemove:g,edgesToRemove:p,nodes:m,edges:x,onBeforeDelete:E}),M=k.length>0,D=O.length>0;if(M){const V=k.map(Mg);b?.(k),N(V)}if(D){const V=O.map(Mg);v?.(O),_(V)}return(D||M)&&w?.({nodes:O,edges:k}),{deletedNodes:O,deletedEdges:k}},getIntersectingNodes:(g,p=!0,m)=>{const x=Pp(g),v=x?g:f(g),b=m!==void 0;return v?(m||t.getState().nodes).filter(_=>{const N=t.getState().nodeLookup.get(_.id);if(N&&!x&&(_.id===g.id||!N.internals.positionAbsolute))return!1;const w=oo(b?_:N),E=li(w,v);return p&&E>0||E>=w.width*w.height||E>=v.width*v.height}):[]},isNodeIntersecting:(g,p,m=!0)=>{const v=Pp(g)?g:f(g);if(!v)return!1;const b=li(v,p);return m&&b>0||b>=v.width*v.height},updateNode:d,updateNodeData:(g,p,m={replace:!1})=>{d(g,x=>{const v=typeof p=="function"?p(x):p;return m.replace?{...x,data:v}:{...x,data:{...x.data,...v}}},m)},updateEdge:h,updateEdgeData:(g,p,m={replace:!1})=>{h(g,x=>{const v=typeof p=="function"?p(x):p;return m.replace?{...x,data:v}:{...x,data:{...x.data,...v}}},m)},getNodesBounds:g=>{const{nodeLookup:p,nodeOrigin:m}=t.getState();return hE(g,{nodeLookup:p,nodeOrigin:m})},getHandleConnections:({type:g,id:p,nodeId:m})=>Array.from(t.getState().connectionLookup.get(`${m}-${g}${p?`-${p}`:""}`)?.values()??[]),getNodeConnections:({type:g,handleId:p,nodeId:m})=>Array.from(t.getState().connectionLookup.get(`${m}${g?p?`-${g}-${p}`:`-${g}`:""}`)?.values()??[]),fitView:async g=>{const p=t.getState().fitViewResolver??xE();return t.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:p}),n.nodeQueue.push(m=>[...m]),p.promise}}},[]);return z.useMemo(()=>({...s,...e,viewportInitialized:o}),[o])}const Bg=e=>e.selected,YC=typeof window<"u"?window:void 0;function XC({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=je(),{deleteElements:o}=mi(),s=pi(e,{actInsideInputWithModifier:!1}),a=pi(t,{target:YC});z.useEffect(()=>{if(s){const{edges:l,nodes:c}=n.getState();o({nodes:c.filter(Bg),edges:l.filter(Bg)}),n.setState({nodesSelectionActive:!1})}},[s]),z.useEffect(()=>{n.setState({multiSelectionActive:a})},[a])}function qC(e){const t=je();z.useEffect(()=>{const n=()=>{if(!e.current)return!1;const o=Ac(e.current);(o.height===0||o.width===0)&&t.getState().onError?.("004",_t.error004()),t.setState({width:o.width||500,height:o.height||500})};if(e.current){n(),window.addEventListener("resize",n);const o=new ResizeObserver(()=>n());return o.observe(e.current),()=>{window.removeEventListener("resize",n),o&&e.current&&o.unobserve(e.current)}}},[])}const ra={position:"absolute",width:"100%",height:"100%",top:0,left:0},KC=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib});function ZC({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:o=!1,panOnScrollSpeed:s=.5,panOnScrollMode:a=Nr.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:f,translateExtent:d,minZoom:h,maxZoom:g,zoomActivationKeyCode:p,preventScrolling:m=!0,children:x,noWheelClassName:v,noPanClassName:b,onViewportChange:_,isControlledViewport:N,paneClickDistance:w}){const E=je(),O=z.useRef(null),{userSelectionActive:k,lib:M}=Re(KC,qe),D=pi(p),V=z.useRef();qC(O);const K=z.useCallback(Z=>{_?.({x:Z[0],y:Z[1],zoom:Z[2]}),N||E.setState({transform:Z})},[_,N]);return z.useEffect(()=>{if(O.current){V.current=tC({domNode:O.current,minZoom:h,maxZoom:g,translateExtent:d,viewport:f,paneClickDistance:w,onDraggingChange:C=>E.setState({paneDragging:C}),onPanZoomStart:(C,H)=>{const{onViewportChangeStart:B,onMoveStart:R}=E.getState();R?.(C,H),B?.(H)},onPanZoom:(C,H)=>{const{onViewportChange:B,onMove:R}=E.getState();R?.(C,H),B?.(H)},onPanZoomEnd:(C,H)=>{const{onViewportChangeEnd:B,onMoveEnd:R}=E.getState();R?.(C,H),B?.(H)}});const{x:Z,y:U,zoom:q}=V.current.getViewport();return E.setState({panZoom:V.current,transform:[Z,U,q],domNode:O.current.closest(".react-flow")}),()=>{V.current?.destroy()}}},[]),z.useEffect(()=>{V.current?.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:o,panOnScrollSpeed:s,panOnScrollMode:a,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:D,preventScrolling:m,noPanClassName:b,userSelectionActive:k,noWheelClassName:v,lib:M,onTransformChange:K})},[e,t,n,o,s,a,l,c,D,m,b,k,v,M,K]),T.jsx("div",{className:"react-flow__renderer",ref:O,style:ra,children:x})}const QC=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function JC(){const{userSelectionActive:e,userSelectionRect:t}=Re(QC,qe);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 jc=(e,t)=>n=>{n.target===t.current&&e?.(n)},eN=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging});function tN({isSelecting:e,selectionKeyPressed:t,selectionMode:n=no.Full,panOnDrag:o,selectionOnDrag:s,onSelectionStart:a,onSelectionEnd:l,onPaneClick:c,onPaneContextMenu:f,onPaneScroll:d,onPaneMouseEnter:h,onPaneMouseMove:g,onPaneMouseLeave:p,children:m}){const x=je(),{userSelectionActive:v,elementsSelectable:b,dragging:_,connectionInProgress:N}=Re(eN,qe),w=b&&(e||v),E=z.useRef(null),O=z.useRef(),k=z.useRef(new Set),M=z.useRef(new Set),D=z.useRef(!1),V=z.useRef(!1),K=R=>{if(D.current||N){D.current=!1;return}c?.(R),x.getState().resetSelectedElements(),x.setState({nodesSelectionActive:!1})},Z=R=>{if(Array.isArray(o)&&o?.includes(2)){R.preventDefault();return}f?.(R)},U=d?R=>d(R):void 0,q=R=>{const{resetSelectedElements:P,domNode:W}=x.getState();if(O.current=W?.getBoundingClientRect(),!b||!e||R.button!==0||R.target!==E.current||!O.current)return;R.target?.setPointerCapture?.(R.pointerId),V.current=!0,D.current=!1;const{x:$,y:G}=pn(R.nativeEvent,O.current);P(),x.setState({userSelectionRect:{width:0,height:0,startX:$,startY:G,x:$,y:G}}),a?.(R)},C=R=>{const{userSelectionRect:P,transform:W,nodeLookup:$,edgeLookup:G,connectionLookup:J,triggerNodeChanges:re,triggerEdgeChanges:se,defaultEdgeOptions:ce}=x.getState();if(!O.current||!P)return;D.current=!0;const{x:ge,y:te}=pn(R.nativeEvent,O.current),{startX:Q,startY:ae}=P,fe={startX:Q,startY:ae,x:ge<Q?ge:Q,y:te<ae?te:ae,width:Math.abs(ge-Q),height:Math.abs(te-ae)},de=k.current,ue=M.current;k.current=new Set(Ec($,fe,W,n===no.Partial,!0).map(ye=>ye.id)),M.current=new Set;const _e=ce?.selectable??!0;for(const ye of k.current){const Le=J.get(ye);if(Le)for(const{edgeId:Ze}of Le.values()){const Ge=G.get(Ze);Ge&&(Ge.selectable??_e)&&M.current.add(Ze)}}if(!Dp(de,k.current)){const ye=lo($,k.current,!0);re(ye)}if(!Dp(ue,M.current)){const ye=lo(G,M.current);se(ye)}x.setState({userSelectionRect:fe,userSelectionActive:!0,nodesSelectionActive:!1})},H=R=>{if(R.button!==0||!V.current)return;R.target?.releasePointerCapture?.(R.pointerId);const{userSelectionRect:P}=x.getState();!v&&P&&R.target===E.current&&K?.(R),x.setState({userSelectionActive:!1,userSelectionRect:null,nodesSelectionActive:k.current.size>0}),l?.(R),(t||s)&&(D.current=!1),V.current=!1},B=o===!0||Array.isArray(o)&&o.includes(0);return T.jsxs("div",{className:nt(["react-flow__pane",{draggable:B,dragging:_,selection:e}]),onClick:w?void 0:jc(K,E),onContextMenu:jc(Z,E),onWheel:jc(U,E),onPointerEnter:w?void 0:h,onPointerDown:w?q:g,onPointerMove:w?C:g,onPointerUp:w?H:void 0,onPointerLeave:p,ref:E,style:ra,children:[m,T.jsx(JC,{})]})}function Uc({id:e,store:t,unselect:n=!1,nodeRef:o}){const{addSelectedNodes:s,unselectNodesAndEdges:a,multiSelectionActive:l,nodeLookup:c,onError:f}=t.getState(),d=c.get(e);if(!d){f?.("012",_t.error012(e));return}t.setState({nodesSelectionActive:!1}),d.selected?(n||d.selected&&l)&&(a({nodes:[d],edges:[]}),requestAnimationFrame(()=>o?.current?.blur())):s([e])}function Fg({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:o,nodeId:s,isSelectable:a,nodeClickDistance:l}){const c=je(),[f,d]=z.useState(!1),h=z.useRef();return z.useEffect(()=>{h.current=HE({getStoreItems:()=>c.getState(),onNodeMouseDown:g=>{Uc({id:g,store:c,nodeRef:e})},onDragStart:()=>{d(!0)},onDragStop:()=>{d(!1)}})},[]),z.useEffect(()=>{if(t)h.current?.destroy();else if(e.current)return h.current?.update({noDragClassName:n,handleSelector:o,domNode:e.current,isSelectable:a,nodeId:s,nodeClickDistance:l}),()=>{h.current?.destroy()}},[n,o,t,a,e,s]),f}const nN=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function Hg(){const e=je();return z.useCallback(n=>{const{nodeExtent:o,snapToGrid:s,snapGrid:a,nodesDraggable:l,onError:c,updateNodePositions:f,nodeLookup:d,nodeOrigin:h}=e.getState(),g=new Map,p=nN(l),m=s?a[0]:5,x=s?a[1]:5,v=n.direction.x*m*n.factor,b=n.direction.y*x*n.factor;for(const[,_]of d){if(!p(_))continue;let N={x:_.internals.positionAbsolute.x+v,y:_.internals.positionAbsolute.y+b};s&&(N=ci(N,a));const{position:w,positionAbsolute:E}=Np({nodeId:_.id,nextPosition:N,nodeLookup:d,nodeExtent:o,nodeOrigin:h,onError:c});_.position=w,_.internals.positionAbsolute=E,g.set(_.id,_)}f(g)},[])}const Gc=z.createContext(null),rN=Gc.Provider;Gc.Consumer;const yi=()=>z.useContext(Gc),oN=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),iN=(e,t,n)=>o=>{const{connectionClickStartHandle:s,connectionMode:a,connection:l}=o,{fromHandle:c,toHandle:f,isValid:d}=l,h=f?.nodeId===e&&f?.id===t&&f?.type===n;return{connectingFrom:c?.nodeId===e&&c?.id===t&&c?.type===n,connectingTo:h,clickConnecting:s?.nodeId===e&&s?.id===t&&s?.type===n,isPossibleEndHandle:a===to.Strict?c?.type!==n:e!==c?.nodeId||t!==c?.id,connectionInProcess:!!c,clickConnectionInProcess:!!s,valid:h&&d}};function sN({type:e="source",position:t=be.Top,isValidConnection:n,isConnectable:o=!0,isConnectableStart:s=!0,isConnectableEnd:a=!0,id:l,onConnect:c,children:f,className:d,onMouseDown:h,onTouchStart:g,...p},m){const x=l||null,v=e==="target",b=je(),_=yi(),{connectOnClick:N,noPanClassName:w,rfId:E}=Re(oN,qe),{connectingFrom:O,connectingTo:k,clickConnecting:M,isPossibleEndHandle:D,connectionInProcess:V,clickConnectionInProcess:K,valid:Z}=Re(iN(_,x,e),qe);_||b.getState().onError?.("010",_t.error010());const U=H=>{const{defaultEdgeOptions:B,onConnect:R,hasDefaultEdges:P}=b.getState(),W={...B,...H};if(P){const{edges:$,setEdges:G}=b.getState();G(Wp(W,$))}R?.(W),c?.(W)},q=H=>{if(!_)return;const B=Bp(H.nativeEvent);if(s&&(B&&H.button===0||!B)){const R=b.getState();$c.onPointerDown(H.nativeEvent,{handleDomNode:H.currentTarget,autoPanOnConnect:R.autoPanOnConnect,connectionMode:R.connectionMode,connectionRadius:R.connectionRadius,domNode:R.domNode,nodeLookup:R.nodeLookup,lib:R.lib,isTarget:v,handleId:x,nodeId:_,flowId:R.rfId,panBy:R.panBy,cancelConnection:R.cancelConnection,onConnectStart:R.onConnectStart,onConnectEnd:R.onConnectEnd,updateConnection:R.updateConnection,onConnect:U,isValidConnection:n||R.isValidConnection,getTransform:()=>b.getState().transform,getFromHandle:()=>b.getState().connection.fromHandle,autoPanSpeed:R.autoPanSpeed,dragThreshold:R.connectionDragThreshold})}B?h?.(H):g?.(H)},C=H=>{const{onClickConnectStart:B,onClickConnectEnd:R,connectionClickStartHandle:P,connectionMode:W,isValidConnection:$,lib:G,rfId:J,nodeLookup:re,connection:se}=b.getState();if(!_||!P&&!s)return;if(!P){B?.(H.nativeEvent,{nodeId:_,handleId:x,handleType:e}),b.setState({connectionClickStartHandle:{nodeId:_,type:e,id:x}});return}const ce=Lp(H.target),ge=n||$,{connection:te,isValid:Q}=$c.isValid(H.nativeEvent,{handle:{nodeId:_,id:x,type:e},connectionMode:W,fromNodeId:P.nodeId,fromHandleId:P.id||null,fromType:P.type,isValidConnection:ge,flowId:J,doc:ce,lib:G,nodeLookup:re});Q&&te&&U(te);const ae=structuredClone(se);delete ae.inProgress,ae.toPosition=ae.toHandle?ae.toHandle.position:null,R?.(H,ae),b.setState({connectionClickStartHandle:null})};return T.jsx("div",{"data-handleid":x,"data-nodeid":_,"data-handlepos":t,"data-id":`${E}-${_}-${x}-${e}`,className:nt(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",w,d,{source:!v,target:v,connectable:o,connectablestart:s,connectableend:a,clickconnecting:M,connectingfrom:O,connectingto:k,valid:Z,connectionindicator:o&&(!V||D)&&(V||K?a:s)}]),onMouseDown:q,onTouchStart:q,onClick:N?C:void 0,ref:m,...p,children:f})}const vi=z.memo(Dg(sN));function aN({data:e,isConnectable:t,sourcePosition:n=be.Bottom}){return T.jsxs(T.Fragment,{children:[e?.label,T.jsx(vi,{type:"source",position:n,isConnectable:t})]})}function lN({data:e,isConnectable:t,targetPosition:n=be.Top,sourcePosition:o=be.Bottom}){return T.jsxs(T.Fragment,{children:[T.jsx(vi,{type:"target",position:n,isConnectable:t}),e?.label,T.jsx(vi,{type:"source",position:o,isConnectable:t})]})}function cN(){return null}function uN({data:e,isConnectable:t,targetPosition:n=be.Top}){return T.jsxs(T.Fragment,{children:[T.jsx(vi,{type:"target",position:n,isConnectable:t}),e?.label]})}const oa={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},zg={input:aN,default:lN,output:uN,group:cN};function fN(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const dN=e=>{const{width:t,height:n,x:o,y:s}=ai(e.nodeLookup,{filter:a=>!!a.selected});return{width:Jt(t)?t:null,height:Jt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${o}px,${s}px)`}};function hN({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const o=je(),{width:s,height:a,transformString:l,userSelectionActive:c}=Re(dN,qe),f=Hg(),d=z.useRef(null);if(z.useEffect(()=>{n||d.current?.focus({preventScroll:!0})},[n]),Fg({nodeRef:d}),c||!s||!a)return null;const h=e?p=>{const m=o.getState().nodes.filter(x=>x.selected);e(p,m)}:void 0,g=p=>{Object.prototype.hasOwnProperty.call(oa,p.key)&&(p.preventDefault(),f({direction:oa[p.key],factor:p.shiftKey?4:1}))};return T.jsx("div",{className:nt(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:T.jsx("div",{ref:d,className:"react-flow__nodesselection-rect",onContextMenu:h,tabIndex:n?void 0:-1,onKeyDown:n?void 0:g,style:{width:s,height:a}})})}const Vg=typeof window<"u"?window:void 0,pN=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function Wg({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:s,onPaneContextMenu:a,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:f,selectionKeyCode:d,selectionOnDrag:h,selectionMode:g,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:x,panActivationKeyCode:v,zoomActivationKeyCode:b,elementsSelectable:_,zoomOnScroll:N,zoomOnPinch:w,panOnScroll:E,panOnScrollSpeed:O,panOnScrollMode:k,zoomOnDoubleClick:M,panOnDrag:D,defaultViewport:V,translateExtent:K,minZoom:Z,maxZoom:U,preventScrolling:q,onSelectionContextMenu:C,noWheelClassName:H,noPanClassName:B,disableKeyboardA11y:R,onViewportChange:P,isControlledViewport:W}){const{nodesSelectionActive:$,userSelectionActive:G}=Re(pN),J=pi(d,{target:Vg}),re=pi(v,{target:Vg}),se=re||D,ce=re||E,ge=h&&se!==!0,te=J||G||ge;return XC({deleteKeyCode:f,multiSelectionKeyCode:x}),T.jsx(ZC,{onPaneContextMenu:a,elementsSelectable:_,zoomOnScroll:N,zoomOnPinch:w,panOnScroll:ce,panOnScrollSpeed:O,panOnScrollMode:k,zoomOnDoubleClick:M,panOnDrag:!J&&se,defaultViewport:V,translateExtent:K,minZoom:Z,maxZoom:U,zoomActivationKeyCode:b,preventScrolling:q,noWheelClassName:H,noPanClassName:B,onViewportChange:P,isControlledViewport:W,paneClickDistance:c,children:T.jsxs(tN,{onSelectionStart:p,onSelectionEnd:m,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:o,onPaneMouseLeave:s,onPaneContextMenu:a,onPaneScroll:l,panOnDrag:se,isSelecting:!!te,selectionMode:g,selectionKeyPressed:J,selectionOnDrag:ge,children:[e,$&&T.jsx(hN,{onSelectionContextMenu:C,noPanClassName:B,disableKeyboardA11y:R})]})})}Wg.displayName="FlowRenderer";const gN=z.memo(Wg),mN=e=>t=>e?Ec(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 yN(e){return Re(z.useCallback(mN(e),[e]),qe)}const vN=e=>e.updateNodeInternals;function xN(){const e=Re(vN),[t]=z.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const o=new Map;n.forEach(s=>{const a=s.target.getAttribute("data-id");o.set(a,{id:a,nodeElement:s.target,force:!0})}),e(o)}));return z.useEffect(()=>()=>{t?.disconnect()},[t]),t}function wN({node:e,nodeType:t,hasDimensions:n,resizeObserver:o}){const s=je(),a=z.useRef(null),l=z.useRef(null),c=z.useRef(e.sourcePosition),f=z.useRef(e.targetPosition),d=z.useRef(t),h=n&&!!e.internals.handleBounds;return z.useEffect(()=>{a.current&&!e.hidden&&(!h||l.current!==a.current)&&(l.current&&o?.unobserve(l.current),o?.observe(a.current),l.current=a.current)},[h,e.hidden]),z.useEffect(()=>()=>{l.current&&(o?.unobserve(l.current),l.current=null)},[]),z.useEffect(()=>{if(a.current){const g=d.current!==t,p=c.current!==e.sourcePosition,m=f.current!==e.targetPosition;(g||p||m)&&(d.current=t,c.current=e.sourcePosition,f.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 bN({id:e,onClick:t,onMouseEnter:n,onMouseMove:o,onMouseLeave:s,onContextMenu:a,onDoubleClick:l,nodesDraggable:c,elementsSelectable:f,nodesConnectable:d,nodesFocusable:h,resizeObserver:g,noDragClassName:p,noPanClassName:m,disableKeyboardA11y:x,rfId:v,nodeTypes:b,nodeClickDistance:_,onError:N}){const{node:w,internals:E,isParent:O}=Re(Q=>{const ae=Q.nodeLookup.get(e),fe=Q.parentLookup.has(e);return{node:ae,internals:ae.internals,isParent:fe}},qe);let k=w.type||"default",M=b?.[k]||zg[k];M===void 0&&(N?.("003",_t.error003(k)),k="default",M=b?.default||zg.default);const D=!!(w.draggable||c&&typeof w.draggable>"u"),V=!!(w.selectable||f&&typeof w.selectable>"u"),K=!!(w.connectable||d&&typeof w.connectable>"u"),Z=!!(w.focusable||h&&typeof w.focusable>"u"),U=je(),q=Mp(w),C=wN({node:w,nodeType:k,hasDimensions:q,resizeObserver:g}),H=Fg({nodeRef:C,disabled:w.hidden||!D,noDragClassName:p,handleSelector:w.dragHandle,nodeId:e,isSelectable:V,nodeClickDistance:_}),B=Hg();if(w.hidden)return null;const R=kn(w),P=fN(w),W=V||D||t||n||o||s,$=n?Q=>n(Q,{...E.userNode}):void 0,G=o?Q=>o(Q,{...E.userNode}):void 0,J=s?Q=>s(Q,{...E.userNode}):void 0,re=a?Q=>a(Q,{...E.userNode}):void 0,se=l?Q=>l(Q,{...E.userNode}):void 0,ce=Q=>{const{selectNodesOnDrag:ae,nodeDragThreshold:fe}=U.getState();V&&(!ae||!D||fe>0)&&Uc({id:e,store:U,nodeRef:C}),t&&t(Q,{...E.userNode})},ge=Q=>{if(!($p(Q.nativeEvent)||x)){if(xp.includes(Q.key)&&V){const ae=Q.key==="Escape";Uc({id:e,store:U,unselect:ae,nodeRef:C})}else if(D&&w.selected&&Object.prototype.hasOwnProperty.call(oa,Q.key)){Q.preventDefault();const{ariaLabelConfig:ae}=U.getState();U.setState({ariaLiveMessage:ae["node.a11yDescription.ariaLiveMessage"]({direction:Q.key.replace("Arrow","").toLowerCase(),x:~~E.positionAbsolute.x,y:~~E.positionAbsolute.y})}),B({direction:oa[Q.key],factor:Q.shiftKey?4:1})}}},te=()=>{if(x||!C.current?.matches(":focus-visible"))return;const{transform:Q,width:ae,height:fe,autoPanOnNodeFocus:de,setCenter:ue}=U.getState();if(!de)return;Ec(new Map([[e,w]]),{x:0,y:0,width:ae,height:fe},Q,!0).length>0||ue(w.position.x+R.width/2,w.position.y+R.height/2,{zoom:Q[2]})};return T.jsx("div",{className:nt(["react-flow__node",`react-flow__node-${k}`,{[m]:D},w.className,{selected:w.selected,selectable:V,parent:O,draggable:D,dragging:H}]),ref:C,style:{zIndex:E.z,transform:`translate(${E.positionAbsolute.x}px,${E.positionAbsolute.y}px)`,pointerEvents:W?"all":"none",visibility:q?"visible":"hidden",...w.style,...P},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:$,onMouseMove:G,onMouseLeave:J,onContextMenu:re,onClick:ce,onDoubleClick:se,onKeyDown:Z?ge:void 0,tabIndex:Z?0:void 0,onFocus:Z?te:void 0,role:w.ariaRole??(Z?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${bg}-${v}`,"aria-label":w.ariaLabel,...w.domAttributes,children:T.jsx(rN,{value:e,children:T.jsx(M,{id:e,data:w.data,type:k,positionAbsoluteX:E.positionAbsolute.x,positionAbsoluteY:E.positionAbsolute.y,selected:w.selected??!1,selectable:V,draggable:D,deletable:w.deletable??!0,isConnectable:K,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:H,dragHandle:w.dragHandle,zIndex:E.z,parentId:w.parentId,...R})})})}const _N=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function jg(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:s,onError:a}=Re(_N,qe),l=yN(e.onlyRenderVisibleElements),c=xN();return T.jsx("div",{className:"react-flow__nodes",style:ra,children:l.map(f=>T.jsx(bN,{id:f,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:c,nodesDraggable:t,nodesConnectable:n,nodesFocusable:o,elementsSelectable:s,nodeClickDistance:e.nodeClickDistance,onError:a},f))})}jg.displayName="NodeRenderer";const SN=z.memo(jg);function EN(e){return Re(z.useCallback(n=>{if(!e)return n.edges.map(s=>s.id);const o=[];if(n.width&&n.height)for(const s of n.edges){const a=n.nodeLookup.get(s.source),l=n.nodeLookup.get(s.target);a&&l&&SE({sourceNode:a,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&o.push(s.id)}return o},[e]),qe)}const CN=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return T.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},NN=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return T.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Ug={[Ws.Arrow]:CN,[Ws.ArrowClosed]:NN};function TN(e){const t=je();return z.useMemo(()=>Object.prototype.hasOwnProperty.call(Ug,e)?Ug[e]:(t.getState().onError?.("009",_t.error009(e)),null),[e])}const AN=({id:e,type:t,color:n,width:o=12.5,height:s=12.5,markerUnits:a="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const f=TN(t);return f?T.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${o}`,markerHeight:`${s}`,viewBox:"-10 -10 20 20",markerUnits:a,orient:c,refX:"0",refY:"0",children:T.jsx(f,{color:n,strokeWidth:l})}):null},Gg=({defaultColor:e,rfId:t})=>{const n=Re(a=>a.edges),o=Re(a=>a.defaultEdgeOptions),s=z.useMemo(()=>OE(n,{id:t,defaultColor:e,defaultMarkerStart:o?.markerStart,defaultMarkerEnd:o?.markerEnd}),[n,o,t,e]);return s.length?T.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:T.jsx("defs",{children:s.map(a=>T.jsx(AN,{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};Gg.displayName="MarkerDefinitions";var IN=z.memo(Gg);function Yg({x:e,y:t,label:n,labelStyle:o,labelShowBg:s=!0,labelBgStyle:a,labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:f,className:d,...h}){const[g,p]=z.useState({x:1,y:0,width:0,height:0}),m=nt(["react-flow__edge-textwrapper",d]),x=z.useRef(null);return z.useEffect(()=>{if(x.current){const v=x.current.getBBox();p({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?T.jsxs("g",{transform:`translate(${e-g.width/2} ${t-g.height/2})`,className:m,visibility:g.width?"visible":"hidden",...h,children:[s&&T.jsx("rect",{width:g.width+2*l[0],x:-l[0],y:-l[1],height:g.height+2*l[1],className:"react-flow__edge-textbg",style:a,rx:c,ry:c}),T.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:x,style:o,children:n}),f]}):null}Yg.displayName="EdgeText";const ON=z.memo(Yg);function co({path:e,labelX:t,labelY:n,label:o,labelStyle:s,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:f,interactionWidth:d=20,...h}){return T.jsxs(T.Fragment,{children:[T.jsx("path",{...h,d:e,fill:"none",className:nt(["react-flow__edge-path",h.className])}),d?T.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:d,className:"react-flow__edge-interaction"}):null,o&&Jt(t)&&Jt(n)?T.jsx(ON,{x:t,y:n,label:o,labelStyle:s,labelShowBg:a,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:f}):null]})}function Xg({pos:e,x1:t,y1:n,x2:o,y2:s}){return e===be.Left||e===be.Right?[.5*(t+o),n]:[t,.5*(n+s)]}function qg({sourceX:e,sourceY:t,sourcePosition:n=be.Bottom,targetX:o,targetY:s,targetPosition:a=be.Top}){const[l,c]=Xg({pos:n,x1:e,y1:t,x2:o,y2:s}),[f,d]=Xg({pos:a,x1:o,y1:s,x2:e,y2:t}),[h,g,p,m]=Hp({sourceX:e,sourceY:t,targetX:o,targetY:s,sourceControlX:l,sourceControlY:c,targetControlX:f,targetControlY:d});return[`M${e},${t} C${l},${c} ${f},${d} ${o},${s}`,h,g,p,m]}function Kg(e){return z.memo(({id:t,sourceX:n,sourceY:o,targetX:s,targetY:a,sourcePosition:l,targetPosition:c,label:f,labelStyle:d,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:v,markerStart:b,interactionWidth:_})=>{const[N,w,E]=qg({sourceX:n,sourceY:o,sourcePosition:l,targetX:s,targetY:a,targetPosition:c}),O=e.isInternal?void 0:t;return T.jsx(co,{id:O,path:N,labelX:w,labelY:E,label:f,labelStyle:d,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:v,markerStart:b,interactionWidth:_})})}const PN=Kg({isInternal:!1}),Zg=Kg({isInternal:!0});PN.displayName="SimpleBezierEdge",Zg.displayName="SimpleBezierEdgeInternal";function Qg(e){return z.memo(({id:t,sourceX:n,sourceY:o,targetX:s,targetY:a,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:g,style:p,sourcePosition:m=be.Bottom,targetPosition:x=be.Top,markerEnd:v,markerStart:b,pathOptions:_,interactionWidth:N})=>{const[w,E,O]=Ic({sourceX:n,sourceY:o,sourcePosition:m,targetX:s,targetY:a,targetPosition:x,borderRadius:_?.borderRadius,offset:_?.offset,stepPosition:_?.stepPosition}),k=e.isInternal?void 0:t;return T.jsx(co,{id:k,path:w,labelX:E,labelY:O,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:g,style:p,markerEnd:v,markerStart:b,interactionWidth:N})})}const Jg=Qg({isInternal:!1}),em=Qg({isInternal:!0});Jg.displayName="SmoothStepEdge",em.displayName="SmoothStepEdgeInternal";function tm(e){return z.memo(({id:t,...n})=>{const o=e.isInternal?void 0:t;return T.jsx(Jg,{...n,id:o,pathOptions:z.useMemo(()=>({borderRadius:0,offset:n.pathOptions?.offset}),[n.pathOptions?.offset])})})}const kN=tm({isInternal:!1}),nm=tm({isInternal:!0});kN.displayName="StepEdge",nm.displayName="StepEdgeInternal";function rm(e){return z.memo(({id:t,sourceX:n,sourceY:o,targetX:s,targetY:a,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:g,style:p,markerEnd:m,markerStart:x,interactionWidth:v})=>{const[b,_,N]=jp({sourceX:n,sourceY:o,targetX:s,targetY:a}),w=e.isInternal?void 0:t;return T.jsx(co,{id:w,path:b,labelX:_,labelY:N,label:l,labelStyle:c,labelShowBg:f,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:g,style:p,markerEnd:m,markerStart:x,interactionWidth:v})})}const MN=rm({isInternal:!1}),om=rm({isInternal:!0});MN.displayName="StraightEdge",om.displayName="StraightEdgeInternal";function im(e){return z.memo(({id:t,sourceX:n,sourceY:o,targetX:s,targetY:a,sourcePosition:l=be.Bottom,targetPosition:c=be.Top,label:f,labelStyle:d,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:v,markerStart:b,pathOptions:_,interactionWidth:N})=>{const[w,E,O]=qs({sourceX:n,sourceY:o,sourcePosition:l,targetX:s,targetY:a,targetPosition:c,curvature:_?.curvature}),k=e.isInternal?void 0:t;return T.jsx(co,{id:k,path:w,labelX:E,labelY:O,label:f,labelStyle:d,labelShowBg:h,labelBgStyle:g,labelBgPadding:p,labelBgBorderRadius:m,style:x,markerEnd:v,markerStart:b,interactionWidth:N})})}const RN=im({isInternal:!1}),sm=im({isInternal:!0});RN.displayName="BezierEdge",sm.displayName="BezierEdgeInternal";const am={default:sm,straight:om,step:nm,smoothstep:em,simplebezier:Zg},lm={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},DN=(e,t,n)=>n===be.Left?e-t:n===be.Right?e+t:e,LN=(e,t,n)=>n===be.Top?e-t:n===be.Bottom?e+t:e,cm="react-flow__edgeupdater";function um({position:e,centerX:t,centerY:n,radius:o=10,onMouseDown:s,onMouseEnter:a,onMouseOut:l,type:c}){return T.jsx("circle",{onMouseDown:s,onMouseEnter:a,onMouseOut:l,className:nt([cm,`${cm}-${c}`]),cx:DN(t,o,e),cy:LN(n,o,e),r:o,stroke:"transparent",fill:"transparent"})}function $N({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:o,sourceY:s,targetX:a,targetY:l,sourcePosition:c,targetPosition:f,onReconnect:d,onReconnectStart:h,onReconnectEnd:g,setReconnecting:p,setUpdateHover:m}){const x=je(),v=(E,O)=>{if(E.button!==0)return;const{autoPanOnConnect:k,domNode:M,isValidConnection:D,connectionMode:V,connectionRadius:K,lib:Z,onConnectStart:U,onConnectEnd:q,cancelConnection:C,nodeLookup:H,rfId:B,panBy:R,updateConnection:P}=x.getState(),W=O.type==="target",$=(re,se)=>{p(!1),g?.(re,n,O.type,se)},G=re=>d?.(n,re),J=(re,se)=>{p(!0),h?.(E,n,O.type),U?.(re,se)};$c.onPointerDown(E.nativeEvent,{autoPanOnConnect:k,connectionMode:V,connectionRadius:K,domNode:M,handleId:O.id,nodeId:O.nodeId,nodeLookup:H,isTarget:W,edgeUpdaterType:O.type,lib:Z,flowId:B,cancelConnection:C,panBy:R,isValidConnection:D,onConnect:G,onConnectStart:J,onConnectEnd:q,onReconnectEnd:$,updateConnection:P,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:E.currentTarget})},b=E=>v(E,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),_=E=>v(E,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),N=()=>m(!0),w=()=>m(!1);return T.jsxs(T.Fragment,{children:[(e===!0||e==="source")&&T.jsx(um,{position:c,centerX:o,centerY:s,radius:t,onMouseDown:b,onMouseEnter:N,onMouseOut:w,type:"source"}),(e===!0||e==="target")&&T.jsx(um,{position:f,centerX:a,centerY:l,radius:t,onMouseDown:_,onMouseEnter:N,onMouseOut:w,type:"target"})]})}function BN({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:o,onClick:s,onDoubleClick:a,onContextMenu:l,onMouseEnter:c,onMouseMove:f,onMouseLeave:d,reconnectRadius:h,onReconnect:g,onReconnectStart:p,onReconnectEnd:m,rfId:x,edgeTypes:v,noPanClassName:b,onError:_,disableKeyboardA11y:N}){let w=Re(ue=>ue.edgeLookup.get(e));const E=Re(ue=>ue.defaultEdgeOptions);w=E?{...E,...w}:w;let O=w.type||"default",k=v?.[O]||am[O];k===void 0&&(_?.("011",_t.error011(O)),O="default",k=v?.default||am.default);const M=!!(w.focusable||t&&typeof w.focusable>"u"),D=typeof g<"u"&&(w.reconnectable||n&&typeof w.reconnectable>"u"),V=!!(w.selectable||o&&typeof w.selectable>"u"),K=z.useRef(null),[Z,U]=z.useState(!1),[q,C]=z.useState(!1),H=je(),{zIndex:B,sourceX:R,sourceY:P,targetX:W,targetY:$,sourcePosition:G,targetPosition:J}=Re(z.useCallback(ue=>{const _e=ue.nodeLookup.get(w.source),ye=ue.nodeLookup.get(w.target);if(!_e||!ye)return{zIndex:w.zIndex,...lm};const Le=IE({id:e,sourceNode:_e,targetNode:ye,sourceHandle:w.sourceHandle||null,targetHandle:w.targetHandle||null,connectionMode:ue.connectionMode,onError:_});return{zIndex:_E({selected:w.selected,zIndex:w.zIndex,sourceNode:_e,targetNode:ye,elevateOnSelect:ue.elevateEdgesOnSelect}),...Le||lm}},[w.source,w.target,w.sourceHandle,w.targetHandle,w.selected,w.zIndex]),qe),re=z.useMemo(()=>w.markerStart?`url('#${Oc(w.markerStart,x)}')`:void 0,[w.markerStart,x]),se=z.useMemo(()=>w.markerEnd?`url('#${Oc(w.markerEnd,x)}')`:void 0,[w.markerEnd,x]);if(w.hidden||R===null||P===null||W===null||$===null)return null;const ce=ue=>{const{addSelectedEdges:_e,unselectNodesAndEdges:ye,multiSelectionActive:Le}=H.getState();V&&(H.setState({nodesSelectionActive:!1}),w.selected&&Le?(ye({nodes:[],edges:[w]}),K.current?.blur()):_e([e])),s&&s(ue,w)},ge=a?ue=>{a(ue,{...w})}:void 0,te=l?ue=>{l(ue,{...w})}:void 0,Q=c?ue=>{c(ue,{...w})}:void 0,ae=f?ue=>{f(ue,{...w})}:void 0,fe=d?ue=>{d(ue,{...w})}:void 0,de=ue=>{if(!N&&xp.includes(ue.key)&&V){const{unselectNodesAndEdges:_e,addSelectedEdges:ye}=H.getState();ue.key==="Escape"?(K.current?.blur(),_e({edges:[w]})):ye([e])}};return T.jsx("svg",{style:{zIndex:B},children:T.jsxs("g",{className:nt(["react-flow__edge",`react-flow__edge-${O}`,w.className,b,{selected:w.selected,animated:w.animated,inactive:!V&&!s,updating:Z,selectable:V}]),onClick:ce,onDoubleClick:ge,onContextMenu:te,onMouseEnter:Q,onMouseMove:ae,onMouseLeave:fe,onKeyDown:M?de:void 0,tabIndex:M?0:void 0,role:w.ariaRole??(M?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":w.ariaLabel===null?void 0:w.ariaLabel||`Edge from ${w.source} to ${w.target}`,"aria-describedby":M?`${_g}-${x}`:void 0,ref:K,...w.domAttributes,children:[!q&&T.jsx(k,{id:e,source:w.source,target:w.target,type:w.type,selected:w.selected,animated:w.animated,selectable:V,deletable:w.deletable??!0,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,sourceX:R,sourceY:P,targetX:W,targetY:$,sourcePosition:G,targetPosition:J,data:w.data,style:w.style,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerStart:re,markerEnd:se,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth}),D&&T.jsx($N,{edge:w,isReconnectable:D,reconnectRadius:h,onReconnect:g,onReconnectStart:p,onReconnectEnd:m,sourceX:R,sourceY:P,targetX:W,targetY:$,sourcePosition:G,targetPosition:J,setUpdateHover:U,setReconnecting:C})]})})}const FN=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function fm({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:o,noPanClassName:s,onReconnect:a,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:f,onEdgeMouseLeave:d,onEdgeClick:h,reconnectRadius:g,onEdgeDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,disableKeyboardA11y:v}){const{edgesFocusable:b,edgesReconnectable:_,elementsSelectable:N,onError:w}=Re(FN,qe),E=EN(t);return T.jsxs("div",{className:"react-flow__edges",children:[T.jsx(IN,{defaultColor:e,rfId:n}),E.map(O=>T.jsx(BN,{id:O,edgesFocusable:b,edgesReconnectable:_,elementsSelectable:N,noPanClassName:s,onReconnect:a,onContextMenu:l,onMouseEnter:c,onMouseMove:f,onMouseLeave:d,onClick:h,reconnectRadius:g,onDoubleClick:p,onReconnectStart:m,onReconnectEnd:x,rfId:n,onError:w,edgeTypes:o,disableKeyboardA11y:v},O))]})}fm.displayName="EdgeRenderer";const HN=z.memo(fm),zN=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function VN({children:e}){const t=Re(zN);return T.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function WN(e){const t=mi(),n=z.useRef(!1);z.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const jN=e=>e.panZoom?.syncViewport;function UN(e){const t=Re(jN),n=je();return z.useEffect(()=>{e&&(t?.(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function GN(e){return e.connection.inProgress?{...e.connection,to:ui(e.connection.to,e.transform)}:{...e.connection}}function YN(e){return GN}function dm(e){const t=YN();return Re(t,qe)}const XN=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function qN({containerStyle:e,style:t,type:n,component:o}){const{nodesConnectable:s,width:a,height:l,isValid:c,inProgress:f}=Re(XN,qe);return!(a&&s&&f)?null:T.jsx("svg",{style:e,width:a,height:l,className:"react-flow__connectionline react-flow__container",children:T.jsx("g",{className:nt(["react-flow__connection",Ep(c)]),children:T.jsx(hm,{style:t,type:n,CustomComponent:o,isValid:c})})})}const hm=({style:e,type:t=Zn.Bezier,CustomComponent:n,isValid:o})=>{const{inProgress:s,from:a,fromNode:l,fromHandle:c,fromPosition:f,to:d,toNode:h,toHandle:g,toPosition:p}=dm();if(!s)return;if(n)return T.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:c,fromX:a.x,fromY:a.y,toX:d.x,toY:d.y,fromPosition:f,toPosition:p,connectionStatus:Ep(o),toNode:h,toHandle:g});let m="";const x={sourceX:a.x,sourceY:a.y,sourcePosition:f,targetX:d.x,targetY:d.y,targetPosition:p};switch(t){case Zn.Bezier:[m]=qs(x);break;case Zn.SimpleBezier:[m]=qg(x);break;case Zn.Step:[m]=Ic({...x,borderRadius:0});break;case Zn.SmoothStep:[m]=Ic(x);break;default:[m]=jp(x)}return T.jsx("path",{d:m,fill:"none",className:"react-flow__connection-path",style:e})};hm.displayName="ConnectionLine";const KN={};function pm(e=KN){const t=z.useRef(e),n=je();z.useEffect(()=>{if(process.env.NODE_ENV==="development"){const o=new Set([...Object.keys(t.current),...Object.keys(e)]);for(const s of o)if(t.current[s]!==e[s]){n.getState().onError?.("002",_t.error002());break}t.current=e}},[e])}function ZN(){const e=je(),t=z.useRef(!1);z.useEffect(()=>{if(process.env.NODE_ENV==="development"&&!t.current){const n=document.querySelector(".react-flow__pane");n&&window.getComputedStyle(n).zIndex!=="1"&&e.getState().onError?.("013",_t.error013("react")),t.current=!0}},[])}function gm({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:o,onEdgeClick:s,onNodeDoubleClick:a,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:h,onSelectionContextMenu:g,onSelectionStart:p,onSelectionEnd:m,connectionLineType:x,connectionLineStyle:v,connectionLineComponent:b,connectionLineContainerStyle:_,selectionKeyCode:N,selectionOnDrag:w,selectionMode:E,multiSelectionKeyCode:O,panActivationKeyCode:k,zoomActivationKeyCode:M,deleteKeyCode:D,onlyRenderVisibleElements:V,elementsSelectable:K,defaultViewport:Z,translateExtent:U,minZoom:q,maxZoom:C,preventScrolling:H,defaultMarkerColor:B,zoomOnScroll:R,zoomOnPinch:P,panOnScroll:W,panOnScrollSpeed:$,panOnScrollMode:G,zoomOnDoubleClick:J,panOnDrag:re,onPaneClick:se,onPaneMouseEnter:ce,onPaneMouseMove:ge,onPaneMouseLeave:te,onPaneScroll:Q,onPaneContextMenu:ae,paneClickDistance:fe,nodeClickDistance:de,onEdgeContextMenu:ue,onEdgeMouseEnter:_e,onEdgeMouseMove:ye,onEdgeMouseLeave:Le,reconnectRadius:Ze,onReconnect:Ge,onReconnectStart:Fn,onReconnectEnd:bo,noDragClassName:bn,noWheelClassName:pt,noPanClassName:nn,disableKeyboardA11y:_n,nodeExtent:Mi,rfId:Sn,viewport:lr,onViewportChange:rn}){return pm(e),pm(t),ZN(),WN(n),UN(lr),T.jsx(gN,{onPaneClick:se,onPaneMouseEnter:ce,onPaneMouseMove:ge,onPaneMouseLeave:te,onPaneContextMenu:ae,onPaneScroll:Q,paneClickDistance:fe,deleteKeyCode:D,selectionKeyCode:N,selectionOnDrag:w,selectionMode:E,onSelectionStart:p,onSelectionEnd:m,multiSelectionKeyCode:O,panActivationKeyCode:k,zoomActivationKeyCode:M,elementsSelectable:K,zoomOnScroll:R,zoomOnPinch:P,zoomOnDoubleClick:J,panOnScroll:W,panOnScrollSpeed:$,panOnScrollMode:G,panOnDrag:re,defaultViewport:Z,translateExtent:U,minZoom:q,maxZoom:C,onSelectionContextMenu:g,preventScrolling:H,noDragClassName:bn,noWheelClassName:pt,noPanClassName:nn,disableKeyboardA11y:_n,onViewportChange:rn,isControlledViewport:!!lr,children:T.jsxs(VN,{children:[T.jsx(HN,{edgeTypes:t,onEdgeClick:s,onEdgeDoubleClick:l,onReconnect:Ge,onReconnectStart:Fn,onReconnectEnd:bo,onlyRenderVisibleElements:V,onEdgeContextMenu:ue,onEdgeMouseEnter:_e,onEdgeMouseMove:ye,onEdgeMouseLeave:Le,reconnectRadius:Ze,defaultMarkerColor:B,noPanClassName:nn,disableKeyboardA11y:_n,rfId:Sn}),T.jsx(qN,{style:v,type:x,component:b,containerStyle:_}),T.jsx("div",{className:"react-flow__edgelabel-renderer"}),T.jsx(SN,{nodeTypes:e,onNodeClick:o,onNodeDoubleClick:a,onNodeMouseEnter:c,onNodeMouseMove:f,onNodeMouseLeave:d,onNodeContextMenu:h,nodeClickDistance:de,onlyRenderVisibleElements:V,noPanClassName:nn,noDragClassName:bn,disableKeyboardA11y:_n,nodeExtent:Mi,rfId:Sn}),T.jsx("div",{className:"react-flow__viewport-portal"})]})})}gm.displayName="GraphView";const QN=z.memo(gm),mm=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:s,height:a,fitView:l,fitViewOptions:c,minZoom:f=.5,maxZoom:d=2,nodeOrigin:h,nodeExtent:g}={})=>{const p=new Map,m=new Map,x=new Map,v=new Map,b=o??t??[],_=n??e??[],N=h??[0,0],w=g??ii;Qp(x,v,b);const E=Mc(_,p,m,{nodeOrigin:N,nodeExtent:w,elevateNodesOnSelect:!1});let O=[0,0,1];if(l&&s&&a){const k=ai(p,{filter:K=>!!((K.width||K.initialWidth)&&(K.height||K.initialHeight))}),{x:M,y:D,zoom:V}=Tc(k,s,a,f,d,c?.padding??.1);O=[M,D,V]}return{rfId:"1",width:0,height:0,transform:O,nodes:_,nodesInitialized:E,nodeLookup:p,parentLookup:m,edges:b,edgeLookup:v,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:o!==void 0,panZoom:null,minZoom:f,maxZoom:d,translateExtent:ii,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:to.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:N,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!1,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:c,fitViewResolver:null,connection:{...bp},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:kp,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:wp}},JN=({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:s,height:a,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:d,nodeOrigin:h,nodeExtent:g})=>bC((p,m)=>{async function x(){const{nodeLookup:v,panZoom:b,fitViewOptions:_,fitViewResolver:N,width:w,height:E,minZoom:O,maxZoom:k}=m();b&&(await gE({nodes:v,width:w,height:E,panZoom:b,minZoom:O,maxZoom:k},_),N?.resolve(!0),p({fitViewResolver:null}))}return{...mm({nodes:e,edges:t,width:s,height:a,fitView:l,fitViewOptions:c,minZoom:f,maxZoom:d,nodeOrigin:h,nodeExtent:g,defaultNodes:n,defaultEdges:o}),setNodes:v=>{const{nodeLookup:b,parentLookup:_,nodeOrigin:N,elevateNodesOnSelect:w,fitViewQueued:E}=m(),O=Mc(v,b,_,{nodeOrigin:N,nodeExtent:g,elevateNodesOnSelect:w,checkEquality:!0});E&&O?(x(),p({nodes:v,nodesInitialized:O,fitViewQueued:!1,fitViewOptions:void 0})):p({nodes:v,nodesInitialized:O})},setEdges:v=>{const{connectionLookup:b,edgeLookup:_}=m();Qp(b,_,v),p({edges:v})},setDefaultNodesAndEdges:(v,b)=>{if(v){const{setNodes:_}=m();_(v),p({hasDefaultNodes:!0})}if(b){const{setEdges:_}=m();_(b),p({hasDefaultEdges:!0})}},updateNodeInternals:v=>{const{triggerNodeChanges:b,nodeLookup:_,parentLookup:N,domNode:w,nodeOrigin:E,nodeExtent:O,debug:k,fitViewQueued:M}=m(),{changes:D,updatedInternals:V}=DE(v,_,N,w,E,O);V&&(kE(_,N,{nodeOrigin:E,nodeExtent:O}),M?(x(),p({fitViewQueued:!1,fitViewOptions:void 0})):p({}),D?.length>0&&(k&&console.log("React Flow: trigger node changes",D),b?.(D)))},updateNodePositions:(v,b=!1)=>{const _=[],N=[],{nodeLookup:w,triggerNodeChanges:E}=m();for(const[O,k]of v){const M=w.get(O),D=!!(M?.expandParent&&M?.parentId&&k?.position),V={id:O,type:"position",position:D?{x:Math.max(0,k.position.x),y:Math.max(0,k.position.y)}:k.position,dragging:b};D&&M.parentId&&_.push({id:O,parentId:M.parentId,rect:{...k.internals.positionAbsolute,width:k.measured.width??0,height:k.measured.height??0}}),N.push(V)}if(_.length>0){const{parentLookup:O,nodeOrigin:k}=m(),M=Dc(_,w,O,k);N.push(...M)}E(N)},triggerNodeChanges:v=>{const{onNodesChange:b,setNodes:_,nodes:N,hasDefaultNodes:w,debug:E}=m();if(v?.length){if(w){const O=Pg(v,N);_(O)}E&&console.log("React Flow: trigger node changes",v),b?.(v)}},triggerEdgeChanges:v=>{const{onEdgesChange:b,setEdges:_,edges:N,hasDefaultEdges:w,debug:E}=m();if(v?.length){if(w){const O=gi(v,N);_(O)}E&&console.log("React Flow: trigger edge changes",v),b?.(v)}},addSelectedNodes:v=>{const{multiSelectionActive:b,edgeLookup:_,nodeLookup:N,triggerNodeChanges:w,triggerEdgeChanges:E}=m();if(b){const O=v.map(k=>Ir(k,!0));w(O);return}w(lo(N,new Set([...v]),!0)),E(lo(_))},addSelectedEdges:v=>{const{multiSelectionActive:b,edgeLookup:_,nodeLookup:N,triggerNodeChanges:w,triggerEdgeChanges:E}=m();if(b){const O=v.map(k=>Ir(k,!0));E(O);return}E(lo(_,new Set([...v]))),w(lo(N,new Set,!0))},unselectNodesAndEdges:({nodes:v,edges:b}={})=>{const{edges:_,nodes:N,nodeLookup:w,triggerNodeChanges:E,triggerEdgeChanges:O}=m(),k=v||N,M=b||_,D=k.map(K=>{const Z=w.get(K.id);return Z&&(Z.selected=!1),Ir(K.id,!1)}),V=M.map(K=>Ir(K.id,!1));E(D),O(V)},setMinZoom:v=>{const{panZoom:b,maxZoom:_}=m();b?.setScaleExtent([v,_]),p({minZoom:v})},setMaxZoom:v=>{const{panZoom:b,minZoom:_}=m();b?.setScaleExtent([_,v]),p({maxZoom:v})},setTranslateExtent:v=>{m().panZoom?.setTranslateExtent(v),p({translateExtent:v})},setPaneClickDistance:v=>{m().panZoom?.setClickDistance(v)},resetSelectedElements:()=>{const{edges:v,nodes:b,triggerNodeChanges:_,triggerEdgeChanges:N,elementsSelectable:w}=m();if(!w)return;const E=b.reduce((k,M)=>M.selected?[...k,Ir(M.id,!1)]:k,[]),O=v.reduce((k,M)=>M.selected?[...k,Ir(M.id,!1)]:k,[]);_(E),N(O)},setNodeExtent:v=>{const{nodes:b,nodeLookup:_,parentLookup:N,nodeOrigin:w,elevateNodesOnSelect:E,nodeExtent:O}=m();v[0][0]===O[0][0]&&v[0][1]===O[0][1]&&v[1][0]===O[1][0]&&v[1][1]===O[1][1]||(Mc(b,_,N,{nodeOrigin:w,nodeExtent:v,elevateNodesOnSelect:E,checkEquality:!1}),p({nodeExtent:v}))},panBy:v=>{const{transform:b,width:_,height:N,panZoom:w,translateExtent:E}=m();return LE({delta:v,panZoom:w,transform:b,translateExtent:E,width:_,height:N})},setCenter:async(v,b,_)=>{const{width:N,height:w,maxZoom:E,panZoom:O}=m();if(!O)return Promise.resolve(!1);const k=typeof _?.zoom<"u"?_.zoom:E;return await O.setViewport({x:N/2-v*k,y:w/2-b*k,zoom:k},{duration:_?.duration,ease:_?.ease,interpolate:_?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{p({connection:{...bp}})},updateConnection:v=>{p({connection:v})},reset:()=>p({...mm()})}},Object.is);function ym({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:o,initialWidth:s,initialHeight:a,initialMinZoom:l,initialMaxZoom:c,initialFitViewOptions:f,fitView:d,nodeOrigin:h,nodeExtent:g,children:p}){const[m]=z.useState(()=>JN({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,width:s,height:a,fitView:d,minZoom:l,maxZoom:c,fitViewOptions:f,nodeOrigin:h,nodeExtent:g}));return T.jsx(_C,{value:m,children:T.jsx(jC,{children:p})})}function eT({children:e,nodes:t,edges:n,defaultNodes:o,defaultEdges:s,width:a,height:l,fitView:c,fitViewOptions:f,minZoom:d,maxZoom:h,nodeOrigin:g,nodeExtent:p}){return z.useContext(ea)?T.jsx(T.Fragment,{children:e}):T.jsx(ym,{initialNodes:t,initialEdges:n,defaultNodes:o,defaultEdges:s,initialWidth:a,initialHeight:l,fitView:c,initialFitViewOptions:f,initialMinZoom:d,initialMaxZoom:h,nodeOrigin:g,nodeExtent:p,children:e})}const tT={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function nT({nodes:e,edges:t,defaultNodes:n,defaultEdges:o,className:s,nodeTypes:a,edgeTypes:l,onNodeClick:c,onEdgeClick:f,onInit:d,onMove:h,onMoveStart:g,onMoveEnd:p,onConnect:m,onConnectStart:x,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:_,onNodeMouseEnter:N,onNodeMouseMove:w,onNodeMouseLeave:E,onNodeContextMenu:O,onNodeDoubleClick:k,onNodeDragStart:M,onNodeDrag:D,onNodeDragStop:V,onNodesDelete:K,onEdgesDelete:Z,onDelete:U,onSelectionChange:q,onSelectionDragStart:C,onSelectionDrag:H,onSelectionDragStop:B,onSelectionContextMenu:R,onSelectionStart:P,onSelectionEnd:W,onBeforeDelete:$,connectionMode:G,connectionLineType:J=Zn.Bezier,connectionLineStyle:re,connectionLineComponent:se,connectionLineContainerStyle:ce,deleteKeyCode:ge="Backspace",selectionKeyCode:te="Shift",selectionOnDrag:Q=!1,selectionMode:ae=no.Full,panActivationKeyCode:fe="Space",multiSelectionKeyCode:de=fi()?"Meta":"Control",zoomActivationKeyCode:ue=fi()?"Meta":"Control",snapToGrid:_e,snapGrid:ye,onlyRenderVisibleElements:Le=!1,selectNodesOnDrag:Ze,nodesDraggable:Ge,autoPanOnNodeFocus:Fn,nodesConnectable:bo,nodesFocusable:bn,nodeOrigin:pt=Sg,edgesFocusable:nn,edgesReconnectable:_n,elementsSelectable:Mi=!0,defaultViewport:Sn=DC,minZoom:lr=.5,maxZoom:rn=2,translateExtent:Hn=ii,preventScrolling:Ri=!0,nodeExtent:Lr,defaultMarkerColor:Di="#b1b1b7",zoomOnScroll:Li=!0,zoomOnPinch:$i=!0,panOnScroll:Bi=!1,panOnScrollSpeed:Fi=.5,panOnScrollMode:Hi=Nr.Free,zoomOnDoubleClick:zi=!0,panOnDrag:tf=!0,onPaneClick:nf,onPaneMouseEnter:rf,onPaneMouseMove:Ba,onPaneMouseLeave:Fa,onPaneScroll:of,onPaneContextMenu:sf,paneClickDistance:Ha=0,nodeClickDistance:af=0,children:za,onReconnect:lf,onReconnectStart:cf,onReconnectEnd:uf,onEdgeContextMenu:Vi,onEdgeDoubleClick:ff,onEdgeMouseEnter:Wi,onEdgeMouseMove:df,onEdgeMouseLeave:hf,reconnectRadius:pf=10,onNodesChange:gf,onEdgesChange:mf,noDragClassName:yf="nodrag",noWheelClassName:vf="nowheel",noPanClassName:Va="nopan",fitView:ji,fitViewOptions:Wa,connectOnClick:xf,attributionPosition:wf,proOptions:bf,defaultEdgeOptions:_f,elevateNodesOnSelect:Sf,elevateEdgesOnSelect:_o,disableKeyboardA11y:ja=!1,autoPanOnConnect:So,autoPanOnNodeDrag:Ef,autoPanSpeed:Cf,connectionRadius:Nf,isValidConnection:Ua,onError:Ga,style:Ya,id:Xa,nodeDragThreshold:Tf,connectionDragThreshold:Af,viewport:If,onViewportChange:qa,width:Ka,height:Za,colorMode:Ui="light",debug:Of,onScroll:Gi,ariaLabelConfig:Eo,...Qa},Pf){const Co=Xa||"1",Ja=BC(Ui),Yi=z.useCallback(el=>{el.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Gi?.(el)},[Gi]);return T.jsx("div",{"data-testid":"rf__wrapper",...Qa,onScroll:Yi,style:{...Ya,...tT},ref:Pf,className:nt(["react-flow",s,Ja]),id:Xa,role:"application",children:T.jsxs(eT,{nodes:e,edges:t,width:Ka,height:Za,fitView:ji,fitViewOptions:Wa,minZoom:lr,maxZoom:rn,nodeOrigin:pt,nodeExtent:Lr,children:[T.jsx(QN,{onInit:d,onNodeClick:c,onEdgeClick:f,onNodeMouseEnter:N,onNodeMouseMove:w,onNodeMouseLeave:E,onNodeContextMenu:O,onNodeDoubleClick:k,nodeTypes:a,edgeTypes:l,connectionLineType:J,connectionLineStyle:re,connectionLineComponent:se,connectionLineContainerStyle:ce,selectionKeyCode:te,selectionOnDrag:Q,selectionMode:ae,deleteKeyCode:ge,multiSelectionKeyCode:de,panActivationKeyCode:fe,zoomActivationKeyCode:ue,onlyRenderVisibleElements:Le,defaultViewport:Sn,translateExtent:Hn,minZoom:lr,maxZoom:rn,preventScrolling:Ri,zoomOnScroll:Li,zoomOnPinch:$i,zoomOnDoubleClick:zi,panOnScroll:Bi,panOnScrollSpeed:Fi,panOnScrollMode:Hi,panOnDrag:tf,onPaneClick:nf,onPaneMouseEnter:rf,onPaneMouseMove:Ba,onPaneMouseLeave:Fa,onPaneScroll:of,onPaneContextMenu:sf,paneClickDistance:Ha,nodeClickDistance:af,onSelectionContextMenu:R,onSelectionStart:P,onSelectionEnd:W,onReconnect:lf,onReconnectStart:cf,onReconnectEnd:uf,onEdgeContextMenu:Vi,onEdgeDoubleClick:ff,onEdgeMouseEnter:Wi,onEdgeMouseMove:df,onEdgeMouseLeave:hf,reconnectRadius:pf,defaultMarkerColor:Di,noDragClassName:yf,noWheelClassName:vf,noPanClassName:Va,rfId:Co,disableKeyboardA11y:ja,nodeExtent:Lr,viewport:If,onViewportChange:qa}),T.jsx($C,{nodes:e,edges:t,defaultNodes:n,defaultEdges:o,onConnect:m,onConnectStart:x,onConnectEnd:v,onClickConnectStart:b,onClickConnectEnd:_,nodesDraggable:Ge,autoPanOnNodeFocus:Fn,nodesConnectable:bo,nodesFocusable:bn,edgesFocusable:nn,edgesReconnectable:_n,elementsSelectable:Mi,elevateNodesOnSelect:Sf,elevateEdgesOnSelect:_o,minZoom:lr,maxZoom:rn,nodeExtent:Lr,onNodesChange:gf,onEdgesChange:mf,snapToGrid:_e,snapGrid:ye,connectionMode:G,translateExtent:Hn,connectOnClick:xf,defaultEdgeOptions:_f,fitView:ji,fitViewOptions:Wa,onNodesDelete:K,onEdgesDelete:Z,onDelete:U,onNodeDragStart:M,onNodeDrag:D,onNodeDragStop:V,onSelectionDrag:H,onSelectionDragStart:C,onSelectionDragStop:B,onMove:h,onMoveStart:g,onMoveEnd:p,noPanClassName:Va,nodeOrigin:pt,rfId:Co,autoPanOnConnect:So,autoPanOnNodeDrag:Ef,autoPanSpeed:Cf,onError:Ga,connectionRadius:Nf,isValidConnection:Ua,selectNodesOnDrag:Ze,nodeDragThreshold:Tf,connectionDragThreshold:Af,onBeforeDelete:$,paneClickDistance:Ha,debug:Of,ariaLabelConfig:Eo}),T.jsx(RC,{onSelectionChange:q}),za,T.jsx(IC,{proOptions:bf,position:wf}),T.jsx(AC,{rfId:Co,disableKeyboardA11y:ja})]})})}var rT=Dg(nT);const oT=_t.error014();function iT({id:e,handleType:t,handleId:n,onConnect:o,onDisconnect:s}={}){const a=yi(),l=e??a;if(!l)throw new Error(oT);const c=z.useRef(null),f=Re(d=>d.connectionLookup.get(`${l}${t?n?`-${t}-${n}`:`-${t}`:""}`),uE);return z.useEffect(()=>{if(c.current&&c.current!==f){const d=f??new Map;Sp(c.current,d,s),Sp(d,c.current,o)}c.current=f??new Map},[f,o,s]),z.useMemo(()=>Array.from(f?.values()??[]),[f])}function Yc(e){return Re(z.useCallback(n=>{const o=[],s=Array.isArray(e),a=s?e:[e];for(const l of a){const c=n.nodeLookup.get(l);c&&o.push({id:c.id,type:c.type,data:c.data})}return s?o:o[0]??null},[e]),$E)}function sT({dimensions:e,lineWidth:t,variant:n,className:o}){return T.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:nt(["react-flow__background-pattern",n,o])})}function aT({radius:e,className:t}){return T.jsx("circle",{cx:e,cy:e,r:e,className:nt(["react-flow__background-pattern","dots",t])})}var er;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(er||(er={}));const lT={[er.Dots]:1,[er.Lines]:1,[er.Cross]:6},cT=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function vm({id:e,variant:t=er.Dots,gap:n=20,size:o,lineWidth:s=1,offset:a=0,color:l,bgColor:c,style:f,className:d,patternClassName:h}){const g=z.useRef(null),{transform:p,patternId:m}=Re(cT,qe),x=o||lT[t],v=t===er.Dots,b=t===er.Cross,_=Array.isArray(n)?n:[n,n],N=[_[0]*p[2]||1,_[1]*p[2]||1],w=x*p[2],E=Array.isArray(a)?a:[a,a],O=b?[w,w]:N,k=[E[0]*p[2]||1+O[0]/2,E[1]*p[2]||1+O[1]/2],M=`${m}${e||""}`;return T.jsxs("svg",{className:nt(["react-flow__background",d]),style:{...f,...ra,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:g,"data-testid":"rf__background",children:[T.jsx("pattern",{id:M,x:p[0]%N[0],y:p[1]%N[1],width:N[0],height:N[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${k[0]},-${k[1]})`,children:v?T.jsx(aT,{radius:w/2,className:h}):T.jsx(sT,{dimensions:O,lineWidth:s,variant:t,className:h})}),T.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${M})`})]})}vm.displayName="Background";const uT=z.memo(vm);function fT(){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 dT(){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 pT(){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 gT(){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 ia({children:e,className:t,...n}){return T.jsx("button",{type:"button",className:nt(["react-flow__controls-button",t]),...n,children:e})}const mT=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function xm({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:o=!0,fitViewOptions:s,onZoomIn:a,onZoomOut:l,onFitView:c,onInteractiveChange:f,className:d,children:h,position:g="bottom-left",orientation:p="vertical","aria-label":m}){const x=je(),{isInteractive:v,minZoomReached:b,maxZoomReached:_,ariaLabelConfig:N}=Re(mT,qe),{zoomIn:w,zoomOut:E,fitView:O}=mi(),k=()=>{w(),a?.()},M=()=>{E(),l?.()},D=()=>{O(s),c?.()},V=()=>{x.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),f?.(!v)},K=p==="horizontal"?"horizontal":"vertical";return T.jsxs(ta,{className:nt(["react-flow__controls",K,d]),position:g,style:e,"data-testid":"rf__controls","aria-label":m??N["controls.ariaLabel"],children:[t&&T.jsxs(T.Fragment,{children:[T.jsx(ia,{onClick:k,className:"react-flow__controls-zoomin",title:N["controls.zoomIn.ariaLabel"],"aria-label":N["controls.zoomIn.ariaLabel"],disabled:_,children:T.jsx(fT,{})}),T.jsx(ia,{onClick:M,className:"react-flow__controls-zoomout",title:N["controls.zoomOut.ariaLabel"],"aria-label":N["controls.zoomOut.ariaLabel"],disabled:b,children:T.jsx(dT,{})})]}),n&&T.jsx(ia,{className:"react-flow__controls-fitview",onClick:D,title:N["controls.fitView.ariaLabel"],"aria-label":N["controls.fitView.ariaLabel"],children:T.jsx(hT,{})}),o&&T.jsx(ia,{className:"react-flow__controls-interactive",onClick:V,title:N["controls.interactive.ariaLabel"],"aria-label":N["controls.interactive.ariaLabel"],children:v?T.jsx(gT,{}):T.jsx(pT,{})}),h]})}xm.displayName="Controls";const yT=z.memo(xm);function vT({id:e,x:t,y:n,width:o,height:s,style:a,color:l,strokeColor:c,strokeWidth:f,className:d,borderRadius:h,shapeRendering:g,selected:p,onClick:m}){const{background:x,backgroundColor:v}=a||{},b=l||x||v;return T.jsx("rect",{className:nt(["react-flow__minimap-node",{selected:p},d]),x:t,y:n,rx:h,ry:h,width:o,height:s,style:{fill:b,stroke:c,strokeWidth:f},shapeRendering:g,onClick:m?_=>m(_,e):void 0})}const xT=z.memo(vT),wT=e=>e.nodes.map(t=>t.id),Xc=e=>e instanceof Function?e:()=>e;function bT({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:o=5,nodeStrokeWidth:s,nodeComponent:a=xT,onClick:l}){const c=Re(wT,qe),f=Xc(t),d=Xc(e),h=Xc(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return T.jsx(T.Fragment,{children:c.map(p=>T.jsx(ST,{id:p,nodeColorFunc:f,nodeStrokeColorFunc:d,nodeClassNameFunc:h,nodeBorderRadius:o,nodeStrokeWidth:s,NodeComponent:a,onClick:l,shapeRendering:g},p))})}function _T({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:o,nodeBorderRadius:s,nodeStrokeWidth:a,shapeRendering:l,NodeComponent:c,onClick:f}){const{node:d,x:h,y:g,width:p,height:m}=Re(x=>{const{internals:v}=x.nodeLookup.get(e),b=v.userNode,{x:_,y:N}=v.positionAbsolute,{width:w,height:E}=kn(b);return{node:b,x:_,y:N,width:w,height:E}},qe);return!d||d.hidden||!Mp(d)?null:T.jsx(c,{x:h,y:g,width:p,height:m,style:d.style,selected:!!d.selected,className:o(d),color:t(d),borderRadius:s,strokeColor:n(d),strokeWidth:a,shapeRendering:l,onClick:f,id:d.id})}const ST=z.memo(_T);var ET=z.memo(bT);const CT=200,NT=150,TT=e=>!e.hidden,AT=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?Op(ai(e.nodeLookup,{filter:TT}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},IT="react-flow__minimap-desc";function wm({style:e,className:t,nodeStrokeColor:n,nodeColor:o,nodeClassName:s="",nodeBorderRadius:a=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:f,maskColor:d,maskStrokeColor:h,maskStrokeWidth:g,position:p="bottom-right",onClick:m,onNodeClick:x,pannable:v=!1,zoomable:b=!1,ariaLabel:_,inversePan:N,zoomStep:w=1,offsetScale:E=5}){const O=je(),k=z.useRef(null),{boundingRect:M,viewBB:D,rfId:V,panZoom:K,translateExtent:Z,flowWidth:U,flowHeight:q,ariaLabelConfig:C}=Re(AT,qe),H=e?.width??CT,B=e?.height??NT,R=M.width/H,P=M.height/B,W=Math.max(R,P),$=W*H,G=W*B,J=E*W,re=M.x-($-M.width)/2-J,se=M.y-(G-M.height)/2-J,ce=$+J*2,ge=G+J*2,te=`${IT}-${V}`,Q=z.useRef(0),ae=z.useRef();Q.current=W,z.useEffect(()=>{if(k.current&&K)return ae.current=GE({domNode:k.current,panZoom:K,getTransform:()=>O.getState().transform,getViewScale:()=>Q.current}),()=>{ae.current?.destroy()}},[K]),z.useEffect(()=>{ae.current?.update({translateExtent:Z,width:U,height:q,inversePan:N,pannable:v,zoomStep:w,zoomable:b})},[v,b,N,w,Z,U,q]);const fe=m?_e=>{const[ye,Le]=ae.current?.pointer(_e)||[0,0];m(_e,{x:ye,y:Le})}:void 0,de=x?z.useCallback((_e,ye)=>{const Le=O.getState().nodeLookup.get(ye).internals.userNode;x(_e,Le)},[]):void 0,ue=_??C["minimap.ariaLabel"];return T.jsx(ta,{position:p,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-stroke-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*W:void 0,"--xy-minimap-node-background-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:nt(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:T.jsxs("svg",{width:H,height:B,viewBox:`${re} ${se} ${ce} ${ge}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":te,ref:k,onClick:fe,children:[ue&&T.jsx("title",{id:te,children:ue}),T.jsx(ET,{onClick:de,nodeColor:o,nodeStrokeColor:n,nodeBorderRadius:a,nodeClassName:s,nodeStrokeWidth:l,nodeComponent:c}),T.jsx("path",{className:"react-flow__minimap-mask",d:`M${re-J},${se-J}h${ce+J*2}v${ge+J*2}h${-ce-J*2}z
60
+ M${D.x},${D.y}h${D.width}v${D.height}h${-D.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}wm.displayName="MiniMap";const OT=z.memo(wm),PT=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,kT={[Ar.Line]:"right",[Ar.Handle]:"bottom-right"};function MT({nodeId:e,position:t,variant:n=Ar.Handle,className:o,style:s=void 0,children:a,color:l,minWidth:c=10,minHeight:f=10,maxWidth:d=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:p,autoScale:m=!0,shouldResize:x,onResizeStart:v,onResize:b,onResizeEnd:_}){const N=yi(),w=typeof e=="string"?e:N,E=je(),O=z.useRef(null),k=n===Ar.Handle,M=Re(z.useCallback(PT(k&&m),[k,m]),qe),D=z.useRef(null),V=t??kT[n];z.useEffect(()=>{if(!(!O.current||!w))return D.current||(D.current=lC({domNode:O.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:Z,transform:U,snapGrid:q,snapToGrid:C,nodeOrigin:H,domNode:B}=E.getState();return{nodeLookup:Z,transform:U,snapGrid:q,snapToGrid:C,nodeOrigin:H,paneDomNode:B}},onChange:(Z,U)=>{const{triggerNodeChanges:q,nodeLookup:C,parentLookup:H,nodeOrigin:B}=E.getState(),R=[],P={x:Z.x,y:Z.y},W=C.get(w);if(W&&W.expandParent&&W.parentId){const $=W.origin??B,G=Z.width??W.measured.width??0,J=Z.height??W.measured.height??0,re={id:W.id,parentId:W.parentId,rect:{width:G,height:J,...Rp({x:Z.x??W.position.x,y:Z.y??W.position.y},{width:G,height:J},W.parentId,C,$)}},se=Dc([re],C,H,B);R.push(...se),P.x=Z.x?Math.max($[0]*G,Z.x):void 0,P.y=Z.y?Math.max($[1]*J,Z.y):void 0}if(P.x!==void 0&&P.y!==void 0){const $={id:w,type:"position",position:{...P}};R.push($)}if(Z.width!==void 0&&Z.height!==void 0){const G={id:w,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:Z.width,height:Z.height}};R.push(G)}for(const $ of U){const G={...$,type:"position"};R.push(G)}q(R)},onEnd:({width:Z,height:U})=>{const q={id:w,type:"dimensions",resizing:!1,dimensions:{width:Z,height:U}};E.getState().triggerNodeChanges([q])}})),D.current.update({controlPosition:V,boundaries:{minWidth:c,minHeight:f,maxWidth:d,maxHeight:h},keepAspectRatio:g,resizeDirection:p,onResizeStart:v,onResize:b,onResizeEnd:_,shouldResize:x}),()=>{D.current?.destroy()}},[V,c,f,d,h,g,v,b,_,x]);const K=V.split("-");return T.jsx("div",{className:nt(["react-flow__resize-control","nodrag",...K,n,o]),ref:O,style:{...s,scale:M,...l&&{[k?"backgroundColor":"borderColor"]:l}},children:a})}const bm=z.memo(MT),qc=20;function tr(e,t){const n=t[e.dataType],o=e.allowInput??n.allowInput;return n.underlyingType==="number"?{id:un(qc),name:e.name,handleColor:n.color,allowInput:o,type:"number",handleShape:n.shape,dataType:{dataTypeObject:n,dataTypeUniqueId:e.dataType}}:{id:un(qc),name:e.name,handleColor:n.color,allowInput:n.underlyingType==="string"?o:!1,type:"string",handleShape:n.shape,dataType:{dataTypeObject:n,dataTypeUniqueId:e.dataType}}}function _m(e,t){const n=un(qc),o=e.inputs.map(s=>tr(s,t));return{id:n,name:e.name,inputs:o}}function xi(e,t,n,o,s){const a=n[t],l=a.inputs.map(f=>"inputs"in f?_m(f,e):tr(f,e)),c=a.outputs.map(f=>tr(f,e));return{id:o,position:s,sourcePosition:be.Right,targetPosition:be.Left,type:"configurableNode",width:400,data:{name:a.name,headerColor:a.headerColor,inputs:l,outputs:c,nodeTypeUniqueId:t,showNodeOpenButton:a.subtree!==void 0}}}function sa(e,t,n,o){const s=n[t];if(o)if(o.type==="input"){const a=s?.inputs?.[o.index1];if(!a)return;if(o.index2!==void 0&&"inputs"in a)return tr(a.inputs?.[o.index2],e);if(o.index2===void 0&&!("inputs"in a))return tr(a,e)}else return tr(s?.outputs?.[o.index1],e)}function Pt(e){const t=e.openedNodeGroupStack?.[e.openedNodeGroupStack.length-1];if(!t)return{nodes:e.nodes,edges:e.edges};const n=e.typeOfNodes[t.nodeType].subtree;return n?{nodes:n.nodes,edges:n.edges,inputNodeId:n.inputNodeId,outputNodeId:n.outputNodeId}:{nodes:e.nodes,edges:e.edges}}function Or(e,t,n){const o=e.openedNodeGroupStack?.[e.openedNodeGroupStack.length-1];if(!o)return t&&(e.nodes=[...t]),n&&(e.edges=[...n]),e;const s=e.typeOfNodes[o.nodeType].subtree,a=e.typeOfNodes[o.nodeType].subtree?.numberOfReferences;return!s||a!==0?(t&&(e.nodes=[...t]),n&&(e.edges=[...n]),e):(t&&(s.nodes=[...t]),n&&(s.edges=[...n]),e)}function wi(e){const t={},n={};for(const o of Object.keys(e.typeOfNodes)){const a=e.typeOfNodes[o].subtree;if(!(!a||a.nodes.length===0))for(const l of a.nodes){const c=l.data.nodeTypeUniqueId;c&&(n[o]=n[o]||new Set,n[o]?.add(c),t[c]=t[c]||new Set,t[c]?.add(o))}}return{nodeToNodeDependents:t,nodeToNodeDependencies:n}}function Kc(e,t){return("typeOfNodes"in e?wi(e).nodeToNodeDependents:e)[t]||new Set}function Sm(e,t){return("typeOfNodes"in e?wi(e).nodeToNodeDependencies:e)[t]||new Set}function Em(e,t){const n="typeOfNodes"in e?wi(e).nodeToNodeDependents:e,o=new Set,s=[t];for(;s.length>0;){const a=s.shift();if(!a)continue;o.add(a);const l=Kc(n,a);for(const c of l)o.has(c)||s.push(c)}return o}function RT(e,t){const n="typeOfNodes"in e?wi(e).nodeToNodeDependencies:e,o=new Set,s=[t];for(;s.length>0;){const a=s.shift();if(!a)continue;o.add(a);const l=Sm(n,a);for(const c of l)o.has(c)||s.push(c)}return o}function Mn(e,t){return e>=0?e:e+t}function Zc(e){return e>=0?e+1:e-1}function Qc(e,t){const n=Mn(e,t);return n>=0&&n<t}function Pr(e,t,n=void 0){let o=n?.index1??0,s=n?.index2??0;return Iterator.from({next:function(){if(!Qc(o,e.length))return{value:{value:void 0,handleIndices:{type:t,index1:o,index2:void 0},parentArray:e,parentArrayIndex:o},done:!0};const l=e[Mn(o,e.length)];if("inputs"in l){if(!Qc(s,l.inputs.length))return{value:{value:void 0,handleIndices:{type:"input",index1:o,index2:s},parentArray:l.inputs,parentArrayIndex:s},done:!0};const c=l.inputs[Mn(s,l.inputs.length)],f=o,d=s;let h=!1;for(;;){h?(s=s>=0?0:-1,h=!1):s=Zc(s);const m=e[Mn(o,e.length)];if(!m||!("inputs"in m)){s=0;break}if(Qc(s,m.inputs.length))break;o=Zc(o),h=!0}const g=c,p=e[Mn(f,e.length)];return{value:{value:g,handleIndices:{type:"input",index1:f,index2:d},parentArray:p,parentArrayIndex:d},done:!1}}else{const c=o;return o=Zc(o),s=0,{value:{value:l,handleIndices:{type:t,index1:c,index2:void 0},parentArray:e,parentArrayIndex:c},done:!1}}}})}function Cm(e,t,n=!0,o=!0){if(n){const s=e?.inputs instanceof Array?e?.inputs:[];Pr(s,"input").every(({value:l,handleIndices:c})=>t(l,c)!==!1)}if(o){const s=e?.outputs instanceof Array?e?.outputs:[];Pr(s,"output").forEach(({value:l,handleIndices:c})=>{t(l,c)})}return e}function Nm(e,t,n,o=!0,s=!0,a=!0){if(a){const l=Rn(t,e,o,s)?.value;return l&&Object.assign(l,n),e}else return Yo(e,l=>{const c=Rn(t,l,o,s)?.value;return c&&Object.assign(c,n),l})}function Jc(e,t,n=0,o,s=!0,a="before"){if(s){const l=gn(t,e);if(l){const c=l.parentArray,f=a==="before"?Mn(l.parentArrayIndex,c.length):Mn(l.parentArrayIndex,c.length)+1;c.splice(f,n,o)}return e}else return Yo(e,l=>{const c=gn(t,l);if(c){const f=c.parentArray,d=a==="before"?Mn(c.parentArrayIndex,f.length):Mn(c.parentArrayIndex,f.length)+1;f.splice(d,n,o)}return l})}var bi={exports:{}};/**
61
+ * @license
62
+ * Lodash <https://lodash.com/>
63
+ * Copyright OpenJS Foundation and other contributors <https://openjsf.org/>
64
+ * Released under MIT license <https://lodash.com/license>
65
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
66
+ * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
67
+ */var DT=bi.exports,Tm;function LT(){return Tm||(Tm=1,function(e,t){(function(){var n,o="4.17.21",s=200,a="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",c="Invalid `variable` option passed into `_.template`",f="__lodash_hash_undefined__",d=500,h="__lodash_placeholder__",g=1,p=2,m=4,x=1,v=2,b=1,_=2,N=4,w=8,E=16,O=32,k=64,M=128,D=256,V=512,K=30,Z="...",U=800,q=16,C=1,H=2,B=3,R=1/0,P=9007199254740991,W=17976931348623157e292,$=NaN,G=4294967295,J=G-1,re=G>>>1,se=[["ary",M],["bind",b],["bindKey",_],["curry",w],["curryRight",E],["flip",V],["partial",O],["partialRight",k],["rearg",D]],ce="[object Arguments]",ge="[object Array]",te="[object AsyncFunction]",Q="[object Boolean]",ae="[object Date]",fe="[object DOMException]",de="[object Error]",ue="[object Function]",_e="[object GeneratorFunction]",ye="[object Map]",Le="[object Number]",Ze="[object Null]",Ge="[object Object]",Fn="[object Promise]",bo="[object Proxy]",bn="[object RegExp]",pt="[object Set]",nn="[object String]",_n="[object Symbol]",Mi="[object Undefined]",Sn="[object WeakMap]",lr="[object WeakSet]",rn="[object ArrayBuffer]",Hn="[object DataView]",Ri="[object Float32Array]",Lr="[object Float64Array]",Di="[object Int8Array]",Li="[object Int16Array]",$i="[object Int32Array]",Bi="[object Uint8Array]",Fi="[object Uint8ClampedArray]",Hi="[object Uint16Array]",zi="[object Uint32Array]",tf=/\b__p \+= '';/g,nf=/\b(__p \+=) '' \+/g,rf=/(__e\(.*?\)|\b__t\)) \+\n'';/g,Ba=/&(?:amp|lt|gt|quot|#39);/g,Fa=/[&<>"']/g,of=RegExp(Ba.source),sf=RegExp(Fa.source),Ha=/<%-([\s\S]+?)%>/g,af=/<%([\s\S]+?)%>/g,za=/<%=([\s\S]+?)%>/g,lf=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,cf=/^\w*$/,uf=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Vi=/[\\^$.*+?()[\]{}|]/g,ff=RegExp(Vi.source),Wi=/^\s+/,df=/\s/,hf=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,pf=/\{\n\/\* \[wrapped with (.+)\] \*/,gf=/,? & /,mf=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,yf=/[()=,{}\[\]\/\s]/,vf=/\\(\\)?/g,Va=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,ji=/\w*$/,Wa=/^[-+]0x[0-9a-f]+$/i,xf=/^0b[01]+$/i,wf=/^\[object .+?Constructor\]$/,bf=/^0o[0-7]+$/i,_f=/^(?:0|[1-9]\d*)$/,Sf=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,_o=/($^)/,ja=/['\n\r\u2028\u2029\\]/g,So="\\ud800-\\udfff",Ef="\\u0300-\\u036f",Cf="\\ufe20-\\ufe2f",Nf="\\u20d0-\\u20ff",Ua=Ef+Cf+Nf,Ga="\\u2700-\\u27bf",Ya="a-z\\xdf-\\xf6\\xf8-\\xff",Xa="\\xac\\xb1\\xd7\\xf7",Tf="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Af="\\u2000-\\u206f",If=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",qa="A-Z\\xc0-\\xd6\\xd8-\\xde",Ka="\\ufe0e\\ufe0f",Za=Xa+Tf+Af+If,Ui="['’]",Of="["+So+"]",Gi="["+Za+"]",Eo="["+Ua+"]",Qa="\\d+",Pf="["+Ga+"]",Co="["+Ya+"]",Ja="[^"+So+Za+Qa+Ga+Ya+qa+"]",Yi="\\ud83c[\\udffb-\\udfff]",el="(?:"+Eo+"|"+Yi+")",cv="[^"+So+"]",kf="(?:\\ud83c[\\udde6-\\uddff]){2}",Mf="[\\ud800-\\udbff][\\udc00-\\udfff]",No="["+qa+"]",uv="\\u200d",fv="(?:"+Co+"|"+Ja+")",FP="(?:"+No+"|"+Ja+")",dv="(?:"+Ui+"(?:d|ll|m|re|s|t|ve))?",hv="(?:"+Ui+"(?:D|LL|M|RE|S|T|VE))?",pv=el+"?",gv="["+Ka+"]?",HP="(?:"+uv+"(?:"+[cv,kf,Mf].join("|")+")"+gv+pv+")*",zP="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",VP="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",mv=gv+pv+HP,WP="(?:"+[Pf,kf,Mf].join("|")+")"+mv,jP="(?:"+[cv+Eo+"?",Eo,kf,Mf,Of].join("|")+")",UP=RegExp(Ui,"g"),GP=RegExp(Eo,"g"),Rf=RegExp(Yi+"(?="+Yi+")|"+jP+mv,"g"),YP=RegExp([No+"?"+Co+"+"+dv+"(?="+[Gi,No,"$"].join("|")+")",FP+"+"+hv+"(?="+[Gi,No+fv,"$"].join("|")+")",No+"?"+fv+"+"+dv,No+"+"+hv,VP,zP,Qa,WP].join("|"),"g"),XP=RegExp("["+uv+So+Ua+Ka+"]"),qP=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,KP=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],ZP=-1,Ye={};Ye[Ri]=Ye[Lr]=Ye[Di]=Ye[Li]=Ye[$i]=Ye[Bi]=Ye[Fi]=Ye[Hi]=Ye[zi]=!0,Ye[ce]=Ye[ge]=Ye[rn]=Ye[Q]=Ye[Hn]=Ye[ae]=Ye[de]=Ye[ue]=Ye[ye]=Ye[Le]=Ye[Ge]=Ye[bn]=Ye[pt]=Ye[nn]=Ye[Sn]=!1;var We={};We[ce]=We[ge]=We[rn]=We[Hn]=We[Q]=We[ae]=We[Ri]=We[Lr]=We[Di]=We[Li]=We[$i]=We[ye]=We[Le]=We[Ge]=We[bn]=We[pt]=We[nn]=We[_n]=We[Bi]=We[Fi]=We[Hi]=We[zi]=!0,We[de]=We[ue]=We[Sn]=!1;var QP={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},JP={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},ek={"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"},tk={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},nk=parseFloat,rk=parseInt,yv=typeof us=="object"&&us&&us.Object===Object&&us,ok=typeof self=="object"&&self&&self.Object===Object&&self,ft=yv||ok||Function("return this")(),Df=t&&!t.nodeType&&t,$r=Df&&!0&&e&&!e.nodeType&&e,vv=$r&&$r.exports===Df,Lf=vv&&yv.process,Vt=function(){try{var Y=$r&&$r.require&&$r.require("util").types;return Y||Lf&&Lf.binding&&Lf.binding("util")}catch{}}(),xv=Vt&&Vt.isArrayBuffer,wv=Vt&&Vt.isDate,bv=Vt&&Vt.isMap,_v=Vt&&Vt.isRegExp,Sv=Vt&&Vt.isSet,Ev=Vt&&Vt.isTypedArray;function Dt(Y,ne,ee){switch(ee.length){case 0:return Y.call(ne);case 1:return Y.call(ne,ee[0]);case 2:return Y.call(ne,ee[0],ee[1]);case 3:return Y.call(ne,ee[0],ee[1],ee[2])}return Y.apply(ne,ee)}function ik(Y,ne,ee,me){for(var Te=-1,Be=Y==null?0:Y.length;++Te<Be;){var at=Y[Te];ne(me,at,ee(at),Y)}return me}function Wt(Y,ne){for(var ee=-1,me=Y==null?0:Y.length;++ee<me&&ne(Y[ee],ee,Y)!==!1;);return Y}function sk(Y,ne){for(var ee=Y==null?0:Y.length;ee--&&ne(Y[ee],ee,Y)!==!1;);return Y}function Cv(Y,ne){for(var ee=-1,me=Y==null?0:Y.length;++ee<me;)if(!ne(Y[ee],ee,Y))return!1;return!0}function cr(Y,ne){for(var ee=-1,me=Y==null?0:Y.length,Te=0,Be=[];++ee<me;){var at=Y[ee];ne(at,ee,Y)&&(Be[Te++]=at)}return Be}function tl(Y,ne){var ee=Y==null?0:Y.length;return!!ee&&To(Y,ne,0)>-1}function $f(Y,ne,ee){for(var me=-1,Te=Y==null?0:Y.length;++me<Te;)if(ee(ne,Y[me]))return!0;return!1}function Xe(Y,ne){for(var ee=-1,me=Y==null?0:Y.length,Te=Array(me);++ee<me;)Te[ee]=ne(Y[ee],ee,Y);return Te}function ur(Y,ne){for(var ee=-1,me=ne.length,Te=Y.length;++ee<me;)Y[Te+ee]=ne[ee];return Y}function Bf(Y,ne,ee,me){var Te=-1,Be=Y==null?0:Y.length;for(me&&Be&&(ee=Y[++Te]);++Te<Be;)ee=ne(ee,Y[Te],Te,Y);return ee}function ak(Y,ne,ee,me){var Te=Y==null?0:Y.length;for(me&&Te&&(ee=Y[--Te]);Te--;)ee=ne(ee,Y[Te],Te,Y);return ee}function Ff(Y,ne){for(var ee=-1,me=Y==null?0:Y.length;++ee<me;)if(ne(Y[ee],ee,Y))return!0;return!1}var lk=Hf("length");function ck(Y){return Y.split("")}function uk(Y){return Y.match(mf)||[]}function Nv(Y,ne,ee){var me;return ee(Y,function(Te,Be,at){if(ne(Te,Be,at))return me=Be,!1}),me}function nl(Y,ne,ee,me){for(var Te=Y.length,Be=ee+(me?1:-1);me?Be--:++Be<Te;)if(ne(Y[Be],Be,Y))return Be;return-1}function To(Y,ne,ee){return ne===ne?_k(Y,ne,ee):nl(Y,Tv,ee)}function fk(Y,ne,ee,me){for(var Te=ee-1,Be=Y.length;++Te<Be;)if(me(Y[Te],ne))return Te;return-1}function Tv(Y){return Y!==Y}function Av(Y,ne){var ee=Y==null?0:Y.length;return ee?Vf(Y,ne)/ee:$}function Hf(Y){return function(ne){return ne==null?n:ne[Y]}}function zf(Y){return function(ne){return Y==null?n:Y[ne]}}function Iv(Y,ne,ee,me,Te){return Te(Y,function(Be,at,ze){ee=me?(me=!1,Be):ne(ee,Be,at,ze)}),ee}function dk(Y,ne){var ee=Y.length;for(Y.sort(ne);ee--;)Y[ee]=Y[ee].value;return Y}function Vf(Y,ne){for(var ee,me=-1,Te=Y.length;++me<Te;){var Be=ne(Y[me]);Be!==n&&(ee=ee===n?Be:ee+Be)}return ee}function Wf(Y,ne){for(var ee=-1,me=Array(Y);++ee<Y;)me[ee]=ne(ee);return me}function hk(Y,ne){return Xe(ne,function(ee){return[ee,Y[ee]]})}function Ov(Y){return Y&&Y.slice(0,Rv(Y)+1).replace(Wi,"")}function Lt(Y){return function(ne){return Y(ne)}}function jf(Y,ne){return Xe(ne,function(ee){return Y[ee]})}function Xi(Y,ne){return Y.has(ne)}function Pv(Y,ne){for(var ee=-1,me=Y.length;++ee<me&&To(ne,Y[ee],0)>-1;);return ee}function kv(Y,ne){for(var ee=Y.length;ee--&&To(ne,Y[ee],0)>-1;);return ee}function pk(Y,ne){for(var ee=Y.length,me=0;ee--;)Y[ee]===ne&&++me;return me}var gk=zf(QP),mk=zf(JP);function yk(Y){return"\\"+tk[Y]}function vk(Y,ne){return Y==null?n:Y[ne]}function Ao(Y){return XP.test(Y)}function xk(Y){return qP.test(Y)}function wk(Y){for(var ne,ee=[];!(ne=Y.next()).done;)ee.push(ne.value);return ee}function Uf(Y){var ne=-1,ee=Array(Y.size);return Y.forEach(function(me,Te){ee[++ne]=[Te,me]}),ee}function Mv(Y,ne){return function(ee){return Y(ne(ee))}}function fr(Y,ne){for(var ee=-1,me=Y.length,Te=0,Be=[];++ee<me;){var at=Y[ee];(at===ne||at===h)&&(Y[ee]=h,Be[Te++]=ee)}return Be}function rl(Y){var ne=-1,ee=Array(Y.size);return Y.forEach(function(me){ee[++ne]=me}),ee}function bk(Y){var ne=-1,ee=Array(Y.size);return Y.forEach(function(me){ee[++ne]=[me,me]}),ee}function _k(Y,ne,ee){for(var me=ee-1,Te=Y.length;++me<Te;)if(Y[me]===ne)return me;return-1}function Sk(Y,ne,ee){for(var me=ee+1;me--;)if(Y[me]===ne)return me;return me}function Io(Y){return Ao(Y)?Ck(Y):lk(Y)}function on(Y){return Ao(Y)?Nk(Y):ck(Y)}function Rv(Y){for(var ne=Y.length;ne--&&df.test(Y.charAt(ne)););return ne}var Ek=zf(ek);function Ck(Y){for(var ne=Rf.lastIndex=0;Rf.test(Y);)++ne;return ne}function Nk(Y){return Y.match(Rf)||[]}function Tk(Y){return Y.match(YP)||[]}var Ak=function Y(ne){ne=ne==null?ft:Oo.defaults(ft.Object(),ne,Oo.pick(ft,KP));var ee=ne.Array,me=ne.Date,Te=ne.Error,Be=ne.Function,at=ne.Math,ze=ne.Object,Gf=ne.RegExp,Ik=ne.String,jt=ne.TypeError,ol=ee.prototype,Ok=Be.prototype,Po=ze.prototype,il=ne["__core-js_shared__"],sl=Ok.toString,He=Po.hasOwnProperty,Pk=0,Dv=function(){var r=/[^.]+$/.exec(il&&il.keys&&il.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""}(),al=Po.toString,kk=sl.call(ze),Mk=ft._,Rk=Gf("^"+sl.call(He).replace(Vi,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ll=vv?ne.Buffer:n,dr=ne.Symbol,cl=ne.Uint8Array,Lv=ll?ll.allocUnsafe:n,ul=Mv(ze.getPrototypeOf,ze),$v=ze.create,Bv=Po.propertyIsEnumerable,fl=ol.splice,Fv=dr?dr.isConcatSpreadable:n,qi=dr?dr.iterator:n,Br=dr?dr.toStringTag:n,dl=function(){try{var r=Wr(ze,"defineProperty");return r({},"",{}),r}catch{}}(),Dk=ne.clearTimeout!==ft.clearTimeout&&ne.clearTimeout,Lk=me&&me.now!==ft.Date.now&&me.now,$k=ne.setTimeout!==ft.setTimeout&&ne.setTimeout,hl=at.ceil,pl=at.floor,Yf=ze.getOwnPropertySymbols,Bk=ll?ll.isBuffer:n,Hv=ne.isFinite,Fk=ol.join,Hk=Mv(ze.keys,ze),lt=at.max,gt=at.min,zk=me.now,Vk=ne.parseInt,zv=at.random,Wk=ol.reverse,Xf=Wr(ne,"DataView"),Ki=Wr(ne,"Map"),qf=Wr(ne,"Promise"),ko=Wr(ne,"Set"),Zi=Wr(ne,"WeakMap"),Qi=Wr(ze,"create"),gl=Zi&&new Zi,Mo={},jk=jr(Xf),Uk=jr(Ki),Gk=jr(qf),Yk=jr(ko),Xk=jr(Zi),ml=dr?dr.prototype:n,Ji=ml?ml.valueOf:n,Vv=ml?ml.toString:n;function A(r){if(Qe(r)&&!Ae(r)&&!(r instanceof De)){if(r instanceof Ut)return r;if(He.call(r,"__wrapped__"))return Wx(r)}return new Ut(r)}var Ro=function(){function r(){}return function(i){if(!Ke(i))return{};if($v)return $v(i);r.prototype=i;var u=new r;return r.prototype=n,u}}();function yl(){}function Ut(r,i){this.__wrapped__=r,this.__actions__=[],this.__chain__=!!i,this.__index__=0,this.__values__=n}A.templateSettings={escape:Ha,evaluate:af,interpolate:za,variable:"",imports:{_:A}},A.prototype=yl.prototype,A.prototype.constructor=A,Ut.prototype=Ro(yl.prototype),Ut.prototype.constructor=Ut;function De(r){this.__wrapped__=r,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=G,this.__views__=[]}function qk(){var r=new De(this.__wrapped__);return r.__actions__=Et(this.__actions__),r.__dir__=this.__dir__,r.__filtered__=this.__filtered__,r.__iteratees__=Et(this.__iteratees__),r.__takeCount__=this.__takeCount__,r.__views__=Et(this.__views__),r}function Kk(){if(this.__filtered__){var r=new De(this);r.__dir__=-1,r.__filtered__=!0}else r=this.clone(),r.__dir__*=-1;return r}function Zk(){var r=this.__wrapped__.value(),i=this.__dir__,u=Ae(r),y=i<0,S=u?r.length:0,I=cR(0,S,this.__views__),F=I.start,j=I.end,X=j-F,oe=y?j:F-1,ie=this.__iteratees__,le=ie.length,he=0,we=gt(X,this.__takeCount__);if(!u||!y&&S==X&&we==X)return dx(r,this.__actions__);var Ee=[];e:for(;X--&&he<we;){oe+=i;for(var Oe=-1,Ce=r[oe];++Oe<le;){var Me=ie[Oe],$e=Me.iteratee,Ft=Me.type,xt=$e(Ce);if(Ft==H)Ce=xt;else if(!xt){if(Ft==C)continue e;break e}}Ee[he++]=Ce}return Ee}De.prototype=Ro(yl.prototype),De.prototype.constructor=De;function Fr(r){var i=-1,u=r==null?0:r.length;for(this.clear();++i<u;){var y=r[i];this.set(y[0],y[1])}}function Qk(){this.__data__=Qi?Qi(null):{},this.size=0}function Jk(r){var i=this.has(r)&&delete this.__data__[r];return this.size-=i?1:0,i}function eM(r){var i=this.__data__;if(Qi){var u=i[r];return u===f?n:u}return He.call(i,r)?i[r]:n}function tM(r){var i=this.__data__;return Qi?i[r]!==n:He.call(i,r)}function nM(r,i){var u=this.__data__;return this.size+=this.has(r)?0:1,u[r]=Qi&&i===n?f:i,this}Fr.prototype.clear=Qk,Fr.prototype.delete=Jk,Fr.prototype.get=eM,Fr.prototype.has=tM,Fr.prototype.set=nM;function zn(r){var i=-1,u=r==null?0:r.length;for(this.clear();++i<u;){var y=r[i];this.set(y[0],y[1])}}function rM(){this.__data__=[],this.size=0}function oM(r){var i=this.__data__,u=vl(i,r);if(u<0)return!1;var y=i.length-1;return u==y?i.pop():fl.call(i,u,1),--this.size,!0}function iM(r){var i=this.__data__,u=vl(i,r);return u<0?n:i[u][1]}function sM(r){return vl(this.__data__,r)>-1}function aM(r,i){var u=this.__data__,y=vl(u,r);return y<0?(++this.size,u.push([r,i])):u[y][1]=i,this}zn.prototype.clear=rM,zn.prototype.delete=oM,zn.prototype.get=iM,zn.prototype.has=sM,zn.prototype.set=aM;function Vn(r){var i=-1,u=r==null?0:r.length;for(this.clear();++i<u;){var y=r[i];this.set(y[0],y[1])}}function lM(){this.size=0,this.__data__={hash:new Fr,map:new(Ki||zn),string:new Fr}}function cM(r){var i=Ol(this,r).delete(r);return this.size-=i?1:0,i}function uM(r){return Ol(this,r).get(r)}function fM(r){return Ol(this,r).has(r)}function dM(r,i){var u=Ol(this,r),y=u.size;return u.set(r,i),this.size+=u.size==y?0:1,this}Vn.prototype.clear=lM,Vn.prototype.delete=cM,Vn.prototype.get=uM,Vn.prototype.has=fM,Vn.prototype.set=dM;function Hr(r){var i=-1,u=r==null?0:r.length;for(this.__data__=new Vn;++i<u;)this.add(r[i])}function hM(r){return this.__data__.set(r,f),this}function pM(r){return this.__data__.has(r)}Hr.prototype.add=Hr.prototype.push=hM,Hr.prototype.has=pM;function sn(r){var i=this.__data__=new zn(r);this.size=i.size}function gM(){this.__data__=new zn,this.size=0}function mM(r){var i=this.__data__,u=i.delete(r);return this.size=i.size,u}function yM(r){return this.__data__.get(r)}function vM(r){return this.__data__.has(r)}function xM(r,i){var u=this.__data__;if(u instanceof zn){var y=u.__data__;if(!Ki||y.length<s-1)return y.push([r,i]),this.size=++u.size,this;u=this.__data__=new Vn(y)}return u.set(r,i),this.size=u.size,this}sn.prototype.clear=gM,sn.prototype.delete=mM,sn.prototype.get=yM,sn.prototype.has=vM,sn.prototype.set=xM;function Wv(r,i){var u=Ae(r),y=!u&&Ur(r),S=!u&&!y&&yr(r),I=!u&&!y&&!S&&Bo(r),F=u||y||S||I,j=F?Wf(r.length,Ik):[],X=j.length;for(var oe in r)(i||He.call(r,oe))&&!(F&&(oe=="length"||S&&(oe=="offset"||oe=="parent")||I&&(oe=="buffer"||oe=="byteLength"||oe=="byteOffset")||Gn(oe,X)))&&j.push(oe);return j}function jv(r){var i=r.length;return i?r[sd(0,i-1)]:n}function wM(r,i){return Pl(Et(r),zr(i,0,r.length))}function bM(r){return Pl(Et(r))}function Kf(r,i,u){(u!==n&&!an(r[i],u)||u===n&&!(i in r))&&Wn(r,i,u)}function es(r,i,u){var y=r[i];(!(He.call(r,i)&&an(y,u))||u===n&&!(i in r))&&Wn(r,i,u)}function vl(r,i){for(var u=r.length;u--;)if(an(r[u][0],i))return u;return-1}function _M(r,i,u,y){return hr(r,function(S,I,F){i(y,S,u(S),F)}),y}function Uv(r,i){return r&&Cn(i,ct(i),r)}function SM(r,i){return r&&Cn(i,Nt(i),r)}function Wn(r,i,u){i=="__proto__"&&dl?dl(r,i,{configurable:!0,enumerable:!0,value:u,writable:!0}):r[i]=u}function Zf(r,i){for(var u=-1,y=i.length,S=ee(y),I=r==null;++u<y;)S[u]=I?n:Pd(r,i[u]);return S}function zr(r,i,u){return r===r&&(u!==n&&(r=r<=u?r:u),i!==n&&(r=r>=i?r:i)),r}function Gt(r,i,u,y,S,I){var F,j=i&g,X=i&p,oe=i&m;if(u&&(F=S?u(r,y,S,I):u(r)),F!==n)return F;if(!Ke(r))return r;var ie=Ae(r);if(ie){if(F=fR(r),!j)return Et(r,F)}else{var le=mt(r),he=le==ue||le==_e;if(yr(r))return gx(r,j);if(le==Ge||le==ce||he&&!S){if(F=X||he?{}:Rx(r),!j)return X?eR(r,SM(F,r)):JM(r,Uv(F,r))}else{if(!We[le])return S?r:{};F=dR(r,le,j)}}I||(I=new sn);var we=I.get(r);if(we)return we;I.set(r,F),cw(r)?r.forEach(function(Ce){F.add(Gt(Ce,i,u,Ce,r,I))}):aw(r)&&r.forEach(function(Ce,Me){F.set(Me,Gt(Ce,i,u,Me,r,I))});var Ee=oe?X?yd:md:X?Nt:ct,Oe=ie?n:Ee(r);return Wt(Oe||r,function(Ce,Me){Oe&&(Me=Ce,Ce=r[Me]),es(F,Me,Gt(Ce,i,u,Me,r,I))}),F}function EM(r){var i=ct(r);return function(u){return Gv(u,r,i)}}function Gv(r,i,u){var y=u.length;if(r==null)return!y;for(r=ze(r);y--;){var S=u[y],I=i[S],F=r[S];if(F===n&&!(S in r)||!I(F))return!1}return!0}function Yv(r,i,u){if(typeof r!="function")throw new jt(l);return as(function(){r.apply(n,u)},i)}function ts(r,i,u,y){var S=-1,I=tl,F=!0,j=r.length,X=[],oe=i.length;if(!j)return X;u&&(i=Xe(i,Lt(u))),y?(I=$f,F=!1):i.length>=s&&(I=Xi,F=!1,i=new Hr(i));e:for(;++S<j;){var ie=r[S],le=u==null?ie:u(ie);if(ie=y||ie!==0?ie:0,F&&le===le){for(var he=oe;he--;)if(i[he]===le)continue e;X.push(ie)}else I(i,le,y)||X.push(ie)}return X}var hr=wx(En),Xv=wx(Jf,!0);function CM(r,i){var u=!0;return hr(r,function(y,S,I){return u=!!i(y,S,I),u}),u}function xl(r,i,u){for(var y=-1,S=r.length;++y<S;){var I=r[y],F=i(I);if(F!=null&&(j===n?F===F&&!Bt(F):u(F,j)))var j=F,X=I}return X}function NM(r,i,u,y){var S=r.length;for(u=Ie(u),u<0&&(u=-u>S?0:S+u),y=y===n||y>S?S:Ie(y),y<0&&(y+=S),y=u>y?0:fw(y);u<y;)r[u++]=i;return r}function qv(r,i){var u=[];return hr(r,function(y,S,I){i(y,S,I)&&u.push(y)}),u}function dt(r,i,u,y,S){var I=-1,F=r.length;for(u||(u=pR),S||(S=[]);++I<F;){var j=r[I];i>0&&u(j)?i>1?dt(j,i-1,u,y,S):ur(S,j):y||(S[S.length]=j)}return S}var Qf=bx(),Kv=bx(!0);function En(r,i){return r&&Qf(r,i,ct)}function Jf(r,i){return r&&Kv(r,i,ct)}function wl(r,i){return cr(i,function(u){return Yn(r[u])})}function Vr(r,i){i=gr(i,r);for(var u=0,y=i.length;r!=null&&u<y;)r=r[Nn(i[u++])];return u&&u==y?r:n}function Zv(r,i,u){var y=i(r);return Ae(r)?y:ur(y,u(r))}function yt(r){return r==null?r===n?Mi:Ze:Br&&Br in ze(r)?lR(r):bR(r)}function ed(r,i){return r>i}function TM(r,i){return r!=null&&He.call(r,i)}function AM(r,i){return r!=null&&i in ze(r)}function IM(r,i,u){return r>=gt(i,u)&&r<lt(i,u)}function td(r,i,u){for(var y=u?$f:tl,S=r[0].length,I=r.length,F=I,j=ee(I),X=1/0,oe=[];F--;){var ie=r[F];F&&i&&(ie=Xe(ie,Lt(i))),X=gt(ie.length,X),j[F]=!u&&(i||S>=120&&ie.length>=120)?new Hr(F&&ie):n}ie=r[0];var le=-1,he=j[0];e:for(;++le<S&&oe.length<X;){var we=ie[le],Ee=i?i(we):we;if(we=u||we!==0?we:0,!(he?Xi(he,Ee):y(oe,Ee,u))){for(F=I;--F;){var Oe=j[F];if(!(Oe?Xi(Oe,Ee):y(r[F],Ee,u)))continue e}he&&he.push(Ee),oe.push(we)}}return oe}function OM(r,i,u,y){return En(r,function(S,I,F){i(y,u(S),I,F)}),y}function ns(r,i,u){i=gr(i,r),r=Bx(r,i);var y=r==null?r:r[Nn(Xt(i))];return y==null?n:Dt(y,r,u)}function Qv(r){return Qe(r)&&yt(r)==ce}function PM(r){return Qe(r)&&yt(r)==rn}function kM(r){return Qe(r)&&yt(r)==ae}function rs(r,i,u,y,S){return r===i?!0:r==null||i==null||!Qe(r)&&!Qe(i)?r!==r&&i!==i:MM(r,i,u,y,rs,S)}function MM(r,i,u,y,S,I){var F=Ae(r),j=Ae(i),X=F?ge:mt(r),oe=j?ge:mt(i);X=X==ce?Ge:X,oe=oe==ce?Ge:oe;var ie=X==Ge,le=oe==Ge,he=X==oe;if(he&&yr(r)){if(!yr(i))return!1;F=!0,ie=!1}if(he&&!ie)return I||(I=new sn),F||Bo(r)?Px(r,i,u,y,S,I):sR(r,i,X,u,y,S,I);if(!(u&x)){var we=ie&&He.call(r,"__wrapped__"),Ee=le&&He.call(i,"__wrapped__");if(we||Ee){var Oe=we?r.value():r,Ce=Ee?i.value():i;return I||(I=new sn),S(Oe,Ce,u,y,I)}}return he?(I||(I=new sn),aR(r,i,u,y,S,I)):!1}function RM(r){return Qe(r)&&mt(r)==ye}function nd(r,i,u,y){var S=u.length,I=S,F=!y;if(r==null)return!I;for(r=ze(r);S--;){var j=u[S];if(F&&j[2]?j[1]!==r[j[0]]:!(j[0]in r))return!1}for(;++S<I;){j=u[S];var X=j[0],oe=r[X],ie=j[1];if(F&&j[2]){if(oe===n&&!(X in r))return!1}else{var le=new sn;if(y)var he=y(oe,ie,X,r,i,le);if(!(he===n?rs(ie,oe,x|v,y,le):he))return!1}}return!0}function Jv(r){if(!Ke(r)||mR(r))return!1;var i=Yn(r)?Rk:wf;return i.test(jr(r))}function DM(r){return Qe(r)&&yt(r)==bn}function LM(r){return Qe(r)&&mt(r)==pt}function $M(r){return Qe(r)&&$l(r.length)&&!!Ye[yt(r)]}function ex(r){return typeof r=="function"?r:r==null?Tt:typeof r=="object"?Ae(r)?rx(r[0],r[1]):nx(r):_w(r)}function rd(r){if(!ss(r))return Hk(r);var i=[];for(var u in ze(r))He.call(r,u)&&u!="constructor"&&i.push(u);return i}function BM(r){if(!Ke(r))return wR(r);var i=ss(r),u=[];for(var y in r)y=="constructor"&&(i||!He.call(r,y))||u.push(y);return u}function od(r,i){return r<i}function tx(r,i){var u=-1,y=Ct(r)?ee(r.length):[];return hr(r,function(S,I,F){y[++u]=i(S,I,F)}),y}function nx(r){var i=xd(r);return i.length==1&&i[0][2]?Lx(i[0][0],i[0][1]):function(u){return u===r||nd(u,r,i)}}function rx(r,i){return bd(r)&&Dx(i)?Lx(Nn(r),i):function(u){var y=Pd(u,r);return y===n&&y===i?kd(u,r):rs(i,y,x|v)}}function bl(r,i,u,y,S){r!==i&&Qf(i,function(I,F){if(S||(S=new sn),Ke(I))FM(r,i,F,u,bl,y,S);else{var j=y?y(Sd(r,F),I,F+"",r,i,S):n;j===n&&(j=I),Kf(r,F,j)}},Nt)}function FM(r,i,u,y,S,I,F){var j=Sd(r,u),X=Sd(i,u),oe=F.get(X);if(oe){Kf(r,u,oe);return}var ie=I?I(j,X,u+"",r,i,F):n,le=ie===n;if(le){var he=Ae(X),we=!he&&yr(X),Ee=!he&&!we&&Bo(X);ie=X,he||we||Ee?Ae(j)?ie=j:et(j)?ie=Et(j):we?(le=!1,ie=gx(X,!0)):Ee?(le=!1,ie=mx(X,!0)):ie=[]:ls(X)||Ur(X)?(ie=j,Ur(j)?ie=dw(j):(!Ke(j)||Yn(j))&&(ie=Rx(X))):le=!1}le&&(F.set(X,ie),S(ie,X,y,I,F),F.delete(X)),Kf(r,u,ie)}function ox(r,i){var u=r.length;if(u)return i+=i<0?u:0,Gn(i,u)?r[i]:n}function ix(r,i,u){i.length?i=Xe(i,function(I){return Ae(I)?function(F){return Vr(F,I.length===1?I[0]:I)}:I}):i=[Tt];var y=-1;i=Xe(i,Lt(Se()));var S=tx(r,function(I,F,j){var X=Xe(i,function(oe){return oe(I)});return{criteria:X,index:++y,value:I}});return dk(S,function(I,F){return QM(I,F,u)})}function HM(r,i){return sx(r,i,function(u,y){return kd(r,y)})}function sx(r,i,u){for(var y=-1,S=i.length,I={};++y<S;){var F=i[y],j=Vr(r,F);u(j,F)&&os(I,gr(F,r),j)}return I}function zM(r){return function(i){return Vr(i,r)}}function id(r,i,u,y){var S=y?fk:To,I=-1,F=i.length,j=r;for(r===i&&(i=Et(i)),u&&(j=Xe(r,Lt(u)));++I<F;)for(var X=0,oe=i[I],ie=u?u(oe):oe;(X=S(j,ie,X,y))>-1;)j!==r&&fl.call(j,X,1),fl.call(r,X,1);return r}function ax(r,i){for(var u=r?i.length:0,y=u-1;u--;){var S=i[u];if(u==y||S!==I){var I=S;Gn(S)?fl.call(r,S,1):cd(r,S)}}return r}function sd(r,i){return r+pl(zv()*(i-r+1))}function VM(r,i,u,y){for(var S=-1,I=lt(hl((i-r)/(u||1)),0),F=ee(I);I--;)F[y?I:++S]=r,r+=u;return F}function ad(r,i){var u="";if(!r||i<1||i>P)return u;do i%2&&(u+=r),i=pl(i/2),i&&(r+=r);while(i);return u}function ke(r,i){return Ed($x(r,i,Tt),r+"")}function WM(r){return jv(Fo(r))}function jM(r,i){var u=Fo(r);return Pl(u,zr(i,0,u.length))}function os(r,i,u,y){if(!Ke(r))return r;i=gr(i,r);for(var S=-1,I=i.length,F=I-1,j=r;j!=null&&++S<I;){var X=Nn(i[S]),oe=u;if(X==="__proto__"||X==="constructor"||X==="prototype")return r;if(S!=F){var ie=j[X];oe=y?y(ie,X,j):n,oe===n&&(oe=Ke(ie)?ie:Gn(i[S+1])?[]:{})}es(j,X,oe),j=j[X]}return r}var lx=gl?function(r,i){return gl.set(r,i),r}:Tt,UM=dl?function(r,i){return dl(r,"toString",{configurable:!0,enumerable:!1,value:Rd(i),writable:!0})}:Tt;function GM(r){return Pl(Fo(r))}function Yt(r,i,u){var y=-1,S=r.length;i<0&&(i=-i>S?0:S+i),u=u>S?S:u,u<0&&(u+=S),S=i>u?0:u-i>>>0,i>>>=0;for(var I=ee(S);++y<S;)I[y]=r[y+i];return I}function YM(r,i){var u;return hr(r,function(y,S,I){return u=i(y,S,I),!u}),!!u}function _l(r,i,u){var y=0,S=r==null?y:r.length;if(typeof i=="number"&&i===i&&S<=re){for(;y<S;){var I=y+S>>>1,F=r[I];F!==null&&!Bt(F)&&(u?F<=i:F<i)?y=I+1:S=I}return S}return ld(r,i,Tt,u)}function ld(r,i,u,y){var S=0,I=r==null?0:r.length;if(I===0)return 0;i=u(i);for(var F=i!==i,j=i===null,X=Bt(i),oe=i===n;S<I;){var ie=pl((S+I)/2),le=u(r[ie]),he=le!==n,we=le===null,Ee=le===le,Oe=Bt(le);if(F)var Ce=y||Ee;else oe?Ce=Ee&&(y||he):j?Ce=Ee&&he&&(y||!we):X?Ce=Ee&&he&&!we&&(y||!Oe):we||Oe?Ce=!1:Ce=y?le<=i:le<i;Ce?S=ie+1:I=ie}return gt(I,J)}function cx(r,i){for(var u=-1,y=r.length,S=0,I=[];++u<y;){var F=r[u],j=i?i(F):F;if(!u||!an(j,X)){var X=j;I[S++]=F===0?0:F}}return I}function ux(r){return typeof r=="number"?r:Bt(r)?$:+r}function $t(r){if(typeof r=="string")return r;if(Ae(r))return Xe(r,$t)+"";if(Bt(r))return Vv?Vv.call(r):"";var i=r+"";return i=="0"&&1/r==-R?"-0":i}function pr(r,i,u){var y=-1,S=tl,I=r.length,F=!0,j=[],X=j;if(u)F=!1,S=$f;else if(I>=s){var oe=i?null:oR(r);if(oe)return rl(oe);F=!1,S=Xi,X=new Hr}else X=i?[]:j;e:for(;++y<I;){var ie=r[y],le=i?i(ie):ie;if(ie=u||ie!==0?ie:0,F&&le===le){for(var he=X.length;he--;)if(X[he]===le)continue e;i&&X.push(le),j.push(ie)}else S(X,le,u)||(X!==j&&X.push(le),j.push(ie))}return j}function cd(r,i){return i=gr(i,r),r=Bx(r,i),r==null||delete r[Nn(Xt(i))]}function fx(r,i,u,y){return os(r,i,u(Vr(r,i)),y)}function Sl(r,i,u,y){for(var S=r.length,I=y?S:-1;(y?I--:++I<S)&&i(r[I],I,r););return u?Yt(r,y?0:I,y?I+1:S):Yt(r,y?I+1:0,y?S:I)}function dx(r,i){var u=r;return u instanceof De&&(u=u.value()),Bf(i,function(y,S){return S.func.apply(S.thisArg,ur([y],S.args))},u)}function ud(r,i,u){var y=r.length;if(y<2)return y?pr(r[0]):[];for(var S=-1,I=ee(y);++S<y;)for(var F=r[S],j=-1;++j<y;)j!=S&&(I[S]=ts(I[S]||F,r[j],i,u));return pr(dt(I,1),i,u)}function hx(r,i,u){for(var y=-1,S=r.length,I=i.length,F={};++y<S;){var j=y<I?i[y]:n;u(F,r[y],j)}return F}function fd(r){return et(r)?r:[]}function dd(r){return typeof r=="function"?r:Tt}function gr(r,i){return Ae(r)?r:bd(r,i)?[r]:Vx(Fe(r))}var XM=ke;function mr(r,i,u){var y=r.length;return u=u===n?y:u,!i&&u>=y?r:Yt(r,i,u)}var px=Dk||function(r){return ft.clearTimeout(r)};function gx(r,i){if(i)return r.slice();var u=r.length,y=Lv?Lv(u):new r.constructor(u);return r.copy(y),y}function hd(r){var i=new r.constructor(r.byteLength);return new cl(i).set(new cl(r)),i}function qM(r,i){var u=i?hd(r.buffer):r.buffer;return new r.constructor(u,r.byteOffset,r.byteLength)}function KM(r){var i=new r.constructor(r.source,ji.exec(r));return i.lastIndex=r.lastIndex,i}function ZM(r){return Ji?ze(Ji.call(r)):{}}function mx(r,i){var u=i?hd(r.buffer):r.buffer;return new r.constructor(u,r.byteOffset,r.length)}function yx(r,i){if(r!==i){var u=r!==n,y=r===null,S=r===r,I=Bt(r),F=i!==n,j=i===null,X=i===i,oe=Bt(i);if(!j&&!oe&&!I&&r>i||I&&F&&X&&!j&&!oe||y&&F&&X||!u&&X||!S)return 1;if(!y&&!I&&!oe&&r<i||oe&&u&&S&&!y&&!I||j&&u&&S||!F&&S||!X)return-1}return 0}function QM(r,i,u){for(var y=-1,S=r.criteria,I=i.criteria,F=S.length,j=u.length;++y<F;){var X=yx(S[y],I[y]);if(X){if(y>=j)return X;var oe=u[y];return X*(oe=="desc"?-1:1)}}return r.index-i.index}function vx(r,i,u,y){for(var S=-1,I=r.length,F=u.length,j=-1,X=i.length,oe=lt(I-F,0),ie=ee(X+oe),le=!y;++j<X;)ie[j]=i[j];for(;++S<F;)(le||S<I)&&(ie[u[S]]=r[S]);for(;oe--;)ie[j++]=r[S++];return ie}function xx(r,i,u,y){for(var S=-1,I=r.length,F=-1,j=u.length,X=-1,oe=i.length,ie=lt(I-j,0),le=ee(ie+oe),he=!y;++S<ie;)le[S]=r[S];for(var we=S;++X<oe;)le[we+X]=i[X];for(;++F<j;)(he||S<I)&&(le[we+u[F]]=r[S++]);return le}function Et(r,i){var u=-1,y=r.length;for(i||(i=ee(y));++u<y;)i[u]=r[u];return i}function Cn(r,i,u,y){var S=!u;u||(u={});for(var I=-1,F=i.length;++I<F;){var j=i[I],X=y?y(u[j],r[j],j,u,r):n;X===n&&(X=r[j]),S?Wn(u,j,X):es(u,j,X)}return u}function JM(r,i){return Cn(r,wd(r),i)}function eR(r,i){return Cn(r,kx(r),i)}function El(r,i){return function(u,y){var S=Ae(u)?ik:_M,I=i?i():{};return S(u,r,Se(y,2),I)}}function Do(r){return ke(function(i,u){var y=-1,S=u.length,I=S>1?u[S-1]:n,F=S>2?u[2]:n;for(I=r.length>3&&typeof I=="function"?(S--,I):n,F&&vt(u[0],u[1],F)&&(I=S<3?n:I,S=1),i=ze(i);++y<S;){var j=u[y];j&&r(i,j,y,I)}return i})}function wx(r,i){return function(u,y){if(u==null)return u;if(!Ct(u))return r(u,y);for(var S=u.length,I=i?S:-1,F=ze(u);(i?I--:++I<S)&&y(F[I],I,F)!==!1;);return u}}function bx(r){return function(i,u,y){for(var S=-1,I=ze(i),F=y(i),j=F.length;j--;){var X=F[r?j:++S];if(u(I[X],X,I)===!1)break}return i}}function tR(r,i,u){var y=i&b,S=is(r);function I(){var F=this&&this!==ft&&this instanceof I?S:r;return F.apply(y?u:this,arguments)}return I}function _x(r){return function(i){i=Fe(i);var u=Ao(i)?on(i):n,y=u?u[0]:i.charAt(0),S=u?mr(u,1).join(""):i.slice(1);return y[r]()+S}}function Lo(r){return function(i){return Bf(ww(xw(i).replace(UP,"")),r,"")}}function is(r){return function(){var i=arguments;switch(i.length){case 0:return new r;case 1:return new r(i[0]);case 2:return new r(i[0],i[1]);case 3:return new r(i[0],i[1],i[2]);case 4:return new r(i[0],i[1],i[2],i[3]);case 5:return new r(i[0],i[1],i[2],i[3],i[4]);case 6:return new r(i[0],i[1],i[2],i[3],i[4],i[5]);case 7:return new r(i[0],i[1],i[2],i[3],i[4],i[5],i[6])}var u=Ro(r.prototype),y=r.apply(u,i);return Ke(y)?y:u}}function nR(r,i,u){var y=is(r);function S(){for(var I=arguments.length,F=ee(I),j=I,X=$o(S);j--;)F[j]=arguments[j];var oe=I<3&&F[0]!==X&&F[I-1]!==X?[]:fr(F,X);if(I-=oe.length,I<u)return Tx(r,i,Cl,S.placeholder,n,F,oe,n,n,u-I);var ie=this&&this!==ft&&this instanceof S?y:r;return Dt(ie,this,F)}return S}function Sx(r){return function(i,u,y){var S=ze(i);if(!Ct(i)){var I=Se(u,3);i=ct(i),u=function(j){return I(S[j],j,S)}}var F=r(i,u,y);return F>-1?S[I?i[F]:F]:n}}function Ex(r){return Un(function(i){var u=i.length,y=u,S=Ut.prototype.thru;for(r&&i.reverse();y--;){var I=i[y];if(typeof I!="function")throw new jt(l);if(S&&!F&&Il(I)=="wrapper")var F=new Ut([],!0)}for(y=F?y:u;++y<u;){I=i[y];var j=Il(I),X=j=="wrapper"?vd(I):n;X&&_d(X[0])&&X[1]==(M|w|O|D)&&!X[4].length&&X[9]==1?F=F[Il(X[0])].apply(F,X[3]):F=I.length==1&&_d(I)?F[j]():F.thru(I)}return function(){var oe=arguments,ie=oe[0];if(F&&oe.length==1&&Ae(ie))return F.plant(ie).value();for(var le=0,he=u?i[le].apply(this,oe):ie;++le<u;)he=i[le].call(this,he);return he}})}function Cl(r,i,u,y,S,I,F,j,X,oe){var ie=i&M,le=i&b,he=i&_,we=i&(w|E),Ee=i&V,Oe=he?n:is(r);function Ce(){for(var Me=arguments.length,$e=ee(Me),Ft=Me;Ft--;)$e[Ft]=arguments[Ft];if(we)var xt=$o(Ce),Ht=pk($e,xt);if(y&&($e=vx($e,y,S,we)),I&&($e=xx($e,I,F,we)),Me-=Ht,we&&Me<oe){var tt=fr($e,xt);return Tx(r,i,Cl,Ce.placeholder,u,$e,tt,j,X,oe-Me)}var ln=le?u:this,qn=he?ln[r]:r;return Me=$e.length,j?$e=_R($e,j):Ee&&Me>1&&$e.reverse(),ie&&X<Me&&($e.length=X),this&&this!==ft&&this instanceof Ce&&(qn=Oe||is(qn)),qn.apply(ln,$e)}return Ce}function Cx(r,i){return function(u,y){return OM(u,r,i(y),{})}}function Nl(r,i){return function(u,y){var S;if(u===n&&y===n)return i;if(u!==n&&(S=u),y!==n){if(S===n)return y;typeof u=="string"||typeof y=="string"?(u=$t(u),y=$t(y)):(u=ux(u),y=ux(y)),S=r(u,y)}return S}}function pd(r){return Un(function(i){return i=Xe(i,Lt(Se())),ke(function(u){var y=this;return r(i,function(S){return Dt(S,y,u)})})})}function Tl(r,i){i=i===n?" ":$t(i);var u=i.length;if(u<2)return u?ad(i,r):i;var y=ad(i,hl(r/Io(i)));return Ao(i)?mr(on(y),0,r).join(""):y.slice(0,r)}function rR(r,i,u,y){var S=i&b,I=is(r);function F(){for(var j=-1,X=arguments.length,oe=-1,ie=y.length,le=ee(ie+X),he=this&&this!==ft&&this instanceof F?I:r;++oe<ie;)le[oe]=y[oe];for(;X--;)le[oe++]=arguments[++j];return Dt(he,S?u:this,le)}return F}function Nx(r){return function(i,u,y){return y&&typeof y!="number"&&vt(i,u,y)&&(u=y=n),i=Xn(i),u===n?(u=i,i=0):u=Xn(u),y=y===n?i<u?1:-1:Xn(y),VM(i,u,y,r)}}function Al(r){return function(i,u){return typeof i=="string"&&typeof u=="string"||(i=qt(i),u=qt(u)),r(i,u)}}function Tx(r,i,u,y,S,I,F,j,X,oe){var ie=i&w,le=ie?F:n,he=ie?n:F,we=ie?I:n,Ee=ie?n:I;i|=ie?O:k,i&=~(ie?k:O),i&N||(i&=-4);var Oe=[r,i,S,we,le,Ee,he,j,X,oe],Ce=u.apply(n,Oe);return _d(r)&&Fx(Ce,Oe),Ce.placeholder=y,Hx(Ce,r,i)}function gd(r){var i=at[r];return function(u,y){if(u=qt(u),y=y==null?0:gt(Ie(y),292),y&&Hv(u)){var S=(Fe(u)+"e").split("e"),I=i(S[0]+"e"+(+S[1]+y));return S=(Fe(I)+"e").split("e"),+(S[0]+"e"+(+S[1]-y))}return i(u)}}var oR=ko&&1/rl(new ko([,-0]))[1]==R?function(r){return new ko(r)}:$d;function Ax(r){return function(i){var u=mt(i);return u==ye?Uf(i):u==pt?bk(i):hk(i,r(i))}}function jn(r,i,u,y,S,I,F,j){var X=i&_;if(!X&&typeof r!="function")throw new jt(l);var oe=y?y.length:0;if(oe||(i&=-97,y=S=n),F=F===n?F:lt(Ie(F),0),j=j===n?j:Ie(j),oe-=S?S.length:0,i&k){var ie=y,le=S;y=S=n}var he=X?n:vd(r),we=[r,i,u,y,S,ie,le,I,F,j];if(he&&xR(we,he),r=we[0],i=we[1],u=we[2],y=we[3],S=we[4],j=we[9]=we[9]===n?X?0:r.length:lt(we[9]-oe,0),!j&&i&(w|E)&&(i&=-25),!i||i==b)var Ee=tR(r,i,u);else i==w||i==E?Ee=nR(r,i,j):(i==O||i==(b|O))&&!S.length?Ee=rR(r,i,u,y):Ee=Cl.apply(n,we);var Oe=he?lx:Fx;return Hx(Oe(Ee,we),r,i)}function Ix(r,i,u,y){return r===n||an(r,Po[u])&&!He.call(y,u)?i:r}function Ox(r,i,u,y,S,I){return Ke(r)&&Ke(i)&&(I.set(i,r),bl(r,i,n,Ox,I),I.delete(i)),r}function iR(r){return ls(r)?n:r}function Px(r,i,u,y,S,I){var F=u&x,j=r.length,X=i.length;if(j!=X&&!(F&&X>j))return!1;var oe=I.get(r),ie=I.get(i);if(oe&&ie)return oe==i&&ie==r;var le=-1,he=!0,we=u&v?new Hr:n;for(I.set(r,i),I.set(i,r);++le<j;){var Ee=r[le],Oe=i[le];if(y)var Ce=F?y(Oe,Ee,le,i,r,I):y(Ee,Oe,le,r,i,I);if(Ce!==n){if(Ce)continue;he=!1;break}if(we){if(!Ff(i,function(Me,$e){if(!Xi(we,$e)&&(Ee===Me||S(Ee,Me,u,y,I)))return we.push($e)})){he=!1;break}}else if(!(Ee===Oe||S(Ee,Oe,u,y,I))){he=!1;break}}return I.delete(r),I.delete(i),he}function sR(r,i,u,y,S,I,F){switch(u){case Hn:if(r.byteLength!=i.byteLength||r.byteOffset!=i.byteOffset)return!1;r=r.buffer,i=i.buffer;case rn:return!(r.byteLength!=i.byteLength||!I(new cl(r),new cl(i)));case Q:case ae:case Le:return an(+r,+i);case de:return r.name==i.name&&r.message==i.message;case bn:case nn:return r==i+"";case ye:var j=Uf;case pt:var X=y&x;if(j||(j=rl),r.size!=i.size&&!X)return!1;var oe=F.get(r);if(oe)return oe==i;y|=v,F.set(r,i);var ie=Px(j(r),j(i),y,S,I,F);return F.delete(r),ie;case _n:if(Ji)return Ji.call(r)==Ji.call(i)}return!1}function aR(r,i,u,y,S,I){var F=u&x,j=md(r),X=j.length,oe=md(i),ie=oe.length;if(X!=ie&&!F)return!1;for(var le=X;le--;){var he=j[le];if(!(F?he in i:He.call(i,he)))return!1}var we=I.get(r),Ee=I.get(i);if(we&&Ee)return we==i&&Ee==r;var Oe=!0;I.set(r,i),I.set(i,r);for(var Ce=F;++le<X;){he=j[le];var Me=r[he],$e=i[he];if(y)var Ft=F?y($e,Me,he,i,r,I):y(Me,$e,he,r,i,I);if(!(Ft===n?Me===$e||S(Me,$e,u,y,I):Ft)){Oe=!1;break}Ce||(Ce=he=="constructor")}if(Oe&&!Ce){var xt=r.constructor,Ht=i.constructor;xt!=Ht&&"constructor"in r&&"constructor"in i&&!(typeof xt=="function"&&xt instanceof xt&&typeof Ht=="function"&&Ht instanceof Ht)&&(Oe=!1)}return I.delete(r),I.delete(i),Oe}function Un(r){return Ed($x(r,n,Gx),r+"")}function md(r){return Zv(r,ct,wd)}function yd(r){return Zv(r,Nt,kx)}var vd=gl?function(r){return gl.get(r)}:$d;function Il(r){for(var i=r.name+"",u=Mo[i],y=He.call(Mo,i)?u.length:0;y--;){var S=u[y],I=S.func;if(I==null||I==r)return S.name}return i}function $o(r){var i=He.call(A,"placeholder")?A:r;return i.placeholder}function Se(){var r=A.iteratee||Dd;return r=r===Dd?ex:r,arguments.length?r(arguments[0],arguments[1]):r}function Ol(r,i){var u=r.__data__;return gR(i)?u[typeof i=="string"?"string":"hash"]:u.map}function xd(r){for(var i=ct(r),u=i.length;u--;){var y=i[u],S=r[y];i[u]=[y,S,Dx(S)]}return i}function Wr(r,i){var u=vk(r,i);return Jv(u)?u:n}function lR(r){var i=He.call(r,Br),u=r[Br];try{r[Br]=n;var y=!0}catch{}var S=al.call(r);return y&&(i?r[Br]=u:delete r[Br]),S}var wd=Yf?function(r){return r==null?[]:(r=ze(r),cr(Yf(r),function(i){return Bv.call(r,i)}))}:Bd,kx=Yf?function(r){for(var i=[];r;)ur(i,wd(r)),r=ul(r);return i}:Bd,mt=yt;(Xf&&mt(new Xf(new ArrayBuffer(1)))!=Hn||Ki&&mt(new Ki)!=ye||qf&&mt(qf.resolve())!=Fn||ko&&mt(new ko)!=pt||Zi&&mt(new Zi)!=Sn)&&(mt=function(r){var i=yt(r),u=i==Ge?r.constructor:n,y=u?jr(u):"";if(y)switch(y){case jk:return Hn;case Uk:return ye;case Gk:return Fn;case Yk:return pt;case Xk:return Sn}return i});function cR(r,i,u){for(var y=-1,S=u.length;++y<S;){var I=u[y],F=I.size;switch(I.type){case"drop":r+=F;break;case"dropRight":i-=F;break;case"take":i=gt(i,r+F);break;case"takeRight":r=lt(r,i-F);break}}return{start:r,end:i}}function uR(r){var i=r.match(pf);return i?i[1].split(gf):[]}function Mx(r,i,u){i=gr(i,r);for(var y=-1,S=i.length,I=!1;++y<S;){var F=Nn(i[y]);if(!(I=r!=null&&u(r,F)))break;r=r[F]}return I||++y!=S?I:(S=r==null?0:r.length,!!S&&$l(S)&&Gn(F,S)&&(Ae(r)||Ur(r)))}function fR(r){var i=r.length,u=new r.constructor(i);return i&&typeof r[0]=="string"&&He.call(r,"index")&&(u.index=r.index,u.input=r.input),u}function Rx(r){return typeof r.constructor=="function"&&!ss(r)?Ro(ul(r)):{}}function dR(r,i,u){var y=r.constructor;switch(i){case rn:return hd(r);case Q:case ae:return new y(+r);case Hn:return qM(r,u);case Ri:case Lr:case Di:case Li:case $i:case Bi:case Fi:case Hi:case zi:return mx(r,u);case ye:return new y;case Le:case nn:return new y(r);case bn:return KM(r);case pt:return new y;case _n:return ZM(r)}}function hR(r,i){var u=i.length;if(!u)return r;var y=u-1;return i[y]=(u>1?"& ":"")+i[y],i=i.join(u>2?", ":" "),r.replace(hf,`{
68
+ /* [wrapped with `+i+`] */
69
+ `)}function pR(r){return Ae(r)||Ur(r)||!!(Fv&&r&&r[Fv])}function Gn(r,i){var u=typeof r;return i=i??P,!!i&&(u=="number"||u!="symbol"&&_f.test(r))&&r>-1&&r%1==0&&r<i}function vt(r,i,u){if(!Ke(u))return!1;var y=typeof i;return(y=="number"?Ct(u)&&Gn(i,u.length):y=="string"&&i in u)?an(u[i],r):!1}function bd(r,i){if(Ae(r))return!1;var u=typeof r;return u=="number"||u=="symbol"||u=="boolean"||r==null||Bt(r)?!0:cf.test(r)||!lf.test(r)||i!=null&&r in ze(i)}function gR(r){var i=typeof r;return i=="string"||i=="number"||i=="symbol"||i=="boolean"?r!=="__proto__":r===null}function _d(r){var i=Il(r),u=A[i];if(typeof u!="function"||!(i in De.prototype))return!1;if(r===u)return!0;var y=vd(u);return!!y&&r===y[0]}function mR(r){return!!Dv&&Dv in r}var yR=il?Yn:Fd;function ss(r){var i=r&&r.constructor,u=typeof i=="function"&&i.prototype||Po;return r===u}function Dx(r){return r===r&&!Ke(r)}function Lx(r,i){return function(u){return u==null?!1:u[r]===i&&(i!==n||r in ze(u))}}function vR(r){var i=Dl(r,function(y){return u.size===d&&u.clear(),y}),u=i.cache;return i}function xR(r,i){var u=r[1],y=i[1],S=u|y,I=S<(b|_|M),F=y==M&&u==w||y==M&&u==D&&r[7].length<=i[8]||y==(M|D)&&i[7].length<=i[8]&&u==w;if(!(I||F))return r;y&b&&(r[2]=i[2],S|=u&b?0:N);var j=i[3];if(j){var X=r[3];r[3]=X?vx(X,j,i[4]):j,r[4]=X?fr(r[3],h):i[4]}return j=i[5],j&&(X=r[5],r[5]=X?xx(X,j,i[6]):j,r[6]=X?fr(r[5],h):i[6]),j=i[7],j&&(r[7]=j),y&M&&(r[8]=r[8]==null?i[8]:gt(r[8],i[8])),r[9]==null&&(r[9]=i[9]),r[0]=i[0],r[1]=S,r}function wR(r){var i=[];if(r!=null)for(var u in ze(r))i.push(u);return i}function bR(r){return al.call(r)}function $x(r,i,u){return i=lt(i===n?r.length-1:i,0),function(){for(var y=arguments,S=-1,I=lt(y.length-i,0),F=ee(I);++S<I;)F[S]=y[i+S];S=-1;for(var j=ee(i+1);++S<i;)j[S]=y[S];return j[i]=u(F),Dt(r,this,j)}}function Bx(r,i){return i.length<2?r:Vr(r,Yt(i,0,-1))}function _R(r,i){for(var u=r.length,y=gt(i.length,u),S=Et(r);y--;){var I=i[y];r[y]=Gn(I,u)?S[I]:n}return r}function Sd(r,i){if(!(i==="constructor"&&typeof r[i]=="function")&&i!="__proto__")return r[i]}var Fx=zx(lx),as=$k||function(r,i){return ft.setTimeout(r,i)},Ed=zx(UM);function Hx(r,i,u){var y=i+"";return Ed(r,hR(y,SR(uR(y),u)))}function zx(r){var i=0,u=0;return function(){var y=zk(),S=q-(y-u);if(u=y,S>0){if(++i>=U)return arguments[0]}else i=0;return r.apply(n,arguments)}}function Pl(r,i){var u=-1,y=r.length,S=y-1;for(i=i===n?y:i;++u<i;){var I=sd(u,S),F=r[I];r[I]=r[u],r[u]=F}return r.length=i,r}var Vx=vR(function(r){var i=[];return r.charCodeAt(0)===46&&i.push(""),r.replace(uf,function(u,y,S,I){i.push(S?I.replace(vf,"$1"):y||u)}),i});function Nn(r){if(typeof r=="string"||Bt(r))return r;var i=r+"";return i=="0"&&1/r==-R?"-0":i}function jr(r){if(r!=null){try{return sl.call(r)}catch{}try{return r+""}catch{}}return""}function SR(r,i){return Wt(se,function(u){var y="_."+u[0];i&u[1]&&!tl(r,y)&&r.push(y)}),r.sort()}function Wx(r){if(r instanceof De)return r.clone();var i=new Ut(r.__wrapped__,r.__chain__);return i.__actions__=Et(r.__actions__),i.__index__=r.__index__,i.__values__=r.__values__,i}function ER(r,i,u){(u?vt(r,i,u):i===n)?i=1:i=lt(Ie(i),0);var y=r==null?0:r.length;if(!y||i<1)return[];for(var S=0,I=0,F=ee(hl(y/i));S<y;)F[I++]=Yt(r,S,S+=i);return F}function CR(r){for(var i=-1,u=r==null?0:r.length,y=0,S=[];++i<u;){var I=r[i];I&&(S[y++]=I)}return S}function NR(){var r=arguments.length;if(!r)return[];for(var i=ee(r-1),u=arguments[0],y=r;y--;)i[y-1]=arguments[y];return ur(Ae(u)?Et(u):[u],dt(i,1))}var TR=ke(function(r,i){return et(r)?ts(r,dt(i,1,et,!0)):[]}),AR=ke(function(r,i){var u=Xt(i);return et(u)&&(u=n),et(r)?ts(r,dt(i,1,et,!0),Se(u,2)):[]}),IR=ke(function(r,i){var u=Xt(i);return et(u)&&(u=n),et(r)?ts(r,dt(i,1,et,!0),n,u):[]});function OR(r,i,u){var y=r==null?0:r.length;return y?(i=u||i===n?1:Ie(i),Yt(r,i<0?0:i,y)):[]}function PR(r,i,u){var y=r==null?0:r.length;return y?(i=u||i===n?1:Ie(i),i=y-i,Yt(r,0,i<0?0:i)):[]}function kR(r,i){return r&&r.length?Sl(r,Se(i,3),!0,!0):[]}function MR(r,i){return r&&r.length?Sl(r,Se(i,3),!0):[]}function RR(r,i,u,y){var S=r==null?0:r.length;return S?(u&&typeof u!="number"&&vt(r,i,u)&&(u=0,y=S),NM(r,i,u,y)):[]}function jx(r,i,u){var y=r==null?0:r.length;if(!y)return-1;var S=u==null?0:Ie(u);return S<0&&(S=lt(y+S,0)),nl(r,Se(i,3),S)}function Ux(r,i,u){var y=r==null?0:r.length;if(!y)return-1;var S=y-1;return u!==n&&(S=Ie(u),S=u<0?lt(y+S,0):gt(S,y-1)),nl(r,Se(i,3),S,!0)}function Gx(r){var i=r==null?0:r.length;return i?dt(r,1):[]}function DR(r){var i=r==null?0:r.length;return i?dt(r,R):[]}function LR(r,i){var u=r==null?0:r.length;return u?(i=i===n?1:Ie(i),dt(r,i)):[]}function $R(r){for(var i=-1,u=r==null?0:r.length,y={};++i<u;){var S=r[i];y[S[0]]=S[1]}return y}function Yx(r){return r&&r.length?r[0]:n}function BR(r,i,u){var y=r==null?0:r.length;if(!y)return-1;var S=u==null?0:Ie(u);return S<0&&(S=lt(y+S,0)),To(r,i,S)}function FR(r){var i=r==null?0:r.length;return i?Yt(r,0,-1):[]}var HR=ke(function(r){var i=Xe(r,fd);return i.length&&i[0]===r[0]?td(i):[]}),zR=ke(function(r){var i=Xt(r),u=Xe(r,fd);return i===Xt(u)?i=n:u.pop(),u.length&&u[0]===r[0]?td(u,Se(i,2)):[]}),VR=ke(function(r){var i=Xt(r),u=Xe(r,fd);return i=typeof i=="function"?i:n,i&&u.pop(),u.length&&u[0]===r[0]?td(u,n,i):[]});function WR(r,i){return r==null?"":Fk.call(r,i)}function Xt(r){var i=r==null?0:r.length;return i?r[i-1]:n}function jR(r,i,u){var y=r==null?0:r.length;if(!y)return-1;var S=y;return u!==n&&(S=Ie(u),S=S<0?lt(y+S,0):gt(S,y-1)),i===i?Sk(r,i,S):nl(r,Tv,S,!0)}function UR(r,i){return r&&r.length?ox(r,Ie(i)):n}var GR=ke(Xx);function Xx(r,i){return r&&r.length&&i&&i.length?id(r,i):r}function YR(r,i,u){return r&&r.length&&i&&i.length?id(r,i,Se(u,2)):r}function XR(r,i,u){return r&&r.length&&i&&i.length?id(r,i,n,u):r}var qR=Un(function(r,i){var u=r==null?0:r.length,y=Zf(r,i);return ax(r,Xe(i,function(S){return Gn(S,u)?+S:S}).sort(yx)),y});function KR(r,i){var u=[];if(!(r&&r.length))return u;var y=-1,S=[],I=r.length;for(i=Se(i,3);++y<I;){var F=r[y];i(F,y,r)&&(u.push(F),S.push(y))}return ax(r,S),u}function Cd(r){return r==null?r:Wk.call(r)}function ZR(r,i,u){var y=r==null?0:r.length;return y?(u&&typeof u!="number"&&vt(r,i,u)?(i=0,u=y):(i=i==null?0:Ie(i),u=u===n?y:Ie(u)),Yt(r,i,u)):[]}function QR(r,i){return _l(r,i)}function JR(r,i,u){return ld(r,i,Se(u,2))}function eD(r,i){var u=r==null?0:r.length;if(u){var y=_l(r,i);if(y<u&&an(r[y],i))return y}return-1}function tD(r,i){return _l(r,i,!0)}function nD(r,i,u){return ld(r,i,Se(u,2),!0)}function rD(r,i){var u=r==null?0:r.length;if(u){var y=_l(r,i,!0)-1;if(an(r[y],i))return y}return-1}function oD(r){return r&&r.length?cx(r):[]}function iD(r,i){return r&&r.length?cx(r,Se(i,2)):[]}function sD(r){var i=r==null?0:r.length;return i?Yt(r,1,i):[]}function aD(r,i,u){return r&&r.length?(i=u||i===n?1:Ie(i),Yt(r,0,i<0?0:i)):[]}function lD(r,i,u){var y=r==null?0:r.length;return y?(i=u||i===n?1:Ie(i),i=y-i,Yt(r,i<0?0:i,y)):[]}function cD(r,i){return r&&r.length?Sl(r,Se(i,3),!1,!0):[]}function uD(r,i){return r&&r.length?Sl(r,Se(i,3)):[]}var fD=ke(function(r){return pr(dt(r,1,et,!0))}),dD=ke(function(r){var i=Xt(r);return et(i)&&(i=n),pr(dt(r,1,et,!0),Se(i,2))}),hD=ke(function(r){var i=Xt(r);return i=typeof i=="function"?i:n,pr(dt(r,1,et,!0),n,i)});function pD(r){return r&&r.length?pr(r):[]}function gD(r,i){return r&&r.length?pr(r,Se(i,2)):[]}function mD(r,i){return i=typeof i=="function"?i:n,r&&r.length?pr(r,n,i):[]}function Nd(r){if(!(r&&r.length))return[];var i=0;return r=cr(r,function(u){if(et(u))return i=lt(u.length,i),!0}),Wf(i,function(u){return Xe(r,Hf(u))})}function qx(r,i){if(!(r&&r.length))return[];var u=Nd(r);return i==null?u:Xe(u,function(y){return Dt(i,n,y)})}var yD=ke(function(r,i){return et(r)?ts(r,i):[]}),vD=ke(function(r){return ud(cr(r,et))}),xD=ke(function(r){var i=Xt(r);return et(i)&&(i=n),ud(cr(r,et),Se(i,2))}),wD=ke(function(r){var i=Xt(r);return i=typeof i=="function"?i:n,ud(cr(r,et),n,i)}),bD=ke(Nd);function _D(r,i){return hx(r||[],i||[],es)}function SD(r,i){return hx(r||[],i||[],os)}var ED=ke(function(r){var i=r.length,u=i>1?r[i-1]:n;return u=typeof u=="function"?(r.pop(),u):n,qx(r,u)});function Kx(r){var i=A(r);return i.__chain__=!0,i}function CD(r,i){return i(r),r}function kl(r,i){return i(r)}var ND=Un(function(r){var i=r.length,u=i?r[0]:0,y=this.__wrapped__,S=function(I){return Zf(I,r)};return i>1||this.__actions__.length||!(y instanceof De)||!Gn(u)?this.thru(S):(y=y.slice(u,+u+(i?1:0)),y.__actions__.push({func:kl,args:[S],thisArg:n}),new Ut(y,this.__chain__).thru(function(I){return i&&!I.length&&I.push(n),I}))});function TD(){return Kx(this)}function AD(){return new Ut(this.value(),this.__chain__)}function ID(){this.__values__===n&&(this.__values__=uw(this.value()));var r=this.__index__>=this.__values__.length,i=r?n:this.__values__[this.__index__++];return{done:r,value:i}}function OD(){return this}function PD(r){for(var i,u=this;u instanceof yl;){var y=Wx(u);y.__index__=0,y.__values__=n,i?S.__wrapped__=y:i=y;var S=y;u=u.__wrapped__}return S.__wrapped__=r,i}function kD(){var r=this.__wrapped__;if(r instanceof De){var i=r;return this.__actions__.length&&(i=new De(this)),i=i.reverse(),i.__actions__.push({func:kl,args:[Cd],thisArg:n}),new Ut(i,this.__chain__)}return this.thru(Cd)}function MD(){return dx(this.__wrapped__,this.__actions__)}var RD=El(function(r,i,u){He.call(r,u)?++r[u]:Wn(r,u,1)});function DD(r,i,u){var y=Ae(r)?Cv:CM;return u&&vt(r,i,u)&&(i=n),y(r,Se(i,3))}function LD(r,i){var u=Ae(r)?cr:qv;return u(r,Se(i,3))}var $D=Sx(jx),BD=Sx(Ux);function FD(r,i){return dt(Ml(r,i),1)}function HD(r,i){return dt(Ml(r,i),R)}function zD(r,i,u){return u=u===n?1:Ie(u),dt(Ml(r,i),u)}function Zx(r,i){var u=Ae(r)?Wt:hr;return u(r,Se(i,3))}function Qx(r,i){var u=Ae(r)?sk:Xv;return u(r,Se(i,3))}var VD=El(function(r,i,u){He.call(r,u)?r[u].push(i):Wn(r,u,[i])});function WD(r,i,u,y){r=Ct(r)?r:Fo(r),u=u&&!y?Ie(u):0;var S=r.length;return u<0&&(u=lt(S+u,0)),Bl(r)?u<=S&&r.indexOf(i,u)>-1:!!S&&To(r,i,u)>-1}var jD=ke(function(r,i,u){var y=-1,S=typeof i=="function",I=Ct(r)?ee(r.length):[];return hr(r,function(F){I[++y]=S?Dt(i,F,u):ns(F,i,u)}),I}),UD=El(function(r,i,u){Wn(r,u,i)});function Ml(r,i){var u=Ae(r)?Xe:tx;return u(r,Se(i,3))}function GD(r,i,u,y){return r==null?[]:(Ae(i)||(i=i==null?[]:[i]),u=y?n:u,Ae(u)||(u=u==null?[]:[u]),ix(r,i,u))}var YD=El(function(r,i,u){r[u?0:1].push(i)},function(){return[[],[]]});function XD(r,i,u){var y=Ae(r)?Bf:Iv,S=arguments.length<3;return y(r,Se(i,4),u,S,hr)}function qD(r,i,u){var y=Ae(r)?ak:Iv,S=arguments.length<3;return y(r,Se(i,4),u,S,Xv)}function KD(r,i){var u=Ae(r)?cr:qv;return u(r,Ll(Se(i,3)))}function ZD(r){var i=Ae(r)?jv:WM;return i(r)}function QD(r,i,u){(u?vt(r,i,u):i===n)?i=1:i=Ie(i);var y=Ae(r)?wM:jM;return y(r,i)}function JD(r){var i=Ae(r)?bM:GM;return i(r)}function e2(r){if(r==null)return 0;if(Ct(r))return Bl(r)?Io(r):r.length;var i=mt(r);return i==ye||i==pt?r.size:rd(r).length}function t2(r,i,u){var y=Ae(r)?Ff:YM;return u&&vt(r,i,u)&&(i=n),y(r,Se(i,3))}var n2=ke(function(r,i){if(r==null)return[];var u=i.length;return u>1&&vt(r,i[0],i[1])?i=[]:u>2&&vt(i[0],i[1],i[2])&&(i=[i[0]]),ix(r,dt(i,1),[])}),Rl=Lk||function(){return ft.Date.now()};function r2(r,i){if(typeof i!="function")throw new jt(l);return r=Ie(r),function(){if(--r<1)return i.apply(this,arguments)}}function Jx(r,i,u){return i=u?n:i,i=r&&i==null?r.length:i,jn(r,M,n,n,n,n,i)}function ew(r,i){var u;if(typeof i!="function")throw new jt(l);return r=Ie(r),function(){return--r>0&&(u=i.apply(this,arguments)),r<=1&&(i=n),u}}var Td=ke(function(r,i,u){var y=b;if(u.length){var S=fr(u,$o(Td));y|=O}return jn(r,y,i,u,S)}),tw=ke(function(r,i,u){var y=b|_;if(u.length){var S=fr(u,$o(tw));y|=O}return jn(i,y,r,u,S)});function nw(r,i,u){i=u?n:i;var y=jn(r,w,n,n,n,n,n,i);return y.placeholder=nw.placeholder,y}function rw(r,i,u){i=u?n:i;var y=jn(r,E,n,n,n,n,n,i);return y.placeholder=rw.placeholder,y}function ow(r,i,u){var y,S,I,F,j,X,oe=0,ie=!1,le=!1,he=!0;if(typeof r!="function")throw new jt(l);i=qt(i)||0,Ke(u)&&(ie=!!u.leading,le="maxWait"in u,I=le?lt(qt(u.maxWait)||0,i):I,he="trailing"in u?!!u.trailing:he);function we(tt){var ln=y,qn=S;return y=S=n,oe=tt,F=r.apply(qn,ln),F}function Ee(tt){return oe=tt,j=as(Me,i),ie?we(tt):F}function Oe(tt){var ln=tt-X,qn=tt-oe,Sw=i-ln;return le?gt(Sw,I-qn):Sw}function Ce(tt){var ln=tt-X,qn=tt-oe;return X===n||ln>=i||ln<0||le&&qn>=I}function Me(){var tt=Rl();if(Ce(tt))return $e(tt);j=as(Me,Oe(tt))}function $e(tt){return j=n,he&&y?we(tt):(y=S=n,F)}function Ft(){j!==n&&px(j),oe=0,y=X=S=j=n}function xt(){return j===n?F:$e(Rl())}function Ht(){var tt=Rl(),ln=Ce(tt);if(y=arguments,S=this,X=tt,ln){if(j===n)return Ee(X);if(le)return px(j),j=as(Me,i),we(X)}return j===n&&(j=as(Me,i)),F}return Ht.cancel=Ft,Ht.flush=xt,Ht}var o2=ke(function(r,i){return Yv(r,1,i)}),i2=ke(function(r,i,u){return Yv(r,qt(i)||0,u)});function s2(r){return jn(r,V)}function Dl(r,i){if(typeof r!="function"||i!=null&&typeof i!="function")throw new jt(l);var u=function(){var y=arguments,S=i?i.apply(this,y):y[0],I=u.cache;if(I.has(S))return I.get(S);var F=r.apply(this,y);return u.cache=I.set(S,F)||I,F};return u.cache=new(Dl.Cache||Vn),u}Dl.Cache=Vn;function Ll(r){if(typeof r!="function")throw new jt(l);return function(){var i=arguments;switch(i.length){case 0:return!r.call(this);case 1:return!r.call(this,i[0]);case 2:return!r.call(this,i[0],i[1]);case 3:return!r.call(this,i[0],i[1],i[2])}return!r.apply(this,i)}}function a2(r){return ew(2,r)}var l2=XM(function(r,i){i=i.length==1&&Ae(i[0])?Xe(i[0],Lt(Se())):Xe(dt(i,1),Lt(Se()));var u=i.length;return ke(function(y){for(var S=-1,I=gt(y.length,u);++S<I;)y[S]=i[S].call(this,y[S]);return Dt(r,this,y)})}),Ad=ke(function(r,i){var u=fr(i,$o(Ad));return jn(r,O,n,i,u)}),iw=ke(function(r,i){var u=fr(i,$o(iw));return jn(r,k,n,i,u)}),c2=Un(function(r,i){return jn(r,D,n,n,n,i)});function u2(r,i){if(typeof r!="function")throw new jt(l);return i=i===n?i:Ie(i),ke(r,i)}function f2(r,i){if(typeof r!="function")throw new jt(l);return i=i==null?0:lt(Ie(i),0),ke(function(u){var y=u[i],S=mr(u,0,i);return y&&ur(S,y),Dt(r,this,S)})}function d2(r,i,u){var y=!0,S=!0;if(typeof r!="function")throw new jt(l);return Ke(u)&&(y="leading"in u?!!u.leading:y,S="trailing"in u?!!u.trailing:S),ow(r,i,{leading:y,maxWait:i,trailing:S})}function h2(r){return Jx(r,1)}function p2(r,i){return Ad(dd(i),r)}function g2(){if(!arguments.length)return[];var r=arguments[0];return Ae(r)?r:[r]}function m2(r){return Gt(r,m)}function y2(r,i){return i=typeof i=="function"?i:n,Gt(r,m,i)}function v2(r){return Gt(r,g|m)}function x2(r,i){return i=typeof i=="function"?i:n,Gt(r,g|m,i)}function w2(r,i){return i==null||Gv(r,i,ct(i))}function an(r,i){return r===i||r!==r&&i!==i}var b2=Al(ed),_2=Al(function(r,i){return r>=i}),Ur=Qv(function(){return arguments}())?Qv:function(r){return Qe(r)&&He.call(r,"callee")&&!Bv.call(r,"callee")},Ae=ee.isArray,S2=xv?Lt(xv):PM;function Ct(r){return r!=null&&$l(r.length)&&!Yn(r)}function et(r){return Qe(r)&&Ct(r)}function E2(r){return r===!0||r===!1||Qe(r)&&yt(r)==Q}var yr=Bk||Fd,C2=wv?Lt(wv):kM;function N2(r){return Qe(r)&&r.nodeType===1&&!ls(r)}function T2(r){if(r==null)return!0;if(Ct(r)&&(Ae(r)||typeof r=="string"||typeof r.splice=="function"||yr(r)||Bo(r)||Ur(r)))return!r.length;var i=mt(r);if(i==ye||i==pt)return!r.size;if(ss(r))return!rd(r).length;for(var u in r)if(He.call(r,u))return!1;return!0}function A2(r,i){return rs(r,i)}function I2(r,i,u){u=typeof u=="function"?u:n;var y=u?u(r,i):n;return y===n?rs(r,i,n,u):!!y}function Id(r){if(!Qe(r))return!1;var i=yt(r);return i==de||i==fe||typeof r.message=="string"&&typeof r.name=="string"&&!ls(r)}function O2(r){return typeof r=="number"&&Hv(r)}function Yn(r){if(!Ke(r))return!1;var i=yt(r);return i==ue||i==_e||i==te||i==bo}function sw(r){return typeof r=="number"&&r==Ie(r)}function $l(r){return typeof r=="number"&&r>-1&&r%1==0&&r<=P}function Ke(r){var i=typeof r;return r!=null&&(i=="object"||i=="function")}function Qe(r){return r!=null&&typeof r=="object"}var aw=bv?Lt(bv):RM;function P2(r,i){return r===i||nd(r,i,xd(i))}function k2(r,i,u){return u=typeof u=="function"?u:n,nd(r,i,xd(i),u)}function M2(r){return lw(r)&&r!=+r}function R2(r){if(yR(r))throw new Te(a);return Jv(r)}function D2(r){return r===null}function L2(r){return r==null}function lw(r){return typeof r=="number"||Qe(r)&&yt(r)==Le}function ls(r){if(!Qe(r)||yt(r)!=Ge)return!1;var i=ul(r);if(i===null)return!0;var u=He.call(i,"constructor")&&i.constructor;return typeof u=="function"&&u instanceof u&&sl.call(u)==kk}var Od=_v?Lt(_v):DM;function $2(r){return sw(r)&&r>=-P&&r<=P}var cw=Sv?Lt(Sv):LM;function Bl(r){return typeof r=="string"||!Ae(r)&&Qe(r)&&yt(r)==nn}function Bt(r){return typeof r=="symbol"||Qe(r)&&yt(r)==_n}var Bo=Ev?Lt(Ev):$M;function B2(r){return r===n}function F2(r){return Qe(r)&&mt(r)==Sn}function H2(r){return Qe(r)&&yt(r)==lr}var z2=Al(od),V2=Al(function(r,i){return r<=i});function uw(r){if(!r)return[];if(Ct(r))return Bl(r)?on(r):Et(r);if(qi&&r[qi])return wk(r[qi]());var i=mt(r),u=i==ye?Uf:i==pt?rl:Fo;return u(r)}function Xn(r){if(!r)return r===0?r:0;if(r=qt(r),r===R||r===-R){var i=r<0?-1:1;return i*W}return r===r?r:0}function Ie(r){var i=Xn(r),u=i%1;return i===i?u?i-u:i:0}function fw(r){return r?zr(Ie(r),0,G):0}function qt(r){if(typeof r=="number")return r;if(Bt(r))return $;if(Ke(r)){var i=typeof r.valueOf=="function"?r.valueOf():r;r=Ke(i)?i+"":i}if(typeof r!="string")return r===0?r:+r;r=Ov(r);var u=xf.test(r);return u||bf.test(r)?rk(r.slice(2),u?2:8):Wa.test(r)?$:+r}function dw(r){return Cn(r,Nt(r))}function W2(r){return r?zr(Ie(r),-P,P):r===0?r:0}function Fe(r){return r==null?"":$t(r)}var j2=Do(function(r,i){if(ss(i)||Ct(i)){Cn(i,ct(i),r);return}for(var u in i)He.call(i,u)&&es(r,u,i[u])}),hw=Do(function(r,i){Cn(i,Nt(i),r)}),Fl=Do(function(r,i,u,y){Cn(i,Nt(i),r,y)}),U2=Do(function(r,i,u,y){Cn(i,ct(i),r,y)}),G2=Un(Zf);function Y2(r,i){var u=Ro(r);return i==null?u:Uv(u,i)}var X2=ke(function(r,i){r=ze(r);var u=-1,y=i.length,S=y>2?i[2]:n;for(S&&vt(i[0],i[1],S)&&(y=1);++u<y;)for(var I=i[u],F=Nt(I),j=-1,X=F.length;++j<X;){var oe=F[j],ie=r[oe];(ie===n||an(ie,Po[oe])&&!He.call(r,oe))&&(r[oe]=I[oe])}return r}),q2=ke(function(r){return r.push(n,Ox),Dt(pw,n,r)});function K2(r,i){return Nv(r,Se(i,3),En)}function Z2(r,i){return Nv(r,Se(i,3),Jf)}function Q2(r,i){return r==null?r:Qf(r,Se(i,3),Nt)}function J2(r,i){return r==null?r:Kv(r,Se(i,3),Nt)}function eL(r,i){return r&&En(r,Se(i,3))}function tL(r,i){return r&&Jf(r,Se(i,3))}function nL(r){return r==null?[]:wl(r,ct(r))}function rL(r){return r==null?[]:wl(r,Nt(r))}function Pd(r,i,u){var y=r==null?n:Vr(r,i);return y===n?u:y}function oL(r,i){return r!=null&&Mx(r,i,TM)}function kd(r,i){return r!=null&&Mx(r,i,AM)}var iL=Cx(function(r,i,u){i!=null&&typeof i.toString!="function"&&(i=al.call(i)),r[i]=u},Rd(Tt)),sL=Cx(function(r,i,u){i!=null&&typeof i.toString!="function"&&(i=al.call(i)),He.call(r,i)?r[i].push(u):r[i]=[u]},Se),aL=ke(ns);function ct(r){return Ct(r)?Wv(r):rd(r)}function Nt(r){return Ct(r)?Wv(r,!0):BM(r)}function lL(r,i){var u={};return i=Se(i,3),En(r,function(y,S,I){Wn(u,i(y,S,I),y)}),u}function cL(r,i){var u={};return i=Se(i,3),En(r,function(y,S,I){Wn(u,S,i(y,S,I))}),u}var uL=Do(function(r,i,u){bl(r,i,u)}),pw=Do(function(r,i,u,y){bl(r,i,u,y)}),fL=Un(function(r,i){var u={};if(r==null)return u;var y=!1;i=Xe(i,function(I){return I=gr(I,r),y||(y=I.length>1),I}),Cn(r,yd(r),u),y&&(u=Gt(u,g|p|m,iR));for(var S=i.length;S--;)cd(u,i[S]);return u});function dL(r,i){return gw(r,Ll(Se(i)))}var hL=Un(function(r,i){return r==null?{}:HM(r,i)});function gw(r,i){if(r==null)return{};var u=Xe(yd(r),function(y){return[y]});return i=Se(i),sx(r,u,function(y,S){return i(y,S[0])})}function pL(r,i,u){i=gr(i,r);var y=-1,S=i.length;for(S||(S=1,r=n);++y<S;){var I=r==null?n:r[Nn(i[y])];I===n&&(y=S,I=u),r=Yn(I)?I.call(r):I}return r}function gL(r,i,u){return r==null?r:os(r,i,u)}function mL(r,i,u,y){return y=typeof y=="function"?y:n,r==null?r:os(r,i,u,y)}var mw=Ax(ct),yw=Ax(Nt);function yL(r,i,u){var y=Ae(r),S=y||yr(r)||Bo(r);if(i=Se(i,4),u==null){var I=r&&r.constructor;S?u=y?new I:[]:Ke(r)?u=Yn(I)?Ro(ul(r)):{}:u={}}return(S?Wt:En)(r,function(F,j,X){return i(u,F,j,X)}),u}function vL(r,i){return r==null?!0:cd(r,i)}function xL(r,i,u){return r==null?r:fx(r,i,dd(u))}function wL(r,i,u,y){return y=typeof y=="function"?y:n,r==null?r:fx(r,i,dd(u),y)}function Fo(r){return r==null?[]:jf(r,ct(r))}function bL(r){return r==null?[]:jf(r,Nt(r))}function _L(r,i,u){return u===n&&(u=i,i=n),u!==n&&(u=qt(u),u=u===u?u:0),i!==n&&(i=qt(i),i=i===i?i:0),zr(qt(r),i,u)}function SL(r,i,u){return i=Xn(i),u===n?(u=i,i=0):u=Xn(u),r=qt(r),IM(r,i,u)}function EL(r,i,u){if(u&&typeof u!="boolean"&&vt(r,i,u)&&(i=u=n),u===n&&(typeof i=="boolean"?(u=i,i=n):typeof r=="boolean"&&(u=r,r=n)),r===n&&i===n?(r=0,i=1):(r=Xn(r),i===n?(i=r,r=0):i=Xn(i)),r>i){var y=r;r=i,i=y}if(u||r%1||i%1){var S=zv();return gt(r+S*(i-r+nk("1e-"+((S+"").length-1))),i)}return sd(r,i)}var CL=Lo(function(r,i,u){return i=i.toLowerCase(),r+(u?vw(i):i)});function vw(r){return Md(Fe(r).toLowerCase())}function xw(r){return r=Fe(r),r&&r.replace(Sf,gk).replace(GP,"")}function NL(r,i,u){r=Fe(r),i=$t(i);var y=r.length;u=u===n?y:zr(Ie(u),0,y);var S=u;return u-=i.length,u>=0&&r.slice(u,S)==i}function TL(r){return r=Fe(r),r&&sf.test(r)?r.replace(Fa,mk):r}function AL(r){return r=Fe(r),r&&ff.test(r)?r.replace(Vi,"\\$&"):r}var IL=Lo(function(r,i,u){return r+(u?"-":"")+i.toLowerCase()}),OL=Lo(function(r,i,u){return r+(u?" ":"")+i.toLowerCase()}),PL=_x("toLowerCase");function kL(r,i,u){r=Fe(r),i=Ie(i);var y=i?Io(r):0;if(!i||y>=i)return r;var S=(i-y)/2;return Tl(pl(S),u)+r+Tl(hl(S),u)}function ML(r,i,u){r=Fe(r),i=Ie(i);var y=i?Io(r):0;return i&&y<i?r+Tl(i-y,u):r}function RL(r,i,u){r=Fe(r),i=Ie(i);var y=i?Io(r):0;return i&&y<i?Tl(i-y,u)+r:r}function DL(r,i,u){return u||i==null?i=0:i&&(i=+i),Vk(Fe(r).replace(Wi,""),i||0)}function LL(r,i,u){return(u?vt(r,i,u):i===n)?i=1:i=Ie(i),ad(Fe(r),i)}function $L(){var r=arguments,i=Fe(r[0]);return r.length<3?i:i.replace(r[1],r[2])}var BL=Lo(function(r,i,u){return r+(u?"_":"")+i.toLowerCase()});function FL(r,i,u){return u&&typeof u!="number"&&vt(r,i,u)&&(i=u=n),u=u===n?G:u>>>0,u?(r=Fe(r),r&&(typeof i=="string"||i!=null&&!Od(i))&&(i=$t(i),!i&&Ao(r))?mr(on(r),0,u):r.split(i,u)):[]}var HL=Lo(function(r,i,u){return r+(u?" ":"")+Md(i)});function zL(r,i,u){return r=Fe(r),u=u==null?0:zr(Ie(u),0,r.length),i=$t(i),r.slice(u,u+i.length)==i}function VL(r,i,u){var y=A.templateSettings;u&&vt(r,i,u)&&(i=n),r=Fe(r),i=Fl({},i,y,Ix);var S=Fl({},i.imports,y.imports,Ix),I=ct(S),F=jf(S,I),j,X,oe=0,ie=i.interpolate||_o,le="__p += '",he=Gf((i.escape||_o).source+"|"+ie.source+"|"+(ie===za?Va:_o).source+"|"+(i.evaluate||_o).source+"|$","g"),we="//# sourceURL="+(He.call(i,"sourceURL")?(i.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++ZP+"]")+`
70
+ `;r.replace(he,function(Ce,Me,$e,Ft,xt,Ht){return $e||($e=Ft),le+=r.slice(oe,Ht).replace(ja,yk),Me&&(j=!0,le+=`' +
71
+ __e(`+Me+`) +
72
+ '`),xt&&(X=!0,le+=`';
73
+ `+xt+`;
74
+ __p += '`),$e&&(le+=`' +
75
+ ((__t = (`+$e+`)) == null ? '' : __t) +
76
+ '`),oe=Ht+Ce.length,Ce}),le+=`';
77
+ `;var Ee=He.call(i,"variable")&&i.variable;if(!Ee)le=`with (obj) {
78
+ `+le+`
79
+ }
80
+ `;else if(yf.test(Ee))throw new Te(c);le=(X?le.replace(tf,""):le).replace(nf,"$1").replace(rf,"$1;"),le="function("+(Ee||"obj")+`) {
81
+ `+(Ee?"":`obj || (obj = {});
82
+ `)+"var __t, __p = ''"+(j?", __e = _.escape":"")+(X?`, __j = Array.prototype.join;
83
+ function print() { __p += __j.call(arguments, '') }
84
+ `:`;
85
+ `)+le+`return __p
86
+ }`;var Oe=bw(function(){return Be(I,we+"return "+le).apply(n,F)});if(Oe.source=le,Id(Oe))throw Oe;return Oe}function WL(r){return Fe(r).toLowerCase()}function jL(r){return Fe(r).toUpperCase()}function UL(r,i,u){if(r=Fe(r),r&&(u||i===n))return Ov(r);if(!r||!(i=$t(i)))return r;var y=on(r),S=on(i),I=Pv(y,S),F=kv(y,S)+1;return mr(y,I,F).join("")}function GL(r,i,u){if(r=Fe(r),r&&(u||i===n))return r.slice(0,Rv(r)+1);if(!r||!(i=$t(i)))return r;var y=on(r),S=kv(y,on(i))+1;return mr(y,0,S).join("")}function YL(r,i,u){if(r=Fe(r),r&&(u||i===n))return r.replace(Wi,"");if(!r||!(i=$t(i)))return r;var y=on(r),S=Pv(y,on(i));return mr(y,S).join("")}function XL(r,i){var u=K,y=Z;if(Ke(i)){var S="separator"in i?i.separator:S;u="length"in i?Ie(i.length):u,y="omission"in i?$t(i.omission):y}r=Fe(r);var I=r.length;if(Ao(r)){var F=on(r);I=F.length}if(u>=I)return r;var j=u-Io(y);if(j<1)return y;var X=F?mr(F,0,j).join(""):r.slice(0,j);if(S===n)return X+y;if(F&&(j+=X.length-j),Od(S)){if(r.slice(j).search(S)){var oe,ie=X;for(S.global||(S=Gf(S.source,Fe(ji.exec(S))+"g")),S.lastIndex=0;oe=S.exec(ie);)var le=oe.index;X=X.slice(0,le===n?j:le)}}else if(r.indexOf($t(S),j)!=j){var he=X.lastIndexOf(S);he>-1&&(X=X.slice(0,he))}return X+y}function qL(r){return r=Fe(r),r&&of.test(r)?r.replace(Ba,Ek):r}var KL=Lo(function(r,i,u){return r+(u?" ":"")+i.toUpperCase()}),Md=_x("toUpperCase");function ww(r,i,u){return r=Fe(r),i=u?n:i,i===n?xk(r)?Tk(r):uk(r):r.match(i)||[]}var bw=ke(function(r,i){try{return Dt(r,n,i)}catch(u){return Id(u)?u:new Te(u)}}),ZL=Un(function(r,i){return Wt(i,function(u){u=Nn(u),Wn(r,u,Td(r[u],r))}),r});function QL(r){var i=r==null?0:r.length,u=Se();return r=i?Xe(r,function(y){if(typeof y[1]!="function")throw new jt(l);return[u(y[0]),y[1]]}):[],ke(function(y){for(var S=-1;++S<i;){var I=r[S];if(Dt(I[0],this,y))return Dt(I[1],this,y)}})}function JL(r){return EM(Gt(r,g))}function Rd(r){return function(){return r}}function e$(r,i){return r==null||r!==r?i:r}var t$=Ex(),n$=Ex(!0);function Tt(r){return r}function Dd(r){return ex(typeof r=="function"?r:Gt(r,g))}function r$(r){return nx(Gt(r,g))}function o$(r,i){return rx(r,Gt(i,g))}var i$=ke(function(r,i){return function(u){return ns(u,r,i)}}),s$=ke(function(r,i){return function(u){return ns(r,u,i)}});function Ld(r,i,u){var y=ct(i),S=wl(i,y);u==null&&!(Ke(i)&&(S.length||!y.length))&&(u=i,i=r,r=this,S=wl(i,ct(i)));var I=!(Ke(u)&&"chain"in u)||!!u.chain,F=Yn(r);return Wt(S,function(j){var X=i[j];r[j]=X,F&&(r.prototype[j]=function(){var oe=this.__chain__;if(I||oe){var ie=r(this.__wrapped__),le=ie.__actions__=Et(this.__actions__);return le.push({func:X,args:arguments,thisArg:r}),ie.__chain__=oe,ie}return X.apply(r,ur([this.value()],arguments))})}),r}function a$(){return ft._===this&&(ft._=Mk),this}function $d(){}function l$(r){return r=Ie(r),ke(function(i){return ox(i,r)})}var c$=pd(Xe),u$=pd(Cv),f$=pd(Ff);function _w(r){return bd(r)?Hf(Nn(r)):zM(r)}function d$(r){return function(i){return r==null?n:Vr(r,i)}}var h$=Nx(),p$=Nx(!0);function Bd(){return[]}function Fd(){return!1}function g$(){return{}}function m$(){return""}function y$(){return!0}function v$(r,i){if(r=Ie(r),r<1||r>P)return[];var u=G,y=gt(r,G);i=Se(i),r-=G;for(var S=Wf(y,i);++u<r;)i(u);return S}function x$(r){return Ae(r)?Xe(r,Nn):Bt(r)?[r]:Et(Vx(Fe(r)))}function w$(r){var i=++Pk;return Fe(r)+i}var b$=Nl(function(r,i){return r+i},0),_$=gd("ceil"),S$=Nl(function(r,i){return r/i},1),E$=gd("floor");function C$(r){return r&&r.length?xl(r,Tt,ed):n}function N$(r,i){return r&&r.length?xl(r,Se(i,2),ed):n}function T$(r){return Av(r,Tt)}function A$(r,i){return Av(r,Se(i,2))}function I$(r){return r&&r.length?xl(r,Tt,od):n}function O$(r,i){return r&&r.length?xl(r,Se(i,2),od):n}var P$=Nl(function(r,i){return r*i},1),k$=gd("round"),M$=Nl(function(r,i){return r-i},0);function R$(r){return r&&r.length?Vf(r,Tt):0}function D$(r,i){return r&&r.length?Vf(r,Se(i,2)):0}return A.after=r2,A.ary=Jx,A.assign=j2,A.assignIn=hw,A.assignInWith=Fl,A.assignWith=U2,A.at=G2,A.before=ew,A.bind=Td,A.bindAll=ZL,A.bindKey=tw,A.castArray=g2,A.chain=Kx,A.chunk=ER,A.compact=CR,A.concat=NR,A.cond=QL,A.conforms=JL,A.constant=Rd,A.countBy=RD,A.create=Y2,A.curry=nw,A.curryRight=rw,A.debounce=ow,A.defaults=X2,A.defaultsDeep=q2,A.defer=o2,A.delay=i2,A.difference=TR,A.differenceBy=AR,A.differenceWith=IR,A.drop=OR,A.dropRight=PR,A.dropRightWhile=kR,A.dropWhile=MR,A.fill=RR,A.filter=LD,A.flatMap=FD,A.flatMapDeep=HD,A.flatMapDepth=zD,A.flatten=Gx,A.flattenDeep=DR,A.flattenDepth=LR,A.flip=s2,A.flow=t$,A.flowRight=n$,A.fromPairs=$R,A.functions=nL,A.functionsIn=rL,A.groupBy=VD,A.initial=FR,A.intersection=HR,A.intersectionBy=zR,A.intersectionWith=VR,A.invert=iL,A.invertBy=sL,A.invokeMap=jD,A.iteratee=Dd,A.keyBy=UD,A.keys=ct,A.keysIn=Nt,A.map=Ml,A.mapKeys=lL,A.mapValues=cL,A.matches=r$,A.matchesProperty=o$,A.memoize=Dl,A.merge=uL,A.mergeWith=pw,A.method=i$,A.methodOf=s$,A.mixin=Ld,A.negate=Ll,A.nthArg=l$,A.omit=fL,A.omitBy=dL,A.once=a2,A.orderBy=GD,A.over=c$,A.overArgs=l2,A.overEvery=u$,A.overSome=f$,A.partial=Ad,A.partialRight=iw,A.partition=YD,A.pick=hL,A.pickBy=gw,A.property=_w,A.propertyOf=d$,A.pull=GR,A.pullAll=Xx,A.pullAllBy=YR,A.pullAllWith=XR,A.pullAt=qR,A.range=h$,A.rangeRight=p$,A.rearg=c2,A.reject=KD,A.remove=KR,A.rest=u2,A.reverse=Cd,A.sampleSize=QD,A.set=gL,A.setWith=mL,A.shuffle=JD,A.slice=ZR,A.sortBy=n2,A.sortedUniq=oD,A.sortedUniqBy=iD,A.split=FL,A.spread=f2,A.tail=sD,A.take=aD,A.takeRight=lD,A.takeRightWhile=cD,A.takeWhile=uD,A.tap=CD,A.throttle=d2,A.thru=kl,A.toArray=uw,A.toPairs=mw,A.toPairsIn=yw,A.toPath=x$,A.toPlainObject=dw,A.transform=yL,A.unary=h2,A.union=fD,A.unionBy=dD,A.unionWith=hD,A.uniq=pD,A.uniqBy=gD,A.uniqWith=mD,A.unset=vL,A.unzip=Nd,A.unzipWith=qx,A.update=xL,A.updateWith=wL,A.values=Fo,A.valuesIn=bL,A.without=yD,A.words=ww,A.wrap=p2,A.xor=vD,A.xorBy=xD,A.xorWith=wD,A.zip=bD,A.zipObject=_D,A.zipObjectDeep=SD,A.zipWith=ED,A.entries=mw,A.entriesIn=yw,A.extend=hw,A.extendWith=Fl,Ld(A,A),A.add=b$,A.attempt=bw,A.camelCase=CL,A.capitalize=vw,A.ceil=_$,A.clamp=_L,A.clone=m2,A.cloneDeep=v2,A.cloneDeepWith=x2,A.cloneWith=y2,A.conformsTo=w2,A.deburr=xw,A.defaultTo=e$,A.divide=S$,A.endsWith=NL,A.eq=an,A.escape=TL,A.escapeRegExp=AL,A.every=DD,A.find=$D,A.findIndex=jx,A.findKey=K2,A.findLast=BD,A.findLastIndex=Ux,A.findLastKey=Z2,A.floor=E$,A.forEach=Zx,A.forEachRight=Qx,A.forIn=Q2,A.forInRight=J2,A.forOwn=eL,A.forOwnRight=tL,A.get=Pd,A.gt=b2,A.gte=_2,A.has=oL,A.hasIn=kd,A.head=Yx,A.identity=Tt,A.includes=WD,A.indexOf=BR,A.inRange=SL,A.invoke=aL,A.isArguments=Ur,A.isArray=Ae,A.isArrayBuffer=S2,A.isArrayLike=Ct,A.isArrayLikeObject=et,A.isBoolean=E2,A.isBuffer=yr,A.isDate=C2,A.isElement=N2,A.isEmpty=T2,A.isEqual=A2,A.isEqualWith=I2,A.isError=Id,A.isFinite=O2,A.isFunction=Yn,A.isInteger=sw,A.isLength=$l,A.isMap=aw,A.isMatch=P2,A.isMatchWith=k2,A.isNaN=M2,A.isNative=R2,A.isNil=L2,A.isNull=D2,A.isNumber=lw,A.isObject=Ke,A.isObjectLike=Qe,A.isPlainObject=ls,A.isRegExp=Od,A.isSafeInteger=$2,A.isSet=cw,A.isString=Bl,A.isSymbol=Bt,A.isTypedArray=Bo,A.isUndefined=B2,A.isWeakMap=F2,A.isWeakSet=H2,A.join=WR,A.kebabCase=IL,A.last=Xt,A.lastIndexOf=jR,A.lowerCase=OL,A.lowerFirst=PL,A.lt=z2,A.lte=V2,A.max=C$,A.maxBy=N$,A.mean=T$,A.meanBy=A$,A.min=I$,A.minBy=O$,A.stubArray=Bd,A.stubFalse=Fd,A.stubObject=g$,A.stubString=m$,A.stubTrue=y$,A.multiply=P$,A.nth=UR,A.noConflict=a$,A.noop=$d,A.now=Rl,A.pad=kL,A.padEnd=ML,A.padStart=RL,A.parseInt=DL,A.random=EL,A.reduce=XD,A.reduceRight=qD,A.repeat=LL,A.replace=$L,A.result=pL,A.round=k$,A.runInContext=Y,A.sample=ZD,A.size=e2,A.snakeCase=BL,A.some=t2,A.sortedIndex=QR,A.sortedIndexBy=JR,A.sortedIndexOf=eD,A.sortedLastIndex=tD,A.sortedLastIndexBy=nD,A.sortedLastIndexOf=rD,A.startCase=HL,A.startsWith=zL,A.subtract=M$,A.sum=R$,A.sumBy=D$,A.template=VL,A.times=v$,A.toFinite=Xn,A.toInteger=Ie,A.toLength=fw,A.toLower=WL,A.toNumber=qt,A.toSafeInteger=W2,A.toString=Fe,A.toUpper=jL,A.trim=UL,A.trimEnd=GL,A.trimStart=YL,A.truncate=XL,A.unescape=qL,A.uniqueId=w$,A.upperCase=KL,A.upperFirst=Md,A.each=Zx,A.eachRight=Qx,A.first=Yx,Ld(A,function(){var r={};return En(A,function(i,u){He.call(A.prototype,u)||(r[u]=i)}),r}(),{chain:!1}),A.VERSION=o,Wt(["bind","bindKey","curry","curryRight","partial","partialRight"],function(r){A[r].placeholder=A}),Wt(["drop","take"],function(r,i){De.prototype[r]=function(u){u=u===n?1:lt(Ie(u),0);var y=this.__filtered__&&!i?new De(this):this.clone();return y.__filtered__?y.__takeCount__=gt(u,y.__takeCount__):y.__views__.push({size:gt(u,G),type:r+(y.__dir__<0?"Right":"")}),y},De.prototype[r+"Right"]=function(u){return this.reverse()[r](u).reverse()}}),Wt(["filter","map","takeWhile"],function(r,i){var u=i+1,y=u==C||u==B;De.prototype[r]=function(S){var I=this.clone();return I.__iteratees__.push({iteratee:Se(S,3),type:u}),I.__filtered__=I.__filtered__||y,I}}),Wt(["head","last"],function(r,i){var u="take"+(i?"Right":"");De.prototype[r]=function(){return this[u](1).value()[0]}}),Wt(["initial","tail"],function(r,i){var u="drop"+(i?"":"Right");De.prototype[r]=function(){return this.__filtered__?new De(this):this[u](1)}}),De.prototype.compact=function(){return this.filter(Tt)},De.prototype.find=function(r){return this.filter(r).head()},De.prototype.findLast=function(r){return this.reverse().find(r)},De.prototype.invokeMap=ke(function(r,i){return typeof r=="function"?new De(this):this.map(function(u){return ns(u,r,i)})}),De.prototype.reject=function(r){return this.filter(Ll(Se(r)))},De.prototype.slice=function(r,i){r=Ie(r);var u=this;return u.__filtered__&&(r>0||i<0)?new De(u):(r<0?u=u.takeRight(-r):r&&(u=u.drop(r)),i!==n&&(i=Ie(i),u=i<0?u.dropRight(-i):u.take(i-r)),u)},De.prototype.takeRightWhile=function(r){return this.reverse().takeWhile(r).reverse()},De.prototype.toArray=function(){return this.take(G)},En(De.prototype,function(r,i){var u=/^(?:filter|find|map|reject)|While$/.test(i),y=/^(?:head|last)$/.test(i),S=A[y?"take"+(i=="last"?"Right":""):i],I=y||/^find/.test(i);S&&(A.prototype[i]=function(){var F=this.__wrapped__,j=y?[1]:arguments,X=F instanceof De,oe=j[0],ie=X||Ae(F),le=function(Me){var $e=S.apply(A,ur([Me],j));return y&&he?$e[0]:$e};ie&&u&&typeof oe=="function"&&oe.length!=1&&(X=ie=!1);var he=this.__chain__,we=!!this.__actions__.length,Ee=I&&!he,Oe=X&&!we;if(!I&&ie){F=Oe?F:new De(this);var Ce=r.apply(F,j);return Ce.__actions__.push({func:kl,args:[le],thisArg:n}),new Ut(Ce,he)}return Ee&&Oe?r.apply(this,j):(Ce=this.thru(le),Ee?y?Ce.value()[0]:Ce.value():Ce)})}),Wt(["pop","push","shift","sort","splice","unshift"],function(r){var i=ol[r],u=/^(?:push|sort|unshift)$/.test(r)?"tap":"thru",y=/^(?:pop|shift)$/.test(r);A.prototype[r]=function(){var S=arguments;if(y&&!this.__chain__){var I=this.value();return i.apply(Ae(I)?I:[],S)}return this[u](function(F){return i.apply(Ae(F)?F:[],S)})}}),En(De.prototype,function(r,i){var u=A[i];if(u){var y=u.name+"";He.call(Mo,y)||(Mo[y]=[]),Mo[y].push({name:i,func:u})}}),Mo[Cl(n,_).name]=[{name:"wrapper",func:n}],De.prototype.clone=qk,De.prototype.reverse=Kk,De.prototype.value=Zk,A.prototype.at=ND,A.prototype.chain=TD,A.prototype.commit=AD,A.prototype.next=ID,A.prototype.plant=PD,A.prototype.reverse=kD,A.prototype.toJSON=A.prototype.valueOf=A.prototype.value=MD,A.prototype.first=A.prototype.head,qi&&(A.prototype[qi]=OD),A},Oo=Ak();$r?(($r.exports=Oo)._=Oo,Df._=Oo):ft._=Oo}).call(DT)}(bi,bi.exports)),bi.exports}var $T=LT();const BT=Vd($T);function Am(e,t,n=!0){let o;if(t?.handle){const{id:l,name:c,dataType:f,inferredDataType:d,...h}=t.handle;o=h}const s=(t?.handle?.inferredDataType||t?.handle?.dataType)&&!t?.resetInferredType?t?.handle?.inferredDataType||t?.handle?.dataType:void 0,a=BT.cloneDeep({inferredDataType:s,...t?.overrideDataType?{dataType:s}:{},...t?.handle?.dataType?.dataTypeObject&&t?.handle?.dataType?.dataTypeUniqueId&&o?o:{},...t?.overrideName&&t?.handle?.name?{name:t.handle.name}:{}});return n?(Object.assign(e,a),e):Yo(e,l=>(Object.assign(l,a),l))}function eu(e,t,n,o=!0){return o?Cm(e,s=>{s.dataType?.dataTypeUniqueId===t&&Am(s,n)}):Yo(e,s=>(Cm(s,a=>{a.dataType?.dataTypeUniqueId===t&&Am(a,n)}),s))}function FT(e,t,n,o,s,a,l,c,f){if(!a.sourceHandle||!a.targetHandle)return{validation:{isValid:!1,reason:"Source or target handle not found"}};const d=e.nodes[t].data,h=e.nodes[n].data,g=gn(o,d)?.value,p=gn(s,h)?.value,m=g?.dataType,x=p?.dataType,v=g?.inferredDataType,b=p?.inferredDataType,_=m?.dataTypeObject.underlyingType==="inferFromConnection",N=x?.dataTypeObject.underlyingType==="inferFromConnection";if(!m||!x)return{validation:{isValid:!1,reason:"Source or target handle data type not found"}};const w=!!l&&a.source===l,E=!!c&&a.target===c,O=e.openedNodeGroupStack?.[e.openedNodeGroupStack.length-1];if(!_&&!N)return{validation:{isValid:!0}};let k,M,D,V=!1,K=!1,Z=!1;if(_&&N){if(!v&&!b)return{validation:{isValid:!1,reason:"None of the handles are inferred, inference has no information to work with"}};if(v&&b)return{validation:{isValid:!0}};v?(k=n,M=x.dataTypeUniqueId,D=g,V=!1,K=E,Z=E):b&&(k=t,M=m.dataTypeUniqueId,D=p,V=!1,K=w,Z=w)}else if(_){if(v)return{validation:{isValid:!0}};k=t,M=m.dataTypeUniqueId,D=p,V=!1,K=w,Z=w}else if(N){if(b)return{validation:{isValid:!0}};k=n,M=x.dataTypeUniqueId,D=g,V=!1,K=E,Z=E}if(k===void 0||M===void 0||D===void 0)return{validation:{isValid:!1,reason:"Index of node to update, data type to infer for, or connected handle not found"}};eu(e.nodes[k].data,M,{handle:D,resetInferredType:V,overrideDataType:K,overrideName:Z});//!== is basically xor for boolean, we are checking if one is true and the other is false
87
+ if(O&&(_&&w)!==(N&&E)){const U=E?n:t,q=E?"input":"output",C=sa(e.dataTypes,e.nodes[U].data.nodeTypeUniqueId,e.typeOfNodes,{type:q,index1:0,index2:void 0}),H=E?p.name:g.name,B=E?p.inferredDataType?.dataTypeUniqueId:g.inferredDataType?.dataTypeUniqueId,R=E?p.inferredDataType?.dataTypeObject.allowInput:g.inferredDataType?.dataTypeObject.allowInput;if(!H||!B)return{validation:{isValid:!1,reason:"Handle to add name, data type, or allow input not found"}};if(!C)return{validation:{isValid:!1,reason:"New duplicate handle not found"}};Jc(e.nodes[U].data,{type:q,index1:-1,index2:void 0},0,C,!0,"after"),Mm(f,O.nodeType,{name:H,dataType:B,allowInput:R},{type:E?"output":"input",index1:-1,index2:void 0},"after")}return{validation:{isValid:!0}}}function HT(e,t,n,o,s,a){if(!a.sourceHandle||!a.targetHandle)return{validation:{isValid:!1,reason:"Source or target handle not found"}};const l=e.nodes[t].data,c=e.nodes[n].data,f=gn(o,l)?.value,d=gn(s,c)?.value,h=_i(f),g=_i(d);if(!h||!g)return{validation:{isValid:!1,reason:"Source or target handle data type not found"}};const p=h?.dataTypeObject.underlyingType==="complex",m=g?.dataTypeObject.underlyingType==="complex";return!p&&!m?{validation:{isValid:!0}}:p!==m?{validation:{isValid:!1,reason:"Can't connect complex types with non-complex types"}}:p&&m?h.dataTypeUniqueId===g.dataTypeUniqueId||JSON.stringify(h.dataTypeObject.complexSchema)===JSON.stringify(g.dataTypeObject.complexSchema)?{validation:{isValid:!0}}:{validation:{isValid:!1,reason:"Can't connect complex types with different types"}}:{validation:{isValid:!0}}}function zT(e,t,n,o,s,a){if(!a.sourceHandle||!a.targetHandle)return{validation:{isValid:!1,reason:"Source or target handle not found"}};const l=e.nodes[t].data,c=e.nodes[n].data,f=gn(o,l)?.value,d=gn(s,c)?.value,h=_i(f),g=_i(d);if(!h||!g)return{validation:{isValid:!1,reason:"Source or target handle data type not found"}};if(h.dataTypeUniqueId===g.dataTypeUniqueId)return{validation:{isValid:!0}};const m=e.allowedConversionsBetweenDataTypes?.[h.dataTypeUniqueId]?.[g.dataTypeUniqueId],x=h.dataTypeObject.underlyingType==="complex"&&g.dataTypeObject.underlyingType==="complex";return m||x&&e.allowConversionBetweenComplexTypesUnlessDisallowedByComplexTypeChecking?{validation:{isValid:!0}}:{validation:{isValid:!1,reason:`${h.dataTypeUniqueId} to ${g.dataTypeUniqueId} conversion is not allowed`}}}function VT(e,t,n,o,s,a){const l=e.nodes[t],c=e.nodes[n],f=gn(o,l.data)?.value,d=gn(s,c.data)?.value,h=f?.dataType,g=d?.dataType;if(!h||!g)return{updatedNodes:e.nodes,validation:{isValid:!1,reason:"Source or target handle data type not found"}};if(h.dataTypeObject.underlyingType!=="inferFromConnection"&&g.dataTypeObject.underlyingType!=="inferFromConnection")return{updatedNodes:e.nodes,validation:{isValid:!0}};let p=e.nodes;if(h.dataTypeObject.underlyingType==="inferFromConnection"){const m=Cc([l],e.edges),{inputsAndIndices:x,outputsAndIndices:v}=Dm(l.data),b={};for(const N of x)N.value.dataType?.dataTypeUniqueId===h.dataTypeUniqueId&&(b[N.value.id]=!0);for(const N of v)N.value.dataType?.dataTypeUniqueId===h.dataTypeUniqueId&&(b[N.value.id]=!0);let _=!1;for(const N of m)if(N.id!==a.id&&!(!N.sourceHandle||!N.targetHandle)){if(b[N.sourceHandle]){_=!0;break}if(b[N.targetHandle]){_=!0;break}}_||(p=[...p],p[t]={...p[t],data:eu(p[t].data,h.dataTypeUniqueId,{handle:sa(e.dataTypes,p[t].data.nodeTypeUniqueId,e.typeOfNodes,o),resetInferredType:!0})})}if(g.dataTypeObject.underlyingType==="inferFromConnection"){const m=Cc([c],e.edges),{inputsAndIndices:x,outputsAndIndices:v}=Dm(c.data),b={};for(const N of x)N.value.dataType?.dataTypeUniqueId===g.dataTypeUniqueId&&(b[N.value.id]=!0);for(const N of v)N.value.dataType?.dataTypeUniqueId===g.dataTypeUniqueId&&(b[N.value.id]=!0);let _=!1;for(const N of m)if(N.id!==a.id&&!(!N.sourceHandle||!N.targetHandle)){if(b[N.sourceHandle]){_=!0;break}if(b[N.targetHandle]){_=!0;break}}_||(p=[...p],p[n]={...p[n],data:eu(p[n].data,g.dataTypeUniqueId,{handle:sa(e.dataTypes,p[n].data.nodeTypeUniqueId,e.typeOfNodes,s),resetInferredType:!0})})}return{updatedNodes:p,validation:{isValid:!0}}}const WT=20;function Im(e,t,n,o,s,a,l,c){const f={id:un(WT),source:e,target:n,sourceHandle:t,targetHandle:o,type:"configurableEdge"};if(Wp(f,s.edges)===s.edges)return{validation:{isValid:!1,reason:"Edge already exists or was rejected by reactflow"}};if(!(s.enableTypeInference||s.enableComplexTypeChecking||s.allowedConversionsBetweenDataTypes))return s.edges.push(f),{validation:{isValid:!0}};const h=s.nodes.findIndex(_=>_.id===e),g=s.nodes.findIndex(_=>_.id===n);if(h===-1||g===-1)return{validation:{isValid:!1,reason:"Source or target node not found"}};const p=s.nodes[h],m=s.nodes[g],x=Rn(t,p.data)?.handleIndices,v=Rn(o,m.data)?.handleIndices;if(!x||!v)return{validation:{isValid:!1,reason:"Source or target handle not found"}};let b={isValid:!0};if(s.enableTypeInference){const{validation:_}=FT(s,h,g,x,v,f,a,l,c);b=_}if(s.enableComplexTypeChecking&&b.isValid){const{validation:_}=HT({...s,nodes:s.nodes},h,g,x,v,f);b=_}if(s.allowedConversionsBetweenDataTypes&&b.isValid){const{validation:_}=zT({...s,nodes:s.nodes},h,g,x,v,f);b=_}return s.edges.push(f),{validation:b}}function Om(e,t,n){if(gi([n],t.edges)===t.edges)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Edge already exists or was rejected by reactflow"}};if(!(t.enableTypeInference||t.enableComplexTypeChecking||t.allowedConversionsBetweenDataTypes))return{updatedNodes:t.nodes,updatedEdges:gi([n],t.edges),validation:{isValid:!0}};const s=t.nodes.findIndex(p=>p.id===e.source),a=t.nodes.findIndex(p=>p.id===e.target);if(s===-1||a===-1)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Source or target node not found"}};if(!e.sourceHandle||!e.targetHandle)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Source or target handle not found"}};const l=t.nodes[s],c=t.nodes[a],f=Rn(e.sourceHandle,l.data)?.handleIndices,d=Rn(e.targetHandle,c.data)?.handleIndices;if(!f||!d)return{updatedNodes:t.nodes,updatedEdges:t.edges,validation:{isValid:!1,reason:"Source or target handle not found"}};let h=t.nodes,g={isValid:!0};if(t.enableTypeInference){const{updatedNodes:p,validation:m}=VT(t,s,a,f,d,e);h=p,g=m}return{updatedNodes:h,updatedEdges:gi([n],t.edges),validation:g}}function _i(e){const t=e?.dataType,n=e?.inferredDataType;if(t)return t.dataTypeObject.underlyingType!=="inferFromConnection"?t:n||void 0}function Pm(e,t,n){const o=e.nodes.find(a=>a.id===n);if(!o)return!1;if(o.id===t)return!0;const s=(a,l=new Set)=>{if(l.has(a.id))return!1;l.add(a.id);for(const c of dE(a,e.nodes,e.edges))if(c.id===t||s(c,l))return!0;return!1};return s(o)}function km(e,t,n,o,s,a){const l=[],c=[];for(const f of t.nodes){if(f.data.nodeTypeUniqueId!==n){l.push(f);continue}Jc(f.data,s,0,tr(o,e),void 0,a),l.push(f)}for(const f of t.edges)c.push(f);return{...t,nodes:l,edges:c}}function Mm(e,t,n,o,s="before"){const a=e.typeOfNodes[t];if(!a)return e;Jc(a,o,0,n,void 0,s);const l=Kc(e,t);for(const d of l){const h=e.typeOfNodes[d];h&&h.subtree&&(e.typeOfNodes[d]={...h,subtree:{...h.subtree,...km(e.dataTypes,h.subtree,t,n,o,s)}})}const{nodes:c,edges:f}=km(e.dataTypes,{nodes:e.nodes,edges:e.edges},t,n,o,s);return{typeOfNodes:e.typeOfNodes,nodes:c,edges:f}}const Si=["newGroupInput","newGroupOutput"],Ei={[Si[0]]:Si[0],[Si[1]]:Si[1]},Ci=["groupInput","groupOutput"],Ni={[Ci[0]]:Ci[0],[Ci[1]]:Ci[1]},jT={[Ei.newGroupInput]:{name:"New Group Input",underlyingType:"inferFromConnection",color:"#333333"},[Ei.newGroupOutput]:{name:"New Group Output",underlyingType:"inferFromConnection",color:"#333333"}},UT={[Ni.groupInput]:{name:"Group Input",headerColor:"#1d1d1d",inputs:[],outputs:[{name:"",dataType:Ei.newGroupInput}]},[Ni.groupOutput]:{name:"Group Output",headerColor:"#1d1d1d",inputs:[{name:"",dataType:Ei.newGroupOutput}],outputs:[]}},Ti=20,rt=["ADD_NODE","ADD_NODE_AND_SELECT","UPDATE_NODE_BY_REACT_FLOW","UPDATE_EDGES_BY_REACT_FLOW","ADD_EDGE_BY_REACT_FLOW","UPDATE_INPUT_VALUE","OPEN_NODE_GROUP","CLOSE_NODE_GROUP","ADD_NODE_GROUP","SET_VIEWPORT"],st={[rt[0]]:rt[0],[rt[1]]:rt[1],[rt[2]]:rt[2],[rt[3]]:rt[3],[rt[4]]:rt[4],[rt[5]]:rt[5],[rt[6]]:rt[6],[rt[7]]:rt[7],[rt[8]]:rt[8],[rt[9]]:rt[9]};function Rm(e,t){return Yo(e,o=>{switch(t.type){case st.ADD_NODE:const s=t.payload.type,a=un(Ti),l=t.payload.position,c=xi(o.dataTypes,s,o.typeOfNodes,a,l);o=Or(o,[...Pt(o).nodes,c]);break;case st.ADD_NODE_AND_SELECT:const f=t.payload.type,d=un(Ti),h=t.payload.position,g=xi(o.dataTypes,f,o.typeOfNodes,d,h);o=Or(o,Pt(o).nodes.map(C=>({...C,selected:!1}))),o=Or(o,[...Pt(o).nodes,{...g,selected:!0}]);break;case st.UPDATE_NODE_BY_REACT_FLOW:const p=t.payload.changes;o=Or(o,Pg(p,Pt(o).nodes));break;case st.UPDATE_EDGES_BY_REACT_FLOW:const m=t.payload.changes;for(const C of m){if(C.type!=="remove"){o=Or(o,void 0,gi([C],Pt(o).edges));continue}const{id:H}=C,B=Pt(o).edges.find(P=>P.id===H);if(!B)continue;const R=Om(B,{...o,nodes:Pt(o).nodes,edges:Pt(o).edges},C);R.validation.isValid&&(o=Or(o,R.updatedNodes,R.updatedEdges))}break;case st.ADD_EDGE_BY_REACT_FLOW:const x=t.payload.edge,{sourceHandle:v,targetHandle:b,source:_,target:N}=x,w=Pt(o);if(o.enableCycleChecking&&Pm({...o,nodes:w.nodes,edges:w.edges},_,N)||!_||!N||!v||!b)break;const E=Pt(o);if(!Im(_,v,N,b,{...o,nodes:E.nodes,edges:E.edges},E.inputNodeId,E.outputNodeId,o).validation.isValid)break;break;case st.OPEN_NODE_GROUP:if("nodeId"in t.payload){const C=t.payload.nodeId,H=Pt(o).nodes.find(P=>P.id===C);if(!H)break;const B=H.data.nodeTypeUniqueId;if(!B)break;const R=o.typeOfNodes[B];if(!R||!R.subtree)break;o.openedNodeGroupStack=[...o.openedNodeGroupStack||[],{nodeType:B,nodeId:C,previousViewport:o.viewport}]}else{const C=t.payload.nodeType,H=o.typeOfNodes[C];if(!H||!H.subtree)break;o.openedNodeGroupStack=[{nodeType:C,previousViewport:o.openedNodeGroupStack?.[0]?.previousViewport||o.viewport}]}o.viewport=void 0;break;case st.CLOSE_NODE_GROUP:const k=o.openedNodeGroupStack?.[o.openedNodeGroupStack.length-1];k&&"previousViewport"in k&&(o.viewport=k.previousViewport),o.openedNodeGroupStack=o.openedNodeGroupStack?.slice(0,-1);break;case st.ADD_NODE_GROUP:const M=un(Ti),D=un(Ti),V=xi(o.dataTypes,Ni.groupInput,o.typeOfNodes,D,{x:-500,y:0}),K=un(Ti),Z=xi(o.dataTypes,Ni.groupOutput,o.typeOfNodes,K,{x:500,y:0}),q={name:"Node Group "+(Object.keys(o.typeOfNodes).filter(C=>o.typeOfNodes[C].subtree).length+1).toString(),headerColor:"#344621",inputs:[],outputs:[],subtree:{nodes:[V,Z],edges:[],numberOfReferences:0,inputNodeId:D,outputNodeId:K}};o.typeOfNodes[M]=q,o.openedNodeGroupStack=[{nodeType:M,previousViewport:o.openedNodeGroupStack?.[0]?.previousViewport||o.viewport}],o.viewport=void 0;break;case st.SET_VIEWPORT:o.viewport=t.payload.viewport;break}})}function Rn(e,t,n=!0,o=!0){if(n){const s=t?.inputs instanceof Array?t?.inputs:[],l=Pr(s,"input").find(({value:c})=>c?.id===e);if(l)return l}if(o){const s=t?.outputs instanceof Array?t?.outputs:[],l=Pr(s,"output").find(({value:c})=>c?.id===e);if(l)return l}}function gn(e,t){if(!e)return;const n=e.type==="input"?t.inputs:t.outputs;if(!n)return;const s=Pr(n,e.type,{index1:e.index1,index2:e.index2}).next();return s.value&&s.value.handleIndices.index1===e.index1&&s.value.handleIndices.index2===e.index2?s.value:{value:void 0,handleIndices:e,parentArray:n,parentArrayIndex:s.value.parentArrayIndex}}function Dm(e,t=!0,n=!0){let o=[],s=[];return t&&e.inputs&&(o=Array.from(Pr(e.inputs,"input"))),n&&e.outputs&&(s=Array.from(Pr(e.outputs,"output"))),{inputsAndIndices:o,outputsAndIndices:s}}const tu=z.forwardRef(({id:e,sourceX:t,sourceY:n,targetX:o,targetY:s,sourcePosition:a,targetPosition:l,...c},f)=>{const[d]=qs({sourceX:t,sourceY:n,sourcePosition:a,targetX:o,targetY:s,targetPosition:l}),h=je(),[g,p]=z.useState(!0),m=z.useRef(null);z.useEffect(()=>{const M=h.getState().domNode;if(!M)return;const D=document.getElementById(e);if(!D)return;const V=new IntersectionObserver(K=>{const Z=K.find(U=>U.target.id===e);Z&&p(U=>Z.isIntersecting)},{root:M,threshold:1,rootMargin:"20px"});return V.observe(D),m.current=V,()=>{m.current&&(m.current.disconnect(),m.current=null)}},[h.getState().domNode]);const x=Yc(c.source||""),v=z.useMemo(()=>!c.source||!x?void 0:Rn(c.sourceHandleId||"",x?.data)?.value?.handleColor??"#A1A1A1",[c.source,x]),b=Yc(c.target||""),_=z.useMemo(()=>!c.target||!b?void 0:Rn(c.targetHandleId||"",b?.data)?.value?.handleColor??"#A1A1A1",[c.target,b]),{label:N,labelStyle:w,markerStart:E,markerEnd:O,interactionWidth:k}=c;return T.jsxs(T.Fragment,{children:[T.jsx("defs",{children:T.jsxs("linearGradient",{id:`linear-gradient-edge-${e}`,x1:t,y1:n,x2:o,y2:s,gradientUnits:"userSpaceOnUse",children:[T.jsx("stop",{stopColor:v,offset:"0"}),T.jsx("stop",{stopColor:_,offset:"1"})]})}),T.jsx(co,{id:e,path:d,label:N,labelStyle:w,markerEnd:O,markerStart:E,interactionWidth:k,className:Ne("!stroke-7 in-[g.selected]:brightness-150",!g&&"opacity-25"),style:{stroke:`url(#${`linear-gradient-edge-${e}`})`},focusable:!0})]})});tu.displayName="ConfigurableEdge";function Lm(e,t,n=!0,o=!1){const s=e!==null?"current"in e?e.current:e:null,a=z.useCallback(l=>{if(!s)return;let c=!0;if(n&&l.target instanceof Node&&!s.contains(l.target))c=!1;else if(o){const f="clientX"in l?{x:l.clientX,y:l.clientY}:{x:l.touches[0].clientX,y:l.touches[0].clientY},d=s.getBoundingClientRect();dh(f,d)||(c=!1)}c||t()},[s,t,n,o]);z.useEffect(()=>(document.addEventListener("mousedown",a),document.addEventListener("touchstart",a),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("touchstart",a)}),[s,a])}const Ai=z.forwardRef(({placeholder:e="Input",className:t,...n},o)=>{const s=z.useMemo(()=>n.allowOnlyNumbers&&n.value!==void 0?Yl(n.value,n.numberOfDecimals??5):n.value?.toString(),[n.value,n.allowOnlyNumbers,n.numberOfDecimals]),[a,l]=z.useState(s??""),[c,f]=z.useState(null),d=n.value??a,[h,g]=z.useState(d.toString());function p(x){n.allowOnlyNumbers&&/[^0-9\.\-]/.test(x)||g(x)}function m(){if(n.allowOnlyNumbers){const x=hh(h||d.toString()),v=Yl(x,n.numberOfDecimals??5);l(v),n.onChange?.(x),g(v)}else l(h),n.onChange?.(h),g(h)}return Lm(c,()=>m()),T.jsx("input",{type:"text",className:Ne("h-[44px] rounded-md text-primary-white bg-primary-black font-main px-4 text-[27px] leading-[27px] outline-none focus-visible:!outline-none border-secondary-dark-gray border w-max min-w-0 placeholder:text-[#6B6B6B]",t),placeholder:e,size:5,ref:x=>{f(x),typeof o=="function"?o(x):o&&(o.current=x)},value:h,onChange:x=>p(x.target.value),onKeyDown:x=>{x.key==="Enter"&&m()},onMouseMove:x=>{x.preventDefault(),x.stopPropagation()},onBlur:x=>{x.preventDefault(),x.stopPropagation(),m()}})});Ai.displayName="Input";function $m({nodeId:e,isVisible:t=!0,handleClassName:n,handleStyle:o,lineClassName:s,lineStyle:a,color:l,minWidth:c=10,minHeight:f=10,maxWidth:d=Number.MAX_VALUE,maxHeight:h=Number.MAX_VALUE,keepAspectRatio:g=!1,autoScale:p=!0,shouldResize:m,onResizeStart:x,onResize:v,onResizeEnd:b,linePosition:_=["left","right"],handlePosition:N=[],resizeDirection:w="horizontal"}){return t?T.jsxs(T.Fragment,{children:[_.map(E=>T.jsx(bm,{className:Ne("!border-none",E==="left"||E==="right"?"!w-4":"!h-4",s),style:a,nodeId:e,position:E,variant:Ar.Line,color:l,minWidth:c,minHeight:f,maxWidth:d,maxHeight:h,onResizeStart:x,keepAspectRatio:g,autoScale:p,shouldResize:m,onResize:v,onResizeEnd:b,resizeDirection:w},E)),N.map(E=>T.jsx(bm,{className:n,style:o,nodeId:e,position:E,color:l,minWidth:c,minHeight:f,maxWidth:d,maxHeight:h,onResizeStart:x,keepAspectRatio:g,autoScale:p,shouldResize:m,onResize:v,onResizeEnd:b,resizeDirection:w},E))]}):null}/**
61
88
  * @license lucide-react v0.542.0 - ISC
62
89
  *
63
90
  * This source code is licensed under the ISC license.
64
91
  * See the LICENSE file in the root directory of this source tree.
65
- */const nx=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ox=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase()),Sl=e=>{const t=ox(e);return t.charAt(0).toUpperCase()+t.slice(1)},Cl=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim(),rx=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
92
+ */const GT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),YT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,o)=>o?o.toUpperCase():n.toLowerCase()),Bm=e=>{const t=YT(e);return t.charAt(0).toUpperCase()+t.slice(1)},Fm=(...e)=>e.filter((t,n,o)=>!!t&&t.trim()!==""&&o.indexOf(t)===n).join(" ").trim(),XT=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
66
93
  * @license lucide-react v0.542.0 - ISC
67
94
  *
68
95
  * This source code is licensed under the ISC license.
69
96
  * See the LICENSE file in the root directory of this source tree.
70
- */var ix={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
97
+ */var qT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
71
98
  * @license lucide-react v0.542.0 - ISC
72
99
  *
73
100
  * This source code is licensed under the ISC license.
74
101
  * See the LICENSE file in the root directory of this source tree.
75
- */const sx=O.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:r="",children:i,iconNode:s,...a},c)=>O.createElement("svg",{ref:c,...ix,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:Cl("lucide",r),...!i&&!rx(a)&&{"aria-hidden":"true"},...a},[...s.map(([l,u])=>O.createElement(l,u)),...Array.isArray(i)?i:[i]]));/**
102
+ */const KT=z.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:o,className:s="",children:a,iconNode:l,...c},f)=>z.createElement("svg",{ref:f,...qT,width:t,height:t,stroke:e,strokeWidth:o?Number(n)*24/Number(t):n,className:Fm("lucide",s),...!a&&!XT(c)&&{"aria-hidden":"true"},...c},[...l.map(([d,h])=>z.createElement(d,h)),...Array.isArray(a)?a:[a]]));/**
76
103
  * @license lucide-react v0.542.0 - ISC
77
104
  *
78
105
  * This source code is licensed under the ISC license.
79
106
  * See the LICENSE file in the root directory of this source tree.
80
- */const Cn=(e,t)=>{const n=O.forwardRef(({className:o,...r},i)=>O.createElement(sx,{ref:i,iconNode:t,className:Cl(`lucide-${nx(Sl(e))}`,`lucide-${e}`,o),...r}));return n.displayName=Sl(e),n};/**
107
+ */const nr=(e,t)=>{const n=z.forwardRef(({className:o,...s},a)=>z.createElement(KT,{ref:a,iconNode:t,className:Fm(`lucide-${GT(Bm(e))}`,`lucide-${e}`,o),...s}));return n.displayName=Bm(e),n};/**
81
108
  * @license lucide-react v0.542.0 - ISC
82
109
  *
83
110
  * This source code is licensed under the ISC license.
84
111
  * See the LICENSE file in the root directory of this source tree.
85
- */const ax=Cn("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
112
+ */const ZT=nr("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
86
113
  * @license lucide-react v0.542.0 - ISC
87
114
  *
88
115
  * This source code is licensed under the ISC license.
89
116
  * See the LICENSE file in the root directory of this source tree.
90
- */const cx=Cn("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
117
+ */const QT=nr("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
91
118
  * @license lucide-react v0.542.0 - ISC
92
119
  *
93
120
  * This source code is licensed under the ISC license.
94
121
  * See the LICENSE file in the root directory of this source tree.
95
- */const Nl=Cn("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
122
+ */const aa=nr("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
96
123
  * @license lucide-react v0.542.0 - ISC
97
124
  *
98
125
  * This source code is licensed under the ISC license.
99
126
  * See the LICENSE file in the root directory of this source tree.
100
- */const lx=Cn("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
127
+ */const Hm=nr("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
101
128
  * @license lucide-react v0.542.0 - ISC
102
129
  *
103
130
  * This source code is licensed under the ISC license.
104
131
  * See the LICENSE file in the root directory of this source tree.
105
- */const ux=Cn("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),Mo=O.forwardRef(({name:e="Input",value:t,onChange:n=()=>{},className:o,min:r,max:i,step:s},a)=>{const[c,l]=O.useState(t??0),[u,h]=O.useState(!1),d=O.useRef(0),f=O.useRef(0),p=t??c,g=O.useRef(0);O.useEffect(()=>{g.current=Math.abs(s??parseFloat(i===void 0||r===void 0?(p||1).toString():(i-r).toString()))},[p,s,i,r]);const{isDragging:x,dragRef:b}=_l({onMove:(H,j,R,$,y)=>{const A=H/(y+60);d.current+=A,Math.abs(d.current)>.05&&Date.now()-f.current>50&&(f.current=Date.now(),v(g.current*d.current),d.current=0)},onClick:k,clickThreshold:2});function v(H){l(j=>{let R=j+H;return r!==void 0&&R<=r?R=r:i!==void 0&&R>=i&&(R=i),n(R),R})}function m(H=.1){v(g.current*H)}function w(H=.1){v(-g.current*H)}function k(){h(!0)}function N(H){v(H-p),h(!1)}const P=x,M=r!==void 0&&i!==void 0&&p!==void 0&&i!==r?(p-r)/(i-r)*100:-1,L=M!==-1?`linear-gradient(90deg,#4772b3 ${M}%, #545454 ${M}%)`:"";return u?C.jsx(Sn,{className:"w-full",placeholder:e,value:p,allowOnlyNumbers:!0,onChange:H=>N(H),ref:a}):C.jsxs("div",{className:se("flex items-center gap-0 group/lightParentGroupBasedHover w-max rounded-md bg-primary-gray",o),style:L!==""?{background:L}:{},ref:a,children:[C.jsx(vt,{color:"lightParentGroupBasedHover",className:"h-[44px] rounded-r-none w-[30px] p-0 shrink-0 bg-transparent",onClick:()=>w(.1),"aria-label":`Decrement ${e}`,applyHoverStyles:!P,children:C.jsx(cx,{})}),C.jsxs(vt,{color:"lightParentGroupBasedHover",className:"h-[44px] rounded-none pl-1.5 pr-0 flex-1 justify-between grid grid-cols-[repeat(2,auto)] bg-transparent",applyHoverStyles:!P,ref:b,children:[C.jsx("span",{className:"truncate text-left",children:e}),C.jsx("span",{className:"truncate",children:p.toFixed(4)})]}),C.jsx(vt,{color:"lightParentGroupBasedHover",className:"h-[44px] rounded-l-none w-[30px] p-0 shrink-0 bg-transparent",onClick:()=>m(.1),"aria-label":`Increment ${e}`,applyHoverStyles:!P,children:C.jsx(Nl,{})})]})});Mo.displayName="SliderNumberInput";function Ao(){return typeof window<"u"}function Ht(e){return kl(e)?(e.nodeName||"").toLowerCase():"#document"}function Ee(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function He(e){var t;return(t=(kl(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function kl(e){return Ao()?e instanceof Node||e instanceof Ee(e).Node:!1}function le(e){return Ao()?e instanceof Element||e instanceof Ee(e).Element:!1}function Pe(e){return Ao()?e instanceof HTMLElement||e instanceof Ee(e).HTMLElement:!1}function Po(e){return!Ao()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Ee(e).ShadowRoot}const dx=new Set(["inline","contents"]);function Nn(e){const{overflow:t,overflowX:n,overflowY:o,display:r}=Ce(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!dx.has(r)}const fx=new Set(["table","td","th"]);function hx(e){return fx.has(Ht(e))}const px=[":popover-open",":modal"];function Io(e){return px.some(t=>{try{return e.matches(t)}catch{return!1}})}const gx=["transform","translate","scale","rotate","perspective"],mx=["transform","translate","scale","rotate","perspective","filter"],yx=["paint","layout","strict","content"];function hi(e){const t=Oo(),n=le(e)?Ce(e):e;return gx.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||mx.some(o=>(n.willChange||"").includes(o))||yx.some(o=>(n.contain||"").includes(o))}function xx(e){let t=Ge(e);for(;Pe(t)&&!Ue(t);){if(hi(t))return t;if(Io(t))return null;t=Ge(t)}return null}function Oo(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const wx=new Set(["html","body","#document"]);function Ue(e){return wx.has(Ht(e))}function Ce(e){return Ee(e).getComputedStyle(e)}function Do(e){return le(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ge(e){if(Ht(e)==="html")return e;const t=e.assignedSlot||e.parentNode||Po(e)&&e.host||He(e);return Po(t)?t.host:t}function Tl(e){const t=Ge(e);return Ue(t)?e.ownerDocument?e.ownerDocument.body:e.body:Pe(t)&&Nn(t)?t:Tl(t)}function et(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const r=Tl(e),i=r===((o=e.ownerDocument)==null?void 0:o.body),s=Ee(r);if(i){const a=pi(s);return t.concat(s,s.visualViewport||[],Nn(r)?r:[],a&&n?et(a):[])}return t.concat(r,et(r,[],n))}function pi(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const Ro=Math.min,gt=Math.max,Lo=Math.round,$o=Math.floor,je=e=>({x:e,y:e}),bx={left:"right",right:"left",bottom:"top",top:"bottom"},vx={start:"end",end:"start"};function Ml(e,t,n){return gt(e,Ro(t,n))}function zo(e,t){return typeof e=="function"?e(t):e}function mt(e){return e.split("-")[0]}function Ho(e){return e.split("-")[1]}function Al(e){return e==="x"?"y":"x"}function Pl(e){return e==="y"?"height":"width"}const Ex=new Set(["top","bottom"]);function tt(e){return Ex.has(mt(e))?"y":"x"}function Il(e){return Al(tt(e))}function _x(e,t,n){n===void 0&&(n=!1);const o=Ho(e),r=Il(e),i=Pl(r);let s=r==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=jo(s)),[s,jo(s)]}function Sx(e){const t=jo(e);return[gi(e),t,gi(t)]}function gi(e){return e.replace(/start|end/g,t=>vx[t])}const Ol=["left","right"],Dl=["right","left"],Cx=["top","bottom"],Nx=["bottom","top"];function kx(e,t,n){switch(e){case"top":case"bottom":return n?t?Dl:Ol:t?Ol:Dl;case"left":case"right":return t?Cx:Nx;default:return[]}}function Tx(e,t,n,o){const r=Ho(e);let i=kx(mt(e),n==="start",o);return r&&(i=i.map(s=>s+"-"+r),t&&(i=i.concat(i.map(gi)))),i}function jo(e){return e.replace(/left|right|bottom|top/g,t=>bx[t])}function Mx(e){return{top:0,right:0,bottom:0,left:0,...e}}function Ax(e){return typeof e!="number"?Mx(e):{top:e,right:e,bottom:e,left:e}}function Vo(e){const{x:t,y:n,width:o,height:r}=e;return{width:o,height:r,top:n,left:t,right:t+o,bottom:n+r,x:t,y:n}}function mi(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Po(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function kn(e){return"composedPath"in e?e.composedPath()[0]:e.target}function yi(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function Px(e){return e.matches("html,body")}function jt(e){return e?.ownerDocument||document}function Fo(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var i;return r.parentId===t&&(!n||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...Fo(e,r.id,n)])}function Ix(e){return"nativeEvent"in e}function xi(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var Ox=typeof document<"u",Dx=function(){},Vt=Ox?O.useLayoutEffect:Dx;const Rx={...U};function Bo(e){const t=U.useRef(e);return Vt(()=>{t.current=e}),t}const Lx=Rx.useInsertionEffect||(e=>e());function Ve(e){const t=U.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return Lx(()=>{t.current=e}),U.useCallback(function(){for(var n=arguments.length,o=new Array(n),r=0;r<n;r++)o[r]=arguments[r];return t.current==null?void 0:t.current(...o)},[])}function Rl(e,t,n){let{reference:o,floating:r}=e;const i=tt(t),s=Il(t),a=Pl(s),c=mt(t),l=i==="y",u=o.x+o.width/2-r.width/2,h=o.y+o.height/2-r.height/2,d=o[a]/2-r[a]/2;let f;switch(c){case"top":f={x:u,y:o.y-r.height};break;case"bottom":f={x:u,y:o.y+o.height};break;case"right":f={x:o.x+o.width,y:h};break;case"left":f={x:o.x-r.width,y:h};break;default:f={x:o.x,y:o.y}}switch(Ho(t)){case"start":f[s]-=d*(n&&l?-1:1);break;case"end":f[s]+=d*(n&&l?-1:1);break}return f}const $x=async(e,t,n)=>{const{placement:o="bottom",strategy:r="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),c=await(s.isRTL==null?void 0:s.isRTL(t));let l=await s.getElementRects({reference:e,floating:t,strategy:r}),{x:u,y:h}=Rl(l,o,c),d=o,f={},p=0;for(let g=0;g<a.length;g++){const{name:x,fn:b}=a[g],{x:v,y:m,data:w,reset:k}=await b({x:u,y:h,initialPlacement:o,placement:d,strategy:r,middlewareData:f,rects:l,platform:s,elements:{reference:e,floating:t}});u=v??u,h=m??h,f={...f,[x]:{...f[x],...w}},k&&p<=50&&(p++,typeof k=="object"&&(k.placement&&(d=k.placement),k.rects&&(l=k.rects===!0?await s.getElementRects({reference:e,floating:t,strategy:r}):k.rects),{x:u,y:h}=Rl(l,d,c)),g=-1)}return{x:u,y:h,placement:d,strategy:r,middlewareData:f}};async function Ll(e,t){var n;t===void 0&&(t={});const{x:o,y:r,platform:i,rects:s,elements:a,strategy:c}=e,{boundary:l="clippingAncestors",rootBoundary:u="viewport",elementContext:h="floating",altBoundary:d=!1,padding:f=0}=zo(t,e),p=Ax(f),x=a[d?h==="floating"?"reference":"floating":h],b=Vo(await i.getClippingRect({element:(n=await(i.isElement==null?void 0:i.isElement(x)))==null||n?x:x.contextElement||await(i.getDocumentElement==null?void 0:i.getDocumentElement(a.floating)),boundary:l,rootBoundary:u,strategy:c})),v=h==="floating"?{x:o,y:r,width:s.floating.width,height:s.floating.height}:s.reference,m=await(i.getOffsetParent==null?void 0:i.getOffsetParent(a.floating)),w=await(i.isElement==null?void 0:i.isElement(m))?await(i.getScale==null?void 0:i.getScale(m))||{x:1,y:1}:{x:1,y:1},k=Vo(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:v,offsetParent:m,strategy:c}):v);return{top:(b.top-k.top+p.top)/w.y,bottom:(k.bottom-b.bottom+p.bottom)/w.y,left:(b.left-k.left+p.left)/w.x,right:(k.right-b.right+p.right)/w.x}}const zx=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:r,middlewareData:i,rects:s,initialPlacement:a,platform:c,elements:l}=t,{mainAxis:u=!0,crossAxis:h=!0,fallbackPlacements:d,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:p="none",flipAlignment:g=!0,...x}=zo(e,t);if((n=i.arrow)!=null&&n.alignmentOffset)return{};const b=mt(r),v=tt(a),m=mt(a)===a,w=await(c.isRTL==null?void 0:c.isRTL(l.floating)),k=d||(m||!g?[jo(a)]:Sx(a)),N=p!=="none";!d&&N&&k.push(...Tx(a,g,p,w));const P=[a,...k],M=await Ll(t,x),L=[];let H=((o=i.flip)==null?void 0:o.overflows)||[];if(u&&L.push(M[b]),h){const y=_x(r,s,w);L.push(M[y[0]],M[y[1]])}if(H=[...H,{placement:r,overflows:L}],!L.every(y=>y<=0)){var j,R;const y=(((j=i.flip)==null?void 0:j.index)||0)+1,A=P[y];if(A&&(!(h==="alignment"?v!==tt(A):!1)||H.every(E=>tt(E.placement)===v?E.overflows[0]>0:!0)))return{data:{index:y,overflows:H},reset:{placement:A}};let T=(R=H.filter(S=>S.overflows[0]<=0).sort((S,E)=>S.overflows[1]-E.overflows[1])[0])==null?void 0:R.placement;if(!T)switch(f){case"bestFit":{var $;const S=($=H.filter(E=>{if(N){const I=tt(E.placement);return I===v||I==="y"}return!0}).map(E=>[E.placement,E.overflows.filter(I=>I>0).reduce((I,_)=>I+_,0)]).sort((E,I)=>E[1]-I[1])[0])==null?void 0:$[0];S&&(T=S);break}case"initialPlacement":T=a;break}if(r!==T)return{reset:{placement:T}}}return{}}}},Hx=new Set(["left","top"]);async function jx(e,t){const{placement:n,platform:o,elements:r}=e,i=await(o.isRTL==null?void 0:o.isRTL(r.floating)),s=mt(n),a=Ho(n),c=tt(n)==="y",l=Hx.has(s)?-1:1,u=i&&c?-1:1,h=zo(t,e);let{mainAxis:d,crossAxis:f,alignmentAxis:p}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof p=="number"&&(f=a==="end"?p*-1:p),c?{x:f*u,y:d*l}:{x:d*l,y:f*u}}const Vx=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:r,y:i,placement:s,middlewareData:a}=t,c=await jx(t,e);return s===((n=a.offset)==null?void 0:n.placement)&&(o=a.arrow)!=null&&o.alignmentOffset?{}:{x:r+c.x,y:i+c.y,data:{...c,placement:s}}}}},Fx=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:r}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:x=>{let{x:b,y:v}=x;return{x:b,y:v}}},...c}=zo(e,t),l={x:n,y:o},u=await Ll(t,c),h=tt(mt(r)),d=Al(h);let f=l[d],p=l[h];if(i){const x=d==="y"?"top":"left",b=d==="y"?"bottom":"right",v=f+u[x],m=f-u[b];f=Ml(v,f,m)}if(s){const x=h==="y"?"top":"left",b=h==="y"?"bottom":"right",v=p+u[x],m=p-u[b];p=Ml(v,p,m)}const g=a.fn({...t,[d]:f,[h]:p});return{...g,data:{x:g.x-n,y:g.y-o,enabled:{[d]:i,[h]:s}}}}}};function $l(e){const t=Ce(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const r=Pe(e),i=r?e.offsetWidth:n,s=r?e.offsetHeight:o,a=Lo(n)!==i||Lo(o)!==s;return a&&(n=i,o=s),{width:n,height:o,$:a}}function wi(e){return le(e)?e:e.contextElement}function Ft(e){const t=wi(e);if(!Pe(t))return je(1);const n=t.getBoundingClientRect(),{width:o,height:r,$:i}=$l(t);let s=(i?Lo(n.width):n.width)/o,a=(i?Lo(n.height):n.height)/r;return(!s||!Number.isFinite(s))&&(s=1),(!a||!Number.isFinite(a))&&(a=1),{x:s,y:a}}const Bx=je(0);function zl(e){const t=Ee(e);return!Oo()||!t.visualViewport?Bx:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function Wx(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Ee(e)?!1:t}function yt(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const r=e.getBoundingClientRect(),i=wi(e);let s=je(1);t&&(o?le(o)&&(s=Ft(o)):s=Ft(e));const a=Wx(i,n,o)?zl(i):je(0);let c=(r.left+a.x)/s.x,l=(r.top+a.y)/s.y,u=r.width/s.x,h=r.height/s.y;if(i){const d=Ee(i),f=o&&le(o)?Ee(o):o;let p=d,g=pi(p);for(;g&&o&&f!==p;){const x=Ft(g),b=g.getBoundingClientRect(),v=Ce(g),m=b.left+(g.clientLeft+parseFloat(v.paddingLeft))*x.x,w=b.top+(g.clientTop+parseFloat(v.paddingTop))*x.y;c*=x.x,l*=x.y,u*=x.x,h*=x.y,c+=m,l+=w,p=Ee(g),g=pi(p)}}return Vo({width:u,height:h,x:c,y:l})}function Wo(e,t){const n=Do(e).scrollLeft;return t?t.left+n:yt(He(e)).left+n}function Hl(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-Wo(e,n),r=n.top+t.scrollTop;return{x:o,y:r}}function Yx(e){let{elements:t,rect:n,offsetParent:o,strategy:r}=e;const i=r==="fixed",s=He(o),a=t?Io(t.floating):!1;if(o===s||a&&i)return n;let c={scrollLeft:0,scrollTop:0},l=je(1);const u=je(0),h=Pe(o);if((h||!h&&!i)&&((Ht(o)!=="body"||Nn(s))&&(c=Do(o)),Pe(o))){const f=yt(o);l=Ft(o),u.x=f.x+o.clientLeft,u.y=f.y+o.clientTop}const d=s&&!h&&!i?Hl(s,c):je(0);return{width:n.width*l.x,height:n.height*l.y,x:n.x*l.x-c.scrollLeft*l.x+u.x+d.x,y:n.y*l.y-c.scrollTop*l.y+u.y+d.y}}function Xx(e){return Array.from(e.getClientRects())}function Ux(e){const t=He(e),n=Do(e),o=e.ownerDocument.body,r=gt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),i=gt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let s=-n.scrollLeft+Wo(e);const a=-n.scrollTop;return Ce(o).direction==="rtl"&&(s+=gt(t.clientWidth,o.clientWidth)-r),{width:r,height:i,x:s,y:a}}const jl=25;function Gx(e,t){const n=Ee(e),o=He(e),r=n.visualViewport;let i=o.clientWidth,s=o.clientHeight,a=0,c=0;if(r){i=r.width,s=r.height;const u=Oo();(!u||u&&t==="fixed")&&(a=r.offsetLeft,c=r.offsetTop)}const l=Wo(o);if(l<=0){const u=o.ownerDocument,h=u.body,d=getComputedStyle(h),f=u.compatMode==="CSS1Compat"&&parseFloat(d.marginLeft)+parseFloat(d.marginRight)||0,p=Math.abs(o.clientWidth-h.clientWidth-f);p<=jl&&(i-=p)}else l<=jl&&(i+=l);return{width:i,height:s,x:a,y:c}}const qx=new Set(["absolute","fixed"]);function Zx(e,t){const n=yt(e,!0,t==="fixed"),o=n.top+e.clientTop,r=n.left+e.clientLeft,i=Pe(e)?Ft(e):je(1),s=e.clientWidth*i.x,a=e.clientHeight*i.y,c=r*i.x,l=o*i.y;return{width:s,height:a,x:c,y:l}}function Vl(e,t,n){let o;if(t==="viewport")o=Gx(e,n);else if(t==="document")o=Ux(He(e));else if(le(t))o=Zx(t,n);else{const r=zl(e);o={x:t.x-r.x,y:t.y-r.y,width:t.width,height:t.height}}return Vo(o)}function Fl(e,t){const n=Ge(e);return n===t||!le(n)||Ue(n)?!1:Ce(n).position==="fixed"||Fl(n,t)}function Kx(e,t){const n=t.get(e);if(n)return n;let o=et(e,[],!1).filter(a=>le(a)&&Ht(a)!=="body"),r=null;const i=Ce(e).position==="fixed";let s=i?Ge(e):e;for(;le(s)&&!Ue(s);){const a=Ce(s),c=hi(s);!c&&a.position==="fixed"&&(r=null),(i?!c&&!r:!c&&a.position==="static"&&!!r&&qx.has(r.position)||Nn(s)&&!c&&Fl(e,s))?o=o.filter(u=>u!==s):r=a,s=Ge(s)}return t.set(e,o),o}function Qx(e){let{element:t,boundary:n,rootBoundary:o,strategy:r}=e;const s=[...n==="clippingAncestors"?Io(t)?[]:Kx(t,this._c):[].concat(n),o],a=s[0],c=s.reduce((l,u)=>{const h=Vl(t,u,r);return l.top=gt(h.top,l.top),l.right=Ro(h.right,l.right),l.bottom=Ro(h.bottom,l.bottom),l.left=gt(h.left,l.left),l},Vl(t,a,r));return{width:c.right-c.left,height:c.bottom-c.top,x:c.left,y:c.top}}function Jx(e){const{width:t,height:n}=$l(e);return{width:t,height:n}}function ew(e,t,n){const o=Pe(t),r=He(t),i=n==="fixed",s=yt(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const c=je(0);function l(){c.x=Wo(r)}if(o||!o&&!i)if((Ht(t)!=="body"||Nn(r))&&(a=Do(t)),o){const f=yt(t,!0,i,t);c.x=f.x+t.clientLeft,c.y=f.y+t.clientTop}else r&&l();i&&!o&&r&&l();const u=r&&!o&&!i?Hl(r,a):je(0),h=s.left+a.scrollLeft-c.x-u.x,d=s.top+a.scrollTop-c.y-u.y;return{x:h,y:d,width:s.width,height:s.height}}function bi(e){return Ce(e).position==="static"}function Bl(e,t){if(!Pe(e)||Ce(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return He(e)===n&&(n=n.ownerDocument.body),n}function Wl(e,t){const n=Ee(e);if(Io(e))return n;if(!Pe(e)){let r=Ge(e);for(;r&&!Ue(r);){if(le(r)&&!bi(r))return r;r=Ge(r)}return n}let o=Bl(e,t);for(;o&&hx(o)&&bi(o);)o=Bl(o,t);return o&&Ue(o)&&bi(o)&&!hi(o)?n:o||xx(e)||n}const tw=async function(e){const t=this.getOffsetParent||Wl,n=this.getDimensions,o=await n(e.floating);return{reference:ew(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function nw(e){return Ce(e).direction==="rtl"}const ow={convertOffsetParentRelativeRectToViewportRelativeRect:Yx,getDocumentElement:He,getClippingRect:Qx,getOffsetParent:Wl,getElementRects:tw,getClientRects:Xx,getDimensions:Jx,getScale:Ft,isElement:le,isRTL:nw};function Yl(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function rw(e,t){let n=null,o;const r=He(e);function i(){var a;clearTimeout(o),(a=n)==null||a.disconnect(),n=null}function s(a,c){a===void 0&&(a=!1),c===void 0&&(c=1),i();const l=e.getBoundingClientRect(),{left:u,top:h,width:d,height:f}=l;if(a||t(),!d||!f)return;const p=$o(h),g=$o(r.clientWidth-(u+d)),x=$o(r.clientHeight-(h+f)),b=$o(u),m={rootMargin:-p+"px "+-g+"px "+-x+"px "+-b+"px",threshold:gt(0,Ro(1,c))||1};let w=!0;function k(N){const P=N[0].intersectionRatio;if(P!==c){if(!w)return s();P?s(!1,P):o=setTimeout(()=>{s(!1,1e-7)},1e3)}P===1&&!Yl(l,e.getBoundingClientRect())&&s(),w=!1}try{n=new IntersectionObserver(k,{...m,root:r.ownerDocument})}catch{n=new IntersectionObserver(k,m)}n.observe(e)}return s(!0),i}function Xl(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:r=!0,ancestorResize:i=!0,elementResize:s=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:c=!1}=o,l=wi(e),u=r||i?[...l?et(l):[],...et(t)]:[];u.forEach(b=>{r&&b.addEventListener("scroll",n,{passive:!0}),i&&b.addEventListener("resize",n)});const h=l&&a?rw(l,n):null;let d=-1,f=null;s&&(f=new ResizeObserver(b=>{let[v]=b;v&&v.target===l&&f&&(f.unobserve(t),cancelAnimationFrame(d),d=requestAnimationFrame(()=>{var m;(m=f)==null||m.observe(t)})),n()}),l&&!c&&f.observe(l),f.observe(t));let p,g=c?yt(e):null;c&&x();function x(){const b=yt(e);g&&!Yl(g,b)&&n(),g=b,p=requestAnimationFrame(x)}return n(),()=>{var b;u.forEach(v=>{r&&v.removeEventListener("scroll",n),i&&v.removeEventListener("resize",n)}),h?.(),(b=f)==null||b.disconnect(),f=null,c&&cancelAnimationFrame(p)}}const iw=Vx,sw=Fx,aw=zx,cw=(e,t,n)=>{const o=new Map,r={platform:ow,...n},i={...r.platform,_c:o};return $x(e,t,{...r,platform:i})};var lw=typeof document<"u",uw=function(){},Yo=lw?O.useLayoutEffect:uw;function Xo(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,r;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Xo(e[o],t[o]))return!1;return!0}if(r=Object.keys(e),n=r.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,r[o]))return!1;for(o=n;o--!==0;){const i=r[o];if(!(i==="_owner"&&e.$$typeof)&&!Xo(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function Ul(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Gl(e,t){const n=Ul(e);return Math.round(t*n)/n}function vi(e){const t=U.useRef(e);return Yo(()=>{t.current=e}),t}function dw(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:r,elements:{reference:i,floating:s}={},transform:a=!0,whileElementsMounted:c,open:l}=e,[u,h]=U.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[d,f]=U.useState(o);Xo(d,o)||f(o);const[p,g]=U.useState(null),[x,b]=U.useState(null),v=U.useCallback(E=>{E!==N.current&&(N.current=E,g(E))},[]),m=U.useCallback(E=>{E!==P.current&&(P.current=E,b(E))},[]),w=i||p,k=s||x,N=U.useRef(null),P=U.useRef(null),M=U.useRef(u),L=c!=null,H=vi(c),j=vi(r),R=vi(l),$=U.useCallback(()=>{if(!N.current||!P.current)return;const E={placement:t,strategy:n,middleware:d};j.current&&(E.platform=j.current),cw(N.current,P.current,E).then(I=>{const _={...I,isPositioned:R.current!==!1};y.current&&!Xo(M.current,_)&&(M.current=_,Mu.flushSync(()=>{h(_)}))})},[d,t,n,j,R]);Yo(()=>{l===!1&&M.current.isPositioned&&(M.current.isPositioned=!1,h(E=>({...E,isPositioned:!1})))},[l]);const y=U.useRef(!1);Yo(()=>(y.current=!0,()=>{y.current=!1}),[]),Yo(()=>{if(w&&(N.current=w),k&&(P.current=k),w&&k){if(H.current)return H.current(w,k,$);$()}},[w,k,$,H,L]);const A=U.useMemo(()=>({reference:N,floating:P,setReference:v,setFloating:m}),[v,m]),T=U.useMemo(()=>({reference:w,floating:k}),[w,k]),S=U.useMemo(()=>{const E={position:n,left:0,top:0};if(!T.floating)return E;const I=Gl(T.floating,u.x),_=Gl(T.floating,u.y);return a?{...E,transform:"translate("+I+"px, "+_+"px)",...Ul(T.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:I,top:_}},[n,a,T.floating,u.x,u.y]);return U.useMemo(()=>({...u,update:$,refs:A,elements:T,floatingStyles:S}),[u,$,A,T,S])}const ql=(e,t)=>({...iw(e),options:[e,t]}),Zl=(e,t)=>({...sw(e),options:[e,t]}),Kl=(e,t)=>({...aw(e),options:[e,t]}),fw="data-floating-ui-focusable",Ql="active",Jl="selected",hw={...U};let eu=!1,pw=0;const tu=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+pw++;function gw(){const[e,t]=U.useState(()=>eu?tu():void 0);return Vt(()=>{e==null&&t(tu())},[]),U.useEffect(()=>{eu=!0},[]),e}const mw=hw.useId||gw;let Ei;process.env.NODE_ENV!=="production"&&(Ei=new Set);function yw(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const r="Floating UI: "+n.join(" ");if(!((e=Ei)!=null&&e.has(r))){var i;(i=Ei)==null||i.add(r),console.error(r)}}function xw(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(r=>r(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var o;(o=e.get(t))==null||o.delete(n)}}}const ww=U.createContext(null),bw=U.createContext(null),nu=()=>{var e;return((e=U.useContext(ww))==null?void 0:e.id)||null},_i=()=>U.useContext(bw);function ou(e){return"data-floating-ui-"+e}function _e(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const ru=ou("safe-polygon");function Si(e,t,n){if(n&&!xi(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function Ci(e){return typeof e=="function"?e():e}function vw(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:r,events:i,elements:s}=e,{enabled:a=!0,delay:c=0,handleClose:l=null,mouseOnly:u=!1,restMs:h=0,move:d=!0}=t,f=_i(),p=nu(),g=Bo(l),x=Bo(c),b=Bo(n),v=Bo(h),m=U.useRef(),w=U.useRef(-1),k=U.useRef(),N=U.useRef(-1),P=U.useRef(!0),M=U.useRef(!1),L=U.useRef(()=>{}),H=U.useRef(!1),j=Ve(()=>{var S;const E=(S=r.current.openEvent)==null?void 0:S.type;return E?.includes("mouse")&&E!=="mousedown"});U.useEffect(()=>{if(!a)return;function S(E){let{open:I}=E;I||(_e(w),_e(N),P.current=!0,H.current=!1)}return i.on("openchange",S),()=>{i.off("openchange",S)}},[a,i]),U.useEffect(()=>{if(!a||!g.current||!n)return;function S(I){j()&&o(!1,I,"hover")}const E=jt(s.floating).documentElement;return E.addEventListener("mouseleave",S),()=>{E.removeEventListener("mouseleave",S)}},[s.floating,n,o,a,g,j]);const R=U.useCallback(function(S,E,I){E===void 0&&(E=!0),I===void 0&&(I="hover");const _=Si(x.current,"close",m.current);_&&!k.current?(_e(w),w.current=window.setTimeout(()=>o(!1,S,I),_)):E&&(_e(w),o(!1,S,I))},[x,o]),$=Ve(()=>{L.current(),k.current=void 0}),y=Ve(()=>{if(M.current){const S=jt(s.floating).body;S.style.pointerEvents="",S.removeAttribute(ru),M.current=!1}}),A=Ve(()=>r.current.openEvent?["click","mousedown"].includes(r.current.openEvent.type):!1);U.useEffect(()=>{if(!a)return;function S(z){if(_e(w),P.current=!1,u&&!xi(m.current)||Ci(v.current)>0&&!Si(x.current,"open"))return;const F=Si(x.current,"open",m.current);F?w.current=window.setTimeout(()=>{b.current||o(!0,z,"hover")},F):n||o(!0,z,"hover")}function E(z){if(A()){y();return}L.current();const F=jt(s.floating);if(_e(N),H.current=!1,g.current&&r.current.floatingContext){n||_e(w),k.current=g.current({...r.current.floatingContext,tree:f,x:z.clientX,y:z.clientY,onClose(){y(),$(),A()||R(z,!0,"safe-polygon")}});const Y=k.current;F.addEventListener("mousemove",Y),L.current=()=>{F.removeEventListener("mousemove",Y)};return}(m.current==="touch"?!mi(s.floating,z.relatedTarget):!0)&&R(z)}function I(z){A()||r.current.floatingContext&&(g.current==null||g.current({...r.current.floatingContext,tree:f,x:z.clientX,y:z.clientY,onClose(){y(),$(),A()||R(z)}})(z))}function _(){_e(w)}function D(z){A()||R(z,!1)}if(le(s.domReference)){const z=s.domReference,F=s.floating;return n&&z.addEventListener("mouseleave",I),d&&z.addEventListener("mousemove",S,{once:!0}),z.addEventListener("mouseenter",S),z.addEventListener("mouseleave",E),F&&(F.addEventListener("mouseleave",I),F.addEventListener("mouseenter",_),F.addEventListener("mouseleave",D)),()=>{n&&z.removeEventListener("mouseleave",I),d&&z.removeEventListener("mousemove",S),z.removeEventListener("mouseenter",S),z.removeEventListener("mouseleave",E),F&&(F.removeEventListener("mouseleave",I),F.removeEventListener("mouseenter",_),F.removeEventListener("mouseleave",D))}}},[s,a,e,u,d,R,$,y,o,n,b,f,x,g,r,A,v]),Vt(()=>{var S;if(a&&n&&(S=g.current)!=null&&(S=S.__options)!=null&&S.blockPointerEvents&&j()){M.current=!0;const I=s.floating;if(le(s.domReference)&&I){var E;const _=jt(s.floating).body;_.setAttribute(ru,"");const D=s.domReference,z=f==null||(E=f.nodesRef.current.find(F=>F.id===p))==null||(E=E.context)==null?void 0:E.elements.floating;return z&&(z.style.pointerEvents=""),_.style.pointerEvents="none",D.style.pointerEvents="auto",I.style.pointerEvents="auto",()=>{_.style.pointerEvents="",D.style.pointerEvents="",I.style.pointerEvents=""}}}},[a,n,p,s,f,g,j]),Vt(()=>{n||(m.current=void 0,H.current=!1,$(),y())},[n,$,y]),U.useEffect(()=>()=>{$(),_e(w),_e(N),y()},[a,s.domReference,$,y]);const T=U.useMemo(()=>{function S(E){m.current=E.pointerType}return{onPointerDown:S,onPointerEnter:S,onMouseMove(E){const{nativeEvent:I}=E;function _(){!P.current&&!b.current&&o(!0,I,"hover")}u&&!xi(m.current)||n||Ci(v.current)===0||H.current&&E.movementX**2+E.movementY**2<2||(_e(N),m.current==="touch"?_():(H.current=!0,N.current=window.setTimeout(_,Ci(v.current))))}}},[u,o,n,b,v]);return U.useMemo(()=>a?{reference:T}:{},[a,T])}function Ni(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&Po(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Ew(e){return"composedPath"in e?e.composedPath()[0]:e.target}const _w={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},Sw={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},iu=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function Cw(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,elements:r,dataRef:i}=e,{enabled:s=!0,escapeKey:a=!0,outsidePress:c=!0,outsidePressEvent:l="pointerdown",referencePress:u=!1,referencePressEvent:h="pointerdown",ancestorScroll:d=!1,bubbles:f,capture:p}=t,g=_i(),x=Ve(typeof c=="function"?c:()=>!1),b=typeof c=="function"?x:c,v=U.useRef(!1),{escapeKey:m,outsidePress:w}=iu(f),{escapeKey:k,outsidePress:N}=iu(p),P=U.useRef(!1),M=Ve(y=>{var A;if(!n||!s||!a||y.key!=="Escape"||P.current)return;const T=(A=i.current.floatingContext)==null?void 0:A.nodeId,S=g?Fo(g.nodesRef.current,T):[];if(!m&&(y.stopPropagation(),S.length>0)){let E=!0;if(S.forEach(I=>{var _;if((_=I.context)!=null&&_.open&&!I.context.dataRef.current.__escapeKeyBubbles){E=!1;return}}),!E)return}o(!1,Ix(y)?y.nativeEvent:y,"escape-key")}),L=Ve(y=>{var A;const T=()=>{var S;M(y),(S=kn(y))==null||S.removeEventListener("keydown",T)};(A=kn(y))==null||A.addEventListener("keydown",T)}),H=Ve(y=>{var A;const T=i.current.insideReactTree;i.current.insideReactTree=!1;const S=v.current;if(v.current=!1,l==="click"&&S||T||typeof b=="function"&&!b(y))return;const E=kn(y),I="["+ou("inert")+"]",_=jt(r.floating).querySelectorAll(I);let D=le(E)?E:null;for(;D&&!Ue(D);){const Y=Ge(D);if(Ue(Y)||!le(Y))break;D=Y}if(_.length&&le(E)&&!Px(E)&&!mi(E,r.floating)&&Array.from(_).every(Y=>!mi(D,Y)))return;if(Pe(E)&&$){const Y=Ue(E),K=Ce(E),W=/auto|scroll/,V=Y||W.test(K.overflowX),X=Y||W.test(K.overflowY),J=V&&E.clientWidth>0&&E.scrollWidth>E.clientWidth,te=X&&E.clientHeight>0&&E.scrollHeight>E.clientHeight,Z=K.direction==="rtl",oe=te&&(Z?y.offsetX<=E.offsetWidth-E.clientWidth:y.offsetX>E.clientWidth),ne=J&&y.offsetY>E.clientHeight;if(oe||ne)return}const z=(A=i.current.floatingContext)==null?void 0:A.nodeId,F=g&&Fo(g.nodesRef.current,z).some(Y=>{var K;return yi(y,(K=Y.context)==null?void 0:K.elements.floating)});if(yi(y,r.floating)||yi(y,r.domReference)||F)return;const B=g?Fo(g.nodesRef.current,z):[];if(B.length>0){let Y=!0;if(B.forEach(K=>{var W;if((W=K.context)!=null&&W.open&&!K.context.dataRef.current.__outsidePressBubbles){Y=!1;return}}),!Y)return}o(!1,y,"outside-press")}),j=Ve(y=>{var A;const T=()=>{var S;H(y),(S=kn(y))==null||S.removeEventListener(l,T)};(A=kn(y))==null||A.addEventListener(l,T)});U.useEffect(()=>{if(!n||!s)return;i.current.__escapeKeyBubbles=m,i.current.__outsidePressBubbles=w;let y=-1;function A(_){o(!1,_,"ancestor-scroll")}function T(){window.clearTimeout(y),P.current=!0}function S(){y=window.setTimeout(()=>{P.current=!1},Oo()?5:0)}const E=jt(r.floating);a&&(E.addEventListener("keydown",k?L:M,k),E.addEventListener("compositionstart",T),E.addEventListener("compositionend",S)),b&&E.addEventListener(l,N?j:H,N);let I=[];return d&&(le(r.domReference)&&(I=et(r.domReference)),le(r.floating)&&(I=I.concat(et(r.floating))),!le(r.reference)&&r.reference&&r.reference.contextElement&&(I=I.concat(et(r.reference.contextElement)))),I=I.filter(_=>{var D;return _!==((D=E.defaultView)==null?void 0:D.visualViewport)}),I.forEach(_=>{_.addEventListener("scroll",A,{passive:!0})}),()=>{a&&(E.removeEventListener("keydown",k?L:M,k),E.removeEventListener("compositionstart",T),E.removeEventListener("compositionend",S)),b&&E.removeEventListener(l,N?j:H,N),I.forEach(_=>{_.removeEventListener("scroll",A)}),window.clearTimeout(y)}},[i,r,a,b,l,n,o,d,s,m,w,M,k,L,H,N,j]),U.useEffect(()=>{i.current.insideReactTree=!1},[i,b,l]);const R=U.useMemo(()=>({onKeyDown:M,...u&&{[_w[h]]:y=>{o(!1,y.nativeEvent,"reference-press")},...h!=="click"&&{onClick(y){o(!1,y.nativeEvent,"reference-press")}}}}),[M,o,u,h]),$=U.useMemo(()=>({onKeyDown:M,onMouseDown(){v.current=!0},onMouseUp(){v.current=!0},[Sw[l]]:()=>{i.current.insideReactTree=!0}}),[M,l,i]);return U.useMemo(()=>s?{reference:R,floating:$}:{},[s,R,$])}function Nw(e){const{open:t=!1,onOpenChange:n,elements:o}=e,r=mw(),i=U.useRef({}),[s]=U.useState(()=>xw()),a=nu()!=null;if(process.env.NODE_ENV!=="production"){const f=o.reference;f&&!le(f)&&yw("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[c,l]=U.useState(o.reference),u=Ve((f,p,g)=>{i.current.openEvent=f?p:void 0,s.emit("openchange",{open:f,event:p,reason:g,nested:a}),n?.(f,p,g)}),h=U.useMemo(()=>({setPositionReference:l}),[]),d=U.useMemo(()=>({reference:c||o.reference||null,floating:o.floating||null,domReference:o.reference}),[c,o.reference,o.floating]);return U.useMemo(()=>({dataRef:i,open:t,onOpenChange:u,elements:d,events:s,floatingId:r,refs:h}),[t,u,d,s,r,h])}function su(e){e===void 0&&(e={});const{nodeId:t}=e,n=Nw({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,r=o.elements,[i,s]=U.useState(null),[a,c]=U.useState(null),u=r?.domReference||i,h=U.useRef(null),d=_i();Vt(()=>{u&&(h.current=u)},[u]);const f=dw({...e,elements:{...r,...a&&{reference:a}}}),p=U.useCallback(m=>{const w=le(m)?{getBoundingClientRect:()=>m.getBoundingClientRect(),getClientRects:()=>m.getClientRects(),contextElement:m}:m;c(w),f.refs.setReference(w)},[f.refs]),g=U.useCallback(m=>{(le(m)||m===null)&&(h.current=m,s(m)),(le(f.refs.reference.current)||f.refs.reference.current===null||m!==null&&!le(m))&&f.refs.setReference(m)},[f.refs]),x=U.useMemo(()=>({...f.refs,setReference:g,setPositionReference:p,domReference:h}),[f.refs,g,p]),b=U.useMemo(()=>({...f.elements,domReference:u}),[f.elements,u]),v=U.useMemo(()=>({...f,...o,refs:x,elements:b,nodeId:t}),[f,x,b,t,o]);return Vt(()=>{o.dataRef.current.floatingContext=v;const m=d?.nodesRef.current.find(w=>w.id===t);m&&(m.context=v)}),U.useMemo(()=>({...f,context:v,refs:x,elements:b}),[f,x,b,v])}function ki(e,t,n){const o=new Map,r=n==="item";let i=e;if(r&&e){const{[Ql]:s,[Jl]:a,...c}=e;i=c}return{...n==="floating"&&{tabIndex:-1,[fw]:""},...i,...t.map(s=>{const a=s?s[n]:null;return typeof a=="function"?e?a(e):null:a}).concat(e).reduce((s,a)=>(a&&Object.entries(a).forEach(c=>{let[l,u]=c;if(!(r&&[Ql,Jl].includes(l)))if(l.indexOf("on")===0){if(o.has(l)||o.set(l,[]),typeof u=="function"){var h;(h=o.get(l))==null||h.push(u),s[l]=function(){for(var d,f=arguments.length,p=new Array(f),g=0;g<f;g++)p[g]=arguments[g];return(d=o.get(l))==null?void 0:d.map(x=>x(...p)).find(x=>x!==void 0)}}}else s[l]=u}),s),{})}}function au(e){e===void 0&&(e=[]);const t=e.map(a=>a?.reference),n=e.map(a=>a?.floating),o=e.map(a=>a?.item),r=U.useCallback(a=>ki(a,e,"reference"),t),i=U.useCallback(a=>ki(a,e,"floating"),n),s=U.useCallback(a=>ki(a,e,"item"),o);return U.useMemo(()=>({getReferenceProps:r,getFloatingProps:i,getItemProps:s}),[r,i,s])}function cu(e,t,n){return n===void 0&&(n=!0),e.filter(r=>{var i;return r.parentId===t&&(!n||((i=r.context)==null?void 0:i.open))}).flatMap(r=>[r,...cu(e,r.id,n)])}function lu(e,t){const[n,o]=e;let r=!1;const i=t.length;for(let s=0,a=i-1;s<i;a=s++){const[c,l]=t[s]||[0,0],[u,h]=t[a]||[0,0];l>=o!=h>=o&&n<=(u-c)*(o-l)/(h-l)+c&&(r=!r)}return r}function kw(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function Tw(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,r={current:-1};let i=!1,s=null,a=null,c=typeof performance<"u"?performance.now():0;function l(h,d){const f=performance.now(),p=f-c;if(s===null||a===null||p===0)return s=h,a=d,c=f,null;const g=h-s,x=d-a,v=Math.sqrt(g*g+x*x)/p;return s=h,a=d,c=f,v}const u=h=>{let{x:d,y:f,placement:p,elements:g,onClose:x,nodeId:b,tree:v}=h;return function(w){function k(){_e(r),x()}if(_e(r),!g.domReference||!g.floating||p==null||d==null||f==null)return;const{clientX:N,clientY:P}=w,M=[N,P],L=Ew(w),H=w.type==="mouseleave",j=Ni(g.floating,L),R=Ni(g.domReference,L),$=g.domReference.getBoundingClientRect(),y=g.floating.getBoundingClientRect(),A=p.split("-")[0],T=d>y.right-y.width/2,S=f>y.bottom-y.height/2,E=kw(M,$),I=y.width>$.width,_=y.height>$.height,D=(I?$:y).left,z=(I?$:y).right,F=(_?$:y).top,B=(_?$:y).bottom;if(j&&(i=!0,!H))return;if(R&&(i=!1),R&&!H){i=!0;return}if(H&&le(w.relatedTarget)&&Ni(g.floating,w.relatedTarget)||v&&cu(v.nodesRef.current,b).length)return;if(A==="top"&&f>=$.bottom-1||A==="bottom"&&f<=$.top+1||A==="left"&&d>=$.right-1||A==="right"&&d<=$.left+1)return k();let Y=[];switch(A){case"top":Y=[[D,$.top+1],[D,y.bottom-1],[z,y.bottom-1],[z,$.top+1]];break;case"bottom":Y=[[D,y.top+1],[D,$.bottom-1],[z,$.bottom-1],[z,y.top+1]];break;case"left":Y=[[y.right-1,B],[y.right-1,F],[$.left+1,F],[$.left+1,B]];break;case"right":Y=[[$.right-1,B],[$.right-1,F],[y.left+1,F],[y.left+1,B]];break}function K(W){let[V,X]=W;switch(A){case"top":{const J=[I?V+t/2:T?V+t*4:V-t*4,X+t+1],te=[I?V-t/2:T?V+t*4:V-t*4,X+t+1],Z=[[y.left,T||I?y.bottom-t:y.top],[y.right,T?I?y.bottom-t:y.top:y.bottom-t]];return[J,te,...Z]}case"bottom":{const J=[I?V+t/2:T?V+t*4:V-t*4,X-t],te=[I?V-t/2:T?V+t*4:V-t*4,X-t],Z=[[y.left,T||I?y.top+t:y.bottom],[y.right,T?I?y.top+t:y.bottom:y.top+t]];return[J,te,...Z]}case"left":{const J=[V+t+1,_?X+t/2:S?X+t*4:X-t*4],te=[V+t+1,_?X-t/2:S?X+t*4:X-t*4];return[...[[S||_?y.right-t:y.left,y.top],[S?_?y.right-t:y.left:y.right-t,y.bottom]],J,te]}case"right":{const J=[V-t,_?X+t/2:S?X+t*4:X-t*4],te=[V-t,_?X-t/2:S?X+t*4:X-t*4],Z=[[S||_?y.left+t:y.right,y.top],[S?_?y.left+t:y.right:y.left+t,y.bottom]];return[J,te,...Z]}}}if(!lu([N,P],Y)){if(i&&!E)return k();if(!H&&o){const W=l(w.clientX,w.clientY);if(W!==null&&W<.1)return k()}lu([N,P],K([d,f]))?!i&&o&&(r.current=window.setTimeout(k,40)):k()}}};return u.__options={blockPointerEvents:n},u}const uu=({subItems:e,onItemClick:t,className:n})=>{const[,o]=O.useState(null),r=i=>{i.onClick&&i.onClick(),t&&t(i)};return C.jsx("ul",{className:se("min-w-48 bg-[#181818] border border-none rounded-md shadow-lg py-1",n),children:e.map((i,s)=>C.jsx(Mw,{item:i,index:s,onItemClick:r,onItemClickCallback:t,setHoveredItemId:o},i.id))})},Mw=({item:e,index:t,onItemClick:n,onItemClickCallback:o,setHoveredItemId:r})=>{const[i,s]=O.useState(!1),{refs:a,floatingStyles:c,context:l}=su({open:i,onOpenChange:s,placement:"right-start",middleware:[ql(5),Kl({fallbackPlacements:["left-start"]}),Zl({padding:8})],whileElementsMounted:Xl}),u=vw(l,{handleClose:Tw(),delay:{open:75,close:75}}),{getReferenceProps:h,getFloatingProps:d}=au([u]),f=()=>{r(e.id),e.subItems&&e.subItems.length>0&&s(!0)},p=()=>{};return C.jsxs("li",{className:"relative",children:[e.separator&&t>0&&C.jsx("div",{className:"border-t border-gray-600 m-0"}),C.jsxs("div",{ref:a.setReference,className:se("flex items-center justify-between gap-2 px-3 py-1.25 hover:bg-[#3F3F3F] cursor-pointer","transition-colors duration-150"),onClick:()=>n(e),onMouseEnter:f,onMouseLeave:p,...h(),children:[C.jsxs("div",{className:"flex items-center gap-2",children:[e.icon&&C.jsx("span",{className:"text-primary-white w-3 h-3 flex items-center justify-center",children:e.icon}),C.jsx("span",{className:"text-sm leading-3.5 text-primary-white font-main",children:e.label})]}),C.jsxs("div",{className:"flex items-center gap-2",children:[e.shortcut&&C.jsx("span",{className:"text-sm leading-3.5 text-gray-400 font-mono",children:e.shortcut}),e.subItems&&e.subItems.length>0&&C.jsx(Nl,{className:"w-3 h-3 text-gray-400"})]})]}),e.subItems&&e.subItems.length>0&&i&&C.jsx("div",{ref:a.setFloating,style:{...c,contain:"layout",willChange:"transform"},className:"z-50",...d(),children:C.jsx(uu,{subItems:e.subItems,onItemClick:o,className:"ml-1"})})]})},du=({subItems:e,className:t,onItemClick:n})=>C.jsx("div",{className:se("relative",t),children:C.jsx(uu,{subItems:e,onItemClick:n})});function fu({typeOfNodes:e,dispatch:t,setContextMenu:n,contextMenuPosition:o}){const r=Object.keys(e);if(r.length===0)return[];const i=r.map(s=>({id:`add-${s}`,label:e[s].name,onClick:()=>{t({type:ze.ADD_NODE_AND_SELECT,payload:{type:s,position:o}}),n({isOpen:!1,position:{x:0,y:0}})}}));return[{id:"add-node",label:"Add Node",icon:O.createElement(ux,{className:"w-4 h-4"}),subItems:i}]}const ae=["circle","square","rectangle","list","grid","diamond","trapezium","hexagon","star","cross","zigzag","sparkle","parallelogram"],pe={[ae[0]]:ae[0],[ae[1]]:ae[1],[ae[2]]:ae[2],[ae[3]]:ae[3],[ae[4]]:ae[4],[ae[5]]:ae[5],[ae[6]]:ae[6],[ae[7]]:ae[7],[ae[8]]:ae[8],[ae[9]]:ae[9],[ae[10]]:ae[10],[ae[11]]:ae[11],[ae[12]]:ae[12]},Uo=(e,t,n,o="black",r=2)=>C.jsxs("div",{className:se("relative",n),children:[C.jsx("div",{className:"absolute",style:{top:-r,left:-r,right:-r,bottom:-r,backgroundColor:o,clipPath:e}}),C.jsx("div",{className:"absolute inset-0",style:{backgroundColor:t,clipPath:e}})]}),hu=(e=pe.circle,t="#A1A1A1",n)=>{const o="border-2 border-black",r="border-1 border-black",i={backgroundColor:t};switch(e){case pe.circle:return C.jsx("div",{className:se("w-6 h-6 rounded-full",o,n),style:i});case pe.square:return C.jsx("div",{className:se("w-6 h-6",o,n),style:i});case pe.rectangle:return C.jsx("div",{className:se("w-4 h-8",o,n),style:i});case pe.list:return C.jsx("div",{className:se("w-6 h-6 flex flex-col justify-center gap-0.5",n),children:[0,1,2].map(s=>C.jsx("div",{className:se("w-full h-2",r),style:i},s))});case pe.grid:return C.jsx("div",{className:se("w-6 h-6 grid grid-cols-2 gap-0.5",n),children:[0,1,2,3].map(s=>C.jsx("div",{className:se("w-full h-full",r),style:i},s))});case pe.diamond:return C.jsx("div",{className:se("w-6 h-6 rotate-45",o,n),style:i});case pe.trapezium:return Uo("polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%)",t,se("w-6 h-6",n));case pe.hexagon:return Uo("polygon(-50% 50%,50% 100%,150% 50%,50% 0)",t,se("w-5 h-6",n));case pe.star:return Uo("polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)",t,se("w-6 h-6",n));case pe.cross:return C.jsxs("div",{className:se("w-6 h-6 relative",n),children:[C.jsx("div",{className:se("absolute top-1/2 left-0 w-full h-2 -translate-y-1/2",r),style:i}),C.jsx("div",{className:se("absolute left-1/2 top-0 w-2 h-full -translate-x-1/2",r),style:i})]});case pe.zigzag:return C.jsx("div",{className:se("w-6 h-6",n),style:{...i,width:"calc(4px + 24px/(2*tan(90deg/2)))",minHeight:"24px",mask:"4px 50%/100% 24px repeat-y conic-gradient(from calc(90deg - 90deg/2) at left, #0000, #000 1deg calc(90deg - 1deg), #0000 90deg) exclude, 0 50%/100% 24px repeat-y conic-gradient(from calc(90deg - 90deg/2) at left, #0000, #000 1deg calc(90deg - 1deg), #0000 90deg)",border:"2px solid black"}});case pe.sparkle:return C.jsx("div",{className:se("w-6 h-6",n),style:{...i,mask:"radial-gradient(#0000 71%, #000 72%) 10000% 10000%/99.5% 99.5%",border:"2px solid black"}});case pe.parallelogram:return Uo("polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%)",t,se("w-6 h-6",n));default:return C.jsx("div",{className:se("w-6 h-6 rounded-full",o,n),style:i})}},Go=O.forwardRef(({type:e,position:t,id:n,color:o,shape:r=pe.circle,isCurrentlyInsideReactFlow:i=!1,className:s,...a},c)=>i?C.jsx(vn,{type:e,position:t,id:n,className:se("!w-6 !h-6 !border-none !bg-transparent !pointer-events-auto",s),style:{backgroundColor:"transparent"},...a,ref:c,children:C.jsx("div",{className:se("pointer-events-none flex justify-center"),children:hu(r,o||"#A1A1A1",s)})}):C.jsx("div",{className:se("absolute",t===Q.Right&&"right-0 top-1/2 -translate-y-1/2 translate-x-1/2",t===Q.Left&&"left-0 top-1/2 -translate-y-1/2 -translate-x-1/2"),...a,ref:c,children:hu(r,o||"#A1A1A1",s)}));Go.displayName="ContextAwareHandle";const pu=({input:e})=>{const t=bn(),n=No();return e.type==="string"?C.jsx(Sn,{placeholder:e.name,value:e.value,onChange:o=>{e.onChange?.(o),t.setNodes(r=>r.map(i=>i.id===n?{...i,data:wl(e.id,i.data,{value:o})}:i))},allowOnlyNumbers:!1,className:"w-full"}):C.jsx(Mo,{name:e.name,value:e.value,onChange:o=>{e.onChange?.(o),t.setNodes(r=>r.map(i=>i.id===n?{...i,data:wl(e.id,i.data,{value:o})}:i))},className:"w-full"})},gu=({input:e,isCurrentlyInsideReactFlow:t})=>t?C.jsx(pu,{input:e}):e.type==="string"?C.jsx(Sn,{placeholder:e.name,value:e.value,onChange:e.onChange,allowOnlyNumbers:!1,className:"w-full"}):C.jsx(Mo,{name:e.name,value:e.value,onChange:e.onChange,className:"w-full"}),Ti=O.forwardRef(({input:e,isCurrentlyInsideReactFlow:t,hide:n=!1},o)=>{const r=t?m0({handleId:e.id}):[],i=t&&r.some(a=>a.targetHandle===e.id),s=e.allowInput&&!i;return C.jsxs("div",{ref:o,className:se("text-primary-white text-[27px] leading-[27px] font-main relative px-6 flex flex-row py-3",n&&"h-0 overflow-hidden py-0",s&&"py-1"),children:[C.jsx(Go,{type:"target",position:Q.Left,id:e.id,color:e.handleColor,shape:e.handleShape,isCurrentlyInsideReactFlow:t}),C.jsxs("div",{className:"flex-1 flex items-center gap-3 w-full",children:[!s&&C.jsx("div",{className:"truncate",children:e.name}),s&&C.jsx("div",{className:"flex-1 w-full",children:C.jsx(gu,{input:e,isCurrentlyInsideReactFlow:t})})]})]},e.id)});Ti.displayName="RenderInput";const mu=O.forwardRef(({output:e,isCurrentlyInsideReactFlow:t},n)=>C.jsxs("div",{ref:n,className:"text-primary-white text-[27px] leading-[27px] font-main relative px-6 flex flex-row justify-end py-3",children:[C.jsx("div",{className:"truncate text-right",children:e.name}),C.jsx(Go,{type:"source",position:Q.Right,id:e.id,color:e.handleColor,shape:e.handleShape,isCurrentlyInsideReactFlow:t})]},e.id));mu.displayName="RenderOutput";const yu=O.forwardRef(({panel:e,isCurrentlyInsideReactFlow:t,isOpen:n,onToggle:o},r)=>C.jsxs("div",{ref:r,className:"flex flex-col",children:[C.jsxs(vt,{onClick:i=>{i.stopPropagation(),i.preventDefault(),o()},className:"bg-transparent border-none hover:bg-primary-gray rounded-none justify-start",children:[n?C.jsx(lx,{className:"w-6 h-6 flex-shrink-0 mr-2"}):C.jsx(ax,{className:"w-6 h-6 flex-shrink-0 mr-2"}),C.jsx("span",{className:"truncate",children:e.name})]}),C.jsx("div",{className:se("flex flex-col bg-[#272727]",!n&&"h-0 overflow-hidden"),children:e.inputs.map(i=>C.jsx(Ti,{input:i,isCurrentlyInsideReactFlow:t,hide:!n},i.id))})]},e.id));yu.displayName="RenderInputPanel";const Mi=O.forwardRef(({name:e="Node",headerColor:t="#79461D",inputs:n=[],outputs:o=[],isCurrentlyInsideReactFlow:r=!1,className:i,nodeResizerProps:s={},...a},c)=>{const[l,u]=O.useState(new Set),h=d=>{u(f=>{const p=new Set(f);return p.has(d)?p.delete(d):p.add(d),p})};return C.jsxs("div",{tabIndex:0,className:se("flex flex-col gap-0 rounded-md w-max border-[1.5px] border-transparent focus:border-white","in-[.selected]:border-white",i),...a,ref:c,children:[C.jsx("div",{className:`text-primary-white text-left text-[27px] leading-[27px] font-main \\
106
- py-2 px-4 transition-all rounded-t-md truncate`,style:{backgroundColor:t},children:e}),C.jsxs("div",{className:"min-h-[50px] rounded-b-md bg-primary-dark-gray",children:[r&&C.jsx(El,{...s}),C.jsx("div",{className:"flex flex-col py-4",children:o.map(d=>C.jsx(mu,{output:d,isCurrentlyInsideReactFlow:r},d.id))}),C.jsx("div",{className:"flex flex-col py-4",children:n.map(d=>{if("inputs"in d){const f=l.has(d.id);return C.jsx(yu,{panel:d,isCurrentlyInsideReactFlow:r,isOpen:f,onToggle:()=>h(d.id)},d.id)}else return C.jsx(Ti,{input:d,isCurrentlyInsideReactFlow:r},d.id)})})]})]})});Mi.displayName="ConfigurableNode";const Ai=O.forwardRef(({data:e={}},t)=>C.jsx(Mi,{isCurrentlyInsideReactFlow:!0,className:"w-full",...e,ref:t}));Ai.displayName="ConfigurableNodeReactFlowWrapper";const xu=({fromX:e,fromY:t,toX:n,toY:o,fromPosition:r,toPosition:i})=>{const{fromHandle:s}=nl(),a=si(s?.nodeId||""),c=O.useMemo(()=>!s?.id||!a?.data?void 0:ui(s?.id,a?.data)?.handleColor??"#A1A1A1",[s?.id,a?.data]),[l]=mo({sourceX:e,sourceY:t,sourcePosition:r,targetX:n,targetY:o,targetPosition:i});return C.jsx($t,{path:l,className:"!stroke-7 in-[g.selected]:brightness-150",style:{stroke:c||"#A1A1A1"},focusable:!0})};xu.displayName="ConfigurableConnection";const Aw={configurableNode:Ai},Pw={configurableEdge:fi};function Iw(e){const[t,n]=O.useReducer(xl,e);return{state:t,dispatch:n}}function Ow({state:e,dispatch:t}){const[n,o]=O.useState({isOpen:!1,position:{x:0,y:0}}),{screenToFlowPosition:r}=bn(),{refs:i,floatingStyles:s,context:a}=su({open:n.isOpen,onOpenChange:f=>{f||o({isOpen:!1,position:{x:0,y:0}})},placement:"bottom-start",middleware:[ql(5),Kl({fallbackPlacements:["top-start"]}),Zl({padding:8})],whileElementsMounted:Xl}),c=Cw(a),{getFloatingProps:l}=au([c]),u=fu({typeOfNodes:e.typeOfNodes,dispatch:t,setContextMenu:o,contextMenuPosition:r(n.position)}),h=O.useCallback(f=>{f.preventDefault();const p={x:f.clientX,y:f.clientY};i.setReference&&i.setReference({getBoundingClientRect:()=>({x:p.x,y:p.y,width:1,height:1,top:p.y,right:p.x+1,bottom:p.y+1,left:p.x})}),o({isOpen:!0,position:p})},[i]),d=O.useCallback(()=>{o({isOpen:!1,position:{x:0,y:0}})},[]);return C.jsxs("div",{style:{width:"100%",height:"100%"},children:[C.jsxs(p0,{nodes:e.nodes,edges:e.edges,onNodesChange:f=>t({type:ze.UPDATE_NODE_BY_REACT_FLOW,payload:{changes:f}}),onEdgesChange:f=>t({type:ze.UPDATE_EDGES_BY_REACT_FLOW,payload:{changes:f}}),onConnect:f=>t({type:ze.ADD_EDGE_BY_REACT_FLOW,payload:{edge:f}}),fitView:!0,fitViewOptions:{maxZoom:.5,minZoom:.1},maxZoom:1,minZoom:.1,proOptions:{hideAttribution:!0},colorMode:"dark",selectNodesOnDrag:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectionMode:At.Partial,nodeTypes:Aw,edgeTypes:Pw,deleteKeyCode:["Backspace","Delete","x"],connectionLineComponent:xu,onContextMenu:h,onClick:d,children:[C.jsx(T0,{}),C.jsx(v0,{}),C.jsx(V0,{pannable:!0})]}),n.isOpen&&C.jsx("div",{ref:i.setFloating,style:{...s,contain:"layout",willChange:"transform"},className:"z-50",onClick:f=>f.stopPropagation(),...l(),children:C.jsx(du,{subItems:u})})]})}function Dw({state:e,dispatch:t}){return C.jsx(al,{children:C.jsx(Ow,{state:e,dispatch:t})})}ee.Button=vt,ee.ConfigurableEdge=fi,ee.ConfigurableNode=Mi,ee.ConfigurableNodeReactFlowWrapper=Ai,ee.ContextAwareHandle=Go,ee.ContextAwareInput=gu,ee.ContextMenu=du,ee.FullGraph=Dw,ee.Input=Sn,ee.NodeResizerWithMoreControls=El,ee.ReactFlowAwareInput=pu,ee.SliderNumberInput=Mo,ee.actionTypesMap=ze,ee.addEdgeWithTypeChecking=pl,ee.cn=se,ee.constructInputOrOutputOfType=pt,ee.constructInputPanelOfType=fl,ee.constructNodeOfType=li,ee.constructTypeOfHandleFromIndices=hl,ee.convertStringToNumber=rs,ee.createNodeContextMenu=fu,ee.getResultantDataTypeOfHandleConsideringInferredType=En,ee.handleShapesMap=pe,ee.isCoordinateInBox=os,ee.isNumberInRange=ir,ee.isSupportedUnderlyingType=_d,ee.isValidDataTypeId=Cd,ee.mainReducer=xl,ee.makeAllowedConversionsBetweenDataTypesWithAutoInfer=kd,ee.makeDataTypeWithAutoInfer=Sd,ee.makeStateWithAutoInfer=Td,ee.makeTypeOfNodeWithAutoInfer=Nd,ee.removeEdgeWithTypeChecking=gl,ee.sanitizeNumberToShowAsText=sr,ee.supportedUnderlyingTypesMap=is,ee.useClickedOutside=vl,ee.useDrag=_l,ee.useFullGraph=Iw,ee.willAddingEdgeCreateCycle=ml,Object.defineProperty(ee,Symbol.toStringTag,{value:"Module"})});
132
+ */const la=nr("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
133
+ * @license lucide-react v0.542.0 - ISC
134
+ *
135
+ * This source code is licensed under the ISC license.
136
+ * See the LICENSE file in the root directory of this source tree.
137
+ */const nu=nr("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
138
+ * @license lucide-react v0.542.0 - ISC
139
+ *
140
+ * This source code is licensed under the ISC license.
141
+ * See the LICENSE file in the root directory of this source tree.
142
+ */const zm=nr("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
143
+ * @license lucide-react v0.542.0 - ISC
144
+ *
145
+ * This source code is licensed under the ISC license.
146
+ * See the LICENSE file in the root directory of this source tree.
147
+ */const Vm=nr("square-mouse-pointer",[["path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z",key:"xwnzip"}],["path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6",key:"14rsvq"}]]),ru=z.forwardRef(({children:e,orientation:t="horizontal",className:n,scrollAreaClassName:o,showArrows:s=!0,disabled:a=!1,ariaLabel:l,scrollSpeedPxPerFrame:c=14,observeChildren:f=!0},d)=>{const h=z.useRef(null),[g,p]=z.useState(!1),[m,x]=z.useState(!1),v=z.useRef(null),b=z.useRef(null);z.useImperativeHandle(d,()=>h.current);const _=z.useCallback(()=>t==="vertical"?{pos:"scrollTop",size:"clientHeight",full:"scrollHeight"}:{pos:"scrollLeft",size:"clientWidth",full:"scrollWidth"},[t]),N=z.useCallback(()=>{const V=h.current;if(!V||a){p(!1),x(!1);return}const K=_(),Z=V[K.pos],U=V[K.size],q=V[K.full];p(Z>0),x(Z+U<q-1)},[a,_]),w=z.useCallback(()=>{v.current!==null&&(cancelAnimationFrame(v.current),v.current=null),b.current=null},[]),E=z.useCallback(()=>{const V=h.current;if(!V||!b.current||a){w();return}const K=_(),Z=b.current==="start"?-1:1;if(K.pos==="scrollLeft"?V.scrollLeft+=Z*c:V.scrollTop+=Z*c,N(),Z<0&&!g||Z>0&&!m){w();return}v.current=requestAnimationFrame(E)},[m,g,a,_,c,w,N]),O=z.useCallback(V=>{a||b.current!==V&&(b.current=V,v.current!==null&&cancelAnimationFrame(v.current),v.current=requestAnimationFrame(E))},[a,E]);z.useEffect(()=>{N();const V=h.current;if(!V)return;const K=()=>N();V.addEventListener("scroll",K,{passive:!0});let Z=null;"ResizeObserver"in window&&(Z=new ResizeObserver(()=>N()),Z.observe(V));const U=()=>N();window.addEventListener("resize",U);const q=()=>w();return window.addEventListener("pointerup",q),window.addEventListener("touchend",q),()=>{V.removeEventListener("scroll",K),window.removeEventListener("resize",U),window.removeEventListener("pointerup",q),window.removeEventListener("touchend",q),Z&&Z.disconnect()}},[N]),z.useEffect(()=>{const V=requestAnimationFrame(N);return()=>cancelAnimationFrame(V)},[e,N]),z.useEffect(()=>{if(!f)return;const V=h.current;if(!V)return;const K=new MutationObserver(()=>N());return K.observe(V,{childList:!0,subtree:!0}),()=>K.disconnect()},[f,N]);const k=s&&g&&!a,M=s&&m&&!a,D=t==="horizontal"?"overflow-x-scroll overflow-y-hidden flex items-center gap-2 whitespace-nowrap":"overflow-y-scroll overflow-x-hidden flex flex-col items-start gap-2";return T.jsxs("div",{className:Ne("relative w-full h-full",n),children:[k&&T.jsx(An,{className:Ne("h-[44px] border-secondary-dark-gray bg-primary-black absolute z-10",t==="horizontal"?"left-0 top-1/2 -translate-y-1/2":"top-0 left-1/2 -translate-x-1/2"),disabled:!k,onMouseDown:()=>O("start"),onMouseUp:w,onMouseLeave:w,onTouchStart:()=>O("start"),onTouchEnd:w,children:t==="horizontal"?T.jsx(Hm,{}):T.jsx(nu,{})}),T.jsx("div",{ref:h,"aria-label":l,className:Ne("no-scrollbar w-full h-full",D,o),children:e}),M&&T.jsx(An,{className:Ne("h-[44px] border-secondary-dark-gray bg-primary-black absolute z-10",t==="horizontal"?"right-0 top-1/2 -translate-y-1/2":"bottom-0 left-1/2 -translate-x-1/2"),disabled:!M,onMouseDown:()=>O("end"),onMouseUp:w,onMouseLeave:w,onTouchStart:()=>O("end"),onTouchEnd:w,children:t==="horizontal"?T.jsx(la,{}):T.jsx(aa,{})})]})});ru.displayName="ScrollableButtonContainer";function Wm({onMove:e,onClick:t,clickThreshold:n=2,enabled:o=!0,preventDefaultAndStopPropagation:s=!0}={}){const[a,l]=z.useState(!1),[c,f]=z.useState(null),d=z.useRef(null),h=z.useRef(null),g=z.useCallback(p=>{f(p)},[]);return z.useEffect(()=>{if(!c||!o)return;const p=m=>{s&&(m.preventDefault(),m.stopPropagation()),d.current={x:m.clientX,y:m.clientY},h.current={width:c.clientWidth,height:c.clientHeight},l(!0);const x=b=>{s&&(b.preventDefault(),b.stopPropagation()),document.removeEventListener("mouseup",x),document.removeEventListener("mousemove",v),l(!1),d.current&&Math.sqrt((b.clientX-d.current.x)**2+(b.clientY-d.current.y)**2)<n&&t?.()},v=b=>{s&&(b.preventDefault(),b.stopPropagation());const _=b.movementX,N=b.movementY,w=h.current?.width||1,E=h.current?.height||1,O=_/w,k=N/E;e?.(_,N,O,k,w,E)};document.addEventListener("mouseup",x),document.addEventListener("mousemove",v)};return c.addEventListener("mousedown",p),()=>{c.removeEventListener("mousedown",p)}},[c,o,e,t,n,s]),{isDragging:a,dragRef:g}}const ca=z.forwardRef(({name:e="Input",value:t,onChange:n=()=>{},className:o,min:s,max:a,step:l},c)=>{const[f,d]=z.useState(t??0),[h,g]=z.useState(!1),p=z.useRef(0),m=z.useRef(0),x=t??f,v=z.useRef(0);z.useEffect(()=>{v.current=Math.abs(l??parseFloat(a===void 0||s===void 0?(x||1).toString():(a-s).toString()))},[x,l,a,s]);const{isDragging:b,dragRef:_}=Wm({onMove:(K,Z,U,q,C)=>{const H=K/(C+60);p.current+=H,Math.abs(p.current)>.05&&Date.now()-m.current>50&&(m.current=Date.now(),N(v.current*p.current),p.current=0)},onClick:O,clickThreshold:2});function N(K){d(Z=>{let U=Z+K;return s!==void 0&&U<=s?U=s:a!==void 0&&U>=a&&(U=a),n(U),U})}function w(K=.1){N(v.current*K)}function E(K=.1){N(-v.current*K)}function O(){g(!0)}function k(K){N(K-x),g(!1)}const M=b,D=s!==void 0&&a!==void 0&&x!==void 0&&a!==s?(x-s)/(a-s)*100:-1,V=D!==-1?`linear-gradient(90deg,#4772b3 ${D}%, #545454 ${D}%)`:"";return h?T.jsx(Ai,{className:"w-full",placeholder:e,value:x,allowOnlyNumbers:!0,onChange:K=>k(K),ref:c}):T.jsxs("div",{className:Ne("flex items-center gap-0 group/lightParentGroupBasedHover w-max rounded-md bg-primary-gray",o),style:V!==""?{background:V}:{},ref:c,children:[T.jsx(An,{color:"lightParentGroupBasedHover",className:"h-[44px] rounded-r-none w-[30px] p-0 shrink-0 bg-transparent",onClick:()=>E(.1),"aria-label":`Decrement ${e}`,applyHoverStyles:!M,children:T.jsx(Hm,{})}),T.jsxs(An,{color:"lightParentGroupBasedHover",className:"h-[44px] rounded-none pl-1.5 pr-0 flex-1 justify-between grid grid-cols-[repeat(2,auto)] bg-transparent",applyHoverStyles:!M,ref:_,children:[T.jsx("span",{className:"truncate text-left",children:e}),T.jsx("span",{className:"truncate",children:x.toFixed(4)})]}),T.jsx(An,{color:"lightParentGroupBasedHover",className:"h-[44px] rounded-l-none w-[30px] p-0 shrink-0 bg-transparent",onClick:()=>w(.1),"aria-label":`Increment ${e}`,applyHoverStyles:!M,children:T.jsx(la,{})})]})});ca.displayName="SliderNumberInput";function ua(){return typeof window<"u"}function uo(e){return jm(e)?(e.nodeName||"").toLowerCase():"#document"}function kt(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mn(e){var t;return(t=(jm(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function jm(e){return ua()?e instanceof Node||e instanceof kt(e).Node:!1}function Ue(e){return ua()?e instanceof Element||e instanceof kt(e).Element:!1}function en(e){return ua()?e instanceof HTMLElement||e instanceof kt(e).HTMLElement:!1}function fa(e){return!ua()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof kt(e).ShadowRoot}const JT=new Set(["inline","contents"]);function Ii(e){const{overflow:t,overflowX:n,overflowY:o,display:s}=zt(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!JT.has(s)}const eA=new Set(["table","td","th"]);function tA(e){return eA.has(uo(e))}const nA=[":popover-open",":modal"];function da(e){return nA.some(t=>{try{return e.matches(t)}catch{return!1}})}const rA=["transform","translate","scale","rotate","perspective"],oA=["transform","translate","scale","rotate","perspective","filter"],iA=["paint","layout","strict","content"];function ou(e){const t=ha(),n=Ue(e)?zt(e):e;return rA.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||oA.some(o=>(n.willChange||"").includes(o))||iA.some(o=>(n.contain||"").includes(o))}function sA(e){let t=Ln(e);for(;en(t)&&!Dn(t);){if(ou(t))return t;if(da(t))return null;t=Ln(t)}return null}function ha(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const aA=new Set(["html","body","#document"]);function Dn(e){return aA.has(uo(e))}function zt(e){return kt(e).getComputedStyle(e)}function pa(e){return Ue(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Ln(e){if(uo(e)==="html")return e;const t=e.assignedSlot||e.parentNode||fa(e)&&e.host||mn(e);return fa(t)?t.host:t}function Um(e){const t=Ln(e);return Dn(t)?e.ownerDocument?e.ownerDocument.body:e.body:en(t)&&Ii(t)?t:Um(t)}function rr(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const s=Um(e),a=s===((o=e.ownerDocument)==null?void 0:o.body),l=kt(s);if(a){const c=iu(l);return t.concat(l,l.visualViewport||[],Ii(s)?s:[],c&&n?rr(c):[])}return t.concat(s,rr(s,[],n))}function iu(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}const lA=["top","right","bottom","left"],or=Math.min,Mt=Math.max,ga=Math.round,ma=Math.floor,yn=e=>({x:e,y:e}),cA={left:"right",right:"left",bottom:"top",top:"bottom"},uA={start:"end",end:"start"};function su(e,t,n){return Mt(e,or(t,n))}function $n(e,t){return typeof e=="function"?e(t):e}function Bn(e){return e.split("-")[0]}function fo(e){return e.split("-")[1]}function au(e){return e==="x"?"y":"x"}function lu(e){return e==="y"?"height":"width"}const fA=new Set(["top","bottom"]);function vn(e){return fA.has(Bn(e))?"y":"x"}function cu(e){return au(vn(e))}function dA(e,t,n){n===void 0&&(n=!1);const o=fo(e),s=cu(e),a=lu(s);let l=s==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[a]>t.floating[a]&&(l=ya(l)),[l,ya(l)]}function hA(e){const t=ya(e);return[uu(e),t,uu(t)]}function uu(e){return e.replace(/start|end/g,t=>uA[t])}const Gm=["left","right"],Ym=["right","left"],pA=["top","bottom"],gA=["bottom","top"];function mA(e,t,n){switch(e){case"top":case"bottom":return n?t?Ym:Gm:t?Gm:Ym;case"left":case"right":return t?pA:gA;default:return[]}}function yA(e,t,n,o){const s=fo(e);let a=mA(Bn(e),n==="start",o);return s&&(a=a.map(l=>l+"-"+s),t&&(a=a.concat(a.map(uu)))),a}function ya(e){return e.replace(/left|right|bottom|top/g,t=>cA[t])}function vA(e){return{top:0,right:0,bottom:0,left:0,...e}}function Xm(e){return typeof e!="number"?vA(e):{top:e,right:e,bottom:e,left:e}}function va(e){const{x:t,y:n,width:o,height:s}=e;return{width:o,height:s,top:n,left:t,right:t+o,bottom:n+s,x:t,y:n}}function fu(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&fa(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function Oi(e){return"composedPath"in e?e.composedPath()[0]:e.target}function du(e,t){if(t==null)return!1;if("composedPath"in e)return e.composedPath().includes(t);const n=e;return n.target!=null&&t.contains(n.target)}function xA(e){return e.matches("html,body")}function ho(e){return e?.ownerDocument||document}function xa(e,t,n){return n===void 0&&(n=!0),e.filter(s=>{var a;return s.parentId===t&&(!n||((a=s.context)==null?void 0:a.open))}).flatMap(s=>[s,...xa(e,s.id,n)])}function wA(e){return"nativeEvent"in e}function hu(e,t){const n=["mouse","pen"];return n.push("",void 0),n.includes(e)}var bA=typeof document<"u",_A=function(){},po=bA?z.useLayoutEffect:_A;const SA={...L};function wa(e){const t=L.useRef(e);return po(()=>{t.current=e}),t}const EA=SA.useInsertionEffect||(e=>e());function xn(e){const t=L.useRef(()=>{if(process.env.NODE_ENV!=="production")throw new Error("Cannot call an event handler while rendering.")});return EA(()=>{t.current=e}),L.useCallback(function(){for(var n=arguments.length,o=new Array(n),s=0;s<n;s++)o[s]=arguments[s];return t.current==null?void 0:t.current(...o)},[])}function qm(e,t,n){let{reference:o,floating:s}=e;const a=vn(t),l=cu(t),c=lu(l),f=Bn(t),d=a==="y",h=o.x+o.width/2-s.width/2,g=o.y+o.height/2-s.height/2,p=o[c]/2-s[c]/2;let m;switch(f){case"top":m={x:h,y:o.y-s.height};break;case"bottom":m={x:h,y:o.y+o.height};break;case"right":m={x:o.x+o.width,y:g};break;case"left":m={x:o.x-s.width,y:g};break;default:m={x:o.x,y:o.y}}switch(fo(t)){case"start":m[l]-=p*(n&&d?-1:1);break;case"end":m[l]+=p*(n&&d?-1:1);break}return m}const CA=async(e,t,n)=>{const{placement:o="bottom",strategy:s="absolute",middleware:a=[],platform:l}=n,c=a.filter(Boolean),f=await(l.isRTL==null?void 0:l.isRTL(t));let d=await l.getElementRects({reference:e,floating:t,strategy:s}),{x:h,y:g}=qm(d,o,f),p=o,m={},x=0;for(let v=0;v<c.length;v++){const{name:b,fn:_}=c[v],{x:N,y:w,data:E,reset:O}=await _({x:h,y:g,initialPlacement:o,placement:p,strategy:s,middlewareData:m,rects:d,platform:l,elements:{reference:e,floating:t}});h=N??h,g=w??g,m={...m,[b]:{...m[b],...E}},O&&x<=50&&(x++,typeof O=="object"&&(O.placement&&(p=O.placement),O.rects&&(d=O.rects===!0?await l.getElementRects({reference:e,floating:t,strategy:s}):O.rects),{x:h,y:g}=qm(d,p,f)),v=-1)}return{x:h,y:g,placement:p,strategy:s,middlewareData:m}};async function Pi(e,t){var n;t===void 0&&(t={});const{x:o,y:s,platform:a,rects:l,elements:c,strategy:f}=e,{boundary:d="clippingAncestors",rootBoundary:h="viewport",elementContext:g="floating",altBoundary:p=!1,padding:m=0}=$n(t,e),x=Xm(m),b=c[p?g==="floating"?"reference":"floating":g],_=va(await a.getClippingRect({element:(n=await(a.isElement==null?void 0:a.isElement(b)))==null||n?b:b.contextElement||await(a.getDocumentElement==null?void 0:a.getDocumentElement(c.floating)),boundary:d,rootBoundary:h,strategy:f})),N=g==="floating"?{x:o,y:s,width:l.floating.width,height:l.floating.height}:l.reference,w=await(a.getOffsetParent==null?void 0:a.getOffsetParent(c.floating)),E=await(a.isElement==null?void 0:a.isElement(w))?await(a.getScale==null?void 0:a.getScale(w))||{x:1,y:1}:{x:1,y:1},O=va(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:c,rect:N,offsetParent:w,strategy:f}):N);return{top:(_.top-O.top+x.top)/E.y,bottom:(O.bottom-_.bottom+x.bottom)/E.y,left:(_.left-O.left+x.left)/E.x,right:(O.right-_.right+x.right)/E.x}}const NA=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:s,rects:a,platform:l,elements:c,middlewareData:f}=t,{element:d,padding:h=0}=$n(e,t)||{};if(d==null)return{};const g=Xm(h),p={x:n,y:o},m=cu(s),x=lu(m),v=await l.getDimensions(d),b=m==="y",_=b?"top":"left",N=b?"bottom":"right",w=b?"clientHeight":"clientWidth",E=a.reference[x]+a.reference[m]-p[m]-a.floating[x],O=p[m]-a.reference[m],k=await(l.getOffsetParent==null?void 0:l.getOffsetParent(d));let M=k?k[w]:0;(!M||!await(l.isElement==null?void 0:l.isElement(k)))&&(M=c.floating[w]||a.floating[x]);const D=E/2-O/2,V=M/2-v[x]/2-1,K=or(g[_],V),Z=or(g[N],V),U=K,q=M-v[x]-Z,C=M/2-v[x]/2+D,H=su(U,C,q),B=!f.arrow&&fo(s)!=null&&C!==H&&a.reference[x]/2-(C<U?K:Z)-v[x]/2<0,R=B?C<U?C-U:C-q:0;return{[m]:p[m]+R,data:{[m]:H,centerOffset:C-H-R,...B&&{alignmentOffset:R}},reset:B}}}),TA=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:s,middlewareData:a,rects:l,initialPlacement:c,platform:f,elements:d}=t,{mainAxis:h=!0,crossAxis:g=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",fallbackAxisSideDirection:x="none",flipAlignment:v=!0,...b}=$n(e,t);if((n=a.arrow)!=null&&n.alignmentOffset)return{};const _=Bn(s),N=vn(c),w=Bn(c)===c,E=await(f.isRTL==null?void 0:f.isRTL(d.floating)),O=p||(w||!v?[ya(c)]:hA(c)),k=x!=="none";!p&&k&&O.push(...yA(c,v,x,E));const M=[c,...O],D=await Pi(t,b),V=[];let K=((o=a.flip)==null?void 0:o.overflows)||[];if(h&&V.push(D[_]),g){const C=dA(s,l,E);V.push(D[C[0]],D[C[1]])}if(K=[...K,{placement:s,overflows:V}],!V.every(C=>C<=0)){var Z,U;const C=(((Z=a.flip)==null?void 0:Z.index)||0)+1,H=M[C];if(H&&(!(g==="alignment"?N!==vn(H):!1)||K.every(P=>vn(P.placement)===N?P.overflows[0]>0:!0)))return{data:{index:C,overflows:K},reset:{placement:H}};let B=(U=K.filter(R=>R.overflows[0]<=0).sort((R,P)=>R.overflows[1]-P.overflows[1])[0])==null?void 0:U.placement;if(!B)switch(m){case"bestFit":{var q;const R=(q=K.filter(P=>{if(k){const W=vn(P.placement);return W===N||W==="y"}return!0}).map(P=>[P.placement,P.overflows.filter(W=>W>0).reduce((W,$)=>W+$,0)]).sort((P,W)=>P[1]-W[1])[0])==null?void 0:q[0];R&&(B=R);break}case"initialPlacement":B=c;break}if(s!==B)return{reset:{placement:B}}}return{}}}};function Km(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Zm(e){return lA.some(t=>e[t]>=0)}const AA=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...s}=$n(e,t);switch(o){case"referenceHidden":{const a=await Pi(t,{...s,elementContext:"reference"}),l=Km(a,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:Zm(l)}}}case"escaped":{const a=await Pi(t,{...s,altBoundary:!0}),l=Km(a,n.floating);return{data:{escapedOffsets:l,escaped:Zm(l)}}}default:return{}}}}},Qm=new Set(["left","top"]);async function IA(e,t){const{placement:n,platform:o,elements:s}=e,a=await(o.isRTL==null?void 0:o.isRTL(s.floating)),l=Bn(n),c=fo(n),f=vn(n)==="y",d=Qm.has(l)?-1:1,h=a&&f?-1:1,g=$n(t,e);let{mainAxis:p,crossAxis:m,alignmentAxis:x}=typeof g=="number"?{mainAxis:g,crossAxis:0,alignmentAxis:null}:{mainAxis:g.mainAxis||0,crossAxis:g.crossAxis||0,alignmentAxis:g.alignmentAxis};return c&&typeof x=="number"&&(m=c==="end"?x*-1:x),f?{x:m*h,y:p*d}:{x:p*d,y:m*h}}const OA=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:s,y:a,placement:l,middlewareData:c}=t,f=await IA(t,e);return l===((n=c.offset)==null?void 0:n.placement)&&(o=c.arrow)!=null&&o.alignmentOffset?{}:{x:s+f.x,y:a+f.y,data:{...f,placement:l}}}}},PA=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:s}=t,{mainAxis:a=!0,crossAxis:l=!1,limiter:c={fn:b=>{let{x:_,y:N}=b;return{x:_,y:N}}},...f}=$n(e,t),d={x:n,y:o},h=await Pi(t,f),g=vn(Bn(s)),p=au(g);let m=d[p],x=d[g];if(a){const b=p==="y"?"top":"left",_=p==="y"?"bottom":"right",N=m+h[b],w=m-h[_];m=su(N,m,w)}if(l){const b=g==="y"?"top":"left",_=g==="y"?"bottom":"right",N=x+h[b],w=x-h[_];x=su(N,x,w)}const v=c.fn({...t,[p]:m,[g]:x});return{...v,data:{x:v.x-n,y:v.y-o,enabled:{[p]:a,[g]:l}}}}}},kA=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:s,rects:a,middlewareData:l}=t,{offset:c=0,mainAxis:f=!0,crossAxis:d=!0}=$n(e,t),h={x:n,y:o},g=vn(s),p=au(g);let m=h[p],x=h[g];const v=$n(c,t),b=typeof v=="number"?{mainAxis:v,crossAxis:0}:{mainAxis:0,crossAxis:0,...v};if(f){const w=p==="y"?"height":"width",E=a.reference[p]-a.floating[w]+b.mainAxis,O=a.reference[p]+a.reference[w]-b.mainAxis;m<E?m=E:m>O&&(m=O)}if(d){var _,N;const w=p==="y"?"width":"height",E=Qm.has(Bn(s)),O=a.reference[g]-a.floating[w]+(E&&((_=l.offset)==null?void 0:_[g])||0)+(E?0:b.crossAxis),k=a.reference[g]+a.reference[w]+(E?0:((N=l.offset)==null?void 0:N[g])||0)-(E?b.crossAxis:0);x<O?x=O:x>k&&(x=k)}return{[p]:m,[g]:x}}}},MA=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:s,rects:a,platform:l,elements:c}=t,{apply:f=()=>{},...d}=$n(e,t),h=await Pi(t,d),g=Bn(s),p=fo(s),m=vn(s)==="y",{width:x,height:v}=a.floating;let b,_;g==="top"||g==="bottom"?(b=g,_=p===(await(l.isRTL==null?void 0:l.isRTL(c.floating))?"start":"end")?"left":"right"):(_=g,b=p==="end"?"top":"bottom");const N=v-h.top-h.bottom,w=x-h.left-h.right,E=or(v-h[b],N),O=or(x-h[_],w),k=!t.middlewareData.shift;let M=E,D=O;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(D=w),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(M=N),k&&!p){const K=Mt(h.left,0),Z=Mt(h.right,0),U=Mt(h.top,0),q=Mt(h.bottom,0);m?D=x-2*(K!==0||Z!==0?K+Z:Mt(h.left,h.right)):M=v-2*(U!==0||q!==0?U+q:Mt(h.top,h.bottom))}await f({...t,availableWidth:D,availableHeight:M});const V=await l.getDimensions(c.floating);return x!==V.width||v!==V.height?{reset:{rects:!0}}:{}}}};function Jm(e){const t=zt(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const s=en(e),a=s?e.offsetWidth:n,l=s?e.offsetHeight:o,c=ga(n)!==a||ga(o)!==l;return c&&(n=a,o=l),{width:n,height:o,$:c}}function pu(e){return Ue(e)?e:e.contextElement}function go(e){const t=pu(e);if(!en(t))return yn(1);const n=t.getBoundingClientRect(),{width:o,height:s,$:a}=Jm(t);let l=(a?ga(n.width):n.width)/o,c=(a?ga(n.height):n.height)/s;return(!l||!Number.isFinite(l))&&(l=1),(!c||!Number.isFinite(c))&&(c=1),{x:l,y:c}}const RA=yn(0);function ey(e){const t=kt(e);return!ha()||!t.visualViewport?RA:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function DA(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==kt(e)?!1:t}function kr(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const s=e.getBoundingClientRect(),a=pu(e);let l=yn(1);t&&(o?Ue(o)&&(l=go(o)):l=go(e));const c=DA(a,n,o)?ey(a):yn(0);let f=(s.left+c.x)/l.x,d=(s.top+c.y)/l.y,h=s.width/l.x,g=s.height/l.y;if(a){const p=kt(a),m=o&&Ue(o)?kt(o):o;let x=p,v=iu(x);for(;v&&o&&m!==x;){const b=go(v),_=v.getBoundingClientRect(),N=zt(v),w=_.left+(v.clientLeft+parseFloat(N.paddingLeft))*b.x,E=_.top+(v.clientTop+parseFloat(N.paddingTop))*b.y;f*=b.x,d*=b.y,h*=b.x,g*=b.y,f+=w,d+=E,x=kt(v),v=iu(x)}}return va({width:h,height:g,x:f,y:d})}function ba(e,t){const n=pa(e).scrollLeft;return t?t.left+n:kr(mn(e)).left+n}function ty(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-ba(e,n),s=n.top+t.scrollTop;return{x:o,y:s}}function LA(e){let{elements:t,rect:n,offsetParent:o,strategy:s}=e;const a=s==="fixed",l=mn(o),c=t?da(t.floating):!1;if(o===l||c&&a)return n;let f={scrollLeft:0,scrollTop:0},d=yn(1);const h=yn(0),g=en(o);if((g||!g&&!a)&&((uo(o)!=="body"||Ii(l))&&(f=pa(o)),en(o))){const m=kr(o);d=go(o),h.x=m.x+o.clientLeft,h.y=m.y+o.clientTop}const p=l&&!g&&!a?ty(l,f):yn(0);return{width:n.width*d.x,height:n.height*d.y,x:n.x*d.x-f.scrollLeft*d.x+h.x+p.x,y:n.y*d.y-f.scrollTop*d.y+h.y+p.y}}function $A(e){return Array.from(e.getClientRects())}function BA(e){const t=mn(e),n=pa(e),o=e.ownerDocument.body,s=Mt(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),a=Mt(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let l=-n.scrollLeft+ba(e);const c=-n.scrollTop;return zt(o).direction==="rtl"&&(l+=Mt(t.clientWidth,o.clientWidth)-s),{width:s,height:a,x:l,y:c}}const ny=25;function FA(e,t){const n=kt(e),o=mn(e),s=n.visualViewport;let a=o.clientWidth,l=o.clientHeight,c=0,f=0;if(s){a=s.width,l=s.height;const h=ha();(!h||h&&t==="fixed")&&(c=s.offsetLeft,f=s.offsetTop)}const d=ba(o);if(d<=0){const h=o.ownerDocument,g=h.body,p=getComputedStyle(g),m=h.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,x=Math.abs(o.clientWidth-g.clientWidth-m);x<=ny&&(a-=x)}else d<=ny&&(a+=d);return{width:a,height:l,x:c,y:f}}const HA=new Set(["absolute","fixed"]);function zA(e,t){const n=kr(e,!0,t==="fixed"),o=n.top+e.clientTop,s=n.left+e.clientLeft,a=en(e)?go(e):yn(1),l=e.clientWidth*a.x,c=e.clientHeight*a.y,f=s*a.x,d=o*a.y;return{width:l,height:c,x:f,y:d}}function ry(e,t,n){let o;if(t==="viewport")o=FA(e,n);else if(t==="document")o=BA(mn(e));else if(Ue(t))o=zA(t,n);else{const s=ey(e);o={x:t.x-s.x,y:t.y-s.y,width:t.width,height:t.height}}return va(o)}function oy(e,t){const n=Ln(e);return n===t||!Ue(n)||Dn(n)?!1:zt(n).position==="fixed"||oy(n,t)}function VA(e,t){const n=t.get(e);if(n)return n;let o=rr(e,[],!1).filter(c=>Ue(c)&&uo(c)!=="body"),s=null;const a=zt(e).position==="fixed";let l=a?Ln(e):e;for(;Ue(l)&&!Dn(l);){const c=zt(l),f=ou(l);!f&&c.position==="fixed"&&(s=null),(a?!f&&!s:!f&&c.position==="static"&&!!s&&HA.has(s.position)||Ii(l)&&!f&&oy(e,l))?o=o.filter(h=>h!==l):s=c,l=Ln(l)}return t.set(e,o),o}function WA(e){let{element:t,boundary:n,rootBoundary:o,strategy:s}=e;const l=[...n==="clippingAncestors"?da(t)?[]:VA(t,this._c):[].concat(n),o],c=l[0],f=l.reduce((d,h)=>{const g=ry(t,h,s);return d.top=Mt(g.top,d.top),d.right=or(g.right,d.right),d.bottom=or(g.bottom,d.bottom),d.left=Mt(g.left,d.left),d},ry(t,c,s));return{width:f.right-f.left,height:f.bottom-f.top,x:f.left,y:f.top}}function jA(e){const{width:t,height:n}=Jm(e);return{width:t,height:n}}function UA(e,t,n){const o=en(t),s=mn(t),a=n==="fixed",l=kr(e,!0,a,t);let c={scrollLeft:0,scrollTop:0};const f=yn(0);function d(){f.x=ba(s)}if(o||!o&&!a)if((uo(t)!=="body"||Ii(s))&&(c=pa(t)),o){const m=kr(t,!0,a,t);f.x=m.x+t.clientLeft,f.y=m.y+t.clientTop}else s&&d();a&&!o&&s&&d();const h=s&&!o&&!a?ty(s,c):yn(0),g=l.left+c.scrollLeft-f.x-h.x,p=l.top+c.scrollTop-f.y-h.y;return{x:g,y:p,width:l.width,height:l.height}}function gu(e){return zt(e).position==="static"}function iy(e,t){if(!en(e)||zt(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return mn(e)===n&&(n=n.ownerDocument.body),n}function sy(e,t){const n=kt(e);if(da(e))return n;if(!en(e)){let s=Ln(e);for(;s&&!Dn(s);){if(Ue(s)&&!gu(s))return s;s=Ln(s)}return n}let o=iy(e,t);for(;o&&tA(o)&&gu(o);)o=iy(o,t);return o&&Dn(o)&&gu(o)&&!ou(o)?n:o||sA(e)||n}const GA=async function(e){const t=this.getOffsetParent||sy,n=this.getDimensions,o=await n(e.floating);return{reference:UA(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function YA(e){return zt(e).direction==="rtl"}const XA={convertOffsetParentRelativeRectToViewportRelativeRect:LA,getDocumentElement:mn,getClippingRect:WA,getOffsetParent:sy,getElementRects:GA,getClientRects:$A,getDimensions:jA,getScale:go,isElement:Ue,isRTL:YA};function ay(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function qA(e,t){let n=null,o;const s=mn(e);function a(){var c;clearTimeout(o),(c=n)==null||c.disconnect(),n=null}function l(c,f){c===void 0&&(c=!1),f===void 0&&(f=1),a();const d=e.getBoundingClientRect(),{left:h,top:g,width:p,height:m}=d;if(c||t(),!p||!m)return;const x=ma(g),v=ma(s.clientWidth-(h+p)),b=ma(s.clientHeight-(g+m)),_=ma(h),w={rootMargin:-x+"px "+-v+"px "+-b+"px "+-_+"px",threshold:Mt(0,or(1,f))||1};let E=!0;function O(k){const M=k[0].intersectionRatio;if(M!==f){if(!E)return l();M?l(!1,M):o=setTimeout(()=>{l(!1,1e-7)},1e3)}M===1&&!ay(d,e.getBoundingClientRect())&&l(),E=!1}try{n=new IntersectionObserver(O,{...w,root:s.ownerDocument})}catch{n=new IntersectionObserver(O,w)}n.observe(e)}return l(!0),a}function mu(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:s=!0,ancestorResize:a=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:c=typeof IntersectionObserver=="function",animationFrame:f=!1}=o,d=pu(e),h=s||a?[...d?rr(d):[],...rr(t)]:[];h.forEach(_=>{s&&_.addEventListener("scroll",n,{passive:!0}),a&&_.addEventListener("resize",n)});const g=d&&c?qA(d,n):null;let p=-1,m=null;l&&(m=new ResizeObserver(_=>{let[N]=_;N&&N.target===d&&m&&(m.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=m)==null||w.observe(t)})),n()}),d&&!f&&m.observe(d),m.observe(t));let x,v=f?kr(e):null;f&&b();function b(){const _=kr(e);v&&!ay(v,_)&&n(),v=_,x=requestAnimationFrame(b)}return n(),()=>{var _;h.forEach(N=>{s&&N.removeEventListener("scroll",n),a&&N.removeEventListener("resize",n)}),g?.(),(_=m)==null||_.disconnect(),m=null,f&&cancelAnimationFrame(x)}}const KA=OA,ZA=PA,QA=TA,JA=MA,eI=AA,ly=NA,tI=kA,nI=(e,t,n)=>{const o=new Map,s={platform:XA,...n},a={...s.platform,_c:o};return CA(e,t,{...s,platform:a})};var rI=typeof document<"u",oI=function(){},_a=rI?z.useLayoutEffect:oI;function Sa(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,s;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!Sa(e[o],t[o]))return!1;return!0}if(s=Object.keys(e),n=s.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,s[o]))return!1;for(o=n;o--!==0;){const a=s[o];if(!(a==="_owner"&&e.$$typeof)&&!Sa(e[a],t[a]))return!1}return!0}return e!==e&&t!==t}function cy(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function uy(e,t){const n=cy(e);return Math.round(t*n)/n}function yu(e){const t=L.useRef(e);return _a(()=>{t.current=e}),t}function fy(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:s,elements:{reference:a,floating:l}={},transform:c=!0,whileElementsMounted:f,open:d}=e,[h,g]=L.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[p,m]=L.useState(o);Sa(p,o)||m(o);const[x,v]=L.useState(null),[b,_]=L.useState(null),N=L.useCallback(P=>{P!==k.current&&(k.current=P,v(P))},[]),w=L.useCallback(P=>{P!==M.current&&(M.current=P,_(P))},[]),E=a||x,O=l||b,k=L.useRef(null),M=L.useRef(null),D=L.useRef(h),V=f!=null,K=yu(f),Z=yu(s),U=yu(d),q=L.useCallback(()=>{if(!k.current||!M.current)return;const P={placement:t,strategy:n,middleware:p};Z.current&&(P.platform=Z.current),nI(k.current,M.current,P).then(W=>{const $={...W,isPositioned:U.current!==!1};C.current&&!Sa(D.current,$)&&(D.current=$,cs.flushSync(()=>{g($)}))})},[p,t,n,Z,U]);_a(()=>{d===!1&&D.current.isPositioned&&(D.current.isPositioned=!1,g(P=>({...P,isPositioned:!1})))},[d]);const C=L.useRef(!1);_a(()=>(C.current=!0,()=>{C.current=!1}),[]),_a(()=>{if(E&&(k.current=E),O&&(M.current=O),E&&O){if(K.current)return K.current(E,O,q);q()}},[E,O,q,K,V]);const H=L.useMemo(()=>({reference:k,floating:M,setReference:N,setFloating:w}),[N,w]),B=L.useMemo(()=>({reference:E,floating:O}),[E,O]),R=L.useMemo(()=>{const P={position:n,left:0,top:0};if(!B.floating)return P;const W=uy(B.floating,h.x),$=uy(B.floating,h.y);return c?{...P,transform:"translate("+W+"px, "+$+"px)",...cy(B.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:W,top:$}},[n,c,B.floating,h.x,h.y]);return L.useMemo(()=>({...h,update:q,refs:H,elements:B,floatingStyles:R}),[h,q,H,B,R])}const iI=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:s}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?ly({element:o.current,padding:s}).fn(n):{}:o?ly({element:o,padding:s}).fn(n):{}}}},vu=(e,t)=>({...KA(e),options:[e,t]}),xu=(e,t)=>({...ZA(e),options:[e,t]}),sI=(e,t)=>({...tI(e),options:[e,t]}),wu=(e,t)=>({...QA(e),options:[e,t]}),aI=(e,t)=>({...JA(e),options:[e,t]}),lI=(e,t)=>({...eI(e),options:[e,t]}),cI=(e,t)=>({...iI(e),options:[e,t]}),uI="data-floating-ui-focusable",dy="active",hy="selected",fI={...L};let py=!1,dI=0;const gy=()=>"floating-ui-"+Math.random().toString(36).slice(2,6)+dI++;function hI(){const[e,t]=L.useState(()=>py?gy():void 0);return po(()=>{e==null&&t(gy())},[]),L.useEffect(()=>{py=!0},[]),e}const pI=fI.useId||hI;let bu;process.env.NODE_ENV!=="production"&&(bu=new Set);function gI(){for(var e,t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];const s="Floating UI: "+n.join(" ");if(!((e=bu)!=null&&e.has(s))){var a;(a=bu)==null||a.add(s),console.error(s)}}function mI(){const e=new Map;return{emit(t,n){var o;(o=e.get(t))==null||o.forEach(s=>s(n))},on(t,n){e.has(t)||e.set(t,new Set),e.get(t).add(n)},off(t,n){var o;(o=e.get(t))==null||o.delete(n)}}}const yI=L.createContext(null),vI=L.createContext(null),my=()=>{var e;return((e=L.useContext(yI))==null?void 0:e.id)||null},_u=()=>L.useContext(vI);function yy(e){return"data-floating-ui-"+e}function Rt(e){e.current!==-1&&(clearTimeout(e.current),e.current=-1)}const vy=yy("safe-polygon");function Su(e,t,n){if(n&&!hu(n))return 0;if(typeof e=="number")return e;if(typeof e=="function"){const o=e();return typeof o=="number"?o:o?.[t]}return e?.[t]}function Eu(e){return typeof e=="function"?e():e}function xI(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,dataRef:s,events:a,elements:l}=e,{enabled:c=!0,delay:f=0,handleClose:d=null,mouseOnly:h=!1,restMs:g=0,move:p=!0}=t,m=_u(),x=my(),v=wa(d),b=wa(f),_=wa(n),N=wa(g),w=L.useRef(),E=L.useRef(-1),O=L.useRef(),k=L.useRef(-1),M=L.useRef(!0),D=L.useRef(!1),V=L.useRef(()=>{}),K=L.useRef(!1),Z=xn(()=>{var R;const P=(R=s.current.openEvent)==null?void 0:R.type;return P?.includes("mouse")&&P!=="mousedown"});L.useEffect(()=>{if(!c)return;function R(P){let{open:W}=P;W||(Rt(E),Rt(k),M.current=!0,K.current=!1)}return a.on("openchange",R),()=>{a.off("openchange",R)}},[c,a]),L.useEffect(()=>{if(!c||!v.current||!n)return;function R(W){Z()&&o(!1,W,"hover")}const P=ho(l.floating).documentElement;return P.addEventListener("mouseleave",R),()=>{P.removeEventListener("mouseleave",R)}},[l.floating,n,o,c,v,Z]);const U=L.useCallback(function(R,P,W){P===void 0&&(P=!0),W===void 0&&(W="hover");const $=Su(b.current,"close",w.current);$&&!O.current?(Rt(E),E.current=window.setTimeout(()=>o(!1,R,W),$)):P&&(Rt(E),o(!1,R,W))},[b,o]),q=xn(()=>{V.current(),O.current=void 0}),C=xn(()=>{if(D.current){const R=ho(l.floating).body;R.style.pointerEvents="",R.removeAttribute(vy),D.current=!1}}),H=xn(()=>s.current.openEvent?["click","mousedown"].includes(s.current.openEvent.type):!1);L.useEffect(()=>{if(!c)return;function R(J){if(Rt(E),M.current=!1,h&&!hu(w.current)||Eu(N.current)>0&&!Su(b.current,"open"))return;const re=Su(b.current,"open",w.current);re?E.current=window.setTimeout(()=>{_.current||o(!0,J,"hover")},re):n||o(!0,J,"hover")}function P(J){if(H()){C();return}V.current();const re=ho(l.floating);if(Rt(k),K.current=!1,v.current&&s.current.floatingContext){n||Rt(E),O.current=v.current({...s.current.floatingContext,tree:m,x:J.clientX,y:J.clientY,onClose(){C(),q(),H()||U(J,!0,"safe-polygon")}});const ce=O.current;re.addEventListener("mousemove",ce),V.current=()=>{re.removeEventListener("mousemove",ce)};return}(w.current==="touch"?!fu(l.floating,J.relatedTarget):!0)&&U(J)}function W(J){H()||s.current.floatingContext&&(v.current==null||v.current({...s.current.floatingContext,tree:m,x:J.clientX,y:J.clientY,onClose(){C(),q(),H()||U(J)}})(J))}function $(){Rt(E)}function G(J){H()||U(J,!1)}if(Ue(l.domReference)){const J=l.domReference,re=l.floating;return n&&J.addEventListener("mouseleave",W),p&&J.addEventListener("mousemove",R,{once:!0}),J.addEventListener("mouseenter",R),J.addEventListener("mouseleave",P),re&&(re.addEventListener("mouseleave",W),re.addEventListener("mouseenter",$),re.addEventListener("mouseleave",G)),()=>{n&&J.removeEventListener("mouseleave",W),p&&J.removeEventListener("mousemove",R),J.removeEventListener("mouseenter",R),J.removeEventListener("mouseleave",P),re&&(re.removeEventListener("mouseleave",W),re.removeEventListener("mouseenter",$),re.removeEventListener("mouseleave",G))}}},[l,c,e,h,p,U,q,C,o,n,_,m,b,v,s,H,N]),po(()=>{var R;if(c&&n&&(R=v.current)!=null&&(R=R.__options)!=null&&R.blockPointerEvents&&Z()){D.current=!0;const W=l.floating;if(Ue(l.domReference)&&W){var P;const $=ho(l.floating).body;$.setAttribute(vy,"");const G=l.domReference,J=m==null||(P=m.nodesRef.current.find(re=>re.id===x))==null||(P=P.context)==null?void 0:P.elements.floating;return J&&(J.style.pointerEvents=""),$.style.pointerEvents="none",G.style.pointerEvents="auto",W.style.pointerEvents="auto",()=>{$.style.pointerEvents="",G.style.pointerEvents="",W.style.pointerEvents=""}}}},[c,n,x,l,m,v,Z]),po(()=>{n||(w.current=void 0,K.current=!1,q(),C())},[n,q,C]),L.useEffect(()=>()=>{q(),Rt(E),Rt(k),C()},[c,l.domReference,q,C]);const B=L.useMemo(()=>{function R(P){w.current=P.pointerType}return{onPointerDown:R,onPointerEnter:R,onMouseMove(P){const{nativeEvent:W}=P;function $(){!M.current&&!_.current&&o(!0,W,"hover")}h&&!hu(w.current)||n||Eu(N.current)===0||K.current&&P.movementX**2+P.movementY**2<2||(Rt(k),w.current==="touch"?$():(K.current=!0,k.current=window.setTimeout($,Eu(N.current))))}}},[h,o,n,_,N]);return L.useMemo(()=>c?{reference:B}:{},[c,B])}function Cu(e,t){if(!e||!t)return!1;const n=t.getRootNode==null?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&fa(n)){let o=t;for(;o;){if(e===o)return!0;o=o.parentNode||o.host}}return!1}function wI(e){return"composedPath"in e?e.composedPath()[0]:e.target}const bI={pointerdown:"onPointerDown",mousedown:"onMouseDown",click:"onClick"},_I={pointerdown:"onPointerDownCapture",mousedown:"onMouseDownCapture",click:"onClickCapture"},xy=e=>{var t,n;return{escapeKey:typeof e=="boolean"?e:(t=e?.escapeKey)!=null?t:!1,outsidePress:typeof e=="boolean"?e:(n=e?.outsidePress)!=null?n:!0}};function SI(e,t){t===void 0&&(t={});const{open:n,onOpenChange:o,elements:s,dataRef:a}=e,{enabled:l=!0,escapeKey:c=!0,outsidePress:f=!0,outsidePressEvent:d="pointerdown",referencePress:h=!1,referencePressEvent:g="pointerdown",ancestorScroll:p=!1,bubbles:m,capture:x}=t,v=_u(),b=xn(typeof f=="function"?f:()=>!1),_=typeof f=="function"?b:f,N=L.useRef(!1),{escapeKey:w,outsidePress:E}=xy(m),{escapeKey:O,outsidePress:k}=xy(x),M=L.useRef(!1),D=xn(C=>{var H;if(!n||!l||!c||C.key!=="Escape"||M.current)return;const B=(H=a.current.floatingContext)==null?void 0:H.nodeId,R=v?xa(v.nodesRef.current,B):[];if(!w&&(C.stopPropagation(),R.length>0)){let P=!0;if(R.forEach(W=>{var $;if(($=W.context)!=null&&$.open&&!W.context.dataRef.current.__escapeKeyBubbles){P=!1;return}}),!P)return}o(!1,wA(C)?C.nativeEvent:C,"escape-key")}),V=xn(C=>{var H;const B=()=>{var R;D(C),(R=Oi(C))==null||R.removeEventListener("keydown",B)};(H=Oi(C))==null||H.addEventListener("keydown",B)}),K=xn(C=>{var H;const B=a.current.insideReactTree;a.current.insideReactTree=!1;const R=N.current;if(N.current=!1,d==="click"&&R||B||typeof _=="function"&&!_(C))return;const P=Oi(C),W="["+yy("inert")+"]",$=ho(s.floating).querySelectorAll(W);let G=Ue(P)?P:null;for(;G&&!Dn(G);){const ce=Ln(G);if(Dn(ce)||!Ue(ce))break;G=ce}if($.length&&Ue(P)&&!xA(P)&&!fu(P,s.floating)&&Array.from($).every(ce=>!fu(G,ce)))return;if(en(P)&&q){const ce=Dn(P),ge=zt(P),te=/auto|scroll/,Q=ce||te.test(ge.overflowX),ae=ce||te.test(ge.overflowY),fe=Q&&P.clientWidth>0&&P.scrollWidth>P.clientWidth,de=ae&&P.clientHeight>0&&P.scrollHeight>P.clientHeight,ue=ge.direction==="rtl",_e=de&&(ue?C.offsetX<=P.offsetWidth-P.clientWidth:C.offsetX>P.clientWidth),ye=fe&&C.offsetY>P.clientHeight;if(_e||ye)return}const J=(H=a.current.floatingContext)==null?void 0:H.nodeId,re=v&&xa(v.nodesRef.current,J).some(ce=>{var ge;return du(C,(ge=ce.context)==null?void 0:ge.elements.floating)});if(du(C,s.floating)||du(C,s.domReference)||re)return;const se=v?xa(v.nodesRef.current,J):[];if(se.length>0){let ce=!0;if(se.forEach(ge=>{var te;if((te=ge.context)!=null&&te.open&&!ge.context.dataRef.current.__outsidePressBubbles){ce=!1;return}}),!ce)return}o(!1,C,"outside-press")}),Z=xn(C=>{var H;const B=()=>{var R;K(C),(R=Oi(C))==null||R.removeEventListener(d,B)};(H=Oi(C))==null||H.addEventListener(d,B)});L.useEffect(()=>{if(!n||!l)return;a.current.__escapeKeyBubbles=w,a.current.__outsidePressBubbles=E;let C=-1;function H($){o(!1,$,"ancestor-scroll")}function B(){window.clearTimeout(C),M.current=!0}function R(){C=window.setTimeout(()=>{M.current=!1},ha()?5:0)}const P=ho(s.floating);c&&(P.addEventListener("keydown",O?V:D,O),P.addEventListener("compositionstart",B),P.addEventListener("compositionend",R)),_&&P.addEventListener(d,k?Z:K,k);let W=[];return p&&(Ue(s.domReference)&&(W=rr(s.domReference)),Ue(s.floating)&&(W=W.concat(rr(s.floating))),!Ue(s.reference)&&s.reference&&s.reference.contextElement&&(W=W.concat(rr(s.reference.contextElement)))),W=W.filter($=>{var G;return $!==((G=P.defaultView)==null?void 0:G.visualViewport)}),W.forEach($=>{$.addEventListener("scroll",H,{passive:!0})}),()=>{c&&(P.removeEventListener("keydown",O?V:D,O),P.removeEventListener("compositionstart",B),P.removeEventListener("compositionend",R)),_&&P.removeEventListener(d,k?Z:K,k),W.forEach($=>{$.removeEventListener("scroll",H)}),window.clearTimeout(C)}},[a,s,c,_,d,n,o,p,l,w,E,D,O,V,K,k,Z]),L.useEffect(()=>{a.current.insideReactTree=!1},[a,_,d]);const U=L.useMemo(()=>({onKeyDown:D,...h&&{[bI[g]]:C=>{o(!1,C.nativeEvent,"reference-press")},...g!=="click"&&{onClick(C){o(!1,C.nativeEvent,"reference-press")}}}}),[D,o,h,g]),q=L.useMemo(()=>({onKeyDown:D,onMouseDown(){N.current=!0},onMouseUp(){N.current=!0},[_I[d]]:()=>{a.current.insideReactTree=!0}}),[D,d,a]);return L.useMemo(()=>l?{reference:U,floating:q}:{},[l,U,q])}function EI(e){const{open:t=!1,onOpenChange:n,elements:o}=e,s=pI(),a=L.useRef({}),[l]=L.useState(()=>mI()),c=my()!=null;if(process.env.NODE_ENV!=="production"){const m=o.reference;m&&!Ue(m)&&gI("Cannot pass a virtual element to the `elements.reference` option,","as it must be a real DOM element. Use `refs.setPositionReference()`","instead.")}const[f,d]=L.useState(o.reference),h=xn((m,x,v)=>{a.current.openEvent=m?x:void 0,l.emit("openchange",{open:m,event:x,reason:v,nested:c}),n?.(m,x,v)}),g=L.useMemo(()=>({setPositionReference:d}),[]),p=L.useMemo(()=>({reference:f||o.reference||null,floating:o.floating||null,domReference:o.reference}),[f,o.reference,o.floating]);return L.useMemo(()=>({dataRef:a,open:t,onOpenChange:h,elements:p,events:l,floatingId:s,refs:g}),[t,h,p,l,s,g])}function wy(e){e===void 0&&(e={});const{nodeId:t}=e,n=EI({...e,elements:{reference:null,floating:null,...e.elements}}),o=e.rootContext||n,s=o.elements,[a,l]=L.useState(null),[c,f]=L.useState(null),h=s?.domReference||a,g=L.useRef(null),p=_u();po(()=>{h&&(g.current=h)},[h]);const m=fy({...e,elements:{...s,...c&&{reference:c}}}),x=L.useCallback(w=>{const E=Ue(w)?{getBoundingClientRect:()=>w.getBoundingClientRect(),getClientRects:()=>w.getClientRects(),contextElement:w}:w;f(E),m.refs.setReference(E)},[m.refs]),v=L.useCallback(w=>{(Ue(w)||w===null)&&(g.current=w,l(w)),(Ue(m.refs.reference.current)||m.refs.reference.current===null||w!==null&&!Ue(w))&&m.refs.setReference(w)},[m.refs]),b=L.useMemo(()=>({...m.refs,setReference:v,setPositionReference:x,domReference:g}),[m.refs,v,x]),_=L.useMemo(()=>({...m.elements,domReference:h}),[m.elements,h]),N=L.useMemo(()=>({...m,...o,refs:b,elements:_,nodeId:t}),[m,b,_,t,o]);return po(()=>{o.dataRef.current.floatingContext=N;const w=p?.nodesRef.current.find(E=>E.id===t);w&&(w.context=N)}),L.useMemo(()=>({...m,context:N,refs:b,elements:_}),[m,b,_,N])}function Nu(e,t,n){const o=new Map,s=n==="item";let a=e;if(s&&e){const{[dy]:l,[hy]:c,...f}=e;a=f}return{...n==="floating"&&{tabIndex:-1,[uI]:""},...a,...t.map(l=>{const c=l?l[n]:null;return typeof c=="function"?e?c(e):null:c}).concat(e).reduce((l,c)=>(c&&Object.entries(c).forEach(f=>{let[d,h]=f;if(!(s&&[dy,hy].includes(d)))if(d.indexOf("on")===0){if(o.has(d)||o.set(d,[]),typeof h=="function"){var g;(g=o.get(d))==null||g.push(h),l[d]=function(){for(var p,m=arguments.length,x=new Array(m),v=0;v<m;v++)x[v]=arguments[v];return(p=o.get(d))==null?void 0:p.map(b=>b(...x)).find(b=>b!==void 0)}}}else l[d]=h}),l),{})}}function by(e){e===void 0&&(e=[]);const t=e.map(c=>c?.reference),n=e.map(c=>c?.floating),o=e.map(c=>c?.item),s=L.useCallback(c=>Nu(c,e,"reference"),t),a=L.useCallback(c=>Nu(c,e,"floating"),n),l=L.useCallback(c=>Nu(c,e,"item"),o);return L.useMemo(()=>({getReferenceProps:s,getFloatingProps:a,getItemProps:l}),[s,a,l])}function _y(e,t,n){return n===void 0&&(n=!0),e.filter(s=>{var a;return s.parentId===t&&(!n||((a=s.context)==null?void 0:a.open))}).flatMap(s=>[s,..._y(e,s.id,n)])}function Sy(e,t){const[n,o]=e;let s=!1;const a=t.length;for(let l=0,c=a-1;l<a;c=l++){const[f,d]=t[l]||[0,0],[h,g]=t[c]||[0,0];d>=o!=g>=o&&n<=(h-f)*(o-d)/(g-d)+f&&(s=!s)}return s}function CI(e,t){return e[0]>=t.x&&e[0]<=t.x+t.width&&e[1]>=t.y&&e[1]<=t.y+t.height}function NI(e){e===void 0&&(e={});const{buffer:t=.5,blockPointerEvents:n=!1,requireIntent:o=!0}=e,s={current:-1};let a=!1,l=null,c=null,f=typeof performance<"u"?performance.now():0;function d(g,p){const m=performance.now(),x=m-f;if(l===null||c===null||x===0)return l=g,c=p,f=m,null;const v=g-l,b=p-c,N=Math.sqrt(v*v+b*b)/x;return l=g,c=p,f=m,N}const h=g=>{let{x:p,y:m,placement:x,elements:v,onClose:b,nodeId:_,tree:N}=g;return function(E){function O(){Rt(s),b()}if(Rt(s),!v.domReference||!v.floating||x==null||p==null||m==null)return;const{clientX:k,clientY:M}=E,D=[k,M],V=wI(E),K=E.type==="mouseleave",Z=Cu(v.floating,V),U=Cu(v.domReference,V),q=v.domReference.getBoundingClientRect(),C=v.floating.getBoundingClientRect(),H=x.split("-")[0],B=p>C.right-C.width/2,R=m>C.bottom-C.height/2,P=CI(D,q),W=C.width>q.width,$=C.height>q.height,G=(W?q:C).left,J=(W?q:C).right,re=($?q:C).top,se=($?q:C).bottom;if(Z&&(a=!0,!K))return;if(U&&(a=!1),U&&!K){a=!0;return}if(K&&Ue(E.relatedTarget)&&Cu(v.floating,E.relatedTarget)||N&&_y(N.nodesRef.current,_).length)return;if(H==="top"&&m>=q.bottom-1||H==="bottom"&&m<=q.top+1||H==="left"&&p>=q.right-1||H==="right"&&p<=q.left+1)return O();let ce=[];switch(H){case"top":ce=[[G,q.top+1],[G,C.bottom-1],[J,C.bottom-1],[J,q.top+1]];break;case"bottom":ce=[[G,C.top+1],[G,q.bottom-1],[J,q.bottom-1],[J,C.top+1]];break;case"left":ce=[[C.right-1,se],[C.right-1,re],[q.left+1,re],[q.left+1,se]];break;case"right":ce=[[q.right-1,se],[q.right-1,re],[C.left+1,re],[C.left+1,se]];break}function ge(te){let[Q,ae]=te;switch(H){case"top":{const fe=[W?Q+t/2:B?Q+t*4:Q-t*4,ae+t+1],de=[W?Q-t/2:B?Q+t*4:Q-t*4,ae+t+1],ue=[[C.left,B||W?C.bottom-t:C.top],[C.right,B?W?C.bottom-t:C.top:C.bottom-t]];return[fe,de,...ue]}case"bottom":{const fe=[W?Q+t/2:B?Q+t*4:Q-t*4,ae-t],de=[W?Q-t/2:B?Q+t*4:Q-t*4,ae-t],ue=[[C.left,B||W?C.top+t:C.bottom],[C.right,B?W?C.top+t:C.bottom:C.top+t]];return[fe,de,...ue]}case"left":{const fe=[Q+t+1,$?ae+t/2:R?ae+t*4:ae-t*4],de=[Q+t+1,$?ae-t/2:R?ae+t*4:ae-t*4];return[...[[R||$?C.right-t:C.left,C.top],[R?$?C.right-t:C.left:C.right-t,C.bottom]],fe,de]}case"right":{const fe=[Q-t,$?ae+t/2:R?ae+t*4:ae-t*4],de=[Q-t,$?ae-t/2:R?ae+t*4:ae-t*4],ue=[[R||$?C.left+t:C.right,C.top],[R?$?C.left+t:C.right:C.left+t,C.bottom]];return[fe,de,...ue]}}}if(!Sy([k,M],ce)){if(a&&!P)return O();if(!K&&o){const te=d(E.clientX,E.clientY);if(te!==null&&te<.1)return O()}Sy([k,M],ge([p,m]))?!a&&o&&(s.current=window.setTimeout(O,40)):O()}}};return h.__options={blockPointerEvents:n},h}const Ey=({subItems:e,onItemClick:t,className:n})=>{const[,o]=z.useState(null),s=a=>{a.onClick&&a.onClick(),t&&t(a)};return T.jsx("ul",{className:Ne("min-w-48 bg-[#181818] border border-none rounded-md shadow-lg py-1",n),children:e.map((a,l)=>T.jsx(TI,{item:a,index:l,onItemClick:s,onItemClickCallback:t,setHoveredItemId:o},a.id))})},TI=({item:e,index:t,onItemClick:n,onItemClickCallback:o,setHoveredItemId:s})=>{const[a,l]=z.useState(!1),{refs:c,floatingStyles:f,context:d}=wy({open:a,onOpenChange:l,placement:"right-start",middleware:[vu(5),wu({fallbackPlacements:["left-start"]}),xu({padding:8})],whileElementsMounted:mu}),h=xI(d,{handleClose:NI(),delay:{open:75,close:75}}),{getReferenceProps:g,getFloatingProps:p}=by([h]),m=()=>{s(e.id),e.subItems&&e.subItems.length>0&&l(!0)},x=()=>{};return T.jsxs("li",{className:"relative",children:[e.separator&&t>0&&T.jsx("div",{className:"border-t border-gray-600 m-0"}),T.jsxs("div",{ref:c.setReference,className:Ne("flex items-center justify-between gap-2 px-3 py-1.25 hover:bg-[#3F3F3F] cursor-pointer","transition-colors duration-150"),onClick:()=>n(e),onMouseEnter:m,onMouseLeave:x,...g(),children:[T.jsxs("div",{className:"flex items-center gap-2",children:[e.icon&&T.jsx("span",{className:"text-primary-white w-3 h-3 flex items-center justify-center",children:e.icon}),T.jsx("span",{className:"text-sm leading-3.5 text-primary-white font-main",children:e.label})]}),T.jsxs("div",{className:"flex items-center gap-2",children:[e.shortcut&&T.jsx("span",{className:"text-sm leading-3.5 text-gray-400 font-mono",children:e.shortcut}),e.subItems&&e.subItems.length>0&&T.jsx(la,{className:"w-3 h-3 text-gray-400"})]})]}),e.subItems&&e.subItems.length>0&&a&&T.jsx("div",{ref:c.setFloating,style:{...f,contain:"layout",willChange:"transform"},className:"z-50",...p(),children:T.jsx(Ey,{subItems:e.subItems,onItemClick:o,className:"ml-1"})})]})},Cy=({subItems:e,className:t,onItemClick:n})=>T.jsx("div",{className:Ne("relative",t),children:T.jsx(Ey,{subItems:e,onItemClick:n})});function Ny({typeOfNodes:e,dispatch:t,setContextMenu:n,contextMenuPosition:o,isRecursionAllowed:s=!0,currentNodeType:a}){const l=Object.keys(e);if(l.length===0)return[];function c(h,g){if(g||!a)return h;const p=Em({typeOfNodes:e},a);return h.filter(m=>!p.has(m))}const d=c(l,s).map(h=>({id:`add-${h}`,label:e[h].name,onClick:()=>{t({type:st.ADD_NODE_AND_SELECT,payload:{type:h,position:o}}),n({isOpen:!1,position:{x:0,y:0}})}}));return[{id:"add-node",label:"Add Node",icon:z.createElement(zm,{className:"w-4 h-4"}),subItems:d}]}function Ty(e,[t,n]){return Math.min(n,Math.max(t,e))}function ot(e,t,{checkForDefaultPrevented:n=!0}={}){return function(s){if(e?.(s),n===!1||!s.defaultPrevented)return t?.(s)}}function Tu(e,t=[]){let n=[];function o(a,l){const c=L.createContext(l),f=n.length;n=[...n,l];const d=g=>{const{scope:p,children:m,...x}=g,v=p?.[e]?.[f]||c,b=L.useMemo(()=>x,Object.values(x));return T.jsx(v.Provider,{value:b,children:m})};d.displayName=a+"Provider";function h(g,p){const m=p?.[e]?.[f]||c,x=L.useContext(m);if(x)return x;if(l!==void 0)return l;throw new Error(`\`${g}\` must be used within \`${a}\``)}return[d,h]}const s=()=>{const a=n.map(l=>L.createContext(l));return function(c){const f=c?.[e]||a;return L.useMemo(()=>({[`__scope${e}`]:{...c,[e]:f}}),[c,f])}};return s.scopeName=e,[o,AI(s,...t)]}function AI(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const o=e.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(a){const l=o.reduce((c,{useScope:f,scopeName:d})=>{const g=f(a)[`__scope${d}`];return{...c,...g}},{});return L.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function II(e){const t=e+"CollectionProvider",[n,o]=Tu(t),[s,a]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=v=>{const{scope:b,children:_}=v,N=z.useRef(null),w=z.useRef(new Map).current;return T.jsx(s,{scope:b,itemMap:w,collectionRef:N,children:_})};l.displayName=t;const c=e+"CollectionSlot",f=Vo(c),d=z.forwardRef((v,b)=>{const{scope:_,children:N}=v,w=a(c,_),E=ut(b,w.collectionRef);return T.jsx(f,{ref:E,children:N})});d.displayName=c;const h=e+"CollectionItemSlot",g="data-radix-collection-item",p=Vo(h),m=z.forwardRef((v,b)=>{const{scope:_,children:N,...w}=v,E=z.useRef(null),O=ut(b,E),k=a(h,_);return z.useEffect(()=>(k.itemMap.set(E,{ref:E,...w}),()=>void k.itemMap.delete(E))),T.jsx(p,{[g]:"",ref:O,children:N})});m.displayName=h;function x(v){const b=a(e+"CollectionConsumer",v);return z.useCallback(()=>{const N=b.collectionRef.current;if(!N)return[];const w=Array.from(N.querySelectorAll(`[${g}]`));return Array.from(b.itemMap.values()).sort((k,M)=>w.indexOf(k.ref.current)-w.indexOf(M.ref.current))},[b.collectionRef,b.itemMap])}return[{Provider:l,Slot:d,ItemSlot:m},x,o]}var OI=L.createContext(void 0);function PI(e){const t=L.useContext(OI);return e||t||"ltr"}var kI=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Je=kI.reduce((e,t)=>{const n=Vo(`Primitive.${t}`),o=L.forwardRef((s,a)=>{const{asChild:l,...c}=s,f=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(f,{...c,ref:a})});return o.displayName=`Primitive.${t}`,{...e,[t]:o}},{});function MI(e,t){e&&cs.flushSync(()=>e.dispatchEvent(t))}function Mr(e){const t=L.useRef(e);return L.useEffect(()=>{t.current=e}),L.useMemo(()=>(...n)=>t.current?.(...n),[])}function RI(e,t=globalThis?.document){const n=Mr(e);L.useEffect(()=>{const o=s=>{s.key==="Escape"&&n(s)};return t.addEventListener("keydown",o,{capture:!0}),()=>t.removeEventListener("keydown",o,{capture:!0})},[n,t])}var DI="DismissableLayer",Au="dismissableLayer.update",LI="dismissableLayer.pointerDownOutside",$I="dismissableLayer.focusOutside",Ay,Iy=L.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Oy=L.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...f}=e,d=L.useContext(Iy),[h,g]=L.useState(null),p=h?.ownerDocument??globalThis?.document,[,m]=L.useState({}),x=ut(t,M=>g(M)),v=Array.from(d.layers),[b]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),_=v.indexOf(b),N=h?v.indexOf(h):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,E=N>=_,O=HI(M=>{const D=M.target,V=[...d.branches].some(K=>K.contains(D));!E||V||(s?.(M),l?.(M),M.defaultPrevented||c?.())},p),k=zI(M=>{const D=M.target;[...d.branches].some(K=>K.contains(D))||(a?.(M),l?.(M),M.defaultPrevented||c?.())},p);return RI(M=>{N===d.layers.size-1&&(o?.(M),!M.defaultPrevented&&c&&(M.preventDefault(),c()))},p),L.useEffect(()=>{if(h)return n&&(d.layersWithOutsidePointerEventsDisabled.size===0&&(Ay=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(h)),d.layers.add(h),Py(),()=>{n&&d.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=Ay)}},[h,p,n,d]),L.useEffect(()=>()=>{h&&(d.layers.delete(h),d.layersWithOutsidePointerEventsDisabled.delete(h),Py())},[h,d]),L.useEffect(()=>{const M=()=>m({});return document.addEventListener(Au,M),()=>document.removeEventListener(Au,M)},[]),T.jsx(Je.div,{...f,ref:x,style:{pointerEvents:w?E?"auto":"none":void 0,...e.style},onFocusCapture:ot(e.onFocusCapture,k.onFocusCapture),onBlurCapture:ot(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:ot(e.onPointerDownCapture,O.onPointerDownCapture)})});Oy.displayName=DI;var BI="DismissableLayerBranch",FI=L.forwardRef((e,t)=>{const n=L.useContext(Iy),o=L.useRef(null),s=ut(t,o);return L.useEffect(()=>{const a=o.current;if(a)return n.branches.add(a),()=>{n.branches.delete(a)}},[n.branches]),T.jsx(Je.div,{...e,ref:s})});FI.displayName=BI;function HI(e,t=globalThis?.document){const n=Mr(e),o=L.useRef(!1),s=L.useRef(()=>{});return L.useEffect(()=>{const a=c=>{if(c.target&&!o.current){let f=function(){ky(LI,n,d,{discrete:!0})};const d={originalEvent:c};c.pointerType==="touch"?(t.removeEventListener("click",s.current),s.current=f,t.addEventListener("click",s.current,{once:!0})):f()}else t.removeEventListener("click",s.current);o.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",a)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",a),t.removeEventListener("click",s.current)}},[t,n]),{onPointerDownCapture:()=>o.current=!0}}function zI(e,t=globalThis?.document){const n=Mr(e),o=L.useRef(!1);return L.useEffect(()=>{const s=a=>{a.target&&!o.current&&ky($I,n,{originalEvent:a},{discrete:!1})};return t.addEventListener("focusin",s),()=>t.removeEventListener("focusin",s)},[t,n]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}function Py(){const e=new CustomEvent(Au);document.dispatchEvent(e)}function ky(e,t,n,{discrete:o}){const s=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&s.addEventListener(e,t,{once:!0}),o?MI(s,a):s.dispatchEvent(a)}var Iu=0;function VI(){L.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??My()),document.body.insertAdjacentElement("beforeend",e[1]??My()),Iu++,()=>{Iu===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Iu--}},[])}function My(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ou="focusScope.autoFocusOnMount",Pu="focusScope.autoFocusOnUnmount",Ry={bubbles:!1,cancelable:!0},WI="FocusScope",Dy=L.forwardRef((e,t)=>{const{loop:n=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,f]=L.useState(null),d=Mr(s),h=Mr(a),g=L.useRef(null),p=ut(t,v=>f(v)),m=L.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;L.useEffect(()=>{if(o){let v=function(w){if(m.paused||!c)return;const E=w.target;c.contains(E)?g.current=E:ir(g.current,{select:!0})},b=function(w){if(m.paused||!c)return;const E=w.relatedTarget;E!==null&&(c.contains(E)||ir(g.current,{select:!0}))},_=function(w){if(document.activeElement===document.body)for(const O of w)O.removedNodes.length>0&&ir(c)};document.addEventListener("focusin",v),document.addEventListener("focusout",b);const N=new MutationObserver(_);return c&&N.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",v),document.removeEventListener("focusout",b),N.disconnect()}}},[o,c,m.paused]),L.useEffect(()=>{if(c){By.add(m);const v=document.activeElement;if(!c.contains(v)){const _=new CustomEvent(Ou,Ry);c.addEventListener(Ou,d),c.dispatchEvent(_),_.defaultPrevented||(jI(qI(Ly(c)),{select:!0}),document.activeElement===v&&ir(c))}return()=>{c.removeEventListener(Ou,d),setTimeout(()=>{const _=new CustomEvent(Pu,Ry);c.addEventListener(Pu,h),c.dispatchEvent(_),_.defaultPrevented||ir(v??document.body,{select:!0}),c.removeEventListener(Pu,h),By.remove(m)},0)}}},[c,d,h,m]);const x=L.useCallback(v=>{if(!n&&!o||m.paused)return;const b=v.key==="Tab"&&!v.altKey&&!v.ctrlKey&&!v.metaKey,_=document.activeElement;if(b&&_){const N=v.currentTarget,[w,E]=UI(N);w&&E?!v.shiftKey&&_===E?(v.preventDefault(),n&&ir(w,{select:!0})):v.shiftKey&&_===w&&(v.preventDefault(),n&&ir(E,{select:!0})):_===N&&v.preventDefault()}},[n,o,m.paused]);return T.jsx(Je.div,{tabIndex:-1,...l,ref:p,onKeyDown:x})});Dy.displayName=WI;function jI(e,{select:t=!1}={}){const n=document.activeElement;for(const o of e)if(ir(o,{select:t}),document.activeElement!==n)return}function UI(e){const t=Ly(e),n=$y(t,e),o=$y(t.reverse(),e);return[n,o]}function Ly(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:o=>{const s=o.tagName==="INPUT"&&o.type==="hidden";return o.disabled||o.hidden||s?NodeFilter.FILTER_SKIP:o.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function $y(e,t){for(const n of e)if(!GI(n,{upTo:t}))return n}function GI(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function YI(e){return e instanceof HTMLInputElement&&"select"in e}function ir(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&YI(e)&&t&&e.select()}}var By=XI();function XI(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Fy(e,t),e.unshift(t)},remove(t){e=Fy(e,t),e[0]?.resume()}}}function Fy(e,t){const n=[...e],o=n.indexOf(t);return o!==-1&&n.splice(o,1),n}function qI(e){return e.filter(t=>t.tagName!=="A")}var St=globalThis?.document?L.useLayoutEffect:()=>{},KI=L[" useId ".trim().toString()]||(()=>{}),ZI=0;function ku(e){const[t,n]=L.useState(KI());return St(()=>{n(o=>o??String(ZI++))},[e]),t?`radix-${t}`:""}var QI="Arrow",Hy=L.forwardRef((e,t)=>{const{children:n,width:o=10,height:s=5,...a}=e;return T.jsx(Je.svg,{...a,ref:t,width:o,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:T.jsx("polygon",{points:"0,0 30,0 15,10"})})});Hy.displayName=QI;var JI=Hy;function eO(e){const[t,n]=L.useState(void 0);return St(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const o=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const a=s[0];let l,c;if("borderBoxSize"in a){const f=a.borderBoxSize,d=Array.isArray(f)?f[0]:f;l=d.inlineSize,c=d.blockSize}else l=e.offsetWidth,c=e.offsetHeight;n({width:l,height:c})});return o.observe(e,{box:"border-box"}),()=>o.unobserve(e)}else n(void 0)},[e]),t}var Mu="Popper",[zy,Vy]=Tu(Mu),[tO,Wy]=zy(Mu),jy=e=>{const{__scopePopper:t,children:n}=e,[o,s]=L.useState(null);return T.jsx(tO,{scope:t,anchor:o,onAnchorChange:s,children:n})};jy.displayName=Mu;var Uy="PopperAnchor",Gy=L.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...s}=e,a=Wy(Uy,n),l=L.useRef(null),c=ut(t,l),f=L.useRef(null);return L.useEffect(()=>{const d=f.current;f.current=o?.current||l.current,d!==f.current&&a.onAnchorChange(f.current)}),o?null:T.jsx(Je.div,{...s,ref:c})});Gy.displayName=Uy;var Ru="PopperContent",[nO,rO]=zy(Ru),Yy=L.forwardRef((e,t)=>{const{__scopePopper:n,side:o="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:f=!0,collisionBoundary:d=[],collisionPadding:h=0,sticky:g="partial",hideWhenDetached:p=!1,updatePositionStrategy:m="optimized",onPlaced:x,...v}=e,b=Wy(Ru,n),[_,N]=L.useState(null),w=ut(t,te=>N(te)),[E,O]=L.useState(null),k=eO(E),M=k?.width??0,D=k?.height??0,V=o+(a!=="center"?"-"+a:""),K=typeof h=="number"?h:{top:0,right:0,bottom:0,left:0,...h},Z=Array.isArray(d)?d:[d],U=Z.length>0,q={padding:K,boundary:Z.filter(iO),altBoundary:U},{refs:C,floatingStyles:H,placement:B,isPositioned:R,middlewareData:P}=fy({strategy:"fixed",placement:V,whileElementsMounted:(...te)=>mu(...te,{animationFrame:m==="always"}),elements:{reference:b.anchor},middleware:[vu({mainAxis:s+D,alignmentAxis:l}),f&&xu({mainAxis:!0,crossAxis:!1,limiter:g==="partial"?sI():void 0,...q}),f&&wu({...q}),aI({...q,apply:({elements:te,rects:Q,availableWidth:ae,availableHeight:fe})=>{const{width:de,height:ue}=Q.reference,_e=te.floating.style;_e.setProperty("--radix-popper-available-width",`${ae}px`),_e.setProperty("--radix-popper-available-height",`${fe}px`),_e.setProperty("--radix-popper-anchor-width",`${de}px`),_e.setProperty("--radix-popper-anchor-height",`${ue}px`)}}),E&&cI({element:E,padding:c}),sO({arrowWidth:M,arrowHeight:D}),p&&lI({strategy:"referenceHidden",...q})]}),[W,$]=Ky(B),G=Mr(x);St(()=>{R&&G?.()},[R,G]);const J=P.arrow?.x,re=P.arrow?.y,se=P.arrow?.centerOffset!==0,[ce,ge]=L.useState();return St(()=>{_&&ge(window.getComputedStyle(_).zIndex)},[_]),T.jsx("div",{ref:C.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:R?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:ce,"--radix-popper-transform-origin":[P.transformOrigin?.x,P.transformOrigin?.y].join(" "),...P.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:T.jsx(nO,{scope:n,placedSide:W,onArrowChange:O,arrowX:J,arrowY:re,shouldHideArrow:se,children:T.jsx(Je.div,{"data-side":W,"data-align":$,...v,ref:w,style:{...v.style,animation:R?void 0:"none"}})})})});Yy.displayName=Ru;var Xy="PopperArrow",oO={top:"bottom",right:"left",bottom:"top",left:"right"},qy=L.forwardRef(function(t,n){const{__scopePopper:o,...s}=t,a=rO(Xy,o),l=oO[a.placedSide];return T.jsx("span",{ref:a.onArrowChange,style:{position:"absolute",left:a.arrowX,top:a.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[a.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[a.placedSide],visibility:a.shouldHideArrow?"hidden":void 0},children:T.jsx(JI,{...s,ref:n,style:{...s.style,display:"block"}})})});qy.displayName=Xy;function iO(e){return e!==null}var sO=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:o,middlewareData:s}=t,l=s.arrow?.centerOffset!==0,c=l?0:e.arrowWidth,f=l?0:e.arrowHeight,[d,h]=Ky(n),g={start:"0%",center:"50%",end:"100%"}[h],p=(s.arrow?.x??0)+c/2,m=(s.arrow?.y??0)+f/2;let x="",v="";return d==="bottom"?(x=l?g:`${p}px`,v=`${-f}px`):d==="top"?(x=l?g:`${p}px`,v=`${o.floating.height+f}px`):d==="right"?(x=`${-f}px`,v=l?g:`${m}px`):d==="left"&&(x=`${o.floating.width+f}px`,v=l?g:`${m}px`),{data:{x,y:v}}}});function Ky(e){const[t,n="center"]=e.split("-");return[t,n]}var aO=jy,lO=Gy,cO=Yy,uO=qy,fO="Portal",Zy=L.forwardRef((e,t)=>{const{container:n,...o}=e,[s,a]=L.useState(!1);St(()=>a(!0),[]);const l=n||s&&globalThis?.document?.body;return l?Hd.createPortal(T.jsx(Je.div,{...o,ref:t}),l):null});Zy.displayName=fO;var dO=L[" useInsertionEffect ".trim().toString()]||St;function Qy({prop:e,defaultProp:t,onChange:n=()=>{},caller:o}){const[s,a,l]=hO({defaultProp:t,onChange:n}),c=e!==void 0,f=c?e:s;{const h=L.useRef(e!==void 0);L.useEffect(()=>{const g=h.current;g!==c&&console.warn(`${o} is changing from ${g?"controlled":"uncontrolled"} to ${c?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),h.current=c},[c,o])}const d=L.useCallback(h=>{if(c){const g=pO(h)?h(e):h;g!==e&&l.current?.(g)}else a(h)},[c,e,a,l]);return[f,d]}function hO({defaultProp:e,onChange:t}){const[n,o]=L.useState(e),s=L.useRef(n),a=L.useRef(t);return dO(()=>{a.current=t},[t]),L.useEffect(()=>{s.current!==n&&(a.current?.(n),s.current=n)},[n,s]),[n,o,a]}function pO(e){return typeof e=="function"}function gO(e){const t=L.useRef({value:e,previous:e});return L.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var Jy=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),mO="VisuallyHidden",yO=L.forwardRef((e,t)=>T.jsx(Je.span,{...e,ref:t,style:{...Jy,...e.style}}));yO.displayName=mO;var vO=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},mo=new WeakMap,Ea=new WeakMap,Ca={},Du=0,e0=function(e){return e&&(e.host||e0(e.parentNode))},xO=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=e0(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},wO=function(e,t,n,o){var s=xO(t,Array.isArray(e)?e:[e]);Ca[n]||(Ca[n]=new WeakMap);var a=Ca[n],l=[],c=new Set,f=new Set(s),d=function(g){!g||c.has(g)||(c.add(g),d(g.parentNode))};s.forEach(d);var h=function(g){!g||f.has(g)||Array.prototype.forEach.call(g.children,function(p){if(c.has(p))h(p);else try{var m=p.getAttribute(o),x=m!==null&&m!=="false",v=(mo.get(p)||0)+1,b=(a.get(p)||0)+1;mo.set(p,v),a.set(p,b),l.push(p),v===1&&x&&Ea.set(p,!0),b===1&&p.setAttribute(n,"true"),x||p.setAttribute(o,"true")}catch(_){console.error("aria-hidden: cannot operate on ",p,_)}})};return h(t),c.clear(),Du++,function(){l.forEach(function(g){var p=mo.get(g)-1,m=a.get(g)-1;mo.set(g,p),a.set(g,m),p||(Ea.has(g)||g.removeAttribute(o),Ea.delete(g)),m||g.removeAttribute(n)}),Du--,Du||(mo=new WeakMap,mo=new WeakMap,Ea=new WeakMap,Ca={})}},bO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),s=vO(e);return s?(o.push.apply(o,Array.from(s.querySelectorAll("[aria-live], script"))),wO(o,s,n,"aria-hidden")):function(){return null}},wn=function(){return wn=Object.assign||function(t){for(var n,o=1,s=arguments.length;o<s;o++){n=arguments[o];for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&(t[a]=n[a])}return t},wn.apply(this,arguments)};function t0(e,t){var n={};for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&t.indexOf(o)<0&&(n[o]=e[o]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,o=Object.getOwnPropertySymbols(e);s<o.length;s++)t.indexOf(o[s])<0&&Object.prototype.propertyIsEnumerable.call(e,o[s])&&(n[o[s]]=e[o[s]]);return n}function _O(e,t,n){if(n||arguments.length===2)for(var o=0,s=t.length,a;o<s;o++)(a||!(o in t))&&(a||(a=Array.prototype.slice.call(t,0,o)),a[o]=t[o]);return e.concat(a||Array.prototype.slice.call(t))}typeof SuppressedError=="function"&&SuppressedError;var Na="right-scroll-bar-position",Ta="width-before-scroll-bar",SO="with-scroll-bars-hidden",EO="--removed-body-scroll-bar-size";function Lu(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function CO(e,t){var n=z.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(o){var s=n.value;s!==o&&(n.value=o,n.callback(o,s))}}}})[0];return n.callback=t,n.facade}var NO=typeof window<"u"?L.useLayoutEffect:L.useEffect,n0=new WeakMap;function TO(e,t){var n=CO(null,function(o){return e.forEach(function(s){return Lu(s,o)})});return NO(function(){var o=n0.get(n);if(o){var s=new Set(o),a=new Set(e),l=n.current;s.forEach(function(c){a.has(c)||Lu(c,null)}),a.forEach(function(c){s.has(c)||Lu(c,l)})}n0.set(n,e)},[e]),n}function AO(e){return e}function IO(e,t){t===void 0&&(t=AO);var n=[],o=!1,s={read:function(){if(o)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(a){var l=t(a,o);return n.push(l),function(){n=n.filter(function(c){return c!==l})}},assignSyncMedium:function(a){for(o=!0;n.length;){var l=n;n=[],l.forEach(a)}n={push:function(c){return a(c)},filter:function(){return n}}},assignMedium:function(a){o=!0;var l=[];if(n.length){var c=n;n=[],c.forEach(a),l=n}var f=function(){var h=l;l=[],h.forEach(a)},d=function(){return Promise.resolve().then(f)};d(),n={push:function(h){l.push(h),d()},filter:function(h){return l=l.filter(h),n}}}};return s}function OO(e){e===void 0&&(e={});var t=IO(null);return t.options=wn({async:!0,ssr:!1},e),t}var r0=function(e){var t=e.sideCar,n=t0(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=t.read();if(!o)throw new Error("Sidecar medium not found");return L.createElement(o,wn({},n))};r0.isSideCarExport=!0;function PO(e,t){return e.useMedium(t),r0}var o0=OO(),$u=function(){},Aa=L.forwardRef(function(e,t){var n=L.useRef(null),o=L.useState({onScrollCapture:$u,onWheelCapture:$u,onTouchMoveCapture:$u}),s=o[0],a=o[1],l=e.forwardProps,c=e.children,f=e.className,d=e.removeScrollBar,h=e.enabled,g=e.shards,p=e.sideCar,m=e.noRelative,x=e.noIsolation,v=e.inert,b=e.allowPinchZoom,_=e.as,N=_===void 0?"div":_,w=e.gapMode,E=t0(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),O=p,k=TO([n,t]),M=wn(wn({},E),s);return L.createElement(L.Fragment,null,h&&L.createElement(O,{sideCar:o0,removeScrollBar:d,shards:g,noRelative:m,noIsolation:x,inert:v,setCallbacks:a,allowPinchZoom:!!b,lockRef:n,gapMode:w}),l?L.cloneElement(L.Children.only(c),wn(wn({},M),{ref:k})):L.createElement(N,wn({},M,{className:f,ref:k}),c))});Aa.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Aa.classNames={fullWidth:Ta,zeroRight:Na};var kO=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function MO(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=kO();return t&&e.setAttribute("nonce",t),e}function RO(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function DO(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var LO=function(){var e=0,t=null;return{add:function(n){e==0&&(t=MO())&&(RO(t,n),DO(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},$O=function(){var e=LO();return function(t,n){L.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},i0=function(){var e=$O(),t=function(n){var o=n.styles,s=n.dynamic;return e(o,s),null};return t},BO={left:0,top:0,right:0,gap:0},Bu=function(e){return parseInt(e||"",10)||0},FO=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],o=t[e==="padding"?"paddingTop":"marginTop"],s=t[e==="padding"?"paddingRight":"marginRight"];return[Bu(n),Bu(o),Bu(s)]},HO=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return BO;var t=FO(e),n=document.documentElement.clientWidth,o=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,o-n+t[2]-t[0])}},zO=i0(),yo="data-scroll-locked",VO=function(e,t,n,o){var s=e.left,a=e.top,l=e.right,c=e.gap;return n===void 0&&(n="margin"),`
148
+ .`.concat(SO,` {
149
+ overflow: hidden `).concat(o,`;
150
+ padding-right: `).concat(c,"px ").concat(o,`;
151
+ }
152
+ body[`).concat(yo,`] {
153
+ overflow: hidden `).concat(o,`;
154
+ overscroll-behavior: contain;
155
+ `).concat([t&&"position: relative ".concat(o,";"),n==="margin"&&`
156
+ padding-left: `.concat(s,`px;
157
+ padding-top: `).concat(a,`px;
158
+ padding-right: `).concat(l,`px;
159
+ margin-left:0;
160
+ margin-top:0;
161
+ margin-right: `).concat(c,"px ").concat(o,`;
162
+ `),n==="padding"&&"padding-right: ".concat(c,"px ").concat(o,";")].filter(Boolean).join(""),`
163
+ }
164
+
165
+ .`).concat(Na,` {
166
+ right: `).concat(c,"px ").concat(o,`;
167
+ }
168
+
169
+ .`).concat(Ta,` {
170
+ margin-right: `).concat(c,"px ").concat(o,`;
171
+ }
172
+
173
+ .`).concat(Na," .").concat(Na,` {
174
+ right: 0 `).concat(o,`;
175
+ }
176
+
177
+ .`).concat(Ta," .").concat(Ta,` {
178
+ margin-right: 0 `).concat(o,`;
179
+ }
180
+
181
+ body[`).concat(yo,`] {
182
+ `).concat(EO,": ").concat(c,`px;
183
+ }
184
+ `)},s0=function(){var e=parseInt(document.body.getAttribute(yo)||"0",10);return isFinite(e)?e:0},WO=function(){L.useEffect(function(){return document.body.setAttribute(yo,(s0()+1).toString()),function(){var e=s0()-1;e<=0?document.body.removeAttribute(yo):document.body.setAttribute(yo,e.toString())}},[])},jO=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,s=o===void 0?"margin":o;WO();var a=L.useMemo(function(){return HO(s)},[s]);return L.createElement(zO,{styles:VO(a,!t,s,n?"":"!important")})},Fu=!1;if(typeof window<"u")try{var Ia=Object.defineProperty({},"passive",{get:function(){return Fu=!0,!0}});window.addEventListener("test",Ia,Ia),window.removeEventListener("test",Ia,Ia)}catch{Fu=!1}var vo=Fu?{passive:!1}:!1,UO=function(e){return e.tagName==="TEXTAREA"},a0=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!UO(e)&&n[t]==="visible")},GO=function(e){return a0(e,"overflowY")},YO=function(e){return a0(e,"overflowX")},l0=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var s=c0(e,o);if(s){var a=u0(e,o),l=a[1],c=a[2];if(l>c)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},XO=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},qO=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},c0=function(e,t){return e==="v"?GO(t):YO(t)},u0=function(e,t){return e==="v"?XO(t):qO(t)},KO=function(e,t){return e==="h"&&t==="rtl"?-1:1},ZO=function(e,t,n,o,s){var a=KO(e,window.getComputedStyle(t).direction),l=a*o,c=n.target,f=t.contains(c),d=!1,h=l>0,g=0,p=0;do{if(!c)break;var m=u0(e,c),x=m[0],v=m[1],b=m[2],_=v-b-a*x;(x||_)&&c0(e,c)&&(g+=_,p+=x);var N=c.parentNode;c=N&&N.nodeType===Node.DOCUMENT_FRAGMENT_NODE?N.host:N}while(!f&&c!==document.body||f&&(t.contains(c)||t===c));return(h&&Math.abs(g)<1||!h&&Math.abs(p)<1)&&(d=!0),d},Oa=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},f0=function(e){return[e.deltaX,e.deltaY]},d0=function(e){return e&&"current"in e?e.current:e},QO=function(e,t){return e[0]===t[0]&&e[1]===t[1]},JO=function(e){return`
185
+ .block-interactivity-`.concat(e,` {pointer-events: none;}
186
+ .allow-interactivity-`).concat(e,` {pointer-events: all;}
187
+ `)},eP=0,xo=[];function tP(e){var t=L.useRef([]),n=L.useRef([0,0]),o=L.useRef(),s=L.useState(eP++)[0],a=L.useState(i0)[0],l=L.useRef(e);L.useEffect(function(){l.current=e},[e]),L.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(s));var v=_O([e.lockRef.current],(e.shards||[]).map(d0),!0).filter(Boolean);return v.forEach(function(b){return b.classList.add("allow-interactivity-".concat(s))}),function(){document.body.classList.remove("block-interactivity-".concat(s)),v.forEach(function(b){return b.classList.remove("allow-interactivity-".concat(s))})}}},[e.inert,e.lockRef.current,e.shards]);var c=L.useCallback(function(v,b){if("touches"in v&&v.touches.length===2||v.type==="wheel"&&v.ctrlKey)return!l.current.allowPinchZoom;var _=Oa(v),N=n.current,w="deltaX"in v?v.deltaX:N[0]-_[0],E="deltaY"in v?v.deltaY:N[1]-_[1],O,k=v.target,M=Math.abs(w)>Math.abs(E)?"h":"v";if("touches"in v&&M==="h"&&k.type==="range")return!1;var D=l0(M,k);if(!D)return!0;if(D?O=M:(O=M==="v"?"h":"v",D=l0(M,k)),!D)return!1;if(!o.current&&"changedTouches"in v&&(w||E)&&(o.current=O),!O)return!0;var V=o.current||O;return ZO(V,b,v,V==="h"?w:E)},[]),f=L.useCallback(function(v){var b=v;if(!(!xo.length||xo[xo.length-1]!==a)){var _="deltaY"in b?f0(b):Oa(b),N=t.current.filter(function(O){return O.name===b.type&&(O.target===b.target||b.target===O.shadowParent)&&QO(O.delta,_)})[0];if(N&&N.should){b.cancelable&&b.preventDefault();return}if(!N){var w=(l.current.shards||[]).map(d0).filter(Boolean).filter(function(O){return O.contains(b.target)}),E=w.length>0?c(b,w[0]):!l.current.noIsolation;E&&b.cancelable&&b.preventDefault()}}},[]),d=L.useCallback(function(v,b,_,N){var w={name:v,delta:b,target:_,should:N,shadowParent:nP(_)};t.current.push(w),setTimeout(function(){t.current=t.current.filter(function(E){return E!==w})},1)},[]),h=L.useCallback(function(v){n.current=Oa(v),o.current=void 0},[]),g=L.useCallback(function(v){d(v.type,f0(v),v.target,c(v,e.lockRef.current))},[]),p=L.useCallback(function(v){d(v.type,Oa(v),v.target,c(v,e.lockRef.current))},[]);L.useEffect(function(){return xo.push(a),e.setCallbacks({onScrollCapture:g,onWheelCapture:g,onTouchMoveCapture:p}),document.addEventListener("wheel",f,vo),document.addEventListener("touchmove",f,vo),document.addEventListener("touchstart",h,vo),function(){xo=xo.filter(function(v){return v!==a}),document.removeEventListener("wheel",f,vo),document.removeEventListener("touchmove",f,vo),document.removeEventListener("touchstart",h,vo)}},[]);var m=e.removeScrollBar,x=e.inert;return L.createElement(L.Fragment,null,x?L.createElement(a,{styles:JO(s)}):null,m?L.createElement(jO,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function nP(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const rP=PO(o0,tP);var h0=L.forwardRef(function(e,t){return L.createElement(Aa,wn({},e,{ref:t,sideCar:rP}))});h0.classNames=Aa.classNames;var oP=[" ","Enter","ArrowUp","ArrowDown"],iP=[" ","Enter"],Rr="Select",[Pa,ka,sP]=II(Rr),[wo,X$]=Tu(Rr,[sP,Vy]),Ma=Vy(),[aP,sr]=wo(Rr),[lP,cP]=wo(Rr),p0=e=>{const{__scopeSelect:t,children:n,open:o,defaultOpen:s,onOpenChange:a,value:l,defaultValue:c,onValueChange:f,dir:d,name:h,autoComplete:g,disabled:p,required:m,form:x}=e,v=Ma(t),[b,_]=L.useState(null),[N,w]=L.useState(null),[E,O]=L.useState(!1),k=PI(d),[M,D]=Qy({prop:o,defaultProp:s??!1,onChange:a,caller:Rr}),[V,K]=Qy({prop:l,defaultProp:c,onChange:f,caller:Rr}),Z=L.useRef(null),U=b?x||!!b.closest("form"):!0,[q,C]=L.useState(new Set),H=Array.from(q).map(B=>B.props.value).join(";");return T.jsx(aO,{...v,children:T.jsxs(aP,{required:m,scope:t,trigger:b,onTriggerChange:_,valueNode:N,onValueNodeChange:w,valueNodeHasChildren:E,onValueNodeHasChildrenChange:O,contentId:ku(),value:V,onValueChange:K,open:M,onOpenChange:D,dir:k,triggerPointerDownPosRef:Z,disabled:p,children:[T.jsx(Pa.Provider,{scope:t,children:T.jsx(lP,{scope:e.__scopeSelect,onNativeOptionAdd:L.useCallback(B=>{C(R=>new Set(R).add(B))},[]),onNativeOptionRemove:L.useCallback(B=>{C(R=>{const P=new Set(R);return P.delete(B),P})},[]),children:n})}),U?T.jsxs(F0,{"aria-hidden":!0,required:m,tabIndex:-1,name:h,autoComplete:g,value:V,onChange:B=>K(B.target.value),disabled:p,form:x,children:[V===void 0?T.jsx("option",{value:""}):null,Array.from(q)]},H):null]})})};p0.displayName=Rr;var g0="SelectTrigger",m0=L.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:o=!1,...s}=e,a=Ma(n),l=sr(g0,n),c=l.disabled||o,f=ut(t,l.onTriggerChange),d=ka(n),h=L.useRef("touch"),[g,p,m]=z0(v=>{const b=d().filter(w=>!w.disabled),_=b.find(w=>w.value===l.value),N=V0(b,v,_);N!==void 0&&l.onValueChange(N.value)}),x=v=>{c||(l.onOpenChange(!0),m()),v&&(l.triggerPointerDownPosRef.current={x:Math.round(v.pageX),y:Math.round(v.pageY)})};return T.jsx(lO,{asChild:!0,...a,children:T.jsx(Je.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":H0(l.value)?"":void 0,...s,ref:f,onClick:ot(s.onClick,v=>{v.currentTarget.focus(),h.current!=="mouse"&&x(v)}),onPointerDown:ot(s.onPointerDown,v=>{h.current=v.pointerType;const b=v.target;b.hasPointerCapture(v.pointerId)&&b.releasePointerCapture(v.pointerId),v.button===0&&v.ctrlKey===!1&&v.pointerType==="mouse"&&(x(v),v.preventDefault())}),onKeyDown:ot(s.onKeyDown,v=>{const b=g.current!=="";!(v.ctrlKey||v.altKey||v.metaKey)&&v.key.length===1&&p(v.key),!(b&&v.key===" ")&&oP.includes(v.key)&&(x(),v.preventDefault())})})})});m0.displayName=g0;var y0="SelectValue",v0=L.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:s,children:a,placeholder:l="",...c}=e,f=sr(y0,n),{onValueNodeHasChildrenChange:d}=f,h=a!==void 0,g=ut(t,f.onValueNodeChange);return St(()=>{d(h)},[d,h]),T.jsx(Je.span,{...c,ref:g,style:{pointerEvents:"none"},children:H0(f.value)?T.jsx(T.Fragment,{children:l}):a})});v0.displayName=y0;var uP="SelectIcon",x0=L.forwardRef((e,t)=>{const{__scopeSelect:n,children:o,...s}=e;return T.jsx(Je.span,{"aria-hidden":!0,...s,ref:t,children:o||"▼"})});x0.displayName=uP;var fP="SelectPortal",w0=e=>T.jsx(Zy,{asChild:!0,...e});w0.displayName=fP;var Dr="SelectContent",b0=L.forwardRef((e,t)=>{const n=sr(Dr,e.__scopeSelect),[o,s]=L.useState();if(St(()=>{s(new DocumentFragment)},[]),!n.open){const a=o;return a?cs.createPortal(T.jsx(_0,{scope:e.__scopeSelect,children:T.jsx(Pa.Slot,{scope:e.__scopeSelect,children:T.jsx("div",{children:e.children})})}),a):null}return T.jsx(S0,{...e,ref:t})});b0.displayName=Dr;var tn=10,[_0,ar]=wo(Dr),dP="SelectContentImpl",hP=Vo("SelectContent.RemoveScroll"),S0=L.forwardRef((e,t)=>{const{__scopeSelect:n,position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:l,side:c,sideOffset:f,align:d,alignOffset:h,arrowPadding:g,collisionBoundary:p,collisionPadding:m,sticky:x,hideWhenDetached:v,avoidCollisions:b,..._}=e,N=sr(Dr,n),[w,E]=L.useState(null),[O,k]=L.useState(null),M=ut(t,te=>E(te)),[D,V]=L.useState(null),[K,Z]=L.useState(null),U=ka(n),[q,C]=L.useState(!1),H=L.useRef(!1);L.useEffect(()=>{if(w)return bO(w)},[w]),VI();const B=L.useCallback(te=>{const[Q,...ae]=U().map(ue=>ue.ref.current),[fe]=ae.slice(-1),de=document.activeElement;for(const ue of te)if(ue===de||(ue?.scrollIntoView({block:"nearest"}),ue===Q&&O&&(O.scrollTop=0),ue===fe&&O&&(O.scrollTop=O.scrollHeight),ue?.focus(),document.activeElement!==de))return},[U,O]),R=L.useCallback(()=>B([D,w]),[B,D,w]);L.useEffect(()=>{q&&R()},[q,R]);const{onOpenChange:P,triggerPointerDownPosRef:W}=N;L.useEffect(()=>{if(w){let te={x:0,y:0};const Q=fe=>{te={x:Math.abs(Math.round(fe.pageX)-(W.current?.x??0)),y:Math.abs(Math.round(fe.pageY)-(W.current?.y??0))}},ae=fe=>{te.x<=10&&te.y<=10?fe.preventDefault():w.contains(fe.target)||P(!1),document.removeEventListener("pointermove",Q),W.current=null};return W.current!==null&&(document.addEventListener("pointermove",Q),document.addEventListener("pointerup",ae,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",Q),document.removeEventListener("pointerup",ae,{capture:!0})}}},[w,P,W]),L.useEffect(()=>{const te=()=>P(!1);return window.addEventListener("blur",te),window.addEventListener("resize",te),()=>{window.removeEventListener("blur",te),window.removeEventListener("resize",te)}},[P]);const[$,G]=z0(te=>{const Q=U().filter(de=>!de.disabled),ae=Q.find(de=>de.ref.current===document.activeElement),fe=V0(Q,te,ae);fe&&setTimeout(()=>fe.ref.current.focus())}),J=L.useCallback((te,Q,ae)=>{const fe=!H.current&&!ae;(N.value!==void 0&&N.value===Q||fe)&&(V(te),fe&&(H.current=!0))},[N.value]),re=L.useCallback(()=>w?.focus(),[w]),se=L.useCallback((te,Q,ae)=>{const fe=!H.current&&!ae;(N.value!==void 0&&N.value===Q||fe)&&Z(te)},[N.value]),ce=o==="popper"?Hu:E0,ge=ce===Hu?{side:c,sideOffset:f,align:d,alignOffset:h,arrowPadding:g,collisionBoundary:p,collisionPadding:m,sticky:x,hideWhenDetached:v,avoidCollisions:b}:{};return T.jsx(_0,{scope:n,content:w,viewport:O,onViewportChange:k,itemRefCallback:J,selectedItem:D,onItemLeave:re,itemTextRefCallback:se,focusSelectedItem:R,selectedItemText:K,position:o,isPositioned:q,searchRef:$,children:T.jsx(h0,{as:hP,allowPinchZoom:!0,children:T.jsx(Dy,{asChild:!0,trapped:N.open,onMountAutoFocus:te=>{te.preventDefault()},onUnmountAutoFocus:ot(s,te=>{N.trigger?.focus({preventScroll:!0}),te.preventDefault()}),children:T.jsx(Oy,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:te=>te.preventDefault(),onDismiss:()=>N.onOpenChange(!1),children:T.jsx(ce,{role:"listbox",id:N.contentId,"data-state":N.open?"open":"closed",dir:N.dir,onContextMenu:te=>te.preventDefault(),..._,...ge,onPlaced:()=>C(!0),ref:M,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:ot(_.onKeyDown,te=>{const Q=te.ctrlKey||te.altKey||te.metaKey;if(te.key==="Tab"&&te.preventDefault(),!Q&&te.key.length===1&&G(te.key),["ArrowUp","ArrowDown","Home","End"].includes(te.key)){let fe=U().filter(de=>!de.disabled).map(de=>de.ref.current);if(["ArrowUp","End"].includes(te.key)&&(fe=fe.slice().reverse()),["ArrowUp","ArrowDown"].includes(te.key)){const de=te.target,ue=fe.indexOf(de);fe=fe.slice(ue+1)}setTimeout(()=>B(fe)),te.preventDefault()}})})})})})})});S0.displayName=dP;var pP="SelectItemAlignedPosition",E0=L.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:o,...s}=e,a=sr(Dr,n),l=ar(Dr,n),[c,f]=L.useState(null),[d,h]=L.useState(null),g=ut(t,M=>h(M)),p=ka(n),m=L.useRef(!1),x=L.useRef(!0),{viewport:v,selectedItem:b,selectedItemText:_,focusSelectedItem:N}=l,w=L.useCallback(()=>{if(a.trigger&&a.valueNode&&c&&d&&v&&b&&_){const M=a.trigger.getBoundingClientRect(),D=d.getBoundingClientRect(),V=a.valueNode.getBoundingClientRect(),K=_.getBoundingClientRect();if(a.dir!=="rtl"){const de=K.left-D.left,ue=V.left-de,_e=M.left-ue,ye=M.width+_e,Le=Math.max(ye,D.width),Ze=window.innerWidth-tn,Ge=Ty(ue,[tn,Math.max(tn,Ze-Le)]);c.style.minWidth=ye+"px",c.style.left=Ge+"px"}else{const de=D.right-K.right,ue=window.innerWidth-V.right-de,_e=window.innerWidth-M.right-ue,ye=M.width+_e,Le=Math.max(ye,D.width),Ze=window.innerWidth-tn,Ge=Ty(ue,[tn,Math.max(tn,Ze-Le)]);c.style.minWidth=ye+"px",c.style.right=Ge+"px"}const Z=p(),U=window.innerHeight-tn*2,q=v.scrollHeight,C=window.getComputedStyle(d),H=parseInt(C.borderTopWidth,10),B=parseInt(C.paddingTop,10),R=parseInt(C.borderBottomWidth,10),P=parseInt(C.paddingBottom,10),W=H+B+q+P+R,$=Math.min(b.offsetHeight*5,W),G=window.getComputedStyle(v),J=parseInt(G.paddingTop,10),re=parseInt(G.paddingBottom,10),se=M.top+M.height/2-tn,ce=U-se,ge=b.offsetHeight/2,te=b.offsetTop+ge,Q=H+B+te,ae=W-Q;if(Q<=se){const de=Z.length>0&&b===Z[Z.length-1].ref.current;c.style.bottom="0px";const ue=d.clientHeight-v.offsetTop-v.offsetHeight,_e=Math.max(ce,ge+(de?re:0)+ue+R),ye=Q+_e;c.style.height=ye+"px"}else{const de=Z.length>0&&b===Z[0].ref.current;c.style.top="0px";const _e=Math.max(se,H+v.offsetTop+(de?J:0)+ge)+ae;c.style.height=_e+"px",v.scrollTop=Q-se+v.offsetTop}c.style.margin=`${tn}px 0`,c.style.minHeight=$+"px",c.style.maxHeight=U+"px",o?.(),requestAnimationFrame(()=>m.current=!0)}},[p,a.trigger,a.valueNode,c,d,v,b,_,a.dir,o]);St(()=>w(),[w]);const[E,O]=L.useState();St(()=>{d&&O(window.getComputedStyle(d).zIndex)},[d]);const k=L.useCallback(M=>{M&&x.current===!0&&(w(),N?.(),x.current=!1)},[w,N]);return T.jsx(mP,{scope:n,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:T.jsx("div",{ref:f,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:T.jsx(Je.div,{...s,ref:g,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});E0.displayName=pP;var gP="SelectPopperPosition",Hu=L.forwardRef((e,t)=>{const{__scopeSelect:n,align:o="start",collisionPadding:s=tn,...a}=e,l=Ma(n);return T.jsx(cO,{...l,...a,ref:t,align:o,collisionPadding:s,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Hu.displayName=gP;var[mP,zu]=wo(Dr,{}),Vu="SelectViewport",C0=L.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:o,...s}=e,a=ar(Vu,n),l=zu(Vu,n),c=ut(t,a.onViewportChange),f=L.useRef(0);return T.jsxs(T.Fragment,{children:[T.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),T.jsx(Pa.Slot,{scope:n,children:T.jsx(Je.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:ot(s.onScroll,d=>{const h=d.currentTarget,{contentWrapper:g,shouldExpandOnScrollRef:p}=l;if(p?.current&&g){const m=Math.abs(f.current-h.scrollTop);if(m>0){const x=window.innerHeight-tn*2,v=parseFloat(g.style.minHeight),b=parseFloat(g.style.height),_=Math.max(v,b);if(_<x){const N=_+m,w=Math.min(x,N),E=N-w;g.style.height=w+"px",g.style.bottom==="0px"&&(h.scrollTop=E>0?E:0,g.style.justifyContent="flex-end")}}}f.current=h.scrollTop})})})]})});C0.displayName=Vu;var N0="SelectGroup",[yP,vP]=wo(N0),T0=L.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,s=ku();return T.jsx(yP,{scope:n,id:s,children:T.jsx(Je.div,{role:"group","aria-labelledby":s,...o,ref:t})})});T0.displayName=N0;var A0="SelectLabel",I0=L.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,s=vP(A0,n);return T.jsx(Je.div,{id:s.id,...o,ref:t})});I0.displayName=A0;var Ra="SelectItem",[xP,O0]=wo(Ra),P0=L.forwardRef((e,t)=>{const{__scopeSelect:n,value:o,disabled:s=!1,textValue:a,...l}=e,c=sr(Ra,n),f=ar(Ra,n),d=c.value===o,[h,g]=L.useState(a??""),[p,m]=L.useState(!1),x=ut(t,N=>f.itemRefCallback?.(N,o,s)),v=ku(),b=L.useRef("touch"),_=()=>{s||(c.onValueChange(o),c.onOpenChange(!1))};if(o==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return T.jsx(xP,{scope:n,value:o,disabled:s,textId:v,isSelected:d,onItemTextChange:L.useCallback(N=>{g(w=>w||(N?.textContent??"").trim())},[]),children:T.jsx(Pa.ItemSlot,{scope:n,value:o,disabled:s,textValue:h,children:T.jsx(Je.div,{role:"option","aria-labelledby":v,"data-highlighted":p?"":void 0,"aria-selected":d&&p,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:x,onFocus:ot(l.onFocus,()=>m(!0)),onBlur:ot(l.onBlur,()=>m(!1)),onClick:ot(l.onClick,()=>{b.current!=="mouse"&&_()}),onPointerUp:ot(l.onPointerUp,()=>{b.current==="mouse"&&_()}),onPointerDown:ot(l.onPointerDown,N=>{b.current=N.pointerType}),onPointerMove:ot(l.onPointerMove,N=>{b.current=N.pointerType,s?f.onItemLeave?.():b.current==="mouse"&&N.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ot(l.onPointerLeave,N=>{N.currentTarget===document.activeElement&&f.onItemLeave?.()}),onKeyDown:ot(l.onKeyDown,N=>{f.searchRef?.current!==""&&N.key===" "||(iP.includes(N.key)&&_(),N.key===" "&&N.preventDefault())})})})})});P0.displayName=Ra;var ki="SelectItemText",k0=L.forwardRef((e,t)=>{const{__scopeSelect:n,className:o,style:s,...a}=e,l=sr(ki,n),c=ar(ki,n),f=O0(ki,n),d=cP(ki,n),[h,g]=L.useState(null),p=ut(t,_=>g(_),f.onItemTextChange,_=>c.itemTextRefCallback?.(_,f.value,f.disabled)),m=h?.textContent,x=L.useMemo(()=>T.jsx("option",{value:f.value,disabled:f.disabled,children:m},f.value),[f.disabled,f.value,m]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=d;return St(()=>(v(x),()=>b(x)),[v,b,x]),T.jsxs(T.Fragment,{children:[T.jsx(Je.span,{id:f.textId,...a,ref:p}),f.isSelected&&l.valueNode&&!l.valueNodeHasChildren?cs.createPortal(a.children,l.valueNode):null]})});k0.displayName=ki;var M0="SelectItemIndicator",R0=L.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return O0(M0,n).isSelected?T.jsx(Je.span,{"aria-hidden":!0,...o,ref:t}):null});R0.displayName=M0;var Wu="SelectScrollUpButton",D0=L.forwardRef((e,t)=>{const n=ar(Wu,e.__scopeSelect),o=zu(Wu,e.__scopeSelect),[s,a]=L.useState(!1),l=ut(t,o.onScrollButtonChange);return St(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=f.scrollTop>0;a(d)};const f=n.viewport;return c(),f.addEventListener("scroll",c),()=>f.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?T.jsx($0,{...e,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:f}=n;c&&f&&(c.scrollTop=c.scrollTop-f.offsetHeight)}}):null});D0.displayName=Wu;var ju="SelectScrollDownButton",L0=L.forwardRef((e,t)=>{const n=ar(ju,e.__scopeSelect),o=zu(ju,e.__scopeSelect),[s,a]=L.useState(!1),l=ut(t,o.onScrollButtonChange);return St(()=>{if(n.viewport&&n.isPositioned){let c=function(){const d=f.scrollHeight-f.clientHeight,h=Math.ceil(f.scrollTop)<d;a(h)};const f=n.viewport;return c(),f.addEventListener("scroll",c),()=>f.removeEventListener("scroll",c)}},[n.viewport,n.isPositioned]),s?T.jsx($0,{...e,ref:l,onAutoScroll:()=>{const{viewport:c,selectedItem:f}=n;c&&f&&(c.scrollTop=c.scrollTop+f.offsetHeight)}}):null});L0.displayName=ju;var $0=L.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:o,...s}=e,a=ar("SelectScrollButton",n),l=L.useRef(null),c=ka(n),f=L.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return L.useEffect(()=>()=>f(),[f]),St(()=>{c().find(h=>h.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[c]),T.jsx(Je.div,{"aria-hidden":!0,...s,ref:t,style:{flexShrink:0,...s.style},onPointerDown:ot(s.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(o,50))}),onPointerMove:ot(s.onPointerMove,()=>{a.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(o,50))}),onPointerLeave:ot(s.onPointerLeave,()=>{f()})})}),wP="SelectSeparator",B0=L.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e;return T.jsx(Je.div,{"aria-hidden":!0,...o,ref:t})});B0.displayName=wP;var Uu="SelectArrow",bP=L.forwardRef((e,t)=>{const{__scopeSelect:n,...o}=e,s=Ma(n),a=sr(Uu,n),l=ar(Uu,n);return a.open&&l.position==="popper"?T.jsx(uO,{...s,...o,ref:t}):null});bP.displayName=Uu;var _P="SelectBubbleInput",F0=L.forwardRef(({__scopeSelect:e,value:t,...n},o)=>{const s=L.useRef(null),a=ut(o,s),l=gO(t);return L.useEffect(()=>{const c=s.current;if(!c)return;const f=window.HTMLSelectElement.prototype,h=Object.getOwnPropertyDescriptor(f,"value").set;if(l!==t&&h){const g=new Event("change",{bubbles:!0});h.call(c,t),c.dispatchEvent(g)}},[l,t]),T.jsx(Je.select,{...n,style:{...Jy,...n.style},ref:a,defaultValue:t})});F0.displayName=_P;function H0(e){return e===""||e===void 0}function z0(e){const t=Mr(e),n=L.useRef(""),o=L.useRef(0),s=L.useCallback(l=>{const c=n.current+l;t(c),function f(d){n.current=d,window.clearTimeout(o.current),d!==""&&(o.current=window.setTimeout(()=>f(""),1e3))}(c)},[t]),a=L.useCallback(()=>{n.current="",window.clearTimeout(o.current)},[]);return L.useEffect(()=>()=>window.clearTimeout(o.current),[]),[n,s,a]}function V0(e,t,n){const s=t.length>1&&Array.from(t).every(d=>d===t[0])?t[0]:t,a=n?e.indexOf(n):-1;let l=SP(e,Math.max(a,0));s.length===1&&(l=l.filter(d=>d!==n));const f=l.find(d=>d.textValue.toLowerCase().startsWith(s.toLowerCase()));return f!==n?f:void 0}function SP(e,t){return e.map((n,o)=>e[(t+o)%e.length])}var EP=p0,W0=m0,j0=v0,CP=x0,NP=w0,U0=b0,TP=C0,AP=T0,G0=I0,Y0=P0,IP=k0,OP=R0,X0=D0,q0=L0,K0=B0;const Z0=EP,Gu=z.forwardRef(({className:e,children:t,...n},o)=>T.jsxs(W0,{ref:o,className:Ne("flex h-[44px] w-full items-center justify-between rounded-md border cursor-pointer border-secondary-dark-gray bg-primary-black px-4 py-2 text-[27px] leading-[27px] font-main text-primary-white data-[placeholder]:text-[#6B6B6B] focus:outline-none focus-visible:ring-1 focus-visible:ring-white disabled:cursor-not-allowed disabled:opacity-50",e),...n,children:[T.jsx("span",{className:"text-left truncate",children:t}),T.jsx(CP,{asChild:!0,children:T.jsx(aa,{className:"h-6 w-6 shrink-0 ml-2"})})]}));Gu.displayName=W0.displayName;const Yu=z.forwardRef(({className:e,...t},n)=>T.jsx(X0,{ref:n,className:Ne("flex cursor-default items-center justify-center py-1",e),...t,children:T.jsx(nu,{className:"h-4 w-4"})}));Yu.displayName=X0.displayName;const Xu=z.forwardRef(({className:e,...t},n)=>T.jsx(q0,{ref:n,className:Ne("flex cursor-default items-center justify-center py-1",e),...t,children:T.jsx(aa,{className:"h-4 w-4"})}));Xu.displayName=q0.displayName;const qu=z.forwardRef(({className:e,children:t,position:n="popper",...o},s)=>T.jsx(NP,{children:T.jsxs(U0,{ref:s,className:Ne("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-secondary-dark-gray bg-[#181818] text-primary-white shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...o,children:[T.jsx(Yu,{}),T.jsx(TP,{className:Ne("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),T.jsx(Xu,{})]})}));qu.displayName=U0.displayName;const Q0=z.forwardRef(({className:e,...t},n)=>T.jsx(G0,{ref:n,className:Ne("py-1.5 px-2 text-[27px] leading-[27px] font-main font-semibold text-primary-white",e),...t}));Q0.displayName=G0.displayName;const Da=z.forwardRef(({className:e,children:t,...n},o)=>T.jsxs(Y0,{ref:o,className:Ne("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-4 pr-2 text-[27px] leading-[27px] font-main text-primary-white outline-none focus:bg-[#3F3F3F] focus:text-primary-white data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[T.jsx(IP,{children:t}),T.jsx("span",{className:"ml-auto",children:T.jsx(OP,{children:T.jsx(QT,{className:"h-5 w-5 ml-2 mr-1",strokeWidth:2.5})})})]}));Da.displayName=Y0.displayName;const J0=z.forwardRef(({className:e,...t},n)=>T.jsx(K0,{ref:n,className:Ne("-mx-1 my-1 h-px bg-secondary-dark-gray",e),...t}));J0.displayName=K0.displayName;const PP=AP,Ku=z.forwardRef(({className:e,...t},n)=>T.jsx(j0,{ref:n,className:Ne(e),...t}));Ku.displayName=j0.displayName;const Ve=["circle","square","rectangle","list","grid","diamond","trapezium","hexagon","star","cross","zigzag","sparkle","parallelogram"],ht={[Ve[0]]:Ve[0],[Ve[1]]:Ve[1],[Ve[2]]:Ve[2],[Ve[3]]:Ve[3],[Ve[4]]:Ve[4],[Ve[5]]:Ve[5],[Ve[6]]:Ve[6],[Ve[7]]:Ve[7],[Ve[8]]:Ve[8],[Ve[9]]:Ve[9],[Ve[10]]:Ve[10],[Ve[11]]:Ve[11],[Ve[12]]:Ve[12]},La=(e,t,n,o="black",s=2)=>T.jsxs("div",{className:Ne("relative",n),children:[T.jsx("div",{className:"absolute",style:{top:-s,left:-s,right:-s,bottom:-s,backgroundColor:o,clipPath:e}}),T.jsx("div",{className:"absolute inset-0",style:{backgroundColor:t,clipPath:e}})]}),ev=(e=ht.circle,t="#A1A1A1",n)=>{const o="border-2 border-black",s="border-1 border-black",a={backgroundColor:t};switch(e){case ht.circle:return T.jsx("div",{className:Ne("w-6 h-6 rounded-full",o,n),style:a});case ht.square:return T.jsx("div",{className:Ne("w-6 h-6",o,n),style:a});case ht.rectangle:return T.jsx("div",{className:Ne("w-4 h-8",o,n),style:a});case ht.list:return T.jsx("div",{className:Ne("w-6 h-6 flex flex-col justify-center gap-0.5",n),children:[0,1,2].map(l=>T.jsx("div",{className:Ne("w-full h-2",s),style:a},l))});case ht.grid:return T.jsx("div",{className:Ne("w-6 h-6 grid grid-cols-2 gap-0.5",n),children:[0,1,2,3].map(l=>T.jsx("div",{className:Ne("w-full h-full",s),style:a},l))});case ht.diamond:return T.jsx("div",{className:Ne("w-6 h-6 rotate-45",o,n),style:a});case ht.trapezium:return La("polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%)",t,Ne("w-6 h-6",n));case ht.hexagon:return La("polygon(-50% 50%,50% 100%,150% 50%,50% 0)",t,Ne("w-5 h-6",n));case ht.star:return La("polygon(50% 0%, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%)",t,Ne("w-6 h-6",n));case ht.cross:return T.jsxs("div",{className:Ne("w-6 h-6 relative",n),children:[T.jsx("div",{className:Ne("absolute top-1/2 left-0 w-full h-2 -translate-y-1/2",s),style:a}),T.jsx("div",{className:Ne("absolute left-1/2 top-0 w-2 h-full -translate-x-1/2",s),style:a})]});case ht.zigzag:return T.jsx("div",{className:Ne("w-6 h-6",n),style:{...a,width:"calc(4px + 24px/(2*tan(90deg/2)))",minHeight:"24px",mask:"4px 50%/100% 24px repeat-y conic-gradient(from calc(90deg - 90deg/2) at left, #0000, #000 1deg calc(90deg - 1deg), #0000 90deg) exclude, 0 50%/100% 24px repeat-y conic-gradient(from calc(90deg - 90deg/2) at left, #0000, #000 1deg calc(90deg - 1deg), #0000 90deg)",border:"2px solid black"}});case ht.sparkle:return T.jsx("div",{className:Ne("w-6 h-6",n),style:{...a,mask:"radial-gradient(#0000 71%, #000 72%) 10000% 10000%/99.5% 99.5%",border:"2px solid black"}});case ht.parallelogram:return La("polygon(25% 0%, 100% 0%, 75% 100%, 0% 100%)",t,Ne("w-6 h-6",n));default:return T.jsx("div",{className:Ne("w-6 h-6 rounded-full",o,n),style:a})}},$a=z.forwardRef(({type:e,position:t,id:n,color:o,shape:s=ht.circle,isCurrentlyInsideReactFlow:a=!1,className:l,...c},f)=>a?T.jsx(vi,{type:e,position:t,id:n,className:Ne("!w-6 !h-6 !border-none !bg-transparent !pointer-events-auto",l),style:{backgroundColor:"transparent"},...c,ref:f,children:T.jsx("div",{className:Ne("pointer-events-none flex justify-center"),children:ev(s,o||"#A1A1A1",l)})}):T.jsx("div",{className:Ne("absolute",t===be.Right&&"right-0 top-1/2 -translate-y-1/2 translate-x-1/2",t===be.Left&&"left-0 top-1/2 -translate-y-1/2 -translate-x-1/2"),...c,ref:f,children:ev(s,o||"#A1A1A1",l)}));$a.displayName="ContextAwareHandle";const tv=({input:e})=>{const t=mi(),n=yi();return e.type==="string"?T.jsx(Ai,{placeholder:e.name,value:e.value,onChange:o=>{e.onChange?.(o),t.setNodes(s=>s.map(a=>a.id===n?{...a,data:Nm(a.data,e.id,{value:o},!0,!1,!1)}:a))},allowOnlyNumbers:!1,className:"w-full"}):T.jsx(ca,{name:e.name,value:e.value,onChange:o=>{e.onChange?.(o),t.setNodes(s=>s.map(a=>a.id===n?{...a,data:Nm(a.data,e.id,{value:o},!0,!1,!1)}:a))},className:"w-full"})},nv=({input:e,isCurrentlyInsideReactFlow:t})=>t?T.jsx(tv,{input:e}):e.type==="string"?T.jsx(Ai,{placeholder:e.name,value:e.value,onChange:e.onChange,allowOnlyNumbers:!1,className:"w-full"}):T.jsx(ca,{name:e.name,value:e.value,onChange:e.onChange,className:"w-full"}),rv=({})=>{const e=z.useContext(ef),t=yi(),n=()=>{e?.allProps?.dispatch&&t&&e.allProps.dispatch({type:st.OPEN_NODE_GROUP,payload:{nodeId:t}})};return T.jsx(Vm,{strokeWidth:2.5,className:"shrink-0 w-7 h-7 aspect-square cursor-pointer hover:opacity-80",onClick:n})},ov=({showButton:e=!1,isCurrentlyInsideReactFlow:t})=>e?t?T.jsx(rv,{}):T.jsx(Vm,{strokeWidth:2.5,className:"shrink-0 w-7 h-7 aspect-square cursor-pointer hover:opacity-80"}):T.jsx(T.Fragment,{}),Zu=z.forwardRef(({input:e,isCurrentlyInsideReactFlow:t,hide:n=!1},o)=>{const s=t?iT({handleId:e.id}):[],a=t&&s.some(c=>c.targetHandle===e.id),l=e.allowInput&&!a;return T.jsxs("div",{ref:o,className:Ne("text-primary-white text-[27px] leading-[27px] font-main relative px-6 flex flex-row py-3",n&&"h-0 overflow-hidden py-0",l&&"py-1"),children:[T.jsx($a,{type:"target",position:be.Left,id:e.id,color:e.handleColor,shape:e.handleShape,isCurrentlyInsideReactFlow:t}),T.jsxs("div",{className:"flex-1 flex items-center gap-3 w-full",children:[!l&&T.jsx("div",{className:"truncate",children:e.name||"​"}),l&&T.jsx("div",{className:"flex-1 w-full",children:T.jsx(nv,{input:e,isCurrentlyInsideReactFlow:t})})]})]},e.id)});Zu.displayName="RenderInput";const iv=z.forwardRef(({output:e,isCurrentlyInsideReactFlow:t},n)=>T.jsxs("div",{ref:n,className:"text-primary-white text-[27px] leading-[27px] font-main relative px-6 flex flex-row justify-end py-3",children:[T.jsx("div",{className:"truncate text-right",children:e.name||"​"}),T.jsx($a,{type:"source",position:be.Right,id:e.id,color:e.handleColor,shape:e.handleShape,isCurrentlyInsideReactFlow:t})]},e.id));iv.displayName="RenderOutput";const sv=z.forwardRef(({panel:e,isCurrentlyInsideReactFlow:t,isOpen:n,onToggle:o},s)=>T.jsxs("div",{ref:s,className:"flex flex-col",children:[T.jsxs(An,{onClick:a=>{a.stopPropagation(),a.preventDefault(),o()},className:"bg-transparent border-none hover:bg-primary-gray rounded-none justify-start",children:[n?T.jsx(nu,{className:"w-6 h-6 flex-shrink-0 mr-2"}):T.jsx(aa,{className:"w-6 h-6 flex-shrink-0 mr-2"}),T.jsx("span",{className:"truncate",children:e.name})]}),T.jsx("div",{className:Ne("flex flex-col bg-[#272727]",!n&&"h-0 overflow-hidden"),children:e.inputs.map(a=>T.jsx(Zu,{input:a,isCurrentlyInsideReactFlow:t,hide:!n},a.id))})]},e.id));sv.displayName="RenderInputPanel";const Qu=z.forwardRef(({name:e="Node",headerColor:t="#79461D",inputs:n=[],outputs:o=[],isCurrentlyInsideReactFlow:s=!1,className:a,nodeResizerProps:l={},nodeTypeUniqueId:c,showNodeOpenButton:f=!1,...d},h)=>{const[g,p]=z.useState(new Set),m=x=>{p(v=>{const b=new Set(v);return b.has(x)?b.delete(x):b.add(x),b})};return T.jsxs("div",{tabIndex:0,className:Ne("flex flex-col gap-0 rounded-md w-max border-[1.5px] border-transparent focus:border-white","in-[.selected]:border-white",a),...d,ref:h,children:[T.jsxs("div",{className:`text-primary-white text-left text-[27px] leading-[27px] font-main \\
188
+ px-4 transition-all rounded-t-md truncate flex justify-between items-center`,style:{backgroundColor:t},children:[T.jsx("p",{className:"truncate py-2",children:e}),T.jsx(ov,{showButton:f,isCurrentlyInsideReactFlow:s})]}),T.jsxs("div",{className:"min-h-[50px] rounded-b-md bg-primary-dark-gray",children:[s&&T.jsx($m,{...l}),T.jsx("div",{className:"flex flex-col py-4",children:o.map(x=>T.jsx(iv,{output:x,isCurrentlyInsideReactFlow:s},x.id))}),T.jsx("div",{className:"flex flex-col py-4",children:n.map(x=>{if("inputs"in x){const v=g.has(x.id);return T.jsx(sv,{panel:x,isCurrentlyInsideReactFlow:s,isOpen:v,onToggle:()=>m(x.id)},x.id)}else return T.jsx(Zu,{input:x,isCurrentlyInsideReactFlow:s},x.id)})})]})]})});Qu.displayName="ConfigurableNode";const Ju=z.forwardRef(({data:e={}},t)=>T.jsx(Qu,{isCurrentlyInsideReactFlow:!0,className:"w-full",...e,ref:t}));Ju.displayName="ConfigurableNodeReactFlowWrapper";const av=({fromX:e,fromY:t,toX:n,toY:o,fromPosition:s,toPosition:a})=>{const{fromHandle:l}=dm(),c=Yc(l?.nodeId||""),f=z.useMemo(()=>!l?.id||!c?.data?void 0:Rn(l?.id,c?.data)?.value?.handleColor??"#A1A1A1",[l?.id,c?.data]),[d]=qs({sourceX:e,sourceY:t,sourcePosition:s,targetX:n,targetY:o,targetPosition:a});return T.jsx(co,{path:d,className:"!stroke-7 in-[g.selected]:brightness-150",style:{stroke:f||"#A1A1A1"},focusable:!0})};av.displayName="ConfigurableConnection";const kP=({isOpen:e,position:t,onClose:n,subItems:o})=>{const{refs:s,floatingStyles:a,context:l}=wy({open:e,onOpenChange:d=>{d||n()},placement:"bottom-start",middleware:[vu(5),wu({fallbackPlacements:["top-start"]}),xu({padding:8})],whileElementsMounted:mu}),c=SI(l),{getFloatingProps:f}=by([c]);return z.useEffect(()=>{e&&s.setReference({getBoundingClientRect:()=>({x:t.x,y:t.y,width:1,height:1,top:t.y,right:t.x+1,bottom:t.y+1,left:t.x})})},[e,t,s]),e?T.jsx("div",{ref:s.setFloating,style:{...a,contain:"layout",willChange:"transform"},className:"z-50",onClick:d=>d.stopPropagation(),...f(),children:T.jsx(Cy,{subItems:o})}):null},lv="add-new-node-group"+un(10),MP=({value:e,setValue:t,nodeGroups:n,handleAddNewGroup:o,enableBackButton:s,handleBack:a,openedNodeGroupStack:l})=>{const c=f=>{if(f===lv){o?.();return}t(f)};return T.jsxs("div",{className:"absolute top-0 left-0 scale-75 origin-top-left flex items-center gap-3 m-2 max-w-full",children:[T.jsx(An,{className:"h-[44px] border-secondary-dark-gray bg-primary-black shrink-0",disabled:!s,onClick:a,children:T.jsx(ZT,{})}),T.jsxs(Z0,{value:e,onValueChange:c,children:[T.jsx(Gu,{className:"hover:bg-primary-dark-gray shrink-0 w-fit",children:T.jsx(Ku,{placeholder:"Node Group"})}),T.jsxs(qu,{className:"scale-75 origin-top-left",children:[T.jsx(Da,{value:lv,className:"pl-2",children:T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx(zm,{}),T.jsx("p",{className:"truncate",children:"Add New Node Group"})]})}),n.map(f=>T.jsx(Da,{value:f.id,children:f.name},f.id))]})]}),T.jsx(ru,{orientation:"horizontal",className:"relative flex-1 min-w-0",scrollAreaClassName:"text-[27px] leading-[27px] font-main whitespace-nowrap text-primary-white flex gap-2 items-center overflow-x-scroll no-scrollbar overflow-y-hidden",children:l.map((f,d)=>T.jsxs("div",{className:"flex items-center gap-2",children:[T.jsx("div",{children:f.name}),d<l.length-1&&T.jsx(la,{className:"shrink-0"})]},f.id))})]})},RP={configurableNode:Ju},DP={configurableEdge:tu};function LP(e){const[t,n]=z.useReducer(Rm,e);return{state:t,dispatch:n}}function $P({state:e,dispatch:t}){const[n,o]=z.useState({isOpen:!1,position:{x:0,y:0}}),s=z.useMemo(()=>Object.keys(e.typeOfNodes).filter(p=>e.typeOfNodes[p].subtree!==void 0).map(p=>({id:p,name:e.typeOfNodes[p].name})),[e.typeOfNodes]),a=z.useMemo(()=>e.openedNodeGroupStack?.[e.openedNodeGroupStack.length-1],[e.openedNodeGroupStack]),{screenToFlowPosition:l,fitView:c}=mi(),f=z.useMemo(()=>Ny({typeOfNodes:e.typeOfNodes,dispatch:t,setContextMenu:o,contextMenuPosition:l(n.position),currentNodeType:a?.nodeType,isRecursionAllowed:!e.enableRecursionChecking}),[e.typeOfNodes,t,o,n.position,a?.nodeType,e.enableRecursionChecking]),d=z.useCallback(p=>{p.preventDefault();const m={x:p.clientX,y:p.clientY};o({isOpen:!0,position:m})},[]),h=z.useCallback(()=>{o({isOpen:!1,position:{x:0,y:0}})},[]),g=z.useMemo(()=>Pt(e),[e.nodes,e.edges,e.openedNodeGroupStack,e.typeOfNodes]);return z.useEffect(()=>{e.viewport===void 0&&c({maxZoom:.5,minZoom:.1})},[e.viewport]),T.jsxs("div",{style:{width:"100%",height:"100%"},className:"relative",children:[T.jsxs(rT,{nodes:g.nodes,edges:g.edges,onNodesChange:p=>t({type:st.UPDATE_NODE_BY_REACT_FLOW,payload:{changes:p}}),onEdgesChange:p=>t({type:st.UPDATE_EDGES_BY_REACT_FLOW,payload:{changes:p}}),onConnect:p=>t({type:st.ADD_EDGE_BY_REACT_FLOW,payload:{edge:p}}),maxZoom:1,minZoom:.1,proOptions:{hideAttribution:!0},colorMode:"dark",selectNodesOnDrag:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectionMode:no.Partial,nodeTypes:RP,edgeTypes:DP,deleteKeyCode:["Backspace","Delete","x"],connectionLineComponent:av,onContextMenu:d,onClick:h,viewport:e.viewport,onViewportChange:p=>t({type:st.SET_VIEWPORT,payload:{viewport:p}}),children:[T.jsx(yT,{}),T.jsx(uT,{}),T.jsx(OT,{pannable:!0})]}),T.jsx(kP,{isOpen:n.isOpen,position:n.position,onClose:h,subItems:f}),T.jsx(MP,{nodeGroups:s,value:a?.nodeType??"",setValue:p=>t({type:st.OPEN_NODE_GROUP,payload:{nodeType:p}}),handleAddNewGroup:()=>t({type:st.ADD_NODE_GROUP}),enableBackButton:(e.openedNodeGroupStack?.length||0)>0,handleBack:()=>t({type:st.CLOSE_NODE_GROUP}),openedNodeGroupStack:(e.openedNodeGroupStack||[]).map(p=>({id:p.nodeType+("nodeId"in p?p.nodeId:""),name:e.typeOfNodes[p.nodeType].name}))})]})}const ef=z.createContext(null);function BP({state:e,dispatch:t}){return T.jsx(ym,{children:T.jsx(ef.Provider,{value:{allProps:{state:e,dispatch:t}},children:T.jsx($P,{state:e,dispatch:t})})})}pe.Button=An,pe.ConfigurableEdge=tu,pe.ConfigurableNode=Qu,pe.ConfigurableNodeReactFlowWrapper=Ju,pe.ContextAwareHandle=$a,pe.ContextAwareInput=nv,pe.ContextAwareOpenButton=ov,pe.ContextMenu=Cy,pe.FullGraph=BP,pe.FullGraphContext=ef,pe.Input=Ai,pe.NodeResizerWithMoreControls=$m,pe.ReactFlowAwareInput=tv,pe.ReactFlowAwareOpenButton=rv,pe.ScrollableButtonContainer=ru,pe.Select=Z0,pe.SelectContent=qu,pe.SelectGroup=PP,pe.SelectItem=Da,pe.SelectLabel=Q0,pe.SelectScrollDownButton=Xu,pe.SelectScrollUpButton=Yu,pe.SelectSeparator=J0,pe.SelectTrigger=Gu,pe.SelectValue=Ku,pe.SliderNumberInput=ca,pe.actionTypesMap=st,pe.addAnInputOrOutputToAllNodesOfANodeTypeAcrossStateIncludingSubtrees=Mm,pe.addEdgeWithTypeChecking=Im,pe.cn=Ne,pe.constructInputOrOutputOfType=tr,pe.constructInputPanelOfType=_m,pe.constructNodeOfType=xi,pe.constructTypeOfHandleFromIndices=sa,pe.convertStringToNumber=hh,pe.createNodeContextMenu=Ny,pe.getAllDependenciesOfNodeTypeRecursively=RT,pe.getAllDependentsOfNodeTypeRecursively=Em,pe.getCurrentNodesAndEdgesFromState=Pt,pe.getDependencyGraphBetweenNodeTypes=wi,pe.getDirectDependenciesOfNodeType=Sm,pe.getDirectDependentsOfNodeType=Kc,pe.getResultantDataTypeOfHandleConsideringInferredType=_i,pe.handleShapesMap=ht,pe.isCoordinateInBox=dh,pe.isNumberInRange=Gl,pe.isSupportedUnderlyingType=pb,pe.isValidDataTypeId=mb,pe.mainReducer=Rm,pe.makeAllowedConversionsBetweenDataTypesWithAutoInfer=vb,pe.makeDataTypeWithAutoInfer=gb,pe.makeStateWithAutoInfer=xb,pe.makeTypeOfNodeWithAutoInfer=yb,pe.removeEdgeWithTypeChecking=Om,pe.sanitizeNumberToShowAsText=Yl,pe.setCurrentNodesAndEdgesToStateWithMutatingState=Or,pe.standardDataTypeNames=Si,pe.standardDataTypeNamesMap=Ei,pe.standardDataTypes=jT,pe.standardNodeTypeNames=Ci,pe.standardNodeTypeNamesMap=Ni,pe.standardNodeTypes=UT,pe.supportedUnderlyingTypesMap=ph,pe.useClickedOutside=Lm,pe.useDrag=Wm,pe.useFullGraph=LP,pe.willAddingEdgeCreateCycle=Pm,Object.defineProperty(pe,Symbol.toStringTag,{value:"Module"})});
107
189
  //# sourceMappingURL=react-blender-nodes.umd.js.map