@railtownai/railtracks-visualizer 0.0.18 → 0.0.20

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.
package/dist/esm/index.js CHANGED
@@ -1,18 +1,53 @@
1
- import*as e from"react";import t,{createContext as n,memo as r,useMemo as o,forwardRef as a,useEffect as i,useCallback as s,useRef as l,useContext as c,useState as u,createElement as d,useLayoutEffect as f}from"react";import*as p from"react-dom";import h from"react-dom";import{jsx as m,jsxs as g,Fragment as y}from"react/jsx-runtime";function v(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,r=0;r<e.length;r++)""!==(n=v(e[r]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w,x={exports:{}},S={},E={exports:{}},_={};var C,k,N,M={};function P(){return k||(k=1,"production"===process.env.NODE_ENV?E.exports=function(){if(w)return _;w=1;var e=t,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useState,o=e.useEffect,a=e.useLayoutEffect,i=e.useDebugValue;function s(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),l=r({inst:{value:n,getSnapshot:t}}),c=l[0].inst,u=l[1];return a(function(){c.value=n,c.getSnapshot=t,s(c)&&u({inst:c})},[e,n,t]),o(function(){return s(c)&&u({inst:c}),e(function(){s(c)&&u({inst:c})})},[e]),i(n),n};return _.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,_}():E.exports=(C||(C=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=t,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useState,a=n.useEffect,i=n.useLayoutEffect,s=n.useDebugValue,l=!1,c=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,u){l||void 0===n.startTransition||(l=!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 d=u();if(!c){var f=u();r(d,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var p=(f=o({inst:{value:d,getSnapshot:u}}))[0].inst,h=f[1];return i(function(){p.value=d,p.getSnapshot=u,e(p)&&h({inst:p})},[t,d,u]),a(function(){return e(p)&&h({inst:p}),t(function(){e(p)&&h({inst:p})})},[t]),s(d),d};M.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),M)),E.exports}var O,A={};"production"===process.env.NODE_ENV?x.exports=function(){if(N)return S;N=1;var e=t,n=P(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,a=e.useRef,i=e.useEffect,s=e.useMemo,l=e.useDebugValue;return S.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=a(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,o=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return a=t}return a=e}if(t=a,r(o,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(o=e,t):(o=e,a=n)}var o,a,i=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,c,u]);var p=o(e,d[0],d[1]);return i(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},S}():x.exports=(O||(O=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=t,n=P(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,a=e.useRef,i=e.useEffect,s=e.useMemo,l=e.useDebugValue;A.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=a(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!i){if(i=!0,o=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return a=t}return a=e}if(t=a,r(o,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(o=e,t):(o=e,a=n)}var o,a,i=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,c,u]);var p=o(e,d[0],d[1]);return i(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),A);var R=b(x.exports);const T=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>i,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&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()}},i=t=e(r,o,a);return a},{useDebugValue:D}=t,{useSyncExternalStoreWithSelector:$}=R,I=e=>e;function z(e,t=I,n){const r=$(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return D(r),r}const L=(e,t)=>{const n=(e=>e?T(e):T)(e),r=(e,r=t)=>z(n,e,r);return Object.assign(r,n),r};function B(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var F={value:()=>{}};function H(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new W(r)}function W(e){this._=e}function V(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}function j(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=F,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}W.prototype=H.prototype={constructor:W,on:function(e,t){var n,r,o=this._,a=(r=o,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),i=-1,s=a.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++i<s;)if(n=(e=a[i]).type)o[n]=j(o[n],e.name,t);else if(null==t)for(n in o)o[n]=j(o[n],e.name,null);return this}for(;++i<s;)if((n=(e=a[i]).type)&&(n=V(o[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new W(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),a=0;a<n;++a)o[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(a=0,n=(r=this._[e]).length;a<n;++a)r[a].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,a=r.length;o<a;++o)r[o].value.apply(t,n)}};var Y="http://www.w3.org/1999/xhtml",X={svg:"http://www.w3.org/2000/svg",xhtml:Y,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function K(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),X.hasOwnProperty(t)?{space:X[t],local:e}:e}function U(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Y&&t.documentElement.namespaceURI===Y?t.createElement(e):t.createElementNS(n,e)}}function q(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Z(e){var t=K(e);return(t.local?q:U)(t)}function G(){}function Q(e){return null==e?G:function(){return this.querySelector(e)}}function J(){return[]}function ee(e){return null==e?J:function(){return this.querySelectorAll(e)}}function te(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}function ne(e){return function(){return this.matches(e)}}function re(e){return function(t){return t.matches(e)}}var oe=Array.prototype.find;function ae(){return this.firstElementChild}var ie=Array.prototype.filter;function se(){return Array.from(this.children)}function le(e){return new Array(e.length)}function ce(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function ue(e,t,n,r,o,a){for(var i,s=0,l=t.length,c=a.length;s<c;++s)(i=t[s])?(i.__data__=a[s],r[s]=i):n[s]=new ce(e,a[s]);for(;s<l;++s)(i=t[s])&&(o[s]=i)}function de(e,t,n,r,o,a,i){var s,l,c,u=new Map,d=t.length,f=a.length,p=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(p[s]=c=i.call(l,l.__data__,s,t)+"",u.has(c)?o[s]=l:u.set(c,l));for(s=0;s<f;++s)c=i.call(e,a[s],s,a)+"",(l=u.get(c))?(r[s]=l,l.__data__=a[s],u.delete(c)):n[s]=new ce(e,a[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(p[s])===l&&(o[s]=l)}function fe(e){return e.__data__}function pe(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function he(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function me(e){return function(){this.removeAttribute(e)}}function ge(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ye(e,t){return function(){this.setAttribute(e,t)}}function ve(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function be(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function we(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function xe(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Se(e){return function(){this.style.removeProperty(e)}}function Ee(e,t,n){return function(){this.style.setProperty(e,t,n)}}function _e(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Ce(e,t){return e.style.getPropertyValue(t)||xe(e).getComputedStyle(e,null).getPropertyValue(t)}function ke(e){return function(){delete this[e]}}function Ne(e,t){return function(){this[e]=t}}function Me(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function Pe(e){return e.trim().split(/^|\s+/)}function Oe(e){return e.classList||new Ae(e)}function Ae(e){this._node=e,this._names=Pe(e.getAttribute("class")||"")}function Re(e,t){for(var n=Oe(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Te(e,t){for(var n=Oe(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function De(e){return function(){Re(this,e)}}function $e(e){return function(){Te(this,e)}}function Ie(e,t){return function(){(t.apply(this,arguments)?Re:Te)(this,e)}}function ze(){this.textContent=""}function Le(e){return function(){this.textContent=e}}function Be(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function Fe(){this.innerHTML=""}function He(e){return function(){this.innerHTML=e}}function We(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Ve(){this.nextSibling&&this.parentNode.appendChild(this)}function je(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function Ye(){return null}function Xe(){var e=this.parentNode;e&&e.removeChild(this)}function Ke(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ue(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qe(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,a=t.length;r<a;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function Ze(e,t,n){return function(){var r,o=this.__on,a=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var i=0,s=o.length;i<s;++i)if((r=o[i]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=a,r.options=n),void(r.value=t);this.addEventListener(e.type,a,n),r={type:e.type,name:e.name,value:t,listener:a,options:n},o?o.push(r):this.__on=[r]}}function Ge(e,t,n){var r=xe(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function Qe(e,t){return function(){return Ge(this,e,t)}}function Je(e,t){return function(){return Ge(this,e,t.apply(this,arguments))}}ce.prototype={constructor:ce,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)}},Ae.prototype={add:function(e){this._names.indexOf(e)<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}};var et=[null];function tt(e,t){this._groups=e,this._parents=t}function nt(){return new tt([[document.documentElement]],et)}function rt(e){return"string"==typeof e?new tt([[document.querySelector(e)]],[document.documentElement]):new tt([[e]],et)}function ot(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}tt.prototype=nt.prototype={constructor:tt,select:function(e){"function"!=typeof e&&(e=Q(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i,s=t[o],l=s.length,c=r[o]=new Array(l),u=0;u<l;++u)(a=s[u])&&(i=e.call(a,a.__data__,u,s))&&("__data__"in a&&(i.__data__=a.__data__),c[u]=i);return new tt(r,this._parents)},selectAll:function(e){e="function"==typeof e?te(e):ee(e);for(var t=this._groups,n=t.length,r=[],o=[],a=0;a<n;++a)for(var i,s=t[a],l=s.length,c=0;c<l;++c)(i=s[c])&&(r.push(e.call(i,i.__data__,c,s)),o.push(i));return new tt(r,o)},selectChild:function(e){return this.select(null==e?ae:function(e){return function(){return oe.call(this.children,e)}}("function"==typeof e?e:re(e)))},selectChildren:function(e){return this.selectAll(null==e?se:function(e){return function(){return ie.call(this.children,e)}}("function"==typeof e?e:re(e)))},filter:function(e){"function"!=typeof e&&(e=ne(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i=t[o],s=i.length,l=r[o]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new tt(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,fe);var n,r=t?de:ue,o=this._parents,a=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var i=a.length,s=new Array(i),l=new Array(i),c=new Array(i),u=0;u<i;++u){var d=o[u],f=a[u],p=f.length,h=pe(e.call(d,d&&d.__data__,u,o)),m=h.length,g=l[u]=new Array(m),y=s[u]=new Array(m);r(d,f,g,y,c[u]=new Array(p),h,t);for(var v,b,w=0,x=0;w<m;++w)if(v=g[w]){for(w>=x&&(x=w+1);!(b=y[x])&&++x<m;);v._next=b||null}}return(s=new tt(s,o))._enter=l,s._exit=c,s},enter:function(){return new tt(this._enter||this._groups.map(le),this._parents)},exit:function(){return new tt(this._exit||this._groups.map(le),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,a=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?a.remove():n(a),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,a=r.length,i=Math.min(o,a),s=new Array(o),l=0;l<i;++l)for(var c,u=n[l],d=r[l],f=u.length,p=s[l]=new Array(f),h=0;h<f;++h)(c=u[h]||d[h])&&(p[h]=c);for(;l<o;++l)s[l]=n[l];return new tt(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],a=o.length-1,i=o[a];--a>=0;)(r=o[a])&&(i&&4^r.compareDocumentPosition(i)&&i.parentNode.insertBefore(r,i),i=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=he);for(var n=this._groups,r=n.length,o=new Array(r),a=0;a<r;++a){for(var i,s=n[a],l=s.length,c=o[a]=new Array(l),u=0;u<l;++u)(i=s[u])&&(c[u]=i);c.sort(t)}return new tt(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,a=r.length;o<a;++o){var i=r[o];if(i)return i}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,a=t[n],i=0,s=a.length;i<s;++i)(o=a[i])&&e.call(o,o.__data__,i,a);return this},attr:function(e,t){var n=K(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?ge:me:"function"==typeof t?n.local?we:be:n.local?ve:ye)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?Se:"function"==typeof t?_e:Ee)(e,t,null==n?"":n)):Ce(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?ke:"function"==typeof t?Me:Ne)(e,t)):this.node()[e]},classed:function(e,t){var n=Pe(e+"");if(arguments.length<2){for(var r=Oe(this.node()),o=-1,a=n.length;++o<a;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?Ie:t?De:$e)(n,t))},text:function(e){return arguments.length?this.each(null==e?ze:("function"==typeof e?Be:Le)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Fe:("function"==typeof e?We:He)(e)):this.node().innerHTML},raise:function(){return this.each(Ve)},lower:function(){return this.each(je)},append:function(e){var t="function"==typeof e?e:Z(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:Z(e),r=null==t?Ye:"function"==typeof t?t:Q(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(Xe)},clone:function(e){return this.select(e?Ue:Ke)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,a=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),i=a.length;if(!(arguments.length<2)){for(s=t?Ze:qe,r=0;r<i;++r)this.each(s(a[r],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(r=0,l=s[c];r<i;++r)if((o=a[r]).type===l.type&&o.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?Je:Qe)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],a=0,i=o.length;a<i;++a)(r=o[a])&&(yield r)}};const at={passive:!1},it={capture:!0,passive:!1};function st(e){e.stopImmediatePropagation()}function lt(e){e.preventDefault(),e.stopImmediatePropagation()}function ct(e){var t=e.document.documentElement,n=rt(e).on("dragstart.drag",lt,it);"onselectstart"in t?n.on("selectstart.drag",lt,it):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ut(e,t){var n=e.document.documentElement,r=rt(e).on("dragstart.drag",null);t&&(r.on("click.drag",lt,it),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var dt=e=>()=>e;function ft(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:a,x:i,y:s,dx:l,dy:c,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:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:a,enumerable:!0,configurable:!0},x:{value:i,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function pt(e){return!e.ctrlKey&&!e.button}function ht(){return this.parentNode}function mt(e,t){return null==t?{x:e.x,y:e.y}:t}function gt(){return navigator.maxTouchPoints||"ontouchstart"in this}function yt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function vt(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function bt(){}ft.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var wt=.7,xt=1/wt,St="\\s*([+-]?\\d+)\\s*",Et="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_t="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ct=/^#([0-9a-f]{3,8})$/,kt=new RegExp(`^rgb\\(${St},${St},${St}\\)$`),Nt=new RegExp(`^rgb\\(${_t},${_t},${_t}\\)$`),Mt=new RegExp(`^rgba\\(${St},${St},${St},${Et}\\)$`),Pt=new RegExp(`^rgba\\(${_t},${_t},${_t},${Et}\\)$`),Ot=new RegExp(`^hsl\\(${Et},${_t},${_t}\\)$`),At=new RegExp(`^hsla\\(${Et},${_t},${_t},${Et}\\)$`),Rt={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};function Tt(){return this.rgb().formatHex()}function Dt(){return this.rgb().formatRgb()}function $t(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ct.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?It(t):3===n?new Bt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?zt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?zt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=kt.exec(e))?new Bt(t[1],t[2],t[3],1):(t=Nt.exec(e))?new Bt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Mt.exec(e))?zt(t[1],t[2],t[3],t[4]):(t=Pt.exec(e))?zt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=Ot.exec(e))?Yt(t[1],t[2]/100,t[3]/100,1):(t=At.exec(e))?Yt(t[1],t[2]/100,t[3]/100,t[4]):Rt.hasOwnProperty(e)?It(Rt[e]):"transparent"===e?new Bt(NaN,NaN,NaN,0):null}function It(e){return new Bt(e>>16&255,e>>8&255,255&e,1)}function zt(e,t,n,r){return r<=0&&(e=t=n=NaN),new Bt(e,t,n,r)}function Lt(e,t,n,r){return 1===arguments.length?((o=e)instanceof bt||(o=$t(o)),o?new Bt((o=o.rgb()).r,o.g,o.b,o.opacity):new Bt):new Bt(e,t,n,null==r?1:r);var o}function Bt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ft(){return`#${jt(this.r)}${jt(this.g)}${jt(this.b)}`}function Ht(){const e=Wt(this.opacity);return`${1===e?"rgb(":"rgba("}${Vt(this.r)}, ${Vt(this.g)}, ${Vt(this.b)}${1===e?")":`, ${e})`}`}function Wt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Vt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function jt(e){return((e=Vt(e))<16?"0":"")+e.toString(16)}function Yt(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kt(e,t,n,r)}function Xt(e){if(e instanceof Kt)return new Kt(e.h,e.s,e.l,e.opacity);if(e instanceof bt||(e=$t(e)),!e)return new Kt;if(e instanceof Kt)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),a=Math.max(t,n,r),i=NaN,s=a-o,l=(a+o)/2;return s?(i=t===a?(n-r)/s+6*(n<r):n===a?(r-t)/s+2:(t-n)/s+4,s/=l<.5?a+o:2-a-o,i*=60):s=l>0&&l<1?0:i,new Kt(i,s,l,e.opacity)}function Kt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ut(e){return(e=(e||0)%360)<0?e+360:e}function qt(e){return Math.max(0,Math.min(1,e||0))}function Zt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}yt(bt,$t,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Tt,formatHex:Tt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Xt(this).formatHsl()},formatRgb:Dt,toString:Dt}),yt(Bt,Lt,vt(bt,{brighter(e){return e=null==e?xt:Math.pow(xt,e),new Bt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?wt:Math.pow(wt,e),new Bt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Bt(Vt(this.r),Vt(this.g),Vt(this.b),Wt(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:Ft,formatHex:Ft,formatHex8:function(){return`#${jt(this.r)}${jt(this.g)}${jt(this.b)}${jt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ht,toString:Ht})),yt(Kt,function(e,t,n,r){return 1===arguments.length?Xt(e):new Kt(e,t,n,null==r?1:r)},vt(bt,{brighter(e){return e=null==e?xt:Math.pow(xt,e),new Kt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?wt:Math.pow(wt,e),new Kt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Bt(Zt(e>=240?e-240:e+120,o,r),Zt(e,o,r),Zt(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Kt(Ut(this.h),qt(this.s),qt(this.l),Wt(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=Wt(this.opacity);return`${1===e?"hsl(":"hsla("}${Ut(this.h)}, ${100*qt(this.s)}%, ${100*qt(this.l)}%${1===e?")":`, ${e})`}`}}));var Gt=e=>()=>e;function Qt(e){return 1===(e=+e)?Jt:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Gt(isNaN(t)?n:t)}}function Jt(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Gt(isNaN(e)?t:e)}var en=function e(t){var n=Qt(t);function r(e,t){var r=n((e=Lt(e)).r,(t=Lt(t)).r),o=n(e.g,t.g),a=n(e.b,t.b),i=Jt(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=a(t),e.opacity=i(t),e+""}}return r.gamma=e,r}(1);function tn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var nn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,rn=new RegExp(nn.source,"g");function on(e,t){var n,r,o,a=nn.lastIndex=rn.lastIndex=0,i=-1,s=[],l=[];for(e+="",t+="";(n=nn.exec(e))&&(r=rn.exec(t));)(o=r.index)>a&&(o=t.slice(a,o),s[i]?s[i]+=o:s[++i]=o),(n=n[0])===(r=r[0])?s[i]?s[i]+=r:s[++i]=r:(s[++i]=null,l.push({i:i,x:tn(n,r)})),a=rn.lastIndex;return a<t.length&&(o=t.slice(a),s[i]?s[i]+=o:s[++i]=o),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}var an,sn=180/Math.PI,ln={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function cn(e,t,n,r,o,a){var i,s,l;return(i=Math.sqrt(e*e+t*t))&&(e/=i,t/=i),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,i=-i),{translateX:o,translateY:a,rotate:Math.atan2(t,e)*sn,skewX:Math.atan(l)*sn,scaleX:i,scaleY:s}}function un(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(a,i){var s=[],l=[];return a=e(a),i=e(i),function(e,r,o,a,i,s){if(e!==o||r!==a){var l=i.push("translate(",null,t,null,n);s.push({i:l-4,x:tn(e,o)},{i:l-2,x:tn(r,a)})}else(o||a)&&i.push("translate("+o+t+a+n)}(a.translateX,a.translateY,i.translateX,i.translateY,s,l),function(e,t,n,a){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),a.push({i:n.push(o(n)+"rotate(",null,r)-2,x:tn(e,t)})):t&&n.push(o(n)+"rotate("+t+r)}(a.rotate,i.rotate,s,l),function(e,t,n,a){e!==t?a.push({i:n.push(o(n)+"skewX(",null,r)-2,x:tn(e,t)}):t&&n.push(o(n)+"skewX("+t+r)}(a.skewX,i.skewX,s,l),function(e,t,n,r,a,i){if(e!==n||t!==r){var s=a.push(o(a)+"scale(",null,",",null,")");i.push({i:s-4,x:tn(e,n)},{i:s-2,x:tn(t,r)})}else 1===n&&1===r||a.push(o(a)+"scale("+n+","+r+")")}(a.scaleX,a.scaleY,i.scaleX,i.scaleY,s,l),a=i=null,function(e){for(var t,n=-1,r=l.length;++n<r;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var dn=un(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ln:cn(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),fn=un(function(e){return null==e?ln:(an||(an=document.createElementNS("http://www.w3.org/2000/svg","g")),an.setAttribute("transform",e),(e=an.transform.baseVal.consolidate())?cn((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):ln)},", ",")",")");function pn(e){return((e=Math.exp(e))+1/e)/2}var hn,mn,gn=function e(t,n,r){function o(e,o){var a,i,s=e[0],l=e[1],c=e[2],u=o[0],d=o[1],f=o[2],p=u-s,h=d-l,m=p*p+h*h;if(m<1e-12)i=Math.log(f/c)/t,a=function(e){return[s+e*p,l+e*h,c*Math.exp(t*e*i)]};else{var g=Math.sqrt(m),y=(f*f-c*c+r*m)/(2*c*n*g),v=(f*f-c*c-r*m)/(2*f*n*g),b=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(v*v+1)-v);i=(w-b)/t,a=function(e){var r,o=e*i,a=pn(b),u=c/(n*g)*(a*(r=t*o+b,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+u*p,l+u*h,c*a/pn(t*o+b)]}}return a.duration=1e3*i*t/Math.SQRT2,a}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4),yn=0,vn=0,bn=0,wn=0,xn=0,Sn=0,En="object"==typeof performance&&performance.now?performance:Date,_n="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Cn(){return xn||(_n(kn),xn=En.now()+Sn)}function kn(){xn=0}function Nn(){this._call=this._time=this._next=null}function Mn(e,t,n){var r=new Nn;return r.restart(e,t,n),r}function Pn(){xn=(wn=En.now())+Sn,yn=vn=0;try{!function(){Cn(),++yn;for(var e,t=hn;t;)(e=xn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--yn}()}finally{yn=0,function(){var e,t,n=hn,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:hn=t);mn=e,An(r)}(),xn=0}}function On(){var e=En.now(),t=e-wn;t>1e3&&(Sn-=t,wn=e)}function An(e){yn||(vn&&(vn=clearTimeout(vn)),e-xn>24?(e<1/0&&(vn=setTimeout(Pn,e-En.now()-Sn)),bn&&(bn=clearInterval(bn))):(bn||(wn=En.now(),bn=setInterval(On,1e3)),yn=1,_n(Pn)))}function Rn(e,t,n){var r=new Nn;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}Nn.prototype=Mn.prototype={constructor:Nn,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?Cn():+n)+(null==t?0:+t),this._next||mn===this||(mn?mn._next=this:hn=this,mn=this),this._call=e,this._time=n,An()},stop:function(){this._call&&(this._call=null,this._time=1/0,An())}};var Tn=H("start","end","cancel","interrupt"),Dn=[];function $n(e,t,n,r,o,a){var i=e.__transition;if(i){if(n in i)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function a(e){n.state=1,n.timer.restart(i,n.delay,n.time),n.delay<=e&&i(e-n.delay)}function i(a){var c,u,d,f;if(1!==n.state)return l();for(c in o)if((f=o[c]).name===n.name){if(3===f.state)return Rn(i);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[c])}if(Rn(function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(a))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++u]=f);r.length=u+1}}function s(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),a=-1,i=r.length;++a<i;)r[a].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=Mn(a,0,n.time)}(e,n,{name:t,index:r,group:o,on:Tn,tween:Dn,time:a.time,delay:a.delay,duration:a.duration,ease:a.ease,timer:null,state:0})}function In(e,t){var n=Ln(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function zn(e,t){var n=Ln(e,t);if(n.state>3)throw new Error("too late; already running");return n}function Ln(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Bn(e,t){var n,r,o,a=e.__transition,i=!0;if(a){for(o in t=null==t?null:t+"",a)(n=a[o]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete a[o]):i=!1;i&&delete e.__transition}}function Fn(e,t){var n,r;return function(){var o=zn(this,e),a=o.tween;if(a!==n)for(var i=0,s=(r=n=a).length;i<s;++i)if(r[i].name===t){(r=r.slice()).splice(i,1);break}o.tween=r}}function Hn(e,t,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var a=zn(this,e),i=a.tween;if(i!==r){o=(r=i).slice();for(var s={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=s;break}l===c&&o.push(s)}a.tween=o}}function Wn(e,t,n){var r=e._id;return e.each(function(){var e=zn(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return Ln(e,r).value[t]}}function Vn(e,t){var n;return("number"==typeof t?tn:t instanceof $t?en:(n=$t(t))?(t=n,en):on)(e,t)}function jn(e){return function(){this.removeAttribute(e)}}function Yn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xn(e,t,n){var r,o,a=n+"";return function(){var i=this.getAttribute(e);return i===a?null:i===r?o:o=t(r=i,n)}}function Kn(e,t,n){var r,o,a=n+"";return function(){var i=this.getAttributeNS(e.space,e.local);return i===a?null:i===r?o:o=t(r=i,n)}}function Un(e,t,n){var r,o,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttribute(e))===(s=l+"")?null:i===r&&s===o?a:(o=s,a=t(r=i,l));this.removeAttribute(e)}}function qn(e,t,n){var r,o,a;return function(){var i,s,l=n(this);if(null!=l)return(i=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:i===r&&s===o?a:(o=s,a=t(r=i,l));this.removeAttributeNS(e.space,e.local)}}function Zn(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,o)),n}return o._value=t,o}function Gn(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,o)),n}return o._value=t,o}function Qn(e,t){return function(){In(this,e).delay=+t.apply(this,arguments)}}function Jn(e,t){return t=+t,function(){In(this,e).delay=t}}function er(e,t){return function(){zn(this,e).duration=+t.apply(this,arguments)}}function tr(e,t){return t=+t,function(){zn(this,e).duration=t}}var nr=nt.prototype.constructor;function rr(e){return function(){this.style.removeProperty(e)}}var or=0;function ar(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function ir(){return++or}var sr=nt.prototype;ar.prototype={constructor:ar,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=Q(e));for(var r=this._groups,o=r.length,a=new Array(o),i=0;i<o;++i)for(var s,l,c=r[i],u=c.length,d=a[i]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=e.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),d[f]=l,$n(d[f],t,n,f,d,Ln(s,n)));return new ar(a,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=ee(e));for(var r=this._groups,o=r.length,a=[],i=[],s=0;s<o;++s)for(var l,c=r[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var f,p=e.call(l,l.__data__,d,c),h=Ln(l,n),m=0,g=p.length;m<g;++m)(f=p[m])&&$n(f,t,n,m,p,h);a.push(p),i.push(l)}return new ar(a,i,t,n)},selectChild:sr.selectChild,selectChildren:sr.selectChildren,filter:function(e){"function"!=typeof e&&(e=ne(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var a,i=t[o],s=i.length,l=r[o]=[],c=0;c<s;++c)(a=i[c])&&e.call(a,a.__data__,c,i)&&l.push(a);return new ar(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,a=Math.min(r,o),i=new Array(r),s=0;s<a;++s)for(var l,c=t[s],u=n[s],d=c.length,f=i[s]=new Array(d),p=0;p<d;++p)(l=c[p]||u[p])&&(f[p]=l);for(;s<r;++s)i[s]=t[s];return new ar(i,this._parents,this._name,this._id)},selection:function(){return new nr(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=ir(),r=this._groups,o=r.length,a=0;a<o;++a)for(var i,s=r[a],l=s.length,c=0;c<l;++c)if(i=s[c]){var u=Ln(i,t);$n(i,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ar(r,this._parents,e,n)},call:sr.call,nodes:sr.nodes,node:sr.node,size:sr.size,empty:sr.empty,each:sr.each,on:function(e,t){var n=this._id;return arguments.length<2?Ln(this.node(),n).on.on(e):this.each(function(e,t,n){var r,o,a=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?In:zn;return function(){var i=a(this,e),s=i.on;s!==r&&(o=(r=s).copy()).on(t,n),i.on=o}}(n,e,t))},attr:function(e,t){var n=K(e),r="transform"===n?fn:Vn;return this.attrTween(e,"function"==typeof t?(n.local?qn:Un)(n,r,Wn(this,"attr."+e,t)):null==t?(n.local?Yn:jn)(n):(n.local?Kn:Xn)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=K(e);return this.tween(n,(r.local?Zn:Gn)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?dn:Vn;return null==t?this.styleTween(e,function(e,t){var n,r,o;return function(){var a=Ce(this,e),i=(this.style.removeProperty(e),Ce(this,e));return a===i?null:a===n&&i===r?o:o=t(n=a,r=i)}}(e,r)).on("end.style."+e,rr(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,o,a;return function(){var i=Ce(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=Ce(this,e)),i===l?null:i===r&&l===o?a:(o=l,a=t(r=i,s))}}(e,r,Wn(this,"style."+e,t))).each(function(e,t){var n,r,o,a,i="style."+t,s="end."+i;return function(){var l=zn(this,e),c=l.on,u=null==l.value[i]?a||(a=rr(t)):void 0;c===n&&o===u||(r=(n=c).copy()).on(s,o=u),l.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,o,a=n+"";return function(){var i=Ce(this,e);return i===a?null:i===r?o:o=t(r=i,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,o;function a(){var a=t.apply(this,arguments);return a!==o&&(r=(o=a)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,a,n)),r}return a._value=t,a}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(Wn(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=Ln(this.node(),n).tween,a=0,i=o.length;a<i;++a)if((r=o[a]).name===e)return r.value;return null}return this.each((null==t?Fn:Hn)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Qn:Jn)(t,e)):Ln(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?er:tr)(t,e)):Ln(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){zn(this,e).ease=t}}(t,e)):Ln(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;zn(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(a,i){var s={value:i},l={value:function(){0===--o&&a()}};n.each(function(){var n=zn(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===o&&a()})},[Symbol.iterator]:sr[Symbol.iterator]};var lr={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function cr(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}nt.prototype.interrupt=function(e){return this.each(function(){Bn(this,e)})},nt.prototype.transition=function(e){var t,n;e instanceof ar?(t=e._id,e=e._name):(t=ir(),(n=lr).time=Cn(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,a=0;a<o;++a)for(var i,s=r[a],l=s.length,c=0;c<l;++c)(i=s[c])&&$n(i,e,t,c,s,n||cr(i,t));return new ar(r,this._parents,e,t)};var ur=e=>()=>e;function dr(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function fr(e,t,n){this.k=e,this.x=t,this.y=n}fr.prototype={constructor:fr,scale:function(e){return 1===e?this:new fr(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new fr(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 pr=new fr(1,0,0);function hr(e){e.stopImmediatePropagation()}function mr(e){e.preventDefault(),e.stopImmediatePropagation()}function gr(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function yr(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).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 vr(){return this.__zoom||pr}function br(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function wr(){return navigator.maxTouchPoints||"ontouchstart"in this}function xr(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],a=e.invertY(t[0][1])-n[0][1],i=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),i>a?(a+i)/2:Math.min(0,a)||Math.max(0,i))}fr.prototype;const Sr=n(null),Er=Sr.Provider,_r=()=>"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.",Cr=e=>`Node type "${e}" not found. Using fallback type "default".`,kr=()=>"The React Flow parent container needs a width and a height to render the graph.",Nr=()=>"Only child nodes can use a parent extent.",Mr=()=>"Can't create edge. An edge needs a source and a target.",Pr=e=>`Marker type "${e}" doesn't exist.`,Or=(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,Ar=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",Rr=e=>`Edge type "${e}" not found. Using fallback type "default".`,Tr=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.`,Dr=(()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001")();function $r(e,t){const n=c(Sr);if(null===n)throw new Error(Dr);return z(n,e,t)}const Ir=()=>{const e=c(Sr);if(null===e)throw new Error(Dr);return o(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},zr=e=>e.userSelectionActive?"none":"all";function Lr({position:e,children:n,className:r,style:o,...a}){const i=$r(zr),s=`${e}`.split("-");return t.createElement("div",{className:v(["react-flow__panel",r,...s]),style:{...o,pointerEvents:i},...a},n)}function Br({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:t.createElement(Lr,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},t.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var Fr=r(({x:e,y:n,label:r,labelStyle:o={},labelShowBg:a=!0,labelBgStyle:s={},labelBgPadding:c=[2,4],labelBgBorderRadius:d=2,children:f,className:p,...h})=>{const m=l(null),[g,y]=u({x:0,y:0,width:0,height:0}),b=v(["react-flow__edge-textwrapper",p]);return i(()=>{if(m.current){const e=m.current.getBBox();y({x:e.x,y:e.y,width:e.width,height:e.height})}},[r]),void 0!==r&&r?t.createElement("g",{transform:`translate(${e-g.width/2} ${n-g.height/2})`,className:b,visibility:g.width?"visible":"hidden",...h},a&&t.createElement("rect",{width:g.width+2*c[0],x:-c[0],y:-c[1],height:g.height+2*c[1],className:"react-flow__edge-textbg",style:s,rx:d,ry:d}),t.createElement("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:m,style:o},r),f):null});const Hr=e=>({width:e.offsetWidth,height:e.offsetHeight}),Wr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Vr=(e={x:0,y:0},t)=>({x:Wr(e.x,t[0][0],t[1][0]),y:Wr(e.y,t[0][1],t[1][1])}),jr=(e,t,n)=>e<t?Wr(Math.abs(e-t),1,50)/50:e>n?-Wr(Math.abs(e-n),1,50)/50:0,Yr=(e,t)=>[20*jr(e.x,35,t.width-35),20*jr(e.y,35,t.height-35)],Xr=e=>e.getRootNode?.()||window?.document,Kr=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Ur=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),qr=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Zr=e=>!isNaN(e)&&isFinite(e),Gr=Symbol.for("internals"),Qr=["Enter"," ","Escape"],Jr=(e,t)=>{"development"===process.env.NODE_ENV&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)};function eo(e){const t=(e=>"nativeEvent"in e)(e)?e.nativeEvent:e,n=t.composedPath?.()?.[0]||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const to=e=>"clientX"in e,no=(e,t)=>{const n=to(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},ro=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,oo=({id:e,path:n,labelX:r,labelY:o,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h=20})=>t.createElement(t.Fragment,null,t.createElement("path",{id:e,style:d,d:n,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:p}),h&&t.createElement("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),a&&Zr(r)&&Zr(o)?t.createElement(Fr,{x:r,y:o,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);function ao(e,t,n){return void 0===n?n:r=>{const o=t().edges.find(t=>t.id===e);o&&n(r,{...o})}}function io({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,a=n<e?n+o:n-o,i=Math.abs(r-t)/2;return[a,r<t?r+i:r-i,o,i]}function so({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:a,targetControlX:i,targetControlY:s}){const l=.125*e+.375*o+.375*i+.125*n,c=.125*t+.375*a+.375*s+.125*r;return[l,c,Math.abs(l-e),Math.abs(c-t)]}var lo,co,uo,fo,po,ho;function mo({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===ho.Left||e===ho.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function go({sourceX:e,sourceY:t,sourcePosition:n=ho.Bottom,targetX:r,targetY:o,targetPosition:a=ho.Top}){const[i,s]=mo({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,c]=mo({pos:a,x1:r,y1:o,x2:e,y2:t}),[u,d,f,p]=so({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:i,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${i},${s} ${l},${c} ${r},${o}`,u,d,f,p]}oo.displayName="BaseEdge",function(e){e.Strict="strict",e.Loose="loose"}(lo||(lo={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(co||(co={})),function(e){e.Partial="partial",e.Full="full"}(uo||(uo={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(fo||(fo={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(po||(po={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(ho||(ho={}));const yo=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,sourcePosition:a=ho.Bottom,targetPosition:i=ho.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})=>{const[y,v,b]=go({sourceX:e,sourceY:n,sourcePosition:a,targetX:r,targetY:o,targetPosition:i});return t.createElement(oo,{path:y,labelX:v,labelY:b,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})});yo.displayName="SimpleBezierEdge";const vo={[ho.Left]:{x:-1,y:0},[ho.Right]:{x:1,y:0},[ho.Top]:{x:0,y:-1},[ho.Bottom]:{x:0,y:1}},bo=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function wo({source:e,sourcePosition:t=ho.Bottom,target:n,targetPosition:r=ho.Top,center:o,offset:a}){const i=vo[t],s=vo[r],l={x:e.x+i.x*a,y:e.y+i.y*a},c={x:n.x+s.x*a,y:n.y+s.y*a},u=(({source:e,sourcePosition:t=ho.Bottom,target:n})=>t===ho.Left||t===ho.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})({source:l,sourcePosition:t,target:c}),d=0!==u.x?"x":"y",f=u[d];let p,h,m=[];const g={x:0,y:0},y={x:0,y:0},[v,b,w,x]=io({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(i[d]*s[d]===-1){p=o.x??v,h=o.y??b;const e=[{x:p,y:l.y},{x:p,y:c.y}],t=[{x:l.x,y:h},{x:c.x,y:h}];m=i[d]===f?"x"===d?e:t:"x"===d?t:e}else{const o=[{x:l.x,y:c.y}],u=[{x:c.x,y:l.y}];if(m="x"===d?i.x===f?u:o:i.y===f?o:u,t===r){const t=Math.abs(e[d]-n[d]);if(t<=a){const r=Math.min(a-1,a-t);i[d]===f?g[d]=(l[d]>e[d]?-1:1)*r:y[d]=(c[d]>n[d]?-1:1)*r}}if(t!==r){const e="x"===d?"y":"x",t=i[d]===s[e],n=l[e]>c[e],r=l[e]<c[e];(1===i[d]&&(!t&&n||t&&r)||1!==i[d]&&(!t&&r||t&&n))&&(m="x"===d?o:u)}const v={x:l.x+g.x,y:l.y+g.y},b={x:c.x+y.x,y:c.y+y.y};Math.max(Math.abs(v.x-m[0].x),Math.abs(b.x-m[0].x))>=Math.max(Math.abs(v.y-m[0].y),Math.abs(b.y-m[0].y))?(p=(v.x+b.x)/2,h=m[0].y):(p=m[0].x,h=(v.y+b.y)/2)}return[[e,{x:l.x+g.x,y:l.y+g.y},...m,{x:c.x+y.x,y:c.y+y.y},n],p,h,w,x]}function xo({sourceX:e,sourceY:t,sourcePosition:n=ho.Bottom,targetX:r,targetY:o,targetPosition:a=ho.Top,borderRadius:i=5,centerX:s,centerY:l,offset:c=20}){const[u,d,f,p,h]=wo({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:a,center:{x:s,y:l},offset:c}),m=u.reduce((e,t,n)=>{let r="";return r=n>0&&n<u.length-1?function(e,t,n,r){const o=Math.min(bo(e,t)/2,bo(t,n)/2,r),{x:a,y:i}=t;if(e.x===a&&a===n.x||e.y===i&&i===n.y)return`L${a} ${i}`;if(e.y===i)return`L ${a+o*(e.x<n.x?-1:1)},${i}Q ${a},${i} ${a},${i+o*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${a},${i+o*(e.y<n.y?-1:1)}Q ${a},${i} ${a+o*s},${i}`}(u[n-1],t,u[n+1],i):`${0===n?"M":"L"}${t.x} ${t.y}`,e+=r},"");return[m,d,f,p,h]}const So=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,sourcePosition:f=ho.Bottom,targetPosition:p=ho.Top,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=xo({sourceX:e,sourceY:n,sourcePosition:f,targetX:r,targetY:o,targetPosition:p,borderRadius:g?.borderRadius,offset:g?.offset});return t.createElement(oo,{path:v,labelX:b,labelY:w,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:h,markerStart:m,interactionWidth:y})});So.displayName="SmoothStepEdge";const Eo=r(e=>t.createElement(So,{...e,pathOptions:o(()=>({borderRadius:0,offset:e.pathOptions?.offset}),[e.pathOptions?.offset])}));Eo.displayName="StepEdge";const _o=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})=>{const[m,g,y]=function({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,a,i,s]=io({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,a,i,s]}({sourceX:e,sourceY:n,targetX:r,targetY:o});return t.createElement(oo,{path:m,labelX:g,labelY:y,label:a,labelStyle:i,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})});function Co(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function ko({pos:e,x1:t,y1:n,x2:r,y2:o,c:a}){switch(e){case ho.Left:return[t-Co(t-r,a),n];case ho.Right:return[t+Co(r-t,a),n];case ho.Top:return[t,n-Co(n-o,a)];case ho.Bottom:return[t,n+Co(o-n,a)]}}function No({sourceX:e,sourceY:t,sourcePosition:n=ho.Bottom,targetX:r,targetY:o,targetPosition:a=ho.Top,curvature:i=.25}){const[s,l]=ko({pos:n,x1:e,y1:t,x2:r,y2:o,c:i}),[c,u]=ko({pos:a,x1:r,y1:o,x2:e,y2:t,c:i}),[d,f,p,h]=so({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${r},${o}`,d,f,p,h]}_o.displayName="StraightEdge";const Mo=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,sourcePosition:a=ho.Bottom,targetPosition:i=ho.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=No({sourceX:e,sourceY:n,sourcePosition:a,targetX:r,targetY:o,targetPosition:i,curvature:g?.curvature});return t.createElement(oo,{path:v,labelX:b,labelY:w,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:y})});Mo.displayName="BezierEdge";const Po=n(null),Oo=Po.Provider;Po.Consumer;const Ao=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,Ro=(e,t)=>{if(void 0===e)return"";if("string"==typeof e)return e;return`${t?`${t}__`:""}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`},To=(e,t)=>{if(!e.source||!e.target)return Jr("006",Mr()),t;let n;var r;return n="id"in(r=e)&&"source"in r&&"target"in r?{...e}:{...e,id:Ao(e)},((e,t)=>t.some(t=>!(t.source!==e.source||t.target!==e.target||t.sourceHandle!==e.sourceHandle&&(t.sourceHandle||e.sourceHandle)||t.targetHandle!==e.targetHandle&&(t.targetHandle||e.targetHandle))))(n,t)?t:t.concat(n)},Do=({x:e,y:t},[n,r,o],a,[i,s])=>{const l={x:(e-n)/o,y:(t-r)/o};return a?{x:i*Math.round(l.x/i),y:s*Math.round(l.y/s)}:l},$o=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),Io=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},zo=(e,t=[0,0])=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce((e,n)=>{const{x:r,y:o}=Io(n,t).positionAbsolute;return a=e,i=Kr({x:r,y:o,width:n.width||0,height:n.height||0}),{x:Math.min(a.x,i.x),y:Math.min(a.y,i.y),x2:Math.max(a.x2,i.x2),y2:Math.max(a.y2,i.y2)};var a,i},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return(({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}))(n)},Lo=(e,t,[n,r,o]=[0,0,1],a=!1,i=!1,s=[0,0])=>{const l={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},c=[];return e.forEach(e=>{const{width:t,height:n,selectable:r=!0,hidden:o=!1}=e;if(i&&!r||o)return!1;const{positionAbsolute:u}=Io(e,s),d={x:u.x,y:u.y,width:t||0,height:n||0},f=qr(l,d);(void 0===t||void 0===n||null===t||null===n||a&&f>0||f>=(t||0)*(n||0)||e.dragging)&&c.push(e)}),c},Bo=(e,t)=>{const n=e.map(e=>e.id);return t.filter(e=>n.includes(e.source)||n.includes(e.target))},Fo=(e,t,n,r,o,a=.1)=>{const i=t/(e.width*(1+a)),s=n/(e.height*(1+a)),l=Math.min(i,s),c=Wr(l,r,o);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},Ho=(e,t=0)=>e.transition().duration(t);function Wo(e,t,n,r){return(t[n]||[]).reduce((t,o)=>(`${e.id}-${o.id}-${n}`!==r&&t.push({id:o.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+o.x+o.width/2,y:(e.positionAbsolute?.y??0)+o.y+o.height/2}),t),[])}const Vo={source:null,target:null,sourceHandle:null,targetHandle:null},jo=()=>({handleDomNode:null,isValid:!1,connection:Vo,endHandle:null});function Yo(e,t,n,r,o,a,i){const s="target"===o,l=i.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),c={...jo(),handleDomNode:l};if(l){const e=Xo(void 0,l),o=l.getAttribute("data-nodeid"),i=l.getAttribute("data-handleid"),u=l.classList.contains("connectable"),d=l.classList.contains("connectableend"),f={source:s?o:n,sourceHandle:s?i:r,target:s?n:o,targetHandle:s?r:i};c.connection=f;u&&d&&(t===lo.Strict?s&&"source"===e||!s&&"target"===e:o!==n||i!==r)&&(c.endHandle={nodeId:o,handleId:i,type:e},c.isValid=a(f))}return c}function Xo(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Ko(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Uo(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function qo({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:a,setState:i,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:c}){const u=Xr(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:p,connectionRadius:h,onConnectStart:m,panBy:g,getNodes:y,cancelConnection:v}=a();let b,w=0;const{x:x,y:S}=no(e),E=u?.elementFromPoint(x,S),_=Xo(l,E),C=f?.getBoundingClientRect();if(!C||!_)return;let k,N=no(e,C),M=!1,P=null,O=!1,A=null;const R=function({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((e,o)=>{if(o[Gr]){const{handleBounds:a}=o[Gr];let i=[],s=[];a&&(i=Wo(o,a,"source",`${t}-${n}-${r}`),s=Wo(o,a,"target",`${t}-${n}-${r}`)),e.push(...i,...s)}return e},[])}({nodes:y(),nodeId:n,handleId:t,handleType:_}),T=()=>{if(!p)return;const[e,t]=Yr(N,C);g({x:e,y:t}),w=requestAnimationFrame(T)};function D(e){const{transform:r}=a();N=no(e,C);const{handle:l,validHandleResult:c}=function(e,t,n,r,o,a){const{x:i,y:s}=no(e),l=t.elementsFromPoint(i,s).find(e=>e.classList.contains("react-flow__handle"));if(l){const e=l.getAttribute("data-nodeid");if(e){const t=Xo(void 0,l),r=l.getAttribute("data-handleid"),i=a({nodeId:e,id:r,type:t});if(i){const a=o.find(n=>n.nodeId===e&&n.type===t&&n.id===r);return{handle:{id:r,type:t,nodeId:e,x:a?.x||n.x,y:a?.y||n.y},validHandleResult:i}}}}let c=[],u=1/0;if(o.forEach(e=>{const t=Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2);if(t<=r){const n=a(e);t<=u&&(t<u?c=[{handle:e,validHandleResult:n}]:t===u&&c.push({handle:e,validHandleResult:n}),u=t)}}),!c.length)return{handle:null,validHandleResult:jo()};if(1===c.length)return c[0];const d=c.some(({validHandleResult:e})=>e.isValid),f=c.some(({handle:e})=>"target"===e.type);return c.find(({handle:e,validHandleResult:t})=>f?"target"===e.type:!d||t.isValid)||c[0]}(e,u,Do(N,r,!1,[1,1]),h,R,e=>Yo(e,d,n,t,o?"target":"source",s,u));if(b=l,M||(T(),M=!0),A=c.handleDomNode,P=c.connection,O=c.isValid,i({connectionPosition:b&&O?$o({x:b.x,y:b.y},r):N,connectionStatus:Uo(!!b,O),connectionEndHandle:c.endHandle}),!b&&!O&&!A)return Ko(k);P.source!==P.target&&A&&(Ko(k),k=A,A.classList.add("connecting","react-flow__handle-connecting"),A.classList.toggle("valid",O),A.classList.toggle("react-flow__handle-valid",O))}function $(e){(b||A)&&P&&O&&r?.(P),a().onConnectEnd?.(e),l&&c?.(e),Ko(k),v(),cancelAnimationFrame(w),M=!1,O=!1,P=null,A=null,u.removeEventListener("mousemove",D),u.removeEventListener("mouseup",$),u.removeEventListener("touchmove",D),u.removeEventListener("touchend",$)}i({connectionPosition:N,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:_,connectionStartHandle:{nodeId:n,handleId:t,type:_},connectionEndHandle:null}),m?.(e,{nodeId:n,handleId:t,handleType:_}),u.addEventListener("mousemove",D),u.addEventListener("mouseup",$),u.addEventListener("touchmove",D),u.addEventListener("touchend",$)}const Zo=()=>!0,Go=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Qo=a(({type:e="source",position:n=ho.Top,isValidConnection:r,isConnectable:o=!0,isConnectableStart:a=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:u,className:d,onMouseDown:f,onTouchStart:p,...h},m)=>{const g=s||null,y="target"===e,b=Ir(),w=c(Po),{connectOnClick:x,noPanClassName:S}=$r(Go,B),{connecting:E,clickConnecting:_}=$r(((e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:a,connectionClickStartHandle:i}=r;return{connecting:o?.nodeId===e&&o?.handleId===t&&o?.type===n||a?.nodeId===e&&a?.handleId===t&&a?.type===n,clickConnecting:i?.nodeId===e&&i?.handleId===t&&i?.type===n}})(w,g,e),B);w||b.getState().onError?.("010",Ar());const C=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=b.getState(),o={...t,...e};if(r){const{edges:e,setEdges:t}=b.getState();t(To(o,e))}n?.(o),l?.(o)},k=e=>{if(!w)return;const t=to(e);a&&(t&&0===e.button||!t)&&qo({event:e,handleId:g,nodeId:w,onConnect:C,isTarget:y,getState:b.getState,setState:b.setState,isValidConnection:r||b.getState().isValidConnection||Zo}),t?f?.(e):p?.(e)};return t.createElement("div",{"data-handleid":g,"data-nodeid":w,"data-handlepos":n,"data-id":`${w}-${g}-${e}`,className:v(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",S,d,{source:!y,target:y,connectable:o,connectablestart:a,connectableend:i,connecting:_,connectionindicator:o&&(a&&!E||i&&E)}]),onMouseDown:k,onTouchStart:k,onClick:x?t=>{const{onClickConnectStart:n,onClickConnectEnd:o,connectionClickStartHandle:i,connectionMode:s,isValidConnection:l}=b.getState();if(!w||!i&&!a)return;if(!i)return n?.(t,{nodeId:w,handleId:g,handleType:e}),void b.setState({connectionClickStartHandle:{nodeId:w,type:e,handleId:g}});const c=Xr(t.target),u=r||l||Zo,{connection:d,isValid:f}=Yo({nodeId:w,id:g,type:e},s,i.nodeId,i.handleId||null,i.type,u,c);f&&C(d),o?.(t),b.setState({connectionClickStartHandle:null})}:void 0,ref:m,...h},u)});Qo.displayName="Handle";var Jo=r(Qo);const ea=({data:e,isConnectable:n,targetPosition:r=ho.Top,sourcePosition:o=ho.Bottom})=>t.createElement(t.Fragment,null,t.createElement(Jo,{type:"target",position:r,isConnectable:n}),e?.label,t.createElement(Jo,{type:"source",position:o,isConnectable:n}));ea.displayName="DefaultNode";var ta=r(ea);const na=({data:e,isConnectable:n,sourcePosition:r=ho.Bottom})=>t.createElement(t.Fragment,null,e?.label,t.createElement(Jo,{type:"source",position:r,isConnectable:n}));na.displayName="InputNode";var ra=r(na);const oa=({data:e,isConnectable:n,targetPosition:r=ho.Top})=>t.createElement(t.Fragment,null,t.createElement(Jo,{type:"target",position:r,isConnectable:n}),e?.label);oa.displayName="OutputNode";var aa=r(oa);const ia=()=>null;ia.displayName="GroupNode";const sa=e=>({selectedNodes:e.getNodes().filter(e=>e.selected),selectedEdges:e.edges.filter(e=>e.selected).map(e=>({...e}))}),la=e=>e.id;function ca(e,t){return B(e.selectedNodes.map(la),t.selectedNodes.map(la))&&B(e.selectedEdges.map(la),t.selectedEdges.map(la))}const ua=r(({onSelectionChange:e})=>{const t=Ir(),{selectedNodes:n,selectedEdges:r}=$r(sa,ca);return i(()=>{const o={nodes:n,edges:r};e?.(o),t.getState().onSelectionChange.forEach(e=>e(o))},[n,r,e]),null});ua.displayName="SelectionListener";const da=e=>!!e.onSelectionChange;function fa({onSelectionChange:e}){const n=$r(da);return e||n?t.createElement(ua,{onSelectionChange:e}):null}const pa=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function ha(e,t){i(()=>{void 0!==e&&t(e)},[e])}function ma(e,t,n){i(()=>{void 0!==t&&n({[e]:t})},[t])}const ga=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:a,onConnectEnd:s,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:u,nodesConnectable:d,nodesFocusable:f,edgesFocusable:p,edgesUpdatable:h,elevateNodesOnSelect:m,minZoom:g,maxZoom:y,nodeExtent:v,onNodesChange:b,onEdgesChange:w,elementsSelectable:x,connectionMode:S,snapGrid:E,snapToGrid:_,translateExtent:C,connectOnClick:k,defaultEdgeOptions:N,fitView:M,fitViewOptions:P,onNodesDelete:O,onEdgesDelete:A,onNodeDrag:R,onNodeDragStart:T,onNodeDragStop:D,onSelectionDrag:$,onSelectionDragStart:I,onSelectionDragStop:z,noPanClassName:L,nodeOrigin:F,rfId:H,autoPanOnConnect:W,autoPanOnNodeDrag:V,onError:j,connectionRadius:Y,isValidConnection:X,nodeDragThreshold:K})=>{const{setNodes:U,setEdges:q,setDefaultNodesAndEdges:Z,setMinZoom:G,setMaxZoom:Q,setTranslateExtent:J,setNodeExtent:ee,reset:te}=$r(pa,B),ne=Ir();return i(()=>{const e=r?.map(e=>({...e,...N}));return Z(n,e),()=>{te()}},[]),ma("defaultEdgeOptions",N,ne.setState),ma("connectionMode",S,ne.setState),ma("onConnect",o,ne.setState),ma("onConnectStart",a,ne.setState),ma("onConnectEnd",s,ne.setState),ma("onClickConnectStart",l,ne.setState),ma("onClickConnectEnd",c,ne.setState),ma("nodesDraggable",u,ne.setState),ma("nodesConnectable",d,ne.setState),ma("nodesFocusable",f,ne.setState),ma("edgesFocusable",p,ne.setState),ma("edgesUpdatable",h,ne.setState),ma("elementsSelectable",x,ne.setState),ma("elevateNodesOnSelect",m,ne.setState),ma("snapToGrid",_,ne.setState),ma("snapGrid",E,ne.setState),ma("onNodesChange",b,ne.setState),ma("onEdgesChange",w,ne.setState),ma("connectOnClick",k,ne.setState),ma("fitViewOnInit",M,ne.setState),ma("fitViewOnInitOptions",P,ne.setState),ma("onNodesDelete",O,ne.setState),ma("onEdgesDelete",A,ne.setState),ma("onNodeDrag",R,ne.setState),ma("onNodeDragStart",T,ne.setState),ma("onNodeDragStop",D,ne.setState),ma("onSelectionDrag",$,ne.setState),ma("onSelectionDragStart",I,ne.setState),ma("onSelectionDragStop",z,ne.setState),ma("noPanClassName",L,ne.setState),ma("nodeOrigin",F,ne.setState),ma("rfId",H,ne.setState),ma("autoPanOnConnect",W,ne.setState),ma("autoPanOnNodeDrag",V,ne.setState),ma("onError",j,ne.setState),ma("connectionRadius",Y,ne.setState),ma("isValidConnection",X,ne.setState),ma("nodeDragThreshold",K,ne.setState),ha(e,U),ha(t,q),ha(g,G),ha(y,Q),ha(C,J),ha(v,ee),null},ya={display:"none"},va={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},ba="react-flow__node-desc",wa="react-flow__edge-desc",xa=e=>e.ariaLiveMessage;function Sa({rfId:e}){const n=$r(xa);return t.createElement("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:va},n)}function Ea({rfId:e,disableKeyboardA11y:n}){return t.createElement(t.Fragment,null,t.createElement("div",{id:`${ba}-${e}`,style:ya},"Press enter or space to select a node.",!n&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),t.createElement("div",{id:`${wa}-${e}`,style:ya},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&t.createElement(Sa,{rfId:e}))}var _a=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=u(!1),a=l(!1),s=l(new Set([])),[c,d]=o(()=>{if(null!==e){const t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.split("+")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return i(()=>{const n="undefined"!=typeof document?document:null,o=t?.target||n;if(null!==e){const e=e=>{a.current=e.ctrlKey||e.metaKey||e.shiftKey;if((!a.current||a.current&&!t.actInsideInputWithModifier)&&eo(e))return!1;const n=ka(e.code,d);s.current.add(e[n]),Ca(c,s.current,!1)&&(e.preventDefault(),r(!0))},n=e=>{if((!a.current||a.current&&!t.actInsideInputWithModifier)&&eo(e))return!1;const n=ka(e.code,d);Ca(c,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(e[n]),"Meta"===e.key&&s.current.clear(),a.current=!1},i=()=>{s.current.clear(),r(!1)};return o?.addEventListener("keydown",e),o?.addEventListener("keyup",n),window.addEventListener("blur",i),()=>{o?.removeEventListener("keydown",e),o?.removeEventListener("keyup",n),window.removeEventListener("blur",i)}}},[e,r]),n};function Ca(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function ka(e,t){return t.includes(e)?"code":"key"}function Na(e,t,n,r){const o=e.parentNode||e.parentId;if(!o)return n;const a=t.get(o),i=Io(a,r);return Na(a,t,{x:(n.x??0)+i.x,y:(n.y??0)+i.y,z:(a[Gr]?.z??0)>(n.z??0)?a[Gr]?.z??0:n.z??0},r)}function Ma(e,t,n){e.forEach(r=>{const o=r.parentNode||r.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||n?.[r.id]){const{x:o,y:a,z:i}=Na(r,e,{...r.position,z:r[Gr]?.z??0},t);r.positionAbsolute={x:o,y:a},r[Gr].z=i,n?.[r.id]&&(r[Gr].isParent=!0)}})}function Pa(e,t,n,r){const o=new Map,a={},i=r?1e3:0;return e.forEach(e=>{const n=(Zr(e.zIndex)?e.zIndex:0)+(e.selected?i:0),r=t.get(e.id),s={...e,positionAbsolute:{x:e.position.x,y:e.position.y}},l=e.parentNode||e.parentId;l&&(a[l]=!0);const c=r?.type&&r?.type!==e.type;Object.defineProperty(s,Gr,{enumerable:!1,value:{handleBounds:c?void 0:r?.[Gr]?.handleBounds,z:n}}),o.set(e.id,s)}),Ma(o,n,a),o}function Oa(e,t={}){const{getNodes:n,width:r,height:o,minZoom:a,maxZoom:i,d3Zoom:s,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:d}=e(),f=t.initial&&!c&&u;if(s&&l&&(f||!t.initial)){const e=n().filter(e=>{const n=t.includeHiddenNodes?e.width&&e.height:!e.hidden;return t.nodes?.length?n&&t.nodes.some(t=>t.id===e.id):n}),c=e.every(e=>e.width&&e.height);if(e.length>0&&c){const n=zo(e,d),{x:c,y:u,zoom:f}=Fo(n,r,o,t.minZoom??a,t.maxZoom??i,t.padding??.1),p=pr.translate(c,u).scale(f);return"number"==typeof t.duration&&t.duration>0?s.transform(Ho(l,t.duration),p):s.transform(l,p),!0}}return!1}function Aa(e,t){return e.forEach(e=>{const n=t.get(e.id);n&&t.set(n.id,{...n,[Gr]:n[Gr],selected:e.selected})}),new Map(t)}function Ra(e,t){return t.map(t=>{const n=e.find(e=>e.id===t.id);return n&&(t.selected=n.selected),t})}function Ta({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:a,onNodesChange:i,onEdgesChange:s,hasDefaultNodes:l,hasDefaultEdges:c}=n();e?.length&&(l&&r({nodeInternals:Aa(e,o)}),i?.(e)),t?.length&&(c&&r({edges:Ra(t,a)}),s?.(t))}const Da=()=>{},$a={zoomIn:Da,zoomOut:Da,zoomTo:Da,getZoom:()=>1,setViewport:Da,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Da,fitBounds:Da,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},Ia=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection});function za(){const e=(()=>{const e=Ir(),{d3Zoom:t,d3Selection:n}=$r(Ia,B),r=o(()=>n&&t?{zoomIn:e=>t.scaleBy(Ho(n,e?.duration),1.2),zoomOut:e=>t.scaleBy(Ho(n,e?.duration),1/1.2),zoomTo:(e,r)=>t.scaleTo(Ho(n,r?.duration),e),getZoom:()=>e.getState().transform[2],setViewport:(r,o)=>{const[a,i,s]=e.getState().transform,l=pr.translate(r.x??a,r.y??i).scale(r.zoom??s);t.transform(Ho(n,o?.duration),l)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>Oa(e.getState,t),setCenter:(r,o,a)=>{const{width:i,height:s,maxZoom:l}=e.getState(),c=void 0!==a?.zoom?a.zoom:l,u=i/2-r*c,d=s/2-o*c,f=pr.translate(u,d).scale(c);t.transform(Ho(n,a?.duration),f)},fitBounds:(r,o)=>{const{width:a,height:i,minZoom:s,maxZoom:l}=e.getState(),{x:c,y:u,zoom:d}=Fo(r,a,i,s,l,o?.padding??.1),f=pr.translate(c,u).scale(d);t.transform(Ho(n,o?.duration),f)},project:t=>{const{transform:n,snapToGrid:r,snapGrid:o}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Do(t,n,r,o)},screenToFlowPosition:t=>{const{transform:n,snapToGrid:r,snapGrid:o,domNode:a}=e.getState();if(!a)return t;const{x:i,y:s}=a.getBoundingClientRect(),l={x:t.x-i,y:t.y-s};return Do(l,n,r,o)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:a}=r.getBoundingClientRect(),i=$o(t,n);return{x:i.x+o,y:i.y+a}},viewportInitialized:!0}:$a,[t,n]);return r})(),t=Ir(),n=s(()=>t.getState().getNodes().map(e=>({...e})),[]),r=s(e=>t.getState().nodeInternals.get(e),[]),a=s(()=>{const{edges:e=[]}=t.getState();return e.map(e=>({...e}))},[]),i=s(e=>{const{edges:n=[]}=t.getState();return n.find(t=>t.id===e)},[]),l=s(e=>{const{getNodes:n,setNodes:r,hasDefaultNodes:o,onNodesChange:a}=t.getState(),i=n(),s="function"==typeof e?e(i):e;if(o)r(s);else if(a){const e=0===s.length?i.map(e=>({type:"remove",id:e.id})):s.map(e=>({item:e,type:"reset"}));a(e)}},[]),c=s(e=>{const{edges:n=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:a}=t.getState(),i="function"==typeof e?e(n):e;if(o)r(i);else if(a){a(0===i.length?n.map(e=>({type:"remove",id:e.id})):i.map(e=>({item:e,type:"reset"})))}},[]),u=s(e=>{const n=Array.isArray(e)?e:[e],{getNodes:r,setNodes:o,hasDefaultNodes:a,onNodesChange:i}=t.getState();if(a){o([...r(),...n])}else if(i){const e=n.map(e=>({item:e,type:"add"}));i(e)}},[]),d=s(e=>{const n=Array.isArray(e)?e:[e],{edges:r=[],setEdges:o,hasDefaultEdges:a,onEdgesChange:i}=t.getState();if(a)o([...r,...n]);else if(i){i(n.map(e=>({item:e,type:"add"})))}},[]),f=s(()=>{const{getNodes:e,edges:n=[],transform:r}=t.getState(),[o,a,i]=r;return{nodes:e().map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:o,y:a,zoom:i}}},[]),p=s(({nodes:e,edges:n})=>{const{nodeInternals:r,getNodes:o,edges:a,hasDefaultNodes:i,hasDefaultEdges:s,onNodesDelete:l,onEdgesDelete:c,onNodesChange:u,onEdgesChange:d}=t.getState(),f=(e||[]).map(e=>e.id),p=(n||[]).map(e=>e.id),h=o().reduce((e,t)=>{const n=t.parentNode||t.parentId,r=!f.includes(t.id)&&n&&e.find(e=>e.id===n);return("boolean"!=typeof t.deletable||t.deletable)&&(f.includes(t.id)||r)&&e.push(t),e},[]),m=a.filter(e=>"boolean"!=typeof e.deletable||e.deletable),g=m.filter(e=>p.includes(e.id));if(h||g){const e=Bo(h,m),n=[...g,...e],o=n.reduce((e,t)=>(e.includes(t.id)||e.push(t.id),e),[]);if((s||i)&&(s&&t.setState({edges:a.filter(e=>!o.includes(e.id))}),i&&(h.forEach(e=>{r.delete(e.id)}),t.setState({nodeInternals:new Map(r)}))),o.length>0&&(c?.(n),d&&d(o.map(e=>({id:e,type:"remove"})))),h.length>0&&(l?.(h),u)){u(h.map(e=>({id:e.id,type:"remove"})))}}},[]),h=s(e=>{const n=Zr((r=e).width)&&Zr(r.height)&&Zr(r.x)&&Zr(r.y);var r;const o=n?null:t.getState().nodeInternals.get(e.id);if(!n&&!o)return[null,null,n];return[n?e:Ur(o),o,n]},[]),m=s((e,n=!0,r)=>{const[o,a,i]=h(e);return o?(r||t.getState().getNodes()).filter(e=>{if(!(i||e.id!==a.id&&e.positionAbsolute))return!1;const t=Ur(e),r=qr(t,o);return n&&r>0||r>=o.width*o.height}):[]},[]),g=s((e,t,n=!0)=>{const[r]=h(e);if(!r)return!1;const o=qr(r,t);return n&&o>0||o>=r.width*r.height},[]);return o(()=>({...e,getNodes:n,getNode:r,getEdges:a,getEdge:i,setNodes:l,setEdges:c,addNodes:u,addEdges:d,toObject:f,deleteElements:p,getIntersectingNodes:m,isNodeIntersecting:g}),[e,n,r,a,i,l,c,u,d,f,p,m,g])}const La={actInsideInputWithModifier:!1};const Ba={position:"absolute",width:"100%",height:"100%",top:0,left:0},Fa=e=>({x:e.x,y:e.y,zoom:e.k}),Ha=(e,t)=>e.target.closest(`.${t}`),Wa=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Va=e=>{const t=e.ctrlKey&&ro()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t},ja=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),Ya=({onMove:e,onMoveStart:n,onMoveEnd:r,onPaneContextMenu:o,zoomOnScroll:a=!0,zoomOnPinch:s=!0,panOnScroll:c=!1,panOnScrollSpeed:u=.5,panOnScrollMode:d=co.Free,zoomOnDoubleClick:f=!0,elementsSelectable:p,panOnDrag:h=!0,defaultViewport:m,translateExtent:g,minZoom:y,maxZoom:v,zoomActivationKeyCode:b,preventScrolling:w=!0,children:x,noWheelClassName:S,noPanClassName:E})=>{const _=l(),C=Ir(),k=l(!1),N=l(!1),M=l(null),P=l({x:0,y:0,zoom:0}),{d3Zoom:O,d3Selection:A,d3ZoomHandler:R,userSelectionActive:T}=$r(ja,B),D=_a(b),$=l(0),I=l(!1),z=l();return function(e){const t=Ir();i(()=>{let n;const r=()=>{if(!e.current)return;const n=Hr(e.current);0!==n.height&&0!==n.width||t.getState().onError?.("004",kr()),t.setState({width:n.width||500,height:n.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}(M),i(()=>{if(M.current){const e=M.current.getBoundingClientRect(),t=function(){var e,t,n,r=gr,o=yr,a=xr,i=br,s=wr,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=gn,f=H("start","zoom","end"),p=0,h=10;function m(e){e.property("__zoom",vr).on("wheel.zoom",S,{passive:!1}).on("mousedown.zoom",E).on("dblclick.zoom",_).filter(s).on("touchstart.zoom",C).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new fr(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new fr(e.k,r,o)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,r){e.on("start.zoom",function(){w(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(r).end()}).tween("zoom",function(){var e=this,a=arguments,i=w(e,a).event(r),s=o.apply(e,a),l=null==n?v(s):"function"==typeof n?n.apply(e,a):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,a):t,p=d(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=p(e),n=c/t[2];e=new fr(n,l[0]-t[0]*n,l[1]-t[1]*n)}i.zoom(null,e)}})}function w(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function S(e,...t){if(r.apply(this,arguments)){var n=w(this,t).event(e),o=this.__zoom,s=Math.max(l[0],Math.min(l[1],o.k*Math.pow(2,i.apply(this,arguments)))),u=ot(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=o.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(o.k===s)return;n.mouse=[u,o.invert(u)],Bn(this),n.start()}mr(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",a(y(g(o,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function E(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,i=w(this,t,!0).event(e),s=rt(e.view).on("mousemove.zoom",function(e){if(mr(e),!i.moved){var t=e.clientX-u,n=e.clientY-d;i.moved=t*t+n*n>p}i.event(e).zoom("mouse",a(y(i.that.__zoom,i.mouse[0]=ot(e,o),i.mouse[1]),i.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),ut(e.view,i.moved),mr(e),i.event(e).end()},!0),l=ot(e,o),u=e.clientX,d=e.clientY;ct(e.view),hr(e),i.mouse=[l,this.__zoom.invert(l)],Bn(this),i.start()}}function _(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,i=ot(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(i),l=n.k*(e.shiftKey?.5:2),d=a(y(g(n,l),i,s),o.apply(this,t),c);mr(e),u>0?rt(this).transition().duration(u).call(b,d,i,e):rt(this).call(m.transform,d,i,e)}}function C(n,...o){if(r.apply(this,arguments)){var a,i,s,l,c=n.touches,u=c.length,d=w(this,o,n.changedTouches.length===u).event(n);for(hr(n),i=0;i<u;++i)l=[l=ot(s=c[i],this),this.__zoom.invert(l),s.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,a=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),a&&(d.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),Bn(this),d.start())}}function k(e,...t){if(this.__zooming){var n,r,o,i,s=w(this,t).event(e),l=e.changedTouches,u=l.length;for(mr(e),n=0;n<u;++n)o=ot(r=l[n],this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=o:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=o);if(r=s.that.__zoom,s.touch1){var d=s.touch0[0],f=s.touch0[1],p=s.touch1[0],h=s.touch1[1],m=(m=p[0]-d[0])*m+(m=p[1]-d[1])*m,v=(v=h[0]-f[0])*v+(v=h[1]-f[1])*v;r=g(r,Math.sqrt(m/v)),o=[(d[0]+p[0])/2,(d[1]+p[1])/2],i=[(f[0]+h[0])/2,(f[1]+h[1])/2]}else{if(!s.touch0)return;o=s.touch0[0],i=s.touch0[1]}s.zoom("touch",a(y(r,o,i),s.extent,c))}}function N(e,...r){if(this.__zooming){var o,a,i=w(this,r).event(e),s=e.changedTouches,l=s.length;for(hr(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),o=0;o<l;++o)a=s[o],i.touch0&&i.touch0[2]===a.identifier?delete i.touch0:i.touch1&&i.touch1[2]===a.identifier&&delete i.touch1;if(i.touch1&&!i.touch0&&(i.touch0=i.touch1,delete i.touch1),i.touch0)i.touch0[1]=this.__zoom.invert(i.touch0[0]);else if(i.end(),2===i.taps&&(a=ot(a,this),Math.hypot(t[0]-a[0],t[1]-a[1])<h)){var c=rt(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",vr),e!==o?b(e,t,n,r):o.interrupt().each(function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},m.scaleBy=function(e,t,n,r){m.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,r)},m.scaleTo=function(e,t,n,r){m.transform(e,function(){var e=o.apply(this,arguments),r=this.__zoom,i=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(i),l="function"==typeof t?t.apply(this,arguments):t;return a(y(g(r,l),i,s),e,c)},n,r)},m.translateBy=function(e,t,n,r){m.transform(e,function(){return a(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)},null,r)},m.translateTo=function(e,t,n,r,i){m.transform(e,function(){var e=o.apply(this,arguments),i=this.__zoom,s=null==r?v(e):"function"==typeof r?r.apply(this,arguments):r;return a(pr.translate(s[0],s[1]).scale(i.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},r,i)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=rt(this.that).datum();f.call(e,this.that,new dr(e,{sourceEvent:this.sourceEvent,target:m,type:e,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(i="function"==typeof e?e:ur(+e),m):i},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:ur(!!e),m):r},m.touchable=function(e){return arguments.length?(s="function"==typeof e?e:ur(!!e),m):s},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:ur([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},m.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],m):[l[0],l[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(a=e,m):a},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(p=(e=+e)*e,m):Math.sqrt(p)},m.tapDistance=function(e){return arguments.length?(h=+e,m):h},m}().scaleExtent([y,v]).translateExtent(g),n=rt(M.current).call(t),r=pr.translate(m.x,m.y).scale(Wr(m.zoom,y,v)),o=[[0,0],[e.width,e.height]],a=t.constrain()(r,o,g);t.transform(n,a),t.wheelDelta(Va),C.setState({d3Zoom:t,d3Selection:n,d3ZoomHandler:n.on("wheel.zoom"),transform:[a.x,a.y,a.k],domNode:M.current.closest(".react-flow")})}},[]),i(()=>{A&&O&&(!c||D||T?void 0!==R&&A.on("wheel.zoom",function(e,t){if(!w&&"wheel"===e.type&&!e.ctrlKey||Ha(e,S))return null;e.preventDefault(),R.call(this,e,t)},{passive:!1}):A.on("wheel.zoom",t=>{if(Ha(t,S))return!1;t.preventDefault(),t.stopImmediatePropagation();const o=A.property("__zoom").k||1;if(t.ctrlKey&&s){const e=ot(t),n=Va(t),r=o*Math.pow(2,n);return void O.scaleTo(A,r,e,t)}const a=1===t.deltaMode?20:1;let i=d===co.Vertical?0:t.deltaX*a,l=d===co.Horizontal?0:t.deltaY*a;!ro()&&t.shiftKey&&d!==co.Vertical&&(i=t.deltaY*a,l=0),O.translateBy(A,-i/o*u,-l/o*u,{internal:!0});const c=Fa(A.property("__zoom")),{onViewportChangeStart:f,onViewportChange:p,onViewportChangeEnd:h}=C.getState();clearTimeout(z.current),I.current||(I.current=!0,n?.(t,c),f?.(c)),I.current&&(e?.(t,c),p?.(c),z.current=setTimeout(()=>{r?.(t,c),h?.(c),I.current=!1},150))},{passive:!1}))},[T,c,d,A,O,R,D,s,w,S,n,e,r]),i(()=>{O&&O.on("start",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;$.current=e.sourceEvent?.button;const{onViewportChangeStart:t}=C.getState(),r=Fa(e.transform);k.current=!0,P.current=r,"mousedown"===e.sourceEvent?.type&&C.setState({paneDragging:!0}),t?.(r),n?.(e.sourceEvent,r)})},[O,n]),i(()=>{O&&(T&&!k.current?O.on("zoom",null):T||O.on("zoom",t=>{const{onViewportChange:n}=C.getState();if(C.setState({transform:[t.transform.x,t.transform.y,t.transform.k]}),N.current=!(!o||!Wa(h,$.current??0)),(e||n)&&!t.sourceEvent?.internal){const r=Fa(t.transform);n?.(r),e?.(t.sourceEvent,r)}}))},[T,O,e,h,o]),i(()=>{O&&O.on("end",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=C.getState();if(k.current=!1,C.setState({paneDragging:!1}),o&&Wa(h,$.current??0)&&!N.current&&o(e.sourceEvent),N.current=!1,(r||t)&&(n=P.current,a=e.transform,n.x!==a.x||n.y!==a.y||n.zoom!==a.k)){const n=Fa(e.transform);P.current=n,clearTimeout(_.current),_.current=setTimeout(()=>{t?.(n),r?.(e.sourceEvent,n)},c?150:0)}var n,a})},[O,c,h,r,o]),i(()=>{O&&O.filter(e=>{const t=D||a,n=s&&e.ctrlKey;if((!0===h||Array.isArray(h)&&h.includes(1))&&1===e.button&&"mousedown"===e.type&&(Ha(e,"react-flow__node")||Ha(e,"react-flow__edge")))return!0;if(!(h||t||c||f||s))return!1;if(T)return!1;if(!f&&"dblclick"===e.type)return!1;if(Ha(e,S)&&"wheel"===e.type)return!1;if(Ha(e,E)&&("wheel"!==e.type||c&&"wheel"===e.type&&!D))return!1;if(!s&&e.ctrlKey&&"wheel"===e.type)return!1;if(!t&&!c&&!n&&"wheel"===e.type)return!1;if(!h&&("mousedown"===e.type||"touchstart"===e.type))return!1;if(Array.isArray(h)&&!h.includes(e.button)&&"mousedown"===e.type)return!1;const r=Array.isArray(h)&&h.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&r})},[T,O,a,s,c,f,h,p,D]),t.createElement("div",{className:"react-flow__renderer",ref:M,style:Ba},x)},Xa=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Ka(){const{userSelectionActive:e,userSelectionRect:n}=$r(Xa,B);return e&&n?t.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}function Ua(e,t){const n=t.parentNode||t.parentId,r=e.find(e=>e.id===n);if(r){const e=t.position.x+t.width-r.width,n=t.position.y+t.height-r.height;if(e>0||n>0||t.position.x<0||t.position.y<0){if(r.style={...r.style}||{},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,e>0&&(r.style.width+=e),n>0&&(r.style.height+=n),t.position.x<0){const e=Math.abs(t.position.x);r.position.x=r.position.x-e,r.style.width+=e,t.position.x=0}if(t.position.y<0){const e=Math.abs(t.position.y);r.position.y=r.position.y-e,r.style.height+=e,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function qa(e,t){if(e.some(e=>"reset"===e.type))return e.filter(e=>"reset"===e.type).map(e=>e.item);const n=e.filter(e=>"add"===e.type).map(e=>e.item);return t.reduce((t,n)=>{const r=e.filter(e=>e.id===n.id);if(0===r.length)return t.push(n),t;const o={...n};for(const e of r)if(e)switch(e.type){case"select":o.selected=e.selected;break;case"position":void 0!==e.position&&(o.position=e.position),void 0!==e.positionAbsolute&&(o.positionAbsolute=e.positionAbsolute),void 0!==e.dragging&&(o.dragging=e.dragging),o.expandParent&&Ua(t,o);break;case"dimensions":void 0!==e.dimensions&&(o.width=e.dimensions.width,o.height=e.dimensions.height),void 0!==e.updateStyle&&(o.style={...o.style||{},...e.dimensions}),"boolean"==typeof e.resizing&&(o.resizing=e.resizing),o.expandParent&&Ua(t,o);break;case"remove":return t}return t.push(o),t},n)}function Za(e,t){return qa(e,t)}const Ga=(e,t)=>({id:e,type:"select",selected:t});function Qa(e,t){return e.reduce((e,n)=>{const r=t.includes(n.id);return!n.selected&&r?(n.selected=!0,e.push(Ga(n.id,!0))):n.selected&&!r&&(n.selected=!1,e.push(Ga(n.id,!1))),e},[])}const Ja=(e,t)=>n=>{n.target===t.current&&e?.(n)},ei=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),ti=r(({isSelecting:e,selectionMode:n=uo.Full,panOnDrag:r,onSelectionStart:o,onSelectionEnd:a,onPaneClick:i,onPaneContextMenu:s,onPaneScroll:c,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p})=>{const h=l(null),m=Ir(),g=l(0),y=l(0),b=l(),{userSelectionActive:w,elementsSelectable:x,dragging:S}=$r(ei,B),E=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,y.current=0},_=e=>{i?.(e),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},C=c?e=>c(e):void 0,k=x&&(e||w);return t.createElement("div",{className:v(["react-flow__pane",{dragging:S,selection:e}]),onClick:k?void 0:Ja(_,h),onContextMenu:Ja(e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():s?.(e)},h),onWheel:Ja(C,h),onMouseEnter:k?void 0:u,onMouseDown:k?t=>{const{resetSelectedElements:n,domNode:r}=m.getState();if(b.current=r?.getBoundingClientRect(),!x||!e||0!==t.button||t.target!==h.current||!b.current)return;const{x:a,y:i}=no(t,b.current);n(),m.setState({userSelectionRect:{width:0,height:0,startX:a,startY:i,x:a,y:i}}),o?.(t)}:void 0,onMouseMove:k?t=>{const{userSelectionRect:r,nodeInternals:o,edges:a,transform:i,onNodesChange:s,onEdgesChange:l,nodeOrigin:c,getNodes:u}=m.getState();if(!e||!b.current||!r)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const d=no(t,b.current),f=r.startX??0,p=r.startY??0,h={...r,x:d.x<f?d.x:f,y:d.y<p?d.y:p,width:Math.abs(d.x-f),height:Math.abs(d.y-p)},v=u(),w=Lo(o,h,i,n===uo.Partial,!0,c),x=Bo(w,a).map(e=>e.id),S=w.map(e=>e.id);if(g.current!==S.length){g.current=S.length;const e=Qa(v,S);e.length&&s?.(e)}if(y.current!==x.length){y.current=x.length;const e=Qa(a,x);e.length&&l?.(e)}m.setState({userSelectionRect:h})}:d,onMouseUp:k?e=>{if(0!==e.button)return;const{userSelectionRect:t}=m.getState();!w&&t&&e.target===h.current&&_?.(e),m.setState({nodesSelectionActive:g.current>0}),E(),a?.(e)}:void 0,onMouseLeave:k?e=>{w&&(m.setState({nodesSelectionActive:g.current>0}),a?.(e)),E()}:f,ref:h,style:Ba},p,t.createElement(Ka,null))});function ni(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return!!r&&(!!r.selected||ni(r,t))}function ri(e,t,n){let r=e;do{if(r?.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function oi(e,t,n,r){return Array.from(e.values()).filter(n=>(n.selected||n.id===r)&&(!n.parentNode||n.parentId||!ni(n,e))&&(n.draggable||t&&void 0===n.draggable)).map(e=>({id:e.id,position:e.position||{x:0,y:0},positionAbsolute:e.positionAbsolute||{x:0,y:0},distance:{x:n.x-(e.positionAbsolute?.x??0),y:n.y-(e.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:e.extent,parentNode:e.parentNode||e.parentId,parentId:e.parentNode||e.parentId,width:e.width,height:e.height,expandParent:e.expandParent}))}function ai(e,t,n,r,o=[0,0],a){const i=function(e,t){return t&&"parent"!==t?[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]:t}(e,e.extent||r);let s=i;const l=e.parentNode||e.parentId;if("parent"!==e.extent||e.expandParent){if(e.extent&&l&&"parent"!==e.extent){const t=n.get(l),{x:r,y:a}=Io(t,o).positionAbsolute;s=[[e.extent[0][0]+r,e.extent[0][1]+a],[e.extent[1][0]+r,e.extent[1][1]+a]]}}else if(l&&e.width&&e.height){const t=n.get(l),{x:r,y:a}=Io(t,o).positionAbsolute;s=t&&Zr(r)&&Zr(a)&&Zr(t.width)&&Zr(t.height)?[[r+e.width*o[0],a+e.height*o[1]],[r+t.width-e.width+e.width*o[0],a+t.height-e.height+e.height*o[1]]]:s}else a?.("005",Nr()),s=i;let c={x:0,y:0};if(l){const e=n.get(l);c=Io(e,o).positionAbsolute}const u=s&&"parent"!==s?Vr(t,s):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function ii({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(e=>({...n.get(e.id),position:e.position,positionAbsolute:e.positionAbsolute}));return[e?r.find(t=>t.id===e):r[0],r]}ti.displayName="Pane";const si=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const a=Array.from(o),i=t.getBoundingClientRect(),s=i.width*r[0],l=i.height*r[1];return a.map(e=>{const t=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(t.left-i.left-s)/n,y:(t.top-i.top-l)/n,...Hr(e)}})};function li(e,t,n){return void 0===n?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function ci({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:a,multiSelectionActive:i,nodeInternals:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&i)&&(a({nodes:[c],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):o([e])):l?.("012",Tr(e))}function ui(e){return(t,n,r)=>e?.(t,r)}function di({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:a,selectNodesOnDrag:c}){const d=Ir(),[f,p]=u(!1),h=l([]),m=l({x:null,y:null}),g=l(0),y=l(null),v=l({x:0,y:0}),b=l(null),w=l(!1),x=l(!1),S=l(!1),E=function(){const e=Ir(),t=s(({sourceEvent:t})=>{const{transform:n,snapGrid:r,snapToGrid:o}=e.getState(),a=t.touches?t.touches[0].clientX:t.clientX,i=t.touches?t.touches[0].clientY:t.clientY,s={x:(a-n[0])/n[2],y:(i-n[1])/n[2]};return{xSnapped:o?r[0]*Math.round(s.x/r[0]):s.x,ySnapped:o?r[1]*Math.round(s.y/r[1]):s.y,...s}},[]);return t}();return i(()=>{if(e?.current){const i=rt(e.current),s=({x:e,y:t})=>{const{nodeInternals:n,onNodeDrag:r,onSelectionDrag:a,updateNodePositions:i,nodeExtent:s,snapGrid:l,snapToGrid:c,nodeOrigin:u,onError:f}=d.getState();m.current={x:e,y:t};let g=!1,y={x:0,y:0,x2:0,y2:0};if(h.current.length>1&&s){const e=zo(h.current,u);y=Kr(e)}if(h.current=h.current.map(r=>{const o={x:e-r.distance.x,y:t-r.distance.y};c&&(o.x=l[0]*Math.round(o.x/l[0]),o.y=l[1]*Math.round(o.y/l[1]));const a=[[s[0][0],s[0][1]],[s[1][0],s[1][1]]];h.current.length>1&&s&&!r.extent&&(a[0][0]=r.positionAbsolute.x-y.x+s[0][0],a[1][0]=r.positionAbsolute.x+(r.width??0)-y.x2+s[1][0],a[0][1]=r.positionAbsolute.y-y.y+s[0][1],a[1][1]=r.positionAbsolute.y+(r.height??0)-y.y2+s[1][1]);const i=ai(r,o,n,a,u,f);return g=g||r.position.x!==i.position.x||r.position.y!==i.position.y,r.position=i.position,r.positionAbsolute=i.positionAbsolute,r}),!g)return;i(h.current,!0,!0),p(!0);const v=o?r:ui(a);if(v&&b.current){const[e,t]=ii({nodeId:o,dragItems:h.current,nodeInternals:n});v(b.current,e,t)}},l=()=>{if(!y.current)return;const[e,t]=Yr(v.current,y.current);if(0!==e||0!==t){const{transform:n,panBy:r}=d.getState();m.current.x=(m.current.x??0)-e/n[2],m.current.y=(m.current.y??0)-t/n[2],r({x:e,y:t})&&s(m.current)}g.current=requestAnimationFrame(l)},u=t=>{const{nodeInternals:n,multiSelectionActive:r,nodesDraggable:i,unselectNodesAndEdges:s,onNodeDragStart:l,onSelectionDragStart:u}=d.getState();x.current=!0;const f=o?l:ui(u);c&&a||r||!o||n.get(o)?.selected||s(),o&&a&&c&&ci({id:o,store:d,nodeRef:e});const p=E(t);if(m.current=p,h.current=oi(n,i,p,o),f&&h.current){const[e,r]=ii({nodeId:o,dragItems:h.current,nodeInternals:n});f(t.sourceEvent,e,r)}};if(!t){const t=function(){var e,t,n,r,o=pt,a=ht,i=mt,s=gt,l={},c=H("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",p).filter(s).on("touchstart.drag",g).on("touchmove.drag",y,at).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(i,s){if(!r&&o.call(this,i,s)){var l=b(this,a.call(this,i,s),i,s,"mouse");l&&(rt(i.view).on("mousemove.drag",h,it).on("mouseup.drag",m,it),ct(i.view),st(i),n=!1,e=i.clientX,t=i.clientY,l("start",i))}}function h(r){if(lt(r),!n){var o=r.clientX-e,a=r.clientY-t;n=o*o+a*a>d}l.mouse("drag",r)}function m(e){rt(e.view).on("mousemove.drag mouseup.drag",null),ut(e.view,n),lt(e),l.mouse("end",e)}function g(e,t){if(o.call(this,e,t)){var n,r,i=e.changedTouches,s=a.call(this,e,t),l=i.length;for(n=0;n<l;++n)(r=b(this,s,e,t,i[n].identifier,i[n]))&&(st(e),r("start",e,i[n]))}}function y(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=l[r[t].identifier])&&(lt(e),n("drag",e,r[t]))}function v(e){var t,n,o=e.changedTouches,a=o.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<a;++t)(n=l[o[t].identifier])&&(st(e),n("end",e,o[t]))}function b(e,t,n,r,o,a){var s,d,p,h=c.copy(),m=ot(a||n,t);if(null!=(p=i.call(e,new ft("beforestart",{sourceEvent:n,target:f,identifier:o,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),r)))return s=p.x-m[0]||0,d=p.y-m[1]||0,function n(a,i,c){var g,y=m;switch(a){case"start":l[o]=n,g=u++;break;case"end":delete l[o],--u;case"drag":m=ot(c||i,t),g=u}h.call(a,e,new ft(a,{sourceEvent:i,subject:p,target:f,identifier:o,active:g,x:m[0]+s,y:m[1]+d,dx:m[0]-y[0],dy:m[1]-y[1],dispatch:h}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:dt(!!e),f):o},f.container=function(e){return arguments.length?(a="function"==typeof e?e:dt(e),f):a},f.subject=function(e){return arguments.length?(i="function"==typeof e?e:dt(e),f):i},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:dt(!!e),f):s},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}().on("start",e=>{const{domNode:t,nodeDragThreshold:n}=d.getState();0===n&&u(e),S.current=!1;const r=E(e);m.current=r,y.current=t?.getBoundingClientRect()||null,v.current=no(e.sourceEvent,y.current)}).on("drag",e=>{const t=E(e),{autoPanOnNodeDrag:n,nodeDragThreshold:r}=d.getState();if("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1&&(S.current=!0),!S.current){if(!w.current&&x.current&&n&&(w.current=!0,l()),!x.current){const n=t.xSnapped-(m?.current?.x??0),o=t.ySnapped-(m?.current?.y??0);Math.sqrt(n*n+o*o)>r&&u(e)}(m.current.x!==t.xSnapped||m.current.y!==t.ySnapped)&&h.current&&x.current&&(b.current=e.sourceEvent,v.current=no(e.sourceEvent,y.current),s(t))}}).on("end",e=>{if(x.current&&!S.current&&(p(!1),w.current=!1,x.current=!1,cancelAnimationFrame(g.current),h.current)){const{updateNodePositions:t,nodeInternals:n,onNodeDragStop:r,onSelectionDragStop:a}=d.getState(),i=o?r:ui(a);if(t(h.current,!1,!1),i){const[t,r]=ii({nodeId:o,dragItems:h.current,nodeInternals:n});i(e.sourceEvent,t,r)}}}).filter(t=>{const o=t.target;return!t.button&&(!n||!ri(o,`.${n}`,e))&&(!r||ri(o,r,e))});return i.call(t),()=>{i.on(".drag",null)}}i.on(".drag",null)}},[e,t,n,r,a,d,o,c,E]),f}function fi(){const e=Ir(),t=s(t=>{const{nodeInternals:n,nodeExtent:r,updateNodePositions:o,getNodes:a,snapToGrid:i,snapGrid:s,onError:l,nodesDraggable:c}=e.getState(),u=a().filter(e=>e.selected&&(e.draggable||c&&void 0===e.draggable)),d=i?s[0]:5,f=i?s[1]:5,p=t.isShiftPressed?4:1,h=t.x*d*p,m=t.y*f*p,g=u.map(e=>{if(e.positionAbsolute){const t={x:e.positionAbsolute.x+h,y:e.positionAbsolute.y+m};i&&(t.x=s[0]*Math.round(t.x/s[0]),t.y=s[1]*Math.round(t.y/s[1]));const{positionAbsolute:o,position:a}=ai(e,t,n,r,void 0,l);e.position=a,e.positionAbsolute=o}return e});o(g,!0,!1)},[]);return t}const pi={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var hi=e=>{const n=({id:n,type:r,data:o,xPos:a,yPos:s,xPosOrigin:c,yPosOrigin:u,selected:d,onClick:f,onMouseEnter:p,onMouseMove:h,onMouseLeave:m,onContextMenu:g,onDoubleClick:y,style:b,className:w,isDraggable:x,isSelectable:S,isConnectable:E,isFocusable:_,selectNodesOnDrag:C,sourcePosition:k,targetPosition:N,hidden:M,resizeObserver:P,dragHandle:O,zIndex:A,isParent:R,noDragClassName:T,noPanClassName:D,initialized:$,disableKeyboardA11y:I,ariaLabel:z,rfId:L,hasHandleBounds:B})=>{const F=Ir(),H=l(null),W=l(null),V=l(k),j=l(N),Y=l(r),X=S||x||f||p||h||m,K=fi(),U=li(n,F.getState,p),q=li(n,F.getState,h),Z=li(n,F.getState,m),G=li(n,F.getState,g),Q=li(n,F.getState,y);i(()=>()=>{W.current&&(P?.unobserve(W.current),W.current=null)},[]),i(()=>{if(H.current&&!M){const e=H.current;$&&B&&W.current===e||(W.current&&P?.unobserve(W.current),P?.observe(e),W.current=e)}},[M,$,B]),i(()=>{const e=Y.current!==r,t=V.current!==k,o=j.current!==N;H.current&&(e||t||o)&&(e&&(Y.current=r),t&&(V.current=k),o&&(j.current=N),F.getState().updateNodeDimensions([{id:n,nodeElement:H.current,forceUpdate:!0}]))},[n,r,k,N]);const J=di({nodeRef:H,disabled:M||!x,noDragClassName:T,handleSelector:O,nodeId:n,isSelectable:S,selectNodesOnDrag:C});return M?null:t.createElement("div",{className:v(["react-flow__node",`react-flow__node-${r}`,{[D]:x},w,{selected:d,selectable:S,parent:R,dragging:J}]),ref:H,style:{zIndex:A,transform:`translate(${c}px,${u}px)`,pointerEvents:X?"all":"none",visibility:$?"visible":"hidden",...b},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:U,onMouseMove:q,onMouseLeave:Z,onContextMenu:G,onClick:e=>{const{nodeDragThreshold:t}=F.getState();if(S&&(!C||!x||t>0)&&ci({id:n,store:F,nodeRef:H}),f){const t=F.getState().nodeInternals.get(n);t&&f(e,{...t})}},onDoubleClick:Q,onKeyDown:_?e=>{if(!eo(e)&&!I)if(Qr.includes(e.key)&&S){const t="Escape"===e.key;ci({id:n,store:F,unselect:t,nodeRef:H})}else x&&d&&Object.prototype.hasOwnProperty.call(pi,e.key)&&(F.setState({ariaLiveMessage:`Moved selected node ${e.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~a}, y: ${~~s}`}),K({x:pi[e.key].x,y:pi[e.key].y,isShiftPressed:e.shiftKey}))}:void 0,tabIndex:_?0:void 0,role:_?"button":void 0,"aria-describedby":I?void 0:`${ba}-${L}`,"aria-label":z},t.createElement(Oo,{value:n},t.createElement(e,{id:n,data:o,type:r,xPos:a,yPos:s,selected:d,isConnectable:E,sourcePosition:k,targetPosition:N,dragging:J,dragHandle:O,zIndex:A})))};return n.displayName="NodeWrapper",r(n)};const mi=e=>{const t=e.getNodes().filter(e=>e.selected);return{...zo(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};var gi=r(function({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:r}){const o=Ir(),{width:a,height:s,x:c,y:u,transformString:d,userSelectionActive:f}=$r(mi,B),p=fi(),h=l(null);if(i(()=>{r||h.current?.focus({preventScroll:!0})},[r]),di({nodeRef:h}),f||!a||!s)return null;const m=e?t=>{const n=o.getState().getNodes().filter(e=>e.selected);e(t,n)}:void 0;return t.createElement("div",{className:v(["react-flow__nodesselection","react-flow__container",n]),style:{transform:d}},t.createElement("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:r?void 0:-1,onKeyDown:r?void 0:e=>{Object.prototype.hasOwnProperty.call(pi,e.key)&&p({x:pi[e.key].x,y:pi[e.key].y,isShiftPressed:e.shiftKey})},style:{width:a,height:s,top:u,left:c}}))});const yi=e=>e.nodesSelectionActive,vi=({children:e,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:l,deleteKeyCode:c,onMove:u,onMoveStart:d,onMoveEnd:f,selectionKeyCode:p,selectionOnDrag:h,selectionMode:m,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:v,panActivationKeyCode:b,zoomActivationKeyCode:w,elementsSelectable:x,zoomOnScroll:S,zoomOnPinch:E,panOnScroll:_,panOnScrollSpeed:C,panOnScrollMode:k,zoomOnDoubleClick:N,panOnDrag:M,defaultViewport:P,translateExtent:O,minZoom:A,maxZoom:R,preventScrolling:T,onSelectionContextMenu:D,noWheelClassName:$,noPanClassName:I,disableKeyboardA11y:z})=>{const L=$r(yi),B=_a(p),F=_a(b),H=F||M,W=F||_,V=B||h&&!0!==H;return(({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Ir(),{deleteElements:r}=za(),o=_a(e,La),a=_a(t);i(()=>{if(o){const{edges:e,getNodes:t}=n.getState(),o=t().filter(e=>e.selected),a=e.filter(e=>e.selected);r({nodes:o,edges:a}),n.setState({nodesSelectionActive:!1})}},[o]),i(()=>{n.setState({multiSelectionActive:a})},[a])})({deleteKeyCode:c,multiSelectionKeyCode:v}),t.createElement(Ya,{onMove:u,onMoveStart:d,onMoveEnd:f,onPaneContextMenu:s,elementsSelectable:x,zoomOnScroll:S,zoomOnPinch:E,panOnScroll:W,panOnScrollSpeed:C,panOnScrollMode:k,zoomOnDoubleClick:N,panOnDrag:!B&&H,defaultViewport:P,translateExtent:O,minZoom:A,maxZoom:R,zoomActivationKeyCode:w,preventScrolling:T,noWheelClassName:$,noPanClassName:I},t.createElement(ti,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:a,onPaneContextMenu:s,onPaneScroll:l,panOnDrag:H,isSelecting:!!V,selectionMode:m},e,L&&t.createElement(gi,{onSelectionContextMenu:D,noPanClassName:I,disableKeyboardA11y:z})))};vi.displayName="FlowRenderer";var bi=r(vi);function wi(e){return{...{input:hi(e.input||ra),default:hi(e.default||ta),output:hi(e.output||aa),group:hi(e.group||ia)},...Object.keys(e).filter(e=>!["input","default","output","group"].includes(e)).reduce((t,n)=>(t[n]=hi(e[n]||ta),t),{})}}const xi=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),Si=e=>{const{nodesDraggable:n,nodesConnectable:r,nodesFocusable:a,elementsSelectable:c,updateNodeDimensions:u,onError:d}=$r(xi,B),f=(p=e.onlyRenderVisibleElements,$r(s(e=>p?Lo(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes(),[p])));var p;const h=l(),m=o(()=>{if("undefined"==typeof ResizeObserver)return null;const e=new ResizeObserver(e=>{const t=e.map(e=>({id:e.target.getAttribute("data-id"),nodeElement:e.target,forceUpdate:!0}));u(t)});return h.current=e,e},[]);return i(()=>()=>{h?.current?.disconnect()},[]),t.createElement("div",{className:"react-flow__nodes",style:Ba},f.map(o=>{let i=o.type||"default";e.nodeTypes[i]||(d?.("003",Cr(i)),i="default");const s=e.nodeTypes[i]||e.nodeTypes.default,l=!!(o.draggable||n&&void 0===o.draggable),u=!!(o.selectable||c&&void 0===o.selectable),f=!!(o.connectable||r&&void 0===o.connectable),p=!!(o.focusable||a&&void 0===o.focusable),h=e.nodeExtent?Vr(o.positionAbsolute,e.nodeExtent):o.positionAbsolute,g=h?.x??0,y=h?.y??0,v=(({x:e,y:t,width:n,height:r,origin:o})=>n&&r?o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]}:{x:e,y:t})({x:g,y:y,width:o.width??0,height:o.height??0,origin:e.nodeOrigin});return t.createElement(s,{key:o.id,id:o.id,className:o.className,style:o.style,type:i,data:o.data,sourcePosition:o.sourcePosition||ho.Bottom,targetPosition:o.targetPosition||ho.Top,hidden:o.hidden,xPos:g,yPos:y,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!o.selected,isDraggable:l,isSelectable:u,isConnectable:f,isFocusable:p,resizeObserver:m,dragHandle:o.dragHandle,zIndex:o[Gr]?.z??0,isParent:!!o[Gr]?.isParent,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!o.width&&!!o.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:o.ariaLabel,hasHandleBounds:!!o[Gr]?.handleBounds})}))};Si.displayName="NodeRenderer";var Ei=r(Si);const _i=(e,t,n)=>n===ho.Left?e-t:n===ho.Right?e+t:e,Ci=(e,t,n)=>n===ho.Top?e-t:n===ho.Bottom?e+t:e,ki="react-flow__edgeupdater",Ni=({position:e,centerX:n,centerY:r,radius:o=10,onMouseDown:a,onMouseEnter:i,onMouseOut:s,type:l})=>t.createElement("circle",{onMouseDown:a,onMouseEnter:i,onMouseOut:s,className:v([ki,`${ki}-${l}`]),cx:_i(n,o,e),cy:Ci(r,o,e),r:o,stroke:"transparent",fill:"transparent"}),Mi=()=>!0;var Pi=e=>{const n=({id:n,className:r,type:a,data:i,onClick:s,onEdgeDoubleClick:c,selected:d,animated:f,label:p,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:b,style:w,source:x,target:S,sourceX:E,sourceY:_,targetX:C,targetY:k,sourcePosition:N,targetPosition:M,elementsSelectable:P,hidden:O,sourceHandleId:A,targetHandleId:R,onContextMenu:T,onMouseEnter:D,onMouseMove:$,onMouseLeave:I,reconnectRadius:z,onReconnect:L,onReconnectStart:B,onReconnectEnd:F,markerEnd:H,markerStart:W,rfId:V,ariaLabel:j,isFocusable:Y,isReconnectable:X,pathOptions:K,interactionWidth:U,disableKeyboardA11y:q})=>{const Z=l(null),[G,Q]=u(!1),[J,ee]=u(!1),te=Ir(),ne=o(()=>`url('#${Ro(W,V)}')`,[W,V]),re=o(()=>`url('#${Ro(H,V)}')`,[H,V]);if(O)return null;const oe=ao(n,te.getState,c),ae=ao(n,te.getState,T),ie=ao(n,te.getState,D),se=ao(n,te.getState,$),le=ao(n,te.getState,I),ce=(e,t)=>{if(0!==e.button)return;const{edges:r,isValidConnection:o}=te.getState(),a=t?S:x,i=(t?R:A)||null,s=t?"target":"source",l=o||Mi,c=t,u=r.find(e=>e.id===n);ee(!0),B?.(e,u,s);qo({event:e,handleId:i,nodeId:a,onConnect:e=>L?.(u,e),isTarget:c,getState:te.getState,setState:te.setState,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:e=>{ee(!1),F?.(e,u,s)}})},ue=()=>Q(!0),de=()=>Q(!1),fe=!P&&!s;return t.createElement("g",{className:v(["react-flow__edge",`react-flow__edge-${a}`,r,{selected:d,animated:f,inactive:fe,updating:G}]),onClick:e=>{const{edges:t,addSelectedEdges:r,unselectNodesAndEdges:o,multiSelectionActive:a}=te.getState(),i=t.find(e=>e.id===n);i&&(P&&(te.setState({nodesSelectionActive:!1}),i.selected&&a?(o({nodes:[],edges:[i]}),Z.current?.blur()):r([n])),s&&s(e,i))},onDoubleClick:oe,onContextMenu:ae,onMouseEnter:ie,onMouseMove:se,onMouseLeave:le,onKeyDown:Y?e=>{if(!q&&Qr.includes(e.key)&&P){const{unselectNodesAndEdges:t,addSelectedEdges:r,edges:o}=te.getState();"Escape"===e.key?(Z.current?.blur(),t({edges:[o.find(e=>e.id===n)]})):r([n])}}:void 0,tabIndex:Y?0:void 0,role:Y?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":null===j?void 0:j||`Edge from ${x} to ${S}`,"aria-describedby":Y?`${wa}-${V}`:void 0,ref:Z},!J&&t.createElement(e,{id:n,source:x,target:S,selected:d,animated:f,label:p,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:b,data:i,style:w,sourceX:E,sourceY:_,targetX:C,targetY:k,sourcePosition:N,targetPosition:M,sourceHandleId:A,targetHandleId:R,markerStart:ne,markerEnd:re,pathOptions:K,interactionWidth:U}),X&&t.createElement(t.Fragment,null,("source"===X||!0===X)&&t.createElement(Ni,{position:N,centerX:E,centerY:_,radius:z,onMouseDown:e=>ce(e,!0),onMouseEnter:ue,onMouseOut:de,type:"source"}),("target"===X||!0===X)&&t.createElement(Ni,{position:M,centerX:C,centerY:k,radius:z,onMouseDown:e=>ce(e,!1),onMouseEnter:ue,onMouseOut:de,type:"target"})))};return n.displayName="EdgeWrapper",r(n)};function Oi(e){return{...{default:Pi(e.default||Mo),straight:Pi(e.bezier||_o),step:Pi(e.step||Eo),smoothstep:Pi(e.step||So),simplebezier:Pi(e.simplebezier||yo)},...Object.keys(e).filter(e=>!["default","bezier"].includes(e)).reduce((t,n)=>(t[n]=Pi(e[n]||Mo),t),{})}}function Ai(e,t,n=null){const r=(n?.x||0)+t.x,o=(n?.y||0)+t.y,a=n?.width||t.width,i=n?.height||t.height;switch(e){case ho.Top:return{x:r+a/2,y:o};case ho.Right:return{x:r+a,y:o+i/2};case ho.Bottom:return{x:r+a/2,y:o+i};case ho.Left:return{x:r,y:o+i/2}}}function Ri(e,t){return e?1!==e.length&&t?t&&e.find(e=>e.id===t)||null:e[0]:null}function Ti(e){const t=e?.[Gr]?.handleBounds||null,n=t&&e?.width&&e?.height&&void 0!==e?.positionAbsolute?.x&&void 0!==e?.positionAbsolute?.y;return[{x:e?.positionAbsolute?.x||0,y:e?.positionAbsolute?.y||0,width:e?.width||0,height:e?.height||0},t,!!n]}const Di=[{level:0,isMaxLevel:!0,edges:[]}];function $i(e,t,n){return function(e,t,n=!1){let r=-1;const o=e.reduce((e,o)=>{const a=Zr(o.zIndex);let i=a?o.zIndex:0;if(n){const e=t.get(o.target),n=t.get(o.source),r=o.selected||e?.selected||n?.selected,s=Math.max(n?.[Gr]?.z||0,e?.[Gr]?.z||0,1e3);i=(a?o.zIndex:0)+(r?s:0)}return e[i]?e[i].push(o):e[i]=[o],r=i>r?i:r,e},{}),a=Object.entries(o).map(([e,t])=>{const n=+e;return{edges:t,level:n,isMaxLevel:n===r}});return 0===a.length?Di:a}($r(s(n=>e?n.edges.filter(e=>{const r=t.get(e.source),o=t.get(e.target);return r?.width&&r?.height&&o?.width&&o?.height&&function({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:a,width:i,height:s,transform:l}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+a)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=Kr({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:i/l[2],height:s/l[2]}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),f=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*f)>0}({sourcePos:r.positionAbsolute||{x:0,y:0},targetPos:o.positionAbsolute||{x:0,y:0},sourceWidth:r.width,sourceHeight:r.height,targetWidth:o.width,targetHeight:o.height,width:n.width,height:n.height,transform:n.transform})}):n.edges,[e,t])),t,n)}const Ii={[po.Arrow]:({color:e="none",strokeWidth:n=1})=>t.createElement("polyline",{style:{stroke:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[po.ArrowClosed]:({color:e="none",strokeWidth:n=1})=>t.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})};const zi=({id:e,type:n,color:r,width:a=12.5,height:i=12.5,markerUnits:s="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const u=function(e){const t=Ir();return o(()=>Object.prototype.hasOwnProperty.call(Ii,e)?Ii[e]:(t.getState().onError?.("009",Pr(e)),null),[e])}(n);return u?t.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${i}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:c,refX:"0",refY:"0"},t.createElement(u,{color:r,strokeWidth:l})):null},Li=({defaultColor:e,rfId:n})=>{const r=$r(s((({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((n,o)=>([o.markerStart,o.markerEnd].forEach(o=>{if(o&&"object"==typeof o){const a=Ro(o,t);r.includes(a)||(n.push({id:a,color:o.color||e,...o}),r.push(a))}}),n),[]).sort((e,t)=>e.id.localeCompare(t.id))})({defaultColor:e,rfId:n}),[e,n]),(e,t)=>!(e.length!==t.length||e.some((e,n)=>e.id!==t[n].id)));return t.createElement("defs",null,r.map(e=>t.createElement(zi,{id:e.id,key:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient})))};Li.displayName="MarkerDefinitions";var Bi=r(Li);const Fi=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),Hi=({defaultMarkerColor:e,onlyRenderVisibleElements:n,elevateEdgesOnSelect:r,rfId:o,edgeTypes:a,noPanClassName:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,onEdgeDoubleClick:f,onReconnect:p,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,children:y,disableKeyboardA11y:b})=>{const{edgesFocusable:w,edgesUpdatable:x,elementsSelectable:S,width:E,height:_,connectionMode:C,nodeInternals:k,onError:N}=$r(Fi,B),M=$i(n,k,r);return E?t.createElement(t.Fragment,null,M.map(({level:n,edges:r,isMaxLevel:y})=>t.createElement("svg",{key:n,style:{zIndex:n},width:E,height:_,className:"react-flow__edges react-flow__container"},y&&t.createElement(Bi,{defaultColor:e,rfId:o}),t.createElement("g",null,r.map(e=>{const[n,r,y]=Ti(k.get(e.source)),[E,_,M]=Ti(k.get(e.target));if(!y||!M)return null;let P=e.type||"default";a[P]||(N?.("011",Rr(P)),P="default");const O=a[P]||a.default,A=C===lo.Strict?_.target:(_.target??[]).concat(_.source??[]),R=Ri(r.source,e.sourceHandle),T=Ri(A,e.targetHandle),D=R?.position||ho.Bottom,$=T?.position||ho.Top,I=!!(e.focusable||w&&void 0===e.focusable),z=e.reconnectable||e.updatable,L=void 0!==p&&(z||x&&void 0===z);if(!R||!T)return N?.("008",Or(R,e)),null;const{sourceX:B,sourceY:F,targetX:H,targetY:W}=((e,t,n,r,o,a)=>{const i=Ai(n,e,t),s=Ai(a,r,o);return{sourceX:i.x,sourceY:i.y,targetX:s.x,targetY:s.y}})(n,R,D,E,T,$);return t.createElement(O,{key:e.id,id:e.id,className:v([e.className,i]),type:P,data:e.data,selected:!!e.selected,animated:!!e.animated,hidden:!!e.hidden,label:e.label,labelStyle:e.labelStyle,labelShowBg:e.labelShowBg,labelBgStyle:e.labelBgStyle,labelBgPadding:e.labelBgPadding,labelBgBorderRadius:e.labelBgBorderRadius,style:e.style,source:e.source,target:e.target,sourceHandleId:e.sourceHandle,targetHandleId:e.targetHandle,markerEnd:e.markerEnd,markerStart:e.markerStart,sourceX:B,sourceY:F,targetX:H,targetY:W,sourcePosition:D,targetPosition:$,elementsSelectable:S,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onEdgeDoubleClick:f,onReconnect:p,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,rfId:o,ariaLabel:e.ariaLabel,isFocusable:I,isReconnectable:L,pathOptions:"pathOptions"in e?e.pathOptions:void 0,interactionWidth:e.interactionWidth,disableKeyboardA11y:b})})))),y):null};Hi.displayName="EdgeRenderer";var Wi=r(Hi);const Vi=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function ji({children:e}){const n=$r(Vi);return t.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},e)}const Yi={[ho.Left]:ho.Right,[ho.Right]:ho.Left,[ho.Top]:ho.Bottom,[ho.Bottom]:ho.Top},Xi=({nodeId:e,handleType:n,style:r,type:o=fo.Bezier,CustomComponent:a,connectionStatus:i})=>{const{fromNode:l,handleId:c,toX:u,toY:d,connectionMode:f}=$r(s(t=>({fromNode:t.nodeInternals.get(e),handleId:t.connectionHandleId,toX:(t.connectionPosition.x-t.transform[0])/t.transform[2],toY:(t.connectionPosition.y-t.transform[1])/t.transform[2],connectionMode:t.connectionMode}),[e]),B),p=l?.[Gr]?.handleBounds;let h=p?.[n];if(f===lo.Loose&&(h=h||p?.["source"===n?"target":"source"]),!l||!h)return null;const m=c?h.find(e=>e.id===c):h[0],g=m?m.x+m.width/2:(l.width??0)/2,y=m?m.y+m.height/2:l.height??0,v=(l.positionAbsolute?.x??0)+g,b=(l.positionAbsolute?.y??0)+y,w=m?.position,x=w?Yi[w]:null;if(!w||!x)return null;if(a)return t.createElement(a,{connectionLineType:o,connectionLineStyle:r,fromNode:l,fromHandle:m,fromX:v,fromY:b,toX:u,toY:d,fromPosition:w,toPosition:x,connectionStatus:i});let S="";const E={sourceX:v,sourceY:b,sourcePosition:w,targetX:u,targetY:d,targetPosition:x};return o===fo.Bezier?[S]=No(E):o===fo.Step?[S]=xo({...E,borderRadius:0}):o===fo.SmoothStep?[S]=xo(E):o===fo.SimpleBezier?[S]=go(E):S=`M${v},${b} ${u},${d}`,t.createElement("path",{d:S,fill:"none",className:"react-flow__connection-path",style:r})};Xi.displayName="ConnectionLine";const Ki=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Ui({containerStyle:e,style:n,type:r,component:o}){const{nodeId:a,handleType:i,nodesConnectable:s,width:l,height:c,connectionStatus:u}=$r(Ki,B);return!!(a&&i&&l&&s)?t.createElement("svg",{style:e,width:l,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},t.createElement("g",{className:v(["react-flow__connection",u])},t.createElement(Xi,{nodeId:a,handleType:i,style:n,type:r,CustomComponent:o,connectionStatus:u}))):null}function qi(e,t){const n=l(null),r=Ir();return o(()=>{if("development"===process.env.NODE_ENV){const t=Object.keys(e);B(n.current,t)&&r.getState().onError?.("002",_r()),n.current=t}return t(e)},[e])}const Zi=({nodeTypes:e,edgeTypes:n,onMove:r,onMoveStart:o,onMoveEnd:a,onInit:s,onNodeClick:c,onEdgeClick:u,onNodeDoubleClick:d,onEdgeDoubleClick:f,onNodeMouseEnter:p,onNodeMouseMove:h,onNodeMouseLeave:m,onNodeContextMenu:g,onSelectionContextMenu:y,onSelectionStart:v,onSelectionEnd:b,connectionLineType:w,connectionLineStyle:x,connectionLineComponent:S,connectionLineContainerStyle:E,selectionKeyCode:_,selectionOnDrag:C,selectionMode:k,multiSelectionKeyCode:N,panActivationKeyCode:M,zoomActivationKeyCode:P,deleteKeyCode:O,onlyRenderVisibleElements:A,elementsSelectable:R,selectNodesOnDrag:T,defaultViewport:D,translateExtent:$,minZoom:I,maxZoom:z,preventScrolling:L,defaultMarkerColor:B,zoomOnScroll:F,zoomOnPinch:H,panOnScroll:W,panOnScrollSpeed:V,panOnScrollMode:j,zoomOnDoubleClick:Y,panOnDrag:X,onPaneClick:K,onPaneMouseEnter:U,onPaneMouseMove:q,onPaneMouseLeave:Z,onPaneScroll:G,onPaneContextMenu:Q,onEdgeContextMenu:J,onEdgeMouseEnter:ee,onEdgeMouseMove:te,onEdgeMouseLeave:ne,onReconnect:re,onReconnectStart:oe,onReconnectEnd:ae,reconnectRadius:ie,noDragClassName:se,noWheelClassName:le,noPanClassName:ce,elevateEdgesOnSelect:ue,disableKeyboardA11y:de,nodeOrigin:fe,nodeExtent:pe,rfId:he})=>{const me=qi(e,wi),ge=qi(n,Oi);return function(e){const t=za(),n=l(!1);i(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}(s),t.createElement(bi,{onPaneClick:K,onPaneMouseEnter:U,onPaneMouseMove:q,onPaneMouseLeave:Z,onPaneContextMenu:Q,onPaneScroll:G,deleteKeyCode:O,selectionKeyCode:_,selectionOnDrag:C,selectionMode:k,onSelectionStart:v,onSelectionEnd:b,multiSelectionKeyCode:N,panActivationKeyCode:M,zoomActivationKeyCode:P,elementsSelectable:R,onMove:r,onMoveStart:o,onMoveEnd:a,zoomOnScroll:F,zoomOnPinch:H,zoomOnDoubleClick:Y,panOnScroll:W,panOnScrollSpeed:V,panOnScrollMode:j,panOnDrag:X,defaultViewport:D,translateExtent:$,minZoom:I,maxZoom:z,onSelectionContextMenu:y,preventScrolling:L,noDragClassName:se,noWheelClassName:le,noPanClassName:ce,disableKeyboardA11y:de},t.createElement(ji,null,t.createElement(Wi,{edgeTypes:ge,onEdgeClick:u,onEdgeDoubleClick:f,onlyRenderVisibleElements:A,onEdgeContextMenu:J,onEdgeMouseEnter:ee,onEdgeMouseMove:te,onEdgeMouseLeave:ne,onReconnect:re,onReconnectStart:oe,onReconnectEnd:ae,reconnectRadius:ie,defaultMarkerColor:B,noPanClassName:ce,elevateEdgesOnSelect:!!ue,disableKeyboardA11y:de,rfId:he},t.createElement(Ui,{style:x,type:w,component:S,containerStyle:E})),t.createElement("div",{className:"react-flow__edgelabel-renderer"}),t.createElement(Ei,{nodeTypes:me,onNodeClick:c,onNodeDoubleClick:d,onNodeMouseEnter:p,onNodeMouseMove:h,onNodeMouseLeave:m,onNodeContextMenu:g,selectNodesOnDrag:T,onlyRenderVisibleElements:A,noPanClassName:ce,noDragClassName:se,disableKeyboardA11y:de,nodeOrigin:fe,nodeExtent:pe,rfId:he})))};Zi.displayName="GraphView";var Gi=r(Zi);const Qi=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ji={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Qi,nodeExtent:Qi,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:lo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:Jr,isValidConnection:void 0},es=()=>{return e=(e,t)=>({...Ji,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:a}=t();e({nodeInternals:Pa(n,r,o,a)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(e=>({...r,...e}))})},setDefaultNodesAndEdges:(n,r)=>{const o=void 0!==n,a=void 0!==r,i=o?Pa(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:i,edges:a?r:[],hasDefaultNodes:o,hasDefaultEdges:a})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:a,fitViewOnInitDone:i,fitViewOnInitOptions:s,domNode:l,nodeOrigin:c}=t(),u=l?.querySelector(".react-flow__viewport");if(!u)return;const d=window.getComputedStyle(u),{m22:f}=new window.DOMMatrixReadOnly(d.transform),p=n.reduce((e,t)=>{const n=o.get(t.id);if(n?.hidden)o.set(n.id,{...n,[Gr]:{...n[Gr],handleBounds:void 0}});else if(n){const r=Hr(t.nodeElement);r.width&&r.height&&(n.width!==r.width||n.height!==r.height||t.forceUpdate)&&(o.set(n.id,{...n,[Gr]:{...n[Gr],handleBounds:{source:si(".source",t.nodeElement,f,c),target:si(".target",t.nodeElement,f,c)}},...r}),e.push({id:n.id,type:"dimensions",dimensions:r}))}return e},[]);Ma(o,c);const h=i||a&&!i&&Oa(t,{initial:!0,...s});e({nodeInternals:new Map(o),fitViewOnInitDone:h}),p?.length>0&&r?.(p)},updateNodePositions:(e,n=!0,r=!1)=>{const{triggerNodeChanges:o}=t(),a=e.map(e=>{const t={id:e.id,type:"position",dragging:r};return n&&(t.positionAbsolute=e.positionAbsolute,t.position=e.position),t});o(a)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:a,nodeOrigin:i,getNodes:s,elevateNodesOnSelect:l}=t();if(n?.length){if(a){const t=Pa(Za(n,s()),o,i,l);e({nodeInternals:t})}r?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:a}=t();let i,s=null;r?i=n.map(e=>Ga(e,!0)):(i=Qa(a(),n),s=Qa(o,[])),Ta({changedNodes:i,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:a}=t();let i,s=null;r?i=n.map(e=>Ga(e,!0)):(i=Qa(o,n),s=Qa(a(),[])),Ta({changedNodes:s,changedEdges:i,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:a}=t(),i=r||o;Ta({changedNodes:(n||a()).map(e=>(e.selected=!1,Ga(e.id,!1))),changedEdges:i.map(e=>Ga(e.id,!1)),get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r?.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r?.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t();Ta({changedNodes:r().filter(e=>e.selected).map(e=>Ga(e.id,!1)),changedEdges:n.filter(e=>e.selected).map(e=>Ga(e.id,!1)),get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(e=>{e.positionAbsolute=Vr(e.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:e=>{const{transform:n,width:r,height:o,d3Zoom:a,d3Selection:i,translateExtent:s}=t();if(!a||!i||!e.x&&!e.y)return!1;const l=pr.translate(n[0]+e.x,n[1]+e.y).scale(n[2]),c=[[0,0],[r,o]],u=a?.constrain()(l,c,s);return a.transform(i,u),n[0]!==u.x||n[1]!==u.y||n[2]!==u.k},cancelConnection:()=>e({connectionNodeId:Ji.connectionNodeId,connectionHandleId:Ji.connectionHandleId,connectionHandleType:Ji.connectionHandleType,connectionStatus:Ji.connectionStatus,connectionStartHandle:Ji.connectionStartHandle,connectionEndHandle:Ji.connectionEndHandle}),reset:()=>e({...Ji})}),t=Object.is,e?L(e,t):L;var e,t},ts=({children:e})=>{const n=l(null);return n.current||(n.current=es()),t.createElement(Er,{value:n.current},e)};ts.displayName="ReactFlowProvider";const ns=({children:e})=>c(Sr)?t.createElement(t.Fragment,null,e):t.createElement(ts,null,e);ns.displayName="ReactFlowWrapper";const rs={input:ra,default:ta,output:aa,group:ia},os={default:Mo,straight:_o,step:Eo,smoothstep:So,simplebezier:yo},as=[0,0],is=[15,15],ss={x:0,y:0,zoom:1},ls={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},cs=a(({nodes:e,edges:n,defaultNodes:r,defaultEdges:o,className:a,nodeTypes:i=rs,edgeTypes:s=os,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:S,onNodeContextMenu:E,onNodeDoubleClick:_,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:N,onNodesDelete:M,onEdgesDelete:P,onSelectionChange:O,onSelectionDragStart:A,onSelectionDrag:R,onSelectionDragStop:T,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:I,connectionMode:z=lo.Strict,connectionLineType:L=fo.Bezier,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:H,deleteKeyCode:W="Backspace",selectionKeyCode:V="Shift",selectionOnDrag:j=!1,selectionMode:Y=uo.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:K=(ro()?"Meta":"Control"),zoomActivationKeyCode:U=(ro()?"Meta":"Control"),snapToGrid:q=!1,snapGrid:Z=is,onlyRenderVisibleElements:G=!1,selectNodesOnDrag:Q=!0,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=as,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ae,defaultViewport:ie=ss,minZoom:se=.5,maxZoom:le=2,translateExtent:ce=Qi,preventScrolling:ue=!0,nodeExtent:de,defaultMarkerColor:fe="#b1b1b7",zoomOnScroll:pe=!0,zoomOnPinch:he=!0,panOnScroll:me=!1,panOnScrollSpeed:ge=.5,panOnScrollMode:ye=co.Free,zoomOnDoubleClick:ve=!0,panOnDrag:be=!0,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Se,onPaneMouseLeave:Ee,onPaneScroll:_e,onPaneContextMenu:Ce,children:ke,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Pe,onEdgeMouseMove:Oe,onEdgeMouseLeave:Ae,onEdgeUpdate:Re,onEdgeUpdateStart:Te,onEdgeUpdateEnd:De,onReconnect:$e,onReconnectStart:Ie,onReconnectEnd:ze,reconnectRadius:Le=10,edgeUpdaterRadius:Be=10,onNodesChange:Fe,onEdgesChange:He,noDragClassName:We="nodrag",noWheelClassName:Ve="nowheel",noPanClassName:je="nopan",fitView:Ye=!1,fitViewOptions:Xe,connectOnClick:Ke=!0,attributionPosition:Ue,proOptions:qe,defaultEdgeOptions:Ze,elevateNodesOnSelect:Ge=!0,elevateEdgesOnSelect:Qe=!1,disableKeyboardA11y:Je=!1,autoPanOnConnect:et=!0,autoPanOnNodeDrag:tt=!0,connectionRadius:nt=20,isValidConnection:rt,onError:ot,style:at,id:it,nodeDragThreshold:st,...lt},ct)=>{const ut=it||"1";return t.createElement("div",{...lt,style:{...at,...ls},ref:ct,className:v(["react-flow",a]),"data-testid":"rf__wrapper",id:it},t.createElement(ns,null,t.createElement(Gi,{onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:S,onNodeContextMenu:E,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:s,connectionLineType:L,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:H,selectionKeyCode:V,selectionOnDrag:j,selectionMode:Y,deleteKeyCode:W,multiSelectionKeyCode:K,panActivationKeyCode:X,zoomActivationKeyCode:U,onlyRenderVisibleElements:G,selectNodesOnDrag:Q,defaultViewport:ie,translateExtent:ce,minZoom:se,maxZoom:le,preventScrolling:ue,zoomOnScroll:pe,zoomOnPinch:he,zoomOnDoubleClick:ve,panOnScroll:me,panOnScrollSpeed:ge,panOnScrollMode:ye,panOnDrag:be,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Se,onPaneMouseLeave:Ee,onPaneScroll:_e,onPaneContextMenu:Ce,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:I,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Pe,onEdgeMouseMove:Oe,onEdgeMouseLeave:Ae,onReconnect:$e??Re,onReconnectStart:Ie??Te,onReconnectEnd:ze??De,reconnectRadius:Le??Be,defaultMarkerColor:fe,noDragClassName:We,noWheelClassName:Ve,noPanClassName:je,elevateEdgesOnSelect:Qe,rfId:ut,disableKeyboardA11y:Je,nodeOrigin:ne,nodeExtent:de}),t.createElement(ga,{nodes:e,edges:n,defaultNodes:r,defaultEdges:o,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:b,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ae,elevateNodesOnSelect:Ge,minZoom:se,maxZoom:le,nodeExtent:de,onNodesChange:Fe,onEdgesChange:He,snapToGrid:q,snapGrid:Z,connectionMode:z,translateExtent:ce,connectOnClick:Ke,defaultEdgeOptions:Ze,fitView:Ye,fitViewOptions:Xe,onNodesDelete:M,onEdgesDelete:P,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:N,onSelectionDrag:R,onSelectionDragStart:A,onSelectionDragStop:T,noPanClassName:je,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:ot,connectionRadius:nt,isValidConnection:rt,nodeDragThreshold:st}),t.createElement(fa,{onSelectionChange:O}),ke,t.createElement(Br,{proOptions:qe,position:Ue}),t.createElement(Ea,{rfId:ut,disableKeyboardA11y:Je})))});function us(e){return t=>{const[n,r]=u(t),o=s(t=>r(n=>e(t,n)),[]);return[n,r,o]}}cs.displayName="ReactFlow";const ds=us(Za),fs=us(function(e,t){return qa(e,t)});var ps;function hs({color:e,dimensions:n,lineWidth:r}){return t.createElement("path",{stroke:e,strokeWidth:r,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`})}function ms({color:e,radius:n}){return t.createElement("circle",{cx:n,cy:n,r:n,fill:e})}!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(ps||(ps={}));const gs={[ps.Dots]:"#91919a",[ps.Lines]:"#eee",[ps.Cross]:"#e2e2e2"},ys={[ps.Dots]:1,[ps.Lines]:1,[ps.Cross]:6},vs=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function bs({id:e,variant:n=ps.Dots,gap:r=20,size:o,lineWidth:a=1,offset:i=2,color:s,style:c,className:u}){const d=l(null),{transform:f,patternId:p}=$r(vs,B),h=s||gs[n],m=o||ys[n],g=n===ps.Dots,y=n===ps.Cross,b=Array.isArray(r)?r:[r,r],w=[b[0]*f[2]||1,b[1]*f[2]||1],x=m*f[2],S=y?[x,x]:w,E=g?[x/i,x/i]:[S[0]/i,S[1]/i];return t.createElement("svg",{className:v(["react-flow__background",u]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},t.createElement("pattern",{id:p+e,x:f[0]%w[0],y:f[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${E[0]},-${E[1]})`},g?t.createElement(ms,{color:h,radius:x/i}):t.createElement(hs,{dimensions:S,color:h,lineWidth:a})),t.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+e})`}))}bs.displayName="Background";var ws=r(bs);!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".react-flow{direction:ltr}.react-flow__container{height:100%;left:0;position:absolute;top:0;width:100%}.react-flow__pane{cursor:-webkit-grab;cursor:grab;z-index:1}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__viewport{pointer-events:none;transform-origin:0 0;z-index:2}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{overflow:visible;pointer-events:none}.react-flow__connection-path,.react-flow__edge-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{cursor:pointer;pointer-events:visibleStroke}.react-flow__edge.animated path{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;-webkit-animation:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{box-sizing:border-box;cursor:-webkit-grab;cursor:grab;pointer-events:all;position:absolute;transform-origin:0 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__node.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__nodesselection{pointer-events:none;transform-origin:left top;z-index:3}.react-flow__nodesselection-rect{cursor:-webkit-grab;cursor:grab;pointer-events:all;position:absolute}.react-flow__handle{background:#1a192b;border:1px solid #fff;border-radius:100%;height:6px;min-height:5px;min-width:5px;pointer-events:none;position:absolute;width:6px}.react-flow__handle.connectionindicator{cursor:crosshair;pointer-events:all}.react-flow__handle-bottom{bottom:-4px;left:50%;top:auto;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{left:-4px;top:50%;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{margin:15px;position:absolute;z-index:5}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translateX(-50%)}.react-flow__attribution{background:hsla(0,0%,100%,.5);font-size:10px;margin:0;padding:2px 3px}.react-flow__attribution a{color:#999;text-decoration:none}@-webkit-keyframes dashdraw{0%{stroke-dashoffset:10}}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{height:100%;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-group,.react-flow__node-input,.react-flow__node-output{background-color:#fff;border:1px solid #1a192b;border-radius:3px;color:#222;font-size:12px;padding:10px;text-align:center;width:150px}.react-flow__node-default.selectable:hover,.react-flow__node-group.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover{box-shadow:0 1px 4px 1px rgba(0,0,0,.08)}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:hsla(0,0%,94%,.25)}.react-flow__nodesselection-rect,.react-flow__selection{background:rgba(0,89,220,.08);border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px rgba(0,0,0,.08)}.react-flow__controls-button{align-items:center;background:#fefefe;border:none;border-bottom:1px solid #eee;box-sizing:content-box;cursor:pointer;display:flex;height:16px;justify-content:center;padding:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{max-height:12px;max-width:12px;width:100%}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.bottom,.react-flow__resize-control.top{cursor:ns-resize}.react-flow__resize-control.bottom.right,.react-flow__resize-control.top.left{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:#3367d9;border:1px solid #fff;border-radius:1px;height:4px;transform:translate(-50%,-50%);width:4px}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.bottom.left,.react-flow__resize-control.handle.top.left{left:0}.react-flow__resize-control.handle.bottom.right,.react-flow__resize-control.handle.top.right{left:100%}.react-flow__resize-control.line{border:0 solid #3367d9}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{height:100%;top:0;transform:translate(-50%);width:1px}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.bottom,.react-flow__resize-control.line.top{height:1px;left:0;transform:translateY(-50%);width:100%}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}");
1
+ import*as e from"react";import t,{createContext as n,memo as r,useMemo as o,forwardRef as i,useEffect as a,useCallback as s,useRef as l,useContext as c,useState as u,createElement as d,useLayoutEffect as f}from"react";import*as p from"react-dom";import h from"react-dom";import{jsx as m,jsxs as g,Fragment as y}from"react/jsx-runtime";function v(e){if("string"==typeof e||"number"==typeof e)return""+e;let t="";if(Array.isArray(e))for(let n,r=0;r<e.length;r++)""!==(n=v(e[r]))&&(t+=(t&&" ")+n);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}function b(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var w,x={exports:{}},E={},S={exports:{}},_={};var C,k,N,M={};function O(){return k||(k=1,"production"===process.env.NODE_ENV?S.exports=function(){if(w)return _;w=1;var e=t,n="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},r=e.useState,o=e.useEffect,i=e.useLayoutEffect,a=e.useDebugValue;function s(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!n(e,r)}catch(e){return!0}}var l="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,t){var n=t(),l=r({inst:{value:n,getSnapshot:t}}),c=l[0].inst,u=l[1];return i(function(){c.value=n,c.getSnapshot=t,s(c)&&u({inst:c})},[e,n,t]),o(function(){return s(c)&&u({inst:c}),e(function(){s(c)&&u({inst:c})})},[e]),a(n),n};return _.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:l,_}():S.exports=(C||(C=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(e){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var n=t,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useState,i=n.useEffect,a=n.useLayoutEffect,s=n.useDebugValue,l=!1,c=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(t,u){l||void 0===n.startTransition||(l=!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 d=u();if(!c){var f=u();r(d,f)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),c=!0)}var p=(f=o({inst:{value:d,getSnapshot:u}}))[0].inst,h=f[1];return a(function(){p.value=d,p.getSnapshot=u,e(p)&&h({inst:p})},[t,d,u]),i(function(){return e(p)&&h({inst:p}),t(function(){e(p)&&h({inst:p})})},[t]),s(d),d};M.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),M)),S.exports}var A,P={};"production"===process.env.NODE_ENV?x.exports=function(){if(N)return E;N=1;var e=t,n=O(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;return E.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=i(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!a){if(a=!0,o=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(o=e,t):(o=e,i=n)}var o,i,a=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,c,u]);var p=o(e,d[0],d[1]);return a(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},E}():x.exports=(A||(A=1,"production"!==process.env.NODE_ENV&&function(){"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var e=t,n=O(),r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=n.useSyncExternalStore,i=e.useRef,a=e.useEffect,s=e.useMemo,l=e.useDebugValue;P.useSyncExternalStoreWithSelector=function(e,t,n,c,u){var d=i(null);if(null===d.current){var f={hasValue:!1,value:null};d.current=f}else f=d.current;d=s(function(){function e(e){if(!a){if(a=!0,o=e,e=c(e),void 0!==u&&f.hasValue){var t=f.value;if(u(t,e))return i=t}return i=e}if(t=i,r(o,e))return t;var n=c(e);return void 0!==u&&u(t,n)?(o=e,t):(o=e,i=n)}var o,i,a=!1,s=void 0===n?null:n;return[function(){return e(t())},null===s?void 0:function(){return e(s())}]},[t,n,c,u]);var p=o(e,d[0],d[1]);return a(function(){f.hasValue=!0,f.value=p},[p]),l(p),p},"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),P);var R=b(x.exports);const T=e=>{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o||null===o)?o:Object.assign({},t,o),n.forEach(n=>n(t,e))}},o=()=>t,i={setState:r,getState:o,getInitialState:()=>a,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{"production"!==(import.meta.env?import.meta.env.MODE:void 0)&&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()}},a=t=e(r,o,i);return i},{useDebugValue:D}=t,{useSyncExternalStoreWithSelector:$}=R,I=e=>e;function z(e,t=I,n){const r=$(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return D(r),r}const L=(e,t)=>{const n=(e=>e?T(e):T)(e),r=(e,r=t)=>z(n,e,r);return Object.assign(r,n),r};function B(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}var F={value:()=>{}};function H(){for(var e,t=0,n=arguments.length,r={};t<n;++t){if(!(e=arguments[t]+"")||e in r||/[\s.]/.test(e))throw new Error("illegal type: "+e);r[e]=[]}return new W(r)}function W(e){this._=e}function V(e,t){for(var n,r=0,o=e.length;r<o;++r)if((n=e[r]).name===t)return n.value}function Y(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=F,e=e.slice(0,r).concat(e.slice(r+1));break}return null!=n&&e.push({name:t,value:n}),e}W.prototype=H.prototype={constructor:W,on:function(e,t){var n,r,o=this._,i=(r=o,(e+"").trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");if(n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),e&&!r.hasOwnProperty(e))throw new Error("unknown type: "+e);return{type:e,name:t}})),a=-1,s=i.length;if(!(arguments.length<2)){if(null!=t&&"function"!=typeof t)throw new Error("invalid callback: "+t);for(;++a<s;)if(n=(e=i[a]).type)o[n]=Y(o[n],e.name,t);else if(null==t)for(n in o)o[n]=Y(o[n],e.name,null);return this}for(;++a<s;)if((n=(e=i[a]).type)&&(n=V(o[n],e.name)))return n},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new W(e)},call:function(e,t){if((n=arguments.length-2)>0)for(var n,r,o=new Array(n),i=0;i<n;++i)o[i]=arguments[i+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=0,n=(r=this._[e]).length;i<n;++i)r[i].value.apply(t,o)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],o=0,i=r.length;o<i;++o)r[o].value.apply(t,n)}};var j="http://www.w3.org/1999/xhtml",X={svg:"http://www.w3.org/2000/svg",xhtml:j,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function K(e){var t=e+="",n=t.indexOf(":");return n>=0&&"xmlns"!==(t=e.slice(0,n))&&(e=e.slice(n+1)),X.hasOwnProperty(t)?{space:X[t],local:e}:e}function U(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===j&&t.documentElement.namespaceURI===j?t.createElement(e):t.createElementNS(n,e)}}function q(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Z(e){var t=K(e);return(t.local?q:U)(t)}function G(){}function Q(e){return null==e?G:function(){return this.querySelector(e)}}function J(){return[]}function ee(e){return null==e?J:function(){return this.querySelectorAll(e)}}function te(e){return function(){return null==(t=e.apply(this,arguments))?[]:Array.isArray(t)?t:Array.from(t);var t}}function ne(e){return function(){return this.matches(e)}}function re(e){return function(t){return t.matches(e)}}var oe=Array.prototype.find;function ie(){return this.firstElementChild}var ae=Array.prototype.filter;function se(){return Array.from(this.children)}function le(e){return new Array(e.length)}function ce(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}function ue(e,t,n,r,o,i){for(var a,s=0,l=t.length,c=i.length;s<c;++s)(a=t[s])?(a.__data__=i[s],r[s]=a):n[s]=new ce(e,i[s]);for(;s<l;++s)(a=t[s])&&(o[s]=a)}function de(e,t,n,r,o,i,a){var s,l,c,u=new Map,d=t.length,f=i.length,p=new Array(d);for(s=0;s<d;++s)(l=t[s])&&(p[s]=c=a.call(l,l.__data__,s,t)+"",u.has(c)?o[s]=l:u.set(c,l));for(s=0;s<f;++s)c=a.call(e,i[s],s,i)+"",(l=u.get(c))?(r[s]=l,l.__data__=i[s],u.delete(c)):n[s]=new ce(e,i[s]);for(s=0;s<d;++s)(l=t[s])&&u.get(p[s])===l&&(o[s]=l)}function fe(e){return e.__data__}function pe(e){return"object"==typeof e&&"length"in e?e:Array.from(e)}function he(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function me(e){return function(){this.removeAttribute(e)}}function ge(e){return function(){this.removeAttributeNS(e.space,e.local)}}function ye(e,t){return function(){this.setAttribute(e,t)}}function ve(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function be(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttribute(e):this.setAttribute(e,n)}}function we(e,t){return function(){var n=t.apply(this,arguments);null==n?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function xe(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function Ee(e){return function(){this.style.removeProperty(e)}}function Se(e,t,n){return function(){this.style.setProperty(e,t,n)}}function _e(e,t,n){return function(){var r=t.apply(this,arguments);null==r?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function Ce(e,t){return e.style.getPropertyValue(t)||xe(e).getComputedStyle(e,null).getPropertyValue(t)}function ke(e){return function(){delete this[e]}}function Ne(e,t){return function(){this[e]=t}}function Me(e,t){return function(){var n=t.apply(this,arguments);null==n?delete this[e]:this[e]=n}}function Oe(e){return e.trim().split(/^|\s+/)}function Ae(e){return e.classList||new Pe(e)}function Pe(e){this._node=e,this._names=Oe(e.getAttribute("class")||"")}function Re(e,t){for(var n=Ae(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Te(e,t){for(var n=Ae(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function De(e){return function(){Re(this,e)}}function $e(e){return function(){Te(this,e)}}function Ie(e,t){return function(){(t.apply(this,arguments)?Re:Te)(this,e)}}function ze(){this.textContent=""}function Le(e){return function(){this.textContent=e}}function Be(e){return function(){var t=e.apply(this,arguments);this.textContent=null==t?"":t}}function Fe(){this.innerHTML=""}function He(e){return function(){this.innerHTML=e}}function We(e){return function(){var t=e.apply(this,arguments);this.innerHTML=null==t?"":t}}function Ve(){this.nextSibling&&this.parentNode.appendChild(this)}function Ye(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function je(){return null}function Xe(){var e=this.parentNode;e&&e.removeChild(this)}function Ke(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function Ue(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function qe(e){return function(){var t=this.__on;if(t){for(var n,r=0,o=-1,i=t.length;r<i;++r)n=t[r],e.type&&n.type!==e.type||n.name!==e.name?t[++o]=n:this.removeEventListener(n.type,n.listener,n.options);++o?t.length=o:delete this.__on}}}function Ze(e,t,n){return function(){var r,o=this.__on,i=function(e){return function(t){e.call(this,t,this.__data__)}}(t);if(o)for(var a=0,s=o.length;a<s;++a)if((r=o[a]).type===e.type&&r.name===e.name)return this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=i,r.options=n),void(r.value=t);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 Ge(e,t,n){var r=xe(e),o=r.CustomEvent;"function"==typeof o?o=new o(t,n):(o=r.document.createEvent("Event"),n?(o.initEvent(t,n.bubbles,n.cancelable),o.detail=n.detail):o.initEvent(t,!1,!1)),e.dispatchEvent(o)}function Qe(e,t){return function(){return Ge(this,e,t)}}function Je(e,t){return function(){return Ge(this,e,t.apply(this,arguments))}}ce.prototype={constructor:ce,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)}},Pe.prototype={add:function(e){this._names.indexOf(e)<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}};var et=[null];function tt(e,t){this._groups=e,this._parents=t}function nt(){return new tt([[document.documentElement]],et)}function rt(e){return"string"==typeof e?new tt([[document.querySelector(e)]],[document.documentElement]):new tt([[e]],et)}function ot(e,t){if(e=function(e){let t;for(;t=e.sourceEvent;)e=t;return e}(e),void 0===t&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,[(r=r.matrixTransform(t.getScreenCTM().inverse())).x,r.y]}if(t.getBoundingClientRect){var o=t.getBoundingClientRect();return[e.clientX-o.left-t.clientLeft,e.clientY-o.top-t.clientTop]}}return[e.pageX,e.pageY]}tt.prototype=nt.prototype={constructor:tt,select:function(e){"function"!=typeof e&&(e=Q(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a,s=t[o],l=s.length,c=r[o]=new Array(l),u=0;u<l;++u)(i=s[u])&&(a=e.call(i,i.__data__,u,s))&&("__data__"in i&&(a.__data__=i.__data__),c[u]=a);return new tt(r,this._parents)},selectAll:function(e){e="function"==typeof e?te(e):ee(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var a,s=t[i],l=s.length,c=0;c<l;++c)(a=s[c])&&(r.push(e.call(a,a.__data__,c,s)),o.push(a));return new tt(r,o)},selectChild:function(e){return this.select(null==e?ie:function(e){return function(){return oe.call(this.children,e)}}("function"==typeof e?e:re(e)))},selectChildren:function(e){return this.selectAll(null==e?se:function(e){return function(){return ae.call(this.children,e)}}("function"==typeof e?e:re(e)))},filter:function(e){"function"!=typeof e&&(e=ne(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],s=a.length,l=r[o]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new tt(r,this._parents)},data:function(e,t){if(!arguments.length)return Array.from(this,fe);var n,r=t?de:ue,o=this._parents,i=this._groups;"function"!=typeof e&&(n=e,e=function(){return n});for(var a=i.length,s=new Array(a),l=new Array(a),c=new Array(a),u=0;u<a;++u){var d=o[u],f=i[u],p=f.length,h=pe(e.call(d,d&&d.__data__,u,o)),m=h.length,g=l[u]=new Array(m),y=s[u]=new Array(m);r(d,f,g,y,c[u]=new Array(p),h,t);for(var v,b,w=0,x=0;w<m;++w)if(v=g[w]){for(w>=x&&(x=w+1);!(b=y[x])&&++x<m;);v._next=b||null}}return(s=new tt(s,o))._enter=l,s._exit=c,s},enter:function(){return new tt(this._enter||this._groups.map(le),this._parents)},exit:function(){return new tt(this._exit||this._groups.map(le),this._parents)},join:function(e,t,n){var r=this.enter(),o=this,i=this.exit();return"function"==typeof e?(r=e(r))&&(r=r.selection()):r=r.append(e+""),null!=t&&(o=t(o))&&(o=o.selection()),null==n?i.remove():n(i),r&&o?r.merge(o).order():o},merge:function(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,a=Math.min(o,i),s=new Array(o),l=0;l<a;++l)for(var c,u=n[l],d=r[l],f=u.length,p=s[l]=new Array(f),h=0;h<f;++h)(c=u[h]||d[h])&&(p[h]=c);for(;l<o;++l)s[l]=n[l];return new tt(s,this._parents)},selection:function(){return this},order:function(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r,o=e[t],i=o.length-1,a=o[i];--i>=0;)(r=o[i])&&(a&&4^r.compareDocumentPosition(a)&&a.parentNode.insertBefore(r,a),a=r);return this},sort:function(e){function t(t,n){return t&&n?e(t.__data__,n.__data__):!t-!n}e||(e=he);for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var a,s=n[i],l=s.length,c=o[i]=new Array(l),u=0;u<l;++u)(a=s[u])&&(c[u]=a);c.sort(t)}return new tt(o,this._parents).order()},call:function(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this},nodes:function(){return Array.from(this)},node:function(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length;o<i;++o){var a=r[o];if(a)return a}return null},size:function(){let e=0;for(const t of this)++e;return e},empty:function(){return!this.node()},each:function(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o,i=t[n],a=0,s=i.length;a<s;++a)(o=i[a])&&e.call(o,o.__data__,a,i);return this},attr:function(e,t){var n=K(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((null==t?n.local?ge:me:"function"==typeof t?n.local?we:be:n.local?ve:ye)(n,t))},style:function(e,t,n){return arguments.length>1?this.each((null==t?Ee:"function"==typeof t?_e:Se)(e,t,null==n?"":n)):Ce(this.node(),e)},property:function(e,t){return arguments.length>1?this.each((null==t?ke:"function"==typeof t?Me:Ne)(e,t)):this.node()[e]},classed:function(e,t){var n=Oe(e+"");if(arguments.length<2){for(var r=Ae(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each(("function"==typeof t?Ie:t?De:$e)(n,t))},text:function(e){return arguments.length?this.each(null==e?ze:("function"==typeof e?Be:Le)(e)):this.node().textContent},html:function(e){return arguments.length?this.each(null==e?Fe:("function"==typeof e?We:He)(e)):this.node().innerHTML},raise:function(){return this.each(Ve)},lower:function(){return this.each(Ye)},append:function(e){var t="function"==typeof e?e:Z(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})},insert:function(e,t){var n="function"==typeof e?e:Z(e),r=null==t?je:"function"==typeof t?t:Q(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})},remove:function(){return this.each(Xe)},clone:function(e){return this.select(e?Ue:Ke)},datum:function(e){return arguments.length?this.property("__data__",e):this.node().__data__},on:function(e,t,n){var r,o,i=function(e){return e.trim().split(/^|\s+/).map(function(e){var t="",n=e.indexOf(".");return n>=0&&(t=e.slice(n+1),e=e.slice(0,n)),{type:e,name:t}})}(e+""),a=i.length;if(!(arguments.length<2)){for(s=t?Ze:qe,r=0;r<a;++r)this.each(s(i[r],t,n));return this}var s=this.node().__on;if(s)for(var l,c=0,u=s.length;c<u;++c)for(r=0,l=s[c];r<a;++r)if((o=i[r]).type===l.type&&o.name===l.name)return l.value},dispatch:function(e,t){return this.each(("function"==typeof t?Je:Qe)(e,t))},[Symbol.iterator]:function*(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r,o=e[t],i=0,a=o.length;i<a;++i)(r=o[i])&&(yield r)}};const it={passive:!1},at={capture:!0,passive:!1};function st(e){e.stopImmediatePropagation()}function lt(e){e.preventDefault(),e.stopImmediatePropagation()}function ct(e){var t=e.document.documentElement,n=rt(e).on("dragstart.drag",lt,at);"onselectstart"in t?n.on("selectstart.drag",lt,at):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function ut(e,t){var n=e.document.documentElement,r=rt(e).on("dragstart.drag",null);t&&(r.on("click.drag",lt,at),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}var dt=e=>()=>e;function ft(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:a,y:s,dx:l,dy:c,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:r,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:i,enumerable:!0,configurable:!0},x:{value:a,enumerable:!0,configurable:!0},y:{value:s,enumerable:!0,configurable:!0},dx:{value:l,enumerable:!0,configurable:!0},dy:{value:c,enumerable:!0,configurable:!0},_:{value:u}})}function pt(e){return!e.ctrlKey&&!e.button}function ht(){return this.parentNode}function mt(e,t){return null==t?{x:e.x,y:e.y}:t}function gt(){return navigator.maxTouchPoints||"ontouchstart"in this}function yt(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function vt(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function bt(){}ft.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};var wt=.7,xt=1/wt,Et="\\s*([+-]?\\d+)\\s*",St="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",_t="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Ct=/^#([0-9a-f]{3,8})$/,kt=new RegExp(`^rgb\\(${Et},${Et},${Et}\\)$`),Nt=new RegExp(`^rgb\\(${_t},${_t},${_t}\\)$`),Mt=new RegExp(`^rgba\\(${Et},${Et},${Et},${St}\\)$`),Ot=new RegExp(`^rgba\\(${_t},${_t},${_t},${St}\\)$`),At=new RegExp(`^hsl\\(${St},${_t},${_t}\\)$`),Pt=new RegExp(`^hsla\\(${St},${_t},${_t},${St}\\)$`),Rt={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};function Tt(){return this.rgb().formatHex()}function Dt(){return this.rgb().formatRgb()}function $t(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=Ct.exec(e))?(n=t[1].length,t=parseInt(t[1],16),6===n?It(t):3===n?new Bt(t>>8&15|t>>4&240,t>>4&15|240&t,(15&t)<<4|15&t,1):8===n?zt(t>>24&255,t>>16&255,t>>8&255,(255&t)/255):4===n?zt(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|240&t,((15&t)<<4|15&t)/255):null):(t=kt.exec(e))?new Bt(t[1],t[2],t[3],1):(t=Nt.exec(e))?new Bt(255*t[1]/100,255*t[2]/100,255*t[3]/100,1):(t=Mt.exec(e))?zt(t[1],t[2],t[3],t[4]):(t=Ot.exec(e))?zt(255*t[1]/100,255*t[2]/100,255*t[3]/100,t[4]):(t=At.exec(e))?jt(t[1],t[2]/100,t[3]/100,1):(t=Pt.exec(e))?jt(t[1],t[2]/100,t[3]/100,t[4]):Rt.hasOwnProperty(e)?It(Rt[e]):"transparent"===e?new Bt(NaN,NaN,NaN,0):null}function It(e){return new Bt(e>>16&255,e>>8&255,255&e,1)}function zt(e,t,n,r){return r<=0&&(e=t=n=NaN),new Bt(e,t,n,r)}function Lt(e,t,n,r){return 1===arguments.length?((o=e)instanceof bt||(o=$t(o)),o?new Bt((o=o.rgb()).r,o.g,o.b,o.opacity):new Bt):new Bt(e,t,n,null==r?1:r);var o}function Bt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}function Ft(){return`#${Yt(this.r)}${Yt(this.g)}${Yt(this.b)}`}function Ht(){const e=Wt(this.opacity);return`${1===e?"rgb(":"rgba("}${Vt(this.r)}, ${Vt(this.g)}, ${Vt(this.b)}${1===e?")":`, ${e})`}`}function Wt(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Vt(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Yt(e){return((e=Vt(e))<16?"0":"")+e.toString(16)}function jt(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Kt(e,t,n,r)}function Xt(e){if(e instanceof Kt)return new Kt(e.h,e.s,e.l,e.opacity);if(e instanceof bt||(e=$t(e)),!e)return new Kt;if(e instanceof Kt)return e;var t=(e=e.rgb()).r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),a=NaN,s=i-o,l=(i+o)/2;return s?(a=t===i?(n-r)/s+6*(n<r):n===i?(r-t)/s+2:(t-n)/s+4,s/=l<.5?i+o:2-i-o,a*=60):s=l>0&&l<1?0:a,new Kt(a,s,l,e.opacity)}function Kt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}function Ut(e){return(e=(e||0)%360)<0?e+360:e}function qt(e){return Math.max(0,Math.min(1,e||0))}function Zt(e,t,n){return 255*(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)}yt(bt,$t,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:Tt,formatHex:Tt,formatHex8:function(){return this.rgb().formatHex8()},formatHsl:function(){return Xt(this).formatHsl()},formatRgb:Dt,toString:Dt}),yt(Bt,Lt,vt(bt,{brighter(e){return e=null==e?xt:Math.pow(xt,e),new Bt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=null==e?wt:Math.pow(wt,e),new Bt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Bt(Vt(this.r),Vt(this.g),Vt(this.b),Wt(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:Ft,formatHex:Ft,formatHex8:function(){return`#${Yt(this.r)}${Yt(this.g)}${Yt(this.b)}${Yt(255*(isNaN(this.opacity)?1:this.opacity))}`},formatRgb:Ht,toString:Ht})),yt(Kt,function(e,t,n,r){return 1===arguments.length?Xt(e):new Kt(e,t,n,null==r?1:r)},vt(bt,{brighter(e){return e=null==e?xt:Math.pow(xt,e),new Kt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=null==e?wt:Math.pow(wt,e),new Kt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+360*(this.h<0),t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new Bt(Zt(e>=240?e-240:e+120,o,r),Zt(e,o,r),Zt(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Kt(Ut(this.h),qt(this.s),qt(this.l),Wt(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=Wt(this.opacity);return`${1===e?"hsl(":"hsla("}${Ut(this.h)}, ${100*qt(this.s)}%, ${100*qt(this.l)}%${1===e?")":`, ${e})`}`}}));var Gt=e=>()=>e;function Qt(e){return 1===(e=+e)?Jt:function(t,n){return n-t?function(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}(t,n,e):Gt(isNaN(t)?n:t)}}function Jt(e,t){var n=t-e;return n?function(e,t){return function(n){return e+n*t}}(e,n):Gt(isNaN(e)?t:e)}var en=function e(t){var n=Qt(t);function r(e,t){var r=n((e=Lt(e)).r,(t=Lt(t)).r),o=n(e.g,t.g),i=n(e.b,t.b),a=Jt(e.opacity,t.opacity);return function(t){return e.r=r(t),e.g=o(t),e.b=i(t),e.opacity=a(t),e+""}}return r.gamma=e,r}(1);function tn(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}var nn=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,rn=new RegExp(nn.source,"g");function on(e,t){var n,r,o,i=nn.lastIndex=rn.lastIndex=0,a=-1,s=[],l=[];for(e+="",t+="";(n=nn.exec(e))&&(r=rn.exec(t));)(o=r.index)>i&&(o=t.slice(i,o),s[a]?s[a]+=o:s[++a]=o),(n=n[0])===(r=r[0])?s[a]?s[a]+=r:s[++a]=r:(s[++a]=null,l.push({i:a,x:tn(n,r)})),i=rn.lastIndex;return i<t.length&&(o=t.slice(i),s[a]?s[a]+=o:s[++a]=o),s.length<2?l[0]?function(e){return function(t){return e(t)+""}}(l[0].x):function(e){return function(){return e}}(t):(t=l.length,function(e){for(var n,r=0;r<t;++r)s[(n=l[r]).i]=n.x(e);return s.join("")})}var an,sn=180/Math.PI,ln={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function cn(e,t,n,r,o,i){var a,s,l;return(a=Math.sqrt(e*e+t*t))&&(e/=a,t/=a),(l=e*n+t*r)&&(n-=e*l,r-=t*l),(s=Math.sqrt(n*n+r*r))&&(n/=s,r/=s,l/=s),e*r<t*n&&(e=-e,t=-t,l=-l,a=-a),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*sn,skewX:Math.atan(l)*sn,scaleX:a,scaleY:s}}function un(e,t,n,r){function o(e){return e.length?e.pop()+" ":""}return function(i,a){var s=[],l=[];return i=e(i),a=e(a),function(e,r,o,i,a,s){if(e!==o||r!==i){var l=a.push("translate(",null,t,null,n);s.push({i:l-4,x:tn(e,o)},{i:l-2,x:tn(r,i)})}else(o||i)&&a.push("translate("+o+t+i+n)}(i.translateX,i.translateY,a.translateX,a.translateY,s,l),function(e,t,n,i){e!==t?(e-t>180?t+=360:t-e>180&&(e+=360),i.push({i:n.push(o(n)+"rotate(",null,r)-2,x:tn(e,t)})):t&&n.push(o(n)+"rotate("+t+r)}(i.rotate,a.rotate,s,l),function(e,t,n,i){e!==t?i.push({i:n.push(o(n)+"skewX(",null,r)-2,x:tn(e,t)}):t&&n.push(o(n)+"skewX("+t+r)}(i.skewX,a.skewX,s,l),function(e,t,n,r,i,a){if(e!==n||t!==r){var s=i.push(o(i)+"scale(",null,",",null,")");a.push({i:s-4,x:tn(e,n)},{i:s-2,x:tn(t,r)})}else 1===n&&1===r||i.push(o(i)+"scale("+n+","+r+")")}(i.scaleX,i.scaleY,a.scaleX,a.scaleY,s,l),i=a=null,function(e){for(var t,n=-1,r=l.length;++n<r;)s[(t=l[n]).i]=t.x(e);return s.join("")}}}var dn=un(function(e){const t=new("function"==typeof DOMMatrix?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?ln:cn(t.a,t.b,t.c,t.d,t.e,t.f)},"px, ","px)","deg)"),fn=un(function(e){return null==e?ln:(an||(an=document.createElementNS("http://www.w3.org/2000/svg","g")),an.setAttribute("transform",e),(e=an.transform.baseVal.consolidate())?cn((e=e.matrix).a,e.b,e.c,e.d,e.e,e.f):ln)},", ",")",")");function pn(e){return((e=Math.exp(e))+1/e)/2}var hn,mn,gn=function e(t,n,r){function o(e,o){var i,a,s=e[0],l=e[1],c=e[2],u=o[0],d=o[1],f=o[2],p=u-s,h=d-l,m=p*p+h*h;if(m<1e-12)a=Math.log(f/c)/t,i=function(e){return[s+e*p,l+e*h,c*Math.exp(t*e*a)]};else{var g=Math.sqrt(m),y=(f*f-c*c+r*m)/(2*c*n*g),v=(f*f-c*c-r*m)/(2*f*n*g),b=Math.log(Math.sqrt(y*y+1)-y),w=Math.log(Math.sqrt(v*v+1)-v);a=(w-b)/t,i=function(e){var r,o=e*a,i=pn(b),u=c/(n*g)*(i*(r=t*o+b,((r=Math.exp(2*r))-1)/(r+1))-function(e){return((e=Math.exp(e))-1/e)/2}(b));return[s+u*p,l+u*h,c*i/pn(t*o+b)]}}return i.duration=1e3*a*t/Math.SQRT2,i}return o.rho=function(t){var n=Math.max(.001,+t),r=n*n;return e(n,r,r*r)},o}(Math.SQRT2,2,4),yn=0,vn=0,bn=0,wn=0,xn=0,En=0,Sn="object"==typeof performance&&performance.now?performance:Date,_n="object"==typeof window&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Cn(){return xn||(_n(kn),xn=Sn.now()+En)}function kn(){xn=0}function Nn(){this._call=this._time=this._next=null}function Mn(e,t,n){var r=new Nn;return r.restart(e,t,n),r}function On(){xn=(wn=Sn.now())+En,yn=vn=0;try{!function(){Cn(),++yn;for(var e,t=hn;t;)(e=xn-t._time)>=0&&t._call.call(void 0,e),t=t._next;--yn}()}finally{yn=0,function(){var e,t,n=hn,r=1/0;for(;n;)n._call?(r>n._time&&(r=n._time),e=n,n=n._next):(t=n._next,n._next=null,n=e?e._next=t:hn=t);mn=e,Pn(r)}(),xn=0}}function An(){var e=Sn.now(),t=e-wn;t>1e3&&(En-=t,wn=e)}function Pn(e){yn||(vn&&(vn=clearTimeout(vn)),e-xn>24?(e<1/0&&(vn=setTimeout(On,e-Sn.now()-En)),bn&&(bn=clearInterval(bn))):(bn||(wn=Sn.now(),bn=setInterval(An,1e3)),yn=1,_n(On)))}function Rn(e,t,n){var r=new Nn;return t=null==t?0:+t,r.restart(n=>{r.stop(),e(n+t)},t,n),r}Nn.prototype=Mn.prototype={constructor:Nn,restart:function(e,t,n){if("function"!=typeof e)throw new TypeError("callback is not a function");n=(null==n?Cn():+n)+(null==t?0:+t),this._next||mn===this||(mn?mn._next=this:hn=this,mn=this),this._call=e,this._time=n,Pn()},stop:function(){this._call&&(this._call=null,this._time=1/0,Pn())}};var Tn=H("start","end","cancel","interrupt"),Dn=[];function $n(e,t,n,r,o,i){var a=e.__transition;if(a){if(n in a)return}else e.__transition={};!function(e,t,n){var r,o=e.__transition;function i(e){n.state=1,n.timer.restart(a,n.delay,n.time),n.delay<=e&&a(e-n.delay)}function a(i){var c,u,d,f;if(1!==n.state)return l();for(c in o)if((f=o[c]).name===n.name){if(3===f.state)return Rn(a);4===f.state?(f.state=6,f.timer.stop(),f.on.call("interrupt",e,e.__data__,f.index,f.group),delete o[c]):+c<t&&(f.state=6,f.timer.stop(),f.on.call("cancel",e,e.__data__,f.index,f.group),delete o[c])}if(Rn(function(){3===n.state&&(n.state=4,n.timer.restart(s,n.delay,n.time),s(i))}),n.state=2,n.on.call("start",e,e.__data__,n.index,n.group),2===n.state){for(n.state=3,r=new Array(d=n.tween.length),c=0,u=-1;c<d;++c)(f=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(r[++u]=f);r.length=u+1}}function s(t){for(var o=t<n.duration?n.ease.call(null,t/n.duration):(n.timer.restart(l),n.state=5,1),i=-1,a=r.length;++i<a;)r[i].call(e,o);5===n.state&&(n.on.call("end",e,e.__data__,n.index,n.group),l())}function l(){for(var r in n.state=6,n.timer.stop(),delete o[t],o)return;delete e.__transition}o[t]=n,n.timer=Mn(i,0,n.time)}(e,n,{name:t,index:r,group:o,on:Tn,tween:Dn,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:0})}function In(e,t){var n=Ln(e,t);if(n.state>0)throw new Error("too late; already scheduled");return n}function zn(e,t){var n=Ln(e,t);if(n.state>3)throw new Error("too late; already running");return n}function Ln(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Bn(e,t){var n,r,o,i=e.__transition,a=!0;if(i){for(o in t=null==t?null:t+"",i)(n=i[o]).name===t?(r=n.state>2&&n.state<5,n.state=6,n.timer.stop(),n.on.call(r?"interrupt":"cancel",e,e.__data__,n.index,n.group),delete i[o]):a=!1;a&&delete e.__transition}}function Fn(e,t){var n,r;return function(){var o=zn(this,e),i=o.tween;if(i!==n)for(var a=0,s=(r=n=i).length;a<s;++a)if(r[a].name===t){(r=r.slice()).splice(a,1);break}o.tween=r}}function Hn(e,t,n){var r,o;if("function"!=typeof n)throw new Error;return function(){var i=zn(this,e),a=i.tween;if(a!==r){o=(r=a).slice();for(var s={name:t,value:n},l=0,c=o.length;l<c;++l)if(o[l].name===t){o[l]=s;break}l===c&&o.push(s)}i.tween=o}}function Wn(e,t,n){var r=e._id;return e.each(function(){var e=zn(this,r);(e.value||(e.value={}))[t]=n.apply(this,arguments)}),function(e){return Ln(e,r).value[t]}}function Vn(e,t){var n;return("number"==typeof t?tn:t instanceof $t?en:(n=$t(t))?(t=n,en):on)(e,t)}function Yn(e){return function(){this.removeAttribute(e)}}function jn(e){return function(){this.removeAttributeNS(e.space,e.local)}}function Xn(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttribute(e);return a===i?null:a===r?o:o=t(r=a,n)}}function Kn(e,t,n){var r,o,i=n+"";return function(){var a=this.getAttributeNS(e.space,e.local);return a===i?null:a===r?o:o=t(r=a,n)}}function Un(e,t,n){var r,o,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttribute(e))===(s=l+"")?null:a===r&&s===o?i:(o=s,i=t(r=a,l));this.removeAttribute(e)}}function qn(e,t,n){var r,o,i;return function(){var a,s,l=n(this);if(null!=l)return(a=this.getAttributeNS(e.space,e.local))===(s=l+"")?null:a===r&&s===o?i:(o=s,i=t(r=a,l));this.removeAttributeNS(e.space,e.local)}}function Zn(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}(e,o)),n}return o._value=t,o}function Gn(e,t){var n,r;function o(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&function(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}(e,o)),n}return o._value=t,o}function Qn(e,t){return function(){In(this,e).delay=+t.apply(this,arguments)}}function Jn(e,t){return t=+t,function(){In(this,e).delay=t}}function er(e,t){return function(){zn(this,e).duration=+t.apply(this,arguments)}}function tr(e,t){return t=+t,function(){zn(this,e).duration=t}}var nr=nt.prototype.constructor;function rr(e){return function(){this.style.removeProperty(e)}}var or=0;function ir(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function ar(){return++or}var sr=nt.prototype;ir.prototype={constructor:ir,select:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=Q(e));for(var r=this._groups,o=r.length,i=new Array(o),a=0;a<o;++a)for(var s,l,c=r[a],u=c.length,d=i[a]=new Array(u),f=0;f<u;++f)(s=c[f])&&(l=e.call(s,s.__data__,f,c))&&("__data__"in s&&(l.__data__=s.__data__),d[f]=l,$n(d[f],t,n,f,d,Ln(s,n)));return new ir(i,this._parents,t,n)},selectAll:function(e){var t=this._name,n=this._id;"function"!=typeof e&&(e=ee(e));for(var r=this._groups,o=r.length,i=[],a=[],s=0;s<o;++s)for(var l,c=r[s],u=c.length,d=0;d<u;++d)if(l=c[d]){for(var f,p=e.call(l,l.__data__,d,c),h=Ln(l,n),m=0,g=p.length;m<g;++m)(f=p[m])&&$n(f,t,n,m,p,h);i.push(p),a.push(l)}return new ir(i,a,t,n)},selectChild:sr.selectChild,selectChildren:sr.selectChildren,filter:function(e){"function"!=typeof e&&(e=ne(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i,a=t[o],s=a.length,l=r[o]=[],c=0;c<s;++c)(i=a[c])&&e.call(i,i.__data__,c,a)&&l.push(i);return new ir(r,this._parents,this._name,this._id)},merge:function(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,o=n.length,i=Math.min(r,o),a=new Array(r),s=0;s<i;++s)for(var l,c=t[s],u=n[s],d=c.length,f=a[s]=new Array(d),p=0;p<d;++p)(l=c[p]||u[p])&&(f[p]=l);for(;s<r;++s)a[s]=t[s];return new ir(a,this._parents,this._name,this._id)},selection:function(){return new nr(this._groups,this._parents)},transition:function(){for(var e=this._name,t=this._id,n=ar(),r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],l=s.length,c=0;c<l;++c)if(a=s[c]){var u=Ln(a,t);$n(a,e,n,c,s,{time:u.time+u.delay+u.duration,delay:0,duration:u.duration,ease:u.ease})}return new ir(r,this._parents,e,n)},call:sr.call,nodes:sr.nodes,node:sr.node,size:sr.size,empty:sr.empty,each:sr.each,on:function(e,t){var n=this._id;return arguments.length<2?Ln(this.node(),n).on.on(e):this.each(function(e,t,n){var r,o,i=function(e){return(e+"").trim().split(/^|\s+/).every(function(e){var t=e.indexOf(".");return t>=0&&(e=e.slice(0,t)),!e||"start"===e})}(t)?In:zn;return function(){var a=i(this,e),s=a.on;s!==r&&(o=(r=s).copy()).on(t,n),a.on=o}}(n,e,t))},attr:function(e,t){var n=K(e),r="transform"===n?fn:Vn;return this.attrTween(e,"function"==typeof t?(n.local?qn:Un)(n,r,Wn(this,"attr."+e,t)):null==t?(n.local?jn:Yn)(n):(n.local?Kn:Xn)(n,r,t))},attrTween:function(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(null==t)return this.tween(n,null);if("function"!=typeof t)throw new Error;var r=K(e);return this.tween(n,(r.local?Zn:Gn)(r,t))},style:function(e,t,n){var r="transform"==(e+="")?dn:Vn;return null==t?this.styleTween(e,function(e,t){var n,r,o;return function(){var i=Ce(this,e),a=(this.style.removeProperty(e),Ce(this,e));return i===a?null:i===n&&a===r?o:o=t(n=i,r=a)}}(e,r)).on("end.style."+e,rr(e)):"function"==typeof t?this.styleTween(e,function(e,t,n){var r,o,i;return function(){var a=Ce(this,e),s=n(this),l=s+"";return null==s&&(this.style.removeProperty(e),l=s=Ce(this,e)),a===l?null:a===r&&l===o?i:(o=l,i=t(r=a,s))}}(e,r,Wn(this,"style."+e,t))).each(function(e,t){var n,r,o,i,a="style."+t,s="end."+a;return function(){var l=zn(this,e),c=l.on,u=null==l.value[a]?i||(i=rr(t)):void 0;c===n&&o===u||(r=(n=c).copy()).on(s,o=u),l.on=r}}(this._id,e)):this.styleTween(e,function(e,t,n){var r,o,i=n+"";return function(){var a=Ce(this,e);return a===i?null:a===r?o:o=t(r=a,n)}}(e,r,t),n).on("end.style."+e,null)},styleTween:function(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(null==t)return this.tween(r,null);if("function"!=typeof t)throw new Error;return this.tween(r,function(e,t,n){var r,o;function i(){var i=t.apply(this,arguments);return i!==o&&(r=(o=i)&&function(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}(e,i,n)),r}return i._value=t,i}(e,t,null==n?"":n))},text:function(e){return this.tween("text","function"==typeof e?function(e){return function(){var t=e(this);this.textContent=null==t?"":t}}(Wn(this,"text",e)):function(e){return function(){this.textContent=e}}(null==e?"":e+""))},textTween:function(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(null==e)return this.tween(t,null);if("function"!=typeof e)throw new Error;return this.tween(t,function(e){var t,n;function r(){var r=e.apply(this,arguments);return r!==n&&(t=(n=r)&&function(e){return function(t){this.textContent=e.call(this,t)}}(r)),t}return r._value=e,r}(e))},remove:function(){return this.on("end.remove",function(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}(this._id))},tween:function(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r,o=Ln(this.node(),n).tween,i=0,a=o.length;i<a;++i)if((r=o[i]).name===e)return r.value;return null}return this.each((null==t?Fn:Hn)(n,e,t))},delay:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?Qn:Jn)(t,e)):Ln(this.node(),t).delay},duration:function(e){var t=this._id;return arguments.length?this.each(("function"==typeof e?er:tr)(t,e)):Ln(this.node(),t).duration},ease:function(e){var t=this._id;return arguments.length?this.each(function(e,t){if("function"!=typeof t)throw new Error;return function(){zn(this,e).ease=t}}(t,e)):Ln(this.node(),t).ease},easeVarying:function(e){if("function"!=typeof e)throw new Error;return this.each(function(e,t){return function(){var n=t.apply(this,arguments);if("function"!=typeof n)throw new Error;zn(this,e).ease=n}}(this._id,e))},end:function(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,a){var s={value:a},l={value:function(){0===--o&&i()}};n.each(function(){var n=zn(this,r),o=n.on;o!==e&&((t=(e=o).copy())._.cancel.push(s),t._.interrupt.push(s),t._.end.push(l)),n.on=t}),0===o&&i()})},[Symbol.iterator]:sr[Symbol.iterator]};var lr={time:null,delay:0,duration:250,ease:function(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}};function cr(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}nt.prototype.interrupt=function(e){return this.each(function(){Bn(this,e)})},nt.prototype.transition=function(e){var t,n;e instanceof ir?(t=e._id,e=e._name):(t=ar(),(n=lr).time=Cn(),e=null==e?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var a,s=r[i],l=s.length,c=0;c<l;++c)(a=s[c])&&$n(a,e,t,c,s,n||cr(a,t));return new ir(r,this._parents,e,t)};var ur=e=>()=>e;function dr(e,{sourceEvent:t,target:n,transform:r,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:o}})}function fr(e,t,n){this.k=e,this.x=t,this.y=n}fr.prototype={constructor:fr,scale:function(e){return 1===e?this:new fr(this.k*e,this.x,this.y)},translate:function(e,t){return 0===e&0===t?this:new fr(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 pr=new fr(1,0,0);function hr(e){e.stopImmediatePropagation()}function mr(e){e.preventDefault(),e.stopImmediatePropagation()}function gr(e){return!(e.ctrlKey&&"wheel"!==e.type||e.button)}function yr(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e).hasAttribute("viewBox")?[[(e=e.viewBox.baseVal).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 vr(){return this.__zoom||pr}function br(e){return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function wr(){return navigator.maxTouchPoints||"ontouchstart"in this}function xr(e,t,n){var r=e.invertX(t[0][0])-n[0][0],o=e.invertX(t[1][0])-n[1][0],i=e.invertY(t[0][1])-n[0][1],a=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),a>i?(i+a)/2:Math.min(0,i)||Math.max(0,a))}fr.prototype;const Er=n(null),Sr=Er.Provider,_r=()=>"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.",Cr=e=>`Node type "${e}" not found. Using fallback type "default".`,kr=()=>"The React Flow parent container needs a width and a height to render the graph.",Nr=()=>"Only child nodes can use a parent extent.",Mr=()=>"Can't create edge. An edge needs a source and a target.",Or=e=>`Marker type "${e}" doesn't exist.`,Ar=(e,t)=>`Couldn't create edge for ${e?"target":"source"} handle id: "${e?t.targetHandle:t.sourceHandle}", edge id: ${t.id}.`,Pr=()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",Rr=e=>`Edge type "${e}" not found. Using fallback type "default".`,Tr=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.`,Dr=(()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001")();function $r(e,t){const n=c(Er);if(null===n)throw new Error(Dr);return z(n,e,t)}const Ir=()=>{const e=c(Er);if(null===e)throw new Error(Dr);return o(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe,destroy:e.destroy}),[e])},zr=e=>e.userSelectionActive?"none":"all";function Lr({position:e,children:n,className:r,style:o,...i}){const a=$r(zr),s=`${e}`.split("-");return t.createElement("div",{className:v(["react-flow__panel",r,...s]),style:{...o,pointerEvents:a},...i},n)}function Br({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:t.createElement(Lr,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://reactflow.dev/pro"},t.createElement("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution"},"React Flow"))}var Fr=r(({x:e,y:n,label:r,labelStyle:o={},labelShowBg:i=!0,labelBgStyle:s={},labelBgPadding:c=[2,4],labelBgBorderRadius:d=2,children:f,className:p,...h})=>{const m=l(null),[g,y]=u({x:0,y:0,width:0,height:0}),b=v(["react-flow__edge-textwrapper",p]);return a(()=>{if(m.current){const e=m.current.getBBox();y({x:e.x,y:e.y,width:e.width,height:e.height})}},[r]),void 0!==r&&r?t.createElement("g",{transform:`translate(${e-g.width/2} ${n-g.height/2})`,className:b,visibility:g.width?"visible":"hidden",...h},i&&t.createElement("rect",{width:g.width+2*c[0],x:-c[0],y:-c[1],height:g.height+2*c[1],className:"react-flow__edge-textbg",style:s,rx:d,ry:d}),t.createElement("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:m,style:o},r),f):null});const Hr=e=>({width:e.offsetWidth,height:e.offsetHeight}),Wr=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),Vr=(e={x:0,y:0},t)=>({x:Wr(e.x,t[0][0],t[1][0]),y:Wr(e.y,t[0][1],t[1][1])}),Yr=(e,t,n)=>e<t?Wr(Math.abs(e-t),1,50)/50:e>n?-Wr(Math.abs(e-n),1,50)/50:0,jr=(e,t)=>[20*Yr(e.x,35,t.width-35),20*Yr(e.y,35,t.height-35)],Xr=e=>e.getRootNode?.()||window?.document,Kr=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Ur=e=>({...e.positionAbsolute||{x:0,y:0},width:e.width||0,height:e.height||0}),qr=(e,t)=>{const n=Math.max(0,Math.min(e.x+e.width,t.x+t.width)-Math.max(e.x,t.x)),r=Math.max(0,Math.min(e.y+e.height,t.y+t.height)-Math.max(e.y,t.y));return Math.ceil(n*r)},Zr=e=>!isNaN(e)&&isFinite(e),Gr=Symbol.for("internals"),Qr=["Enter"," ","Escape"],Jr=(e,t)=>{"development"===process.env.NODE_ENV&&console.warn(`[React Flow]: ${t} Help: https://reactflow.dev/error#${e}`)};function eo(e){const t=(e=>"nativeEvent"in e)(e)?e.nativeEvent:e,n=t.composedPath?.()?.[0]||e.target;return["INPUT","SELECT","TEXTAREA"].includes(n?.nodeName)||n?.hasAttribute("contenteditable")||!!n?.closest(".nokey")}const to=e=>"clientX"in e,no=(e,t)=>{const n=to(e),r=n?e.clientX:e.touches?.[0].clientX,o=n?e.clientY:e.touches?.[0].clientY;return{x:r-(t?.left??0),y:o-(t?.top??0)}},ro=()=>"undefined"!=typeof navigator&&navigator?.userAgent?.indexOf("Mac")>=0,oo=({id:e,path:n,labelX:r,labelY:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h=20})=>t.createElement(t.Fragment,null,t.createElement("path",{id:e,style:d,d:n,fill:"none",className:"react-flow__edge-path",markerEnd:f,markerStart:p}),h&&t.createElement("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}),i&&Zr(r)&&Zr(o)?t.createElement(Fr,{x:r,y:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u}):null);function io(e,t,n){return void 0===n?n:r=>{const o=t().edges.find(t=>t.id===e);o&&n(r,{...o})}}function ao({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,a=Math.abs(r-t)/2;return[i,r<t?r+a:r-a,o,a]}function so({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:a,targetControlY:s}){const l=.125*e+.375*o+.375*a+.125*n,c=.125*t+.375*i+.375*s+.125*r;return[l,c,Math.abs(l-e),Math.abs(c-t)]}var lo,co,uo,fo,po,ho;function mo({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===ho.Left||e===ho.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function go({sourceX:e,sourceY:t,sourcePosition:n=ho.Bottom,targetX:r,targetY:o,targetPosition:i=ho.Top}){const[a,s]=mo({pos:n,x1:e,y1:t,x2:r,y2:o}),[l,c]=mo({pos:i,x1:r,y1:o,x2:e,y2:t}),[u,d,f,p]=so({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:a,sourceControlY:s,targetControlX:l,targetControlY:c});return[`M${e},${t} C${a},${s} ${l},${c} ${r},${o}`,u,d,f,p]}oo.displayName="BaseEdge",function(e){e.Strict="strict",e.Loose="loose"}(lo||(lo={})),function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"}(co||(co={})),function(e){e.Partial="partial",e.Full="full"}(uo||(uo={})),function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"}(fo||(fo={})),function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"}(po||(po={})),function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"}(ho||(ho={}));const yo=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,sourcePosition:i=ho.Bottom,targetPosition:a=ho.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})=>{const[y,v,b]=go({sourceX:e,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:a});return t.createElement(oo,{path:y,labelX:v,labelY:b,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:g})});yo.displayName="SimpleBezierEdge";const vo={[ho.Left]:{x:-1,y:0},[ho.Right]:{x:1,y:0},[ho.Top]:{x:0,y:-1},[ho.Bottom]:{x:0,y:1}},bo=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function wo({source:e,sourcePosition:t=ho.Bottom,target:n,targetPosition:r=ho.Top,center:o,offset:i}){const a=vo[t],s=vo[r],l={x:e.x+a.x*i,y:e.y+a.y*i},c={x:n.x+s.x*i,y:n.y+s.y*i},u=(({source:e,sourcePosition:t=ho.Bottom,target:n})=>t===ho.Left||t===ho.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})({source:l,sourcePosition:t,target:c}),d=0!==u.x?"x":"y",f=u[d];let p,h,m=[];const g={x:0,y:0},y={x:0,y:0},[v,b,w,x]=ao({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(a[d]*s[d]===-1){p=o.x??v,h=o.y??b;const e=[{x:p,y:l.y},{x:p,y:c.y}],t=[{x:l.x,y:h},{x:c.x,y:h}];m=a[d]===f?"x"===d?e:t:"x"===d?t:e}else{const o=[{x:l.x,y:c.y}],u=[{x:c.x,y:l.y}];if(m="x"===d?a.x===f?u:o:a.y===f?o:u,t===r){const t=Math.abs(e[d]-n[d]);if(t<=i){const r=Math.min(i-1,i-t);a[d]===f?g[d]=(l[d]>e[d]?-1:1)*r:y[d]=(c[d]>n[d]?-1:1)*r}}if(t!==r){const e="x"===d?"y":"x",t=a[d]===s[e],n=l[e]>c[e],r=l[e]<c[e];(1===a[d]&&(!t&&n||t&&r)||1!==a[d]&&(!t&&r||t&&n))&&(m="x"===d?o:u)}const v={x:l.x+g.x,y:l.y+g.y},b={x:c.x+y.x,y:c.y+y.y};Math.max(Math.abs(v.x-m[0].x),Math.abs(b.x-m[0].x))>=Math.max(Math.abs(v.y-m[0].y),Math.abs(b.y-m[0].y))?(p=(v.x+b.x)/2,h=m[0].y):(p=m[0].x,h=(v.y+b.y)/2)}return[[e,{x:l.x+g.x,y:l.y+g.y},...m,{x:c.x+y.x,y:c.y+y.y},n],p,h,w,x]}function xo({sourceX:e,sourceY:t,sourcePosition:n=ho.Bottom,targetX:r,targetY:o,targetPosition:i=ho.Top,borderRadius:a=5,centerX:s,centerY:l,offset:c=20}){const[u,d,f,p,h]=wo({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:s,y:l},offset:c}),m=u.reduce((e,t,n)=>{let r="";return r=n>0&&n<u.length-1?function(e,t,n,r){const o=Math.min(bo(e,t)/2,bo(t,n)/2,r),{x:i,y:a}=t;if(e.x===i&&i===n.x||e.y===a&&a===n.y)return`L${i} ${a}`;if(e.y===a)return`L ${i+o*(e.x<n.x?-1:1)},${a}Q ${i},${a} ${i},${a+o*(e.y<n.y?1:-1)}`;const s=e.x<n.x?1:-1;return`L ${i},${a+o*(e.y<n.y?-1:1)}Q ${i},${a} ${i+o*s},${a}`}(u[n-1],t,u[n+1],a):`${0===n?"M":"L"}${t.x} ${t.y}`,e+=r},"");return[m,d,f,p,h]}const Eo=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,sourcePosition:f=ho.Bottom,targetPosition:p=ho.Top,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=xo({sourceX:e,sourceY:n,sourcePosition:f,targetX:r,targetY:o,targetPosition:p,borderRadius:g?.borderRadius,offset:g?.offset});return t.createElement(oo,{path:v,labelX:b,labelY:w,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:h,markerStart:m,interactionWidth:y})});Eo.displayName="SmoothStepEdge";const So=r(e=>t.createElement(Eo,{...e,pathOptions:o(()=>({borderRadius:0,offset:e.pathOptions?.offset}),[e.pathOptions?.offset])}));So.displayName="StepEdge";const _o=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})=>{const[m,g,y]=function({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,a,s]=ao({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,a,s]}({sourceX:e,sourceY:n,targetX:r,targetY:o});return t.createElement(oo,{path:m,labelX:g,labelY:y,label:i,labelStyle:a,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:u,style:d,markerEnd:f,markerStart:p,interactionWidth:h})});function Co(e,t){return e>=0?.5*e:25*t*Math.sqrt(-e)}function ko({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case ho.Left:return[t-Co(t-r,i),n];case ho.Right:return[t+Co(r-t,i),n];case ho.Top:return[t,n-Co(n-o,i)];case ho.Bottom:return[t,n+Co(o-n,i)]}}function No({sourceX:e,sourceY:t,sourcePosition:n=ho.Bottom,targetX:r,targetY:o,targetPosition:i=ho.Top,curvature:a=.25}){const[s,l]=ko({pos:n,x1:e,y1:t,x2:r,y2:o,c:a}),[c,u]=ko({pos:i,x1:r,y1:o,x2:e,y2:t,c:a}),[d,f,p,h]=so({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:c,targetControlY:u});return[`M${e},${t} C${s},${l} ${c},${u} ${r},${o}`,d,f,p,h]}_o.displayName="StraightEdge";const Mo=r(({sourceX:e,sourceY:n,targetX:r,targetY:o,sourcePosition:i=ho.Bottom,targetPosition:a=ho.Top,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,pathOptions:g,interactionWidth:y})=>{const[v,b,w]=No({sourceX:e,sourceY:n,sourcePosition:i,targetX:r,targetY:o,targetPosition:a,curvature:g?.curvature});return t.createElement(oo,{path:v,labelX:b,labelY:w,label:s,labelStyle:l,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:f,style:p,markerEnd:h,markerStart:m,interactionWidth:y})});Mo.displayName="BezierEdge";const Oo=n(null),Ao=Oo.Provider;Oo.Consumer;const Po=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`reactflow__edge-${e}${t||""}-${n}${r||""}`,Ro=(e,t)=>{if(void 0===e)return"";if("string"==typeof e)return e;return`${t?`${t}__`:""}${Object.keys(e).sort().map(t=>`${t}=${e[t]}`).join("&")}`},To=(e,t)=>{if(!e.source||!e.target)return Jr("006",Mr()),t;let n;var r;return n="id"in(r=e)&&"source"in r&&"target"in r?{...e}:{...e,id:Po(e)},((e,t)=>t.some(t=>!(t.source!==e.source||t.target!==e.target||t.sourceHandle!==e.sourceHandle&&(t.sourceHandle||e.sourceHandle)||t.targetHandle!==e.targetHandle&&(t.targetHandle||e.targetHandle))))(n,t)?t:t.concat(n)},Do=({x:e,y:t},[n,r,o],i,[a,s])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?{x:a*Math.round(l.x/a),y:s*Math.round(l.y/s)}:l},$o=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r}),Io=(e,t=[0,0])=>{if(!e)return{x:0,y:0,positionAbsolute:{x:0,y:0}};const n=(e.width??0)*t[0],r=(e.height??0)*t[1],o={x:e.position.x-n,y:e.position.y-r};return{...o,positionAbsolute:e.positionAbsolute?{x:e.positionAbsolute.x-n,y:e.positionAbsolute.y-r}:o}},zo=(e,t=[0,0])=>{if(0===e.length)return{x:0,y:0,width:0,height:0};const n=e.reduce((e,n)=>{const{x:r,y:o}=Io(n,t).positionAbsolute;return i=e,a=Kr({x:r,y:o,width:n.width||0,height:n.height||0}),{x:Math.min(i.x,a.x),y:Math.min(i.y,a.y),x2:Math.max(i.x2,a.x2),y2:Math.max(i.y2,a.y2)};var i,a},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return(({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}))(n)},Lo=(e,t,[n,r,o]=[0,0,1],i=!1,a=!1,s=[0,0])=>{const l={x:(t.x-n)/o,y:(t.y-r)/o,width:t.width/o,height:t.height/o},c=[];return e.forEach(e=>{const{width:t,height:n,selectable:r=!0,hidden:o=!1}=e;if(a&&!r||o)return!1;const{positionAbsolute:u}=Io(e,s),d={x:u.x,y:u.y,width:t||0,height:n||0},f=qr(l,d);(void 0===t||void 0===n||null===t||null===n||i&&f>0||f>=(t||0)*(n||0)||e.dragging)&&c.push(e)}),c},Bo=(e,t)=>{const n=e.map(e=>e.id);return t.filter(e=>n.includes(e.source)||n.includes(e.target))},Fo=(e,t,n,r,o,i=.1)=>{const a=t/(e.width*(1+i)),s=n/(e.height*(1+i)),l=Math.min(a,s),c=Wr(l,r,o);return{x:t/2-(e.x+e.width/2)*c,y:n/2-(e.y+e.height/2)*c,zoom:c}},Ho=(e,t=0)=>e.transition().duration(t);function Wo(e,t,n,r){return(t[n]||[]).reduce((t,o)=>(`${e.id}-${o.id}-${n}`!==r&&t.push({id:o.id||null,type:n,nodeId:e.id,x:(e.positionAbsolute?.x??0)+o.x+o.width/2,y:(e.positionAbsolute?.y??0)+o.y+o.height/2}),t),[])}const Vo={source:null,target:null,sourceHandle:null,targetHandle:null},Yo=()=>({handleDomNode:null,isValid:!1,connection:Vo,endHandle:null});function jo(e,t,n,r,o,i,a){const s="target"===o,l=a.querySelector(`.react-flow__handle[data-id="${e?.nodeId}-${e?.id}-${e?.type}"]`),c={...Yo(),handleDomNode:l};if(l){const e=Xo(void 0,l),o=l.getAttribute("data-nodeid"),a=l.getAttribute("data-handleid"),u=l.classList.contains("connectable"),d=l.classList.contains("connectableend"),f={source:s?o:n,sourceHandle:s?a:r,target:s?n:o,targetHandle:s?r:a};c.connection=f;u&&d&&(t===lo.Strict?s&&"source"===e||!s&&"target"===e:o!==n||a!==r)&&(c.endHandle={nodeId:o,handleId:a,type:e},c.isValid=i(f))}return c}function Xo(e,t){return e||(t?.classList.contains("target")?"target":t?.classList.contains("source")?"source":null)}function Ko(e){e?.classList.remove("valid","connecting","react-flow__handle-valid","react-flow__handle-connecting")}function Uo(e,t){let n=null;return t?n="valid":e&&!t&&(n="invalid"),n}function qo({event:e,handleId:t,nodeId:n,onConnect:r,isTarget:o,getState:i,setState:a,isValidConnection:s,edgeUpdaterType:l,onReconnectEnd:c}){const u=Xr(e.target),{connectionMode:d,domNode:f,autoPanOnConnect:p,connectionRadius:h,onConnectStart:m,panBy:g,getNodes:y,cancelConnection:v}=i();let b,w=0;const{x:x,y:E}=no(e),S=u?.elementFromPoint(x,E),_=Xo(l,S),C=f?.getBoundingClientRect();if(!C||!_)return;let k,N=no(e,C),M=!1,O=null,A=!1,P=null;const R=function({nodes:e,nodeId:t,handleId:n,handleType:r}){return e.reduce((e,o)=>{if(o[Gr]){const{handleBounds:i}=o[Gr];let a=[],s=[];i&&(a=Wo(o,i,"source",`${t}-${n}-${r}`),s=Wo(o,i,"target",`${t}-${n}-${r}`)),e.push(...a,...s)}return e},[])}({nodes:y(),nodeId:n,handleId:t,handleType:_}),T=()=>{if(!p)return;const[e,t]=jr(N,C);g({x:e,y:t}),w=requestAnimationFrame(T)};function D(e){const{transform:r}=i();N=no(e,C);const{handle:l,validHandleResult:c}=function(e,t,n,r,o,i){const{x:a,y:s}=no(e),l=t.elementsFromPoint(a,s).find(e=>e.classList.contains("react-flow__handle"));if(l){const e=l.getAttribute("data-nodeid");if(e){const t=Xo(void 0,l),r=l.getAttribute("data-handleid"),a=i({nodeId:e,id:r,type:t});if(a){const i=o.find(n=>n.nodeId===e&&n.type===t&&n.id===r);return{handle:{id:r,type:t,nodeId:e,x:i?.x||n.x,y:i?.y||n.y},validHandleResult:a}}}}let c=[],u=1/0;if(o.forEach(e=>{const t=Math.sqrt((e.x-n.x)**2+(e.y-n.y)**2);if(t<=r){const n=i(e);t<=u&&(t<u?c=[{handle:e,validHandleResult:n}]:t===u&&c.push({handle:e,validHandleResult:n}),u=t)}}),!c.length)return{handle:null,validHandleResult:Yo()};if(1===c.length)return c[0];const d=c.some(({validHandleResult:e})=>e.isValid),f=c.some(({handle:e})=>"target"===e.type);return c.find(({handle:e,validHandleResult:t})=>f?"target"===e.type:!d||t.isValid)||c[0]}(e,u,Do(N,r,!1,[1,1]),h,R,e=>jo(e,d,n,t,o?"target":"source",s,u));if(b=l,M||(T(),M=!0),P=c.handleDomNode,O=c.connection,A=c.isValid,a({connectionPosition:b&&A?$o({x:b.x,y:b.y},r):N,connectionStatus:Uo(!!b,A),connectionEndHandle:c.endHandle}),!b&&!A&&!P)return Ko(k);O.source!==O.target&&P&&(Ko(k),k=P,P.classList.add("connecting","react-flow__handle-connecting"),P.classList.toggle("valid",A),P.classList.toggle("react-flow__handle-valid",A))}function $(e){(b||P)&&O&&A&&r?.(O),i().onConnectEnd?.(e),l&&c?.(e),Ko(k),v(),cancelAnimationFrame(w),M=!1,A=!1,O=null,P=null,u.removeEventListener("mousemove",D),u.removeEventListener("mouseup",$),u.removeEventListener("touchmove",D),u.removeEventListener("touchend",$)}a({connectionPosition:N,connectionStatus:null,connectionNodeId:n,connectionHandleId:t,connectionHandleType:_,connectionStartHandle:{nodeId:n,handleId:t,type:_},connectionEndHandle:null}),m?.(e,{nodeId:n,handleId:t,handleType:_}),u.addEventListener("mousemove",D),u.addEventListener("mouseup",$),u.addEventListener("touchmove",D),u.addEventListener("touchend",$)}const Zo=()=>!0,Go=e=>({connectionStartHandle:e.connectionStartHandle,connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName}),Qo=i(({type:e="source",position:n=ho.Top,isValidConnection:r,isConnectable:o=!0,isConnectableStart:i=!0,isConnectableEnd:a=!0,id:s,onConnect:l,children:u,className:d,onMouseDown:f,onTouchStart:p,...h},m)=>{const g=s||null,y="target"===e,b=Ir(),w=c(Oo),{connectOnClick:x,noPanClassName:E}=$r(Go,B),{connecting:S,clickConnecting:_}=$r(((e,t,n)=>r=>{const{connectionStartHandle:o,connectionEndHandle:i,connectionClickStartHandle:a}=r;return{connecting:o?.nodeId===e&&o?.handleId===t&&o?.type===n||i?.nodeId===e&&i?.handleId===t&&i?.type===n,clickConnecting:a?.nodeId===e&&a?.handleId===t&&a?.type===n}})(w,g,e),B);w||b.getState().onError?.("010",Pr());const C=e=>{const{defaultEdgeOptions:t,onConnect:n,hasDefaultEdges:r}=b.getState(),o={...t,...e};if(r){const{edges:e,setEdges:t}=b.getState();t(To(o,e))}n?.(o),l?.(o)},k=e=>{if(!w)return;const t=to(e);i&&(t&&0===e.button||!t)&&qo({event:e,handleId:g,nodeId:w,onConnect:C,isTarget:y,getState:b.getState,setState:b.setState,isValidConnection:r||b.getState().isValidConnection||Zo}),t?f?.(e):p?.(e)};return t.createElement("div",{"data-handleid":g,"data-nodeid":w,"data-handlepos":n,"data-id":`${w}-${g}-${e}`,className:v(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",E,d,{source:!y,target:y,connectable:o,connectablestart:i,connectableend:a,connecting:_,connectionindicator:o&&(i&&!S||a&&S)}]),onMouseDown:k,onTouchStart:k,onClick:x?t=>{const{onClickConnectStart:n,onClickConnectEnd:o,connectionClickStartHandle:a,connectionMode:s,isValidConnection:l}=b.getState();if(!w||!a&&!i)return;if(!a)return n?.(t,{nodeId:w,handleId:g,handleType:e}),void b.setState({connectionClickStartHandle:{nodeId:w,type:e,handleId:g}});const c=Xr(t.target),u=r||l||Zo,{connection:d,isValid:f}=jo({nodeId:w,id:g,type:e},s,a.nodeId,a.handleId||null,a.type,u,c);f&&C(d),o?.(t),b.setState({connectionClickStartHandle:null})}:void 0,ref:m,...h},u)});Qo.displayName="Handle";var Jo=r(Qo);const ei=({data:e,isConnectable:n,targetPosition:r=ho.Top,sourcePosition:o=ho.Bottom})=>t.createElement(t.Fragment,null,t.createElement(Jo,{type:"target",position:r,isConnectable:n}),e?.label,t.createElement(Jo,{type:"source",position:o,isConnectable:n}));ei.displayName="DefaultNode";var ti=r(ei);const ni=({data:e,isConnectable:n,sourcePosition:r=ho.Bottom})=>t.createElement(t.Fragment,null,e?.label,t.createElement(Jo,{type:"source",position:r,isConnectable:n}));ni.displayName="InputNode";var ri=r(ni);const oi=({data:e,isConnectable:n,targetPosition:r=ho.Top})=>t.createElement(t.Fragment,null,t.createElement(Jo,{type:"target",position:r,isConnectable:n}),e?.label);oi.displayName="OutputNode";var ii=r(oi);const ai=()=>null;ai.displayName="GroupNode";const si=e=>({selectedNodes:e.getNodes().filter(e=>e.selected),selectedEdges:e.edges.filter(e=>e.selected).map(e=>({...e}))}),li=e=>e.id;function ci(e,t){return B(e.selectedNodes.map(li),t.selectedNodes.map(li))&&B(e.selectedEdges.map(li),t.selectedEdges.map(li))}const ui=r(({onSelectionChange:e})=>{const t=Ir(),{selectedNodes:n,selectedEdges:r}=$r(si,ci);return a(()=>{const o={nodes:n,edges:r};e?.(o),t.getState().onSelectionChange.forEach(e=>e(o))},[n,r,e]),null});ui.displayName="SelectionListener";const di=e=>!!e.onSelectionChange;function fi({onSelectionChange:e}){const n=$r(di);return e||n?t.createElement(ui,{onSelectionChange:e}):null}const pi=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset});function hi(e,t){a(()=>{void 0!==e&&t(e)},[e])}function mi(e,t,n){a(()=>{void 0!==t&&n({[e]:t})},[t])}const gi=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:o,onConnectStart:i,onConnectEnd:s,onClickConnectStart:l,onClickConnectEnd:c,nodesDraggable:u,nodesConnectable:d,nodesFocusable:f,edgesFocusable:p,edgesUpdatable:h,elevateNodesOnSelect:m,minZoom:g,maxZoom:y,nodeExtent:v,onNodesChange:b,onEdgesChange:w,elementsSelectable:x,connectionMode:E,snapGrid:S,snapToGrid:_,translateExtent:C,connectOnClick:k,defaultEdgeOptions:N,fitView:M,fitViewOptions:O,onNodesDelete:A,onEdgesDelete:P,onNodeDrag:R,onNodeDragStart:T,onNodeDragStop:D,onSelectionDrag:$,onSelectionDragStart:I,onSelectionDragStop:z,noPanClassName:L,nodeOrigin:F,rfId:H,autoPanOnConnect:W,autoPanOnNodeDrag:V,onError:Y,connectionRadius:j,isValidConnection:X,nodeDragThreshold:K})=>{const{setNodes:U,setEdges:q,setDefaultNodesAndEdges:Z,setMinZoom:G,setMaxZoom:Q,setTranslateExtent:J,setNodeExtent:ee,reset:te}=$r(pi,B),ne=Ir();return a(()=>{const e=r?.map(e=>({...e,...N}));return Z(n,e),()=>{te()}},[]),mi("defaultEdgeOptions",N,ne.setState),mi("connectionMode",E,ne.setState),mi("onConnect",o,ne.setState),mi("onConnectStart",i,ne.setState),mi("onConnectEnd",s,ne.setState),mi("onClickConnectStart",l,ne.setState),mi("onClickConnectEnd",c,ne.setState),mi("nodesDraggable",u,ne.setState),mi("nodesConnectable",d,ne.setState),mi("nodesFocusable",f,ne.setState),mi("edgesFocusable",p,ne.setState),mi("edgesUpdatable",h,ne.setState),mi("elementsSelectable",x,ne.setState),mi("elevateNodesOnSelect",m,ne.setState),mi("snapToGrid",_,ne.setState),mi("snapGrid",S,ne.setState),mi("onNodesChange",b,ne.setState),mi("onEdgesChange",w,ne.setState),mi("connectOnClick",k,ne.setState),mi("fitViewOnInit",M,ne.setState),mi("fitViewOnInitOptions",O,ne.setState),mi("onNodesDelete",A,ne.setState),mi("onEdgesDelete",P,ne.setState),mi("onNodeDrag",R,ne.setState),mi("onNodeDragStart",T,ne.setState),mi("onNodeDragStop",D,ne.setState),mi("onSelectionDrag",$,ne.setState),mi("onSelectionDragStart",I,ne.setState),mi("onSelectionDragStop",z,ne.setState),mi("noPanClassName",L,ne.setState),mi("nodeOrigin",F,ne.setState),mi("rfId",H,ne.setState),mi("autoPanOnConnect",W,ne.setState),mi("autoPanOnNodeDrag",V,ne.setState),mi("onError",Y,ne.setState),mi("connectionRadius",j,ne.setState),mi("isValidConnection",X,ne.setState),mi("nodeDragThreshold",K,ne.setState),hi(e,U),hi(t,q),hi(g,G),hi(y,Q),hi(C,J),hi(v,ee),null},yi={display:"none"},vi={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},bi="react-flow__node-desc",wi="react-flow__edge-desc",xi=e=>e.ariaLiveMessage;function Ei({rfId:e}){const n=$r(xi);return t.createElement("div",{id:`react-flow__aria-live-${e}`,"aria-live":"assertive","aria-atomic":"true",style:vi},n)}function Si({rfId:e,disableKeyboardA11y:n}){return t.createElement(t.Fragment,null,t.createElement("div",{id:`${bi}-${e}`,style:yi},"Press enter or space to select a node.",!n&&"You can then use the arrow keys to move the node around."," Press delete to remove it and escape to cancel."," "),t.createElement("div",{id:`${wi}-${e}`,style:yi},"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel."),!n&&t.createElement(Ei,{rfId:e}))}var _i=(e=null,t={actInsideInputWithModifier:!0})=>{const[n,r]=u(!1),i=l(!1),s=l(new Set([])),[c,d]=o(()=>{if(null!==e){const t=(Array.isArray(e)?e:[e]).filter(e=>"string"==typeof e).map(e=>e.split("+")),n=t.reduce((e,t)=>e.concat(...t),[]);return[t,n]}return[[],[]]},[e]);return a(()=>{const n="undefined"!=typeof document?document:null,o=t?.target||n;if(null!==e){const e=e=>{i.current=e.ctrlKey||e.metaKey||e.shiftKey;if((!i.current||i.current&&!t.actInsideInputWithModifier)&&eo(e))return!1;const n=ki(e.code,d);s.current.add(e[n]),Ci(c,s.current,!1)&&(e.preventDefault(),r(!0))},n=e=>{if((!i.current||i.current&&!t.actInsideInputWithModifier)&&eo(e))return!1;const n=ki(e.code,d);Ci(c,s.current,!0)?(r(!1),s.current.clear()):s.current.delete(e[n]),"Meta"===e.key&&s.current.clear(),i.current=!1},a=()=>{s.current.clear(),r(!1)};return o?.addEventListener("keydown",e),o?.addEventListener("keyup",n),window.addEventListener("blur",a),()=>{o?.removeEventListener("keydown",e),o?.removeEventListener("keyup",n),window.removeEventListener("blur",a)}}},[e,r]),n};function Ci(e,t,n){return e.filter(e=>n||e.length===t.size).some(e=>e.every(e=>t.has(e)))}function ki(e,t){return t.includes(e)?"code":"key"}function Ni(e,t,n,r){const o=e.parentNode||e.parentId;if(!o)return n;const i=t.get(o),a=Io(i,r);return Ni(i,t,{x:(n.x??0)+a.x,y:(n.y??0)+a.y,z:(i[Gr]?.z??0)>(n.z??0)?i[Gr]?.z??0:n.z??0},r)}function Mi(e,t,n){e.forEach(r=>{const o=r.parentNode||r.parentId;if(o&&!e.has(o))throw new Error(`Parent node ${o} not found`);if(o||n?.[r.id]){const{x:o,y:i,z:a}=Ni(r,e,{...r.position,z:r[Gr]?.z??0},t);r.positionAbsolute={x:o,y:i},r[Gr].z=a,n?.[r.id]&&(r[Gr].isParent=!0)}})}function Oi(e,t,n,r){const o=new Map,i={},a=r?1e3:0;return e.forEach(e=>{const n=(Zr(e.zIndex)?e.zIndex:0)+(e.selected?a:0),r=t.get(e.id),s={...e,positionAbsolute:{x:e.position.x,y:e.position.y}},l=e.parentNode||e.parentId;l&&(i[l]=!0);const c=r?.type&&r?.type!==e.type;Object.defineProperty(s,Gr,{enumerable:!1,value:{handleBounds:c?void 0:r?.[Gr]?.handleBounds,z:n}}),o.set(e.id,s)}),Mi(o,n,i),o}function Ai(e,t={}){const{getNodes:n,width:r,height:o,minZoom:i,maxZoom:a,d3Zoom:s,d3Selection:l,fitViewOnInitDone:c,fitViewOnInit:u,nodeOrigin:d}=e(),f=t.initial&&!c&&u;if(s&&l&&(f||!t.initial)){const e=n().filter(e=>{const n=t.includeHiddenNodes?e.width&&e.height:!e.hidden;return t.nodes?.length?n&&t.nodes.some(t=>t.id===e.id):n}),c=e.every(e=>e.width&&e.height);if(e.length>0&&c){const n=zo(e,d),{x:c,y:u,zoom:f}=Fo(n,r,o,t.minZoom??i,t.maxZoom??a,t.padding??.1),p=pr.translate(c,u).scale(f);return"number"==typeof t.duration&&t.duration>0?s.transform(Ho(l,t.duration),p):s.transform(l,p),!0}}return!1}function Pi(e,t){return e.forEach(e=>{const n=t.get(e.id);n&&t.set(n.id,{...n,[Gr]:n[Gr],selected:e.selected})}),new Map(t)}function Ri(e,t){return t.map(t=>{const n=e.find(e=>e.id===t.id);return n&&(t.selected=n.selected),t})}function Ti({changedNodes:e,changedEdges:t,get:n,set:r}){const{nodeInternals:o,edges:i,onNodesChange:a,onEdgesChange:s,hasDefaultNodes:l,hasDefaultEdges:c}=n();e?.length&&(l&&r({nodeInternals:Pi(e,o)}),a?.(e)),t?.length&&(c&&r({edges:Ri(t,i)}),s?.(t))}const Di=()=>{},$i={zoomIn:Di,zoomOut:Di,zoomTo:Di,getZoom:()=>1,setViewport:Di,getViewport:()=>({x:0,y:0,zoom:1}),fitView:()=>!1,setCenter:Di,fitBounds:Di,project:e=>e,screenToFlowPosition:e=>e,flowToScreenPosition:e=>e,viewportInitialized:!1},Ii=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection});function zi(){const e=(()=>{const e=Ir(),{d3Zoom:t,d3Selection:n}=$r(Ii,B),r=o(()=>n&&t?{zoomIn:e=>t.scaleBy(Ho(n,e?.duration),1.2),zoomOut:e=>t.scaleBy(Ho(n,e?.duration),1/1.2),zoomTo:(e,r)=>t.scaleTo(Ho(n,r?.duration),e),getZoom:()=>e.getState().transform[2],setViewport:(r,o)=>{const[i,a,s]=e.getState().transform,l=pr.translate(r.x??i,r.y??a).scale(r.zoom??s);t.transform(Ho(n,o?.duration),l)},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},fitView:t=>Ai(e.getState,t),setCenter:(r,o,i)=>{const{width:a,height:s,maxZoom:l}=e.getState(),c=void 0!==i?.zoom?i.zoom:l,u=a/2-r*c,d=s/2-o*c,f=pr.translate(u,d).scale(c);t.transform(Ho(n,i?.duration),f)},fitBounds:(r,o)=>{const{width:i,height:a,minZoom:s,maxZoom:l}=e.getState(),{x:c,y:u,zoom:d}=Fo(r,i,a,s,l,o?.padding??.1),f=pr.translate(c,u).scale(d);t.transform(Ho(n,o?.duration),f)},project:t=>{const{transform:n,snapToGrid:r,snapGrid:o}=e.getState();return console.warn("[DEPRECATED] `project` is deprecated. Instead use `screenToFlowPosition`. There is no need to subtract the react flow bounds anymore! https://reactflow.dev/api-reference/types/react-flow-instance#screen-to-flow-position"),Do(t,n,r,o)},screenToFlowPosition:t=>{const{transform:n,snapToGrid:r,snapGrid:o,domNode:i}=e.getState();if(!i)return t;const{x:a,y:s}=i.getBoundingClientRect(),l={x:t.x-a,y:t.y-s};return Do(l,n,r,o)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),a=$o(t,n);return{x:a.x+o,y:a.y+i}},viewportInitialized:!0}:$i,[t,n]);return r})(),t=Ir(),n=s(()=>t.getState().getNodes().map(e=>({...e})),[]),r=s(e=>t.getState().nodeInternals.get(e),[]),i=s(()=>{const{edges:e=[]}=t.getState();return e.map(e=>({...e}))},[]),a=s(e=>{const{edges:n=[]}=t.getState();return n.find(t=>t.id===e)},[]),l=s(e=>{const{getNodes:n,setNodes:r,hasDefaultNodes:o,onNodesChange:i}=t.getState(),a=n(),s="function"==typeof e?e(a):e;if(o)r(s);else if(i){const e=0===s.length?a.map(e=>({type:"remove",id:e.id})):s.map(e=>({item:e,type:"reset"}));i(e)}},[]),c=s(e=>{const{edges:n=[],setEdges:r,hasDefaultEdges:o,onEdgesChange:i}=t.getState(),a="function"==typeof e?e(n):e;if(o)r(a);else if(i){i(0===a.length?n.map(e=>({type:"remove",id:e.id})):a.map(e=>({item:e,type:"reset"})))}},[]),u=s(e=>{const n=Array.isArray(e)?e:[e],{getNodes:r,setNodes:o,hasDefaultNodes:i,onNodesChange:a}=t.getState();if(i){o([...r(),...n])}else if(a){const e=n.map(e=>({item:e,type:"add"}));a(e)}},[]),d=s(e=>{const n=Array.isArray(e)?e:[e],{edges:r=[],setEdges:o,hasDefaultEdges:i,onEdgesChange:a}=t.getState();if(i)o([...r,...n]);else if(a){a(n.map(e=>({item:e,type:"add"})))}},[]),f=s(()=>{const{getNodes:e,edges:n=[],transform:r}=t.getState(),[o,i,a]=r;return{nodes:e().map(e=>({...e})),edges:n.map(e=>({...e})),viewport:{x:o,y:i,zoom:a}}},[]),p=s(({nodes:e,edges:n})=>{const{nodeInternals:r,getNodes:o,edges:i,hasDefaultNodes:a,hasDefaultEdges:s,onNodesDelete:l,onEdgesDelete:c,onNodesChange:u,onEdgesChange:d}=t.getState(),f=(e||[]).map(e=>e.id),p=(n||[]).map(e=>e.id),h=o().reduce((e,t)=>{const n=t.parentNode||t.parentId,r=!f.includes(t.id)&&n&&e.find(e=>e.id===n);return("boolean"!=typeof t.deletable||t.deletable)&&(f.includes(t.id)||r)&&e.push(t),e},[]),m=i.filter(e=>"boolean"!=typeof e.deletable||e.deletable),g=m.filter(e=>p.includes(e.id));if(h||g){const e=Bo(h,m),n=[...g,...e],o=n.reduce((e,t)=>(e.includes(t.id)||e.push(t.id),e),[]);if((s||a)&&(s&&t.setState({edges:i.filter(e=>!o.includes(e.id))}),a&&(h.forEach(e=>{r.delete(e.id)}),t.setState({nodeInternals:new Map(r)}))),o.length>0&&(c?.(n),d&&d(o.map(e=>({id:e,type:"remove"})))),h.length>0&&(l?.(h),u)){u(h.map(e=>({id:e.id,type:"remove"})))}}},[]),h=s(e=>{const n=Zr((r=e).width)&&Zr(r.height)&&Zr(r.x)&&Zr(r.y);var r;const o=n?null:t.getState().nodeInternals.get(e.id);if(!n&&!o)return[null,null,n];return[n?e:Ur(o),o,n]},[]),m=s((e,n=!0,r)=>{const[o,i,a]=h(e);return o?(r||t.getState().getNodes()).filter(e=>{if(!(a||e.id!==i.id&&e.positionAbsolute))return!1;const t=Ur(e),r=qr(t,o);return n&&r>0||r>=o.width*o.height}):[]},[]),g=s((e,t,n=!0)=>{const[r]=h(e);if(!r)return!1;const o=qr(r,t);return n&&o>0||o>=r.width*r.height},[]);return o(()=>({...e,getNodes:n,getNode:r,getEdges:i,getEdge:a,setNodes:l,setEdges:c,addNodes:u,addEdges:d,toObject:f,deleteElements:p,getIntersectingNodes:m,isNodeIntersecting:g}),[e,n,r,i,a,l,c,u,d,f,p,m,g])}const Li={actInsideInputWithModifier:!1};const Bi={position:"absolute",width:"100%",height:"100%",top:0,left:0},Fi=e=>({x:e.x,y:e.y,zoom:e.k}),Hi=(e,t)=>e.target.closest(`.${t}`),Wi=(e,t)=>2===t&&Array.isArray(e)&&e.includes(2),Vi=e=>{const t=e.ctrlKey&&ro()?10:1;return-e.deltaY*(1===e.deltaMode?.05:e.deltaMode?1:.002)*t},Yi=e=>({d3Zoom:e.d3Zoom,d3Selection:e.d3Selection,d3ZoomHandler:e.d3ZoomHandler,userSelectionActive:e.userSelectionActive}),ji=({onMove:e,onMoveStart:n,onMoveEnd:r,onPaneContextMenu:o,zoomOnScroll:i=!0,zoomOnPinch:s=!0,panOnScroll:c=!1,panOnScrollSpeed:u=.5,panOnScrollMode:d=co.Free,zoomOnDoubleClick:f=!0,elementsSelectable:p,panOnDrag:h=!0,defaultViewport:m,translateExtent:g,minZoom:y,maxZoom:v,zoomActivationKeyCode:b,preventScrolling:w=!0,children:x,noWheelClassName:E,noPanClassName:S})=>{const _=l(),C=Ir(),k=l(!1),N=l(!1),M=l(null),O=l({x:0,y:0,zoom:0}),{d3Zoom:A,d3Selection:P,d3ZoomHandler:R,userSelectionActive:T}=$r(Yi,B),D=_i(b),$=l(0),I=l(!1),z=l();return function(e){const t=Ir();a(()=>{let n;const r=()=>{if(!e.current)return;const n=Hr(e.current);0!==n.height&&0!==n.width||t.getState().onError?.("004",kr()),t.setState({width:n.width||500,height:n.height||500})};return r(),window.addEventListener("resize",r),e.current&&(n=new ResizeObserver(()=>r()),n.observe(e.current)),()=>{window.removeEventListener("resize",r),n&&e.current&&n.unobserve(e.current)}},[])}(M),a(()=>{if(M.current){const e=M.current.getBoundingClientRect(),t=function(){var e,t,n,r=gr,o=yr,i=xr,a=br,s=wr,l=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],u=250,d=gn,f=H("start","zoom","end"),p=0,h=10;function m(e){e.property("__zoom",vr).on("wheel.zoom",E,{passive:!1}).on("mousedown.zoom",S).on("dblclick.zoom",_).filter(s).on("touchstart.zoom",C).on("touchmove.zoom",k).on("touchend.zoom touchcancel.zoom",N).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(e,t){return(t=Math.max(l[0],Math.min(l[1],t)))===e.k?e:new fr(t,e.x,e.y)}function y(e,t,n){var r=t[0]-n[0]*e.k,o=t[1]-n[1]*e.k;return r===e.x&&o===e.y?e:new fr(e.k,r,o)}function v(e){return[(+e[0][0]+ +e[1][0])/2,(+e[0][1]+ +e[1][1])/2]}function b(e,t,n,r){e.on("start.zoom",function(){w(this,arguments).event(r).start()}).on("interrupt.zoom end.zoom",function(){w(this,arguments).event(r).end()}).tween("zoom",function(){var e=this,i=arguments,a=w(e,i).event(r),s=o.apply(e,i),l=null==n?v(s):"function"==typeof n?n.apply(e,i):n,c=Math.max(s[1][0]-s[0][0],s[1][1]-s[0][1]),u=e.__zoom,f="function"==typeof t?t.apply(e,i):t,p=d(u.invert(l).concat(c/u.k),f.invert(l).concat(c/f.k));return function(e){if(1===e)e=f;else{var t=p(e),n=c/t[2];e=new fr(n,l[0]-t[0]*n,l[1]-t[1]*n)}a.zoom(null,e)}})}function w(e,t,n){return!n&&e.__zooming||new x(e,t)}function x(e,t){this.that=e,this.args=t,this.active=0,this.sourceEvent=null,this.extent=o.apply(e,t),this.taps=0}function E(e,...t){if(r.apply(this,arguments)){var n=w(this,t).event(e),o=this.__zoom,s=Math.max(l[0],Math.min(l[1],o.k*Math.pow(2,a.apply(this,arguments)))),u=ot(e);if(n.wheel)n.mouse[0][0]===u[0]&&n.mouse[0][1]===u[1]||(n.mouse[1]=o.invert(n.mouse[0]=u)),clearTimeout(n.wheel);else{if(o.k===s)return;n.mouse=[u,o.invert(u)],Bn(this),n.start()}mr(e),n.wheel=setTimeout(function(){n.wheel=null,n.end()},150),n.zoom("mouse",i(y(g(o,s),n.mouse[0],n.mouse[1]),n.extent,c))}}function S(e,...t){if(!n&&r.apply(this,arguments)){var o=e.currentTarget,a=w(this,t,!0).event(e),s=rt(e.view).on("mousemove.zoom",function(e){if(mr(e),!a.moved){var t=e.clientX-u,n=e.clientY-d;a.moved=t*t+n*n>p}a.event(e).zoom("mouse",i(y(a.that.__zoom,a.mouse[0]=ot(e,o),a.mouse[1]),a.extent,c))},!0).on("mouseup.zoom",function(e){s.on("mousemove.zoom mouseup.zoom",null),ut(e.view,a.moved),mr(e),a.event(e).end()},!0),l=ot(e,o),u=e.clientX,d=e.clientY;ct(e.view),hr(e),a.mouse=[l,this.__zoom.invert(l)],Bn(this),a.start()}}function _(e,...t){if(r.apply(this,arguments)){var n=this.__zoom,a=ot(e.changedTouches?e.changedTouches[0]:e,this),s=n.invert(a),l=n.k*(e.shiftKey?.5:2),d=i(y(g(n,l),a,s),o.apply(this,t),c);mr(e),u>0?rt(this).transition().duration(u).call(b,d,a,e):rt(this).call(m.transform,d,a,e)}}function C(n,...o){if(r.apply(this,arguments)){var i,a,s,l,c=n.touches,u=c.length,d=w(this,o,n.changedTouches.length===u).event(n);for(hr(n),a=0;a<u;++a)l=[l=ot(s=c[a],this),this.__zoom.invert(l),s.identifier],d.touch0?d.touch1||d.touch0[2]===l[2]||(d.touch1=l,d.taps=0):(d.touch0=l,i=!0,d.taps=1+!!e);e&&(e=clearTimeout(e)),i&&(d.taps<2&&(t=l[0],e=setTimeout(function(){e=null},500)),Bn(this),d.start())}}function k(e,...t){if(this.__zooming){var n,r,o,a,s=w(this,t).event(e),l=e.changedTouches,u=l.length;for(mr(e),n=0;n<u;++n)o=ot(r=l[n],this),s.touch0&&s.touch0[2]===r.identifier?s.touch0[0]=o:s.touch1&&s.touch1[2]===r.identifier&&(s.touch1[0]=o);if(r=s.that.__zoom,s.touch1){var d=s.touch0[0],f=s.touch0[1],p=s.touch1[0],h=s.touch1[1],m=(m=p[0]-d[0])*m+(m=p[1]-d[1])*m,v=(v=h[0]-f[0])*v+(v=h[1]-f[1])*v;r=g(r,Math.sqrt(m/v)),o=[(d[0]+p[0])/2,(d[1]+p[1])/2],a=[(f[0]+h[0])/2,(f[1]+h[1])/2]}else{if(!s.touch0)return;o=s.touch0[0],a=s.touch0[1]}s.zoom("touch",i(y(r,o,a),s.extent,c))}}function N(e,...r){if(this.__zooming){var o,i,a=w(this,r).event(e),s=e.changedTouches,l=s.length;for(hr(e),n&&clearTimeout(n),n=setTimeout(function(){n=null},500),o=0;o<l;++o)i=s[o],a.touch0&&a.touch0[2]===i.identifier?delete a.touch0:a.touch1&&a.touch1[2]===i.identifier&&delete a.touch1;if(a.touch1&&!a.touch0&&(a.touch0=a.touch1,delete a.touch1),a.touch0)a.touch0[1]=this.__zoom.invert(a.touch0[0]);else if(a.end(),2===a.taps&&(i=ot(i,this),Math.hypot(t[0]-i[0],t[1]-i[1])<h)){var c=rt(this).on("dblclick.zoom");c&&c.apply(this,arguments)}}}return m.transform=function(e,t,n,r){var o=e.selection?e.selection():e;o.property("__zoom",vr),e!==o?b(e,t,n,r):o.interrupt().each(function(){w(this,arguments).event(r).start().zoom(null,"function"==typeof t?t.apply(this,arguments):t).end()})},m.scaleBy=function(e,t,n,r){m.scaleTo(e,function(){return this.__zoom.k*("function"==typeof t?t.apply(this,arguments):t)},n,r)},m.scaleTo=function(e,t,n,r){m.transform(e,function(){var e=o.apply(this,arguments),r=this.__zoom,a=null==n?v(e):"function"==typeof n?n.apply(this,arguments):n,s=r.invert(a),l="function"==typeof t?t.apply(this,arguments):t;return i(y(g(r,l),a,s),e,c)},n,r)},m.translateBy=function(e,t,n,r){m.transform(e,function(){return i(this.__zoom.translate("function"==typeof t?t.apply(this,arguments):t,"function"==typeof n?n.apply(this,arguments):n),o.apply(this,arguments),c)},null,r)},m.translateTo=function(e,t,n,r,a){m.transform(e,function(){var e=o.apply(this,arguments),a=this.__zoom,s=null==r?v(e):"function"==typeof r?r.apply(this,arguments):r;return i(pr.translate(s[0],s[1]).scale(a.k).translate("function"==typeof t?-t.apply(this,arguments):-t,"function"==typeof n?-n.apply(this,arguments):-n),e,c)},r,a)},x.prototype={event:function(e){return e&&(this.sourceEvent=e),this},start:function(){return 1===++this.active&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(e,t){return this.mouse&&"mouse"!==e&&(this.mouse[1]=t.invert(this.mouse[0])),this.touch0&&"touch"!==e&&(this.touch0[1]=t.invert(this.touch0[0])),this.touch1&&"touch"!==e&&(this.touch1[1]=t.invert(this.touch1[0])),this.that.__zoom=t,this.emit("zoom"),this},end:function(){return 0===--this.active&&(delete this.that.__zooming,this.emit("end")),this},emit:function(e){var t=rt(this.that).datum();f.call(e,this.that,new dr(e,{sourceEvent:this.sourceEvent,target:m,type:e,transform:this.that.__zoom,dispatch:f}),t)}},m.wheelDelta=function(e){return arguments.length?(a="function"==typeof e?e:ur(+e),m):a},m.filter=function(e){return arguments.length?(r="function"==typeof e?e:ur(!!e),m):r},m.touchable=function(e){return arguments.length?(s="function"==typeof e?e:ur(!!e),m):s},m.extent=function(e){return arguments.length?(o="function"==typeof e?e:ur([[+e[0][0],+e[0][1]],[+e[1][0],+e[1][1]]]),m):o},m.scaleExtent=function(e){return arguments.length?(l[0]=+e[0],l[1]=+e[1],m):[l[0],l[1]]},m.translateExtent=function(e){return arguments.length?(c[0][0]=+e[0][0],c[1][0]=+e[1][0],c[0][1]=+e[0][1],c[1][1]=+e[1][1],m):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},m.constrain=function(e){return arguments.length?(i=e,m):i},m.duration=function(e){return arguments.length?(u=+e,m):u},m.interpolate=function(e){return arguments.length?(d=e,m):d},m.on=function(){var e=f.on.apply(f,arguments);return e===f?m:e},m.clickDistance=function(e){return arguments.length?(p=(e=+e)*e,m):Math.sqrt(p)},m.tapDistance=function(e){return arguments.length?(h=+e,m):h},m}().scaleExtent([y,v]).translateExtent(g),n=rt(M.current).call(t),r=pr.translate(m.x,m.y).scale(Wr(m.zoom,y,v)),o=[[0,0],[e.width,e.height]],i=t.constrain()(r,o,g);t.transform(n,i),t.wheelDelta(Vi),C.setState({d3Zoom:t,d3Selection:n,d3ZoomHandler:n.on("wheel.zoom"),transform:[i.x,i.y,i.k],domNode:M.current.closest(".react-flow")})}},[]),a(()=>{P&&A&&(!c||D||T?void 0!==R&&P.on("wheel.zoom",function(e,t){if(!w&&"wheel"===e.type&&!e.ctrlKey||Hi(e,E))return null;e.preventDefault(),R.call(this,e,t)},{passive:!1}):P.on("wheel.zoom",t=>{if(Hi(t,E))return!1;t.preventDefault(),t.stopImmediatePropagation();const o=P.property("__zoom").k||1;if(t.ctrlKey&&s){const e=ot(t),n=Vi(t),r=o*Math.pow(2,n);return void A.scaleTo(P,r,e,t)}const i=1===t.deltaMode?20:1;let a=d===co.Vertical?0:t.deltaX*i,l=d===co.Horizontal?0:t.deltaY*i;!ro()&&t.shiftKey&&d!==co.Vertical&&(a=t.deltaY*i,l=0),A.translateBy(P,-a/o*u,-l/o*u,{internal:!0});const c=Fi(P.property("__zoom")),{onViewportChangeStart:f,onViewportChange:p,onViewportChangeEnd:h}=C.getState();clearTimeout(z.current),I.current||(I.current=!0,n?.(t,c),f?.(c)),I.current&&(e?.(t,c),p?.(c),z.current=setTimeout(()=>{r?.(t,c),h?.(c),I.current=!1},150))},{passive:!1}))},[T,c,d,P,A,R,D,s,w,E,n,e,r]),a(()=>{A&&A.on("start",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;$.current=e.sourceEvent?.button;const{onViewportChangeStart:t}=C.getState(),r=Fi(e.transform);k.current=!0,O.current=r,"mousedown"===e.sourceEvent?.type&&C.setState({paneDragging:!0}),t?.(r),n?.(e.sourceEvent,r)})},[A,n]),a(()=>{A&&(T&&!k.current?A.on("zoom",null):T||A.on("zoom",t=>{const{onViewportChange:n}=C.getState();if(C.setState({transform:[t.transform.x,t.transform.y,t.transform.k]}),N.current=!(!o||!Wi(h,$.current??0)),(e||n)&&!t.sourceEvent?.internal){const r=Fi(t.transform);n?.(r),e?.(t.sourceEvent,r)}}))},[T,A,e,h,o]),a(()=>{A&&A.on("end",e=>{if(!e.sourceEvent||e.sourceEvent.internal)return null;const{onViewportChangeEnd:t}=C.getState();if(k.current=!1,C.setState({paneDragging:!1}),o&&Wi(h,$.current??0)&&!N.current&&o(e.sourceEvent),N.current=!1,(r||t)&&(n=O.current,i=e.transform,n.x!==i.x||n.y!==i.y||n.zoom!==i.k)){const n=Fi(e.transform);O.current=n,clearTimeout(_.current),_.current=setTimeout(()=>{t?.(n),r?.(e.sourceEvent,n)},c?150:0)}var n,i})},[A,c,h,r,o]),a(()=>{A&&A.filter(e=>{const t=D||i,n=s&&e.ctrlKey;if((!0===h||Array.isArray(h)&&h.includes(1))&&1===e.button&&"mousedown"===e.type&&(Hi(e,"react-flow__node")||Hi(e,"react-flow__edge")))return!0;if(!(h||t||c||f||s))return!1;if(T)return!1;if(!f&&"dblclick"===e.type)return!1;if(Hi(e,E)&&"wheel"===e.type)return!1;if(Hi(e,S)&&("wheel"!==e.type||c&&"wheel"===e.type&&!D))return!1;if(!s&&e.ctrlKey&&"wheel"===e.type)return!1;if(!t&&!c&&!n&&"wheel"===e.type)return!1;if(!h&&("mousedown"===e.type||"touchstart"===e.type))return!1;if(Array.isArray(h)&&!h.includes(e.button)&&"mousedown"===e.type)return!1;const r=Array.isArray(h)&&h.includes(e.button)||!e.button||e.button<=1;return(!e.ctrlKey||"wheel"===e.type)&&r})},[T,A,i,s,c,f,h,p,D]),t.createElement("div",{className:"react-flow__renderer",ref:M,style:Bi},x)},Xi=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function Ki(){const{userSelectionActive:e,userSelectionRect:n}=$r(Xi,B);return e&&n?t.createElement("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}function Ui(e,t){const n=t.parentNode||t.parentId,r=e.find(e=>e.id===n);if(r){const e=t.position.x+t.width-r.width,n=t.position.y+t.height-r.height;if(e>0||n>0||t.position.x<0||t.position.y<0){if(r.style={...r.style}||{},r.style.width=r.style.width??r.width,r.style.height=r.style.height??r.height,e>0&&(r.style.width+=e),n>0&&(r.style.height+=n),t.position.x<0){const e=Math.abs(t.position.x);r.position.x=r.position.x-e,r.style.width+=e,t.position.x=0}if(t.position.y<0){const e=Math.abs(t.position.y);r.position.y=r.position.y-e,r.style.height+=e,t.position.y=0}r.width=r.style.width,r.height=r.style.height}}}function qi(e,t){if(e.some(e=>"reset"===e.type))return e.filter(e=>"reset"===e.type).map(e=>e.item);const n=e.filter(e=>"add"===e.type).map(e=>e.item);return t.reduce((t,n)=>{const r=e.filter(e=>e.id===n.id);if(0===r.length)return t.push(n),t;const o={...n};for(const e of r)if(e)switch(e.type){case"select":o.selected=e.selected;break;case"position":void 0!==e.position&&(o.position=e.position),void 0!==e.positionAbsolute&&(o.positionAbsolute=e.positionAbsolute),void 0!==e.dragging&&(o.dragging=e.dragging),o.expandParent&&Ui(t,o);break;case"dimensions":void 0!==e.dimensions&&(o.width=e.dimensions.width,o.height=e.dimensions.height),void 0!==e.updateStyle&&(o.style={...o.style||{},...e.dimensions}),"boolean"==typeof e.resizing&&(o.resizing=e.resizing),o.expandParent&&Ui(t,o);break;case"remove":return t}return t.push(o),t},n)}function Zi(e,t){return qi(e,t)}const Gi=(e,t)=>({id:e,type:"select",selected:t});function Qi(e,t){return e.reduce((e,n)=>{const r=t.includes(n.id);return!n.selected&&r?(n.selected=!0,e.push(Gi(n.id,!0))):n.selected&&!r&&(n.selected=!1,e.push(Gi(n.id,!1))),e},[])}const Ji=(e,t)=>n=>{n.target===t.current&&e?.(n)},ea=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging}),ta=r(({isSelecting:e,selectionMode:n=uo.Full,panOnDrag:r,onSelectionStart:o,onSelectionEnd:i,onPaneClick:a,onPaneContextMenu:s,onPaneScroll:c,onPaneMouseEnter:u,onPaneMouseMove:d,onPaneMouseLeave:f,children:p})=>{const h=l(null),m=Ir(),g=l(0),y=l(0),b=l(),{userSelectionActive:w,elementsSelectable:x,dragging:E}=$r(ea,B),S=()=>{m.setState({userSelectionActive:!1,userSelectionRect:null}),g.current=0,y.current=0},_=e=>{a?.(e),m.getState().resetSelectedElements(),m.setState({nodesSelectionActive:!1})},C=c?e=>c(e):void 0,k=x&&(e||w);return t.createElement("div",{className:v(["react-flow__pane",{dragging:E,selection:e}]),onClick:k?void 0:Ji(_,h),onContextMenu:Ji(e=>{Array.isArray(r)&&r?.includes(2)?e.preventDefault():s?.(e)},h),onWheel:Ji(C,h),onMouseEnter:k?void 0:u,onMouseDown:k?t=>{const{resetSelectedElements:n,domNode:r}=m.getState();if(b.current=r?.getBoundingClientRect(),!x||!e||0!==t.button||t.target!==h.current||!b.current)return;const{x:i,y:a}=no(t,b.current);n(),m.setState({userSelectionRect:{width:0,height:0,startX:i,startY:a,x:i,y:a}}),o?.(t)}:void 0,onMouseMove:k?t=>{const{userSelectionRect:r,nodeInternals:o,edges:i,transform:a,onNodesChange:s,onEdgesChange:l,nodeOrigin:c,getNodes:u}=m.getState();if(!e||!b.current||!r)return;m.setState({userSelectionActive:!0,nodesSelectionActive:!1});const d=no(t,b.current),f=r.startX??0,p=r.startY??0,h={...r,x:d.x<f?d.x:f,y:d.y<p?d.y:p,width:Math.abs(d.x-f),height:Math.abs(d.y-p)},v=u(),w=Lo(o,h,a,n===uo.Partial,!0,c),x=Bo(w,i).map(e=>e.id),E=w.map(e=>e.id);if(g.current!==E.length){g.current=E.length;const e=Qi(v,E);e.length&&s?.(e)}if(y.current!==x.length){y.current=x.length;const e=Qi(i,x);e.length&&l?.(e)}m.setState({userSelectionRect:h})}:d,onMouseUp:k?e=>{if(0!==e.button)return;const{userSelectionRect:t}=m.getState();!w&&t&&e.target===h.current&&_?.(e),m.setState({nodesSelectionActive:g.current>0}),S(),i?.(e)}:void 0,onMouseLeave:k?e=>{w&&(m.setState({nodesSelectionActive:g.current>0}),i?.(e)),S()}:f,ref:h,style:Bi},p,t.createElement(Ki,null))});function na(e,t){const n=e.parentNode||e.parentId;if(!n)return!1;const r=t.get(n);return!!r&&(!!r.selected||na(r,t))}function ra(e,t,n){let r=e;do{if(r?.matches(t))return!0;if(r===n.current)return!1;r=r.parentElement}while(r);return!1}function oa(e,t,n,r){return Array.from(e.values()).filter(n=>(n.selected||n.id===r)&&(!n.parentNode||n.parentId||!na(n,e))&&(n.draggable||t&&void 0===n.draggable)).map(e=>({id:e.id,position:e.position||{x:0,y:0},positionAbsolute:e.positionAbsolute||{x:0,y:0},distance:{x:n.x-(e.positionAbsolute?.x??0),y:n.y-(e.positionAbsolute?.y??0)},delta:{x:0,y:0},extent:e.extent,parentNode:e.parentNode||e.parentId,parentId:e.parentNode||e.parentId,width:e.width,height:e.height,expandParent:e.expandParent}))}function ia(e,t,n,r,o=[0,0],i){const a=function(e,t){return t&&"parent"!==t?[t[0],[t[1][0]-(e.width||0),t[1][1]-(e.height||0)]]:t}(e,e.extent||r);let s=a;const l=e.parentNode||e.parentId;if("parent"!==e.extent||e.expandParent){if(e.extent&&l&&"parent"!==e.extent){const t=n.get(l),{x:r,y:i}=Io(t,o).positionAbsolute;s=[[e.extent[0][0]+r,e.extent[0][1]+i],[e.extent[1][0]+r,e.extent[1][1]+i]]}}else if(l&&e.width&&e.height){const t=n.get(l),{x:r,y:i}=Io(t,o).positionAbsolute;s=t&&Zr(r)&&Zr(i)&&Zr(t.width)&&Zr(t.height)?[[r+e.width*o[0],i+e.height*o[1]],[r+t.width-e.width+e.width*o[0],i+t.height-e.height+e.height*o[1]]]:s}else i?.("005",Nr()),s=a;let c={x:0,y:0};if(l){const e=n.get(l);c=Io(e,o).positionAbsolute}const u=s&&"parent"!==s?Vr(t,s):t;return{position:{x:u.x-c.x,y:u.y-c.y},positionAbsolute:u}}function aa({nodeId:e,dragItems:t,nodeInternals:n}){const r=t.map(e=>({...n.get(e.id),position:e.position,positionAbsolute:e.positionAbsolute}));return[e?r.find(t=>t.id===e):r[0],r]}ta.displayName="Pane";const sa=(e,t,n,r)=>{const o=t.querySelectorAll(e);if(!o||!o.length)return null;const i=Array.from(o),a=t.getBoundingClientRect(),s=a.width*r[0],l=a.height*r[1];return i.map(e=>{const t=e.getBoundingClientRect();return{id:e.getAttribute("data-handleid"),position:e.getAttribute("data-handlepos"),x:(t.left-a.left-s)/n,y:(t.top-a.top-l)/n,...Hr(e)}})};function la(e,t,n){return void 0===n?n:r=>{const o=t().nodeInternals.get(e);o&&n(r,{...o})}}function ca({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:a,nodeInternals:s,onError:l}=t.getState(),c=s.get(e);c?(t.setState({nodesSelectionActive:!1}),c.selected?(n||c.selected&&a)&&(i({nodes:[c],edges:[]}),requestAnimationFrame(()=>r?.current?.blur())):o([e])):l?.("012",Tr(e))}function ua(e){return(t,n,r)=>e?.(t,r)}function da({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,selectNodesOnDrag:c}){const d=Ir(),[f,p]=u(!1),h=l([]),m=l({x:null,y:null}),g=l(0),y=l(null),v=l({x:0,y:0}),b=l(null),w=l(!1),x=l(!1),E=l(!1),S=function(){const e=Ir(),t=s(({sourceEvent:t})=>{const{transform:n,snapGrid:r,snapToGrid:o}=e.getState(),i=t.touches?t.touches[0].clientX:t.clientX,a=t.touches?t.touches[0].clientY:t.clientY,s={x:(i-n[0])/n[2],y:(a-n[1])/n[2]};return{xSnapped:o?r[0]*Math.round(s.x/r[0]):s.x,ySnapped:o?r[1]*Math.round(s.y/r[1]):s.y,...s}},[]);return t}();return a(()=>{if(e?.current){const a=rt(e.current),s=({x:e,y:t})=>{const{nodeInternals:n,onNodeDrag:r,onSelectionDrag:i,updateNodePositions:a,nodeExtent:s,snapGrid:l,snapToGrid:c,nodeOrigin:u,onError:f}=d.getState();m.current={x:e,y:t};let g=!1,y={x:0,y:0,x2:0,y2:0};if(h.current.length>1&&s){const e=zo(h.current,u);y=Kr(e)}if(h.current=h.current.map(r=>{const o={x:e-r.distance.x,y:t-r.distance.y};c&&(o.x=l[0]*Math.round(o.x/l[0]),o.y=l[1]*Math.round(o.y/l[1]));const i=[[s[0][0],s[0][1]],[s[1][0],s[1][1]]];h.current.length>1&&s&&!r.extent&&(i[0][0]=r.positionAbsolute.x-y.x+s[0][0],i[1][0]=r.positionAbsolute.x+(r.width??0)-y.x2+s[1][0],i[0][1]=r.positionAbsolute.y-y.y+s[0][1],i[1][1]=r.positionAbsolute.y+(r.height??0)-y.y2+s[1][1]);const a=ia(r,o,n,i,u,f);return g=g||r.position.x!==a.position.x||r.position.y!==a.position.y,r.position=a.position,r.positionAbsolute=a.positionAbsolute,r}),!g)return;a(h.current,!0,!0),p(!0);const v=o?r:ua(i);if(v&&b.current){const[e,t]=aa({nodeId:o,dragItems:h.current,nodeInternals:n});v(b.current,e,t)}},l=()=>{if(!y.current)return;const[e,t]=jr(v.current,y.current);if(0!==e||0!==t){const{transform:n,panBy:r}=d.getState();m.current.x=(m.current.x??0)-e/n[2],m.current.y=(m.current.y??0)-t/n[2],r({x:e,y:t})&&s(m.current)}g.current=requestAnimationFrame(l)},u=t=>{const{nodeInternals:n,multiSelectionActive:r,nodesDraggable:a,unselectNodesAndEdges:s,onNodeDragStart:l,onSelectionDragStart:u}=d.getState();x.current=!0;const f=o?l:ua(u);c&&i||r||!o||n.get(o)?.selected||s(),o&&i&&c&&ca({id:o,store:d,nodeRef:e});const p=S(t);if(m.current=p,h.current=oa(n,a,p,o),f&&h.current){const[e,r]=aa({nodeId:o,dragItems:h.current,nodeInternals:n});f(t.sourceEvent,e,r)}};if(!t){const t=function(){var e,t,n,r,o=pt,i=ht,a=mt,s=gt,l={},c=H("start","drag","end"),u=0,d=0;function f(e){e.on("mousedown.drag",p).filter(s).on("touchstart.drag",g).on("touchmove.drag",y,it).on("touchend.drag touchcancel.drag",v).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function p(a,s){if(!r&&o.call(this,a,s)){var l=b(this,i.call(this,a,s),a,s,"mouse");l&&(rt(a.view).on("mousemove.drag",h,at).on("mouseup.drag",m,at),ct(a.view),st(a),n=!1,e=a.clientX,t=a.clientY,l("start",a))}}function h(r){if(lt(r),!n){var o=r.clientX-e,i=r.clientY-t;n=o*o+i*i>d}l.mouse("drag",r)}function m(e){rt(e.view).on("mousemove.drag mouseup.drag",null),ut(e.view,n),lt(e),l.mouse("end",e)}function g(e,t){if(o.call(this,e,t)){var n,r,a=e.changedTouches,s=i.call(this,e,t),l=a.length;for(n=0;n<l;++n)(r=b(this,s,e,t,a[n].identifier,a[n]))&&(st(e),r("start",e,a[n]))}}function y(e){var t,n,r=e.changedTouches,o=r.length;for(t=0;t<o;++t)(n=l[r[t].identifier])&&(lt(e),n("drag",e,r[t]))}function v(e){var t,n,o=e.changedTouches,i=o.length;for(r&&clearTimeout(r),r=setTimeout(function(){r=null},500),t=0;t<i;++t)(n=l[o[t].identifier])&&(st(e),n("end",e,o[t]))}function b(e,t,n,r,o,i){var s,d,p,h=c.copy(),m=ot(i||n,t);if(null!=(p=a.call(e,new ft("beforestart",{sourceEvent:n,target:f,identifier:o,active:u,x:m[0],y:m[1],dx:0,dy:0,dispatch:h}),r)))return s=p.x-m[0]||0,d=p.y-m[1]||0,function n(i,a,c){var g,y=m;switch(i){case"start":l[o]=n,g=u++;break;case"end":delete l[o],--u;case"drag":m=ot(c||a,t),g=u}h.call(i,e,new ft(i,{sourceEvent:a,subject:p,target:f,identifier:o,active:g,x:m[0]+s,y:m[1]+d,dx:m[0]-y[0],dy:m[1]-y[1],dispatch:h}),r)}}return f.filter=function(e){return arguments.length?(o="function"==typeof e?e:dt(!!e),f):o},f.container=function(e){return arguments.length?(i="function"==typeof e?e:dt(e),f):i},f.subject=function(e){return arguments.length?(a="function"==typeof e?e:dt(e),f):a},f.touchable=function(e){return arguments.length?(s="function"==typeof e?e:dt(!!e),f):s},f.on=function(){var e=c.on.apply(c,arguments);return e===c?f:e},f.clickDistance=function(e){return arguments.length?(d=(e=+e)*e,f):Math.sqrt(d)},f}().on("start",e=>{const{domNode:t,nodeDragThreshold:n}=d.getState();0===n&&u(e),E.current=!1;const r=S(e);m.current=r,y.current=t?.getBoundingClientRect()||null,v.current=no(e.sourceEvent,y.current)}).on("drag",e=>{const t=S(e),{autoPanOnNodeDrag:n,nodeDragThreshold:r}=d.getState();if("touchmove"===e.sourceEvent.type&&e.sourceEvent.touches.length>1&&(E.current=!0),!E.current){if(!w.current&&x.current&&n&&(w.current=!0,l()),!x.current){const n=t.xSnapped-(m?.current?.x??0),o=t.ySnapped-(m?.current?.y??0);Math.sqrt(n*n+o*o)>r&&u(e)}(m.current.x!==t.xSnapped||m.current.y!==t.ySnapped)&&h.current&&x.current&&(b.current=e.sourceEvent,v.current=no(e.sourceEvent,y.current),s(t))}}).on("end",e=>{if(x.current&&!E.current&&(p(!1),w.current=!1,x.current=!1,cancelAnimationFrame(g.current),h.current)){const{updateNodePositions:t,nodeInternals:n,onNodeDragStop:r,onSelectionDragStop:i}=d.getState(),a=o?r:ua(i);if(t(h.current,!1,!1),a){const[t,r]=aa({nodeId:o,dragItems:h.current,nodeInternals:n});a(e.sourceEvent,t,r)}}}).filter(t=>{const o=t.target;return!t.button&&(!n||!ra(o,`.${n}`,e))&&(!r||ra(o,r,e))});return a.call(t),()=>{a.on(".drag",null)}}a.on(".drag",null)}},[e,t,n,r,i,d,o,c,S]),f}function fa(){const e=Ir(),t=s(t=>{const{nodeInternals:n,nodeExtent:r,updateNodePositions:o,getNodes:i,snapToGrid:a,snapGrid:s,onError:l,nodesDraggable:c}=e.getState(),u=i().filter(e=>e.selected&&(e.draggable||c&&void 0===e.draggable)),d=a?s[0]:5,f=a?s[1]:5,p=t.isShiftPressed?4:1,h=t.x*d*p,m=t.y*f*p,g=u.map(e=>{if(e.positionAbsolute){const t={x:e.positionAbsolute.x+h,y:e.positionAbsolute.y+m};a&&(t.x=s[0]*Math.round(t.x/s[0]),t.y=s[1]*Math.round(t.y/s[1]));const{positionAbsolute:o,position:i}=ia(e,t,n,r,void 0,l);e.position=i,e.positionAbsolute=o}return e});o(g,!0,!1)},[]);return t}const pa={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}};var ha=e=>{const n=({id:n,type:r,data:o,xPos:i,yPos:s,xPosOrigin:c,yPosOrigin:u,selected:d,onClick:f,onMouseEnter:p,onMouseMove:h,onMouseLeave:m,onContextMenu:g,onDoubleClick:y,style:b,className:w,isDraggable:x,isSelectable:E,isConnectable:S,isFocusable:_,selectNodesOnDrag:C,sourcePosition:k,targetPosition:N,hidden:M,resizeObserver:O,dragHandle:A,zIndex:P,isParent:R,noDragClassName:T,noPanClassName:D,initialized:$,disableKeyboardA11y:I,ariaLabel:z,rfId:L,hasHandleBounds:B})=>{const F=Ir(),H=l(null),W=l(null),V=l(k),Y=l(N),j=l(r),X=E||x||f||p||h||m,K=fa(),U=la(n,F.getState,p),q=la(n,F.getState,h),Z=la(n,F.getState,m),G=la(n,F.getState,g),Q=la(n,F.getState,y);a(()=>()=>{W.current&&(O?.unobserve(W.current),W.current=null)},[]),a(()=>{if(H.current&&!M){const e=H.current;$&&B&&W.current===e||(W.current&&O?.unobserve(W.current),O?.observe(e),W.current=e)}},[M,$,B]),a(()=>{const e=j.current!==r,t=V.current!==k,o=Y.current!==N;H.current&&(e||t||o)&&(e&&(j.current=r),t&&(V.current=k),o&&(Y.current=N),F.getState().updateNodeDimensions([{id:n,nodeElement:H.current,forceUpdate:!0}]))},[n,r,k,N]);const J=da({nodeRef:H,disabled:M||!x,noDragClassName:T,handleSelector:A,nodeId:n,isSelectable:E,selectNodesOnDrag:C});return M?null:t.createElement("div",{className:v(["react-flow__node",`react-flow__node-${r}`,{[D]:x},w,{selected:d,selectable:E,parent:R,dragging:J}]),ref:H,style:{zIndex:P,transform:`translate(${c}px,${u}px)`,pointerEvents:X?"all":"none",visibility:$?"visible":"hidden",...b},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:U,onMouseMove:q,onMouseLeave:Z,onContextMenu:G,onClick:e=>{const{nodeDragThreshold:t}=F.getState();if(E&&(!C||!x||t>0)&&ca({id:n,store:F,nodeRef:H}),f){const t=F.getState().nodeInternals.get(n);t&&f(e,{...t})}},onDoubleClick:Q,onKeyDown:_?e=>{if(!eo(e)&&!I)if(Qr.includes(e.key)&&E){const t="Escape"===e.key;ca({id:n,store:F,unselect:t,nodeRef:H})}else x&&d&&Object.prototype.hasOwnProperty.call(pa,e.key)&&(F.setState({ariaLiveMessage:`Moved selected node ${e.key.replace("Arrow","").toLowerCase()}. New position, x: ${~~i}, y: ${~~s}`}),K({x:pa[e.key].x,y:pa[e.key].y,isShiftPressed:e.shiftKey}))}:void 0,tabIndex:_?0:void 0,role:_?"button":void 0,"aria-describedby":I?void 0:`${bi}-${L}`,"aria-label":z},t.createElement(Ao,{value:n},t.createElement(e,{id:n,data:o,type:r,xPos:i,yPos:s,selected:d,isConnectable:S,sourcePosition:k,targetPosition:N,dragging:J,dragHandle:A,zIndex:P})))};return n.displayName="NodeWrapper",r(n)};const ma=e=>{const t=e.getNodes().filter(e=>e.selected);return{...zo(t,e.nodeOrigin),transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`,userSelectionActive:e.userSelectionActive}};var ga=r(function({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:r}){const o=Ir(),{width:i,height:s,x:c,y:u,transformString:d,userSelectionActive:f}=$r(ma,B),p=fa(),h=l(null);if(a(()=>{r||h.current?.focus({preventScroll:!0})},[r]),da({nodeRef:h}),f||!i||!s)return null;const m=e?t=>{const n=o.getState().getNodes().filter(e=>e.selected);e(t,n)}:void 0;return t.createElement("div",{className:v(["react-flow__nodesselection","react-flow__container",n]),style:{transform:d}},t.createElement("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:r?void 0:-1,onKeyDown:r?void 0:e=>{Object.prototype.hasOwnProperty.call(pa,e.key)&&p({x:pa[e.key].x,y:pa[e.key].y,isShiftPressed:e.shiftKey})},style:{width:i,height:s,top:u,left:c}}))});const ya=e=>e.nodesSelectionActive,va=({children:e,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:l,deleteKeyCode:c,onMove:u,onMoveStart:d,onMoveEnd:f,selectionKeyCode:p,selectionOnDrag:h,selectionMode:m,onSelectionStart:g,onSelectionEnd:y,multiSelectionKeyCode:v,panActivationKeyCode:b,zoomActivationKeyCode:w,elementsSelectable:x,zoomOnScroll:E,zoomOnPinch:S,panOnScroll:_,panOnScrollSpeed:C,panOnScrollMode:k,zoomOnDoubleClick:N,panOnDrag:M,defaultViewport:O,translateExtent:A,minZoom:P,maxZoom:R,preventScrolling:T,onSelectionContextMenu:D,noWheelClassName:$,noPanClassName:I,disableKeyboardA11y:z})=>{const L=$r(ya),B=_i(p),F=_i(b),H=F||M,W=F||_,V=B||h&&!0!==H;return(({deleteKeyCode:e,multiSelectionKeyCode:t})=>{const n=Ir(),{deleteElements:r}=zi(),o=_i(e,Li),i=_i(t);a(()=>{if(o){const{edges:e,getNodes:t}=n.getState(),o=t().filter(e=>e.selected),i=e.filter(e=>e.selected);r({nodes:o,edges:i}),n.setState({nodesSelectionActive:!1})}},[o]),a(()=>{n.setState({multiSelectionActive:i})},[i])})({deleteKeyCode:c,multiSelectionKeyCode:v}),t.createElement(ji,{onMove:u,onMoveStart:d,onMoveEnd:f,onPaneContextMenu:s,elementsSelectable:x,zoomOnScroll:E,zoomOnPinch:S,panOnScroll:W,panOnScrollSpeed:C,panOnScrollMode:k,zoomOnDoubleClick:N,panOnDrag:!B&&H,defaultViewport:O,translateExtent:A,minZoom:P,maxZoom:R,zoomActivationKeyCode:w,preventScrolling:T,noWheelClassName:$,noPanClassName:I},t.createElement(ta,{onSelectionStart:g,onSelectionEnd:y,onPaneClick:n,onPaneMouseEnter:r,onPaneMouseMove:o,onPaneMouseLeave:i,onPaneContextMenu:s,onPaneScroll:l,panOnDrag:H,isSelecting:!!V,selectionMode:m},e,L&&t.createElement(ga,{onSelectionContextMenu:D,noPanClassName:I,disableKeyboardA11y:z})))};va.displayName="FlowRenderer";var ba=r(va);function wa(e){return{...{input:ha(e.input||ri),default:ha(e.default||ti),output:ha(e.output||ii),group:ha(e.group||ai)},...Object.keys(e).filter(e=>!["input","default","output","group"].includes(e)).reduce((t,n)=>(t[n]=ha(e[n]||ti),t),{})}}const xa=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,updateNodeDimensions:e.updateNodeDimensions,onError:e.onError}),Ea=e=>{const{nodesDraggable:n,nodesConnectable:r,nodesFocusable:i,elementsSelectable:c,updateNodeDimensions:u,onError:d}=$r(xa,B),f=(p=e.onlyRenderVisibleElements,$r(s(e=>p?Lo(e.nodeInternals,{x:0,y:0,width:e.width,height:e.height},e.transform,!0):e.getNodes(),[p])));var p;const h=l(),m=o(()=>{if("undefined"==typeof ResizeObserver)return null;const e=new ResizeObserver(e=>{const t=e.map(e=>({id:e.target.getAttribute("data-id"),nodeElement:e.target,forceUpdate:!0}));u(t)});return h.current=e,e},[]);return a(()=>()=>{h?.current?.disconnect()},[]),t.createElement("div",{className:"react-flow__nodes",style:Bi},f.map(o=>{let a=o.type||"default";e.nodeTypes[a]||(d?.("003",Cr(a)),a="default");const s=e.nodeTypes[a]||e.nodeTypes.default,l=!!(o.draggable||n&&void 0===o.draggable),u=!!(o.selectable||c&&void 0===o.selectable),f=!!(o.connectable||r&&void 0===o.connectable),p=!!(o.focusable||i&&void 0===o.focusable),h=e.nodeExtent?Vr(o.positionAbsolute,e.nodeExtent):o.positionAbsolute,g=h?.x??0,y=h?.y??0,v=(({x:e,y:t,width:n,height:r,origin:o})=>n&&r?o[0]<0||o[1]<0||o[0]>1||o[1]>1?{x:e,y:t}:{x:e-n*o[0],y:t-r*o[1]}:{x:e,y:t})({x:g,y:y,width:o.width??0,height:o.height??0,origin:e.nodeOrigin});return t.createElement(s,{key:o.id,id:o.id,className:o.className,style:o.style,type:a,data:o.data,sourcePosition:o.sourcePosition||ho.Bottom,targetPosition:o.targetPosition||ho.Top,hidden:o.hidden,xPos:g,yPos:y,xPosOrigin:v.x,yPosOrigin:v.y,selectNodesOnDrag:e.selectNodesOnDrag,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,selected:!!o.selected,isDraggable:l,isSelectable:u,isConnectable:f,isFocusable:p,resizeObserver:m,dragHandle:o.dragHandle,zIndex:o[Gr]?.z??0,isParent:!!o[Gr]?.isParent,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,initialized:!!o.width&&!!o.height,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,ariaLabel:o.ariaLabel,hasHandleBounds:!!o[Gr]?.handleBounds})}))};Ea.displayName="NodeRenderer";var Sa=r(Ea);const _a=(e,t,n)=>n===ho.Left?e-t:n===ho.Right?e+t:e,Ca=(e,t,n)=>n===ho.Top?e-t:n===ho.Bottom?e+t:e,ka="react-flow__edgeupdater",Na=({position:e,centerX:n,centerY:r,radius:o=10,onMouseDown:i,onMouseEnter:a,onMouseOut:s,type:l})=>t.createElement("circle",{onMouseDown:i,onMouseEnter:a,onMouseOut:s,className:v([ka,`${ka}-${l}`]),cx:_a(n,o,e),cy:Ca(r,o,e),r:o,stroke:"transparent",fill:"transparent"}),Ma=()=>!0;var Oa=e=>{const n=({id:n,className:r,type:i,data:a,onClick:s,onEdgeDoubleClick:c,selected:d,animated:f,label:p,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:b,style:w,source:x,target:E,sourceX:S,sourceY:_,targetX:C,targetY:k,sourcePosition:N,targetPosition:M,elementsSelectable:O,hidden:A,sourceHandleId:P,targetHandleId:R,onContextMenu:T,onMouseEnter:D,onMouseMove:$,onMouseLeave:I,reconnectRadius:z,onReconnect:L,onReconnectStart:B,onReconnectEnd:F,markerEnd:H,markerStart:W,rfId:V,ariaLabel:Y,isFocusable:j,isReconnectable:X,pathOptions:K,interactionWidth:U,disableKeyboardA11y:q})=>{const Z=l(null),[G,Q]=u(!1),[J,ee]=u(!1),te=Ir(),ne=o(()=>`url('#${Ro(W,V)}')`,[W,V]),re=o(()=>`url('#${Ro(H,V)}')`,[H,V]);if(A)return null;const oe=io(n,te.getState,c),ie=io(n,te.getState,T),ae=io(n,te.getState,D),se=io(n,te.getState,$),le=io(n,te.getState,I),ce=(e,t)=>{if(0!==e.button)return;const{edges:r,isValidConnection:o}=te.getState(),i=t?E:x,a=(t?R:P)||null,s=t?"target":"source",l=o||Ma,c=t,u=r.find(e=>e.id===n);ee(!0),B?.(e,u,s);qo({event:e,handleId:a,nodeId:i,onConnect:e=>L?.(u,e),isTarget:c,getState:te.getState,setState:te.setState,isValidConnection:l,edgeUpdaterType:s,onReconnectEnd:e=>{ee(!1),F?.(e,u,s)}})},ue=()=>Q(!0),de=()=>Q(!1),fe=!O&&!s;return t.createElement("g",{className:v(["react-flow__edge",`react-flow__edge-${i}`,r,{selected:d,animated:f,inactive:fe,updating:G}]),onClick:e=>{const{edges:t,addSelectedEdges:r,unselectNodesAndEdges:o,multiSelectionActive:i}=te.getState(),a=t.find(e=>e.id===n);a&&(O&&(te.setState({nodesSelectionActive:!1}),a.selected&&i?(o({nodes:[],edges:[a]}),Z.current?.blur()):r([n])),s&&s(e,a))},onDoubleClick:oe,onContextMenu:ie,onMouseEnter:ae,onMouseMove:se,onMouseLeave:le,onKeyDown:j?e=>{if(!q&&Qr.includes(e.key)&&O){const{unselectNodesAndEdges:t,addSelectedEdges:r,edges:o}=te.getState();"Escape"===e.key?(Z.current?.blur(),t({edges:[o.find(e=>e.id===n)]})):r([n])}}:void 0,tabIndex:j?0:void 0,role:j?"button":"img","data-testid":`rf__edge-${n}`,"aria-label":null===Y?void 0:Y||`Edge from ${x} to ${E}`,"aria-describedby":j?`${wi}-${V}`:void 0,ref:Z},!J&&t.createElement(e,{id:n,source:x,target:E,selected:d,animated:f,label:p,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:b,data:a,style:w,sourceX:S,sourceY:_,targetX:C,targetY:k,sourcePosition:N,targetPosition:M,sourceHandleId:P,targetHandleId:R,markerStart:ne,markerEnd:re,pathOptions:K,interactionWidth:U}),X&&t.createElement(t.Fragment,null,("source"===X||!0===X)&&t.createElement(Na,{position:N,centerX:S,centerY:_,radius:z,onMouseDown:e=>ce(e,!0),onMouseEnter:ue,onMouseOut:de,type:"source"}),("target"===X||!0===X)&&t.createElement(Na,{position:M,centerX:C,centerY:k,radius:z,onMouseDown:e=>ce(e,!1),onMouseEnter:ue,onMouseOut:de,type:"target"})))};return n.displayName="EdgeWrapper",r(n)};function Aa(e){return{...{default:Oa(e.default||Mo),straight:Oa(e.bezier||_o),step:Oa(e.step||So),smoothstep:Oa(e.step||Eo),simplebezier:Oa(e.simplebezier||yo)},...Object.keys(e).filter(e=>!["default","bezier"].includes(e)).reduce((t,n)=>(t[n]=Oa(e[n]||Mo),t),{})}}function Pa(e,t,n=null){const r=(n?.x||0)+t.x,o=(n?.y||0)+t.y,i=n?.width||t.width,a=n?.height||t.height;switch(e){case ho.Top:return{x:r+i/2,y:o};case ho.Right:return{x:r+i,y:o+a/2};case ho.Bottom:return{x:r+i/2,y:o+a};case ho.Left:return{x:r,y:o+a/2}}}function Ra(e,t){return e?1!==e.length&&t?t&&e.find(e=>e.id===t)||null:e[0]:null}function Ta(e){const t=e?.[Gr]?.handleBounds||null,n=t&&e?.width&&e?.height&&void 0!==e?.positionAbsolute?.x&&void 0!==e?.positionAbsolute?.y;return[{x:e?.positionAbsolute?.x||0,y:e?.positionAbsolute?.y||0,width:e?.width||0,height:e?.height||0},t,!!n]}const Da=[{level:0,isMaxLevel:!0,edges:[]}];function $a(e,t,n){return function(e,t,n=!1){let r=-1;const o=e.reduce((e,o)=>{const i=Zr(o.zIndex);let a=i?o.zIndex:0;if(n){const e=t.get(o.target),n=t.get(o.source),r=o.selected||e?.selected||n?.selected,s=Math.max(n?.[Gr]?.z||0,e?.[Gr]?.z||0,1e3);a=(i?o.zIndex:0)+(r?s:0)}return e[a]?e[a].push(o):e[a]=[o],r=a>r?a:r,e},{}),i=Object.entries(o).map(([e,t])=>{const n=+e;return{edges:t,level:n,isMaxLevel:n===r}});return 0===i.length?Da:i}($r(s(n=>e?n.edges.filter(e=>{const r=t.get(e.source),o=t.get(e.target);return r?.width&&r?.height&&o?.width&&o?.height&&function({sourcePos:e,targetPos:t,sourceWidth:n,sourceHeight:r,targetWidth:o,targetHeight:i,width:a,height:s,transform:l}){const c={x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x+n,t.x+o),y2:Math.max(e.y+r,t.y+i)};c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u=Kr({x:(0-l[0])/l[2],y:(0-l[1])/l[2],width:a/l[2],height:s/l[2]}),d=Math.max(0,Math.min(u.x2,c.x2)-Math.max(u.x,c.x)),f=Math.max(0,Math.min(u.y2,c.y2)-Math.max(u.y,c.y));return Math.ceil(d*f)>0}({sourcePos:r.positionAbsolute||{x:0,y:0},targetPos:o.positionAbsolute||{x:0,y:0},sourceWidth:r.width,sourceHeight:r.height,targetWidth:o.width,targetHeight:o.height,width:n.width,height:n.height,transform:n.transform})}):n.edges,[e,t])),t,n)}const Ia={[po.Arrow]:({color:e="none",strokeWidth:n=1})=>t.createElement("polyline",{style:{stroke:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",fill:"none",points:"-5,-4 0,0 -5,4"}),[po.ArrowClosed]:({color:e="none",strokeWidth:n=1})=>t.createElement("polyline",{style:{stroke:e,fill:e,strokeWidth:n},strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})};const za=({id:e,type:n,color:r,width:i=12.5,height:a=12.5,markerUnits:s="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const u=function(e){const t=Ir();return o(()=>Object.prototype.hasOwnProperty.call(Ia,e)?Ia[e]:(t.getState().onError?.("009",Or(e)),null),[e])}(n);return u?t.createElement("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${i}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:c,refX:"0",refY:"0"},t.createElement(u,{color:r,strokeWidth:l})):null},La=({defaultColor:e,rfId:n})=>{const r=$r(s((({defaultColor:e,rfId:t})=>n=>{const r=[];return n.edges.reduce((n,o)=>([o.markerStart,o.markerEnd].forEach(o=>{if(o&&"object"==typeof o){const i=Ro(o,t);r.includes(i)||(n.push({id:i,color:o.color||e,...o}),r.push(i))}}),n),[]).sort((e,t)=>e.id.localeCompare(t.id))})({defaultColor:e,rfId:n}),[e,n]),(e,t)=>!(e.length!==t.length||e.some((e,n)=>e.id!==t[n].id)));return t.createElement("defs",null,r.map(e=>t.createElement(za,{id:e.id,key:e.id,type:e.type,color:e.color,width:e.width,height:e.height,markerUnits:e.markerUnits,strokeWidth:e.strokeWidth,orient:e.orient})))};La.displayName="MarkerDefinitions";var Ba=r(La);const Fa=e=>({nodesConnectable:e.nodesConnectable,edgesFocusable:e.edgesFocusable,edgesUpdatable:e.edgesUpdatable,elementsSelectable:e.elementsSelectable,width:e.width,height:e.height,connectionMode:e.connectionMode,nodeInternals:e.nodeInternals,onError:e.onError}),Ha=({defaultMarkerColor:e,onlyRenderVisibleElements:n,elevateEdgesOnSelect:r,rfId:o,edgeTypes:i,noPanClassName:a,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:c,onEdgeMouseLeave:u,onEdgeClick:d,onEdgeDoubleClick:f,onReconnect:p,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,children:y,disableKeyboardA11y:b})=>{const{edgesFocusable:w,edgesUpdatable:x,elementsSelectable:E,width:S,height:_,connectionMode:C,nodeInternals:k,onError:N}=$r(Fa,B),M=$a(n,k,r);return S?t.createElement(t.Fragment,null,M.map(({level:n,edges:r,isMaxLevel:y})=>t.createElement("svg",{key:n,style:{zIndex:n},width:S,height:_,className:"react-flow__edges react-flow__container"},y&&t.createElement(Ba,{defaultColor:e,rfId:o}),t.createElement("g",null,r.map(e=>{const[n,r,y]=Ta(k.get(e.source)),[S,_,M]=Ta(k.get(e.target));if(!y||!M)return null;let O=e.type||"default";i[O]||(N?.("011",Rr(O)),O="default");const A=i[O]||i.default,P=C===lo.Strict?_.target:(_.target??[]).concat(_.source??[]),R=Ra(r.source,e.sourceHandle),T=Ra(P,e.targetHandle),D=R?.position||ho.Bottom,$=T?.position||ho.Top,I=!!(e.focusable||w&&void 0===e.focusable),z=e.reconnectable||e.updatable,L=void 0!==p&&(z||x&&void 0===z);if(!R||!T)return N?.("008",Ar(R,e)),null;const{sourceX:B,sourceY:F,targetX:H,targetY:W}=((e,t,n,r,o,i)=>{const a=Pa(n,e,t),s=Pa(i,r,o);return{sourceX:a.x,sourceY:a.y,targetX:s.x,targetY:s.y}})(n,R,D,S,T,$);return t.createElement(A,{key:e.id,id:e.id,className:v([e.className,a]),type:O,data:e.data,selected:!!e.selected,animated:!!e.animated,hidden:!!e.hidden,label:e.label,labelStyle:e.labelStyle,labelShowBg:e.labelShowBg,labelBgStyle:e.labelBgStyle,labelBgPadding:e.labelBgPadding,labelBgBorderRadius:e.labelBgBorderRadius,style:e.style,source:e.source,target:e.target,sourceHandleId:e.sourceHandle,targetHandleId:e.targetHandle,markerEnd:e.markerEnd,markerStart:e.markerStart,sourceX:B,sourceY:F,targetX:H,targetY:W,sourcePosition:D,targetPosition:$,elementsSelectable:E,onContextMenu:s,onMouseEnter:l,onMouseMove:c,onMouseLeave:u,onClick:d,onEdgeDoubleClick:f,onReconnect:p,onReconnectStart:h,onReconnectEnd:m,reconnectRadius:g,rfId:o,ariaLabel:e.ariaLabel,isFocusable:I,isReconnectable:L,pathOptions:"pathOptions"in e?e.pathOptions:void 0,interactionWidth:e.interactionWidth,disableKeyboardA11y:b})})))),y):null};Ha.displayName="EdgeRenderer";var Wa=r(Ha);const Va=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function Ya({children:e}){const n=$r(Va);return t.createElement("div",{className:"react-flow__viewport react-flow__container",style:{transform:n}},e)}const ja={[ho.Left]:ho.Right,[ho.Right]:ho.Left,[ho.Top]:ho.Bottom,[ho.Bottom]:ho.Top},Xa=({nodeId:e,handleType:n,style:r,type:o=fo.Bezier,CustomComponent:i,connectionStatus:a})=>{const{fromNode:l,handleId:c,toX:u,toY:d,connectionMode:f}=$r(s(t=>({fromNode:t.nodeInternals.get(e),handleId:t.connectionHandleId,toX:(t.connectionPosition.x-t.transform[0])/t.transform[2],toY:(t.connectionPosition.y-t.transform[1])/t.transform[2],connectionMode:t.connectionMode}),[e]),B),p=l?.[Gr]?.handleBounds;let h=p?.[n];if(f===lo.Loose&&(h=h||p?.["source"===n?"target":"source"]),!l||!h)return null;const m=c?h.find(e=>e.id===c):h[0],g=m?m.x+m.width/2:(l.width??0)/2,y=m?m.y+m.height/2:l.height??0,v=(l.positionAbsolute?.x??0)+g,b=(l.positionAbsolute?.y??0)+y,w=m?.position,x=w?ja[w]:null;if(!w||!x)return null;if(i)return t.createElement(i,{connectionLineType:o,connectionLineStyle:r,fromNode:l,fromHandle:m,fromX:v,fromY:b,toX:u,toY:d,fromPosition:w,toPosition:x,connectionStatus:a});let E="";const S={sourceX:v,sourceY:b,sourcePosition:w,targetX:u,targetY:d,targetPosition:x};return o===fo.Bezier?[E]=No(S):o===fo.Step?[E]=xo({...S,borderRadius:0}):o===fo.SmoothStep?[E]=xo(S):o===fo.SimpleBezier?[E]=go(S):E=`M${v},${b} ${u},${d}`,t.createElement("path",{d:E,fill:"none",className:"react-flow__connection-path",style:r})};Xa.displayName="ConnectionLine";const Ka=e=>({nodeId:e.connectionNodeId,handleType:e.connectionHandleType,nodesConnectable:e.nodesConnectable,connectionStatus:e.connectionStatus,width:e.width,height:e.height});function Ua({containerStyle:e,style:n,type:r,component:o}){const{nodeId:i,handleType:a,nodesConnectable:s,width:l,height:c,connectionStatus:u}=$r(Ka,B);return!!(i&&a&&l&&s)?t.createElement("svg",{style:e,width:l,height:c,className:"react-flow__edges react-flow__connectionline react-flow__container"},t.createElement("g",{className:v(["react-flow__connection",u])},t.createElement(Xa,{nodeId:i,handleType:a,style:n,type:r,CustomComponent:o,connectionStatus:u}))):null}function qa(e,t){const n=l(null),r=Ir();return o(()=>{if("development"===process.env.NODE_ENV){const t=Object.keys(e);B(n.current,t)&&r.getState().onError?.("002",_r()),n.current=t}return t(e)},[e])}const Za=({nodeTypes:e,edgeTypes:n,onMove:r,onMoveStart:o,onMoveEnd:i,onInit:s,onNodeClick:c,onEdgeClick:u,onNodeDoubleClick:d,onEdgeDoubleClick:f,onNodeMouseEnter:p,onNodeMouseMove:h,onNodeMouseLeave:m,onNodeContextMenu:g,onSelectionContextMenu:y,onSelectionStart:v,onSelectionEnd:b,connectionLineType:w,connectionLineStyle:x,connectionLineComponent:E,connectionLineContainerStyle:S,selectionKeyCode:_,selectionOnDrag:C,selectionMode:k,multiSelectionKeyCode:N,panActivationKeyCode:M,zoomActivationKeyCode:O,deleteKeyCode:A,onlyRenderVisibleElements:P,elementsSelectable:R,selectNodesOnDrag:T,defaultViewport:D,translateExtent:$,minZoom:I,maxZoom:z,preventScrolling:L,defaultMarkerColor:B,zoomOnScroll:F,zoomOnPinch:H,panOnScroll:W,panOnScrollSpeed:V,panOnScrollMode:Y,zoomOnDoubleClick:j,panOnDrag:X,onPaneClick:K,onPaneMouseEnter:U,onPaneMouseMove:q,onPaneMouseLeave:Z,onPaneScroll:G,onPaneContextMenu:Q,onEdgeContextMenu:J,onEdgeMouseEnter:ee,onEdgeMouseMove:te,onEdgeMouseLeave:ne,onReconnect:re,onReconnectStart:oe,onReconnectEnd:ie,reconnectRadius:ae,noDragClassName:se,noWheelClassName:le,noPanClassName:ce,elevateEdgesOnSelect:ue,disableKeyboardA11y:de,nodeOrigin:fe,nodeExtent:pe,rfId:he})=>{const me=qa(e,wa),ge=qa(n,Aa);return function(e){const t=zi(),n=l(!1);a(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}(s),t.createElement(ba,{onPaneClick:K,onPaneMouseEnter:U,onPaneMouseMove:q,onPaneMouseLeave:Z,onPaneContextMenu:Q,onPaneScroll:G,deleteKeyCode:A,selectionKeyCode:_,selectionOnDrag:C,selectionMode:k,onSelectionStart:v,onSelectionEnd:b,multiSelectionKeyCode:N,panActivationKeyCode:M,zoomActivationKeyCode:O,elementsSelectable:R,onMove:r,onMoveStart:o,onMoveEnd:i,zoomOnScroll:F,zoomOnPinch:H,zoomOnDoubleClick:j,panOnScroll:W,panOnScrollSpeed:V,panOnScrollMode:Y,panOnDrag:X,defaultViewport:D,translateExtent:$,minZoom:I,maxZoom:z,onSelectionContextMenu:y,preventScrolling:L,noDragClassName:se,noWheelClassName:le,noPanClassName:ce,disableKeyboardA11y:de},t.createElement(Ya,null,t.createElement(Wa,{edgeTypes:ge,onEdgeClick:u,onEdgeDoubleClick:f,onlyRenderVisibleElements:P,onEdgeContextMenu:J,onEdgeMouseEnter:ee,onEdgeMouseMove:te,onEdgeMouseLeave:ne,onReconnect:re,onReconnectStart:oe,onReconnectEnd:ie,reconnectRadius:ae,defaultMarkerColor:B,noPanClassName:ce,elevateEdgesOnSelect:!!ue,disableKeyboardA11y:de,rfId:he},t.createElement(Ua,{style:x,type:w,component:E,containerStyle:S})),t.createElement("div",{className:"react-flow__edgelabel-renderer"}),t.createElement(Sa,{nodeTypes:me,onNodeClick:c,onNodeDoubleClick:d,onNodeMouseEnter:p,onNodeMouseMove:h,onNodeMouseLeave:m,onNodeContextMenu:g,selectNodesOnDrag:T,onlyRenderVisibleElements:P,noPanClassName:ce,noDragClassName:se,disableKeyboardA11y:de,nodeOrigin:fe,nodeExtent:pe,rfId:he})))};Za.displayName="GraphView";var Ga=r(Za);const Qa=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Ja={rfId:"1",width:0,height:0,transform:[0,0,1],nodeInternals:new Map,edges:[],onNodesChange:null,onEdgesChange:null,hasDefaultNodes:!1,hasDefaultEdges:!1,d3Zoom:null,d3Selection:null,d3ZoomHandler:void 0,minZoom:.5,maxZoom:2,translateExtent:Qa,nodeExtent:Qa,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionNodeId:null,connectionHandleId:null,connectionHandleType:"source",connectionPosition:{x:0,y:0},connectionStatus:null,connectionMode:lo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:[0,0],nodeDragThreshold:0,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesUpdatable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,fitViewOnInit:!1,fitViewOnInitDone:!1,fitViewOnInitOptions:void 0,onSelectionChange:[],multiSelectionActive:!1,connectionStartHandle:null,connectionEndHandle:null,connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,connectionRadius:20,onError:Jr,isValidConnection:void 0},es=()=>{return e=(e,t)=>({...Ja,setNodes:n=>{const{nodeInternals:r,nodeOrigin:o,elevateNodesOnSelect:i}=t();e({nodeInternals:Oi(n,r,o,i)})},getNodes:()=>Array.from(t().nodeInternals.values()),setEdges:n=>{const{defaultEdgeOptions:r={}}=t();e({edges:n.map(e=>({...r,...e}))})},setDefaultNodesAndEdges:(n,r)=>{const o=void 0!==n,i=void 0!==r,a=o?Oi(n,new Map,t().nodeOrigin,t().elevateNodesOnSelect):new Map;e({nodeInternals:a,edges:i?r:[],hasDefaultNodes:o,hasDefaultEdges:i})},updateNodeDimensions:n=>{const{onNodesChange:r,nodeInternals:o,fitViewOnInit:i,fitViewOnInitDone:a,fitViewOnInitOptions:s,domNode:l,nodeOrigin:c}=t(),u=l?.querySelector(".react-flow__viewport");if(!u)return;const d=window.getComputedStyle(u),{m22:f}=new window.DOMMatrixReadOnly(d.transform),p=n.reduce((e,t)=>{const n=o.get(t.id);if(n?.hidden)o.set(n.id,{...n,[Gr]:{...n[Gr],handleBounds:void 0}});else if(n){const r=Hr(t.nodeElement);r.width&&r.height&&(n.width!==r.width||n.height!==r.height||t.forceUpdate)&&(o.set(n.id,{...n,[Gr]:{...n[Gr],handleBounds:{source:sa(".source",t.nodeElement,f,c),target:sa(".target",t.nodeElement,f,c)}},...r}),e.push({id:n.id,type:"dimensions",dimensions:r}))}return e},[]);Mi(o,c);const h=a||i&&!a&&Ai(t,{initial:!0,...s});e({nodeInternals:new Map(o),fitViewOnInitDone:h}),p?.length>0&&r?.(p)},updateNodePositions:(e,n=!0,r=!1)=>{const{triggerNodeChanges:o}=t(),i=e.map(e=>{const t={id:e.id,type:"position",dragging:r};return n&&(t.positionAbsolute=e.positionAbsolute,t.position=e.position),t});o(i)},triggerNodeChanges:n=>{const{onNodesChange:r,nodeInternals:o,hasDefaultNodes:i,nodeOrigin:a,getNodes:s,elevateNodesOnSelect:l}=t();if(n?.length){if(i){const t=Oi(Zi(n,s()),o,a,l);e({nodeInternals:t})}r?.(n)}},addSelectedNodes:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let a,s=null;r?a=n.map(e=>Gi(e,!0)):(a=Qi(i(),n),s=Qi(o,[])),Ti({changedNodes:a,changedEdges:s,get:t,set:e})},addSelectedEdges:n=>{const{multiSelectionActive:r,edges:o,getNodes:i}=t();let a,s=null;r?a=n.map(e=>Gi(e,!0)):(a=Qi(o,n),s=Qi(i(),[])),Ti({changedNodes:s,changedEdges:a,get:t,set:e})},unselectNodesAndEdges:({nodes:n,edges:r}={})=>{const{edges:o,getNodes:i}=t(),a=r||o;Ti({changedNodes:(n||i()).map(e=>(e.selected=!1,Gi(e.id,!1))),changedEdges:a.map(e=>Gi(e.id,!1)),get:t,set:e})},setMinZoom:n=>{const{d3Zoom:r,maxZoom:o}=t();r?.scaleExtent([n,o]),e({minZoom:n})},setMaxZoom:n=>{const{d3Zoom:r,minZoom:o}=t();r?.scaleExtent([o,n]),e({maxZoom:n})},setTranslateExtent:n=>{t().d3Zoom?.translateExtent(n),e({translateExtent:n})},resetSelectedElements:()=>{const{edges:n,getNodes:r}=t();Ti({changedNodes:r().filter(e=>e.selected).map(e=>Gi(e.id,!1)),changedEdges:n.filter(e=>e.selected).map(e=>Gi(e.id,!1)),get:t,set:e})},setNodeExtent:n=>{const{nodeInternals:r}=t();r.forEach(e=>{e.positionAbsolute=Vr(e.position,n)}),e({nodeExtent:n,nodeInternals:new Map(r)})},panBy:e=>{const{transform:n,width:r,height:o,d3Zoom:i,d3Selection:a,translateExtent:s}=t();if(!i||!a||!e.x&&!e.y)return!1;const l=pr.translate(n[0]+e.x,n[1]+e.y).scale(n[2]),c=[[0,0],[r,o]],u=i?.constrain()(l,c,s);return i.transform(a,u),n[0]!==u.x||n[1]!==u.y||n[2]!==u.k},cancelConnection:()=>e({connectionNodeId:Ja.connectionNodeId,connectionHandleId:Ja.connectionHandleId,connectionHandleType:Ja.connectionHandleType,connectionStatus:Ja.connectionStatus,connectionStartHandle:Ja.connectionStartHandle,connectionEndHandle:Ja.connectionEndHandle}),reset:()=>e({...Ja})}),t=Object.is,e?L(e,t):L;var e,t},ts=({children:e})=>{const n=l(null);return n.current||(n.current=es()),t.createElement(Sr,{value:n.current},e)};ts.displayName="ReactFlowProvider";const ns=({children:e})=>c(Er)?t.createElement(t.Fragment,null,e):t.createElement(ts,null,e);ns.displayName="ReactFlowWrapper";const rs={input:ri,default:ti,output:ii,group:ai},os={default:Mo,straight:_o,step:So,smoothstep:Eo,simplebezier:yo},is=[0,0],as=[15,15],ss={x:0,y:0,zoom:1},ls={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0},cs=i(({nodes:e,edges:n,defaultNodes:r,defaultEdges:o,className:i,nodeTypes:a=rs,edgeTypes:s=os,onNodeClick:l,onEdgeClick:c,onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:b,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:N,onNodesDelete:M,onEdgesDelete:O,onSelectionChange:A,onSelectionDragStart:P,onSelectionDrag:R,onSelectionDragStop:T,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:I,connectionMode:z=lo.Strict,connectionLineType:L=fo.Bezier,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:H,deleteKeyCode:W="Backspace",selectionKeyCode:V="Shift",selectionOnDrag:Y=!1,selectionMode:j=uo.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:K=(ro()?"Meta":"Control"),zoomActivationKeyCode:U=(ro()?"Meta":"Control"),snapToGrid:q=!1,snapGrid:Z=as,onlyRenderVisibleElements:G=!1,selectNodesOnDrag:Q=!0,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,nodeOrigin:ne=is,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ie,defaultViewport:ae=ss,minZoom:se=.5,maxZoom:le=2,translateExtent:ce=Qa,preventScrolling:ue=!0,nodeExtent:de,defaultMarkerColor:fe="#b1b1b7",zoomOnScroll:pe=!0,zoomOnPinch:he=!0,panOnScroll:me=!1,panOnScrollSpeed:ge=.5,panOnScrollMode:ye=co.Free,zoomOnDoubleClick:ve=!0,panOnDrag:be=!0,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ee,onPaneMouseLeave:Se,onPaneScroll:_e,onPaneContextMenu:Ce,children:ke,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Oe,onEdgeMouseMove:Ae,onEdgeMouseLeave:Pe,onEdgeUpdate:Re,onEdgeUpdateStart:Te,onEdgeUpdateEnd:De,onReconnect:$e,onReconnectStart:Ie,onReconnectEnd:ze,reconnectRadius:Le=10,edgeUpdaterRadius:Be=10,onNodesChange:Fe,onEdgesChange:He,noDragClassName:We="nodrag",noWheelClassName:Ve="nowheel",noPanClassName:Ye="nopan",fitView:je=!1,fitViewOptions:Xe,connectOnClick:Ke=!0,attributionPosition:Ue,proOptions:qe,defaultEdgeOptions:Ze,elevateNodesOnSelect:Ge=!0,elevateEdgesOnSelect:Qe=!1,disableKeyboardA11y:Je=!1,autoPanOnConnect:et=!0,autoPanOnNodeDrag:tt=!0,connectionRadius:nt=20,isValidConnection:rt,onError:ot,style:it,id:at,nodeDragThreshold:st,...lt},ct)=>{const ut=at||"1";return t.createElement("div",{...lt,style:{...it,...ls},ref:ct,className:v(["react-flow",i]),"data-testid":"rf__wrapper",id:at},t.createElement(ns,null,t.createElement(Ga,{onInit:u,onMove:d,onMoveStart:f,onMoveEnd:p,onNodeClick:l,onEdgeClick:c,onNodeMouseEnter:w,onNodeMouseMove:x,onNodeMouseLeave:E,onNodeContextMenu:S,onNodeDoubleClick:_,nodeTypes:a,edgeTypes:s,connectionLineType:L,connectionLineStyle:B,connectionLineComponent:F,connectionLineContainerStyle:H,selectionKeyCode:V,selectionOnDrag:Y,selectionMode:j,deleteKeyCode:W,multiSelectionKeyCode:K,panActivationKeyCode:X,zoomActivationKeyCode:U,onlyRenderVisibleElements:G,selectNodesOnDrag:Q,defaultViewport:ae,translateExtent:ce,minZoom:se,maxZoom:le,preventScrolling:ue,zoomOnScroll:pe,zoomOnPinch:he,zoomOnDoubleClick:ve,panOnScroll:me,panOnScrollSpeed:ge,panOnScrollMode:ye,panOnDrag:be,onPaneClick:we,onPaneMouseEnter:xe,onPaneMouseMove:Ee,onPaneMouseLeave:Se,onPaneScroll:_e,onPaneContextMenu:Ce,onSelectionContextMenu:D,onSelectionStart:$,onSelectionEnd:I,onEdgeContextMenu:Ne,onEdgeDoubleClick:Me,onEdgeMouseEnter:Oe,onEdgeMouseMove:Ae,onEdgeMouseLeave:Pe,onReconnect:$e??Re,onReconnectStart:Ie??Te,onReconnectEnd:ze??De,reconnectRadius:Le??Be,defaultMarkerColor:fe,noDragClassName:We,noWheelClassName:Ve,noPanClassName:Ye,elevateEdgesOnSelect:Qe,rfId:ut,disableKeyboardA11y:Je,nodeOrigin:ne,nodeExtent:de}),t.createElement(gi,{nodes:e,edges:n,defaultNodes:r,defaultEdges:o,onConnect:h,onConnectStart:m,onConnectEnd:g,onClickConnectStart:y,onClickConnectEnd:b,nodesDraggable:J,nodesConnectable:ee,nodesFocusable:te,edgesFocusable:re,edgesUpdatable:oe,elementsSelectable:ie,elevateNodesOnSelect:Ge,minZoom:se,maxZoom:le,nodeExtent:de,onNodesChange:Fe,onEdgesChange:He,snapToGrid:q,snapGrid:Z,connectionMode:z,translateExtent:ce,connectOnClick:Ke,defaultEdgeOptions:Ze,fitView:je,fitViewOptions:Xe,onNodesDelete:M,onEdgesDelete:O,onNodeDragStart:C,onNodeDrag:k,onNodeDragStop:N,onSelectionDrag:R,onSelectionDragStart:P,onSelectionDragStop:T,noPanClassName:Ye,nodeOrigin:ne,rfId:ut,autoPanOnConnect:et,autoPanOnNodeDrag:tt,onError:ot,connectionRadius:nt,isValidConnection:rt,nodeDragThreshold:st}),t.createElement(fi,{onSelectionChange:A}),ke,t.createElement(Br,{proOptions:qe,position:Ue}),t.createElement(Si,{rfId:ut,disableKeyboardA11y:Je})))});function us(e){return t=>{const[n,r]=u(t),o=s(t=>r(n=>e(t,n)),[]);return[n,r,o]}}cs.displayName="ReactFlow";const ds=us(Zi),fs=us(function(e,t){return qi(e,t)});var ps;function hs({color:e,dimensions:n,lineWidth:r}){return t.createElement("path",{stroke:e,strokeWidth:r,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`})}function ms({color:e,radius:n}){return t.createElement("circle",{cx:n,cy:n,r:n,fill:e})}!function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"}(ps||(ps={}));const gs={[ps.Dots]:"#91919a",[ps.Lines]:"#eee",[ps.Cross]:"#e2e2e2"},ys={[ps.Dots]:1,[ps.Lines]:1,[ps.Cross]:6},vs=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function bs({id:e,variant:n=ps.Dots,gap:r=20,size:o,lineWidth:i=1,offset:a=2,color:s,style:c,className:u}){const d=l(null),{transform:f,patternId:p}=$r(vs,B),h=s||gs[n],m=o||ys[n],g=n===ps.Dots,y=n===ps.Cross,b=Array.isArray(r)?r:[r,r],w=[b[0]*f[2]||1,b[1]*f[2]||1],x=m*f[2],E=y?[x,x]:w,S=g?[x/a,x/a]:[E[0]/a,E[1]/a];return t.createElement("svg",{className:v(["react-flow__background",u]),style:{...c,position:"absolute",width:"100%",height:"100%",top:0,left:0},ref:d,"data-testid":"rf__background"},t.createElement("pattern",{id:p+e,x:f[0]%w[0],y:f[1]%w[1],width:w[0],height:w[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${S[0]},-${S[1]})`},g?t.createElement(ms,{color:h,radius:x/a}):t.createElement(hs,{dimensions:E,color:h,lineWidth:i})),t.createElement("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${p+e})`}))}bs.displayName="Background";var ws=r(bs);!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}(".react-flow{direction:ltr}.react-flow__container{height:100%;left:0;position:absolute;top:0;width:100%}.react-flow__pane{cursor:-webkit-grab;cursor:grab;z-index:1}.react-flow__pane.selection{cursor:pointer}.react-flow__pane.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__viewport{pointer-events:none;transform-origin:0 0;z-index:2}.react-flow__renderer{z-index:4}.react-flow__selection{z-index:6}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible{outline:none}.react-flow .react-flow__edges{overflow:visible;pointer-events:none}.react-flow__connection-path,.react-flow__edge-path{stroke:#b1b1b7;stroke-width:1;fill:none}.react-flow__edge{cursor:pointer;pointer-events:visibleStroke}.react-flow__edge.animated path{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__edge.animated path.react-flow__edge-interaction{stroke-dasharray:none;-webkit-animation:none;animation:none}.react-flow__edge.inactive{pointer-events:none}.react-flow__edge.selected,.react-flow__edge:focus,.react-flow__edge:focus-visible{outline:none}.react-flow__edge.selected .react-flow__edge-path,.react-flow__edge:focus .react-flow__edge-path,.react-flow__edge:focus-visible .react-flow__edge-path{stroke:#555}.react-flow__edge-textwrapper{pointer-events:all}.react-flow__edge-textbg{fill:#fff}.react-flow__edge .react-flow__edge-text{pointer-events:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__connection{pointer-events:none}.react-flow__connection .animated{stroke-dasharray:5;-webkit-animation:dashdraw .5s linear infinite;animation:dashdraw .5s linear infinite}.react-flow__connectionline{z-index:1001}.react-flow__nodes{pointer-events:none;transform-origin:0 0}.react-flow__node{box-sizing:border-box;cursor:-webkit-grab;cursor:grab;pointer-events:all;position:absolute;transform-origin:0 0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.react-flow__node.dragging{cursor:-webkit-grabbing;cursor:grabbing}.react-flow__nodesselection{pointer-events:none;transform-origin:left top;z-index:3}.react-flow__nodesselection-rect{cursor:-webkit-grab;cursor:grab;pointer-events:all;position:absolute}.react-flow__handle{background:#1a192b;border:1px solid #fff;border-radius:100%;height:6px;min-height:5px;min-width:5px;pointer-events:none;position:absolute;width:6px}.react-flow__handle.connectionindicator{cursor:crosshair;pointer-events:all}.react-flow__handle-bottom{bottom:-4px;left:50%;top:auto;transform:translate(-50%)}.react-flow__handle-top{left:50%;top:-4px;transform:translate(-50%)}.react-flow__handle-left{left:-4px;top:50%;transform:translateY(-50%)}.react-flow__handle-right{right:-4px;top:50%;transform:translateY(-50%)}.react-flow__edgeupdater{cursor:move;pointer-events:all}.react-flow__panel{margin:15px;position:absolute;z-index:5}.react-flow__panel.top{top:0}.react-flow__panel.bottom{bottom:0}.react-flow__panel.left{left:0}.react-flow__panel.right{right:0}.react-flow__panel.center{left:50%;transform:translateX(-50%)}.react-flow__attribution{background:hsla(0,0%,100%,.5);font-size:10px;margin:0;padding:2px 3px}.react-flow__attribution a{color:#999;text-decoration:none}@-webkit-keyframes dashdraw{0%{stroke-dashoffset:10}}@keyframes dashdraw{0%{stroke-dashoffset:10}}.react-flow__edgelabel-renderer{height:100%;pointer-events:none;position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:100%}.react-flow__edge.updating .react-flow__edge-path{stroke:#777}.react-flow__edge-text{font-size:10px}.react-flow__node.selectable:focus,.react-flow__node.selectable:focus-visible{outline:none}.react-flow__node-default,.react-flow__node-group,.react-flow__node-input,.react-flow__node-output{background-color:#fff;border:1px solid #1a192b;border-radius:3px;color:#222;font-size:12px;padding:10px;text-align:center;width:150px}.react-flow__node-default.selectable:hover,.react-flow__node-group.selectable:hover,.react-flow__node-input.selectable:hover,.react-flow__node-output.selectable:hover{box-shadow:0 1px 4px 1px rgba(0,0,0,.08)}.react-flow__node-default.selectable.selected,.react-flow__node-default.selectable:focus,.react-flow__node-default.selectable:focus-visible,.react-flow__node-group.selectable.selected,.react-flow__node-group.selectable:focus,.react-flow__node-group.selectable:focus-visible,.react-flow__node-input.selectable.selected,.react-flow__node-input.selectable:focus,.react-flow__node-input.selectable:focus-visible,.react-flow__node-output.selectable.selected,.react-flow__node-output.selectable:focus,.react-flow__node-output.selectable:focus-visible{box-shadow:0 0 0 .5px #1a192b}.react-flow__node-group{background-color:hsla(0,0%,94%,.25)}.react-flow__nodesselection-rect,.react-flow__selection{background:rgba(0,89,220,.08);border:1px dotted rgba(0,89,220,.8)}.react-flow__nodesselection-rect:focus,.react-flow__nodesselection-rect:focus-visible,.react-flow__selection:focus,.react-flow__selection:focus-visible{outline:none}.react-flow__controls{box-shadow:0 0 2px 1px rgba(0,0,0,.08)}.react-flow__controls-button{align-items:center;background:#fefefe;border:none;border-bottom:1px solid #eee;box-sizing:content-box;cursor:pointer;display:flex;height:16px;justify-content:center;padding:5px;-webkit-user-select:none;-moz-user-select:none;user-select:none;width:16px}.react-flow__controls-button:hover{background:#f4f4f4}.react-flow__controls-button svg{max-height:12px;max-width:12px;width:100%}.react-flow__controls-button:disabled{pointer-events:none}.react-flow__controls-button:disabled svg{fill-opacity:.4}.react-flow__minimap{background-color:#fff}.react-flow__minimap svg{display:block}.react-flow__resize-control{position:absolute}.react-flow__resize-control.left,.react-flow__resize-control.right{cursor:ew-resize}.react-flow__resize-control.bottom,.react-flow__resize-control.top{cursor:ns-resize}.react-flow__resize-control.bottom.right,.react-flow__resize-control.top.left{cursor:nwse-resize}.react-flow__resize-control.bottom.left,.react-flow__resize-control.top.right{cursor:nesw-resize}.react-flow__resize-control.handle{background-color:#3367d9;border:1px solid #fff;border-radius:1px;height:4px;transform:translate(-50%,-50%);width:4px}.react-flow__resize-control.handle.left{left:0;top:50%}.react-flow__resize-control.handle.right{left:100%;top:50%}.react-flow__resize-control.handle.top{left:50%;top:0}.react-flow__resize-control.handle.bottom{left:50%;top:100%}.react-flow__resize-control.handle.bottom.left,.react-flow__resize-control.handle.top.left{left:0}.react-flow__resize-control.handle.bottom.right,.react-flow__resize-control.handle.top.right{left:100%}.react-flow__resize-control.line{border:0 solid #3367d9}.react-flow__resize-control.line.left,.react-flow__resize-control.line.right{height:100%;top:0;transform:translate(-50%);width:1px}.react-flow__resize-control.line.left{border-left-width:1px;left:0}.react-flow__resize-control.line.right{border-right-width:1px;left:100%}.react-flow__resize-control.line.bottom,.react-flow__resize-control.line.top{height:1px;left:0;transform:translateY(-50%);width:100%}.react-flow__resize-control.line.top{border-top-width:1px;top:0}.react-flow__resize-control.line.bottom{border-bottom-width:1px;top:100%}");
2
2
  /**
3
3
  * @license lucide-react v0.525.0 - ISC
4
4
  *
5
5
  * This source code is licensed under the ISC license.
6
6
  * See the LICENSE file in the root directory of this source tree.
7
7
  */
8
- const xs=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Ss=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),Es=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
8
+ const xs=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,n)=>n?n.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)},Es=(...e)=>e.filter((e,t,n)=>Boolean(e)&&""!==e.trim()&&n.indexOf(e)===t).join(" ").trim(),Ss=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0};
9
9
  /**
10
10
  * @license lucide-react v0.525.0 - ISC
11
11
  *
12
12
  * This source code is licensed under the ISC license.
13
13
  * See the LICENSE file in the root directory of this source tree.
14
14
  */
15
- var _s={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"};const Cs=a(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:a,iconNode:i,...s},l)=>d("svg",{ref:l,..._s,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:Ss("lucide",o),...!a&&!Es(s)&&{"aria-hidden":"true"},...s},[...i.map(([e,t])=>d(e,t)),...Array.isArray(a)?a:[a]])),ks=(e,t)=>{const n=a(({className:n,...r},o)=>{return d(Cs,{ref:o,iconNode:t,className:Ss(`lucide-${a=xs(e),a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r});var a});return n.displayName=xs(e),n},Ns=ks("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Ms=ks("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Ps=ks("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),Os=ks("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),As=ks("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Rs=ks("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Ts=ks("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]),Ds={colors:{background:"hsl(0 0% 100%)",foreground:"hsl(222.2 84% 4.9%)",card:"hsl(0 0% 100%)",cardForeground:"hsl(222.2 84% 4.9%)",popover:"hsl(0 0% 100%)",popoverForeground:"hsl(222.2 84% 4.9%)",primary:"hsl(221.2 83.2% 53.3%)",primaryForeground:"hsl(210 40% 98%)",secondary:"hsl(210 40% 96%)",secondaryForeground:"hsl(222.2 84% 4.9%)",muted:"hsl(210 40% 96%)",mutedForeground:"hsl(215.4 16.3% 46.9%)",accent:"hsl(210 40% 96%)",accentForeground:"hsl(222.2 84% 4.9%)",destructive:"hsl(0 84.2% 60.2%)",destructiveForeground:"hsl(210 40% 98%)",border:"hsl(214.3 31.8% 91.4%)",input:"hsl(214.3 31.8% 91.4%)",ring:"hsl(221.2 83.2% 53.3%)"},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},borderRadius:{sm:"calc(var(--radius) - 4px)",md:"calc(var(--radius) - 2px)",lg:"var(--radius)",xl:"0.75rem"},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"},transitions:{fast:"0.15s ease-in-out",normal:"0.2s ease-in-out",slow:"0.3s ease-in-out"}},$s={colors:{background:"hsl(222.2 84% 4.9%)",foreground:"hsl(210 40% 98%)",card:"hsl(222.2 84% 4.9%)",cardForeground:"hsl(210 40% 98%)",popover:"hsl(222.2 84% 4.9%)",popoverForeground:"hsl(210 40% 98%)",primary:"hsl(217.2 91.2% 59.8%)",primaryForeground:"hsl(222.2 84% 4.9%)",secondary:"hsl(217.2 32.6% 17.5%)",secondaryForeground:"hsl(210 40% 98%)",muted:"hsl(217.2 32.6% 17.5%)",mutedForeground:"hsl(215 20.2% 65.1%)",accent:"hsl(217.2 32.6% 17.5%)",accentForeground:"hsl(210 40% 98%)",destructive:"hsl(0 62.8% 30.6%)",destructiveForeground:"hsl(210 40% 98%)",border:"hsl(217.2 32.6% 17.5%)",input:"hsl(217.2 32.6% 17.5%)",ring:"hsl(224.3 76.3% 94.1%)"},spacing:Ds.spacing,borderRadius:Ds.borderRadius,fontSize:Ds.fontSize,fontWeight:Ds.fontWeight,shadows:Ds.shadows,transitions:Ds.transitions},Is=Ds,zs=()=>{const[e,t]=u(()=>{const e=localStorage.getItem("theme");return!!e&&"dark"===e}),[n,r]=u(e?$s:Ds);i(()=>{const t=document.documentElement;r(e?$s:Ds),e?(t.classList.add("dark"),localStorage.setItem("theme","dark")):(t.classList.remove("dark"),localStorage.setItem("theme","light"))},[e]);return{isDarkMode:e,theme:n,toggleTheme:()=>{t(!e)},setTheme:e=>{t("dark"===e)}}},Ls=({id:e,sourceX:n,sourceY:r,targetX:a,targetY:i,sourcePosition:s,targetPosition:l,style:c={},markerEnd:d,bidirectional:f=!1,data:p,clientToSvgCoords:h,svgRef:m})=>{u(!1);const{theme:g}=zs(),[y,v,b]=o(()=>No({sourceX:n,sourceY:r,targetX:a,targetY:i}),[n,r,a,i]),w={...c,stroke:(()=>{const e=p?.details?.state;switch(e){case"Open":case"Completed":default:return g.colors.mutedForeground;case"Error":return g.colors.destructive}})(),strokeWidth:c.strokeWidth||2};return t.createElement(t.Fragment,null,t.createElement(oo,{path:y,style:w}))};function Bs(){return Bs=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Bs.apply(null,arguments)}var Fs=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),Hs="-ms-",Ws="-moz-",Vs="-webkit-",js="comm",Ys="rule",Xs="decl",Ks="@keyframes",Us=Math.abs,qs=String.fromCharCode,Zs=Object.assign;function Gs(e){return e.trim()}function Qs(e,t,n){return e.replace(t,n)}function Js(e,t){return e.indexOf(t)}function el(e,t){return 0|e.charCodeAt(t)}function tl(e,t,n){return e.slice(t,n)}function nl(e){return e.length}function rl(e){return e.length}function ol(e,t){return t.push(e),e}var al=1,il=1,sl=0,ll=0,cl=0,ul="";function dl(e,t,n,r,o,a,i){return{value:e,root:t,parent:n,type:r,props:o,children:a,line:al,column:il,length:i,return:""}}function fl(e,t){return Zs(dl("",null,null,"",null,null,0),e,{length:-e.length},t)}function pl(){return cl=ll>0?el(ul,--ll):0,il--,10===cl&&(il=1,al--),cl}function hl(){return cl=ll<sl?el(ul,ll++):0,il++,10===cl&&(il=1,al++),cl}function ml(){return el(ul,ll)}function gl(){return ll}function yl(e,t){return tl(ul,e,t)}function vl(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function bl(e){return al=il=1,sl=nl(ul=e),ll=0,[]}function wl(e){return ul="",e}function xl(e){return Gs(yl(ll-1,_l(91===e?e+2:40===e?e+1:e)))}function Sl(e){for(;(cl=ml())&&cl<33;)hl();return vl(e)>2||vl(cl)>3?"":" "}function El(e,t){for(;--t&&hl()&&!(cl<48||cl>102||cl>57&&cl<65||cl>70&&cl<97););return yl(e,gl()+(t<6&&32==ml()&&32==hl()))}function _l(e){for(;hl();)switch(cl){case e:return ll;case 34:case 39:34!==e&&39!==e&&_l(cl);break;case 40:41===e&&_l(e);break;case 92:hl()}return ll}function Cl(e,t){for(;hl()&&e+cl!==57&&(e+cl!==84||47!==ml()););return"/*"+yl(t,ll-1)+"*"+qs(47===e?e:hl())}function kl(e){for(;!vl(ml());)hl();return yl(e,ll)}function Nl(e){return wl(Ml("",null,null,null,[""],e=bl(e),0,[0],e))}function Ml(e,t,n,r,o,a,i,s,l){for(var c=0,u=0,d=i,f=0,p=0,h=0,m=1,g=1,y=1,v=0,b="",w=o,x=a,S=r,E=b;g;)switch(h=v,v=hl()){case 40:if(108!=h&&58==el(E,d-1)){-1!=Js(E+=Qs(xl(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:E+=xl(v);break;case 9:case 10:case 13:case 32:E+=Sl(h);break;case 92:E+=El(gl()-1,7);continue;case 47:switch(ml()){case 42:case 47:ol(Ol(Cl(hl(),gl()),t,n),l);break;default:E+="/"}break;case 123*m:s[c++]=nl(E)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(E=Qs(E,/\f/g,"")),p>0&&nl(E)-d&&ol(p>32?Al(E+";",r,n,d-1):Al(Qs(E," ","")+";",r,n,d-2),l);break;case 59:E+=";";default:if(ol(S=Pl(E,t,n,c,u,o,s,b,w=[],x=[],d),a),123===v)if(0===u)Ml(E,t,S,S,w,a,d,s,x);else switch(99===f&&110===el(E,3)?100:f){case 100:case 108:case 109:case 115:Ml(e,S,S,r&&ol(Pl(e,S,S,0,0,o,s,b,o,w=[],d),x),o,x,d,s,r?w:x);break;default:Ml(E,S,S,S,[""],x,0,s,x)}}c=u=p=0,m=y=1,b=E="",d=i;break;case 58:d=1+nl(E),p=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==pl())continue;switch(E+=qs(v),v*m){case 38:y=u>0?1:(E+="\f",-1);break;case 44:s[c++]=(nl(E)-1)*y,y=1;break;case 64:45===ml()&&(E+=xl(hl())),f=ml(),u=d=nl(b=E+=kl(gl())),v++;break;case 45:45===h&&2==nl(E)&&(m=0)}}return a}function Pl(e,t,n,r,o,a,i,s,l,c,u){for(var d=o-1,f=0===o?a:[""],p=rl(f),h=0,m=0,g=0;h<r;++h)for(var y=0,v=tl(e,d+1,d=Us(m=i[h])),b=e;y<p;++y)(b=Gs(m>0?f[y]+" "+v:Qs(v,/&\f/g,f[y])))&&(l[g++]=b);return dl(e,t,n,0===o?Ys:s,l,c,u)}function Ol(e,t,n){return dl(e,t,n,js,qs(cl),tl(e,2,-2),0)}function Al(e,t,n,r){return dl(e,t,n,Xs,tl(e,0,r),tl(e,r+1,-1),r)}function Rl(e,t){for(var n="",r=rl(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function Tl(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Xs:return e.return=e.return||e.value;case js:return"";case Ks:return e.return=e.value+"{"+Rl(e.children,r)+"}";case Ys:e.value=e.props.join(",")}return nl(n=Rl(e.children,r))?e.return=e.value+"{"+n+"}":""}var Dl=function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var r=e(n);return t.set(n,r),r}};function $l(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Il=function(e,t,n){for(var r=0,o=0;r=o,o=ml(),38===r&&12===o&&(t[n]=1),!vl(o);)hl();return yl(e,ll)},zl=function(e,t){return wl(function(e,t){var n=-1,r=44;do{switch(vl(r)){case 0:38===r&&12===ml()&&(t[n]=1),e[n]+=Il(ll-1,t,n);break;case 2:e[n]+=xl(r);break;case 4:if(44===r){e[++n]=58===ml()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=qs(r)}}while(r=hl());return e}(bl(e),t))},Ll=new WeakMap,Bl=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Ll.get(n))&&!r){Ll.set(e,!0);for(var o=[],a=zl(t,o),i=n.props,s=0,l=0;s<a.length;s++)for(var c=0;c<i.length;c++,l++)e.props[l]=o[s]?a[s].replace(/&\f/g,i[c]):i[c]+" "+a[s]}}},Fl=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function Hl(e,t){switch(function(e,t){return 45^el(e,0)?(((t<<2^el(e,0))<<2^el(e,1))<<2^el(e,2))<<2^el(e,3):0}(e,t)){case 5103:return Vs+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return Vs+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return Vs+e+Ws+e+Hs+e+e;case 6828:case 4268:return Vs+e+Hs+e+e;case 6165:return Vs+e+Hs+"flex-"+e+e;case 5187:return Vs+e+Qs(e,/(\w+).+(:[^]+)/,Vs+"box-$1$2"+Hs+"flex-$1$2")+e;case 5443:return Vs+e+Hs+"flex-item-"+Qs(e,/flex-|-self/,"")+e;case 4675:return Vs+e+Hs+"flex-line-pack"+Qs(e,/align-content|flex-|-self/,"")+e;case 5548:return Vs+e+Hs+Qs(e,"shrink","negative")+e;case 5292:return Vs+e+Hs+Qs(e,"basis","preferred-size")+e;case 6060:return Vs+"box-"+Qs(e,"-grow","")+Vs+e+Hs+Qs(e,"grow","positive")+e;case 4554:return Vs+Qs(e,/([^-])(transform)/g,"$1"+Vs+"$2")+e;case 6187:return Qs(Qs(Qs(e,/(zoom-|grab)/,Vs+"$1"),/(image-set)/,Vs+"$1"),e,"")+e;case 5495:case 3959:return Qs(e,/(image-set\([^]*)/,Vs+"$1$`$1");case 4968:return Qs(Qs(e,/(.+:)(flex-)?(.*)/,Vs+"box-pack:$3"+Hs+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+Vs+e+e;case 4095:case 3583:case 4068:case 2532:return Qs(e,/(.+)-inline(.+)/,Vs+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(nl(e)-1-t>6)switch(el(e,t+1)){case 109:if(45!==el(e,t+4))break;case 102:return Qs(e,/(.+:)(.+)-([^]+)/,"$1"+Vs+"$2-$3$1"+Ws+(108==el(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Js(e,"stretch")?Hl(Qs(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==el(e,t+1))break;case 6444:switch(el(e,nl(e)-3-(~Js(e,"!important")&&10))){case 107:return Qs(e,":",":"+Vs)+e;case 101:return Qs(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+Vs+(45===el(e,14)?"inline-":"")+"box$3$1"+Vs+"$2$3$1"+Hs+"$2box$3")+e}break;case 5936:switch(el(e,t+11)){case 114:return Vs+e+Hs+Qs(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return Vs+e+Hs+Qs(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return Vs+e+Hs+Qs(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return Vs+e+Hs+e+e}return e}var Wl,Vl=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Xs:e.return=Hl(e.value,e.length);break;case Ks:return Rl([fl(e,{value:Qs(e.value,"@","@"+Vs)})],r);case Ys:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Rl([fl(e,{props:[Qs(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return Rl([fl(e,{props:[Qs(t,/:(plac\w+)/,":"+Vs+"input-$1")]}),fl(e,{props:[Qs(t,/:(plac\w+)/,":-moz-$1")]}),fl(e,{props:[Qs(t,/:(plac\w+)/,Hs+"input-$1")]})],r)}return""})}}],jl=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,o,a=e.stylisPlugins||Vl,i={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)i[t[n]]=!0;s.push(e)});var l,c,u=[Tl,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=rl(e);return function(n,r,o,a){for(var i="",s=0;s<t;s++)i+=e[s](n,r,o,a)||"";return i}}([Bl,Fl].concat(a,u));o=function(e,t,n,r){l=n,Rl(Nl(e?e+"{"+t.styles+"}":t.styles),d),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new Fs({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:i,registered:{},insert:o};return f.sheet.hydrate(s),f},Yl={exports:{}},Xl={};var Kl,Ul={};"production"===process.env.NODE_ENV?Yl.exports=function(){if(Wl)return Xl;Wl=1;var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:switch(e=e.type){case l:case c:case r:case a:case o:case d:return e;default:switch(e=e&&e.$$typeof){case s:case u:case h:case p:case i:return e;default:return f}}case n:return f}}}function w(e){return b(e)===c}return Xl.AsyncMode=l,Xl.ConcurrentMode=c,Xl.ContextConsumer=s,Xl.ContextProvider=i,Xl.Element=t,Xl.ForwardRef=u,Xl.Fragment=r,Xl.Lazy=h,Xl.Memo=p,Xl.Portal=n,Xl.Profiler=a,Xl.StrictMode=o,Xl.Suspense=d,Xl.isAsyncMode=function(e){return w(e)||b(e)===l},Xl.isConcurrentMode=w,Xl.isContextConsumer=function(e){return b(e)===s},Xl.isContextProvider=function(e){return b(e)===i},Xl.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Xl.isForwardRef=function(e){return b(e)===u},Xl.isFragment=function(e){return b(e)===r},Xl.isLazy=function(e){return b(e)===h},Xl.isMemo=function(e){return b(e)===p},Xl.isPortal=function(e){return b(e)===n},Xl.isProfiler=function(e){return b(e)===a},Xl.isStrictMode=function(e){return b(e)===o},Xl.isSuspense=function(e){return b(e)===d},Xl.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===a||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===i||e.$$typeof===s||e.$$typeof===u||e.$$typeof===g||e.$$typeof===y||e.$$typeof===v||e.$$typeof===m)},Xl.typeOf=b,Xl}():Yl.exports=(Kl||(Kl=1,"production"!==process.env.NODE_ENV&&function(){var e="function"==typeof Symbol&&Symbol.for,t=e?Symbol.for("react.element"):60103,n=e?Symbol.for("react.portal"):60106,r=e?Symbol.for("react.fragment"):60107,o=e?Symbol.for("react.strict_mode"):60108,a=e?Symbol.for("react.profiler"):60114,i=e?Symbol.for("react.provider"):60109,s=e?Symbol.for("react.context"):60110,l=e?Symbol.for("react.async_mode"):60111,c=e?Symbol.for("react.concurrent_mode"):60111,u=e?Symbol.for("react.forward_ref"):60112,d=e?Symbol.for("react.suspense"):60113,f=e?Symbol.for("react.suspense_list"):60120,p=e?Symbol.for("react.memo"):60115,h=e?Symbol.for("react.lazy"):60116,m=e?Symbol.for("react.block"):60121,g=e?Symbol.for("react.fundamental"):60117,y=e?Symbol.for("react.responder"):60118,v=e?Symbol.for("react.scope"):60119;function b(e){if("object"==typeof e&&null!==e){var f=e.$$typeof;switch(f){case t:var m=e.type;switch(m){case l:case c:case r:case a:case o:case d:return m;default:var g=m&&m.$$typeof;switch(g){case s:case u:case h:case p:case i:return g;default:return f}}case n:return f}}}var w=l,x=c,S=s,E=i,_=t,C=u,k=r,N=h,M=p,P=n,O=a,A=o,R=d,T=!1;function D(e){return b(e)===c}Ul.AsyncMode=w,Ul.ConcurrentMode=x,Ul.ContextConsumer=S,Ul.ContextProvider=E,Ul.Element=_,Ul.ForwardRef=C,Ul.Fragment=k,Ul.Lazy=N,Ul.Memo=M,Ul.Portal=P,Ul.Profiler=O,Ul.StrictMode=A,Ul.Suspense=R,Ul.isAsyncMode=function(e){return T||(T=!0,console.warn("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 17+. Update your code to use ReactIs.isConcurrentMode() instead. It has the exact same API.")),D(e)||b(e)===l},Ul.isConcurrentMode=D,Ul.isContextConsumer=function(e){return b(e)===s},Ul.isContextProvider=function(e){return b(e)===i},Ul.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===t},Ul.isForwardRef=function(e){return b(e)===u},Ul.isFragment=function(e){return b(e)===r},Ul.isLazy=function(e){return b(e)===h},Ul.isMemo=function(e){return b(e)===p},Ul.isPortal=function(e){return b(e)===n},Ul.isProfiler=function(e){return b(e)===a},Ul.isStrictMode=function(e){return b(e)===o},Ul.isSuspense=function(e){return b(e)===d},Ul.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===r||e===c||e===a||e===o||e===d||e===f||"object"==typeof e&&null!==e&&(e.$$typeof===h||e.$$typeof===p||e.$$typeof===i||e.$$typeof===s||e.$$typeof===u||e.$$typeof===g||e.$$typeof===y||e.$$typeof===v||e.$$typeof===m)},Ul.typeOf=b}()),Ul);var ql=Yl.exports,Zl={};Zl[ql.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},Zl[ql.Memo]={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0};function Gl(e,t,n){var r="";return n.split(" ").forEach(function(n){void 0!==e[n]?t.push(e[n]+";"):n&&(r+=n+" ")}),r}var Ql=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)},Jl=function(e,t,n){Ql(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}};var ec={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},tc=/[A-Z]|^ms/g,nc=/_EMO_([^_]+?)_([^]*?)_EMO_/g,rc=function(e){return 45===e.charCodeAt(1)},oc=function(e){return null!=e&&"boolean"!=typeof e},ac=$l(function(e){return rc(e)?e:e.replace(tc,"-$&").toLowerCase()}),ic=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(nc,function(e,t,n){return lc={name:t,styles:n,next:lc},t})}return 1===ec[e]||rc(e)||"number"!=typeof t||0===t?t:t+"px"};function sc(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var o=n;if(1===o.anim)return lc={name:o.name,styles:o.styles,next:lc},o.name;var a=n;if(void 0!==a.styles){var i=a.next;if(void 0!==i)for(;void 0!==i;)lc={name:i.name,styles:i.styles,next:lc},i=i.next;return a.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=sc(e,t,n[o])+";";else for(var a in n){var i=n[a];if("object"!=typeof i){var s=i;null!=t&&void 0!==t[s]?r+=a+"{"+t[s]+"}":oc(s)&&(r+=ac(a)+":"+ic(a,s)+";")}else if(!Array.isArray(i)||"string"!=typeof i[0]||null!=t&&void 0!==t[i[0]]){var l=sc(e,t,i);switch(a){case"animation":case"animationName":r+=ac(a)+":"+l+";";break;default:r+=a+"{"+l+"}"}}else for(var c=0;c<i.length;c++)oc(i[c])&&(r+=ac(a)+":"+ic(a,i[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=lc,l=n(e);return lc=s,sc(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var lc,cc=/label:\s*([^\s;{]+)\s*(;|$)/g;function uc(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";lc=void 0;var a=e[0];null==a||void 0===a.raw?(r=!1,o+=sc(n,t,a)):o+=a[0];for(var i=1;i<e.length;i++){if(o+=sc(n,t,e[i]),r)o+=a[i]}cc.lastIndex=0;for(var s,l="";null!==(s=cc.exec(o));)l+="-"+s[1];var c=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:lc}}var dc=!!e.useInsertionEffect&&e.useInsertionEffect,fc=dc||function(e){return e()},pc=dc||e.useLayoutEffect,hc=e.createContext("undefined"!=typeof HTMLElement?jl({key:"css"}):null);hc.Provider;var mc,gc,yc=function(e){return a(function(t,n){var r=c(hc);return e(t,r,n)})},vc=e.createContext({}),bc=Dl(function(e){return Dl(function(t){return function(e,t){return"function"==typeof t?t(e):Bs({},e,t)}(e,t)})}),wc=function(t){var n=e.useContext(vc);return t.theme!==n&&(n=bc(n)(t.theme)),e.createElement(vc.Provider,{value:n},t.children)},xc={}.hasOwnProperty,Sc="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",Ec=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Ql(t,n,r),fc(function(){return Jl(t,n,r)}),null},_c=yc(function(t,n,r){var o=t.css;"string"==typeof o&&void 0!==n.registered[o]&&(o=n.registered[o]);var a=t[Sc],i=[o],s="";"string"==typeof t.className?s=Gl(n.registered,i,t.className):null!=t.className&&(s=t.className+" ");var l=uc(i,void 0,e.useContext(vc));s+=n.key+"-"+l.name;var c={};for(var u in t)xc.call(t,u)&&"css"!==u&&u!==Sc&&(c[u]=t[u]);return c.className=s,r&&(c.ref=r),e.createElement(e.Fragment,null,e.createElement(Ec,{cache:n,serialized:l,isStringTag:"string"==typeof a}),e.createElement(a,c))}),Cc=_c,kc=function(t,n){var r=arguments;if(null==n||!xc.call(n,"css"))return e.createElement.apply(void 0,r);var o=r.length,a=new Array(o);a[0]=Cc,a[1]=function(e,t){var n={};for(var r in t)xc.call(t,r)&&(n[r]=t[r]);return n[Sc]=e,n}(t,n);for(var i=2;i<o;i++)a[i]=r[i];return e.createElement.apply(null,a)};mc=kc||(kc={}),gc||(gc=mc.JSX||(mc.JSX={}));var Nc=yc(function(t,n){var r=uc([t.styles],void 0,e.useContext(vc)),o=e.useRef();return pc(function(){var e=n.key+"-global",t=new n.sheet.constructor({key:e,nonce:n.sheet.nonce,container:n.sheet.container,speedy:n.sheet.isSpeedy}),a=!1,i=document.querySelector('style[data-emotion="'+e+" "+r.name+'"]');return n.sheet.tags.length&&(t.before=n.sheet.tags[0]),null!==i&&(a=!0,i.setAttribute("data-emotion",e),t.hydrate([i])),o.current=[t,a],function(){t.flush()}},[n]),pc(function(){var e=o.current,t=e[0];if(e[1])e[1]=!1;else{if(void 0!==r.next&&Jl(n,r.next,!0),t.tags.length){var a=t.tags[t.tags.length-1].nextElementSibling;t.before=a,t.flush()}n.insert("",r,t,!1)}},[n,r.name]),null});function Mc(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return uc(t)}var Pc=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Oc=$l(function(e){return Pc.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),Ac=function(e){return"theme"!==e},Rc=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?Oc:Ac},Tc=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},Dc=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Ql(t,n,r),fc(function(){return Jl(t,n,r)}),null},$c=function t(n,r){var o,a,i=n.__emotion_real===n,s=i&&n.__emotion_base||n;void 0!==r&&(o=r.label,a=r.target);var l=Tc(n,r,i),c=l||Rc(s),u=!c("as");return function(){var d=arguments,f=i&&void 0!==n.__emotion_styles?n.__emotion_styles.slice(0):[];if(void 0!==o&&f.push("label:"+o+";"),null==d[0]||void 0===d[0].raw)f.push.apply(f,d);else{var p=d[0];f.push(p[0]);for(var h=d.length,m=1;m<h;m++)f.push(d[m],p[m])}var g=yc(function(t,n,r){var o=u&&t.as||s,i="",d=[],p=t;if(null==t.theme){for(var h in p={},t)p[h]=t[h];p.theme=e.useContext(vc)}"string"==typeof t.className?i=Gl(n.registered,d,t.className):null!=t.className&&(i=t.className+" ");var m=uc(f.concat(d),n.registered,p);i+=n.key+"-"+m.name,void 0!==a&&(i+=" "+a);var g=u&&void 0===l?Rc(o):c,y={};for(var v in t)u&&"as"===v||g(v)&&(y[v]=t[v]);return y.className=i,r&&(y.ref=r),e.createElement(e.Fragment,null,e.createElement(Dc,{cache:n,serialized:m,isStringTag:"string"==typeof o}),e.createElement(o,y))});return g.displayName=void 0!==o?o:"Styled("+("string"==typeof s?s:s.displayName||s.name||"Component")+")",g.defaultProps=n.defaultProps,g.__emotion_real=g,g.__emotion_base=s,g.__emotion_styles=f,g.__emotion_forwardProp=l,Object.defineProperty(g,"toString",{value:function(){return"."+a}}),g.withComponent=function(e,n){return t(e,Bs({},r,n,{shouldForwardProp:Tc(g,n,!0)})).apply(void 0,f)},g}}.bind(null);function Ic(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=Ic(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function zc(...e){return function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=Ic(e))&&(r&&(r+=" "),r+=t);return r}(e)}function Lc(e){return e.split(/[-_\s]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function Bc(e){return null==e?"$0.00":new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:4}).format(e)}function Fc(e){if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;return`${Math.floor(e/6e4)}m ${Math.round(e%6e4/1e3)}s`}function Hc(e,t){return e.length<=t?e:e.substring(0,t-3)+"..."}function Wc(e,t,n=""){return e?t:n}function Vc(e,t){return e.spacing[t]||e.spacing.md}function jc(e,t){return e.colors[t]||e.colors.foreground}["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){$c[e]=$c(e)});const Yc=$c.div`
15
+ var _s={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"};const Cs=i(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:o="",children:i,iconNode:a,...s},l)=>d("svg",{ref:l,..._s,width:t,height:t,stroke:e,strokeWidth:r?24*Number(n)/Number(t):n,className:Es("lucide",o),...!i&&!Ss(s)&&{"aria-hidden":"true"},...s},[...a.map(([e,t])=>d(e,t)),...Array.isArray(i)?i:[i]])),ks=(e,t)=>{const n=i(({className:n,...r},o)=>{return d(Cs,{ref:o,iconNode:t,className:Es(`lucide-${i=xs(e),i.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...r});var i});return n.displayName=xs(e),n},Ns=ks("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]),Ms=ks("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]),Os=ks("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),As=ks("chevron-up",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]),Ps=ks("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),Rs=ks("panel-left",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]),Ts=ks("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);var Ds=function(){function e(e){var t=this;this._insertTag=function(e){var n;n=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,n),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{n.insertRule(e,n.cssRules.length)}catch(e){}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),$s="-ms-",Is="-moz-",zs="-webkit-",Ls="comm",Bs="rule",Fs="decl",Hs="@keyframes",Ws=Math.abs,Vs=String.fromCharCode,Ys=Object.assign;function js(e){return e.trim()}function Xs(e,t,n){return e.replace(t,n)}function Ks(e,t){return e.indexOf(t)}function Us(e,t){return 0|e.charCodeAt(t)}function qs(e,t,n){return e.slice(t,n)}function Zs(e){return e.length}function Gs(e){return e.length}function Qs(e,t){return t.push(e),e}var Js=1,el=1,tl=0,nl=0,rl=0,ol="";function il(e,t,n,r,o,i,a){return{value:e,root:t,parent:n,type:r,props:o,children:i,line:Js,column:el,length:a,return:""}}function al(e,t){return Ys(il("",null,null,"",null,null,0),e,{length:-e.length},t)}function sl(){return rl=nl>0?Us(ol,--nl):0,el--,10===rl&&(el=1,Js--),rl}function ll(){return rl=nl<tl?Us(ol,nl++):0,el++,10===rl&&(el=1,Js++),rl}function cl(){return Us(ol,nl)}function ul(){return nl}function dl(e,t){return qs(ol,e,t)}function fl(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function pl(e){return Js=el=1,tl=Zs(ol=e),nl=0,[]}function hl(e){return ol="",e}function ml(e){return js(dl(nl-1,vl(91===e?e+2:40===e?e+1:e)))}function gl(e){for(;(rl=cl())&&rl<33;)ll();return fl(e)>2||fl(rl)>3?"":" "}function yl(e,t){for(;--t&&ll()&&!(rl<48||rl>102||rl>57&&rl<65||rl>70&&rl<97););return dl(e,ul()+(t<6&&32==cl()&&32==ll()))}function vl(e){for(;ll();)switch(rl){case e:return nl;case 34:case 39:34!==e&&39!==e&&vl(rl);break;case 40:41===e&&vl(e);break;case 92:ll()}return nl}function bl(e,t){for(;ll()&&e+rl!==57&&(e+rl!==84||47!==cl()););return"/*"+dl(t,nl-1)+"*"+Vs(47===e?e:ll())}function wl(e){for(;!fl(cl());)ll();return dl(e,nl)}function xl(e){return hl(El("",null,null,null,[""],e=pl(e),0,[0],e))}function El(e,t,n,r,o,i,a,s,l){for(var c=0,u=0,d=a,f=0,p=0,h=0,m=1,g=1,y=1,v=0,b="",w=o,x=i,E=r,S=b;g;)switch(h=v,v=ll()){case 40:if(108!=h&&58==Us(S,d-1)){-1!=Ks(S+=Xs(ml(v),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:S+=ml(v);break;case 9:case 10:case 13:case 32:S+=gl(h);break;case 92:S+=yl(ul()-1,7);continue;case 47:switch(cl()){case 42:case 47:Qs(_l(bl(ll(),ul()),t,n),l);break;default:S+="/"}break;case 123*m:s[c++]=Zs(S)*y;case 125*m:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:-1==y&&(S=Xs(S,/\f/g,"")),p>0&&Zs(S)-d&&Qs(p>32?Cl(S+";",r,n,d-1):Cl(Xs(S," ","")+";",r,n,d-2),l);break;case 59:S+=";";default:if(Qs(E=Sl(S,t,n,c,u,o,s,b,w=[],x=[],d),i),123===v)if(0===u)El(S,t,E,E,w,i,d,s,x);else switch(99===f&&110===Us(S,3)?100:f){case 100:case 108:case 109:case 115:El(e,E,E,r&&Qs(Sl(e,E,E,0,0,o,s,b,o,w=[],d),x),o,x,d,s,r?w:x);break;default:El(S,E,E,E,[""],x,0,s,x)}}c=u=p=0,m=y=1,b=S="",d=a;break;case 58:d=1+Zs(S),p=h;default:if(m<1)if(123==v)--m;else if(125==v&&0==m++&&125==sl())continue;switch(S+=Vs(v),v*m){case 38:y=u>0?1:(S+="\f",-1);break;case 44:s[c++]=(Zs(S)-1)*y,y=1;break;case 64:45===cl()&&(S+=ml(ll())),f=cl(),u=d=Zs(b=S+=wl(ul())),v++;break;case 45:45===h&&2==Zs(S)&&(m=0)}}return i}function Sl(e,t,n,r,o,i,a,s,l,c,u){for(var d=o-1,f=0===o?i:[""],p=Gs(f),h=0,m=0,g=0;h<r;++h)for(var y=0,v=qs(e,d+1,d=Ws(m=a[h])),b=e;y<p;++y)(b=js(m>0?f[y]+" "+v:Xs(v,/&\f/g,f[y])))&&(l[g++]=b);return il(e,t,n,0===o?Bs:s,l,c,u)}function _l(e,t,n){return il(e,t,n,Ls,Vs(rl),qs(e,2,-2),0)}function Cl(e,t,n,r){return il(e,t,n,Fs,qs(e,0,r),qs(e,r+1,-1),r)}function kl(e,t){for(var n="",r=Gs(e),o=0;o<r;o++)n+=t(e[o],o,e,t)||"";return n}function Nl(e,t,n,r){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case Fs:return e.return=e.return||e.value;case Ls:return"";case Hs:return e.return=e.value+"{"+kl(e.children,r)+"}";case Bs:e.value=e.props.join(",")}return Zs(n=kl(e.children,r))?e.return=e.value+"{"+n+"}":""}var Ml=function(e){var t=new WeakMap;return function(n){if(t.has(n))return t.get(n);var r=e(n);return t.set(n,r),r}};function Ol(e){var t=Object.create(null);return function(n){return void 0===t[n]&&(t[n]=e(n)),t[n]}}var Al=function(e,t,n){for(var r=0,o=0;r=o,o=cl(),38===r&&12===o&&(t[n]=1),!fl(o);)ll();return dl(e,nl)},Pl=function(e,t){return hl(function(e,t){var n=-1,r=44;do{switch(fl(r)){case 0:38===r&&12===cl()&&(t[n]=1),e[n]+=Al(nl-1,t,n);break;case 2:e[n]+=ml(r);break;case 4:if(44===r){e[++n]=58===cl()?"&\f":"",t[n]=e[n].length;break}default:e[n]+=Vs(r)}}while(r=ll());return e}(pl(e),t))},Rl=new WeakMap,Tl=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;"rule"!==n.type;)if(!(n=n.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Rl.get(n))&&!r){Rl.set(e,!0);for(var o=[],i=Pl(t,o),a=n.props,s=0,l=0;s<i.length;s++)for(var c=0;c<a.length;c++,l++)e.props[l]=o[s]?i[s].replace(/&\f/g,a[c]):a[c]+" "+i[s]}}},Dl=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}};function $l(e,t){switch(function(e,t){return 45^Us(e,0)?(((t<<2^Us(e,0))<<2^Us(e,1))<<2^Us(e,2))<<2^Us(e,3):0}(e,t)){case 5103:return zs+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return zs+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return zs+e+Is+e+$s+e+e;case 6828:case 4268:return zs+e+$s+e+e;case 6165:return zs+e+$s+"flex-"+e+e;case 5187:return zs+e+Xs(e,/(\w+).+(:[^]+)/,zs+"box-$1$2"+$s+"flex-$1$2")+e;case 5443:return zs+e+$s+"flex-item-"+Xs(e,/flex-|-self/,"")+e;case 4675:return zs+e+$s+"flex-line-pack"+Xs(e,/align-content|flex-|-self/,"")+e;case 5548:return zs+e+$s+Xs(e,"shrink","negative")+e;case 5292:return zs+e+$s+Xs(e,"basis","preferred-size")+e;case 6060:return zs+"box-"+Xs(e,"-grow","")+zs+e+$s+Xs(e,"grow","positive")+e;case 4554:return zs+Xs(e,/([^-])(transform)/g,"$1"+zs+"$2")+e;case 6187:return Xs(Xs(Xs(e,/(zoom-|grab)/,zs+"$1"),/(image-set)/,zs+"$1"),e,"")+e;case 5495:case 3959:return Xs(e,/(image-set\([^]*)/,zs+"$1$`$1");case 4968:return Xs(Xs(e,/(.+:)(flex-)?(.*)/,zs+"box-pack:$3"+$s+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+zs+e+e;case 4095:case 3583:case 4068:case 2532:return Xs(e,/(.+)-inline(.+)/,zs+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(Zs(e)-1-t>6)switch(Us(e,t+1)){case 109:if(45!==Us(e,t+4))break;case 102:return Xs(e,/(.+:)(.+)-([^]+)/,"$1"+zs+"$2-$3$1"+Is+(108==Us(e,t+3)?"$3":"$2-$3"))+e;case 115:return~Ks(e,"stretch")?$l(Xs(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Us(e,t+1))break;case 6444:switch(Us(e,Zs(e)-3-(~Ks(e,"!important")&&10))){case 107:return Xs(e,":",":"+zs)+e;case 101:return Xs(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+zs+(45===Us(e,14)?"inline-":"")+"box$3$1"+zs+"$2$3$1"+$s+"$2box$3")+e}break;case 5936:switch(Us(e,t+11)){case 114:return zs+e+$s+Xs(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return zs+e+$s+Xs(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return zs+e+$s+Xs(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return zs+e+$s+e+e}return e}var Il=[function(e,t,n,r){if(e.length>-1&&!e.return)switch(e.type){case Fs:e.return=$l(e.value,e.length);break;case Hs:return kl([al(e,{value:Xs(e.value,"@","@"+zs)})],r);case Bs:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return kl([al(e,{props:[Xs(t,/:(read-\w+)/,":-moz-$1")]})],r);case"::placeholder":return kl([al(e,{props:[Xs(t,/:(plac\w+)/,":"+zs+"input-$1")]}),al(e,{props:[Xs(t,/:(plac\w+)/,":-moz-$1")]}),al(e,{props:[Xs(t,/:(plac\w+)/,$s+"input-$1")]})],r)}return""})}}],zl=function(e){var t=e.key;if("css"===t){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var r,o,i=e.stylisPlugins||Il,a={},s=[];r=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),n=1;n<t.length;n++)a[t[n]]=!0;s.push(e)});var l,c,u=[Nl,(c=function(e){l.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],d=function(e){var t=Gs(e);return function(n,r,o,i){for(var a="",s=0;s<t;s++)a+=e[s](n,r,o,i)||"";return a}}([Tl,Dl].concat(i,u));o=function(e,t,n,r){l=n,kl(xl(e?e+"{"+t.styles+"}":t.styles),d),r&&(f.inserted[t.name]=!0)};var f={key:t,sheet:new Ds({key:t,container:r,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:o};return f.sheet.hydrate(s),f};function Ll(){return Ll=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ll.apply(null,arguments)}var Bl=function(e,t,n){var r=e.key+"-"+t.name;!1===n&&void 0===e.registered[r]&&(e.registered[r]=t.styles)};var Fl={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Hl=/[A-Z]|^ms/g,Wl=/_EMO_([^_]+?)_([^]*?)_EMO_/g,Vl=function(e){return 45===e.charCodeAt(1)},Yl=function(e){return null!=e&&"boolean"!=typeof e},jl=Ol(function(e){return Vl(e)?e:e.replace(Hl,"-$&").toLowerCase()}),Xl=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(Wl,function(e,t,n){return Ul={name:t,styles:n,next:Ul},t})}return 1===Fl[e]||Vl(e)||"number"!=typeof t||0===t?t:t+"px"};function Kl(e,t,n){if(null==n)return"";var r=n;if(void 0!==r.__emotion_styles)return r;switch(typeof n){case"boolean":return"";case"object":var o=n;if(1===o.anim)return Ul={name:o.name,styles:o.styles,next:Ul},o.name;var i=n;if(void 0!==i.styles){var a=i.next;if(void 0!==a)for(;void 0!==a;)Ul={name:a.name,styles:a.styles,next:Ul},a=a.next;return i.styles+";"}return function(e,t,n){var r="";if(Array.isArray(n))for(var o=0;o<n.length;o++)r+=Kl(e,t,n[o])+";";else for(var i in n){var a=n[i];if("object"!=typeof a){var s=a;null!=t&&void 0!==t[s]?r+=i+"{"+t[s]+"}":Yl(s)&&(r+=jl(i)+":"+Xl(i,s)+";")}else if(!Array.isArray(a)||"string"!=typeof a[0]||null!=t&&void 0!==t[a[0]]){var l=Kl(e,t,a);switch(i){case"animation":case"animationName":r+=jl(i)+":"+l+";";break;default:r+=i+"{"+l+"}"}}else for(var c=0;c<a.length;c++)Yl(a[c])&&(r+=jl(i)+":"+Xl(i,a[c])+";")}return r}(e,t,n);case"function":if(void 0!==e){var s=Ul,l=n(e);return Ul=s,Kl(e,t,l)}}var c=n;if(null==t)return c;var u=t[c];return void 0!==u?u:c}var Ul,ql=/label:\s*([^\s;{]+)\s*(;|$)/g;var Zl=!!e.useInsertionEffect&&e.useInsertionEffect||function(e){return e()},Gl=e.createContext("undefined"!=typeof HTMLElement?zl({key:"css"}):null);Gl.Provider;var Ql=e.createContext({}),Jl=Ml(function(e){return Ml(function(t){return function(e,t){return"function"==typeof t?t(e):Ll({},e,t)}(e,t)})}),ec=function(t){var n=e.useContext(Ql);return t.theme!==n&&(n=Jl(n)(t.theme)),e.createElement(Ql.Provider,{value:n},t.children)};const tc={colors:{background:"hsl(0 0% 100%)",foreground:"hsl(222.2 84% 4.9%)",card:"hsl(0 0% 100%)",cardForeground:"hsl(222.2 84% 4.9%)",popover:"hsl(0 0% 100%)",popoverForeground:"hsl(222.2 84% 4.9%)",primary:"hsl(221.2 83.2% 53.3%)",primaryForeground:"hsl(210 40% 98%)",secondary:"hsl(210 40% 96%)",secondaryForeground:"hsl(222.2 84% 4.9%)",muted:"hsl(210 40% 96%)",mutedForeground:"hsl(215.4 16.3% 46.9%)",accent:"hsl(210 40% 96%)",accentForeground:"hsl(222.2 84% 4.9%)",destructive:"hsl(0 84.2% 60.2%)",destructiveForeground:"hsl(210 40% 98%)",border:"hsl(214.3 31.8% 91.4%)",mutedBorder:"hsl(214.3 31.8% 91.4%)",input:"hsl(214.3 31.8% 91.4%)",ring:"hsl(221.2 83.2% 53.3%)"},spacing:{xs:"0.25rem",sm:"0.5rem",md:"1rem",lg:"1.5rem",xl:"2rem","2xl":"3rem","3xl":"4rem"},borderRadius:{sm:"calc(var(--radius) - 4px)",md:"calc(var(--radius) - 2px)",lg:"var(--radius)",xl:"0.75rem"},fontSize:{xs:"0.75rem",sm:"0.875rem",base:"1rem",lg:"1.125rem",xl:"1.25rem"},fontWeight:{normal:"400",medium:"500",semibold:"600",bold:"700"},shadows:{sm:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",md:"0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06)",lg:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)"},transitions:{fast:"0.15s ease-in-out",normal:"0.2s ease-in-out",slow:"0.3s ease-in-out"}},nc={colors:{background:"hsl(222.2 84% 4.9%)",foreground:"hsl(210 40% 98%)",card:"hsl(222.2 84% 4.9%)",cardForeground:"hsl(210 40% 98%)",popover:"hsl(222.2 84% 4.9%)",popoverForeground:"hsl(210 40% 98%)",primary:"hsl(217.2 91.2% 59.8%)",primaryForeground:"hsl(222.2 84% 4.9%)",secondary:"hsl(217.2 32.6% 17.5%)",secondaryForeground:"hsl(210 40% 98%)",muted:"hsl(217.2 32.6% 17.5%)",mutedForeground:"hsl(215 20.2% 65.1%)",accent:"hsl(217.2 32.6% 17.5%)",accentForeground:"hsl(210 40% 98%)",destructive:"hsl(0 62.8% 30.6%)",destructiveForeground:"hsl(210 40% 98%)",border:"hsl(217.2 32.6% 17.5%)",mutedBorder:"hsl(217.2 32.6% 5%)",input:"hsl(217.2 32.6% 17.5%)",ring:"hsl(224.3 76.3% 94.1%)"},spacing:tc.spacing,borderRadius:tc.borderRadius,fontSize:tc.fontSize,fontWeight:tc.fontWeight,shadows:tc.shadows,transitions:tc.transitions},rc=tc,oc=n(void 0),ic=({children:e,theme:n})=>{const[r,o]=t.useState(()=>{if(n)return n;return"dark"===localStorage.getItem("theme")?nc:tc});a(()=>{n&&o(n)},[n]),a(()=>{if(n)return;const e=()=>{const e=localStorage.getItem("theme");o("dark"===e?nc:tc)};return window.addEventListener("storage",e),()=>{window.removeEventListener("storage",e)}},[n]);const i=t.useMemo(()=>({theme:r,setTheme:o}),[r]);return t.createElement(oc.Provider,{value:i},t.createElement(ec,{theme:r},e))},ac=()=>{const e=c(oc);return void 0===e?{theme:tc,setTheme:()=>{console.warn("Theme context not available. setTheme called but ignored.")}}:e},sc=()=>{const{theme:e}=ac();return e},lc=e=>{const{theme:t}=ac();return e||t},cc=({id:e,sourceX:n,sourceY:r,targetX:i,targetY:a,sourcePosition:s,targetPosition:l,style:c={},markerEnd:d,bidirectional:f=!1,data:p,clientToSvgCoords:h,svgRef:m})=>{u(!1);const{theme:g}=ac(),y=g.colors,[v,b,w]=o(()=>No({sourceX:n,sourceY:r,targetX:i,targetY:a}),[n,r,i,a]),x={...c,stroke:(()=>{const e=p?.details?.state;switch(e){case"Open":case"Completed":default:return y.mutedForeground;case"Error":return y.destructive}})(),strokeWidth:c.strokeWidth||2};return t.createElement(t.Fragment,null,t.createElement(oo,{path:v,style:x}))};var uc=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|disableRemotePlayback|download|draggable|encType|enterKeyHint|fetchpriority|fetchPriority|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,dc=Ol(function(e){return uc.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}),fc=function(e){return"theme"!==e},pc=function(e){return"string"==typeof e&&e.charCodeAt(0)>96?dc:fc},hc=function(e,t,n){var r;if(t){var o=t.shouldForwardProp;r=e.__emotion_forwardProp&&o?function(t){return e.__emotion_forwardProp(t)&&o(t)}:o}return"function"!=typeof r&&n&&(r=e.__emotion_forwardProp),r},mc=function(e){var t=e.cache,n=e.serialized,r=e.isStringTag;return Bl(t,n,r),Zl(function(){return function(e,t,n){Bl(e,t,n);var r=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var o=t;do{e.insert(t===o?"."+r:"",o,e.sheet,!0),o=o.next}while(void 0!==o)}}(t,n,r)}),null},gc=function t(n,r){var o,a,s=n.__emotion_real===n,l=s&&n.__emotion_base||n;void 0!==r&&(o=r.label,a=r.target);var u=hc(n,r,s),d=u||pc(l),f=!d("as");return function(){var p=arguments,h=s&&void 0!==n.__emotion_styles?n.__emotion_styles.slice(0):[];if(void 0!==o&&h.push("label:"+o+";"),null==p[0]||void 0===p[0].raw)h.push.apply(h,p);else{var m=p[0];h.push(m[0]);for(var g=p.length,y=1;y<g;y++)h.push(p[y],m[y])}var v,b=(v=function(t,n,r){var o,i,s,c,p=f&&t.as||l,m="",g=[],y=t;if(null==t.theme){for(var v in y={},t)y[v]=t[v];y.theme=e.useContext(Ql)}"string"==typeof t.className?(o=n.registered,i=g,s=t.className,c="",s.split(" ").forEach(function(e){void 0!==o[e]?i.push(o[e]+";"):e&&(c+=e+" ")}),m=c):null!=t.className&&(m=t.className+" ");var b=function(e,t,n){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var r=!0,o="";Ul=void 0;var i=e[0];null==i||void 0===i.raw?(r=!1,o+=Kl(n,t,i)):o+=i[0];for(var a=1;a<e.length;a++)o+=Kl(n,t,e[a]),r&&(o+=i[a]);ql.lastIndex=0;for(var s,l="";null!==(s=ql.exec(o));)l+="-"+s[1];var c=function(e){for(var t,n=0,r=0,o=e.length;o>=4;++r,o-=4)t=1540483477*(65535&(t=255&e.charCodeAt(r)|(255&e.charCodeAt(++r))<<8|(255&e.charCodeAt(++r))<<16|(255&e.charCodeAt(++r))<<24))+(59797*(t>>>16)<<16),n=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&n)+(59797*(n>>>16)<<16);switch(o){case 3:n^=(255&e.charCodeAt(r+2))<<16;case 2:n^=(255&e.charCodeAt(r+1))<<8;case 1:n=1540483477*(65535&(n^=255&e.charCodeAt(r)))+(59797*(n>>>16)<<16)}return(((n=1540483477*(65535&(n^=n>>>13))+(59797*(n>>>16)<<16))^n>>>15)>>>0).toString(36)}(o)+l;return{name:c,styles:o,next:Ul}}(h.concat(g),n.registered,y);m+=n.key+"-"+b.name,void 0!==a&&(m+=" "+a);var w=f&&void 0===u?pc(p):d,x={};for(var E in t)f&&"as"===E||w(E)&&(x[E]=t[E]);return x.className=m,r&&(x.ref=r),e.createElement(e.Fragment,null,e.createElement(mc,{cache:n,serialized:b,isStringTag:"string"==typeof p}),e.createElement(p,x))},i(function(e,t){var n=c(Gl);return v(e,n,t)}));return b.displayName=void 0!==o?o:"Styled("+("string"==typeof l?l:l.displayName||l.name||"Component")+")",b.defaultProps=n.defaultProps,b.__emotion_real=b,b.__emotion_base=l,b.__emotion_styles=h,b.__emotion_forwardProp=u,Object.defineProperty(b,"toString",{value:function(){return"."+a}}),b.withComponent=function(e,n){return t(e,Ll({},r,n,{shouldForwardProp:hc(b,n,!0)})).apply(void 0,h)},b}}.bind(null);function yc(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=yc(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function vc(...e){return function(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=yc(e))&&(r&&(r+=" "),r+=t);return r}(e)}function bc(e){return e.split(/[-_\s]+/).map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" ")}function wc(e){if(null==e)return"$0.00";if(Math.abs(e)<.01&&0!==e)return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:3,maximumFractionDigits:6}).format(e);const t=e.toString().split(".")[1]?.length||0,n=Math.max(2,Math.min(t,6));return new Intl.NumberFormat("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:n}).format(e)}function xc(e){if(e<1)return`${Math.round(1e3*e)}ms`;if(e<60)return`${e.toFixed(1)}s`;return`${Math.floor(e/60)}m ${Math.round(e%60/1e3)}s`}function Ec(e,t){return e.length<=t?e:e.substring(0,t-3)+"..."}function Sc(e,t,n=""){return e?t:n}function _c(e,t){return e.spacing[t]||e.spacing.md}function Cc(e,t){return e.colors[t]||e.colors.foreground}["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach(function(e){gc[e]=gc(e)});const kc=gc.div`
16
+ position: relative;
17
+ display: inline-block;
18
+ `,Nc=gc.div`
19
+ position: absolute;
20
+ z-index: 1000;
21
+ padding: 8px 12px;
22
+ background-color: ${({themeColors:e})=>e.popover};
23
+ color: ${({themeColors:e})=>e.popoverForeground};
24
+ border: 1px solid ${({themeColors:e})=>e.border};
25
+ border-radius: 6px;
26
+ font-size: 14px;
27
+ line-height: 1.4;
28
+ white-space: nowrap;
29
+ box-shadow:
30
+ 0 4px 6px -1px rgba(0, 0, 0, 0.1),
31
+ 0 2px 4px -1px rgba(0, 0, 0, 0.06);
32
+ opacity: ${({isVisible:e})=>e?1:0};
33
+ visibility: ${({isVisible:e})=>e?"visible":"hidden"};
34
+ transition:
35
+ opacity 0.15s ease-in-out,
36
+ visibility 0.15s ease-in-out;
37
+ pointer-events: none;
38
+
39
+ /* Arrow */
40
+ &::before {
41
+ content: "";
42
+ position: absolute;
43
+ width: 0;
44
+ height: 0;
45
+ border: 4px solid transparent;
46
+ }
47
+
48
+ /* Placement-specific positioning and arrow */
49
+ ${({placement:e,themeColors:t})=>{switch(e){case"top":default:return`\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: 8px;\n &::before {\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-top-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-top-color: ${t.popover};\n }\n `;case"bottom":return`\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-top: 8px;\n &::before {\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-bottom-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-bottom-color: ${t.popover};\n }\n `;case"left":return`\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-right: 8px;\n &::before {\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n border-left-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-left-color: ${t.popover};\n }\n `;case"right":return`\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-left: 8px;\n &::before {\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n border-right-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-right-color: ${t.popover};\n }\n `;case"topLeft":return`\n bottom: 100%;\n right: 0;\n margin-bottom: 8px;\n &::before {\n top: 100%;\n right: 8px;\n border-top-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n top: 100%;\n right: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-top-color: ${t.popover};\n }\n `;case"topRight":return`\n bottom: 100%;\n left: 0;\n margin-bottom: 8px;\n &::before {\n top: 100%;\n left: 8px;\n border-top-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n top: 100%;\n left: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-top-color: ${t.popover};\n }\n `;case"bottomLeft":return`\n top: 100%;\n right: 0;\n margin-top: 8px;\n &::before {\n bottom: 100%;\n right: 8px;\n border-bottom-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n bottom: 100%;\n right: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-bottom-color: ${t.popover};\n }\n `;case"bottomRight":return`\n top: 100%;\n left: 0;\n margin-top: 8px;\n &::before {\n bottom: 100%;\n left: 8px;\n border-bottom-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n bottom: 100%;\n left: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-bottom-color: ${t.popover};\n }\n `;case"leftTop":return`\n right: 100%;\n bottom: 0;\n margin-right: 8px;\n &::before {\n left: 100%;\n bottom: 8px;\n border-left-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n left: 100%;\n bottom: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-left-color: ${t.popover};\n }\n `;case"leftBottom":return`\n right: 100%;\n top: 0;\n margin-right: 8px;\n &::before {\n left: 100%;\n top: 8px;\n border-left-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n left: 100%;\n top: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-left-color: ${t.popover};\n }\n `;case"rightTop":return`\n left: 100%;\n bottom: 0;\n margin-left: 8px;\n &::before {\n right: 100%;\n bottom: 8px;\n border-right-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n right: 100%;\n bottom: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-right-color: ${t.popover};\n }\n `;case"rightBottom":return`\n left: 100%;\n top: 0;\n margin-left: 8px;\n &::before {\n right: 100%;\n top: 8px;\n border-right-color: ${t.border};\n }\n &::after {\n content: "";\n position: absolute;\n right: 100%;\n top: 8px;\n width: 0;\n height: 0;\n border: 3px solid transparent;\n border-right-color: ${t.popover};\n }\n `}}}
50
+ `,Mc=({children:t,content:n,placement:r="top",delay:o=300})=>{const{theme:i}=ac(),[a,s]=e.useState(!1),l=e.useRef(),c=()=>{l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{s(!0)},o)},u=()=>{l.current&&clearTimeout(l.current),s(!1)};return e.useEffect(()=>()=>{l.current&&clearTimeout(l.current)},[]),e.createElement(kc,{onMouseEnter:c,onMouseLeave:u,onFocus:c,onBlur:u},t,e.createElement(Nc,{isVisible:a,placement:r,themeColors:i.colors,role:"tooltip"},n))},Oc=gc.div`
16
51
  display: inline-flex;
17
52
  align-items: center;
18
53
  border-radius: 9999px;
@@ -28,10 +63,10 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
28
63
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
29
64
  }
30
65
 
31
- ${({variant:e,theme:t})=>{switch(e){case"default":default:return`\n background-color: ${t.colors.primary};\n color: ${t.colors.primaryForeground};\n &:hover {\n background-color: ${t.colors.primary};\n opacity: 0.9;\n }\n `;case"secondary":case"cost":case"gray":case"latency":case"latencyLow":case"latencyMedium":return`\n background-color: ${t.colors.secondary};\n color: ${t.colors.secondaryForeground};\n &:hover {\n background-color: ${t.colors.muted};\n }\n `;case"destructive":case"latencyHigh":return`\n background-color: ${t.colors.destructive};\n color: ${t.colors.destructiveForeground};\n &:hover {\n background-color: ${t.colors.destructive};\n opacity: 0.9;\n }\n `;case"outline":return`\n background-color: transparent;\n color: ${t.colors.cardForeground};\n border-color: ${t.colors.border};\n `}}}
32
- `;function Xc({className:t,variant:n="default",...r}){return e.createElement(Yc,{variant:n,className:t,...r})}const Kc=$c.div`
66
+ ${({variant:e,themeColors:t})=>{switch(e){case"default":default:return`\n background-color: ${t.primary};\n color: ${t.primaryForeground};\n &:hover {\n background-color: ${t.primary};\n opacity: 0.9;\n }\n `;case"secondary":case"cost":case"gray":case"latency":case"latencyLow":case"latencyMedium":return`\n background-color: ${t.secondary};\n color: ${t.secondaryForeground};\n &:hover {\n background-color: ${t.muted};\n }\n `;case"destructive":case"latencyHigh":return`\n background-color: ${t.destructive};\n color: ${t.destructiveForeground};\n &:hover {\n background-color: ${t.destructive};\n opacity: 0.9;\n }\n `;case"outline":return`\n background-color: transparent;\n color: ${t.cardForeground};\n border-color: ${t.border};\n `}}}
67
+ `,Ac=({variant:t="default",children:n,title:r,placement:o="top"})=>{const{theme:i}=ac(),a=i.colors,s=e.createElement(Oc,{variant:t,themeColors:a},n);return r?e.createElement(Mc,{content:r,placement:o},s):s},Pc=gc.div`
33
68
  user-select: none;
34
- `,Uc=$c.div`
69
+ `,Rc=gc.div`
35
70
  display: flex;
36
71
  align-items: center;
37
72
  gap: 0.25rem;
@@ -41,79 +76,91 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
41
76
  transition: background-color 0.15s ease-in-out;
42
77
 
43
78
  &:hover {
44
- background-color: ${e=>e.isExpandable?e.theme.colors.muted:"transparent"};
79
+ background-color: ${e=>e.isExpandable?e.themeColors.muted:"transparent"};
45
80
  }
46
- `,qc=$c.div`
81
+ `,Tc=gc.div`
47
82
  width: 0.5rem;
48
83
  height: 0.5rem;
49
84
  flex-shrink: 0;
50
85
  display: flex;
51
86
  align-items: center;
52
87
  justify-content: center;
53
- color: ${e=>e.theme.colors.mutedForeground};
54
- `,Zc=$c.span`
88
+ color: ${e=>e.themeColors.mutedForeground};
89
+ `,Dc=gc.span`
55
90
  font-weight: 500;
56
- color: ${e=>e.theme.colors.cardForeground};
91
+ color: ${e=>e.themeColors.foreground};
57
92
  font-size: 0.75rem;
58
- `,Gc=$c.span`
93
+ `,$c=gc.span`
59
94
  font-size: 0.75rem;
60
- color: ${e=>{switch(e.valueType){case"string":return e.theme.colors.primary;case"number":return e.theme.colors.accent;case"boolean":return e.theme.colors.secondary;case"null":case"undefined":return e.theme.colors.mutedForeground;default:return e.theme.colors.cardForeground}}};
61
- `,Qc=$c.span`
95
+ color: ${e=>e.themeColors.primary};
96
+ `,Ic=gc.span`
62
97
  font-size: 0.75rem;
63
- color: ${e=>e.theme.colors.mutedForeground};
64
- `,Jc=$c.div`
65
- border-left: 1px solid ${e=>e.theme.colors.border};
98
+ color: ${e=>e.themeColors.mutedForeground};
99
+ `,zc=gc.div`
100
+ border-left: 1px solid ${e=>e.themeColors.border};
66
101
  margin-left: 0.5rem;
67
- `,eu=$c.div`
102
+ `,Lc=gc.div`
68
103
  width: 100%;
69
- background-color: ${e=>e.theme.colors.muted};
104
+ background-color: ${e=>e.themeColors.muted};
70
105
  border-radius: 0.5rem;
71
- border: 1px solid ${e=>e.theme.colors.border};
106
+ border: 1px solid ${e=>e.themeColors.border};
72
107
  overflow: hidden;
73
- `,tu=$c.div`
108
+ `,Bc=gc.div`
74
109
  width: 100%;
75
110
  max-height: 16rem;
76
111
  overflow-y: auto;
77
112
  padding: 0.5rem;
78
- `,nu=$c.div`
113
+ `,Fc=gc.div`
79
114
  width: 100%;
80
115
  padding: 1rem;
81
116
  text-align: center;
82
- color: ${e=>e.theme.colors.mutedForeground};
117
+ color: ${e=>e.themeColors.mutedForeground};
83
118
  font-size: 0.875rem;
84
- background-color: ${e=>e.theme.colors.muted};
119
+ background-color: ${e=>e.themeColors.muted};
85
120
  border-radius: 0.5rem;
86
- border: 1px solid ${e=>e.theme.colors.border};
87
- `,ru=$c.div`
121
+ border: 1px solid ${e=>e.themeColors.border};
122
+ `,Hc=gc.div`
88
123
  width: 100%;
89
124
  padding: 0.5rem;
90
- background-color: ${e=>e.theme.colors.muted};
125
+ background-color: ${e=>e.themeColors.muted};
91
126
  border-radius: 0.5rem;
92
- border: 1px solid ${e=>e.theme.colors.border};
93
- `,ou=$c.span`
127
+ border: 1px solid ${e=>e.themeColors.border};
128
+ font-size: 0.75rem;
129
+ color: ${e=>e.themeColors.foreground};
130
+ word-break: break-all;
131
+ `;gc.div`
132
+ width: 100%;
133
+ padding: 1rem;
134
+ text-align: center;
135
+ color: ${e=>e.themeColors.mutedForeground};
136
+ font-size: 0.875rem;
137
+ background-color: ${e=>e.themeColors.muted};
138
+ border-radius: 0.5rem;
139
+ border: 1px solid ${e=>e.themeColors.border};
140
+ margin-bottom: 0.5rem;
141
+ `;const Wc=gc.span`
94
142
  font-weight: 500;
95
- color: ${e=>e.theme.colors.cardForeground};
143
+ color: ${e=>e.themeColors.cardForeground};
96
144
  font-size: 0.875rem;
97
- `,au=$c.span`
98
- color: ${e=>e.theme.colors.cardForeground};
145
+ `,Vc=gc.span`
146
+ color: ${e=>e.themeColors.foreground};
99
147
  font-size: 0.875rem;
100
- `,iu=$c.div`
148
+ `,Yc=gc.div`
101
149
  width: 100%;
102
150
  padding: 1rem;
103
151
  text-align: center;
104
- color: ${e=>e.theme.colors.mutedForeground};
152
+ color: ${e=>e.themeColors.mutedForeground};
105
153
  font-size: 0.875rem;
106
- background-color: ${e=>e.theme.colors.muted};
154
+ background-color: ${e=>e.themeColors.muted};
107
155
  border-radius: 0.5rem;
108
- border: 1px solid ${e=>e.theme.colors.border};
109
- `,su=$c.span`
110
- color: ${e=>e.theme.colors.mutedForeground};
111
- `,lu=(e,t=["input","output"])=>Object.entries(e).sort(([e],[n])=>{const r=t.indexOf(e),o=t.indexOf(n);return-1!==r&&-1!==o?r-o:-1!==r?-1:-1!==o?1:e.localeCompare(n)}),cu=({data:e,label:n,depth:r,maxDepth:o,path:a,priorityKeys:i})=>{const[s,l]=u(!1),c=null!==e&&"object"==typeof e&&!Array.isArray(e),d=Array.isArray(e),f=(c||d)&&r<o,p=f&&Object.keys(e).length>0;return t.createElement(Kc,null,t.createElement(Uc,{isExpandable:f,onClick:()=>{f&&l(!s)},style:{paddingLeft:12*r+8+"px"}},t.createElement(qc,null,f&&p?s?t.createElement(Ms,{size:12}):t.createElement(Ps,{size:12}):t.createElement("div",{style:{width:"12px",height:"12px"}})),t.createElement(Zc,null,n,":"),!f&&t.createElement(Gc,{valueType:(h=e,null===h?"null":void 0===h?"undefined":typeof h)},(e=>null===e?"null":void 0===e?"undefined":"string"==typeof e?`"${e}"`:"number"==typeof e||"boolean"==typeof e?e.toString():Array.isArray(e)?`Array(${e.length})`:"object"==typeof e?`Object(${Object.keys(e).length})`:String(e))(e)),f&&!p&&t.createElement(Qc,null,d?"[]":"{}"),f&&p&&!s&&t.createElement(Qc,null,d?`[${Object.keys(e).length} items]`:`{${Object.keys(e).length} keys}`)),s&&p&&t.createElement(Jc,null,lu(e,i).map(([e,n])=>t.createElement(cu,{key:`${a}.${e}`,data:n,label:e,depth:r+1,maxDepth:o,path:`${a}.${e}`,priorityKeys:i}))));var h},uu=({data:e,maxDepth:n=4,initialExpanded:r=!1,className:o="",priorityKeys:a=["input","output"]})=>null==e?t.createElement(nu,{className:o},"No data available"):"object"!=typeof e?t.createElement(ru,{className:o},t.createElement(ou,null,"Value:")," ",t.createElement(au,null,String(e))):0===Object.keys(e).length?t.createElement(iu,{className:o},t.createElement(su,null,Array.isArray(e)?"Empty array":"Empty object")):t.createElement(eu,{className:o},t.createElement(tu,null,lu(e,a).map(([e,r])=>t.createElement(cu,{key:e,data:r,label:e,depth:0,maxDepth:n,path:e,priorityKeys:a})))),du=({width:e="1.5rem",height:n="1.5rem"})=>t.createElement("svg",{style:{width:"number"==typeof e?`${e}px`:e,height:"number"==typeof n?`${n}px`:n,display:"block",color:"#1f2937"},fill:"currentColor",viewBox:"0 0 24 24",role:"img",xmlns:"http://www.w3.org/2000/svg"},t.createElement("title",null,"OpenAI icon"),t.createElement("path",{d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"})),fu=({width:e="1.5rem",height:n="1.5rem"})=>t.createElement("svg",{style:{width:"number"==typeof e?`${e}px`:e,height:"number"==typeof n?`${n}px`:n},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",height:"24",width:"24"},t.createElement("path",{fill:"currentColor",d:"m13.788825 3.932 6.43325 16.136075h3.5279L17.316725 3.932H13.788825Z",strokeWidth:"0.25"}),t.createElement("path",{fill:"currentColor",d:"m6.325375 13.682775 2.20125 -5.67065 2.201275 5.67065H6.325375ZM6.68225 3.932 0.25 20.068075h3.596525l1.3155 -3.3886h6.729425l1.315275 3.3886h3.59655L10.371 3.932H6.68225Z",strokeWidth:"0.25"})),pu=({width:e="1.5rem",height:n="1.5rem"})=>t.createElement("svg",{style:{width:"number"==typeof e?`${e}px`:e,height:"number"==typeof n?`${n}px`:n},xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},t.createElement("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),t.createElement("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),t.createElement("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),t.createElement("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"}),t.createElement("path",{d:"M1 1h22v22H1z",fill:"none"})),hu=({label:e,content:n,isExpanded:r,onToggle:o,theme:a})=>{const i=r?n:n?.slice(0,100)+(n?.length>100?"...":"");return t.createElement(Eu,null,t.createElement(_u,{onClick:o,onMouseEnter:e=>{e.currentTarget.style.backgroundColor=a.colors.muted},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"}},t.createElement(Cu,{style:{color:a.colors.mutedForeground}},e),t.createElement(Nu,null,r?t.createElement(Ms,{style:{width:"12px",height:"12px",color:a.colors.mutedForeground}}):t.createElement(Ps,{style:{width:"12px",height:"12px",color:a.colors.mutedForeground}}))),t.createElement(ku,{value:i||"",readOnly:!0,rows:r?Math.max(3,Math.max(n?.split("\n").length||0,Math.ceil((n?.length||0)/60))):2,style:{border:`1px solid ${a.colors.border}`,backgroundColor:a.colors.muted,color:a.colors.foreground}}))},mu=({data:e,id:n})=>{za();const{theme:r}=zs(),[o,a]=u(!1),[i,s]=u(!1),l=e.edges?.some(e=>e.source===n)||!1,c=e.edges?.some(e=>e.target===n)||!1,d=e.nodeType||"Agent",f=e.label||Lc(d)||"Agent",p=e.details?.internals?.llm_details?.[0]?.model_provider,h=((e,n)=>{if("tool"===e)return"🔧";if("coordinator"===e)return"🎯";if("agent"===e){if("OpenAI"===n)return t.createElement(du,null);if("Anthropic"===n)return t.createElement(fu,null);if("Google"===n||"Vertex_AI"===n)return t.createElement(pu,null)}return"🤖"})(d.toLowerCase(),p),m=e.details?.internals?.llm_details?.[0]?.model_name||"Unknown",g=Bc(e.details?.internals?.llm_details?.[0]?.total_cost),y=e.details?.internals?.llm_details?.[0]?.input?.[0]?.content||"",v=e.details?.internals?.llm_details?.[0]?.input?.[1]?.content||"",b=e.details?.internals?.latency?.total_time;return t.createElement(gu,{onClick:()=>{console.log("Node clicked:",{label:e.label,nodeType:e.nodeType,details:e.details})},theme:r},c&&t.createElement(Jo,{type:"target",position:ho.Top,style:{width:"8px",height:"8px",border:"2px solid #6366f1",backgroundColor:r.colors.background,cursor:"default"},isConnectable:!1}),t.createElement(yu,{theme:r},t.createElement(vu,null,t.createElement(bu,null,h),t.createElement(wu,{theme:r},f)),"Agent"===d&&t.createElement(xu,null,t.createElement(Xc,{variant:"gray"},m),t.createElement(Xc,{variant:"cost"},g)),"Tool"===d&&null!=b&&t.createElement(xu,null,t.createElement(Xc,{variant:"latency"},Fc(b))),"Coordinator"===d&&t.createElement(xu,null,t.createElement(Xc,{variant:"gray"},"Coordinator"))),t.createElement(Su,null,"Agent"===d?t.createElement(t.Fragment,null,t.createElement(hu,{label:"System Message",content:y,isExpanded:o,onToggle:()=>a(!o),theme:r}),t.createElement(hu,{label:"User Message",content:v,isExpanded:i,onToggle:()=>s(!i),theme:r})):"Tool"===d?t.createElement(uu,{data:(()=>{const t=e.details?.internals||{};return e.edgeDetails&&e.edgeDetails.length>0?{...t,input:{args:e.edgeDetails[0]?.input_args,kwargs:e.edgeDetails[0]?.input_kwargs},output:e.edgeDetails[0]?.output,state:e.edgeDetails[0]?.state,status:e.edgeDetails[0]?.status}:t})()}):"Coordinator"===d?t.createElement(uu,{data:e.details?.internals||{}}):null),l&&t.createElement(Jo,{type:"source",position:ho.Bottom,style:{width:"8px",height:"8px",border:"2px solid #6366f1",backgroundColor:r.colors.background,cursor:"default"},isConnectable:!1}))},gu=$c.div`
112
- font-family: ui-sans-serif, system-ui, sans-serif;
156
+ border: 1px solid ${e=>e.themeColors.border};
157
+ `,jc=gc.span`
158
+ color: ${e=>e.themeColors.mutedForeground};
159
+ `,Xc=(e,t=["input","output"])=>Object.entries(e).sort(([e],[n])=>{const r=t.indexOf(e),o=t.indexOf(n);return-1!==r&&-1!==o?r-o:-1!==r?-1:-1!==o?1:e.localeCompare(n)}),Kc=({data:e,label:n,depth:r,maxDepth:o,path:i,priorityKeys:a})=>{const[s,l]=u(!1),{theme:c}=ac(),d=c.colors,f=null!==e&&"object"==typeof e&&!Array.isArray(e),p=Array.isArray(e),h=(f||p)&&r<o,m=h&&Object.keys(e).length>0;return t.createElement(Pc,null,t.createElement(Rc,{isExpandable:h,themeColors:d,onClick:()=>{h&&l(!s)},style:{paddingLeft:12*r+8+"px"}},t.createElement(Tc,{themeColors:d},h&&m?s?t.createElement(Ms,{size:12}):t.createElement(Os,{size:12}):t.createElement("div",{style:{width:"12px",height:"12px"}})),t.createElement(Dc,{themeColors:d},n,":"),!h&&t.createElement($c,{valueType:(g=e,null===g?"null":void 0===g?"undefined":typeof g),themeColors:d},(e=>null===e?"null":void 0===e?"undefined":"string"==typeof e?`"${e}"`:"number"==typeof e||"boolean"==typeof e?e.toString():Array.isArray(e)?`Array(${e.length})`:"object"==typeof e?`Object(${Object.keys(e).length})`:String(e))(e)),h&&!m&&t.createElement(Ic,{themeColors:d},p?"[]":"{}"),h&&m&&!s&&t.createElement(Ic,{themeColors:d},p?`[${Object.keys(e).length} items]`:`{${Object.keys(e).length} keys}`)),s&&m&&t.createElement(zc,{themeColors:d},Xc(e,a).map(([e,n])=>t.createElement(Kc,{key:`${i}.${e}`,data:n,label:e,depth:r+1,maxDepth:o,path:`${i}.${e}`,priorityKeys:a}))));var g},Uc=({data:e,maxDepth:n=4,initialExpanded:r=!1,className:o="",priorityKeys:i=["input","output"]})=>{const{theme:a}=ac(),s=a.colors;return null==e?t.createElement(Fc,{themeColors:s,className:o},"No data available"):"object"!=typeof e?t.createElement(Hc,{themeColors:s,className:o},t.createElement(Wc,{themeColors:s},"Value:")," ",t.createElement(Vc,{themeColors:s},String(e))):0===Object.keys(e).length?t.createElement(Yc,{themeColors:s,className:o},t.createElement(jc,{themeColors:s},Array.isArray(e)?"Empty array":"Empty object")):t.createElement(Lc,{themeColors:s,className:o},t.createElement(Bc,null,Xc(e,i).map(([e,r])=>t.createElement(Kc,{key:e,data:r,label:e,depth:0,maxDepth:n,path:e,priorityKeys:i}))))},qc=({width:e="1.5rem",height:n="1.5rem"})=>t.createElement("svg",{style:{width:"number"==typeof e?`${e}px`:e,height:"number"==typeof n?`${n}px`:n,display:"block"},fill:"currentColor",viewBox:"0 0 24 24",role:"img",xmlns:"http://www.w3.org/2000/svg"},t.createElement("title",null,"OpenAI icon"),t.createElement("path",{d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"})),Zc=({width:e="1.5rem",height:n="1.5rem"})=>t.createElement("svg",{style:{width:"number"==typeof e?`${e}px`:e,height:"number"==typeof n?`${n}px`:n},xmlns:"http://www.w3.org/2000/svg",height:"24",viewBox:"0 0 24 24",width:"24"},t.createElement("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),t.createElement("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),t.createElement("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),t.createElement("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"}),t.createElement("path",{d:"M1 1h22v22H1z",fill:"none"})),Gc=({width:e="1.5rem",height:n="1.5rem"})=>t.createElement("svg",{style:{width:"number"==typeof e?`${e}px`:e,height:"number"==typeof n?`${n}px`:n},xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",height:"24",width:"24"},t.createElement("path",{fill:"currentColor",d:"m13.788825 3.932 6.43325 16.136075h3.5279L17.316725 3.932H13.788825Z",strokeWidth:"0.25"}),t.createElement("path",{fill:"currentColor",d:"m6.325375 13.682775 2.20125 -5.67065 2.201275 5.67065H6.325375ZM6.68225 3.932 0.25 20.068075h3.596525l1.3155 -3.3886h6.729425l1.315275 3.3886h3.59655L10.371 3.932H6.68225Z",strokeWidth:"0.25"})),Qc=({label:e,content:n,isExpanded:r,onToggle:o})=>{const{theme:i}=ac(),a=i.colors,s=r?n:n?.slice(0,100)+(n?.length>100?"...":"");return t.createElement(su,null,t.createElement(lu,{onClick:o,onMouseEnter:e=>{e.currentTarget.style.backgroundColor=a.muted},onMouseLeave:e=>{e.currentTarget.style.backgroundColor="transparent"}},t.createElement(cu,{style:{color:a.mutedForeground}},e),t.createElement(du,null,r?t.createElement(Ms,{style:{width:"12px",height:"12px",color:a.mutedForeground}}):t.createElement(Os,{style:{width:"12px",height:"12px",color:a.mutedForeground}}))),t.createElement(uu,{value:s||"",readOnly:!0,rows:r?Math.max(3,Math.max(n?.split("\n").length||0,Math.ceil((n?.length||0)/60))):2,style:{border:`1px solid ${a.border}`,backgroundColor:a.muted,color:a.foreground}}))},Jc=({data:e,id:n})=>{zi();const{theme:r}=ac(),o=r.colors,[i,a]=u(!1),[s,l]=u(!1),c=e.edges?.some(e=>e.source===n)||!1,d=e.edges?.some(e=>e.target===n)||!1,f=e.nodeType||"Agent",p=e.label||bc(f)||"Agent",h=e.details?.internals?.llm_details?.[0]?.model_provider,m=((e,n)=>{if("tool"===e)return"🔧";if("coordinator"===e)return"🎯";if("agent"===e){if("OpenAI"===n)return t.createElement(qc,null);if("Anthropic"===n)return t.createElement(Gc,null);if("Google"===n||"Vertex_AI"===n)return t.createElement(Zc,null)}return"🤖"})(f.toLowerCase(),h),g=e.details?.internals?.llm_details?.[0]?.model_name||"Unknown",y=wc(e.details?.internals?.llm_details?.[0]?.total_cost),v=e.details?.internals?.llm_details?.[0]?.total_cost,b=e.details?.internals?.llm_details?.[0]?.input?.[0]?.content||"",w=e.details?.internals?.llm_details?.[0]?.input?.[1]?.content||"",x=e.details?.internals?.latency?.total_time;return t.createElement(eu,{onClick:()=>{console.log("Node clicked:",{label:e.label,nodeType:e.nodeType,details:e.details})}},d&&t.createElement(Jo,{type:"target",position:ho.Top,style:{width:"8px",height:"8px",border:`2px solid ${o.primary}`,backgroundColor:o.background,cursor:"default"},isConnectable:!1}),t.createElement(tu,null,t.createElement(nu,null,t.createElement(ru,null,m),t.createElement(ou,null,p)),"Agent"===f&&t.createElement(iu,null,t.createElement(Ac,{variant:"gray",title:g},g),t.createElement(Ac,{variant:"cost",title:v?.toString()||""},y)),"Tool"===f&&null!=x&&t.createElement(iu,null,t.createElement(Ac,{variant:"latency"},xc(x))),"Coordinator"===f&&t.createElement(iu,null,t.createElement(Ac,{variant:"gray"},"Coordinator"))),t.createElement(au,null,"Agent"===f?t.createElement(t.Fragment,null,t.createElement(Qc,{label:"System Message",content:b,isExpanded:i,onToggle:()=>a(!i)}),t.createElement(Qc,{label:"User Message",content:w,isExpanded:s,onToggle:()=>l(!s)})):"Tool"===f?t.createElement(Uc,{data:(()=>{const t=e.details?.internals||{};return e.edgeDetails&&e.edgeDetails.length>0?{...t,input:{args:e.edgeDetails[0]?.input_args,kwargs:e.edgeDetails[0]?.input_kwargs},output:e.edgeDetails[0]?.output,state:e.edgeDetails[0]?.state,status:e.edgeDetails[0]?.status}:t})()}):"Coordinator"===f?t.createElement(Uc,{data:e.details?.internals||{}}):null),c&&t.createElement(Jo,{type:"source",position:ho.Bottom,style:{width:"8px",height:"8px",border:`2px solid ${o.primary}`,backgroundColor:o.background,cursor:"default"},isConnectable:!1}))},eu=gc.div`
113
160
  border-radius: 0.5rem;
114
161
  background-color: ${e=>e.theme.colors.card};
115
162
  border: 2px solid ${e=>e.theme.colors.border};
116
- box-shadow: ${e=>e.theme.shadows.sm};
163
+ box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
117
164
  min-width: 300px;
118
165
  max-width: 500px;
119
166
  transition: all 0.2s ease-in-out;
@@ -121,45 +168,48 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
121
168
  cursor: pointer;
122
169
 
123
170
  &:hover {
124
- border-color: #6366f1;
125
- box-shadow: ${e=>e.theme.shadows.md};
171
+ border-color: ${e=>e.theme.colors.primary};
172
+ box-shadow:
173
+ 0 4px 6px -1px rgba(0, 0, 0, 0.1),
174
+ 0 2px 4px -1px rgba(0, 0, 0, 0.06);
126
175
  }
127
- `,yu=$c.div`
176
+ `,tu=gc.div`
128
177
  display: flex;
129
178
  justify-content: space-between;
130
179
  align-items: center;
131
180
  gap: 0.5rem;
132
181
  padding: 0.75rem;
133
182
  border-bottom: 1px solid ${e=>e.theme.colors.border};
134
- `,vu=$c.div`
183
+ `,nu=gc.div`
135
184
  display: flex;
136
185
  align-items: center;
137
186
  gap: 0.5rem;
138
- `,bu=$c.div`
187
+ `,ru=gc.div`
139
188
  font-size: 1.25rem;
140
189
  display: flex;
141
190
  align-items: center;
142
191
  justify-content: center;
143
- `,wu=$c.div`
192
+ color: ${e=>e.theme.colors.foreground};
193
+ `,ou=gc.div`
144
194
  font-weight: 600;
145
195
  color: ${e=>e.theme.colors.foreground};
146
196
  font-size: 0.875rem;
147
197
  word-break: break-words;
148
- `,xu=$c.div`
198
+ `,iu=gc.div`
149
199
  display: flex;
150
200
  gap: 0.5rem;
151
201
  justify-content: flex-end;
152
202
  align-items: center;
153
- `,Su=$c.div`
203
+ `,au=gc.div`
154
204
  padding: 0.75rem;
155
205
  display: flex;
156
206
  flex-direction: column;
157
207
  align-items: flex-start;
158
208
  justify-content: center;
159
209
  gap: 0.5rem;
160
- `,Eu=$c.div`
210
+ `,su=gc.div`
161
211
  width: 100%;
162
- `,_u=$c.div`
212
+ `,lu=gc.div`
163
213
  display: flex;
164
214
  justify-content: space-between;
165
215
  align-items: center;
@@ -173,48 +223,47 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
173
223
  &:hover {
174
224
  background-color: transparent;
175
225
  }
176
- `,Cu=$c.span`
226
+ `,cu=gc.span`
177
227
  font-weight: 600;
178
228
  font-size: 0.75rem;
179
- `,ku=$c.textarea`
229
+ `,uu=gc.textarea`
180
230
  box-sizing: border-box;
181
231
  width: 100%;
182
232
  border-radius: 0.25rem;
183
233
  padding: 0.5rem;
184
- font-size: 0.75rem;
185
234
  resize: none;
186
235
  min-height: 40px;
187
236
  font-family: inherit;
188
237
 
189
238
  &:focus {
190
239
  outline: none;
191
- border-color: #6366f1;
192
- box-shadow: 0 0 0 1px #6366f1;
240
+ border-color: ${e=>e.theme.colors.primary};
241
+ box-shadow: 0 0 0 1px ${e=>e.theme.colors.primary};
193
242
  }
194
243
 
195
244
  transition: all 0.2s ease-in-out;
196
- `,Nu=$c.div`
245
+ `,du=gc.div`
197
246
  transition: transform 0.2s ease-in-out;
198
- `,Mu=$c.div`
247
+ `,fu=gc.div`
199
248
  background-color: ${e=>e.theme.colors.card};
200
249
  border: 1px solid ${e=>e.theme.colors.border};
201
250
  border-radius: 0.5rem;
202
251
  overflow: hidden;
203
252
  width: 100%;
204
253
  max-width: 400px;
205
- `,Pu=$c.div`
254
+ `,pu=gc.div`
206
255
  display: flex;
207
256
  justify-content: space-between;
208
257
  align-items: center;
209
258
  padding: 0.75rem;
210
259
  border-bottom: 1px solid ${e=>e.theme.colors.border};
211
260
  background-color: ${e=>e.theme.colors.muted};
212
- `,Ou=$c.h3`
261
+ `,hu=gc.h3`
213
262
  margin: 0;
214
263
  font-size: 0.875rem;
215
264
  font-weight: 600;
216
265
  color: ${e=>e.theme.colors.cardForeground};
217
- `,Au=$c.button`
266
+ `,mu=gc.button`
218
267
  display: flex;
219
268
  align-items: center;
220
269
  justify-content: center;
@@ -230,11 +279,11 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
230
279
  background-color: ${e=>e.theme.colors.accent};
231
280
  color: ${e=>e.theme.colors.accentForeground};
232
281
  }
233
- `,Ru=$c.div`
282
+ `,gu=gc.div`
234
283
  padding: 0.75rem;
235
284
  max-height: 400px;
236
285
  overflow-y: auto;
237
- `,Tu=$c.div`
286
+ `,yu=gc.div`
238
287
  position: relative;
239
288
  padding: 0.5rem;
240
289
  border-radius: 0.375rem;
@@ -247,26 +296,26 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
247
296
  &:hover {
248
297
  background-color: ${e=>e.hasStep&&!e.isActive?e.theme.colors.accent:e.isActive?e.theme.colors.primary:"transparent"};
249
298
  }
250
- `,Du=$c.div`
299
+ `,vu=gc.div`
251
300
  display: flex;
252
301
  align-items: center;
253
302
  gap: 0.5rem;
254
303
  margin-bottom: 0.25rem;
255
- `,$u=$c.div`
304
+ `,bu=gc.div`
256
305
  width: 0.5rem;
257
306
  height: 0.5rem;
258
307
  border-radius: 50%;
259
308
  background-color: ${e=>e.isActive?e.theme.colors.primaryForeground:e.isPast?e.theme.colors.primary:e.hasStep?e.theme.colors.mutedForeground:e.theme.colors.border};
260
309
  flex-shrink: 0;
261
- `,Iu=$c.span`
310
+ `,wu=gc.span`
262
311
  font-weight: 600;
263
312
  font-size: 0.75rem;
264
313
  color: ${e=>e.isActive?e.theme.colors.primaryForeground:e.theme.colors.cardForeground};
265
- `,zu=$c.div`
314
+ `,xu=gc.div`
266
315
  font-size: 0.75rem;
267
316
  color: ${e=>e.hasStep?e.theme.colors.cardForeground:e.theme.colors.mutedForeground};
268
317
  font-style: ${e=>e.hasStep?"normal":"italic"};
269
- `,Lu=$c.div`
318
+ `,Eu=gc.div`
270
319
  position: absolute;
271
320
  top: 0;
272
321
  left: 0;
@@ -286,7 +335,7 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
286
335
  opacity: 0.5;
287
336
  }
288
337
  }
289
- `,Bu=({stamps:e,currentStep:n,onStepChange:r,onToggle:o})=>{const a=e.length>0?Math.max(...e.map(e=>e.step)):0,i=e.length>0?Math.min(...e.map(e=>e.step)):0,s=a-i+1,l=e=>e<5e3?"latencyLow":e<=3e4?"latencyMedium":"latencyHigh";return t.createElement(Mu,null,t.createElement(Pu,null,t.createElement(Ou,null,"Timeline"),o&&t.createElement(Au,{onClick:o,title:"Collapse Panel"},t.createElement(Rs,{size:16}))),t.createElement(Ru,null,Array.from({length:s},(o,a)=>{const s=i+a,c=s===n,u=s<n,d=e.some(e=>e.step===s),f=(t=>{const n=e.filter(e=>e.step===t);if(0===n.length)return null;const r=t-1,o=e.filter(e=>e.step===r);return 0===o.length?null:Math.min(...n.map(e=>e.time))-Math.max(...o.map(e=>e.time))})(s),p=(t=>{const n=e.filter(e=>e.step===t);return 0===n.length?`Step ${t}`:n[0]?.identifier||`Step ${t}`})(s);return t.createElement(Tu,{key:s,isActive:c,isPast:u,hasStep:d,onClick:()=>d&&r(s)},t.createElement(Du,null,t.createElement($u,{isActive:c,isPast:u,hasStep:d}),t.createElement(Iu,{isActive:c},"Step ",s),f&&t.createElement(Xc,{variant:l(f),style:{marginLeft:"auto"}},(e=>e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`)(f))),t.createElement(zu,{hasStep:d},d?p:"No activity"),c&&t.createElement(Lu,null))})))};function Fu(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function Hu(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function Wu(...e){return t=>{let n=!1;const r=e.map(e=>{const r=Hu(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():Hu(e[t],null)}}}}function Vu(...t){return e.useCallback(Wu(...t),t)}function ju(t,n=[]){let r=[];const o=()=>{const n=r.map(t=>e.createContext(t));return function(r){const o=r?.[t]||n;return e.useMemo(()=>({[`__scope${t}`]:{...r,[t]:o}}),[r,o])}};return o.scopeName=t,[function(n,o){const a=e.createContext(o),i=r.length;r=[...r,o];const s=n=>{const{scope:r,children:o,...s}=n,l=r?.[t]?.[i]||a,c=e.useMemo(()=>s,Object.values(s));return m(l.Provider,{value:c,children:o})};return s.displayName=n+"Provider",[s,function(r,s){const l=s?.[t]?.[i]||a,c=e.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},Yu(o,...n)]}function Yu(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const o=r.reduce((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]}),{});return e.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])}};return r.scopeName=n.scopeName,r}var Xu=globalThis?.document?e.useLayoutEffect:()=>{},Ku=e[" useId ".trim().toString()]||(()=>{}),Uu=0;function qu(t){const[n,r]=e.useState(Ku());return Xu(()=>{t||r(e=>e??String(Uu++))},[t]),t||(n?`radix-${n}`:"")}var Zu=e[" useInsertionEffect ".trim().toString()]||Xu;function Gu({prop:t,defaultProp:n,onChange:r=()=>{},caller:o}){const[a,i,s]=function({defaultProp:t,onChange:n}){const[r,o]=e.useState(t),a=e.useRef(r),i=e.useRef(n);return Zu(()=>{i.current=n},[n]),e.useEffect(()=>{a.current!==r&&(i.current?.(r),a.current=r)},[r,a]),[r,o,i]}({defaultProp:n,onChange:r}),l=void 0!==t,c=l?t:a;{const n=e.useRef(void 0!==t);e.useEffect(()=>{const e=n.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${n}. 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.`)}n.current=l},[l,o])}const u=e.useCallback(e=>{if(l){const n=function(e){return"function"==typeof e}(e)?e(t):e;n!==t&&s.current?.(n)}else i(e)},[l,t,i,s]);return[c,u]}function Qu(t){const n=Ju(t),r=e.forwardRef((t,r)=>{const{children:o,...a}=t,i=e.Children.toArray(o),s=i.find(td);if(s){const t=s.props.children,o=i.map(n=>n===s?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:n);return m(n,{...a,ref:r,children:e.isValidElement(t)?e.cloneElement(t,void 0,o):null})}return m(n,{...a,ref:r,children:o})});return r.displayName=`${t}.Slot`,r}function Ju(t){const n=e.forwardRef((t,n)=>{const{children:r,...o}=t;if(e.isValidElement(r)){const t=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(r),a=function(e,t){const n={...t};for(const r in t){const o=e[r],a=t[r];/^on[A-Z]/.test(r)?o&&a?n[r]=(...e)=>{const t=a(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...a}:"className"===r&&(n[r]=[o,a].filter(Boolean).join(" "))}return{...e,...n}}(o,r.props);return r.type!==e.Fragment&&(a.ref=n?Wu(n,t):t),e.cloneElement(r,a)}return e.Children.count(r)>1?e.Children.only(null):null});return n.displayName=`${t}.SlotClone`,n}var ed=Symbol("radix.slottable");function td(t){return e.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===ed}var nd=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const r=Qu(`Primitive.${n}`),o=e.forwardRef((e,t)=>{const{asChild:o,...a}=e,i=o?r:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),m(i,{...a,ref:t})});return o.displayName=`Primitive.${n}`,{...t,[n]:o}},{});function rd(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>(...e)=>n.current?.(...e),[])}var od,ad="dismissableLayer.update",id="dismissableLayer.pointerDownOutside",sd="dismissableLayer.focusOutside",ld=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),cd=e.forwardRef((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:s,onDismiss:l,...c}=t,u=e.useContext(ld),[d,f]=e.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=e.useState({}),g=Vu(n,e=>f(e)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),w=d?y.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,S=w>=b,E=function(t,n=globalThis?.document){const r=rd(t),o=e.useRef(!1),a=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let t=function(){fd(id,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",a.current),a.current=t,n.addEventListener("click",a.current,{once:!0})):t()}else n.removeEventListener("click",a.current);o.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",a.current)}},[n,r]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));S&&!n&&(a?.(e),s?.(e),e.defaultPrevented||l?.())},p),_=function(t,n=globalThis?.document){const r=rd(t),o=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){fd(sd,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(i?.(e),s?.(e),e.defaultPrevented||l?.())},p);return function(t,n=globalThis?.document){const r=rd(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[r,n])}(e=>{w===u.layers.size-1&&(o?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),e.useEffect(()=>{if(d)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(od=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),dd(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=od)}},[d,p,r,u]),e.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),dd())},[d,u]),e.useEffect(()=>{const e=()=>h({});return document.addEventListener(ad,e),()=>document.removeEventListener(ad,e)},[]),m(nd.div,{...c,ref:g,style:{pointerEvents:x?S?"auto":"none":void 0,...t.style},onFocusCapture:Fu(t.onFocusCapture,_.onFocusCapture),onBlurCapture:Fu(t.onBlurCapture,_.onBlurCapture),onPointerDownCapture:Fu(t.onPointerDownCapture,E.onPointerDownCapture)})});cd.displayName="DismissableLayer";var ud=e.forwardRef((t,n)=>{const r=e.useContext(ld),o=e.useRef(null),a=Vu(n,o);return e.useEffect(()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),m(nd.div,{...t,ref:a})});function dd(){const e=new CustomEvent(ad);document.dispatchEvent(e)}function fd(e,t,n,{discrete:r}){const o=n.originalEvent.target,a=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&p.flushSync(()=>e.dispatchEvent(t))}(o,a):o.dispatchEvent(a)}ud.displayName="DismissableLayerBranch";var pd="focusScope.autoFocusOnMount",hd="focusScope.autoFocusOnUnmount",md={bubbles:!1,cancelable:!0},gd=e.forwardRef((t,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...s}=t,[l,c]=e.useState(null),u=rd(a),d=rd(i),f=e.useRef(null),p=Vu(n,e=>c(e)),h=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(o){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?f.current=t:wd(f.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||wd(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&wd(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[o,l,h.paused]),e.useEffect(()=>{if(l){xd.add(h);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(pd,md);l.addEventListener(pd,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(wd(r,{select:t}),document.activeElement!==n)return}((e=yd(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&wd(l))}return()=>{l.removeEventListener(pd,u),setTimeout(()=>{const e=new CustomEvent(hd,md);l.addEventListener(hd,d),l.dispatchEvent(e),e.defaultPrevented||wd(t??document.body,{select:!0}),l.removeEventListener(hd,d),xd.remove(h)},0)}}var e},[l,u,d,h]);const g=e.useCallback(e=>{if(!r&&!o)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,a]=function(e){const t=yd(e),n=vd(t,e),r=vd(t.reverse(),e);return[n,r]}(t);o&&a?e.shiftKey||n!==a?e.shiftKey&&n===o&&(e.preventDefault(),r&&wd(a,{select:!0})):(e.preventDefault(),r&&wd(o,{select:!0})):n===t&&e.preventDefault()}},[r,o,h.paused]);return m(nd.div,{tabIndex:-1,...s,ref:p,onKeyDown:g})});function yd(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function vd(e,t){for(const n of e)if(!bd(n,{upTo:t}))return n}function bd(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function wd(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}gd.displayName="FocusScope";var xd=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=Sd(e,t),e.unshift(t)},remove(t){e=Sd(e,t),e[0]?.resume()}}}();function Sd(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var Ed=e.forwardRef((t,n)=>{const{container:r,...o}=t,[a,i]=e.useState(!1);Xu(()=>i(!0),[]);const s=r||a&&globalThis?.document?.body;return s?h.createPortal(m(nd.div,{...o,ref:n}),s):null});Ed.displayName="Portal";var _d=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef(null),a=e.useRef(t),i=e.useRef("none"),s=t?"mounted":"unmounted",[l,c]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=Cd(o.current);i.current="mounted"===l?e:"none"},[l]),Xu(()=>{const e=o.current,n=a.current;if(n!==t){const r=i.current,o=Cd(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}a.current=t}},[t,c]),Xu(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const i=Cd(o.current).includes(CSS.escape(r.animationName));if(r.target===n&&i&&(c("ANIMATION_END"),!a.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(i.current=Cd(o.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,r(e)},[])}}(n),a="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),i=Vu(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(a));return"function"==typeof r||o.isPresent?e.cloneElement(a,{ref:i}):null};function Cd(e){return e?.animationName||"none"}_d.displayName="Presence";var kd=0;function Nd(){e.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??Md()),document.body.insertAdjacentElement("beforeend",e[1]??Md()),kd++,()=>{1===kd&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),kd--}},[])}function Md(){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 Pd=function(){return Pd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},Pd.apply(this,arguments)};function Od(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var Ad="right-scroll-bar-position",Rd="width-before-scroll-bar";function Td(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var Dd="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,$d=new WeakMap;function Id(e,t){var n,r,o,a=(n=t||null,r=function(t){return e.forEach(function(e){return Td(e,t)})},(o=u(function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}})[0]).callback=r,o.facade);return Dd(function(){var t=$d.get(a);if(t){var n=new Set(t),r=new Set(e),o=a.current;n.forEach(function(e){r.has(e)||Td(e,null)}),r.forEach(function(e){n.has(e)||Td(e,o)})}$d.set(a,e)},[e]),a}function zd(e){return e}var Ld=function(t){var n=t.sideCar,r=Od(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,Pd({},r))};Ld.isSideCarExport=!0;var Bd=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=zd);var n=[],r=!1,o={read:function(){if(r)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(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var a=function(){var n=t;t=[],n.forEach(e)},i=function(){return Promise.resolve().then(a)};i(),n={push:function(e){t.push(e),i()},filter:function(e){return t=t.filter(e),n}}}};return o}(null);return t.options=Pd({async:!0,ssr:!1},e),t}(),Fd=function(){},Hd=e.forwardRef(function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:Fd,onWheelCapture:Fd,onTouchMoveCapture:Fd}),a=o[0],i=o[1],s=t.forwardProps,l=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,p=t.sideCar,h=t.noRelative,m=t.noIsolation,g=t.inert,y=t.allowPinchZoom,v=t.as,b=void 0===v?"div":v,w=t.gapMode,x=Od(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),S=p,E=Id([r,n]),_=Pd(Pd({},x),a);return e.createElement(e.Fragment,null,d&&e.createElement(S,{sideCar:Bd,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:g,setCallbacks:i,allowPinchZoom:!!y,lockRef:r,gapMode:w}),s?e.cloneElement(e.Children.only(l),Pd(Pd({},_),{ref:E})):e.createElement(b,Pd({},_,{className:c,ref:E}),l))});Hd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Hd.classNames={fullWidth:Rd,zeroRight:Ad};function Wd(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Vd=function(){var e=0,t=null;return{add:function(n){var r;0==e&&(t=Wd())&&(!function(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}(t,n),r=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(r)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},jd=function(){var t,n=(t=Vd(),function(n,r){e.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&r])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},Yd={left:0,top:0,right:0,gap:0},Xd=function(e){return parseInt(e||"",10)||0},Kd=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Yd;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Xd(n),Xd(r),Xd(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Ud=jd(),qd="data-scroll-locked",Zd=function(e,t,n,r){var o=e.left,a=e.top,i=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(qd,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(a,"px;\n padding-right: ").concat(i,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(Ad," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(Rd," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(Ad," .").concat(Ad," {\n right: 0 ").concat(r,";\n }\n \n .").concat(Rd," .").concat(Rd," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(qd,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},Gd=function(){var e=parseInt(document.body.getAttribute(qd)||"0",10);return isFinite(e)?e:0},Qd=function(t){var n=t.noRelative,r=t.noImportant,o=t.gapMode,a=void 0===o?"margin":o;e.useEffect(function(){return document.body.setAttribute(qd,(Gd()+1).toString()),function(){var e=Gd()-1;e<=0?document.body.removeAttribute(qd):document.body.setAttribute(qd,e.toString())}},[]);var i=e.useMemo(function(){return Kd(a)},[a]);return e.createElement(Ud,{styles:Zd(i,!n,a,r?"":"!important")})},Jd=!1;if("undefined"!=typeof window)try{var ef=Object.defineProperty({},"passive",{get:function(){return Jd=!0,!0}});window.addEventListener("test",ef,ef),window.removeEventListener("test",ef,ef)}catch(e){Jd=!1}var tf=!!Jd&&{passive:!1},nf=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},rf=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),of(e,r)){var o=af(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},of=function(e,t){return"v"===e?function(e){return nf(e,"overflowY")}(t):function(e){return nf(e,"overflowX")}(t)},af=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},sf=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},lf=function(e){return[e.deltaX,e.deltaY]},cf=function(e){return e&&"current"in e?e.current:e},uf=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},df=0,ff=[];function pf(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var hf,mf=(hf=function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),a=e.useState(df++)[0],i=e.useState(jd)[0],s=e.useRef(t);e.useEffect(function(){s.current=t},[t]),e.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(a));var e=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,a=t.length;o<a;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([t.lockRef.current],(t.shards||[]).map(cf),!0).filter(Boolean);return e.forEach(function(e){return e.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),e.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(a))})}}},[t.inert,t.lockRef.current,t.shards]);var l=e.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var n,a=sf(e),i=r.current,l="deltaX"in e?e.deltaX:i[0]-a[0],c="deltaY"in e?e.deltaY:i[1]-a[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=rf(d,u);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=rf(d,u)),!f)return!1;if(!o.current&&"changedTouches"in e&&(l||c)&&(o.current=n),!n)return!0;var p=o.current||n;return function(e,t,n,r,o){var a=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),i=a*r,s=n.target,l=t.contains(s),c=!1,u=i>0,d=0,f=0;do{if(!s)break;var p=af(e,s),h=p[0],m=p[1]-p[2]-a*h;(h||m)&&of(e,s)&&(d+=m,f+=h);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(o&&Math.abs(d)<1||!o&&i>d)||!u&&(o&&Math.abs(f)<1||!o&&-i>f))&&(c=!0),c}(p,t,e,"h"===p?l:c,!0)},[]),c=e.useCallback(function(e){var t=e;if(ff.length&&ff[ff.length-1]===i){var r="deltaY"in t?lf(t):sf(t),o=n.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(n=e.delta,o=r,n[0]===o[0]&&n[1]===o[1]);var n,o})[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var a=(s.current.shards||[]).map(cf).filter(Boolean).filter(function(e){return e.contains(t.target)});(a.length>0?l(t,a[0]):!s.current.noIsolation)&&t.cancelable&&t.preventDefault()}}},[]),u=e.useCallback(function(e,t,r,o){var a={name:e,delta:t,target:r,should:o,shadowParent:pf(r)};n.current.push(a),setTimeout(function(){n.current=n.current.filter(function(e){return e!==a})},1)},[]),d=e.useCallback(function(e){r.current=sf(e),o.current=void 0},[]),f=e.useCallback(function(e){u(e.type,lf(e),e.target,l(e,t.lockRef.current))},[]),p=e.useCallback(function(e){u(e.type,sf(e),e.target,l(e,t.lockRef.current))},[]);e.useEffect(function(){return ff.push(i),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,tf),document.addEventListener("touchmove",c,tf),document.addEventListener("touchstart",d,tf),function(){ff=ff.filter(function(e){return e!==i}),document.removeEventListener("wheel",c,tf),document.removeEventListener("touchmove",c,tf),document.removeEventListener("touchstart",d,tf)}},[]);var h=t.removeScrollBar,m=t.inert;return e.createElement(e.Fragment,null,m?e.createElement(i,{styles:uf(a)}):null,h?e.createElement(Qd,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},Bd.useMedium(hf),Ld),gf=e.forwardRef(function(t,n){return e.createElement(Hd,Pd({},t,{ref:n,sideCar:mf}))});gf.classNames=Hd.classNames;var yf=gf,vf=new WeakMap,bf=new WeakMap,wf={},xf=0,Sf=function(e){return e&&(e.host||Sf(e.parentNode))},Ef=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=Sf(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);wf[n]||(wf[n]=new WeakMap);var a=wf[n],i=[],s=new Set,l=new Set(o),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(vf.get(e)||0)+1,c=(a.get(e)||0)+1;vf.set(e,l),a.set(e,c),i.push(e),1===l&&o&&bf.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),xf++,function(){i.forEach(function(e){var t=vf.get(e)-1,o=a.get(e)-1;vf.set(e,t),a.set(e,o),t||(bf.has(e)||e.removeAttribute(r),bf.delete(e)),o||e.removeAttribute(n)}),--xf||(vf=new WeakMap,vf=new WeakMap,bf=new WeakMap,wf={})}},_f=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),Ef(r,o,n,"aria-hidden")):function(){return null}},Cf="Dialog",[kf,Nf]=ju(Cf),[Mf,Pf]=kf(Cf),Of=t=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:a,onOpenChange:i,modal:s=!0}=t,l=e.useRef(null),c=e.useRef(null),[u,d]=Gu({prop:o,defaultProp:a??!1,onChange:i,caller:Cf});return m(Mf,{scope:n,triggerRef:l,contentRef:c,contentId:qu(),titleId:qu(),descriptionId:qu(),open:u,onOpenChange:d,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})};Of.displayName=Cf;var Af="DialogTrigger",Rf=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Pf(Af,n),a=Vu(t,o.triggerRef);return m(nd.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":Qf(o.open),...r,ref:a,onClick:Fu(e.onClick,o.onOpenToggle)})});Rf.displayName=Af;var Tf="DialogPortal",[Df,$f]=kf(Tf,{forceMount:void 0}),If=t=>{const{__scopeDialog:n,forceMount:r,children:o,container:a}=t,i=Pf(Tf,n);return m(Df,{scope:n,forceMount:r,children:e.Children.map(o,e=>m(_d,{present:r||i.open,children:m(Ed,{asChild:!0,container:a,children:e})}))})};If.displayName=Tf;var zf="DialogOverlay",Lf=e.forwardRef((e,t)=>{const n=$f(zf,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=Pf(zf,e.__scopeDialog);return a.modal?m(_d,{present:r||a.open,children:m(Ff,{...o,ref:t})}):null});Lf.displayName=zf;var Bf=Qu("DialogOverlay.RemoveScroll"),Ff=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Pf(zf,n);return m(yf,{as:Bf,allowPinchZoom:!0,shards:[o.contentRef],children:m(nd.div,{"data-state":Qf(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Hf="DialogContent",Wf=e.forwardRef((e,t)=>{const n=$f(Hf,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,a=Pf(Hf,e.__scopeDialog);return m(_d,{present:r||a.open,children:a.modal?m(Vf,{...o,ref:t}):m(jf,{...o,ref:t})})});Wf.displayName=Hf;var Vf=e.forwardRef((t,n)=>{const r=Pf(Hf,t.__scopeDialog),o=e.useRef(null),a=Vu(n,r.contentRef,o);return e.useEffect(()=>{const e=o.current;if(e)return _f(e)},[]),m(Yf,{...t,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Fu(t.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:Fu(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:Fu(t.onFocusOutside,e=>e.preventDefault())})}),jf=e.forwardRef((t,n)=>{const r=Pf(Hf,t.__scopeDialog),o=e.useRef(!1),a=e.useRef(!1);return m(Yf,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||r.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,a.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(a.current=!0));const n=e.target,i=r.triggerRef.current?.contains(n);i&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&a.current&&e.preventDefault()}})}),Yf=e.forwardRef((t,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:i,...s}=t,l=Pf(Hf,r),c=e.useRef(null),u=Vu(n,c);return Nd(),g(y,{children:[m(gd,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:i,children:m(cd,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":Qf(l.open),...s,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),g(y,{children:[m(np,{titleId:l.titleId}),m(rp,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Xf="DialogTitle",Kf=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Pf(Xf,n);return m(nd.h2,{id:o.titleId,...r,ref:t})});Kf.displayName=Xf;var Uf="DialogDescription",qf=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Pf(Uf,n);return m(nd.p,{id:o.descriptionId,...r,ref:t})});qf.displayName=Uf;var Zf="DialogClose",Gf=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=Pf(Zf,n);return m(nd.button,{type:"button",...r,ref:t,onClick:Fu(e.onClick,()=>o.onOpenChange(!1))})});function Qf(e){return e?"open":"closed"}Gf.displayName=Zf;var Jf="DialogTitleWarning",[ep,tp]=function(t,n){const r=e.createContext(n),o=t=>{const{children:n,...o}=t,a=e.useMemo(()=>o,Object.values(o));return m(r.Provider,{value:a,children:n})};return o.displayName=t+"Provider",[o,function(o){const a=e.useContext(r);if(a)return a;if(void 0!==n)return n;throw new Error(`\`${o}\` must be used within \`${t}\``)}]}(Jf,{contentName:Hf,titleName:Xf,docsSlug:"dialog"}),np=({titleId:t})=>{const n=tp(Jf),r=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return e.useEffect(()=>{if(t){document.getElementById(t)||console.error(r)}},[r,t]),null},rp=({contentRef:t,descriptionId:n})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tp("DialogDescriptionWarning").contentName}}.`;return e.useEffect(()=>{const e=t.current?.getAttribute("aria-describedby");if(n&&e){document.getElementById(n)||console.warn(r)}},[r,t,n]),null},op=Of,ap=Rf,ip=If,sp=Lf,lp=Wf,cp=Kf,up=qf,dp=Gf;const fp=op,pp=ap,hp=ip,mp=e.forwardRef(({className:t,...n},r)=>e.createElement(sp,{style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"hsla(var(--background), 0.8)",backdropFilter:"blur(4px)"},className:t,...n,ref:r}));mp.displayName=sp.displayName;const gp=(e="right")=>{const t={position:"fixed",zIndex:50,gap:"16px",backgroundColor:"hsl(var(--background))",padding:"24px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",transition:"all 0.3s ease-in-out"};switch(e){case"top":return{...t,left:0,right:0,top:0,borderBottom:"1px solid hsl(var(--border))"};case"bottom":return{...t,left:0,right:0,bottom:0,borderTop:"1px solid hsl(var(--border))"};case"left":return{...t,top:0,bottom:0,left:0,height:"100%",width:"75%",borderRight:"1px solid hsl(var(--border))",maxWidth:"384px"};default:return{...t,top:0,bottom:0,right:0,height:"100%",width:"75%",borderLeft:"1px solid hsl(var(--border))",maxWidth:"384px"}}},yp=e.forwardRef(({side:t="right",className:n,children:r,...o},a)=>e.createElement(hp,null,e.createElement(mp,null),e.createElement(lp,{ref:a,style:gp(t),className:n,...o},r,e.createElement(dp,{style:{position:"absolute",right:"16px",top:"16px",borderRadius:"4px",opacity:.7,transition:"opacity 0.2s ease-in-out",cursor:"pointer",border:"none",background:"transparent",padding:"4px"},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"}},e.createElement("svg",{style:{height:"16px",width:"16px"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),e.createElement("span",{style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},"Close")))));yp.displayName=lp.displayName;e.forwardRef(({className:t,...n},r)=>e.createElement(cp,{ref:r,style:{fontSize:"18px",fontWeight:600,color:"hsl(var(--foreground))"},className:t,...n})).displayName=cp.displayName;e.forwardRef(({className:t,...n},r)=>e.createElement(up,{ref:r,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:t,...n})).displayName=up.displayName;const vp=(e,t,n={})=>{const{minNodeSpacing:r=200,containerWidth:o=600}=n;if(!e||0===e.length)return new Map;new Map(e.map(e=>[e.identifier,e]));const a=new Map,i=new Map;e.forEach(e=>a.set(e.identifier,[])),t.length>0?t.forEach(e=>{e.source&&e.target&&(a.get(e.source)?.push(e.target),i.set(e.target,e.source))}):e.forEach(e=>{e.parent&&e.parent.identifier!==e.identifier&&(a.get(e.parent.identifier)?.push(e.identifier),i.set(e.identifier,e.parent.identifier))});const s=e.filter(e=>!i.has(e.identifier)),l=new Map,c=(e,t)=>{l.set(e,t);for(const n of a.get(e)||[])c(n,t+1)};s.forEach(e=>c(e.identifier,0));const u=[];e.forEach(e=>{const t=l.get(e.identifier)??0;u[t]||(u[t]=[]),u[t].push(e.identifier)});const d=new Map,f=200,p=Math.max(250,r+50),h=e=>{const t=a.get(e)||[];if(0===t.length)return d.set(e,f),f;let n=0;for(const e of t)n+=h(e);return n+=(t.length-1)*p,d.set(e,n),n};s.forEach(e=>h(e.identifier));const m=new Map,g=Math.max(400,r+200),y=(e,t,n)=>{const r=d.get(e)||f,o=n*g+100,i=a.get(e)||[];if(0===i.length)m.set(e,{x:t+r/2-100,y:o});else{let r=t;for(const e of i){const t=d.get(e)||f;y(e,r,n+1),r+=t+p}const a=i[0],s=i[i.length-1],l=m.get(a),c=m.get(s),u=(l.x+c.x)/2;m.set(e,{x:u,y:o})}};let v=0;for(const e of s)v+=d.get(e.identifier)||f;s.length>1&&(v+=(s.length-1)*p*2);let b=Math.max(0,(o-v)/2);for(const e of s)y(e.identifier,b,0),b+=(d.get(e.identifier)||f)+2*p;const w=r,x=Array.from(m.keys());for(let e=0;e<x.length;e++)for(let t=e+1;t<x.length;t++){const n=m.get(x[e]),r=m.get(x[t]);if(Math.sqrt((r.x-n.x)**2+(r.y-n.y)**2)<w){const e=r.x-n.x,t=r.y-n.y,o=Math.sqrt(e*e+t*t);if(o>0){const a=w/o,i=(e*a-e)/2,s=(t*a-t)/2;n.x-=i,n.y-=s,r.x+=i,r.y+=s}else n.x-=w/2,r.x+=w/2}}return m},bp={Agent:mu,Tool:mu,Coordinator:mu},wp=({flowData:e,width:n="100%",height:r="1000px",className:a="",defaultZoom:c=1,defaultPan:d={x:0,y:0},disableAutoFit:f=!0,showTimeline:p=!1,minNodeSpacing:h=200})=>{const{theme:m}=zs(),g=e;if(!g)return t.createElement("div",{style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof r?`${r}px`:r,border:`1px solid ${m.colors.border}`,borderRadius:"8px",background:m.colors.muted,position:"relative",minWidth:"800px",minHeight:"600px",display:"flex",alignItems:"center",justifyContent:"center"},className:a},t.createElement("div",{style:{textAlign:"center"}},t.createElement("div",{style:{fontSize:"16px",color:m.colors.mutedForeground,marginBottom:"8px"}},"No flow data available"),t.createElement("div",{style:{fontSize:"14px",color:m.colors.mutedForeground}},"Please provide flowData prop")));const y=l(null),v=l(null),[b,w]=u({width:"number"==typeof n?n:1200,height:"number"==typeof r?r:600}),[x,S]=u(0),[E,_]=u(!1),C=l(null),[k,N]=u(!1),M=o(()=>{const e=g.stamps||g.steps||[];return e.length>0?Math.max(...e.map(e=>e.step)):0},[g.stamps,g.steps]);i(()=>(E?C.current=setInterval(()=>{S(e=>e>=M?(_(!1),e):e+1)},250):C.current&&(clearInterval(C.current),C.current=null),()=>{C.current&&clearInterval(C.current)}),[E,M]),i(()=>{const e=g.stamps||g.steps||[];e.length>0&&S(Math.max(...e.map(e=>e.step)))},[g.stamps,g.steps]),i(()=>{const e=()=>{if(y.current){const e=y.current.getBoundingClientRect();w({width:Math.max(e.width||("number"==typeof n?n:1200),1200),height:e.height||("number"==typeof r?r:600)})}};if(e(),window.ResizeObserver&&y.current){const t=new ResizeObserver(e);return t.observe(y.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n,r]);const P=o(()=>{if(!g.nodes)return new Map;const e=Math.max(b.width||800,1200);return vp(g.nodes,g.edges||[],{minNodeSpacing:h,containerWidth:e})},[g.nodes,g.edges,b.width,h]),O=s(e=>g.nodes?g.nodes.filter(t=>t.stamp.step<=e):[],[g.nodes]),A=s(e=>(g.edges||[]).filter(t=>t.stamp.step<=e),[g.edges]),R=o(()=>{const e=O(x),t=A(x);return e.map(e=>{const n=P.get(e.identifier)||{x:0,y:0},r=e.stamp.step===x,o="Tool"===e.node_type?t.filter(t=>t.target===e.identifier&&t.details).map(e=>e.details):void 0;return{id:e.identifier,type:e.node_type||"Agent",position:n,data:{label:e.name||e.node_type,nodeType:e.node_type,details:e.details,isActive:r,id:e.identifier,edges:t,edgeDetails:o},style:{filter:r?"drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3))":"none"}}})},[P,x,O,A]),T=o(()=>A(x).filter(e=>e.source&&e.target).map(e=>{const t=e.stamp.step===x;return{id:e.identifier,type:"default",source:e.source,target:e.target,animated:t,bidirectional:!0,style:{stroke:t?"#6366f1":"#9ca3af",strokeWidth:t?3:2},label:e.stamp?.identifier?Hc(String(e.stamp.identifier),50):void 0,data:{label:e.stamp?.identifier?Hc(String(e.stamp.identifier),50):void 0,source:e.source,target:e.target,step:e.stamp?.step,time:e.stamp?.time,details:e.details}}}),[x,A]),[D,$,I]=ds(R),[z,L,B]=fs(T);i(()=>{$(R)},[R,$]),i(()=>{L(T)},[T,L]);const F=s(e=>L(t=>To(e,t)),[L]),H=s(e=>{S(e),_(!1)},[]);s(()=>{_(e=>!e)},[]);const W=(e,t)=>{if(!v.current)return{x:0,y:0};const n=v.current.createSVGPoint();n.x=e,n.y=t;const r=n.matrixTransform(v.current.getScreenCTM()?.inverse());return{x:r.x,y:r.y}},V=za();return i(()=>{if(f||!V||0===R.length)return;const e=new Map;T.forEach(t=>{const n=e.get(t.source)||0;e.set(t.source,n+1);const r=e.get(t.target)||0;e.set(t.target,r+1)});let t="",n=0;e.forEach((e,r)=>{e>n&&(n=e,t=r)}),!t&&R.length>0&&(t=R[0].id),t&&setTimeout(()=>{V.fitView({nodes:[{id:t}],duration:1e3,padding:.2,minZoom:c,maxZoom:1})},500)},[R,T,V,f,c]),t.createElement("div",{ref:y,style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof r?`${r}px`:r,border:`1px solid ${m.colors.border}`,borderRadius:"8px",overflow:"hidden",position:"relative",minWidth:"800px",minHeight:"600px",background:m.colors.background},className:a},p&&t.createElement(fp,{open:k,onOpenChange:N},t.createElement(pp,{asChild:!0},t.createElement("button",{style:{position:"absolute",top:"16px",left:"16px",zIndex:50,width:"40px",height:"40px",backgroundColor:m.colors.card,border:`1px solid ${m.colors.border}`,borderRadius:"8px",boxShadow:m.shadows.sm,display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease-in-out",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=m.colors.muted},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=m.colors.card},title:"Open Timeline"},t.createElement(Rs,{size:20,style:{color:m.colors.mutedForeground}}))),t.createElement(hp,null,t.createElement(lp,{style:{position:"fixed",top:0,bottom:0,left:0,height:"100%",width:"280px",zIndex:50,backgroundColor:m.colors.background,borderRight:`1px solid ${m.colors.border}`,boxShadow:m.shadows.lg,transition:"all 0.3s ease-in-out",padding:0},onPointerDownOutside:e=>e.preventDefault()},t.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100%"}},t.createElement("div",{style:{flex:1,overflowY:"auto"}},t.createElement(Bu,{stamps:g.stamps||g.steps||[],currentStep:x,onStepChange:H}))),t.createElement(dp,{style:{position:"absolute",right:"16px",top:"16px",borderRadius:"4px",opacity:.7,transition:"opacity 0.2s ease-in-out",cursor:"pointer",border:"none",background:"transparent",padding:"4px",color:m.colors.mutedForeground},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"}},t.createElement("svg",{style:{height:"16px",width:"16px"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),t.createElement("span",{style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},"Close"))))),t.createElement(cs,{nodes:D,edges:z,onNodesChange:I,onEdgesChange:B,onConnect:F,nodeTypes:bp,edgeTypes:{default:e=>t.createElement(Ls,{...e,clientToSvgCoords:W,svgRef:v})},attributionPosition:"bottom-left",style:{width:"100%",height:"100%"},defaultViewport:{x:d.x,y:d.y,zoom:c},onInit:()=>{if(y.current){const e=y.current.querySelector("svg");e&&(v.current=e)}}},t.createElement(ws,{variant:ps.Lines,color:m.colors.border,gap:16})),t.createElement("style",null,`\n .react-flow__edge-label {\n font-size: 10px;\n background: ${m.colors.card};\n color: ${m.colors.cardForeground};\n padding: 2px 4px;\n border-radius: 4px;\n border: 1px solid ${m.colors.border};\n max-width: 150px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .react-flow__edge {\n cursor: default !important;\n }\n\n .react-flow__edge-path {\n cursor: default !important;\n }\n `))},xp=e=>t.createElement(ts,null,t.createElement(wp,e));function Sp(e,[t,n]){return Math.min(n,Math.max(t,e))}var Ep=e.createContext(void 0);const _p=["top","right","bottom","left"],Cp=Math.min,kp=Math.max,Np=Math.round,Mp=Math.floor,Pp=e=>({x:e,y:e}),Op={left:"right",right:"left",bottom:"top",top:"bottom"},Ap={start:"end",end:"start"};function Rp(e,t,n){return kp(e,Cp(t,n))}function Tp(e,t){return"function"==typeof e?e(t):e}function Dp(e){return e.split("-")[0]}function $p(e){return e.split("-")[1]}function Ip(e){return"x"===e?"y":"x"}function zp(e){return"y"===e?"height":"width"}const Lp=new Set(["top","bottom"]);function Bp(e){return Lp.has(Dp(e))?"y":"x"}function Fp(e){return Ip(Bp(e))}function Hp(e){return e.replace(/start|end/g,e=>Ap[e])}const Wp=["left","right"],Vp=["right","left"],jp=["top","bottom"],Yp=["bottom","top"];function Xp(e,t,n,r){const o=$p(e);let a=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Vp:Wp:t?Wp:Vp;case"left":case"right":return t?jp:Yp;default:return[]}}(Dp(e),"start"===n,r);return o&&(a=a.map(e=>e+"-"+o),t&&(a=a.concat(a.map(Hp)))),a}function Kp(e){return e.replace(/left|right|bottom|top/g,e=>Op[e])}function Up(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function qp(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Zp(e,t,n){let{reference:r,floating:o}=e;const a=Bp(t),i=Fp(t),s=zp(i),l=Dp(t),c="y"===a,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch($p(t)){case"start":p[i]-=f*(n&&c?-1:1);break;case"end":p[i]+=f*(n&&c?-1:1)}return p}async function Gp(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:a,rects:i,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=Tp(t,e),h=Up(p),m=s[f?"floating"===d?"reference":"floating":d],g=qp(await a.getClippingRect({element:null==(n=await(null==a.isElement?void 0:a.isElement(m)))||n?m:m.contextElement||await(null==a.getDocumentElement?void 0:a.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:r,y:o,width:i.floating.width,height:i.floating.height}:i.reference,v=await(null==a.getOffsetParent?void 0:a.getOffsetParent(s.floating)),b=await(null==a.isElement?void 0:a.isElement(v))&&await(null==a.getScale?void 0:a.getScale(v))||{x:1,y:1},w=qp(a.convertOffsetParentRelativeRectToViewportRelativeRect?await a.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function Qp(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function Jp(e){return _p.some(t=>e[t]>=0)}const eh=new Set(["left","top"]);function th(){return"undefined"!=typeof window}function nh(e){return ah(e)?(e.nodeName||"").toLowerCase():"#document"}function rh(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function oh(e){var t;return null==(t=(ah(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function ah(e){return!!th()&&(e instanceof Node||e instanceof rh(e).Node)}function ih(e){return!!th()&&(e instanceof Element||e instanceof rh(e).Element)}function sh(e){return!!th()&&(e instanceof HTMLElement||e instanceof rh(e).HTMLElement)}function lh(e){return!(!th()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof rh(e).ShadowRoot)}const ch=new Set(["inline","contents"]);function uh(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=Sh(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!ch.has(o)}const dh=new Set(["table","td","th"]);function fh(e){return dh.has(nh(e))}const ph=[":popover-open",":modal"];function hh(e){return ph.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const mh=["transform","translate","scale","rotate","perspective"],gh=["transform","translate","scale","rotate","perspective","filter"],yh=["paint","layout","strict","content"];function vh(e){const t=bh(),n=ih(e)?Sh(e):e;return mh.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||gh.some(e=>(n.willChange||"").includes(e))||yh.some(e=>(n.contain||"").includes(e))}function bh(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const wh=new Set(["html","body","#document"]);function xh(e){return wh.has(nh(e))}function Sh(e){return rh(e).getComputedStyle(e)}function Eh(e){return ih(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function _h(e){if("html"===nh(e))return e;const t=e.assignedSlot||e.parentNode||lh(e)&&e.host||oh(e);return lh(t)?t.host:t}function Ch(e){const t=_h(e);return xh(t)?e.ownerDocument?e.ownerDocument.body:e.body:sh(t)&&uh(t)?t:Ch(t)}function kh(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=Ch(e),a=o===(null==(r=e.ownerDocument)?void 0:r.body),i=rh(o);if(a){const e=Nh(i);return t.concat(i,i.visualViewport||[],uh(o)?o:[],e&&n?kh(e):[])}return t.concat(o,kh(o,[],n))}function Nh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function Mh(e){const t=Sh(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=sh(e),a=o?e.offsetWidth:n,i=o?e.offsetHeight:r,s=Np(n)!==a||Np(r)!==i;return s&&(n=a,r=i),{width:n,height:r,$:s}}function Ph(e){return ih(e)?e:e.contextElement}function Oh(e){const t=Ph(e);if(!sh(t))return Pp(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:a}=Mh(t);let i=(a?Np(n.width):n.width)/r,s=(a?Np(n.height):n.height)/o;return i&&Number.isFinite(i)||(i=1),s&&Number.isFinite(s)||(s=1),{x:i,y:s}}const Ah=Pp(0);function Rh(e){const t=rh(e);return bh()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:Ah}function Th(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),a=Ph(e);let i=Pp(1);t&&(r?ih(r)&&(i=Oh(r)):i=Oh(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==rh(e))&&t}(a,n,r)?Rh(a):Pp(0);let l=(o.left+s.x)/i.x,c=(o.top+s.y)/i.y,u=o.width/i.x,d=o.height/i.y;if(a){const e=rh(a),t=r&&ih(r)?rh(r):r;let n=e,o=Nh(n);for(;o&&r&&t!==n;){const e=Oh(o),t=o.getBoundingClientRect(),r=Sh(o),a=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,i=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=a,c+=i,n=rh(o),o=Nh(n)}}return qp({width:u,height:d,x:l,y:c})}function Dh(e,t){const n=Eh(e).scrollLeft;return t?t.left+n:Th(oh(e)).left+n}function $h(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-Dh(e,n),y:n.top+t.scrollTop}}const Ih=new Set(["absolute","fixed"]);function zh(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=rh(e),r=oh(e),o=n.visualViewport;let a=r.clientWidth,i=r.clientHeight,s=0,l=0;if(o){a=o.width,i=o.height;const e=bh();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=Dh(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,i=Math.abs(r.clientWidth-t.clientWidth-o);i<=25&&(a-=i)}else c<=25&&(a+=c);return{width:a,height:i,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=oh(e),n=Eh(e),r=e.ownerDocument.body,o=kp(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),a=kp(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let i=-n.scrollLeft+Dh(e);const s=-n.scrollTop;return"rtl"===Sh(r).direction&&(i+=kp(t.clientWidth,r.clientWidth)-o),{width:o,height:a,x:i,y:s}}(oh(e));else if(ih(t))r=function(e,t){const n=Th(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,a=sh(e)?Oh(e):Pp(1);return{width:e.clientWidth*a.x,height:e.clientHeight*a.y,x:o*a.x,y:r*a.y}}(t,n);else{const n=Rh(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return qp(r)}function Lh(e,t){const n=_h(e);return!(n===t||!ih(n)||xh(n))&&("fixed"===Sh(n).position||Lh(n,t))}function Bh(e,t,n){const r=sh(t),o=oh(t),a="fixed"===n,i=Th(e,!0,a,t);let s={scrollLeft:0,scrollTop:0};const l=Pp(0);function c(){l.x=Dh(o)}if(r||!r&&!a)if(("body"!==nh(t)||uh(o))&&(s=Eh(t)),r){const e=Th(t,!0,a,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();a&&!r&&o&&c();const u=!o||r||a?Pp(0):$h(o,s);return{x:i.left+s.scrollLeft-l.x-u.x,y:i.top+s.scrollTop-l.y-u.y,width:i.width,height:i.height}}function Fh(e){return"static"===Sh(e).position}function Hh(e,t){if(!sh(e)||"fixed"===Sh(e).position)return null;if(t)return t(e);let n=e.offsetParent;return oh(e)===n&&(n=n.ownerDocument.body),n}function Wh(e,t){const n=rh(e);if(hh(e))return n;if(!sh(e)){let t=_h(e);for(;t&&!xh(t);){if(ih(t)&&!Fh(t))return t;t=_h(t)}return n}let r=Hh(e,t);for(;r&&fh(r)&&Fh(r);)r=Hh(r,t);return r&&xh(r)&&Fh(r)&&!vh(r)?n:r||function(e){let t=_h(e);for(;sh(t)&&!xh(t);){if(vh(t))return t;if(hh(t))return null;t=_h(t)}return null}(e)||n}const Vh={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const a="fixed"===o,i=oh(r),s=!!t&&hh(t.floating);if(r===i||s&&a)return n;let l={scrollLeft:0,scrollTop:0},c=Pp(1);const u=Pp(0),d=sh(r);if((d||!d&&!a)&&(("body"!==nh(r)||uh(i))&&(l=Eh(r)),sh(r))){const e=Th(r);c=Oh(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!i||d||a?Pp(0):$h(i,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:oh,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const a="clippingAncestors"===n?hh(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=kh(e,[],!1).filter(e=>ih(e)&&"body"!==nh(e)),o=null;const a="fixed"===Sh(e).position;let i=a?_h(e):e;for(;ih(i)&&!xh(i);){const t=Sh(i),n=vh(i);n||"fixed"!==t.position||(o=null),(a?!n&&!o:!n&&"static"===t.position&&o&&Ih.has(o.position)||uh(i)&&!n&&Lh(e,i))?r=r.filter(e=>e!==i):o=t,i=_h(i)}return t.set(e,r),r}(t,this._c):[].concat(n),i=[...a,r],s=i[0],l=i.reduce((e,n)=>{const r=zh(t,n,o);return e.top=kp(r.top,e.top),e.right=Cp(r.right,e.right),e.bottom=Cp(r.bottom,e.bottom),e.left=kp(r.left,e.left),e},zh(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:Wh,getElementRects:async function(e){const t=this.getOffsetParent||Wh,n=this.getDimensions,r=await n(e.floating);return{reference:Bh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=Mh(e);return{width:t,height:n}},getScale:Oh,isElement:ih,isRTL:function(e){return"rtl"===Sh(e).direction}};function jh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Yh(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:a=!0,elementResize:i="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=Ph(e),u=o||a?[...c?kh(c):[],...kh(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),a&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,r=null;const o=oh(e);function a(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function i(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),a();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const h={rootMargin:-Mp(d)+"px "+-Mp(o.clientWidth-(u+f))+"px "+-Mp(o.clientHeight-(d+p))+"px "+-Mp(u)+"px",threshold:kp(0,Cp(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return i();r?i(!1,r):n=setTimeout(()=>{i(!1,1e-7)},1e3)}1!==r||jh(c,e.getBoundingClientRect())||i(),m=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),a}(c,n):null;let f,p=-1,h=null;i&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m=l?Th(e):null;return l&&function t(){const r=Th(e);m&&!jh(m,r)&&n();m=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),a&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Xh=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:a,placement:i,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,a=await(null==r.isRTL?void 0:r.isRTL(o.floating)),i=Dp(n),s=$p(n),l="y"===Bp(n),c=eh.has(i)?-1:1,u=a&&l?-1:1,d=Tp(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return i===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:a+l.y,data:{...l,placement:i}}}}},Kh=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:a=!0,crossAxis:i=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=Tp(e,t),c={x:n,y:r},u=await Gp(t,l),d=Bp(Dp(o)),f=Ip(d);let p=c[f],h=c[d];if(a){const e="y"===f?"bottom":"right";p=Rp(p+u["y"===f?"top":"left"],p,p-u[e])}if(i){const e="y"===d?"bottom":"right";h=Rp(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[f]:p,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:a,[d]:i}}}}}},Uh=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:a,rects:i,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=Tp(e,t);if(null!=(n=a.arrow)&&n.alignmentOffset)return{};const y=Dp(o),v=Bp(s),b=Dp(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!m?[Kp(s)]:function(e){const t=Kp(e);return[Hp(e),t,Hp(t)]}(s)),S="none"!==h;!f&&S&&x.push(...Xp(s,m,h,w));const E=[s,...x],_=await Gp(t,g),C=[];let k=(null==(r=a.flip)?void 0:r.overflows)||[];if(u&&C.push(_[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=$p(e),o=Fp(e),a=zp(o);let i="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[a]>t.floating[a]&&(i=Kp(i)),[i,Kp(i)]}(o,i,w);C.push(_[e[0]],_[e[1]])}if(k=[...k,{placement:o,overflows:C}],!C.every(e=>e<=0)){var N,M;const e=((null==(N=a.flip)?void 0:N.index)||0)+1,t=E[e];if(t){if(!("alignment"===d&&v!==Bp(t))||k.every(e=>Bp(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:k},reset:{placement:t}}}let n=null==(M=k.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:M.placement;if(!n)switch(p){case"bestFit":{var P;const e=null==(P=k.filter(e=>{if(S){const t=Bp(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:P[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},qh=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:a,platform:i,elements:s}=t,{apply:l=()=>{},...c}=Tp(e,t),u=await Gp(t,c),d=Dp(o),f=$p(o),p="y"===Bp(o),{width:h,height:m}=a.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=f===(await(null==i.isRTL?void 0:i.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,g="end"===f?"top":"bottom");const v=m-u.top-u.bottom,b=h-u.left-u.right,w=Cp(m-u[g],v),x=Cp(h-u[y],b),S=!t.middlewareData.shift;let E=w,_=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(_=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(E=v),S&&!f){const e=kp(u.left,0),t=kp(u.right,0),n=kp(u.top,0),r=kp(u.bottom,0);p?_=h-2*(0!==e||0!==t?e+t:kp(u.left,u.right)):E=m-2*(0!==n||0!==r?n+r:kp(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:E});const C=await i.getDimensions(s.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},Zh=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=Tp(e,t);switch(r){case"referenceHidden":{const e=Qp(await Gp(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:Jp(e)}}}case"escaped":{const e=Qp(await Gp(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:Jp(e)}}}default:return{}}}}},Gh=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:a,platform:i,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Tp(e,t)||{};if(null==c)return{};const d=Up(u),f={x:n,y:r},p=Fp(o),h=zp(p),m=await i.getDimensions(c),g="y"===p,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=a.reference[h]+a.reference[p]-f[p]-a.floating[h],x=f[p]-a.reference[p],S=await(null==i.getOffsetParent?void 0:i.getOffsetParent(c));let E=S?S[b]:0;E&&await(null==i.isElement?void 0:i.isElement(S))||(E=s.floating[b]||a.floating[h]);const _=w/2-x/2,C=E/2-m[h]/2-1,k=Cp(d[y],C),N=Cp(d[v],C),M=k,P=E-m[h]-N,O=E/2-m[h]/2+_,A=Rp(M,O,P),R=!l.arrow&&null!=$p(o)&&O!==A&&a.reference[h]/2-(O<M?k:N)-m[h]/2<0,T=R?O<M?O-M:O-P:0;return{[p]:f[p]+T,data:{[p]:A,centerOffset:O-A-T,...R&&{alignmentOffset:T}},reset:R}}}),Qh=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:a,middlewareData:i}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Tp(e,t),u={x:n,y:r},d=Bp(o),f=Ip(d);let p=u[f],h=u[d];const m=Tp(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===f?"height":"width",t=a.reference[f]-a.floating[e]+g.mainAxis,n=a.reference[f]+a.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var y,v;const e="y"===f?"width":"height",t=eh.has(Dp(o)),n=a.reference[d]-a.floating[e]+(t&&(null==(y=i.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),r=a.reference[d]+a.reference[e]+(t?0:(null==(v=i.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[f]:p,[d]:h}}}},Jh=(e,t,n)=>{const r=new Map,o={platform:Vh,...n},a={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:a=[],platform:i}=n,s=a.filter(Boolean),l=await(null==i.isRTL?void 0:i.isRTL(t));let c=await i.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Zp(c,r,l),f=r,p={},h=0;for(let n=0;n<s.length;n++){const{name:a,fn:m}=s[n],{x:g,y:y,data:v,reset:b}=await m({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:c,platform:i,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,p={...p,[a]:{...p[a],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await i.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=Zp(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:a})};var em="undefined"!=typeof document?f:function(){};function tm(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!tm(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!tm(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function nm(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function rm(e,t){const n=nm(e);return Math.round(t*n)/n}function om(t){const n=e.useRef(t);return em(()=>{n.current=t}),n}const am=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?Gh({element:n.current,padding:r}).fn(t):{}:n?Gh({element:n,padding:r}).fn(t):{};var o}}),im=(e,t)=>({...Xh(e),options:[e,t]}),sm=(e,t)=>({...Kh(e),options:[e,t]}),lm=(e,t)=>({...Qh(e),options:[e,t]}),cm=(e,t)=>({...Uh(e),options:[e,t]}),um=(e,t)=>({...qh(e),options:[e,t]}),dm=(e,t)=>({...Zh(e),options:[e,t]}),fm=(e,t)=>({...am(e),options:[e,t]});var pm=e.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...a}=e;return m(nd.svg,{...a,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m("polygon",{points:"0,0 30,0 15,10"})})});pm.displayName="Arrow";var hm=pm;function mm(t){const[n,r]=e.useState(void 0);return Xu(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let o,a;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,a=t.blockSize}else o=t.offsetWidth,a=t.offsetHeight;r({width:o,height:a})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}r(void 0)},[t]),n}var gm="Popper",[ym,vm]=ju(gm),[bm,wm]=ym(gm),xm=t=>{const{__scopePopper:n,children:r}=t,[o,a]=e.useState(null);return m(bm,{scope:n,anchor:o,onAnchorChange:a,children:r})};xm.displayName=gm;var Sm="PopperAnchor",Em=e.forwardRef((t,n)=>{const{__scopePopper:r,virtualRef:o,...a}=t,i=wm(Sm,r),s=e.useRef(null),l=Vu(n,s),c=e.useRef(null);return e.useEffect(()=>{const e=c.current;c.current=o?.current||s.current,e!==c.current&&i.onAnchorChange(c.current)}),o?null:m(nd.div,{...a,ref:l})});Em.displayName=Sm;var _m="PopperContent",[Cm,km]=ym(_m),Nm=e.forwardRef((t,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:a=0,align:i="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=t,b=wm(_m,r),[w,x]=e.useState(null),S=Vu(n,e=>x(e)),[E,_]=e.useState(null),C=mm(E),k=C?.width??0,N=C?.height??0,M=o+("center"!==i?"-"+i:""),P="number"==typeof d?d:{top:0,right:0,bottom:0,left:0,...d},O=Array.isArray(u)?u:[u],A=O.length>0,R={padding:P,boundary:O.filter(Am),altBoundary:A},{refs:T,floatingStyles:D,placement:$,isPositioned:I,middlewareData:z}=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:a,elements:{reference:i,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=t,[d,f]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[h,m]=e.useState(o);tm(h,o)||m(o);const[g,y]=e.useState(null),[v,b]=e.useState(null),w=e.useCallback(e=>{e!==_.current&&(_.current=e,y(e))},[]),x=e.useCallback(e=>{e!==C.current&&(C.current=e,b(e))},[]),S=i||g,E=s||v,_=e.useRef(null),C=e.useRef(null),k=e.useRef(d),N=null!=c,M=om(c),P=om(a),O=om(u),A=e.useCallback(()=>{if(!_.current||!C.current)return;const e={placement:n,strategy:r,middleware:h};P.current&&(e.platform=P.current),Jh(_.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==O.current};R.current&&!tm(k.current,t)&&(k.current=t,p.flushSync(()=>{f(t)}))})},[h,n,r,P,O]);em(()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const R=e.useRef(!1);em(()=>(R.current=!0,()=>{R.current=!1}),[]),em(()=>{if(S&&(_.current=S),E&&(C.current=E),S&&E){if(M.current)return M.current(S,E,A);A()}},[S,E,A,M,N]);const T=e.useMemo(()=>({reference:_,floating:C,setReference:w,setFloating:x}),[w,x]),D=e.useMemo(()=>({reference:S,floating:E}),[S,E]),$=e.useMemo(()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=rm(D.floating,d.x),n=rm(D.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...nm(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,D.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:A,refs:T,elements:D,floatingStyles:$}),[d,A,T,D,$])}({strategy:"fixed",placement:M,whileElementsMounted:(...e)=>Yh(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[im({mainAxis:a+N,alignmentAxis:s}),c&&sm({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?lm():void 0,...R}),c&&cm({...R}),um({...R,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:a}=t.reference,i=e.floating.style;i.setProperty("--radix-popper-available-width",`${n}px`),i.setProperty("--radix-popper-available-height",`${r}px`),i.setProperty("--radix-popper-anchor-width",`${o}px`),i.setProperty("--radix-popper-anchor-height",`${a}px`)}}),E&&fm({element:E,padding:l}),Rm({arrowWidth:k,arrowHeight:N}),h&&dm({strategy:"referenceHidden",...R})]}),[L,B]=Tm($),F=rd(y);Xu(()=>{I&&F?.()},[I,F]);const H=z.arrow?.x,W=z.arrow?.y,V=0!==z.arrow?.centerOffset,[j,Y]=e.useState();return Xu(()=>{w&&Y(window.getComputedStyle(w).zIndex)},[w]),m("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:I?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:j,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m(Cm,{scope:r,placedSide:L,onArrowChange:_,arrowX:H,arrowY:W,shouldHideArrow:V,children:m(nd.div,{"data-side":L,"data-align":B,...v,ref:S,style:{...v.style,animation:I?void 0:"none"}})})})});Nm.displayName=_m;var Mm="PopperArrow",Pm={top:"bottom",right:"left",bottom:"top",left:"right"},Om=e.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=km(Mm,n),a=Pm[o.placedSide];return m("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:m(hm,{...r,ref:t,style:{...r.style,display:"block"}})})});function Am(e){return null!==e}Om.displayName=Mm;var Rm=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,a=0!==o.arrow?.centerOffset,i=a?0:e.arrowWidth,s=a?0:e.arrowHeight,[l,c]=Tm(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+i/2,f=(o.arrow?.y??0)+s/2;let p="",h="";return"bottom"===l?(p=a?u:`${d}px`,h=-s+"px"):"top"===l?(p=a?u:`${d}px`,h=`${r.floating.height+s}px`):"right"===l?(p=-s+"px",h=a?u:`${f}px`):"left"===l&&(p=`${r.floating.width+s}px`,h=a?u:`${f}px`),{data:{x:p,y:h}}}});function Tm(e){const[t,n="center"]=e.split("-");return[t,n]}var Dm=xm,$m=Em,Im=Nm,zm=Om;function Lm(t){const n=e.useRef({value:t,previous:t});return e.useMemo(()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous),[t])}var Bm=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"});e.forwardRef((e,t)=>m(nd.span,{...e,ref:t,style:{...Bm,...e.style}})).displayName="VisuallyHidden";var Fm=[" ","Enter","ArrowUp","ArrowDown"],Hm=[" ","Enter"],Wm="Select",[Vm,jm,Ym]=function(e){const n=e+"CollectionProvider",[r,o]=ju(n),[a,i]=r(n,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:r}=e,o=t.useRef(null),i=t.useRef(new Map).current;return m(a,{scope:n,itemMap:i,collectionRef:o,children:r})};s.displayName=n;const l=e+"CollectionSlot",c=Qu(l),u=t.forwardRef((e,t)=>{const{scope:n,children:r}=e,o=Vu(t,i(l,n).collectionRef);return m(c,{ref:o,children:r})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=Qu(d),h=t.forwardRef((e,n)=>{const{scope:r,children:o,...a}=e,s=t.useRef(null),l=Vu(n,s),c=i(d,r);return t.useEffect(()=>(c.itemMap.set(s,{ref:s,...a}),()=>{c.itemMap.delete(s)})),m(p,{[f]:"",ref:l,children:o})});return h.displayName=d,[{Provider:s,Slot:u,ItemSlot:h},function(n){const r=i(e+"CollectionConsumer",n);return t.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(r.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[r.collectionRef,r.itemMap])},o]}(Wm),[Xm,Km]=ju(Wm,[Ym,vm]),Um=vm(),[qm,Zm]=Xm(Wm),[Gm,Qm]=Xm(Wm),Jm=t=>{const{__scopeSelect:n,children:r,open:o,defaultOpen:a,onOpenChange:i,value:s,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:y}=t,v=Um(n),[b,w]=e.useState(null),[x,S]=e.useState(null),[E,_]=e.useState(!1),C=function(t){const n=e.useContext(Ep);return t||n||"ltr"}(u),[k,N]=Gu({prop:o,defaultProp:a??!1,onChange:i,caller:Wm}),[M,P]=Gu({prop:s,defaultProp:l,onChange:c,caller:Wm}),O=e.useRef(null),A=!b||(y||!!b.closest("form")),[R,T]=e.useState(new Set),D=Array.from(R).map(e=>e.props.value).join(";");return m(Dm,{...v,children:g(qm,{required:h,scope:n,trigger:b,onTriggerChange:w,valueNode:x,onValueNodeChange:S,valueNodeHasChildren:E,onValueNodeHasChildrenChange:_,contentId:qu(),value:M,onValueChange:P,open:k,onOpenChange:N,dir:C,triggerPointerDownPosRef:O,disabled:p,children:[m(Vm.Provider,{scope:n,children:m(Gm,{scope:t.__scopeSelect,onNativeOptionAdd:e.useCallback(e=>{T(t=>new Set(t).add(e))},[]),onNativeOptionRemove:e.useCallback(e=>{T(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:r})}),A?g(Bg,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:M,onChange:e=>P(e.target.value),disabled:p,form:y,children:[void 0===M?m("option",{value:""}):null,Array.from(R)]},D):null]})})};Jm.displayName=Wm;var eg="SelectTrigger",tg=e.forwardRef((t,n)=>{const{__scopeSelect:r,disabled:o=!1,...a}=t,i=Um(r),s=Zm(eg,r),l=s.disabled||o,c=Vu(n,s.onTriggerChange),u=jm(r),d=e.useRef("touch"),[f,p,h]=Hg(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),r=Wg(t,e,n);void 0!==r&&s.onValueChange(r.value)}),g=e=>{l||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return m($m,{asChild:!0,...i,children:m(nd.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":Fg(s.value)?"":void 0,...a,ref:c,onClick:Fu(a.onClick,e=>{e.currentTarget.focus(),"mouse"!==d.current&&g(e)}),onPointerDown:Fu(a.onPointerDown,e=>{d.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:Fu(a.onKeyDown,e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||Fm.includes(e.key)&&(g(),e.preventDefault())})})})});tg.displayName=eg;var ng="SelectValue",rg=e.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:i="",...s}=e,l=Zm(ng,n),{onValueNodeHasChildrenChange:c}=l,u=void 0!==a,d=Vu(t,l.onValueNodeChange);return Xu(()=>{c(u)},[c,u]),m(nd.span,{...s,ref:d,style:{pointerEvents:"none"},children:Fg(l.value)?m(y,{children:i}):a})});rg.displayName=ng;var og=e.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m(nd.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});og.displayName="SelectIcon";var ag=e=>m(Ed,{asChild:!0,...e});ag.displayName="SelectPortal";var ig="SelectContent",sg=e.forwardRef((t,n)=>{const r=Zm(ig,t.__scopeSelect),[o,a]=e.useState();if(Xu(()=>{a(new DocumentFragment)},[]),!r.open){const e=o;return e?p.createPortal(m(cg,{scope:t.__scopeSelect,children:m(Vm.Slot,{scope:t.__scopeSelect,children:m("div",{children:t.children})})}),e):null}return m(fg,{...t,ref:n})});sg.displayName=ig;var lg=10,[cg,ug]=Xm(ig),dg=Qu("SelectContent.RemoveScroll"),fg=e.forwardRef((t,n)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:i,onPointerDownOutside:s,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:y,avoidCollisions:v,...b}=t,w=Zm(ig,r),[x,S]=e.useState(null),[E,_]=e.useState(null),C=Vu(n,e=>S(e)),[k,N]=e.useState(null),[M,P]=e.useState(null),O=jm(r),[A,R]=e.useState(!1),T=e.useRef(!1);e.useEffect(()=>{if(x)return _f(x)},[x]),Nd();const D=e.useCallback(e=>{const[t,...n]=O().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const n of e){if(n===o)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&E&&(E.scrollTop=0),n===r&&E&&(E.scrollTop=E.scrollHeight),n?.focus(),document.activeElement!==o)return}},[O,E]),$=e.useCallback(()=>D([k,x]),[D,k,x]);e.useEffect(()=>{A&&$()},[A,$]);const{onOpenChange:I,triggerPointerDownPosRef:z}=w;e.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||I(!1),document.removeEventListener("pointermove",t),z.current=null};return null!==z.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,I,z]),e.useEffect(()=>{const e=()=>I(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[I]);const[L,B]=Hg(e=>{const t=O().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=Wg(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),F=e.useCallback((e,t,n)=>{const r=!T.current&&!n;(void 0!==w.value&&w.value===t||r)&&(N(e),r&&(T.current=!0))},[w.value]),H=e.useCallback(()=>x?.focus(),[x]),W=e.useCallback((e,t,n)=>{const r=!T.current&&!n;(void 0!==w.value&&w.value===t||r)&&P(e)},[w.value]),V="popper"===o?hg:pg,j=V===hg?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return m(cg,{scope:r,content:x,viewport:E,onViewportChange:_,itemRefCallback:F,selectedItem:k,onItemLeave:H,itemTextRefCallback:W,focusSelectedItem:$,selectedItemText:M,position:o,isPositioned:A,searchRef:L,children:m(yf,{as:dg,allowPinchZoom:!0,children:m(gd,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:Fu(a,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:m(cd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:i,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:m(V,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...b,...j,onPlaced:()=>R(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:Fu(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=O().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>D(t)),e.preventDefault()}})})})})})})});fg.displayName="SelectContentImpl";var pg=e.forwardRef((t,n)=>{const{__scopeSelect:r,onPlaced:o,...a}=t,i=Zm(ig,r),s=ug(ig,r),[l,c]=e.useState(null),[u,d]=e.useState(null),f=Vu(n,e=>d(e)),p=jm(r),h=e.useRef(!1),g=e.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:w}=s,x=e.useCallback(()=>{if(i.trigger&&i.valueNode&&l&&u&&y&&v&&b){const e=i.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=i.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if("rtl"!==i.dir){const o=r.left-t.left,a=n.left-o,i=e.left-a,s=e.width+i,c=Math.max(s,t.width),u=window.innerWidth-lg,d=Sp(a,[lg,Math.max(lg,u-c)]);l.style.minWidth=s+"px",l.style.left=d+"px"}else{const o=t.right-r.right,a=window.innerWidth-n.right-o,i=window.innerWidth-e.right-a,s=e.width+i,c=Math.max(s,t.width),u=window.innerWidth-lg,d=Sp(a,[lg,Math.max(lg,u-c)]);l.style.minWidth=s+"px",l.style.right=d+"px"}const a=p(),s=window.innerHeight-2*lg,c=y.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),w=f+m+c+parseInt(d.paddingBottom,10)+g,x=Math.min(5*v.offsetHeight,w),S=window.getComputedStyle(y),E=parseInt(S.paddingTop,10),_=parseInt(S.paddingBottom,10),C=e.top+e.height/2-lg,k=s-C,N=v.offsetHeight/2,M=f+m+(v.offsetTop+N),P=w-M;if(M<=C){const e=a.length>0&&v===a[a.length-1].ref.current;l.style.bottom="0px";const t=u.clientHeight-y.offsetTop-y.offsetHeight,n=M+Math.max(k,N+(e?_:0)+t+g);l.style.height=n+"px"}else{const e=a.length>0&&v===a[0].ref.current;l.style.top="0px";const t=Math.max(C,f+y.offsetTop+(e?E:0)+N)+P;l.style.height=t+"px",y.scrollTop=M-C+y.offsetTop}l.style.margin=`${lg}px 0`,l.style.minHeight=x+"px",l.style.maxHeight=s+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[p,i.trigger,i.valueNode,l,u,y,v,b,i.dir,o]);Xu(()=>x(),[x]);const[S,E]=e.useState();Xu(()=>{u&&E(window.getComputedStyle(u).zIndex)},[u]);const _=e.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return m(mg,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:_,children:m("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:m(nd.div,{...a,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});pg.displayName="SelectItemAlignedPosition";var hg=e.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=lg,...a}=e,i=Um(n);return m(Im,{...i,...a,ref:t,align:r,collisionPadding:o,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)"}})});hg.displayName="SelectPopperPosition";var[mg,gg]=Xm(ig,{}),yg="SelectViewport",vg=e.forwardRef((t,n)=>{const{__scopeSelect:r,nonce:o,...a}=t,i=ug(yg,r),s=gg(yg,r),l=Vu(n,i.onViewportChange),c=e.useRef(0);return g(y,{children:[m("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}),m(Vm.Slot,{scope:r,children:m(nd.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Fu(a.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){const e=Math.abs(c.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*lg,o=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(o,a);if(i<r){const o=i+e,a=Math.min(r,o),s=o-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});vg.displayName=yg;var bg="SelectGroup",[wg,xg]=Xm(bg);e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=qu();return m(wg,{scope:n,id:o,children:m(nd.div,{role:"group","aria-labelledby":o,...r,ref:t})})}).displayName=bg;var Sg="SelectLabel",Eg=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=xg(Sg,n);return m(nd.div,{id:o.id,...r,ref:t})});Eg.displayName=Sg;var _g="SelectItem",[Cg,kg]=Xm(_g),Ng=e.forwardRef((t,n)=>{const{__scopeSelect:r,value:o,disabled:a=!1,textValue:i,...s}=t,l=Zm(_g,r),c=ug(_g,r),u=l.value===o,[d,f]=e.useState(i??""),[p,h]=e.useState(!1),g=Vu(n,e=>c.itemRefCallback?.(e,o,a)),y=qu(),v=e.useRef("touch"),b=()=>{a||(l.onValueChange(o),l.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 m(Cg,{scope:r,value:o,disabled:a,textId:y,isSelected:u,onItemTextChange:e.useCallback(e=>{f(t=>t||(e?.textContent??"").trim())},[]),children:m(Vm.ItemSlot,{scope:r,value:o,disabled:a,textValue:d,children:m(nd.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...s,ref:g,onFocus:Fu(s.onFocus,()=>h(!0)),onBlur:Fu(s.onBlur,()=>h(!1)),onClick:Fu(s.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:Fu(s.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:Fu(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:Fu(s.onPointerMove,e=>{v.current=e.pointerType,a?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Fu(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:Fu(s.onKeyDown,e=>{""!==c.searchRef?.current&&" "===e.key||(Hm.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});Ng.displayName=_g;var Mg="SelectItemText",Pg=e.forwardRef((t,n)=>{const{__scopeSelect:r,className:o,style:a,...i}=t,s=Zm(Mg,r),l=ug(Mg,r),c=kg(Mg,r),u=Qm(Mg,r),[d,f]=e.useState(null),h=Vu(n,e=>f(e),c.onItemTextChange,e=>l.itemTextRefCallback?.(e,c.value,c.disabled)),v=d?.textContent,b=e.useMemo(()=>m("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=u;return Xu(()=>(w(b),()=>x(b)),[w,x,b]),g(y,{children:[m(nd.span,{id:c.textId,...i,ref:h}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?p.createPortal(i.children,s.valueNode):null]})});Pg.displayName=Mg;var Og="SelectItemIndicator",Ag=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return kg(Og,n).isSelected?m(nd.span,{"aria-hidden":!0,...r,ref:t}):null});Ag.displayName=Og;var Rg="SelectScrollUpButton",Tg=e.forwardRef((t,n)=>{const r=ug(Rg,t.__scopeSelect),o=gg(Rg,t.__scopeSelect),[a,i]=e.useState(!1),s=Vu(n,o.onScrollButtonChange);return Xu(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollTop>0;i(e)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),a?m(Ig,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Tg.displayName=Rg;var Dg="SelectScrollDownButton",$g=e.forwardRef((t,n)=>{const r=ug(Dg,t.__scopeSelect),o=gg(Dg,t.__scopeSelect),[a,i]=e.useState(!1),s=Vu(n,o.onScrollButtonChange);return Xu(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;i(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),a?m(Ig,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});$g.displayName=Dg;var Ig=e.forwardRef((t,n)=>{const{__scopeSelect:r,onAutoScroll:o,...a}=t,i=ug("SelectScrollButton",r),s=e.useRef(null),l=jm(r),c=e.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return e.useEffect(()=>()=>c(),[c]),Xu(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),m(nd.div,{"aria-hidden":!0,...a,ref:n,style:{flexShrink:0,...a.style},onPointerDown:Fu(a.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(o,50))}),onPointerMove:Fu(a.onPointerMove,()=>{i.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(o,50))}),onPointerLeave:Fu(a.onPointerLeave,()=>{c()})})}),zg=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m(nd.div,{"aria-hidden":!0,...r,ref:t})});zg.displayName="SelectSeparator";var Lg="SelectArrow";e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Um(n),a=Zm(Lg,n),i=ug(Lg,n);return a.open&&"popper"===i.position?m(zm,{...o,...r,ref:t}):null}).displayName=Lg;var Bg=e.forwardRef(({__scopeSelect:t,value:n,...r},o)=>{const a=e.useRef(null),i=Vu(o,a),s=Lm(n);return e.useEffect(()=>{const e=a.current;if(!e)return;const t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(s!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[s,n]),m(nd.select,{...r,style:{...Bm,...r.style},ref:i,defaultValue:n})});function Fg(e){return""===e||void 0===e}function Hg(t){const n=rd(t),r=e.useRef(""),o=e.useRef(0),a=e.useCallback(e=>{const t=r.current+e;n(t),function e(t){r.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(t)},[n]),i=e.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return e.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,a,i]}function Wg(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0]),o=r?t[0]:t,a=n?e.indexOf(n):-1;let i=function(e,t){return e.map((n,r)=>e[(t+r)%e.length])}(e,Math.max(a,0));1===o.length&&(i=i.filter(e=>e!==n));const s=i.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return s!==n?s:void 0}Bg.displayName="SelectBubbleInput";var Vg=tg,jg=og,Yg=ag,Xg=sg,Kg=vg,Ug=Eg,qg=Ng,Zg=Pg,Gg=Ag,Qg=Tg,Jg=$g,ey=zg;const ty=Jm,ny=rg,ry=$c(Vg)`
338
+ `,Su=({stamps:e,currentStep:n,onStepChange:r,onToggle:o})=>{const i=e.length>0?Math.max(...e.map(e=>e.step)):0,a=e.length>0?Math.min(...e.map(e=>e.step)):0,s=i-a+1,l=e=>e<5e3?"latencyLow":e<=3e4?"latencyMedium":"latencyHigh";return t.createElement(fu,null,t.createElement(pu,null,t.createElement(hu,null,"Timeline"),o&&t.createElement(mu,{onClick:o,title:"Collapse Panel"},t.createElement(Rs,{size:16}))),t.createElement(gu,null,Array.from({length:s},(o,i)=>{const s=a+i,c=s===n,u=s<n,d=e.some(e=>e.step===s),f=(t=>{const n=e.filter(e=>e.step===t);if(0===n.length)return null;const r=t-1,o=e.filter(e=>e.step===r);return 0===o.length?null:Math.min(...n.map(e=>e.time))-Math.max(...o.map(e=>e.time))})(s),p=(t=>{const n=e.filter(e=>e.step===t);return 0===n.length?`Step ${t}`:n[0]?.identifier||`Step ${t}`})(s);return t.createElement(yu,{key:s,isActive:c,isPast:u,hasStep:d,onClick:()=>d&&r(s)},t.createElement(vu,null,t.createElement(bu,{isActive:c,isPast:u,hasStep:d}),t.createElement(wu,{isActive:c},"Step ",s),f&&t.createElement("div",{style:{marginLeft:"auto"}},t.createElement(Ac,{variant:l(f)},(e=>e<1e3?`${e}ms`:`${(e/1e3).toFixed(1)}s`)(f)))),t.createElement(xu,{hasStep:d},d?p:"No activity"),c&&t.createElement(Eu,null))})))};function _u(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function Cu(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function ku(...e){return t=>{let n=!1;const r=e.map(e=>{const r=Cu(e,t);return n||"function"!=typeof r||(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():Cu(e[t],null)}}}}function Nu(...t){return e.useCallback(ku(...t),t)}function Mu(t,n=[]){let r=[];const o=()=>{const n=r.map(t=>e.createContext(t));return function(r){const o=r?.[t]||n;return e.useMemo(()=>({[`__scope${t}`]:{...r,[t]:o}}),[r,o])}};return o.scopeName=t,[function(n,o){const i=e.createContext(o),a=r.length;r=[...r,o];const s=n=>{const{scope:r,children:o,...s}=n,l=r?.[t]?.[a]||i,c=e.useMemo(()=>s,Object.values(s));return m(l.Provider,{value:c,children:o})};return s.displayName=n+"Provider",[s,function(r,s){const l=s?.[t]?.[a]||i,c=e.useContext(l);if(c)return c;if(void 0!==o)return o;throw new Error(`\`${r}\` must be used within \`${n}\``)}]},Ou(o,...n)]}function Ou(...t){const n=t[0];if(1===t.length)return n;const r=()=>{const r=t.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(t){const o=r.reduce((e,{useScope:n,scopeName:r})=>({...e,...n(t)[`__scope${r}`]}),{});return e.useMemo(()=>({[`__scope${n.scopeName}`]:o}),[o])}};return r.scopeName=n.scopeName,r}var Au=globalThis?.document?e.useLayoutEffect:()=>{},Pu=e[" useId ".trim().toString()]||(()=>{}),Ru=0;function Tu(t){const[n,r]=e.useState(Pu());return Au(()=>{t||r(e=>e??String(Ru++))},[t]),t||(n?`radix-${n}`:"")}var Du=e[" useInsertionEffect ".trim().toString()]||Au;function $u({prop:t,defaultProp:n,onChange:r=()=>{},caller:o}){const[i,a,s]=function({defaultProp:t,onChange:n}){const[r,o]=e.useState(t),i=e.useRef(r),a=e.useRef(n);return Du(()=>{a.current=n},[n]),e.useEffect(()=>{i.current!==r&&(a.current?.(r),i.current=r)},[r,i]),[r,o,a]}({defaultProp:n,onChange:r}),l=void 0!==t,c=l?t:i;{const n=e.useRef(void 0!==t);e.useEffect(()=>{const e=n.current;if(e!==l){const t=e?"controlled":"uncontrolled",n=l?"controlled":"uncontrolled";console.warn(`${o} is changing from ${t} to ${n}. 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.`)}n.current=l},[l,o])}const u=e.useCallback(e=>{if(l){const n=function(e){return"function"==typeof e}(e)?e(t):e;n!==t&&s.current?.(n)}else a(e)},[l,t,a,s]);return[c,u]}function Iu(t){const n=zu(t),r=e.forwardRef((t,r)=>{const{children:o,...i}=t,a=e.Children.toArray(o),s=a.find(Bu);if(s){const t=s.props.children,o=a.map(n=>n===s?e.Children.count(t)>1?e.Children.only(null):e.isValidElement(t)?t.props.children:null:n);return m(n,{...i,ref:r,children:e.isValidElement(t)?e.cloneElement(t,void 0,o):null})}return m(n,{...i,ref:r,children:o})});return r.displayName=`${t}.Slot`,r}function zu(t){const n=e.forwardRef((t,n)=>{const{children:r,...o}=t;if(e.isValidElement(r)){const t=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(r),i=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{const t=i(...e);return o(...e),t}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(o,r.props);return r.type!==e.Fragment&&(i.ref=n?ku(n,t):t),e.cloneElement(r,i)}return e.Children.count(r)>1?e.Children.only(null):null});return n.displayName=`${t}.SlotClone`,n}var Lu=Symbol("radix.slottable");function Bu(t){return e.isValidElement(t)&&"function"==typeof t.type&&"__radixId"in t.type&&t.type.__radixId===Lu}var Fu=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((t,n)=>{const r=Iu(`Primitive.${n}`),o=e.forwardRef((e,t)=>{const{asChild:o,...i}=e,a=o?r:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),m(a,{...i,ref:t})});return o.displayName=`Primitive.${n}`,{...t,[n]:o}},{});function Hu(t){const n=e.useRef(t);return e.useEffect(()=>{n.current=t}),e.useMemo(()=>(...e)=>n.current?.(...e),[])}var Wu,Vu="dismissableLayer.update",Yu="dismissableLayer.pointerDownOutside",ju="dismissableLayer.focusOutside",Xu=e.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ku=e.forwardRef((t,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:i,onFocusOutside:a,onInteractOutside:s,onDismiss:l,...c}=t,u=e.useContext(Xu),[d,f]=e.useState(null),p=d?.ownerDocument??globalThis?.document,[,h]=e.useState({}),g=Nu(n,e=>f(e)),y=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),w=d?y.indexOf(d):-1,x=u.layersWithOutsidePointerEventsDisabled.size>0,E=w>=b,S=function(t,n=globalThis?.document){const r=Hu(t),o=e.useRef(!1),i=e.useRef(()=>{});return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){let t=function(){Zu(Yu,r,o,{discrete:!0})};const o={originalEvent:e};"touch"===e.pointerType?(n.removeEventListener("click",i.current),i.current=t,n.addEventListener("click",i.current,{once:!0})):t()}else n.removeEventListener("click",i.current);o.current=!1},t=window.setTimeout(()=>{n.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),n.removeEventListener("pointerdown",e),n.removeEventListener("click",i.current)}},[n,r]),{onPointerDownCapture:()=>o.current=!0}}(e=>{const t=e.target,n=[...u.branches].some(e=>e.contains(t));E&&!n&&(i?.(e),s?.(e),e.defaultPrevented||l?.())},p),_=function(t,n=globalThis?.document){const r=Hu(t),o=e.useRef(!1);return e.useEffect(()=>{const e=e=>{if(e.target&&!o.current){Zu(ju,r,{originalEvent:e},{discrete:!1})}};return n.addEventListener("focusin",e),()=>n.removeEventListener("focusin",e)},[n,r]),{onFocusCapture:()=>o.current=!0,onBlurCapture:()=>o.current=!1}}(e=>{const t=e.target;[...u.branches].some(e=>e.contains(t))||(a?.(e),s?.(e),e.defaultPrevented||l?.())},p);return function(t,n=globalThis?.document){const r=Hu(t);e.useEffect(()=>{const e=e=>{"Escape"===e.key&&r(e)};return n.addEventListener("keydown",e,{capture:!0}),()=>n.removeEventListener("keydown",e,{capture:!0})},[r,n])}(e=>{w===u.layers.size-1&&(o?.(e),!e.defaultPrevented&&l&&(e.preventDefault(),l()))},p),e.useEffect(()=>{if(d)return r&&(0===u.layersWithOutsidePointerEventsDisabled.size&&(Wu=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),qu(),()=>{r&&1===u.layersWithOutsidePointerEventsDisabled.size&&(p.body.style.pointerEvents=Wu)}},[d,p,r,u]),e.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),qu())},[d,u]),e.useEffect(()=>{const e=()=>h({});return document.addEventListener(Vu,e),()=>document.removeEventListener(Vu,e)},[]),m(Fu.div,{...c,ref:g,style:{pointerEvents:x?E?"auto":"none":void 0,...t.style},onFocusCapture:_u(t.onFocusCapture,_.onFocusCapture),onBlurCapture:_u(t.onBlurCapture,_.onBlurCapture),onPointerDownCapture:_u(t.onPointerDownCapture,S.onPointerDownCapture)})});Ku.displayName="DismissableLayer";var Uu=e.forwardRef((t,n)=>{const r=e.useContext(Xu),o=e.useRef(null),i=Nu(n,o);return e.useEffect(()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),m(Fu.div,{...t,ref:i})});function qu(){const e=new CustomEvent(Vu);document.dispatchEvent(e)}function Zu(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&p.flushSync(()=>e.dispatchEvent(t))}(o,i):o.dispatchEvent(i)}Uu.displayName="DismissableLayerBranch";var Gu="focusScope.autoFocusOnMount",Qu="focusScope.autoFocusOnUnmount",Ju={bubbles:!1,cancelable:!0},ed=e.forwardRef((t,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:i,onUnmountAutoFocus:a,...s}=t,[l,c]=e.useState(null),u=Hu(i),d=Hu(a),f=e.useRef(null),p=Nu(n,e=>c(e)),h=e.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;e.useEffect(()=>{if(o){let e=function(e){if(h.paused||!l)return;const t=e.target;l.contains(t)?f.current=t:od(f.current,{select:!0})},t=function(e){if(h.paused||!l)return;const t=e.relatedTarget;null!==t&&(l.contains(t)||od(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&od(l)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return l&&r.observe(l,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[o,l,h.paused]),e.useEffect(()=>{if(l){id.add(h);const t=document.activeElement;if(!l.contains(t)){const n=new CustomEvent(Gu,Ju);l.addEventListener(Gu,u),l.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(od(r,{select:t}),document.activeElement!==n)return}((e=td(l),e.filter(e=>"A"!==e.tagName)),{select:!0}),document.activeElement===t&&od(l))}return()=>{l.removeEventListener(Gu,u),setTimeout(()=>{const e=new CustomEvent(Qu,Ju);l.addEventListener(Qu,d),l.dispatchEvent(e),e.defaultPrevented||od(t??document.body,{select:!0}),l.removeEventListener(Qu,d),id.remove(h)},0)}}var e},[l,u,d,h]);const g=e.useCallback(e=>{if(!r&&!o)return;if(h.paused)return;const t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,n=document.activeElement;if(t&&n){const t=e.currentTarget,[o,i]=function(e){const t=td(e),n=nd(t,e),r=nd(t.reverse(),e);return[n,r]}(t);o&&i?e.shiftKey||n!==i?e.shiftKey&&n===o&&(e.preventDefault(),r&&od(i,{select:!0})):(e.preventDefault(),r&&od(o,{select:!0})):n===t&&e.preventDefault()}},[r,o,h.paused]);return m(Fu.div,{tabIndex:-1,...s,ref:p,onKeyDown:g})});function td(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{const t="INPUT"===e.tagName&&"hidden"===e.type;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function nd(e,t){for(const n of e)if(!rd(n,{upTo:t}))return n}function rd(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function od(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}ed.displayName="FocusScope";var id=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=ad(e,t),e.unshift(t)},remove(t){e=ad(e,t),e[0]?.resume()}}}();function ad(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var sd=e.forwardRef((t,n)=>{const{container:r,...o}=t,[i,a]=e.useState(!1);Au(()=>a(!0),[]);const s=r||i&&globalThis?.document?.body;return s?h.createPortal(m(Fu.div,{...o,ref:n}),s):null});sd.displayName="Portal";var ld=t=>{const{present:n,children:r}=t,o=function(t){const[n,r]=e.useState(),o=e.useRef(null),i=e.useRef(t),a=e.useRef("none"),s=t?"mounted":"unmounted",[l,c]=function(t,n){return e.useReducer((e,t)=>n[e][t]??e,t)}(s,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return e.useEffect(()=>{const e=cd(o.current);a.current="mounted"===l?e:"none"},[l]),Au(()=>{const e=o.current,n=i.current;if(n!==t){const r=a.current,o=cd(e);if(t)c("MOUNT");else if("none"===o||"none"===e?.display)c("UNMOUNT");else{c(n&&r!==o?"ANIMATION_OUT":"UNMOUNT")}i.current=t}},[t,c]),Au(()=>{if(n){let e;const t=n.ownerDocument.defaultView??window,r=r=>{const a=cd(o.current).includes(CSS.escape(r.animationName));if(r.target===n&&a&&(c("ANIMATION_END"),!i.current)){const r=n.style.animationFillMode;n.style.animationFillMode="forwards",e=t.setTimeout(()=>{"forwards"===n.style.animationFillMode&&(n.style.animationFillMode=r)})}},s=e=>{e.target===n&&(a.current=cd(o.current))};return n.addEventListener("animationstart",s),n.addEventListener("animationcancel",r),n.addEventListener("animationend",r),()=>{t.clearTimeout(e),n.removeEventListener("animationstart",s),n.removeEventListener("animationcancel",r),n.removeEventListener("animationend",r)}}c("ANIMATION_END")},[n,c]),{isPresent:["mounted","unmountSuspended"].includes(l),ref:e.useCallback(e=>{o.current=e?getComputedStyle(e):null,r(e)},[])}}(n),i="function"==typeof r?r({present:o.isPresent}):e.Children.only(r),a=Nu(o.ref,function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(i));return"function"==typeof r||o.isPresent?e.cloneElement(i,{ref:a}):null};function cd(e){return e?.animationName||"none"}ld.displayName="Presence";var ud=0;function dd(){e.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??fd()),document.body.insertAdjacentElement("beforeend",e[1]??fd()),ud++,()=>{1===ud&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),ud--}},[])}function fd(){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 pd=function(){return pd=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},pd.apply(this,arguments)};function hd(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}"function"==typeof SuppressedError&&SuppressedError;var md="right-scroll-bar-position",gd="width-before-scroll-bar";function yd(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var vd="undefined"!=typeof window?e.useLayoutEffect:e.useEffect,bd=new WeakMap;function wd(e,t){var n,r,o,i=(n=t||null,r=function(t){return e.forEach(function(e){return yd(e,t)})},(o=u(function(){return{value:n,callback:r,facade:{get current(){return o.value},set current(e){var t=o.value;t!==e&&(o.value=e,o.callback(e,t))}}}})[0]).callback=r,o.facade);return vd(function(){var t=bd.get(i);if(t){var n=new Set(t),r=new Set(e),o=i.current;n.forEach(function(e){r.has(e)||yd(e,null)}),r.forEach(function(e){n.has(e)||yd(e,o)})}bd.set(i,e)},[e]),i}function xd(e){return e}var Ed=function(t){var n=t.sideCar,r=hd(t,["sideCar"]);if(!n)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var o=n.read();if(!o)throw new Error("Sidecar medium not found");return e.createElement(o,pd({},r))};Ed.isSideCarExport=!0;var Sd=function(e){void 0===e&&(e={});var t=function(e,t){void 0===t&&(t=xd);var n=[],r=!1,o={read:function(){if(r)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(e){var o=t(e,r);return n.push(o),function(){n=n.filter(function(e){return e!==o})}},assignSyncMedium:function(e){for(r=!0;n.length;){var t=n;n=[],t.forEach(e)}n={push:function(t){return e(t)},filter:function(){return n}}},assignMedium:function(e){r=!0;var t=[];if(n.length){var o=n;n=[],o.forEach(e),t=n}var i=function(){var n=t;t=[],n.forEach(e)},a=function(){return Promise.resolve().then(i)};a(),n={push:function(e){t.push(e),a()},filter:function(e){return t=t.filter(e),n}}}};return o}(null);return t.options=pd({async:!0,ssr:!1},e),t}(),_d=function(){},Cd=e.forwardRef(function(t,n){var r=e.useRef(null),o=e.useState({onScrollCapture:_d,onWheelCapture:_d,onTouchMoveCapture:_d}),i=o[0],a=o[1],s=t.forwardProps,l=t.children,c=t.className,u=t.removeScrollBar,d=t.enabled,f=t.shards,p=t.sideCar,h=t.noRelative,m=t.noIsolation,g=t.inert,y=t.allowPinchZoom,v=t.as,b=void 0===v?"div":v,w=t.gapMode,x=hd(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),E=p,S=wd([r,n]),_=pd(pd({},x),i);return e.createElement(e.Fragment,null,d&&e.createElement(E,{sideCar:Sd,removeScrollBar:u,shards:f,noRelative:h,noIsolation:m,inert:g,setCallbacks:a,allowPinchZoom:!!y,lockRef:r,gapMode:w}),s?e.cloneElement(e.Children.only(l),pd(pd({},_),{ref:S})):e.createElement(b,pd({},_,{className:c,ref:S}),l))});Cd.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},Cd.classNames={fullWidth:gd,zeroRight:md};function kd(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=function(){if("undefined"!=typeof __webpack_nonce__)return __webpack_nonce__}();return t&&e.setAttribute("nonce",t),e}var Nd=function(){var e=0,t=null;return{add:function(n){var r,o;0==e&&(t=kd())&&(o=n,(r=t).styleSheet?r.styleSheet.cssText=o:r.appendChild(document.createTextNode(o)),function(e){(document.head||document.getElementsByTagName("head")[0]).appendChild(e)}(t)),e++},remove:function(){! --e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Md=function(){var t,n=(t=Nd(),function(n,r){e.useEffect(function(){return t.add(n),function(){t.remove()}},[n&&r])});return function(e){var t=e.styles,r=e.dynamic;return n(t,r),null}},Od={left:0,top:0,right:0,gap:0},Ad=function(e){return parseInt(e||"",10)||0},Pd=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return Od;var t=function(e){var t=window.getComputedStyle(document.body),n=t["padding"===e?"paddingLeft":"marginLeft"],r=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[Ad(n),Ad(r),Ad(o)]}(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Rd=Md(),Td="data-scroll-locked",Dd=function(e,t,n,r){var o=e.left,i=e.top,a=e.right,s=e.gap;return void 0===n&&(n="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(r,";\n padding-right: ").concat(s,"px ").concat(r,";\n }\n body[").concat(Td,"] {\n overflow: hidden ").concat(r,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(r,";"),"margin"===n&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(r,";\n "),"padding"===n&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),"\n }\n \n .").concat(md," {\n right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(gd," {\n margin-right: ").concat(s,"px ").concat(r,";\n }\n \n .").concat(md," .").concat(md," {\n right: 0 ").concat(r,";\n }\n \n .").concat(gd," .").concat(gd," {\n margin-right: 0 ").concat(r,";\n }\n \n body[").concat(Td,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},$d=function(){var e=parseInt(document.body.getAttribute(Td)||"0",10);return isFinite(e)?e:0},Id=function(t){var n=t.noRelative,r=t.noImportant,o=t.gapMode,i=void 0===o?"margin":o;e.useEffect(function(){return document.body.setAttribute(Td,($d()+1).toString()),function(){var e=$d()-1;e<=0?document.body.removeAttribute(Td):document.body.setAttribute(Td,e.toString())}},[]);var a=e.useMemo(function(){return Pd(i)},[i]);return e.createElement(Rd,{styles:Dd(a,!n,i,r?"":"!important")})},zd=!1;if("undefined"!=typeof window)try{var Ld=Object.defineProperty({},"passive",{get:function(){return zd=!0,!0}});window.addEventListener("test",Ld,Ld),window.removeEventListener("test",Ld,Ld)}catch(e){zd=!1}var Bd=!!zd&&{passive:!1},Fd=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return"hidden"!==n[t]&&!(n.overflowY===n.overflowX&&!function(e){return"TEXTAREA"===e.tagName}(e)&&"visible"===n[t])},Hd=function(e,t){var n=t.ownerDocument,r=t;do{if("undefined"!=typeof ShadowRoot&&r instanceof ShadowRoot&&(r=r.host),Wd(e,r)){var o=Vd(e,r);if(o[1]>o[2])return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Wd=function(e,t){return"v"===e?function(e){return Fd(e,"overflowY")}(t):function(e){return Fd(e,"overflowX")}(t)},Vd=function(e,t){return"v"===e?[(n=t).scrollTop,n.scrollHeight,n.clientHeight]:function(e){return[e.scrollLeft,e.scrollWidth,e.clientWidth]}(t);var n},Yd=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},jd=function(e){return[e.deltaX,e.deltaY]},Xd=function(e){return e&&"current"in e?e.current:e},Kd=function(e){return"\n .block-interactivity-".concat(e," {pointer-events: none;}\n .allow-interactivity-").concat(e," {pointer-events: all;}\n")},Ud=0,qd=[];function Zd(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}var Gd,Qd=(Gd=function(t){var n=e.useRef([]),r=e.useRef([0,0]),o=e.useRef(),i=e.useState(Ud++)[0],a=e.useState(Md)[0],s=e.useRef(t);e.useEffect(function(){s.current=t},[t]),e.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var e=function(e,t,n){if(n||2===arguments.length)for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}([t.lockRef.current],(t.shards||[]).map(Xd),!0).filter(Boolean);return e.forEach(function(e){return e.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),e.forEach(function(e){return e.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var l=e.useCallback(function(e,t){if("touches"in e&&2===e.touches.length||"wheel"===e.type&&e.ctrlKey)return!s.current.allowPinchZoom;var n,i=Yd(e),a=r.current,l="deltaX"in e?e.deltaX:a[0]-i[0],c="deltaY"in e?e.deltaY:a[1]-i[1],u=e.target,d=Math.abs(l)>Math.abs(c)?"h":"v";if("touches"in e&&"h"===d&&"range"===u.type)return!1;var f=Hd(d,u);if(!f)return!0;if(f?n=d:(n="v"===d?"h":"v",f=Hd(d,u)),!f)return!1;if(!o.current&&"changedTouches"in e&&(l||c)&&(o.current=n),!n)return!0;var p=o.current||n;return function(e,t,n,r,o){var i=function(e,t){return"h"===e&&"rtl"===t?-1:1}(e,window.getComputedStyle(t).direction),a=i*r,s=n.target,l=t.contains(s),c=!1,u=a>0,d=0,f=0;do{if(!s)break;var p=Vd(e,s),h=p[0],m=p[1]-p[2]-i*h;(h||m)&&Wd(e,s)&&(d+=m,f+=h);var g=s.parentNode;s=g&&g.nodeType===Node.DOCUMENT_FRAGMENT_NODE?g.host:g}while(!l&&s!==document.body||l&&(t.contains(s)||t===s));return(u&&(o&&Math.abs(d)<1||!o&&a>d)||!u&&(o&&Math.abs(f)<1||!o&&-a>f))&&(c=!0),c}(p,t,e,"h"===p?l:c,!0)},[]),c=e.useCallback(function(e){var t=e;if(qd.length&&qd[qd.length-1]===a){var r="deltaY"in t?jd(t):Yd(t),o=n.current.filter(function(e){return e.name===t.type&&(e.target===t.target||t.target===e.shadowParent)&&(n=e.delta,o=r,n[0]===o[0]&&n[1]===o[1]);var n,o})[0];if(o&&o.should)t.cancelable&&t.preventDefault();else if(!o){var i=(s.current.shards||[]).map(Xd).filter(Boolean).filter(function(e){return e.contains(t.target)});(i.length>0?l(t,i[0]):!s.current.noIsolation)&&t.cancelable&&t.preventDefault()}}},[]),u=e.useCallback(function(e,t,r,o){var i={name:e,delta:t,target:r,should:o,shadowParent:Zd(r)};n.current.push(i),setTimeout(function(){n.current=n.current.filter(function(e){return e!==i})},1)},[]),d=e.useCallback(function(e){r.current=Yd(e),o.current=void 0},[]),f=e.useCallback(function(e){u(e.type,jd(e),e.target,l(e,t.lockRef.current))},[]),p=e.useCallback(function(e){u(e.type,Yd(e),e.target,l(e,t.lockRef.current))},[]);e.useEffect(function(){return qd.push(a),t.setCallbacks({onScrollCapture:f,onWheelCapture:f,onTouchMoveCapture:p}),document.addEventListener("wheel",c,Bd),document.addEventListener("touchmove",c,Bd),document.addEventListener("touchstart",d,Bd),function(){qd=qd.filter(function(e){return e!==a}),document.removeEventListener("wheel",c,Bd),document.removeEventListener("touchmove",c,Bd),document.removeEventListener("touchstart",d,Bd)}},[]);var h=t.removeScrollBar,m=t.inert;return e.createElement(e.Fragment,null,m?e.createElement(a,{styles:Kd(i)}):null,h?e.createElement(Id,{noRelative:t.noRelative,gapMode:t.gapMode}):null)},Sd.useMedium(Gd),Ed),Jd=e.forwardRef(function(t,n){return e.createElement(Cd,pd({},t,{ref:n,sideCar:Qd}))});Jd.classNames=Cd.classNames;var ef=Jd,tf=new WeakMap,nf=new WeakMap,rf={},of=0,af=function(e){return e&&(e.host||af(e.parentNode))},sf=function(e,t,n,r){var o=function(e,t){return t.map(function(t){if(e.contains(t))return t;var n=af(t);return n&&e.contains(n)?n:(console.error("aria-hidden",t,"in not contained inside",e,". Doing nothing"),null)}).filter(function(e){return Boolean(e)})}(t,Array.isArray(e)?e:[e]);rf[n]||(rf[n]=new WeakMap);var i=rf[n],a=[],s=new Set,l=new Set(o),c=function(e){e&&!s.has(e)&&(s.add(e),c(e.parentNode))};o.forEach(c);var u=function(e){e&&!l.has(e)&&Array.prototype.forEach.call(e.children,function(e){if(s.has(e))u(e);else try{var t=e.getAttribute(r),o=null!==t&&"false"!==t,l=(tf.get(e)||0)+1,c=(i.get(e)||0)+1;tf.set(e,l),i.set(e,c),a.push(e),1===l&&o&&nf.set(e,!0),1===c&&e.setAttribute(n,"true"),o||e.setAttribute(r,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return u(t),s.clear(),of++,function(){a.forEach(function(e){var t=tf.get(e)-1,o=i.get(e)-1;tf.set(e,t),i.set(e,o),t||(nf.has(e)||e.removeAttribute(r),nf.delete(e)),o||e.removeAttribute(n)}),--of||(tf=new WeakMap,tf=new WeakMap,nf=new WeakMap,rf={})}},lf=function(e,t,n){void 0===n&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),o=t||function(e){return"undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body}(e);return o?(r.push.apply(r,Array.from(o.querySelectorAll("[aria-live], script"))),sf(r,o,n,"aria-hidden")):function(){return null}},cf="Dialog",[uf,df]=Mu(cf),[ff,pf]=uf(cf),hf=t=>{const{__scopeDialog:n,children:r,open:o,defaultOpen:i,onOpenChange:a,modal:s=!0}=t,l=e.useRef(null),c=e.useRef(null),[u,d]=$u({prop:o,defaultProp:i??!1,onChange:a,caller:cf});return m(ff,{scope:n,triggerRef:l,contentRef:c,contentId:Tu(),titleId:Tu(),descriptionId:Tu(),open:u,onOpenChange:d,onOpenToggle:e.useCallback(()=>d(e=>!e),[d]),modal:s,children:r})};hf.displayName=cf;var mf="DialogTrigger",gf=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=pf(mf,n),i=Nu(t,o.triggerRef);return m(Fu.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":If(o.open),...r,ref:i,onClick:_u(e.onClick,o.onOpenToggle)})});gf.displayName=mf;var yf="DialogPortal",[vf,bf]=uf(yf,{forceMount:void 0}),wf=t=>{const{__scopeDialog:n,forceMount:r,children:o,container:i}=t,a=pf(yf,n);return m(vf,{scope:n,forceMount:r,children:e.Children.map(o,e=>m(ld,{present:r||a.open,children:m(sd,{asChild:!0,container:i,children:e})}))})};wf.displayName=yf;var xf="DialogOverlay",Ef=e.forwardRef((e,t)=>{const n=bf(xf,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=pf(xf,e.__scopeDialog);return i.modal?m(ld,{present:r||i.open,children:m(_f,{...o,ref:t})}):null});Ef.displayName=xf;var Sf=Iu("DialogOverlay.RemoveScroll"),_f=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=pf(xf,n);return m(ef,{as:Sf,allowPinchZoom:!0,shards:[o.contentRef],children:m(Fu.div,{"data-state":If(o.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),Cf="DialogContent",kf=e.forwardRef((e,t)=>{const n=bf(Cf,e.__scopeDialog),{forceMount:r=n.forceMount,...o}=e,i=pf(Cf,e.__scopeDialog);return m(ld,{present:r||i.open,children:i.modal?m(Nf,{...o,ref:t}):m(Mf,{...o,ref:t})})});kf.displayName=Cf;var Nf=e.forwardRef((t,n)=>{const r=pf(Cf,t.__scopeDialog),o=e.useRef(null),i=Nu(n,r.contentRef,o);return e.useEffect(()=>{const e=o.current;if(e)return lf(e)},[]),m(Of,{...t,ref:i,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:_u(t.onCloseAutoFocus,e=>{e.preventDefault(),r.triggerRef.current?.focus()}),onPointerDownOutside:_u(t.onPointerDownOutside,e=>{const t=e.detail.originalEvent,n=0===t.button&&!0===t.ctrlKey;(2===t.button||n)&&e.preventDefault()}),onFocusOutside:_u(t.onFocusOutside,e=>e.preventDefault())})}),Mf=e.forwardRef((t,n)=>{const r=pf(Cf,t.__scopeDialog),o=e.useRef(!1),i=e.useRef(!1);return m(Of,{...t,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:e=>{t.onCloseAutoFocus?.(e),e.defaultPrevented||(o.current||r.triggerRef.current?.focus(),e.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:e=>{t.onInteractOutside?.(e),e.defaultPrevented||(o.current=!0,"pointerdown"===e.detail.originalEvent.type&&(i.current=!0));const n=e.target,a=r.triggerRef.current?.contains(n);a&&e.preventDefault(),"focusin"===e.detail.originalEvent.type&&i.current&&e.preventDefault()}})}),Of=e.forwardRef((t,n)=>{const{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:a,...s}=t,l=pf(Cf,r),c=e.useRef(null),u=Nu(n,c);return dd(),g(y,{children:[m(ed,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:a,children:m(Ku,{role:"dialog",id:l.contentId,"aria-describedby":l.descriptionId,"aria-labelledby":l.titleId,"data-state":If(l.open),...s,ref:u,onDismiss:()=>l.onOpenChange(!1)})}),g(y,{children:[m(Ff,{titleId:l.titleId}),m(Hf,{contentRef:c,descriptionId:l.descriptionId})]})]})}),Af="DialogTitle",Pf=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=pf(Af,n);return m(Fu.h2,{id:o.titleId,...r,ref:t})});Pf.displayName=Af;var Rf="DialogDescription",Tf=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=pf(Rf,n);return m(Fu.p,{id:o.descriptionId,...r,ref:t})});Tf.displayName=Rf;var Df="DialogClose",$f=e.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,o=pf(Df,n);return m(Fu.button,{type:"button",...r,ref:t,onClick:_u(e.onClick,()=>o.onOpenChange(!1))})});function If(e){return e?"open":"closed"}$f.displayName=Df;var zf="DialogTitleWarning",[Lf,Bf]=function(t,n){const r=e.createContext(n),o=t=>{const{children:n,...o}=t,i=e.useMemo(()=>o,Object.values(o));return m(r.Provider,{value:i,children:n})};return o.displayName=t+"Provider",[o,function(o){const i=e.useContext(r);if(i)return i;if(void 0!==n)return n;throw new Error(`\`${o}\` must be used within \`${t}\``)}]}(zf,{contentName:Cf,titleName:Af,docsSlug:"dialog"}),Ff=({titleId:t})=>{const n=Bf(zf),r=`\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.\n\nIf you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/${n.docsSlug}`;return e.useEffect(()=>{if(t){document.getElementById(t)||console.error(r)}},[r,t]),null},Hf=({contentRef:t,descriptionId:n})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Bf("DialogDescriptionWarning").contentName}}.`;return e.useEffect(()=>{const e=t.current?.getAttribute("aria-describedby");if(n&&e){document.getElementById(n)||console.warn(r)}},[r,t,n]),null},Wf=hf,Vf=gf,Yf=wf,jf=Ef,Xf=kf,Kf=Pf,Uf=Tf,qf=$f;const Zf=Wf,Gf=Vf,Qf=Yf,Jf=e.forwardRef(({className:t,...n},r)=>e.createElement(jf,{style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"hsla(var(--background), 0.8)",backdropFilter:"blur(4px)"},className:t,...n,ref:r}));Jf.displayName=jf.displayName;const ep=(e="right")=>{const t={position:"fixed",zIndex:50,gap:"16px",backgroundColor:"hsl(var(--background))",padding:"24px",boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",transition:"all 0.3s ease-in-out"};switch(e){case"top":return{...t,left:0,right:0,top:0,borderBottom:"1px solid hsl(var(--border))"};case"bottom":return{...t,left:0,right:0,bottom:0,borderTop:"1px solid hsl(var(--border))"};case"left":return{...t,top:0,bottom:0,left:0,height:"100%",width:"75%",borderRight:"1px solid hsl(var(--border))",maxWidth:"384px"};default:return{...t,top:0,bottom:0,right:0,height:"100%",width:"75%",borderLeft:"1px solid hsl(var(--border))",maxWidth:"384px"}}},tp=e.forwardRef(({side:t="right",className:n,children:r,...o},i)=>e.createElement(Qf,null,e.createElement(Jf,null),e.createElement(Xf,{ref:i,style:ep(t),className:n,...o},r,e.createElement(qf,{style:{position:"absolute",right:"16px",top:"16px",borderRadius:"4px",opacity:.7,transition:"opacity 0.2s ease-in-out",cursor:"pointer",border:"none",background:"transparent",padding:"4px"},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"}},e.createElement("svg",{style:{height:"16px",width:"16px"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},e.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),e.createElement("span",{style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},"Close")))));tp.displayName=Xf.displayName;e.forwardRef(({className:t,...n},r)=>e.createElement(Kf,{ref:r,style:{fontSize:"18px",fontWeight:600,color:"hsl(var(--foreground))"},className:t,...n})).displayName=Kf.displayName;e.forwardRef(({className:t,...n},r)=>e.createElement(Uf,{ref:r,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:t,...n})).displayName=Uf.displayName;const np=(e,t,n={})=>{const{minNodeSpacing:r=200,containerWidth:o=600}=n;if(!e||0===e.length)return new Map;new Map(e.map(e=>[e.identifier,e]));const i=new Map,a=new Map;e.forEach(e=>i.set(e.identifier,[])),t.length>0?t.forEach(e=>{e.source&&e.target&&(i.get(e.source)?.push(e.target),a.set(e.target,e.source))}):e.forEach(e=>{e.parent&&e.parent.identifier!==e.identifier&&(i.get(e.parent.identifier)?.push(e.identifier),a.set(e.identifier,e.parent.identifier))});const s=e.filter(e=>!a.has(e.identifier)),l=new Map,c=(e,t)=>{l.set(e,t);for(const n of i.get(e)||[])c(n,t+1)};s.forEach(e=>c(e.identifier,0));const u=[];e.forEach(e=>{const t=l.get(e.identifier)??0;u[t]||(u[t]=[]),u[t].push(e.identifier)});const d=new Map,f=200,p=Math.max(250,r+50),h=e=>{const t=i.get(e)||[];if(0===t.length)return d.set(e,f),f;let n=0;for(const e of t)n+=h(e);return n+=(t.length-1)*p,d.set(e,n),n};s.forEach(e=>h(e.identifier));const m=new Map,g=Math.max(400,r+200),y=(e,t,n)=>{const r=d.get(e)||f,o=n*g+100,a=i.get(e)||[];if(0===a.length)m.set(e,{x:t+r/2-100,y:o});else{let r=t;for(const e of a){const t=d.get(e)||f;y(e,r,n+1),r+=t+p}const i=a[0],s=a[a.length-1],l=m.get(i),c=m.get(s),u=(l.x+c.x)/2;m.set(e,{x:u,y:o})}};let v=0;for(const e of s)v+=d.get(e.identifier)||f;s.length>1&&(v+=(s.length-1)*p*2);let b=Math.max(0,(o-v)/2);for(const e of s)y(e.identifier,b,0),b+=(d.get(e.identifier)||f)+2*p;const w=r,x=Array.from(m.keys());for(let e=0;e<x.length;e++)for(let t=e+1;t<x.length;t++){const n=m.get(x[e]),r=m.get(x[t]);if(Math.sqrt((r.x-n.x)**2+(r.y-n.y)**2)<w){const e=r.x-n.x,t=r.y-n.y,o=Math.sqrt(e*e+t*t);if(o>0){const i=w/o,a=(e*i-e)/2,s=(t*i-t)/2;n.x-=a,n.y-=s,r.x+=a,r.y+=s}else n.x-=w/2,r.x+=w/2}}return m},rp={Agent:Jc,Tool:Jc,Coordinator:Jc},op=({flowData:e,width:n="100%",height:r="1000px",className:i="",defaultZoom:c=1,defaultPan:d={x:0,y:0},disableAutoFit:f=!0,showTimeline:p=!1,minNodeSpacing:h=200})=>{const{theme:m}=ac(),g=m.colors,y=e;if(!y)return t.createElement("div",{style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof r?`${r}px`:r,border:`1px solid ${g.border}`,borderRadius:"8px",background:g.muted,position:"relative",minWidth:"800px",minHeight:"600px",display:"flex",alignItems:"center",justifyContent:"center"},className:i},t.createElement("div",{style:{textAlign:"center"}},t.createElement("div",{style:{fontSize:"16px",color:g.mutedForeground,marginBottom:"8px"}},"No flow data available"),t.createElement("div",{style:{fontSize:"14px",color:g.mutedForeground}},"Please provide flowData prop")));const v=l(null),b=l(null),[w,x]=u({width:"number"==typeof n?n:1200,height:"number"==typeof r?r:600}),[E,S]=u(0),[_,C]=u(!1),k=l(null),[N,M]=u(!1),O=o(()=>{const e=y.stamps||y.steps||[];return e.length>0?Math.max(...e.map(e=>e.step)):0},[y.stamps,y.steps]);a(()=>(_?k.current=setInterval(()=>{S(e=>e>=O?(C(!1),e):e+1)},250):k.current&&(clearInterval(k.current),k.current=null),()=>{k.current&&clearInterval(k.current)}),[_,O]),a(()=>{const e=y.stamps||y.steps||[];e.length>0&&S(Math.max(...e.map(e=>e.step)))},[y.stamps,y.steps]),a(()=>{const e=()=>{if(v.current){const e=v.current.getBoundingClientRect();x({width:Math.max(e.width||("number"==typeof n?n:1200),1200),height:e.height||("number"==typeof r?r:600)})}};if(e(),window.ResizeObserver&&v.current){const t=new ResizeObserver(e);return t.observe(v.current),()=>t.disconnect()}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[n,r]);const A=o(()=>{if(!y.nodes)return new Map;const e=Math.max(w.width||800,1200);return np(y.nodes,y.edges||[],{minNodeSpacing:h,containerWidth:e})},[y.nodes,y.edges,w.width,h]),P=s(e=>y.nodes?y.nodes.filter(t=>t.stamp.step<=e):[],[y.nodes]),R=s(e=>(y.edges||[]).filter(t=>t.stamp.step<=e),[y.edges]),T=o(()=>{const e=P(E),t=R(E);return e.map(e=>{const n=A.get(e.identifier)||{x:0,y:0},r=e.stamp.step===E,o="Tool"===e.node_type?t.filter(t=>t.target===e.identifier&&t.details).map(e=>e.details):void 0;return{id:e.identifier,type:e.node_type||"Agent",position:n,data:{label:e.name||e.node_type,nodeType:e.node_type,details:e.details,isActive:r,id:e.identifier,edges:t,edgeDetails:o},style:{filter:r?"drop-shadow(0 4px 8px rgba(99, 102, 241, 0.3))":"none"}}})},[A,E,P,R]),D=o(()=>R(E).filter(e=>e.source&&e.target).map(e=>{const t=e.stamp.step===E;return{id:e.identifier,type:"default",source:e.source,target:e.target,animated:t,bidirectional:!0,style:{stroke:t?g.primary:g.mutedForeground,strokeWidth:t?3:2},label:e.stamp?.identifier?Ec(String(e.stamp.identifier),50):void 0,data:{label:e.stamp?.identifier?Ec(String(e.stamp.identifier),50):void 0,source:e.source,target:e.target,step:e.stamp?.step,time:e.stamp?.time,details:e.details}}}),[E,R,g.primary,g.mutedForeground]),[$,I,z]=ds(T),[L,B,F]=fs(D);a(()=>{I(T)},[T,I]),a(()=>{B(D)},[D,B]);const H=s(e=>B(t=>To(e,t)),[B]),W=s(e=>{S(e),C(!1)},[]);s(()=>{C(e=>!e)},[]);const V=(e,t)=>{if(!b.current)return{x:0,y:0};const n=b.current.createSVGPoint();n.x=e,n.y=t;const r=n.matrixTransform(b.current.getScreenCTM()?.inverse());return{x:r.x,y:r.y}},Y=zi();return a(()=>{if(f||!Y||0===T.length)return;const e=new Map;D.forEach(t=>{const n=e.get(t.source)||0;e.set(t.source,n+1);const r=e.get(t.target)||0;e.set(t.target,r+1)});let t="",n=0;e.forEach((e,r)=>{e>n&&(n=e,t=r)}),!t&&T.length>0&&(t=T[0].id),t&&setTimeout(()=>{Y.fitView({nodes:[{id:t}],duration:1e3,padding:.2,minZoom:c,maxZoom:1})},500)},[T,D,Y,f,c]),t.createElement("div",{ref:v,style:{width:"number"==typeof n?`${n}px`:n,height:"number"==typeof r?`${r}px`:r,border:`1px solid ${g.border}`,borderRadius:"8px",overflow:"hidden",position:"relative",minWidth:"800px",minHeight:"600px",background:g.background},className:i},p&&t.createElement(Zf,{open:N,onOpenChange:M},t.createElement(Gf,{asChild:!0},t.createElement("button",{style:{position:"absolute",top:"16px",left:"16px",zIndex:50,width:"40px",height:"40px",backgroundColor:g.card,border:`1px solid ${g.border}`,borderRadius:"8px",boxShadow:"0 1px 2px 0 rgba(0, 0, 0, 0.05)",display:"flex",alignItems:"center",justifyContent:"center",transition:"background-color 0.2s ease-in-out",cursor:"pointer"},onMouseEnter:e=>{e.currentTarget.style.backgroundColor=g.muted},onMouseLeave:e=>{e.currentTarget.style.backgroundColor=g.card},title:"Open Timeline"},t.createElement(Rs,{size:20,style:{color:g.mutedForeground}}))),t.createElement(Qf,null,t.createElement(Xf,{style:{position:"fixed",top:0,bottom:0,left:0,height:"100%",width:"280px",zIndex:50,backgroundColor:g.background,borderRight:`1px solid ${g.border}`,boxShadow:"0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05)",transition:"all 0.3s ease-in-out",padding:0},onPointerDownOutside:e=>e.preventDefault()},t.createElement("div",{style:{display:"flex",flexDirection:"column",height:"100%"}},t.createElement("div",{style:{flex:1,overflowY:"auto"}},t.createElement(Su,{stamps:y.stamps||y.steps||[],currentStep:E,onStepChange:W}))),t.createElement(qf,{style:{position:"absolute",right:"16px",top:"16px",borderRadius:"4px",opacity:.7,transition:"opacity 0.2s ease-in-out",cursor:"pointer",border:"none",background:"transparent",padding:"4px",color:g.mutedForeground},onMouseEnter:e=>{e.currentTarget.style.opacity="1"},onMouseLeave:e=>{e.currentTarget.style.opacity="0.7"}},t.createElement("svg",{style:{height:"16px",width:"16px"},fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},t.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M6 18L18 6M6 6l12 12"})),t.createElement("span",{style:{position:"absolute",width:"1px",height:"1px",padding:0,margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",border:0}},"Close"))))),t.createElement(cs,{nodes:$,edges:L,onNodesChange:z,onEdgesChange:F,onConnect:H,nodeTypes:rp,edgeTypes:{default:e=>t.createElement(cc,{...e,clientToSvgCoords:V,svgRef:b})},attributionPosition:"bottom-left",style:{width:"100%",height:"100%"},defaultViewport:{x:d.x,y:d.y,zoom:c},onInit:()=>{if(v.current){const e=v.current.querySelector("svg");e&&(b.current=e)}}},t.createElement(ws,{variant:ps.Lines,color:g.mutedBorder,gap:16})),t.createElement("style",null,`\n .react-flow__edge-label {\n font-size: 10px;\n background: ${g.card};\n color: ${g.cardForeground};\n padding: 2px 4px;\n border-radius: 4px;\n border: 1px solid ${g.border};\n max-width: 150px;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n }\n\n .react-flow__edge {\n cursor: default !important;\n }\n\n .react-flow__edge-path {\n cursor: default !important;\n }\n `))},ip=e=>t.createElement(ts,null,t.createElement(op,e));function ap(e,[t,n]){return Math.min(n,Math.max(t,e))}var sp=e.createContext(void 0);const lp=["top","right","bottom","left"],cp=Math.min,up=Math.max,dp=Math.round,fp=Math.floor,pp=e=>({x:e,y:e}),hp={left:"right",right:"left",bottom:"top",top:"bottom"},mp={start:"end",end:"start"};function gp(e,t,n){return up(e,cp(t,n))}function yp(e,t){return"function"==typeof e?e(t):e}function vp(e){return e.split("-")[0]}function bp(e){return e.split("-")[1]}function wp(e){return"x"===e?"y":"x"}function xp(e){return"y"===e?"height":"width"}const Ep=new Set(["top","bottom"]);function Sp(e){return Ep.has(vp(e))?"y":"x"}function _p(e){return wp(Sp(e))}function Cp(e){return e.replace(/start|end/g,e=>mp[e])}const kp=["left","right"],Np=["right","left"],Mp=["top","bottom"],Op=["bottom","top"];function Ap(e,t,n,r){const o=bp(e);let i=function(e,t,n){switch(e){case"top":case"bottom":return n?t?Np:kp:t?kp:Np;case"left":case"right":return t?Mp:Op;default:return[]}}(vp(e),"start"===n,r);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(Cp)))),i}function Pp(e){return e.replace(/left|right|bottom|top/g,e=>hp[e])}function Rp(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function Tp(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function Dp(e,t,n){let{reference:r,floating:o}=e;const i=Sp(t),a=_p(t),s=xp(a),l=vp(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,f=r[s]/2-o[s]/2;let p;switch(l){case"top":p={x:u,y:r.y-o.height};break;case"bottom":p={x:u,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:d};break;case"left":p={x:r.x-o.width,y:d};break;default:p={x:r.x,y:r.y}}switch(bp(t)){case"start":p[a]-=f*(n&&c?-1:1);break;case"end":p[a]+=f*(n&&c?-1:1)}return p}async function $p(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:a,elements:s,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:f=!1,padding:p=0}=yp(t,e),h=Rp(p),m=s[f?"floating"===d?"reference":"floating":d],g=Tp(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(s.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:r,y:o,width:a.floating.width,height:a.floating.height}:a.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(s.floating)),b=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},w=Tp(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:s,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-w.top+h.top)/b.y,bottom:(w.bottom-g.bottom+h.bottom)/b.y,left:(g.left-w.left+h.left)/b.x,right:(w.right-g.right+h.right)/b.x}}function Ip(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function zp(e){return lp.some(t=>e[t]>=0)}const Lp=new Set(["left","top"]);function Bp(){return"undefined"!=typeof window}function Fp(e){return Vp(e)?(e.nodeName||"").toLowerCase():"#document"}function Hp(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function Wp(e){var t;return null==(t=(Vp(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function Vp(e){return!!Bp()&&(e instanceof Node||e instanceof Hp(e).Node)}function Yp(e){return!!Bp()&&(e instanceof Element||e instanceof Hp(e).Element)}function jp(e){return!!Bp()&&(e instanceof HTMLElement||e instanceof Hp(e).HTMLElement)}function Xp(e){return!(!Bp()||"undefined"==typeof ShadowRoot)&&(e instanceof ShadowRoot||e instanceof Hp(e).ShadowRoot)}const Kp=new Set(["inline","contents"]);function Up(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=ah(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!Kp.has(o)}const qp=new Set(["table","td","th"]);function Zp(e){return qp.has(Fp(e))}const Gp=[":popover-open",":modal"];function Qp(e){return Gp.some(t=>{try{return e.matches(t)}catch(e){return!1}})}const Jp=["transform","translate","scale","rotate","perspective"],eh=["transform","translate","scale","rotate","perspective","filter"],th=["paint","layout","strict","content"];function nh(e){const t=rh(),n=Yp(e)?ah(e):e;return Jp.some(e=>!!n[e]&&"none"!==n[e])||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||eh.some(e=>(n.willChange||"").includes(e))||th.some(e=>(n.contain||"").includes(e))}function rh(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}const oh=new Set(["html","body","#document"]);function ih(e){return oh.has(Fp(e))}function ah(e){return Hp(e).getComputedStyle(e)}function sh(e){return Yp(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function lh(e){if("html"===Fp(e))return e;const t=e.assignedSlot||e.parentNode||Xp(e)&&e.host||Wp(e);return Xp(t)?t.host:t}function ch(e){const t=lh(e);return ih(t)?e.ownerDocument?e.ownerDocument.body:e.body:jp(t)&&Up(t)?t:ch(t)}function uh(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=ch(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),a=Hp(o);if(i){const e=dh(a);return t.concat(a,a.visualViewport||[],Up(o)?o:[],e&&n?uh(e):[])}return t.concat(o,uh(o,[],n))}function dh(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function fh(e){const t=ah(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=jp(e),i=o?e.offsetWidth:n,a=o?e.offsetHeight:r,s=dp(n)!==i||dp(r)!==a;return s&&(n=i,r=a),{width:n,height:r,$:s}}function ph(e){return Yp(e)?e:e.contextElement}function hh(e){const t=ph(e);if(!jp(t))return pp(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=fh(t);let a=(i?dp(n.width):n.width)/r,s=(i?dp(n.height):n.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}const mh=pp(0);function gh(e){const t=Hp(e);return rh()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:mh}function yh(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=ph(e);let a=pp(1);t&&(r?Yp(r)&&(a=hh(r)):a=hh(e));const s=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==Hp(e))&&t}(i,n,r)?gh(i):pp(0);let l=(o.left+s.x)/a.x,c=(o.top+s.y)/a.y,u=o.width/a.x,d=o.height/a.y;if(i){const e=Hp(i),t=r&&Yp(r)?Hp(r):r;let n=e,o=dh(n);for(;o&&r&&t!==n;){const e=hh(o),t=o.getBoundingClientRect(),r=ah(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=a,n=Hp(o),o=dh(n)}}return Tp({width:u,height:d,x:l,y:c})}function vh(e,t){const n=sh(e).scrollLeft;return t?t.left+n:yh(Wp(e)).left+n}function bh(e,t){const n=e.getBoundingClientRect();return{x:n.left+t.scrollLeft-vh(e,n),y:n.top+t.scrollTop}}const wh=new Set(["absolute","fixed"]);function xh(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=Hp(e),r=Wp(e),o=n.visualViewport;let i=r.clientWidth,a=r.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;const e=rh();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}const c=vh(r);if(c<=0){const e=r.ownerDocument,t=e.body,n=getComputedStyle(t),o="CSS1Compat"===e.compatMode&&parseFloat(n.marginLeft)+parseFloat(n.marginRight)||0,a=Math.abs(r.clientWidth-t.clientWidth-o);a<=25&&(i-=a)}else c<=25&&(i+=c);return{width:i,height:a,x:s,y:l}}(e,n);else if("document"===t)r=function(e){const t=Wp(e),n=sh(e),r=e.ownerDocument.body,o=up(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=up(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let a=-n.scrollLeft+vh(e);const s=-n.scrollTop;return"rtl"===ah(r).direction&&(a+=up(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:a,y:s}}(Wp(e));else if(Yp(t))r=function(e,t){const n=yh(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=jp(e)?hh(e):pp(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=gh(e);r={x:t.x-n.x,y:t.y-n.y,width:t.width,height:t.height}}return Tp(r)}function Eh(e,t){const n=lh(e);return!(n===t||!Yp(n)||ih(n))&&("fixed"===ah(n).position||Eh(n,t))}function Sh(e,t,n){const r=jp(t),o=Wp(t),i="fixed"===n,a=yh(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=pp(0);function c(){l.x=vh(o)}if(r||!r&&!i)if(("body"!==Fp(t)||Up(o))&&(s=sh(t)),r){const e=yh(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&c();i&&!r&&o&&c();const u=!o||r||i?pp(0):bh(o,s);return{x:a.left+s.scrollLeft-l.x-u.x,y:a.top+s.scrollTop-l.y-u.y,width:a.width,height:a.height}}function _h(e){return"static"===ah(e).position}function Ch(e,t){if(!jp(e)||"fixed"===ah(e).position)return null;if(t)return t(e);let n=e.offsetParent;return Wp(e)===n&&(n=n.ownerDocument.body),n}function kh(e,t){const n=Hp(e);if(Qp(e))return n;if(!jp(e)){let t=lh(e);for(;t&&!ih(t);){if(Yp(t)&&!_h(t))return t;t=lh(t)}return n}let r=Ch(e,t);for(;r&&Zp(r)&&_h(r);)r=Ch(r,t);return r&&ih(r)&&_h(r)&&!nh(r)?n:r||function(e){let t=lh(e);for(;jp(t)&&!ih(t);){if(nh(t))return t;if(Qp(t))return null;t=lh(t)}return null}(e)||n}const Nh={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,a=Wp(r),s=!!t&&Qp(t.floating);if(r===a||s&&i)return n;let l={scrollLeft:0,scrollTop:0},c=pp(1);const u=pp(0),d=jp(r);if((d||!d&&!i)&&(("body"!==Fp(r)||Up(a))&&(l=sh(r)),jp(r))){const e=yh(r);c=hh(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}const f=!a||d||i?pp(0):bh(a,l);return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x+f.x,y:n.y*c.y-l.scrollTop*c.y+u.y+f.y}},getDocumentElement:Wp,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i="clippingAncestors"===n?Qp(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=uh(e,[],!1).filter(e=>Yp(e)&&"body"!==Fp(e)),o=null;const i="fixed"===ah(e).position;let a=i?lh(e):e;for(;Yp(a)&&!ih(a);){const t=ah(a),n=nh(a);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&wh.has(o.position)||Up(a)&&!n&&Eh(e,a))?r=r.filter(e=>e!==a):o=t,a=lh(a)}return t.set(e,r),r}(t,this._c):[].concat(n),a=[...i,r],s=a[0],l=a.reduce((e,n)=>{const r=xh(t,n,o);return e.top=up(r.top,e.top),e.right=cp(r.right,e.right),e.bottom=cp(r.bottom,e.bottom),e.left=up(r.left,e.left),e},xh(t,s,o));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}},getOffsetParent:kh,getElementRects:async function(e){const t=this.getOffsetParent||kh,n=this.getDimensions,r=await n(e.floating);return{reference:Sh(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=fh(e);return{width:t,height:n}},getScale:hh,isElement:Yp,isRTL:function(e){return"rtl"===ah(e).direction}};function Mh(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Oh(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:a="function"==typeof ResizeObserver,layoutShift:s="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=ph(e),u=o||i?[...c?uh(c):[],...uh(t)]:[];u.forEach(e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)});const d=c&&s?function(e,t){let n,r=null;const o=Wp(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:d,width:f,height:p}=c;if(s||t(),!f||!p)return;const h={rootMargin:-fp(d)+"px "+-fp(o.clientWidth-(u+f))+"px "+-fp(o.clientHeight-(d+p))+"px "+-fp(u)+"px",threshold:up(0,cp(1,l))||1};let m=!0;function g(t){const r=t[0].intersectionRatio;if(r!==l){if(!m)return a();r?a(!1,r):n=setTimeout(()=>{a(!1,1e-7)},1e3)}1!==r||Mh(c,e.getBoundingClientRect())||a(),m=!1}try{r=new IntersectionObserver(g,{...h,root:o.ownerDocument})}catch(e){r=new IntersectionObserver(g,h)}r.observe(e)}(!0),i}(c,n):null;let f,p=-1,h=null;a&&(h=new ResizeObserver(e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),n()}),c&&!l&&h.observe(c),h.observe(t));let m=l?yh(e):null;return l&&function t(){const r=yh(e);m&&!Mh(m,r)&&n();m=r,f=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach(e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)}),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(f)}}const Ah=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:a,middlewareData:s}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),a=vp(n),s=bp(n),l="y"===Sp(n),c=Lp.has(a)?-1:1,u=i&&l?-1:1,d=yp(t,e);let{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:d.mainAxis||0,crossAxis:d.crossAxis||0,alignmentAxis:d.alignmentAxis};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*u,y:f*c}:{x:f*c,y:p*u}}(t,e);return a===(null==(n=s.offset)?void 0:n.placement)&&null!=(r=s.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}},Ph=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=yp(e,t),c={x:n,y:r},u=await $p(t,l),d=Sp(vp(o)),f=wp(d);let p=c[f],h=c[d];if(i){const e="y"===f?"bottom":"right";p=gp(p+u["y"===f?"top":"left"],p,p-u[e])}if(a){const e="y"===d?"bottom":"right";h=gp(h+u["y"===d?"top":"left"],h,h-u[e])}const m=s.fn({...t,[f]:p,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r,enabled:{[f]:i,[d]:a}}}}}},Rh=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:a,initialPlacement:s,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:f,fallbackStrategy:p="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=yp(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=vp(o),v=Sp(s),b=vp(s)===s,w=await(null==l.isRTL?void 0:l.isRTL(c.floating)),x=f||(b||!m?[Pp(s)]:function(e){const t=Pp(e);return[Cp(e),t,Cp(t)]}(s)),E="none"!==h;!f&&E&&x.push(...Ap(s,m,h,w));const S=[s,...x],_=await $p(t,g),C=[];let k=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&C.push(_[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=bp(e),o=_p(e),i=xp(o);let a="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=Pp(a)),[a,Pp(a)]}(o,a,w);C.push(_[e[0]],_[e[1]])}if(k=[...k,{placement:o,overflows:C}],!C.every(e=>e<=0)){var N,M;const e=((null==(N=i.flip)?void 0:N.index)||0)+1,t=S[e];if(t){if(!("alignment"===d&&v!==Sp(t))||k.every(e=>Sp(e.placement)!==v||e.overflows[0]>0))return{data:{index:e,overflows:k},reset:{placement:t}}}let n=null==(M=k.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:M.placement;if(!n)switch(p){case"bestFit":{var O;const e=null==(O=k.filter(e=>{if(E){const t=Sp(e.placement);return t===v||"y"===t}return!0}).map(e=>[e.placement,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:O[0];e&&(n=e);break}case"initialPlacement":n=s}if(o!==n)return{reset:{placement:n}}}return{}}}},Th=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:o,rects:i,platform:a,elements:s}=t,{apply:l=()=>{},...c}=yp(e,t),u=await $p(t,c),d=vp(o),f=bp(o),p="y"===Sp(o),{width:h,height:m}=i.floating;let g,y;"top"===d||"bottom"===d?(g=d,y=f===(await(null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(y=d,g="end"===f?"top":"bottom");const v=m-u.top-u.bottom,b=h-u.left-u.right,w=cp(m-u[g],v),x=cp(h-u[y],b),E=!t.middlewareData.shift;let S=w,_=x;if(null!=(n=t.middlewareData.shift)&&n.enabled.x&&(_=b),null!=(r=t.middlewareData.shift)&&r.enabled.y&&(S=v),E&&!f){const e=up(u.left,0),t=up(u.right,0),n=up(u.top,0),r=up(u.bottom,0);p?_=h-2*(0!==e||0!==t?e+t:up(u.left,u.right)):S=m-2*(0!==n||0!==r?n+r:up(u.top,u.bottom))}await l({...t,availableWidth:_,availableHeight:S});const C=await a.getDimensions(s.floating);return h!==C.width||m!==C.height?{reset:{rects:!0}}:{}}}},Dh=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=yp(e,t);switch(r){case"referenceHidden":{const e=Ip(await $p(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:zp(e)}}}case"escaped":{const e=Ip(await $p(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:zp(e)}}}default:return{}}}}},$h=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=yp(e,t)||{};if(null==c)return{};const d=Rp(u),f={x:n,y:r},p=_p(o),h=xp(p),m=await a.getDimensions(c),g="y"===p,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[p]-f[p]-i.floating[h],x=f[p]-i.reference[p],E=await(null==a.getOffsetParent?void 0:a.getOffsetParent(c));let S=E?E[b]:0;S&&await(null==a.isElement?void 0:a.isElement(E))||(S=s.floating[b]||i.floating[h]);const _=w/2-x/2,C=S/2-m[h]/2-1,k=cp(d[y],C),N=cp(d[v],C),M=k,O=S-m[h]-N,A=S/2-m[h]/2+_,P=gp(M,A,O),R=!l.arrow&&null!=bp(o)&&A!==P&&i.reference[h]/2-(A<M?k:N)-m[h]/2<0,T=R?A<M?A-M:A-O:0;return{[p]:f[p]+T,data:{[p]:P,centerOffset:A-P-T,...R&&{alignmentOffset:T}},reset:R}}}),Ih=function(e){return void 0===e&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:o,rects:i,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=yp(e,t),u={x:n,y:r},d=Sp(o),f=wp(d);let p=u[f],h=u[d];const m=yp(s,t),g="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){const e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+g.mainAxis,n=i.reference[f]+i.reference[e]-g.mainAxis;p<t?p=t:p>n&&(p=n)}if(c){var y,v;const e="y"===f?"width":"height",t=Lp.has(vp(o)),n=i.reference[d]-i.floating[e]+(t&&(null==(y=a.offset)?void 0:y[d])||0)+(t?0:g.crossAxis),r=i.reference[d]+i.reference[e]+(t?0:(null==(v=a.offset)?void 0:v[d])||0)-(t?g.crossAxis:0);h<n?h=n:h>r&&(h=r)}return{[f]:p,[d]:h}}}},zh=(e,t,n)=>{const r=new Map,o={platform:Nh,...n},i={...o.platform,_c:r};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:a}=n,s=i.filter(Boolean),l=await(null==a.isRTL?void 0:a.isRTL(t));let c=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=Dp(c,r,l),f=r,p={},h=0;for(let n=0;n<s.length;n++){const{name:i,fn:m}=s[n],{x:g,y:y,data:v,reset:b}=await m({x:u,y:d,initialPlacement:r,placement:f,strategy:o,middlewareData:p,rects:c,platform:a,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,p={...p,[i]:{...p[i],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(f=b.placement),b.rects&&(c=!0===b.rects?await a.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=Dp(c,f,l))),n=-1)}return{x:u,y:d,placement:f,strategy:o,middlewareData:p}})(e,t,{...o,platform:i})};var Lh="undefined"!=typeof document?f:function(){};function Bh(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;let n,r,o;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;0!==r--;)if(!Bh(e[r],t[r]))return!1;return!0}if(o=Object.keys(e),n=o.length,n!==Object.keys(t).length)return!1;for(r=n;0!==r--;)if(!{}.hasOwnProperty.call(t,o[r]))return!1;for(r=n;0!==r--;){const n=o[r];if(("_owner"!==n||!e.$$typeof)&&!Bh(e[n],t[n]))return!1}return!0}return e!=e&&t!=t}function Fh(e){if("undefined"==typeof window)return 1;return(e.ownerDocument.defaultView||window).devicePixelRatio||1}function Hh(e,t){const n=Fh(e);return Math.round(t*n)/n}function Wh(t){const n=e.useRef(t);return Lh(()=>{n.current=t}),n}const Vh=e=>({name:"arrow",options:e,fn(t){const{element:n,padding:r}="function"==typeof e?e(t):e;return n&&(o=n,{}.hasOwnProperty.call(o,"current"))?null!=n.current?$h({element:n.current,padding:r}).fn(t):{}:n?$h({element:n,padding:r}).fn(t):{};var o}}),Yh=(e,t)=>({...Ah(e),options:[e,t]}),jh=(e,t)=>({...Ph(e),options:[e,t]}),Xh=(e,t)=>({...Ih(e),options:[e,t]}),Kh=(e,t)=>({...Rh(e),options:[e,t]}),Uh=(e,t)=>({...Th(e),options:[e,t]}),qh=(e,t)=>({...Dh(e),options:[e,t]}),Zh=(e,t)=>({...Vh(e),options:[e,t]});var Gh=e.forwardRef((e,t)=>{const{children:n,width:r=10,height:o=5,...i}=e;return m(Fu.svg,{...i,ref:t,width:r,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:m("polygon",{points:"0,0 30,0 15,10"})})});Gh.displayName="Arrow";var Qh=Gh;function Jh(t){const[n,r]=e.useState(void 0);return Au(()=>{if(t){r({width:t.offsetWidth,height:t.offsetHeight});const e=new ResizeObserver(e=>{if(!Array.isArray(e))return;if(!e.length)return;const n=e[0];let o,i;if("borderBoxSize"in n){const e=n.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=t.offsetWidth,i=t.offsetHeight;r({width:o,height:i})});return e.observe(t,{box:"border-box"}),()=>e.unobserve(t)}r(void 0)},[t]),n}var em="Popper",[tm,nm]=Mu(em),[rm,om]=tm(em),im=t=>{const{__scopePopper:n,children:r}=t,[o,i]=e.useState(null);return m(rm,{scope:n,anchor:o,onAnchorChange:i,children:r})};im.displayName=em;var am="PopperAnchor",sm=e.forwardRef((t,n)=>{const{__scopePopper:r,virtualRef:o,...i}=t,a=om(am,r),s=e.useRef(null),l=Nu(n,s),c=e.useRef(null);return e.useEffect(()=>{const e=c.current;c.current=o?.current||s.current,e!==c.current&&a.onAnchorChange(c.current)}),o?null:m(Fu.div,{...i,ref:l})});sm.displayName=am;var lm="PopperContent",[cm,um]=tm(lm),dm=e.forwardRef((t,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:i=0,align:a="center",alignOffset:s=0,arrowPadding:l=0,avoidCollisions:c=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:g="optimized",onPlaced:y,...v}=t,b=om(lm,r),[w,x]=e.useState(null),E=Nu(n,e=>x(e)),[S,_]=e.useState(null),C=Jh(S),k=C?.width??0,N=C?.height??0,M=o+("center"!==a?"-"+a:""),O="number"==typeof d?d:{top:0,right:0,bottom:0,left:0,...d},A=Array.isArray(u)?u:[u],P=A.length>0,R={padding:O,boundary:A.filter(mm),altBoundary:P},{refs:T,floatingStyles:D,placement:$,isPositioned:I,middlewareData:z}=function(t){void 0===t&&(t={});const{placement:n="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:c,open:u}=t,[d,f]=e.useState({x:0,y:0,strategy:r,placement:n,middlewareData:{},isPositioned:!1}),[h,m]=e.useState(o);Bh(h,o)||m(o);const[g,y]=e.useState(null),[v,b]=e.useState(null),w=e.useCallback(e=>{e!==_.current&&(_.current=e,y(e))},[]),x=e.useCallback(e=>{e!==C.current&&(C.current=e,b(e))},[]),E=a||g,S=s||v,_=e.useRef(null),C=e.useRef(null),k=e.useRef(d),N=null!=c,M=Wh(c),O=Wh(i),A=Wh(u),P=e.useCallback(()=>{if(!_.current||!C.current)return;const e={placement:n,strategy:r,middleware:h};O.current&&(e.platform=O.current),zh(_.current,C.current,e).then(e=>{const t={...e,isPositioned:!1!==A.current};R.current&&!Bh(k.current,t)&&(k.current=t,p.flushSync(()=>{f(t)}))})},[h,n,r,O,A]);Lh(()=>{!1===u&&k.current.isPositioned&&(k.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[u]);const R=e.useRef(!1);Lh(()=>(R.current=!0,()=>{R.current=!1}),[]),Lh(()=>{if(E&&(_.current=E),S&&(C.current=S),E&&S){if(M.current)return M.current(E,S,P);P()}},[E,S,P,M,N]);const T=e.useMemo(()=>({reference:_,floating:C,setReference:w,setFloating:x}),[w,x]),D=e.useMemo(()=>({reference:E,floating:S}),[E,S]),$=e.useMemo(()=>{const e={position:r,left:0,top:0};if(!D.floating)return e;const t=Hh(D.floating,d.x),n=Hh(D.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...Fh(D.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,D.floating,d.x,d.y]);return e.useMemo(()=>({...d,update:P,refs:T,elements:D,floatingStyles:$}),[d,P,T,D,$])}({strategy:"fixed",placement:M,whileElementsMounted:(...e)=>Oh(...e,{animationFrame:"always"===g}),elements:{reference:b.anchor},middleware:[Yh({mainAxis:i+N,alignmentAxis:s}),c&&jh({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?Xh():void 0,...R}),c&&Kh({...R}),Uh({...R,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${n}px`),a.setProperty("--radix-popper-available-height",`${r}px`),a.setProperty("--radix-popper-anchor-width",`${o}px`),a.setProperty("--radix-popper-anchor-height",`${i}px`)}}),S&&Zh({element:S,padding:l}),gm({arrowWidth:k,arrowHeight:N}),h&&qh({strategy:"referenceHidden",...R})]}),[L,B]=ym($),F=Hu(y);Au(()=>{I&&F?.()},[I,F]);const H=z.arrow?.x,W=z.arrow?.y,V=0!==z.arrow?.centerOffset,[Y,j]=e.useState();return Au(()=>{w&&j(window.getComputedStyle(w).zIndex)},[w]),m("div",{ref:T.setFloating,"data-radix-popper-content-wrapper":"",style:{...D,transform:I?D.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Y,"--radix-popper-transform-origin":[z.transformOrigin?.x,z.transformOrigin?.y].join(" "),...z.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:m(cm,{scope:r,placedSide:L,onArrowChange:_,arrowX:H,arrowY:W,shouldHideArrow:V,children:m(Fu.div,{"data-side":L,"data-align":B,...v,ref:E,style:{...v.style,animation:I?void 0:"none"}})})})});dm.displayName=lm;var fm="PopperArrow",pm={top:"bottom",right:"left",bottom:"top",left:"right"},hm=e.forwardRef(function(e,t){const{__scopePopper:n,...r}=e,o=um(fm,n),i=pm[o.placedSide];return m("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[i]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:m(Qh,{...r,ref:t,style:{...r.style,display:"block"}})})});function mm(e){return null!==e}hm.displayName=fm;var gm=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,a=i?0:e.arrowWidth,s=i?0:e.arrowHeight,[l,c]=ym(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+a/2,f=(o.arrow?.y??0)+s/2;let p="",h="";return"bottom"===l?(p=i?u:`${d}px`,h=-s+"px"):"top"===l?(p=i?u:`${d}px`,h=`${r.floating.height+s}px`):"right"===l?(p=-s+"px",h=i?u:`${f}px`):"left"===l&&(p=`${r.floating.width+s}px`,h=i?u:`${f}px`),{data:{x:p,y:h}}}});function ym(e){const[t,n="center"]=e.split("-");return[t,n]}var vm=im,bm=sm,wm=dm,xm=hm;function Em(t){const n=e.useRef({value:t,previous:t});return e.useMemo(()=>(n.current.value!==t&&(n.current.previous=n.current.value,n.current.value=t),n.current.previous),[t])}var Sm=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"});e.forwardRef((e,t)=>m(Fu.span,{...e,ref:t,style:{...Sm,...e.style}})).displayName="VisuallyHidden";var _m=[" ","Enter","ArrowUp","ArrowDown"],Cm=[" ","Enter"],km="Select",[Nm,Mm,Om]=function(e){const n=e+"CollectionProvider",[r,o]=Mu(n),[i,a]=r(n,{collectionRef:{current:null},itemMap:new Map}),s=e=>{const{scope:n,children:r}=e,o=t.useRef(null),a=t.useRef(new Map).current;return m(i,{scope:n,itemMap:a,collectionRef:o,children:r})};s.displayName=n;const l=e+"CollectionSlot",c=Iu(l),u=t.forwardRef((e,t)=>{const{scope:n,children:r}=e,o=Nu(t,a(l,n).collectionRef);return m(c,{ref:o,children:r})});u.displayName=l;const d=e+"CollectionItemSlot",f="data-radix-collection-item",p=Iu(d),h=t.forwardRef((e,n)=>{const{scope:r,children:o,...i}=e,s=t.useRef(null),l=Nu(n,s),c=a(d,r);return t.useEffect(()=>(c.itemMap.set(s,{ref:s,...i}),()=>{c.itemMap.delete(s)})),m(p,{[f]:"",ref:l,children:o})});return h.displayName=d,[{Provider:s,Slot:u,ItemSlot:h},function(n){const r=a(e+"CollectionConsumer",n);return t.useCallback(()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(r.itemMap.values()).sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current))},[r.collectionRef,r.itemMap])},o]}(km),[Am,Pm]=Mu(km,[Om,nm]),Rm=nm(),[Tm,Dm]=Am(km),[$m,Im]=Am(km),zm=t=>{const{__scopeSelect:n,children:r,open:o,defaultOpen:i,onOpenChange:a,value:s,defaultValue:l,onValueChange:c,dir:u,name:d,autoComplete:f,disabled:p,required:h,form:y}=t,v=Rm(n),[b,w]=e.useState(null),[x,E]=e.useState(null),[S,_]=e.useState(!1),C=function(t){const n=e.useContext(sp);return t||n||"ltr"}(u),[k,N]=$u({prop:o,defaultProp:i??!1,onChange:a,caller:km}),[M,O]=$u({prop:s,defaultProp:l,onChange:c,caller:km}),A=e.useRef(null),P=!b||(y||!!b.closest("form")),[R,T]=e.useState(new Set),D=Array.from(R).map(e=>e.props.value).join(";");return m(vm,{...v,children:g(Tm,{required:h,scope:n,trigger:b,onTriggerChange:w,valueNode:x,onValueNodeChange:E,valueNodeHasChildren:S,onValueNodeHasChildrenChange:_,contentId:Tu(),value:M,onValueChange:O,open:k,onOpenChange:N,dir:C,triggerPointerDownPosRef:A,disabled:p,children:[m(Nm.Provider,{scope:n,children:m($m,{scope:t.__scopeSelect,onNativeOptionAdd:e.useCallback(e=>{T(t=>new Set(t).add(e))},[]),onNativeOptionRemove:e.useCallback(e=>{T(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:r})}),P?g(Sg,{"aria-hidden":!0,required:h,tabIndex:-1,name:d,autoComplete:f,value:M,onChange:e=>O(e.target.value),disabled:p,form:y,children:[void 0===M?m("option",{value:""}):null,Array.from(R)]},D):null]})})};zm.displayName=km;var Lm="SelectTrigger",Bm=e.forwardRef((t,n)=>{const{__scopeSelect:r,disabled:o=!1,...i}=t,a=Rm(r),s=Dm(Lm,r),l=s.disabled||o,c=Nu(n,s.onTriggerChange),u=Mm(r),d=e.useRef("touch"),[f,p,h]=Cg(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===s.value),r=kg(t,e,n);void 0!==r&&s.onValueChange(r.value)}),g=e=>{l||(s.onOpenChange(!0),h()),e&&(s.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return m(bm,{asChild:!0,...a,children:m(Fu.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:l,"data-disabled":l?"":void 0,"data-placeholder":_g(s.value)?"":void 0,...i,ref:c,onClick:_u(i.onClick,e=>{e.currentTarget.focus(),"mouse"!==d.current&&g(e)}),onPointerDown:_u(i.onPointerDown,e=>{d.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())}),onKeyDown:_u(i.onKeyDown,e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||p(e.key),t&&" "===e.key||_m.includes(e.key)&&(g(),e.preventDefault())})})})});Bm.displayName=Lm;var Fm="SelectValue",Hm=e.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:i,placeholder:a="",...s}=e,l=Dm(Fm,n),{onValueNodeHasChildrenChange:c}=l,u=void 0!==i,d=Nu(t,l.onValueNodeChange);return Au(()=>{c(u)},[c,u]),m(Fu.span,{...s,ref:d,style:{pointerEvents:"none"},children:_g(l.value)?m(y,{children:a}):i})});Hm.displayName=Fm;var Wm=e.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m(Fu.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});Wm.displayName="SelectIcon";var Vm=e=>m(sd,{asChild:!0,...e});Vm.displayName="SelectPortal";var Ym="SelectContent",jm=e.forwardRef((t,n)=>{const r=Dm(Ym,t.__scopeSelect),[o,i]=e.useState();if(Au(()=>{i(new DocumentFragment)},[]),!r.open){const e=o;return e?p.createPortal(m(Km,{scope:t.__scopeSelect,children:m(Nm.Slot,{scope:t.__scopeSelect,children:m("div",{children:t.children})})}),e):null}return m(Zm,{...t,ref:n})});jm.displayName=Ym;var Xm=10,[Km,Um]=Am(Ym),qm=Iu("SelectContent.RemoveScroll"),Zm=e.forwardRef((t,n)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:i,onEscapeKeyDown:a,onPointerDownOutside:s,side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:y,avoidCollisions:v,...b}=t,w=Dm(Ym,r),[x,E]=e.useState(null),[S,_]=e.useState(null),C=Nu(n,e=>E(e)),[k,N]=e.useState(null),[M,O]=e.useState(null),A=Mm(r),[P,R]=e.useState(!1),T=e.useRef(!1);e.useEffect(()=>{if(x)return lf(x)},[x]),dd();const D=e.useCallback(e=>{const[t,...n]=A().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const n of e){if(n===o)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==o)return}},[A,S]),$=e.useCallback(()=>D([k,x]),[D,k,x]);e.useEffect(()=>{P&&$()},[P,$]);const{onOpenChange:I,triggerPointerDownPosRef:z}=w;e.useEffect(()=>{if(x){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(z.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(z.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():x.contains(n.target)||I(!1),document.removeEventListener("pointermove",t),z.current=null};return null!==z.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[x,I,z]),e.useEffect(()=>{const e=()=>I(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[I]);const[L,B]=Cg(e=>{const t=A().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=kg(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),F=e.useCallback((e,t,n)=>{const r=!T.current&&!n;(void 0!==w.value&&w.value===t||r)&&(N(e),r&&(T.current=!0))},[w.value]),H=e.useCallback(()=>x?.focus(),[x]),W=e.useCallback((e,t,n)=>{const r=!T.current&&!n;(void 0!==w.value&&w.value===t||r)&&O(e)},[w.value]),V="popper"===o?Qm:Gm,Y=V===Qm?{side:l,sideOffset:c,align:u,alignOffset:d,arrowPadding:f,collisionBoundary:p,collisionPadding:h,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return m(Km,{scope:r,content:x,viewport:S,onViewportChange:_,itemRefCallback:F,selectedItem:k,onItemLeave:H,itemTextRefCallback:W,focusSelectedItem:$,selectedItemText:M,position:o,isPositioned:P,searchRef:L,children:m(ef,{as:qm,allowPinchZoom:!0,children:m(ed,{asChild:!0,trapped:w.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:_u(i,e=>{w.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:m(Ku,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:s,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>w.onOpenChange(!1),children:m(V,{role:"listbox",id:w.contentId,"data-state":w.open?"open":"closed",dir:w.dir,onContextMenu:e=>e.preventDefault(),...b,...Y,onPlaced:()=>R(!0),ref:C,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:_u(b.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||B(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=A().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>D(t)),e.preventDefault()}})})})})})})});Zm.displayName="SelectContentImpl";var Gm=e.forwardRef((t,n)=>{const{__scopeSelect:r,onPlaced:o,...i}=t,a=Dm(Ym,r),s=Um(Ym,r),[l,c]=e.useState(null),[u,d]=e.useState(null),f=Nu(n,e=>d(e)),p=Mm(r),h=e.useRef(!1),g=e.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:w}=s,x=e.useCallback(()=>{if(a.trigger&&a.valueNode&&l&&u&&y&&v&&b){const e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if("rtl"!==a.dir){const o=r.left-t.left,i=n.left-o,a=e.left-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-Xm,d=ap(i,[Xm,Math.max(Xm,u-c)]);l.style.minWidth=s+"px",l.style.left=d+"px"}else{const o=t.right-r.right,i=window.innerWidth-n.right-o,a=window.innerWidth-e.right-i,s=e.width+a,c=Math.max(s,t.width),u=window.innerWidth-Xm,d=ap(i,[Xm,Math.max(Xm,u-c)]);l.style.minWidth=s+"px",l.style.right=d+"px"}const i=p(),s=window.innerHeight-2*Xm,c=y.scrollHeight,d=window.getComputedStyle(u),f=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),g=parseInt(d.borderBottomWidth,10),w=f+m+c+parseInt(d.paddingBottom,10)+g,x=Math.min(5*v.offsetHeight,w),E=window.getComputedStyle(y),S=parseInt(E.paddingTop,10),_=parseInt(E.paddingBottom,10),C=e.top+e.height/2-Xm,k=s-C,N=v.offsetHeight/2,M=f+m+(v.offsetTop+N),O=w-M;if(M<=C){const e=i.length>0&&v===i[i.length-1].ref.current;l.style.bottom="0px";const t=u.clientHeight-y.offsetTop-y.offsetHeight,n=M+Math.max(k,N+(e?_:0)+t+g);l.style.height=n+"px"}else{const e=i.length>0&&v===i[0].ref.current;l.style.top="0px";const t=Math.max(C,f+y.offsetTop+(e?S:0)+N)+O;l.style.height=t+"px",y.scrollTop=M-C+y.offsetTop}l.style.margin=`${Xm}px 0`,l.style.minHeight=x+"px",l.style.maxHeight=s+"px",o?.(),requestAnimationFrame(()=>h.current=!0)}},[p,a.trigger,a.valueNode,l,u,y,v,b,a.dir,o]);Au(()=>x(),[x]);const[E,S]=e.useState();Au(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const _=e.useCallback(e=>{e&&!0===g.current&&(x(),w?.(),g.current=!1)},[x,w]);return m(Jm,{scope:r,contentWrapper:l,shouldExpandOnScrollRef:h,onScrollButtonChange:_,children:m("div",{ref:c,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:E},children:m(Fu.div,{...i,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...i.style}})})})});Gm.displayName="SelectItemAlignedPosition";var Qm=e.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=Xm,...i}=e,a=Rm(n);return m(wm,{...a,...i,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...i.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)"}})});Qm.displayName="SelectPopperPosition";var[Jm,eg]=Am(Ym,{}),tg="SelectViewport",ng=e.forwardRef((t,n)=>{const{__scopeSelect:r,nonce:o,...i}=t,a=Um(tg,r),s=eg(tg,r),l=Nu(n,a.onViewportChange),c=e.useRef(0);return g(y,{children:[m("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}),m(Nm.Slot,{scope:r,children:m(Fu.div,{"data-radix-select-viewport":"",role:"presentation",...i,ref:l,style:{position:"relative",flex:1,overflow:"hidden auto",...i.style},onScroll:_u(i.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=s;if(r?.current&&n){const e=Math.abs(c.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*Xm,o=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),a=Math.max(o,i);if(a<r){const o=a+e,i=Math.min(r,o),s=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}c.current=t.scrollTop})})})]})});ng.displayName=tg;var rg="SelectGroup",[og,ig]=Am(rg);e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Tu();return m(og,{scope:n,id:o,children:m(Fu.div,{role:"group","aria-labelledby":o,...r,ref:t})})}).displayName=rg;var ag="SelectLabel",sg=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=ig(ag,n);return m(Fu.div,{id:o.id,...r,ref:t})});sg.displayName=ag;var lg="SelectItem",[cg,ug]=Am(lg),dg=e.forwardRef((t,n)=>{const{__scopeSelect:r,value:o,disabled:i=!1,textValue:a,...s}=t,l=Dm(lg,r),c=Um(lg,r),u=l.value===o,[d,f]=e.useState(a??""),[p,h]=e.useState(!1),g=Nu(n,e=>c.itemRefCallback?.(e,o,i)),y=Tu(),v=e.useRef("touch"),b=()=>{i||(l.onValueChange(o),l.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 m(cg,{scope:r,value:o,disabled:i,textId:y,isSelected:u,onItemTextChange:e.useCallback(e=>{f(t=>t||(e?.textContent??"").trim())},[]),children:m(Nm.ItemSlot,{scope:r,value:o,disabled:i,textValue:d,children:m(Fu.div,{role:"option","aria-labelledby":y,"data-highlighted":p?"":void 0,"aria-selected":u&&p,"data-state":u?"checked":"unchecked","aria-disabled":i||void 0,"data-disabled":i?"":void 0,tabIndex:i?void 0:-1,...s,ref:g,onFocus:_u(s.onFocus,()=>h(!0)),onBlur:_u(s.onBlur,()=>h(!1)),onClick:_u(s.onClick,()=>{"mouse"!==v.current&&b()}),onPointerUp:_u(s.onPointerUp,()=>{"mouse"===v.current&&b()}),onPointerDown:_u(s.onPointerDown,e=>{v.current=e.pointerType}),onPointerMove:_u(s.onPointerMove,e=>{v.current=e.pointerType,i?c.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:_u(s.onPointerLeave,e=>{e.currentTarget===document.activeElement&&c.onItemLeave?.()}),onKeyDown:_u(s.onKeyDown,e=>{""!==c.searchRef?.current&&" "===e.key||(Cm.includes(e.key)&&b()," "===e.key&&e.preventDefault())})})})})});dg.displayName=lg;var fg="SelectItemText",pg=e.forwardRef((t,n)=>{const{__scopeSelect:r,className:o,style:i,...a}=t,s=Dm(fg,r),l=Um(fg,r),c=ug(fg,r),u=Im(fg,r),[d,f]=e.useState(null),h=Nu(n,e=>f(e),c.onItemTextChange,e=>l.itemTextRefCallback?.(e,c.value,c.disabled)),v=d?.textContent,b=e.useMemo(()=>m("option",{value:c.value,disabled:c.disabled,children:v},c.value),[c.disabled,c.value,v]),{onNativeOptionAdd:w,onNativeOptionRemove:x}=u;return Au(()=>(w(b),()=>x(b)),[w,x,b]),g(y,{children:[m(Fu.span,{id:c.textId,...a,ref:h}),c.isSelected&&s.valueNode&&!s.valueNodeHasChildren?p.createPortal(a.children,s.valueNode):null]})});pg.displayName=fg;var hg="SelectItemIndicator",mg=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return ug(hg,n).isSelected?m(Fu.span,{"aria-hidden":!0,...r,ref:t}):null});mg.displayName=hg;var gg="SelectScrollUpButton",yg=e.forwardRef((t,n)=>{const r=Um(gg,t.__scopeSelect),o=eg(gg,t.__scopeSelect),[i,a]=e.useState(!1),s=Nu(n,o.onScrollButtonChange);return Au(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollTop>0;a(e)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?m(wg,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});yg.displayName=gg;var vg="SelectScrollDownButton",bg=e.forwardRef((t,n)=>{const r=Um(vg,t.__scopeSelect),o=eg(vg,t.__scopeSelect),[i,a]=e.useState(!1),s=Nu(n,o.onScrollButtonChange);return Au(()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[r.viewport,r.isPositioned]),i?m(wg,{...t,ref:s,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});bg.displayName=vg;var wg=e.forwardRef((t,n)=>{const{__scopeSelect:r,onAutoScroll:o,...i}=t,a=Um("SelectScrollButton",r),s=e.useRef(null),l=Mm(r),c=e.useCallback(()=>{null!==s.current&&(window.clearInterval(s.current),s.current=null)},[]);return e.useEffect(()=>()=>c(),[c]),Au(()=>{const e=l().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[l]),m(Fu.div,{"aria-hidden":!0,...i,ref:n,style:{flexShrink:0,...i.style},onPointerDown:_u(i.onPointerDown,()=>{null===s.current&&(s.current=window.setInterval(o,50))}),onPointerMove:_u(i.onPointerMove,()=>{a.onItemLeave?.(),null===s.current&&(s.current=window.setInterval(o,50))}),onPointerLeave:_u(i.onPointerLeave,()=>{c()})})}),xg=e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m(Fu.div,{"aria-hidden":!0,...r,ref:t})});xg.displayName="SelectSeparator";var Eg="SelectArrow";e.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Rm(n),i=Dm(Eg,n),a=Um(Eg,n);return i.open&&"popper"===a.position?m(xm,{...o,...r,ref:t}):null}).displayName=Eg;var Sg=e.forwardRef(({__scopeSelect:t,value:n,...r},o)=>{const i=e.useRef(null),a=Nu(o,i),s=Em(n);return e.useEffect(()=>{const e=i.current;if(!e)return;const t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(s!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}},[s,n]),m(Fu.select,{...r,style:{...Sm,...r.style},ref:a,defaultValue:n})});function _g(e){return""===e||void 0===e}function Cg(t){const n=Hu(t),r=e.useRef(""),o=e.useRef(0),i=e.useCallback(e=>{const t=r.current+e;n(t),function e(t){r.current=t,window.clearTimeout(o.current),""!==t&&(o.current=window.setTimeout(()=>e(""),1e3))}(t)},[n]),a=e.useCallback(()=>{r.current="",window.clearTimeout(o.current)},[]);return e.useEffect(()=>()=>window.clearTimeout(o.current),[]),[r,i,a]}function kg(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0]),o=r?t[0]:t,i=n?e.indexOf(n):-1;let a=function(e,t){return e.map((n,r)=>e[(t+r)%e.length])}(e,Math.max(i,0));1===o.length&&(a=a.filter(e=>e!==n));const s=a.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return s!==n?s:void 0}Sg.displayName="SelectBubbleInput";var Ng=Bm,Mg=Wm,Og=Vm,Ag=jm,Pg=ng,Rg=sg,Tg=dg,Dg=pg,$g=mg,Ig=yg,zg=bg,Lg=xg;const Bg=zm,Fg=Hm,Hg=gc(Ng)`
290
339
  display: flex;
291
340
  height: 2.5rem;
292
341
  width: 100%;
@@ -314,29 +363,29 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
314
363
  &[data-placeholder] {
315
364
  color: #6b7280;
316
365
  }
317
- `,oy=$c(Ms)`
366
+ `,Wg=gc(Ms)`
318
367
  height: 1rem;
319
368
  width: 1rem;
320
369
  opacity: 0.5;
321
- `,ay=$c(Qg)`
370
+ `,Vg=gc(Ig)`
322
371
  display: flex;
323
372
  cursor: default;
324
373
  align-items: center;
325
374
  justify-content: center;
326
375
  padding: 0.25rem;
327
- `,iy=$c(Os)`
376
+ `,Yg=gc(As)`
328
377
  height: 1rem;
329
378
  width: 1rem;
330
- `,sy=$c(Jg)`
379
+ `,jg=gc(zg)`
331
380
  display: flex;
332
381
  cursor: default;
333
382
  align-items: center;
334
383
  justify-content: center;
335
384
  padding: 0.25rem;
336
- `,ly=$c(Ms)`
385
+ `,Xg=gc(Ms)`
337
386
  height: 1rem;
338
387
  width: 1rem;
339
- `,cy=$c(Xg)`
388
+ `,Kg=gc(Ag)`
340
389
  position: relative;
341
390
  z-index: 50;
342
391
  min-width: 8rem;
@@ -359,13 +408,13 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
359
408
  transform: translateY(0);
360
409
  }
361
410
  }
362
- `,uy=$c(Ug)`
411
+ `,Ug=gc(Rg)`
363
412
  padding: 0.375rem 0.75rem;
364
413
  padding-left: 2rem;
365
414
  font-size: 0.875rem;
366
415
  font-weight: 600;
367
416
  color: #374151;
368
- `,dy=$c(qg)`
417
+ `,qg=gc(Tg)`
369
418
  position: relative;
370
419
  display: flex;
371
420
  cursor: default;
@@ -391,7 +440,7 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
391
440
  background-color: #f3f4f6;
392
441
  color: #1f2937;
393
442
  }
394
- `,fy=$c.span`
443
+ `,Zg=gc.span`
395
444
  position: absolute;
396
445
  left: 0.5rem;
397
446
  display: flex;
@@ -399,61 +448,61 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
399
448
  width: 0.875rem;
400
449
  align-items: center;
401
450
  justify-content: center;
402
- `,py=$c(Ns)`
451
+ `,Gg=gc(Ns)`
403
452
  height: 1rem;
404
453
  width: 1rem;
405
- `,hy=$c(ey)`
454
+ `,Qg=gc(Lg)`
406
455
  margin: 0.25rem -0.25rem;
407
456
  height: 1px;
408
457
  background-color: #e5e7eb;
409
- `,my=e.forwardRef(({children:t,...n},r)=>e.createElement(ry,{ref:r,...n},t,e.createElement(jg,{asChild:!0},e.createElement(oy,null))));my.displayName=Vg.displayName;const gy=e.forwardRef(({...t},n)=>e.createElement(ay,{ref:n,...t},e.createElement(iy,null)));gy.displayName=Qg.displayName;const yy=e.forwardRef(({...t},n)=>e.createElement(sy,{ref:n,...t},e.createElement(ly,null)));yy.displayName=Jg.displayName;const vy=e.forwardRef(({children:t,position:n="popper",...r},o)=>e.createElement(Yg,null,e.createElement(cy,{ref:o,position:n,...r},e.createElement(gy,null),e.createElement(Kg,{style:{padding:"4px"}},t),e.createElement(yy,null))));vy.displayName=Xg.displayName;e.forwardRef(({...t},n)=>e.createElement(uy,{ref:n,...t})).displayName=Ug.displayName;const by=e.forwardRef(({children:t,...n},r)=>e.createElement(dy,{ref:r,...n},e.createElement(fy,null,e.createElement(Gg,null,e.createElement(py,null))),e.createElement(Zg,null,t)));by.displayName=qg.displayName;e.forwardRef(({...t},n)=>e.createElement(hy,{ref:n,...t})).displayName=ey.displayName;const wy=$c.div`
458
+ `,Jg=e.forwardRef(({children:t,...n},r)=>e.createElement(Hg,{ref:r,...n},t,e.createElement(Mg,{asChild:!0},e.createElement(Wg,null))));Jg.displayName=Ng.displayName;const ey=e.forwardRef(({...t},n)=>e.createElement(Vg,{ref:n,...t},e.createElement(Yg,null)));ey.displayName=Ig.displayName;const ty=e.forwardRef(({...t},n)=>e.createElement(jg,{ref:n,...t},e.createElement(Xg,null)));ty.displayName=zg.displayName;const ny=e.forwardRef(({children:t,position:n="popper",...r},o)=>e.createElement(Og,null,e.createElement(Kg,{ref:o,position:n,...r},e.createElement(ey,null),e.createElement(Pg,{style:{padding:"4px"}},t),e.createElement(ty,null))));ny.displayName=Ag.displayName;e.forwardRef(({...t},n)=>e.createElement(Ug,{ref:n,...t})).displayName=Rg.displayName;const ry=e.forwardRef(({children:t,...n},r)=>e.createElement(qg,{ref:r,...n},e.createElement(Zg,null,e.createElement($g,null,e.createElement(Gg,null))),e.createElement(Dg,null,t)));ry.displayName=Tg.displayName;e.forwardRef(({...t},n)=>e.createElement(Qg,{ref:n,...t})).displayName=Lg.displayName;const oy=gc.div`
410
459
  display: flex;
411
460
  align-items: center;
412
461
  gap: 0.5rem;
413
462
  min-width: 300px;
414
- `,xy=$c.div`
463
+ `,iy=gc.div`
415
464
  padding: 0.5rem 1rem;
416
- color: ${e=>e.theme.colors.mutedForeground};
465
+ color: ${e=>e.themeColors.mutedForeground};
417
466
  font-size: 0.875rem;
418
- background-color: ${e=>e.theme.colors.muted};
467
+ background-color: ${e=>e.themeColors.muted};
419
468
  border-radius: 0.375rem;
420
- border: 1px solid ${e=>e.theme.colors.border};
421
- `,Sy=$c.div`
469
+ border: 1px solid ${e=>e.themeColors.border};
470
+ `,ay=gc.div`
422
471
  flex: 1;
423
472
  min-width: 0;
424
- `,Ey=$c.div`
473
+ `,sy=gc.div`
425
474
  display: flex;
426
475
  align-items: center;
427
476
  justify-content: space-between;
428
477
  width: 100%;
429
- `,_y=$c.div`
478
+ `,ly=gc.div`
430
479
  padding: 0.5rem 1rem;
431
- color: ${e=>e.theme.colors.mutedForeground};
480
+ color: ${e=>e.themeColors.mutedForeground};
432
481
  font-size: 0.875rem;
433
482
  text-align: center;
434
- `,Cy=$c.button`
483
+ `,cy=gc.button`
435
484
  display: flex;
436
485
  align-items: center;
437
486
  justify-content: center;
438
487
  padding: 0.5rem;
439
488
  border: none;
440
489
  border-radius: 0.375rem;
441
- border: 1px solid ${e=>e.theme.colors.border};
442
- background-color: ${e=>e.theme.colors.card};
443
- color: ${e=>e.theme.colors.cardForeground};
490
+ border: 1px solid ${e=>e.themeColors.border};
491
+ background-color: ${e=>e.themeColors.card};
492
+ color: ${e=>e.themeColors.cardForeground};
444
493
  transition: all 0.2s ease-in-out;
445
494
  opacity: ${e=>e.loading||e.disabled?.5:1};
446
495
  cursor: ${e=>e.loading||e.disabled?"not-allowed":"pointer"};
447
496
 
448
497
  &:hover:not(:disabled) {
449
- background-color: ${e=>e.theme.colors.muted};
450
- color: ${e=>e.theme.colors.cardForeground};
498
+ background-color: ${e=>e.themeColors.muted};
499
+ color: ${e=>e.themeColors.cardForeground};
451
500
  }
452
- `,ky=$c(As)`
501
+ `,uy=gc(Ps)`
453
502
  height: 1rem;
454
503
  width: 1rem;
455
504
  animation: spin 1s linear infinite;
456
- color: ${e=>e.theme.colors.mutedForeground};
505
+ color: ${e=>e.themeColors.mutedForeground};
457
506
 
458
507
  @keyframes spin {
459
508
  from {
@@ -463,10 +512,10 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
463
512
  transform: rotate(360deg);
464
513
  }
465
514
  }
466
- `,Ny=$c(Ts)`
515
+ `,dy=gc(Ts)`
467
516
  height: 1rem;
468
517
  width: 1rem;
469
- `,My=({files:e,currentFile:n,onFileSelect:r,onRefresh:o,loading:a=!1,disabled:i=!1})=>t.createElement(wy,null,0!==e.length||a?t.createElement(ty,{value:n||"",onValueChange:r,disabled:i||a},t.createElement(Sy,{disabled:i,loading:a},t.createElement(my,null,t.createElement(Ey,null,t.createElement(ny,{placeholder:a?"Loading sessions...":0===e.length?"No sessions found":"Select an Agent Session..."})))),t.createElement(vy,null,0!==e.length||a?e.map(e=>t.createElement(by,{key:e.name,value:e.name},e.name)):t.createElement(_y,null,"No agent sessions available"))):t.createElement(xy,null,"No agent sessions available"),e.length>0&&t.createElement(Cy,{onClick:e=>{e.stopPropagation(),o()},disabled:a||i,loading:a,title:a?"Loading...":"Refresh files"},a?t.createElement(ky,null):t.createElement(Ny,null)));var Py="Checkbox",[Oy,Ay]=ju(Py),[Ry,Ty]=Oy(Py);function Dy(t){const{__scopeCheckbox:n,checked:r,children:o,defaultChecked:a,disabled:i,form:s,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[p,h]=Gu({prop:r,defaultProp:a??!1,onChange:c,caller:Py}),[g,y]=e.useState(null),[v,b]=e.useState(null),w=e.useRef(!1),x=!g||(!!s||!!g.closest("form")),S={checked:p,disabled:i,setChecked:h,control:g,setControl:y,name:l,form:s,value:d,hasConsumerStoppedPropagationRef:w,required:u,defaultChecked:!Vy(a)&&a,isFormControl:x,bubbleInput:v,setBubbleInput:b};return m(Ry,{scope:n,...S,children:Wy(f)?f(S):o})}var $y="CheckboxTrigger",Iy=e.forwardRef(({__scopeCheckbox:t,onKeyDown:n,onClick:r,...o},a)=>{const{control:i,value:s,disabled:l,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:g}=Ty($y,t),y=Vu(a,d),v=e.useRef(c);return e.useEffect(()=>{const e=i?.form;if(e){const t=()=>f(v.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[i,f]),m(nd.button,{type:"button",role:"checkbox","aria-checked":Vy(c)?"mixed":c,"aria-required":u,"data-state":jy(c),"data-disabled":l?"":void 0,disabled:l,value:s,...o,ref:y,onKeyDown:Fu(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:Fu(r,e=>{f(e=>!!Vy(e)||!e),g&&h&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})});Iy.displayName=$y;var zy=e.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:a,required:i,disabled:s,value:l,onCheckedChange:c,form:u,...d}=e;return m(Dy,{__scopeCheckbox:n,checked:o,defaultChecked:a,disabled:s,required:i,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:e})=>g(y,{children:[m(Iy,{...d,ref:t,__scopeCheckbox:n}),e&&m(Hy,{__scopeCheckbox:n})]})})});zy.displayName=Py;var Ly="CheckboxIndicator",By=e.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,a=Ty(Ly,n);return m(_d,{present:r||Vy(a.checked)||!0===a.checked,children:m(nd.span,{"data-state":jy(a.checked),"data-disabled":a.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});By.displayName=Ly;var Fy="CheckboxBubbleInput",Hy=e.forwardRef(({__scopeCheckbox:t,...n},r)=>{const{control:o,hasConsumerStoppedPropagationRef:a,checked:i,defaultChecked:s,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:h}=Ty(Fy,t),g=Vu(r,h),y=Lm(i),v=mm(o);e.useEffect(()=>{const e=p;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set,r=!a.current;if(y!==i&&n){const t=new Event("click",{bubbles:r});e.indeterminate=Vy(i),n.call(e,!Vy(i)&&i),e.dispatchEvent(t)}},[p,y,i,a]);const b=e.useRef(!Vy(i)&&i);return m(nd.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??b.current,required:l,disabled:c,name:u,value:d,form:f,...n,tabIndex:-1,ref:g,style:{...n.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function Wy(e){return"function"==typeof e}function Vy(e){return"indeterminate"===e}function jy(e){return Vy(e)?"indeterminate":e?"checked":"unchecked"}Hy.displayName=Fy;const Yy=$c(zy)`
518
+ `,fy=({files:e,currentFile:n,onFileSelect:r,onRefresh:o,loading:i=!1,disabled:a=!1})=>{const{theme:s}=ac(),l=s.colors;return t.createElement(oy,null,0!==e.length||i?t.createElement(Bg,{value:n||"",onValueChange:r,disabled:a||i},t.createElement(ay,{disabled:a,loading:i},t.createElement(Jg,null,t.createElement(sy,null,t.createElement(Fg,{placeholder:i?"Loading sessions...":0===e.length?"No sessions found":"Select an Agent Session..."})))),t.createElement(ny,null,0!==e.length||i?e.map(e=>t.createElement(ry,{key:e.name,value:e.name},e.name)):t.createElement(ly,{themeColors:l},"No agent sessions available"))):t.createElement(iy,{themeColors:l},"No agent sessions available"),e.length>0&&t.createElement(cy,{onClick:e=>{e.stopPropagation(),o()},disabled:i||a,loading:i,title:i?"Loading...":"Refresh files",themeColors:l},i?t.createElement(uy,{themeColors:l}):t.createElement(dy,null)))};var py="Checkbox",[hy,my]=Mu(py),[gy,yy]=hy(py);function vy(t){const{__scopeCheckbox:n,checked:r,children:o,defaultChecked:i,disabled:a,form:s,name:l,onCheckedChange:c,required:u,value:d="on",internal_do_not_use_render:f}=t,[p,h]=$u({prop:r,defaultProp:i??!1,onChange:c,caller:py}),[g,y]=e.useState(null),[v,b]=e.useState(null),w=e.useRef(!1),x=!g||(!!s||!!g.closest("form")),E={checked:p,disabled:a,setChecked:h,control:g,setControl:y,name:l,form:s,value:d,hasConsumerStoppedPropagationRef:w,required:u,defaultChecked:!Ny(i)&&i,isFormControl:x,bubbleInput:v,setBubbleInput:b};return m(gy,{scope:n,...E,children:ky(f)?f(E):o})}var by="CheckboxTrigger",wy=e.forwardRef(({__scopeCheckbox:t,onKeyDown:n,onClick:r,...o},i)=>{const{control:a,value:s,disabled:l,checked:c,required:u,setControl:d,setChecked:f,hasConsumerStoppedPropagationRef:p,isFormControl:h,bubbleInput:g}=yy(by,t),y=Nu(i,d),v=e.useRef(c);return e.useEffect(()=>{const e=a?.form;if(e){const t=()=>f(v.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}},[a,f]),m(Fu.button,{type:"button",role:"checkbox","aria-checked":Ny(c)?"mixed":c,"aria-required":u,"data-state":My(c),"data-disabled":l?"":void 0,disabled:l,value:s,...o,ref:y,onKeyDown:_u(n,e=>{"Enter"===e.key&&e.preventDefault()}),onClick:_u(r,e=>{f(e=>!!Ny(e)||!e),g&&h&&(p.current=e.isPropagationStopped(),p.current||e.stopPropagation())})})});wy.displayName=by;var xy=e.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:o,defaultChecked:i,required:a,disabled:s,value:l,onCheckedChange:c,form:u,...d}=e;return m(vy,{__scopeCheckbox:n,checked:o,defaultChecked:i,disabled:s,required:a,onCheckedChange:c,name:r,form:u,value:l,internal_do_not_use_render:({isFormControl:e})=>g(y,{children:[m(wy,{...d,ref:t,__scopeCheckbox:n}),e&&m(Cy,{__scopeCheckbox:n})]})})});xy.displayName=py;var Ey="CheckboxIndicator",Sy=e.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...o}=e,i=yy(Ey,n);return m(ld,{present:r||Ny(i.checked)||!0===i.checked,children:m(Fu.span,{"data-state":My(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:t,style:{pointerEvents:"none",...e.style}})})});Sy.displayName=Ey;var _y="CheckboxBubbleInput",Cy=e.forwardRef(({__scopeCheckbox:t,...n},r)=>{const{control:o,hasConsumerStoppedPropagationRef:i,checked:a,defaultChecked:s,required:l,disabled:c,name:u,value:d,form:f,bubbleInput:p,setBubbleInput:h}=yy(_y,t),g=Nu(r,h),y=Em(a),v=Jh(o);e.useEffect(()=>{const e=p;if(!e)return;const t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set,r=!i.current;if(y!==a&&n){const t=new Event("click",{bubbles:r});e.indeterminate=Ny(a),n.call(e,!Ny(a)&&a),e.dispatchEvent(t)}},[p,y,a,i]);const b=e.useRef(!Ny(a)&&a);return m(Fu.input,{type:"checkbox","aria-hidden":!0,defaultChecked:s??b.current,required:l,disabled:c,name:u,value:d,form:f,...n,tabIndex:-1,ref:g,style:{...n.style,...v,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});function ky(e){return"function"==typeof e}function Ny(e){return"indeterminate"===e}function My(e){return Ny(e)?"indeterminate":e?"checked":"unchecked"}Cy.displayName=_y;const Oy=gc(xy)`
470
519
  display: flex;
471
520
  align-items: center;
472
521
  justify-content: center;
@@ -493,194 +542,12 @@ var _s={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24
493
542
  background-color: #6366f1;
494
543
  color: white;
495
544
  }
496
- `,Xy=$c(By)`
545
+ `,Ay=gc(Sy)`
497
546
  display: flex;
498
547
  align-items: center;
499
548
  justify-content: center;
500
549
  color: currentColor;
501
- `,Ky=$c(Ns)`
550
+ `,Py=gc(Ns)`
502
551
  height: 1rem;
503
552
  width: 1rem;
504
- `,Uy=e.forwardRef(({className:t,...n},r)=>e.createElement(Yy,{ref:r,...n},e.createElement(Xy,null,e.createElement(Ky,null))));Uy.displayName=zy.displayName;const qy=t.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Zy=()=>{const e=t.useContext(qy);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};function Gy(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Qy(){return ev(/^iPad/)||ev(/^Mac/)&&navigator.maxTouchPoints>1}function Jy(){return ev(/^iPhone/)||Qy()}function ev(e){return"undefined"!=typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");const tv="undefined"!=typeof window?f:i;function nv(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}const rv="undefined"!=typeof document&&window.visualViewport;function ov(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function av(e){for(ov(e)&&(e=e.parentElement);e&&!ov(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const iv=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let sv,lv=0;function cv(e={}){let{isDisabled:t}=e;tv(()=>{if(!t)return lv++,1===lv&&Jy()&&(sv=function(){let e,t=0,n=n=>{e=av(n.target),e===document.documentElement&&e===document.body||(t=n.changedTouches[0].pageY)},r=n=>{if(!e||e===document.documentElement||e===document.body)return void n.preventDefault();let r=n.changedTouches[0].pageY,o=e.scrollTop,a=e.scrollHeight-e.clientHeight;0!==a&&((o<=0&&r>t||o>=a&&r<t)&&n.preventDefault(),t=r)},o=e=>{let t=e.target;fv(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},a=e=>{let t=e.target;fv(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",rv&&(rv.height<window.innerHeight?requestAnimationFrame(()=>{dv(t)}):rv.addEventListener("resize",()=>dv(t),{once:!0}))}))},i=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=nv(function(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"));window.scrollTo(0,0);let u=nv(uv(document,"touchstart",n,{passive:!1,capture:!0}),uv(document,"touchmove",r,{passive:!1,capture:!0}),uv(document,"touchend",o,{passive:!1,capture:!0}),uv(document,"focus",a,!0),uv(window,"scroll",i));return()=>{c(),u(),window.scrollTo(s,l)}}()),()=>{lv--,0===lv&&(null==sv||sv())}},[t])}function uv(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function dv(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=av(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=r-n)}e=t.parentElement}}function fv(e){return e instanceof HTMLInputElement&&!iv.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function pv(...t){return e.useCallback(function(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}(...t),t)}const hv=new WeakMap;function mv(e,t,n=!1){if(!(e&&e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),n||hv.set(e,r)}const gv=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function yv(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[gv(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[gv(t)?5:4]):null)}function vv(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}const bv={DURATION:.5,EASE:[.32,.72,0,1]},wv=16,xv="vaul-dragging";function Sv(e){const n=t.useRef(e);return t.useEffect(()=>{n.current=e}),t.useMemo(()=>(...e)=>null==n.current?void 0:n.current.call(n,...e),[])}function Ev({prop:e,defaultProp:n,onChange:r=()=>{}}){const[o,a]=function({defaultProp:e,onChange:n}){const r=t.useState(e),[o]=r,a=t.useRef(o),i=Sv(n);return t.useEffect(()=>{a.current!==o&&(i(o),a.current=o)},[o,a,i]),r}({defaultProp:n,onChange:r}),i=void 0!==e,s=i?e:o,l=Sv(r),c=t.useCallback(t=>{if(i){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else a(t)},[i,e,a,l]);return[s,c]}let _v=null;function Cv({open:e,onOpenChange:n,children:r,onDrag:o,onRelease:a,snapPoints:i,shouldScaleBackground:s=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=.25,scrollLockTimeout:u=100,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:p=i&&i.length-1,activeSnapPoint:h,setActiveSnapPoint:m,fixed:g,modal:y=!0,onClose:v,nested:b,noBodyStyles:w=!1,direction:x="bottom",defaultOpen:S=!1,disablePreventScroll:E=!0,snapToSequentialPoint:_=!1,preventScrollRestoration:C=!1,repositionInputs:k=!0,onAnimationEnd:N,container:M,autoFocus:P=!1}){var O,A;const[R=!1,T]=Ev({defaultProp:S,prop:e,onChange:e=>{null==n||n(e),e||b||ue(),setTimeout(()=>{null==N||N(e)},1e3*bv.DURATION),e&&!y&&"undefined"!=typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[D,$]=t.useState(!1),[I,z]=t.useState(!1),[L,B]=t.useState(!1),F=t.useRef(null),H=t.useRef(null),W=t.useRef(null),V=t.useRef(null),j=t.useRef(null),Y=t.useRef(!1),X=t.useRef(null),K=t.useRef(0),U=t.useRef(!1),q=t.useRef(!S),Z=t.useRef(0),G=t.useRef(null),Q=t.useRef((null==(O=G.current)?void 0:O.getBoundingClientRect().height)||0),J=t.useRef((null==(A=G.current)?void 0:A.getBoundingClientRect().width)||0),ee=t.useRef(0),te=t.useCallback(e=>{i&&e===ie.length-1&&(H.current=new Date)},[]),{activeSnapPoint:ne,activeSnapPointIndex:re,setActiveSnapPoint:oe,onRelease:ae,snapPointsOffset:ie,onDrag:se,shouldFade:le,getPercentageDragged:ce}=function({activeSnapPointProp:e,setActiveSnapPointProp:n,snapPoints:r,drawerRef:o,overlayRef:a,fadeFromIndex:i,onSnapPointChange:s,direction:l="bottom",container:c,snapToSequentialPoint:u}){const[d,f]=Ev({prop:e,defaultProp:null==r?void 0:r[0],onChange:n}),[p,h]=t.useState("undefined"!=typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);t.useEffect(()=>{function e(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const m=t.useMemo(()=>d===(null==r?void 0:r[r.length-1])||null,[r,d]),g=t.useMemo(()=>{var e;return null!=(e=null==r?void 0:r.findIndex(e=>e===d))?e:null},[r,d]),y=r&&r.length>0&&(i||0===i)&&!Number.isNaN(i)&&r[i]===d||!r,v=t.useMemo(()=>{const e=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:"undefined"!=typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var t;return null!=(t=null==r?void 0:r.map(t=>{const n="string"==typeof t;let r=0;if(n&&(r=parseInt(t,10)),gv(l)){const o=n?r:p?t*e.height:0;return p?"bottom"===l?e.height-o:-e.height+o:o}const o=n?r:p?t*e.width:0;return p?"right"===l?e.width-o:-e.width+o:o}))?t:[]},[r,p,c]),b=t.useMemo(()=>null!==g?null==v?void 0:v[g]:null,[v,g]),w=t.useCallback(e=>{var t;const n=null!=(t=null==v?void 0:v.findIndex(t=>t===e))?t:null;s(n),mv(o.current,{transition:`transform ${bv.DURATION}s cubic-bezier(${bv.EASE.join(",")})`,transform:gv(l)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&n!==v.length-1&&void 0!==i&&n!==i&&n<i?mv(a.current,{transition:`opacity ${bv.DURATION}s cubic-bezier(${bv.EASE.join(",")})`,opacity:"0"}):mv(a.current,{transition:`opacity ${bv.DURATION}s cubic-bezier(${bv.EASE.join(",")})`,opacity:"1"}),f(null==r?void 0:r[Math.max(n,0)])},[o.current,r,v,i,a,f]);return t.useEffect(()=>{if(d||e){var t;const n=null!=(t=null==r?void 0:r.findIndex(t=>t===e||t===d))?t:-1;v&&-1!==n&&"number"==typeof v[n]&&w(v[n])}},[d,e,r,v,w]),{isLastSnapPoint:m,activeSnapPoint:d,shouldFade:y,getPercentageDragged:function(e,t){if(!r||"number"!=typeof g||!v||void 0===i)return null;const n=g===i-1;if(g>=i&&t)return 0;if(n&&!t)return 1;if(!y&&!n)return null;const o=n?g+1:g-1,a=n?v[o]-v[o-1]:v[o+1]-v[o],s=e/Math.abs(a);return n?1-s:s},setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:n,dismissible:o}){if(void 0===i)return;const s="bottom"===l||"right"===l?(null!=b?b:0)-e:(null!=b?b:0)+e,c=0===g,d=e>0;if(g===i-1&&mv(a.current,{transition:`opacity ${bv.DURATION}s cubic-bezier(${bv.EASE.join(",")})`}),!u&&n>2&&!d)return void(o?t():w(v[0]));if(!u&&n>2&&d&&v&&r)return void w(v[r.length-1]);const f=null==v?void 0:v.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-s)<Math.abs(e-s)?t:e),p=gv(l)?window.innerHeight:window.innerWidth;if(n>.4&&Math.abs(e)<.4*p){const e=d?1:-1;if(e>0&&m&&r)return void w(v[r.length-1]);if(c&&e<0&&o&&t(),null===g)return;return void w(v[g+e])}w(f)},onDrag:function({draggedDistance:e}){if(null===b)return;const t="bottom"===l||"right"===l?b-e:b+e;("bottom"===l||"right"===l)&&t<v[v.length-1]||("top"===l||"left"===l)&&t>v[v.length-1]||mv(o.current,{transform:gv(l)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:v}}({snapPoints:i,activeSnapPointProp:h,setActiveSnapPointProp:m,drawerRef:G,fadeFromIndex:p,overlayRef:F,onSnapPointChange:te,direction:x,container:M,snapToSequentialPoint:_});cv({isDisabled:!R||I||!y||L||!D||!k||!E});const{restorePositionSetting:ue}=function({isOpen:e,modal:n,nested:r,hasBeenOpened:o,preventScrollRestoration:a,noBodyStyles:i}){const[s,l]=t.useState(()=>"undefined"!=typeof window?window.location.href:""),c=t.useRef(0),u=t.useCallback(()=>{if(Gy()&&null===_v&&e&&!i){_v={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:-c.current+"px",left:-e+"px",right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const e=t-window.innerHeight;e&&c.current>=t&&(document.body.style.top=-(c.current+e)+"px")}),300)}},[e]),d=t.useCallback(()=>{if(Gy()&&null!==_v&&!i){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,_v),window.requestAnimationFrame(()=>{a&&s!==window.location.href?l(window.location.href):window.scrollTo(t,e)}),_v=null}},[s]);return t.useEffect(()=>{function e(){c.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),t.useEffect(()=>{if(n)return()=>{"undefined"!=typeof document&&(document.querySelector("[data-vaul-drawer]")||d())}},[n,d]),t.useEffect(()=>{!r&&o&&(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),n||window.setTimeout(()=>{d()},500)):d())},[e,o,s,n,r,u,d]),{restorePositionSetting:d}}({isOpen:R,modal:y,nested:null!=b&&b,hasBeenOpened:D,preventScrollRestoration:C,noBodyStyles:w});function de(){return(window.innerWidth-26)/window.innerWidth}function fe(e,t){var n;let r=e;const o=null==(n=window.getSelection())?void 0:n.toString(),a=G.current?yv(G.current,x):null,i=new Date;if("SELECT"===r.tagName)return!1;if(r.hasAttribute("data-vaul-no-drag")||r.closest("[data-vaul-no-drag]"))return!1;if("right"===x||"left"===x)return!0;if(H.current&&i.getTime()-H.current.getTime()<500)return!1;if(null!==a&&("bottom"===x?a>0:a<0))return!0;if(o&&o.length>0)return!1;if(j.current&&i.getTime()-j.current.getTime()<u&&0===a)return j.current=i,!1;if(t)return j.current=i,!1;for(;r;){if(r.scrollHeight>r.clientHeight){if(0!==r.scrollTop)return j.current=new Date,!1;if("dialog"===r.getAttribute("role"))return!0}r=r.parentNode}return!0}function pe(e){!function(){if(!I||!G.current)return;G.current.classList.remove(xv),Y.current=!1,z(!1),V.current=new Date}(),null==v||v(),e||T(!1),setTimeout(()=>{i&&oe(i[0])},1e3*bv.DURATION)}function he(){if(!G.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=yv(G.current,x);mv(G.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${bv.DURATION}s cubic-bezier(${bv.EASE.join(",")})`}),mv(F.current,{transition:`opacity ${bv.DURATION}s cubic-bezier(${bv.EASE.join(",")})`,opacity:"1"}),s&&t&&t>0&&R&&mv(e,{borderRadius:"8px",overflow:"hidden",...gv(x)?{transform:`scale(${de()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${de()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${bv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${bv.EASE.join(",")})`},!0)}return t.useEffect(()=>{window.requestAnimationFrame(()=>{q.current=!0})},[]),t.useEffect(()=>{var e;function t(){if(!G.current||!k)return;if(fv(document.activeElement)||U.current){var e;const t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight;let r=n-t;const o=G.current.getBoundingClientRect().height||0,a=o>.8*n;ee.current||(ee.current=o);const s=G.current.getBoundingClientRect().top;if(Math.abs(Z.current-r)>60&&(U.current=!U.current),i&&i.length>0&&ie&&re){r+=ie[re]||0}if(Z.current=r,o>t||U.current){const e=G.current.getBoundingClientRect().height;let n=e;e>t&&(n=t-(a?s:26)),G.current.style.height=g?e-Math.max(r,0)+"px":`${Math.max(n,t-s)}px`}else(function(){const e=navigator.userAgent;return"undefined"!=typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))})()||(G.current.style.height=`${ee.current}px`);i&&i.length>0&&!U.current?G.current.style.bottom="0px":G.current.style.bottom=`${Math.max(r,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[re,i,ie]),t.useEffect(()=>(R&&(mv(document.documentElement,{scrollBehavior:"auto"}),H.current=new Date),()=>{!function(e,t){if(!(e&&e instanceof HTMLElement))return;let n=hv.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[R]),t.useEffect(()=>{y||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[y]),t.createElement(op,{defaultOpen:S,onOpenChange:e=>{(d||e)&&(e?$(!0):pe(!0),T(e))},open:R},t.createElement(qy.Provider,{value:{activeSnapPoint:ne,snapPoints:i,setActiveSnapPoint:oe,drawerRef:G,overlayRef:F,onOpenChange:n,onPress:function(e){var t,n;(d||i)&&(G.current&&!G.current.contains(e.target)||(Q.current=(null==(t=G.current)?void 0:t.getBoundingClientRect().height)||0,J.current=(null==(n=G.current)?void 0:n.getBoundingClientRect().width)||0,z(!0),W.current=new Date,Jy()&&window.addEventListener("touchend",()=>Y.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),K.current=gv(x)?e.pageY:e.pageX))},onRelease:function(e){if(!I||!G.current)return;G.current.classList.remove(xv),Y.current=!1,z(!1),V.current=new Date;const t=yv(G.current,x);if(!e||!fe(e.target,!1)||!t||Number.isNaN(t))return;if(null===W.current)return;const n=V.current.getTime()-W.current.getTime(),r=K.current-(gv(x)?e.pageY:e.pageX),o=Math.abs(r)/n;if(o>.05&&(B(!0),setTimeout(()=>{B(!1)},200)),i){return ae({draggedDistance:r*("bottom"===x||"right"===x?1:-1),closeDrawer:pe,velocity:o,dismissible:d}),void(null==a||a(e,!0))}if("bottom"===x||"right"===x?r>0:r<0)return he(),void(null==a||a(e,!0));if(o>.4)return pe(),void(null==a||a(e,!1));var s;const l=Math.min(null!=(s=G.current.getBoundingClientRect().height)?s:0,window.innerHeight);var u;const f=Math.min(null!=(u=G.current.getBoundingClientRect().width)?u:0,window.innerWidth),p="left"===x||"right"===x;if(Math.abs(t)>=(p?f:l)*c)return pe(),void(null==a||a(e,!1));null==a||a(e,!0),he()},onDrag:function(e){var t;if(G.current&&I){const n="bottom"===x||"right"===x?1:-1,r=(K.current-(gv(x)?e.pageY:e.pageX))*n,a=r>0,l=i&&!d&&!a;if(l&&0===re)return;const c=Math.abs(r),u=document.querySelector("[data-vaul-drawer-wrapper]");let f=c/("bottom"===x||"top"===x?Q.current:J.current);const h=ce(c,a);if(null!==h&&(f=h),l&&f>=1)return;if(!Y.current&&!fe(e.target,a))return;if(G.current.classList.add(xv),Y.current=!0,mv(G.current,{transition:"none"}),mv(F.current,{transition:"none"}),i&&se({draggedDistance:r}),a&&!i){const e=(t=r,8*(Math.log(t+1)-2)),o=Math.min(-1*e,0)*n;return void mv(G.current,{transform:gv(x)?`translate3d(0, ${o}px, 0)`:`translate3d(${o}px, 0, 0)`})}const m=1-f;if((le||p&&re===p-1)&&(null==o||o(e,f),mv(F.current,{opacity:`${m}`,transition:"none"},!0)),u&&F.current&&s){const e=Math.min(de()+f*(1-de()),1),t=8-8*f,n=Math.max(0,14-14*f);mv(u,{borderRadius:`${t}px`,transform:gv(x)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!i){const e=c*n;mv(G.current,{transform:gv(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:d,shouldAnimate:q,handleOnly:f,isOpen:R,isDragging:I,shouldFade:le,closeDrawer:pe,onNestedDrag:function(e,t){if(t<0)return;const n=(window.innerWidth-wv)/window.innerWidth,r=n+t*(1-n),o=t*wv-16;mv(G.current,{transform:gv(x)?`scale(${r}) translate3d(0, ${o}px, 0)`:`scale(${r}) translate3d(${o}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){const t=e?(window.innerWidth-wv)/window.innerWidth:1,n=e?-16:0;X.current&&window.clearTimeout(X.current),mv(G.current,{transition:`transform ${bv.DURATION}s cubic-bezier(${bv.EASE.join(",")})`,transform:gv(x)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&G.current&&(X.current=setTimeout(()=>{const e=yv(G.current,x);mv(G.current,{transition:"none",transform:gv(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){const n=gv(x)?window.innerHeight:window.innerWidth,r=t?(n-wv)/n:1,o=t?-16:0;t&&mv(G.current,{transition:`transform ${bv.DURATION}s cubic-bezier(${bv.EASE.join(",")})`,transform:gv(x)?`scale(${r}) translate3d(0, ${o}px, 0)`:`scale(${r}) translate3d(${o}px, 0, 0)`})},keyboardIsOpen:U,modal:y,snapPointsOffset:ie,activeSnapPointIndex:re,direction:x,shouldScaleBackground:s,setBackgroundColorOnScale:l,noBodyStyles:w,container:M,autoFocus:P}},r))}const kv=t.forwardRef(function({...e},n){const{overlayRef:r,snapPoints:o,onRelease:a,shouldFade:i,isOpen:s,modal:l,shouldAnimate:c}=Zy(),u=pv(n,r),d=o&&o.length>0;if(!l)return null;const f=t.useCallback(e=>a(e),[a]);return t.createElement(sp,{onMouseUp:f,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":s&&d?"true":"false","data-vaul-snap-points-overlay":s&&i?"true":"false","data-vaul-animate":(null==c?void 0:c.current)?"true":"false",...e})});kv.displayName="Drawer.Overlay";const Nv=t.forwardRef(function({onPointerDownOutside:e,style:n,onOpenAutoFocus:r,...a},i){const{drawerRef:s,onPress:l,onRelease:c,onDrag:u,keyboardIsOpen:d,snapPointsOffset:f,activeSnapPointIndex:p,modal:h,isOpen:m,direction:g,snapPoints:y,container:v,handleOnly:b,shouldAnimate:w,autoFocus:x}=Zy(),[S,E]=t.useState(!1),_=pv(i,s),C=t.useRef(null),k=t.useRef(null),N=t.useRef(!1),M=y&&y.length>0;!function(){const{direction:e,isOpen:n,shouldScaleBackground:r,setBackgroundColorOnScale:a,noBodyStyles:i}=Zy(),s=t.useRef(null),l=o(()=>document.body.style.backgroundColor,[]);function c(){return(window.innerWidth-26)/window.innerWidth}t.useEffect(()=>{if(n&&r){s.current&&clearTimeout(s.current);const t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;a&&!i&&vv(document.body,{background:"black"}),vv(t,{transformOrigin:gv(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${bv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${bv.EASE.join(",")})`});const n=vv(t,{borderRadius:"8px",overflow:"hidden",...gv(e)?{transform:`scale(${c()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${c()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),s.current=window.setTimeout(()=>{l?document.body.style.background=l:document.body.style.removeProperty("background")},1e3*bv.DURATION)}}},[n,r,l])}();function P(e){C.current=null,N.current=!1,c(e)}return t.useEffect(()=>{M&&window.requestAnimationFrame(()=>{E(!0)})},[]),t.createElement(lp,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":S?"true":"false","data-vaul-snap-points":m&&M?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":(null==w?void 0:w.current)?"true":"false",...a,ref:_,style:f&&f.length>0?{"--snap-point-height":`${f[null!=p?p:0]}px`,...n}:n,onPointerDown:e=>{b||(null==a.onPointerDown||a.onPointerDown.call(a,e),C.current={x:e.pageX,y:e.pageY},l(e))},onOpenAutoFocus:e=>{null==r||r(e),x||e.preventDefault()},onPointerDownOutside:t=>{null==e||e(t),h&&!t.defaultPrevented?d.current&&(d.current=!1):t.preventDefault()},onFocusOutside:e=>{h||e.preventDefault()},onPointerMove:e=>{if(k.current=e,b)return;if(null==a.onPointerMove||a.onPointerMove.call(a,e),!C.current)return;const t=e.pageY-C.current.y,n=e.pageX-C.current.x,r="touch"===e.pointerType?10:2,o=((e,t,n=0)=>{if(N.current)return!0;const r=Math.abs(e.y),o=Math.abs(e.x),a=o>r,i=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*i<0)&&o>=0&&o<=n)return a}else if(!(e.y*i<0)&&r>=0&&r<=n)return!a;return N.current=!0,!0})({x:n,y:t},g,r);o?u(e):(Math.abs(n)>r||Math.abs(t)>r)&&(C.current=null)},onPointerUp:e=>{null==a.onPointerUp||a.onPointerUp.call(a,e),C.current=null,N.current=!1,c(e)},onPointerOut:e=>{null==a.onPointerOut||a.onPointerOut.call(a,e),P(k.current)},onContextMenu:e=>{null==a.onContextMenu||a.onContextMenu.call(a,e),k.current&&P(k.current)}})});Nv.displayName="Drawer.Content";const Mv=t.forwardRef(function({preventCycle:e=!1,children:n,...r},o){const{closeDrawer:a,isDragging:i,snapPoints:s,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:u,handleOnly:d,isOpen:f,onPress:p,onDrag:h}=Zy(),m=t.useRef(null),g=t.useRef(!1);function y(){m.current&&window.clearTimeout(m.current),g.current=!1}return t.createElement("div",{onClick:function(){g.current?y():window.setTimeout(()=>{!function(){if(i||e||g.current)return void y();if(y(),!s||0===s.length)return void(u||a());if(l===s[s.length-1]&&u)return void a();const t=s.findIndex(e=>e===l);if(-1===t)return;const n=s[t+1];c(n)}()},120)},onPointerCancel:y,onPointerDown:e=>{d&&p(e),m.current=window.setTimeout(()=>{g.current=!0},250)},onPointerMove:e=>{d&&h(e)},ref:o,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},t.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},n))});Mv.displayName="Drawer.Handle";const Pv={Root:Cv,NestedRoot:function({onDrag:e,onOpenChange:n,open:r,...o}){const{onNestedDrag:a,onNestedOpenChange:i,onNestedRelease:s}=Zy();if(!a)throw new Error("Drawer.NestedRoot must be placed in another drawer");return t.createElement(Cv,{nested:!0,open:r,onClose:()=>{i(!1)},onDrag:(t,n)=>{a(t,n),null==e||e(t,n)},onOpenChange:e=>{e&&i(e),null==n||n(e)},onRelease:s,...o})},Content:Nv,Overlay:kv,Trigger:ap,Portal:function(e){const n=Zy(),{container:r=n.container,...o}=e;return t.createElement(ip,{container:r,...o})},Handle:Mv,Close:dp,Title:cp,Description:up},Ov=({shouldScaleBackground:t=!0,...n})=>e.createElement(Pv.Root,{shouldScaleBackground:t,...n});Ov.displayName="Drawer";const Av=Pv.Portal,Rv=e.forwardRef(({className:t,...n},r)=>e.createElement(Pv.Overlay,{ref:r,style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"rgba(0, 0, 0, 0.8)"},className:t,...n}));Rv.displayName=Pv.Overlay.displayName;const Tv=e.forwardRef(({className:t,children:n,...r},o)=>e.createElement(Av,null,e.createElement(Rv,null),e.createElement(Pv.Content,{ref:o,style:{position:"fixed",left:0,right:0,top:0,zIndex:50,marginTop:"96px",display:"flex",height:"auto",flexDirection:"column",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",border:"1px solid hsl(var(--border))",backgroundColor:"hsl(var(--background))"},className:t,...r},e.createElement("div",{style:{margin:"16px auto 0",height:"8px",width:"100px",borderRadius:"9999px",backgroundColor:"hsl(var(--muted))"}}),n)));Tv.displayName="DrawerContent";e.forwardRef(({className:t,...n},r)=>e.createElement(Pv.Title,{ref:r,style:{fontSize:"18px",fontWeight:600,lineHeight:1,letterSpacing:"-0.025em"},className:t,...n})).displayName=Pv.Title.displayName;e.forwardRef(({className:t,...n},r)=>e.createElement(Pv.Description,{ref:r,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:t,...n})).displayName=Pv.Description.displayName;const Dv=n(void 0),$v=({children:e,theme:n=Is})=>{const[r,o]=t.useState(n),a=t.useMemo(()=>({theme:r,setTheme:o}),[r]);return t.createElement(Dv.Provider,{value:a},t.createElement(wc,{theme:r},e))},Iv=()=>{const e=c(Dv);if(void 0===e)throw new Error("useTheme must be used within a ThemeProvider");return e},zv=()=>{const{theme:e}=Iv();return e},Lv=()=>t.createElement(Nc,{styles:Mc`
505
- * {
506
- box-sizing: border-box;
507
- border-color: #e5e7eb;
508
- }
509
-
510
- html,
511
- body {
512
- margin: 0;
513
- padding: 0;
514
- background-color: #ffffff;
515
- color: #1f2937;
516
- font-family:
517
- ui-sans-serif,
518
- system-ui,
519
- -apple-system,
520
- BlinkMacSystemFont,
521
- "Segoe UI",
522
- Roboto,
523
- "Helvetica Neue",
524
- Arial,
525
- "Noto Sans",
526
- sans-serif;
527
- line-height: 1.5;
528
- -webkit-font-smoothing: antialiased;
529
- -moz-osx-font-smoothing: grayscale;
530
- transition:
531
- background-color 0.2s ease-in-out,
532
- color 0.2s ease-in-out;
533
- }
534
-
535
- /* Dark theme styles */
536
- html.dark,
537
- html.dark body {
538
- background-color: #0f172a;
539
- color: #f1f5f9;
540
- }
541
-
542
- /* ReactFlow overrides */
543
- .react-flow__edge {
544
- cursor: default !important;
545
- }
546
-
547
- .react-flow__edge-path {
548
- cursor: default !important;
549
- }
550
-
551
- .react-flow__edge-label {
552
- font-size: 10px;
553
- background: white;
554
- padding: 2px 4px;
555
- border-radius: 4px;
556
- border: 1px solid #e5e7eb;
557
- max-width: 150px;
558
- overflow: hidden;
559
- text-overflow: ellipsis;
560
- white-space: nowrap;
561
- }
562
-
563
- /* Dark theme ReactFlow overrides */
564
- html.dark .react-flow__edge-label {
565
- background: #1e293b;
566
- border: 1px solid #475569;
567
- color: #f1f5f9;
568
- }
569
-
570
- /* Radix UI Select styles */
571
- [data-radix-select-trigger],
572
- .shadcn-select {
573
- display: flex;
574
- height: 2.5rem;
575
- width: 100%;
576
- align-items: center;
577
- justify-content: space-between;
578
- border-radius: 0.375rem;
579
- border: 1px solid #e5e7eb;
580
- background-color: #ffffff;
581
- padding: 0.5rem 0.75rem;
582
- font-size: 0.875rem;
583
- line-height: 1.25rem;
584
- outline: none;
585
- transition: all 0.2s ease-in-out;
586
- }
587
-
588
- /* Dark theme select styles */
589
- html.dark [data-radix-select-trigger],
590
- html.dark .shadcn-select {
591
- border: 1px solid #475569;
592
- background-color: #1e293b;
593
- color: #f1f5f9;
594
- }
595
-
596
- [data-radix-select-trigger]:focus,
597
- .shadcn-select:focus {
598
- outline: none;
599
- box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
600
- }
601
-
602
- [data-radix-select-trigger]:disabled,
603
- .shadcn-select:disabled {
604
- cursor: not-allowed;
605
- opacity: 0.5;
606
- }
607
-
608
- /* File selector refresh button styles */
609
- .file-selector-refresh-btn {
610
- padding: 0.5rem;
611
- border-radius: 0.375rem;
612
- border: 1px solid #e5e7eb;
613
- background-color: #ffffff;
614
- transition: all 0.2s ease-in-out;
615
- }
616
-
617
- .file-selector-refresh-btn:hover {
618
- background-color: #f3f4f6;
619
- color: #374151;
620
- }
621
-
622
- .file-selector-refresh-btn:disabled {
623
- opacity: 0.5;
624
- cursor: not-allowed;
625
- }
626
-
627
- /* Dark theme file selector refresh button */
628
- html.dark .file-selector-refresh-btn {
629
- border: 1px solid #475569;
630
- background-color: #1e293b;
631
- color: #f1f5f9;
632
- }
633
-
634
- html.dark .file-selector-refresh-btn:hover {
635
- background-color: #334155;
636
- color: #f1f5f9;
637
- }
638
-
639
- /* CSS Variables for backward compatibility */
640
- :root {
641
- --background: #ffffff;
642
- --foreground: #1f2937;
643
- --card: #ffffff;
644
- --card-foreground: #1f2937;
645
- --popover: #ffffff;
646
- --popover-foreground: #1f2937;
647
- --primary: #6366f1;
648
- --primary-foreground: #ffffff;
649
- --secondary: #f3f4f6;
650
- --secondary-foreground: #1f2937;
651
- --muted: #f3f4f6;
652
- --muted-foreground: #6b7280;
653
- --accent: #f3f4f6;
654
- --accent-foreground: #1f2937;
655
- --destructive: #ef4444;
656
- --destructive-foreground: #ffffff;
657
- --border: #e5e7eb;
658
- --input: #e5e7eb;
659
- --ring: #6366f1;
660
- --radius: 0.5rem;
661
- }
662
-
663
- /* Dark theme CSS variables */
664
- html.dark {
665
- --background: #0f172a;
666
- --foreground: #f1f5f9;
667
- --card: #1e293b;
668
- --card-foreground: #f1f5f9;
669
- --popover: #1e293b;
670
- --popover-foreground: #f1f5f9;
671
- --primary: #6366f1;
672
- --primary-foreground: #ffffff;
673
- --secondary: #334155;
674
- --secondary-foreground: #f1f5f9;
675
- --muted: #334155;
676
- --muted-foreground: #94a3b8;
677
- --accent: #334155;
678
- --accent-foreground: #f1f5f9;
679
- --destructive: #ef4444;
680
- --destructive-foreground: #ffffff;
681
- --border: #475569;
682
- --input: #475569;
683
- --ring: #6366f1;
684
- --radius: 0.5rem;
685
- }
686
- `});export{wp as AgenticFlowVisualizer,fu as AnthropicIcon,Xc as Badge,Uy as Checkbox,Ov as Drawer,Ls as Edge,My as FileSelector,Lv as GlobalStyles,pu as GoogleIcon,uu as JsonTreeViewer,mu as Node,du as OpenAIIcon,ty as Select,fp as Sheet,$v as ThemeProvider,Bu as Timeline,xp as Visualizer,vp as calculateAutoLayout,zc as cn,Wc as conditionalStyle,$s as darkTheme,Is as defaultTheme,Bc as formatCurrency,Fc as formatLatency,jc as getColor,Vc as getSpacing,Ds as lightTheme,Lc as toTitleCase,Hc as truncateText,Iv as useTheme,zv as useThemeValue};
553
+ `,Ry=e.forwardRef(({className:t,...n},r)=>e.createElement(Oy,{ref:r,...n},e.createElement(Ay,null,e.createElement(Py,null))));Ry.displayName=xy.displayName;const Ty=t.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),Dy=()=>{const e=t.useContext(Ty);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};function $y(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function Iy(){return Ly(/^iPad/)||Ly(/^Mac/)&&navigator.maxTouchPoints>1}function zy(){return Ly(/^iPhone/)||Iy()}function Ly(e){return"undefined"!=typeof window&&null!=window.navigator?e.test(window.navigator.platform):void 0}!function(e){if(!e||"undefined"==typeof document)return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}("[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(\n[data-state=closed]\n){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}");const By="undefined"!=typeof window?f:a;function Fy(...e){return(...t)=>{for(let n of e)"function"==typeof n&&n(...t)}}const Hy="undefined"!=typeof document&&window.visualViewport;function Wy(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function Vy(e){for(Wy(e)&&(e=e.parentElement);e&&!Wy(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const Yy=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let jy,Xy=0;function Ky(e={}){let{isDisabled:t}=e;By(()=>{if(!t)return Xy++,1===Xy&&zy()&&(jy=function(){let e,t=0,n=n=>{e=Vy(n.target),e===document.documentElement&&e===document.body||(t=n.changedTouches[0].pageY)},r=n=>{if(!e||e===document.documentElement||e===document.body)return void n.preventDefault();let r=n.changedTouches[0].pageY,o=e.scrollTop,i=e.scrollHeight-e.clientHeight;0!==i&&((o<=0&&r>t||o>=i&&r<t)&&n.preventDefault(),t=r)},o=e=>{let t=e.target;Zy(t)&&t!==document.activeElement&&(e.preventDefault(),t.style.transform="translateY(-2000px)",t.focus(),requestAnimationFrame(()=>{t.style.transform=""}))},i=e=>{let t=e.target;Zy(t)&&(t.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{t.style.transform="",Hy&&(Hy.height<window.innerHeight?requestAnimationFrame(()=>{qy(t)}):Hy.addEventListener("resize",()=>qy(t),{once:!0}))}))},a=()=>{window.scrollTo(0,0)},s=window.pageXOffset,l=window.pageYOffset,c=Fy(function(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}(document.documentElement,"paddingRight",window.innerWidth-document.documentElement.clientWidth+"px"));window.scrollTo(0,0);let u=Fy(Uy(document,"touchstart",n,{passive:!1,capture:!0}),Uy(document,"touchmove",r,{passive:!1,capture:!0}),Uy(document,"touchend",o,{passive:!1,capture:!0}),Uy(document,"focus",i,!0),Uy(window,"scroll",a));return()=>{c(),u(),window.scrollTo(s,l)}}()),()=>{Xy--,0===Xy&&(null==jy||jy())}},[t])}function Uy(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function qy(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let t=Vy(e);if(t!==document.documentElement&&t!==document.body&&t!==e){let n=t.getBoundingClientRect().top,r=e.getBoundingClientRect().top;e.getBoundingClientRect().bottom>t.getBoundingClientRect().bottom+24&&(t.scrollTop+=r-n)}e=t.parentElement}}function Zy(e){return e instanceof HTMLInputElement&&!Yy.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function Gy(...t){return e.useCallback(function(...e){return t=>e.forEach(e=>function(e,t){"function"==typeof e?e(t):null!=e&&(e.current=t)}(e,t))}(...t),t)}const Qy=new WeakMap;function Jy(e,t,n=!1){if(!(e&&e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([t,n])=>{t.startsWith("--")?e.style.setProperty(t,n):(r[t]=e.style[t],e.style[t]=n)}),n||Qy.set(e,r)}const ev=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function tv(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[ev(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[ev(t)?5:4]):null)}function nv(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}const rv={DURATION:.5,EASE:[.32,.72,0,1]},ov=16,iv="vaul-dragging";function av(e){const n=t.useRef(e);return t.useEffect(()=>{n.current=e}),t.useMemo(()=>(...e)=>null==n.current?void 0:n.current.call(n,...e),[])}function sv({prop:e,defaultProp:n,onChange:r=()=>{}}){const[o,i]=function({defaultProp:e,onChange:n}){const r=t.useState(e),[o]=r,i=t.useRef(o),a=av(n);return t.useEffect(()=>{i.current!==o&&(a(o),i.current=o)},[o,i,a]),r}({defaultProp:n,onChange:r}),a=void 0!==e,s=a?e:o,l=av(r),c=t.useCallback(t=>{if(a){const n="function"==typeof t?t(e):t;n!==e&&l(n)}else i(t)},[a,e,i,l]);return[s,c]}let lv=null;function cv({open:e,onOpenChange:n,children:r,onDrag:o,onRelease:i,snapPoints:a,shouldScaleBackground:s=!1,setBackgroundColorOnScale:l=!0,closeThreshold:c=.25,scrollLockTimeout:u=100,dismissible:d=!0,handleOnly:f=!1,fadeFromIndex:p=a&&a.length-1,activeSnapPoint:h,setActiveSnapPoint:m,fixed:g,modal:y=!0,onClose:v,nested:b,noBodyStyles:w=!1,direction:x="bottom",defaultOpen:E=!1,disablePreventScroll:S=!0,snapToSequentialPoint:_=!1,preventScrollRestoration:C=!1,repositionInputs:k=!0,onAnimationEnd:N,container:M,autoFocus:O=!1}){var A,P;const[R=!1,T]=sv({defaultProp:E,prop:e,onChange:e=>{null==n||n(e),e||b||ue(),setTimeout(()=>{null==N||N(e)},1e3*rv.DURATION),e&&!y&&"undefined"!=typeof window&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),e||(document.body.style.pointerEvents="auto")}}),[D,$]=t.useState(!1),[I,z]=t.useState(!1),[L,B]=t.useState(!1),F=t.useRef(null),H=t.useRef(null),W=t.useRef(null),V=t.useRef(null),Y=t.useRef(null),j=t.useRef(!1),X=t.useRef(null),K=t.useRef(0),U=t.useRef(!1),q=t.useRef(!E),Z=t.useRef(0),G=t.useRef(null),Q=t.useRef((null==(A=G.current)?void 0:A.getBoundingClientRect().height)||0),J=t.useRef((null==(P=G.current)?void 0:P.getBoundingClientRect().width)||0),ee=t.useRef(0),te=t.useCallback(e=>{a&&e===ae.length-1&&(H.current=new Date)},[]),{activeSnapPoint:ne,activeSnapPointIndex:re,setActiveSnapPoint:oe,onRelease:ie,snapPointsOffset:ae,onDrag:se,shouldFade:le,getPercentageDragged:ce}=function({activeSnapPointProp:e,setActiveSnapPointProp:n,snapPoints:r,drawerRef:o,overlayRef:i,fadeFromIndex:a,onSnapPointChange:s,direction:l="bottom",container:c,snapToSequentialPoint:u}){const[d,f]=sv({prop:e,defaultProp:null==r?void 0:r[0],onChange:n}),[p,h]=t.useState("undefined"!=typeof window?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);t.useEffect(()=>{function e(){h({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const m=t.useMemo(()=>d===(null==r?void 0:r[r.length-1])||null,[r,d]),g=t.useMemo(()=>{var e;return null!=(e=null==r?void 0:r.findIndex(e=>e===d))?e:null},[r,d]),y=r&&r.length>0&&(a||0===a)&&!Number.isNaN(a)&&r[a]===d||!r,v=t.useMemo(()=>{const e=c?{width:c.getBoundingClientRect().width,height:c.getBoundingClientRect().height}:"undefined"!=typeof window?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var t;return null!=(t=null==r?void 0:r.map(t=>{const n="string"==typeof t;let r=0;if(n&&(r=parseInt(t,10)),ev(l)){const o=n?r:p?t*e.height:0;return p?"bottom"===l?e.height-o:-e.height+o:o}const o=n?r:p?t*e.width:0;return p?"right"===l?e.width-o:-e.width+o:o}))?t:[]},[r,p,c]),b=t.useMemo(()=>null!==g?null==v?void 0:v[g]:null,[v,g]),w=t.useCallback(e=>{var t;const n=null!=(t=null==v?void 0:v.findIndex(t=>t===e))?t:null;s(n),Jy(o.current,{transition:`transform ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`,transform:ev(l)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`}),v&&n!==v.length-1&&void 0!==a&&n!==a&&n<a?Jy(i.current,{transition:`opacity ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`,opacity:"0"}):Jy(i.current,{transition:`opacity ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`,opacity:"1"}),f(null==r?void 0:r[Math.max(n,0)])},[o.current,r,v,a,i,f]);return t.useEffect(()=>{if(d||e){var t;const n=null!=(t=null==r?void 0:r.findIndex(t=>t===e||t===d))?t:-1;v&&-1!==n&&"number"==typeof v[n]&&w(v[n])}},[d,e,r,v,w]),{isLastSnapPoint:m,activeSnapPoint:d,shouldFade:y,getPercentageDragged:function(e,t){if(!r||"number"!=typeof g||!v||void 0===a)return null;const n=g===a-1;if(g>=a&&t)return 0;if(n&&!t)return 1;if(!y&&!n)return null;const o=n?g+1:g-1,i=n?v[o]-v[o-1]:v[o+1]-v[o],s=e/Math.abs(i);return n?1-s:s},setActiveSnapPoint:f,activeSnapPointIndex:g,onRelease:function({draggedDistance:e,closeDrawer:t,velocity:n,dismissible:o}){if(void 0===a)return;const s="bottom"===l||"right"===l?(null!=b?b:0)-e:(null!=b?b:0)+e,c=0===g,d=e>0;if(g===a-1&&Jy(i.current,{transition:`opacity ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`}),!u&&n>2&&!d)return void(o?t():w(v[0]));if(!u&&n>2&&d&&v&&r)return void w(v[r.length-1]);const f=null==v?void 0:v.reduce((e,t)=>"number"!=typeof e||"number"!=typeof t?e:Math.abs(t-s)<Math.abs(e-s)?t:e),p=ev(l)?window.innerHeight:window.innerWidth;if(n>.4&&Math.abs(e)<.4*p){const e=d?1:-1;if(e>0&&m&&r)return void w(v[r.length-1]);if(c&&e<0&&o&&t(),null===g)return;return void w(v[g+e])}w(f)},onDrag:function({draggedDistance:e}){if(null===b)return;const t="bottom"===l||"right"===l?b-e:b+e;("bottom"===l||"right"===l)&&t<v[v.length-1]||("top"===l||"left"===l)&&t>v[v.length-1]||Jy(o.current,{transform:ev(l)?`translate3d(0, ${t}px, 0)`:`translate3d(${t}px, 0, 0)`})},snapPointsOffset:v}}({snapPoints:a,activeSnapPointProp:h,setActiveSnapPointProp:m,drawerRef:G,fadeFromIndex:p,overlayRef:F,onSnapPointChange:te,direction:x,container:M,snapToSequentialPoint:_});Ky({isDisabled:!R||I||!y||L||!D||!k||!S});const{restorePositionSetting:ue}=function({isOpen:e,modal:n,nested:r,hasBeenOpened:o,preventScrollRestoration:i,noBodyStyles:a}){const[s,l]=t.useState(()=>"undefined"!=typeof window?window.location.href:""),c=t.useRef(0),u=t.useCallback(()=>{if($y()&&null===lv&&e&&!a){lv={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:e,innerHeight:t}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:-c.current+"px",left:-e+"px",right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const e=t-window.innerHeight;e&&c.current>=t&&(document.body.style.top=-(c.current+e)+"px")}),300)}},[e]),d=t.useCallback(()=>{if($y()&&null!==lv&&!a){const e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);Object.assign(document.body.style,lv),window.requestAnimationFrame(()=>{i&&s!==window.location.href?l(window.location.href):window.scrollTo(t,e)}),lv=null}},[s]);return t.useEffect(()=>{function e(){c.current=window.scrollY}return e(),window.addEventListener("scroll",e),()=>{window.removeEventListener("scroll",e)}},[]),t.useEffect(()=>{if(n)return()=>{"undefined"!=typeof document&&(document.querySelector("[data-vaul-drawer]")||d())}},[n,d]),t.useEffect(()=>{!r&&o&&(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),n||window.setTimeout(()=>{d()},500)):d())},[e,o,s,n,r,u,d]),{restorePositionSetting:d}}({isOpen:R,modal:y,nested:null!=b&&b,hasBeenOpened:D,preventScrollRestoration:C,noBodyStyles:w});function de(){return(window.innerWidth-26)/window.innerWidth}function fe(e,t){var n;let r=e;const o=null==(n=window.getSelection())?void 0:n.toString(),i=G.current?tv(G.current,x):null,a=new Date;if("SELECT"===r.tagName)return!1;if(r.hasAttribute("data-vaul-no-drag")||r.closest("[data-vaul-no-drag]"))return!1;if("right"===x||"left"===x)return!0;if(H.current&&a.getTime()-H.current.getTime()<500)return!1;if(null!==i&&("bottom"===x?i>0:i<0))return!0;if(o&&o.length>0)return!1;if(Y.current&&a.getTime()-Y.current.getTime()<u&&0===i)return Y.current=a,!1;if(t)return Y.current=a,!1;for(;r;){if(r.scrollHeight>r.clientHeight){if(0!==r.scrollTop)return Y.current=new Date,!1;if("dialog"===r.getAttribute("role"))return!0}r=r.parentNode}return!0}function pe(e){!function(){if(!I||!G.current)return;G.current.classList.remove(iv),j.current=!1,z(!1),V.current=new Date}(),null==v||v(),e||T(!1),setTimeout(()=>{a&&oe(a[0])},1e3*rv.DURATION)}function he(){if(!G.current)return;const e=document.querySelector("[data-vaul-drawer-wrapper]"),t=tv(G.current,x);Jy(G.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`}),Jy(F.current,{transition:`opacity ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`,opacity:"1"}),s&&t&&t>0&&R&&Jy(e,{borderRadius:"8px",overflow:"hidden",...ev(x)?{transform:`scale(${de()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${de()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${rv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${rv.EASE.join(",")})`},!0)}return t.useEffect(()=>{window.requestAnimationFrame(()=>{q.current=!0})},[]),t.useEffect(()=>{var e;function t(){if(!G.current||!k)return;if(Zy(document.activeElement)||U.current){var e;const t=(null==(e=window.visualViewport)?void 0:e.height)||0,n=window.innerHeight;let r=n-t;const o=G.current.getBoundingClientRect().height||0,i=o>.8*n;ee.current||(ee.current=o);const s=G.current.getBoundingClientRect().top;if(Math.abs(Z.current-r)>60&&(U.current=!U.current),a&&a.length>0&&ae&&re){r+=ae[re]||0}if(Z.current=r,o>t||U.current){const e=G.current.getBoundingClientRect().height;let n=e;e>t&&(n=t-(i?s:26)),G.current.style.height=g?e-Math.max(r,0)+"px":`${Math.max(n,t-s)}px`}else(function(){const e=navigator.userAgent;return"undefined"!=typeof window&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))})()||(G.current.style.height=`${ee.current}px`);a&&a.length>0&&!U.current?G.current.style.bottom="0px":G.current.style.bottom=`${Math.max(r,0)}px`}}return null==(e=window.visualViewport)||e.addEventListener("resize",t),()=>{var e;return null==(e=window.visualViewport)?void 0:e.removeEventListener("resize",t)}},[re,a,ae]),t.useEffect(()=>(R&&(Jy(document.documentElement,{scrollBehavior:"auto"}),H.current=new Date),()=>{!function(e,t){if(!(e&&e instanceof HTMLElement))return;let n=Qy.get(e);n&&(e.style[t]=n[t])}(document.documentElement,"scrollBehavior")}),[R]),t.useEffect(()=>{y||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[y]),t.createElement(Wf,{defaultOpen:E,onOpenChange:e=>{(d||e)&&(e?$(!0):pe(!0),T(e))},open:R},t.createElement(Ty.Provider,{value:{activeSnapPoint:ne,snapPoints:a,setActiveSnapPoint:oe,drawerRef:G,overlayRef:F,onOpenChange:n,onPress:function(e){var t,n;(d||a)&&(G.current&&!G.current.contains(e.target)||(Q.current=(null==(t=G.current)?void 0:t.getBoundingClientRect().height)||0,J.current=(null==(n=G.current)?void 0:n.getBoundingClientRect().width)||0,z(!0),W.current=new Date,zy()&&window.addEventListener("touchend",()=>j.current=!1,{once:!0}),e.target.setPointerCapture(e.pointerId),K.current=ev(x)?e.pageY:e.pageX))},onRelease:function(e){if(!I||!G.current)return;G.current.classList.remove(iv),j.current=!1,z(!1),V.current=new Date;const t=tv(G.current,x);if(!e||!fe(e.target,!1)||!t||Number.isNaN(t))return;if(null===W.current)return;const n=V.current.getTime()-W.current.getTime(),r=K.current-(ev(x)?e.pageY:e.pageX),o=Math.abs(r)/n;if(o>.05&&(B(!0),setTimeout(()=>{B(!1)},200)),a){return ie({draggedDistance:r*("bottom"===x||"right"===x?1:-1),closeDrawer:pe,velocity:o,dismissible:d}),void(null==i||i(e,!0))}if("bottom"===x||"right"===x?r>0:r<0)return he(),void(null==i||i(e,!0));if(o>.4)return pe(),void(null==i||i(e,!1));var s;const l=Math.min(null!=(s=G.current.getBoundingClientRect().height)?s:0,window.innerHeight);var u;const f=Math.min(null!=(u=G.current.getBoundingClientRect().width)?u:0,window.innerWidth),p="left"===x||"right"===x;if(Math.abs(t)>=(p?f:l)*c)return pe(),void(null==i||i(e,!1));null==i||i(e,!0),he()},onDrag:function(e){var t;if(G.current&&I){const n="bottom"===x||"right"===x?1:-1,r=(K.current-(ev(x)?e.pageY:e.pageX))*n,i=r>0,l=a&&!d&&!i;if(l&&0===re)return;const c=Math.abs(r),u=document.querySelector("[data-vaul-drawer-wrapper]");let f=c/("bottom"===x||"top"===x?Q.current:J.current);const h=ce(c,i);if(null!==h&&(f=h),l&&f>=1)return;if(!j.current&&!fe(e.target,i))return;if(G.current.classList.add(iv),j.current=!0,Jy(G.current,{transition:"none"}),Jy(F.current,{transition:"none"}),a&&se({draggedDistance:r}),i&&!a){const e=(t=r,8*(Math.log(t+1)-2)),o=Math.min(-1*e,0)*n;return void Jy(G.current,{transform:ev(x)?`translate3d(0, ${o}px, 0)`:`translate3d(${o}px, 0, 0)`})}const m=1-f;if((le||p&&re===p-1)&&(null==o||o(e,f),Jy(F.current,{opacity:`${m}`,transition:"none"},!0)),u&&F.current&&s){const e=Math.min(de()+f*(1-de()),1),t=8-8*f,n=Math.max(0,14-14*f);Jy(u,{borderRadius:`${t}px`,transform:ev(x)?`scale(${e}) translate3d(0, ${n}px, 0)`:`scale(${e}) translate3d(${n}px, 0, 0)`,transition:"none"},!0)}if(!a){const e=c*n;Jy(G.current,{transform:ev(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})}}},dismissible:d,shouldAnimate:q,handleOnly:f,isOpen:R,isDragging:I,shouldFade:le,closeDrawer:pe,onNestedDrag:function(e,t){if(t<0)return;const n=(window.innerWidth-ov)/window.innerWidth,r=n+t*(1-n),o=t*ov-16;Jy(G.current,{transform:ev(x)?`scale(${r}) translate3d(0, ${o}px, 0)`:`scale(${r}) translate3d(${o}px, 0, 0)`,transition:"none"})},onNestedOpenChange:function(e){const t=e?(window.innerWidth-ov)/window.innerWidth:1,n=e?-16:0;X.current&&window.clearTimeout(X.current),Jy(G.current,{transition:`transform ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`,transform:ev(x)?`scale(${t}) translate3d(0, ${n}px, 0)`:`scale(${t}) translate3d(${n}px, 0, 0)`}),!e&&G.current&&(X.current=setTimeout(()=>{const e=tv(G.current,x);Jy(G.current,{transition:"none",transform:ev(x)?`translate3d(0, ${e}px, 0)`:`translate3d(${e}px, 0, 0)`})},500))},onNestedRelease:function(e,t){const n=ev(x)?window.innerHeight:window.innerWidth,r=t?(n-ov)/n:1,o=t?-16:0;t&&Jy(G.current,{transition:`transform ${rv.DURATION}s cubic-bezier(${rv.EASE.join(",")})`,transform:ev(x)?`scale(${r}) translate3d(0, ${o}px, 0)`:`scale(${r}) translate3d(${o}px, 0, 0)`})},keyboardIsOpen:U,modal:y,snapPointsOffset:ae,activeSnapPointIndex:re,direction:x,shouldScaleBackground:s,setBackgroundColorOnScale:l,noBodyStyles:w,container:M,autoFocus:O}},r))}const uv=t.forwardRef(function({...e},n){const{overlayRef:r,snapPoints:o,onRelease:i,shouldFade:a,isOpen:s,modal:l,shouldAnimate:c}=Dy(),u=Gy(n,r),d=o&&o.length>0;if(!l)return null;const f=t.useCallback(e=>i(e),[i]);return t.createElement(jf,{onMouseUp:f,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":s&&d?"true":"false","data-vaul-snap-points-overlay":s&&a?"true":"false","data-vaul-animate":(null==c?void 0:c.current)?"true":"false",...e})});uv.displayName="Drawer.Overlay";const dv=t.forwardRef(function({onPointerDownOutside:e,style:n,onOpenAutoFocus:r,...i},a){const{drawerRef:s,onPress:l,onRelease:c,onDrag:u,keyboardIsOpen:d,snapPointsOffset:f,activeSnapPointIndex:p,modal:h,isOpen:m,direction:g,snapPoints:y,container:v,handleOnly:b,shouldAnimate:w,autoFocus:x}=Dy(),[E,S]=t.useState(!1),_=Gy(a,s),C=t.useRef(null),k=t.useRef(null),N=t.useRef(!1),M=y&&y.length>0;!function(){const{direction:e,isOpen:n,shouldScaleBackground:r,setBackgroundColorOnScale:i,noBodyStyles:a}=Dy(),s=t.useRef(null),l=o(()=>document.body.style.backgroundColor,[]);function c(){return(window.innerWidth-26)/window.innerWidth}t.useEffect(()=>{if(n&&r){s.current&&clearTimeout(s.current);const t=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!t)return;i&&!a&&nv(document.body,{background:"black"}),nv(t,{transformOrigin:ev(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${rv.DURATION}s`,transitionTimingFunction:`cubic-bezier(${rv.EASE.join(",")})`});const n=nv(t,{borderRadius:"8px",overflow:"hidden",...ev(e)?{transform:`scale(${c()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${c()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{n(),s.current=window.setTimeout(()=>{l?document.body.style.background=l:document.body.style.removeProperty("background")},1e3*rv.DURATION)}}},[n,r,l])}();function O(e){C.current=null,N.current=!1,c(e)}return t.useEffect(()=>{M&&window.requestAnimationFrame(()=>{S(!0)})},[]),t.createElement(Xf,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":E?"true":"false","data-vaul-snap-points":m&&M?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":(null==w?void 0:w.current)?"true":"false",...i,ref:_,style:f&&f.length>0?{"--snap-point-height":`${f[null!=p?p:0]}px`,...n}:n,onPointerDown:e=>{b||(null==i.onPointerDown||i.onPointerDown.call(i,e),C.current={x:e.pageX,y:e.pageY},l(e))},onOpenAutoFocus:e=>{null==r||r(e),x||e.preventDefault()},onPointerDownOutside:t=>{null==e||e(t),h&&!t.defaultPrevented?d.current&&(d.current=!1):t.preventDefault()},onFocusOutside:e=>{h||e.preventDefault()},onPointerMove:e=>{if(k.current=e,b)return;if(null==i.onPointerMove||i.onPointerMove.call(i,e),!C.current)return;const t=e.pageY-C.current.y,n=e.pageX-C.current.x,r="touch"===e.pointerType?10:2,o=((e,t,n=0)=>{if(N.current)return!0;const r=Math.abs(e.y),o=Math.abs(e.x),i=o>r,a=["bottom","right"].includes(t)?1:-1;if("left"===t||"right"===t){if(!(e.x*a<0)&&o>=0&&o<=n)return i}else if(!(e.y*a<0)&&r>=0&&r<=n)return!i;return N.current=!0,!0})({x:n,y:t},g,r);o?u(e):(Math.abs(n)>r||Math.abs(t)>r)&&(C.current=null)},onPointerUp:e=>{null==i.onPointerUp||i.onPointerUp.call(i,e),C.current=null,N.current=!1,c(e)},onPointerOut:e=>{null==i.onPointerOut||i.onPointerOut.call(i,e),O(k.current)},onContextMenu:e=>{null==i.onContextMenu||i.onContextMenu.call(i,e),k.current&&O(k.current)}})});dv.displayName="Drawer.Content";const fv=t.forwardRef(function({preventCycle:e=!1,children:n,...r},o){const{closeDrawer:i,isDragging:a,snapPoints:s,activeSnapPoint:l,setActiveSnapPoint:c,dismissible:u,handleOnly:d,isOpen:f,onPress:p,onDrag:h}=Dy(),m=t.useRef(null),g=t.useRef(!1);function y(){m.current&&window.clearTimeout(m.current),g.current=!1}return t.createElement("div",{onClick:function(){g.current?y():window.setTimeout(()=>{!function(){if(a||e||g.current)return void y();if(y(),!s||0===s.length)return void(u||i());if(l===s[s.length-1]&&u)return void i();const t=s.findIndex(e=>e===l);if(-1===t)return;const n=s[t+1];c(n)}()},120)},onPointerCancel:y,onPointerDown:e=>{d&&p(e),m.current=window.setTimeout(()=>{g.current=!0},250)},onPointerMove:e=>{d&&h(e)},ref:o,"data-vaul-drawer-visible":f?"true":"false","data-vaul-handle":"","aria-hidden":"true",...r},t.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},n))});fv.displayName="Drawer.Handle";const pv={Root:cv,NestedRoot:function({onDrag:e,onOpenChange:n,open:r,...o}){const{onNestedDrag:i,onNestedOpenChange:a,onNestedRelease:s}=Dy();if(!i)throw new Error("Drawer.NestedRoot must be placed in another drawer");return t.createElement(cv,{nested:!0,open:r,onClose:()=>{a(!1)},onDrag:(t,n)=>{i(t,n),null==e||e(t,n)},onOpenChange:e=>{e&&a(e),null==n||n(e)},onRelease:s,...o})},Content:dv,Overlay:uv,Trigger:Vf,Portal:function(e){const n=Dy(),{container:r=n.container,...o}=e;return t.createElement(Yf,{container:r,...o})},Handle:fv,Close:qf,Title:Kf,Description:Uf},hv=({shouldScaleBackground:t=!0,...n})=>e.createElement(pv.Root,{shouldScaleBackground:t,...n});hv.displayName="Drawer";const mv=pv.Portal,gv=e.forwardRef(({className:t,...n},r)=>e.createElement(pv.Overlay,{ref:r,style:{position:"fixed",top:0,right:0,bottom:0,left:0,zIndex:50,backgroundColor:"rgba(0, 0, 0, 0.8)"},className:t,...n}));gv.displayName=pv.Overlay.displayName;const yv=e.forwardRef(({className:t,children:n,...r},o)=>e.createElement(mv,null,e.createElement(gv,null),e.createElement(pv.Content,{ref:o,style:{position:"fixed",left:0,right:0,top:0,zIndex:50,marginTop:"96px",display:"flex",height:"auto",flexDirection:"column",borderTopLeftRadius:"10px",borderTopRightRadius:"10px",border:"1px solid hsl(var(--border))",backgroundColor:"hsl(var(--background))"},className:t,...r},e.createElement("div",{style:{margin:"16px auto 0",height:"8px",width:"100px",borderRadius:"9999px",backgroundColor:"hsl(var(--muted))"}}),n)));yv.displayName="DrawerContent";e.forwardRef(({className:t,...n},r)=>e.createElement(pv.Title,{ref:r,style:{fontSize:"18px",fontWeight:600,lineHeight:1,letterSpacing:"-0.025em"},className:t,...n})).displayName=pv.Title.displayName;e.forwardRef(({className:t,...n},r)=>e.createElement(pv.Description,{ref:r,style:{fontSize:"14px",color:"hsl(var(--muted-foreground))"},className:t,...n})).displayName=pv.Description.displayName;const vv=()=>null;export{op as AgenticFlowVisualizer,Gc as AnthropicIcon,Ac as Badge,Ry as Checkbox,hv as Drawer,cc as Edge,fy as FileSelector,vv as GlobalStyles,Zc as GoogleIcon,Uc as JsonTreeViewer,Jc as Node,qc as OpenAIIcon,Bg as Select,Zf as Sheet,ic as ThemeProvider,Su as Timeline,ip as Visualizer,np as calculateAutoLayout,vc as cn,Sc as conditionalStyle,nc as darkTheme,rc as defaultTheme,wc as formatCurrency,xc as formatLatency,Cc as getColor,_c as getSpacing,tc as lightTheme,bc as toTitleCase,Ec as truncateText,lc as useComponentTheme,ac as useTheme,sc as useThemeValue};