dreative 0.5.2 → 0.5.4

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.
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var wi=Symbol.for("react.element"),Sv=Symbol.for("react.portal"),Ev=Symbol.for("react.fragment"),kv=Symbol.for("react.strict_mode"),Cv=Symbol.for("react.profiler"),_v=Symbol.for("react.provider"),Nv=Symbol.for("react.context"),bv=Symbol.for("react.forward_ref"),Mv=Symbol.for("react.suspense"),Iv=Symbol.for("react.memo"),Pv=Symbol.for("react.lazy"),jd=Symbol.iterator;function Dv(e){return e===null||typeof e!="object"?null:(e=jd&&e[jd]||e["@@iterator"],typeof e=="function"?e:null)}var mp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yp=Object.assign,vp={};function io(e,t,n){this.props=e,this.context=t,this.refs=vp,this.updater=n||mp}io.prototype.isReactComponent={};io.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};io.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function wp(){}wp.prototype=io.prototype;function lc(e,t,n){this.props=e,this.context=t,this.refs=vp,this.updater=n||mp}var ac=lc.prototype=new wp;ac.constructor=lc;yp(ac,io.prototype);ac.isPureReactComponent=!0;var Ad=Array.isArray,xp=Object.prototype.hasOwnProperty,uc={current:null},Sp={key:!0,ref:!0,__self:!0,__source:!0};function Ep(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)xp.call(t,r)&&!Sp.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];o.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:wi,type:e,key:i,ref:s,props:o,_owner:uc.current}}function Tv(e,t){return{$$typeof:wi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function cc(e){return typeof e=="object"&&e!==null&&e.$$typeof===wi}function Rv(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var $d=/\/+/g;function ia(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Rv(""+e.key):t.toString(36)}function hs(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case wi:case Sv:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+ia(s,0):r,Ad(o)?(n="",e!=null&&(n=e.replace($d,"$&/")+"/"),hs(o,t,n,"",function(u){return u})):o!=null&&(cc(o)&&(o=Tv(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace($d,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Ad(e))for(var l=0;l<e.length;l++){i=e[l];var a=r+ia(i,l);s+=hs(i,t,n,a,o)}else if(a=Dv(e),typeof a=="function")for(e=a.call(e),l=0;!(i=e.next()).done;)i=i.value,a=r+ia(i,l++),s+=hs(i,t,n,a,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function $i(e,t,n){if(e==null)return e;var r=[],o=0;return hs(e,r,"","",function(i){return t.call(n,i,o++)}),r}function zv(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ye={current:null},ps={transition:null},jv={ReactCurrentDispatcher:Ye,ReactCurrentBatchConfig:ps,ReactCurrentOwner:uc};function kp(){throw Error("act(...) is not supported in production builds of React.")}oe.Children={map:$i,forEach:function(e,t,n){$i(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return $i(e,function(){t++}),t},toArray:function(e){return $i(e,function(t){return t})||[]},only:function(e){if(!cc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=io;oe.Fragment=Ev;oe.Profiler=Cv;oe.PureComponent=lc;oe.StrictMode=kv;oe.Suspense=Mv;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=jv;oe.act=kp;oe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=yp({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=uc.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)xp.call(t,a)&&!Sp.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:wi,type:e.type,key:o,ref:i,props:r,_owner:s}};oe.createContext=function(e){return e={$$typeof:Nv,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:_v,_context:e},e.Consumer=e};oe.createElement=Ep;oe.createFactory=function(e){var t=Ep.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:bv,render:e}};oe.isValidElement=cc;oe.lazy=function(e){return{$$typeof:Pv,_payload:{_status:-1,_result:e},_init:zv}};oe.memo=function(e,t){return{$$typeof:Iv,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=ps.transition;ps.transition={};try{e()}finally{ps.transition=t}};oe.unstable_act=kp;oe.useCallback=function(e,t){return Ye.current.useCallback(e,t)};oe.useContext=function(e){return Ye.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return Ye.current.useDeferredValue(e)};oe.useEffect=function(e,t){return Ye.current.useEffect(e,t)};oe.useId=function(){return Ye.current.useId()};oe.useImperativeHandle=function(e,t,n){return Ye.current.useImperativeHandle(e,t,n)};oe.useInsertionEffect=function(e,t){return Ye.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return Ye.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return Ye.current.useMemo(e,t)};oe.useReducer=function(e,t,n){return Ye.current.useReducer(e,t,n)};oe.useRef=function(e){return Ye.current.useRef(e)};oe.useState=function(e){return Ye.current.useState(e)};oe.useSyncExternalStore=function(e,t,n){return Ye.current.useSyncExternalStore(e,t,n)};oe.useTransition=function(){return Ye.current.useTransition()};oe.version="18.3.1";gp.exports=oe;var k=gp.exports;const Se=hp(k);/**
9
+ */var wi=Symbol.for("react.element"),Sv=Symbol.for("react.portal"),Ev=Symbol.for("react.fragment"),kv=Symbol.for("react.strict_mode"),Cv=Symbol.for("react.profiler"),_v=Symbol.for("react.provider"),Nv=Symbol.for("react.context"),bv=Symbol.for("react.forward_ref"),Mv=Symbol.for("react.suspense"),Iv=Symbol.for("react.memo"),Pv=Symbol.for("react.lazy"),zd=Symbol.iterator;function Dv(e){return e===null||typeof e!="object"?null:(e=zd&&e[zd]||e["@@iterator"],typeof e=="function"?e:null)}var mp={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},yp=Object.assign,vp={};function io(e,t,n){this.props=e,this.context=t,this.refs=vp,this.updater=n||mp}io.prototype.isReactComponent={};io.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};io.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function wp(){}wp.prototype=io.prototype;function lc(e,t,n){this.props=e,this.context=t,this.refs=vp,this.updater=n||mp}var ac=lc.prototype=new wp;ac.constructor=lc;yp(ac,io.prototype);ac.isPureReactComponent=!0;var Ad=Array.isArray,xp=Object.prototype.hasOwnProperty,uc={current:null},Sp={key:!0,ref:!0,__self:!0,__source:!0};function Ep(e,t,n){var r,o={},i=null,s=null;if(t!=null)for(r in t.ref!==void 0&&(s=t.ref),t.key!==void 0&&(i=""+t.key),t)xp.call(t,r)&&!Sp.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(l===1)o.children=n;else if(1<l){for(var a=Array(l),u=0;u<l;u++)a[u]=arguments[u+2];o.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps,l)o[r]===void 0&&(o[r]=l[r]);return{$$typeof:wi,type:e,key:i,ref:s,props:o,_owner:uc.current}}function Tv(e,t){return{$$typeof:wi,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function cc(e){return typeof e=="object"&&e!==null&&e.$$typeof===wi}function Rv(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var $d=/\/+/g;function ia(e,t){return typeof e=="object"&&e!==null&&e.key!=null?Rv(""+e.key):t.toString(36)}function hs(e,t,n,r,o){var i=typeof e;(i==="undefined"||i==="boolean")&&(e=null);var s=!1;if(e===null)s=!0;else switch(i){case"string":case"number":s=!0;break;case"object":switch(e.$$typeof){case wi:case Sv:s=!0}}if(s)return s=e,o=o(s),e=r===""?"."+ia(s,0):r,Ad(o)?(n="",e!=null&&(n=e.replace($d,"$&/")+"/"),hs(o,t,n,"",function(u){return u})):o!=null&&(cc(o)&&(o=Tv(o,n+(!o.key||s&&s.key===o.key?"":(""+o.key).replace($d,"$&/")+"/")+e)),t.push(o)),1;if(s=0,r=r===""?".":r+":",Ad(e))for(var l=0;l<e.length;l++){i=e[l];var a=r+ia(i,l);s+=hs(i,t,n,a,o)}else if(a=Dv(e),typeof a=="function")for(e=a.call(e),l=0;!(i=e.next()).done;)i=i.value,a=r+ia(i,l++),s+=hs(i,t,n,a,o);else if(i==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return s}function $i(e,t,n){if(e==null)return e;var r=[],o=0;return hs(e,r,"","",function(i){return t.call(n,i,o++)}),r}function jv(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Ye={current:null},ps={transition:null},zv={ReactCurrentDispatcher:Ye,ReactCurrentBatchConfig:ps,ReactCurrentOwner:uc};function kp(){throw Error("act(...) is not supported in production builds of React.")}oe.Children={map:$i,forEach:function(e,t,n){$i(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return $i(e,function(){t++}),t},toArray:function(e){return $i(e,function(t){return t})||[]},only:function(e){if(!cc(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};oe.Component=io;oe.Fragment=Ev;oe.Profiler=Cv;oe.PureComponent=lc;oe.StrictMode=kv;oe.Suspense=Mv;oe.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=zv;oe.act=kp;oe.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=yp({},e.props),o=e.key,i=e.ref,s=e._owner;if(t!=null){if(t.ref!==void 0&&(i=t.ref,s=uc.current),t.key!==void 0&&(o=""+t.key),e.type&&e.type.defaultProps)var l=e.type.defaultProps;for(a in t)xp.call(t,a)&&!Sp.hasOwnProperty(a)&&(r[a]=t[a]===void 0&&l!==void 0?l[a]:t[a])}var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){l=Array(a);for(var u=0;u<a;u++)l[u]=arguments[u+2];r.children=l}return{$$typeof:wi,type:e.type,key:o,ref:i,props:r,_owner:s}};oe.createContext=function(e){return e={$$typeof:Nv,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:_v,_context:e},e.Consumer=e};oe.createElement=Ep;oe.createFactory=function(e){var t=Ep.bind(null,e);return t.type=e,t};oe.createRef=function(){return{current:null}};oe.forwardRef=function(e){return{$$typeof:bv,render:e}};oe.isValidElement=cc;oe.lazy=function(e){return{$$typeof:Pv,_payload:{_status:-1,_result:e},_init:jv}};oe.memo=function(e,t){return{$$typeof:Iv,type:e,compare:t===void 0?null:t}};oe.startTransition=function(e){var t=ps.transition;ps.transition={};try{e()}finally{ps.transition=t}};oe.unstable_act=kp;oe.useCallback=function(e,t){return Ye.current.useCallback(e,t)};oe.useContext=function(e){return Ye.current.useContext(e)};oe.useDebugValue=function(){};oe.useDeferredValue=function(e){return Ye.current.useDeferredValue(e)};oe.useEffect=function(e,t){return Ye.current.useEffect(e,t)};oe.useId=function(){return Ye.current.useId()};oe.useImperativeHandle=function(e,t,n){return Ye.current.useImperativeHandle(e,t,n)};oe.useInsertionEffect=function(e,t){return Ye.current.useInsertionEffect(e,t)};oe.useLayoutEffect=function(e,t){return Ye.current.useLayoutEffect(e,t)};oe.useMemo=function(e,t){return Ye.current.useMemo(e,t)};oe.useReducer=function(e,t,n){return Ye.current.useReducer(e,t,n)};oe.useRef=function(e){return Ye.current.useRef(e)};oe.useState=function(e){return Ye.current.useState(e)};oe.useSyncExternalStore=function(e,t,n){return Ye.current.useSyncExternalStore(e,t,n)};oe.useTransition=function(){return Ye.current.useTransition()};oe.version="18.3.1";gp.exports=oe;var k=gp.exports;const Se=hp(k);/**
10
10
  * @license React
11
11
  * react-jsx-runtime.production.min.js
12
12
  *
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(I,M){var j=I.length;I.push(M);e:for(;0<j;){var O=j-1>>>1,$=I[O];if(0<o($,M))I[O]=M,I[j]=$,j=O;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var M=I[0],j=I.pop();if(j!==M){I[0]=j;e:for(var O=0,$=I.length,U=$>>>1;O<U;){var W=2*(O+1)-1,Z=I[W],G=W+1,q=I[G];if(0>o(Z,j))G<$&&0>o(q,Z)?(I[O]=q,I[G]=j,O=G):(I[O]=Z,I[W]=j,O=W);else if(G<$&&0>o(q,j))I[O]=q,I[G]=j,O=G;else break e}}return M}function o(I,M){var j=I.sortIndex-M.sortIndex;return j!==0?j:I.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],u=[],c=1,d=null,f=3,g=!1,y=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(I){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=I)r(u),M.sortIndex=M.expirationTime,t(a,M);else break;M=n(u)}}function w(I){if(v=!1,h(I),!y)if(n(a)!==null)y=!0,P(C);else{var M=n(u);M!==null&&R(w,M.startTime-I)}}function C(I,M){y=!1,v&&(v=!1,p(b),b=-1),g=!0;var j=f;try{for(h(M),d=n(a);d!==null&&(!(d.expirationTime>M)||I&&!z());){var O=d.callback;if(typeof O=="function"){d.callback=null,f=d.priorityLevel;var $=O(d.expirationTime<=M);M=e.unstable_now(),typeof $=="function"?d.callback=$:d===n(a)&&r(a),h(M)}else r(a);d=n(a)}if(d!==null)var U=!0;else{var W=n(u);W!==null&&R(w,W.startTime-M),U=!1}return U}finally{d=null,f=j,g=!1}}var _=!1,N=null,b=-1,D=5,A=-1;function z(){return!(e.unstable_now()-A<D)}function H(){if(N!==null){var I=e.unstable_now();A=I;var M=!0;try{M=N(!0,I)}finally{M?L():(_=!1,N=null)}}else _=!1}var L;if(typeof m=="function")L=function(){m(H)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,T=E.port2;E.port1.onmessage=H,L=function(){T.postMessage(null)}}else L=function(){x(H,0)};function P(I){N=I,_||(_=!0,L())}function R(I,M){b=x(function(){I(e.unstable_now())},M)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_continueExecution=function(){y||g||(y=!0,P(C))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(I){switch(f){case 1:case 2:case 3:var M=3;break;default:M=f}var j=f;f=M;try{return I()}finally{f=j}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,M){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var j=f;f=I;try{return M()}finally{f=j}},e.unstable_scheduleCallback=function(I,M,j){var O=e.unstable_now();switch(typeof j=="object"&&j!==null?(j=j.delay,j=typeof j=="number"&&0<j?O+j:O):j=O,I){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=j+$,I={id:c++,callback:M,priorityLevel:I,startTime:j,expirationTime:$,sortIndex:-1},j>O?(I.sortIndex=j,t(u,I),n(a)===null&&I===n(u)&&(v?(p(b),b=-1):v=!0,R(w,j-O))):(I.sortIndex=$,t(a,I),y||g||(y=!0,P(C))),I},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(I){var M=f;return function(){var j=f;f=M;try{return I.apply(this,arguments)}finally{f=j}}}})(bp);Np.exports=bp;var Bv=Np.exports;/**
25
+ */(function(e){function t(I,M){var z=I.length;I.push(M);e:for(;0<z;){var O=z-1>>>1,$=I[O];if(0<o($,M))I[O]=M,I[z]=$,z=O;else break e}}function n(I){return I.length===0?null:I[0]}function r(I){if(I.length===0)return null;var M=I[0],z=I.pop();if(z!==M){I[0]=z;e:for(var O=0,$=I.length,U=$>>>1;O<U;){var W=2*(O+1)-1,Z=I[W],G=W+1,q=I[G];if(0>o(Z,z))G<$&&0>o(q,Z)?(I[O]=q,I[G]=z,O=G):(I[O]=Z,I[W]=z,O=W);else if(G<$&&0>o(q,z))I[O]=q,I[G]=z,O=G;else break e}}return M}function o(I,M){var z=I.sortIndex-M.sortIndex;return z!==0?z:I.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var s=Date,l=s.now();e.unstable_now=function(){return s.now()-l}}var a=[],u=[],c=1,d=null,f=3,g=!1,y=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,m=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function h(I){for(var M=n(u);M!==null;){if(M.callback===null)r(u);else if(M.startTime<=I)r(u),M.sortIndex=M.expirationTime,t(a,M);else break;M=n(u)}}function w(I){if(v=!1,h(I),!y)if(n(a)!==null)y=!0,P(C);else{var M=n(u);M!==null&&R(w,M.startTime-I)}}function C(I,M){y=!1,v&&(v=!1,p(b),b=-1),g=!0;var z=f;try{for(h(M),d=n(a);d!==null&&(!(d.expirationTime>M)||I&&!j());){var O=d.callback;if(typeof O=="function"){d.callback=null,f=d.priorityLevel;var $=O(d.expirationTime<=M);M=e.unstable_now(),typeof $=="function"?d.callback=$:d===n(a)&&r(a),h(M)}else r(a);d=n(a)}if(d!==null)var U=!0;else{var W=n(u);W!==null&&R(w,W.startTime-M),U=!1}return U}finally{d=null,f=z,g=!1}}var _=!1,N=null,b=-1,D=5,A=-1;function j(){return!(e.unstable_now()-A<D)}function H(){if(N!==null){var I=e.unstable_now();A=I;var M=!0;try{M=N(!0,I)}finally{M?L():(_=!1,N=null)}}else _=!1}var L;if(typeof m=="function")L=function(){m(H)};else if(typeof MessageChannel<"u"){var E=new MessageChannel,T=E.port2;E.port1.onmessage=H,L=function(){T.postMessage(null)}}else L=function(){x(H,0)};function P(I){N=I,_||(_=!0,L())}function R(I,M){b=x(function(){I(e.unstable_now())},M)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(I){I.callback=null},e.unstable_continueExecution=function(){y||g||(y=!0,P(C))},e.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<I?Math.floor(1e3/I):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_getFirstCallbackNode=function(){return n(a)},e.unstable_next=function(I){switch(f){case 1:case 2:case 3:var M=3;break;default:M=f}var z=f;f=M;try{return I()}finally{f=z}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(I,M){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var z=f;f=I;try{return M()}finally{f=z}},e.unstable_scheduleCallback=function(I,M,z){var O=e.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?O+z:O):z=O,I){case 1:var $=-1;break;case 2:$=250;break;case 5:$=1073741823;break;case 4:$=1e4;break;default:$=5e3}return $=z+$,I={id:c++,callback:M,priorityLevel:I,startTime:z,expirationTime:$,sortIndex:-1},z>O?(I.sortIndex=z,t(u,I),n(a)===null&&I===n(u)&&(v?(p(b),b=-1):v=!0,R(w,z-O))):(I.sortIndex=$,t(a,I),y||g||(y=!0,P(C))),I},e.unstable_shouldYield=j,e.unstable_wrapCallback=function(I){var M=f;return function(){var z=f;f=M;try{return I.apply(this,arguments)}finally{f=z}}}})(bp);Np.exports=bp;var Bv=Np.exports;/**
26
26
  * @license React
27
27
  * react-dom.production.min.js
28
28
  *
@@ -30,14 +30,14 @@
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var Vv=k,dt=Bv;function B(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Mp=new Set,Uo={};function gr(e,t){Wr(e,t),Wr(e+"Capture",t)}function Wr(e,t){for(Uo[e]=t,e=0;e<t.length;e++)Mp.add(t[e])}var hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ka=Object.prototype.hasOwnProperty,Uv=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ld={},Od={};function Wv(e){return Ka.call(Od,e)?!0:Ka.call(Ld,e)?!1:Uv.test(e)?Od[e]=!0:(Ld[e]=!0,!1)}function Xv(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Yv(e,t,n,r){if(t===null||typeof t>"u"||Xv(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Qe(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var je={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){je[e]=new Qe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];je[t]=new Qe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){je[e]=new Qe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){je[e]=new Qe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){je[e]=new Qe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){je[e]=new Qe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){je[e]=new Qe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){je[e]=new Qe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){je[e]=new Qe(e,5,!1,e.toLowerCase(),null,!1,!1)});var dc=/[\-:]([a-z])/g;function fc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(dc,fc);je[t]=new Qe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(dc,fc);je[t]=new Qe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(dc,fc);je[t]=new Qe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){je[e]=new Qe(e,1,!1,e.toLowerCase(),null,!1,!1)});je.xlinkHref=new Qe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){je[e]=new Qe(e,1,!1,e.toLowerCase(),null,!0,!0)});function hc(e,t,n,r){var o=je.hasOwnProperty(t)?je[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Yv(t,n,o,r)&&(n=null),r||o===null?Wv(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var vn=Vv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Li=Symbol.for("react.element"),xr=Symbol.for("react.portal"),Sr=Symbol.for("react.fragment"),pc=Symbol.for("react.strict_mode"),Ga=Symbol.for("react.profiler"),Ip=Symbol.for("react.provider"),Pp=Symbol.for("react.context"),gc=Symbol.for("react.forward_ref"),Za=Symbol.for("react.suspense"),qa=Symbol.for("react.suspense_list"),mc=Symbol.for("react.memo"),kn=Symbol.for("react.lazy"),Dp=Symbol.for("react.offscreen"),Fd=Symbol.iterator;function po(e){return e===null||typeof e!="object"?null:(e=Fd&&e[Fd]||e["@@iterator"],typeof e=="function"?e:null)}var ye=Object.assign,sa;function Co(e){if(sa===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);sa=t&&t[1]||""}return`
33
+ */var Vv=k,dt=Bv;function B(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var Mp=new Set,Uo={};function gr(e,t){Wr(e,t),Wr(e+"Capture",t)}function Wr(e,t){for(Uo[e]=t,e=0;e<t.length;e++)Mp.add(t[e])}var hn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ka=Object.prototype.hasOwnProperty,Uv=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,Ld={},Od={};function Wv(e){return Ka.call(Od,e)?!0:Ka.call(Ld,e)?!1:Uv.test(e)?Od[e]=!0:(Ld[e]=!0,!1)}function Xv(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Yv(e,t,n,r){if(t===null||typeof t>"u"||Xv(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Qe(e,t,n,r,o,i,s){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=o,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=s}var ze={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ze[e]=new Qe(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ze[t]=new Qe(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ze[e]=new Qe(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ze[e]=new Qe(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ze[e]=new Qe(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ze[e]=new Qe(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ze[e]=new Qe(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ze[e]=new Qe(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ze[e]=new Qe(e,5,!1,e.toLowerCase(),null,!1,!1)});var dc=/[\-:]([a-z])/g;function fc(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(dc,fc);ze[t]=new Qe(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(dc,fc);ze[t]=new Qe(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(dc,fc);ze[t]=new Qe(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ze[e]=new Qe(e,1,!1,e.toLowerCase(),null,!1,!1)});ze.xlinkHref=new Qe("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ze[e]=new Qe(e,1,!1,e.toLowerCase(),null,!0,!0)});function hc(e,t,n,r){var o=ze.hasOwnProperty(t)?ze[t]:null;(o!==null?o.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Yv(t,n,o,r)&&(n=null),r||o===null?Wv(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):o.mustUseProperty?e[o.propertyName]=n===null?o.type===3?!1:"":n:(t=o.attributeName,r=o.attributeNamespace,n===null?e.removeAttribute(t):(o=o.type,n=o===3||o===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var vn=Vv.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Li=Symbol.for("react.element"),xr=Symbol.for("react.portal"),Sr=Symbol.for("react.fragment"),pc=Symbol.for("react.strict_mode"),Ga=Symbol.for("react.profiler"),Ip=Symbol.for("react.provider"),Pp=Symbol.for("react.context"),gc=Symbol.for("react.forward_ref"),Za=Symbol.for("react.suspense"),qa=Symbol.for("react.suspense_list"),mc=Symbol.for("react.memo"),kn=Symbol.for("react.lazy"),Dp=Symbol.for("react.offscreen"),Fd=Symbol.iterator;function po(e){return e===null||typeof e!="object"?null:(e=Fd&&e[Fd]||e["@@iterator"],typeof e=="function"?e:null)}var ye=Object.assign,sa;function Co(e){if(sa===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);sa=t&&t[1]||""}return`
34
34
  `+sa+e}var la=!1;function aa(e,t){if(!e||la)return"";la=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(u){var r=u}Reflect.construct(e,[],t)}else{try{t.call()}catch(u){r=u}e.call(t.prototype)}else{try{throw Error()}catch(u){r=u}e()}}catch(u){if(u&&r&&typeof u.stack=="string"){for(var o=u.stack.split(`
35
35
  `),i=r.stack.split(`
36
36
  `),s=o.length-1,l=i.length-1;1<=s&&0<=l&&o[s]!==i[l];)l--;for(;1<=s&&0<=l;s--,l--)if(o[s]!==i[l]){if(s!==1||l!==1)do if(s--,l--,0>l||o[s]!==i[l]){var a=`
37
- `+o[s].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{la=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Co(e):""}function Qv(e){switch(e.tag){case 5:return Co(e.type);case 16:return Co("Lazy");case 13:return Co("Suspense");case 19:return Co("SuspenseList");case 0:case 2:case 15:return e=aa(e.type,!1),e;case 11:return e=aa(e.type.render,!1),e;case 1:return e=aa(e.type,!0),e;default:return""}}function Ja(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Sr:return"Fragment";case xr:return"Portal";case Ga:return"Profiler";case pc:return"StrictMode";case Za:return"Suspense";case qa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Pp:return(e.displayName||"Context")+".Consumer";case Ip:return(e._context.displayName||"Context")+".Provider";case gc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mc:return t=e.displayName||null,t!==null?t:Ja(e.type)||"Memo";case kn:t=e._payload,e=e._init;try{return Ja(e(t))}catch{}}return null}function Kv(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ja(t);case 8:return t===pc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Fn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Tp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gv(e){var t=Tp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Oi(e){e._valueTracker||(e._valueTracker=Gv(e))}function Rp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Tp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ds(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function eu(e,t){var n=t.checked;return ye({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Hd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Fn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function zp(e,t){t=t.checked,t!=null&&hc(e,"checked",t,!1)}function tu(e,t){zp(e,t);var n=Fn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?nu(e,t.type,n):t.hasOwnProperty("defaultValue")&&nu(e,t.type,Fn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Bd(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function nu(e,t,n){(t!=="number"||Ds(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var _o=Array.isArray;function jr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Fn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function ru(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(B(91));return ye({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Vd(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(B(92));if(_o(n)){if(1<n.length)throw Error(B(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Fn(n)}}function jp(e,t){var n=Fn(t.value),r=Fn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Ud(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ap(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ou(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ap(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fi,$p=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Fi=Fi||document.createElement("div"),Fi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Po={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Zv=["Webkit","ms","Moz","O"];Object.keys(Po).forEach(function(e){Zv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Po[t]=Po[e]})});function Lp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Po.hasOwnProperty(e)&&Po[e]?(""+t).trim():t+"px"}function Op(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Lp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var qv=ye({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function iu(e,t){if(t){if(qv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function su(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lu=null;function yc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var au=null,Ar=null,$r=null;function Wd(e){if(e=Ei(e)){if(typeof au!="function")throw Error(B(280));var t=e.stateNode;t&&(t=kl(t),au(e.stateNode,e.type,t))}}function Fp(e){Ar?$r?$r.push(e):$r=[e]:Ar=e}function Hp(){if(Ar){var e=Ar,t=$r;if($r=Ar=null,Wd(e),t)for(e=0;e<t.length;e++)Wd(t[e])}}function Bp(e,t){return e(t)}function Vp(){}var ua=!1;function Up(e,t,n){if(ua)return e(t,n);ua=!0;try{return Bp(e,t,n)}finally{ua=!1,(Ar!==null||$r!==null)&&(Vp(),Hp())}}function Xo(e,t){var n=e.stateNode;if(n===null)return null;var r=kl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(B(231,t,typeof n));return n}var uu=!1;if(hn)try{var go={};Object.defineProperty(go,"passive",{get:function(){uu=!0}}),window.addEventListener("test",go,go),window.removeEventListener("test",go,go)}catch{uu=!1}function Jv(e,t,n,r,o,i,s,l,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Do=!1,Ts=null,Rs=!1,cu=null,ew={onError:function(e){Do=!0,Ts=e}};function tw(e,t,n,r,o,i,s,l,a){Do=!1,Ts=null,Jv.apply(ew,arguments)}function nw(e,t,n,r,o,i,s,l,a){if(tw.apply(this,arguments),Do){if(Do){var u=Ts;Do=!1,Ts=null}else throw Error(B(198));Rs||(Rs=!0,cu=u)}}function mr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Wp(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Xd(e){if(mr(e)!==e)throw Error(B(188))}function rw(e){var t=e.alternate;if(!t){if(t=mr(e),t===null)throw Error(B(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Xd(o),e;if(i===r)return Xd(o),t;i=i.sibling}throw Error(B(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(B(189))}}if(n.alternate!==r)throw Error(B(190))}if(n.tag!==3)throw Error(B(188));return n.stateNode.current===n?e:t}function Xp(e){return e=rw(e),e!==null?Yp(e):null}function Yp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Yp(e);if(t!==null)return t;e=e.sibling}return null}var Qp=dt.unstable_scheduleCallback,Yd=dt.unstable_cancelCallback,ow=dt.unstable_shouldYield,iw=dt.unstable_requestPaint,xe=dt.unstable_now,sw=dt.unstable_getCurrentPriorityLevel,vc=dt.unstable_ImmediatePriority,Kp=dt.unstable_UserBlockingPriority,zs=dt.unstable_NormalPriority,lw=dt.unstable_LowPriority,Gp=dt.unstable_IdlePriority,wl=null,qt=null;function aw(e){if(qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(wl,e,void 0,(e.current.flags&128)===128)}catch{}}var jt=Math.clz32?Math.clz32:dw,uw=Math.log,cw=Math.LN2;function dw(e){return e>>>=0,e===0?32:31-(uw(e)/cw|0)|0}var Hi=64,Bi=4194304;function No(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function js(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=No(l):(i&=s,i!==0&&(r=No(i)))}else s=n&~o,s!==0?r=No(s):i!==0&&(r=No(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-jt(t),o=1<<n,r|=e[n],t&=~o;return r}function fw(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hw(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-jt(i),l=1<<s,a=o[s];a===-1?(!(l&n)||l&r)&&(o[s]=fw(l,t)):a<=t&&(e.expiredLanes|=l),i&=~l}}function du(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Zp(){var e=Hi;return Hi<<=1,!(Hi&4194240)&&(Hi=64),e}function ca(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function xi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-jt(t),e[t]=n}function pw(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-jt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function wc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-jt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ae=0;function qp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Jp,xc,eg,tg,ng,fu=!1,Vi=[],Dn=null,Tn=null,Rn=null,Yo=new Map,Qo=new Map,Nn=[],gw="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Qd(e,t){switch(e){case"focusin":case"focusout":Dn=null;break;case"dragenter":case"dragleave":Tn=null;break;case"mouseover":case"mouseout":Rn=null;break;case"pointerover":case"pointerout":Yo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qo.delete(t.pointerId)}}function mo(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Ei(t),t!==null&&xc(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function mw(e,t,n,r,o){switch(t){case"focusin":return Dn=mo(Dn,e,t,n,r,o),!0;case"dragenter":return Tn=mo(Tn,e,t,n,r,o),!0;case"mouseover":return Rn=mo(Rn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Yo.set(i,mo(Yo.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Qo.set(i,mo(Qo.get(i)||null,e,t,n,r,o)),!0}return!1}function rg(e){var t=Zn(e.target);if(t!==null){var n=mr(t);if(n!==null){if(t=n.tag,t===13){if(t=Wp(n),t!==null){e.blockedOn=t,ng(e.priority,function(){eg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function gs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=hu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);lu=r,n.target.dispatchEvent(r),lu=null}else return t=Ei(n),t!==null&&xc(t),e.blockedOn=n,!1;t.shift()}return!0}function Kd(e,t,n){gs(e)&&n.delete(t)}function yw(){fu=!1,Dn!==null&&gs(Dn)&&(Dn=null),Tn!==null&&gs(Tn)&&(Tn=null),Rn!==null&&gs(Rn)&&(Rn=null),Yo.forEach(Kd),Qo.forEach(Kd)}function yo(e,t){e.blockedOn===t&&(e.blockedOn=null,fu||(fu=!0,dt.unstable_scheduleCallback(dt.unstable_NormalPriority,yw)))}function Ko(e){function t(o){return yo(o,e)}if(0<Vi.length){yo(Vi[0],e);for(var n=1;n<Vi.length;n++){var r=Vi[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Dn!==null&&yo(Dn,e),Tn!==null&&yo(Tn,e),Rn!==null&&yo(Rn,e),Yo.forEach(t),Qo.forEach(t),n=0;n<Nn.length;n++)r=Nn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Nn.length&&(n=Nn[0],n.blockedOn===null);)rg(n),n.blockedOn===null&&Nn.shift()}var Lr=vn.ReactCurrentBatchConfig,As=!0;function vw(e,t,n,r){var o=ae,i=Lr.transition;Lr.transition=null;try{ae=1,Sc(e,t,n,r)}finally{ae=o,Lr.transition=i}}function ww(e,t,n,r){var o=ae,i=Lr.transition;Lr.transition=null;try{ae=4,Sc(e,t,n,r)}finally{ae=o,Lr.transition=i}}function Sc(e,t,n,r){if(As){var o=hu(e,t,n,r);if(o===null)xa(e,t,r,$s,n),Qd(e,r);else if(mw(o,e,t,n,r))r.stopPropagation();else if(Qd(e,r),t&4&&-1<gw.indexOf(e)){for(;o!==null;){var i=Ei(o);if(i!==null&&Jp(i),i=hu(e,t,n,r),i===null&&xa(e,t,r,$s,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else xa(e,t,r,null,n)}}var $s=null;function hu(e,t,n,r){if($s=null,e=yc(r),e=Zn(e),e!==null)if(t=mr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Wp(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return $s=e,null}function og(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(sw()){case vc:return 1;case Kp:return 4;case zs:case lw:return 16;case Gp:return 536870912;default:return 16}default:return 16}}var In=null,Ec=null,ms=null;function ig(){if(ms)return ms;var e,t=Ec,n=t.length,r,o="value"in In?In.value:In.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return ms=o.slice(e,1<r?1-r:void 0)}function ys(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ui(){return!0}function Gd(){return!1}function pt(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ui:Gd,this.isPropagationStopped=Gd,this}return ye(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ui)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ui)},persist:function(){},isPersistent:Ui}),t}var so={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kc=pt(so),Si=ye({},so,{view:0,detail:0}),xw=pt(Si),da,fa,vo,xl=ye({},Si,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==vo&&(vo&&e.type==="mousemove"?(da=e.screenX-vo.screenX,fa=e.screenY-vo.screenY):fa=da=0,vo=e),da)},movementY:function(e){return"movementY"in e?e.movementY:fa}}),Zd=pt(xl),Sw=ye({},xl,{dataTransfer:0}),Ew=pt(Sw),kw=ye({},Si,{relatedTarget:0}),ha=pt(kw),Cw=ye({},so,{animationName:0,elapsedTime:0,pseudoElement:0}),_w=pt(Cw),Nw=ye({},so,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bw=pt(Nw),Mw=ye({},so,{data:0}),qd=pt(Mw),Iw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pw={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Dw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Dw[e])?!!t[e]:!1}function Cc(){return Tw}var Rw=ye({},Si,{key:function(e){if(e.key){var t=Iw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ys(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Pw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cc,charCode:function(e){return e.type==="keypress"?ys(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ys(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),zw=pt(Rw),jw=ye({},xl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jd=pt(jw),Aw=ye({},Si,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cc}),$w=pt(Aw),Lw=ye({},so,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ow=pt(Lw),Fw=ye({},xl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Hw=pt(Fw),Bw=[9,13,27,32],_c=hn&&"CompositionEvent"in window,To=null;hn&&"documentMode"in document&&(To=document.documentMode);var Vw=hn&&"TextEvent"in window&&!To,sg=hn&&(!_c||To&&8<To&&11>=To),ef=" ",tf=!1;function lg(e,t){switch(e){case"keyup":return Bw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ag(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Er=!1;function Uw(e,t){switch(e){case"compositionend":return ag(t);case"keypress":return t.which!==32?null:(tf=!0,ef);case"textInput":return e=t.data,e===ef&&tf?null:e;default:return null}}function Ww(e,t){if(Er)return e==="compositionend"||!_c&&lg(e,t)?(e=ig(),ms=Ec=In=null,Er=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return sg&&t.locale!=="ko"?null:t.data;default:return null}}var Xw={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function nf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Xw[e.type]:t==="textarea"}function ug(e,t,n,r){Fp(r),t=Ls(t,"onChange"),0<t.length&&(n=new kc("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ro=null,Go=null;function Yw(e){xg(e,0)}function Sl(e){var t=_r(e);if(Rp(t))return e}function Qw(e,t){if(e==="change")return t}var cg=!1;if(hn){var pa;if(hn){var ga="oninput"in document;if(!ga){var rf=document.createElement("div");rf.setAttribute("oninput","return;"),ga=typeof rf.oninput=="function"}pa=ga}else pa=!1;cg=pa&&(!document.documentMode||9<document.documentMode)}function of(){Ro&&(Ro.detachEvent("onpropertychange",dg),Go=Ro=null)}function dg(e){if(e.propertyName==="value"&&Sl(Go)){var t=[];ug(t,Go,e,yc(e)),Up(Yw,t)}}function Kw(e,t,n){e==="focusin"?(of(),Ro=t,Go=n,Ro.attachEvent("onpropertychange",dg)):e==="focusout"&&of()}function Gw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Sl(Go)}function Zw(e,t){if(e==="click")return Sl(t)}function qw(e,t){if(e==="input"||e==="change")return Sl(t)}function Jw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $t=typeof Object.is=="function"?Object.is:Jw;function Zo(e,t){if($t(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Ka.call(t,o)||!$t(e[o],t[o]))return!1}return!0}function sf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lf(e,t){var n=sf(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=sf(n)}}function fg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hg(){for(var e=window,t=Ds();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ds(e.document)}return t}function Nc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ex(e){var t=hg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&fg(n.ownerDocument.documentElement,n)){if(r!==null&&Nc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=lf(n,i);var s=lf(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var tx=hn&&"documentMode"in document&&11>=document.documentMode,kr=null,pu=null,zo=null,gu=!1;function af(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gu||kr==null||kr!==Ds(r)||(r=kr,"selectionStart"in r&&Nc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),zo&&Zo(zo,r)||(zo=r,r=Ls(pu,"onSelect"),0<r.length&&(t=new kc("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=kr)))}function Wi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Cr={animationend:Wi("Animation","AnimationEnd"),animationiteration:Wi("Animation","AnimationIteration"),animationstart:Wi("Animation","AnimationStart"),transitionend:Wi("Transition","TransitionEnd")},ma={},pg={};hn&&(pg=document.createElement("div").style,"AnimationEvent"in window||(delete Cr.animationend.animation,delete Cr.animationiteration.animation,delete Cr.animationstart.animation),"TransitionEvent"in window||delete Cr.transitionend.transition);function El(e){if(ma[e])return ma[e];if(!Cr[e])return e;var t=Cr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in pg)return ma[e]=t[n];return e}var gg=El("animationend"),mg=El("animationiteration"),yg=El("animationstart"),vg=El("transitionend"),wg=new Map,uf="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Bn(e,t){wg.set(e,t),gr(t,[e])}for(var ya=0;ya<uf.length;ya++){var va=uf[ya],nx=va.toLowerCase(),rx=va[0].toUpperCase()+va.slice(1);Bn(nx,"on"+rx)}Bn(gg,"onAnimationEnd");Bn(mg,"onAnimationIteration");Bn(yg,"onAnimationStart");Bn("dblclick","onDoubleClick");Bn("focusin","onFocus");Bn("focusout","onBlur");Bn(vg,"onTransitionEnd");Wr("onMouseEnter",["mouseout","mouseover"]);Wr("onMouseLeave",["mouseout","mouseover"]);Wr("onPointerEnter",["pointerout","pointerover"]);Wr("onPointerLeave",["pointerout","pointerover"]);gr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));gr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));gr("onBeforeInput",["compositionend","keypress","textInput","paste"]);gr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));gr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));gr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ox=new Set("cancel close invalid load scroll toggle".split(" ").concat(bo));function cf(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,nw(r,t,void 0,e),e.currentTarget=null}function xg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==i&&o.isPropagationStopped())break e;cf(o,l,u),i=a}else for(s=0;s<r.length;s++){if(l=r[s],a=l.instance,u=l.currentTarget,l=l.listener,a!==i&&o.isPropagationStopped())break e;cf(o,l,u),i=a}}}if(Rs)throw e=cu,Rs=!1,cu=null,e}function de(e,t){var n=t[xu];n===void 0&&(n=t[xu]=new Set);var r=e+"__bubble";n.has(r)||(Sg(t,e,2,!1),n.add(r))}function wa(e,t,n){var r=0;t&&(r|=4),Sg(n,e,r,t)}var Xi="_reactListening"+Math.random().toString(36).slice(2);function qo(e){if(!e[Xi]){e[Xi]=!0,Mp.forEach(function(n){n!=="selectionchange"&&(ox.has(n)||wa(n,!1,e),wa(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xi]||(t[Xi]=!0,wa("selectionchange",!1,t))}}function Sg(e,t,n,r){switch(og(t)){case 1:var o=vw;break;case 4:o=ww;break;default:o=Sc}n=o.bind(null,t,n,e),o=void 0,!uu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function xa(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var a=s.tag;if((a===3||a===4)&&(a=s.stateNode.containerInfo,a===o||a.nodeType===8&&a.parentNode===o))return;s=s.return}for(;l!==null;){if(s=Zn(l),s===null)return;if(a=s.tag,a===5||a===6){r=i=s;continue e}l=l.parentNode}}r=r.return}Up(function(){var u=i,c=yc(n),d=[];e:{var f=wg.get(e);if(f!==void 0){var g=kc,y=e;switch(e){case"keypress":if(ys(n)===0)break e;case"keydown":case"keyup":g=zw;break;case"focusin":y="focus",g=ha;break;case"focusout":y="blur",g=ha;break;case"beforeblur":case"afterblur":g=ha;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=Zd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=Ew;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=$w;break;case gg:case mg:case yg:g=_w;break;case vg:g=Ow;break;case"scroll":g=xw;break;case"wheel":g=Hw;break;case"copy":case"cut":case"paste":g=bw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Jd}var v=(t&4)!==0,x=!v&&e==="scroll",p=v?f!==null?f+"Capture":null:f;v=[];for(var m=u,h;m!==null;){h=m;var w=h.stateNode;if(h.tag===5&&w!==null&&(h=w,p!==null&&(w=Xo(m,p),w!=null&&v.push(Jo(m,w,h)))),x)break;m=m.return}0<v.length&&(f=new g(f,y,null,n,c),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&n!==lu&&(y=n.relatedTarget||n.fromElement)&&(Zn(y)||y[pn]))break e;if((g||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,g?(y=n.relatedTarget||n.toElement,g=u,y=y?Zn(y):null,y!==null&&(x=mr(y),y!==x||y.tag!==5&&y.tag!==6)&&(y=null)):(g=null,y=u),g!==y)){if(v=Zd,w="onMouseLeave",p="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(v=Jd,w="onPointerLeave",p="onPointerEnter",m="pointer"),x=g==null?f:_r(g),h=y==null?f:_r(y),f=new v(w,m+"leave",g,n,c),f.target=x,f.relatedTarget=h,w=null,Zn(c)===u&&(v=new v(p,m+"enter",y,n,c),v.target=h,v.relatedTarget=x,w=v),x=w,g&&y)t:{for(v=g,p=y,m=0,h=v;h;h=vr(h))m++;for(h=0,w=p;w;w=vr(w))h++;for(;0<m-h;)v=vr(v),m--;for(;0<h-m;)p=vr(p),h--;for(;m--;){if(v===p||p!==null&&v===p.alternate)break t;v=vr(v),p=vr(p)}v=null}else v=null;g!==null&&df(d,f,g,v,!1),y!==null&&x!==null&&df(d,x,y,v,!0)}}e:{if(f=u?_r(u):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var C=Qw;else if(nf(f))if(cg)C=qw;else{C=Gw;var _=Kw}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(C=Zw);if(C&&(C=C(e,u))){ug(d,C,n,c);break e}_&&_(e,f,u),e==="focusout"&&(_=f._wrapperState)&&_.controlled&&f.type==="number"&&nu(f,"number",f.value)}switch(_=u?_r(u):window,e){case"focusin":(nf(_)||_.contentEditable==="true")&&(kr=_,pu=u,zo=null);break;case"focusout":zo=pu=kr=null;break;case"mousedown":gu=!0;break;case"contextmenu":case"mouseup":case"dragend":gu=!1,af(d,n,c);break;case"selectionchange":if(tx)break;case"keydown":case"keyup":af(d,n,c)}var N;if(_c)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Er?lg(e,n)&&(b="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(b="onCompositionStart");b&&(sg&&n.locale!=="ko"&&(Er||b!=="onCompositionStart"?b==="onCompositionEnd"&&Er&&(N=ig()):(In=c,Ec="value"in In?In.value:In.textContent,Er=!0)),_=Ls(u,b),0<_.length&&(b=new qd(b,e,null,n,c),d.push({event:b,listeners:_}),N?b.data=N:(N=ag(n),N!==null&&(b.data=N)))),(N=Vw?Uw(e,n):Ww(e,n))&&(u=Ls(u,"onBeforeInput"),0<u.length&&(c=new qd("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=N))}xg(d,t)})}function Jo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ls(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Xo(e,n),i!=null&&r.unshift(Jo(e,i,o)),i=Xo(e,t),i!=null&&r.push(Jo(e,i,o))),e=e.return}return r}function vr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function df(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&u!==null&&(l=u,o?(a=Xo(n,i),a!=null&&s.unshift(Jo(n,a,l))):o||(a=Xo(n,i),a!=null&&s.push(Jo(n,a,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var ix=/\r\n?/g,sx=/\u0000|\uFFFD/g;function ff(e){return(typeof e=="string"?e:""+e).replace(ix,`
38
- `).replace(sx,"")}function Yi(e,t,n){if(t=ff(t),ff(e)!==t&&n)throw Error(B(425))}function Os(){}var mu=null,yu=null;function vu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wu=typeof setTimeout=="function"?setTimeout:void 0,lx=typeof clearTimeout=="function"?clearTimeout:void 0,hf=typeof Promise=="function"?Promise:void 0,ax=typeof queueMicrotask=="function"?queueMicrotask:typeof hf<"u"?function(e){return hf.resolve(null).then(e).catch(ux)}:wu;function ux(e){setTimeout(function(){throw e})}function Sa(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Ko(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Ko(t)}function zn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function pf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var lo=Math.random().toString(36).slice(2),Zt="__reactFiber$"+lo,ei="__reactProps$"+lo,pn="__reactContainer$"+lo,xu="__reactEvents$"+lo,cx="__reactListeners$"+lo,dx="__reactHandles$"+lo;function Zn(e){var t=e[Zt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pn]||n[Zt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pf(e);e!==null;){if(n=e[Zt])return n;e=pf(e)}return t}e=n,n=e.parentNode}return null}function Ei(e){return e=e[Zt]||e[pn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function _r(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function kl(e){return e[ei]||null}var Su=[],Nr=-1;function Vn(e){return{current:e}}function fe(e){0>Nr||(e.current=Su[Nr],Su[Nr]=null,Nr--)}function ue(e,t){Nr++,Su[Nr]=e.current,e.current=t}var Hn={},Fe=Vn(Hn),nt=Vn(!1),ir=Hn;function Xr(e,t){var n=e.type.contextTypes;if(!n)return Hn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function rt(e){return e=e.childContextTypes,e!=null}function Fs(){fe(nt),fe(Fe)}function gf(e,t,n){if(Fe.current!==Hn)throw Error(B(168));ue(Fe,t),ue(nt,n)}function Eg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(B(108,Kv(e)||"Unknown",o));return ye({},n,r)}function Hs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Hn,ir=Fe.current,ue(Fe,e),ue(nt,nt.current),!0}function mf(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=Eg(e,t,ir),r.__reactInternalMemoizedMergedChildContext=e,fe(nt),fe(Fe),ue(Fe,e)):fe(nt),ue(nt,n)}var an=null,Cl=!1,Ea=!1;function kg(e){an===null?an=[e]:an.push(e)}function fx(e){Cl=!0,kg(e)}function Un(){if(!Ea&&an!==null){Ea=!0;var e=0,t=ae;try{var n=an;for(ae=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}an=null,Cl=!1}catch(o){throw an!==null&&(an=an.slice(e+1)),Qp(vc,Un),o}finally{ae=t,Ea=!1}}return null}var br=[],Mr=0,Bs=null,Vs=0,vt=[],wt=0,sr=null,un=1,cn="";function Qn(e,t){br[Mr++]=Vs,br[Mr++]=Bs,Bs=e,Vs=t}function Cg(e,t,n){vt[wt++]=un,vt[wt++]=cn,vt[wt++]=sr,sr=e;var r=un;e=cn;var o=32-jt(r)-1;r&=~(1<<o),n+=1;var i=32-jt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,un=1<<32-jt(t)+o|n<<o|r,cn=i+e}else un=1<<i|n<<o|r,cn=e}function bc(e){e.return!==null&&(Qn(e,1),Cg(e,1,0))}function Mc(e){for(;e===Bs;)Bs=br[--Mr],br[Mr]=null,Vs=br[--Mr],br[Mr]=null;for(;e===sr;)sr=vt[--wt],vt[wt]=null,cn=vt[--wt],vt[wt]=null,un=vt[--wt],vt[wt]=null}var ct=null,ut=null,pe=!1,Pt=null;function _g(e,t){var n=xt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function yf(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ct=e,ut=zn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ct=e,ut=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=sr!==null?{id:un,overflow:cn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=xt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ct=e,ut=null,!0):!1;default:return!1}}function Eu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ku(e){if(pe){var t=ut;if(t){var n=t;if(!yf(e,t)){if(Eu(e))throw Error(B(418));t=zn(n.nextSibling);var r=ct;t&&yf(e,t)?_g(r,n):(e.flags=e.flags&-4097|2,pe=!1,ct=e)}}else{if(Eu(e))throw Error(B(418));e.flags=e.flags&-4097|2,pe=!1,ct=e}}}function vf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ct=e}function Qi(e){if(e!==ct)return!1;if(!pe)return vf(e),pe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!vu(e.type,e.memoizedProps)),t&&(t=ut)){if(Eu(e))throw Ng(),Error(B(418));for(;t;)_g(e,t),t=zn(t.nextSibling)}if(vf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ut=zn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ut=null}}else ut=ct?zn(e.stateNode.nextSibling):null;return!0}function Ng(){for(var e=ut;e;)e=zn(e.nextSibling)}function Yr(){ut=ct=null,pe=!1}function Ic(e){Pt===null?Pt=[e]:Pt.push(e)}var hx=vn.ReactCurrentBatchConfig;function wo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(B(309));var r=n.stateNode}if(!r)throw Error(B(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(B(284));if(!n._owner)throw Error(B(290,e))}return e}function Ki(e,t){throw e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function wf(e){var t=e._init;return t(e._payload)}function bg(e){function t(p,m){if(e){var h=p.deletions;h===null?(p.deletions=[m],p.flags|=16):h.push(m)}}function n(p,m){if(!e)return null;for(;m!==null;)t(p,m),m=m.sibling;return null}function r(p,m){for(p=new Map;m!==null;)m.key!==null?p.set(m.key,m):p.set(m.index,m),m=m.sibling;return p}function o(p,m){return p=Ln(p,m),p.index=0,p.sibling=null,p}function i(p,m,h){return p.index=h,e?(h=p.alternate,h!==null?(h=h.index,h<m?(p.flags|=2,m):h):(p.flags|=2,m)):(p.flags|=1048576,m)}function s(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,m,h,w){return m===null||m.tag!==6?(m=Ia(h,p.mode,w),m.return=p,m):(m=o(m,h),m.return=p,m)}function a(p,m,h,w){var C=h.type;return C===Sr?c(p,m,h.props.children,w,h.key):m!==null&&(m.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===kn&&wf(C)===m.type)?(w=o(m,h.props),w.ref=wo(p,m,h),w.return=p,w):(w=Cs(h.type,h.key,h.props,null,p.mode,w),w.ref=wo(p,m,h),w.return=p,w)}function u(p,m,h,w){return m===null||m.tag!==4||m.stateNode.containerInfo!==h.containerInfo||m.stateNode.implementation!==h.implementation?(m=Pa(h,p.mode,w),m.return=p,m):(m=o(m,h.children||[]),m.return=p,m)}function c(p,m,h,w,C){return m===null||m.tag!==7?(m=nr(h,p.mode,w,C),m.return=p,m):(m=o(m,h),m.return=p,m)}function d(p,m,h){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Ia(""+m,p.mode,h),m.return=p,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Li:return h=Cs(m.type,m.key,m.props,null,p.mode,h),h.ref=wo(p,null,m),h.return=p,h;case xr:return m=Pa(m,p.mode,h),m.return=p,m;case kn:var w=m._init;return d(p,w(m._payload),h)}if(_o(m)||po(m))return m=nr(m,p.mode,h,null),m.return=p,m;Ki(p,m)}return null}function f(p,m,h,w){var C=m!==null?m.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return C!==null?null:l(p,m,""+h,w);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Li:return h.key===C?a(p,m,h,w):null;case xr:return h.key===C?u(p,m,h,w):null;case kn:return C=h._init,f(p,m,C(h._payload),w)}if(_o(h)||po(h))return C!==null?null:c(p,m,h,w,null);Ki(p,h)}return null}function g(p,m,h,w,C){if(typeof w=="string"&&w!==""||typeof w=="number")return p=p.get(h)||null,l(m,p,""+w,C);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Li:return p=p.get(w.key===null?h:w.key)||null,a(m,p,w,C);case xr:return p=p.get(w.key===null?h:w.key)||null,u(m,p,w,C);case kn:var _=w._init;return g(p,m,h,_(w._payload),C)}if(_o(w)||po(w))return p=p.get(h)||null,c(m,p,w,C,null);Ki(m,w)}return null}function y(p,m,h,w){for(var C=null,_=null,N=m,b=m=0,D=null;N!==null&&b<h.length;b++){N.index>b?(D=N,N=null):D=N.sibling;var A=f(p,N,h[b],w);if(A===null){N===null&&(N=D);break}e&&N&&A.alternate===null&&t(p,N),m=i(A,m,b),_===null?C=A:_.sibling=A,_=A,N=D}if(b===h.length)return n(p,N),pe&&Qn(p,b),C;if(N===null){for(;b<h.length;b++)N=d(p,h[b],w),N!==null&&(m=i(N,m,b),_===null?C=N:_.sibling=N,_=N);return pe&&Qn(p,b),C}for(N=r(p,N);b<h.length;b++)D=g(N,p,b,h[b],w),D!==null&&(e&&D.alternate!==null&&N.delete(D.key===null?b:D.key),m=i(D,m,b),_===null?C=D:_.sibling=D,_=D);return e&&N.forEach(function(z){return t(p,z)}),pe&&Qn(p,b),C}function v(p,m,h,w){var C=po(h);if(typeof C!="function")throw Error(B(150));if(h=C.call(h),h==null)throw Error(B(151));for(var _=C=null,N=m,b=m=0,D=null,A=h.next();N!==null&&!A.done;b++,A=h.next()){N.index>b?(D=N,N=null):D=N.sibling;var z=f(p,N,A.value,w);if(z===null){N===null&&(N=D);break}e&&N&&z.alternate===null&&t(p,N),m=i(z,m,b),_===null?C=z:_.sibling=z,_=z,N=D}if(A.done)return n(p,N),pe&&Qn(p,b),C;if(N===null){for(;!A.done;b++,A=h.next())A=d(p,A.value,w),A!==null&&(m=i(A,m,b),_===null?C=A:_.sibling=A,_=A);return pe&&Qn(p,b),C}for(N=r(p,N);!A.done;b++,A=h.next())A=g(N,p,b,A.value,w),A!==null&&(e&&A.alternate!==null&&N.delete(A.key===null?b:A.key),m=i(A,m,b),_===null?C=A:_.sibling=A,_=A);return e&&N.forEach(function(H){return t(p,H)}),pe&&Qn(p,b),C}function x(p,m,h,w){if(typeof h=="object"&&h!==null&&h.type===Sr&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Li:e:{for(var C=h.key,_=m;_!==null;){if(_.key===C){if(C=h.type,C===Sr){if(_.tag===7){n(p,_.sibling),m=o(_,h.props.children),m.return=p,p=m;break e}}else if(_.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===kn&&wf(C)===_.type){n(p,_.sibling),m=o(_,h.props),m.ref=wo(p,_,h),m.return=p,p=m;break e}n(p,_);break}else t(p,_);_=_.sibling}h.type===Sr?(m=nr(h.props.children,p.mode,w,h.key),m.return=p,p=m):(w=Cs(h.type,h.key,h.props,null,p.mode,w),w.ref=wo(p,m,h),w.return=p,p=w)}return s(p);case xr:e:{for(_=h.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===h.containerInfo&&m.stateNode.implementation===h.implementation){n(p,m.sibling),m=o(m,h.children||[]),m.return=p,p=m;break e}else{n(p,m);break}else t(p,m);m=m.sibling}m=Pa(h,p.mode,w),m.return=p,p=m}return s(p);case kn:return _=h._init,x(p,m,_(h._payload),w)}if(_o(h))return y(p,m,h,w);if(po(h))return v(p,m,h,w);Ki(p,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,m!==null&&m.tag===6?(n(p,m.sibling),m=o(m,h),m.return=p,p=m):(n(p,m),m=Ia(h,p.mode,w),m.return=p,p=m),s(p)):n(p,m)}return x}var Qr=bg(!0),Mg=bg(!1),Us=Vn(null),Ws=null,Ir=null,Pc=null;function Dc(){Pc=Ir=Ws=null}function Tc(e){var t=Us.current;fe(Us),e._currentValue=t}function Cu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Or(e,t){Ws=e,Pc=Ir=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(et=!0),e.firstContext=null)}function Et(e){var t=e._currentValue;if(Pc!==e)if(e={context:e,memoizedValue:t,next:null},Ir===null){if(Ws===null)throw Error(B(308));Ir=e,Ws.dependencies={lanes:0,firstContext:e}}else Ir=Ir.next=e;return t}var qn=null;function Rc(e){qn===null?qn=[e]:qn.push(e)}function Ig(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Rc(t)):(n.next=o.next,o.next=n),t.interleaved=n,gn(e,r)}function gn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Cn=!1;function zc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Pg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function fn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function jn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ie&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,gn(e,n)}return o=r.interleaved,o===null?(t.next=t,Rc(r)):(t.next=o.next,o.next=t),r.interleaved=t,gn(e,n)}function vs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wc(e,n)}}function xf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Xs(e,t,n,r){var o=e.updateQueue;Cn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var a=l,u=a.next;a.next=null,s===null?i=u:s.next=u,s=a;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==s&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a))}if(i!==null){var d=o.baseState;s=0,c=u=a=null,l=i;do{var f=l.lane,g=l.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,v=l;switch(f=t,g=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){d=y.call(g,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(g,d,f):y,f==null)break e;d=ye({},d,f);break e;case 2:Cn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[l]:f.push(l))}else g={eventTime:g,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=g,a=d):c=c.next=g,s|=f;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;f=l,l=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(c===null&&(a=d),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);ar|=s,e.lanes=s,e.memoizedState=d}}function Sf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(B(191,o));o.call(r)}}}var ki={},Jt=Vn(ki),ti=Vn(ki),ni=Vn(ki);function Jn(e){if(e===ki)throw Error(B(174));return e}function jc(e,t){switch(ue(ni,t),ue(ti,e),ue(Jt,ki),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ou(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ou(t,e)}fe(Jt),ue(Jt,t)}function Kr(){fe(Jt),fe(ti),fe(ni)}function Dg(e){Jn(ni.current);var t=Jn(Jt.current),n=ou(t,e.type);t!==n&&(ue(ti,e),ue(Jt,n))}function Ac(e){ti.current===e&&(fe(Jt),fe(ti))}var ge=Vn(0);function Ys(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ka=[];function $c(){for(var e=0;e<ka.length;e++)ka[e]._workInProgressVersionPrimary=null;ka.length=0}var ws=vn.ReactCurrentDispatcher,Ca=vn.ReactCurrentBatchConfig,lr=0,me=null,Ne=null,Pe=null,Qs=!1,jo=!1,ri=0,px=0;function $e(){throw Error(B(321))}function Lc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!$t(e[n],t[n]))return!1;return!0}function Oc(e,t,n,r,o,i){if(lr=i,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ws.current=e===null||e.memoizedState===null?vx:wx,e=n(r,o),jo){i=0;do{if(jo=!1,ri=0,25<=i)throw Error(B(301));i+=1,Pe=Ne=null,t.updateQueue=null,ws.current=xx,e=n(r,o)}while(jo)}if(ws.current=Ks,t=Ne!==null&&Ne.next!==null,lr=0,Pe=Ne=me=null,Qs=!1,t)throw Error(B(300));return e}function Fc(){var e=ri!==0;return ri=0,e}function Kt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pe===null?me.memoizedState=Pe=e:Pe=Pe.next=e,Pe}function kt(){if(Ne===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=Ne.next;var t=Pe===null?me.memoizedState:Pe.next;if(t!==null)Pe=t,Ne=e;else{if(e===null)throw Error(B(310));Ne=e,e={memoizedState:Ne.memoizedState,baseState:Ne.baseState,baseQueue:Ne.baseQueue,queue:Ne.queue,next:null},Pe===null?me.memoizedState=Pe=e:Pe=Pe.next=e}return Pe}function oi(e,t){return typeof t=="function"?t(e):t}function _a(e){var t=kt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=Ne,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,a=null,u=i;do{var c=u.lane;if((lr&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=d,s=r):a=a.next=d,me.lanes|=c,ar|=c}u=u.next}while(u!==null&&u!==i);a===null?s=r:a.next=l,$t(r,t.memoizedState)||(et=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,me.lanes|=i,ar|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Na(e){var t=kt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);$t(i,t.memoizedState)||(et=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Tg(){}function Rg(e,t){var n=me,r=kt(),o=t(),i=!$t(r.memoizedState,o);if(i&&(r.memoizedState=o,et=!0),r=r.queue,Hc(Ag.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Pe!==null&&Pe.memoizedState.tag&1){if(n.flags|=2048,ii(9,jg.bind(null,n,r,o,t),void 0,null),Te===null)throw Error(B(349));lr&30||zg(n,t,o)}return o}function zg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=me.updateQueue,t===null?(t={lastEffect:null,stores:null},me.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function jg(e,t,n,r){t.value=n,t.getSnapshot=r,$g(t)&&Lg(e)}function Ag(e,t,n){return n(function(){$g(t)&&Lg(e)})}function $g(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!$t(e,n)}catch{return!0}}function Lg(e){var t=gn(e,1);t!==null&&At(t,e,1,-1)}function Ef(e){var t=Kt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:e},t.queue=e,e=e.dispatch=yx.bind(null,me,e),[t.memoizedState,e]}function ii(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=me.updateQueue,t===null?(t={lastEffect:null,stores:null},me.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Og(){return kt().memoizedState}function xs(e,t,n,r){var o=Kt();me.flags|=e,o.memoizedState=ii(1|t,n,void 0,r===void 0?null:r)}function _l(e,t,n,r){var o=kt();r=r===void 0?null:r;var i=void 0;if(Ne!==null){var s=Ne.memoizedState;if(i=s.destroy,r!==null&&Lc(r,s.deps)){o.memoizedState=ii(t,n,i,r);return}}me.flags|=e,o.memoizedState=ii(1|t,n,i,r)}function kf(e,t){return xs(8390656,8,e,t)}function Hc(e,t){return _l(2048,8,e,t)}function Fg(e,t){return _l(4,2,e,t)}function Hg(e,t){return _l(4,4,e,t)}function Bg(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Vg(e,t,n){return n=n!=null?n.concat([e]):null,_l(4,4,Bg.bind(null,t,e),n)}function Bc(){}function Ug(e,t){var n=kt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Wg(e,t){var n=kt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lc(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Xg(e,t,n){return lr&21?($t(n,t)||(n=Zp(),me.lanes|=n,ar|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,et=!0),e.memoizedState=n)}function gx(e,t){var n=ae;ae=n!==0&&4>n?n:4,e(!0);var r=Ca.transition;Ca.transition={};try{e(!1),t()}finally{ae=n,Ca.transition=r}}function Yg(){return kt().memoizedState}function mx(e,t,n){var r=$n(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Qg(e))Kg(t,n);else if(n=Ig(e,t,n,r),n!==null){var o=Xe();At(n,e,r,o),Gg(n,t,r)}}function yx(e,t,n){var r=$n(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qg(e))Kg(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,$t(l,s)){var a=t.interleaved;a===null?(o.next=o,Rc(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=Ig(e,t,o,r),n!==null&&(o=Xe(),At(n,e,r,o),Gg(n,t,r))}}function Qg(e){var t=e.alternate;return e===me||t!==null&&t===me}function Kg(e,t){jo=Qs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Gg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wc(e,n)}}var Ks={readContext:Et,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useInsertionEffect:$e,useLayoutEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useMutableSource:$e,useSyncExternalStore:$e,useId:$e,unstable_isNewReconciler:!1},vx={readContext:Et,useCallback:function(e,t){return Kt().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:kf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,xs(4194308,4,Bg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xs(4194308,4,e,t)},useInsertionEffect:function(e,t){return xs(4,2,e,t)},useMemo:function(e,t){var n=Kt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Kt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=mx.bind(null,me,e),[r.memoizedState,e]},useRef:function(e){var t=Kt();return e={current:e},t.memoizedState=e},useState:Ef,useDebugValue:Bc,useDeferredValue:function(e){return Kt().memoizedState=e},useTransition:function(){var e=Ef(!1),t=e[0];return e=gx.bind(null,e[1]),Kt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=me,o=Kt();if(pe){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),Te===null)throw Error(B(349));lr&30||zg(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,kf(Ag.bind(null,r,i,e),[e]),r.flags|=2048,ii(9,jg.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Kt(),t=Te.identifierPrefix;if(pe){var n=cn,r=un;n=(r&~(1<<32-jt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ri++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=px++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},wx={readContext:Et,useCallback:Ug,useContext:Et,useEffect:Hc,useImperativeHandle:Vg,useInsertionEffect:Fg,useLayoutEffect:Hg,useMemo:Wg,useReducer:_a,useRef:Og,useState:function(){return _a(oi)},useDebugValue:Bc,useDeferredValue:function(e){var t=kt();return Xg(t,Ne.memoizedState,e)},useTransition:function(){var e=_a(oi)[0],t=kt().memoizedState;return[e,t]},useMutableSource:Tg,useSyncExternalStore:Rg,useId:Yg,unstable_isNewReconciler:!1},xx={readContext:Et,useCallback:Ug,useContext:Et,useEffect:Hc,useImperativeHandle:Vg,useInsertionEffect:Fg,useLayoutEffect:Hg,useMemo:Wg,useReducer:Na,useRef:Og,useState:function(){return Na(oi)},useDebugValue:Bc,useDeferredValue:function(e){var t=kt();return Ne===null?t.memoizedState=e:Xg(t,Ne.memoizedState,e)},useTransition:function(){var e=Na(oi)[0],t=kt().memoizedState;return[e,t]},useMutableSource:Tg,useSyncExternalStore:Rg,useId:Yg,unstable_isNewReconciler:!1};function bt(e,t){if(e&&e.defaultProps){t=ye({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function _u(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ye({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Nl={isMounted:function(e){return(e=e._reactInternals)?mr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Xe(),o=$n(e),i=fn(r,o);i.payload=t,n!=null&&(i.callback=n),t=jn(e,i,o),t!==null&&(At(t,e,o,r),vs(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Xe(),o=$n(e),i=fn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=jn(e,i,o),t!==null&&(At(t,e,o,r),vs(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Xe(),r=$n(e),o=fn(n,r);o.tag=2,t!=null&&(o.callback=t),t=jn(e,o,r),t!==null&&(At(t,e,r,n),vs(t,e,r))}};function Cf(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Zo(n,r)||!Zo(o,i):!0}function Zg(e,t,n){var r=!1,o=Hn,i=t.contextType;return typeof i=="object"&&i!==null?i=Et(i):(o=rt(t)?ir:Fe.current,r=t.contextTypes,i=(r=r!=null)?Xr(e,o):Hn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Nl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function _f(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Nl.enqueueReplaceState(t,t.state,null)}function Nu(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},zc(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Et(i):(i=rt(t)?ir:Fe.current,o.context=Xr(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(_u(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Nl.enqueueReplaceState(o,o.state,null),Xs(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Gr(e,t){try{var n="",r=t;do n+=Qv(r),r=r.return;while(r);var o=n}catch(i){o=`
37
+ `+o[s].replace(" at new "," at ");return e.displayName&&a.includes("<anonymous>")&&(a=a.replace("<anonymous>",e.displayName)),a}while(1<=s&&0<=l);break}}}finally{la=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?Co(e):""}function Qv(e){switch(e.tag){case 5:return Co(e.type);case 16:return Co("Lazy");case 13:return Co("Suspense");case 19:return Co("SuspenseList");case 0:case 2:case 15:return e=aa(e.type,!1),e;case 11:return e=aa(e.type.render,!1),e;case 1:return e=aa(e.type,!0),e;default:return""}}function Ja(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Sr:return"Fragment";case xr:return"Portal";case Ga:return"Profiler";case pc:return"StrictMode";case Za:return"Suspense";case qa:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case Pp:return(e.displayName||"Context")+".Consumer";case Ip:return(e._context.displayName||"Context")+".Provider";case gc:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case mc:return t=e.displayName||null,t!==null?t:Ja(e.type)||"Memo";case kn:t=e._payload,e=e._init;try{return Ja(e(t))}catch{}}return null}function Kv(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ja(t);case 8:return t===pc?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Fn(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Tp(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Gv(e){var t=Tp(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,i=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(s){r=""+s,i.call(this,s)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(s){r=""+s},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Oi(e){e._valueTracker||(e._valueTracker=Gv(e))}function Rp(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=Tp(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function Ds(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function eu(e,t){var n=t.checked;return ye({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Hd(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Fn(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function jp(e,t){t=t.checked,t!=null&&hc(e,"checked",t,!1)}function tu(e,t){jp(e,t);var n=Fn(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?nu(e,t.type,n):t.hasOwnProperty("defaultValue")&&nu(e,t.type,Fn(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Bd(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function nu(e,t,n){(t!=="number"||Ds(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var _o=Array.isArray;function zr(e,t,n,r){if(e=e.options,t){t={};for(var o=0;o<n.length;o++)t["$"+n[o]]=!0;for(n=0;n<e.length;n++)o=t.hasOwnProperty("$"+e[n].value),e[n].selected!==o&&(e[n].selected=o),o&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Fn(n),t=null,o=0;o<e.length;o++){if(e[o].value===n){e[o].selected=!0,r&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function ru(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(B(91));return ye({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Vd(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(B(92));if(_o(n)){if(1<n.length)throw Error(B(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Fn(n)}}function zp(e,t){var n=Fn(t.value),r=Fn(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Ud(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function Ap(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ou(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?Ap(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Fi,$p=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,o){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,o)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Fi=Fi||document.createElement("div"),Fi.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Fi.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wo(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Po={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Zv=["Webkit","ms","Moz","O"];Object.keys(Po).forEach(function(e){Zv.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Po[t]=Po[e]})});function Lp(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||Po.hasOwnProperty(e)&&Po[e]?(""+t).trim():t+"px"}function Op(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,o=Lp(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,o):e[n]=o}}var qv=ye({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function iu(e,t){if(t){if(qv[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(B(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(B(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(B(61))}if(t.style!=null&&typeof t.style!="object")throw Error(B(62))}}function su(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var lu=null;function yc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var au=null,Ar=null,$r=null;function Wd(e){if(e=Ei(e)){if(typeof au!="function")throw Error(B(280));var t=e.stateNode;t&&(t=kl(t),au(e.stateNode,e.type,t))}}function Fp(e){Ar?$r?$r.push(e):$r=[e]:Ar=e}function Hp(){if(Ar){var e=Ar,t=$r;if($r=Ar=null,Wd(e),t)for(e=0;e<t.length;e++)Wd(t[e])}}function Bp(e,t){return e(t)}function Vp(){}var ua=!1;function Up(e,t,n){if(ua)return e(t,n);ua=!0;try{return Bp(e,t,n)}finally{ua=!1,(Ar!==null||$r!==null)&&(Vp(),Hp())}}function Xo(e,t){var n=e.stateNode;if(n===null)return null;var r=kl(n);if(r===null)return null;n=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(B(231,t,typeof n));return n}var uu=!1;if(hn)try{var go={};Object.defineProperty(go,"passive",{get:function(){uu=!0}}),window.addEventListener("test",go,go),window.removeEventListener("test",go,go)}catch{uu=!1}function Jv(e,t,n,r,o,i,s,l,a){var u=Array.prototype.slice.call(arguments,3);try{t.apply(n,u)}catch(c){this.onError(c)}}var Do=!1,Ts=null,Rs=!1,cu=null,ew={onError:function(e){Do=!0,Ts=e}};function tw(e,t,n,r,o,i,s,l,a){Do=!1,Ts=null,Jv.apply(ew,arguments)}function nw(e,t,n,r,o,i,s,l,a){if(tw.apply(this,arguments),Do){if(Do){var u=Ts;Do=!1,Ts=null}else throw Error(B(198));Rs||(Rs=!0,cu=u)}}function mr(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function Wp(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function Xd(e){if(mr(e)!==e)throw Error(B(188))}function rw(e){var t=e.alternate;if(!t){if(t=mr(e),t===null)throw Error(B(188));return t!==e?null:e}for(var n=e,r=t;;){var o=n.return;if(o===null)break;var i=o.alternate;if(i===null){if(r=o.return,r!==null){n=r;continue}break}if(o.child===i.child){for(i=o.child;i;){if(i===n)return Xd(o),e;if(i===r)return Xd(o),t;i=i.sibling}throw Error(B(188))}if(n.return!==r.return)n=o,r=i;else{for(var s=!1,l=o.child;l;){if(l===n){s=!0,n=o,r=i;break}if(l===r){s=!0,r=o,n=i;break}l=l.sibling}if(!s){for(l=i.child;l;){if(l===n){s=!0,n=i,r=o;break}if(l===r){s=!0,r=i,n=o;break}l=l.sibling}if(!s)throw Error(B(189))}}if(n.alternate!==r)throw Error(B(190))}if(n.tag!==3)throw Error(B(188));return n.stateNode.current===n?e:t}function Xp(e){return e=rw(e),e!==null?Yp(e):null}function Yp(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=Yp(e);if(t!==null)return t;e=e.sibling}return null}var Qp=dt.unstable_scheduleCallback,Yd=dt.unstable_cancelCallback,ow=dt.unstable_shouldYield,iw=dt.unstable_requestPaint,xe=dt.unstable_now,sw=dt.unstable_getCurrentPriorityLevel,vc=dt.unstable_ImmediatePriority,Kp=dt.unstable_UserBlockingPriority,js=dt.unstable_NormalPriority,lw=dt.unstable_LowPriority,Gp=dt.unstable_IdlePriority,wl=null,qt=null;function aw(e){if(qt&&typeof qt.onCommitFiberRoot=="function")try{qt.onCommitFiberRoot(wl,e,void 0,(e.current.flags&128)===128)}catch{}}var zt=Math.clz32?Math.clz32:dw,uw=Math.log,cw=Math.LN2;function dw(e){return e>>>=0,e===0?32:31-(uw(e)/cw|0)|0}var Hi=64,Bi=4194304;function No(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function zs(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,o=e.suspendedLanes,i=e.pingedLanes,s=n&268435455;if(s!==0){var l=s&~o;l!==0?r=No(l):(i&=s,i!==0&&(r=No(i)))}else s=n&~o,s!==0?r=No(s):i!==0&&(r=No(i));if(r===0)return 0;if(t!==0&&t!==r&&!(t&o)&&(o=r&-r,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-zt(t),o=1<<n,r|=e[n],t&=~o;return r}function fw(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function hw(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,o=e.expirationTimes,i=e.pendingLanes;0<i;){var s=31-zt(i),l=1<<s,a=o[s];a===-1?(!(l&n)||l&r)&&(o[s]=fw(l,t)):a<=t&&(e.expiredLanes|=l),i&=~l}}function du(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function Zp(){var e=Hi;return Hi<<=1,!(Hi&4194240)&&(Hi=64),e}function ca(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function xi(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-zt(t),e[t]=n}function pw(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var o=31-zt(n),i=1<<o;t[o]=0,r[o]=-1,e[o]=-1,n&=~i}}function wc(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-zt(n),o=1<<r;o&t|e[r]&t&&(e[r]|=t),n&=~o}}var ae=0;function qp(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Jp,xc,eg,tg,ng,fu=!1,Vi=[],Dn=null,Tn=null,Rn=null,Yo=new Map,Qo=new Map,Nn=[],gw="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Qd(e,t){switch(e){case"focusin":case"focusout":Dn=null;break;case"dragenter":case"dragleave":Tn=null;break;case"mouseover":case"mouseout":Rn=null;break;case"pointerover":case"pointerout":Yo.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qo.delete(t.pointerId)}}function mo(e,t,n,r,o,i){return e===null||e.nativeEvent!==i?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:i,targetContainers:[o]},t!==null&&(t=Ei(t),t!==null&&xc(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function mw(e,t,n,r,o){switch(t){case"focusin":return Dn=mo(Dn,e,t,n,r,o),!0;case"dragenter":return Tn=mo(Tn,e,t,n,r,o),!0;case"mouseover":return Rn=mo(Rn,e,t,n,r,o),!0;case"pointerover":var i=o.pointerId;return Yo.set(i,mo(Yo.get(i)||null,e,t,n,r,o)),!0;case"gotpointercapture":return i=o.pointerId,Qo.set(i,mo(Qo.get(i)||null,e,t,n,r,o)),!0}return!1}function rg(e){var t=Zn(e.target);if(t!==null){var n=mr(t);if(n!==null){if(t=n.tag,t===13){if(t=Wp(n),t!==null){e.blockedOn=t,ng(e.priority,function(){eg(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function gs(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=hu(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);lu=r,n.target.dispatchEvent(r),lu=null}else return t=Ei(n),t!==null&&xc(t),e.blockedOn=n,!1;t.shift()}return!0}function Kd(e,t,n){gs(e)&&n.delete(t)}function yw(){fu=!1,Dn!==null&&gs(Dn)&&(Dn=null),Tn!==null&&gs(Tn)&&(Tn=null),Rn!==null&&gs(Rn)&&(Rn=null),Yo.forEach(Kd),Qo.forEach(Kd)}function yo(e,t){e.blockedOn===t&&(e.blockedOn=null,fu||(fu=!0,dt.unstable_scheduleCallback(dt.unstable_NormalPriority,yw)))}function Ko(e){function t(o){return yo(o,e)}if(0<Vi.length){yo(Vi[0],e);for(var n=1;n<Vi.length;n++){var r=Vi[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Dn!==null&&yo(Dn,e),Tn!==null&&yo(Tn,e),Rn!==null&&yo(Rn,e),Yo.forEach(t),Qo.forEach(t),n=0;n<Nn.length;n++)r=Nn[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Nn.length&&(n=Nn[0],n.blockedOn===null);)rg(n),n.blockedOn===null&&Nn.shift()}var Lr=vn.ReactCurrentBatchConfig,As=!0;function vw(e,t,n,r){var o=ae,i=Lr.transition;Lr.transition=null;try{ae=1,Sc(e,t,n,r)}finally{ae=o,Lr.transition=i}}function ww(e,t,n,r){var o=ae,i=Lr.transition;Lr.transition=null;try{ae=4,Sc(e,t,n,r)}finally{ae=o,Lr.transition=i}}function Sc(e,t,n,r){if(As){var o=hu(e,t,n,r);if(o===null)xa(e,t,r,$s,n),Qd(e,r);else if(mw(o,e,t,n,r))r.stopPropagation();else if(Qd(e,r),t&4&&-1<gw.indexOf(e)){for(;o!==null;){var i=Ei(o);if(i!==null&&Jp(i),i=hu(e,t,n,r),i===null&&xa(e,t,r,$s,n),i===o)break;o=i}o!==null&&r.stopPropagation()}else xa(e,t,r,null,n)}}var $s=null;function hu(e,t,n,r){if($s=null,e=yc(r),e=Zn(e),e!==null)if(t=mr(e),t===null)e=null;else if(n=t.tag,n===13){if(e=Wp(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return $s=e,null}function og(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(sw()){case vc:return 1;case Kp:return 4;case js:case lw:return 16;case Gp:return 536870912;default:return 16}default:return 16}}var In=null,Ec=null,ms=null;function ig(){if(ms)return ms;var e,t=Ec,n=t.length,r,o="value"in In?In.value:In.textContent,i=o.length;for(e=0;e<n&&t[e]===o[e];e++);var s=n-e;for(r=1;r<=s&&t[n-r]===o[i-r];r++);return ms=o.slice(e,1<r?1-r:void 0)}function ys(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ui(){return!0}function Gd(){return!1}function pt(e){function t(n,r,o,i,s){this._reactName=n,this._targetInst=o,this.type=r,this.nativeEvent=i,this.target=s,this.currentTarget=null;for(var l in e)e.hasOwnProperty(l)&&(n=e[l],this[l]=n?n(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Ui:Gd,this.isPropagationStopped=Gd,this}return ye(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Ui)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Ui)},persist:function(){},isPersistent:Ui}),t}var so={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},kc=pt(so),Si=ye({},so,{view:0,detail:0}),xw=pt(Si),da,fa,vo,xl=ye({},Si,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cc,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==vo&&(vo&&e.type==="mousemove"?(da=e.screenX-vo.screenX,fa=e.screenY-vo.screenY):fa=da=0,vo=e),da)},movementY:function(e){return"movementY"in e?e.movementY:fa}}),Zd=pt(xl),Sw=ye({},xl,{dataTransfer:0}),Ew=pt(Sw),kw=ye({},Si,{relatedTarget:0}),ha=pt(kw),Cw=ye({},so,{animationName:0,elapsedTime:0,pseudoElement:0}),_w=pt(Cw),Nw=ye({},so,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),bw=pt(Nw),Mw=ye({},so,{data:0}),qd=pt(Mw),Iw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Pw={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Dw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tw(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Dw[e])?!!t[e]:!1}function Cc(){return Tw}var Rw=ye({},Si,{key:function(e){if(e.key){var t=Iw[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=ys(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Pw[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cc,charCode:function(e){return e.type==="keypress"?ys(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?ys(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jw=pt(Rw),zw=ye({},xl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Jd=pt(zw),Aw=ye({},Si,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cc}),$w=pt(Aw),Lw=ye({},so,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ow=pt(Lw),Fw=ye({},xl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Hw=pt(Fw),Bw=[9,13,27,32],_c=hn&&"CompositionEvent"in window,To=null;hn&&"documentMode"in document&&(To=document.documentMode);var Vw=hn&&"TextEvent"in window&&!To,sg=hn&&(!_c||To&&8<To&&11>=To),ef=" ",tf=!1;function lg(e,t){switch(e){case"keyup":return Bw.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ag(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Er=!1;function Uw(e,t){switch(e){case"compositionend":return ag(t);case"keypress":return t.which!==32?null:(tf=!0,ef);case"textInput":return e=t.data,e===ef&&tf?null:e;default:return null}}function Ww(e,t){if(Er)return e==="compositionend"||!_c&&lg(e,t)?(e=ig(),ms=Ec=In=null,Er=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return sg&&t.locale!=="ko"?null:t.data;default:return null}}var Xw={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function nf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Xw[e.type]:t==="textarea"}function ug(e,t,n,r){Fp(r),t=Ls(t,"onChange"),0<t.length&&(n=new kc("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var Ro=null,Go=null;function Yw(e){xg(e,0)}function Sl(e){var t=_r(e);if(Rp(t))return e}function Qw(e,t){if(e==="change")return t}var cg=!1;if(hn){var pa;if(hn){var ga="oninput"in document;if(!ga){var rf=document.createElement("div");rf.setAttribute("oninput","return;"),ga=typeof rf.oninput=="function"}pa=ga}else pa=!1;cg=pa&&(!document.documentMode||9<document.documentMode)}function of(){Ro&&(Ro.detachEvent("onpropertychange",dg),Go=Ro=null)}function dg(e){if(e.propertyName==="value"&&Sl(Go)){var t=[];ug(t,Go,e,yc(e)),Up(Yw,t)}}function Kw(e,t,n){e==="focusin"?(of(),Ro=t,Go=n,Ro.attachEvent("onpropertychange",dg)):e==="focusout"&&of()}function Gw(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Sl(Go)}function Zw(e,t){if(e==="click")return Sl(t)}function qw(e,t){if(e==="input"||e==="change")return Sl(t)}function Jw(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $t=typeof Object.is=="function"?Object.is:Jw;function Zo(e,t){if($t(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var o=n[r];if(!Ka.call(t,o)||!$t(e[o],t[o]))return!1}return!0}function sf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function lf(e,t){var n=sf(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=sf(n)}}function fg(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?fg(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function hg(){for(var e=window,t=Ds();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=Ds(e.document)}return t}function Nc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function ex(e){var t=hg(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&fg(n.ownerDocument.documentElement,n)){if(r!==null&&Nc(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=n.textContent.length,i=Math.min(r.start,o);r=r.end===void 0?i:Math.min(r.end,o),!e.extend&&i>r&&(o=r,r=i,i=o),o=lf(n,i);var s=lf(n,r);o&&s&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==s.node||e.focusOffset!==s.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>r?(e.addRange(t),e.extend(s.node,s.offset)):(t.setEnd(s.node,s.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var tx=hn&&"documentMode"in document&&11>=document.documentMode,kr=null,pu=null,jo=null,gu=!1;function af(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;gu||kr==null||kr!==Ds(r)||(r=kr,"selectionStart"in r&&Nc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),jo&&Zo(jo,r)||(jo=r,r=Ls(pu,"onSelect"),0<r.length&&(t=new kc("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=kr)))}function Wi(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Cr={animationend:Wi("Animation","AnimationEnd"),animationiteration:Wi("Animation","AnimationIteration"),animationstart:Wi("Animation","AnimationStart"),transitionend:Wi("Transition","TransitionEnd")},ma={},pg={};hn&&(pg=document.createElement("div").style,"AnimationEvent"in window||(delete Cr.animationend.animation,delete Cr.animationiteration.animation,delete Cr.animationstart.animation),"TransitionEvent"in window||delete Cr.transitionend.transition);function El(e){if(ma[e])return ma[e];if(!Cr[e])return e;var t=Cr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in pg)return ma[e]=t[n];return e}var gg=El("animationend"),mg=El("animationiteration"),yg=El("animationstart"),vg=El("transitionend"),wg=new Map,uf="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Bn(e,t){wg.set(e,t),gr(t,[e])}for(var ya=0;ya<uf.length;ya++){var va=uf[ya],nx=va.toLowerCase(),rx=va[0].toUpperCase()+va.slice(1);Bn(nx,"on"+rx)}Bn(gg,"onAnimationEnd");Bn(mg,"onAnimationIteration");Bn(yg,"onAnimationStart");Bn("dblclick","onDoubleClick");Bn("focusin","onFocus");Bn("focusout","onBlur");Bn(vg,"onTransitionEnd");Wr("onMouseEnter",["mouseout","mouseover"]);Wr("onMouseLeave",["mouseout","mouseover"]);Wr("onPointerEnter",["pointerout","pointerover"]);Wr("onPointerLeave",["pointerout","pointerover"]);gr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));gr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));gr("onBeforeInput",["compositionend","keypress","textInput","paste"]);gr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));gr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));gr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var bo="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ox=new Set("cancel close invalid load scroll toggle".split(" ").concat(bo));function cf(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,nw(r,t,void 0,e),e.currentTarget=null}function xg(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],o=r.event;r=r.listeners;e:{var i=void 0;if(t)for(var s=r.length-1;0<=s;s--){var l=r[s],a=l.instance,u=l.currentTarget;if(l=l.listener,a!==i&&o.isPropagationStopped())break e;cf(o,l,u),i=a}else for(s=0;s<r.length;s++){if(l=r[s],a=l.instance,u=l.currentTarget,l=l.listener,a!==i&&o.isPropagationStopped())break e;cf(o,l,u),i=a}}}if(Rs)throw e=cu,Rs=!1,cu=null,e}function de(e,t){var n=t[xu];n===void 0&&(n=t[xu]=new Set);var r=e+"__bubble";n.has(r)||(Sg(t,e,2,!1),n.add(r))}function wa(e,t,n){var r=0;t&&(r|=4),Sg(n,e,r,t)}var Xi="_reactListening"+Math.random().toString(36).slice(2);function qo(e){if(!e[Xi]){e[Xi]=!0,Mp.forEach(function(n){n!=="selectionchange"&&(ox.has(n)||wa(n,!1,e),wa(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Xi]||(t[Xi]=!0,wa("selectionchange",!1,t))}}function Sg(e,t,n,r){switch(og(t)){case 1:var o=vw;break;case 4:o=ww;break;default:o=Sc}n=o.bind(null,t,n,e),o=void 0,!uu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),r?o!==void 0?e.addEventListener(t,n,{capture:!0,passive:o}):e.addEventListener(t,n,!0):o!==void 0?e.addEventListener(t,n,{passive:o}):e.addEventListener(t,n,!1)}function xa(e,t,n,r,o){var i=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var l=r.stateNode.containerInfo;if(l===o||l.nodeType===8&&l.parentNode===o)break;if(s===4)for(s=r.return;s!==null;){var a=s.tag;if((a===3||a===4)&&(a=s.stateNode.containerInfo,a===o||a.nodeType===8&&a.parentNode===o))return;s=s.return}for(;l!==null;){if(s=Zn(l),s===null)return;if(a=s.tag,a===5||a===6){r=i=s;continue e}l=l.parentNode}}r=r.return}Up(function(){var u=i,c=yc(n),d=[];e:{var f=wg.get(e);if(f!==void 0){var g=kc,y=e;switch(e){case"keypress":if(ys(n)===0)break e;case"keydown":case"keyup":g=jw;break;case"focusin":y="focus",g=ha;break;case"focusout":y="blur",g=ha;break;case"beforeblur":case"afterblur":g=ha;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":g=Zd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":g=Ew;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":g=$w;break;case gg:case mg:case yg:g=_w;break;case vg:g=Ow;break;case"scroll":g=xw;break;case"wheel":g=Hw;break;case"copy":case"cut":case"paste":g=bw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":g=Jd}var v=(t&4)!==0,x=!v&&e==="scroll",p=v?f!==null?f+"Capture":null:f;v=[];for(var m=u,h;m!==null;){h=m;var w=h.stateNode;if(h.tag===5&&w!==null&&(h=w,p!==null&&(w=Xo(m,p),w!=null&&v.push(Jo(m,w,h)))),x)break;m=m.return}0<v.length&&(f=new g(f,y,null,n,c),d.push({event:f,listeners:v}))}}if(!(t&7)){e:{if(f=e==="mouseover"||e==="pointerover",g=e==="mouseout"||e==="pointerout",f&&n!==lu&&(y=n.relatedTarget||n.fromElement)&&(Zn(y)||y[pn]))break e;if((g||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,g?(y=n.relatedTarget||n.toElement,g=u,y=y?Zn(y):null,y!==null&&(x=mr(y),y!==x||y.tag!==5&&y.tag!==6)&&(y=null)):(g=null,y=u),g!==y)){if(v=Zd,w="onMouseLeave",p="onMouseEnter",m="mouse",(e==="pointerout"||e==="pointerover")&&(v=Jd,w="onPointerLeave",p="onPointerEnter",m="pointer"),x=g==null?f:_r(g),h=y==null?f:_r(y),f=new v(w,m+"leave",g,n,c),f.target=x,f.relatedTarget=h,w=null,Zn(c)===u&&(v=new v(p,m+"enter",y,n,c),v.target=h,v.relatedTarget=x,w=v),x=w,g&&y)t:{for(v=g,p=y,m=0,h=v;h;h=vr(h))m++;for(h=0,w=p;w;w=vr(w))h++;for(;0<m-h;)v=vr(v),m--;for(;0<h-m;)p=vr(p),h--;for(;m--;){if(v===p||p!==null&&v===p.alternate)break t;v=vr(v),p=vr(p)}v=null}else v=null;g!==null&&df(d,f,g,v,!1),y!==null&&x!==null&&df(d,x,y,v,!0)}}e:{if(f=u?_r(u):window,g=f.nodeName&&f.nodeName.toLowerCase(),g==="select"||g==="input"&&f.type==="file")var C=Qw;else if(nf(f))if(cg)C=qw;else{C=Gw;var _=Kw}else(g=f.nodeName)&&g.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(C=Zw);if(C&&(C=C(e,u))){ug(d,C,n,c);break e}_&&_(e,f,u),e==="focusout"&&(_=f._wrapperState)&&_.controlled&&f.type==="number"&&nu(f,"number",f.value)}switch(_=u?_r(u):window,e){case"focusin":(nf(_)||_.contentEditable==="true")&&(kr=_,pu=u,jo=null);break;case"focusout":jo=pu=kr=null;break;case"mousedown":gu=!0;break;case"contextmenu":case"mouseup":case"dragend":gu=!1,af(d,n,c);break;case"selectionchange":if(tx)break;case"keydown":case"keyup":af(d,n,c)}var N;if(_c)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Er?lg(e,n)&&(b="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(b="onCompositionStart");b&&(sg&&n.locale!=="ko"&&(Er||b!=="onCompositionStart"?b==="onCompositionEnd"&&Er&&(N=ig()):(In=c,Ec="value"in In?In.value:In.textContent,Er=!0)),_=Ls(u,b),0<_.length&&(b=new qd(b,e,null,n,c),d.push({event:b,listeners:_}),N?b.data=N:(N=ag(n),N!==null&&(b.data=N)))),(N=Vw?Uw(e,n):Ww(e,n))&&(u=Ls(u,"onBeforeInput"),0<u.length&&(c=new qd("onBeforeInput","beforeinput",null,n,c),d.push({event:c,listeners:u}),c.data=N))}xg(d,t)})}function Jo(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ls(e,t){for(var n=t+"Capture",r=[];e!==null;){var o=e,i=o.stateNode;o.tag===5&&i!==null&&(o=i,i=Xo(e,n),i!=null&&r.unshift(Jo(e,i,o)),i=Xo(e,t),i!=null&&r.push(Jo(e,i,o))),e=e.return}return r}function vr(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function df(e,t,n,r,o){for(var i=t._reactName,s=[];n!==null&&n!==r;){var l=n,a=l.alternate,u=l.stateNode;if(a!==null&&a===r)break;l.tag===5&&u!==null&&(l=u,o?(a=Xo(n,i),a!=null&&s.unshift(Jo(n,a,l))):o||(a=Xo(n,i),a!=null&&s.push(Jo(n,a,l)))),n=n.return}s.length!==0&&e.push({event:t,listeners:s})}var ix=/\r\n?/g,sx=/\u0000|\uFFFD/g;function ff(e){return(typeof e=="string"?e:""+e).replace(ix,`
38
+ `).replace(sx,"")}function Yi(e,t,n){if(t=ff(t),ff(e)!==t&&n)throw Error(B(425))}function Os(){}var mu=null,yu=null;function vu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var wu=typeof setTimeout=="function"?setTimeout:void 0,lx=typeof clearTimeout=="function"?clearTimeout:void 0,hf=typeof Promise=="function"?Promise:void 0,ax=typeof queueMicrotask=="function"?queueMicrotask:typeof hf<"u"?function(e){return hf.resolve(null).then(e).catch(ux)}:wu;function ux(e){setTimeout(function(){throw e})}function Sa(e,t){var n=t,r=0;do{var o=n.nextSibling;if(e.removeChild(n),o&&o.nodeType===8)if(n=o.data,n==="/$"){if(r===0){e.removeChild(o),Ko(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=o}while(n);Ko(t)}function jn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?")break;if(t==="/$")return null}}return e}function pf(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var lo=Math.random().toString(36).slice(2),Zt="__reactFiber$"+lo,ei="__reactProps$"+lo,pn="__reactContainer$"+lo,xu="__reactEvents$"+lo,cx="__reactListeners$"+lo,dx="__reactHandles$"+lo;function Zn(e){var t=e[Zt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pn]||n[Zt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pf(e);e!==null;){if(n=e[Zt])return n;e=pf(e)}return t}e=n,n=e.parentNode}return null}function Ei(e){return e=e[Zt]||e[pn],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function _r(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(B(33))}function kl(e){return e[ei]||null}var Su=[],Nr=-1;function Vn(e){return{current:e}}function fe(e){0>Nr||(e.current=Su[Nr],Su[Nr]=null,Nr--)}function ue(e,t){Nr++,Su[Nr]=e.current,e.current=t}var Hn={},Fe=Vn(Hn),nt=Vn(!1),ir=Hn;function Xr(e,t){var n=e.type.contextTypes;if(!n)return Hn;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in n)o[i]=t[i];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function rt(e){return e=e.childContextTypes,e!=null}function Fs(){fe(nt),fe(Fe)}function gf(e,t,n){if(Fe.current!==Hn)throw Error(B(168));ue(Fe,t),ue(nt,n)}function Eg(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var o in r)if(!(o in t))throw Error(B(108,Kv(e)||"Unknown",o));return ye({},n,r)}function Hs(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Hn,ir=Fe.current,ue(Fe,e),ue(nt,nt.current),!0}function mf(e,t,n){var r=e.stateNode;if(!r)throw Error(B(169));n?(e=Eg(e,t,ir),r.__reactInternalMemoizedMergedChildContext=e,fe(nt),fe(Fe),ue(Fe,e)):fe(nt),ue(nt,n)}var an=null,Cl=!1,Ea=!1;function kg(e){an===null?an=[e]:an.push(e)}function fx(e){Cl=!0,kg(e)}function Un(){if(!Ea&&an!==null){Ea=!0;var e=0,t=ae;try{var n=an;for(ae=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}an=null,Cl=!1}catch(o){throw an!==null&&(an=an.slice(e+1)),Qp(vc,Un),o}finally{ae=t,Ea=!1}}return null}var br=[],Mr=0,Bs=null,Vs=0,vt=[],wt=0,sr=null,un=1,cn="";function Qn(e,t){br[Mr++]=Vs,br[Mr++]=Bs,Bs=e,Vs=t}function Cg(e,t,n){vt[wt++]=un,vt[wt++]=cn,vt[wt++]=sr,sr=e;var r=un;e=cn;var o=32-zt(r)-1;r&=~(1<<o),n+=1;var i=32-zt(t)+o;if(30<i){var s=o-o%5;i=(r&(1<<s)-1).toString(32),r>>=s,o-=s,un=1<<32-zt(t)+o|n<<o|r,cn=i+e}else un=1<<i|n<<o|r,cn=e}function bc(e){e.return!==null&&(Qn(e,1),Cg(e,1,0))}function Mc(e){for(;e===Bs;)Bs=br[--Mr],br[Mr]=null,Vs=br[--Mr],br[Mr]=null;for(;e===sr;)sr=vt[--wt],vt[wt]=null,cn=vt[--wt],vt[wt]=null,un=vt[--wt],vt[wt]=null}var ct=null,ut=null,pe=!1,Pt=null;function _g(e,t){var n=xt(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function yf(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,ct=e,ut=jn(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,ct=e,ut=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=sr!==null?{id:un,overflow:cn}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=xt(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,ct=e,ut=null,!0):!1;default:return!1}}function Eu(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ku(e){if(pe){var t=ut;if(t){var n=t;if(!yf(e,t)){if(Eu(e))throw Error(B(418));t=jn(n.nextSibling);var r=ct;t&&yf(e,t)?_g(r,n):(e.flags=e.flags&-4097|2,pe=!1,ct=e)}}else{if(Eu(e))throw Error(B(418));e.flags=e.flags&-4097|2,pe=!1,ct=e}}}function vf(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;ct=e}function Qi(e){if(e!==ct)return!1;if(!pe)return vf(e),pe=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!vu(e.type,e.memoizedProps)),t&&(t=ut)){if(Eu(e))throw Ng(),Error(B(418));for(;t;)_g(e,t),t=jn(t.nextSibling)}if(vf(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(B(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){ut=jn(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}ut=null}}else ut=ct?jn(e.stateNode.nextSibling):null;return!0}function Ng(){for(var e=ut;e;)e=jn(e.nextSibling)}function Yr(){ut=ct=null,pe=!1}function Ic(e){Pt===null?Pt=[e]:Pt.push(e)}var hx=vn.ReactCurrentBatchConfig;function wo(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(B(309));var r=n.stateNode}if(!r)throw Error(B(147,e));var o=r,i=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===i?t.ref:(t=function(s){var l=o.refs;s===null?delete l[i]:l[i]=s},t._stringRef=i,t)}if(typeof e!="string")throw Error(B(284));if(!n._owner)throw Error(B(290,e))}return e}function Ki(e,t){throw e=Object.prototype.toString.call(t),Error(B(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function wf(e){var t=e._init;return t(e._payload)}function bg(e){function t(p,m){if(e){var h=p.deletions;h===null?(p.deletions=[m],p.flags|=16):h.push(m)}}function n(p,m){if(!e)return null;for(;m!==null;)t(p,m),m=m.sibling;return null}function r(p,m){for(p=new Map;m!==null;)m.key!==null?p.set(m.key,m):p.set(m.index,m),m=m.sibling;return p}function o(p,m){return p=Ln(p,m),p.index=0,p.sibling=null,p}function i(p,m,h){return p.index=h,e?(h=p.alternate,h!==null?(h=h.index,h<m?(p.flags|=2,m):h):(p.flags|=2,m)):(p.flags|=1048576,m)}function s(p){return e&&p.alternate===null&&(p.flags|=2),p}function l(p,m,h,w){return m===null||m.tag!==6?(m=Ia(h,p.mode,w),m.return=p,m):(m=o(m,h),m.return=p,m)}function a(p,m,h,w){var C=h.type;return C===Sr?c(p,m,h.props.children,w,h.key):m!==null&&(m.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===kn&&wf(C)===m.type)?(w=o(m,h.props),w.ref=wo(p,m,h),w.return=p,w):(w=Cs(h.type,h.key,h.props,null,p.mode,w),w.ref=wo(p,m,h),w.return=p,w)}function u(p,m,h,w){return m===null||m.tag!==4||m.stateNode.containerInfo!==h.containerInfo||m.stateNode.implementation!==h.implementation?(m=Pa(h,p.mode,w),m.return=p,m):(m=o(m,h.children||[]),m.return=p,m)}function c(p,m,h,w,C){return m===null||m.tag!==7?(m=nr(h,p.mode,w,C),m.return=p,m):(m=o(m,h),m.return=p,m)}function d(p,m,h){if(typeof m=="string"&&m!==""||typeof m=="number")return m=Ia(""+m,p.mode,h),m.return=p,m;if(typeof m=="object"&&m!==null){switch(m.$$typeof){case Li:return h=Cs(m.type,m.key,m.props,null,p.mode,h),h.ref=wo(p,null,m),h.return=p,h;case xr:return m=Pa(m,p.mode,h),m.return=p,m;case kn:var w=m._init;return d(p,w(m._payload),h)}if(_o(m)||po(m))return m=nr(m,p.mode,h,null),m.return=p,m;Ki(p,m)}return null}function f(p,m,h,w){var C=m!==null?m.key:null;if(typeof h=="string"&&h!==""||typeof h=="number")return C!==null?null:l(p,m,""+h,w);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Li:return h.key===C?a(p,m,h,w):null;case xr:return h.key===C?u(p,m,h,w):null;case kn:return C=h._init,f(p,m,C(h._payload),w)}if(_o(h)||po(h))return C!==null?null:c(p,m,h,w,null);Ki(p,h)}return null}function g(p,m,h,w,C){if(typeof w=="string"&&w!==""||typeof w=="number")return p=p.get(h)||null,l(m,p,""+w,C);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Li:return p=p.get(w.key===null?h:w.key)||null,a(m,p,w,C);case xr:return p=p.get(w.key===null?h:w.key)||null,u(m,p,w,C);case kn:var _=w._init;return g(p,m,h,_(w._payload),C)}if(_o(w)||po(w))return p=p.get(h)||null,c(m,p,w,C,null);Ki(m,w)}return null}function y(p,m,h,w){for(var C=null,_=null,N=m,b=m=0,D=null;N!==null&&b<h.length;b++){N.index>b?(D=N,N=null):D=N.sibling;var A=f(p,N,h[b],w);if(A===null){N===null&&(N=D);break}e&&N&&A.alternate===null&&t(p,N),m=i(A,m,b),_===null?C=A:_.sibling=A,_=A,N=D}if(b===h.length)return n(p,N),pe&&Qn(p,b),C;if(N===null){for(;b<h.length;b++)N=d(p,h[b],w),N!==null&&(m=i(N,m,b),_===null?C=N:_.sibling=N,_=N);return pe&&Qn(p,b),C}for(N=r(p,N);b<h.length;b++)D=g(N,p,b,h[b],w),D!==null&&(e&&D.alternate!==null&&N.delete(D.key===null?b:D.key),m=i(D,m,b),_===null?C=D:_.sibling=D,_=D);return e&&N.forEach(function(j){return t(p,j)}),pe&&Qn(p,b),C}function v(p,m,h,w){var C=po(h);if(typeof C!="function")throw Error(B(150));if(h=C.call(h),h==null)throw Error(B(151));for(var _=C=null,N=m,b=m=0,D=null,A=h.next();N!==null&&!A.done;b++,A=h.next()){N.index>b?(D=N,N=null):D=N.sibling;var j=f(p,N,A.value,w);if(j===null){N===null&&(N=D);break}e&&N&&j.alternate===null&&t(p,N),m=i(j,m,b),_===null?C=j:_.sibling=j,_=j,N=D}if(A.done)return n(p,N),pe&&Qn(p,b),C;if(N===null){for(;!A.done;b++,A=h.next())A=d(p,A.value,w),A!==null&&(m=i(A,m,b),_===null?C=A:_.sibling=A,_=A);return pe&&Qn(p,b),C}for(N=r(p,N);!A.done;b++,A=h.next())A=g(N,p,b,A.value,w),A!==null&&(e&&A.alternate!==null&&N.delete(A.key===null?b:A.key),m=i(A,m,b),_===null?C=A:_.sibling=A,_=A);return e&&N.forEach(function(H){return t(p,H)}),pe&&Qn(p,b),C}function x(p,m,h,w){if(typeof h=="object"&&h!==null&&h.type===Sr&&h.key===null&&(h=h.props.children),typeof h=="object"&&h!==null){switch(h.$$typeof){case Li:e:{for(var C=h.key,_=m;_!==null;){if(_.key===C){if(C=h.type,C===Sr){if(_.tag===7){n(p,_.sibling),m=o(_,h.props.children),m.return=p,p=m;break e}}else if(_.elementType===C||typeof C=="object"&&C!==null&&C.$$typeof===kn&&wf(C)===_.type){n(p,_.sibling),m=o(_,h.props),m.ref=wo(p,_,h),m.return=p,p=m;break e}n(p,_);break}else t(p,_);_=_.sibling}h.type===Sr?(m=nr(h.props.children,p.mode,w,h.key),m.return=p,p=m):(w=Cs(h.type,h.key,h.props,null,p.mode,w),w.ref=wo(p,m,h),w.return=p,p=w)}return s(p);case xr:e:{for(_=h.key;m!==null;){if(m.key===_)if(m.tag===4&&m.stateNode.containerInfo===h.containerInfo&&m.stateNode.implementation===h.implementation){n(p,m.sibling),m=o(m,h.children||[]),m.return=p,p=m;break e}else{n(p,m);break}else t(p,m);m=m.sibling}m=Pa(h,p.mode,w),m.return=p,p=m}return s(p);case kn:return _=h._init,x(p,m,_(h._payload),w)}if(_o(h))return y(p,m,h,w);if(po(h))return v(p,m,h,w);Ki(p,h)}return typeof h=="string"&&h!==""||typeof h=="number"?(h=""+h,m!==null&&m.tag===6?(n(p,m.sibling),m=o(m,h),m.return=p,p=m):(n(p,m),m=Ia(h,p.mode,w),m.return=p,p=m),s(p)):n(p,m)}return x}var Qr=bg(!0),Mg=bg(!1),Us=Vn(null),Ws=null,Ir=null,Pc=null;function Dc(){Pc=Ir=Ws=null}function Tc(e){var t=Us.current;fe(Us),e._currentValue=t}function Cu(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Or(e,t){Ws=e,Pc=Ir=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(et=!0),e.firstContext=null)}function Et(e){var t=e._currentValue;if(Pc!==e)if(e={context:e,memoizedValue:t,next:null},Ir===null){if(Ws===null)throw Error(B(308));Ir=e,Ws.dependencies={lanes:0,firstContext:e}}else Ir=Ir.next=e;return t}var qn=null;function Rc(e){qn===null?qn=[e]:qn.push(e)}function Ig(e,t,n,r){var o=t.interleaved;return o===null?(n.next=n,Rc(t)):(n.next=o.next,o.next=n),t.interleaved=n,gn(e,r)}function gn(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Cn=!1;function jc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Pg(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function fn(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function zn(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ie&2){var o=r.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),r.pending=t,gn(e,n)}return o=r.interleaved,o===null?(t.next=t,Rc(r)):(t.next=o.next,o.next=t),r.interleaved=t,gn(e,n)}function vs(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wc(e,n)}}function xf(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var o=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var s={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?o=i=s:i=i.next=s,n=n.next}while(n!==null);i===null?o=i=t:i=i.next=t}else o=i=t;n={baseState:r.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Xs(e,t,n,r){var o=e.updateQueue;Cn=!1;var i=o.firstBaseUpdate,s=o.lastBaseUpdate,l=o.shared.pending;if(l!==null){o.shared.pending=null;var a=l,u=a.next;a.next=null,s===null?i=u:s.next=u,s=a;var c=e.alternate;c!==null&&(c=c.updateQueue,l=c.lastBaseUpdate,l!==s&&(l===null?c.firstBaseUpdate=u:l.next=u,c.lastBaseUpdate=a))}if(i!==null){var d=o.baseState;s=0,c=u=a=null,l=i;do{var f=l.lane,g=l.eventTime;if((r&f)===f){c!==null&&(c=c.next={eventTime:g,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var y=e,v=l;switch(f=t,g=n,v.tag){case 1:if(y=v.payload,typeof y=="function"){d=y.call(g,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=v.payload,f=typeof y=="function"?y.call(g,d,f):y,f==null)break e;d=ye({},d,f);break e;case 2:Cn=!0}}l.callback!==null&&l.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[l]:f.push(l))}else g={eventTime:g,lane:f,tag:l.tag,payload:l.payload,callback:l.callback,next:null},c===null?(u=c=g,a=d):c=c.next=g,s|=f;if(l=l.next,l===null){if(l=o.shared.pending,l===null)break;f=l,l=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(c===null&&(a=d),o.baseState=a,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do s|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);ar|=s,e.lanes=s,e.memoizedState=d}}function Sf(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],o=r.callback;if(o!==null){if(r.callback=null,r=n,typeof o!="function")throw Error(B(191,o));o.call(r)}}}var ki={},Jt=Vn(ki),ti=Vn(ki),ni=Vn(ki);function Jn(e){if(e===ki)throw Error(B(174));return e}function zc(e,t){switch(ue(ni,t),ue(ti,e),ue(Jt,ki),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ou(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=ou(t,e)}fe(Jt),ue(Jt,t)}function Kr(){fe(Jt),fe(ti),fe(ni)}function Dg(e){Jn(ni.current);var t=Jn(Jt.current),n=ou(t,e.type);t!==n&&(ue(ti,e),ue(Jt,n))}function Ac(e){ti.current===e&&(fe(Jt),fe(ti))}var ge=Vn(0);function Ys(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var ka=[];function $c(){for(var e=0;e<ka.length;e++)ka[e]._workInProgressVersionPrimary=null;ka.length=0}var ws=vn.ReactCurrentDispatcher,Ca=vn.ReactCurrentBatchConfig,lr=0,me=null,Ne=null,Pe=null,Qs=!1,zo=!1,ri=0,px=0;function $e(){throw Error(B(321))}function Lc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!$t(e[n],t[n]))return!1;return!0}function Oc(e,t,n,r,o,i){if(lr=i,me=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ws.current=e===null||e.memoizedState===null?vx:wx,e=n(r,o),zo){i=0;do{if(zo=!1,ri=0,25<=i)throw Error(B(301));i+=1,Pe=Ne=null,t.updateQueue=null,ws.current=xx,e=n(r,o)}while(zo)}if(ws.current=Ks,t=Ne!==null&&Ne.next!==null,lr=0,Pe=Ne=me=null,Qs=!1,t)throw Error(B(300));return e}function Fc(){var e=ri!==0;return ri=0,e}function Kt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Pe===null?me.memoizedState=Pe=e:Pe=Pe.next=e,Pe}function kt(){if(Ne===null){var e=me.alternate;e=e!==null?e.memoizedState:null}else e=Ne.next;var t=Pe===null?me.memoizedState:Pe.next;if(t!==null)Pe=t,Ne=e;else{if(e===null)throw Error(B(310));Ne=e,e={memoizedState:Ne.memoizedState,baseState:Ne.baseState,baseQueue:Ne.baseQueue,queue:Ne.queue,next:null},Pe===null?me.memoizedState=Pe=e:Pe=Pe.next=e}return Pe}function oi(e,t){return typeof t=="function"?t(e):t}function _a(e){var t=kt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=Ne,o=r.baseQueue,i=n.pending;if(i!==null){if(o!==null){var s=o.next;o.next=i.next,i.next=s}r.baseQueue=o=i,n.pending=null}if(o!==null){i=o.next,r=r.baseState;var l=s=null,a=null,u=i;do{var c=u.lane;if((lr&c)===c)a!==null&&(a=a.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),r=u.hasEagerState?u.eagerState:e(r,u.action);else{var d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};a===null?(l=a=d,s=r):a=a.next=d,me.lanes|=c,ar|=c}u=u.next}while(u!==null&&u!==i);a===null?s=r:a.next=l,$t(r,t.memoizedState)||(et=!0),t.memoizedState=r,t.baseState=s,t.baseQueue=a,n.lastRenderedState=r}if(e=n.interleaved,e!==null){o=e;do i=o.lane,me.lanes|=i,ar|=i,o=o.next;while(o!==e)}else o===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Na(e){var t=kt(),n=t.queue;if(n===null)throw Error(B(311));n.lastRenderedReducer=e;var r=n.dispatch,o=n.pending,i=t.memoizedState;if(o!==null){n.pending=null;var s=o=o.next;do i=e(i,s.action),s=s.next;while(s!==o);$t(i,t.memoizedState)||(et=!0),t.memoizedState=i,t.baseQueue===null&&(t.baseState=i),n.lastRenderedState=i}return[i,r]}function Tg(){}function Rg(e,t){var n=me,r=kt(),o=t(),i=!$t(r.memoizedState,o);if(i&&(r.memoizedState=o,et=!0),r=r.queue,Hc(Ag.bind(null,n,r,e),[e]),r.getSnapshot!==t||i||Pe!==null&&Pe.memoizedState.tag&1){if(n.flags|=2048,ii(9,zg.bind(null,n,r,o,t),void 0,null),Te===null)throw Error(B(349));lr&30||jg(n,t,o)}return o}function jg(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=me.updateQueue,t===null?(t={lastEffect:null,stores:null},me.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function zg(e,t,n,r){t.value=n,t.getSnapshot=r,$g(t)&&Lg(e)}function Ag(e,t,n){return n(function(){$g(t)&&Lg(e)})}function $g(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!$t(e,n)}catch{return!0}}function Lg(e){var t=gn(e,1);t!==null&&At(t,e,1,-1)}function Ef(e){var t=Kt();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:oi,lastRenderedState:e},t.queue=e,e=e.dispatch=yx.bind(null,me,e),[t.memoizedState,e]}function ii(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=me.updateQueue,t===null?(t={lastEffect:null,stores:null},me.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function Og(){return kt().memoizedState}function xs(e,t,n,r){var o=Kt();me.flags|=e,o.memoizedState=ii(1|t,n,void 0,r===void 0?null:r)}function _l(e,t,n,r){var o=kt();r=r===void 0?null:r;var i=void 0;if(Ne!==null){var s=Ne.memoizedState;if(i=s.destroy,r!==null&&Lc(r,s.deps)){o.memoizedState=ii(t,n,i,r);return}}me.flags|=e,o.memoizedState=ii(1|t,n,i,r)}function kf(e,t){return xs(8390656,8,e,t)}function Hc(e,t){return _l(2048,8,e,t)}function Fg(e,t){return _l(4,2,e,t)}function Hg(e,t){return _l(4,4,e,t)}function Bg(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Vg(e,t,n){return n=n!=null?n.concat([e]):null,_l(4,4,Bg.bind(null,t,e),n)}function Bc(){}function Ug(e,t){var n=kt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lc(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Wg(e,t){var n=kt();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&Lc(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function Xg(e,t,n){return lr&21?($t(n,t)||(n=Zp(),me.lanes|=n,ar|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,et=!0),e.memoizedState=n)}function gx(e,t){var n=ae;ae=n!==0&&4>n?n:4,e(!0);var r=Ca.transition;Ca.transition={};try{e(!1),t()}finally{ae=n,Ca.transition=r}}function Yg(){return kt().memoizedState}function mx(e,t,n){var r=$n(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},Qg(e))Kg(t,n);else if(n=Ig(e,t,n,r),n!==null){var o=Xe();At(n,e,r,o),Gg(n,t,r)}}function yx(e,t,n){var r=$n(e),o={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qg(e))Kg(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var s=t.lastRenderedState,l=i(s,n);if(o.hasEagerState=!0,o.eagerState=l,$t(l,s)){var a=t.interleaved;a===null?(o.next=o,Rc(t)):(o.next=a.next,a.next=o),t.interleaved=o;return}}catch{}finally{}n=Ig(e,t,o,r),n!==null&&(o=Xe(),At(n,e,r,o),Gg(n,t,r))}}function Qg(e){var t=e.alternate;return e===me||t!==null&&t===me}function Kg(e,t){zo=Qs=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Gg(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,wc(e,n)}}var Ks={readContext:Et,useCallback:$e,useContext:$e,useEffect:$e,useImperativeHandle:$e,useInsertionEffect:$e,useLayoutEffect:$e,useMemo:$e,useReducer:$e,useRef:$e,useState:$e,useDebugValue:$e,useDeferredValue:$e,useTransition:$e,useMutableSource:$e,useSyncExternalStore:$e,useId:$e,unstable_isNewReconciler:!1},vx={readContext:Et,useCallback:function(e,t){return Kt().memoizedState=[e,t===void 0?null:t],e},useContext:Et,useEffect:kf,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,xs(4194308,4,Bg.bind(null,t,e),n)},useLayoutEffect:function(e,t){return xs(4194308,4,e,t)},useInsertionEffect:function(e,t){return xs(4,2,e,t)},useMemo:function(e,t){var n=Kt();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=Kt();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=mx.bind(null,me,e),[r.memoizedState,e]},useRef:function(e){var t=Kt();return e={current:e},t.memoizedState=e},useState:Ef,useDebugValue:Bc,useDeferredValue:function(e){return Kt().memoizedState=e},useTransition:function(){var e=Ef(!1),t=e[0];return e=gx.bind(null,e[1]),Kt().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=me,o=Kt();if(pe){if(n===void 0)throw Error(B(407));n=n()}else{if(n=t(),Te===null)throw Error(B(349));lr&30||jg(r,t,n)}o.memoizedState=n;var i={value:n,getSnapshot:t};return o.queue=i,kf(Ag.bind(null,r,i,e),[e]),r.flags|=2048,ii(9,zg.bind(null,r,i,n,t),void 0,null),n},useId:function(){var e=Kt(),t=Te.identifierPrefix;if(pe){var n=cn,r=un;n=(r&~(1<<32-zt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=ri++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=px++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},wx={readContext:Et,useCallback:Ug,useContext:Et,useEffect:Hc,useImperativeHandle:Vg,useInsertionEffect:Fg,useLayoutEffect:Hg,useMemo:Wg,useReducer:_a,useRef:Og,useState:function(){return _a(oi)},useDebugValue:Bc,useDeferredValue:function(e){var t=kt();return Xg(t,Ne.memoizedState,e)},useTransition:function(){var e=_a(oi)[0],t=kt().memoizedState;return[e,t]},useMutableSource:Tg,useSyncExternalStore:Rg,useId:Yg,unstable_isNewReconciler:!1},xx={readContext:Et,useCallback:Ug,useContext:Et,useEffect:Hc,useImperativeHandle:Vg,useInsertionEffect:Fg,useLayoutEffect:Hg,useMemo:Wg,useReducer:Na,useRef:Og,useState:function(){return Na(oi)},useDebugValue:Bc,useDeferredValue:function(e){var t=kt();return Ne===null?t.memoizedState=e:Xg(t,Ne.memoizedState,e)},useTransition:function(){var e=Na(oi)[0],t=kt().memoizedState;return[e,t]},useMutableSource:Tg,useSyncExternalStore:Rg,useId:Yg,unstable_isNewReconciler:!1};function bt(e,t){if(e&&e.defaultProps){t=ye({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function _u(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:ye({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Nl={isMounted:function(e){return(e=e._reactInternals)?mr(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Xe(),o=$n(e),i=fn(r,o);i.payload=t,n!=null&&(i.callback=n),t=zn(e,i,o),t!==null&&(At(t,e,o,r),vs(t,e,o))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Xe(),o=$n(e),i=fn(r,o);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=zn(e,i,o),t!==null&&(At(t,e,o,r),vs(t,e,o))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Xe(),r=$n(e),o=fn(n,r);o.tag=2,t!=null&&(o.callback=t),t=zn(e,o,r),t!==null&&(At(t,e,r,n),vs(t,e,r))}};function Cf(e,t,n,r,o,i,s){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,i,s):t.prototype&&t.prototype.isPureReactComponent?!Zo(n,r)||!Zo(o,i):!0}function Zg(e,t,n){var r=!1,o=Hn,i=t.contextType;return typeof i=="object"&&i!==null?i=Et(i):(o=rt(t)?ir:Fe.current,r=t.contextTypes,i=(r=r!=null)?Xr(e,o):Hn),t=new t(n,i),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Nl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=o,e.__reactInternalMemoizedMaskedChildContext=i),t}function _f(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Nl.enqueueReplaceState(t,t.state,null)}function Nu(e,t,n,r){var o=e.stateNode;o.props=n,o.state=e.memoizedState,o.refs={},jc(e);var i=t.contextType;typeof i=="object"&&i!==null?o.context=Et(i):(i=rt(t)?ir:Fe.current,o.context=Xr(e,i)),o.state=e.memoizedState,i=t.getDerivedStateFromProps,typeof i=="function"&&(_u(e,t,i,n),o.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(t=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),t!==o.state&&Nl.enqueueReplaceState(o,o.state,null),Xs(e,n,o,r),o.state=e.memoizedState),typeof o.componentDidMount=="function"&&(e.flags|=4194308)}function Gr(e,t){try{var n="",r=t;do n+=Qv(r),r=r.return;while(r);var o=n}catch(i){o=`
39
39
  Error generating stack: `+i.message+`
40
- `+i.stack}return{value:e,source:t,stack:o,digest:null}}function ba(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function bu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Sx=typeof WeakMap=="function"?WeakMap:Map;function qg(e,t,n){n=fn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Zs||(Zs=!0,$u=r),bu(e,t)},n}function Jg(e,t,n){n=fn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){bu(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){bu(e,t),typeof r!="function"&&(An===null?An=new Set([this]):An.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Nf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Sx;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=jx.bind(null,e,t,n),t.then(e,e))}function bf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Mf(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=fn(-1,1),t.tag=2,jn(n,t,1))),n.lanes|=1),e)}var Ex=vn.ReactCurrentOwner,et=!1;function We(e,t,n,r){t.child=e===null?Mg(t,null,n,r):Qr(t,e.child,n,r)}function If(e,t,n,r,o){n=n.render;var i=t.ref;return Or(t,o),r=Oc(e,t,n,r,i,o),n=Fc(),e!==null&&!et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,mn(e,t,o)):(pe&&n&&bc(t),t.flags|=1,We(e,t,r,o),t.child)}function Pf(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Gc(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,em(e,t,i,r,o)):(e=Cs(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Zo,n(s,r)&&e.ref===t.ref)return mn(e,t,o)}return t.flags|=1,e=Ln(i,r),e.ref=t.ref,e.return=t,t.child=e}function em(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Zo(i,r)&&e.ref===t.ref)if(et=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(et=!0);else return t.lanes=e.lanes,mn(e,t,o)}return Mu(e,t,n,r,o)}function tm(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ue(Dr,lt),lt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ue(Dr,lt),lt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ue(Dr,lt),lt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ue(Dr,lt),lt|=r;return We(e,t,o,n),t.child}function nm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Mu(e,t,n,r,o){var i=rt(n)?ir:Fe.current;return i=Xr(t,i),Or(t,o),n=Oc(e,t,n,r,i,o),r=Fc(),e!==null&&!et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,mn(e,t,o)):(pe&&r&&bc(t),t.flags|=1,We(e,t,n,o),t.child)}function Df(e,t,n,r,o){if(rt(n)){var i=!0;Hs(t)}else i=!1;if(Or(t,o),t.stateNode===null)Ss(e,t),Zg(t,n,r),Nu(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Et(u):(u=rt(n)?ir:Fe.current,u=Xr(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&_f(t,s,r,u),Cn=!1;var f=t.memoizedState;s.state=f,Xs(t,r,s,o),a=t.memoizedState,l!==r||f!==a||nt.current||Cn?(typeof c=="function"&&(_u(t,n,c,r),a=t.memoizedState),(l=Cn||Cf(t,n,l,r,f,a,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),s.props=r,s.state=a,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Pg(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:bt(t.type,l),s.props=u,d=t.pendingProps,f=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=Et(a):(a=rt(n)?ir:Fe.current,a=Xr(t,a));var g=n.getDerivedStateFromProps;(c=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||f!==a)&&_f(t,s,r,a),Cn=!1,f=t.memoizedState,s.state=f,Xs(t,r,s,o);var y=t.memoizedState;l!==d||f!==y||nt.current||Cn?(typeof g=="function"&&(_u(t,n,g,r),y=t.memoizedState),(u=Cn||Cf(t,n,u,r,f,y,a)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,a)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=a,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Iu(e,t,n,r,i,o)}function Iu(e,t,n,r,o,i){nm(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&mf(t,n,!1),mn(e,t,i);r=t.stateNode,Ex.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Qr(t,e.child,null,i),t.child=Qr(t,null,l,i)):We(e,t,l,i),t.memoizedState=r.state,o&&mf(t,n,!0),t.child}function rm(e){var t=e.stateNode;t.pendingContext?gf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&gf(e,t.context,!1),jc(e,t.containerInfo)}function Tf(e,t,n,r,o){return Yr(),Ic(o),t.flags|=256,We(e,t,n,r),t.child}var Pu={dehydrated:null,treeContext:null,retryLane:0};function Du(e){return{baseLanes:e,cachePool:null,transitions:null}}function om(e,t,n){var r=t.pendingProps,o=ge.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ue(ge,o&1),e===null)return ku(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=Il(s,r,0,null),e=nr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Du(n),t.memoizedState=Pu,e):Vc(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return kx(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=Ln(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=Ln(l,i):(i=nr(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?Du(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Pu,r}return i=e.child,e=i.sibling,r=Ln(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Vc(e,t){return t=Il({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Gi(e,t,n,r){return r!==null&&Ic(r),Qr(t,e.child,null,n),e=Vc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kx(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=ba(Error(B(422))),Gi(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Il({mode:"visible",children:r.children},o,0,null),i=nr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Qr(t,e.child,null,s),t.child.memoizedState=Du(s),t.memoizedState=Pu,i);if(!(t.mode&1))return Gi(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(B(419)),r=ba(i,r,void 0),Gi(e,t,s,r)}if(l=(s&e.childLanes)!==0,et||l){if(r=Te,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,gn(e,o),At(r,e,o,-1))}return Kc(),r=ba(Error(B(421))),Gi(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Ax.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,ut=zn(o.nextSibling),ct=t,pe=!0,Pt=null,e!==null&&(vt[wt++]=un,vt[wt++]=cn,vt[wt++]=sr,un=e.id,cn=e.overflow,sr=t),t=Vc(t,r.children),t.flags|=4096,t)}function Rf(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Cu(e.return,t,n)}function Ma(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function im(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(We(e,t,r.children,n),r=ge.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rf(e,n,t);else if(e.tag===19)Rf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ue(ge,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Ys(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ma(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Ys(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ma(t,!0,n,null,i);break;case"together":Ma(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ss(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function mn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ar|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,n=Ln(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ln(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cx(e,t,n){switch(t.tag){case 3:rm(t),Yr();break;case 5:Dg(t);break;case 1:rt(t.type)&&Hs(t);break;case 4:jc(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ue(Us,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ue(ge,ge.current&1),t.flags|=128,null):n&t.child.childLanes?om(e,t,n):(ue(ge,ge.current&1),e=mn(e,t,n),e!==null?e.sibling:null);ue(ge,ge.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return im(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ue(ge,ge.current),r)break;return null;case 22:case 23:return t.lanes=0,tm(e,t,n)}return mn(e,t,n)}var sm,Tu,lm,am;sm=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Tu=function(){};lm=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Jn(Jt.current);var i=null;switch(n){case"input":o=eu(e,o),r=eu(e,r),i=[];break;case"select":o=ye({},o,{value:void 0}),r=ye({},r,{value:void 0}),i=[];break;case"textarea":o=ru(e,o),r=ru(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Os)}iu(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Uo.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var a=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&l[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(i||(i=[]),i.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(i=i||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(i=i||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Uo.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&de("scroll",e),i||l===a||(i=[])):(i=i||[]).push(u,a))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};am=function(e,t,n,r){n!==r&&(t.flags|=4)};function xo(e,t){if(!pe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Le(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _x(e,t,n){var r=t.pendingProps;switch(Mc(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Le(t),null;case 1:return rt(t.type)&&Fs(),Le(t),null;case 3:return r=t.stateNode,Kr(),fe(nt),fe(Fe),$c(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Qi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pt!==null&&(Fu(Pt),Pt=null))),Tu(e,t),Le(t),null;case 5:Ac(t);var o=Jn(ni.current);if(n=t.type,e!==null&&t.stateNode!=null)lm(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(B(166));return Le(t),null}if(e=Jn(Jt.current),Qi(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Zt]=t,r[ei]=i,e=(t.mode&1)!==0,n){case"dialog":de("cancel",r),de("close",r);break;case"iframe":case"object":case"embed":de("load",r);break;case"video":case"audio":for(o=0;o<bo.length;o++)de(bo[o],r);break;case"source":de("error",r);break;case"img":case"image":case"link":de("error",r),de("load",r);break;case"details":de("toggle",r);break;case"input":Hd(r,i),de("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},de("invalid",r);break;case"textarea":Vd(r,i),de("invalid",r)}iu(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&Yi(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Yi(r.textContent,l,e),o=["children",""+l]):Uo.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&de("scroll",r)}switch(n){case"input":Oi(r),Bd(r,i,!0);break;case"textarea":Oi(r),Ud(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Os)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ap(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Zt]=t,e[ei]=r,sm(e,t,!1,!1),t.stateNode=e;e:{switch(s=su(n,r),n){case"dialog":de("cancel",e),de("close",e),o=r;break;case"iframe":case"object":case"embed":de("load",e),o=r;break;case"video":case"audio":for(o=0;o<bo.length;o++)de(bo[o],e);o=r;break;case"source":de("error",e),o=r;break;case"img":case"image":case"link":de("error",e),de("load",e),o=r;break;case"details":de("toggle",e),o=r;break;case"input":Hd(e,r),o=eu(e,r),de("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=ye({},r,{value:void 0}),de("invalid",e);break;case"textarea":Vd(e,r),o=ru(e,r),de("invalid",e);break;default:o=r}iu(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var a=l[i];i==="style"?Op(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&$p(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Wo(e,a):typeof a=="number"&&Wo(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Uo.hasOwnProperty(i)?a!=null&&i==="onScroll"&&de("scroll",e):a!=null&&hc(e,i,a,s))}switch(n){case"input":Oi(e),Bd(e,r,!1);break;case"textarea":Oi(e),Ud(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Fn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?jr(e,!!r.multiple,i,!1):r.defaultValue!=null&&jr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Os)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Le(t),null;case 6:if(e&&t.stateNode!=null)am(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(n=Jn(ni.current),Jn(Jt.current),Qi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Zt]=t,(i=r.nodeValue!==n)&&(e=ct,e!==null))switch(e.tag){case 3:Yi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Yi(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Zt]=t,t.stateNode=r}return Le(t),null;case 13:if(fe(ge),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(pe&&ut!==null&&t.mode&1&&!(t.flags&128))Ng(),Yr(),t.flags|=98560,i=!1;else if(i=Qi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(B(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(B(317));i[Zt]=t}else Yr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Le(t),i=!1}else Pt!==null&&(Fu(Pt),Pt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ge.current&1?Me===0&&(Me=3):Kc())),t.updateQueue!==null&&(t.flags|=4),Le(t),null);case 4:return Kr(),Tu(e,t),e===null&&qo(t.stateNode.containerInfo),Le(t),null;case 10:return Tc(t.type._context),Le(t),null;case 17:return rt(t.type)&&Fs(),Le(t),null;case 19:if(fe(ge),i=t.memoizedState,i===null)return Le(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)xo(i,!1);else{if(Me!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Ys(e),s!==null){for(t.flags|=128,xo(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ue(ge,ge.current&1|2),t.child}e=e.sibling}i.tail!==null&&xe()>Zr&&(t.flags|=128,r=!0,xo(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ys(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),xo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!pe)return Le(t),null}else 2*xe()-i.renderingStartTime>Zr&&n!==1073741824&&(t.flags|=128,r=!0,xo(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=xe(),t.sibling=null,n=ge.current,ue(ge,r?n&1|2:n&1),t):(Le(t),null);case 22:case 23:return Qc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?lt&1073741824&&(Le(t),t.subtreeFlags&6&&(t.flags|=8192)):Le(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function Nx(e,t){switch(Mc(t),t.tag){case 1:return rt(t.type)&&Fs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Kr(),fe(nt),fe(Fe),$c(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ac(t),null;case 13:if(fe(ge),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));Yr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fe(ge),null;case 4:return Kr(),null;case 10:return Tc(t.type._context),null;case 22:case 23:return Qc(),null;case 24:return null;default:return null}}var Zi=!1,Oe=!1,bx=typeof WeakSet=="function"?WeakSet:Set,Q=null;function Pr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){we(e,t,r)}else n.current=null}function Ru(e,t,n){try{n()}catch(r){we(e,t,r)}}var zf=!1;function Mx(e,t){if(mu=As,e=hg(),Nc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var g;d!==n||o!==0&&d.nodeType!==3||(l=s+o),d!==i||r!==0&&d.nodeType!==3||(a=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(g=d.firstChild)!==null;)f=d,d=g;for(;;){if(d===e)break t;if(f===n&&++u===o&&(l=s),f===i&&++c===r&&(a=s),(g=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=g}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(yu={focusedElem:e,selectionRange:n},As=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,x=y.memoizedState,p=t.stateNode,m=p.getSnapshotBeforeUpdate(t.elementType===t.type?v:bt(t.type,v),x);p.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(w){we(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return y=zf,zf=!1,y}function Ao(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Ru(t,n,i)}o=o.next}while(o!==r)}}function bl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function zu(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function um(e){var t=e.alternate;t!==null&&(e.alternate=null,um(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Zt],delete t[ei],delete t[xu],delete t[cx],delete t[dx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function cm(e){return e.tag===5||e.tag===3||e.tag===4}function jf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function ju(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Os));else if(r!==4&&(e=e.child,e!==null))for(ju(e,t,n),e=e.sibling;e!==null;)ju(e,t,n),e=e.sibling}function Au(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Au(e,t,n),e=e.sibling;e!==null;)Au(e,t,n),e=e.sibling}var Re=null,Mt=!1;function xn(e,t,n){for(n=n.child;n!==null;)dm(e,t,n),n=n.sibling}function dm(e,t,n){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(wl,n)}catch{}switch(n.tag){case 5:Oe||Pr(n,t);case 6:var r=Re,o=Mt;Re=null,xn(e,t,n),Re=r,Mt=o,Re!==null&&(Mt?(e=Re,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Re.removeChild(n.stateNode));break;case 18:Re!==null&&(Mt?(e=Re,n=n.stateNode,e.nodeType===8?Sa(e.parentNode,n):e.nodeType===1&&Sa(e,n),Ko(e)):Sa(Re,n.stateNode));break;case 4:r=Re,o=Mt,Re=n.stateNode.containerInfo,Mt=!0,xn(e,t,n),Re=r,Mt=o;break;case 0:case 11:case 14:case 15:if(!Oe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Ru(n,t,s),o=o.next}while(o!==r)}xn(e,t,n);break;case 1:if(!Oe&&(Pr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){we(n,t,l)}xn(e,t,n);break;case 21:xn(e,t,n);break;case 22:n.mode&1?(Oe=(r=Oe)||n.memoizedState!==null,xn(e,t,n),Oe=r):xn(e,t,n);break;default:xn(e,t,n)}}function Af(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new bx),t.forEach(function(r){var o=$x.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Nt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Re=l.stateNode,Mt=!1;break e;case 3:Re=l.stateNode.containerInfo,Mt=!0;break e;case 4:Re=l.stateNode.containerInfo,Mt=!0;break e}l=l.return}if(Re===null)throw Error(B(160));dm(i,s,o),Re=null,Mt=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(u){we(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)fm(t,e),t=t.sibling}function fm(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Nt(t,e),Qt(e),r&4){try{Ao(3,e,e.return),bl(3,e)}catch(v){we(e,e.return,v)}try{Ao(5,e,e.return)}catch(v){we(e,e.return,v)}}break;case 1:Nt(t,e),Qt(e),r&512&&n!==null&&Pr(n,n.return);break;case 5:if(Nt(t,e),Qt(e),r&512&&n!==null&&Pr(n,n.return),e.flags&32){var o=e.stateNode;try{Wo(o,"")}catch(v){we(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&zp(o,i),su(l,s);var u=su(l,i);for(s=0;s<a.length;s+=2){var c=a[s],d=a[s+1];c==="style"?Op(o,d):c==="dangerouslySetInnerHTML"?$p(o,d):c==="children"?Wo(o,d):hc(o,c,d,u)}switch(l){case"input":tu(o,i);break;case"textarea":jp(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var g=i.value;g!=null?jr(o,!!i.multiple,g,!1):f!==!!i.multiple&&(i.defaultValue!=null?jr(o,!!i.multiple,i.defaultValue,!0):jr(o,!!i.multiple,i.multiple?[]:"",!1))}o[ei]=i}catch(v){we(e,e.return,v)}}break;case 6:if(Nt(t,e),Qt(e),r&4){if(e.stateNode===null)throw Error(B(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){we(e,e.return,v)}}break;case 3:if(Nt(t,e),Qt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ko(t.containerInfo)}catch(v){we(e,e.return,v)}break;case 4:Nt(t,e),Qt(e);break;case 13:Nt(t,e),Qt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Xc=xe())),r&4&&Af(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Oe=(u=Oe)||c,Nt(t,e),Oe=u):Nt(t,e),Qt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(Q=e,c=e.child;c!==null;){for(d=Q=c;Q!==null;){switch(f=Q,g=f.child,f.tag){case 0:case 11:case 14:case 15:Ao(4,f,f.return);break;case 1:Pr(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){we(r,n,v)}}break;case 5:Pr(f,f.return);break;case 22:if(f.memoizedState!==null){Lf(d);continue}}g!==null?(g.return=f,Q=g):Lf(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{o=d.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=d.stateNode,a=d.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=Lp("display",s))}catch(v){we(e,e.return,v)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){we(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Nt(t,e),Qt(e),r&4&&Af(e);break;case 21:break;default:Nt(t,e),Qt(e)}}function Qt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(cm(n)){var r=n;break e}n=n.return}throw Error(B(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Wo(o,""),r.flags&=-33);var i=jf(e);Au(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=jf(e);ju(e,l,s);break;default:throw Error(B(161))}}catch(a){we(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ix(e,t,n){Q=e,hm(e)}function hm(e,t,n){for(var r=(e.mode&1)!==0;Q!==null;){var o=Q,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Zi;if(!s){var l=o.alternate,a=l!==null&&l.memoizedState!==null||Oe;l=Zi;var u=Oe;if(Zi=s,(Oe=a)&&!u)for(Q=o;Q!==null;)s=Q,a=s.child,s.tag===22&&s.memoizedState!==null?Of(o):a!==null?(a.return=s,Q=a):Of(o);for(;i!==null;)Q=i,hm(i),i=i.sibling;Q=o,Zi=l,Oe=u}$f(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,Q=i):$f(e)}}function $f(e){for(;Q!==null;){var t=Q;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Oe||bl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Oe)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:bt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Sf(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Sf(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Ko(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}Oe||t.flags&512&&zu(t)}catch(f){we(t,t.return,f)}}if(t===e){Q=null;break}if(n=t.sibling,n!==null){n.return=t.return,Q=n;break}Q=t.return}}function Lf(e){for(;Q!==null;){var t=Q;if(t===e){Q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Q=n;break}Q=t.return}}function Of(e){for(;Q!==null;){var t=Q;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{bl(4,t)}catch(a){we(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){we(t,o,a)}}var i=t.return;try{zu(t)}catch(a){we(t,i,a)}break;case 5:var s=t.return;try{zu(t)}catch(a){we(t,s,a)}}}catch(a){we(t,t.return,a)}if(t===e){Q=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Q=l;break}Q=t.return}}var Px=Math.ceil,Gs=vn.ReactCurrentDispatcher,Uc=vn.ReactCurrentOwner,St=vn.ReactCurrentBatchConfig,ie=0,Te=null,Ee=null,ze=0,lt=0,Dr=Vn(0),Me=0,si=null,ar=0,Ml=0,Wc=0,$o=null,Je=null,Xc=0,Zr=1/0,ln=null,Zs=!1,$u=null,An=null,qi=!1,Pn=null,qs=0,Lo=0,Lu=null,Es=-1,ks=0;function Xe(){return ie&6?xe():Es!==-1?Es:Es=xe()}function $n(e){return e.mode&1?ie&2&&ze!==0?ze&-ze:hx.transition!==null?(ks===0&&(ks=Zp()),ks):(e=ae,e!==0||(e=window.event,e=e===void 0?16:og(e.type)),e):1}function At(e,t,n,r){if(50<Lo)throw Lo=0,Lu=null,Error(B(185));xi(e,n,r),(!(ie&2)||e!==Te)&&(e===Te&&(!(ie&2)&&(Ml|=n),Me===4&&bn(e,ze)),ot(e,r),n===1&&ie===0&&!(t.mode&1)&&(Zr=xe()+500,Cl&&Un()))}function ot(e,t){var n=e.callbackNode;hw(e,t);var r=js(e,e===Te?ze:0);if(r===0)n!==null&&Yd(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Yd(n),t===1)e.tag===0?fx(Ff.bind(null,e)):kg(Ff.bind(null,e)),ax(function(){!(ie&6)&&Un()}),n=null;else{switch(qp(r)){case 1:n=vc;break;case 4:n=Kp;break;case 16:n=zs;break;case 536870912:n=Gp;break;default:n=zs}n=Sm(n,pm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function pm(e,t){if(Es=-1,ks=0,ie&6)throw Error(B(327));var n=e.callbackNode;if(Fr()&&e.callbackNode!==n)return null;var r=js(e,e===Te?ze:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Js(e,r);else{t=r;var o=ie;ie|=2;var i=mm();(Te!==e||ze!==t)&&(ln=null,Zr=xe()+500,tr(e,t));do try{Rx();break}catch(l){gm(e,l)}while(!0);Dc(),Gs.current=i,ie=o,Ee!==null?t=0:(Te=null,ze=0,t=Me)}if(t!==0){if(t===2&&(o=du(e),o!==0&&(r=o,t=Ou(e,o))),t===1)throw n=si,tr(e,0),bn(e,r),ot(e,xe()),n;if(t===6)bn(e,r);else{if(o=e.current.alternate,!(r&30)&&!Dx(o)&&(t=Js(e,r),t===2&&(i=du(e),i!==0&&(r=i,t=Ou(e,i))),t===1))throw n=si,tr(e,0),bn(e,r),ot(e,xe()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(B(345));case 2:Kn(e,Je,ln);break;case 3:if(bn(e,r),(r&130023424)===r&&(t=Xc+500-xe(),10<t)){if(js(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Xe(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=wu(Kn.bind(null,e,Je,ln),t);break}Kn(e,Je,ln);break;case 4:if(bn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-jt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Px(r/1960))-r,10<r){e.timeoutHandle=wu(Kn.bind(null,e,Je,ln),r);break}Kn(e,Je,ln);break;case 5:Kn(e,Je,ln);break;default:throw Error(B(329))}}}return ot(e,xe()),e.callbackNode===n?pm.bind(null,e):null}function Ou(e,t){var n=$o;return e.current.memoizedState.isDehydrated&&(tr(e,t).flags|=256),e=Js(e,t),e!==2&&(t=Je,Je=n,t!==null&&Fu(t)),e}function Fu(e){Je===null?Je=e:Je.push.apply(Je,e)}function Dx(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!$t(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bn(e,t){for(t&=~Wc,t&=~Ml,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-jt(t),r=1<<n;e[n]=-1,t&=~r}}function Ff(e){if(ie&6)throw Error(B(327));Fr();var t=js(e,0);if(!(t&1))return ot(e,xe()),null;var n=Js(e,t);if(e.tag!==0&&n===2){var r=du(e);r!==0&&(t=r,n=Ou(e,r))}if(n===1)throw n=si,tr(e,0),bn(e,t),ot(e,xe()),n;if(n===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Kn(e,Je,ln),ot(e,xe()),null}function Yc(e,t){var n=ie;ie|=1;try{return e(t)}finally{ie=n,ie===0&&(Zr=xe()+500,Cl&&Un())}}function ur(e){Pn!==null&&Pn.tag===0&&!(ie&6)&&Fr();var t=ie;ie|=1;var n=St.transition,r=ae;try{if(St.transition=null,ae=1,e)return e()}finally{ae=r,St.transition=n,ie=t,!(ie&6)&&Un()}}function Qc(){lt=Dr.current,fe(Dr)}function tr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,lx(n)),Ee!==null)for(n=Ee.return;n!==null;){var r=n;switch(Mc(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Fs();break;case 3:Kr(),fe(nt),fe(Fe),$c();break;case 5:Ac(r);break;case 4:Kr();break;case 13:fe(ge);break;case 19:fe(ge);break;case 10:Tc(r.type._context);break;case 22:case 23:Qc()}n=n.return}if(Te=e,Ee=e=Ln(e.current,null),ze=lt=t,Me=0,si=null,Wc=Ml=ar=0,Je=$o=null,qn!==null){for(t=0;t<qn.length;t++)if(n=qn[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}qn=null}return e}function gm(e,t){do{var n=Ee;try{if(Dc(),ws.current=Ks,Qs){for(var r=me.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Qs=!1}if(lr=0,Pe=Ne=me=null,jo=!1,ri=0,Uc.current=null,n===null||n.return===null){Me=1,si=t,Ee=null;break}e:{var i=e,s=n.return,l=n,a=t;if(t=ze,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=l,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var g=bf(s);if(g!==null){g.flags&=-257,Mf(g,s,l,i,t),g.mode&1&&Nf(i,u,t),t=g,a=u;var y=t.updateQueue;if(y===null){var v=new Set;v.add(a),t.updateQueue=v}else y.add(a);break e}else{if(!(t&1)){Nf(i,u,t),Kc();break e}a=Error(B(426))}}else if(pe&&l.mode&1){var x=bf(s);if(x!==null){!(x.flags&65536)&&(x.flags|=256),Mf(x,s,l,i,t),Ic(Gr(a,l));break e}}i=a=Gr(a,l),Me!==4&&(Me=2),$o===null?$o=[i]:$o.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var p=qg(i,a,t);xf(i,p);break e;case 1:l=a;var m=i.type,h=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(An===null||!An.has(h)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=Jg(i,l,t);xf(i,w);break e}}i=i.return}while(i!==null)}vm(n)}catch(C){t=C,Ee===n&&n!==null&&(Ee=n=n.return);continue}break}while(!0)}function mm(){var e=Gs.current;return Gs.current=Ks,e===null?Ks:e}function Kc(){(Me===0||Me===3||Me===2)&&(Me=4),Te===null||!(ar&268435455)&&!(Ml&268435455)||bn(Te,ze)}function Js(e,t){var n=ie;ie|=2;var r=mm();(Te!==e||ze!==t)&&(ln=null,tr(e,t));do try{Tx();break}catch(o){gm(e,o)}while(!0);if(Dc(),ie=n,Gs.current=r,Ee!==null)throw Error(B(261));return Te=null,ze=0,Me}function Tx(){for(;Ee!==null;)ym(Ee)}function Rx(){for(;Ee!==null&&!ow();)ym(Ee)}function ym(e){var t=xm(e.alternate,e,lt);e.memoizedProps=e.pendingProps,t===null?vm(e):Ee=t,Uc.current=null}function vm(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Nx(n,t),n!==null){n.flags&=32767,Ee=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Me=6,Ee=null;return}}else if(n=_x(n,t,lt),n!==null){Ee=n;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);Me===0&&(Me=5)}function Kn(e,t,n){var r=ae,o=St.transition;try{St.transition=null,ae=1,zx(e,t,n,r)}finally{St.transition=o,ae=r}return null}function zx(e,t,n,r){do Fr();while(Pn!==null);if(ie&6)throw Error(B(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(B(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(pw(e,i),e===Te&&(Ee=Te=null,ze=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||qi||(qi=!0,Sm(zs,function(){return Fr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=St.transition,St.transition=null;var s=ae;ae=1;var l=ie;ie|=4,Uc.current=null,Mx(e,n),fm(n,e),ex(yu),As=!!mu,yu=mu=null,e.current=n,Ix(n),iw(),ie=l,ae=s,St.transition=i}else e.current=n;if(qi&&(qi=!1,Pn=e,qs=o),i=e.pendingLanes,i===0&&(An=null),aw(n.stateNode),ot(e,xe()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Zs)throw Zs=!1,e=$u,$u=null,e;return qs&1&&e.tag!==0&&Fr(),i=e.pendingLanes,i&1?e===Lu?Lo++:(Lo=0,Lu=e):Lo=0,Un(),null}function Fr(){if(Pn!==null){var e=qp(qs),t=St.transition,n=ae;try{if(St.transition=null,ae=16>e?16:e,Pn===null)var r=!1;else{if(e=Pn,Pn=null,qs=0,ie&6)throw Error(B(331));var o=ie;for(ie|=4,Q=e.current;Q!==null;){var i=Q,s=i.child;if(Q.flags&16){var l=i.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(Q=u;Q!==null;){var c=Q;switch(c.tag){case 0:case 11:case 15:Ao(8,c,i)}var d=c.child;if(d!==null)d.return=c,Q=d;else for(;Q!==null;){c=Q;var f=c.sibling,g=c.return;if(um(c),c===u){Q=null;break}if(f!==null){f.return=g,Q=f;break}Q=g}}}var y=i.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var x=v.sibling;v.sibling=null,v=x}while(v!==null)}}Q=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,Q=s;else e:for(;Q!==null;){if(i=Q,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ao(9,i,i.return)}var p=i.sibling;if(p!==null){p.return=i.return,Q=p;break e}Q=i.return}}var m=e.current;for(Q=m;Q!==null;){s=Q;var h=s.child;if(s.subtreeFlags&2064&&h!==null)h.return=s,Q=h;else e:for(s=m;Q!==null;){if(l=Q,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:bl(9,l)}}catch(C){we(l,l.return,C)}if(l===s){Q=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,Q=w;break e}Q=l.return}}if(ie=o,Un(),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(wl,e)}catch{}r=!0}return r}finally{ae=n,St.transition=t}}return!1}function Hf(e,t,n){t=Gr(n,t),t=qg(e,t,1),e=jn(e,t,1),t=Xe(),e!==null&&(xi(e,1,t),ot(e,t))}function we(e,t,n){if(e.tag===3)Hf(e,e,n);else for(;t!==null;){if(t.tag===3){Hf(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(An===null||!An.has(r))){e=Gr(n,e),e=Jg(t,e,1),t=jn(t,e,1),e=Xe(),t!==null&&(xi(t,1,e),ot(t,e));break}}t=t.return}}function jx(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Xe(),e.pingedLanes|=e.suspendedLanes&n,Te===e&&(ze&n)===n&&(Me===4||Me===3&&(ze&130023424)===ze&&500>xe()-Xc?tr(e,0):Wc|=n),ot(e,t)}function wm(e,t){t===0&&(e.mode&1?(t=Bi,Bi<<=1,!(Bi&130023424)&&(Bi=4194304)):t=1);var n=Xe();e=gn(e,t),e!==null&&(xi(e,t,n),ot(e,n))}function Ax(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wm(e,n)}function $x(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),wm(e,n)}var xm;xm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||nt.current)et=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return et=!1,Cx(e,t,n);et=!!(e.flags&131072)}else et=!1,pe&&t.flags&1048576&&Cg(t,Vs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ss(e,t),e=t.pendingProps;var o=Xr(t,Fe.current);Or(t,n),o=Oc(null,t,r,e,o,n);var i=Fc();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rt(r)?(i=!0,Hs(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,zc(t),o.updater=Nl,t.stateNode=o,o._reactInternals=t,Nu(t,r,e,n),t=Iu(null,t,r,!0,i,n)):(t.tag=0,pe&&i&&bc(t),We(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ss(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Ox(r),e=bt(r,e),o){case 0:t=Mu(null,t,r,e,n);break e;case 1:t=Df(null,t,r,e,n);break e;case 11:t=If(null,t,r,e,n);break e;case 14:t=Pf(null,t,r,bt(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:bt(r,o),Mu(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:bt(r,o),Df(e,t,r,o,n);case 3:e:{if(rm(t),e===null)throw Error(B(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Pg(e,t),Xs(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Gr(Error(B(423)),t),t=Tf(e,t,r,n,o);break e}else if(r!==o){o=Gr(Error(B(424)),t),t=Tf(e,t,r,n,o);break e}else for(ut=zn(t.stateNode.containerInfo.firstChild),ct=t,pe=!0,Pt=null,n=Mg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Yr(),r===o){t=mn(e,t,n);break e}We(e,t,r,n)}t=t.child}return t;case 5:return Dg(t),e===null&&ku(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,vu(r,o)?s=null:i!==null&&vu(r,i)&&(t.flags|=32),nm(e,t),We(e,t,s,n),t.child;case 6:return e===null&&ku(t),null;case 13:return om(e,t,n);case 4:return jc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qr(t,null,r,n):We(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:bt(r,o),If(e,t,r,o,n);case 7:return We(e,t,t.pendingProps,n),t.child;case 8:return We(e,t,t.pendingProps.children,n),t.child;case 12:return We(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,ue(Us,r._currentValue),r._currentValue=s,i!==null)if($t(i.value,s)){if(i.children===o.children&&!nt.current){t=mn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=fn(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Cu(i.return,n,t),l.lanes|=n;break}a=a.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(B(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Cu(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}We(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Or(t,n),o=Et(o),r=r(o),t.flags|=1,We(e,t,r,n),t.child;case 14:return r=t.type,o=bt(r,t.pendingProps),o=bt(r.type,o),Pf(e,t,r,o,n);case 15:return em(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:bt(r,o),Ss(e,t),t.tag=1,rt(r)?(e=!0,Hs(t)):e=!1,Or(t,n),Zg(t,r,o),Nu(t,r,o,n),Iu(null,t,r,!0,e,n);case 19:return im(e,t,n);case 22:return tm(e,t,n)}throw Error(B(156,t.tag))};function Sm(e,t){return Qp(e,t)}function Lx(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xt(e,t,n,r){return new Lx(e,t,n,r)}function Gc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ox(e){if(typeof e=="function")return Gc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gc)return 11;if(e===mc)return 14}return 2}function Ln(e,t){var n=e.alternate;return n===null?(n=xt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Cs(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Gc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Sr:return nr(n.children,o,i,t);case pc:s=8,o|=8;break;case Ga:return e=xt(12,n,t,o|2),e.elementType=Ga,e.lanes=i,e;case Za:return e=xt(13,n,t,o),e.elementType=Za,e.lanes=i,e;case qa:return e=xt(19,n,t,o),e.elementType=qa,e.lanes=i,e;case Dp:return Il(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ip:s=10;break e;case Pp:s=9;break e;case gc:s=11;break e;case mc:s=14;break e;case kn:s=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=xt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function nr(e,t,n,r){return e=xt(7,e,r,t),e.lanes=n,e}function Il(e,t,n,r){return e=xt(22,e,r,t),e.elementType=Dp,e.lanes=n,e.stateNode={isHidden:!1},e}function Ia(e,t,n){return e=xt(6,e,null,t),e.lanes=n,e}function Pa(e,t,n){return t=xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fx(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ca(0),this.expirationTimes=ca(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ca(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Zc(e,t,n,r,o,i,s,l,a){return e=new Fx(e,t,n,l,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=xt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},zc(i),e}function Hx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:xr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Em(e){if(!e)return Hn;e=e._reactInternals;e:{if(mr(e)!==e||e.tag!==1)throw Error(B(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(rt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(B(171))}if(e.tag===1){var n=e.type;if(rt(n))return Eg(e,n,t)}return t}function km(e,t,n,r,o,i,s,l,a){return e=Zc(n,r,!0,e,o,i,s,l,a),e.context=Em(null),n=e.current,r=Xe(),o=$n(n),i=fn(r,o),i.callback=t??null,jn(n,i,o),e.current.lanes=o,xi(e,o,r),ot(e,r),e}function Pl(e,t,n,r){var o=t.current,i=Xe(),s=$n(o);return n=Em(n),t.context===null?t.context=n:t.pendingContext=n,t=fn(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=jn(o,t,s),e!==null&&(At(e,o,s,i),vs(e,o,s)),s}function el(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Bf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function qc(e,t){Bf(e,t),(e=e.alternate)&&Bf(e,t)}function Bx(){return null}var Cm=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jc(e){this._internalRoot=e}Dl.prototype.render=Jc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));Pl(e,t,null,null)};Dl.prototype.unmount=Jc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ur(function(){Pl(null,e,null,null)}),t[pn]=null}};function Dl(e){this._internalRoot=e}Dl.prototype.unstable_scheduleHydration=function(e){if(e){var t=tg();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Nn.length&&t!==0&&t<Nn[n].priority;n++);Nn.splice(n,0,e),n===0&&rg(e)}};function ed(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Tl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Vf(){}function Vx(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=el(s);i.call(u)}}var s=km(t,r,e,0,null,!1,!1,"",Vf);return e._reactRootContainer=s,e[pn]=s.current,qo(e.nodeType===8?e.parentNode:e),ur(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=el(a);l.call(u)}}var a=Zc(e,0,!1,null,null,!1,!1,"",Vf);return e._reactRootContainer=a,e[pn]=a.current,qo(e.nodeType===8?e.parentNode:e),ur(function(){Pl(t,a,n,r)}),a}function Rl(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var a=el(s);l.call(a)}}Pl(t,s,e,o)}else s=Vx(n,t,e,o,r);return el(s)}Jp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=No(t.pendingLanes);n!==0&&(wc(t,n|1),ot(t,xe()),!(ie&6)&&(Zr=xe()+500,Un()))}break;case 13:ur(function(){var r=gn(e,1);if(r!==null){var o=Xe();At(r,e,1,o)}}),qc(e,1)}};xc=function(e){if(e.tag===13){var t=gn(e,134217728);if(t!==null){var n=Xe();At(t,e,134217728,n)}qc(e,134217728)}};eg=function(e){if(e.tag===13){var t=$n(e),n=gn(e,t);if(n!==null){var r=Xe();At(n,e,t,r)}qc(e,t)}};tg=function(){return ae};ng=function(e,t){var n=ae;try{return ae=e,t()}finally{ae=n}};au=function(e,t,n){switch(t){case"input":if(tu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=kl(r);if(!o)throw Error(B(90));Rp(r),tu(r,o)}}}break;case"textarea":jp(e,n);break;case"select":t=n.value,t!=null&&jr(e,!!n.multiple,t,!1)}};Bp=Yc;Vp=ur;var Ux={usingClientEntryPoint:!1,Events:[Ei,_r,kl,Fp,Hp,Yc]},So={findFiberByHostInstance:Zn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Wx={bundleType:So.bundleType,version:So.version,rendererPackageName:So.rendererPackageName,rendererConfig:So.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:vn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Xp(e),e===null?null:e.stateNode},findFiberByHostInstance:So.findFiberByHostInstance||Bx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ji=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ji.isDisabled&&Ji.supportsFiber)try{wl=Ji.inject(Wx),qt=Ji}catch{}}ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ux;ht.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ed(t))throw Error(B(200));return Hx(e,t,null,n)};ht.createRoot=function(e,t){if(!ed(e))throw Error(B(299));var n=!1,r="",o=Cm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Zc(e,1,!1,null,null,n,!1,r,o),e[pn]=t.current,qo(e.nodeType===8?e.parentNode:e),new Jc(t)};ht.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=Xp(t),e=e===null?null:e.stateNode,e};ht.flushSync=function(e){return ur(e)};ht.hydrate=function(e,t,n){if(!Tl(t))throw Error(B(200));return Rl(null,e,t,!0,n)};ht.hydrateRoot=function(e,t,n){if(!ed(e))throw Error(B(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=Cm;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=km(t,null,e,1,n??null,o,!1,i,s),e[pn]=t.current,qo(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Dl(t)};ht.render=function(e,t,n){if(!Tl(t))throw Error(B(200));return Rl(null,e,t,!1,n)};ht.unmountComponentAtNode=function(e){if(!Tl(e))throw Error(B(40));return e._reactRootContainer?(ur(function(){Rl(null,null,e,!1,function(){e._reactRootContainer=null,e[pn]=null})}),!0):!1};ht.unstable_batchedUpdates=Yc;ht.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Tl(n))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return Rl(e,t,n,!1,r)};ht.version="18.3.1-next-f1338f8080-20240426";function _m(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_m)}catch(e){console.error(e)}}_m(),_p.exports=ht;var Tr=_p.exports,Nm,Uf=Tr;Nm=Uf.createRoot,Uf.hydrateRoot;const Wf=e=>{let t;const n=new Set,r=(u,c)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const f=t;t=c??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(g=>g(t,f))}},o=()=>t,l={setState:r,getState:o,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=t=e(r,o,l);return l},Xx=e=>e?Wf(e):Wf,Yx=e=>e;function Qx(e,t=Yx){const n=Se.useSyncExternalStore(e.subscribe,Se.useCallback(()=>t(e.getState()),[e,t]),Se.useCallback(()=>t(e.getInitialState()),[e,t]));return Se.useDebugValue(n),n}const Xf=e=>{const t=Xx(e),n=r=>Qx(t,r);return Object.assign(n,t),n},Kx=e=>e?Xf(e):Xf;let Yf,Da=null;function Ta(e){Da=e,clearTimeout(Yf),Yf=setTimeout(()=>{const t=Da;Da=null,t&&fetch("/api/project",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})},500)}const Gx=e=>new Promise(t=>setTimeout(t,e)),Dt=Kx((e,t)=>({project:{version:1,pages:[]},selection:{kind:"none"},openPageId:null,viewMode:"layout",busy:null,error:null,previewNonce:0,past:[],future:[],load:async()=>{const n=await(await fetch("/api/project")).json();e({project:n})},setProject:(n,r={})=>{const{persist:o=!0,history:i=!0}=r;e(i?s=>({past:[...s.past.slice(-49),s.project],future:[],project:n}):{project:n}),o&&Ta(n)},select:n=>e({selection:n}),openPage:n=>e({openPageId:n,viewMode:"layout",selection:{kind:"none"}}),setViewMode:n=>e({viewMode:n,selection:{kind:"none"}}),api:async(n,r)=>{if(t().busy)return;e({busy:"Starting…",error:null});const o=Date.now();try{const i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r??{})}),s=await i.json();if(!i.ok)throw new Error(s.error||i.statusText);let l=s;if(s.jobId)for(;;){await Gx(1200);const u=await fetch(`/api/jobs/${s.jobId}`),c=await u.json();if(!u.ok)throw new Error(c.error||u.statusText);const d=Math.round((Date.now()-o)/1e3);if(e({busy:`${c.label}: ${c.detail} (${d}s)`}),c.status==="error")throw new Error(c.error);if(c.status==="done"){l=c.result;break}}const a=l;a&&Array.isArray(a.pages)&&e(u=>({past:[...u.past.slice(-49),u.project],future:[],project:a})),e(u=>({previewNonce:u.previewNonce+1}))}catch(i){e({error:String(i)})}finally{e({busy:null})}},mutatePage:(n,r,o={})=>{const i=structuredClone(t().project),s=i.pages.find(l=>l.id===n);s&&(r(s),t().setProject(i,{history:o.history??!0}))},undo:()=>{const{past:n,project:r,future:o}=t();if(n.length===0)return;const i=n[n.length-1];e({past:n.slice(0,-1),future:[r,...o].slice(0,50),project:i}),Ta(i)},redo:()=>{const{past:n,project:r,future:o}=t();if(o.length===0)return;const i=o[0];e({past:[...n,r].slice(-50),future:o.slice(1),project:i}),Ta(i)}}));function Hr(e,t){if(e.id===t)return e;for(const n of e.children??[]){const r=Hr(n,t);if(r)return r}}function bm(e,t){if(e.id===t)return[e];for(const n of e.children??[]){const r=bm(n,t);if(r.length)return[e,...r]}return[]}function tl(e,t){const n=e.children??[],r=n.findIndex(o=>o.id===t);if(r>=0)return{parent:e,index:r};for(const o of n){const i=tl(o,t);if(i)return i}}function zl(e,t){var n;return{...e,children:(n=e.children)==null?void 0:n.filter(r=>r.id!==t).map(r=>zl(r,t))}}function Mm(e,t,n,r){var o;if(e.id===t){const i=[...e.children??[]];return i.splice(n,0,r),{...e,children:i}}return{...e,children:(o=e.children)==null?void 0:o.map(i=>Mm(i,t,n,r))}}function Zx(e,t,n){if(t===n)return e;const r=Hr(e,t);if(!r||Hr(r,n))return e;const o=tl(e,t),i=zl(e,t),s=tl(i,n);if(!s||!o)return e;let l=s.index;return s.parent.id===o.parent.id&&o.index<s.index&&(l+=1),Mm(i,s.parent.id,l,r)}function Im(e,t,n){var r;return e.id===t?{...e,children:[...e.children??[],n]}:{...e,children:(r=e.children)==null?void 0:r.map(o=>Im(o,t,n))}}let Qf=0;function Pm(){return Qf+=1,`blk_${Date.now().toString(36)}${Qf}`}function qx(e){const t=e.charAt(0).toUpperCase()+e.slice(1).replace("-"," "),n={id:Pm(),type:e,label:t};return e==="row"&&(n.direction="row"),(e==="section"||e==="column")&&(n.direction="column"),n}function Dm(e){var t;return{...e,id:Pm(),children:(t=e.children)==null?void 0:t.map(Dm)}}const Jx=["section","row","column","nav","hero","card-grid","list","form","footer","text","image","button"];function ke(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=ke(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var e1={value:()=>{}};function jl(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new _s(n)}function _s(e){this._=e}function t1(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}_s.prototype=jl.prototype={constructor:_s,on:function(e,t){var n=this._,r=t1(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=n1(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=Kf(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Kf(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new _s(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},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)}};function n1(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Kf(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=e1,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Hu="http://www.w3.org/1999/xhtml";const Gf={svg:"http://www.w3.org/2000/svg",xhtml:Hu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Al(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Gf.hasOwnProperty(t)?{space:Gf[t],local:e}:e}function r1(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Hu&&t.documentElement.namespaceURI===Hu?t.createElement(e):t.createElementNS(n,e)}}function o1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Tm(e){var t=Al(e);return(t.local?o1:r1)(t)}function i1(){}function td(e){return e==null?i1:function(){return this.querySelector(e)}}function s1(e){typeof e!="function"&&(e=td(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=new Array(s),a,u,c=0;c<s;++c)(a=i[c])&&(u=e.call(a,a.__data__,c,i))&&("__data__"in a&&(u.__data__=a.__data__),l[c]=u);return new ft(r,this._parents)}function l1(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function a1(){return[]}function Rm(e){return e==null?a1:function(){return this.querySelectorAll(e)}}function u1(e){return function(){return l1(e.apply(this,arguments))}}function c1(e){typeof e=="function"?e=u1(e):e=Rm(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&(r.push(e.call(a,a.__data__,u,s)),o.push(a));return new ft(r,o)}function zm(e){return function(){return this.matches(e)}}function jm(e){return function(t){return t.matches(e)}}var d1=Array.prototype.find;function f1(e){return function(){return d1.call(this.children,e)}}function h1(){return this.firstElementChild}function p1(e){return this.select(e==null?h1:f1(typeof e=="function"?e:jm(e)))}var g1=Array.prototype.filter;function m1(){return Array.from(this.children)}function y1(e){return function(){return g1.call(this.children,e)}}function v1(e){return this.selectAll(e==null?m1:y1(typeof e=="function"?e:jm(e)))}function w1(e){typeof e!="function"&&(e=zm(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new ft(r,this._parents)}function Am(e){return new Array(e.length)}function x1(){return new ft(this._enter||this._groups.map(Am),this._parents)}function nl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}nl.prototype={constructor:nl,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function S1(e){return function(){return e}}function E1(e,t,n,r,o,i){for(var s=0,l,a=t.length,u=i.length;s<u;++s)(l=t[s])?(l.__data__=i[s],r[s]=l):n[s]=new nl(e,i[s]);for(;s<a;++s)(l=t[s])&&(o[s]=l)}function k1(e,t,n,r,o,i,s){var l,a,u=new Map,c=t.length,d=i.length,f=new Array(c),g;for(l=0;l<c;++l)(a=t[l])&&(f[l]=g=s.call(a,a.__data__,l,t)+"",u.has(g)?o[l]=a:u.set(g,a));for(l=0;l<d;++l)g=s.call(e,i[l],l,i)+"",(a=u.get(g))?(r[l]=a,a.__data__=i[l],u.delete(g)):n[l]=new nl(e,i[l]);for(l=0;l<c;++l)(a=t[l])&&u.get(f[l])===a&&(o[l]=a)}function C1(e){return e.__data__}function _1(e,t){if(!arguments.length)return Array.from(this,C1);var n=t?k1:E1,r=this._parents,o=this._groups;typeof e!="function"&&(e=S1(e));for(var i=o.length,s=new Array(i),l=new Array(i),a=new Array(i),u=0;u<i;++u){var c=r[u],d=o[u],f=d.length,g=N1(e.call(c,c&&c.__data__,u,r)),y=g.length,v=l[u]=new Array(y),x=s[u]=new Array(y),p=a[u]=new Array(f);n(c,d,v,x,p,g,t);for(var m=0,h=0,w,C;m<y;++m)if(w=v[m]){for(m>=h&&(h=m+1);!(C=x[h])&&++h<y;);w._next=C||null}}return s=new ft(s,r),s._enter=l,s._exit=a,s}function N1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function b1(){return new ft(this._exit||this._groups.map(Am),this._parents)}function M1(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function I1(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),l=new Array(o),a=0;a<s;++a)for(var u=n[a],c=r[a],d=u.length,f=l[a]=new Array(d),g,y=0;y<d;++y)(g=u[y]||c[y])&&(f[y]=g);for(;a<o;++a)l[a]=n[a];return new ft(l,this._parents)}function P1(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function D1(e){e||(e=T1);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],l=s.length,a=o[i]=new Array(l),u,c=0;c<l;++c)(u=s[c])&&(a[c]=u);a.sort(t)}return new ft(o,this._parents).order()}function T1(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function R1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function z1(){return Array.from(this)}function j1(){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 s=r[o];if(s)return s}return null}function A1(){let e=0;for(const t of this)++e;return e}function $1(){return!this.node()}function L1(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,l;i<s;++i)(l=o[i])&&e.call(l,l.__data__,i,o);return this}function O1(e){return function(){this.removeAttribute(e)}}function F1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function H1(e,t){return function(){this.setAttribute(e,t)}}function B1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function V1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function U1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function W1(e,t){var n=Al(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?F1:O1:typeof t=="function"?n.local?U1:V1:n.local?B1:H1)(n,t))}function $m(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function X1(e){return function(){this.style.removeProperty(e)}}function Y1(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Q1(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function K1(e,t,n){return arguments.length>1?this.each((t==null?X1:typeof t=="function"?Q1:Y1)(e,t,n??"")):qr(this.node(),e)}function qr(e,t){return e.style.getPropertyValue(t)||$m(e).getComputedStyle(e,null).getPropertyValue(t)}function G1(e){return function(){delete this[e]}}function Z1(e,t){return function(){this[e]=t}}function q1(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function J1(e,t){return arguments.length>1?this.each((t==null?G1:typeof t=="function"?q1:Z1)(e,t)):this.node()[e]}function Lm(e){return e.trim().split(/^|\s+/)}function nd(e){return e.classList||new Om(e)}function Om(e){this._node=e,this._names=Lm(e.getAttribute("class")||"")}Om.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Fm(e,t){for(var n=nd(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Hm(e,t){for(var n=nd(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function eS(e){return function(){Fm(this,e)}}function tS(e){return function(){Hm(this,e)}}function nS(e,t){return function(){(t.apply(this,arguments)?Fm:Hm)(this,e)}}function rS(e,t){var n=Lm(e+"");if(arguments.length<2){for(var r=nd(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?nS:t?eS:tS)(n,t))}function oS(){this.textContent=""}function iS(e){return function(){this.textContent=e}}function sS(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function lS(e){return arguments.length?this.each(e==null?oS:(typeof e=="function"?sS:iS)(e)):this.node().textContent}function aS(){this.innerHTML=""}function uS(e){return function(){this.innerHTML=e}}function cS(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function dS(e){return arguments.length?this.each(e==null?aS:(typeof e=="function"?cS:uS)(e)):this.node().innerHTML}function fS(){this.nextSibling&&this.parentNode.appendChild(this)}function hS(){return this.each(fS)}function pS(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function gS(){return this.each(pS)}function mS(e){var t=typeof e=="function"?e:Tm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function yS(){return null}function vS(e,t){var n=typeof e=="function"?e:Tm(e),r=t==null?yS:typeof t=="function"?t:td(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function wS(){var e=this.parentNode;e&&e.removeChild(this)}function xS(){return this.each(wS)}function SS(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ES(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function kS(e){return this.select(e?ES:SS)}function CS(e){return arguments.length?this.property("__data__",e):this.node().__data__}function _S(e){return function(t){e.call(this,t,this.__data__)}}function NS(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function bS(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function MS(e,t,n){return function(){var r=this.__on,o,i=_S(t);if(r){for(var s=0,l=r.length;s<l;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function IS(e,t,n){var r=NS(e+""),o,i=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,u=l.length,c;a<u;++a)for(o=0,c=l[a];o<i;++o)if((s=r[o]).type===c.type&&s.name===c.name)return c.value}return}for(l=t?MS:bS,o=0;o<i;++o)this.each(l(r[o],t,n));return this}function Bm(e,t,n){var r=$m(e),o=r.CustomEvent;typeof o=="function"?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 PS(e,t){return function(){return Bm(this,e,t)}}function DS(e,t){return function(){return Bm(this,e,t.apply(this,arguments))}}function TS(e,t){return this.each((typeof t=="function"?DS:PS)(e,t))}function*RS(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var Vm=[null];function ft(e,t){this._groups=e,this._parents=t}function Ci(){return new ft([[document.documentElement]],Vm)}function zS(){return this}ft.prototype=Ci.prototype={constructor:ft,select:s1,selectAll:c1,selectChild:p1,selectChildren:v1,filter:w1,data:_1,enter:x1,exit:b1,join:M1,merge:I1,selection:zS,order:P1,sort:D1,call:R1,nodes:z1,node:j1,size:A1,empty:$1,each:L1,attr:W1,style:K1,property:J1,classed:rS,text:lS,html:dS,raise:hS,lower:gS,append:mS,insert:vS,remove:xS,clone:kS,datum:CS,on:IS,dispatch:TS,[Symbol.iterator]:RS};function at(e){return typeof e=="string"?new ft([[document.querySelector(e)]],[document.documentElement]):new ft([[e]],Vm)}function jS(e){let t;for(;t=e.sourceEvent;)e=t;return e}function It(e,t){if(e=jS(e),t===void 0&&(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()),[r.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]}const AS={passive:!1},li={capture:!0,passive:!1};function Ra(e){e.stopImmediatePropagation()}function Br(e){e.preventDefault(),e.stopImmediatePropagation()}function Um(e){var t=e.document.documentElement,n=at(e).on("dragstart.drag",Br,li);"onselectstart"in t?n.on("selectstart.drag",Br,li):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Wm(e,t){var n=e.document.documentElement,r=at(e).on("dragstart.drag",null);t&&(r.on("click.drag",Br,li),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const es=e=>()=>e;function Bu(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:l,dx:a,dy:u,dispatch:c}){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:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}Bu.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function $S(e){return!e.ctrlKey&&!e.button}function LS(){return this.parentNode}function OS(e,t){return t??{x:e.x,y:e.y}}function FS(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xm(){var e=$S,t=LS,n=OS,r=FS,o={},i=jl("start","drag","end"),s=0,l,a,u,c,d=0;function f(w){w.on("mousedown.drag",g).filter(r).on("touchstart.drag",x).on("touchmove.drag",p,AS).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(w,C){if(!(c||!e.call(this,w,C))){var _=h(this,t.call(this,w,C),w,C,"mouse");_&&(at(w.view).on("mousemove.drag",y,li).on("mouseup.drag",v,li),Um(w.view),Ra(w),u=!1,l=w.clientX,a=w.clientY,_("start",w))}}function y(w){if(Br(w),!u){var C=w.clientX-l,_=w.clientY-a;u=C*C+_*_>d}o.mouse("drag",w)}function v(w){at(w.view).on("mousemove.drag mouseup.drag",null),Wm(w.view,u),Br(w),o.mouse("end",w)}function x(w,C){if(e.call(this,w,C)){var _=w.changedTouches,N=t.call(this,w,C),b=_.length,D,A;for(D=0;D<b;++D)(A=h(this,N,w,C,_[D].identifier,_[D]))&&(Ra(w),A("start",w,_[D]))}}function p(w){var C=w.changedTouches,_=C.length,N,b;for(N=0;N<_;++N)(b=o[C[N].identifier])&&(Br(w),b("drag",w,C[N]))}function m(w){var C=w.changedTouches,_=C.length,N,b;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),N=0;N<_;++N)(b=o[C[N].identifier])&&(Ra(w),b("end",w,C[N]))}function h(w,C,_,N,b,D){var A=i.copy(),z=It(D||_,C),H,L,E;if((E=n.call(w,new Bu("beforestart",{sourceEvent:_,target:f,identifier:b,active:s,x:z[0],y:z[1],dx:0,dy:0,dispatch:A}),N))!=null)return H=E.x-z[0]||0,L=E.y-z[1]||0,function T(P,R,I){var M=z,j;switch(P){case"start":o[b]=T,j=s++;break;case"end":delete o[b],--s;case"drag":z=It(I||R,C),j=s;break}A.call(P,w,new Bu(P,{sourceEvent:R,subject:E,target:f,identifier:b,active:j,x:z[0]+H,y:z[1]+L,dx:z[0]-M[0],dy:z[1]-M[1],dispatch:A}),N)}}return f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:es(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:es(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:es(w),f):n},f.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:es(!!w),f):r},f.on=function(){var w=i.on.apply(i,arguments);return w===i?f:w},f.clickDistance=function(w){return arguments.length?(d=(w=+w)*w,f):Math.sqrt(d)},f}function rd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ym(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _i(){}var ai=.7,rl=1/ai,Vr="\\s*([+-]?\\d+)\\s*",ui="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",en="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",HS=/^#([0-9a-f]{3,8})$/,BS=new RegExp(`^rgb\\(${Vr},${Vr},${Vr}\\)$`),VS=new RegExp(`^rgb\\(${en},${en},${en}\\)$`),US=new RegExp(`^rgba\\(${Vr},${Vr},${Vr},${ui}\\)$`),WS=new RegExp(`^rgba\\(${en},${en},${en},${ui}\\)$`),XS=new RegExp(`^hsl\\(${ui},${en},${en}\\)$`),YS=new RegExp(`^hsla\\(${ui},${en},${en},${ui}\\)$`),Zf={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};rd(_i,cr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qf,formatHex:qf,formatHex8:QS,formatHsl:KS,formatRgb:Jf,toString:Jf});function qf(){return this.rgb().formatHex()}function QS(){return this.rgb().formatHex8()}function KS(){return Qm(this).formatHsl()}function Jf(){return this.rgb().formatRgb()}function cr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=HS.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?eh(t):n===3?new tt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ts(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ts(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=BS.exec(e))?new tt(t[1],t[2],t[3],1):(t=VS.exec(e))?new tt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=US.exec(e))?ts(t[1],t[2],t[3],t[4]):(t=WS.exec(e))?ts(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=XS.exec(e))?rh(t[1],t[2]/100,t[3]/100,1):(t=YS.exec(e))?rh(t[1],t[2]/100,t[3]/100,t[4]):Zf.hasOwnProperty(e)?eh(Zf[e]):e==="transparent"?new tt(NaN,NaN,NaN,0):null}function eh(e){return new tt(e>>16&255,e>>8&255,e&255,1)}function ts(e,t,n,r){return r<=0&&(e=t=n=NaN),new tt(e,t,n,r)}function GS(e){return e instanceof _i||(e=cr(e)),e?(e=e.rgb(),new tt(e.r,e.g,e.b,e.opacity)):new tt}function Vu(e,t,n,r){return arguments.length===1?GS(e):new tt(e,t,n,r??1)}function tt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}rd(tt,Vu,Ym(_i,{brighter(e){return e=e==null?rl:Math.pow(rl,e),new tt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ai:Math.pow(ai,e),new tt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new tt(rr(this.r),rr(this.g),rr(this.b),ol(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:th,formatHex:th,formatHex8:ZS,formatRgb:nh,toString:nh}));function th(){return`#${er(this.r)}${er(this.g)}${er(this.b)}`}function ZS(){return`#${er(this.r)}${er(this.g)}${er(this.b)}${er((isNaN(this.opacity)?1:this.opacity)*255)}`}function nh(){const e=ol(this.opacity);return`${e===1?"rgb(":"rgba("}${rr(this.r)}, ${rr(this.g)}, ${rr(this.b)}${e===1?")":`, ${e})`}`}function ol(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function rr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function er(e){return e=rr(e),(e<16?"0":"")+e.toString(16)}function rh(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Tt(e,t,n,r)}function Qm(e){if(e instanceof Tt)return new Tt(e.h,e.s,e.l,e.opacity);if(e instanceof _i||(e=cr(e)),!e)return new Tt;if(e instanceof Tt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,l=i-o,a=(i+o)/2;return l?(t===i?s=(n-r)/l+(n<r)*6:n===i?s=(r-t)/l+2:s=(t-n)/l+4,l/=a<.5?i+o:2-i-o,s*=60):l=a>0&&a<1?0:s,new Tt(s,l,a,e.opacity)}function qS(e,t,n,r){return arguments.length===1?Qm(e):new Tt(e,t,n,r??1)}function Tt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}rd(Tt,qS,Ym(_i,{brighter(e){return e=e==null?rl:Math.pow(rl,e),new Tt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ai:Math.pow(ai,e),new Tt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new tt(za(e>=240?e-240:e+120,o,r),za(e,o,r),za(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Tt(oh(this.h),ns(this.s),ns(this.l),ol(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=ol(this.opacity);return`${e===1?"hsl(":"hsla("}${oh(this.h)}, ${ns(this.s)*100}%, ${ns(this.l)*100}%${e===1?")":`, ${e})`}`}}));function oh(e){return e=(e||0)%360,e<0?e+360:e}function ns(e){return Math.max(0,Math.min(1,e||0))}function za(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const od=e=>()=>e;function JS(e,t){return function(n){return e+n*t}}function eE(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function tE(e){return(e=+e)==1?Km:function(t,n){return n-t?eE(t,n,e):od(isNaN(t)?n:t)}}function Km(e,t){var n=t-e;return n?JS(e,n):od(isNaN(e)?t:e)}const il=function e(t){var n=tE(t);function r(o,i){var s=n((o=Vu(o)).r,(i=Vu(i)).r),l=n(o.g,i.g),a=n(o.b,i.b),u=Km(o.opacity,i.opacity);return function(c){return o.r=s(c),o.g=l(c),o.b=a(c),o.opacity=u(c),o+""}}return r.gamma=e,r}(1);function nE(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function rE(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function oE(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=Oo(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(l){for(s=0;s<r;++s)i[s]=o[s](l);return i}}function iE(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Gt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function sE(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=Oo(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var Uu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ja=new RegExp(Uu.source,"g");function lE(e){return function(){return e}}function aE(e){return function(t){return e(t)+""}}function Gm(e,t){var n=Uu.lastIndex=ja.lastIndex=0,r,o,i,s=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Uu.exec(e))&&(o=ja.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),l[s]?l[s]+=i:l[++s]=i),(r=r[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,a.push({i:s,x:Gt(r,o)})),n=ja.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?a[0]?aE(a[0].x):lE(t):(t=a.length,function(u){for(var c=0,d;c<t;++c)l[(d=a[c]).i]=d.x(u);return l.join("")})}function Oo(e,t){var n=typeof t,r;return t==null||n==="boolean"?od(t):(n==="number"?Gt:n==="string"?(r=cr(t))?(t=r,il):Gm:t instanceof cr?il:t instanceof Date?iE:rE(t)?nE:Array.isArray(t)?oE:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?sE:Gt)(e,t)}var ih=180/Math.PI,Wu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Zm(e,t,n,r,o,i){var s,l,a;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,a/=l),e*r<t*n&&(e=-e,t=-t,a=-a,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*ih,skewX:Math.atan(a)*ih,scaleX:s,scaleY:l}}var rs;function uE(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Wu:Zm(t.a,t.b,t.c,t.d,t.e,t.f)}function cE(e){return e==null||(rs||(rs=document.createElementNS("http://www.w3.org/2000/svg","g")),rs.setAttribute("transform",e),!(e=rs.transform.baseVal.consolidate()))?Wu:(e=e.matrix,Zm(e.a,e.b,e.c,e.d,e.e,e.f))}function qm(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,d,f,g,y){if(u!==d||c!==f){var v=g.push("translate(",null,t,null,n);y.push({i:v-4,x:Gt(u,d)},{i:v-2,x:Gt(c,f)})}else(d||f)&&g.push("translate("+d+t+f+n)}function s(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:Gt(u,c)})):c&&d.push(o(d)+"rotate("+c+r)}function l(u,c,d,f){u!==c?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:Gt(u,c)}):c&&d.push(o(d)+"skewX("+c+r)}function a(u,c,d,f,g,y){if(u!==d||c!==f){var v=g.push(o(g)+"scale(",null,",",null,")");y.push({i:v-4,x:Gt(u,d)},{i:v-2,x:Gt(c,f)})}else(d!==1||f!==1)&&g.push(o(g)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,d,f),s(u.rotate,c.rotate,d,f),l(u.skewX,c.skewX,d,f),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(g){for(var y=-1,v=f.length,x;++y<v;)d[(x=f[y]).i]=x.x(g);return d.join("")}}}var dE=qm(uE,"px, ","px)","deg)"),fE=qm(cE,", ",")",")"),hE=1e-12;function sh(e){return((e=Math.exp(e))+1/e)/2}function pE(e){return((e=Math.exp(e))-1/e)/2}function gE(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ns=function e(t,n,r){function o(i,s){var l=i[0],a=i[1],u=i[2],c=s[0],d=s[1],f=s[2],g=c-l,y=d-a,v=g*g+y*y,x,p;if(v<hE)p=Math.log(f/u)/t,x=function(N){return[l+N*g,a+N*y,u*Math.exp(t*N*p)]};else{var m=Math.sqrt(v),h=(f*f-u*u+r*v)/(2*u*n*m),w=(f*f-u*u-r*v)/(2*f*n*m),C=Math.log(Math.sqrt(h*h+1)-h),_=Math.log(Math.sqrt(w*w+1)-w);p=(_-C)/t,x=function(N){var b=N*p,D=sh(C),A=u/(n*m)*(D*gE(t*b+C)-pE(C));return[l+A*g,a+A*y,u*D/sh(t*b+C)]}}return x.duration=p*1e3*t/Math.SQRT2,x}return o.rho=function(i){var s=Math.max(.001,+i),l=s*s,a=l*l;return e(s,l,a)},o}(Math.SQRT2,2,4);var Jr=0,Mo=0,Eo=0,Jm=1e3,sl,Io,ll=0,dr=0,$l=0,ci=typeof performance=="object"&&performance.now?performance:Date,e0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function id(){return dr||(e0(mE),dr=ci.now()+$l)}function mE(){dr=0}function al(){this._call=this._time=this._next=null}al.prototype=t0.prototype={constructor:al,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?id():+n)+(t==null?0:+t),!this._next&&Io!==this&&(Io?Io._next=this:sl=this,Io=this),this._call=e,this._time=n,Xu()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xu())}};function t0(e,t,n){var r=new al;return r.restart(e,t,n),r}function yE(){id(),++Jr;for(var e=sl,t;e;)(t=dr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Jr}function lh(){dr=(ll=ci.now())+$l,Jr=Mo=0;try{yE()}finally{Jr=0,wE(),dr=0}}function vE(){var e=ci.now(),t=e-ll;t>Jm&&($l-=t,ll=e)}function wE(){for(var e,t=sl,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:sl=n);Io=e,Xu(r)}function Xu(e){if(!Jr){Mo&&(Mo=clearTimeout(Mo));var t=e-dr;t>24?(e<1/0&&(Mo=setTimeout(lh,e-ci.now()-$l)),Eo&&(Eo=clearInterval(Eo))):(Eo||(ll=ci.now(),Eo=setInterval(vE,Jm)),Jr=1,e0(lh))}}function ah(e,t,n){var r=new al;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var xE=jl("start","end","cancel","interrupt"),SE=[],n0=0,uh=1,Yu=2,bs=3,ch=4,Qu=5,Ms=6;function Ll(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;EE(e,n,{name:t,index:r,group:o,on:xE,tween:SE,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:n0})}function sd(e,t){var n=Ft(e,t);if(n.state>n0)throw new Error("too late; already scheduled");return n}function nn(e,t){var n=Ft(e,t);if(n.state>bs)throw new Error("too late; already running");return n}function Ft(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function EE(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=t0(i,0,n.time);function i(u){n.state=uh,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,f,g;if(n.state!==uh)return a();for(c in r)if(g=r[c],g.name===n.name){if(g.state===bs)return ah(s);g.state===ch?(g.state=Ms,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[c]):+c<t&&(g.state=Ms,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[c])}if(ah(function(){n.state===bs&&(n.state=ch,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=Yu,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Yu){for(n.state=bs,o=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(g=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=g);o.length=d+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=Qu,1),d=-1,f=o.length;++d<f;)o[d].call(e,c);n.state===Qu&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Ms,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Is(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>Yu&&r.state<Qu,r.state=Ms,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function kE(e){return this.each(function(){Is(this,e)})}function CE(e,t){var n,r;return function(){var o=nn(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function _E(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=nn(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var l={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=l;break}a===u&&o.push(l)}i.tween=o}}function NE(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ft(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?CE:_E)(n,e,t))}function ld(e,t,n){var r=e._id;return e.each(function(){var o=nn(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Ft(o,r).value[t]}}function r0(e,t){var n;return(typeof t=="number"?Gt:t instanceof cr?il:(n=cr(t))?(t=n,il):Gm)(e,t)}function bE(e){return function(){this.removeAttribute(e)}}function ME(e){return function(){this.removeAttributeNS(e.space,e.local)}}function IE(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function PE(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function DE(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function TE(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function RE(e,t){var n=Al(e),r=n==="transform"?fE:r0;return this.attrTween(e,typeof t=="function"?(n.local?TE:DE)(n,r,ld(this,"attr."+e,t)):t==null?(n.local?ME:bE)(n):(n.local?PE:IE)(n,r,t))}function zE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function jE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function AE(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&jE(e,i)),n}return o._value=t,o}function $E(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&zE(e,i)),n}return o._value=t,o}function LE(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Al(e);return this.tween(n,(r.local?AE:$E)(r,t))}function OE(e,t){return function(){sd(this,e).delay=+t.apply(this,arguments)}}function FE(e,t){return t=+t,function(){sd(this,e).delay=t}}function HE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?OE:FE)(t,e)):Ft(this.node(),t).delay}function BE(e,t){return function(){nn(this,e).duration=+t.apply(this,arguments)}}function VE(e,t){return t=+t,function(){nn(this,e).duration=t}}function UE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?BE:VE)(t,e)):Ft(this.node(),t).duration}function WE(e,t){if(typeof t!="function")throw new Error;return function(){nn(this,e).ease=t}}function XE(e){var t=this._id;return arguments.length?this.each(WE(t,e)):Ft(this.node(),t).ease}function YE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;nn(this,e).ease=n}}function QE(e){if(typeof e!="function")throw new Error;return this.each(YE(this._id,e))}function KE(e){typeof e!="function"&&(e=zm(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new yn(r,this._parents,this._name,this._id)}function GE(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),s=new Array(r),l=0;l<i;++l)for(var a=t[l],u=n[l],c=a.length,d=s[l]=new Array(c),f,g=0;g<c;++g)(f=a[g]||u[g])&&(d[g]=f);for(;l<r;++l)s[l]=t[l];return new yn(s,this._parents,this._name,this._id)}function ZE(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function qE(e,t,n){var r,o,i=ZE(t)?sd:nn;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function JE(e,t){var n=this._id;return arguments.length<2?Ft(this.node(),n).on.on(e):this.each(qE(n,e,t))}function ek(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function tk(){return this.on("end.remove",ek(this._id))}function nk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=td(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var l=r[s],a=l.length,u=i[s]=new Array(a),c,d,f=0;f<a;++f)(c=l[f])&&(d=e.call(c,c.__data__,f,l))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,Ll(u[f],t,n,f,u,Ft(c,n)));return new yn(i,this._parents,t,n)}function rk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Rm(e));for(var r=this._groups,o=r.length,i=[],s=[],l=0;l<o;++l)for(var a=r[l],u=a.length,c,d=0;d<u;++d)if(c=a[d]){for(var f=e.call(c,c.__data__,d,a),g,y=Ft(c,n),v=0,x=f.length;v<x;++v)(g=f[v])&&Ll(g,t,n,v,f,y);i.push(f),s.push(c)}return new yn(i,s,t,n)}var ok=Ci.prototype.constructor;function ik(){return new ok(this._groups,this._parents)}function sk(e,t){var n,r,o;return function(){var i=qr(this,e),s=(this.style.removeProperty(e),qr(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function o0(e){return function(){this.style.removeProperty(e)}}function lk(e,t,n){var r,o=n+"",i;return function(){var s=qr(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function ak(e,t,n){var r,o,i;return function(){var s=qr(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),qr(this,e))),s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l))}}function uk(e,t){var n,r,o,i="style."+t,s="end."+i,l;return function(){var a=nn(this,e),u=a.on,c=a.value[i]==null?l||(l=o0(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),a.on=r}}function ck(e,t,n){var r=(e+="")=="transform"?dE:r0;return t==null?this.styleTween(e,sk(e,r)).on("end.style."+e,o0(e)):typeof t=="function"?this.styleTween(e,ak(e,r,ld(this,"style."+e,t))).each(uk(this._id,e)):this.styleTween(e,lk(e,r,t),n).on("end.style."+e,null)}function dk(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function fk(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&dk(e,s,n)),r}return i._value=t,i}function hk(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,fk(e,t,n??""))}function pk(e){return function(){this.textContent=e}}function gk(e){return function(){var t=e(this);this.textContent=t??""}}function mk(e){return this.tween("text",typeof e=="function"?gk(ld(this,"text",e)):pk(e==null?"":e+""))}function yk(e){return function(t){this.textContent=e.call(this,t)}}function vk(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&yk(o)),t}return r._value=e,r}function wk(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,vk(e))}function xk(){for(var e=this._name,t=this._id,n=i0(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)if(a=s[u]){var c=Ft(a,t);Ll(a,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new yn(r,this._parents,e,n)}function Sk(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var l={value:s},a={value:function(){--o===0&&i()}};n.each(function(){var u=nn(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),u.on=t}),o===0&&i()})}var Ek=0;function yn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function i0(){return++Ek}var sn=Ci.prototype;yn.prototype={constructor:yn,select:nk,selectAll:rk,selectChild:sn.selectChild,selectChildren:sn.selectChildren,filter:KE,merge:GE,selection:ik,transition:xk,call:sn.call,nodes:sn.nodes,node:sn.node,size:sn.size,empty:sn.empty,each:sn.each,on:JE,attr:RE,attrTween:LE,style:ck,styleTween:hk,text:mk,textTween:wk,remove:tk,tween:NE,delay:HE,duration:UE,ease:XE,easeVarying:QE,end:Sk,[Symbol.iterator]:sn[Symbol.iterator]};function kk(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ck={time:null,delay:0,duration:250,ease:kk};function _k(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Nk(e){var t,n;e instanceof yn?(t=e._id,e=e._name):(t=i0(),(n=Ck).time=id(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&Ll(a,e,t,u,s,n||_k(a,t));return new yn(r,this._parents,e,t)}Ci.prototype.interrupt=kE;Ci.prototype.transition=Nk;const os=e=>()=>e;function bk(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 dn(e,t,n){this.k=e,this.x=t,this.y=n}dn.prototype={constructor:dn,scale:function(e){return e===1?this:new dn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new dn(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 Ol=new dn(1,0,0);s0.prototype=dn.prototype;function s0(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ol;return e.__zoom}function Aa(e){e.stopImmediatePropagation()}function ko(e){e.preventDefault(),e.stopImmediatePropagation()}function Mk(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Ik(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function dh(){return this.__zoom||Ol}function Pk(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Dk(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tk(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],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function l0(){var e=Mk,t=Ik,n=Tk,r=Pk,o=Dk,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=Ns,u=jl("start","zoom","end"),c,d,f,g=500,y=150,v=0,x=10;function p(E){E.property("__zoom",dh).on("wheel.zoom",b,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",A).filter(o).on("touchstart.zoom",z).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(E,T,P,R){var I=E.selection?E.selection():E;I.property("__zoom",dh),E!==I?C(E,T,P,R):I.interrupt().each(function(){_(this,arguments).event(R).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},p.scaleBy=function(E,T,P,R){p.scaleTo(E,function(){var I=this.__zoom.k,M=typeof T=="function"?T.apply(this,arguments):T;return I*M},P,R)},p.scaleTo=function(E,T,P,R){p.transform(E,function(){var I=t.apply(this,arguments),M=this.__zoom,j=P==null?w(I):typeof P=="function"?P.apply(this,arguments):P,O=M.invert(j),$=typeof T=="function"?T.apply(this,arguments):T;return n(h(m(M,$),j,O),I,s)},P,R)},p.translateBy=function(E,T,P,R){p.transform(E,function(){return n(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof P=="function"?P.apply(this,arguments):P),t.apply(this,arguments),s)},null,R)},p.translateTo=function(E,T,P,R,I){p.transform(E,function(){var M=t.apply(this,arguments),j=this.__zoom,O=R==null?w(M):typeof R=="function"?R.apply(this,arguments):R;return n(Ol.translate(O[0],O[1]).scale(j.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof P=="function"?-P.apply(this,arguments):-P),M,s)},R,I)};function m(E,T){return T=Math.max(i[0],Math.min(i[1],T)),T===E.k?E:new dn(T,E.x,E.y)}function h(E,T,P){var R=T[0]-P[0]*E.k,I=T[1]-P[1]*E.k;return R===E.x&&I===E.y?E:new dn(E.k,R,I)}function w(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function C(E,T,P,R){E.on("start.zoom",function(){_(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(R).end()}).tween("zoom",function(){var I=this,M=arguments,j=_(I,M).event(R),O=t.apply(I,M),$=P==null?w(O):typeof P=="function"?P.apply(I,M):P,U=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),W=I.__zoom,Z=typeof T=="function"?T.apply(I,M):T,G=a(W.invert($).concat(U/W.k),Z.invert($).concat(U/Z.k));return function(q){if(q===1)q=Z;else{var F=G(q),V=U/F[2];q=new dn(V,$[0]-F[0]*V,$[1]-F[1]*V)}j.zoom(null,q)}})}function _(E,T,P){return!P&&E.__zooming||new N(E,T)}function N(E,T){this.that=E,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,T),this.taps=0}N.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,T){return this.mouse&&E!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var T=at(this.that).datum();u.call(E,this.that,new bk(E,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:u}),T)}};function b(E,...T){if(!e.apply(this,arguments))return;var P=_(this,T).event(E),R=this.__zoom,I=Math.max(i[0],Math.min(i[1],R.k*Math.pow(2,r.apply(this,arguments)))),M=It(E);if(P.wheel)(P.mouse[0][0]!==M[0]||P.mouse[0][1]!==M[1])&&(P.mouse[1]=R.invert(P.mouse[0]=M)),clearTimeout(P.wheel);else{if(R.k===I)return;P.mouse=[M,R.invert(M)],Is(this),P.start()}ko(E),P.wheel=setTimeout(j,y),P.zoom("mouse",n(h(m(R,I),P.mouse[0],P.mouse[1]),P.extent,s));function j(){P.wheel=null,P.end()}}function D(E,...T){if(f||!e.apply(this,arguments))return;var P=E.currentTarget,R=_(this,T,!0).event(E),I=at(E.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",U,!0),M=It(E,P),j=E.clientX,O=E.clientY;Um(E.view),Aa(E),R.mouse=[M,this.__zoom.invert(M)],Is(this),R.start();function $(W){if(ko(W),!R.moved){var Z=W.clientX-j,G=W.clientY-O;R.moved=Z*Z+G*G>v}R.event(W).zoom("mouse",n(h(R.that.__zoom,R.mouse[0]=It(W,P),R.mouse[1]),R.extent,s))}function U(W){I.on("mousemove.zoom mouseup.zoom",null),Wm(W.view,R.moved),ko(W),R.event(W).end()}}function A(E,...T){if(e.apply(this,arguments)){var P=this.__zoom,R=It(E.changedTouches?E.changedTouches[0]:E,this),I=P.invert(R),M=P.k*(E.shiftKey?.5:2),j=n(h(m(P,M),R,I),t.apply(this,T),s);ko(E),l>0?at(this).transition().duration(l).call(C,j,R,E):at(this).call(p.transform,j,R,E)}}function z(E,...T){if(e.apply(this,arguments)){var P=E.touches,R=P.length,I=_(this,T,E.changedTouches.length===R).event(E),M,j,O,$;for(Aa(E),j=0;j<R;++j)O=P[j],$=It(O,this),$=[$,this.__zoom.invert($),O.identifier],I.touch0?!I.touch1&&I.touch0[2]!==$[2]&&(I.touch1=$,I.taps=0):(I.touch0=$,M=!0,I.taps=1+!!c);c&&(c=clearTimeout(c)),M&&(I.taps<2&&(d=$[0],c=setTimeout(function(){c=null},g)),Is(this),I.start())}}function H(E,...T){if(this.__zooming){var P=_(this,T).event(E),R=E.changedTouches,I=R.length,M,j,O,$;for(ko(E),M=0;M<I;++M)j=R[M],O=It(j,this),P.touch0&&P.touch0[2]===j.identifier?P.touch0[0]=O:P.touch1&&P.touch1[2]===j.identifier&&(P.touch1[0]=O);if(j=P.that.__zoom,P.touch1){var U=P.touch0[0],W=P.touch0[1],Z=P.touch1[0],G=P.touch1[1],q=(q=Z[0]-U[0])*q+(q=Z[1]-U[1])*q,F=(F=G[0]-W[0])*F+(F=G[1]-W[1])*F;j=m(j,Math.sqrt(q/F)),O=[(U[0]+Z[0])/2,(U[1]+Z[1])/2],$=[(W[0]+G[0])/2,(W[1]+G[1])/2]}else if(P.touch0)O=P.touch0[0],$=P.touch0[1];else return;P.zoom("touch",n(h(j,O,$),P.extent,s))}}function L(E,...T){if(this.__zooming){var P=_(this,T).event(E),R=E.changedTouches,I=R.length,M,j;for(Aa(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),M=0;M<I;++M)j=R[M],P.touch0&&P.touch0[2]===j.identifier?delete P.touch0:P.touch1&&P.touch1[2]===j.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(j=It(j,this),Math.hypot(d[0]-j[0],d[1]-j[1])<x)){var O=at(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return p.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:os(+E),p):r},p.filter=function(E){return arguments.length?(e=typeof E=="function"?E:os(!!E),p):e},p.touchable=function(E){return arguments.length?(o=typeof E=="function"?E:os(!!E),p):o},p.extent=function(E){return arguments.length?(t=typeof E=="function"?E:os([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),p):t},p.scaleExtent=function(E){return arguments.length?(i[0]=+E[0],i[1]=+E[1],p):[i[0],i[1]]},p.translateExtent=function(E){return arguments.length?(s[0][0]=+E[0][0],s[1][0]=+E[1][0],s[0][1]=+E[0][1],s[1][1]=+E[1][1],p):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},p.constrain=function(E){return arguments.length?(n=E,p):n},p.duration=function(E){return arguments.length?(l=+E,p):l},p.interpolate=function(E){return arguments.length?(a=E,p):a},p.on=function(){var E=u.on.apply(u,arguments);return E===u?p:E},p.clickDistance=function(E){return arguments.length?(v=(E=+E)*E,p):Math.sqrt(v)},p.tapDistance=function(E){return arguments.length?(x=+E,p):x},p}const Lt={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},di=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],a0=["Enter"," ","Escape"],u0={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var eo;(function(e){e.Strict="strict",e.Loose="loose"})(eo||(eo={}));var or;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(or||(or={}));var fi;(function(e){e.Partial="partial",e.Full="full"})(fi||(fi={}));const c0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Mn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Mn||(Mn={}));var ul;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ul||(ul={}));var ee;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ee||(ee={}));const fh={[ee.Left]:ee.Right,[ee.Right]:ee.Left,[ee.Top]:ee.Bottom,[ee.Bottom]:ee.Top};function d0(e){return e===null?null:e?"valid":"invalid"}const f0=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,Rk=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ad=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ni=(e,t=[0,0])=>{const{width:n,height:r}=rn(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},zk=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const i=typeof o=="string";let s=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(o):ad(o)?o:t.nodeLookup.get(o.id));const l=s?cl(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Fl(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Hl(n)},bi=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=Fl(n,cl(o)),r=!0)}),r?Hl(n):{x:0,y:0,width:0,height:0}},ud=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const l=(t.x-n)/o,a=(t.y-r)/o,u=t.width/o,c=t.height/o,d=[];for(const f of e.values()){const{measured:g,selectable:y=!0,hidden:v=!1}=f;if(s&&!y||v)continue;const x=g.width??f.width??f.initialWidth??0,p=g.height??f.height??f.initialHeight??0,{x:m,y:h}=f.internals.positionAbsolute,w=m0(l,a,u,c,m,h,x,p),C=x*p,_=i&&w>0;(!f.internals.handleBounds||_||w>=C||f.dragging)&&d.push(f)}return d},jk=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Ak(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{let i;if(t!=null&&t.includeHiddenNodes){const{width:s,height:l}=rn(o);i=s>0&&l>0}else i=!!(o.measured.width&&o.measured.height&&!o.hidden);i&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function $k({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return!0;const l=Ak(e,s),a=bi(l),u=dd(a,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),!0}function h0({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:a,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},c=s.origin??r;let d=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!l)i==null||i("005",Lt.error005());else{const g=l.measured.width,y=l.measured.height;g&&y&&(d=[[a,u],[a+g,u+y]])}else l&&hr(s.extent)&&(d=[[s.extent[0][0]+a,s.extent[0][1]+u],[s.extent[1][0]+a,s.extent[1][1]+u]]);const f=hr(d)?fr(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",Lt.error015())),{position:{x:f.x-a+(s.measured.width??0)*c[0],y:f.y-u+(s.measured.height??0)*c[1]},positionAbsolute:f}}async function Lk({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const g=i.has(f.id),y=!g&&f.parentId&&s.find(v=>v.id===f.parentId);(g||y)&&s.push(f)}const l=new Set(t.map(f=>f.id)),a=r.filter(f=>f.deletable!==!1),c=jk(s,a);for(const f of a)l.has(f.id)&&!c.find(y=>y.id===f.id)&&c.push(f);if(!o)return{edges:c,nodes:s};const d=await o({nodes:s,edges:c});return typeof d=="boolean"?d?{edges:c,nodes:s}:{edges:[],nodes:[]}:d}const to=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),fr=(e={x:0,y:0},t,n)=>({x:to(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:to(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function p0(e,t,n){const{width:r,height:o}=rn(n),{x:i,y:s}=n.internals.positionAbsolute;return fr(e,[[i,s],[i+r,s+o]],t)}const hh=(e,t,n)=>e<t?to(Math.abs(e-t),1,t)/t:e>n?-to(Math.abs(e-n),1,t)/t:0,cd=(e,t,n=15,r=40)=>{const o=hh(e.x,r,t.width-r)*n,i=hh(e.y,r,t.height-r)*n;return[o,i]},Fl=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Ku=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Hl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),hi=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=ad(e)?e.internals.positionAbsolute:Ni(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},cl=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=ad(e)?e.internals.positionAbsolute:Ni(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},g0=(e,t)=>Hl(Fl(Ku(e),Ku(t))),m0=(e,t,n,r,o,i,s,l)=>{const a=Math.max(0,Math.min(e+n,o+s)-Math.max(e,o)),u=Math.max(0,Math.min(t+r,i+l)-Math.max(t,i));return Math.ceil(a*u)},dl=(e,t)=>m0(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),ph=e=>Rt(e.width)&&Rt(e.height)&&Rt(e.x)&&Rt(e.y),Rt=e=>!isNaN(e)&&isFinite(e),y0=(e,t)=>(n,r)=>{},Mi=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ii=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?Mi(l,s):l},no=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function wr(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Ok(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=wr(e,n),o=wr(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=wr(e.top??e.y??0,n),o=wr(e.bottom??e.y??0,n),i=wr(e.left??e.x??0,t),s=wr(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Fk(e,t,n,r,o,i){const{x:s,y:l}=no(e,[t,n,r]),{x:a,y:u}=no({x:e.x+e.width,y:e.y+e.height},[t,n,r]),c=o-a,d=i-u;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(c),bottom:Math.floor(d)}}const dd=(e,t,n,r,o,i)=>{const s=Ok(i,t,n),l=(t-s.x)/e.width,a=(n-s.y)/e.height,u=Math.min(l,a),c=to(u,r,o),d=e.x+e.width/2,f=e.y+e.height/2,g=t/2-d*c,y=n/2-f*c,v=Fk(e,g,y,c,t,n),x={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:g-x.left+x.right,y:y-x.top+x.bottom,zoom:c}},pi=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function hr(e){return e!=null&&e!=="parent"}function rn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function v0(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function w0(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const l=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function gh(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Hk(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function Bk(e){return{...u0,...e||{}}}function Fo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=zt(e),l=Ii({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:a,y:u}=n?Mi(l,t):l;return{xSnapped:a,ySnapped:u,...l}}const fd=e=>({width:e.offsetWidth,height:e.offsetHeight}),x0=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Vk=["INPUT","SELECT","TEXTAREA"];function S0(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Vk.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const E0=e=>"clientX"in e,zt=(e,t)=>{var i,s;const n=E0(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},mh=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...fd(s)}})};function k0({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:l}){const a=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,c=Math.abs(a-e),d=Math.abs(u-t);return[a,u,c,d]}function is(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function yh({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case ee.Left:return[t-is(t-r,i),n];case ee.Right:return[t+is(r-t,i),n];case ee.Top:return[t,n-is(n-o,i)];case ee.Bottom:return[t,n+is(o-n,i)]}}function C0({sourceX:e,sourceY:t,sourcePosition:n=ee.Bottom,targetX:r,targetY:o,targetPosition:i=ee.Top,curvature:s=.25}){const[l,a]=yh({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,c]=yh({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[d,f,g,y]=k0({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${l},${a} ${u},${c} ${r},${o}`,d,f,g,y]}function _0({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[i,l,o,s]}function Uk({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const s=o&&n?r+1e3:r,l=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+l}function Wk({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=Fl(cl(e),cl(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return dl(s,Hl(i))>0}const Xk=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Yk=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Qk=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",Lt.error006()),t;const r=n.getEdgeId||Xk;let o;return f0(e)?o={...e}:o={...e,id:r(e)},Yk(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function N0({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=_0({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const vh={[ee.Left]:{x:-1,y:0},[ee.Right]:{x:1,y:0},[ee.Top]:{x:0,y:-1},[ee.Bottom]:{x:0,y:1}},Kk=({source:e,sourcePosition:t=ee.Bottom,target:n})=>t===ee.Left||t===ee.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},wh=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Gk({source:e,sourcePosition:t=ee.Bottom,target:n,targetPosition:r=ee.Top,center:o,offset:i,stepPosition:s}){const l=vh[t],a=vh[r],u={x:e.x+l.x*i,y:e.y+l.y*i},c={x:n.x+a.x*i,y:n.y+a.y*i},d=Kk({source:u,sourcePosition:t,target:c}),f=d.x!==0?"x":"y",g=d[f];let y=[],v,x;const p={x:0,y:0},m={x:0,y:0},[,,h,w]=_0({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*a[f]===-1){f==="x"?(v=o.x??u.x+(c.x-u.x)*s,x=o.y??(u.y+c.y)/2):(v=o.x??(u.x+c.x)/2,x=o.y??u.y+(c.y-u.y)*s);const b=[{x:v,y:u.y},{x:v,y:c.y}],D=[{x:u.x,y:x},{x:c.x,y:x}];l[f]===g?y=f==="x"?b:D:y=f==="x"?D:b}else{const b=[{x:u.x,y:c.y}],D=[{x:c.x,y:u.y}];if(f==="x"?y=l.x===g?D:b:y=l.y===g?b:D,t===r){const E=Math.abs(e[f]-n[f]);if(E<=i){const T=Math.min(i-1,i-E);l[f]===g?p[f]=(u[f]>e[f]?-1:1)*T:m[f]=(c[f]>n[f]?-1:1)*T}}if(t!==r){const E=f==="x"?"y":"x",T=l[f]===a[E],P=u[E]>c[E],R=u[E]<c[E];(l[f]===1&&(!T&&P||T&&R)||l[f]!==1&&(!T&&R||T&&P))&&(y=f==="x"?b:D)}const A={x:u.x+p.x,y:u.y+p.y},z={x:c.x+m.x,y:c.y+m.y},H=Math.max(Math.abs(A.x-y[0].x),Math.abs(z.x-y[0].x)),L=Math.max(Math.abs(A.y-y[0].y),Math.abs(z.y-y[0].y));H>=L?(v=(A.x+z.x)/2,x=y[0].y):(v=y[0].x,x=(A.y+z.y)/2)}const C={x:u.x+p.x,y:u.y+p.y},_={x:c.x+m.x,y:c.y+m.y};return[[e,...C.x!==y[0].x||C.y!==y[0].y?[C]:[],...y,..._.x!==y[y.length-1].x||_.y!==y[y.length-1].y?[_]:[],n],v,x,h,w]}function Zk(e,t,n,r){const o=Math.min(wh(e,t)/2,wh(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*c}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${s+o*a}Q ${i},${s} ${i+o*l},${s}`}function Gu({sourceX:e,sourceY:t,sourcePosition:n=ee.Bottom,targetX:r,targetY:o,targetPosition:i=ee.Top,borderRadius:s=5,centerX:l,centerY:a,offset:u=20,stepPosition:c=.5}){const[d,f,g,y,v]=Gk({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:a},offset:u,stepPosition:c});let x=`M${d[0].x} ${d[0].y}`;for(let p=1;p<d.length-1;p++)x+=Zk(d[p-1],d[p],d[p+1],s);return x+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[x,f,g,y,v]}function xh(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function qk(e){var d;const{sourceNode:t,targetNode:n}=e;if(!xh(t)||!xh(n))return null;const r=t.internals.handleBounds||Sh(t.handles),o=n.internals.handleBounds||Sh(n.handles),i=Eh((r==null?void 0:r.source)??[],e.sourceHandle),s=Eh(e.connectionMode===eo.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(d=e.onError)==null||d.call(e,"008",Lt.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||ee.Bottom,a=(s==null?void 0:s.position)||ee.Top,u=pr(t,i,l),c=pr(n,s,a);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y,sourcePosition:l,targetPosition:a}}function Sh(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function pr(e,t,n=ee.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:l}=t??rn(e);if(r)return{x:o+s/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case ee.Top:return{x:o+s/2,y:i};case ee.Right:return{x:o+s,y:i+l/2};case ee.Bottom:return{x:o+s/2,y:i+l};case ee.Left:return{x:o,y:i+l/2}}}function Eh(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Zu(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Jk(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,l)=>([l.markerStart||r,l.markerEnd||o].forEach(a=>{if(a&&typeof a=="object"){const u=Zu(a,t);i.has(u)||(s.push({id:u,color:a.color||n,...a}),i.add(u))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const b0=1e3,eC=10,hd={nodeOrigin:[0,0],nodeExtent:di,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},tC={...hd,checkEquality:!0};function pd(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function nC(e,t,n){const r=pd(hd,n);for(const o of e.values())if(o.parentId)md(o,e,t,r);else{const i=Ni(o,r.nodeOrigin),s=hr(o.extent)?o.extent:r.nodeExtent,l=fr(i,s,rn(o));o.internals.positionAbsolute=l}}function rC(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function gd(e){return e==="manual"}function qu(e,t,n,r={}){var c,d;const o=pd(tC,r),i={i:0},s=new Map(t),l=o!=null&&o.elevateNodesOnSelect&&!gd(o.zIndexMode)?b0:0;let a=e.length>0,u=!1;t.clear(),n.clear();for(const f of e){let g=s.get(f.id);if(o.checkEquality&&f===(g==null?void 0:g.internals.userNode))t.set(f.id,g);else{const y=Ni(f,o.nodeOrigin),v=hr(f.extent)?f.extent:o.nodeExtent,x=fr(y,v,rn(f));g={...o.defaults,...f,measured:{width:(c=f.measured)==null?void 0:c.width,height:(d=f.measured)==null?void 0:d.height},internals:{positionAbsolute:x,handleBounds:rC(f,g),z:M0(f,l,o.zIndexMode),userNode:f}},t.set(f.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(a=!1),f.parentId&&md(g,t,n,r,i),u||(u=f.selected??!1)}return{nodesInitialized:a,hasSelectedNodes:u}}function oC(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function md(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:l,zIndexMode:a}=pd(hd,r),u=e.parentId,c=t.get(u);if(!c){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}oC(e,n),o&&!c.parentId&&c.internals.rootParentIndex===void 0&&a==="auto"&&(c.internals.rootParentIndex=++o.i,c.internals.z=c.internals.z+o.i*eC),o&&c.internals.rootParentIndex!==void 0&&(o.i=c.internals.rootParentIndex);const d=i&&!gd(a)?b0:0,{x:f,y:g,z:y}=iC(e,c,s,l,d,a),{positionAbsolute:v}=e.internals,x=f!==v.x||g!==v.y;(x||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:f,y:g}:v,z:y}})}function M0(e,t,n){const r=Rt(e.zIndex)?e.zIndex:0;return gd(n)?r:r+(e.selected?t:0)}function iC(e,t,n,r,o,i){const{x:s,y:l}=t.internals.positionAbsolute,a=rn(e),u=Ni(e,n),c=hr(e.extent)?fr(u,e.extent,a):u;let d=fr({x:s+c.x,y:l+c.y},r,a);e.extent==="parent"&&(d=p0(d,a,t));const f=M0(e,o,i),g=t.internals.z??0;return{x:d.x,y:d.y,z:g>=f?g+1:f}}function yd(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const u=((s=i.get(l.parentId))==null?void 0:s.expandedRect)??hi(a),c=g0(u,l.rect);i.set(l.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:l,parent:a},u)=>{var h;const c=a.internals.positionAbsolute,d=rn(a),f=a.origin??r,g=l.x<c.x?Math.round(Math.abs(c.x-l.x)):0,y=l.y<c.y?Math.round(Math.abs(c.y-l.y)):0,v=Math.max(d.width,Math.round(l.width)),x=Math.max(d.height,Math.round(l.height)),p=(v-d.width)*f[0],m=(x-d.height)*f[1];(g>0||y>0||p||m)&&(o.push({id:u,type:"position",position:{x:a.position.x-g+p,y:a.position.y-y+m}}),(h=n.get(u))==null||h.forEach(w=>{e.some(C=>C.id===w.id)||o.push({id:w.id,type:"position",position:{x:w.position.x+g,y:w.position.y+y}})})),(d.width<l.width||d.height<l.height||g||y)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:v+(g?f[0]*g-p:0),height:x+(y?f[1]*y-m:0)}})}),o}function sC(e,t,n,r,o,i,s){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const u=[],c=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(c.transform),f=[];for(const g of e.values()){const y=t.get(g.id);if(!y)continue;if(y.hidden){t.set(y.id,{...y,internals:{...y.internals,handleBounds:void 0}}),a=!0;continue}const v=fd(g.nodeElement),x=y.measured.width!==v.width||y.measured.height!==v.height;if(!!(v.width&&v.height&&(x||!y.internals.handleBounds||g.force))){const m=g.nodeElement.getBoundingClientRect(),h=hr(y.extent)?y.extent:i;let{positionAbsolute:w}=y.internals;if(y.parentId&&y.extent==="parent"){const _=t.get(y.parentId);_&&(w=p0(w,v,_))}else h&&(w=fr(w,h,v));const C={...y,measured:v,internals:{...y.internals,positionAbsolute:w,handleBounds:{source:mh("source",g.nodeElement,m,d,y.id),target:mh("target",g.nodeElement,m,d,y.id)}}};t.set(y.id,C),y.parentId&&md(C,t,n,{nodeOrigin:o,zIndexMode:s}),a=!0,x&&(u.push({id:y.id,type:"dimensions",dimensions:v}),y.expandParent&&y.parentId&&f.push({id:y.id,parentId:y.parentId,rect:hi(C,o)}))}}if(f.length>0){const g=yd(f,t,n,o);u.push(...g)}return{changes:u,updatedInternals:a}}async function lC({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return!1;const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r);return!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2])}function kh(e,t,n,r,o,i){let s=o;const l=r.get(s)||new Map;r.set(s,l.set(n,t)),s=`${o}-${e}`;const a=r.get(s)||new Map;if(r.set(s,a.set(n,t)),i){s=`${o}-${e}-${i}`;const u=r.get(s)||new Map;r.set(s,u.set(n,t))}}function I0(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:l=null}=r,a={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:l},u=`${o}-${s}--${i}-${l}`,c=`${i}-${l}--${o}-${s}`;kh("source",a,c,e,o,s),kh("target",a,u,e,i,l),t.set(r.id,r)}}function P0(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:P0(n,t):!1}function Ch(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function aC(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!P0(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const l=e.get(i);l&&o.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return o}function $a({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,a;const o=[];for(const[u,c]of t){const d=(s=n.get(u))==null?void 0:s.internals.userNode;d&&o.push({...d,position:c.position,dragging:r})}if(!e)return[o[0],o];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((a=t.get(e))==null?void 0:a.position)||i.position,dragging:r}:o[0],o]}function uC({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},s=Mi(i,t);return{x:s.x-i.x,y:s.y-i.y}}function cC({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,l=new Map,a=!1,u={x:0,y:0},c=null,d=!1,f=null,g=!1,y=!1,v=null;function x({noDragClassName:m,handleSelector:h,domNode:w,isSelectable:C,nodeId:_,nodeClickDistance:N=0}){f=at(w);function b({x:H,y:L}){const{nodeLookup:E,nodeExtent:T,snapGrid:P,snapToGrid:R,nodeOrigin:I,onNodeDrag:M,onSelectionDrag:j,onError:O,updateNodePositions:$}=t();i={x:H,y:L};let U=!1;const W=l.size>1,Z=W&&T?Ku(bi(l)):null,G=W&&R?uC({dragItems:l,snapGrid:P,x:H,y:L}):null;for(const[q,F]of l){if(!E.has(q))continue;let V={x:H-F.distance.x,y:L-F.distance.y};R&&(V=G?{x:Math.round(V.x+G.x),y:Math.round(V.y+G.y)}:Mi(V,P));let X=null;if(W&&T&&!F.extent&&Z){const{positionAbsolute:K}=F.internals,te=K.x-Z.x+T[0][0],ne=K.x+F.measured.width-Z.x2+T[1][0],re=K.y-Z.y+T[0][1],ce=K.y+F.measured.height-Z.y2+T[1][1];X=[[te,re],[ne,ce]]}const{position:J,positionAbsolute:Y}=h0({nodeId:q,nextPosition:V,nodeLookup:E,nodeExtent:X||T,nodeOrigin:I,onError:O});U=U||F.position.x!==J.x||F.position.y!==J.y,F.position=J,F.internals.positionAbsolute=Y}if(y=y||U,!!U&&($(l,!0),v&&(r||M||!_&&j))){const[q,F]=$a({nodeId:_,dragItems:l,nodeLookup:E});r==null||r(v,l,q,F),M==null||M(v,q,F),_||j==null||j(v,F)}}async function D(){if(!c)return;const{transform:H,panBy:L,autoPanSpeed:E,autoPanOnNodeDrag:T}=t();if(!T){a=!1,cancelAnimationFrame(s);return}const[P,R]=cd(u,c,E);(P!==0||R!==0)&&(i.x=(i.x??0)-P/H[2],i.y=(i.y??0)-R/H[2],await L({x:P,y:R})&&b(i)),s=requestAnimationFrame(D)}function A(H){var W;const{nodeLookup:L,multiSelectionActive:E,nodesDraggable:T,transform:P,snapGrid:R,snapToGrid:I,selectNodesOnDrag:M,onNodeDragStart:j,onSelectionDragStart:O,unselectNodesAndEdges:$}=t();d=!0,(!M||!C)&&!E&&_&&((W=L.get(_))!=null&&W.selected||$()),C&&M&&_&&(e==null||e(_));const U=Fo(H.sourceEvent,{transform:P,snapGrid:R,snapToGrid:I,containerBounds:c});if(i=U,l=aC(L,T,U,_),l.size>0&&(n||j||!_&&O)){const[Z,G]=$a({nodeId:_,dragItems:l,nodeLookup:L});n==null||n(H.sourceEvent,l,Z,G),j==null||j(H.sourceEvent,Z,G),_||O==null||O(H.sourceEvent,G)}}const z=Xm().clickDistance(N).on("start",H=>{const{domNode:L,nodeDragThreshold:E,transform:T,snapGrid:P,snapToGrid:R}=t();c=(L==null?void 0:L.getBoundingClientRect())||null,g=!1,y=!1,v=H.sourceEvent,E===0&&A(H),i=Fo(H.sourceEvent,{transform:T,snapGrid:P,snapToGrid:R,containerBounds:c}),u=zt(H.sourceEvent,c)}).on("drag",H=>{const{autoPanOnNodeDrag:L,transform:E,snapGrid:T,snapToGrid:P,nodeDragThreshold:R,nodeLookup:I}=t(),M=Fo(H.sourceEvent,{transform:E,snapGrid:T,snapToGrid:P,containerBounds:c});if(v=H.sourceEvent,(H.sourceEvent.type==="touchmove"&&H.sourceEvent.touches.length>1||_&&!I.has(_))&&(g=!0),!g){if(!a&&L&&d&&(a=!0,D()),!d){const j=zt(H.sourceEvent,c),O=j.x-u.x,$=j.y-u.y;Math.sqrt(O*O+$*$)>R&&A(H)}(i.x!==M.xSnapped||i.y!==M.ySnapped)&&l&&d&&(u=zt(H.sourceEvent,c),b(M))}}).on("end",H=>{if(!d||g){g&&l.size>0&&t().updateNodePositions(l,!1);return}if(a=!1,d=!1,cancelAnimationFrame(s),l.size>0){const{nodeLookup:L,updateNodePositions:E,onNodeDragStop:T,onSelectionDragStop:P}=t();if(y&&(E(l,!1),y=!1),o||T||!_&&P){const[R,I]=$a({nodeId:_,dragItems:l,nodeLookup:L,dragging:!1});o==null||o(H.sourceEvent,l,R,I),T==null||T(H.sourceEvent,R,I),_||P==null||P(H.sourceEvent,I)}}}).filter(H=>{const L=H.target;return!H.button&&(!m||!Ch(L,`.${m}`,w))&&(!h||Ch(L,h,w))});f.call(z)}function p(){f==null||f.on(".drag",null)}return{update:x,destroy:p}}function dC(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())dl(o,hi(i))>0&&r.push(i);return r}const fC=250;function hC(e,t,n,r){var l,a;let o=[],i=1/0;const s=dC(e,n,t+fC);for(const u of s){const c=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const d of c){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:g}=pr(u,d,d.position,!0),y=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(g-e.y,2));y>t||(y<i?(o=[{...d,x:f,y:g}],i=y):y===i&&o.push({...d,x:f,y:g}))}}if(!o.length)return null;if(o.length>1){const u=r.type==="source"?"target":"source";return o.find(c=>c.type===u)??o[0]}return o[0]}function D0(e,t,n,r,o,i=!1){var u,c,d;const s=r.get(e);if(!s)return null;const l=o==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((c=s.internals.handleBounds)==null?void 0:c.source)??[],...((d=s.internals.handleBounds)==null?void 0:d.target)??[]],a=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return a&&i?{...a,...pr(s,a,a.position,!0)}:a}function T0(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function pC(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const R0=()=>!0;function gC(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:l,nodeLookup:a,lib:u,autoPanOnConnect:c,flowId:d,panBy:f,cancelConnection:g,onConnectStart:y,onConnect:v,onConnectEnd:x,isValidConnection:p=R0,onReconnectEnd:m,updateConnection:h,getTransform:w,getFromHandle:C,autoPanSpeed:_,dragThreshold:N=1,handleDomNode:b}){const D=x0(e.target);let A=0,z;const{x:H,y:L}=zt(e),E=T0(i,b),T=l==null?void 0:l.getBoundingClientRect();let P=!1;if(!T||!E)return;const R=D0(o,E,r,a,t);if(!R)return;let I=zt(e,T),M=!1,j=null,O=!1,$=null;function U(){if(!c||!T)return;const[J,Y]=cd(I,T,_);f({x:J,y:Y}),A=requestAnimationFrame(U)}const W={...R,nodeId:o,type:E,position:R.position},Z=a.get(o);let q={inProgress:!0,isValid:null,from:pr(Z,W,ee.Left,!0),fromHandle:W,fromPosition:W.position,fromNode:Z,to:I,toHandle:null,toPosition:fh[W.position],toNode:null,pointer:I};function F(){P=!0,h(q),y==null||y(e,{nodeId:o,handleId:r,handleType:E})}N===0&&F();function V(J){if(!P){const{x:ce,y:He}=zt(J),Ke=ce-H,Ce=He-L;if(!(Ke*Ke+Ce*Ce>N*N))return;F()}if(!C()||!W){X(J);return}const Y=w();I=zt(J,T),z=hC(Ii(I,Y,!1,[1,1]),n,a,W),M||(U(),M=!0);const K=z0(J,{handle:z,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:p,doc:D,lib:u,flowId:d,nodeLookup:a});$=K.handleDomNode,j=K.connection,O=pC(!!z,K.isValid);const te=a.get(o),ne=te?pr(te,W,ee.Left,!0):q.from,re={...q,from:ne,isValid:O,to:K.toHandle&&O?no({x:K.toHandle.x,y:K.toHandle.y},Y):I,toHandle:K.toHandle,toPosition:O&&K.toHandle?K.toHandle.position:fh[W.position],toNode:K.toHandle?a.get(K.toHandle.nodeId):null,pointer:I};h(re),q=re}function X(J){if(!("touches"in J&&J.touches.length>0)){if(P){(z||$)&&j&&O&&(v==null||v(j));const{inProgress:Y,...K}=q,te={...K,toPosition:q.toHandle?q.toPosition:null};x==null||x(J,te),i&&(m==null||m(J,te))}g(),cancelAnimationFrame(A),M=!1,O=!1,j=null,$=null,D.removeEventListener("mousemove",V),D.removeEventListener("mouseup",X),D.removeEventListener("touchmove",V),D.removeEventListener("touchend",X)}}D.addEventListener("mousemove",V),D.addEventListener("mouseup",X),D.addEventListener("touchmove",V),D.addEventListener("touchend",X)}function z0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:l,flowId:a,isValidConnection:u=R0,nodeLookup:c}){const d=i==="target",f=t?s.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:g,y}=zt(e),v=s.elementFromPoint(g,y),x=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:f,p={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const m=T0(void 0,x),h=x.getAttribute("data-nodeid"),w=x.getAttribute("data-handleid"),C=x.classList.contains("connectable"),_=x.classList.contains("connectableend");if(!h||!m)return p;const N={source:d?h:r,sourceHandle:d?w:o,target:d?r:h,targetHandle:d?o:w};p.connection=N;const D=C&&_&&(n===eo.Strict?d&&m==="source"||!d&&m==="target":h!==r||w!==o);p.isValid=D&&u(N),p.toHandle=D0(h,m,w,c,n,!0)}return p}const Ju={onPointerDown:gC,isValid:z0};function mC({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=at(e);function i({translateExtent:l,width:a,height:u,zoomStep:c=1,pannable:d=!0,zoomable:f=!0,inversePan:g=!1}){const y=h=>{if(h.sourceEvent.type!=="wheel"||!t)return;const w=n(),C=h.sourceEvent.ctrlKey&&pi()?10:1,_=-h.sourceEvent.deltaY*(h.sourceEvent.deltaMode===1?.05:h.sourceEvent.deltaMode?1:.002)*c,N=w[2]*Math.pow(2,_*C);t.scaleTo(N)};let v=[0,0];const x=h=>{(h.sourceEvent.type==="mousedown"||h.sourceEvent.type==="touchstart")&&(v=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY])},p=h=>{const w=n();if(h.sourceEvent.type!=="mousemove"&&h.sourceEvent.type!=="touchmove"||!t)return;const C=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY],_=[C[0]-v[0],C[1]-v[1]];v=C;const N=r()*Math.max(w[2],Math.log(w[2]))*(g?-1:1),b={x:w[0]-_[0]*N,y:w[1]-_[1]*N},D=[[0,0],[a,u]];t.setViewportConstrained({x:b.x,y:b.y,zoom:w[2]},D,l)},m=l0().on("start",x).on("zoom",d?p:null).on("zoom.wheel",f?y:null);o.call(m,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:It}}const Bl=e=>({x:e.x,y:e.y,zoom:e.k}),La=({x:e,y:t,zoom:n})=>Ol.translate(e,t).scale(n),Rr=(e,t)=>e.target.closest(`.${t}`),j0=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),yC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Oa=(e,t=0,n=yC,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},A0=e=>{const t=e.ctrlKey&&pi()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function vC({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:u}){return c=>{if(Rr(c,t))return c.ctrlKey&&c.preventDefault(),!1;c.preventDefault(),c.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(c.ctrlKey&&s){const x=It(c),p=A0(c),m=d*Math.pow(2,p);r.scaleTo(n,m,x,c);return}const f=c.deltaMode===1?20:1;let g=o===or.Vertical?0:c.deltaX*f,y=o===or.Horizontal?0:c.deltaY*f;!pi()&&c.shiftKey&&o!==or.Vertical&&(g=c.deltaY*f,y=0),r.translateBy(n,-(g/d)*i,-(y/d)*i,{internal:!0});const v=Bl(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?a==null||a(c,v):(e.isPanScrolling=!0,l==null||l(c,v)),e.panScrollTimeout=setTimeout(()=>{u==null||u(c,v),e.isPanScrolling=!1},150)}}function wC({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,l=Rr(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),s||l)return null;r.preventDefault(),n.call(this,r,o)}}function xC({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,l;if((i=r.sourceEvent)!=null&&i.internal)return;const o=Bl(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function SC({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,l;e.usedRightMouseButton=!!(n&&j0(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((l=i.sourceEvent)!=null&&l.internal)&&(o==null||o(i.sourceEvent,Bl(i.transform)))}}function EC({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var l;if(!((l=s.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&j0(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const a=Bl(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,a)},n?150:0)}}}function kC({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:l,noPanClassName:a,lib:u,connectionInProgress:c}){return d=>{var x;const f=e||t,g=n&&d.ctrlKey,y=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Rr(d,`${u}-flow__node`)||Rr(d,`${u}-flow__edge`)))return!0;if(!r&&!f&&!o&&!i&&!n||s||c&&!y||Rr(d,l)&&y||Rr(d,a)&&(!y||o&&y&&!e)||!n&&d.ctrlKey&&y)return!1;if(!n&&d.type==="touchstart"&&((x=d.touches)==null?void 0:x.length)>1)return d.preventDefault(),!1;if(!f&&!o&&!g&&y||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const v=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||y)&&v}}function CC({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:l,onDraggingChange:a}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=e.getBoundingClientRect();let d=[[0,0],[c.width,c.height]];const f=typeof ResizeObserver<"u"?new ResizeObserver(L=>{const E=L[0];E&&(d=[[0,0],[E.contentRect.width,E.contentRect.height]])}):null;f==null||f.observe(e);const g=l0().extent(()=>d).scaleExtent([t,n]).translateExtent(r),y=at(e).call(g);w({x:o.x,y:o.y,zoom:to(o.zoom,t,n)},[[0,0],[c.width,c.height]],r);const v=y.on("wheel.zoom"),x=y.on("dblclick.zoom");g.wheelDelta(A0);async function p(L,E){return y?new Promise(T=>{g==null||g.interpolate((E==null?void 0:E.interpolate)==="linear"?Oo:Ns).transform(Oa(y,E==null?void 0:E.duration,E==null?void 0:E.ease,()=>T(!0)),L)}):!1}function m({noWheelClassName:L,noPanClassName:E,onPaneContextMenu:T,userSelectionActive:P,panOnScroll:R,panOnDrag:I,panOnScrollMode:M,panOnScrollSpeed:j,preventScrolling:O,zoomOnPinch:$,zoomOnScroll:U,zoomOnDoubleClick:W,zoomActivationKeyPressed:Z,lib:G,onTransformChange:q,connectionInProgress:F,paneClickDistance:V,selectionOnDrag:X}){P&&!u.isZoomingOrPanning&&h();const J=R&&!Z&&!P;g.clickDistance(X?1/0:!Rt(V)||V<0?0:V);const Y=J?vC({zoomPanValues:u,noWheelClassName:L,d3Selection:y,d3Zoom:g,panOnScrollMode:M,panOnScrollSpeed:j,zoomOnPinch:$,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:l}):wC({noWheelClassName:L,preventScrolling:O,d3ZoomHandler:v});y.on("wheel.zoom",Y,{passive:!1});const K=xC({zoomPanValues:u,onDraggingChange:a,onPanZoomStart:s});g.on("start",K);const te=SC({zoomPanValues:u,panOnDrag:I,onPaneContextMenu:!!T,onPanZoom:i,onTransformChange:q});g.on("zoom",te);const ne=EC({zoomPanValues:u,panOnDrag:I,panOnScroll:R,onPaneContextMenu:T,onPanZoomEnd:l,onDraggingChange:a});g.on("end",ne);const re=kC({zoomActivationKeyPressed:Z,panOnDrag:I,zoomOnScroll:U,panOnScroll:R,zoomOnDoubleClick:W,zoomOnPinch:$,userSelectionActive:P,noPanClassName:E,noWheelClassName:L,lib:G,connectionInProgress:F});g.filter(re),W?y.on("dblclick.zoom",x):y.on("dblclick.zoom",null)}function h(){g.on("zoom",null)}async function w(L,E,T){const P=La(L),R=g==null?void 0:g.constrain()(P,E,T);return R&&await p(R),R}async function C(L,E){const T=La(L);return await p(T,E),T}function _(L){if(y){const E=La(L),T=y.property("__zoom");(T.k!==L.zoom||T.x!==L.x||T.y!==L.y)&&(g==null||g.transform(y,E,null,{sync:!0}))}}function N(){const L=y?s0(y.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}async function b(L,E){return y?new Promise(T=>{g==null||g.interpolate((E==null?void 0:E.interpolate)==="linear"?Oo:Ns).scaleTo(Oa(y,E==null?void 0:E.duration,E==null?void 0:E.ease,()=>T(!0)),L)}):!1}async function D(L,E){return y?new Promise(T=>{g==null||g.interpolate((E==null?void 0:E.interpolate)==="linear"?Oo:Ns).scaleBy(Oa(y,E==null?void 0:E.duration,E==null?void 0:E.ease,()=>T(!0)),L)}):!1}function A(L){g==null||g.scaleExtent(L)}function z(L){g==null||g.translateExtent(L)}function H(L){const E=!Rt(L)||L<0?0:L;g==null||g.clickDistance(E)}return{update:m,destroy:h,setViewport:C,setViewportConstrained:w,getViewport:N,scaleTo:b,scaleBy:D,setScaleExtent:A,setTranslateExtent:z,syncViewport:_,setClickDistance:H}}var ro;(function(e){e.Line="line",e.Handle="handle"})(ro||(ro={}));function _C({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const s=e-t,l=n-r,a=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&o&&(a[0]=a[0]*-1),l&&i&&(a[1]=a[1]*-1),a}function _h(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function Sn(e,t){return Math.max(0,t-e)}function En(e,t){return Math.max(0,e-t)}function ss(e,t,n){return Math.max(0,t-e,e-n)}function Nh(e,t){return e?!t:t}function NC(e,t,n,r,o,i,s,l){let{affectsX:a,affectsY:u}=t;const{isHorizontal:c,isVertical:d}=t,f=c&&d,{xSnapped:g,ySnapped:y}=n,{minWidth:v,maxWidth:x,minHeight:p,maxHeight:m}=r,{x:h,y:w,width:C,height:_,aspectRatio:N}=e;let b=Math.floor(c?g-e.pointerX:0),D=Math.floor(d?y-e.pointerY:0);const A=C+(a?-b:b),z=_+(u?-D:D),H=-i[0]*C,L=-i[1]*_;let E=ss(A,v,x),T=ss(z,p,m);if(s){let I=0,M=0;a&&b<0?I=Sn(h+b+H,s[0][0]):!a&&b>0&&(I=En(h+A+H,s[1][0])),u&&D<0?M=Sn(w+D+L,s[0][1]):!u&&D>0&&(M=En(w+z+L,s[1][1])),E=Math.max(E,I),T=Math.max(T,M)}if(l){let I=0,M=0;a&&b>0?I=En(h+b,l[0][0]):!a&&b<0&&(I=Sn(h+A,l[1][0])),u&&D>0?M=En(w+D,l[0][1]):!u&&D<0&&(M=Sn(w+z,l[1][1])),E=Math.max(E,I),T=Math.max(T,M)}if(o){if(c){const I=ss(A/N,p,m)*N;if(E=Math.max(E,I),s){let M=0;!a&&!u||a&&!u&&f?M=En(w+L+A/N,s[1][1])*N:M=Sn(w+L+(a?b:-b)/N,s[0][1])*N,E=Math.max(E,M)}if(l){let M=0;!a&&!u||a&&!u&&f?M=Sn(w+A/N,l[1][1])*N:M=En(w+(a?b:-b)/N,l[0][1])*N,E=Math.max(E,M)}}if(d){const I=ss(z*N,v,x)/N;if(T=Math.max(T,I),s){let M=0;!a&&!u||u&&!a&&f?M=En(h+z*N+H,s[1][0])/N:M=Sn(h+(u?D:-D)*N+H,s[0][0])/N,T=Math.max(T,M)}if(l){let M=0;!a&&!u||u&&!a&&f?M=Sn(h+z*N,l[1][0])/N:M=En(h+(u?D:-D)*N,l[0][0])/N,T=Math.max(T,M)}}}D=D+(D<0?T:-T),b=b+(b<0?E:-E),o&&(f?A>z*N?D=(Nh(a,u)?-b:b)/N:b=(Nh(a,u)?-D:D)*N:c?(D=b/N,u=a):(b=D*N,a=u));const P=a?h+b:h,R=u?w+D:w;return{width:C+(a?-b:b),height:_+(u?-D:D),x:i[0]*b*(a?-1:1)+P,y:i[1]*D*(u?-1:1)+R}}const $0={width:0,height:0,x:0,y:0},bC={...$0,pointerX:0,pointerY:0,aspectRatio:1};function MC(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,l=n[0]*i,a=n[1]*s;return[[r-l,o-a],[r+i-l,o+s-a]]}function IC({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=at(e);let s={controlDirection:_h("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:c,keepAspectRatio:d,resizeDirection:f,onResizeStart:g,onResize:y,onResizeEnd:v,shouldResize:x}){let p={...$0},m={...bC};s={boundaries:c,resizeDirection:f,keepAspectRatio:d,controlDirection:_h(u)};let h,w=null,C=[],_,N,b,D=!1;const A=Xm().on("start",z=>{const{nodeLookup:H,transform:L,snapGrid:E,snapToGrid:T,nodeOrigin:P,paneDomNode:R}=n();if(h=H.get(t),!h)return;w=(R==null?void 0:R.getBoundingClientRect())??null;const{xSnapped:I,ySnapped:M}=Fo(z.sourceEvent,{transform:L,snapGrid:E,snapToGrid:T,containerBounds:w});p={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},m={...p,pointerX:I,pointerY:M,aspectRatio:p.width/p.height},_=void 0,N=hr(h.extent)?h.extent:void 0,h.parentId&&(h.extent==="parent"||h.expandParent)&&(_=H.get(h.parentId)),_&&h.extent==="parent"&&(N=[[0,0],[_.measured.width,_.measured.height]]),C=[],b=void 0;for(const[j,O]of H)if(O.parentId===t&&(C.push({id:j,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const $=MC(O,h,O.origin??P);b?b=[[Math.min($[0][0],b[0][0]),Math.min($[0][1],b[0][1])],[Math.max($[1][0],b[1][0]),Math.max($[1][1],b[1][1])]]:b=$}g==null||g(z,{...p})}).on("drag",z=>{const{transform:H,snapGrid:L,snapToGrid:E,nodeOrigin:T}=n(),P=Fo(z.sourceEvent,{transform:H,snapGrid:L,snapToGrid:E,containerBounds:w}),R=[];if(!h)return;const{x:I,y:M,width:j,height:O}=p,$={},U=h.origin??T,{width:W,height:Z,x:G,y:q}=NC(m,s.controlDirection,P,s.boundaries,s.keepAspectRatio,U,N,b),F=W!==j,V=Z!==O,X=G!==I&&F,J=q!==M&&V;if(!X&&!J&&!F&&!V)return;if((X||J||U[0]===1||U[1]===1)&&($.x=X?G:p.x,$.y=J?q:p.y,p.x=$.x,p.y=$.y,C.length>0)){const ne=G-I,re=q-M;for(const ce of C)ce.position={x:ce.position.x-ne+U[0]*(W-j),y:ce.position.y-re+U[1]*(Z-O)},R.push(ce)}if((F||V)&&($.width=F&&(!s.resizeDirection||s.resizeDirection==="horizontal")?W:p.width,$.height=V&&(!s.resizeDirection||s.resizeDirection==="vertical")?Z:p.height,p.width=$.width,p.height=$.height),_&&h.expandParent){const ne=U[0]*($.width??0);$.x&&$.x<ne&&(p.x=ne,m.x=m.x-($.x-ne));const re=U[1]*($.height??0);$.y&&$.y<re&&(p.y=re,m.y=m.y-($.y-re))}const Y=_C({width:p.width,prevWidth:j,height:p.height,prevHeight:O,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),K={...p,direction:Y};(x==null?void 0:x(z,K))!==!1&&(D=!0,y==null||y(z,K),r($,R))}).on("end",z=>{D&&(v==null||v(z,{...p}),o==null||o({...p}),D=!1)});i.call(A)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var L0={exports:{}},O0={},F0={exports:{}},H0={};/**
40
+ `+i.stack}return{value:e,source:t,stack:o,digest:null}}function ba(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function bu(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var Sx=typeof WeakMap=="function"?WeakMap:Map;function qg(e,t,n){n=fn(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Zs||(Zs=!0,$u=r),bu(e,t)},n}function Jg(e,t,n){n=fn(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var o=t.value;n.payload=function(){return r(o)},n.callback=function(){bu(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(n.callback=function(){bu(e,t),typeof r!="function"&&(An===null?An=new Set([this]):An.add(this));var s=t.stack;this.componentDidCatch(t.value,{componentStack:s!==null?s:""})}),n}function Nf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Sx;var o=new Set;r.set(t,o)}else o=r.get(t),o===void 0&&(o=new Set,r.set(t,o));o.has(n)||(o.add(n),e=zx.bind(null,e,t,n),t.then(e,e))}function bf(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Mf(e,t,n,r,o){return e.mode&1?(e.flags|=65536,e.lanes=o,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=fn(-1,1),t.tag=2,zn(n,t,1))),n.lanes|=1),e)}var Ex=vn.ReactCurrentOwner,et=!1;function We(e,t,n,r){t.child=e===null?Mg(t,null,n,r):Qr(t,e.child,n,r)}function If(e,t,n,r,o){n=n.render;var i=t.ref;return Or(t,o),r=Oc(e,t,n,r,i,o),n=Fc(),e!==null&&!et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,mn(e,t,o)):(pe&&n&&bc(t),t.flags|=1,We(e,t,r,o),t.child)}function Pf(e,t,n,r,o){if(e===null){var i=n.type;return typeof i=="function"&&!Gc(i)&&i.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=i,em(e,t,i,r,o)):(e=Cs(n.type,null,r,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&o)){var s=i.memoizedProps;if(n=n.compare,n=n!==null?n:Zo,n(s,r)&&e.ref===t.ref)return mn(e,t,o)}return t.flags|=1,e=Ln(i,r),e.ref=t.ref,e.return=t,t.child=e}function em(e,t,n,r,o){if(e!==null){var i=e.memoizedProps;if(Zo(i,r)&&e.ref===t.ref)if(et=!1,t.pendingProps=r=i,(e.lanes&o)!==0)e.flags&131072&&(et=!0);else return t.lanes=e.lanes,mn(e,t,o)}return Mu(e,t,n,r,o)}function tm(e,t,n){var r=t.pendingProps,o=r.children,i=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},ue(Dr,lt),lt|=n;else{if(!(n&1073741824))return e=i!==null?i.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,ue(Dr,lt),lt|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=i!==null?i.baseLanes:n,ue(Dr,lt),lt|=r}else i!==null?(r=i.baseLanes|n,t.memoizedState=null):r=n,ue(Dr,lt),lt|=r;return We(e,t,o,n),t.child}function nm(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function Mu(e,t,n,r,o){var i=rt(n)?ir:Fe.current;return i=Xr(t,i),Or(t,o),n=Oc(e,t,n,r,i,o),r=Fc(),e!==null&&!et?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~o,mn(e,t,o)):(pe&&r&&bc(t),t.flags|=1,We(e,t,n,o),t.child)}function Df(e,t,n,r,o){if(rt(n)){var i=!0;Hs(t)}else i=!1;if(Or(t,o),t.stateNode===null)Ss(e,t),Zg(t,n,r),Nu(t,n,r,o),r=!0;else if(e===null){var s=t.stateNode,l=t.memoizedProps;s.props=l;var a=s.context,u=n.contextType;typeof u=="object"&&u!==null?u=Et(u):(u=rt(n)?ir:Fe.current,u=Xr(t,u));var c=n.getDerivedStateFromProps,d=typeof c=="function"||typeof s.getSnapshotBeforeUpdate=="function";d||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==r||a!==u)&&_f(t,s,r,u),Cn=!1;var f=t.memoizedState;s.state=f,Xs(t,r,s,o),a=t.memoizedState,l!==r||f!==a||nt.current||Cn?(typeof c=="function"&&(_u(t,n,c,r),a=t.memoizedState),(l=Cn||Cf(t,n,l,r,f,a,u))?(d||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount()),typeof s.componentDidMount=="function"&&(t.flags|=4194308)):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=a),s.props=r,s.state=a,s.context=u,r=l):(typeof s.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{s=t.stateNode,Pg(e,t),l=t.memoizedProps,u=t.type===t.elementType?l:bt(t.type,l),s.props=u,d=t.pendingProps,f=s.context,a=n.contextType,typeof a=="object"&&a!==null?a=Et(a):(a=rt(n)?ir:Fe.current,a=Xr(t,a));var g=n.getDerivedStateFromProps;(c=typeof g=="function"||typeof s.getSnapshotBeforeUpdate=="function")||typeof s.UNSAFE_componentWillReceiveProps!="function"&&typeof s.componentWillReceiveProps!="function"||(l!==d||f!==a)&&_f(t,s,r,a),Cn=!1,f=t.memoizedState,s.state=f,Xs(t,r,s,o);var y=t.memoizedState;l!==d||f!==y||nt.current||Cn?(typeof g=="function"&&(_u(t,n,g,r),y=t.memoizedState),(u=Cn||Cf(t,n,u,r,f,y,a)||!1)?(c||typeof s.UNSAFE_componentWillUpdate!="function"&&typeof s.componentWillUpdate!="function"||(typeof s.componentWillUpdate=="function"&&s.componentWillUpdate(r,y,a),typeof s.UNSAFE_componentWillUpdate=="function"&&s.UNSAFE_componentWillUpdate(r,y,a)),typeof s.componentDidUpdate=="function"&&(t.flags|=4),typeof s.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=y),s.props=r,s.state=y,s.context=a,r=u):(typeof s.componentDidUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof s.getSnapshotBeforeUpdate!="function"||l===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return Iu(e,t,n,r,i,o)}function Iu(e,t,n,r,o,i){nm(e,t);var s=(t.flags&128)!==0;if(!r&&!s)return o&&mf(t,n,!1),mn(e,t,i);r=t.stateNode,Ex.current=t;var l=s&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&s?(t.child=Qr(t,e.child,null,i),t.child=Qr(t,null,l,i)):We(e,t,l,i),t.memoizedState=r.state,o&&mf(t,n,!0),t.child}function rm(e){var t=e.stateNode;t.pendingContext?gf(e,t.pendingContext,t.pendingContext!==t.context):t.context&&gf(e,t.context,!1),zc(e,t.containerInfo)}function Tf(e,t,n,r,o){return Yr(),Ic(o),t.flags|=256,We(e,t,n,r),t.child}var Pu={dehydrated:null,treeContext:null,retryLane:0};function Du(e){return{baseLanes:e,cachePool:null,transitions:null}}function om(e,t,n){var r=t.pendingProps,o=ge.current,i=!1,s=(t.flags&128)!==0,l;if((l=s)||(l=e!==null&&e.memoizedState===null?!1:(o&2)!==0),l?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(o|=1),ue(ge,o&1),e===null)return ku(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(s=r.children,e=r.fallback,i?(r=t.mode,i=t.child,s={mode:"hidden",children:s},!(r&1)&&i!==null?(i.childLanes=0,i.pendingProps=s):i=Il(s,r,0,null),e=nr(e,r,n,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=Du(n),t.memoizedState=Pu,e):Vc(t,s));if(o=e.memoizedState,o!==null&&(l=o.dehydrated,l!==null))return kx(e,t,s,r,l,o,n);if(i){i=r.fallback,s=t.mode,o=e.child,l=o.sibling;var a={mode:"hidden",children:r.children};return!(s&1)&&t.child!==o?(r=t.child,r.childLanes=0,r.pendingProps=a,t.deletions=null):(r=Ln(o,a),r.subtreeFlags=o.subtreeFlags&14680064),l!==null?i=Ln(l,i):(i=nr(i,s,n,null),i.flags|=2),i.return=t,r.return=t,r.sibling=i,t.child=r,r=i,i=t.child,s=e.child.memoizedState,s=s===null?Du(n):{baseLanes:s.baseLanes|n,cachePool:null,transitions:s.transitions},i.memoizedState=s,i.childLanes=e.childLanes&~n,t.memoizedState=Pu,r}return i=e.child,e=i.sibling,r=Ln(i,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function Vc(e,t){return t=Il({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Gi(e,t,n,r){return r!==null&&Ic(r),Qr(t,e.child,null,n),e=Vc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kx(e,t,n,r,o,i,s){if(n)return t.flags&256?(t.flags&=-257,r=ba(Error(B(422))),Gi(e,t,s,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=r.fallback,o=t.mode,r=Il({mode:"visible",children:r.children},o,0,null),i=nr(i,o,s,null),i.flags|=2,r.return=t,i.return=t,r.sibling=i,t.child=r,t.mode&1&&Qr(t,e.child,null,s),t.child.memoizedState=Du(s),t.memoizedState=Pu,i);if(!(t.mode&1))return Gi(e,t,s,null);if(o.data==="$!"){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,i=Error(B(419)),r=ba(i,r,void 0),Gi(e,t,s,r)}if(l=(s&e.childLanes)!==0,et||l){if(r=Te,r!==null){switch(s&-s){case 4:o=2;break;case 16:o=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:o=32;break;case 536870912:o=268435456;break;default:o=0}o=o&(r.suspendedLanes|s)?0:o,o!==0&&o!==i.retryLane&&(i.retryLane=o,gn(e,o),At(r,e,o,-1))}return Kc(),r=ba(Error(B(421))),Gi(e,t,s,r)}return o.data==="$?"?(t.flags|=128,t.child=e.child,t=Ax.bind(null,e),o._reactRetry=t,null):(e=i.treeContext,ut=jn(o.nextSibling),ct=t,pe=!0,Pt=null,e!==null&&(vt[wt++]=un,vt[wt++]=cn,vt[wt++]=sr,un=e.id,cn=e.overflow,sr=t),t=Vc(t,r.children),t.flags|=4096,t)}function Rf(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Cu(e.return,t,n)}function Ma(e,t,n,r,o){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:o}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=r,i.tail=n,i.tailMode=o)}function im(e,t,n){var r=t.pendingProps,o=r.revealOrder,i=r.tail;if(We(e,t,r.children,n),r=ge.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Rf(e,n,t);else if(e.tag===19)Rf(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}r&=1}if(ue(ge,r),!(t.mode&1))t.memoizedState=null;else switch(o){case"forwards":for(n=t.child,o=null;n!==null;)e=n.alternate,e!==null&&Ys(e)===null&&(o=n),n=n.sibling;n=o,n===null?(o=t.child,t.child=null):(o=n.sibling,n.sibling=null),Ma(t,!1,o,n,i);break;case"backwards":for(n=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Ys(e)===null){t.child=o;break}e=o.sibling,o.sibling=n,n=o,o=e}Ma(t,!0,n,null,i);break;case"together":Ma(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Ss(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function mn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ar|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(B(153));if(t.child!==null){for(e=t.child,n=Ln(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Ln(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Cx(e,t,n){switch(t.tag){case 3:rm(t),Yr();break;case 5:Dg(t);break;case 1:rt(t.type)&&Hs(t);break;case 4:zc(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,o=t.memoizedProps.value;ue(Us,r._currentValue),r._currentValue=o;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(ue(ge,ge.current&1),t.flags|=128,null):n&t.child.childLanes?om(e,t,n):(ue(ge,ge.current&1),e=mn(e,t,n),e!==null?e.sibling:null);ue(ge,ge.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return im(e,t,n);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),ue(ge,ge.current),r)break;return null;case 22:case 23:return t.lanes=0,tm(e,t,n)}return mn(e,t,n)}var sm,Tu,lm,am;sm=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};Tu=function(){};lm=function(e,t,n,r){var o=e.memoizedProps;if(o!==r){e=t.stateNode,Jn(Jt.current);var i=null;switch(n){case"input":o=eu(e,o),r=eu(e,r),i=[];break;case"select":o=ye({},o,{value:void 0}),r=ye({},r,{value:void 0}),i=[];break;case"textarea":o=ru(e,o),r=ru(e,r),i=[];break;default:typeof o.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Os)}iu(n,r);var s;n=null;for(u in o)if(!r.hasOwnProperty(u)&&o.hasOwnProperty(u)&&o[u]!=null)if(u==="style"){var l=o[u];for(s in l)l.hasOwnProperty(s)&&(n||(n={}),n[s]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Uo.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in r){var a=r[u];if(l=o!=null?o[u]:void 0,r.hasOwnProperty(u)&&a!==l&&(a!=null||l!=null))if(u==="style")if(l){for(s in l)!l.hasOwnProperty(s)||a&&a.hasOwnProperty(s)||(n||(n={}),n[s]="");for(s in a)a.hasOwnProperty(s)&&l[s]!==a[s]&&(n||(n={}),n[s]=a[s])}else n||(i||(i=[]),i.push(u,n)),n=a;else u==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,l=l?l.__html:void 0,a!=null&&l!==a&&(i=i||[]).push(u,a)):u==="children"?typeof a!="string"&&typeof a!="number"||(i=i||[]).push(u,""+a):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Uo.hasOwnProperty(u)?(a!=null&&u==="onScroll"&&de("scroll",e),i||l===a||(i=[])):(i=i||[]).push(u,a))}n&&(i=i||[]).push("style",n);var u=i;(t.updateQueue=u)&&(t.flags|=4)}};am=function(e,t,n,r){n!==r&&(t.flags|=4)};function xo(e,t){if(!pe)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Le(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags&14680064,r|=o.flags&14680064,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)n|=o.lanes|o.childLanes,r|=o.subtreeFlags,r|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function _x(e,t,n){var r=t.pendingProps;switch(Mc(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Le(t),null;case 1:return rt(t.type)&&Fs(),Le(t),null;case 3:return r=t.stateNode,Kr(),fe(nt),fe(Fe),$c(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(Qi(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Pt!==null&&(Fu(Pt),Pt=null))),Tu(e,t),Le(t),null;case 5:Ac(t);var o=Jn(ni.current);if(n=t.type,e!==null&&t.stateNode!=null)lm(e,t,n,r,o),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(B(166));return Le(t),null}if(e=Jn(Jt.current),Qi(t)){r=t.stateNode,n=t.type;var i=t.memoizedProps;switch(r[Zt]=t,r[ei]=i,e=(t.mode&1)!==0,n){case"dialog":de("cancel",r),de("close",r);break;case"iframe":case"object":case"embed":de("load",r);break;case"video":case"audio":for(o=0;o<bo.length;o++)de(bo[o],r);break;case"source":de("error",r);break;case"img":case"image":case"link":de("error",r),de("load",r);break;case"details":de("toggle",r);break;case"input":Hd(r,i),de("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!i.multiple},de("invalid",r);break;case"textarea":Vd(r,i),de("invalid",r)}iu(n,i),o=null;for(var s in i)if(i.hasOwnProperty(s)){var l=i[s];s==="children"?typeof l=="string"?r.textContent!==l&&(i.suppressHydrationWarning!==!0&&Yi(r.textContent,l,e),o=["children",l]):typeof l=="number"&&r.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Yi(r.textContent,l,e),o=["children",""+l]):Uo.hasOwnProperty(s)&&l!=null&&s==="onScroll"&&de("scroll",r)}switch(n){case"input":Oi(r),Bd(r,i,!0);break;case"textarea":Oi(r),Ud(r);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(r.onclick=Os)}r=o,t.updateQueue=r,r!==null&&(t.flags|=4)}else{s=o.nodeType===9?o:o.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Ap(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=s.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=s.createElement(n,{is:r.is}):(e=s.createElement(n),n==="select"&&(s=e,r.multiple?s.multiple=!0:r.size&&(s.size=r.size))):e=s.createElementNS(e,n),e[Zt]=t,e[ei]=r,sm(e,t,!1,!1),t.stateNode=e;e:{switch(s=su(n,r),n){case"dialog":de("cancel",e),de("close",e),o=r;break;case"iframe":case"object":case"embed":de("load",e),o=r;break;case"video":case"audio":for(o=0;o<bo.length;o++)de(bo[o],e);o=r;break;case"source":de("error",e),o=r;break;case"img":case"image":case"link":de("error",e),de("load",e),o=r;break;case"details":de("toggle",e),o=r;break;case"input":Hd(e,r),o=eu(e,r),de("invalid",e);break;case"option":o=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},o=ye({},r,{value:void 0}),de("invalid",e);break;case"textarea":Vd(e,r),o=ru(e,r),de("invalid",e);break;default:o=r}iu(n,o),l=o;for(i in l)if(l.hasOwnProperty(i)){var a=l[i];i==="style"?Op(e,a):i==="dangerouslySetInnerHTML"?(a=a?a.__html:void 0,a!=null&&$p(e,a)):i==="children"?typeof a=="string"?(n!=="textarea"||a!=="")&&Wo(e,a):typeof a=="number"&&Wo(e,""+a):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Uo.hasOwnProperty(i)?a!=null&&i==="onScroll"&&de("scroll",e):a!=null&&hc(e,i,a,s))}switch(n){case"input":Oi(e),Bd(e,r,!1);break;case"textarea":Oi(e),Ud(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Fn(r.value));break;case"select":e.multiple=!!r.multiple,i=r.value,i!=null?zr(e,!!r.multiple,i,!1):r.defaultValue!=null&&zr(e,!!r.multiple,r.defaultValue,!0);break;default:typeof o.onClick=="function"&&(e.onclick=Os)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Le(t),null;case 6:if(e&&t.stateNode!=null)am(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(B(166));if(n=Jn(ni.current),Jn(Jt.current),Qi(t)){if(r=t.stateNode,n=t.memoizedProps,r[Zt]=t,(i=r.nodeValue!==n)&&(e=ct,e!==null))switch(e.tag){case 3:Yi(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Yi(r.nodeValue,n,(e.mode&1)!==0)}i&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[Zt]=t,t.stateNode=r}return Le(t),null;case 13:if(fe(ge),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(pe&&ut!==null&&t.mode&1&&!(t.flags&128))Ng(),Yr(),t.flags|=98560,i=!1;else if(i=Qi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(B(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(B(317));i[Zt]=t}else Yr(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Le(t),i=!1}else Pt!==null&&(Fu(Pt),Pt=null),i=!0;if(!i)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||ge.current&1?Me===0&&(Me=3):Kc())),t.updateQueue!==null&&(t.flags|=4),Le(t),null);case 4:return Kr(),Tu(e,t),e===null&&qo(t.stateNode.containerInfo),Le(t),null;case 10:return Tc(t.type._context),Le(t),null;case 17:return rt(t.type)&&Fs(),Le(t),null;case 19:if(fe(ge),i=t.memoizedState,i===null)return Le(t),null;if(r=(t.flags&128)!==0,s=i.rendering,s===null)if(r)xo(i,!1);else{if(Me!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(s=Ys(e),s!==null){for(t.flags|=128,xo(i,!1),r=s.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)i=n,e=r,i.flags&=14680066,s=i.alternate,s===null?(i.childLanes=0,i.lanes=e,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=s.childLanes,i.lanes=s.lanes,i.child=s.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=s.memoizedProps,i.memoizedState=s.memoizedState,i.updateQueue=s.updateQueue,i.type=s.type,e=s.dependencies,i.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return ue(ge,ge.current&1|2),t.child}e=e.sibling}i.tail!==null&&xe()>Zr&&(t.flags|=128,r=!0,xo(i,!1),t.lanes=4194304)}else{if(!r)if(e=Ys(s),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),xo(i,!0),i.tail===null&&i.tailMode==="hidden"&&!s.alternate&&!pe)return Le(t),null}else 2*xe()-i.renderingStartTime>Zr&&n!==1073741824&&(t.flags|=128,r=!0,xo(i,!1),t.lanes=4194304);i.isBackwards?(s.sibling=t.child,t.child=s):(n=i.last,n!==null?n.sibling=s:t.child=s,i.last=s)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=xe(),t.sibling=null,n=ge.current,ue(ge,r?n&1|2:n&1),t):(Le(t),null);case 22:case 23:return Qc(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?lt&1073741824&&(Le(t),t.subtreeFlags&6&&(t.flags|=8192)):Le(t),null;case 24:return null;case 25:return null}throw Error(B(156,t.tag))}function Nx(e,t){switch(Mc(t),t.tag){case 1:return rt(t.type)&&Fs(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Kr(),fe(nt),fe(Fe),$c(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return Ac(t),null;case 13:if(fe(ge),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(B(340));Yr()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return fe(ge),null;case 4:return Kr(),null;case 10:return Tc(t.type._context),null;case 22:case 23:return Qc(),null;case 24:return null;default:return null}}var Zi=!1,Oe=!1,bx=typeof WeakSet=="function"?WeakSet:Set,Q=null;function Pr(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){we(e,t,r)}else n.current=null}function Ru(e,t,n){try{n()}catch(r){we(e,t,r)}}var jf=!1;function Mx(e,t){if(mu=As,e=hg(),Nc(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var o=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var s=0,l=-1,a=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var g;d!==n||o!==0&&d.nodeType!==3||(l=s+o),d!==i||r!==0&&d.nodeType!==3||(a=s+r),d.nodeType===3&&(s+=d.nodeValue.length),(g=d.firstChild)!==null;)f=d,d=g;for(;;){if(d===e)break t;if(f===n&&++u===o&&(l=s),f===i&&++c===r&&(a=s),(g=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=g}n=l===-1||a===-1?null:{start:l,end:a}}else n=null}n=n||{start:0,end:0}}else n=null;for(yu={focusedElem:e,selectionRange:n},As=!1,Q=t;Q!==null;)if(t=Q,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Q=e;else for(;Q!==null;){t=Q;try{var y=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var v=y.memoizedProps,x=y.memoizedState,p=t.stateNode,m=p.getSnapshotBeforeUpdate(t.elementType===t.type?v:bt(t.type,v),x);p.__reactInternalSnapshotBeforeUpdate=m}break;case 3:var h=t.stateNode.containerInfo;h.nodeType===1?h.textContent="":h.nodeType===9&&h.documentElement&&h.removeChild(h.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(B(163))}}catch(w){we(t,t.return,w)}if(e=t.sibling,e!==null){e.return=t.return,Q=e;break}Q=t.return}return y=jf,jf=!1,y}function Ao(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var o=r=r.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&Ru(t,n,i)}o=o.next}while(o!==r)}}function bl(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function ju(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function um(e){var t=e.alternate;t!==null&&(e.alternate=null,um(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Zt],delete t[ei],delete t[xu],delete t[cx],delete t[dx])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function cm(e){return e.tag===5||e.tag===3||e.tag===4}function zf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zu(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Os));else if(r!==4&&(e=e.child,e!==null))for(zu(e,t,n),e=e.sibling;e!==null;)zu(e,t,n),e=e.sibling}function Au(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(Au(e,t,n),e=e.sibling;e!==null;)Au(e,t,n),e=e.sibling}var Re=null,Mt=!1;function xn(e,t,n){for(n=n.child;n!==null;)dm(e,t,n),n=n.sibling}function dm(e,t,n){if(qt&&typeof qt.onCommitFiberUnmount=="function")try{qt.onCommitFiberUnmount(wl,n)}catch{}switch(n.tag){case 5:Oe||Pr(n,t);case 6:var r=Re,o=Mt;Re=null,xn(e,t,n),Re=r,Mt=o,Re!==null&&(Mt?(e=Re,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Re.removeChild(n.stateNode));break;case 18:Re!==null&&(Mt?(e=Re,n=n.stateNode,e.nodeType===8?Sa(e.parentNode,n):e.nodeType===1&&Sa(e,n),Ko(e)):Sa(Re,n.stateNode));break;case 4:r=Re,o=Mt,Re=n.stateNode.containerInfo,Mt=!0,xn(e,t,n),Re=r,Mt=o;break;case 0:case 11:case 14:case 15:if(!Oe&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){o=r=r.next;do{var i=o,s=i.destroy;i=i.tag,s!==void 0&&(i&2||i&4)&&Ru(n,t,s),o=o.next}while(o!==r)}xn(e,t,n);break;case 1:if(!Oe&&(Pr(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(l){we(n,t,l)}xn(e,t,n);break;case 21:xn(e,t,n);break;case 22:n.mode&1?(Oe=(r=Oe)||n.memoizedState!==null,xn(e,t,n),Oe=r):xn(e,t,n);break;default:xn(e,t,n)}}function Af(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new bx),t.forEach(function(r){var o=$x.bind(null,e,r);n.has(r)||(n.add(r),r.then(o,o))})}}function Nt(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var o=n[r];try{var i=e,s=t,l=s;e:for(;l!==null;){switch(l.tag){case 5:Re=l.stateNode,Mt=!1;break e;case 3:Re=l.stateNode.containerInfo,Mt=!0;break e;case 4:Re=l.stateNode.containerInfo,Mt=!0;break e}l=l.return}if(Re===null)throw Error(B(160));dm(i,s,o),Re=null,Mt=!1;var a=o.alternate;a!==null&&(a.return=null),o.return=null}catch(u){we(o,t,u)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)fm(t,e),t=t.sibling}function fm(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(Nt(t,e),Qt(e),r&4){try{Ao(3,e,e.return),bl(3,e)}catch(v){we(e,e.return,v)}try{Ao(5,e,e.return)}catch(v){we(e,e.return,v)}}break;case 1:Nt(t,e),Qt(e),r&512&&n!==null&&Pr(n,n.return);break;case 5:if(Nt(t,e),Qt(e),r&512&&n!==null&&Pr(n,n.return),e.flags&32){var o=e.stateNode;try{Wo(o,"")}catch(v){we(e,e.return,v)}}if(r&4&&(o=e.stateNode,o!=null)){var i=e.memoizedProps,s=n!==null?n.memoizedProps:i,l=e.type,a=e.updateQueue;if(e.updateQueue=null,a!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&jp(o,i),su(l,s);var u=su(l,i);for(s=0;s<a.length;s+=2){var c=a[s],d=a[s+1];c==="style"?Op(o,d):c==="dangerouslySetInnerHTML"?$p(o,d):c==="children"?Wo(o,d):hc(o,c,d,u)}switch(l){case"input":tu(o,i);break;case"textarea":zp(o,i);break;case"select":var f=o._wrapperState.wasMultiple;o._wrapperState.wasMultiple=!!i.multiple;var g=i.value;g!=null?zr(o,!!i.multiple,g,!1):f!==!!i.multiple&&(i.defaultValue!=null?zr(o,!!i.multiple,i.defaultValue,!0):zr(o,!!i.multiple,i.multiple?[]:"",!1))}o[ei]=i}catch(v){we(e,e.return,v)}}break;case 6:if(Nt(t,e),Qt(e),r&4){if(e.stateNode===null)throw Error(B(162));o=e.stateNode,i=e.memoizedProps;try{o.nodeValue=i}catch(v){we(e,e.return,v)}}break;case 3:if(Nt(t,e),Qt(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Ko(t.containerInfo)}catch(v){we(e,e.return,v)}break;case 4:Nt(t,e),Qt(e);break;case 13:Nt(t,e),Qt(e),o=e.child,o.flags&8192&&(i=o.memoizedState!==null,o.stateNode.isHidden=i,!i||o.alternate!==null&&o.alternate.memoizedState!==null||(Xc=xe())),r&4&&Af(e);break;case 22:if(c=n!==null&&n.memoizedState!==null,e.mode&1?(Oe=(u=Oe)||c,Nt(t,e),Oe=u):Nt(t,e),Qt(e),r&8192){if(u=e.memoizedState!==null,(e.stateNode.isHidden=u)&&!c&&e.mode&1)for(Q=e,c=e.child;c!==null;){for(d=Q=c;Q!==null;){switch(f=Q,g=f.child,f.tag){case 0:case 11:case 14:case 15:Ao(4,f,f.return);break;case 1:Pr(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){r=f,n=f.return;try{t=r,y.props=t.memoizedProps,y.state=t.memoizedState,y.componentWillUnmount()}catch(v){we(r,n,v)}}break;case 5:Pr(f,f.return);break;case 22:if(f.memoizedState!==null){Lf(d);continue}}g!==null?(g.return=f,Q=g):Lf(d)}c=c.sibling}e:for(c=null,d=e;;){if(d.tag===5){if(c===null){c=d;try{o=d.stateNode,u?(i=o.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=d.stateNode,a=d.memoizedProps.style,s=a!=null&&a.hasOwnProperty("display")?a.display:null,l.style.display=Lp("display",s))}catch(v){we(e,e.return,v)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(v){we(e,e.return,v)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===e)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===e)break e;for(;d.sibling===null;){if(d.return===null||d.return===e)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:Nt(t,e),Qt(e),r&4&&Af(e);break;case 21:break;default:Nt(t,e),Qt(e)}}function Qt(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(cm(n)){var r=n;break e}n=n.return}throw Error(B(160))}switch(r.tag){case 5:var o=r.stateNode;r.flags&32&&(Wo(o,""),r.flags&=-33);var i=zf(e);Au(e,i,o);break;case 3:case 4:var s=r.stateNode.containerInfo,l=zf(e);zu(e,l,s);break;default:throw Error(B(161))}}catch(a){we(e,e.return,a)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Ix(e,t,n){Q=e,hm(e)}function hm(e,t,n){for(var r=(e.mode&1)!==0;Q!==null;){var o=Q,i=o.child;if(o.tag===22&&r){var s=o.memoizedState!==null||Zi;if(!s){var l=o.alternate,a=l!==null&&l.memoizedState!==null||Oe;l=Zi;var u=Oe;if(Zi=s,(Oe=a)&&!u)for(Q=o;Q!==null;)s=Q,a=s.child,s.tag===22&&s.memoizedState!==null?Of(o):a!==null?(a.return=s,Q=a):Of(o);for(;i!==null;)Q=i,hm(i),i=i.sibling;Q=o,Zi=l,Oe=u}$f(e)}else o.subtreeFlags&8772&&i!==null?(i.return=o,Q=i):$f(e)}}function $f(e){for(;Q!==null;){var t=Q;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Oe||bl(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Oe)if(n===null)r.componentDidMount();else{var o=t.elementType===t.type?n.memoizedProps:bt(t.type,n.memoizedProps);r.componentDidUpdate(o,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var i=t.updateQueue;i!==null&&Sf(t,i,r);break;case 3:var s=t.updateQueue;if(s!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}Sf(t,s,n)}break;case 5:var l=t.stateNode;if(n===null&&t.flags&4){n=l;var a=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break;case"img":a.src&&(n.src=a.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var u=t.alternate;if(u!==null){var c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&Ko(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(B(163))}Oe||t.flags&512&&ju(t)}catch(f){we(t,t.return,f)}}if(t===e){Q=null;break}if(n=t.sibling,n!==null){n.return=t.return,Q=n;break}Q=t.return}}function Lf(e){for(;Q!==null;){var t=Q;if(t===e){Q=null;break}var n=t.sibling;if(n!==null){n.return=t.return,Q=n;break}Q=t.return}}function Of(e){for(;Q!==null;){var t=Q;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{bl(4,t)}catch(a){we(t,n,a)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var o=t.return;try{r.componentDidMount()}catch(a){we(t,o,a)}}var i=t.return;try{ju(t)}catch(a){we(t,i,a)}break;case 5:var s=t.return;try{ju(t)}catch(a){we(t,s,a)}}}catch(a){we(t,t.return,a)}if(t===e){Q=null;break}var l=t.sibling;if(l!==null){l.return=t.return,Q=l;break}Q=t.return}}var Px=Math.ceil,Gs=vn.ReactCurrentDispatcher,Uc=vn.ReactCurrentOwner,St=vn.ReactCurrentBatchConfig,ie=0,Te=null,Ee=null,je=0,lt=0,Dr=Vn(0),Me=0,si=null,ar=0,Ml=0,Wc=0,$o=null,Je=null,Xc=0,Zr=1/0,ln=null,Zs=!1,$u=null,An=null,qi=!1,Pn=null,qs=0,Lo=0,Lu=null,Es=-1,ks=0;function Xe(){return ie&6?xe():Es!==-1?Es:Es=xe()}function $n(e){return e.mode&1?ie&2&&je!==0?je&-je:hx.transition!==null?(ks===0&&(ks=Zp()),ks):(e=ae,e!==0||(e=window.event,e=e===void 0?16:og(e.type)),e):1}function At(e,t,n,r){if(50<Lo)throw Lo=0,Lu=null,Error(B(185));xi(e,n,r),(!(ie&2)||e!==Te)&&(e===Te&&(!(ie&2)&&(Ml|=n),Me===4&&bn(e,je)),ot(e,r),n===1&&ie===0&&!(t.mode&1)&&(Zr=xe()+500,Cl&&Un()))}function ot(e,t){var n=e.callbackNode;hw(e,t);var r=zs(e,e===Te?je:0);if(r===0)n!==null&&Yd(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Yd(n),t===1)e.tag===0?fx(Ff.bind(null,e)):kg(Ff.bind(null,e)),ax(function(){!(ie&6)&&Un()}),n=null;else{switch(qp(r)){case 1:n=vc;break;case 4:n=Kp;break;case 16:n=js;break;case 536870912:n=Gp;break;default:n=js}n=Sm(n,pm.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function pm(e,t){if(Es=-1,ks=0,ie&6)throw Error(B(327));var n=e.callbackNode;if(Fr()&&e.callbackNode!==n)return null;var r=zs(e,e===Te?je:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Js(e,r);else{t=r;var o=ie;ie|=2;var i=mm();(Te!==e||je!==t)&&(ln=null,Zr=xe()+500,tr(e,t));do try{Rx();break}catch(l){gm(e,l)}while(!0);Dc(),Gs.current=i,ie=o,Ee!==null?t=0:(Te=null,je=0,t=Me)}if(t!==0){if(t===2&&(o=du(e),o!==0&&(r=o,t=Ou(e,o))),t===1)throw n=si,tr(e,0),bn(e,r),ot(e,xe()),n;if(t===6)bn(e,r);else{if(o=e.current.alternate,!(r&30)&&!Dx(o)&&(t=Js(e,r),t===2&&(i=du(e),i!==0&&(r=i,t=Ou(e,i))),t===1))throw n=si,tr(e,0),bn(e,r),ot(e,xe()),n;switch(e.finishedWork=o,e.finishedLanes=r,t){case 0:case 1:throw Error(B(345));case 2:Kn(e,Je,ln);break;case 3:if(bn(e,r),(r&130023424)===r&&(t=Xc+500-xe(),10<t)){if(zs(e,0)!==0)break;if(o=e.suspendedLanes,(o&r)!==r){Xe(),e.pingedLanes|=e.suspendedLanes&o;break}e.timeoutHandle=wu(Kn.bind(null,e,Je,ln),t);break}Kn(e,Je,ln);break;case 4:if(bn(e,r),(r&4194240)===r)break;for(t=e.eventTimes,o=-1;0<r;){var s=31-zt(r);i=1<<s,s=t[s],s>o&&(o=s),r&=~i}if(r=o,r=xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*Px(r/1960))-r,10<r){e.timeoutHandle=wu(Kn.bind(null,e,Je,ln),r);break}Kn(e,Je,ln);break;case 5:Kn(e,Je,ln);break;default:throw Error(B(329))}}}return ot(e,xe()),e.callbackNode===n?pm.bind(null,e):null}function Ou(e,t){var n=$o;return e.current.memoizedState.isDehydrated&&(tr(e,t).flags|=256),e=Js(e,t),e!==2&&(t=Je,Je=n,t!==null&&Fu(t)),e}function Fu(e){Je===null?Je=e:Je.push.apply(Je,e)}function Dx(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var o=n[r],i=o.getSnapshot;o=o.value;try{if(!$t(i(),o))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function bn(e,t){for(t&=~Wc,t&=~Ml,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-zt(t),r=1<<n;e[n]=-1,t&=~r}}function Ff(e){if(ie&6)throw Error(B(327));Fr();var t=zs(e,0);if(!(t&1))return ot(e,xe()),null;var n=Js(e,t);if(e.tag!==0&&n===2){var r=du(e);r!==0&&(t=r,n=Ou(e,r))}if(n===1)throw n=si,tr(e,0),bn(e,t),ot(e,xe()),n;if(n===6)throw Error(B(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Kn(e,Je,ln),ot(e,xe()),null}function Yc(e,t){var n=ie;ie|=1;try{return e(t)}finally{ie=n,ie===0&&(Zr=xe()+500,Cl&&Un())}}function ur(e){Pn!==null&&Pn.tag===0&&!(ie&6)&&Fr();var t=ie;ie|=1;var n=St.transition,r=ae;try{if(St.transition=null,ae=1,e)return e()}finally{ae=r,St.transition=n,ie=t,!(ie&6)&&Un()}}function Qc(){lt=Dr.current,fe(Dr)}function tr(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,lx(n)),Ee!==null)for(n=Ee.return;n!==null;){var r=n;switch(Mc(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Fs();break;case 3:Kr(),fe(nt),fe(Fe),$c();break;case 5:Ac(r);break;case 4:Kr();break;case 13:fe(ge);break;case 19:fe(ge);break;case 10:Tc(r.type._context);break;case 22:case 23:Qc()}n=n.return}if(Te=e,Ee=e=Ln(e.current,null),je=lt=t,Me=0,si=null,Wc=Ml=ar=0,Je=$o=null,qn!==null){for(t=0;t<qn.length;t++)if(n=qn[t],r=n.interleaved,r!==null){n.interleaved=null;var o=r.next,i=n.pending;if(i!==null){var s=i.next;i.next=o,r.next=s}n.pending=r}qn=null}return e}function gm(e,t){do{var n=Ee;try{if(Dc(),ws.current=Ks,Qs){for(var r=me.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Qs=!1}if(lr=0,Pe=Ne=me=null,zo=!1,ri=0,Uc.current=null,n===null||n.return===null){Me=1,si=t,Ee=null;break}e:{var i=e,s=n.return,l=n,a=t;if(t=je,l.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){var u=a,c=l,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var g=bf(s);if(g!==null){g.flags&=-257,Mf(g,s,l,i,t),g.mode&1&&Nf(i,u,t),t=g,a=u;var y=t.updateQueue;if(y===null){var v=new Set;v.add(a),t.updateQueue=v}else y.add(a);break e}else{if(!(t&1)){Nf(i,u,t),Kc();break e}a=Error(B(426))}}else if(pe&&l.mode&1){var x=bf(s);if(x!==null){!(x.flags&65536)&&(x.flags|=256),Mf(x,s,l,i,t),Ic(Gr(a,l));break e}}i=a=Gr(a,l),Me!==4&&(Me=2),$o===null?$o=[i]:$o.push(i),i=s;do{switch(i.tag){case 3:i.flags|=65536,t&=-t,i.lanes|=t;var p=qg(i,a,t);xf(i,p);break e;case 1:l=a;var m=i.type,h=i.stateNode;if(!(i.flags&128)&&(typeof m.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(An===null||!An.has(h)))){i.flags|=65536,t&=-t,i.lanes|=t;var w=Jg(i,l,t);xf(i,w);break e}}i=i.return}while(i!==null)}vm(n)}catch(C){t=C,Ee===n&&n!==null&&(Ee=n=n.return);continue}break}while(!0)}function mm(){var e=Gs.current;return Gs.current=Ks,e===null?Ks:e}function Kc(){(Me===0||Me===3||Me===2)&&(Me=4),Te===null||!(ar&268435455)&&!(Ml&268435455)||bn(Te,je)}function Js(e,t){var n=ie;ie|=2;var r=mm();(Te!==e||je!==t)&&(ln=null,tr(e,t));do try{Tx();break}catch(o){gm(e,o)}while(!0);if(Dc(),ie=n,Gs.current=r,Ee!==null)throw Error(B(261));return Te=null,je=0,Me}function Tx(){for(;Ee!==null;)ym(Ee)}function Rx(){for(;Ee!==null&&!ow();)ym(Ee)}function ym(e){var t=xm(e.alternate,e,lt);e.memoizedProps=e.pendingProps,t===null?vm(e):Ee=t,Uc.current=null}function vm(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=Nx(n,t),n!==null){n.flags&=32767,Ee=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Me=6,Ee=null;return}}else if(n=_x(n,t,lt),n!==null){Ee=n;return}if(t=t.sibling,t!==null){Ee=t;return}Ee=t=e}while(t!==null);Me===0&&(Me=5)}function Kn(e,t,n){var r=ae,o=St.transition;try{St.transition=null,ae=1,jx(e,t,n,r)}finally{St.transition=o,ae=r}return null}function jx(e,t,n,r){do Fr();while(Pn!==null);if(ie&6)throw Error(B(327));n=e.finishedWork;var o=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(B(177));e.callbackNode=null,e.callbackPriority=0;var i=n.lanes|n.childLanes;if(pw(e,i),e===Te&&(Ee=Te=null,je=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||qi||(qi=!0,Sm(js,function(){return Fr(),null})),i=(n.flags&15990)!==0,n.subtreeFlags&15990||i){i=St.transition,St.transition=null;var s=ae;ae=1;var l=ie;ie|=4,Uc.current=null,Mx(e,n),fm(n,e),ex(yu),As=!!mu,yu=mu=null,e.current=n,Ix(n),iw(),ie=l,ae=s,St.transition=i}else e.current=n;if(qi&&(qi=!1,Pn=e,qs=o),i=e.pendingLanes,i===0&&(An=null),aw(n.stateNode),ot(e,xe()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)o=t[n],r(o.value,{componentStack:o.stack,digest:o.digest});if(Zs)throw Zs=!1,e=$u,$u=null,e;return qs&1&&e.tag!==0&&Fr(),i=e.pendingLanes,i&1?e===Lu?Lo++:(Lo=0,Lu=e):Lo=0,Un(),null}function Fr(){if(Pn!==null){var e=qp(qs),t=St.transition,n=ae;try{if(St.transition=null,ae=16>e?16:e,Pn===null)var r=!1;else{if(e=Pn,Pn=null,qs=0,ie&6)throw Error(B(331));var o=ie;for(ie|=4,Q=e.current;Q!==null;){var i=Q,s=i.child;if(Q.flags&16){var l=i.deletions;if(l!==null){for(var a=0;a<l.length;a++){var u=l[a];for(Q=u;Q!==null;){var c=Q;switch(c.tag){case 0:case 11:case 15:Ao(8,c,i)}var d=c.child;if(d!==null)d.return=c,Q=d;else for(;Q!==null;){c=Q;var f=c.sibling,g=c.return;if(um(c),c===u){Q=null;break}if(f!==null){f.return=g,Q=f;break}Q=g}}}var y=i.alternate;if(y!==null){var v=y.child;if(v!==null){y.child=null;do{var x=v.sibling;v.sibling=null,v=x}while(v!==null)}}Q=i}}if(i.subtreeFlags&2064&&s!==null)s.return=i,Q=s;else e:for(;Q!==null;){if(i=Q,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Ao(9,i,i.return)}var p=i.sibling;if(p!==null){p.return=i.return,Q=p;break e}Q=i.return}}var m=e.current;for(Q=m;Q!==null;){s=Q;var h=s.child;if(s.subtreeFlags&2064&&h!==null)h.return=s,Q=h;else e:for(s=m;Q!==null;){if(l=Q,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:bl(9,l)}}catch(C){we(l,l.return,C)}if(l===s){Q=null;break e}var w=l.sibling;if(w!==null){w.return=l.return,Q=w;break e}Q=l.return}}if(ie=o,Un(),qt&&typeof qt.onPostCommitFiberRoot=="function")try{qt.onPostCommitFiberRoot(wl,e)}catch{}r=!0}return r}finally{ae=n,St.transition=t}}return!1}function Hf(e,t,n){t=Gr(n,t),t=qg(e,t,1),e=zn(e,t,1),t=Xe(),e!==null&&(xi(e,1,t),ot(e,t))}function we(e,t,n){if(e.tag===3)Hf(e,e,n);else for(;t!==null;){if(t.tag===3){Hf(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(An===null||!An.has(r))){e=Gr(n,e),e=Jg(t,e,1),t=zn(t,e,1),e=Xe(),t!==null&&(xi(t,1,e),ot(t,e));break}}t=t.return}}function zx(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=Xe(),e.pingedLanes|=e.suspendedLanes&n,Te===e&&(je&n)===n&&(Me===4||Me===3&&(je&130023424)===je&&500>xe()-Xc?tr(e,0):Wc|=n),ot(e,t)}function wm(e,t){t===0&&(e.mode&1?(t=Bi,Bi<<=1,!(Bi&130023424)&&(Bi=4194304)):t=1);var n=Xe();e=gn(e,t),e!==null&&(xi(e,t,n),ot(e,n))}function Ax(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),wm(e,n)}function $x(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,o=e.memoizedState;o!==null&&(n=o.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(B(314))}r!==null&&r.delete(t),wm(e,n)}var xm;xm=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||nt.current)et=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return et=!1,Cx(e,t,n);et=!!(e.flags&131072)}else et=!1,pe&&t.flags&1048576&&Cg(t,Vs,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;Ss(e,t),e=t.pendingProps;var o=Xr(t,Fe.current);Or(t,n),o=Oc(null,t,r,e,o,n);var i=Fc();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,rt(r)?(i=!0,Hs(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,jc(t),o.updater=Nl,t.stateNode=o,o._reactInternals=t,Nu(t,r,e,n),t=Iu(null,t,r,!0,i,n)):(t.tag=0,pe&&i&&bc(t),We(null,t,o,n),t=t.child),t;case 16:r=t.elementType;e:{switch(Ss(e,t),e=t.pendingProps,o=r._init,r=o(r._payload),t.type=r,o=t.tag=Ox(r),e=bt(r,e),o){case 0:t=Mu(null,t,r,e,n);break e;case 1:t=Df(null,t,r,e,n);break e;case 11:t=If(null,t,r,e,n);break e;case 14:t=Pf(null,t,r,bt(r.type,e),n);break e}throw Error(B(306,r,""))}return t;case 0:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:bt(r,o),Mu(e,t,r,o,n);case 1:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:bt(r,o),Df(e,t,r,o,n);case 3:e:{if(rm(t),e===null)throw Error(B(387));r=t.pendingProps,i=t.memoizedState,o=i.element,Pg(e,t),Xs(t,r,null,n);var s=t.memoizedState;if(r=s.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=Gr(Error(B(423)),t),t=Tf(e,t,r,n,o);break e}else if(r!==o){o=Gr(Error(B(424)),t),t=Tf(e,t,r,n,o);break e}else for(ut=jn(t.stateNode.containerInfo.firstChild),ct=t,pe=!0,Pt=null,n=Mg(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Yr(),r===o){t=mn(e,t,n);break e}We(e,t,r,n)}t=t.child}return t;case 5:return Dg(t),e===null&&ku(t),r=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,s=o.children,vu(r,o)?s=null:i!==null&&vu(r,i)&&(t.flags|=32),nm(e,t),We(e,t,s,n),t.child;case 6:return e===null&&ku(t),null;case 13:return om(e,t,n);case 4:return zc(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Qr(t,null,r,n):We(e,t,r,n),t.child;case 11:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:bt(r,o),If(e,t,r,o,n);case 7:return We(e,t,t.pendingProps,n),t.child;case 8:return We(e,t,t.pendingProps.children,n),t.child;case 12:return We(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,o=t.pendingProps,i=t.memoizedProps,s=o.value,ue(Us,r._currentValue),r._currentValue=s,i!==null)if($t(i.value,s)){if(i.children===o.children&&!nt.current){t=mn(e,t,n);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var l=i.dependencies;if(l!==null){s=i.child;for(var a=l.firstContext;a!==null;){if(a.context===r){if(i.tag===1){a=fn(-1,n&-n),a.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?a.next=a:(a.next=c.next,c.next=a),u.pending=a}}i.lanes|=n,a=i.alternate,a!==null&&(a.lanes|=n),Cu(i.return,n,t),l.lanes|=n;break}a=a.next}}else if(i.tag===10)s=i.type===t.type?null:i.child;else if(i.tag===18){if(s=i.return,s===null)throw Error(B(341));s.lanes|=n,l=s.alternate,l!==null&&(l.lanes|=n),Cu(s,n,t),s=i.sibling}else s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===t){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}We(e,t,o.children,n),t=t.child}return t;case 9:return o=t.type,r=t.pendingProps.children,Or(t,n),o=Et(o),r=r(o),t.flags|=1,We(e,t,r,n),t.child;case 14:return r=t.type,o=bt(r,t.pendingProps),o=bt(r.type,o),Pf(e,t,r,o,n);case 15:return em(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,o=t.pendingProps,o=t.elementType===r?o:bt(r,o),Ss(e,t),t.tag=1,rt(r)?(e=!0,Hs(t)):e=!1,Or(t,n),Zg(t,r,o),Nu(t,r,o,n),Iu(null,t,r,!0,e,n);case 19:return im(e,t,n);case 22:return tm(e,t,n)}throw Error(B(156,t.tag))};function Sm(e,t){return Qp(e,t)}function Lx(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xt(e,t,n,r){return new Lx(e,t,n,r)}function Gc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ox(e){if(typeof e=="function")return Gc(e)?1:0;if(e!=null){if(e=e.$$typeof,e===gc)return 11;if(e===mc)return 14}return 2}function Ln(e,t){var n=e.alternate;return n===null?(n=xt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function Cs(e,t,n,r,o,i){var s=2;if(r=e,typeof e=="function")Gc(e)&&(s=1);else if(typeof e=="string")s=5;else e:switch(e){case Sr:return nr(n.children,o,i,t);case pc:s=8,o|=8;break;case Ga:return e=xt(12,n,t,o|2),e.elementType=Ga,e.lanes=i,e;case Za:return e=xt(13,n,t,o),e.elementType=Za,e.lanes=i,e;case qa:return e=xt(19,n,t,o),e.elementType=qa,e.lanes=i,e;case Dp:return Il(n,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case Ip:s=10;break e;case Pp:s=9;break e;case gc:s=11;break e;case mc:s=14;break e;case kn:s=16,r=null;break e}throw Error(B(130,e==null?e:typeof e,""))}return t=xt(s,n,t,o),t.elementType=e,t.type=r,t.lanes=i,t}function nr(e,t,n,r){return e=xt(7,e,r,t),e.lanes=n,e}function Il(e,t,n,r){return e=xt(22,e,r,t),e.elementType=Dp,e.lanes=n,e.stateNode={isHidden:!1},e}function Ia(e,t,n){return e=xt(6,e,null,t),e.lanes=n,e}function Pa(e,t,n){return t=xt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fx(e,t,n,r,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=ca(0),this.expirationTimes=ca(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ca(0),this.identifierPrefix=r,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function Zc(e,t,n,r,o,i,s,l,a){return e=new Fx(e,t,n,l,a),t===1?(t=1,i===!0&&(t|=8)):t=0,i=xt(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},jc(i),e}function Hx(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:xr,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Em(e){if(!e)return Hn;e=e._reactInternals;e:{if(mr(e)!==e||e.tag!==1)throw Error(B(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(rt(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(B(171))}if(e.tag===1){var n=e.type;if(rt(n))return Eg(e,n,t)}return t}function km(e,t,n,r,o,i,s,l,a){return e=Zc(n,r,!0,e,o,i,s,l,a),e.context=Em(null),n=e.current,r=Xe(),o=$n(n),i=fn(r,o),i.callback=t??null,zn(n,i,o),e.current.lanes=o,xi(e,o,r),ot(e,r),e}function Pl(e,t,n,r){var o=t.current,i=Xe(),s=$n(o);return n=Em(n),t.context===null?t.context=n:t.pendingContext=n,t=fn(i,s),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=zn(o,t,s),e!==null&&(At(e,o,s,i),vs(e,o,s)),s}function el(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Bf(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function qc(e,t){Bf(e,t),(e=e.alternate)&&Bf(e,t)}function Bx(){return null}var Cm=typeof reportError=="function"?reportError:function(e){console.error(e)};function Jc(e){this._internalRoot=e}Dl.prototype.render=Jc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(B(409));Pl(e,t,null,null)};Dl.prototype.unmount=Jc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;ur(function(){Pl(null,e,null,null)}),t[pn]=null}};function Dl(e){this._internalRoot=e}Dl.prototype.unstable_scheduleHydration=function(e){if(e){var t=tg();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Nn.length&&t!==0&&t<Nn[n].priority;n++);Nn.splice(n,0,e),n===0&&rg(e)}};function ed(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function Tl(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Vf(){}function Vx(e,t,n,r,o){if(o){if(typeof r=="function"){var i=r;r=function(){var u=el(s);i.call(u)}}var s=km(t,r,e,0,null,!1,!1,"",Vf);return e._reactRootContainer=s,e[pn]=s.current,qo(e.nodeType===8?e.parentNode:e),ur(),s}for(;o=e.lastChild;)e.removeChild(o);if(typeof r=="function"){var l=r;r=function(){var u=el(a);l.call(u)}}var a=Zc(e,0,!1,null,null,!1,!1,"",Vf);return e._reactRootContainer=a,e[pn]=a.current,qo(e.nodeType===8?e.parentNode:e),ur(function(){Pl(t,a,n,r)}),a}function Rl(e,t,n,r,o){var i=n._reactRootContainer;if(i){var s=i;if(typeof o=="function"){var l=o;o=function(){var a=el(s);l.call(a)}}Pl(t,s,e,o)}else s=Vx(n,t,e,o,r);return el(s)}Jp=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=No(t.pendingLanes);n!==0&&(wc(t,n|1),ot(t,xe()),!(ie&6)&&(Zr=xe()+500,Un()))}break;case 13:ur(function(){var r=gn(e,1);if(r!==null){var o=Xe();At(r,e,1,o)}}),qc(e,1)}};xc=function(e){if(e.tag===13){var t=gn(e,134217728);if(t!==null){var n=Xe();At(t,e,134217728,n)}qc(e,134217728)}};eg=function(e){if(e.tag===13){var t=$n(e),n=gn(e,t);if(n!==null){var r=Xe();At(n,e,t,r)}qc(e,t)}};tg=function(){return ae};ng=function(e,t){var n=ae;try{return ae=e,t()}finally{ae=n}};au=function(e,t,n){switch(t){case"input":if(tu(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var o=kl(r);if(!o)throw Error(B(90));Rp(r),tu(r,o)}}}break;case"textarea":zp(e,n);break;case"select":t=n.value,t!=null&&zr(e,!!n.multiple,t,!1)}};Bp=Yc;Vp=ur;var Ux={usingClientEntryPoint:!1,Events:[Ei,_r,kl,Fp,Hp,Yc]},So={findFiberByHostInstance:Zn,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Wx={bundleType:So.bundleType,version:So.version,rendererPackageName:So.rendererPackageName,rendererConfig:So.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:vn.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=Xp(e),e===null?null:e.stateNode},findFiberByHostInstance:So.findFiberByHostInstance||Bx,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ji=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ji.isDisabled&&Ji.supportsFiber)try{wl=Ji.inject(Wx),qt=Ji}catch{}}ht.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ux;ht.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ed(t))throw Error(B(200));return Hx(e,t,null,n)};ht.createRoot=function(e,t){if(!ed(e))throw Error(B(299));var n=!1,r="",o=Cm;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(o=t.onRecoverableError)),t=Zc(e,1,!1,null,null,n,!1,r,o),e[pn]=t.current,qo(e.nodeType===8?e.parentNode:e),new Jc(t)};ht.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(B(188)):(e=Object.keys(e).join(","),Error(B(268,e)));return e=Xp(t),e=e===null?null:e.stateNode,e};ht.flushSync=function(e){return ur(e)};ht.hydrate=function(e,t,n){if(!Tl(t))throw Error(B(200));return Rl(null,e,t,!0,n)};ht.hydrateRoot=function(e,t,n){if(!ed(e))throw Error(B(405));var r=n!=null&&n.hydratedSources||null,o=!1,i="",s=Cm;if(n!=null&&(n.unstable_strictMode===!0&&(o=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onRecoverableError!==void 0&&(s=n.onRecoverableError)),t=km(t,null,e,1,n??null,o,!1,i,s),e[pn]=t.current,qo(e),r)for(e=0;e<r.length;e++)n=r[e],o=n._getVersion,o=o(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,o]:t.mutableSourceEagerHydrationData.push(n,o);return new Dl(t)};ht.render=function(e,t,n){if(!Tl(t))throw Error(B(200));return Rl(null,e,t,!1,n)};ht.unmountComponentAtNode=function(e){if(!Tl(e))throw Error(B(40));return e._reactRootContainer?(ur(function(){Rl(null,null,e,!1,function(){e._reactRootContainer=null,e[pn]=null})}),!0):!1};ht.unstable_batchedUpdates=Yc;ht.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!Tl(n))throw Error(B(200));if(e==null||e._reactInternals===void 0)throw Error(B(38));return Rl(e,t,n,!1,r)};ht.version="18.3.1-next-f1338f8080-20240426";function _m(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(_m)}catch(e){console.error(e)}}_m(),_p.exports=ht;var Tr=_p.exports,Nm,Uf=Tr;Nm=Uf.createRoot,Uf.hydrateRoot;const Wf=e=>{let t;const n=new Set,r=(u,c)=>{const d=typeof u=="function"?u(t):u;if(!Object.is(d,t)){const f=t;t=c??(typeof d!="object"||d===null)?d:Object.assign({},t,d),n.forEach(g=>g(t,f))}},o=()=>t,l={setState:r,getState:o,getInitialState:()=>a,subscribe:u=>(n.add(u),()=>n.delete(u))},a=t=e(r,o,l);return l},Xx=e=>e?Wf(e):Wf,Yx=e=>e;function Qx(e,t=Yx){const n=Se.useSyncExternalStore(e.subscribe,Se.useCallback(()=>t(e.getState()),[e,t]),Se.useCallback(()=>t(e.getInitialState()),[e,t]));return Se.useDebugValue(n),n}const Xf=e=>{const t=Xx(e),n=r=>Qx(t,r);return Object.assign(n,t),n},Kx=e=>e?Xf(e):Xf;let Yf,Da=null;function Ta(e){Da=e,clearTimeout(Yf),Yf=setTimeout(()=>{const t=Da;Da=null,t&&fetch("/api/project",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)})},500)}const Gx=e=>new Promise(t=>setTimeout(t,e)),Dt=Kx((e,t)=>({project:{version:1,pages:[]},selection:{kind:"none"},openPageId:null,viewMode:"layout",busy:null,error:null,previewNonce:0,past:[],future:[],load:async()=>{const n=await(await fetch("/api/project")).json();e({project:n})},setProject:(n,r={})=>{const{persist:o=!0,history:i=!0}=r;e(i?s=>({past:[...s.past.slice(-49),s.project],future:[],project:n}):{project:n}),o&&Ta(n)},select:n=>e({selection:n}),openPage:n=>e({openPageId:n,viewMode:"layout",selection:{kind:"none"}}),setViewMode:n=>e({viewMode:n,selection:{kind:"none"}}),api:async(n,r)=>{if(t().busy)return;e({busy:"Starting…",error:null});const o=Date.now();try{const i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r??{})}),s=await i.json();if(!i.ok)throw new Error(s.error||i.statusText);let l=s;if(s.jobId)for(;;){await Gx(1200);const u=await fetch(`/api/jobs/${s.jobId}`),c=await u.json();if(!u.ok)throw new Error(c.error||u.statusText);const d=Math.round((Date.now()-o)/1e3);if(e({busy:`${c.label}: ${c.detail} (${d}s)`}),c.status==="error")throw new Error(c.error);if(c.status==="done"){l=c.result;break}}const a=l;a&&Array.isArray(a.pages)&&e(u=>({past:[...u.past.slice(-49),u.project],future:[],project:a})),e(u=>({previewNonce:u.previewNonce+1}))}catch(i){e({error:String(i)})}finally{e({busy:null})}},mutatePage:(n,r,o={})=>{const i=structuredClone(t().project),s=i.pages.find(l=>l.id===n);s&&(r(s),t().setProject(i,{history:o.history??!0}))},undo:()=>{const{past:n,project:r,future:o}=t();if(n.length===0)return;const i=n[n.length-1];e({past:n.slice(0,-1),future:[r,...o].slice(0,50),project:i}),Ta(i)},redo:()=>{const{past:n,project:r,future:o}=t();if(o.length===0)return;const i=o[0];e({past:[...n,r].slice(-50),future:o.slice(1),project:i}),Ta(i)}}));function Hr(e,t){if(e.id===t)return e;for(const n of e.children??[]){const r=Hr(n,t);if(r)return r}}function bm(e,t){if(e.id===t)return[e];for(const n of e.children??[]){const r=bm(n,t);if(r.length)return[e,...r]}return[]}function tl(e,t){const n=e.children??[],r=n.findIndex(o=>o.id===t);if(r>=0)return{parent:e,index:r};for(const o of n){const i=tl(o,t);if(i)return i}}function jl(e,t){var n;return{...e,children:(n=e.children)==null?void 0:n.filter(r=>r.id!==t).map(r=>jl(r,t))}}function Mm(e,t,n,r){var o;if(e.id===t){const i=[...e.children??[]];return i.splice(n,0,r),{...e,children:i}}return{...e,children:(o=e.children)==null?void 0:o.map(i=>Mm(i,t,n,r))}}function Zx(e,t,n){if(t===n)return e;const r=Hr(e,t);if(!r||Hr(r,n))return e;const o=tl(e,t),i=jl(e,t),s=tl(i,n);if(!s||!o)return e;let l=s.index;return s.parent.id===o.parent.id&&o.index<s.index&&(l+=1),Mm(i,s.parent.id,l,r)}function Im(e,t,n){var r;return e.id===t?{...e,children:[...e.children??[],n]}:{...e,children:(r=e.children)==null?void 0:r.map(o=>Im(o,t,n))}}let Qf=0;function Pm(){return Qf+=1,`blk_${Date.now().toString(36)}${Qf}`}function qx(e){const t=e.charAt(0).toUpperCase()+e.slice(1).replace("-"," "),n={id:Pm(),type:e,label:t};return e==="row"&&(n.direction="row"),(e==="section"||e==="column")&&(n.direction="column"),n}function Dm(e){var t;return{...e,id:Pm(),children:(t=e.children)==null?void 0:t.map(Dm)}}const Jx=["section","row","column","nav","hero","card-grid","list","form","footer","text","image","button"];function ke(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=ke(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var e1={value:()=>{}};function zl(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new _s(n)}function _s(e){this._=e}function t1(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",o=n.indexOf(".");if(o>=0&&(r=n.slice(o+1),n=n.slice(0,o)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}_s.prototype=zl.prototype={constructor:_s,on:function(e,t){var n=this._,r=t1(e+"",n),o,i=-1,s=r.length;if(arguments.length<2){for(;++i<s;)if((o=(e=r[i]).type)&&(o=n1(n[o],e.name)))return o;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++i<s;)if(o=(e=r[i]).type)n[o]=Kf(n[o],e.name,t);else if(t==null)for(o in n)n[o]=Kf(n[o],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new _s(e)},call:function(e,t){if((o=arguments.length-2)>0)for(var n=new Array(o),r=0,o,i;r<o;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(i=this._[e],r=0,o=i.length;r<o;++r)i[r].value.apply(t,n)},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)}};function n1(e,t){for(var n=0,r=e.length,o;n<r;++n)if((o=e[n]).name===t)return o.value}function Kf(e,t,n){for(var r=0,o=e.length;r<o;++r)if(e[r].name===t){e[r]=e1,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var Hu="http://www.w3.org/1999/xhtml";const Gf={svg:"http://www.w3.org/2000/svg",xhtml:Hu,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Al(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),Gf.hasOwnProperty(t)?{space:Gf[t],local:e}:e}function r1(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===Hu&&t.documentElement.namespaceURI===Hu?t.createElement(e):t.createElementNS(n,e)}}function o1(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Tm(e){var t=Al(e);return(t.local?o1:r1)(t)}function i1(){}function td(e){return e==null?i1:function(){return this.querySelector(e)}}function s1(e){typeof e!="function"&&(e=td(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=new Array(s),a,u,c=0;c<s;++c)(a=i[c])&&(u=e.call(a,a.__data__,c,i))&&("__data__"in a&&(u.__data__=a.__data__),l[c]=u);return new ft(r,this._parents)}function l1(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function a1(){return[]}function Rm(e){return e==null?a1:function(){return this.querySelectorAll(e)}}function u1(e){return function(){return l1(e.apply(this,arguments))}}function c1(e){typeof e=="function"?e=u1(e):e=Rm(e);for(var t=this._groups,n=t.length,r=[],o=[],i=0;i<n;++i)for(var s=t[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&(r.push(e.call(a,a.__data__,u,s)),o.push(a));return new ft(r,o)}function jm(e){return function(){return this.matches(e)}}function zm(e){return function(t){return t.matches(e)}}var d1=Array.prototype.find;function f1(e){return function(){return d1.call(this.children,e)}}function h1(){return this.firstElementChild}function p1(e){return this.select(e==null?h1:f1(typeof e=="function"?e:zm(e)))}var g1=Array.prototype.filter;function m1(){return Array.from(this.children)}function y1(e){return function(){return g1.call(this.children,e)}}function v1(e){return this.selectAll(e==null?m1:y1(typeof e=="function"?e:zm(e)))}function w1(e){typeof e!="function"&&(e=jm(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new ft(r,this._parents)}function Am(e){return new Array(e.length)}function x1(){return new ft(this._enter||this._groups.map(Am),this._parents)}function nl(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}nl.prototype={constructor:nl,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function S1(e){return function(){return e}}function E1(e,t,n,r,o,i){for(var s=0,l,a=t.length,u=i.length;s<u;++s)(l=t[s])?(l.__data__=i[s],r[s]=l):n[s]=new nl(e,i[s]);for(;s<a;++s)(l=t[s])&&(o[s]=l)}function k1(e,t,n,r,o,i,s){var l,a,u=new Map,c=t.length,d=i.length,f=new Array(c),g;for(l=0;l<c;++l)(a=t[l])&&(f[l]=g=s.call(a,a.__data__,l,t)+"",u.has(g)?o[l]=a:u.set(g,a));for(l=0;l<d;++l)g=s.call(e,i[l],l,i)+"",(a=u.get(g))?(r[l]=a,a.__data__=i[l],u.delete(g)):n[l]=new nl(e,i[l]);for(l=0;l<c;++l)(a=t[l])&&u.get(f[l])===a&&(o[l]=a)}function C1(e){return e.__data__}function _1(e,t){if(!arguments.length)return Array.from(this,C1);var n=t?k1:E1,r=this._parents,o=this._groups;typeof e!="function"&&(e=S1(e));for(var i=o.length,s=new Array(i),l=new Array(i),a=new Array(i),u=0;u<i;++u){var c=r[u],d=o[u],f=d.length,g=N1(e.call(c,c&&c.__data__,u,r)),y=g.length,v=l[u]=new Array(y),x=s[u]=new Array(y),p=a[u]=new Array(f);n(c,d,v,x,p,g,t);for(var m=0,h=0,w,C;m<y;++m)if(w=v[m]){for(m>=h&&(h=m+1);!(C=x[h])&&++h<y;);w._next=C||null}}return s=new ft(s,r),s._enter=l,s._exit=a,s}function N1(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function b1(){return new ft(this._exit||this._groups.map(Am),this._parents)}function M1(e,t,n){var r=this.enter(),o=this,i=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(o=t(o),o&&(o=o.selection())),n==null?i.remove():n(i),r&&o?r.merge(o).order():o}function I1(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,o=n.length,i=r.length,s=Math.min(o,i),l=new Array(o),a=0;a<s;++a)for(var u=n[a],c=r[a],d=u.length,f=l[a]=new Array(d),g,y=0;y<d;++y)(g=u[y]||c[y])&&(f[y]=g);for(;a<o;++a)l[a]=n[a];return new ft(l,this._parents)}function P1(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],o=r.length-1,i=r[o],s;--o>=0;)(s=r[o])&&(i&&s.compareDocumentPosition(i)^4&&i.parentNode.insertBefore(s,i),i=s);return this}function D1(e){e||(e=T1);function t(d,f){return d&&f?e(d.__data__,f.__data__):!d-!f}for(var n=this._groups,r=n.length,o=new Array(r),i=0;i<r;++i){for(var s=n[i],l=s.length,a=o[i]=new Array(l),u,c=0;c<l;++c)(u=s[c])&&(a[c]=u);a.sort(t)}return new ft(o,this._parents).order()}function T1(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function R1(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function j1(){return Array.from(this)}function z1(){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 s=r[o];if(s)return s}return null}function A1(){let e=0;for(const t of this)++e;return e}function $1(){return!this.node()}function L1(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var o=t[n],i=0,s=o.length,l;i<s;++i)(l=o[i])&&e.call(l,l.__data__,i,o);return this}function O1(e){return function(){this.removeAttribute(e)}}function F1(e){return function(){this.removeAttributeNS(e.space,e.local)}}function H1(e,t){return function(){this.setAttribute(e,t)}}function B1(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function V1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function U1(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function W1(e,t){var n=Al(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?F1:O1:typeof t=="function"?n.local?U1:V1:n.local?B1:H1)(n,t))}function $m(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function X1(e){return function(){this.style.removeProperty(e)}}function Y1(e,t,n){return function(){this.style.setProperty(e,t,n)}}function Q1(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function K1(e,t,n){return arguments.length>1?this.each((t==null?X1:typeof t=="function"?Q1:Y1)(e,t,n??"")):qr(this.node(),e)}function qr(e,t){return e.style.getPropertyValue(t)||$m(e).getComputedStyle(e,null).getPropertyValue(t)}function G1(e){return function(){delete this[e]}}function Z1(e,t){return function(){this[e]=t}}function q1(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function J1(e,t){return arguments.length>1?this.each((t==null?G1:typeof t=="function"?q1:Z1)(e,t)):this.node()[e]}function Lm(e){return e.trim().split(/^|\s+/)}function nd(e){return e.classList||new Om(e)}function Om(e){this._node=e,this._names=Lm(e.getAttribute("class")||"")}Om.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function Fm(e,t){for(var n=nd(e),r=-1,o=t.length;++r<o;)n.add(t[r])}function Hm(e,t){for(var n=nd(e),r=-1,o=t.length;++r<o;)n.remove(t[r])}function eS(e){return function(){Fm(this,e)}}function tS(e){return function(){Hm(this,e)}}function nS(e,t){return function(){(t.apply(this,arguments)?Fm:Hm)(this,e)}}function rS(e,t){var n=Lm(e+"");if(arguments.length<2){for(var r=nd(this.node()),o=-1,i=n.length;++o<i;)if(!r.contains(n[o]))return!1;return!0}return this.each((typeof t=="function"?nS:t?eS:tS)(n,t))}function oS(){this.textContent=""}function iS(e){return function(){this.textContent=e}}function sS(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function lS(e){return arguments.length?this.each(e==null?oS:(typeof e=="function"?sS:iS)(e)):this.node().textContent}function aS(){this.innerHTML=""}function uS(e){return function(){this.innerHTML=e}}function cS(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function dS(e){return arguments.length?this.each(e==null?aS:(typeof e=="function"?cS:uS)(e)):this.node().innerHTML}function fS(){this.nextSibling&&this.parentNode.appendChild(this)}function hS(){return this.each(fS)}function pS(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function gS(){return this.each(pS)}function mS(e){var t=typeof e=="function"?e:Tm(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function yS(){return null}function vS(e,t){var n=typeof e=="function"?e:Tm(e),r=t==null?yS:typeof t=="function"?t:td(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function wS(){var e=this.parentNode;e&&e.removeChild(this)}function xS(){return this.each(wS)}function SS(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function ES(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function kS(e){return this.select(e?ES:SS)}function CS(e){return arguments.length?this.property("__data__",e):this.node().__data__}function _S(e){return function(t){e.call(this,t,this.__data__)}}function NS(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function bS(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,o=t.length,i;n<o;++n)i=t[n],(!e.type||i.type===e.type)&&i.name===e.name?this.removeEventListener(i.type,i.listener,i.options):t[++r]=i;++r?t.length=r:delete this.__on}}}function MS(e,t,n){return function(){var r=this.__on,o,i=_S(t);if(r){for(var s=0,l=r.length;s<l;++s)if((o=r[s]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=i,o.options=n),o.value=t;return}}this.addEventListener(e.type,i,n),o={type:e.type,name:e.name,value:t,listener:i,options:n},r?r.push(o):this.__on=[o]}}function IS(e,t,n){var r=NS(e+""),o,i=r.length,s;if(arguments.length<2){var l=this.node().__on;if(l){for(var a=0,u=l.length,c;a<u;++a)for(o=0,c=l[a];o<i;++o)if((s=r[o]).type===c.type&&s.name===c.name)return c.value}return}for(l=t?MS:bS,o=0;o<i;++o)this.each(l(r[o],t,n));return this}function Bm(e,t,n){var r=$m(e),o=r.CustomEvent;typeof o=="function"?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 PS(e,t){return function(){return Bm(this,e,t)}}function DS(e,t){return function(){return Bm(this,e,t.apply(this,arguments))}}function TS(e,t){return this.each((typeof t=="function"?DS:PS)(e,t))}function*RS(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],o=0,i=r.length,s;o<i;++o)(s=r[o])&&(yield s)}var Vm=[null];function ft(e,t){this._groups=e,this._parents=t}function Ci(){return new ft([[document.documentElement]],Vm)}function jS(){return this}ft.prototype=Ci.prototype={constructor:ft,select:s1,selectAll:c1,selectChild:p1,selectChildren:v1,filter:w1,data:_1,enter:x1,exit:b1,join:M1,merge:I1,selection:jS,order:P1,sort:D1,call:R1,nodes:j1,node:z1,size:A1,empty:$1,each:L1,attr:W1,style:K1,property:J1,classed:rS,text:lS,html:dS,raise:hS,lower:gS,append:mS,insert:vS,remove:xS,clone:kS,datum:CS,on:IS,dispatch:TS,[Symbol.iterator]:RS};function at(e){return typeof e=="string"?new ft([[document.querySelector(e)]],[document.documentElement]):new ft([[e]],Vm)}function zS(e){let t;for(;t=e.sourceEvent;)e=t;return e}function It(e,t){if(e=zS(e),t===void 0&&(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()),[r.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]}const AS={passive:!1},li={capture:!0,passive:!1};function Ra(e){e.stopImmediatePropagation()}function Br(e){e.preventDefault(),e.stopImmediatePropagation()}function Um(e){var t=e.document.documentElement,n=at(e).on("dragstart.drag",Br,li);"onselectstart"in t?n.on("selectstart.drag",Br,li):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function Wm(e,t){var n=e.document.documentElement,r=at(e).on("dragstart.drag",null);t&&(r.on("click.drag",Br,li),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const es=e=>()=>e;function Bu(e,{sourceEvent:t,subject:n,target:r,identifier:o,active:i,x:s,y:l,dx:a,dy:u,dispatch:c}){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:s,enumerable:!0,configurable:!0},y:{value:l,enumerable:!0,configurable:!0},dx:{value:a,enumerable:!0,configurable:!0},dy:{value:u,enumerable:!0,configurable:!0},_:{value:c}})}Bu.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function $S(e){return!e.ctrlKey&&!e.button}function LS(){return this.parentNode}function OS(e,t){return t??{x:e.x,y:e.y}}function FS(){return navigator.maxTouchPoints||"ontouchstart"in this}function Xm(){var e=$S,t=LS,n=OS,r=FS,o={},i=zl("start","drag","end"),s=0,l,a,u,c,d=0;function f(w){w.on("mousedown.drag",g).filter(r).on("touchstart.drag",x).on("touchmove.drag",p,AS).on("touchend.drag touchcancel.drag",m).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function g(w,C){if(!(c||!e.call(this,w,C))){var _=h(this,t.call(this,w,C),w,C,"mouse");_&&(at(w.view).on("mousemove.drag",y,li).on("mouseup.drag",v,li),Um(w.view),Ra(w),u=!1,l=w.clientX,a=w.clientY,_("start",w))}}function y(w){if(Br(w),!u){var C=w.clientX-l,_=w.clientY-a;u=C*C+_*_>d}o.mouse("drag",w)}function v(w){at(w.view).on("mousemove.drag mouseup.drag",null),Wm(w.view,u),Br(w),o.mouse("end",w)}function x(w,C){if(e.call(this,w,C)){var _=w.changedTouches,N=t.call(this,w,C),b=_.length,D,A;for(D=0;D<b;++D)(A=h(this,N,w,C,_[D].identifier,_[D]))&&(Ra(w),A("start",w,_[D]))}}function p(w){var C=w.changedTouches,_=C.length,N,b;for(N=0;N<_;++N)(b=o[C[N].identifier])&&(Br(w),b("drag",w,C[N]))}function m(w){var C=w.changedTouches,_=C.length,N,b;for(c&&clearTimeout(c),c=setTimeout(function(){c=null},500),N=0;N<_;++N)(b=o[C[N].identifier])&&(Ra(w),b("end",w,C[N]))}function h(w,C,_,N,b,D){var A=i.copy(),j=It(D||_,C),H,L,E;if((E=n.call(w,new Bu("beforestart",{sourceEvent:_,target:f,identifier:b,active:s,x:j[0],y:j[1],dx:0,dy:0,dispatch:A}),N))!=null)return H=E.x-j[0]||0,L=E.y-j[1]||0,function T(P,R,I){var M=j,z;switch(P){case"start":o[b]=T,z=s++;break;case"end":delete o[b],--s;case"drag":j=It(I||R,C),z=s;break}A.call(P,w,new Bu(P,{sourceEvent:R,subject:E,target:f,identifier:b,active:z,x:j[0]+H,y:j[1]+L,dx:j[0]-M[0],dy:j[1]-M[1],dispatch:A}),N)}}return f.filter=function(w){return arguments.length?(e=typeof w=="function"?w:es(!!w),f):e},f.container=function(w){return arguments.length?(t=typeof w=="function"?w:es(w),f):t},f.subject=function(w){return arguments.length?(n=typeof w=="function"?w:es(w),f):n},f.touchable=function(w){return arguments.length?(r=typeof w=="function"?w:es(!!w),f):r},f.on=function(){var w=i.on.apply(i,arguments);return w===i?f:w},f.clickDistance=function(w){return arguments.length?(d=(w=+w)*w,f):Math.sqrt(d)},f}function rd(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function Ym(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function _i(){}var ai=.7,rl=1/ai,Vr="\\s*([+-]?\\d+)\\s*",ui="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",en="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",HS=/^#([0-9a-f]{3,8})$/,BS=new RegExp(`^rgb\\(${Vr},${Vr},${Vr}\\)$`),VS=new RegExp(`^rgb\\(${en},${en},${en}\\)$`),US=new RegExp(`^rgba\\(${Vr},${Vr},${Vr},${ui}\\)$`),WS=new RegExp(`^rgba\\(${en},${en},${en},${ui}\\)$`),XS=new RegExp(`^hsl\\(${ui},${en},${en}\\)$`),YS=new RegExp(`^hsla\\(${ui},${en},${en},${ui}\\)$`),Zf={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};rd(_i,cr,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:qf,formatHex:qf,formatHex8:QS,formatHsl:KS,formatRgb:Jf,toString:Jf});function qf(){return this.rgb().formatHex()}function QS(){return this.rgb().formatHex8()}function KS(){return Qm(this).formatHsl()}function Jf(){return this.rgb().formatRgb()}function cr(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=HS.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?eh(t):n===3?new tt(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?ts(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?ts(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=BS.exec(e))?new tt(t[1],t[2],t[3],1):(t=VS.exec(e))?new tt(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=US.exec(e))?ts(t[1],t[2],t[3],t[4]):(t=WS.exec(e))?ts(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=XS.exec(e))?rh(t[1],t[2]/100,t[3]/100,1):(t=YS.exec(e))?rh(t[1],t[2]/100,t[3]/100,t[4]):Zf.hasOwnProperty(e)?eh(Zf[e]):e==="transparent"?new tt(NaN,NaN,NaN,0):null}function eh(e){return new tt(e>>16&255,e>>8&255,e&255,1)}function ts(e,t,n,r){return r<=0&&(e=t=n=NaN),new tt(e,t,n,r)}function GS(e){return e instanceof _i||(e=cr(e)),e?(e=e.rgb(),new tt(e.r,e.g,e.b,e.opacity)):new tt}function Vu(e,t,n,r){return arguments.length===1?GS(e):new tt(e,t,n,r??1)}function tt(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}rd(tt,Vu,Ym(_i,{brighter(e){return e=e==null?rl:Math.pow(rl,e),new tt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?ai:Math.pow(ai,e),new tt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new tt(rr(this.r),rr(this.g),rr(this.b),ol(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:th,formatHex:th,formatHex8:ZS,formatRgb:nh,toString:nh}));function th(){return`#${er(this.r)}${er(this.g)}${er(this.b)}`}function ZS(){return`#${er(this.r)}${er(this.g)}${er(this.b)}${er((isNaN(this.opacity)?1:this.opacity)*255)}`}function nh(){const e=ol(this.opacity);return`${e===1?"rgb(":"rgba("}${rr(this.r)}, ${rr(this.g)}, ${rr(this.b)}${e===1?")":`, ${e})`}`}function ol(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function rr(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function er(e){return e=rr(e),(e<16?"0":"")+e.toString(16)}function rh(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new Tt(e,t,n,r)}function Qm(e){if(e instanceof Tt)return new Tt(e.h,e.s,e.l,e.opacity);if(e instanceof _i||(e=cr(e)),!e)return new Tt;if(e instanceof Tt)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,o=Math.min(t,n,r),i=Math.max(t,n,r),s=NaN,l=i-o,a=(i+o)/2;return l?(t===i?s=(n-r)/l+(n<r)*6:n===i?s=(r-t)/l+2:s=(t-n)/l+4,l/=a<.5?i+o:2-i-o,s*=60):l=a>0&&a<1?0:s,new Tt(s,l,a,e.opacity)}function qS(e,t,n,r){return arguments.length===1?Qm(e):new Tt(e,t,n,r??1)}function Tt(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}rd(Tt,qS,Ym(_i,{brighter(e){return e=e==null?rl:Math.pow(rl,e),new Tt(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?ai:Math.pow(ai,e),new Tt(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,o=2*n-r;return new tt(ja(e>=240?e-240:e+120,o,r),ja(e,o,r),ja(e<120?e+240:e-120,o,r),this.opacity)},clamp(){return new Tt(oh(this.h),ns(this.s),ns(this.l),ol(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=ol(this.opacity);return`${e===1?"hsl(":"hsla("}${oh(this.h)}, ${ns(this.s)*100}%, ${ns(this.l)*100}%${e===1?")":`, ${e})`}`}}));function oh(e){return e=(e||0)%360,e<0?e+360:e}function ns(e){return Math.max(0,Math.min(1,e||0))}function ja(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const od=e=>()=>e;function JS(e,t){return function(n){return e+n*t}}function eE(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function tE(e){return(e=+e)==1?Km:function(t,n){return n-t?eE(t,n,e):od(isNaN(t)?n:t)}}function Km(e,t){var n=t-e;return n?JS(e,n):od(isNaN(e)?t:e)}const il=function e(t){var n=tE(t);function r(o,i){var s=n((o=Vu(o)).r,(i=Vu(i)).r),l=n(o.g,i.g),a=n(o.b,i.b),u=Km(o.opacity,i.opacity);return function(c){return o.r=s(c),o.g=l(c),o.b=a(c),o.opacity=u(c),o+""}}return r.gamma=e,r}(1);function nE(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),o;return function(i){for(o=0;o<n;++o)r[o]=e[o]*(1-i)+t[o]*i;return r}}function rE(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function oE(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,o=new Array(r),i=new Array(n),s;for(s=0;s<r;++s)o[s]=Oo(e[s],t[s]);for(;s<n;++s)i[s]=t[s];return function(l){for(s=0;s<r;++s)i[s]=o[s](l);return i}}function iE(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Gt(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function sE(e,t){var n={},r={},o;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(o in t)o in e?n[o]=Oo(e[o],t[o]):r[o]=t[o];return function(i){for(o in n)r[o]=n[o](i);return r}}var Uu=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,za=new RegExp(Uu.source,"g");function lE(e){return function(){return e}}function aE(e){return function(t){return e(t)+""}}function Gm(e,t){var n=Uu.lastIndex=za.lastIndex=0,r,o,i,s=-1,l=[],a=[];for(e=e+"",t=t+"";(r=Uu.exec(e))&&(o=za.exec(t));)(i=o.index)>n&&(i=t.slice(n,i),l[s]?l[s]+=i:l[++s]=i),(r=r[0])===(o=o[0])?l[s]?l[s]+=o:l[++s]=o:(l[++s]=null,a.push({i:s,x:Gt(r,o)})),n=za.lastIndex;return n<t.length&&(i=t.slice(n),l[s]?l[s]+=i:l[++s]=i),l.length<2?a[0]?aE(a[0].x):lE(t):(t=a.length,function(u){for(var c=0,d;c<t;++c)l[(d=a[c]).i]=d.x(u);return l.join("")})}function Oo(e,t){var n=typeof t,r;return t==null||n==="boolean"?od(t):(n==="number"?Gt:n==="string"?(r=cr(t))?(t=r,il):Gm:t instanceof cr?il:t instanceof Date?iE:rE(t)?nE:Array.isArray(t)?oE:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?sE:Gt)(e,t)}var ih=180/Math.PI,Wu={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Zm(e,t,n,r,o,i){var s,l,a;return(s=Math.sqrt(e*e+t*t))&&(e/=s,t/=s),(a=e*n+t*r)&&(n-=e*a,r-=t*a),(l=Math.sqrt(n*n+r*r))&&(n/=l,r/=l,a/=l),e*r<t*n&&(e=-e,t=-t,a=-a,s=-s),{translateX:o,translateY:i,rotate:Math.atan2(t,e)*ih,skewX:Math.atan(a)*ih,scaleX:s,scaleY:l}}var rs;function uE(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?Wu:Zm(t.a,t.b,t.c,t.d,t.e,t.f)}function cE(e){return e==null||(rs||(rs=document.createElementNS("http://www.w3.org/2000/svg","g")),rs.setAttribute("transform",e),!(e=rs.transform.baseVal.consolidate()))?Wu:(e=e.matrix,Zm(e.a,e.b,e.c,e.d,e.e,e.f))}function qm(e,t,n,r){function o(u){return u.length?u.pop()+" ":""}function i(u,c,d,f,g,y){if(u!==d||c!==f){var v=g.push("translate(",null,t,null,n);y.push({i:v-4,x:Gt(u,d)},{i:v-2,x:Gt(c,f)})}else(d||f)&&g.push("translate("+d+t+f+n)}function s(u,c,d,f){u!==c?(u-c>180?c+=360:c-u>180&&(u+=360),f.push({i:d.push(o(d)+"rotate(",null,r)-2,x:Gt(u,c)})):c&&d.push(o(d)+"rotate("+c+r)}function l(u,c,d,f){u!==c?f.push({i:d.push(o(d)+"skewX(",null,r)-2,x:Gt(u,c)}):c&&d.push(o(d)+"skewX("+c+r)}function a(u,c,d,f,g,y){if(u!==d||c!==f){var v=g.push(o(g)+"scale(",null,",",null,")");y.push({i:v-4,x:Gt(u,d)},{i:v-2,x:Gt(c,f)})}else(d!==1||f!==1)&&g.push(o(g)+"scale("+d+","+f+")")}return function(u,c){var d=[],f=[];return u=e(u),c=e(c),i(u.translateX,u.translateY,c.translateX,c.translateY,d,f),s(u.rotate,c.rotate,d,f),l(u.skewX,c.skewX,d,f),a(u.scaleX,u.scaleY,c.scaleX,c.scaleY,d,f),u=c=null,function(g){for(var y=-1,v=f.length,x;++y<v;)d[(x=f[y]).i]=x.x(g);return d.join("")}}}var dE=qm(uE,"px, ","px)","deg)"),fE=qm(cE,", ",")",")"),hE=1e-12;function sh(e){return((e=Math.exp(e))+1/e)/2}function pE(e){return((e=Math.exp(e))-1/e)/2}function gE(e){return((e=Math.exp(2*e))-1)/(e+1)}const Ns=function e(t,n,r){function o(i,s){var l=i[0],a=i[1],u=i[2],c=s[0],d=s[1],f=s[2],g=c-l,y=d-a,v=g*g+y*y,x,p;if(v<hE)p=Math.log(f/u)/t,x=function(N){return[l+N*g,a+N*y,u*Math.exp(t*N*p)]};else{var m=Math.sqrt(v),h=(f*f-u*u+r*v)/(2*u*n*m),w=(f*f-u*u-r*v)/(2*f*n*m),C=Math.log(Math.sqrt(h*h+1)-h),_=Math.log(Math.sqrt(w*w+1)-w);p=(_-C)/t,x=function(N){var b=N*p,D=sh(C),A=u/(n*m)*(D*gE(t*b+C)-pE(C));return[l+A*g,a+A*y,u*D/sh(t*b+C)]}}return x.duration=p*1e3*t/Math.SQRT2,x}return o.rho=function(i){var s=Math.max(.001,+i),l=s*s,a=l*l;return e(s,l,a)},o}(Math.SQRT2,2,4);var Jr=0,Mo=0,Eo=0,Jm=1e3,sl,Io,ll=0,dr=0,$l=0,ci=typeof performance=="object"&&performance.now?performance:Date,e0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function id(){return dr||(e0(mE),dr=ci.now()+$l)}function mE(){dr=0}function al(){this._call=this._time=this._next=null}al.prototype=t0.prototype={constructor:al,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?id():+n)+(t==null?0:+t),!this._next&&Io!==this&&(Io?Io._next=this:sl=this,Io=this),this._call=e,this._time=n,Xu()},stop:function(){this._call&&(this._call=null,this._time=1/0,Xu())}};function t0(e,t,n){var r=new al;return r.restart(e,t,n),r}function yE(){id(),++Jr;for(var e=sl,t;e;)(t=dr-e._time)>=0&&e._call.call(void 0,t),e=e._next;--Jr}function lh(){dr=(ll=ci.now())+$l,Jr=Mo=0;try{yE()}finally{Jr=0,wE(),dr=0}}function vE(){var e=ci.now(),t=e-ll;t>Jm&&($l-=t,ll=e)}function wE(){for(var e,t=sl,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:sl=n);Io=e,Xu(r)}function Xu(e){if(!Jr){Mo&&(Mo=clearTimeout(Mo));var t=e-dr;t>24?(e<1/0&&(Mo=setTimeout(lh,e-ci.now()-$l)),Eo&&(Eo=clearInterval(Eo))):(Eo||(ll=ci.now(),Eo=setInterval(vE,Jm)),Jr=1,e0(lh))}}function ah(e,t,n){var r=new al;return t=t==null?0:+t,r.restart(o=>{r.stop(),e(o+t)},t,n),r}var xE=zl("start","end","cancel","interrupt"),SE=[],n0=0,uh=1,Yu=2,bs=3,ch=4,Qu=5,Ms=6;function Ll(e,t,n,r,o,i){var s=e.__transition;if(!s)e.__transition={};else if(n in s)return;EE(e,n,{name:t,index:r,group:o,on:xE,tween:SE,time:i.time,delay:i.delay,duration:i.duration,ease:i.ease,timer:null,state:n0})}function sd(e,t){var n=Ft(e,t);if(n.state>n0)throw new Error("too late; already scheduled");return n}function nn(e,t){var n=Ft(e,t);if(n.state>bs)throw new Error("too late; already running");return n}function Ft(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function EE(e,t,n){var r=e.__transition,o;r[t]=n,n.timer=t0(i,0,n.time);function i(u){n.state=uh,n.timer.restart(s,n.delay,n.time),n.delay<=u&&s(u-n.delay)}function s(u){var c,d,f,g;if(n.state!==uh)return a();for(c in r)if(g=r[c],g.name===n.name){if(g.state===bs)return ah(s);g.state===ch?(g.state=Ms,g.timer.stop(),g.on.call("interrupt",e,e.__data__,g.index,g.group),delete r[c]):+c<t&&(g.state=Ms,g.timer.stop(),g.on.call("cancel",e,e.__data__,g.index,g.group),delete r[c])}if(ah(function(){n.state===bs&&(n.state=ch,n.timer.restart(l,n.delay,n.time),l(u))}),n.state=Yu,n.on.call("start",e,e.__data__,n.index,n.group),n.state===Yu){for(n.state=bs,o=new Array(f=n.tween.length),c=0,d=-1;c<f;++c)(g=n.tween[c].value.call(e,e.__data__,n.index,n.group))&&(o[++d]=g);o.length=d+1}}function l(u){for(var c=u<n.duration?n.ease.call(null,u/n.duration):(n.timer.restart(a),n.state=Qu,1),d=-1,f=o.length;++d<f;)o[d].call(e,c);n.state===Qu&&(n.on.call("end",e,e.__data__,n.index,n.group),a())}function a(){n.state=Ms,n.timer.stop(),delete r[t];for(var u in r)return;delete e.__transition}}function Is(e,t){var n=e.__transition,r,o,i=!0,s;if(n){t=t==null?null:t+"";for(s in n){if((r=n[s]).name!==t){i=!1;continue}o=r.state>Yu&&r.state<Qu,r.state=Ms,r.timer.stop(),r.on.call(o?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[s]}i&&delete e.__transition}}function kE(e){return this.each(function(){Is(this,e)})}function CE(e,t){var n,r;return function(){var o=nn(this,e),i=o.tween;if(i!==n){r=n=i;for(var s=0,l=r.length;s<l;++s)if(r[s].name===t){r=r.slice(),r.splice(s,1);break}}o.tween=r}}function _E(e,t,n){var r,o;if(typeof n!="function")throw new Error;return function(){var i=nn(this,e),s=i.tween;if(s!==r){o=(r=s).slice();for(var l={name:t,value:n},a=0,u=o.length;a<u;++a)if(o[a].name===t){o[a]=l;break}a===u&&o.push(l)}i.tween=o}}function NE(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=Ft(this.node(),n).tween,o=0,i=r.length,s;o<i;++o)if((s=r[o]).name===e)return s.value;return null}return this.each((t==null?CE:_E)(n,e,t))}function ld(e,t,n){var r=e._id;return e.each(function(){var o=nn(this,r);(o.value||(o.value={}))[t]=n.apply(this,arguments)}),function(o){return Ft(o,r).value[t]}}function r0(e,t){var n;return(typeof t=="number"?Gt:t instanceof cr?il:(n=cr(t))?(t=n,il):Gm)(e,t)}function bE(e){return function(){this.removeAttribute(e)}}function ME(e){return function(){this.removeAttributeNS(e.space,e.local)}}function IE(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttribute(e);return s===o?null:s===r?i:i=t(r=s,n)}}function PE(e,t,n){var r,o=n+"",i;return function(){var s=this.getAttributeNS(e.space,e.local);return s===o?null:s===r?i:i=t(r=s,n)}}function DE(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttribute(e):(s=this.getAttribute(e),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function TE(e,t,n){var r,o,i;return function(){var s,l=n(this),a;return l==null?void this.removeAttributeNS(e.space,e.local):(s=this.getAttributeNS(e.space,e.local),a=l+"",s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l)))}}function RE(e,t){var n=Al(e),r=n==="transform"?fE:r0;return this.attrTween(e,typeof t=="function"?(n.local?TE:DE)(n,r,ld(this,"attr."+e,t)):t==null?(n.local?ME:bE)(n):(n.local?PE:IE)(n,r,t))}function jE(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function zE(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function AE(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&zE(e,i)),n}return o._value=t,o}function $E(e,t){var n,r;function o(){var i=t.apply(this,arguments);return i!==r&&(n=(r=i)&&jE(e,i)),n}return o._value=t,o}function LE(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=Al(e);return this.tween(n,(r.local?AE:$E)(r,t))}function OE(e,t){return function(){sd(this,e).delay=+t.apply(this,arguments)}}function FE(e,t){return t=+t,function(){sd(this,e).delay=t}}function HE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?OE:FE)(t,e)):Ft(this.node(),t).delay}function BE(e,t){return function(){nn(this,e).duration=+t.apply(this,arguments)}}function VE(e,t){return t=+t,function(){nn(this,e).duration=t}}function UE(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?BE:VE)(t,e)):Ft(this.node(),t).duration}function WE(e,t){if(typeof t!="function")throw new Error;return function(){nn(this,e).ease=t}}function XE(e){var t=this._id;return arguments.length?this.each(WE(t,e)):Ft(this.node(),t).ease}function YE(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;nn(this,e).ease=n}}function QE(e){if(typeof e!="function")throw new Error;return this.each(YE(this._id,e))}function KE(e){typeof e!="function"&&(e=jm(e));for(var t=this._groups,n=t.length,r=new Array(n),o=0;o<n;++o)for(var i=t[o],s=i.length,l=r[o]=[],a,u=0;u<s;++u)(a=i[u])&&e.call(a,a.__data__,u,i)&&l.push(a);return new yn(r,this._parents,this._name,this._id)}function GE(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),s=new Array(r),l=0;l<i;++l)for(var a=t[l],u=n[l],c=a.length,d=s[l]=new Array(c),f,g=0;g<c;++g)(f=a[g]||u[g])&&(d[g]=f);for(;l<r;++l)s[l]=t[l];return new yn(s,this._parents,this._name,this._id)}function ZE(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function qE(e,t,n){var r,o,i=ZE(t)?sd:nn;return function(){var s=i(this,e),l=s.on;l!==r&&(o=(r=l).copy()).on(t,n),s.on=o}}function JE(e,t){var n=this._id;return arguments.length<2?Ft(this.node(),n).on.on(e):this.each(qE(n,e,t))}function ek(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function tk(){return this.on("end.remove",ek(this._id))}function nk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=td(e));for(var r=this._groups,o=r.length,i=new Array(o),s=0;s<o;++s)for(var l=r[s],a=l.length,u=i[s]=new Array(a),c,d,f=0;f<a;++f)(c=l[f])&&(d=e.call(c,c.__data__,f,l))&&("__data__"in c&&(d.__data__=c.__data__),u[f]=d,Ll(u[f],t,n,f,u,Ft(c,n)));return new yn(i,this._parents,t,n)}function rk(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Rm(e));for(var r=this._groups,o=r.length,i=[],s=[],l=0;l<o;++l)for(var a=r[l],u=a.length,c,d=0;d<u;++d)if(c=a[d]){for(var f=e.call(c,c.__data__,d,a),g,y=Ft(c,n),v=0,x=f.length;v<x;++v)(g=f[v])&&Ll(g,t,n,v,f,y);i.push(f),s.push(c)}return new yn(i,s,t,n)}var ok=Ci.prototype.constructor;function ik(){return new ok(this._groups,this._parents)}function sk(e,t){var n,r,o;return function(){var i=qr(this,e),s=(this.style.removeProperty(e),qr(this,e));return i===s?null:i===n&&s===r?o:o=t(n=i,r=s)}}function o0(e){return function(){this.style.removeProperty(e)}}function lk(e,t,n){var r,o=n+"",i;return function(){var s=qr(this,e);return s===o?null:s===r?i:i=t(r=s,n)}}function ak(e,t,n){var r,o,i;return function(){var s=qr(this,e),l=n(this),a=l+"";return l==null&&(a=l=(this.style.removeProperty(e),qr(this,e))),s===a?null:s===r&&a===o?i:(o=a,i=t(r=s,l))}}function uk(e,t){var n,r,o,i="style."+t,s="end."+i,l;return function(){var a=nn(this,e),u=a.on,c=a.value[i]==null?l||(l=o0(t)):void 0;(u!==n||o!==c)&&(r=(n=u).copy()).on(s,o=c),a.on=r}}function ck(e,t,n){var r=(e+="")=="transform"?dE:r0;return t==null?this.styleTween(e,sk(e,r)).on("end.style."+e,o0(e)):typeof t=="function"?this.styleTween(e,ak(e,r,ld(this,"style."+e,t))).each(uk(this._id,e)):this.styleTween(e,lk(e,r,t),n).on("end.style."+e,null)}function dk(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function fk(e,t,n){var r,o;function i(){var s=t.apply(this,arguments);return s!==o&&(r=(o=s)&&dk(e,s,n)),r}return i._value=t,i}function hk(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,fk(e,t,n??""))}function pk(e){return function(){this.textContent=e}}function gk(e){return function(){var t=e(this);this.textContent=t??""}}function mk(e){return this.tween("text",typeof e=="function"?gk(ld(this,"text",e)):pk(e==null?"":e+""))}function yk(e){return function(t){this.textContent=e.call(this,t)}}function vk(e){var t,n;function r(){var o=e.apply(this,arguments);return o!==n&&(t=(n=o)&&yk(o)),t}return r._value=e,r}function wk(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,vk(e))}function xk(){for(var e=this._name,t=this._id,n=i0(),r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)if(a=s[u]){var c=Ft(a,t);Ll(a,e,n,u,s,{time:c.time+c.delay+c.duration,delay:0,duration:c.duration,ease:c.ease})}return new yn(r,this._parents,e,n)}function Sk(){var e,t,n=this,r=n._id,o=n.size();return new Promise(function(i,s){var l={value:s},a={value:function(){--o===0&&i()}};n.each(function(){var u=nn(this,r),c=u.on;c!==e&&(t=(e=c).copy(),t._.cancel.push(l),t._.interrupt.push(l),t._.end.push(a)),u.on=t}),o===0&&i()})}var Ek=0;function yn(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function i0(){return++Ek}var sn=Ci.prototype;yn.prototype={constructor:yn,select:nk,selectAll:rk,selectChild:sn.selectChild,selectChildren:sn.selectChildren,filter:KE,merge:GE,selection:ik,transition:xk,call:sn.call,nodes:sn.nodes,node:sn.node,size:sn.size,empty:sn.empty,each:sn.each,on:JE,attr:RE,attrTween:LE,style:ck,styleTween:hk,text:mk,textTween:wk,remove:tk,tween:NE,delay:HE,duration:UE,ease:XE,easeVarying:QE,end:Sk,[Symbol.iterator]:sn[Symbol.iterator]};function kk(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var Ck={time:null,delay:0,duration:250,ease:kk};function _k(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function Nk(e){var t,n;e instanceof yn?(t=e._id,e=e._name):(t=i0(),(n=Ck).time=id(),e=e==null?null:e+"");for(var r=this._groups,o=r.length,i=0;i<o;++i)for(var s=r[i],l=s.length,a,u=0;u<l;++u)(a=s[u])&&Ll(a,e,t,u,s,n||_k(a,t));return new yn(r,this._parents,e,t)}Ci.prototype.interrupt=kE;Ci.prototype.transition=Nk;const os=e=>()=>e;function bk(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 dn(e,t,n){this.k=e,this.x=t,this.y=n}dn.prototype={constructor:dn,scale:function(e){return e===1?this:new dn(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new dn(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 Ol=new dn(1,0,0);s0.prototype=dn.prototype;function s0(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Ol;return e.__zoom}function Aa(e){e.stopImmediatePropagation()}function ko(e){e.preventDefault(),e.stopImmediatePropagation()}function Mk(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function Ik(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function dh(){return this.__zoom||Ol}function Pk(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function Dk(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tk(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],s=e.invertY(t[1][1])-n[1][1];return e.translate(o>r?(r+o)/2:Math.min(0,r)||Math.max(0,o),s>i?(i+s)/2:Math.min(0,i)||Math.max(0,s))}function l0(){var e=Mk,t=Ik,n=Tk,r=Pk,o=Dk,i=[0,1/0],s=[[-1/0,-1/0],[1/0,1/0]],l=250,a=Ns,u=zl("start","zoom","end"),c,d,f,g=500,y=150,v=0,x=10;function p(E){E.property("__zoom",dh).on("wheel.zoom",b,{passive:!1}).on("mousedown.zoom",D).on("dblclick.zoom",A).filter(o).on("touchstart.zoom",j).on("touchmove.zoom",H).on("touchend.zoom touchcancel.zoom",L).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}p.transform=function(E,T,P,R){var I=E.selection?E.selection():E;I.property("__zoom",dh),E!==I?C(E,T,P,R):I.interrupt().each(function(){_(this,arguments).event(R).start().zoom(null,typeof T=="function"?T.apply(this,arguments):T).end()})},p.scaleBy=function(E,T,P,R){p.scaleTo(E,function(){var I=this.__zoom.k,M=typeof T=="function"?T.apply(this,arguments):T;return I*M},P,R)},p.scaleTo=function(E,T,P,R){p.transform(E,function(){var I=t.apply(this,arguments),M=this.__zoom,z=P==null?w(I):typeof P=="function"?P.apply(this,arguments):P,O=M.invert(z),$=typeof T=="function"?T.apply(this,arguments):T;return n(h(m(M,$),z,O),I,s)},P,R)},p.translateBy=function(E,T,P,R){p.transform(E,function(){return n(this.__zoom.translate(typeof T=="function"?T.apply(this,arguments):T,typeof P=="function"?P.apply(this,arguments):P),t.apply(this,arguments),s)},null,R)},p.translateTo=function(E,T,P,R,I){p.transform(E,function(){var M=t.apply(this,arguments),z=this.__zoom,O=R==null?w(M):typeof R=="function"?R.apply(this,arguments):R;return n(Ol.translate(O[0],O[1]).scale(z.k).translate(typeof T=="function"?-T.apply(this,arguments):-T,typeof P=="function"?-P.apply(this,arguments):-P),M,s)},R,I)};function m(E,T){return T=Math.max(i[0],Math.min(i[1],T)),T===E.k?E:new dn(T,E.x,E.y)}function h(E,T,P){var R=T[0]-P[0]*E.k,I=T[1]-P[1]*E.k;return R===E.x&&I===E.y?E:new dn(E.k,R,I)}function w(E){return[(+E[0][0]+ +E[1][0])/2,(+E[0][1]+ +E[1][1])/2]}function C(E,T,P,R){E.on("start.zoom",function(){_(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){_(this,arguments).event(R).end()}).tween("zoom",function(){var I=this,M=arguments,z=_(I,M).event(R),O=t.apply(I,M),$=P==null?w(O):typeof P=="function"?P.apply(I,M):P,U=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),W=I.__zoom,Z=typeof T=="function"?T.apply(I,M):T,G=a(W.invert($).concat(U/W.k),Z.invert($).concat(U/Z.k));return function(q){if(q===1)q=Z;else{var F=G(q),V=U/F[2];q=new dn(V,$[0]-F[0]*V,$[1]-F[1]*V)}z.zoom(null,q)}})}function _(E,T,P){return!P&&E.__zooming||new N(E,T)}function N(E,T){this.that=E,this.args=T,this.active=0,this.sourceEvent=null,this.extent=t.apply(E,T),this.taps=0}N.prototype={event:function(E){return E&&(this.sourceEvent=E),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(E,T){return this.mouse&&E!=="mouse"&&(this.mouse[1]=T.invert(this.mouse[0])),this.touch0&&E!=="touch"&&(this.touch0[1]=T.invert(this.touch0[0])),this.touch1&&E!=="touch"&&(this.touch1[1]=T.invert(this.touch1[0])),this.that.__zoom=T,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(E){var T=at(this.that).datum();u.call(E,this.that,new bk(E,{sourceEvent:this.sourceEvent,target:p,transform:this.that.__zoom,dispatch:u}),T)}};function b(E,...T){if(!e.apply(this,arguments))return;var P=_(this,T).event(E),R=this.__zoom,I=Math.max(i[0],Math.min(i[1],R.k*Math.pow(2,r.apply(this,arguments)))),M=It(E);if(P.wheel)(P.mouse[0][0]!==M[0]||P.mouse[0][1]!==M[1])&&(P.mouse[1]=R.invert(P.mouse[0]=M)),clearTimeout(P.wheel);else{if(R.k===I)return;P.mouse=[M,R.invert(M)],Is(this),P.start()}ko(E),P.wheel=setTimeout(z,y),P.zoom("mouse",n(h(m(R,I),P.mouse[0],P.mouse[1]),P.extent,s));function z(){P.wheel=null,P.end()}}function D(E,...T){if(f||!e.apply(this,arguments))return;var P=E.currentTarget,R=_(this,T,!0).event(E),I=at(E.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",U,!0),M=It(E,P),z=E.clientX,O=E.clientY;Um(E.view),Aa(E),R.mouse=[M,this.__zoom.invert(M)],Is(this),R.start();function $(W){if(ko(W),!R.moved){var Z=W.clientX-z,G=W.clientY-O;R.moved=Z*Z+G*G>v}R.event(W).zoom("mouse",n(h(R.that.__zoom,R.mouse[0]=It(W,P),R.mouse[1]),R.extent,s))}function U(W){I.on("mousemove.zoom mouseup.zoom",null),Wm(W.view,R.moved),ko(W),R.event(W).end()}}function A(E,...T){if(e.apply(this,arguments)){var P=this.__zoom,R=It(E.changedTouches?E.changedTouches[0]:E,this),I=P.invert(R),M=P.k*(E.shiftKey?.5:2),z=n(h(m(P,M),R,I),t.apply(this,T),s);ko(E),l>0?at(this).transition().duration(l).call(C,z,R,E):at(this).call(p.transform,z,R,E)}}function j(E,...T){if(e.apply(this,arguments)){var P=E.touches,R=P.length,I=_(this,T,E.changedTouches.length===R).event(E),M,z,O,$;for(Aa(E),z=0;z<R;++z)O=P[z],$=It(O,this),$=[$,this.__zoom.invert($),O.identifier],I.touch0?!I.touch1&&I.touch0[2]!==$[2]&&(I.touch1=$,I.taps=0):(I.touch0=$,M=!0,I.taps=1+!!c);c&&(c=clearTimeout(c)),M&&(I.taps<2&&(d=$[0],c=setTimeout(function(){c=null},g)),Is(this),I.start())}}function H(E,...T){if(this.__zooming){var P=_(this,T).event(E),R=E.changedTouches,I=R.length,M,z,O,$;for(ko(E),M=0;M<I;++M)z=R[M],O=It(z,this),P.touch0&&P.touch0[2]===z.identifier?P.touch0[0]=O:P.touch1&&P.touch1[2]===z.identifier&&(P.touch1[0]=O);if(z=P.that.__zoom,P.touch1){var U=P.touch0[0],W=P.touch0[1],Z=P.touch1[0],G=P.touch1[1],q=(q=Z[0]-U[0])*q+(q=Z[1]-U[1])*q,F=(F=G[0]-W[0])*F+(F=G[1]-W[1])*F;z=m(z,Math.sqrt(q/F)),O=[(U[0]+Z[0])/2,(U[1]+Z[1])/2],$=[(W[0]+G[0])/2,(W[1]+G[1])/2]}else if(P.touch0)O=P.touch0[0],$=P.touch0[1];else return;P.zoom("touch",n(h(z,O,$),P.extent,s))}}function L(E,...T){if(this.__zooming){var P=_(this,T).event(E),R=E.changedTouches,I=R.length,M,z;for(Aa(E),f&&clearTimeout(f),f=setTimeout(function(){f=null},g),M=0;M<I;++M)z=R[M],P.touch0&&P.touch0[2]===z.identifier?delete P.touch0:P.touch1&&P.touch1[2]===z.identifier&&delete P.touch1;if(P.touch1&&!P.touch0&&(P.touch0=P.touch1,delete P.touch1),P.touch0)P.touch0[1]=this.__zoom.invert(P.touch0[0]);else if(P.end(),P.taps===2&&(z=It(z,this),Math.hypot(d[0]-z[0],d[1]-z[1])<x)){var O=at(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return p.wheelDelta=function(E){return arguments.length?(r=typeof E=="function"?E:os(+E),p):r},p.filter=function(E){return arguments.length?(e=typeof E=="function"?E:os(!!E),p):e},p.touchable=function(E){return arguments.length?(o=typeof E=="function"?E:os(!!E),p):o},p.extent=function(E){return arguments.length?(t=typeof E=="function"?E:os([[+E[0][0],+E[0][1]],[+E[1][0],+E[1][1]]]),p):t},p.scaleExtent=function(E){return arguments.length?(i[0]=+E[0],i[1]=+E[1],p):[i[0],i[1]]},p.translateExtent=function(E){return arguments.length?(s[0][0]=+E[0][0],s[1][0]=+E[1][0],s[0][1]=+E[0][1],s[1][1]=+E[1][1],p):[[s[0][0],s[0][1]],[s[1][0],s[1][1]]]},p.constrain=function(E){return arguments.length?(n=E,p):n},p.duration=function(E){return arguments.length?(l=+E,p):l},p.interpolate=function(E){return arguments.length?(a=E,p):a},p.on=function(){var E=u.on.apply(u,arguments);return E===u?p:E},p.clickDistance=function(E){return arguments.length?(v=(E=+E)*E,p):Math.sqrt(v)},p.tapDistance=function(E){return arguments.length?(x=+E,p):x},p}const Lt={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},di=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],a0=["Enter"," ","Escape"],u0={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var eo;(function(e){e.Strict="strict",e.Loose="loose"})(eo||(eo={}));var or;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(or||(or={}));var fi;(function(e){e.Partial="partial",e.Full="full"})(fi||(fi={}));const c0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Mn;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(Mn||(Mn={}));var ul;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(ul||(ul={}));var ee;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(ee||(ee={}));const fh={[ee.Left]:ee.Right,[ee.Right]:ee.Left,[ee.Top]:ee.Bottom,[ee.Bottom]:ee.Top};function d0(e){return e===null?null:e?"valid":"invalid"}const f0=e=>!!e&&typeof e=="object"&&"id"in e&&"source"in e&&"target"in e,Rk=e=>!!e&&typeof e=="object"&&"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),ad=e=>!!e&&typeof e=="object"&&"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),Ni=(e,t=[0,0])=>{const{width:n,height:r}=rn(e),o=e.origin??t,i=n*o[0],s=r*o[1];return{x:e.position.x-i,y:e.position.y-s}},jk=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,o)=>{const i=typeof o=="string";let s=!t.nodeLookup&&!i?o:void 0;t.nodeLookup&&(s=i?t.nodeLookup.get(o):ad(o)?o:t.nodeLookup.get(o.id));const l=s?cl(s,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Fl(r,l)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Hl(n)},bi=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(o=>{(t.filter===void 0||t.filter(o))&&(n=Fl(n,cl(o)),r=!0)}),r?Hl(n):{x:0,y:0,width:0,height:0}},ud=(e,t,[n,r,o]=[0,0,1],i=!1,s=!1)=>{const l=(t.x-n)/o,a=(t.y-r)/o,u=t.width/o,c=t.height/o,d=[];for(const f of e.values()){const{measured:g,selectable:y=!0,hidden:v=!1}=f;if(s&&!y||v)continue;const x=g.width??f.width??f.initialWidth??0,p=g.height??f.height??f.initialHeight??0,{x:m,y:h}=f.internals.positionAbsolute,w=m0(l,a,u,c,m,h,x,p),C=x*p,_=i&&w>0;(!f.internals.handleBounds||_||w>=C||f.dragging)&&d.push(f)}return d},zk=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function Ak(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(o=>o.id)):null;return e.forEach(o=>{let i;if(t!=null&&t.includeHiddenNodes){const{width:s,height:l}=rn(o);i=s>0&&l>0}else i=!!(o.measured.width&&o.measured.height&&!o.hidden);i&&(!r||r.has(o.id))&&n.set(o.id,o)}),n}async function $k({nodes:e,width:t,height:n,panZoom:r,minZoom:o,maxZoom:i},s){if(e.size===0)return!0;const l=Ak(e,s),a=bi(l),u=dd(a,t,n,(s==null?void 0:s.minZoom)??o,(s==null?void 0:s.maxZoom)??i,(s==null?void 0:s.padding)??.1);return await r.setViewport(u,{duration:s==null?void 0:s.duration,ease:s==null?void 0:s.ease,interpolate:s==null?void 0:s.interpolate}),!0}function h0({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:o,onError:i}){const s=n.get(e),l=s.parentId?n.get(s.parentId):void 0,{x:a,y:u}=l?l.internals.positionAbsolute:{x:0,y:0},c=s.origin??r;let d=s.extent||o;if(s.extent==="parent"&&!s.expandParent)if(!l)i==null||i("005",Lt.error005());else{const g=l.measured.width,y=l.measured.height;g&&y&&(d=[[a,u],[a+g,u+y]])}else l&&hr(s.extent)&&(d=[[s.extent[0][0]+a,s.extent[0][1]+u],[s.extent[1][0]+a,s.extent[1][1]+u]]);const f=hr(d)?fr(t,d,s.measured):t;return(s.measured.width===void 0||s.measured.height===void 0)&&(i==null||i("015",Lt.error015())),{position:{x:f.x-a+(s.measured.width??0)*c[0],y:f.y-u+(s.measured.height??0)*c[1]},positionAbsolute:f}}async function Lk({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:o}){const i=new Set(e.map(f=>f.id)),s=[];for(const f of n){if(f.deletable===!1)continue;const g=i.has(f.id),y=!g&&f.parentId&&s.find(v=>v.id===f.parentId);(g||y)&&s.push(f)}const l=new Set(t.map(f=>f.id)),a=r.filter(f=>f.deletable!==!1),c=zk(s,a);for(const f of a)l.has(f.id)&&!c.find(y=>y.id===f.id)&&c.push(f);if(!o)return{edges:c,nodes:s};const d=await o({nodes:s,edges:c});return typeof d=="boolean"?d?{edges:c,nodes:s}:{edges:[],nodes:[]}:d}const to=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),fr=(e={x:0,y:0},t,n)=>({x:to(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:to(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function p0(e,t,n){const{width:r,height:o}=rn(n),{x:i,y:s}=n.internals.positionAbsolute;return fr(e,[[i,s],[i+r,s+o]],t)}const hh=(e,t,n)=>e<t?to(Math.abs(e-t),1,t)/t:e>n?-to(Math.abs(e-n),1,t)/t:0,cd=(e,t,n=15,r=40)=>{const o=hh(e.x,r,t.width-r)*n,i=hh(e.y,r,t.height-r)*n;return[o,i]},Fl=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),Ku=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),Hl=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),hi=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=ad(e)?e.internals.positionAbsolute:Ni(e,t);return{x:n,y:r,width:((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0,height:((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0}},cl=(e,t=[0,0])=>{var o,i;const{x:n,y:r}=ad(e)?e.internals.positionAbsolute:Ni(e,t);return{x:n,y:r,x2:n+(((o=e.measured)==null?void 0:o.width)??e.width??e.initialWidth??0),y2:r+(((i=e.measured)==null?void 0:i.height)??e.height??e.initialHeight??0)}},g0=(e,t)=>Hl(Fl(Ku(e),Ku(t))),m0=(e,t,n,r,o,i,s,l)=>{const a=Math.max(0,Math.min(e+n,o+s)-Math.max(e,o)),u=Math.max(0,Math.min(t+r,i+l)-Math.max(t,i));return Math.ceil(a*u)},dl=(e,t)=>m0(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),ph=e=>Rt(e.width)&&Rt(e.height)&&Rt(e.x)&&Rt(e.y),Rt=e=>!isNaN(e)&&isFinite(e),y0=(e,t)=>(n,r)=>{},Mi=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),Ii=({x:e,y:t},[n,r,o],i=!1,s=[1,1])=>{const l={x:(e-n)/o,y:(t-r)/o};return i?Mi(l,s):l},no=({x:e,y:t},[n,r,o])=>({x:e*o+n,y:t*o+r});function wr(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Ok(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=wr(e,n),o=wr(e,t);return{top:r,right:o,bottom:r,left:o,x:o*2,y:r*2}}if(typeof e=="object"){const r=wr(e.top??e.y??0,n),o=wr(e.bottom??e.y??0,n),i=wr(e.left??e.x??0,t),s=wr(e.right??e.x??0,t);return{top:r,right:s,bottom:o,left:i,x:i+s,y:r+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Fk(e,t,n,r,o,i){const{x:s,y:l}=no(e,[t,n,r]),{x:a,y:u}=no({x:e.x+e.width,y:e.y+e.height},[t,n,r]),c=o-a,d=i-u;return{left:Math.floor(s),top:Math.floor(l),right:Math.floor(c),bottom:Math.floor(d)}}const dd=(e,t,n,r,o,i)=>{const s=Ok(i,t,n),l=(t-s.x)/e.width,a=(n-s.y)/e.height,u=Math.min(l,a),c=to(u,r,o),d=e.x+e.width/2,f=e.y+e.height/2,g=t/2-d*c,y=n/2-f*c,v=Fk(e,g,y,c,t,n),x={left:Math.min(v.left-s.left,0),top:Math.min(v.top-s.top,0),right:Math.min(v.right-s.right,0),bottom:Math.min(v.bottom-s.bottom,0)};return{x:g-x.left+x.right,y:y-x.top+x.bottom,zoom:c}},pi=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function hr(e){return e!=null&&e!=="parent"}function rn(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function v0(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function w0(e,t={width:0,height:0},n,r,o){const i={...e},s=r.get(n);if(s){const l=s.origin||o;i.x+=s.internals.positionAbsolute.x-(t.width??0)*l[0],i.y+=s.internals.positionAbsolute.y-(t.height??0)*l[1]}return i}function gh(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function Hk(){let e,t;return{promise:new Promise((r,o)=>{e=r,t=o}),resolve:e,reject:t}}function Bk(e){return{...u0,...e||{}}}function Fo(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:o}){const{x:i,y:s}=jt(e),l=Ii({x:i-((o==null?void 0:o.left)??0),y:s-((o==null?void 0:o.top)??0)},r),{x:a,y:u}=n?Mi(l,t):l;return{xSnapped:a,ySnapped:u,...l}}const fd=e=>({width:e.offsetWidth,height:e.offsetHeight}),x0=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},Vk=["INPUT","SELECT","TEXTAREA"];function S0(e){var r,o;const t=((o=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:o[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:Vk.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const E0=e=>"clientX"in e,jt=(e,t)=>{var i,s;const n=E0(e),r=n?e.clientX:(i=e.touches)==null?void 0:i[0].clientX,o=n?e.clientY:(s=e.touches)==null?void 0:s[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:o-((t==null?void 0:t.top)??0)}},mh=(e,t,n,r,o)=>{const i=t.querySelectorAll(`.${e}`);return!i||!i.length?null:Array.from(i).map(s=>{const l=s.getBoundingClientRect();return{id:s.getAttribute("data-handleid"),type:e,nodeId:o,position:s.getAttribute("data-handlepos"),x:(l.left-n.left)/r,y:(l.top-n.top)/r,...fd(s)}})};function k0({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:o,sourceControlY:i,targetControlX:s,targetControlY:l}){const a=e*.125+o*.375+s*.375+n*.125,u=t*.125+i*.375+l*.375+r*.125,c=Math.abs(a-e),d=Math.abs(u-t);return[a,u,c,d]}function is(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function yh({pos:e,x1:t,y1:n,x2:r,y2:o,c:i}){switch(e){case ee.Left:return[t-is(t-r,i),n];case ee.Right:return[t+is(r-t,i),n];case ee.Top:return[t,n-is(n-o,i)];case ee.Bottom:return[t,n+is(o-n,i)]}}function C0({sourceX:e,sourceY:t,sourcePosition:n=ee.Bottom,targetX:r,targetY:o,targetPosition:i=ee.Top,curvature:s=.25}){const[l,a]=yh({pos:n,x1:e,y1:t,x2:r,y2:o,c:s}),[u,c]=yh({pos:i,x1:r,y1:o,x2:e,y2:t,c:s}),[d,f,g,y]=k0({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:l,sourceControlY:a,targetControlX:u,targetControlY:c});return[`M${e},${t} C${l},${a} ${u},${c} ${r},${o}`,d,f,g,y]}function _0({sourceX:e,sourceY:t,targetX:n,targetY:r}){const o=Math.abs(n-e)/2,i=n<e?n+o:n-o,s=Math.abs(r-t)/2,l=r<t?r+s:r-s;return[i,l,o,s]}function Uk({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:o=!1,zIndexMode:i="basic"}){if(i==="manual")return r;const s=o&&n?r+1e3:r,l=Math.max(e.parentId||o&&e.selected?e.internals.z:0,t.parentId||o&&t.selected?t.internals.z:0);return s+l}function Wk({sourceNode:e,targetNode:t,width:n,height:r,transform:o}){const i=Fl(cl(e),cl(t));i.x===i.x2&&(i.x2+=1),i.y===i.y2&&(i.y2+=1);const s={x:-o[0]/o[2],y:-o[1]/o[2],width:n/o[2],height:r/o[2]};return dl(s,Hl(i))>0}const Xk=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,Yk=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),Qk=(e,t,n={})=>{var i;if(!e.source||!e.target)return(i=n.onError)==null||i.call(n,"006",Lt.error006()),t;const r=n.getEdgeId||Xk;let o;return f0(e)?o={...e}:o={...e,id:r(e)},Yk(o,t)?t:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,t.concat(o))};function N0({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[o,i,s,l]=_0({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,o,i,s,l]}const vh={[ee.Left]:{x:-1,y:0},[ee.Right]:{x:1,y:0},[ee.Top]:{x:0,y:-1},[ee.Bottom]:{x:0,y:1}},Kk=({source:e,sourcePosition:t=ee.Bottom,target:n})=>t===ee.Left||t===ee.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},wh=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function Gk({source:e,sourcePosition:t=ee.Bottom,target:n,targetPosition:r=ee.Top,center:o,offset:i,stepPosition:s}){const l=vh[t],a=vh[r],u={x:e.x+l.x*i,y:e.y+l.y*i},c={x:n.x+a.x*i,y:n.y+a.y*i},d=Kk({source:u,sourcePosition:t,target:c}),f=d.x!==0?"x":"y",g=d[f];let y=[],v,x;const p={x:0,y:0},m={x:0,y:0},[,,h,w]=_0({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(l[f]*a[f]===-1){f==="x"?(v=o.x??u.x+(c.x-u.x)*s,x=o.y??(u.y+c.y)/2):(v=o.x??(u.x+c.x)/2,x=o.y??u.y+(c.y-u.y)*s);const b=[{x:v,y:u.y},{x:v,y:c.y}],D=[{x:u.x,y:x},{x:c.x,y:x}];l[f]===g?y=f==="x"?b:D:y=f==="x"?D:b}else{const b=[{x:u.x,y:c.y}],D=[{x:c.x,y:u.y}];if(f==="x"?y=l.x===g?D:b:y=l.y===g?b:D,t===r){const E=Math.abs(e[f]-n[f]);if(E<=i){const T=Math.min(i-1,i-E);l[f]===g?p[f]=(u[f]>e[f]?-1:1)*T:m[f]=(c[f]>n[f]?-1:1)*T}}if(t!==r){const E=f==="x"?"y":"x",T=l[f]===a[E],P=u[E]>c[E],R=u[E]<c[E];(l[f]===1&&(!T&&P||T&&R)||l[f]!==1&&(!T&&R||T&&P))&&(y=f==="x"?b:D)}const A={x:u.x+p.x,y:u.y+p.y},j={x:c.x+m.x,y:c.y+m.y},H=Math.max(Math.abs(A.x-y[0].x),Math.abs(j.x-y[0].x)),L=Math.max(Math.abs(A.y-y[0].y),Math.abs(j.y-y[0].y));H>=L?(v=(A.x+j.x)/2,x=y[0].y):(v=y[0].x,x=(A.y+j.y)/2)}const C={x:u.x+p.x,y:u.y+p.y},_={x:c.x+m.x,y:c.y+m.y};return[[e,...C.x!==y[0].x||C.y!==y[0].y?[C]:[],...y,..._.x!==y[y.length-1].x||_.y!==y[y.length-1].y?[_]:[],n],v,x,h,w]}function Zk(e,t,n,r){const o=Math.min(wh(e,t)/2,wh(t,n)/2,r),{x:i,y:s}=t;if(e.x===i&&i===n.x||e.y===s&&s===n.y)return`L${i} ${s}`;if(e.y===s){const u=e.x<n.x?-1:1,c=e.y<n.y?1:-1;return`L ${i+o*u},${s}Q ${i},${s} ${i},${s+o*c}`}const l=e.x<n.x?1:-1,a=e.y<n.y?-1:1;return`L ${i},${s+o*a}Q ${i},${s} ${i+o*l},${s}`}function Gu({sourceX:e,sourceY:t,sourcePosition:n=ee.Bottom,targetX:r,targetY:o,targetPosition:i=ee.Top,borderRadius:s=5,centerX:l,centerY:a,offset:u=20,stepPosition:c=.5}){const[d,f,g,y,v]=Gk({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:o},targetPosition:i,center:{x:l,y:a},offset:u,stepPosition:c});let x=`M${d[0].x} ${d[0].y}`;for(let p=1;p<d.length-1;p++)x+=Zk(d[p-1],d[p],d[p+1],s);return x+=`L${d[d.length-1].x} ${d[d.length-1].y}`,[x,f,g,y,v]}function xh(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function qk(e){var d;const{sourceNode:t,targetNode:n}=e;if(!xh(t)||!xh(n))return null;const r=t.internals.handleBounds||Sh(t.handles),o=n.internals.handleBounds||Sh(n.handles),i=Eh((r==null?void 0:r.source)??[],e.sourceHandle),s=Eh(e.connectionMode===eo.Strict?(o==null?void 0:o.target)??[]:((o==null?void 0:o.target)??[]).concat((o==null?void 0:o.source)??[]),e.targetHandle);if(!i||!s)return(d=e.onError)==null||d.call(e,"008",Lt.error008(i?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const l=(i==null?void 0:i.position)||ee.Bottom,a=(s==null?void 0:s.position)||ee.Top,u=pr(t,i,l),c=pr(n,s,a);return{sourceX:u.x,sourceY:u.y,targetX:c.x,targetY:c.y,sourcePosition:l,targetPosition:a}}function Sh(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function pr(e,t,n=ee.Left,r=!1){const o=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,i=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:s,height:l}=t??rn(e);if(r)return{x:o+s/2,y:i+l/2};switch((t==null?void 0:t.position)??n){case ee.Top:return{x:o+s/2,y:i};case ee.Right:return{x:o+s,y:i+l/2};case ee.Bottom:return{x:o+s/2,y:i+l};case ee.Left:return{x:o,y:i+l/2}}}function Eh(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function Zu(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function Jk(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:o}){const i=new Set;return e.reduce((s,l)=>([l.markerStart||r,l.markerEnd||o].forEach(a=>{if(a&&typeof a=="object"){const u=Zu(a,t);i.has(u)||(s.push({id:u,color:a.color||n,...a}),i.add(u))}}),s),[]).sort((s,l)=>s.id.localeCompare(l.id))}const b0=1e3,eC=10,hd={nodeOrigin:[0,0],nodeExtent:di,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},tC={...hd,checkEquality:!0};function pd(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function nC(e,t,n){const r=pd(hd,n);for(const o of e.values())if(o.parentId)md(o,e,t,r);else{const i=Ni(o,r.nodeOrigin),s=hr(o.extent)?o.extent:r.nodeExtent,l=fr(i,s,rn(o));o.internals.positionAbsolute=l}}function rC(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const o of e.handles){const i={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?n.push(i):o.type==="target"&&r.push(i)}return{source:n,target:r}}function gd(e){return e==="manual"}function qu(e,t,n,r={}){var c,d;const o=pd(tC,r),i={i:0},s=new Map(t),l=o!=null&&o.elevateNodesOnSelect&&!gd(o.zIndexMode)?b0:0;let a=e.length>0,u=!1;t.clear(),n.clear();for(const f of e){let g=s.get(f.id);if(o.checkEquality&&f===(g==null?void 0:g.internals.userNode))t.set(f.id,g);else{const y=Ni(f,o.nodeOrigin),v=hr(f.extent)?f.extent:o.nodeExtent,x=fr(y,v,rn(f));g={...o.defaults,...f,measured:{width:(c=f.measured)==null?void 0:c.width,height:(d=f.measured)==null?void 0:d.height},internals:{positionAbsolute:x,handleBounds:rC(f,g),z:M0(f,l,o.zIndexMode),userNode:f}},t.set(f.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(a=!1),f.parentId&&md(g,t,n,r,i),u||(u=f.selected??!1)}return{nodesInitialized:a,hasSelectedNodes:u}}function oC(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function md(e,t,n,r,o){const{elevateNodesOnSelect:i,nodeOrigin:s,nodeExtent:l,zIndexMode:a}=pd(hd,r),u=e.parentId,c=t.get(u);if(!c){console.warn(`Parent node ${u} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}oC(e,n),o&&!c.parentId&&c.internals.rootParentIndex===void 0&&a==="auto"&&(c.internals.rootParentIndex=++o.i,c.internals.z=c.internals.z+o.i*eC),o&&c.internals.rootParentIndex!==void 0&&(o.i=c.internals.rootParentIndex);const d=i&&!gd(a)?b0:0,{x:f,y:g,z:y}=iC(e,c,s,l,d,a),{positionAbsolute:v}=e.internals,x=f!==v.x||g!==v.y;(x||y!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:x?{x:f,y:g}:v,z:y}})}function M0(e,t,n){const r=Rt(e.zIndex)?e.zIndex:0;return gd(n)?r:r+(e.selected?t:0)}function iC(e,t,n,r,o,i){const{x:s,y:l}=t.internals.positionAbsolute,a=rn(e),u=Ni(e,n),c=hr(e.extent)?fr(u,e.extent,a):u;let d=fr({x:s+c.x,y:l+c.y},r,a);e.extent==="parent"&&(d=p0(d,a,t));const f=M0(e,o,i),g=t.internals.z??0;return{x:d.x,y:d.y,z:g>=f?g+1:f}}function yd(e,t,n,r=[0,0]){var s;const o=[],i=new Map;for(const l of e){const a=t.get(l.parentId);if(!a)continue;const u=((s=i.get(l.parentId))==null?void 0:s.expandedRect)??hi(a),c=g0(u,l.rect);i.set(l.parentId,{expandedRect:c,parent:a})}return i.size>0&&i.forEach(({expandedRect:l,parent:a},u)=>{var h;const c=a.internals.positionAbsolute,d=rn(a),f=a.origin??r,g=l.x<c.x?Math.round(Math.abs(c.x-l.x)):0,y=l.y<c.y?Math.round(Math.abs(c.y-l.y)):0,v=Math.max(d.width,Math.round(l.width)),x=Math.max(d.height,Math.round(l.height)),p=(v-d.width)*f[0],m=(x-d.height)*f[1];(g>0||y>0||p||m)&&(o.push({id:u,type:"position",position:{x:a.position.x-g+p,y:a.position.y-y+m}}),(h=n.get(u))==null||h.forEach(w=>{e.some(C=>C.id===w.id)||o.push({id:w.id,type:"position",position:{x:w.position.x+g,y:w.position.y+y}})})),(d.width<l.width||d.height<l.height||g||y)&&o.push({id:u,type:"dimensions",setAttributes:!0,dimensions:{width:v+(g?f[0]*g-p:0),height:x+(y?f[1]*y-m:0)}})}),o}function sC(e,t,n,r,o,i,s){const l=r==null?void 0:r.querySelector(".xyflow__viewport");let a=!1;if(!l)return{changes:[],updatedInternals:a};const u=[],c=window.getComputedStyle(l),{m22:d}=new window.DOMMatrixReadOnly(c.transform),f=[];for(const g of e.values()){const y=t.get(g.id);if(!y)continue;if(y.hidden){t.set(y.id,{...y,internals:{...y.internals,handleBounds:void 0}}),a=!0;continue}const v=fd(g.nodeElement),x=y.measured.width!==v.width||y.measured.height!==v.height;if(!!(v.width&&v.height&&(x||!y.internals.handleBounds||g.force))){const m=g.nodeElement.getBoundingClientRect(),h=hr(y.extent)?y.extent:i;let{positionAbsolute:w}=y.internals;if(y.parentId&&y.extent==="parent"){const _=t.get(y.parentId);_&&(w=p0(w,v,_))}else h&&(w=fr(w,h,v));const C={...y,measured:v,internals:{...y.internals,positionAbsolute:w,handleBounds:{source:mh("source",g.nodeElement,m,d,y.id),target:mh("target",g.nodeElement,m,d,y.id)}}};t.set(y.id,C),y.parentId&&md(C,t,n,{nodeOrigin:o,zIndexMode:s}),a=!0,x&&(u.push({id:y.id,type:"dimensions",dimensions:v}),y.expandParent&&y.parentId&&f.push({id:y.id,parentId:y.parentId,rect:hi(C,o)}))}}if(f.length>0){const g=yd(f,t,n,o);u.push(...g)}return{changes:u,updatedInternals:a}}async function lC({delta:e,panZoom:t,transform:n,translateExtent:r,width:o,height:i}){if(!t||!e.x&&!e.y)return!1;const s=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[o,i]],r);return!!s&&(s.x!==n[0]||s.y!==n[1]||s.k!==n[2])}function kh(e,t,n,r,o,i){let s=o;const l=r.get(s)||new Map;r.set(s,l.set(n,t)),s=`${o}-${e}`;const a=r.get(s)||new Map;if(r.set(s,a.set(n,t)),i){s=`${o}-${e}-${i}`;const u=r.get(s)||new Map;r.set(s,u.set(n,t))}}function I0(e,t,n){e.clear(),t.clear();for(const r of n){const{source:o,target:i,sourceHandle:s=null,targetHandle:l=null}=r,a={edgeId:r.id,source:o,target:i,sourceHandle:s,targetHandle:l},u=`${o}-${s}--${i}-${l}`,c=`${i}-${l}--${o}-${s}`;kh("source",a,c,e,o,s),kh("target",a,u,e,i,l),t.set(r.id,r)}}function P0(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:P0(n,t):!1}function Ch(e,t,n){var o;let r=e;do{if((o=r==null?void 0:r.matches)!=null&&o.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function aC(e,t,n,r){const o=new Map;for(const[i,s]of e)if((s.selected||s.id===r)&&(!s.parentId||!P0(s,e))&&(s.draggable||t&&typeof s.draggable>"u")){const l=e.get(i);l&&o.set(i,{id:i,position:l.position||{x:0,y:0},distance:{x:n.x-l.internals.positionAbsolute.x,y:n.y-l.internals.positionAbsolute.y},extent:l.extent,parentId:l.parentId,origin:l.origin,expandParent:l.expandParent,internals:{positionAbsolute:l.internals.positionAbsolute||{x:0,y:0}},measured:{width:l.measured.width??0,height:l.measured.height??0}})}return o}function $a({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var s,l,a;const o=[];for(const[u,c]of t){const d=(s=n.get(u))==null?void 0:s.internals.userNode;d&&o.push({...d,position:c.position,dragging:r})}if(!e)return[o[0],o];const i=(l=n.get(e))==null?void 0:l.internals.userNode;return[i?{...i,position:((a=t.get(e))==null?void 0:a.position)||i.position,dragging:r}:o[0],o]}function uC({dragItems:e,snapGrid:t,x:n,y:r}){const o=e.values().next().value;if(!o)return null;const i={x:n-o.distance.x,y:r-o.distance.y},s=Mi(i,t);return{x:s.x-i.x,y:s.y-i.y}}function cC({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:o}){let i={x:null,y:null},s=0,l=new Map,a=!1,u={x:0,y:0},c=null,d=!1,f=null,g=!1,y=!1,v=null;function x({noDragClassName:m,handleSelector:h,domNode:w,isSelectable:C,nodeId:_,nodeClickDistance:N=0}){f=at(w);function b({x:H,y:L}){const{nodeLookup:E,nodeExtent:T,snapGrid:P,snapToGrid:R,nodeOrigin:I,onNodeDrag:M,onSelectionDrag:z,onError:O,updateNodePositions:$}=t();i={x:H,y:L};let U=!1;const W=l.size>1,Z=W&&T?Ku(bi(l)):null,G=W&&R?uC({dragItems:l,snapGrid:P,x:H,y:L}):null;for(const[q,F]of l){if(!E.has(q))continue;let V={x:H-F.distance.x,y:L-F.distance.y};R&&(V=G?{x:Math.round(V.x+G.x),y:Math.round(V.y+G.y)}:Mi(V,P));let X=null;if(W&&T&&!F.extent&&Z){const{positionAbsolute:K}=F.internals,te=K.x-Z.x+T[0][0],ne=K.x+F.measured.width-Z.x2+T[1][0],re=K.y-Z.y+T[0][1],ce=K.y+F.measured.height-Z.y2+T[1][1];X=[[te,re],[ne,ce]]}const{position:J,positionAbsolute:Y}=h0({nodeId:q,nextPosition:V,nodeLookup:E,nodeExtent:X||T,nodeOrigin:I,onError:O});U=U||F.position.x!==J.x||F.position.y!==J.y,F.position=J,F.internals.positionAbsolute=Y}if(y=y||U,!!U&&($(l,!0),v&&(r||M||!_&&z))){const[q,F]=$a({nodeId:_,dragItems:l,nodeLookup:E});r==null||r(v,l,q,F),M==null||M(v,q,F),_||z==null||z(v,F)}}async function D(){if(!c)return;const{transform:H,panBy:L,autoPanSpeed:E,autoPanOnNodeDrag:T}=t();if(!T){a=!1,cancelAnimationFrame(s);return}const[P,R]=cd(u,c,E);(P!==0||R!==0)&&(i.x=(i.x??0)-P/H[2],i.y=(i.y??0)-R/H[2],await L({x:P,y:R})&&b(i)),s=requestAnimationFrame(D)}function A(H){var W;const{nodeLookup:L,multiSelectionActive:E,nodesDraggable:T,transform:P,snapGrid:R,snapToGrid:I,selectNodesOnDrag:M,onNodeDragStart:z,onSelectionDragStart:O,unselectNodesAndEdges:$}=t();d=!0,(!M||!C)&&!E&&_&&((W=L.get(_))!=null&&W.selected||$()),C&&M&&_&&(e==null||e(_));const U=Fo(H.sourceEvent,{transform:P,snapGrid:R,snapToGrid:I,containerBounds:c});if(i=U,l=aC(L,T,U,_),l.size>0&&(n||z||!_&&O)){const[Z,G]=$a({nodeId:_,dragItems:l,nodeLookup:L});n==null||n(H.sourceEvent,l,Z,G),z==null||z(H.sourceEvent,Z,G),_||O==null||O(H.sourceEvent,G)}}const j=Xm().clickDistance(N).on("start",H=>{const{domNode:L,nodeDragThreshold:E,transform:T,snapGrid:P,snapToGrid:R}=t();c=(L==null?void 0:L.getBoundingClientRect())||null,g=!1,y=!1,v=H.sourceEvent,E===0&&A(H),i=Fo(H.sourceEvent,{transform:T,snapGrid:P,snapToGrid:R,containerBounds:c}),u=jt(H.sourceEvent,c)}).on("drag",H=>{const{autoPanOnNodeDrag:L,transform:E,snapGrid:T,snapToGrid:P,nodeDragThreshold:R,nodeLookup:I}=t(),M=Fo(H.sourceEvent,{transform:E,snapGrid:T,snapToGrid:P,containerBounds:c});if(v=H.sourceEvent,(H.sourceEvent.type==="touchmove"&&H.sourceEvent.touches.length>1||_&&!I.has(_))&&(g=!0),!g){if(!a&&L&&d&&(a=!0,D()),!d){const z=jt(H.sourceEvent,c),O=z.x-u.x,$=z.y-u.y;Math.sqrt(O*O+$*$)>R&&A(H)}(i.x!==M.xSnapped||i.y!==M.ySnapped)&&l&&d&&(u=jt(H.sourceEvent,c),b(M))}}).on("end",H=>{if(!d||g){g&&l.size>0&&t().updateNodePositions(l,!1);return}if(a=!1,d=!1,cancelAnimationFrame(s),l.size>0){const{nodeLookup:L,updateNodePositions:E,onNodeDragStop:T,onSelectionDragStop:P}=t();if(y&&(E(l,!1),y=!1),o||T||!_&&P){const[R,I]=$a({nodeId:_,dragItems:l,nodeLookup:L,dragging:!1});o==null||o(H.sourceEvent,l,R,I),T==null||T(H.sourceEvent,R,I),_||P==null||P(H.sourceEvent,I)}}}).filter(H=>{const L=H.target;return!H.button&&(!m||!Ch(L,`.${m}`,w))&&(!h||Ch(L,h,w))});f.call(j)}function p(){f==null||f.on(".drag",null)}return{update:x,destroy:p}}function dC(e,t,n){const r=[],o={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const i of t.values())dl(o,hi(i))>0&&r.push(i);return r}const fC=250;function hC(e,t,n,r){var l,a;let o=[],i=1/0;const s=dC(e,n,t+fC);for(const u of s){const c=[...((l=u.internals.handleBounds)==null?void 0:l.source)??[],...((a=u.internals.handleBounds)==null?void 0:a.target)??[]];for(const d of c){if(r.nodeId===d.nodeId&&r.type===d.type&&r.id===d.id)continue;const{x:f,y:g}=pr(u,d,d.position,!0),y=Math.sqrt(Math.pow(f-e.x,2)+Math.pow(g-e.y,2));y>t||(y<i?(o=[{...d,x:f,y:g}],i=y):y===i&&o.push({...d,x:f,y:g}))}}if(!o.length)return null;if(o.length>1){const u=r.type==="source"?"target":"source";return o.find(c=>c.type===u)??o[0]}return o[0]}function D0(e,t,n,r,o,i=!1){var u,c,d;const s=r.get(e);if(!s)return null;const l=o==="strict"?(u=s.internals.handleBounds)==null?void 0:u[t]:[...((c=s.internals.handleBounds)==null?void 0:c.source)??[],...((d=s.internals.handleBounds)==null?void 0:d.target)??[]],a=(n?l==null?void 0:l.find(f=>f.id===n):l==null?void 0:l[0])??null;return a&&i?{...a,...pr(s,a,a.position,!0)}:a}function T0(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function pC(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const R0=()=>!0;function gC(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:o,edgeUpdaterType:i,isTarget:s,domNode:l,nodeLookup:a,lib:u,autoPanOnConnect:c,flowId:d,panBy:f,cancelConnection:g,onConnectStart:y,onConnect:v,onConnectEnd:x,isValidConnection:p=R0,onReconnectEnd:m,updateConnection:h,getTransform:w,getFromHandle:C,autoPanSpeed:_,dragThreshold:N=1,handleDomNode:b}){const D=x0(e.target);let A=0,j;const{x:H,y:L}=jt(e),E=T0(i,b),T=l==null?void 0:l.getBoundingClientRect();let P=!1;if(!T||!E)return;const R=D0(o,E,r,a,t);if(!R)return;let I=jt(e,T),M=!1,z=null,O=!1,$=null;function U(){if(!c||!T)return;const[J,Y]=cd(I,T,_);f({x:J,y:Y}),A=requestAnimationFrame(U)}const W={...R,nodeId:o,type:E,position:R.position},Z=a.get(o);let q={inProgress:!0,isValid:null,from:pr(Z,W,ee.Left,!0),fromHandle:W,fromPosition:W.position,fromNode:Z,to:I,toHandle:null,toPosition:fh[W.position],toNode:null,pointer:I};function F(){P=!0,h(q),y==null||y(e,{nodeId:o,handleId:r,handleType:E})}N===0&&F();function V(J){if(!P){const{x:ce,y:He}=jt(J),Ke=ce-H,Ce=He-L;if(!(Ke*Ke+Ce*Ce>N*N))return;F()}if(!C()||!W){X(J);return}const Y=w();I=jt(J,T),j=hC(Ii(I,Y,!1,[1,1]),n,a,W),M||(U(),M=!0);const K=j0(J,{handle:j,connectionMode:t,fromNodeId:o,fromHandleId:r,fromType:s?"target":"source",isValidConnection:p,doc:D,lib:u,flowId:d,nodeLookup:a});$=K.handleDomNode,z=K.connection,O=pC(!!j,K.isValid);const te=a.get(o),ne=te?pr(te,W,ee.Left,!0):q.from,re={...q,from:ne,isValid:O,to:K.toHandle&&O?no({x:K.toHandle.x,y:K.toHandle.y},Y):I,toHandle:K.toHandle,toPosition:O&&K.toHandle?K.toHandle.position:fh[W.position],toNode:K.toHandle?a.get(K.toHandle.nodeId):null,pointer:I};h(re),q=re}function X(J){if(!("touches"in J&&J.touches.length>0)){if(P){(j||$)&&z&&O&&(v==null||v(z));const{inProgress:Y,...K}=q,te={...K,toPosition:q.toHandle?q.toPosition:null};x==null||x(J,te),i&&(m==null||m(J,te))}g(),cancelAnimationFrame(A),M=!1,O=!1,z=null,$=null,D.removeEventListener("mousemove",V),D.removeEventListener("mouseup",X),D.removeEventListener("touchmove",V),D.removeEventListener("touchend",X)}}D.addEventListener("mousemove",V),D.addEventListener("mouseup",X),D.addEventListener("touchmove",V),D.addEventListener("touchend",X)}function j0(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:o,fromType:i,doc:s,lib:l,flowId:a,isValidConnection:u=R0,nodeLookup:c}){const d=i==="target",f=t?s.querySelector(`.${l}-flow__handle[data-id="${a}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:g,y}=jt(e),v=s.elementFromPoint(g,y),x=v!=null&&v.classList.contains(`${l}-flow__handle`)?v:f,p={handleDomNode:x,isValid:!1,connection:null,toHandle:null};if(x){const m=T0(void 0,x),h=x.getAttribute("data-nodeid"),w=x.getAttribute("data-handleid"),C=x.classList.contains("connectable"),_=x.classList.contains("connectableend");if(!h||!m)return p;const N={source:d?h:r,sourceHandle:d?w:o,target:d?r:h,targetHandle:d?o:w};p.connection=N;const D=C&&_&&(n===eo.Strict?d&&m==="source"||!d&&m==="target":h!==r||w!==o);p.isValid=D&&u(N),p.toHandle=D0(h,m,w,c,n,!0)}return p}const Ju={onPointerDown:gC,isValid:j0};function mC({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const o=at(e);function i({translateExtent:l,width:a,height:u,zoomStep:c=1,pannable:d=!0,zoomable:f=!0,inversePan:g=!1}){const y=h=>{if(h.sourceEvent.type!=="wheel"||!t)return;const w=n(),C=h.sourceEvent.ctrlKey&&pi()?10:1,_=-h.sourceEvent.deltaY*(h.sourceEvent.deltaMode===1?.05:h.sourceEvent.deltaMode?1:.002)*c,N=w[2]*Math.pow(2,_*C);t.scaleTo(N)};let v=[0,0];const x=h=>{(h.sourceEvent.type==="mousedown"||h.sourceEvent.type==="touchstart")&&(v=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY])},p=h=>{const w=n();if(h.sourceEvent.type!=="mousemove"&&h.sourceEvent.type!=="touchmove"||!t)return;const C=[h.sourceEvent.clientX??h.sourceEvent.touches[0].clientX,h.sourceEvent.clientY??h.sourceEvent.touches[0].clientY],_=[C[0]-v[0],C[1]-v[1]];v=C;const N=r()*Math.max(w[2],Math.log(w[2]))*(g?-1:1),b={x:w[0]-_[0]*N,y:w[1]-_[1]*N},D=[[0,0],[a,u]];t.setViewportConstrained({x:b.x,y:b.y,zoom:w[2]},D,l)},m=l0().on("start",x).on("zoom",d?p:null).on("zoom.wheel",f?y:null);o.call(m,{})}function s(){o.on("zoom",null)}return{update:i,destroy:s,pointer:It}}const Bl=e=>({x:e.x,y:e.y,zoom:e.k}),La=({x:e,y:t,zoom:n})=>Ol.translate(e,t).scale(n),Rr=(e,t)=>e.target.closest(`.${t}`),z0=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),yC=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,Oa=(e,t=0,n=yC,r=()=>{})=>{const o=typeof t=="number"&&t>0;return o||r(),o?e.transition().duration(t).ease(n).on("end",r):e},A0=e=>{const t=e.ctrlKey&&pi()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function vC({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:o,panOnScrollSpeed:i,zoomOnPinch:s,onPanZoomStart:l,onPanZoom:a,onPanZoomEnd:u}){return c=>{if(Rr(c,t))return c.ctrlKey&&c.preventDefault(),!1;c.preventDefault(),c.stopImmediatePropagation();const d=n.property("__zoom").k||1;if(c.ctrlKey&&s){const x=It(c),p=A0(c),m=d*Math.pow(2,p);r.scaleTo(n,m,x,c);return}const f=c.deltaMode===1?20:1;let g=o===or.Vertical?0:c.deltaX*f,y=o===or.Horizontal?0:c.deltaY*f;!pi()&&c.shiftKey&&o!==or.Vertical&&(g=c.deltaY*f,y=0),r.translateBy(n,-(g/d)*i,-(y/d)*i,{internal:!0});const v=Bl(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?a==null||a(c,v):(e.isPanScrolling=!0,l==null||l(c,v)),e.panScrollTimeout=setTimeout(()=>{u==null||u(c,v),e.isPanScrolling=!1},150)}}function wC({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,o){const i=r.type==="wheel",s=!t&&i&&!r.ctrlKey,l=Rr(r,e);if(r.ctrlKey&&i&&l&&r.preventDefault(),s||l)return null;r.preventDefault(),n.call(this,r,o)}}function xC({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var i,s,l;if((i=r.sourceEvent)!=null&&i.internal)return;const o=Bl(r.transform);e.mouseButton=((s=r.sourceEvent)==null?void 0:s.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=o,((l=r.sourceEvent)==null?void 0:l.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,o))}}function SC({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:o}){return i=>{var s,l;e.usedRightMouseButton=!!(n&&z0(t,e.mouseButton??0)),(s=i.sourceEvent)!=null&&s.sync||r([i.transform.x,i.transform.y,i.transform.k]),o&&!((l=i.sourceEvent)!=null&&l.internal)&&(o==null||o(i.sourceEvent,Bl(i.transform)))}}function EC({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:o,onPaneContextMenu:i}){return s=>{var l;if(!((l=s.sourceEvent)!=null&&l.internal)&&(e.isZoomingOrPanning=!1,i&&z0(t,e.mouseButton??0)&&!e.usedRightMouseButton&&s.sourceEvent&&i(s.sourceEvent),e.usedRightMouseButton=!1,r(!1),o)){const a=Bl(s.transform);e.prevViewport=a,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o==null||o(s.sourceEvent,a)},n?150:0)}}}function kC({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:o,zoomOnDoubleClick:i,userSelectionActive:s,noWheelClassName:l,noPanClassName:a,lib:u,connectionInProgress:c}){return d=>{var x;const f=e||t,g=n&&d.ctrlKey,y=d.type==="wheel";if(d.button===1&&d.type==="mousedown"&&(Rr(d,`${u}-flow__node`)||Rr(d,`${u}-flow__edge`)))return!0;if(!r&&!f&&!o&&!i&&!n||s||c&&!y||Rr(d,l)&&y||Rr(d,a)&&(!y||o&&y&&!e)||!n&&d.ctrlKey&&y)return!1;if(!n&&d.type==="touchstart"&&((x=d.touches)==null?void 0:x.length)>1)return d.preventDefault(),!1;if(!f&&!o&&!g&&y||!r&&(d.type==="mousedown"||d.type==="touchstart")||Array.isArray(r)&&!r.includes(d.button)&&d.type==="mousedown")return!1;const v=Array.isArray(r)&&r.includes(d.button)||!d.button||d.button<=1;return(!d.ctrlKey||y)&&v}}function CC({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:o,onPanZoom:i,onPanZoomStart:s,onPanZoomEnd:l,onDraggingChange:a}){const u={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},c=e.getBoundingClientRect();let d=[[0,0],[c.width,c.height]];const f=typeof ResizeObserver<"u"?new ResizeObserver(L=>{const E=L[0];E&&(d=[[0,0],[E.contentRect.width,E.contentRect.height]])}):null;f==null||f.observe(e);const g=l0().extent(()=>d).scaleExtent([t,n]).translateExtent(r),y=at(e).call(g);w({x:o.x,y:o.y,zoom:to(o.zoom,t,n)},[[0,0],[c.width,c.height]],r);const v=y.on("wheel.zoom"),x=y.on("dblclick.zoom");g.wheelDelta(A0);async function p(L,E){return y?new Promise(T=>{g==null||g.interpolate((E==null?void 0:E.interpolate)==="linear"?Oo:Ns).transform(Oa(y,E==null?void 0:E.duration,E==null?void 0:E.ease,()=>T(!0)),L)}):!1}function m({noWheelClassName:L,noPanClassName:E,onPaneContextMenu:T,userSelectionActive:P,panOnScroll:R,panOnDrag:I,panOnScrollMode:M,panOnScrollSpeed:z,preventScrolling:O,zoomOnPinch:$,zoomOnScroll:U,zoomOnDoubleClick:W,zoomActivationKeyPressed:Z,lib:G,onTransformChange:q,connectionInProgress:F,paneClickDistance:V,selectionOnDrag:X}){P&&!u.isZoomingOrPanning&&h();const J=R&&!Z&&!P;g.clickDistance(X?1/0:!Rt(V)||V<0?0:V);const Y=J?vC({zoomPanValues:u,noWheelClassName:L,d3Selection:y,d3Zoom:g,panOnScrollMode:M,panOnScrollSpeed:z,zoomOnPinch:$,onPanZoomStart:s,onPanZoom:i,onPanZoomEnd:l}):wC({noWheelClassName:L,preventScrolling:O,d3ZoomHandler:v});y.on("wheel.zoom",Y,{passive:!1});const K=xC({zoomPanValues:u,onDraggingChange:a,onPanZoomStart:s});g.on("start",K);const te=SC({zoomPanValues:u,panOnDrag:I,onPaneContextMenu:!!T,onPanZoom:i,onTransformChange:q});g.on("zoom",te);const ne=EC({zoomPanValues:u,panOnDrag:I,panOnScroll:R,onPaneContextMenu:T,onPanZoomEnd:l,onDraggingChange:a});g.on("end",ne);const re=kC({zoomActivationKeyPressed:Z,panOnDrag:I,zoomOnScroll:U,panOnScroll:R,zoomOnDoubleClick:W,zoomOnPinch:$,userSelectionActive:P,noPanClassName:E,noWheelClassName:L,lib:G,connectionInProgress:F});g.filter(re),W?y.on("dblclick.zoom",x):y.on("dblclick.zoom",null)}function h(){g.on("zoom",null)}async function w(L,E,T){const P=La(L),R=g==null?void 0:g.constrain()(P,E,T);return R&&await p(R),R}async function C(L,E){const T=La(L);return await p(T,E),T}function _(L){if(y){const E=La(L),T=y.property("__zoom");(T.k!==L.zoom||T.x!==L.x||T.y!==L.y)&&(g==null||g.transform(y,E,null,{sync:!0}))}}function N(){const L=y?s0(y.node()):{x:0,y:0,k:1};return{x:L.x,y:L.y,zoom:L.k}}async function b(L,E){return y?new Promise(T=>{g==null||g.interpolate((E==null?void 0:E.interpolate)==="linear"?Oo:Ns).scaleTo(Oa(y,E==null?void 0:E.duration,E==null?void 0:E.ease,()=>T(!0)),L)}):!1}async function D(L,E){return y?new Promise(T=>{g==null||g.interpolate((E==null?void 0:E.interpolate)==="linear"?Oo:Ns).scaleBy(Oa(y,E==null?void 0:E.duration,E==null?void 0:E.ease,()=>T(!0)),L)}):!1}function A(L){g==null||g.scaleExtent(L)}function j(L){g==null||g.translateExtent(L)}function H(L){const E=!Rt(L)||L<0?0:L;g==null||g.clickDistance(E)}return{update:m,destroy:h,setViewport:C,setViewportConstrained:w,getViewport:N,scaleTo:b,scaleBy:D,setScaleExtent:A,setTranslateExtent:j,syncViewport:_,setClickDistance:H}}var ro;(function(e){e.Line="line",e.Handle="handle"})(ro||(ro={}));function _C({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:o,affectsY:i}){const s=e-t,l=n-r,a=[s>0?1:s<0?-1:0,l>0?1:l<0?-1:0];return s&&o&&(a[0]=a[0]*-1),l&&i&&(a[1]=a[1]*-1),a}function _h(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),o=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:o}}function Sn(e,t){return Math.max(0,t-e)}function En(e,t){return Math.max(0,e-t)}function ss(e,t,n){return Math.max(0,t-e,e-n)}function Nh(e,t){return e?!t:t}function NC(e,t,n,r,o,i,s,l){let{affectsX:a,affectsY:u}=t;const{isHorizontal:c,isVertical:d}=t,f=c&&d,{xSnapped:g,ySnapped:y}=n,{minWidth:v,maxWidth:x,minHeight:p,maxHeight:m}=r,{x:h,y:w,width:C,height:_,aspectRatio:N}=e;let b=Math.floor(c?g-e.pointerX:0),D=Math.floor(d?y-e.pointerY:0);const A=C+(a?-b:b),j=_+(u?-D:D),H=-i[0]*C,L=-i[1]*_;let E=ss(A,v,x),T=ss(j,p,m);if(s){let I=0,M=0;a&&b<0?I=Sn(h+b+H,s[0][0]):!a&&b>0&&(I=En(h+A+H,s[1][0])),u&&D<0?M=Sn(w+D+L,s[0][1]):!u&&D>0&&(M=En(w+j+L,s[1][1])),E=Math.max(E,I),T=Math.max(T,M)}if(l){let I=0,M=0;a&&b>0?I=En(h+b,l[0][0]):!a&&b<0&&(I=Sn(h+A,l[1][0])),u&&D>0?M=En(w+D,l[0][1]):!u&&D<0&&(M=Sn(w+j,l[1][1])),E=Math.max(E,I),T=Math.max(T,M)}if(o){if(c){const I=ss(A/N,p,m)*N;if(E=Math.max(E,I),s){let M=0;!a&&!u||a&&!u&&f?M=En(w+L+A/N,s[1][1])*N:M=Sn(w+L+(a?b:-b)/N,s[0][1])*N,E=Math.max(E,M)}if(l){let M=0;!a&&!u||a&&!u&&f?M=Sn(w+A/N,l[1][1])*N:M=En(w+(a?b:-b)/N,l[0][1])*N,E=Math.max(E,M)}}if(d){const I=ss(j*N,v,x)/N;if(T=Math.max(T,I),s){let M=0;!a&&!u||u&&!a&&f?M=En(h+j*N+H,s[1][0])/N:M=Sn(h+(u?D:-D)*N+H,s[0][0])/N,T=Math.max(T,M)}if(l){let M=0;!a&&!u||u&&!a&&f?M=Sn(h+j*N,l[1][0])/N:M=En(h+(u?D:-D)*N,l[0][0])/N,T=Math.max(T,M)}}}D=D+(D<0?T:-T),b=b+(b<0?E:-E),o&&(f?A>j*N?D=(Nh(a,u)?-b:b)/N:b=(Nh(a,u)?-D:D)*N:c?(D=b/N,u=a):(b=D*N,a=u));const P=a?h+b:h,R=u?w+D:w;return{width:C+(a?-b:b),height:_+(u?-D:D),x:i[0]*b*(a?-1:1)+P,y:i[1]*D*(u?-1:1)+R}}const $0={width:0,height:0,x:0,y:0},bC={...$0,pointerX:0,pointerY:0,aspectRatio:1};function MC(e,t,n){const r=t.position.x+e.position.x,o=t.position.y+e.position.y,i=e.measured.width??0,s=e.measured.height??0,l=n[0]*i,a=n[1]*s;return[[r-l,o-a],[r+i-l,o+s-a]]}function IC({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:o}){const i=at(e);let s={controlDirection:_h("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function l({controlPosition:u,boundaries:c,keepAspectRatio:d,resizeDirection:f,onResizeStart:g,onResize:y,onResizeEnd:v,shouldResize:x}){let p={...$0},m={...bC};s={boundaries:c,resizeDirection:f,keepAspectRatio:d,controlDirection:_h(u)};let h,w=null,C=[],_,N,b,D=!1;const A=Xm().on("start",j=>{const{nodeLookup:H,transform:L,snapGrid:E,snapToGrid:T,nodeOrigin:P,paneDomNode:R}=n();if(h=H.get(t),!h)return;w=(R==null?void 0:R.getBoundingClientRect())??null;const{xSnapped:I,ySnapped:M}=Fo(j.sourceEvent,{transform:L,snapGrid:E,snapToGrid:T,containerBounds:w});p={width:h.measured.width??0,height:h.measured.height??0,x:h.position.x??0,y:h.position.y??0},m={...p,pointerX:I,pointerY:M,aspectRatio:p.width/p.height},_=void 0,N=hr(h.extent)?h.extent:void 0,h.parentId&&(h.extent==="parent"||h.expandParent)&&(_=H.get(h.parentId)),_&&h.extent==="parent"&&(N=[[0,0],[_.measured.width,_.measured.height]]),C=[],b=void 0;for(const[z,O]of H)if(O.parentId===t&&(C.push({id:z,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const $=MC(O,h,O.origin??P);b?b=[[Math.min($[0][0],b[0][0]),Math.min($[0][1],b[0][1])],[Math.max($[1][0],b[1][0]),Math.max($[1][1],b[1][1])]]:b=$}g==null||g(j,{...p})}).on("drag",j=>{const{transform:H,snapGrid:L,snapToGrid:E,nodeOrigin:T}=n(),P=Fo(j.sourceEvent,{transform:H,snapGrid:L,snapToGrid:E,containerBounds:w}),R=[];if(!h)return;const{x:I,y:M,width:z,height:O}=p,$={},U=h.origin??T,{width:W,height:Z,x:G,y:q}=NC(m,s.controlDirection,P,s.boundaries,s.keepAspectRatio,U,N,b),F=W!==z,V=Z!==O,X=G!==I&&F,J=q!==M&&V;if(!X&&!J&&!F&&!V)return;if((X||J||U[0]===1||U[1]===1)&&($.x=X?G:p.x,$.y=J?q:p.y,p.x=$.x,p.y=$.y,C.length>0)){const ne=G-I,re=q-M;for(const ce of C)ce.position={x:ce.position.x-ne+U[0]*(W-z),y:ce.position.y-re+U[1]*(Z-O)},R.push(ce)}if((F||V)&&($.width=F&&(!s.resizeDirection||s.resizeDirection==="horizontal")?W:p.width,$.height=V&&(!s.resizeDirection||s.resizeDirection==="vertical")?Z:p.height,p.width=$.width,p.height=$.height),_&&h.expandParent){const ne=U[0]*($.width??0);$.x&&$.x<ne&&(p.x=ne,m.x=m.x-($.x-ne));const re=U[1]*($.height??0);$.y&&$.y<re&&(p.y=re,m.y=m.y-($.y-re))}const Y=_C({width:p.width,prevWidth:z,height:p.height,prevHeight:O,affectsX:s.controlDirection.affectsX,affectsY:s.controlDirection.affectsY}),K={...p,direction:Y};(x==null?void 0:x(j,K))!==!1&&(D=!0,y==null||y(j,K),r($,R))}).on("end",j=>{D&&(v==null||v(j,{...p}),o==null||o({...p}),D=!1)});i.call(A)}function a(){i.on(".drag",null)}return{update:l,destroy:a}}var L0={exports:{}},O0={},F0={exports:{}},H0={};/**
41
41
  * @license React
42
42
  * use-sync-external-store-shim.production.js
43
43
  *
@@ -45,7 +45,7 @@ Error generating stack: `+i.message+`
45
45
  *
46
46
  * This source code is licensed under the MIT license found in the
47
47
  * LICENSE file in the root directory of this source tree.
48
- */var oo=k;function PC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var DC=typeof Object.is=="function"?Object.is:PC,TC=oo.useState,RC=oo.useEffect,zC=oo.useLayoutEffect,jC=oo.useDebugValue;function AC(e,t){var n=t(),r=TC({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return zC(function(){o.value=n,o.getSnapshot=t,Fa(o)&&i({inst:o})},[e,n,t]),RC(function(){return Fa(o)&&i({inst:o}),e(function(){Fa(o)&&i({inst:o})})},[e]),jC(n),n}function Fa(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!DC(e,n)}catch{return!0}}function $C(e,t){return t()}var LC=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?$C:AC;H0.useSyncExternalStore=oo.useSyncExternalStore!==void 0?oo.useSyncExternalStore:LC;F0.exports=H0;var OC=F0.exports;/**
48
+ */var oo=k;function PC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var DC=typeof Object.is=="function"?Object.is:PC,TC=oo.useState,RC=oo.useEffect,jC=oo.useLayoutEffect,zC=oo.useDebugValue;function AC(e,t){var n=t(),r=TC({inst:{value:n,getSnapshot:t}}),o=r[0].inst,i=r[1];return jC(function(){o.value=n,o.getSnapshot=t,Fa(o)&&i({inst:o})},[e,n,t]),RC(function(){return Fa(o)&&i({inst:o}),e(function(){Fa(o)&&i({inst:o})})},[e]),zC(n),n}function Fa(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!DC(e,n)}catch{return!0}}function $C(e,t){return t()}var LC=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?$C:AC;H0.useSyncExternalStore=oo.useSyncExternalStore!==void 0?oo.useSyncExternalStore:LC;F0.exports=H0;var OC=F0.exports;/**
49
49
  * @license React
50
50
  * use-sync-external-store-shim/with-selector.production.js
51
51
  *
@@ -53,17 +53,17 @@ Error generating stack: `+i.message+`
53
53
  *
54
54
  * This source code is licensed under the MIT license found in the
55
55
  * LICENSE file in the root directory of this source tree.
56
- */var Vl=k,FC=OC;function HC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var BC=typeof Object.is=="function"?Object.is:HC,VC=FC.useSyncExternalStore,UC=Vl.useRef,WC=Vl.useEffect,XC=Vl.useMemo,YC=Vl.useDebugValue;O0.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=UC(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=XC(function(){function a(g){if(!u){if(u=!0,c=g,g=r(g),o!==void 0&&s.hasValue){var y=s.value;if(o(y,g))return d=y}return d=g}if(y=d,BC(c,g))return y;var v=r(g);return o!==void 0&&o(y,v)?(c=g,y):(c=g,d=v)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return a(t())},f===null?void 0:function(){return a(f())}]},[t,n,r,o]);var l=VC(e,i[0],i[1]);return WC(function(){s.hasValue=!0,s.value=l},[l]),YC(l),l};L0.exports=O0;var QC=L0.exports;const KC=hp(QC),GC={},bh=e=>{let t;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const g=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(y=>y(t,g))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(GC?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,o,a);return a},ZC=e=>e?bh(e):bh,{useDebugValue:qC}=Se,{useSyncExternalStoreWithSelector:JC}=KC,e_=e=>e;function B0(e,t=e_,n){const r=JC(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return qC(r),r}const Mh=(e,t)=>{const n=ZC(e),r=(o,i=t)=>B0(n,o,i);return Object.assign(r,n),r},t_=(e,t)=>e?Mh(e,t):Mh;function ve(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Ul=k.createContext(null),n_=Ul.Provider,V0=Lt.error001("react");function se(e,t){const n=k.useContext(Ul);if(n===null)throw new Error(V0);return B0(n,e,t)}function he(){const e=k.useContext(Ul);if(e===null)throw new Error(V0);return k.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Ih={display:"none"},r_={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},U0="react-flow__node-desc",W0="react-flow__edge-desc",o_="react-flow__aria-live",i_=e=>e.ariaLiveMessage,s_=e=>e.ariaLabelConfig;function l_({rfId:e}){const t=se(i_);return S.jsx("div",{id:`${o_}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:r_,children:t})}function a_({rfId:e,disableKeyboardA11y:t}){const n=se(s_);return S.jsxs(S.Fragment,{children:[S.jsx("div",{id:`${U0}-${e}`,style:Ih,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),S.jsx("div",{id:`${W0}-${e}`,style:Ih,children:n["edge.a11yDescription.default"]}),!t&&S.jsx(l_,{rfId:e})]})}const Wl=k.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const s=`${e}`.split("-");return S.jsx("div",{className:ke(["react-flow__panel",n,...s]),style:r,ref:i,...o,children:t})});Wl.displayName="Panel";const Ph="https://reactflow.dev?utm_source=attribution";function u_({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:S.jsx(Wl,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Ph}`,children:S.jsx("a",{href:Ph,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const c_=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},ls=e=>e.id;function d_(e,t){return ve(e.selectedNodes.map(ls),t.selectedNodes.map(ls))&&ve(e.selectedEdges.map(ls),t.selectedEdges.map(ls))}function f_({onSelectionChange:e}){const t=he(),{selectedNodes:n,selectedEdges:r}=se(c_,d_);return k.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const h_=e=>!!e.onSelectionChangeHandlers;function p_({onSelectionChange:e}){const t=se(h_);return e||t?S.jsx(f_,{onSelectionChange:e}):null}const X0=[0,0],g_={x:0,y:0,zoom:1},m_=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Dh=[...m_,"rfId"],y_=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Th={translateExtent:di,nodeOrigin:X0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function v_(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:a}=se(y_,ve),u=he();k.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{c.current=Th,l()}),[]);const c=k.useRef(Th);return k.useEffect(()=>{for(const d of Dh){const f=e[d],g=c.current[d];f!==g&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?r(f):d==="maxZoom"?o(f):d==="translateExtent"?i(f):d==="nodeExtent"?s(f):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:Bk(f)}):d==="fitView"?u.setState({fitViewQueued:f}):d==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[d]:f})))}c.current=e},Dh.map(d=>e[d])),null}function Rh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function w_(e){var r;const[t,n]=k.useState(e==="system"?null:e);return k.useEffect(()=>{if(e!=="system"){n(e);return}const o=Rh(),i=()=>n(o!=null&&o.matches?"dark":"light");return i(),o==null||o.addEventListener("change",i),()=>{o==null||o.removeEventListener("change",i)}},[e]),t!==null?t:(r=Rh())!=null&&r.matches?"dark":"light"}const zh=typeof document<"u"?document:null;function gi(e=null,t={target:zh,actInsideInputWithModifier:!0}){const[n,r]=k.useState(!1),o=k.useRef(!1),i=k.useRef(new Set([])),[s,l]=k.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
56
+ */var Vl=k,FC=OC;function HC(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var BC=typeof Object.is=="function"?Object.is:HC,VC=FC.useSyncExternalStore,UC=Vl.useRef,WC=Vl.useEffect,XC=Vl.useMemo,YC=Vl.useDebugValue;O0.useSyncExternalStoreWithSelector=function(e,t,n,r,o){var i=UC(null);if(i.current===null){var s={hasValue:!1,value:null};i.current=s}else s=i.current;i=XC(function(){function a(g){if(!u){if(u=!0,c=g,g=r(g),o!==void 0&&s.hasValue){var y=s.value;if(o(y,g))return d=y}return d=g}if(y=d,BC(c,g))return y;var v=r(g);return o!==void 0&&o(y,v)?(c=g,y):(c=g,d=v)}var u=!1,c,d,f=n===void 0?null:n;return[function(){return a(t())},f===null?void 0:function(){return a(f())}]},[t,n,r,o]);var l=VC(e,i[0],i[1]);return WC(function(){s.hasValue=!0,s.value=l},[l]),YC(l),l};L0.exports=O0;var QC=L0.exports;const KC=hp(QC),GC={},bh=e=>{let t;const n=new Set,r=(c,d)=>{const f=typeof c=="function"?c(t):c;if(!Object.is(f,t)){const g=t;t=d??(typeof f!="object"||f===null)?f:Object.assign({},t,f),n.forEach(y=>y(t,g))}},o=()=>t,a={setState:r,getState:o,getInitialState:()=>u,subscribe:c=>(n.add(c),()=>n.delete(c)),destroy:()=>{(GC?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},u=t=e(r,o,a);return a},ZC=e=>e?bh(e):bh,{useDebugValue:qC}=Se,{useSyncExternalStoreWithSelector:JC}=KC,e_=e=>e;function B0(e,t=e_,n){const r=JC(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return qC(r),r}const Mh=(e,t)=>{const n=ZC(e),r=(o,i=t)=>B0(n,o,i);return Object.assign(r,n),r},t_=(e,t)=>e?Mh(e,t):Mh;function ve(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,o]of e)if(!Object.is(o,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const Ul=k.createContext(null),n_=Ul.Provider,V0=Lt.error001("react");function se(e,t){const n=k.useContext(Ul);if(n===null)throw new Error(V0);return B0(n,e,t)}function he(){const e=k.useContext(Ul);if(e===null)throw new Error(V0);return k.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const Ih={display:"none"},r_={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},U0="react-flow__node-desc",W0="react-flow__edge-desc",o_="react-flow__aria-live",i_=e=>e.ariaLiveMessage,s_=e=>e.ariaLabelConfig;function l_({rfId:e}){const t=se(i_);return S.jsx("div",{id:`${o_}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:r_,children:t})}function a_({rfId:e,disableKeyboardA11y:t}){const n=se(s_);return S.jsxs(S.Fragment,{children:[S.jsx("div",{id:`${U0}-${e}`,style:Ih,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),S.jsx("div",{id:`${W0}-${e}`,style:Ih,children:n["edge.a11yDescription.default"]}),!t&&S.jsx(l_,{rfId:e})]})}const Wl=k.forwardRef(({position:e="top-left",children:t,className:n,style:r,...o},i)=>{const s=`${e}`.split("-");return S.jsx("div",{className:ke(["react-flow__panel",n,...s]),style:r,ref:i,...o,children:t})});Wl.displayName="Panel";const Ph="https://reactflow.dev?utm_source=attribution";function u_({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:S.jsx(Wl,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${Ph}`,children:S.jsx("a",{href:Ph,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const c_=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},ls=e=>e.id;function d_(e,t){return ve(e.selectedNodes.map(ls),t.selectedNodes.map(ls))&&ve(e.selectedEdges.map(ls),t.selectedEdges.map(ls))}function f_({onSelectionChange:e}){const t=he(),{selectedNodes:n,selectedEdges:r}=se(c_,d_);return k.useEffect(()=>{const o={nodes:n,edges:r};e==null||e(o),t.getState().onSelectionChangeHandlers.forEach(i=>i(o))},[n,r,e]),null}const h_=e=>!!e.onSelectionChangeHandlers;function p_({onSelectionChange:e}){const t=se(h_);return e||t?S.jsx(f_,{onSelectionChange:e}):null}const X0=[0,0],g_={x:0,y:0,zoom:1},m_=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],Dh=[...m_,"rfId"],y_=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),Th={translateExtent:di,nodeOrigin:X0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function v_(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:o,setTranslateExtent:i,setNodeExtent:s,reset:l,setDefaultNodesAndEdges:a}=se(y_,ve),u=he();k.useEffect(()=>(a(e.defaultNodes,e.defaultEdges),()=>{c.current=Th,l()}),[]);const c=k.useRef(Th);return k.useEffect(()=>{for(const d of Dh){const f=e[d],g=c.current[d];f!==g&&(typeof e[d]>"u"||(d==="nodes"?t(f):d==="edges"?n(f):d==="minZoom"?r(f):d==="maxZoom"?o(f):d==="translateExtent"?i(f):d==="nodeExtent"?s(f):d==="ariaLabelConfig"?u.setState({ariaLabelConfig:Bk(f)}):d==="fitView"?u.setState({fitViewQueued:f}):d==="fitViewOptions"?u.setState({fitViewOptions:f}):u.setState({[d]:f})))}c.current=e},Dh.map(d=>e[d])),null}function Rh(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function w_(e){var r;const[t,n]=k.useState(e==="system"?null:e);return k.useEffect(()=>{if(e!=="system"){n(e);return}const o=Rh(),i=()=>n(o!=null&&o.matches?"dark":"light");return i(),o==null||o.addEventListener("change",i),()=>{o==null||o.removeEventListener("change",i)}},[e]),t!==null?t:(r=Rh())!=null&&r.matches?"dark":"light"}const jh=typeof document<"u"?document:null;function gi(e=null,t={target:jh,actInsideInputWithModifier:!0}){const[n,r]=k.useState(!1),o=k.useRef(!1),i=k.useRef(new Set([])),[s,l]=k.useMemo(()=>{if(e!==null){const u=(Array.isArray(e)?e:[e]).filter(d=>typeof d=="string").map(d=>d.replace("+",`
57
57
  `).replace(`
58
58
 
59
59
  `,`
60
60
  +`).split(`
61
- `)),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return k.useEffect(()=>{const a=(t==null?void 0:t.target)??zh,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const c=g=>{var x,p;if(o.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!o.current||o.current&&!u)&&S0(g))return!1;const v=Ah(g.code,l);if(i.current.add(g[v]),jh(s,i.current,!1)){const m=((p=(x=g.composedPath)==null?void 0:x.call(g))==null?void 0:p[0])||g.target,h=(m==null?void 0:m.nodeName)==="BUTTON"||(m==null?void 0:m.nodeName)==="A";t.preventDefault!==!1&&(o.current||!h)&&g.preventDefault(),r(!0)}},d=g=>{const y=Ah(g.code,l);jh(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(g[y]),g.key==="Meta"&&i.current.clear(),o.current=!1},f=()=>{i.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",c),a==null||a.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{a==null||a.removeEventListener("keydown",c),a==null||a.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function jh(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Ah(e,t){return t.includes(e)?"code":"key"}const x_=()=>{const e=he();return k.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:i,maxZoom:s,panZoom:l}=e.getState(),a=dd(t,r,o,i,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(a,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:l,y:a}=s.getBoundingClientRect(),u={x:t.x-l,y:t.y-a},c=n.snapGrid??o,d=n.snapToGrid??i;return Ii(u,r,d,c)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),s=no(t,n);return{x:s.x+o,y:s.y+i}}}),[])};function Y0(e,t){const n=[],r=new Map,o=[];for(const i of e)if(i.type==="add"){o.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const s=r.get(i.id);s?s.push(i):r.set(i.id,[i])}for(const i of t){const s=r.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const l={...i};for(const a of s)S_(a,l);n.push(l)}return o.length&&o.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function S_(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Q0(e,t){return Y0(e,t)}function E_(e,t){return Y0(e,t)}function Gn(e,t){return{id:e,type:"select",selected:t}}function zr(e,t=new Set,n=!1){const r=[];for(const[o,i]of e){const s=t.has(o);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),r.push(Gn(i.id,s)))}return r}function $h({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,s]of e.entries()){const l=t.get(s.id),a=((o=l==null?void 0:l.internals)==null?void 0:o.userNode)??l;a!==void 0&&a!==s&&n.push({id:s.id,item:s,type:"replace"}),a===void 0&&n.push({item:s,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function Lh(e){return{id:e.id,type:"remove"}}const k_=y0();function C_(e,t,n={}){return Qk(e,t,{...n,onError:n.onError??k_})}const Oh=e=>Rk(e),__=e=>f0(e);function K0(e){return k.forwardRef(e)}const G0=typeof window<"u"?k.useLayoutEffect:k.useEffect;function Fh(e){const[t,n]=k.useState(BigInt(0)),[r]=k.useState(()=>N_(()=>n(o=>o+BigInt(1))));return G0(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function N_(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Z0=k.createContext(null);function b_({children:e}){const t=he(),n=k.useCallback(l=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:c,onNodesChange:d,nodeLookup:f,fitViewQueued:g,onNodesChangeMiddlewareMap:y}=t.getState();let v=a;for(const p of l)v=typeof p=="function"?p(v):p;let x=$h({items:v,lookup:f});for(const p of y.values())x=p(x);c&&u(v),x.length>0?d==null||d(x):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:p,nodes:m,setNodes:h}=t.getState();p&&h(m)})},[]),r=Fh(n),o=k.useCallback(l=>{const{edges:a=[],setEdges:u,hasDefaultEdges:c,onEdgesChange:d,edgeLookup:f}=t.getState();let g=a;for(const y of l)g=typeof y=="function"?y(g):y;c?u(g):d&&d($h({items:g,lookup:f}))},[]),i=Fh(o),s=k.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return S.jsx(Z0.Provider,{value:s,children:e})}function M_(){const e=k.useContext(Z0);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const I_=e=>!!e.panZoom;function vd(){const e=x_(),t=he(),n=M_(),r=se(I_),o=k.useMemo(()=>{const i=d=>t.getState().nodeLookup.get(d),s=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},a=d=>{var p,m;const{nodeLookup:f,nodeOrigin:g}=t.getState(),y=Oh(d)?d:f.get(d.id),v=y.parentId?w0(y.position,y.measured,y.parentId,f,g):y.position,x={...y,position:v,width:((p=y.measured)==null?void 0:p.width)??y.width,height:((m=y.measured)==null?void 0:m.height)??y.height};return hi(x)},u=(d,f,g={replace:!1})=>{s(y=>y.map(v=>{if(v.id===d){const x=typeof f=="function"?f(v):f;return g.replace&&Oh(x)?x:{...v,...x}}return v}))},c=(d,f,g={replace:!1})=>{l(y=>y.map(v=>{if(v.id===d){const x=typeof f=="function"?f(v):f;return g.replace&&__(x)?x:{...v,...x}}return v}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=i(d))==null?void 0:f.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:s,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(g=>[...g,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(g=>[...g,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:g}=t.getState(),[y,v,x]=g;return{nodes:d.map(p=>({...p})),edges:f.map(p=>({...p})),viewport:{x:y,y:v,zoom:x}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:g,edges:y,onNodesDelete:v,onEdgesDelete:x,triggerNodeChanges:p,triggerEdgeChanges:m,onDelete:h,onBeforeDelete:w}=t.getState(),{nodes:C,edges:_}=await Lk({nodesToRemove:d,edgesToRemove:f,nodes:g,edges:y,onBeforeDelete:w}),N=_.length>0,b=C.length>0;if(N){const D=_.map(Lh);x==null||x(_),m(D)}if(b){const D=C.map(Lh);v==null||v(C),p(D)}return(b||N)&&(h==null||h({nodes:C,edges:_})),{deletedNodes:C,deletedEdges:_}},getIntersectingNodes:(d,f=!0,g)=>{const y=ph(d),v=y?d:a(d),x=g!==void 0;return v?(g||t.getState().nodes).filter(p=>{const m=t.getState().nodeLookup.get(p.id);if(m&&!y&&(p.id===d.id||!m.internals.positionAbsolute))return!1;const h=hi(x?p:m),w=dl(h,v);return f&&w>0||w>=h.width*h.height||w>=v.width*v.height}):[]},isNodeIntersecting:(d,f,g=!0)=>{const v=ph(d)?d:a(d);if(!v)return!1;const x=dl(v,f);return g&&x>0||x>=f.width*f.height||x>=v.width*v.height},updateNode:u,updateNodeData:(d,f,g={replace:!1})=>{u(d,y=>{const v=typeof f=="function"?f(y):f;return g.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},g)},updateEdge:c,updateEdgeData:(d,f,g={replace:!1})=>{c(d,y=>{const v=typeof f=="function"?f(y):f;return g.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},g)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:g}=t.getState();return zk(d,{nodeLookup:f,nodeOrigin:g})},getHandleConnections:({type:d,id:f,nodeId:g})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${g}-${d}${f?`-${f}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:g})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${g}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:y.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??Hk();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(g=>[...g]),f.promise}}},[]);return k.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const Hh=e=>e.selected,P_=typeof window<"u"?window:void 0;function D_({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=he(),{deleteElements:r}=vd(),o=gi(e,{actInsideInputWithModifier:!1}),i=gi(t,{target:P_});k.useEffect(()=>{if(o){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(Hh),edges:s.filter(Hh)}),n.setState({nodesSelectionActive:!1})}},[o]),k.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function T_(e){const t=he();k.useEffect(()=>{const n=()=>{var o,i,s,l;if(!e.current||!(((i=(o=e.current).checkVisibility)==null?void 0:i.call(o))??!0))return!1;const r=fd(e.current);(r.height===0||r.width===0)&&((l=(s=t.getState()).onError)==null||l.call(s,"004",Lt.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Xl={position:"absolute",width:"100%",height:"100%",top:0,left:0},R_=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function z_({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:i=or.Free,zoomOnDoubleClick:s=!0,panOnDrag:l=!0,defaultViewport:a,translateExtent:u,minZoom:c,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:g=!0,children:y,noWheelClassName:v,noPanClassName:x,onViewportChange:p,isControlledViewport:m,paneClickDistance:h,selectionOnDrag:w}){const C=he(),_=k.useRef(null),{userSelectionActive:N,lib:b,connectionInProgress:D}=se(R_,ve),A=gi(f),z=k.useRef();T_(_);const H=k.useCallback(L=>{p==null||p({x:L[0],y:L[1],zoom:L[2]}),m||C.setState({transform:L})},[p,m]);return k.useEffect(()=>{if(_.current){z.current=CC({domNode:_.current,minZoom:c,maxZoom:d,translateExtent:u,viewport:a,onDraggingChange:P=>C.setState(R=>R.paneDragging===P?R:{paneDragging:P}),onPanZoomStart:(P,R)=>{const{onViewportChangeStart:I,onMoveStart:M}=C.getState();M==null||M(P,R),I==null||I(R)},onPanZoom:(P,R)=>{const{onViewportChange:I,onMove:M}=C.getState();M==null||M(P,R),I==null||I(R)},onPanZoomEnd:(P,R)=>{const{onViewportChangeEnd:I,onMoveEnd:M}=C.getState();M==null||M(P,R),I==null||I(R)}});const{x:L,y:E,zoom:T}=z.current.getViewport();return C.setState({panZoom:z.current,transform:[L,E,T],domNode:_.current.closest(".react-flow")}),()=>{var P;(P=z.current)==null||P.destroy()}}},[]),k.useEffect(()=>{var L;(L=z.current)==null||L.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:l,zoomActivationKeyPressed:A,preventScrolling:g,noPanClassName:x,userSelectionActive:N,noWheelClassName:v,lib:b,onTransformChange:H,connectionInProgress:D,selectionOnDrag:w,paneClickDistance:h})},[e,t,n,r,o,i,s,l,A,g,x,N,v,b,H,D,w,h]),S.jsx("div",{className:"react-flow__renderer",ref:_,style:Xl,children:y})}const j_=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function A_(){const{userSelectionActive:e,userSelectionRect:t}=se(j_,ve);return e&&t?S.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Ha=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},$_=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function L_({isSelecting:e,selectionKeyPressed:t,selectionMode:n=fi.Full,panOnDrag:r,autoPanOnSelection:o,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:l,onSelectionEnd:a,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:g,onPaneMouseLeave:y,children:v}){const x=k.useRef(0),p=he(),{userSelectionActive:m,elementsSelectable:h,dragging:w,panBy:C,autoPanSpeed:_}=se($_,ve),N=h&&(e||m),b=k.useRef(null),D=k.useRef(),A=k.useRef(new Set),z=k.useRef(new Set),H=k.useRef(!1),L=k.useRef(!1),E=k.useRef({x:0,y:0}),T=k.useRef(!1),P=F=>{if(L.current||H.current||p.getState().connection.inProgress){L.current=!1,H.current=!1;return}u==null||u(F),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},R=F=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){F.preventDefault();return}c==null||c(F)},I=d?F=>d(F):void 0,M=F=>{L.current&&(F.stopPropagation(),L.current=!1)},j=F=>{var ce,He;const{domNode:V,transform:X}=p.getState();if(D.current=V==null?void 0:V.getBoundingClientRect(),!D.current)return;const J=F.target===b.current;if(!J&&!!F.target.closest(".nokey")||!e||!(s&&J||t)||F.button!==0||!F.isPrimary)return;(He=(ce=F.target)==null?void 0:ce.setPointerCapture)==null||He.call(ce,F.pointerId),L.current=!1;const{x:te,y:ne}=zt(F.nativeEvent,D.current),re=Ii({x:te,y:ne},X);p.setState({userSelectionRect:{width:0,height:0,startX:re.x,startY:re.y,x:te,y:ne}}),J||(F.stopPropagation(),F.preventDefault())};function O(F,V){const{userSelectionRect:X}=p.getState();if(!X)return;const{transform:J,nodeLookup:Y,edgeLookup:K,connectionLookup:te,triggerNodeChanges:ne,triggerEdgeChanges:re,defaultEdgeOptions:ce}=p.getState(),He={x:X.startX,y:X.startY},{x:Ke,y:Ce}=no(He,J),Ge={startX:He.x,startY:He.y,x:F<Ke?F:Ke,y:V<Ce?V:Ce,width:Math.abs(F-Ke),height:Math.abs(V-Ce)},Ht=A.current,Bt=z.current;A.current=new Set(ud(Y,Ge,J,n===fi.Partial,!0).map(st=>st.id)),z.current=new Set;const Vt=(ce==null?void 0:ce.selectable)??!0;for(const st of A.current){const Ct=te.get(st);if(Ct)for(const{edgeId:Ae}of Ct.values()){const Ze=K.get(Ae);Ze&&(Ze.selectable??Vt)&&z.current.add(Ae)}}if(!gh(Ht,A.current)){const st=zr(Y,A.current,!0);ne(st)}if(!gh(Bt,z.current)){const st=zr(K,z.current);re(st)}p.setState({userSelectionRect:Ge,userSelectionActive:!0,nodesSelectionActive:!1})}function $(){if(!o||!D.current)return;const[F,V]=cd(E.current,D.current,_);C({x:F,y:V}).then(X=>{if(!L.current||!X){x.current=requestAnimationFrame($);return}const{x:J,y:Y}=E.current;O(J,Y),x.current=requestAnimationFrame($)})}const U=()=>{cancelAnimationFrame(x.current),x.current=0,T.current=!1};k.useEffect(()=>()=>U(),[]);const W=F=>{const{userSelectionRect:V,transform:X,resetSelectedElements:J}=p.getState();if(!D.current||!V)return;const{x:Y,y:K}=zt(F.nativeEvent,D.current);E.current={x:Y,y:K};const te=no({x:V.startX,y:V.startY},X);if(!L.current){const ne=t?0:i;if(Math.hypot(Y-te.x,K-te.y)<=ne)return;J(),l==null||l(F)}L.current=!0,T.current||($(),T.current=!0),O(Y,K)},Z=F=>{var V,X;if(!N){F.target===b.current&&p.getState().connection.inProgress&&(H.current=!0);return}F.button===0&&((X=(V=F.target)==null?void 0:V.releasePointerCapture)==null||X.call(V,F.pointerId),!m&&F.target===b.current&&p.getState().userSelectionRect&&(P==null||P(F)),p.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(a==null||a(F),p.setState({nodesSelectionActive:A.current.size>0})),U())},G=F=>{var V,X;(X=(V=F.target)==null?void 0:V.releasePointerCapture)==null||X.call(V,F.pointerId),U()},q=r===!0||Array.isArray(r)&&r.includes(0);return S.jsxs("div",{className:ke(["react-flow__pane",{draggable:q,dragging:w,selection:e}]),onClick:N?void 0:Ha(P,b),onContextMenu:Ha(R,b),onWheel:Ha(I,b),onPointerEnter:N?void 0:f,onPointerMove:N?W:g,onPointerUp:Z,onPointerCancel:N?G:void 0,onPointerDownCapture:N?j:void 0,onClickCapture:N?M:void 0,onPointerLeave:y,ref:b,style:Xl,children:[v,S.jsx(A_,{})]})}function ec({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:l,onError:a}=t.getState(),u=l.get(e);if(!u){a==null||a("012",Lt.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):o([e])}function q0({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:s}){const l=he(),[a,u]=k.useState(!1),c=k.useRef();return k.useEffect(()=>{if(!t)return c.current=cC({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{ec({id:d,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}}),()=>{var d;(d=c.current)==null||d.destroy(),c.current=void 0}},[t,l,e]),k.useEffect(()=>{t||!e.current||!c.current||c.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:s})},[n,r,t,i,e,o,s]),a}const O_=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function J0(){const e=he();return k.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:s,onError:l,updateNodePositions:a,nodeLookup:u,nodeOrigin:c}=e.getState(),d=new Map,f=O_(s),g=o?i[0]:5,y=o?i[1]:5,v=n.direction.x*g*n.factor,x=n.direction.y*y*n.factor;for(const[,p]of u){if(!f(p))continue;let m={x:p.internals.positionAbsolute.x+v,y:p.internals.positionAbsolute.y+x};o&&(m=Mi(m,i));const{position:h,positionAbsolute:w}=h0({nodeId:p.id,nextPosition:m,nodeLookup:u,nodeExtent:r,nodeOrigin:c,onError:l});p.position=h,p.internals.positionAbsolute=w,d.set(p.id,p)}a(d)},[])}const wd=k.createContext(null),F_=wd.Provider;wd.Consumer;const ey=()=>k.useContext(wd),H_=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),ty=k.createContext(null);function B_({children:e}){const t=se(H_,ve);return S.jsx(ty.Provider,{value:t,children:e})}function V_(){const e=k.useContext(ty);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const U_={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},W_=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:s}=r,{fromHandle:l,toHandle:a,isValid:u}=s;if(!l&&!o)return U_;const c=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:c,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:i===eo.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!o,valid:c&&u}};function X_({type:e="source",position:t=ee.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:a,className:u,onMouseDown:c,onTouchStart:d,...f},g){var T,P;const y=s||null,v=e==="target",x=he(),p=ey(),{connectOnClick:m,noPanClassName:h,rfId:w}=V_(),{connectingFrom:C,connectingTo:_,clickConnecting:N,isPossibleEndHandle:b,connectionInProcess:D,clickConnectionInProcess:A,valid:z}=se(W_(p,y,e),ve);p||(P=(T=x.getState()).onError)==null||P.call(T,"010",Lt.error010());const H=R=>{const{defaultEdgeOptions:I,onConnect:M,hasDefaultEdges:j}=x.getState(),O={...I,...R};if(j){const{edges:$,setEdges:U,onError:W}=x.getState();U(C_(O,$,{onError:W}))}M==null||M(O),l==null||l(O)},L=R=>{if(!p)return;const I=E0(R.nativeEvent);if(o&&(I&&R.button===0||!I)){const M=x.getState();Ju.onPointerDown(R.nativeEvent,{handleDomNode:R.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:v,handleId:y,nodeId:p,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:(...j)=>{var O,$;return($=(O=x.getState()).onConnectEnd)==null?void 0:$.call(O,...j)},updateConnection:M.updateConnection,onConnect:H,isValidConnection:n||((...j)=>{var O,$;return(($=(O=x.getState()).isValidConnection)==null?void 0:$.call(O,...j))??!0}),getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}I?c==null||c(R):d==null||d(R)},E=R=>{const{onClickConnectStart:I,onClickConnectEnd:M,connectionClickStartHandle:j,connectionMode:O,isValidConnection:$,lib:U,rfId:W,nodeLookup:Z,connection:G}=x.getState();if(!p||!j&&!o)return;if(!j){I==null||I(R.nativeEvent,{nodeId:p,handleId:y,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:p,type:e,id:y}});return}const q=x0(R.target),F=n||$,{connection:V,isValid:X}=Ju.isValid(R.nativeEvent,{handle:{nodeId:p,id:y,type:e},connectionMode:O,fromNodeId:j.nodeId,fromHandleId:j.id||null,fromType:j.type,isValidConnection:F,flowId:W,doc:q,lib:U,nodeLookup:Z});X&&V&&H(V);const J=structuredClone(G);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,M==null||M(R,J),x.setState({connectionClickStartHandle:null})};return S.jsx("div",{"data-handleid":y,"data-nodeid":p,"data-handlepos":t,"data-id":`${w}-${p}-${y}-${e}`,className:ke(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",h,u,{source:!v,target:v,connectable:r,connectablestart:o,connectableend:i,clickconnecting:N,connectingfrom:C,connectingto:_,valid:z,connectionindicator:r&&(!D||b)&&(D||A?i:o)}]),onMouseDown:L,onTouchStart:L,onClick:m?E:void 0,ref:g,...f,children:a})}const fl=k.memo(K0(X_));function Y_({data:e,isConnectable:t,sourcePosition:n=ee.Bottom}){return S.jsxs(S.Fragment,{children:[e==null?void 0:e.label,S.jsx(fl,{type:"source",position:n,isConnectable:t})]})}function Q_({data:e,isConnectable:t,targetPosition:n=ee.Top,sourcePosition:r=ee.Bottom}){return S.jsxs(S.Fragment,{children:[S.jsx(fl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,S.jsx(fl,{type:"source",position:r,isConnectable:t})]})}function K_(){return null}function G_({data:e,isConnectable:t,targetPosition:n=ee.Top}){return S.jsxs(S.Fragment,{children:[S.jsx(fl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const hl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Bh={input:Y_,default:Q_,output:G_,group:K_};function Z_(e){var t,n,r,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const q_=e=>{const{width:t,height:n,x:r,y:o}=bi(e.nodeLookup,{filter:i=>!!i.selected});return{width:Rt(t)?t:null,height:Rt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function J_({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=he(),{width:o,height:i,transformString:s,userSelectionActive:l}=se(q_,ve),a=J0(),u=k.useRef(null);k.useEffect(()=>{var g;n||(g=u.current)==null||g.focus({preventScroll:!0})},[n]);const c=!l&&o!==null&&i!==null;if(q0({nodeRef:u,disabled:!c}),!c)return null;const d=e?g=>{const y=r.getState().nodes.filter(v=>v.selected);e(g,y)}:void 0,f=g=>{Object.prototype.hasOwnProperty.call(hl,g.key)&&(g.preventDefault(),a({direction:hl[g.key],factor:g.shiftKey?4:1}))};return S.jsx("div",{className:ke(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:S.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:o,height:i}})})}const Vh=typeof window<"u"?window:void 0,eN=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function ny({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:c,selectionMode:d,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:y,panActivationKeyCode:v,zoomActivationKeyCode:x,elementsSelectable:p,zoomOnScroll:m,zoomOnPinch:h,panOnScroll:w,panOnScrollSpeed:C,panOnScrollMode:_,zoomOnDoubleClick:N,panOnDrag:b,autoPanOnSelection:D,defaultViewport:A,translateExtent:z,minZoom:H,maxZoom:L,preventScrolling:E,onSelectionContextMenu:T,noWheelClassName:P,noPanClassName:R,disableKeyboardA11y:I,onViewportChange:M,isControlledViewport:j}){const{nodesSelectionActive:O,userSelectionActive:$}=se(eN,ve),U=gi(u,{target:Vh}),W=gi(v,{target:Vh}),Z=W||b,G=W||w,q=c&&Z!==!0,F=U||$||q;return D_({deleteKeyCode:a,multiSelectionKeyCode:y}),S.jsx(z_,{onPaneContextMenu:i,elementsSelectable:p,zoomOnScroll:m,zoomOnPinch:h,panOnScroll:G,panOnScrollSpeed:C,panOnScrollMode:_,zoomOnDoubleClick:N,panOnDrag:!U&&Z,defaultViewport:A,translateExtent:z,minZoom:H,maxZoom:L,zoomActivationKeyCode:x,preventScrolling:E,noWheelClassName:P,noPanClassName:R,onViewportChange:M,isControlledViewport:j,paneClickDistance:l,selectionOnDrag:q,children:S.jsxs(L_,{onSelectionStart:f,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:Z,autoPanOnSelection:D,isSelecting:!!F,selectionMode:d,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:q,children:[e,O&&S.jsx(J_,{onSelectionContextMenu:T,noPanClassName:R,disableKeyboardA11y:I})]})})}ny.displayName="FlowRenderer";const tN=k.memo(ny),nN=e=>t=>e?ud(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function rN(e){return se(k.useCallback(nN(e),[e]),ve)}const oN=e=>e.updateNodeInternals;function iN(){const e=se(oN),[t]=k.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const i=o.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:o.target,force:!0})}),e(r)}));return k.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function sN({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=he(),i=k.useRef(null),s=k.useRef(null),l=k.useRef(e.sourcePosition),a=k.useRef(e.targetPosition),u=k.useRef(t),c=n&&!!e.internals.handleBounds;return k.useEffect(()=>{i.current&&!e.hidden&&(!c||s.current!==i.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(i.current),s.current=i.current)},[c,e.hidden]),k.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),k.useEffect(()=>{if(i.current){const d=u.current!==t,f=l.current!==e.sourcePosition,g=a.current!==e.targetPosition;(d||f||g)&&(u.current=t,l.current=e.sourcePosition,a.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function lN({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:s,nodesDraggable:l,elementsSelectable:a,nodesConnectable:u,nodesFocusable:c,resizeObserver:d,noDragClassName:f,noPanClassName:g,disableKeyboardA11y:y,rfId:v,nodeTypes:x,nodeClickDistance:p,onError:m}){const{node:h,internals:w,isParent:C}=se(F=>{const V=F.nodeLookup.get(e),X=F.parentLookup.has(e);return{node:V,internals:V.internals,isParent:X}},ve);let _=h.type||"default",N=(x==null?void 0:x[_])||Bh[_];N===void 0&&(m==null||m("003",Lt.error003(_)),_="default",N=(x==null?void 0:x.default)||Bh.default);const b=!!(h.draggable||l&&typeof h.draggable>"u"),D=!!(h.selectable||a&&typeof h.selectable>"u"),A=!!(h.connectable||u&&typeof h.connectable>"u"),z=!!(h.focusable||c&&typeof h.focusable>"u"),H=he(),L=v0(h),E=sN({node:h,nodeType:_,hasDimensions:L,resizeObserver:d}),T=q0({nodeRef:E,disabled:h.hidden||!b,noDragClassName:f,handleSelector:h.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:p}),P=J0();if(h.hidden)return null;const R=rn(h),I=Z_(h),M=D||b||t||n||r||o,j=n?F=>n(F,{...w.userNode}):void 0,O=r?F=>r(F,{...w.userNode}):void 0,$=o?F=>o(F,{...w.userNode}):void 0,U=i?F=>i(F,{...w.userNode}):void 0,W=s?F=>s(F,{...w.userNode}):void 0,Z=F=>{const{selectNodesOnDrag:V,nodeDragThreshold:X}=H.getState();D&&(!V||!b||X>0)&&ec({id:e,store:H,nodeRef:E}),t&&t(F,{...w.userNode})},G=F=>{if(!(S0(F.nativeEvent)||y)){if(a0.includes(F.key)&&D){const V=F.key==="Escape";ec({id:e,store:H,unselect:V,nodeRef:E})}else if(b&&h.selected&&Object.prototype.hasOwnProperty.call(hl,F.key)){F.preventDefault();const{ariaLabelConfig:V}=H.getState();H.setState({ariaLiveMessage:V["node.a11yDescription.ariaLiveMessage"]({direction:F.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),P({direction:hl[F.key],factor:F.shiftKey?4:1})}}},q=()=>{var te;if(y||!((te=E.current)!=null&&te.matches(":focus-visible")))return;const{transform:F,width:V,height:X,autoPanOnNodeFocus:J,setCenter:Y}=H.getState();if(!J)return;ud(new Map([[e,h]]),{x:0,y:0,width:V,height:X},F,!0).length>0||Y(h.position.x+R.width/2,h.position.y+R.height/2,{zoom:F[2]})};return S.jsx("div",{className:ke(["react-flow__node",`react-flow__node-${_}`,{[g]:b},h.className,{selected:h.selected,selectable:D,parent:C,draggable:b,dragging:T}]),ref:E,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:L?"visible":"hidden",...h.style,...I},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:j,onMouseMove:O,onMouseLeave:$,onContextMenu:U,onClick:Z,onDoubleClick:W,onKeyDown:z?G:void 0,tabIndex:z?0:void 0,onFocus:z?q:void 0,role:h.ariaRole??(z?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${U0}-${v}`,"aria-label":h.ariaLabel,...h.domAttributes,children:S.jsx(F_,{value:e,children:S.jsx(N,{id:e,data:h.data,type:_,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:h.selected??!1,selectable:D,draggable:b,deletable:h.deletable??!0,isConnectable:A,sourcePosition:h.sourcePosition,targetPosition:h.targetPosition,dragging:T,dragHandle:h.dragHandle,zIndex:w.z,parentId:h.parentId,...R})})})}var aN=k.memo(lN);const uN=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function ry(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:o}=se(uN,ve),i=rN(e.onlyRenderVisibleElements),s=iN();return S.jsx("div",{className:"react-flow__nodes",style:Xl,children:i.map(l=>S.jsx(aN,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:o},l))})}ry.displayName="NodeRenderer";const cN=k.memo(ry);function dN(e){return se(k.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const i=n.nodeLookup.get(o.source),s=n.nodeLookup.get(o.target);i&&s&&Wk({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),ve)}const fN=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return S.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},hN=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return S.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Uh={[ul.Arrow]:fN,[ul.ArrowClosed]:hN};function pN(e){const t=he();return k.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(Uh,e)?Uh[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Lt.error009(e)),null)},[e])}const gN=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const a=pN(t);return a?S.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:S.jsx(a,{color:n,strokeWidth:s})}):null},oy=({defaultColor:e,rfId:t})=>{const n=se(i=>i.edges),r=se(i=>i.defaultEdgeOptions),o=k.useMemo(()=>Jk(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?S.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:S.jsx("defs",{children:o.map(i=>S.jsx(gN,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};oy.displayName="MarkerDefinitions";var mN=k.memo(oy);function iy({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:a,className:u,...c}){const[d,f]=k.useState({x:1,y:0,width:0,height:0}),g=ke(["react-flow__edge-textwrapper",u]),y=k.useRef(null);return k.useEffect(()=>{if(y.current){const v=y.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?S.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:g,visibility:d.width?"visible":"hidden",...c,children:[o&&S.jsx("rect",{width:d.width+2*s[0],x:-s[0],y:-s[1],height:d.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),S.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:y,style:r,children:n}),a]}):null}iy.displayName="EdgeText";const yN=k.memo(iy);function Yl({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:u=20,...c}){return S.jsxs(S.Fragment,{children:[S.jsx("path",{...c,d:e,fill:"none",className:ke(["react-flow__edge-path",c.className])}),u?S.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Rt(t)&&Rt(n)?S.jsx(yN,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function Wh({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===ee.Left||e===ee.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function sy({sourceX:e,sourceY:t,sourcePosition:n=ee.Bottom,targetX:r,targetY:o,targetPosition:i=ee.Top}){const[s,l]=Wh({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,u]=Wh({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,d,f,g]=k0({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:a,targetControlY:u});return[`M${e},${t} C${s},${l} ${a},${u} ${r},${o}`,c,d,f,g]}function ly(e){return k.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s,targetPosition:l,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:x,interactionWidth:p})=>{const[m,h,w]=sy({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l}),C=e.isInternal?void 0:t;return S.jsx(Yl,{id:C,path:m,labelX:h,labelY:w,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:x,interactionWidth:p})})}const vN=ly({isInternal:!1}),ay=ly({isInternal:!0});vN.displayName="SimpleBezierEdge";ay.displayName="SimpleBezierEdgeInternal";function uy(e){return k.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,sourcePosition:g=ee.Bottom,targetPosition:y=ee.Top,markerEnd:v,markerStart:x,pathOptions:p,interactionWidth:m})=>{const[h,w,C]=Gu({sourceX:n,sourceY:r,sourcePosition:g,targetX:o,targetY:i,targetPosition:y,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset,stepPosition:p==null?void 0:p.stepPosition}),_=e.isInternal?void 0:t;return S.jsx(Yl,{id:_,path:h,labelX:w,labelY:C,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:v,markerStart:x,interactionWidth:m})})}const cy=uy({isInternal:!1}),dy=uy({isInternal:!0});cy.displayName="SmoothStepEdge";dy.displayName="SmoothStepEdgeInternal";function fy(e){return k.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return S.jsx(cy,{...n,id:r,pathOptions:k.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const wN=fy({isInternal:!1}),hy=fy({isInternal:!0});wN.displayName="StepEdge";hy.displayName="StepEdgeInternal";function py(e){return k.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:y,interactionWidth:v})=>{const[x,p,m]=N0({sourceX:n,sourceY:r,targetX:o,targetY:i}),h=e.isInternal?void 0:t;return S.jsx(Yl,{id:h,path:x,labelX:p,labelY:m,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:y,interactionWidth:v})})}const xN=py({isInternal:!1}),gy=py({isInternal:!0});xN.displayName="StraightEdge";gy.displayName="StraightEdgeInternal";function my(e){return k.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s=ee.Bottom,targetPosition:l=ee.Top,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:x,pathOptions:p,interactionWidth:m})=>{const[h,w,C]=C0({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l,curvature:p==null?void 0:p.curvature}),_=e.isInternal?void 0:t;return S.jsx(Yl,{id:_,path:h,labelX:w,labelY:C,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:x,interactionWidth:m})})}const SN=my({isInternal:!1}),yy=my({isInternal:!0});SN.displayName="BezierEdge";yy.displayName="BezierEdgeInternal";const Xh={default:yy,straight:gy,step:hy,smoothstep:dy,simplebezier:ay},Yh={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},EN=(e,t,n)=>n===ee.Left?e-t:n===ee.Right?e+t:e,kN=(e,t,n)=>n===ee.Top?e-t:n===ee.Bottom?e+t:e,Qh="react-flow__edgeupdater";function Kh({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:l}){return S.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:ke([Qh,`${Qh}-${l}`]),cx:EN(t,r,e),cy:kN(n,r,e),r,stroke:"transparent",fill:"transparent"})}function CN({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:s,sourcePosition:l,targetPosition:a,onReconnect:u,onReconnectStart:c,onReconnectEnd:d,setReconnecting:f,setUpdateHover:g}){const y=he(),v=(w,C)=>{if(w.button!==0)return;const{autoPanOnConnect:_,domNode:N,connectionMode:b,connectionRadius:D,lib:A,onConnectStart:z,cancelConnection:H,nodeLookup:L,rfId:E,panBy:T,updateConnection:P}=y.getState(),R=C.type==="target",I=(O,$)=>{f(!1),d==null||d(O,n,C.type,$)},M=O=>u==null?void 0:u(n,O),j=(O,$)=>{f(!0),c==null||c(w,n,C.type),z==null||z(O,$)};Ju.onPointerDown(w.nativeEvent,{autoPanOnConnect:_,connectionMode:b,connectionRadius:D,domNode:N,handleId:C.id,nodeId:C.nodeId,nodeLookup:L,isTarget:R,edgeUpdaterType:C.type,lib:A,flowId:E,cancelConnection:H,panBy:T,isValidConnection:(...O)=>{var $,U;return((U=($=y.getState()).isValidConnection)==null?void 0:U.call($,...O))??!0},onConnect:M,onConnectStart:j,onConnectEnd:(...O)=>{var $,U;return(U=($=y.getState()).onConnectEnd)==null?void 0:U.call($,...O)},onReconnectEnd:I,updateConnection:P,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},x=w=>v(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),p=w=>v(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),m=()=>g(!0),h=()=>g(!1);return S.jsxs(S.Fragment,{children:[(e===!0||e==="source")&&S.jsx(Kh,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:x,onMouseEnter:m,onMouseOut:h,type:"source"}),(e===!0||e==="target")&&S.jsx(Kh,{position:a,centerX:i,centerY:s,radius:t,onMouseDown:p,onMouseEnter:m,onMouseOut:h,type:"target"})]})}function _N({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:g,rfId:y,edgeTypes:v,noPanClassName:x,onError:p,disableKeyboardA11y:m}){let h=se(Y=>Y.edgeLookup.get(e));const w=se(Y=>Y.defaultEdgeOptions);h=w?{...w,...h}:h;let C=h.type||"default",_=(v==null?void 0:v[C])||Xh[C];_===void 0&&(p==null||p("011",Lt.error011(C)),C="default",_=(v==null?void 0:v.default)||Xh.default);const N=!!(h.focusable||t&&typeof h.focusable>"u"),b=typeof d<"u"&&(h.reconnectable||n&&typeof h.reconnectable>"u"),D=!!(h.selectable||r&&typeof h.selectable>"u"),A=k.useRef(null),[z,H]=k.useState(!1),[L,E]=k.useState(!1),T=he(),{zIndex:P=h.zIndex,sourceX:R,sourceY:I,targetX:M,targetY:j,sourcePosition:O,targetPosition:$}=se(k.useCallback(Y=>{const K=Y.nodeLookup.get(h.source),te=Y.nodeLookup.get(h.target);if(!K||!te)return Yh;const ne=qk({id:e,sourceNode:K,targetNode:te,sourceHandle:h.sourceHandle||null,targetHandle:h.targetHandle||null,connectionMode:Y.connectionMode,onError:p}),re=Uk({selected:h.selected,zIndex:h.zIndex,sourceNode:K,targetNode:te,elevateOnSelect:Y.elevateEdgesOnSelect,zIndexMode:Y.zIndexMode});return{...ne||Yh,zIndex:re}},[h.source,h.target,h.sourceHandle,h.targetHandle,h.selected,h.zIndex]),ve),U=k.useMemo(()=>h.markerStart?`url('#${Zu(h.markerStart,y)}')`:void 0,[h.markerStart,y]),W=k.useMemo(()=>h.markerEnd?`url('#${Zu(h.markerEnd,y)}')`:void 0,[h.markerEnd,y]);if(h.hidden||R===null||I===null||M===null||j===null)return null;const Z=Y=>{var re;const{addSelectedEdges:K,unselectNodesAndEdges:te,multiSelectionActive:ne}=T.getState();D&&(T.setState({nodesSelectionActive:!1}),h.selected&&ne?(te({nodes:[],edges:[h]}),(re=A.current)==null||re.blur()):K([e])),o&&o(Y,h)},G=i?Y=>{i(Y,{...h})}:void 0,q=s?Y=>{s(Y,{...h})}:void 0,F=l?Y=>{l(Y,{...h})}:void 0,V=a?Y=>{a(Y,{...h})}:void 0,X=u?Y=>{u(Y,{...h})}:void 0,J=Y=>{var K;if(!m&&a0.includes(Y.key)&&D){const{unselectNodesAndEdges:te,addSelectedEdges:ne}=T.getState();Y.key==="Escape"?((K=A.current)==null||K.blur(),te({edges:[h]})):ne([e])}};return S.jsx("svg",{style:{zIndex:P},children:S.jsxs("g",{className:ke(["react-flow__edge",`react-flow__edge-${C}`,h.className,x,{selected:h.selected,animated:h.animated,inactive:!D&&!o,updating:z,selectable:D}]),onClick:Z,onDoubleClick:G,onContextMenu:q,onMouseEnter:F,onMouseMove:V,onMouseLeave:X,onKeyDown:N?J:void 0,tabIndex:N?0:void 0,role:h.ariaRole??(N?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":h.ariaLabel===null?void 0:h.ariaLabel||`Edge from ${h.source} to ${h.target}`,"aria-describedby":N?`${W0}-${y}`:void 0,ref:A,...h.domAttributes,children:[!L&&S.jsx(_,{id:e,source:h.source,target:h.target,type:h.type,selected:h.selected,animated:h.animated,selectable:D,deletable:h.deletable??!0,label:h.label,labelStyle:h.labelStyle,labelShowBg:h.labelShowBg,labelBgStyle:h.labelBgStyle,labelBgPadding:h.labelBgPadding,labelBgBorderRadius:h.labelBgBorderRadius,sourceX:R,sourceY:I,targetX:M,targetY:j,sourcePosition:O,targetPosition:$,data:h.data,style:h.style,sourceHandleId:h.sourceHandle,targetHandleId:h.targetHandle,markerStart:U,markerEnd:W,pathOptions:"pathOptions"in h?h.pathOptions:void 0,interactionWidth:h.interactionWidth}),b&&S.jsx(CN,{edge:h,isReconnectable:b,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:g,sourceX:R,sourceY:I,targetX:M,targetY:j,sourcePosition:O,targetPosition:$,setUpdateHover:H,setReconnecting:E})]})})}var NN=k.memo(_N);const bN=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function vy({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:c,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:g,onReconnectEnd:y,disableKeyboardA11y:v}){const{edgesFocusable:x,edgesReconnectable:p,elementsSelectable:m,onError:h}=se(bN,ve),w=dN(t);return S.jsxs("div",{className:"react-flow__edges",children:[S.jsx(mN,{defaultColor:e,rfId:n}),w.map(C=>S.jsx(NN,{id:C,edgesFocusable:x,edgesReconnectable:p,elementsSelectable:m,noPanClassName:o,onReconnect:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,onClick:c,reconnectRadius:d,onDoubleClick:f,onReconnectStart:g,onReconnectEnd:y,rfId:n,onError:h,edgeTypes:r,disableKeyboardA11y:v},C))]})}vy.displayName="EdgeRenderer";const MN=k.memo(vy),Gh=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function IN({children:e}){const t=he(),n=k.useRef(null),[r]=k.useState(()=>t.getState().transform);return G0(()=>{let o=null;const i=()=>{const s=t.getState().transform;o&&s[0]===o[0]&&s[1]===o[1]&&s[2]===o[2]||(o=s,n.current&&(n.current.style.transform=Gh(s)))};return i(),t.subscribe(i)},[t]),S.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:Gh(r)},children:e})}function PN(e){const t=vd(),n=k.useRef(!1);k.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const DN=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function TN(e){const t=se(DN),n=he();return k.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function RN(e){return e.connection.inProgress?{...e.connection,to:Ii(e.connection.to,e.transform)}:{...e.connection}}function zN(e){return RN}function jN(e){const t=zN();return se(t,ve)}const AN=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function $N({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:s,isValid:l,inProgress:a}=se(AN,ve);return!(i&&o&&a)?null:S.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:S.jsx("g",{className:ke(["react-flow__connection",d0(l)]),children:S.jsx(wy,{style:t,type:n,CustomComponent:r,isValid:l})})})}const wy=({style:e,type:t=Mn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:s,fromHandle:l,fromPosition:a,to:u,toNode:c,toHandle:d,toPosition:f,pointer:g}=jN();if(!o)return;if(n)return S.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:f,connectionStatus:d0(r),toNode:c,toHandle:d,pointer:g});let y="";const v={sourceX:i.x,sourceY:i.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case Mn.Bezier:[y]=C0(v);break;case Mn.SimpleBezier:[y]=sy(v);break;case Mn.Step:[y]=Gu({...v,borderRadius:0});break;case Mn.SmoothStep:[y]=Gu(v);break;default:[y]=N0(v)}return S.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};wy.displayName="ConnectionLine";const LN={};function Zh(e=LN){k.useRef(e),he(),k.useEffect(()=>{},[e])}function ON(){he(),k.useRef(!1),k.useEffect(()=>{},[])}function xy({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:g,connectionLineType:y,connectionLineStyle:v,connectionLineComponent:x,connectionLineContainerStyle:p,selectionKeyCode:m,selectionOnDrag:h,selectionMode:w,multiSelectionKeyCode:C,panActivationKeyCode:_,zoomActivationKeyCode:N,deleteKeyCode:b,onlyRenderVisibleElements:D,elementsSelectable:A,defaultViewport:z,translateExtent:H,minZoom:L,maxZoom:E,preventScrolling:T,defaultMarkerColor:P,zoomOnScroll:R,zoomOnPinch:I,panOnScroll:M,panOnScrollSpeed:j,panOnScrollMode:O,zoomOnDoubleClick:$,panOnDrag:U,autoPanOnSelection:W,onPaneClick:Z,onPaneMouseEnter:G,onPaneMouseMove:q,onPaneMouseLeave:F,onPaneScroll:V,onPaneContextMenu:X,paneClickDistance:J,nodeClickDistance:Y,onEdgeContextMenu:K,onEdgeMouseEnter:te,onEdgeMouseMove:ne,onEdgeMouseLeave:re,reconnectRadius:ce,onReconnect:He,onReconnectStart:Ke,onReconnectEnd:Ce,noDragClassName:Ge,noWheelClassName:Ht,noPanClassName:Bt,disableKeyboardA11y:Vt,nodeExtent:st,rfId:Ct,viewport:Ae,onViewportChange:Ze,nodesDraggable:on}){return Zh(e),Zh(t),ON(),PN(n),TN(Ae),S.jsx(tN,{onPaneClick:Z,onPaneMouseEnter:G,onPaneMouseMove:q,onPaneMouseLeave:F,onPaneContextMenu:X,onPaneScroll:V,paneClickDistance:J,deleteKeyCode:b,selectionKeyCode:m,selectionOnDrag:h,selectionMode:w,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:C,panActivationKeyCode:_,zoomActivationKeyCode:N,elementsSelectable:A,zoomOnScroll:R,zoomOnPinch:I,zoomOnDoubleClick:$,panOnScroll:M,panOnScrollSpeed:j,panOnScrollMode:O,panOnDrag:U,autoPanOnSelection:W,defaultViewport:z,translateExtent:H,minZoom:L,maxZoom:E,onSelectionContextMenu:d,preventScrolling:T,noDragClassName:Ge,noWheelClassName:Ht,noPanClassName:Bt,disableKeyboardA11y:Vt,onViewportChange:Ze,isControlledViewport:!!Ae,children:S.jsxs(IN,{children:[S.jsx(MN,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:He,onReconnectStart:Ke,onReconnectEnd:Ce,onlyRenderVisibleElements:D,onEdgeContextMenu:K,onEdgeMouseEnter:te,onEdgeMouseMove:ne,onEdgeMouseLeave:re,reconnectRadius:ce,defaultMarkerColor:P,noPanClassName:Bt,disableKeyboardA11y:Vt,rfId:Ct}),S.jsx($N,{style:v,type:y,component:x,containerStyle:p}),S.jsx("div",{className:"react-flow__edgelabel-renderer"}),S.jsx(cN,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,nodeClickDistance:Y,onlyRenderVisibleElements:D,noPanClassName:Bt,noDragClassName:Ge,disableKeyboardA11y:Vt,nodeExtent:st,rfId:Ct,nodesDraggable:on}),S.jsx("div",{className:"react-flow__viewport-portal"})]})})}xy.displayName="GraphView";const FN=k.memo(xy),HN=y0(),qh=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a=.5,maxZoom:u=2,nodeOrigin:c,nodeExtent:d,zIndexMode:f="basic"}={})=>{const g=new Map,y=new Map,v=new Map,x=new Map,p=r??t??[],m=n??e??[],h=c??[0,0],w=d??di;I0(v,x,p);const{nodesInitialized:C}=qu(m,g,y,{nodeOrigin:h,nodeExtent:w,zIndexMode:f});let _=[0,0,1];if(s&&o&&i){const N=bi(g,{filter:z=>!!((z.width||z.initialWidth)&&(z.height||z.initialHeight))}),{x:b,y:D,zoom:A}=dd(N,o,i,a,u,(l==null?void 0:l.padding)??.1);_=[b,D,A]}return{rfId:"1",width:o??0,height:i??0,transform:_,nodes:m,nodesInitialized:C,nodeLookup:g,parentLookup:y,edges:p,edgeLookup:x,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:a,maxZoom:u,translateExtent:di,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:eo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:h,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:l,fitViewResolver:null,connection:{...c0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:HN,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:u0,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},BN=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f})=>t_((g,y)=>{async function v(){const{nodeLookup:x,panZoom:p,fitViewOptions:m,fitViewResolver:h,width:w,height:C,minZoom:_,maxZoom:N}=y();p&&(await $k({nodes:x,width:w,height:C,panZoom:p,minZoom:_,maxZoom:N},m),h==null||h.resolve(!0),g({fitViewResolver:null}))}return{...qh({nodes:e,edges:t,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:x=>{const{nodeLookup:p,parentLookup:m,nodeOrigin:h,elevateNodesOnSelect:w,fitViewQueued:C,zIndexMode:_,nodesSelectionActive:N}=y(),{nodesInitialized:b,hasSelectedNodes:D}=qu(x,p,m,{nodeOrigin:h,nodeExtent:d,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:_}),A=N&&D;C&&b?(v(),g({nodes:x,nodesInitialized:b,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:A})):g({nodes:x,nodesInitialized:b,nodesSelectionActive:A})},setEdges:x=>{const{connectionLookup:p,edgeLookup:m}=y();I0(p,m,x),g({edges:x})},setDefaultNodesAndEdges:(x,p)=>{if(x){const{setNodes:m}=y();m(x),g({hasDefaultNodes:!0})}if(p){const{setEdges:m}=y();m(p),g({hasDefaultEdges:!0})}},updateNodeInternals:x=>{const{triggerNodeChanges:p,nodeLookup:m,parentLookup:h,domNode:w,nodeOrigin:C,nodeExtent:_,debug:N,fitViewQueued:b,zIndexMode:D}=y(),{changes:A,updatedInternals:z}=sC(x,m,h,w,C,_,D);z&&(nC(m,h,{nodeOrigin:C,nodeExtent:_,zIndexMode:D}),b?(v(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),(A==null?void 0:A.length)>0&&(N&&console.log("React Flow: trigger node changes",A),p==null||p(A)))},updateNodePositions:(x,p=!1)=>{const m=[];let h=[];const{nodeLookup:w,triggerNodeChanges:C,connection:_,updateConnection:N,onNodesChangeMiddlewareMap:b}=y();for(const[D,A]of x){const z=w.get(D),H=!!(z!=null&&z.expandParent&&(z!=null&&z.parentId)&&(A!=null&&A.position)),L={id:D,type:"position",position:H?{x:Math.max(0,A.position.x),y:Math.max(0,A.position.y)}:A.position,dragging:p};if(z&&_.inProgress&&_.fromNode.id===z.id){const E=pr(z,_.fromHandle,ee.Left,!0);N({..._,from:E})}H&&z.parentId&&m.push({id:D,parentId:z.parentId,rect:{...A.internals.positionAbsolute,width:A.measured.width??0,height:A.measured.height??0}}),h.push(L)}if(m.length>0){const{parentLookup:D,nodeOrigin:A}=y(),z=yd(m,w,D,A);h.push(...z)}for(const D of b.values())h=D(h);C(h)},triggerNodeChanges:x=>{const{onNodesChange:p,setNodes:m,nodes:h,hasDefaultNodes:w,debug:C}=y();if(x!=null&&x.length){if(w){const _=Q0(x,h);m(_)}C&&console.log("React Flow: trigger node changes",x),p==null||p(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:p,setEdges:m,edges:h,hasDefaultEdges:w,debug:C}=y();if(x!=null&&x.length){if(w){const _=E_(x,h);m(_)}C&&console.log("React Flow: trigger edge changes",x),p==null||p(x)}},addSelectedNodes:x=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:h,triggerNodeChanges:w,triggerEdgeChanges:C}=y();if(p){const _=x.map(N=>Gn(N,!0));w(_);return}w(zr(h,new Set([...x]),!0)),C(zr(m))},addSelectedEdges:x=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:h,triggerNodeChanges:w,triggerEdgeChanges:C}=y();if(p){const _=x.map(N=>Gn(N,!0));C(_);return}C(zr(m,new Set([...x]))),w(zr(h,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:p}={})=>{const{edges:m,nodes:h,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:_}=y(),N=x||h,b=p||m,D=[];for(const z of N){if(!z.selected)continue;const H=w.get(z.id);H&&(H.selected=!1),D.push(Gn(z.id,!1))}const A=[];for(const z of b)z.selected&&A.push(Gn(z.id,!1));C(D),_(A)},setMinZoom:x=>{const{panZoom:p,maxZoom:m}=y();p==null||p.setScaleExtent([x,m]),g({minZoom:x})},setMaxZoom:x=>{const{panZoom:p,minZoom:m}=y();p==null||p.setScaleExtent([m,x]),g({maxZoom:x})},setTranslateExtent:x=>{var p;(p=y().panZoom)==null||p.setTranslateExtent(x),g({translateExtent:x})},resetSelectedElements:()=>{const{edges:x,nodes:p,triggerNodeChanges:m,triggerEdgeChanges:h,elementsSelectable:w}=y();if(!w)return;const C=p.reduce((N,b)=>b.selected?[...N,Gn(b.id,!1)]:N,[]),_=x.reduce((N,b)=>b.selected?[...N,Gn(b.id,!1)]:N,[]);m(C),h(_)},setNodeExtent:x=>{const{nodes:p,nodeLookup:m,parentLookup:h,nodeOrigin:w,elevateNodesOnSelect:C,nodeExtent:_,zIndexMode:N}=y();x[0][0]===_[0][0]&&x[0][1]===_[0][1]&&x[1][0]===_[1][0]&&x[1][1]===_[1][1]||(qu(p,m,h,{nodeOrigin:w,nodeExtent:x,elevateNodesOnSelect:C,checkEquality:!1,zIndexMode:N}),g({nodeExtent:x}))},panBy:x=>{const{transform:p,width:m,height:h,panZoom:w,translateExtent:C}=y();return lC({delta:x,panZoom:w,transform:p,translateExtent:C,width:m,height:h})},setCenter:async(x,p,m)=>{const{width:h,height:w,maxZoom:C,panZoom:_}=y();if(!_)return!1;const N=typeof(m==null?void 0:m.zoom)<"u"?m.zoom:C;return await _.setViewport({x:h/2-x*N,y:w/2-p*N,zoom:N},{duration:m==null?void 0:m.duration,ease:m==null?void 0:m.ease,interpolate:m==null?void 0:m.interpolate}),!0},cancelConnection:()=>{g({connection:{...c0}})},updateConnection:x=>{g({connection:x})},reset:()=>g({...qh()})}},Object.is);function VN({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:s,initialMaxZoom:l,initialFitViewOptions:a,fitView:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f,children:g}){const[y]=k.useState(()=>BN({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:u,minZoom:s,maxZoom:l,fitViewOptions:a,nodeOrigin:c,nodeExtent:d,zIndexMode:f}));return S.jsx(n_,{value:y,children:S.jsx(b_,{children:S.jsx(B_,{children:g})})})}function UN({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:s,fitView:l,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:g}){return k.useContext(Ul)?S.jsx(S.Fragment,{children:e}):S.jsx(VN,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:s,fitView:l,initialFitViewOptions:a,initialMinZoom:u,initialMaxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:g,children:e})}const WN={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function XN({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:s,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:g,onConnectStart:y,onConnectEnd:v,onClickConnectStart:x,onClickConnectEnd:p,onNodeMouseEnter:m,onNodeMouseMove:h,onNodeMouseLeave:w,onNodeContextMenu:C,onNodeDoubleClick:_,onNodeDragStart:N,onNodeDrag:b,onNodeDragStop:D,onNodesDelete:A,onEdgesDelete:z,onDelete:H,onSelectionChange:L,onSelectionDragStart:E,onSelectionDrag:T,onSelectionDragStop:P,onSelectionContextMenu:R,onSelectionStart:I,onSelectionEnd:M,onBeforeDelete:j,connectionMode:O,connectionLineType:$=Mn.Bezier,connectionLineStyle:U,connectionLineComponent:W,connectionLineContainerStyle:Z,deleteKeyCode:G="Backspace",selectionKeyCode:q="Shift",selectionOnDrag:F=!1,selectionMode:V=fi.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:J=pi()?"Meta":"Control",zoomActivationKeyCode:Y=pi()?"Meta":"Control",snapToGrid:K,snapGrid:te,onlyRenderVisibleElements:ne=!1,selectNodesOnDrag:re,nodesDraggable:ce,autoPanOnNodeFocus:He,nodesConnectable:Ke,nodesFocusable:Ce,nodeOrigin:Ge=X0,edgesFocusable:Ht,edgesReconnectable:Bt,elementsSelectable:Vt=!0,defaultViewport:st=g_,minZoom:Ct=.5,maxZoom:Ae=2,translateExtent:Ze=di,preventScrolling:on=!0,nodeExtent:yr,defaultMarkerColor:Ut="#b1b1b7",zoomOnScroll:Ri=!0,zoomOnPinch:ql=!0,panOnScroll:Jl=!1,panOnScrollSpeed:fo=.5,panOnScrollMode:zi=or.Free,zoomOnDoubleClick:ea=!0,panOnDrag:ji=!0,onPaneClick:ta,onPaneMouseEnter:na,onPaneMouseMove:ra,onPaneMouseLeave:Ie,onPaneScroll:Be,onPaneContextMenu:Ve,paneClickDistance:Wt=1,nodeClickDistance:qe=0,children:Ue,onReconnect:gt,onReconnectStart:wn,onReconnectEnd:_e,onEdgeContextMenu:Xt,onEdgeDoubleClick:mt,onEdgeMouseEnter:_t,onEdgeMouseMove:Wn,onEdgeMouseLeave:Xn,reconnectRadius:Yt=10,onNodesChange:Yn,onEdgesChange:ho,noDragClassName:Xy="nodrag",noWheelClassName:Yy="nowheel",noPanClassName:Md="nopan",fitView:Id,fitViewOptions:Pd,connectOnClick:Qy,attributionPosition:Ky,proOptions:Gy,defaultEdgeOptions:Zy,elevateNodesOnSelect:qy=!0,elevateEdgesOnSelect:Jy=!1,disableKeyboardA11y:Dd=!1,autoPanOnConnect:ev,autoPanOnNodeDrag:tv,autoPanOnSelection:nv=!0,autoPanSpeed:rv,connectionRadius:ov,isValidConnection:iv,onError:sv,style:lv,id:Td,nodeDragThreshold:av,connectionDragThreshold:uv,viewport:cv,onViewportChange:dv,width:fv,height:hv,colorMode:pv="light",debug:gv,onScroll:Ai,ariaLabelConfig:mv,zIndexMode:Rd="basic",...yv},vv){const oa=Td||"1",wv=w_(pv),xv=k.useCallback(zd=>{zd.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ai==null||Ai(zd)},[Ai]);return S.jsx("div",{"data-testid":"rf__wrapper",...yv,onScroll:xv,style:{...lv,...WN},ref:vv,className:ke(["react-flow",o,wv]),id:Td,role:"application",children:S.jsxs(UN,{nodes:e,edges:t,width:fv,height:hv,fitView:Id,fitViewOptions:Pd,minZoom:Ct,maxZoom:Ae,nodeOrigin:Ge,nodeExtent:yr,zIndexMode:Rd,children:[S.jsx(v_,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:y,onConnectEnd:v,onClickConnectStart:x,onClickConnectEnd:p,nodesDraggable:ce,autoPanOnNodeFocus:He,nodesConnectable:Ke,nodesFocusable:Ce,edgesFocusable:Ht,edgesReconnectable:Bt,elementsSelectable:Vt,elevateNodesOnSelect:qy,elevateEdgesOnSelect:Jy,minZoom:Ct,maxZoom:Ae,nodeExtent:yr,onNodesChange:Yn,onEdgesChange:ho,snapToGrid:K,snapGrid:te,connectionMode:O,translateExtent:Ze,connectOnClick:Qy,defaultEdgeOptions:Zy,fitView:Id,fitViewOptions:Pd,onNodesDelete:A,onEdgesDelete:z,onDelete:H,onNodeDragStart:N,onNodeDrag:b,onNodeDragStop:D,onSelectionDrag:T,onSelectionDragStart:E,onSelectionDragStop:P,onMove:c,onMoveStart:d,onMoveEnd:f,noPanClassName:Md,nodeOrigin:Ge,rfId:oa,autoPanOnConnect:ev,autoPanOnNodeDrag:tv,autoPanSpeed:rv,onError:sv,connectionRadius:ov,isValidConnection:iv,selectNodesOnDrag:re,nodeDragThreshold:av,connectionDragThreshold:uv,onBeforeDelete:j,debug:gv,ariaLabelConfig:mv,zIndexMode:Rd}),S.jsx(FN,{onInit:u,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:m,onNodeMouseMove:h,onNodeMouseLeave:w,onNodeContextMenu:C,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:s,connectionLineType:$,connectionLineStyle:U,connectionLineComponent:W,connectionLineContainerStyle:Z,selectionKeyCode:q,selectionOnDrag:F,selectionMode:V,deleteKeyCode:G,multiSelectionKeyCode:J,panActivationKeyCode:X,zoomActivationKeyCode:Y,onlyRenderVisibleElements:ne,defaultViewport:st,translateExtent:Ze,minZoom:Ct,maxZoom:Ae,preventScrolling:on,zoomOnScroll:Ri,zoomOnPinch:ql,zoomOnDoubleClick:ea,panOnScroll:Jl,panOnScrollSpeed:fo,panOnScrollMode:zi,panOnDrag:ji,autoPanOnSelection:nv,onPaneClick:ta,onPaneMouseEnter:na,onPaneMouseMove:ra,onPaneMouseLeave:Ie,onPaneScroll:Be,onPaneContextMenu:Ve,paneClickDistance:Wt,nodeClickDistance:qe,onSelectionContextMenu:R,onSelectionStart:I,onSelectionEnd:M,onReconnect:gt,onReconnectStart:wn,onReconnectEnd:_e,onEdgeContextMenu:Xt,onEdgeDoubleClick:mt,onEdgeMouseEnter:_t,onEdgeMouseMove:Wn,onEdgeMouseLeave:Xn,reconnectRadius:Yt,defaultMarkerColor:Ut,noDragClassName:Xy,noWheelClassName:Yy,noPanClassName:Md,rfId:oa,disableKeyboardA11y:Dd,nodeExtent:yr,viewport:cv,onViewportChange:dv,nodesDraggable:ce}),S.jsx(p_,{onSelectionChange:L}),Ue,S.jsx(u_,{proOptions:Gy,position:Ky}),S.jsx(a_,{rfId:oa,disableKeyboardA11y:Dd})]})})}var YN=K0(XN);function QN({dimensions:e,lineWidth:t,variant:n,className:r}){return S.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ke(["react-flow__background-pattern",n,r])})}function KN({radius:e,className:t}){return S.jsx("circle",{cx:e,cy:e,r:e,className:ke(["react-flow__background-pattern","dots",t])})}var On;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(On||(On={}));const GN={[On.Dots]:1,[On.Lines]:1,[On.Cross]:6},ZN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Sy({id:e,variant:t=On.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:s,bgColor:l,style:a,className:u,patternClassName:c}){const d=k.useRef(null),{transform:f,patternId:g}=se(ZN,ve),y=r||GN[t],v=t===On.Dots,x=t===On.Cross,p=Array.isArray(n)?n:[n,n],m=[p[0]*f[2]||1,p[1]*f[2]||1],h=y*f[2],w=Array.isArray(i)?i:[i,i],C=x?[h,h]:m,_=[w[0]*f[2]||1+C[0]/2,w[1]*f[2]||1+C[1]/2],N=`${g}${e||""}`;return S.jsxs("svg",{className:ke(["react-flow__background",u]),style:{...a,...Xl,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:d,"data-testid":"rf__background",children:[S.jsx("pattern",{id:N,x:f[0]%m[0],y:f[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`,children:v?S.jsx(KN,{radius:h/2,className:c}):S.jsx(QN,{dimensions:C,lineWidth:o,variant:t,className:c})}),S.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}Sy.displayName="Background";const qN=k.memo(Sy);function JN(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:S.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function e2(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:S.jsx("path",{d:"M0 0h32v4.2H0z"})})}function t2(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:S.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function n2(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:S.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function r2(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:S.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function as({children:e,className:t,...n}){return S.jsx("button",{type:"button",className:ke(["react-flow__controls-button",t]),...n,children:e})}const o2=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Ey({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:l,onInteractiveChange:a,className:u,children:c,position:d="bottom-left",orientation:f="vertical","aria-label":g}){const y=he(),{isInteractive:v,minZoomReached:x,maxZoomReached:p,ariaLabelConfig:m}=se(o2,ve),{zoomIn:h,zoomOut:w,fitView:C}=vd(),_=()=>{h(),i==null||i()},N=()=>{w(),s==null||s()},b=()=>{C(o),l==null||l()},D=()=>{y.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),a==null||a(!v)},A=f==="horizontal"?"horizontal":"vertical";return S.jsxs(Wl,{className:ke(["react-flow__controls",A,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":g??m["controls.ariaLabel"],children:[t&&S.jsxs(S.Fragment,{children:[S.jsx(as,{onClick:_,className:"react-flow__controls-zoomin",title:m["controls.zoomIn.ariaLabel"],"aria-label":m["controls.zoomIn.ariaLabel"],disabled:p,children:S.jsx(JN,{})}),S.jsx(as,{onClick:N,className:"react-flow__controls-zoomout",title:m["controls.zoomOut.ariaLabel"],"aria-label":m["controls.zoomOut.ariaLabel"],disabled:x,children:S.jsx(e2,{})})]}),n&&S.jsx(as,{className:"react-flow__controls-fitview",onClick:b,title:m["controls.fitView.ariaLabel"],"aria-label":m["controls.fitView.ariaLabel"],children:S.jsx(t2,{})}),r&&S.jsx(as,{className:"react-flow__controls-interactive",onClick:D,title:m["controls.interactive.ariaLabel"],"aria-label":m["controls.interactive.ariaLabel"],children:v?S.jsx(r2,{}):S.jsx(n2,{})}),c]})}Ey.displayName="Controls";const i2=k.memo(Ey);function s2({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:l,strokeWidth:a,className:u,borderRadius:c,shapeRendering:d,selected:f,onClick:g}){const{background:y,backgroundColor:v}=i||{},x=s||y||v;return S.jsx("rect",{className:ke(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:c,ry:c,width:r,height:o,style:{fill:x,stroke:l,strokeWidth:a},shapeRendering:d,onClick:g?p=>g(p,e):void 0})}const l2=k.memo(s2),a2=e=>e.nodes.map(t=>t.id),Ba=e=>e instanceof Function?e:()=>e;function u2({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=l2,onClick:s}){const l=se(a2,ve),a=Ba(t),u=Ba(e),c=Ba(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return S.jsx(S.Fragment,{children:l.map(f=>S.jsx(d2,{id:f,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:c,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:s,shapeRendering:d},f))})}function c2({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:l,onClick:a}){const{node:u,x:c,y:d,width:f,height:g}=se(y=>{const v=y.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const x=v.internals.userNode,{x:p,y:m}=v.internals.positionAbsolute,{width:h,height:w}=rn(x);return{node:x,x:p,y:m,width:h,height:w}},ve);return!u||u.hidden||!v0(u)?null:S.jsx(l,{x:c,y:d,width:f,height:g,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:i,shapeRendering:s,onClick:a,id:u.id})}const d2=k.memo(c2);var f2=k.memo(u2);const h2=200,p2=150,g2=e=>!e.hidden,m2=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?g0(bi(e.nodeLookup,{filter:g2}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Jh=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,y2=(e,t)=>Jh(e.viewBB,t.viewBB)&&Jh(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,v2="react-flow__minimap-desc";function ky({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:a,maskColor:u,maskStrokeColor:c,maskStrokeWidth:d,position:f="bottom-right",onClick:g,onNodeClick:y,pannable:v=!1,zoomable:x=!1,ariaLabel:p,inversePan:m,zoomStep:h=1,offsetScale:w=5}){const C=he(),_=k.useRef(null),{boundingRect:N,viewBB:b,rfId:D,panZoom:A,translateExtent:z,flowWidth:H,flowHeight:L,ariaLabelConfig:E}=se(m2,y2),T=(e==null?void 0:e.width)??h2,P=(e==null?void 0:e.height)??p2,R=N.width/T,I=N.height/P,M=Math.max(R,I),j=M*T,O=M*P,$=w*M,U=N.x-(j-N.width)/2-$,W=N.y-(O-N.height)/2-$,Z=j+$*2,G=O+$*2,q=`${v2}-${D}`,F=k.useRef(0),V=k.useRef();F.current=M,k.useEffect(()=>{if(_.current&&A)return V.current=mC({domNode:_.current,panZoom:A,getTransform:()=>C.getState().transform,getViewScale:()=>F.current}),()=>{var K;(K=V.current)==null||K.destroy()}},[A]),k.useEffect(()=>{var K;(K=V.current)==null||K.update({translateExtent:z,width:H,height:L,inversePan:m,pannable:v,zoomStep:h,zoomable:x})},[v,x,m,h,z,H,L]);const X=g?K=>{var re;const[te,ne]=((re=V.current)==null?void 0:re.pointer(K))||[0,0];g(K,{x:te,y:ne})}:void 0,J=y?k.useCallback((K,te)=>{const ne=C.getState().nodeLookup.get(te).internals.userNode;y(K,ne)},[]):void 0,Y=p??E["minimap.ariaLabel"];return S.jsx(Wl,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*M:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:ke(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:S.jsxs("svg",{width:T,height:P,viewBox:`${U} ${W} ${Z} ${G}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":q,ref:_,onClick:X,children:[Y&&S.jsx("title",{id:q,children:Y}),S.jsx(f2,{onClick:J,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:l}),S.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-$},${W-$}h${Z+$*2}v${G+$*2}h${-Z-$*2}z
62
- M${b.x},${b.y}h${b.width}v${b.height}h${-b.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ky.displayName="MiniMap";k.memo(ky);const w2=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,x2={[ro.Line]:"right",[ro.Handle]:"bottom-right"};function S2({nodeId:e,position:t,variant:n=ro.Handle,className:r,style:o=void 0,children:i,color:s,minWidth:l=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:g=!0,shouldResize:y,onResizeStart:v,onResize:x,onResizeEnd:p}){const m=ey(),h=typeof e=="string"?e:m,w=he(),C=k.useRef(null),_=n===ro.Handle,N=se(k.useCallback(w2(_&&g),[_,g]),ve),b=k.useRef(null),D=t??x2[n];k.useEffect(()=>{if(!(!C.current||!h))return b.current||(b.current=IC({domNode:C.current,nodeId:h,getStoreItems:()=>{const{nodeLookup:z,transform:H,snapGrid:L,snapToGrid:E,nodeOrigin:T,domNode:P}=w.getState();return{nodeLookup:z,transform:H,snapGrid:L,snapToGrid:E,nodeOrigin:T,paneDomNode:P}},onChange:(z,H)=>{const{triggerNodeChanges:L,nodeLookup:E,parentLookup:T,nodeOrigin:P}=w.getState(),R=[],I={x:z.x,y:z.y},M=E.get(h);if(M&&M.expandParent&&M.parentId){const j=M.origin??P,O=z.width??M.measured.width??0,$=z.height??M.measured.height??0,U={id:M.id,parentId:M.parentId,rect:{width:O,height:$,...w0({x:z.x??M.position.x,y:z.y??M.position.y},{width:O,height:$},M.parentId,E,j)}},W=yd([U],E,T,P);R.push(...W),I.x=z.x?Math.max(j[0]*O,z.x):void 0,I.y=z.y?Math.max(j[1]*$,z.y):void 0}if(I.x!==void 0&&I.y!==void 0){const j={id:h,type:"position",position:{...I}};R.push(j)}if(z.width!==void 0&&z.height!==void 0){const O={id:h,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:z.width,height:z.height}};R.push(O)}for(const j of H){const O={...j,type:"position"};R.push(O)}L(R)},onEnd:({width:z,height:H})=>{const L={id:h,type:"dimensions",resizing:!1,dimensions:{width:z,height:H}};w.getState().triggerNodeChanges([L])}})),b.current.update({controlPosition:D,boundaries:{minWidth:l,minHeight:a,maxWidth:u,maxHeight:c},keepAspectRatio:d,resizeDirection:f,onResizeStart:v,onResize:x,onResizeEnd:p,shouldResize:y}),()=>{var z;(z=b.current)==null||z.destroy()}},[D,l,a,u,c,d,v,x,p,y]);const A=D.split("-");return S.jsx("div",{className:ke(["react-flow__resize-control","nodrag",...A,n,r]),ref:C,style:{...o,scale:N,...s&&{[_?"backgroundColor":"borderColor"]:s}},children:i})}k.memo(S2);function E2(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return k.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const Ql=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ao(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function xd(e){return"nodeType"in e}function it(e){var t,n;return e?ao(e)?e:xd(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Sd(e){const{Document:t}=it(e);return e instanceof t}function Pi(e){return ao(e)?!1:e instanceof it(e).HTMLElement}function Cy(e){return e instanceof it(e).SVGElement}function uo(e){return e?ao(e)?e.document:xd(e)?Sd(e)?e:Pi(e)||Cy(e)?e.ownerDocument:document:document:document}const tn=Ql?k.useLayoutEffect:k.useEffect;function Ed(e){const t=k.useRef(e);return tn(()=>{t.current=e}),k.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function k2(){const e=k.useRef(null),t=k.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=k.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function mi(e,t){t===void 0&&(t=[e]);const n=k.useRef(e);return tn(()=>{n.current!==e&&(n.current=e)},t),n}function Di(e,t){const n=k.useRef();return k.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function pl(e){const t=Ed(e),n=k.useRef(null),r=k.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function tc(e){const t=k.useRef();return k.useEffect(()=>{t.current=e},[e]),t.current}let Va={};function Ti(e,t){return k.useMemo(()=>{if(t)return t;const n=Va[e]==null?0:Va[e]+1;return Va[e]=n,e+"-"+n},[e,t])}function _y(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const l=Object.entries(s);for(const[a,u]of l){const c=i[a];c!=null&&(i[a]=c+e*u)}return i},{...t})}}const Ur=_y(1),gl=_y(-1);function C2(e){return"clientX"in e&&"clientY"in e}function kd(e){if(!e)return!1;const{KeyboardEvent:t}=it(e.target);return t&&e instanceof t}function _2(e){if(!e)return!1;const{TouchEvent:t}=it(e.target);return t&&e instanceof t}function nc(e){if(_2(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return C2(e)?{x:e.clientX,y:e.clientY}:null}const yi=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[yi.Translate.toString(e),yi.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),ep="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function N2(e){return e.matches(ep)?e:e.querySelector(ep)}const b2={display:"none"};function M2(e){let{id:t,value:n}=e;return Se.createElement("div",{id:t,style:b2},n)}function I2(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Se.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function P2(){const[e,t]=k.useState("");return{announce:k.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Ny=k.createContext(null);function D2(e){const t=k.useContext(Ny);k.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function T2(){const[e]=k.useState(()=>new Set),t=k.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[k.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var l;return(l=s[o])==null?void 0:l.call(s,i)})},[e]),t]}const R2={draggable:`
61
+ `)),c=u.reduce((d,f)=>d.concat(...f),[]);return[u,c]}return[[],[]]},[e]);return k.useEffect(()=>{const a=(t==null?void 0:t.target)??jh,u=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const c=g=>{var x,p;if(o.current=g.ctrlKey||g.metaKey||g.shiftKey||g.altKey,(!o.current||o.current&&!u)&&S0(g))return!1;const v=Ah(g.code,l);if(i.current.add(g[v]),zh(s,i.current,!1)){const m=((p=(x=g.composedPath)==null?void 0:x.call(g))==null?void 0:p[0])||g.target,h=(m==null?void 0:m.nodeName)==="BUTTON"||(m==null?void 0:m.nodeName)==="A";t.preventDefault!==!1&&(o.current||!h)&&g.preventDefault(),r(!0)}},d=g=>{const y=Ah(g.code,l);zh(s,i.current,!0)?(r(!1),i.current.clear()):i.current.delete(g[y]),g.key==="Meta"&&i.current.clear(),o.current=!1},f=()=>{i.current.clear(),r(!1)};return a==null||a.addEventListener("keydown",c),a==null||a.addEventListener("keyup",d),window.addEventListener("blur",f),window.addEventListener("contextmenu",f),()=>{a==null||a.removeEventListener("keydown",c),a==null||a.removeEventListener("keyup",d),window.removeEventListener("blur",f),window.removeEventListener("contextmenu",f)}}},[e,r]),n}function zh(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(o=>t.has(o)))}function Ah(e,t){return t.includes(e)?"code":"key"}const x_=()=>{const e=he();return k.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,o,i],panZoom:s}=e.getState();return s?(await s.setViewport({x:t.x??r,y:t.y??o,zoom:t.zoom??i},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:o,minZoom:i,maxZoom:s,panZoom:l}=e.getState(),a=dd(t,r,o,i,s,(n==null?void 0:n.padding)??.1);return l?(await l.setViewport(a,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:o,snapToGrid:i,domNode:s}=e.getState();if(!s)return t;const{x:l,y:a}=s.getBoundingClientRect(),u={x:t.x-l,y:t.y-a},c=n.snapGrid??o,d=n.snapToGrid??i;return Ii(u,r,d,c)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:o,y:i}=r.getBoundingClientRect(),s=no(t,n);return{x:s.x+o,y:s.y+i}}}),[])};function Y0(e,t){const n=[],r=new Map,o=[];for(const i of e)if(i.type==="add"){o.push(i);continue}else if(i.type==="remove"||i.type==="replace")r.set(i.id,[i]);else{const s=r.get(i.id);s?s.push(i):r.set(i.id,[i])}for(const i of t){const s=r.get(i.id);if(!s){n.push(i);continue}if(s[0].type==="remove")continue;if(s[0].type==="replace"){n.push({...s[0].item});continue}const l={...i};for(const a of s)S_(a,l);n.push(l)}return o.length&&o.forEach(i=>{i.index!==void 0?n.splice(i.index,0,{...i.item}):n.push({...i.item})}),n}function S_(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function Q0(e,t){return Y0(e,t)}function E_(e,t){return Y0(e,t)}function Gn(e,t){return{id:e,type:"select",selected:t}}function jr(e,t=new Set,n=!1){const r=[];for(const[o,i]of e){const s=t.has(o);!(i.selected===void 0&&!s)&&i.selected!==s&&(n&&(i.selected=s),r.push(Gn(i.id,s)))}return r}function $h({items:e=[],lookup:t}){var o;const n=[],r=new Map(e.map(i=>[i.id,i]));for(const[i,s]of e.entries()){const l=t.get(s.id),a=((o=l==null?void 0:l.internals)==null?void 0:o.userNode)??l;a!==void 0&&a!==s&&n.push({id:s.id,item:s,type:"replace"}),a===void 0&&n.push({item:s,type:"add",index:i})}for(const[i]of t)r.get(i)===void 0&&n.push({id:i,type:"remove"});return n}function Lh(e){return{id:e.id,type:"remove"}}const k_=y0();function C_(e,t,n={}){return Qk(e,t,{...n,onError:n.onError??k_})}const Oh=e=>Rk(e),__=e=>f0(e);function K0(e){return k.forwardRef(e)}const G0=typeof window<"u"?k.useLayoutEffect:k.useEffect;function Fh(e){const[t,n]=k.useState(BigInt(0)),[r]=k.useState(()=>N_(()=>n(o=>o+BigInt(1))));return G0(()=>{const o=r.get();o.length&&(e(o),r.reset())},[t]),r}function N_(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const Z0=k.createContext(null);function b_({children:e}){const t=he(),n=k.useCallback(l=>{const{nodes:a=[],setNodes:u,hasDefaultNodes:c,onNodesChange:d,nodeLookup:f,fitViewQueued:g,onNodesChangeMiddlewareMap:y}=t.getState();let v=a;for(const p of l)v=typeof p=="function"?p(v):p;let x=$h({items:v,lookup:f});for(const p of y.values())x=p(x);c&&u(v),x.length>0?d==null||d(x):g&&window.requestAnimationFrame(()=>{const{fitViewQueued:p,nodes:m,setNodes:h}=t.getState();p&&h(m)})},[]),r=Fh(n),o=k.useCallback(l=>{const{edges:a=[],setEdges:u,hasDefaultEdges:c,onEdgesChange:d,edgeLookup:f}=t.getState();let g=a;for(const y of l)g=typeof y=="function"?y(g):y;c?u(g):d&&d($h({items:g,lookup:f}))},[]),i=Fh(o),s=k.useMemo(()=>({nodeQueue:r,edgeQueue:i}),[]);return S.jsx(Z0.Provider,{value:s,children:e})}function M_(){const e=k.useContext(Z0);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const I_=e=>!!e.panZoom;function vd(){const e=x_(),t=he(),n=M_(),r=se(I_),o=k.useMemo(()=>{const i=d=>t.getState().nodeLookup.get(d),s=d=>{n.nodeQueue.push(d)},l=d=>{n.edgeQueue.push(d)},a=d=>{var p,m;const{nodeLookup:f,nodeOrigin:g}=t.getState(),y=Oh(d)?d:f.get(d.id),v=y.parentId?w0(y.position,y.measured,y.parentId,f,g):y.position,x={...y,position:v,width:((p=y.measured)==null?void 0:p.width)??y.width,height:((m=y.measured)==null?void 0:m.height)??y.height};return hi(x)},u=(d,f,g={replace:!1})=>{s(y=>y.map(v=>{if(v.id===d){const x=typeof f=="function"?f(v):f;return g.replace&&Oh(x)?x:{...v,...x}}return v}))},c=(d,f,g={replace:!1})=>{l(y=>y.map(v=>{if(v.id===d){const x=typeof f=="function"?f(v):f;return g.replace&&__(x)?x:{...v,...x}}return v}))};return{getNodes:()=>t.getState().nodes.map(d=>({...d})),getNode:d=>{var f;return(f=i(d))==null?void 0:f.internals.userNode},getInternalNode:i,getEdges:()=>{const{edges:d=[]}=t.getState();return d.map(f=>({...f}))},getEdge:d=>t.getState().edgeLookup.get(d),setNodes:s,setEdges:l,addNodes:d=>{const f=Array.isArray(d)?d:[d];n.nodeQueue.push(g=>[...g,...f])},addEdges:d=>{const f=Array.isArray(d)?d:[d];n.edgeQueue.push(g=>[...g,...f])},toObject:()=>{const{nodes:d=[],edges:f=[],transform:g}=t.getState(),[y,v,x]=g;return{nodes:d.map(p=>({...p})),edges:f.map(p=>({...p})),viewport:{x:y,y:v,zoom:x}}},deleteElements:async({nodes:d=[],edges:f=[]})=>{const{nodes:g,edges:y,onNodesDelete:v,onEdgesDelete:x,triggerNodeChanges:p,triggerEdgeChanges:m,onDelete:h,onBeforeDelete:w}=t.getState(),{nodes:C,edges:_}=await Lk({nodesToRemove:d,edgesToRemove:f,nodes:g,edges:y,onBeforeDelete:w}),N=_.length>0,b=C.length>0;if(N){const D=_.map(Lh);x==null||x(_),m(D)}if(b){const D=C.map(Lh);v==null||v(C),p(D)}return(b||N)&&(h==null||h({nodes:C,edges:_})),{deletedNodes:C,deletedEdges:_}},getIntersectingNodes:(d,f=!0,g)=>{const y=ph(d),v=y?d:a(d),x=g!==void 0;return v?(g||t.getState().nodes).filter(p=>{const m=t.getState().nodeLookup.get(p.id);if(m&&!y&&(p.id===d.id||!m.internals.positionAbsolute))return!1;const h=hi(x?p:m),w=dl(h,v);return f&&w>0||w>=h.width*h.height||w>=v.width*v.height}):[]},isNodeIntersecting:(d,f,g=!0)=>{const v=ph(d)?d:a(d);if(!v)return!1;const x=dl(v,f);return g&&x>0||x>=f.width*f.height||x>=v.width*v.height},updateNode:u,updateNodeData:(d,f,g={replace:!1})=>{u(d,y=>{const v=typeof f=="function"?f(y):f;return g.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},g)},updateEdge:c,updateEdgeData:(d,f,g={replace:!1})=>{c(d,y=>{const v=typeof f=="function"?f(y):f;return g.replace?{...y,data:v}:{...y,data:{...y.data,...v}}},g)},getNodesBounds:d=>{const{nodeLookup:f,nodeOrigin:g}=t.getState();return jk(d,{nodeLookup:f,nodeOrigin:g})},getHandleConnections:({type:d,id:f,nodeId:g})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${g}-${d}${f?`-${f}`:""}`))==null?void 0:y.values())??[])},getNodeConnections:({type:d,handleId:f,nodeId:g})=>{var y;return Array.from(((y=t.getState().connectionLookup.get(`${g}${d?f?`-${d}-${f}`:`-${d}`:""}`))==null?void 0:y.values())??[])},fitView:async d=>{const f=t.getState().fitViewResolver??Hk();return t.setState({fitViewQueued:!0,fitViewOptions:d,fitViewResolver:f}),n.nodeQueue.push(g=>[...g]),f.promise}}},[]);return k.useMemo(()=>({...o,...e,viewportInitialized:r}),[r])}const Hh=e=>e.selected,P_=typeof window<"u"?window:void 0;function D_({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=he(),{deleteElements:r}=vd(),o=gi(e,{actInsideInputWithModifier:!1}),i=gi(t,{target:P_});k.useEffect(()=>{if(o){const{edges:s,nodes:l}=n.getState();r({nodes:l.filter(Hh),edges:s.filter(Hh)}),n.setState({nodesSelectionActive:!1})}},[o]),k.useEffect(()=>{n.setState({multiSelectionActive:i})},[i])}function T_(e){const t=he();k.useEffect(()=>{const n=()=>{var o,i,s,l;if(!e.current||!(((i=(o=e.current).checkVisibility)==null?void 0:i.call(o))??!0))return!1;const r=fd(e.current);(r.height===0||r.width===0)&&((l=(s=t.getState()).onError)==null||l.call(s,"004",Lt.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const Xl={position:"absolute",width:"100%",height:"100%",top:0,left:0},R_=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function j_({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:o=.5,panOnScrollMode:i=or.Free,zoomOnDoubleClick:s=!0,panOnDrag:l=!0,defaultViewport:a,translateExtent:u,minZoom:c,maxZoom:d,zoomActivationKeyCode:f,preventScrolling:g=!0,children:y,noWheelClassName:v,noPanClassName:x,onViewportChange:p,isControlledViewport:m,paneClickDistance:h,selectionOnDrag:w}){const C=he(),_=k.useRef(null),{userSelectionActive:N,lib:b,connectionInProgress:D}=se(R_,ve),A=gi(f),j=k.useRef();T_(_);const H=k.useCallback(L=>{p==null||p({x:L[0],y:L[1],zoom:L[2]}),m||C.setState({transform:L})},[p,m]);return k.useEffect(()=>{if(_.current){j.current=CC({domNode:_.current,minZoom:c,maxZoom:d,translateExtent:u,viewport:a,onDraggingChange:P=>C.setState(R=>R.paneDragging===P?R:{paneDragging:P}),onPanZoomStart:(P,R)=>{const{onViewportChangeStart:I,onMoveStart:M}=C.getState();M==null||M(P,R),I==null||I(R)},onPanZoom:(P,R)=>{const{onViewportChange:I,onMove:M}=C.getState();M==null||M(P,R),I==null||I(R)},onPanZoomEnd:(P,R)=>{const{onViewportChangeEnd:I,onMoveEnd:M}=C.getState();M==null||M(P,R),I==null||I(R)}});const{x:L,y:E,zoom:T}=j.current.getViewport();return C.setState({panZoom:j.current,transform:[L,E,T],domNode:_.current.closest(".react-flow")}),()=>{var P;(P=j.current)==null||P.destroy()}}},[]),k.useEffect(()=>{var L;(L=j.current)==null||L.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:o,panOnScrollMode:i,zoomOnDoubleClick:s,panOnDrag:l,zoomActivationKeyPressed:A,preventScrolling:g,noPanClassName:x,userSelectionActive:N,noWheelClassName:v,lib:b,onTransformChange:H,connectionInProgress:D,selectionOnDrag:w,paneClickDistance:h})},[e,t,n,r,o,i,s,l,A,g,x,N,v,b,H,D,w,h]),S.jsx("div",{className:"react-flow__renderer",ref:_,style:Xl,children:y})}const z_=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function A_(){const{userSelectionActive:e,userSelectionRect:t}=se(z_,ve);return e&&t?S.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const Ha=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},$_=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function L_({isSelecting:e,selectionKeyPressed:t,selectionMode:n=fi.Full,panOnDrag:r,autoPanOnSelection:o,paneClickDistance:i,selectionOnDrag:s,onSelectionStart:l,onSelectionEnd:a,onPaneClick:u,onPaneContextMenu:c,onPaneScroll:d,onPaneMouseEnter:f,onPaneMouseMove:g,onPaneMouseLeave:y,children:v}){const x=k.useRef(0),p=he(),{userSelectionActive:m,elementsSelectable:h,dragging:w,panBy:C,autoPanSpeed:_}=se($_,ve),N=h&&(e||m),b=k.useRef(null),D=k.useRef(),A=k.useRef(new Set),j=k.useRef(new Set),H=k.useRef(!1),L=k.useRef(!1),E=k.useRef({x:0,y:0}),T=k.useRef(!1),P=F=>{if(L.current||H.current||p.getState().connection.inProgress){L.current=!1,H.current=!1;return}u==null||u(F),p.getState().resetSelectedElements(),p.setState({nodesSelectionActive:!1})},R=F=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){F.preventDefault();return}c==null||c(F)},I=d?F=>d(F):void 0,M=F=>{L.current&&(F.stopPropagation(),L.current=!1)},z=F=>{var ce,He;const{domNode:V,transform:X}=p.getState();if(D.current=V==null?void 0:V.getBoundingClientRect(),!D.current)return;const J=F.target===b.current;if(!J&&!!F.target.closest(".nokey")||!e||!(s&&J||t)||F.button!==0||!F.isPrimary)return;(He=(ce=F.target)==null?void 0:ce.setPointerCapture)==null||He.call(ce,F.pointerId),L.current=!1;const{x:te,y:ne}=jt(F.nativeEvent,D.current),re=Ii({x:te,y:ne},X);p.setState({userSelectionRect:{width:0,height:0,startX:re.x,startY:re.y,x:te,y:ne}}),J||(F.stopPropagation(),F.preventDefault())};function O(F,V){const{userSelectionRect:X}=p.getState();if(!X)return;const{transform:J,nodeLookup:Y,edgeLookup:K,connectionLookup:te,triggerNodeChanges:ne,triggerEdgeChanges:re,defaultEdgeOptions:ce}=p.getState(),He={x:X.startX,y:X.startY},{x:Ke,y:Ce}=no(He,J),Ge={startX:He.x,startY:He.y,x:F<Ke?F:Ke,y:V<Ce?V:Ce,width:Math.abs(F-Ke),height:Math.abs(V-Ce)},Ht=A.current,Bt=j.current;A.current=new Set(ud(Y,Ge,J,n===fi.Partial,!0).map(st=>st.id)),j.current=new Set;const Vt=(ce==null?void 0:ce.selectable)??!0;for(const st of A.current){const Ct=te.get(st);if(Ct)for(const{edgeId:Ae}of Ct.values()){const Ze=K.get(Ae);Ze&&(Ze.selectable??Vt)&&j.current.add(Ae)}}if(!gh(Ht,A.current)){const st=jr(Y,A.current,!0);ne(st)}if(!gh(Bt,j.current)){const st=jr(K,j.current);re(st)}p.setState({userSelectionRect:Ge,userSelectionActive:!0,nodesSelectionActive:!1})}function $(){if(!o||!D.current)return;const[F,V]=cd(E.current,D.current,_);C({x:F,y:V}).then(X=>{if(!L.current||!X){x.current=requestAnimationFrame($);return}const{x:J,y:Y}=E.current;O(J,Y),x.current=requestAnimationFrame($)})}const U=()=>{cancelAnimationFrame(x.current),x.current=0,T.current=!1};k.useEffect(()=>()=>U(),[]);const W=F=>{const{userSelectionRect:V,transform:X,resetSelectedElements:J}=p.getState();if(!D.current||!V)return;const{x:Y,y:K}=jt(F.nativeEvent,D.current);E.current={x:Y,y:K};const te=no({x:V.startX,y:V.startY},X);if(!L.current){const ne=t?0:i;if(Math.hypot(Y-te.x,K-te.y)<=ne)return;J(),l==null||l(F)}L.current=!0,T.current||($(),T.current=!0),O(Y,K)},Z=F=>{var V,X;if(!N){F.target===b.current&&p.getState().connection.inProgress&&(H.current=!0);return}F.button===0&&((X=(V=F.target)==null?void 0:V.releasePointerCapture)==null||X.call(V,F.pointerId),!m&&F.target===b.current&&p.getState().userSelectionRect&&(P==null||P(F)),p.setState({userSelectionActive:!1,userSelectionRect:null}),L.current&&(a==null||a(F),p.setState({nodesSelectionActive:A.current.size>0})),U())},G=F=>{var V,X;(X=(V=F.target)==null?void 0:V.releasePointerCapture)==null||X.call(V,F.pointerId),U()},q=r===!0||Array.isArray(r)&&r.includes(0);return S.jsxs("div",{className:ke(["react-flow__pane",{draggable:q,dragging:w,selection:e}]),onClick:N?void 0:Ha(P,b),onContextMenu:Ha(R,b),onWheel:Ha(I,b),onPointerEnter:N?void 0:f,onPointerMove:N?W:g,onPointerUp:Z,onPointerCancel:N?G:void 0,onPointerDownCapture:N?z:void 0,onClickCapture:N?M:void 0,onPointerLeave:y,ref:b,style:Xl,children:[v,S.jsx(A_,{})]})}function ec({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:o,unselectNodesAndEdges:i,multiSelectionActive:s,nodeLookup:l,onError:a}=t.getState(),u=l.get(e);if(!u){a==null||a("012",Lt.error012(e));return}t.setState({nodesSelectionActive:!1}),u.selected?(n||u.selected&&s)&&(i({nodes:[u],edges:[]}),requestAnimationFrame(()=>{var c;return(c=r==null?void 0:r.current)==null?void 0:c.blur()})):o([e])}function q0({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:o,isSelectable:i,nodeClickDistance:s}){const l=he(),[a,u]=k.useState(!1),c=k.useRef();return k.useEffect(()=>{if(!t)return c.current=cC({getStoreItems:()=>l.getState(),onNodeMouseDown:d=>{ec({id:d,store:l,nodeRef:e})},onDragStart:()=>{u(!0)},onDragStop:()=>{u(!1)}}),()=>{var d;(d=c.current)==null||d.destroy(),c.current=void 0}},[t,l,e]),k.useEffect(()=>{t||!e.current||!c.current||c.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:i,nodeId:o,nodeClickDistance:s})},[n,r,t,i,e,o,s]),a}const O_=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function J0(){const e=he();return k.useCallback(n=>{const{nodeExtent:r,snapToGrid:o,snapGrid:i,nodesDraggable:s,onError:l,updateNodePositions:a,nodeLookup:u,nodeOrigin:c}=e.getState(),d=new Map,f=O_(s),g=o?i[0]:5,y=o?i[1]:5,v=n.direction.x*g*n.factor,x=n.direction.y*y*n.factor;for(const[,p]of u){if(!f(p))continue;let m={x:p.internals.positionAbsolute.x+v,y:p.internals.positionAbsolute.y+x};o&&(m=Mi(m,i));const{position:h,positionAbsolute:w}=h0({nodeId:p.id,nextPosition:m,nodeLookup:u,nodeExtent:r,nodeOrigin:c,onError:l});p.position=h,p.internals.positionAbsolute=w,d.set(p.id,p)}a(d)},[])}const wd=k.createContext(null),F_=wd.Provider;wd.Consumer;const ey=()=>k.useContext(wd),H_=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),ty=k.createContext(null);function B_({children:e}){const t=se(H_,ve);return S.jsx(ty.Provider,{value:t,children:e})}function V_(){const e=k.useContext(ty);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const U_={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},W_=(e,t,n)=>r=>{const{connectionClickStartHandle:o,connectionMode:i,connection:s}=r,{fromHandle:l,toHandle:a,isValid:u}=s;if(!l&&!o)return U_;const c=(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n;return{connectingFrom:(l==null?void 0:l.nodeId)===e&&(l==null?void 0:l.id)===t&&(l==null?void 0:l.type)===n,connectingTo:c,clickConnecting:(o==null?void 0:o.nodeId)===e&&(o==null?void 0:o.id)===t&&(o==null?void 0:o.type)===n,isPossibleEndHandle:i===eo.Strict?(l==null?void 0:l.type)!==n:e!==(l==null?void 0:l.nodeId)||t!==(l==null?void 0:l.id),connectionInProcess:!!l,clickConnectionInProcess:!!o,valid:c&&u}};function X_({type:e="source",position:t=ee.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:o=!0,isConnectableEnd:i=!0,id:s,onConnect:l,children:a,className:u,onMouseDown:c,onTouchStart:d,...f},g){var T,P;const y=s||null,v=e==="target",x=he(),p=ey(),{connectOnClick:m,noPanClassName:h,rfId:w}=V_(),{connectingFrom:C,connectingTo:_,clickConnecting:N,isPossibleEndHandle:b,connectionInProcess:D,clickConnectionInProcess:A,valid:j}=se(W_(p,y,e),ve);p||(P=(T=x.getState()).onError)==null||P.call(T,"010",Lt.error010());const H=R=>{const{defaultEdgeOptions:I,onConnect:M,hasDefaultEdges:z}=x.getState(),O={...I,...R};if(z){const{edges:$,setEdges:U,onError:W}=x.getState();U(C_(O,$,{onError:W}))}M==null||M(O),l==null||l(O)},L=R=>{if(!p)return;const I=E0(R.nativeEvent);if(o&&(I&&R.button===0||!I)){const M=x.getState();Ju.onPointerDown(R.nativeEvent,{handleDomNode:R.currentTarget,autoPanOnConnect:M.autoPanOnConnect,connectionMode:M.connectionMode,connectionRadius:M.connectionRadius,domNode:M.domNode,nodeLookup:M.nodeLookup,lib:M.lib,isTarget:v,handleId:y,nodeId:p,flowId:M.rfId,panBy:M.panBy,cancelConnection:M.cancelConnection,onConnectStart:M.onConnectStart,onConnectEnd:(...z)=>{var O,$;return($=(O=x.getState()).onConnectEnd)==null?void 0:$.call(O,...z)},updateConnection:M.updateConnection,onConnect:H,isValidConnection:n||((...z)=>{var O,$;return(($=(O=x.getState()).isValidConnection)==null?void 0:$.call(O,...z))??!0}),getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,autoPanSpeed:M.autoPanSpeed,dragThreshold:M.connectionDragThreshold})}I?c==null||c(R):d==null||d(R)},E=R=>{const{onClickConnectStart:I,onClickConnectEnd:M,connectionClickStartHandle:z,connectionMode:O,isValidConnection:$,lib:U,rfId:W,nodeLookup:Z,connection:G}=x.getState();if(!p||!z&&!o)return;if(!z){I==null||I(R.nativeEvent,{nodeId:p,handleId:y,handleType:e}),x.setState({connectionClickStartHandle:{nodeId:p,type:e,id:y}});return}const q=x0(R.target),F=n||$,{connection:V,isValid:X}=Ju.isValid(R.nativeEvent,{handle:{nodeId:p,id:y,type:e},connectionMode:O,fromNodeId:z.nodeId,fromHandleId:z.id||null,fromType:z.type,isValidConnection:F,flowId:W,doc:q,lib:U,nodeLookup:Z});X&&V&&H(V);const J=structuredClone(G);delete J.inProgress,J.toPosition=J.toHandle?J.toHandle.position:null,M==null||M(R,J),x.setState({connectionClickStartHandle:null})};return S.jsx("div",{"data-handleid":y,"data-nodeid":p,"data-handlepos":t,"data-id":`${w}-${p}-${y}-${e}`,className:ke(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",h,u,{source:!v,target:v,connectable:r,connectablestart:o,connectableend:i,clickconnecting:N,connectingfrom:C,connectingto:_,valid:j,connectionindicator:r&&(!D||b)&&(D||A?i:o)}]),onMouseDown:L,onTouchStart:L,onClick:m?E:void 0,ref:g,...f,children:a})}const fl=k.memo(K0(X_));function Y_({data:e,isConnectable:t,sourcePosition:n=ee.Bottom}){return S.jsxs(S.Fragment,{children:[e==null?void 0:e.label,S.jsx(fl,{type:"source",position:n,isConnectable:t})]})}function Q_({data:e,isConnectable:t,targetPosition:n=ee.Top,sourcePosition:r=ee.Bottom}){return S.jsxs(S.Fragment,{children:[S.jsx(fl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,S.jsx(fl,{type:"source",position:r,isConnectable:t})]})}function K_(){return null}function G_({data:e,isConnectable:t,targetPosition:n=ee.Top}){return S.jsxs(S.Fragment,{children:[S.jsx(fl,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const hl={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Bh={input:Y_,default:Q_,output:G_,group:K_};function Z_(e){var t,n,r,o;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((o=e.style)==null?void 0:o.height)}}const q_=e=>{const{width:t,height:n,x:r,y:o}=bi(e.nodeLookup,{filter:i=>!!i.selected});return{width:Rt(t)?t:null,height:Rt(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${o}px)`}};function J_({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=he(),{width:o,height:i,transformString:s,userSelectionActive:l}=se(q_,ve),a=J0(),u=k.useRef(null);k.useEffect(()=>{var g;n||(g=u.current)==null||g.focus({preventScroll:!0})},[n]);const c=!l&&o!==null&&i!==null;if(q0({nodeRef:u,disabled:!c}),!c)return null;const d=e?g=>{const y=r.getState().nodes.filter(v=>v.selected);e(g,y)}:void 0,f=g=>{Object.prototype.hasOwnProperty.call(hl,g.key)&&(g.preventDefault(),a({direction:hl[g.key],factor:g.shiftKey?4:1}))};return S.jsx("div",{className:ke(["react-flow__nodesselection","react-flow__container",t]),style:{transform:s},children:S.jsx("div",{ref:u,className:"react-flow__nodesselection-rect",onContextMenu:d,tabIndex:n?void 0:-1,onKeyDown:n?void 0:f,style:{width:o,height:i}})})}const Vh=typeof window<"u"?window:void 0,eN=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function ny({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,paneClickDistance:l,deleteKeyCode:a,selectionKeyCode:u,selectionOnDrag:c,selectionMode:d,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:y,panActivationKeyCode:v,zoomActivationKeyCode:x,elementsSelectable:p,zoomOnScroll:m,zoomOnPinch:h,panOnScroll:w,panOnScrollSpeed:C,panOnScrollMode:_,zoomOnDoubleClick:N,panOnDrag:b,autoPanOnSelection:D,defaultViewport:A,translateExtent:j,minZoom:H,maxZoom:L,preventScrolling:E,onSelectionContextMenu:T,noWheelClassName:P,noPanClassName:R,disableKeyboardA11y:I,onViewportChange:M,isControlledViewport:z}){const{nodesSelectionActive:O,userSelectionActive:$}=se(eN,ve),U=gi(u,{target:Vh}),W=gi(v,{target:Vh}),Z=W||b,G=W||w,q=c&&Z!==!0,F=U||$||q;return D_({deleteKeyCode:a,multiSelectionKeyCode:y}),S.jsx(j_,{onPaneContextMenu:i,elementsSelectable:p,zoomOnScroll:m,zoomOnPinch:h,panOnScroll:G,panOnScrollSpeed:C,panOnScrollMode:_,zoomOnDoubleClick:N,panOnDrag:!U&&Z,defaultViewport:A,translateExtent:j,minZoom:H,maxZoom:L,zoomActivationKeyCode:x,preventScrolling:E,noWheelClassName:P,noPanClassName:R,onViewportChange:M,isControlledViewport:z,paneClickDistance:l,selectionOnDrag:q,children:S.jsxs(L_,{onSelectionStart:f,onSelectionEnd:g,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:o,onPaneContextMenu:i,onPaneScroll:s,panOnDrag:Z,autoPanOnSelection:D,isSelecting:!!F,selectionMode:d,selectionKeyPressed:U,paneClickDistance:l,selectionOnDrag:q,children:[e,O&&S.jsx(J_,{onSelectionContextMenu:T,noPanClassName:R,disableKeyboardA11y:I})]})})}ny.displayName="FlowRenderer";const tN=k.memo(ny),nN=e=>t=>e?ud(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function rN(e){return se(k.useCallback(nN(e),[e]),ve)}const oN=e=>e.updateNodeInternals;function iN(){const e=se(oN),[t]=k.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(o=>{const i=o.target.getAttribute("data-id");r.set(i,{id:i,nodeElement:o.target,force:!0})}),e(r)}));return k.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function sN({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const o=he(),i=k.useRef(null),s=k.useRef(null),l=k.useRef(e.sourcePosition),a=k.useRef(e.targetPosition),u=k.useRef(t),c=n&&!!e.internals.handleBounds;return k.useEffect(()=>{i.current&&!e.hidden&&(!c||s.current!==i.current)&&(s.current&&(r==null||r.unobserve(s.current)),r==null||r.observe(i.current),s.current=i.current)},[c,e.hidden]),k.useEffect(()=>()=>{s.current&&(r==null||r.unobserve(s.current),s.current=null)},[]),k.useEffect(()=>{if(i.current){const d=u.current!==t,f=l.current!==e.sourcePosition,g=a.current!==e.targetPosition;(d||f||g)&&(u.current=t,l.current=e.sourcePosition,a.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:i.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),i}function lN({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:o,onContextMenu:i,onDoubleClick:s,nodesDraggable:l,elementsSelectable:a,nodesConnectable:u,nodesFocusable:c,resizeObserver:d,noDragClassName:f,noPanClassName:g,disableKeyboardA11y:y,rfId:v,nodeTypes:x,nodeClickDistance:p,onError:m}){const{node:h,internals:w,isParent:C}=se(F=>{const V=F.nodeLookup.get(e),X=F.parentLookup.has(e);return{node:V,internals:V.internals,isParent:X}},ve);let _=h.type||"default",N=(x==null?void 0:x[_])||Bh[_];N===void 0&&(m==null||m("003",Lt.error003(_)),_="default",N=(x==null?void 0:x.default)||Bh.default);const b=!!(h.draggable||l&&typeof h.draggable>"u"),D=!!(h.selectable||a&&typeof h.selectable>"u"),A=!!(h.connectable||u&&typeof h.connectable>"u"),j=!!(h.focusable||c&&typeof h.focusable>"u"),H=he(),L=v0(h),E=sN({node:h,nodeType:_,hasDimensions:L,resizeObserver:d}),T=q0({nodeRef:E,disabled:h.hidden||!b,noDragClassName:f,handleSelector:h.dragHandle,nodeId:e,isSelectable:D,nodeClickDistance:p}),P=J0();if(h.hidden)return null;const R=rn(h),I=Z_(h),M=D||b||t||n||r||o,z=n?F=>n(F,{...w.userNode}):void 0,O=r?F=>r(F,{...w.userNode}):void 0,$=o?F=>o(F,{...w.userNode}):void 0,U=i?F=>i(F,{...w.userNode}):void 0,W=s?F=>s(F,{...w.userNode}):void 0,Z=F=>{const{selectNodesOnDrag:V,nodeDragThreshold:X}=H.getState();D&&(!V||!b||X>0)&&ec({id:e,store:H,nodeRef:E}),t&&t(F,{...w.userNode})},G=F=>{if(!(S0(F.nativeEvent)||y)){if(a0.includes(F.key)&&D){const V=F.key==="Escape";ec({id:e,store:H,unselect:V,nodeRef:E})}else if(b&&h.selected&&Object.prototype.hasOwnProperty.call(hl,F.key)){F.preventDefault();const{ariaLabelConfig:V}=H.getState();H.setState({ariaLiveMessage:V["node.a11yDescription.ariaLiveMessage"]({direction:F.key.replace("Arrow","").toLowerCase(),x:~~w.positionAbsolute.x,y:~~w.positionAbsolute.y})}),P({direction:hl[F.key],factor:F.shiftKey?4:1})}}},q=()=>{var te;if(y||!((te=E.current)!=null&&te.matches(":focus-visible")))return;const{transform:F,width:V,height:X,autoPanOnNodeFocus:J,setCenter:Y}=H.getState();if(!J)return;ud(new Map([[e,h]]),{x:0,y:0,width:V,height:X},F,!0).length>0||Y(h.position.x+R.width/2,h.position.y+R.height/2,{zoom:F[2]})};return S.jsx("div",{className:ke(["react-flow__node",`react-flow__node-${_}`,{[g]:b},h.className,{selected:h.selected,selectable:D,parent:C,draggable:b,dragging:T}]),ref:E,style:{zIndex:w.z,transform:`translate(${w.positionAbsolute.x}px,${w.positionAbsolute.y}px)`,pointerEvents:M?"all":"none",visibility:L?"visible":"hidden",...h.style,...I},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:z,onMouseMove:O,onMouseLeave:$,onContextMenu:U,onClick:Z,onDoubleClick:W,onKeyDown:j?G:void 0,tabIndex:j?0:void 0,onFocus:j?q:void 0,role:h.ariaRole??(j?"group":void 0),"aria-roledescription":"node","aria-describedby":y?void 0:`${U0}-${v}`,"aria-label":h.ariaLabel,...h.domAttributes,children:S.jsx(F_,{value:e,children:S.jsx(N,{id:e,data:h.data,type:_,positionAbsoluteX:w.positionAbsolute.x,positionAbsoluteY:w.positionAbsolute.y,selected:h.selected??!1,selectable:D,draggable:b,deletable:h.deletable??!0,isConnectable:A,sourcePosition:h.sourcePosition,targetPosition:h.targetPosition,dragging:T,dragHandle:h.dragHandle,zIndex:w.z,parentId:h.parentId,...R})})})}var aN=k.memo(lN);const uN=e=>({nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function ry(e){const{nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,onError:o}=se(uN,ve),i=rN(e.onlyRenderVisibleElements),s=iN();return S.jsx("div",{className:"react-flow__nodes",style:Xl,children:i.map(l=>S.jsx(aN,{id:l,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:s,nodesDraggable:e.nodesDraggable??!0,nodesConnectable:t,nodesFocusable:n,elementsSelectable:r,nodeClickDistance:e.nodeClickDistance,onError:o},l))})}ry.displayName="NodeRenderer";const cN=k.memo(ry);function dN(e){return se(k.useCallback(n=>{if(!e)return n.edges.map(o=>o.id);const r=[];if(n.width&&n.height)for(const o of n.edges){const i=n.nodeLookup.get(o.source),s=n.nodeLookup.get(o.target);i&&s&&Wk({sourceNode:i,targetNode:s,width:n.width,height:n.height,transform:n.transform})&&r.push(o.id)}return r},[e]),ve)}const fN=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return S.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},hN=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return S.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Uh={[ul.Arrow]:fN,[ul.ArrowClosed]:hN};function pN(e){const t=he();return k.useMemo(()=>{var o,i;return Object.prototype.hasOwnProperty.call(Uh,e)?Uh[e]:((i=(o=t.getState()).onError)==null||i.call(o,"009",Lt.error009(e)),null)},[e])}const gN=({id:e,type:t,color:n,width:r=12.5,height:o=12.5,markerUnits:i="strokeWidth",strokeWidth:s,orient:l="auto-start-reverse"})=>{const a=pN(t);return a?S.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:i,orient:l,refX:"0",refY:"0",children:S.jsx(a,{color:n,strokeWidth:s})}):null},oy=({defaultColor:e,rfId:t})=>{const n=se(i=>i.edges),r=se(i=>i.defaultEdgeOptions),o=k.useMemo(()=>Jk(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return o.length?S.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:S.jsx("defs",{children:o.map(i=>S.jsx(gN,{id:i.id,type:i.type,color:i.color,width:i.width,height:i.height,markerUnits:i.markerUnits,strokeWidth:i.strokeWidth,orient:i.orient},i.id))})}):null};oy.displayName="MarkerDefinitions";var mN=k.memo(oy);function iy({x:e,y:t,label:n,labelStyle:r,labelShowBg:o=!0,labelBgStyle:i,labelBgPadding:s=[2,4],labelBgBorderRadius:l=2,children:a,className:u,...c}){const[d,f]=k.useState({x:1,y:0,width:0,height:0}),g=ke(["react-flow__edge-textwrapper",u]),y=k.useRef(null);return k.useEffect(()=>{if(y.current){const v=y.current.getBBox();f({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?S.jsxs("g",{transform:`translate(${e-d.width/2} ${t-d.height/2})`,className:g,visibility:d.width?"visible":"hidden",...c,children:[o&&S.jsx("rect",{width:d.width+2*s[0],x:-s[0],y:-s[1],height:d.height+2*s[1],className:"react-flow__edge-textbg",style:i,rx:l,ry:l}),S.jsx("text",{className:"react-flow__edge-text",y:d.height/2,dy:"0.3em",ref:y,style:r,children:n}),a]}):null}iy.displayName="EdgeText";const yN=k.memo(iy);function Yl({path:e,labelX:t,labelY:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a,interactionWidth:u=20,...c}){return S.jsxs(S.Fragment,{children:[S.jsx("path",{...c,d:e,fill:"none",className:ke(["react-flow__edge-path",c.className])}),u?S.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:u,className:"react-flow__edge-interaction"}):null,r&&Rt(t)&&Rt(n)?S.jsx(yN,{x:t,y:n,label:r,labelStyle:o,labelShowBg:i,labelBgStyle:s,labelBgPadding:l,labelBgBorderRadius:a}):null]})}function Wh({pos:e,x1:t,y1:n,x2:r,y2:o}){return e===ee.Left||e===ee.Right?[.5*(t+r),n]:[t,.5*(n+o)]}function sy({sourceX:e,sourceY:t,sourcePosition:n=ee.Bottom,targetX:r,targetY:o,targetPosition:i=ee.Top}){const[s,l]=Wh({pos:n,x1:e,y1:t,x2:r,y2:o}),[a,u]=Wh({pos:i,x1:r,y1:o,x2:e,y2:t}),[c,d,f,g]=k0({sourceX:e,sourceY:t,targetX:r,targetY:o,sourceControlX:s,sourceControlY:l,targetControlX:a,targetControlY:u});return[`M${e},${t} C${s},${l} ${a},${u} ${r},${o}`,c,d,f,g]}function ly(e){return k.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s,targetPosition:l,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:x,interactionWidth:p})=>{const[m,h,w]=sy({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l}),C=e.isInternal?void 0:t;return S.jsx(Yl,{id:C,path:m,labelX:h,labelY:w,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:x,interactionWidth:p})})}const vN=ly({isInternal:!1}),ay=ly({isInternal:!0});vN.displayName="SimpleBezierEdge";ay.displayName="SimpleBezierEdgeInternal";function uy(e){return k.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,sourcePosition:g=ee.Bottom,targetPosition:y=ee.Top,markerEnd:v,markerStart:x,pathOptions:p,interactionWidth:m})=>{const[h,w,C]=Gu({sourceX:n,sourceY:r,sourcePosition:g,targetX:o,targetY:i,targetPosition:y,borderRadius:p==null?void 0:p.borderRadius,offset:p==null?void 0:p.offset,stepPosition:p==null?void 0:p.stepPosition}),_=e.isInternal?void 0:t;return S.jsx(Yl,{id:_,path:h,labelX:w,labelY:C,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:v,markerStart:x,interactionWidth:m})})}const cy=uy({isInternal:!1}),dy=uy({isInternal:!0});cy.displayName="SmoothStepEdge";dy.displayName="SmoothStepEdgeInternal";function fy(e){return k.memo(({id:t,...n})=>{var o;const r=e.isInternal?void 0:t;return S.jsx(cy,{...n,id:r,pathOptions:k.useMemo(()=>{var i;return{borderRadius:0,offset:(i=n.pathOptions)==null?void 0:i.offset}},[(o=n.pathOptions)==null?void 0:o.offset])})})}const wN=fy({isInternal:!1}),hy=fy({isInternal:!0});wN.displayName="StepEdge";hy.displayName="StepEdgeInternal";function py(e){return k.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:y,interactionWidth:v})=>{const[x,p,m]=N0({sourceX:n,sourceY:r,targetX:o,targetY:i}),h=e.isInternal?void 0:t;return S.jsx(Yl,{id:h,path:x,labelX:p,labelY:m,label:s,labelStyle:l,labelShowBg:a,labelBgStyle:u,labelBgPadding:c,labelBgBorderRadius:d,style:f,markerEnd:g,markerStart:y,interactionWidth:v})})}const xN=py({isInternal:!1}),gy=py({isInternal:!0});xN.displayName="StraightEdge";gy.displayName="StraightEdgeInternal";function my(e){return k.memo(({id:t,sourceX:n,sourceY:r,targetX:o,targetY:i,sourcePosition:s=ee.Bottom,targetPosition:l=ee.Top,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:x,pathOptions:p,interactionWidth:m})=>{const[h,w,C]=C0({sourceX:n,sourceY:r,sourcePosition:s,targetX:o,targetY:i,targetPosition:l,curvature:p==null?void 0:p.curvature}),_=e.isInternal?void 0:t;return S.jsx(Yl,{id:_,path:h,labelX:w,labelY:C,label:a,labelStyle:u,labelShowBg:c,labelBgStyle:d,labelBgPadding:f,labelBgBorderRadius:g,style:y,markerEnd:v,markerStart:x,interactionWidth:m})})}const SN=my({isInternal:!1}),yy=my({isInternal:!0});SN.displayName="BezierEdge";yy.displayName="BezierEdgeInternal";const Xh={default:yy,straight:gy,step:hy,smoothstep:dy,simplebezier:ay},Yh={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},EN=(e,t,n)=>n===ee.Left?e-t:n===ee.Right?e+t:e,kN=(e,t,n)=>n===ee.Top?e-t:n===ee.Bottom?e+t:e,Qh="react-flow__edgeupdater";function Kh({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:o,onMouseEnter:i,onMouseOut:s,type:l}){return S.jsx("circle",{onMouseDown:o,onMouseEnter:i,onMouseOut:s,className:ke([Qh,`${Qh}-${l}`]),cx:EN(t,r,e),cy:kN(n,r,e),r,stroke:"transparent",fill:"transparent"})}function CN({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:o,targetX:i,targetY:s,sourcePosition:l,targetPosition:a,onReconnect:u,onReconnectStart:c,onReconnectEnd:d,setReconnecting:f,setUpdateHover:g}){const y=he(),v=(w,C)=>{if(w.button!==0)return;const{autoPanOnConnect:_,domNode:N,connectionMode:b,connectionRadius:D,lib:A,onConnectStart:j,cancelConnection:H,nodeLookup:L,rfId:E,panBy:T,updateConnection:P}=y.getState(),R=C.type==="target",I=(O,$)=>{f(!1),d==null||d(O,n,C.type,$)},M=O=>u==null?void 0:u(n,O),z=(O,$)=>{f(!0),c==null||c(w,n,C.type),j==null||j(O,$)};Ju.onPointerDown(w.nativeEvent,{autoPanOnConnect:_,connectionMode:b,connectionRadius:D,domNode:N,handleId:C.id,nodeId:C.nodeId,nodeLookup:L,isTarget:R,edgeUpdaterType:C.type,lib:A,flowId:E,cancelConnection:H,panBy:T,isValidConnection:(...O)=>{var $,U;return((U=($=y.getState()).isValidConnection)==null?void 0:U.call($,...O))??!0},onConnect:M,onConnectStart:z,onConnectEnd:(...O)=>{var $,U;return(U=($=y.getState()).onConnectEnd)==null?void 0:U.call($,...O)},onReconnectEnd:I,updateConnection:P,getTransform:()=>y.getState().transform,getFromHandle:()=>y.getState().connection.fromHandle,dragThreshold:y.getState().connectionDragThreshold,handleDomNode:w.currentTarget})},x=w=>v(w,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),p=w=>v(w,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),m=()=>g(!0),h=()=>g(!1);return S.jsxs(S.Fragment,{children:[(e===!0||e==="source")&&S.jsx(Kh,{position:l,centerX:r,centerY:o,radius:t,onMouseDown:x,onMouseEnter:m,onMouseOut:h,type:"source"}),(e===!0||e==="target")&&S.jsx(Kh,{position:a,centerX:i,centerY:s,radius:t,onMouseDown:p,onMouseEnter:m,onMouseOut:h,type:"target"})]})}function _N({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:o,onDoubleClick:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:g,rfId:y,edgeTypes:v,noPanClassName:x,onError:p,disableKeyboardA11y:m}){let h=se(Y=>Y.edgeLookup.get(e));const w=se(Y=>Y.defaultEdgeOptions);h=w?{...w,...h}:h;let C=h.type||"default",_=(v==null?void 0:v[C])||Xh[C];_===void 0&&(p==null||p("011",Lt.error011(C)),C="default",_=(v==null?void 0:v.default)||Xh.default);const N=!!(h.focusable||t&&typeof h.focusable>"u"),b=typeof d<"u"&&(h.reconnectable||n&&typeof h.reconnectable>"u"),D=!!(h.selectable||r&&typeof h.selectable>"u"),A=k.useRef(null),[j,H]=k.useState(!1),[L,E]=k.useState(!1),T=he(),{zIndex:P=h.zIndex,sourceX:R,sourceY:I,targetX:M,targetY:z,sourcePosition:O,targetPosition:$}=se(k.useCallback(Y=>{const K=Y.nodeLookup.get(h.source),te=Y.nodeLookup.get(h.target);if(!K||!te)return Yh;const ne=qk({id:e,sourceNode:K,targetNode:te,sourceHandle:h.sourceHandle||null,targetHandle:h.targetHandle||null,connectionMode:Y.connectionMode,onError:p}),re=Uk({selected:h.selected,zIndex:h.zIndex,sourceNode:K,targetNode:te,elevateOnSelect:Y.elevateEdgesOnSelect,zIndexMode:Y.zIndexMode});return{...ne||Yh,zIndex:re}},[h.source,h.target,h.sourceHandle,h.targetHandle,h.selected,h.zIndex]),ve),U=k.useMemo(()=>h.markerStart?`url('#${Zu(h.markerStart,y)}')`:void 0,[h.markerStart,y]),W=k.useMemo(()=>h.markerEnd?`url('#${Zu(h.markerEnd,y)}')`:void 0,[h.markerEnd,y]);if(h.hidden||R===null||I===null||M===null||z===null)return null;const Z=Y=>{var re;const{addSelectedEdges:K,unselectNodesAndEdges:te,multiSelectionActive:ne}=T.getState();D&&(T.setState({nodesSelectionActive:!1}),h.selected&&ne?(te({nodes:[],edges:[h]}),(re=A.current)==null||re.blur()):K([e])),o&&o(Y,h)},G=i?Y=>{i(Y,{...h})}:void 0,q=s?Y=>{s(Y,{...h})}:void 0,F=l?Y=>{l(Y,{...h})}:void 0,V=a?Y=>{a(Y,{...h})}:void 0,X=u?Y=>{u(Y,{...h})}:void 0,J=Y=>{var K;if(!m&&a0.includes(Y.key)&&D){const{unselectNodesAndEdges:te,addSelectedEdges:ne}=T.getState();Y.key==="Escape"?((K=A.current)==null||K.blur(),te({edges:[h]})):ne([e])}};return S.jsx("svg",{style:{zIndex:P},children:S.jsxs("g",{className:ke(["react-flow__edge",`react-flow__edge-${C}`,h.className,x,{selected:h.selected,animated:h.animated,inactive:!D&&!o,updating:j,selectable:D}]),onClick:Z,onDoubleClick:G,onContextMenu:q,onMouseEnter:F,onMouseMove:V,onMouseLeave:X,onKeyDown:N?J:void 0,tabIndex:N?0:void 0,role:h.ariaRole??(N?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":h.ariaLabel===null?void 0:h.ariaLabel||`Edge from ${h.source} to ${h.target}`,"aria-describedby":N?`${W0}-${y}`:void 0,ref:A,...h.domAttributes,children:[!L&&S.jsx(_,{id:e,source:h.source,target:h.target,type:h.type,selected:h.selected,animated:h.animated,selectable:D,deletable:h.deletable??!0,label:h.label,labelStyle:h.labelStyle,labelShowBg:h.labelShowBg,labelBgStyle:h.labelBgStyle,labelBgPadding:h.labelBgPadding,labelBgBorderRadius:h.labelBgBorderRadius,sourceX:R,sourceY:I,targetX:M,targetY:z,sourcePosition:O,targetPosition:$,data:h.data,style:h.style,sourceHandleId:h.sourceHandle,targetHandleId:h.targetHandle,markerStart:U,markerEnd:W,pathOptions:"pathOptions"in h?h.pathOptions:void 0,interactionWidth:h.interactionWidth}),b&&S.jsx(CN,{edge:h,isReconnectable:b,reconnectRadius:c,onReconnect:d,onReconnectStart:f,onReconnectEnd:g,sourceX:R,sourceY:I,targetX:M,targetY:z,sourcePosition:O,targetPosition:$,setUpdateHover:H,setReconnecting:E})]})})}var NN=k.memo(_N);const bN=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function vy({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:o,onReconnect:i,onEdgeContextMenu:s,onEdgeMouseEnter:l,onEdgeMouseMove:a,onEdgeMouseLeave:u,onEdgeClick:c,reconnectRadius:d,onEdgeDoubleClick:f,onReconnectStart:g,onReconnectEnd:y,disableKeyboardA11y:v}){const{edgesFocusable:x,edgesReconnectable:p,elementsSelectable:m,onError:h}=se(bN,ve),w=dN(t);return S.jsxs("div",{className:"react-flow__edges",children:[S.jsx(mN,{defaultColor:e,rfId:n}),w.map(C=>S.jsx(NN,{id:C,edgesFocusable:x,edgesReconnectable:p,elementsSelectable:m,noPanClassName:o,onReconnect:i,onContextMenu:s,onMouseEnter:l,onMouseMove:a,onMouseLeave:u,onClick:c,reconnectRadius:d,onDoubleClick:f,onReconnectStart:g,onReconnectEnd:y,rfId:n,onError:h,edgeTypes:r,disableKeyboardA11y:v},C))]})}vy.displayName="EdgeRenderer";const MN=k.memo(vy),Gh=e=>`translate(${e[0]}px,${e[1]}px) scale(${e[2]})`;function IN({children:e}){const t=he(),n=k.useRef(null),[r]=k.useState(()=>t.getState().transform);return G0(()=>{let o=null;const i=()=>{const s=t.getState().transform;o&&s[0]===o[0]&&s[1]===o[1]&&s[2]===o[2]||(o=s,n.current&&(n.current.style.transform=Gh(s)))};return i(),t.subscribe(i)},[t]),S.jsx("div",{ref:n,className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:Gh(r)},children:e})}function PN(e){const t=vd(),n=k.useRef(!1);k.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const DN=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function TN(e){const t=se(DN),n=he();return k.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function RN(e){return e.connection.inProgress?{...e.connection,to:Ii(e.connection.to,e.transform)}:{...e.connection}}function jN(e){return RN}function zN(e){const t=jN();return se(t,ve)}const AN=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function $N({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:o,width:i,height:s,isValid:l,inProgress:a}=se(AN,ve);return!(i&&o&&a)?null:S.jsx("svg",{style:e,width:i,height:s,className:"react-flow__connectionline react-flow__container",children:S.jsx("g",{className:ke(["react-flow__connection",d0(l)]),children:S.jsx(wy,{style:t,type:n,CustomComponent:r,isValid:l})})})}const wy=({style:e,type:t=Mn.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:o,from:i,fromNode:s,fromHandle:l,fromPosition:a,to:u,toNode:c,toHandle:d,toPosition:f,pointer:g}=zN();if(!o)return;if(n)return S.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:s,fromHandle:l,fromX:i.x,fromY:i.y,toX:u.x,toY:u.y,fromPosition:a,toPosition:f,connectionStatus:d0(r),toNode:c,toHandle:d,pointer:g});let y="";const v={sourceX:i.x,sourceY:i.y,sourcePosition:a,targetX:u.x,targetY:u.y,targetPosition:f};switch(t){case Mn.Bezier:[y]=C0(v);break;case Mn.SimpleBezier:[y]=sy(v);break;case Mn.Step:[y]=Gu({...v,borderRadius:0});break;case Mn.SmoothStep:[y]=Gu(v);break;default:[y]=N0(v)}return S.jsx("path",{d:y,fill:"none",className:"react-flow__connection-path",style:e})};wy.displayName="ConnectionLine";const LN={};function Zh(e=LN){k.useRef(e),he(),k.useEffect(()=>{},[e])}function ON(){he(),k.useRef(!1),k.useEffect(()=>{},[])}function xy({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:o,onNodeDoubleClick:i,onEdgeDoubleClick:s,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,onSelectionContextMenu:d,onSelectionStart:f,onSelectionEnd:g,connectionLineType:y,connectionLineStyle:v,connectionLineComponent:x,connectionLineContainerStyle:p,selectionKeyCode:m,selectionOnDrag:h,selectionMode:w,multiSelectionKeyCode:C,panActivationKeyCode:_,zoomActivationKeyCode:N,deleteKeyCode:b,onlyRenderVisibleElements:D,elementsSelectable:A,defaultViewport:j,translateExtent:H,minZoom:L,maxZoom:E,preventScrolling:T,defaultMarkerColor:P,zoomOnScroll:R,zoomOnPinch:I,panOnScroll:M,panOnScrollSpeed:z,panOnScrollMode:O,zoomOnDoubleClick:$,panOnDrag:U,autoPanOnSelection:W,onPaneClick:Z,onPaneMouseEnter:G,onPaneMouseMove:q,onPaneMouseLeave:F,onPaneScroll:V,onPaneContextMenu:X,paneClickDistance:J,nodeClickDistance:Y,onEdgeContextMenu:K,onEdgeMouseEnter:te,onEdgeMouseMove:ne,onEdgeMouseLeave:re,reconnectRadius:ce,onReconnect:He,onReconnectStart:Ke,onReconnectEnd:Ce,noDragClassName:Ge,noWheelClassName:Ht,noPanClassName:Bt,disableKeyboardA11y:Vt,nodeExtent:st,rfId:Ct,viewport:Ae,onViewportChange:Ze,nodesDraggable:on}){return Zh(e),Zh(t),ON(),PN(n),TN(Ae),S.jsx(tN,{onPaneClick:Z,onPaneMouseEnter:G,onPaneMouseMove:q,onPaneMouseLeave:F,onPaneContextMenu:X,onPaneScroll:V,paneClickDistance:J,deleteKeyCode:b,selectionKeyCode:m,selectionOnDrag:h,selectionMode:w,onSelectionStart:f,onSelectionEnd:g,multiSelectionKeyCode:C,panActivationKeyCode:_,zoomActivationKeyCode:N,elementsSelectable:A,zoomOnScroll:R,zoomOnPinch:I,zoomOnDoubleClick:$,panOnScroll:M,panOnScrollSpeed:z,panOnScrollMode:O,panOnDrag:U,autoPanOnSelection:W,defaultViewport:j,translateExtent:H,minZoom:L,maxZoom:E,onSelectionContextMenu:d,preventScrolling:T,noDragClassName:Ge,noWheelClassName:Ht,noPanClassName:Bt,disableKeyboardA11y:Vt,onViewportChange:Ze,isControlledViewport:!!Ae,children:S.jsxs(IN,{children:[S.jsx(MN,{edgeTypes:t,onEdgeClick:o,onEdgeDoubleClick:s,onReconnect:He,onReconnectStart:Ke,onReconnectEnd:Ce,onlyRenderVisibleElements:D,onEdgeContextMenu:K,onEdgeMouseEnter:te,onEdgeMouseMove:ne,onEdgeMouseLeave:re,reconnectRadius:ce,defaultMarkerColor:P,noPanClassName:Bt,disableKeyboardA11y:Vt,rfId:Ct}),S.jsx($N,{style:v,type:y,component:x,containerStyle:p}),S.jsx("div",{className:"react-flow__edgelabel-renderer"}),S.jsx(cN,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:i,onNodeMouseEnter:l,onNodeMouseMove:a,onNodeMouseLeave:u,onNodeContextMenu:c,nodeClickDistance:Y,onlyRenderVisibleElements:D,noPanClassName:Bt,noDragClassName:Ge,disableKeyboardA11y:Vt,nodeExtent:st,rfId:Ct,nodesDraggable:on}),S.jsx("div",{className:"react-flow__viewport-portal"})]})})}xy.displayName="GraphView";const FN=k.memo(xy),HN=y0(),qh=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a=.5,maxZoom:u=2,nodeOrigin:c,nodeExtent:d,zIndexMode:f="basic"}={})=>{const g=new Map,y=new Map,v=new Map,x=new Map,p=r??t??[],m=n??e??[],h=c??[0,0],w=d??di;I0(v,x,p);const{nodesInitialized:C}=qu(m,g,y,{nodeOrigin:h,nodeExtent:w,zIndexMode:f});let _=[0,0,1];if(s&&o&&i){const N=bi(g,{filter:j=>!!((j.width||j.initialWidth)&&(j.height||j.initialHeight))}),{x:b,y:D,zoom:A}=dd(N,o,i,a,u,(l==null?void 0:l.padding)??.1);_=[b,D,A]}return{rfId:"1",width:o??0,height:i??0,transform:_,nodes:m,nodesInitialized:C,nodeLookup:g,parentLookup:y,edges:p,edgeLookup:x,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:a,maxZoom:u,translateExtent:di,nodeExtent:w,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:eo.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:h,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:s??!1,fitViewOptions:l,fitViewResolver:null,connection:{...c0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:HN,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:u0,zIndexMode:f,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},BN=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f})=>t_((g,y)=>{async function v(){const{nodeLookup:x,panZoom:p,fitViewOptions:m,fitViewResolver:h,width:w,height:C,minZoom:_,maxZoom:N}=y();p&&(await $k({nodes:x,width:w,height:C,panZoom:p,minZoom:_,maxZoom:N},m),h==null||h.resolve(!0),g({fitViewResolver:null}))}return{...qh({nodes:e,edges:t,width:o,height:i,fitView:s,fitViewOptions:l,minZoom:a,maxZoom:u,nodeOrigin:c,nodeExtent:d,defaultNodes:n,defaultEdges:r,zIndexMode:f}),setNodes:x=>{const{nodeLookup:p,parentLookup:m,nodeOrigin:h,elevateNodesOnSelect:w,fitViewQueued:C,zIndexMode:_,nodesSelectionActive:N}=y(),{nodesInitialized:b,hasSelectedNodes:D}=qu(x,p,m,{nodeOrigin:h,nodeExtent:d,elevateNodesOnSelect:w,checkEquality:!0,zIndexMode:_}),A=N&&D;C&&b?(v(),g({nodes:x,nodesInitialized:b,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:A})):g({nodes:x,nodesInitialized:b,nodesSelectionActive:A})},setEdges:x=>{const{connectionLookup:p,edgeLookup:m}=y();I0(p,m,x),g({edges:x})},setDefaultNodesAndEdges:(x,p)=>{if(x){const{setNodes:m}=y();m(x),g({hasDefaultNodes:!0})}if(p){const{setEdges:m}=y();m(p),g({hasDefaultEdges:!0})}},updateNodeInternals:x=>{const{triggerNodeChanges:p,nodeLookup:m,parentLookup:h,domNode:w,nodeOrigin:C,nodeExtent:_,debug:N,fitViewQueued:b,zIndexMode:D}=y(),{changes:A,updatedInternals:j}=sC(x,m,h,w,C,_,D);j&&(nC(m,h,{nodeOrigin:C,nodeExtent:_,zIndexMode:D}),b?(v(),g({fitViewQueued:!1,fitViewOptions:void 0})):g({}),(A==null?void 0:A.length)>0&&(N&&console.log("React Flow: trigger node changes",A),p==null||p(A)))},updateNodePositions:(x,p=!1)=>{const m=[];let h=[];const{nodeLookup:w,triggerNodeChanges:C,connection:_,updateConnection:N,onNodesChangeMiddlewareMap:b}=y();for(const[D,A]of x){const j=w.get(D),H=!!(j!=null&&j.expandParent&&(j!=null&&j.parentId)&&(A!=null&&A.position)),L={id:D,type:"position",position:H?{x:Math.max(0,A.position.x),y:Math.max(0,A.position.y)}:A.position,dragging:p};if(j&&_.inProgress&&_.fromNode.id===j.id){const E=pr(j,_.fromHandle,ee.Left,!0);N({..._,from:E})}H&&j.parentId&&m.push({id:D,parentId:j.parentId,rect:{...A.internals.positionAbsolute,width:A.measured.width??0,height:A.measured.height??0}}),h.push(L)}if(m.length>0){const{parentLookup:D,nodeOrigin:A}=y(),j=yd(m,w,D,A);h.push(...j)}for(const D of b.values())h=D(h);C(h)},triggerNodeChanges:x=>{const{onNodesChange:p,setNodes:m,nodes:h,hasDefaultNodes:w,debug:C}=y();if(x!=null&&x.length){if(w){const _=Q0(x,h);m(_)}C&&console.log("React Flow: trigger node changes",x),p==null||p(x)}},triggerEdgeChanges:x=>{const{onEdgesChange:p,setEdges:m,edges:h,hasDefaultEdges:w,debug:C}=y();if(x!=null&&x.length){if(w){const _=E_(x,h);m(_)}C&&console.log("React Flow: trigger edge changes",x),p==null||p(x)}},addSelectedNodes:x=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:h,triggerNodeChanges:w,triggerEdgeChanges:C}=y();if(p){const _=x.map(N=>Gn(N,!0));w(_);return}w(jr(h,new Set([...x]),!0)),C(jr(m))},addSelectedEdges:x=>{const{multiSelectionActive:p,edgeLookup:m,nodeLookup:h,triggerNodeChanges:w,triggerEdgeChanges:C}=y();if(p){const _=x.map(N=>Gn(N,!0));C(_);return}C(jr(m,new Set([...x]))),w(jr(h,new Set,!0))},unselectNodesAndEdges:({nodes:x,edges:p}={})=>{const{edges:m,nodes:h,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:_}=y(),N=x||h,b=p||m,D=[];for(const j of N){if(!j.selected)continue;const H=w.get(j.id);H&&(H.selected=!1),D.push(Gn(j.id,!1))}const A=[];for(const j of b)j.selected&&A.push(Gn(j.id,!1));C(D),_(A)},setMinZoom:x=>{const{panZoom:p,maxZoom:m}=y();p==null||p.setScaleExtent([x,m]),g({minZoom:x})},setMaxZoom:x=>{const{panZoom:p,minZoom:m}=y();p==null||p.setScaleExtent([m,x]),g({maxZoom:x})},setTranslateExtent:x=>{var p;(p=y().panZoom)==null||p.setTranslateExtent(x),g({translateExtent:x})},resetSelectedElements:()=>{const{edges:x,nodes:p,triggerNodeChanges:m,triggerEdgeChanges:h,elementsSelectable:w}=y();if(!w)return;const C=p.reduce((N,b)=>b.selected?[...N,Gn(b.id,!1)]:N,[]),_=x.reduce((N,b)=>b.selected?[...N,Gn(b.id,!1)]:N,[]);m(C),h(_)},setNodeExtent:x=>{const{nodes:p,nodeLookup:m,parentLookup:h,nodeOrigin:w,elevateNodesOnSelect:C,nodeExtent:_,zIndexMode:N}=y();x[0][0]===_[0][0]&&x[0][1]===_[0][1]&&x[1][0]===_[1][0]&&x[1][1]===_[1][1]||(qu(p,m,h,{nodeOrigin:w,nodeExtent:x,elevateNodesOnSelect:C,checkEquality:!1,zIndexMode:N}),g({nodeExtent:x}))},panBy:x=>{const{transform:p,width:m,height:h,panZoom:w,translateExtent:C}=y();return lC({delta:x,panZoom:w,transform:p,translateExtent:C,width:m,height:h})},setCenter:async(x,p,m)=>{const{width:h,height:w,maxZoom:C,panZoom:_}=y();if(!_)return!1;const N=typeof(m==null?void 0:m.zoom)<"u"?m.zoom:C;return await _.setViewport({x:h/2-x*N,y:w/2-p*N,zoom:N},{duration:m==null?void 0:m.duration,ease:m==null?void 0:m.ease,interpolate:m==null?void 0:m.interpolate}),!0},cancelConnection:()=>{g({connection:{...c0}})},updateConnection:x=>{g({connection:x})},reset:()=>g({...qh()})}},Object.is);function VN({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:o,initialHeight:i,initialMinZoom:s,initialMaxZoom:l,initialFitViewOptions:a,fitView:u,nodeOrigin:c,nodeExtent:d,zIndexMode:f,children:g}){const[y]=k.useState(()=>BN({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:o,height:i,fitView:u,minZoom:s,maxZoom:l,fitViewOptions:a,nodeOrigin:c,nodeExtent:d,zIndexMode:f}));return S.jsx(n_,{value:y,children:S.jsx(b_,{children:S.jsx(B_,{children:g})})})}function UN({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:o,width:i,height:s,fitView:l,fitViewOptions:a,minZoom:u,maxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:g}){return k.useContext(Ul)?S.jsx(S.Fragment,{children:e}):S.jsx(VN,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:o,initialWidth:i,initialHeight:s,fitView:l,initialFitViewOptions:a,initialMinZoom:u,initialMaxZoom:c,nodeOrigin:d,nodeExtent:f,zIndexMode:g,children:e})}const WN={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function XN({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:o,nodeTypes:i,edgeTypes:s,onNodeClick:l,onEdgeClick:a,onInit:u,onMove:c,onMoveStart:d,onMoveEnd:f,onConnect:g,onConnectStart:y,onConnectEnd:v,onClickConnectStart:x,onClickConnectEnd:p,onNodeMouseEnter:m,onNodeMouseMove:h,onNodeMouseLeave:w,onNodeContextMenu:C,onNodeDoubleClick:_,onNodeDragStart:N,onNodeDrag:b,onNodeDragStop:D,onNodesDelete:A,onEdgesDelete:j,onDelete:H,onSelectionChange:L,onSelectionDragStart:E,onSelectionDrag:T,onSelectionDragStop:P,onSelectionContextMenu:R,onSelectionStart:I,onSelectionEnd:M,onBeforeDelete:z,connectionMode:O,connectionLineType:$=Mn.Bezier,connectionLineStyle:U,connectionLineComponent:W,connectionLineContainerStyle:Z,deleteKeyCode:G="Backspace",selectionKeyCode:q="Shift",selectionOnDrag:F=!1,selectionMode:V=fi.Full,panActivationKeyCode:X="Space",multiSelectionKeyCode:J=pi()?"Meta":"Control",zoomActivationKeyCode:Y=pi()?"Meta":"Control",snapToGrid:K,snapGrid:te,onlyRenderVisibleElements:ne=!1,selectNodesOnDrag:re,nodesDraggable:ce,autoPanOnNodeFocus:He,nodesConnectable:Ke,nodesFocusable:Ce,nodeOrigin:Ge=X0,edgesFocusable:Ht,edgesReconnectable:Bt,elementsSelectable:Vt=!0,defaultViewport:st=g_,minZoom:Ct=.5,maxZoom:Ae=2,translateExtent:Ze=di,preventScrolling:on=!0,nodeExtent:yr,defaultMarkerColor:Ut="#b1b1b7",zoomOnScroll:Ri=!0,zoomOnPinch:ql=!0,panOnScroll:Jl=!1,panOnScrollSpeed:fo=.5,panOnScrollMode:ji=or.Free,zoomOnDoubleClick:ea=!0,panOnDrag:zi=!0,onPaneClick:ta,onPaneMouseEnter:na,onPaneMouseMove:ra,onPaneMouseLeave:Ie,onPaneScroll:Be,onPaneContextMenu:Ve,paneClickDistance:Wt=1,nodeClickDistance:qe=0,children:Ue,onReconnect:gt,onReconnectStart:wn,onReconnectEnd:_e,onEdgeContextMenu:Xt,onEdgeDoubleClick:mt,onEdgeMouseEnter:_t,onEdgeMouseMove:Wn,onEdgeMouseLeave:Xn,reconnectRadius:Yt=10,onNodesChange:Yn,onEdgesChange:ho,noDragClassName:Xy="nodrag",noWheelClassName:Yy="nowheel",noPanClassName:Md="nopan",fitView:Id,fitViewOptions:Pd,connectOnClick:Qy,attributionPosition:Ky,proOptions:Gy,defaultEdgeOptions:Zy,elevateNodesOnSelect:qy=!0,elevateEdgesOnSelect:Jy=!1,disableKeyboardA11y:Dd=!1,autoPanOnConnect:ev,autoPanOnNodeDrag:tv,autoPanOnSelection:nv=!0,autoPanSpeed:rv,connectionRadius:ov,isValidConnection:iv,onError:sv,style:lv,id:Td,nodeDragThreshold:av,connectionDragThreshold:uv,viewport:cv,onViewportChange:dv,width:fv,height:hv,colorMode:pv="light",debug:gv,onScroll:Ai,ariaLabelConfig:mv,zIndexMode:Rd="basic",...yv},vv){const oa=Td||"1",wv=w_(pv),xv=k.useCallback(jd=>{jd.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ai==null||Ai(jd)},[Ai]);return S.jsx("div",{"data-testid":"rf__wrapper",...yv,onScroll:xv,style:{...lv,...WN},ref:vv,className:ke(["react-flow",o,wv]),id:Td,role:"application",children:S.jsxs(UN,{nodes:e,edges:t,width:fv,height:hv,fitView:Id,fitViewOptions:Pd,minZoom:Ct,maxZoom:Ae,nodeOrigin:Ge,nodeExtent:yr,zIndexMode:Rd,children:[S.jsx(v_,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:g,onConnectStart:y,onConnectEnd:v,onClickConnectStart:x,onClickConnectEnd:p,nodesDraggable:ce,autoPanOnNodeFocus:He,nodesConnectable:Ke,nodesFocusable:Ce,edgesFocusable:Ht,edgesReconnectable:Bt,elementsSelectable:Vt,elevateNodesOnSelect:qy,elevateEdgesOnSelect:Jy,minZoom:Ct,maxZoom:Ae,nodeExtent:yr,onNodesChange:Yn,onEdgesChange:ho,snapToGrid:K,snapGrid:te,connectionMode:O,translateExtent:Ze,connectOnClick:Qy,defaultEdgeOptions:Zy,fitView:Id,fitViewOptions:Pd,onNodesDelete:A,onEdgesDelete:j,onDelete:H,onNodeDragStart:N,onNodeDrag:b,onNodeDragStop:D,onSelectionDrag:T,onSelectionDragStart:E,onSelectionDragStop:P,onMove:c,onMoveStart:d,onMoveEnd:f,noPanClassName:Md,nodeOrigin:Ge,rfId:oa,autoPanOnConnect:ev,autoPanOnNodeDrag:tv,autoPanSpeed:rv,onError:sv,connectionRadius:ov,isValidConnection:iv,selectNodesOnDrag:re,nodeDragThreshold:av,connectionDragThreshold:uv,onBeforeDelete:z,debug:gv,ariaLabelConfig:mv,zIndexMode:Rd}),S.jsx(FN,{onInit:u,onNodeClick:l,onEdgeClick:a,onNodeMouseEnter:m,onNodeMouseMove:h,onNodeMouseLeave:w,onNodeContextMenu:C,onNodeDoubleClick:_,nodeTypes:i,edgeTypes:s,connectionLineType:$,connectionLineStyle:U,connectionLineComponent:W,connectionLineContainerStyle:Z,selectionKeyCode:q,selectionOnDrag:F,selectionMode:V,deleteKeyCode:G,multiSelectionKeyCode:J,panActivationKeyCode:X,zoomActivationKeyCode:Y,onlyRenderVisibleElements:ne,defaultViewport:st,translateExtent:Ze,minZoom:Ct,maxZoom:Ae,preventScrolling:on,zoomOnScroll:Ri,zoomOnPinch:ql,zoomOnDoubleClick:ea,panOnScroll:Jl,panOnScrollSpeed:fo,panOnScrollMode:ji,panOnDrag:zi,autoPanOnSelection:nv,onPaneClick:ta,onPaneMouseEnter:na,onPaneMouseMove:ra,onPaneMouseLeave:Ie,onPaneScroll:Be,onPaneContextMenu:Ve,paneClickDistance:Wt,nodeClickDistance:qe,onSelectionContextMenu:R,onSelectionStart:I,onSelectionEnd:M,onReconnect:gt,onReconnectStart:wn,onReconnectEnd:_e,onEdgeContextMenu:Xt,onEdgeDoubleClick:mt,onEdgeMouseEnter:_t,onEdgeMouseMove:Wn,onEdgeMouseLeave:Xn,reconnectRadius:Yt,defaultMarkerColor:Ut,noDragClassName:Xy,noWheelClassName:Yy,noPanClassName:Md,rfId:oa,disableKeyboardA11y:Dd,nodeExtent:yr,viewport:cv,onViewportChange:dv,nodesDraggable:ce}),S.jsx(p_,{onSelectionChange:L}),Ue,S.jsx(u_,{proOptions:Gy,position:Ky}),S.jsx(a_,{rfId:oa,disableKeyboardA11y:Dd})]})})}var YN=K0(XN);function QN({dimensions:e,lineWidth:t,variant:n,className:r}){return S.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:ke(["react-flow__background-pattern",n,r])})}function KN({radius:e,className:t}){return S.jsx("circle",{cx:e,cy:e,r:e,className:ke(["react-flow__background-pattern","dots",t])})}var On;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(On||(On={}));const GN={[On.Dots]:1,[On.Lines]:1,[On.Cross]:6},ZN=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function Sy({id:e,variant:t=On.Dots,gap:n=20,size:r,lineWidth:o=1,offset:i=0,color:s,bgColor:l,style:a,className:u,patternClassName:c}){const d=k.useRef(null),{transform:f,patternId:g}=se(ZN,ve),y=r||GN[t],v=t===On.Dots,x=t===On.Cross,p=Array.isArray(n)?n:[n,n],m=[p[0]*f[2]||1,p[1]*f[2]||1],h=y*f[2],w=Array.isArray(i)?i:[i,i],C=x?[h,h]:m,_=[w[0]*f[2]||1+C[0]/2,w[1]*f[2]||1+C[1]/2],N=`${g}${e||""}`;return S.jsxs("svg",{className:ke(["react-flow__background",u]),style:{...a,...Xl,"--xy-background-color-props":l,"--xy-background-pattern-color-props":s},ref:d,"data-testid":"rf__background",children:[S.jsx("pattern",{id:N,x:f[0]%m[0],y:f[1]%m[1],width:m[0],height:m[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${_[0]},-${_[1]})`,children:v?S.jsx(KN,{radius:h/2,className:c}):S.jsx(QN,{dimensions:C,lineWidth:o,variant:t,className:c})}),S.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${N})`})]})}Sy.displayName="Background";const qN=k.memo(Sy);function JN(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:S.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function e2(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:S.jsx("path",{d:"M0 0h32v4.2H0z"})})}function t2(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:S.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function n2(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:S.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function r2(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:S.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function as({children:e,className:t,...n}){return S.jsx("button",{type:"button",className:ke(["react-flow__controls-button",t]),...n,children:e})}const o2=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function Ey({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:o,onZoomIn:i,onZoomOut:s,onFitView:l,onInteractiveChange:a,className:u,children:c,position:d="bottom-left",orientation:f="vertical","aria-label":g}){const y=he(),{isInteractive:v,minZoomReached:x,maxZoomReached:p,ariaLabelConfig:m}=se(o2,ve),{zoomIn:h,zoomOut:w,fitView:C}=vd(),_=()=>{h(),i==null||i()},N=()=>{w(),s==null||s()},b=()=>{C(o),l==null||l()},D=()=>{y.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),a==null||a(!v)},A=f==="horizontal"?"horizontal":"vertical";return S.jsxs(Wl,{className:ke(["react-flow__controls",A,u]),position:d,style:e,"data-testid":"rf__controls","aria-label":g??m["controls.ariaLabel"],children:[t&&S.jsxs(S.Fragment,{children:[S.jsx(as,{onClick:_,className:"react-flow__controls-zoomin",title:m["controls.zoomIn.ariaLabel"],"aria-label":m["controls.zoomIn.ariaLabel"],disabled:p,children:S.jsx(JN,{})}),S.jsx(as,{onClick:N,className:"react-flow__controls-zoomout",title:m["controls.zoomOut.ariaLabel"],"aria-label":m["controls.zoomOut.ariaLabel"],disabled:x,children:S.jsx(e2,{})})]}),n&&S.jsx(as,{className:"react-flow__controls-fitview",onClick:b,title:m["controls.fitView.ariaLabel"],"aria-label":m["controls.fitView.ariaLabel"],children:S.jsx(t2,{})}),r&&S.jsx(as,{className:"react-flow__controls-interactive",onClick:D,title:m["controls.interactive.ariaLabel"],"aria-label":m["controls.interactive.ariaLabel"],children:v?S.jsx(r2,{}):S.jsx(n2,{})}),c]})}Ey.displayName="Controls";const i2=k.memo(Ey);function s2({id:e,x:t,y:n,width:r,height:o,style:i,color:s,strokeColor:l,strokeWidth:a,className:u,borderRadius:c,shapeRendering:d,selected:f,onClick:g}){const{background:y,backgroundColor:v}=i||{},x=s||y||v;return S.jsx("rect",{className:ke(["react-flow__minimap-node",{selected:f},u]),x:t,y:n,rx:c,ry:c,width:r,height:o,style:{fill:x,stroke:l,strokeWidth:a},shapeRendering:d,onClick:g?p=>g(p,e):void 0})}const l2=k.memo(s2),a2=e=>e.nodes.map(t=>t.id),Ba=e=>e instanceof Function?e:()=>e;function u2({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:o,nodeComponent:i=l2,onClick:s}){const l=se(a2,ve),a=Ba(t),u=Ba(e),c=Ba(n),d=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return S.jsx(S.Fragment,{children:l.map(f=>S.jsx(d2,{id:f,nodeColorFunc:a,nodeStrokeColorFunc:u,nodeClassNameFunc:c,nodeBorderRadius:r,nodeStrokeWidth:o,NodeComponent:i,onClick:s,shapeRendering:d},f))})}function c2({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:o,nodeStrokeWidth:i,shapeRendering:s,NodeComponent:l,onClick:a}){const{node:u,x:c,y:d,width:f,height:g}=se(y=>{const v=y.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const x=v.internals.userNode,{x:p,y:m}=v.internals.positionAbsolute,{width:h,height:w}=rn(x);return{node:x,x:p,y:m,width:h,height:w}},ve);return!u||u.hidden||!v0(u)?null:S.jsx(l,{x:c,y:d,width:f,height:g,style:u.style,selected:!!u.selected,className:r(u),color:t(u),borderRadius:o,strokeColor:n(u),strokeWidth:i,shapeRendering:s,onClick:a,id:u.id})}const d2=k.memo(c2);var f2=k.memo(u2);const h2=200,p2=150,g2=e=>!e.hidden,m2=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?g0(bi(e.nodeLookup,{filter:g2}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},Jh=(e,t)=>e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height,y2=(e,t)=>Jh(e.viewBB,t.viewBB)&&Jh(e.boundingRect,t.boundingRect)&&e.rfId===t.rfId&&e.panZoom===t.panZoom&&e.translateExtent===t.translateExtent&&e.flowWidth===t.flowWidth&&e.flowHeight===t.flowHeight&&e.ariaLabelConfig===t.ariaLabelConfig,v2="react-flow__minimap-desc";function ky({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:o="",nodeBorderRadius:i=5,nodeStrokeWidth:s,nodeComponent:l,bgColor:a,maskColor:u,maskStrokeColor:c,maskStrokeWidth:d,position:f="bottom-right",onClick:g,onNodeClick:y,pannable:v=!1,zoomable:x=!1,ariaLabel:p,inversePan:m,zoomStep:h=1,offsetScale:w=5}){const C=he(),_=k.useRef(null),{boundingRect:N,viewBB:b,rfId:D,panZoom:A,translateExtent:j,flowWidth:H,flowHeight:L,ariaLabelConfig:E}=se(m2,y2),T=(e==null?void 0:e.width)??h2,P=(e==null?void 0:e.height)??p2,R=N.width/T,I=N.height/P,M=Math.max(R,I),z=M*T,O=M*P,$=w*M,U=N.x-(z-N.width)/2-$,W=N.y-(O-N.height)/2-$,Z=z+$*2,G=O+$*2,q=`${v2}-${D}`,F=k.useRef(0),V=k.useRef();F.current=M,k.useEffect(()=>{if(_.current&&A)return V.current=mC({domNode:_.current,panZoom:A,getTransform:()=>C.getState().transform,getViewScale:()=>F.current}),()=>{var K;(K=V.current)==null||K.destroy()}},[A]),k.useEffect(()=>{var K;(K=V.current)==null||K.update({translateExtent:j,width:H,height:L,inversePan:m,pannable:v,zoomStep:h,zoomable:x})},[v,x,m,h,j,H,L]);const X=g?K=>{var re;const[te,ne]=((re=V.current)==null?void 0:re.pointer(K))||[0,0];g(K,{x:te,y:ne})}:void 0,J=y?k.useCallback((K,te)=>{const ne=C.getState().nodeLookup.get(te).internals.userNode;y(K,ne)},[]):void 0,Y=p??E["minimap.ariaLabel"];return S.jsx(Wl,{position:f,style:{...e,"--xy-minimap-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-mask-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-mask-stroke-color-props":typeof c=="string"?c:void 0,"--xy-minimap-mask-stroke-width-props":typeof d=="number"?d*M:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof s=="number"?s:void 0},className:ke(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:S.jsxs("svg",{width:T,height:P,viewBox:`${U} ${W} ${Z} ${G}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":q,ref:_,onClick:X,children:[Y&&S.jsx("title",{id:q,children:Y}),S.jsx(f2,{onClick:J,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:i,nodeClassName:o,nodeStrokeWidth:s,nodeComponent:l}),S.jsx("path",{className:"react-flow__minimap-mask",d:`M${U-$},${W-$}h${Z+$*2}v${G+$*2}h${-Z-$*2}z
62
+ M${b.x},${b.y}h${b.width}v${b.height}h${-b.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}ky.displayName="MiniMap";k.memo(ky);const w2=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,x2={[ro.Line]:"right",[ro.Handle]:"bottom-right"};function S2({nodeId:e,position:t,variant:n=ro.Handle,className:r,style:o=void 0,children:i,color:s,minWidth:l=10,minHeight:a=10,maxWidth:u=Number.MAX_VALUE,maxHeight:c=Number.MAX_VALUE,keepAspectRatio:d=!1,resizeDirection:f,autoScale:g=!0,shouldResize:y,onResizeStart:v,onResize:x,onResizeEnd:p}){const m=ey(),h=typeof e=="string"?e:m,w=he(),C=k.useRef(null),_=n===ro.Handle,N=se(k.useCallback(w2(_&&g),[_,g]),ve),b=k.useRef(null),D=t??x2[n];k.useEffect(()=>{if(!(!C.current||!h))return b.current||(b.current=IC({domNode:C.current,nodeId:h,getStoreItems:()=>{const{nodeLookup:j,transform:H,snapGrid:L,snapToGrid:E,nodeOrigin:T,domNode:P}=w.getState();return{nodeLookup:j,transform:H,snapGrid:L,snapToGrid:E,nodeOrigin:T,paneDomNode:P}},onChange:(j,H)=>{const{triggerNodeChanges:L,nodeLookup:E,parentLookup:T,nodeOrigin:P}=w.getState(),R=[],I={x:j.x,y:j.y},M=E.get(h);if(M&&M.expandParent&&M.parentId){const z=M.origin??P,O=j.width??M.measured.width??0,$=j.height??M.measured.height??0,U={id:M.id,parentId:M.parentId,rect:{width:O,height:$,...w0({x:j.x??M.position.x,y:j.y??M.position.y},{width:O,height:$},M.parentId,E,z)}},W=yd([U],E,T,P);R.push(...W),I.x=j.x?Math.max(z[0]*O,j.x):void 0,I.y=j.y?Math.max(z[1]*$,j.y):void 0}if(I.x!==void 0&&I.y!==void 0){const z={id:h,type:"position",position:{...I}};R.push(z)}if(j.width!==void 0&&j.height!==void 0){const O={id:h,type:"dimensions",resizing:!0,setAttributes:f?f==="horizontal"?"width":"height":!0,dimensions:{width:j.width,height:j.height}};R.push(O)}for(const z of H){const O={...z,type:"position"};R.push(O)}L(R)},onEnd:({width:j,height:H})=>{const L={id:h,type:"dimensions",resizing:!1,dimensions:{width:j,height:H}};w.getState().triggerNodeChanges([L])}})),b.current.update({controlPosition:D,boundaries:{minWidth:l,minHeight:a,maxWidth:u,maxHeight:c},keepAspectRatio:d,resizeDirection:f,onResizeStart:v,onResize:x,onResizeEnd:p,shouldResize:y}),()=>{var j;(j=b.current)==null||j.destroy()}},[D,l,a,u,c,d,v,x,p,y]);const A=D.split("-");return S.jsx("div",{className:ke(["react-flow__resize-control","nodrag",...A,n,r]),ref:C,style:{...o,scale:N,...s&&{[_?"backgroundColor":"borderColor"]:s}},children:i})}k.memo(S2);function E2(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return k.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const Ql=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ao(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function xd(e){return"nodeType"in e}function it(e){var t,n;return e?ao(e)?e:xd(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Sd(e){const{Document:t}=it(e);return e instanceof t}function Pi(e){return ao(e)?!1:e instanceof it(e).HTMLElement}function Cy(e){return e instanceof it(e).SVGElement}function uo(e){return e?ao(e)?e.document:xd(e)?Sd(e)?e:Pi(e)||Cy(e)?e.ownerDocument:document:document:document}const tn=Ql?k.useLayoutEffect:k.useEffect;function Ed(e){const t=k.useRef(e);return tn(()=>{t.current=e}),k.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function k2(){const e=k.useRef(null),t=k.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=k.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function mi(e,t){t===void 0&&(t=[e]);const n=k.useRef(e);return tn(()=>{n.current!==e&&(n.current=e)},t),n}function Di(e,t){const n=k.useRef();return k.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function pl(e){const t=Ed(e),n=k.useRef(null),r=k.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function tc(e){const t=k.useRef();return k.useEffect(()=>{t.current=e},[e]),t.current}let Va={};function Ti(e,t){return k.useMemo(()=>{if(t)return t;const n=Va[e]==null?0:Va[e]+1;return Va[e]=n,e+"-"+n},[e,t])}function _y(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((i,s)=>{const l=Object.entries(s);for(const[a,u]of l){const c=i[a];c!=null&&(i[a]=c+e*u)}return i},{...t})}}const Ur=_y(1),gl=_y(-1);function C2(e){return"clientX"in e&&"clientY"in e}function kd(e){if(!e)return!1;const{KeyboardEvent:t}=it(e.target);return t&&e instanceof t}function _2(e){if(!e)return!1;const{TouchEvent:t}=it(e.target);return t&&e instanceof t}function nc(e){if(_2(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return C2(e)?{x:e.clientX,y:e.clientY}:null}const yi=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[yi.Translate.toString(e),yi.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),ep="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function N2(e){return e.matches(ep)?e:e.querySelector(ep)}const b2={display:"none"};function M2(e){let{id:t,value:n}=e;return Se.createElement("div",{id:t,style:b2},n)}function I2(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return Se.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function P2(){const[e,t]=k.useState("");return{announce:k.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Ny=k.createContext(null);function D2(e){const t=k.useContext(Ny);k.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function T2(){const[e]=k.useState(()=>new Set),t=k.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[k.useCallback(r=>{let{type:o,event:i}=r;e.forEach(s=>{var l;return(l=s[o])==null?void 0:l.call(s,i)})},[e]),t]}const R2={draggable:`
63
63
  To pick up a draggable item, press the space bar.
64
64
  While dragging, use the arrow keys to move the item.
65
65
  Press space again to drop the item in its new position, or press escape to cancel.
66
- `},z2={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function j2(e){let{announcements:t=z2,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=R2}=e;const{announce:i,announcement:s}=P2(),l=Ti("DndLiveRegion"),[a,u]=k.useState(!1);if(k.useEffect(()=>{u(!0)},[]),D2(k.useMemo(()=>({onDragStart(d){let{active:f}=d;i(t.onDragStart({active:f}))},onDragMove(d){let{active:f,over:g}=d;t.onDragMove&&i(t.onDragMove({active:f,over:g}))},onDragOver(d){let{active:f,over:g}=d;i(t.onDragOver({active:f,over:g}))},onDragEnd(d){let{active:f,over:g}=d;i(t.onDragEnd({active:f,over:g}))},onDragCancel(d){let{active:f,over:g}=d;i(t.onDragCancel({active:f,over:g}))}}),[i,t])),!a)return null;const c=Se.createElement(Se.Fragment,null,Se.createElement(M2,{id:r,value:o.draggable}),Se.createElement(I2,{id:l,announcement:s}));return n?Tr.createPortal(c,n):c}var be;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(be||(be={}));function ml(){}function A2(e,t){return k.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function $2(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return k.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Ot=Object.freeze({x:0,y:0});function L2(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function O2(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function F2(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function H2(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function tp(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const B2=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=tp(t,t.left,t.top),i=[];for(const s of r){const{id:l}=s,a=n.get(l);if(a){const u=L2(tp(a),o);i.push({id:l,data:{droppableContainer:s,value:u}})}}return i.sort(O2)};function V2(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,l=i-n;if(r<o&&n<i){const a=t.width*t.height,u=e.width*e.height,c=s*l,d=c/(a+u-c);return Number(d.toFixed(4))}return 0}const U2=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:s}=i,l=n.get(s);if(l){const a=V2(l,t);a>0&&o.push({id:s,data:{droppableContainer:i,value:a}})}}return o.sort(F2)};function W2(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function by(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ot}function X2(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,l)=>({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...n})}}const Y2=X2(1);function Q2(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function K2(e,t,n){const r=Q2(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:l}=r,a=e.left-s-(1-o)*parseFloat(n),u=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:c,height:d,top:u,right:a+c,bottom:u+d,left:a}}const G2={ignoreTransform:!1};function co(e,t){t===void 0&&(t=G2);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:c}=it(e).getComputedStyle(e);u&&(n=K2(n,u,c))}const{top:r,left:o,width:i,height:s,bottom:l,right:a}=n;return{top:r,left:o,width:i,height:s,bottom:l,right:a}}function np(e){return co(e,{ignoreTransform:!0})}function Z2(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function q2(e,t){return t===void 0&&(t=it(e).getComputedStyle(e)),t.position==="fixed"}function J2(e,t){t===void 0&&(t=it(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function Cd(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Sd(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Pi(o)||Cy(o)||n.includes(o))return n;const i=it(e).getComputedStyle(o);return o!==e&&J2(o,i)&&n.push(o),q2(o,i)?n:r(o.parentNode)}return e?r(e):n}function My(e){const[t]=Cd(e,1);return t??null}function Ua(e){return!Ql||!e?null:ao(e)?e:xd(e)?Sd(e)||e===uo(e).scrollingElement?window:Pi(e)?e:null:null}function Iy(e){return ao(e)?e.scrollX:e.scrollLeft}function Py(e){return ao(e)?e.scrollY:e.scrollTop}function rc(e){return{x:Iy(e),y:Py(e)}}var De;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(De||(De={}));function Dy(e){return!Ql||!e?!1:e===document.scrollingElement}function Ty(e){const t={x:0,y:0},n=Dy(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:l,maxScroll:r,minScroll:t}}const eb={x:.2,y:.2};function tb(e,t,n,r,o){let{top:i,left:s,right:l,bottom:a}=n;r===void 0&&(r=10),o===void 0&&(o=eb);const{isTop:u,isBottom:c,isLeft:d,isRight:f}=Ty(e),g={x:0,y:0},y={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+v.height?(g.y=De.Backward,y.y=r*Math.abs((t.top+v.height-i)/v.height)):!c&&a>=t.bottom-v.height&&(g.y=De.Forward,y.y=r*Math.abs((t.bottom-v.height-a)/v.height)),!f&&l>=t.right-v.width?(g.x=De.Forward,y.x=r*Math.abs((t.right-v.width-l)/v.width)):!d&&s<=t.left+v.width&&(g.x=De.Backward,y.x=r*Math.abs((t.left+v.width-s)/v.width)),{direction:g,speed:y}}function nb(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Ry(e){return e.reduce((t,n)=>Ur(t,rc(n)),Ot)}function rb(e){return e.reduce((t,n)=>t+Iy(n),0)}function ob(e){return e.reduce((t,n)=>t+Py(n),0)}function ib(e,t){if(t===void 0&&(t=co),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);My(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const sb=[["x",["left","right"],rb],["y",["top","bottom"],ob]];class _d{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Cd(n),o=Ry(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,l]of sb)for(const a of s)Object.defineProperty(this,a,{get:()=>{const u=l(r),c=o[i]-u;return this.rect[a]+c},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ho{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function lb(e){const{EventTarget:t}=it(e);return e instanceof t?e:uo(e)}function Wa(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var yt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(yt||(yt={}));function rp(e){e.preventDefault()}function ab(e){e.stopPropagation()}var le;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(le||(le={}));const zy={start:[le.Space,le.Enter],cancel:[le.Esc],end:[le.Space,le.Enter,le.Tab]},ub=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case le.Right:return{...n,x:n.x+25};case le.Left:return{...n,x:n.x-25};case le.Down:return{...n,y:n.y+25};case le.Up:return{...n,y:n.y-25}}};class jy{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ho(uo(n)),this.windowListeners=new Ho(it(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(yt.Resize,this.handleCancel),this.windowListeners.add(yt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(yt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&ib(r),n(Ot)}handleKeyDown(t){if(kd(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=zy,coordinateGetter:s=ub,scrollBehavior:l="smooth"}=o,{code:a}=t;if(i.end.includes(a)){this.handleEnd(t);return}if(i.cancel.includes(a)){this.handleCancel(t);return}const{collisionRect:u}=r.current,c=u?{x:u.left,y:u.top}:Ot;this.referenceCoordinates||(this.referenceCoordinates=c);const d=s(t,{active:n,context:r.current,currentCoordinates:c});if(d){const f=gl(d,c),g={x:0,y:0},{scrollableAncestors:y}=r.current;for(const v of y){const x=t.code,{isTop:p,isRight:m,isLeft:h,isBottom:w,maxScroll:C,minScroll:_}=Ty(v),N=nb(v),b={x:Math.min(x===le.Right?N.right-N.width/2:N.right,Math.max(x===le.Right?N.left:N.left+N.width/2,d.x)),y:Math.min(x===le.Down?N.bottom-N.height/2:N.bottom,Math.max(x===le.Down?N.top:N.top+N.height/2,d.y))},D=x===le.Right&&!m||x===le.Left&&!h,A=x===le.Down&&!w||x===le.Up&&!p;if(D&&b.x!==d.x){const z=v.scrollLeft+f.x,H=x===le.Right&&z<=C.x||x===le.Left&&z>=_.x;if(H&&!f.y){v.scrollTo({left:z,behavior:l});return}H?g.x=v.scrollLeft-z:g.x=x===le.Right?v.scrollLeft-C.x:v.scrollLeft-_.x,g.x&&v.scrollBy({left:-g.x,behavior:l});break}else if(A&&b.y!==d.y){const z=v.scrollTop+f.y,H=x===le.Down&&z<=C.y||x===le.Up&&z>=_.y;if(H&&!f.x){v.scrollTo({top:z,behavior:l});return}H?g.y=v.scrollTop-z:g.y=x===le.Down?v.scrollTop-C.y:v.scrollTop-_.y,g.y&&v.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(t,Ur(gl(d,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}jy.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=zy,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const l=i.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function op(e){return!!(e&&"distance"in e)}function ip(e){return!!(e&&"delay"in e)}class Nd{constructor(t,n,r){var o;r===void 0&&(r=lb(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=uo(s),this.documentListeners=new Ho(this.document),this.listeners=new Ho(r),this.windowListeners=new Ho(it(s)),this.initialCoordinates=(o=nc(i))!=null?o:Ot,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(yt.Resize,this.handleCancel),this.windowListeners.add(yt.DragStart,rp),this.windowListeners.add(yt.VisibilityChange,this.handleCancel),this.windowListeners.add(yt.ContextMenu,rp),this.documentListeners.add(yt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ip(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(op(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(yt.Click,ab,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(yt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:l}}=i;if(!o)return;const a=(n=nc(t))!=null?n:Ot,u=gl(o,a);if(!r&&l){if(op(l)){if(l.tolerance!=null&&Wa(u,l.tolerance))return this.handleCancel();if(Wa(u,l.distance))return this.handleStart()}if(ip(l)&&Wa(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),s(a)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===le.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const cb={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class bd extends Nd{constructor(t){const{event:n}=t,r=uo(n.target);super(t,cb,r)}}bd.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const db={move:{name:"mousemove"},end:{name:"mouseup"}};var oc;(function(e){e[e.RightClick=2]="RightClick"})(oc||(oc={}));class fb extends Nd{constructor(t){super(t,db,uo(t.event.target))}}fb.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===oc.RightClick?!1:(r==null||r({event:n}),!0)}}];const Xa={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class hb extends Nd{constructor(t){super(t,Xa)}static setup(){return window.addEventListener(Xa.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Xa.move.name,t)};function t(){}}}hb.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Bo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Bo||(Bo={}));var yl;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(yl||(yl={}));function pb(e){let{acceleration:t,activator:n=Bo.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:l=yl.TreeOrder,pointerCoordinates:a,scrollableAncestors:u,scrollableAncestorRects:c,delta:d,threshold:f}=e;const g=mb({delta:d,disabled:!i}),[y,v]=k2(),x=k.useRef({x:0,y:0}),p=k.useRef({x:0,y:0}),m=k.useMemo(()=>{switch(n){case Bo.Pointer:return a?{top:a.y,bottom:a.y,left:a.x,right:a.x}:null;case Bo.DraggableRect:return o}},[n,o,a]),h=k.useRef(null),w=k.useCallback(()=>{const _=h.current;if(!_)return;const N=x.current.x*p.current.x,b=x.current.y*p.current.y;_.scrollBy(N,b)},[]),C=k.useMemo(()=>l===yl.TreeOrder?[...u].reverse():u,[l,u]);k.useEffect(()=>{if(!i||!u.length||!m){v();return}for(const _ of C){if((r==null?void 0:r(_))===!1)continue;const N=u.indexOf(_),b=c[N];if(!b)continue;const{direction:D,speed:A}=tb(_,b,m,t,f);for(const z of["x","y"])g[z][D[z]]||(A[z]=0,D[z]=0);if(A.x>0||A.y>0){v(),h.current=_,y(w,s),x.current=A,p.current=D;return}}x.current={x:0,y:0},p.current={x:0,y:0},v()},[t,w,r,v,i,s,JSON.stringify(m),JSON.stringify(g),y,u,C,c,JSON.stringify(f)])}const gb={x:{[De.Backward]:!1,[De.Forward]:!1},y:{[De.Backward]:!1,[De.Forward]:!1}};function mb(e){let{delta:t,disabled:n}=e;const r=tc(t);return Di(o=>{if(n||!r||!o)return gb;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[De.Backward]:o.x[De.Backward]||i.x===-1,[De.Forward]:o.x[De.Forward]||i.x===1},y:{[De.Backward]:o.y[De.Backward]||i.y===-1,[De.Forward]:o.y[De.Forward]||i.y===1}}},[n,t,r])}function yb(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Di(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function vb(e,t){return k.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var vi;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(vi||(vi={}));var ic;(function(e){e.Optimized="optimized"})(ic||(ic={}));const sp=new Map;function wb(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=k.useState(null),{frequency:l,measure:a,strategy:u}=o,c=k.useRef(e),d=x(),f=mi(d),g=k.useCallback(function(p){p===void 0&&(p=[]),!f.current&&s(m=>m===null?p:m.concat(p.filter(h=>!m.includes(h))))},[f]),y=k.useRef(null),v=Di(p=>{if(d&&!n)return sp;if(!p||p===sp||c.current!==e||i!=null){const m=new Map;for(let h of e){if(!h)continue;if(i&&i.length>0&&!i.includes(h.id)&&h.rect.current){m.set(h.id,h.rect.current);continue}const w=h.node.current,C=w?new _d(a(w),w):null;h.rect.current=C,C&&m.set(h.id,C)}return m}return p},[e,i,n,d,a]);return k.useEffect(()=>{c.current=e},[e]),k.useEffect(()=>{d||g()},[n,d]),k.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),k.useEffect(()=>{d||typeof l!="number"||y.current!==null||(y.current=setTimeout(()=>{g(),y.current=null},l))},[l,d,g,...r]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:i!=null};function x(){switch(u){case vi.Always:return!1;case vi.BeforeDragging:return n;default:return!n}}}function Ay(e,t){return Di(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function xb(e,t){return Ay(e,t)}function Sb(e){let{callback:t,disabled:n}=e;const r=Ed(t),o=k.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return k.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Kl(e){let{callback:t,disabled:n}=e;const r=Ed(t),o=k.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return k.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Eb(e){return new _d(co(e),e)}function lp(e,t,n){t===void 0&&(t=Eb);const[r,o]=k.useState(null);function i(){o(a=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=a??n)!=null?u:null}const c=t(e);return JSON.stringify(a)===JSON.stringify(c)?a:c})}const s=Sb({callback(a){if(e)for(const u of a){const{type:c,target:d}=u;if(c==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),l=Kl({callback:i});return tn(()=>{i(),e?(l==null||l.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),s==null||s.disconnect())},[e]),r}function kb(e){const t=Ay(e);return by(e,t)}const ap=[];function Cb(e){const t=k.useRef(e),n=Di(r=>e?r&&r!==ap&&e&&t.current&&e.parentNode===t.current.parentNode?r:Cd(e):ap,[e]);return k.useEffect(()=>{t.current=e},[e]),n}function _b(e){const[t,n]=k.useState(null),r=k.useRef(e),o=k.useCallback(i=>{const s=Ua(i.target);s&&n(l=>l?(l.set(s,rc(s)),new Map(l)):null)},[]);return k.useEffect(()=>{const i=r.current;if(e!==i){s(i);const l=e.map(a=>{const u=Ua(a);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,rc(u)]):null}).filter(a=>a!=null);n(l.length?new Map(l):null),r.current=e}return()=>{s(e),s(i)};function s(l){l.forEach(a=>{const u=Ua(a);u==null||u.removeEventListener("scroll",o)})}},[o,e]),k.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Ur(i,s),Ot):Ry(e):Ot,[e,t])}function up(e,t){t===void 0&&(t=[]);const n=k.useRef(null);return k.useEffect(()=>{n.current=null},t),k.useEffect(()=>{const r=e!==Ot;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?gl(e,n.current):Ot}function Nb(e){k.useEffect(()=>{if(!Ql)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function bb(e,t){return k.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function $y(e){return k.useMemo(()=>e?Z2(e):null,[e])}const cp=[];function Mb(e,t){t===void 0&&(t=co);const[n]=e,r=$y(n?it(n):null),[o,i]=k.useState(cp);function s(){i(()=>e.length?e.map(a=>Dy(a)?r:new _d(t(a),a)):cp)}const l=Kl({callback:s});return tn(()=>{l==null||l.disconnect(),s(),e.forEach(a=>l==null?void 0:l.observe(a))},[e]),o}function Ib(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Pi(t)?t:e}function Pb(e){let{measure:t}=e;const[n,r]=k.useState(null),o=k.useCallback(u=>{for(const{target:c}of u)if(Pi(c)){r(d=>{const f=t(c);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),i=Kl({callback:o}),s=k.useCallback(u=>{const c=Ib(u);i==null||i.disconnect(),c&&(i==null||i.observe(c)),r(c?t(c):null)},[t,i]),[l,a]=pl(s);return k.useMemo(()=>({nodeRef:l,rect:n,setRef:a}),[n,l,a])}const Db=[{sensor:bd,options:{}},{sensor:jy,options:{}}],Tb={current:{}},Ps={draggable:{measure:np},droppable:{measure:np,strategy:vi.WhileDragging,frequency:ic.Optimized},dragOverlay:{measure:co}};class Vo extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Rb={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Vo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ml},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ps,measureDroppableContainers:ml,windowRect:null,measuringScheduled:!1},zb={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ml,draggableNodes:new Map,over:null,measureDroppableContainers:ml},Gl=k.createContext(zb),Ly=k.createContext(Rb);function jb(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Vo}}}function Ab(e,t){switch(t.type){case be.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case be.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case be.DragEnd:case be.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case be.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Vo(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case be.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Vo(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case be.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Vo(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function $b(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=k.useContext(Gl),i=tc(r),s=tc(n==null?void 0:n.id);return k.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!kd(i)||document.activeElement===i.target)return;const l=o.get(s);if(!l)return;const{activatorNode:a,node:u}=l;if(!a.current&&!u.current)return;requestAnimationFrame(()=>{for(const c of[a.current,u.current]){if(!c)continue;const d=N2(c);if(d){d.focus();break}}})}},[r,t,o,s,i]),null}function Lb(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function Ob(e){return k.useMemo(()=>({draggable:{...Ps.draggable,...e==null?void 0:e.draggable},droppable:{...Ps.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ps.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Fb(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=k.useRef(!1),{x:s,y:l}=typeof o=="boolean"?{x:o,y:o}:o;tn(()=>{if(!s&&!l||!t){i.current=!1;return}if(i.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const c=n(u),d=by(c,r);if(s||(d.x=0),l||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=My(u);f&&f.scrollBy({top:d.y,left:d.x})}},[t,s,l,r,n])}const Oy=k.createContext({...Ot,scaleX:1,scaleY:1});var _n;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(_n||(_n={}));const Hb=k.memo(function(t){var n,r,o,i;let{id:s,accessibility:l,autoScroll:a=!0,children:u,sensors:c=Db,collisionDetection:d=U2,measuring:f,modifiers:g,...y}=t;const v=k.useReducer(Ab,void 0,jb),[x,p]=v,[m,h]=T2(),[w,C]=k.useState(_n.Uninitialized),_=w===_n.Initialized,{draggable:{active:N,nodes:b,translate:D},droppable:{containers:A}}=x,z=N!=null?b.get(N):null,H=k.useRef({initial:null,translated:null}),L=k.useMemo(()=>{var Ie;return N!=null?{id:N,data:(Ie=z==null?void 0:z.data)!=null?Ie:Tb,rect:H}:null},[N,z]),E=k.useRef(null),[T,P]=k.useState(null),[R,I]=k.useState(null),M=mi(y,Object.values(y)),j=Ti("DndDescribedBy",s),O=k.useMemo(()=>A.getEnabled(),[A]),$=Ob(f),{droppableRects:U,measureDroppableContainers:W,measuringScheduled:Z}=wb(O,{dragging:_,dependencies:[D.x,D.y],config:$.droppable}),G=yb(b,N),q=k.useMemo(()=>R?nc(R):null,[R]),F=ra(),V=xb(G,$.draggable.measure);Fb({activeNode:N!=null?b.get(N):null,config:F.layoutShiftCompensation,initialRect:V,measure:$.draggable.measure});const X=lp(G,$.draggable.measure,V),J=lp(G?G.parentElement:null),Y=k.useRef({activatorEvent:null,active:null,activeNode:G,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:b,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),K=A.getNodeFor((n=Y.current.over)==null?void 0:n.id),te=Pb({measure:$.dragOverlay.measure}),ne=(r=te.nodeRef.current)!=null?r:G,re=_?(o=te.rect)!=null?o:X:null,ce=!!(te.nodeRef.current&&te.rect),He=kb(ce?null:X),Ke=$y(ne?it(ne):null),Ce=Cb(_?K??G:null),Ge=Mb(Ce),Ht=Lb(g,{transform:{x:D.x-He.x,y:D.y-He.y,scaleX:1,scaleY:1},activatorEvent:R,active:L,activeNodeRect:X,containerNodeRect:J,draggingNodeRect:re,over:Y.current.over,overlayNodeRect:te.rect,scrollableAncestors:Ce,scrollableAncestorRects:Ge,windowRect:Ke}),Bt=q?Ur(q,D):null,Vt=_b(Ce),st=up(Vt),Ct=up(Vt,[X]),Ae=Ur(Ht,st),Ze=re?Y2(re,Ht):null,on=L&&Ze?d({active:L,collisionRect:Ze,droppableRects:U,droppableContainers:O,pointerCoordinates:Bt}):null,yr=H2(on,"id"),[Ut,Ri]=k.useState(null),ql=ce?Ht:Ur(Ht,Ct),Jl=W2(ql,(i=Ut==null?void 0:Ut.rect)!=null?i:null,X),fo=k.useRef(null),zi=k.useCallback((Ie,Be)=>{let{sensor:Ve,options:Wt}=Be;if(E.current==null)return;const qe=b.get(E.current);if(!qe)return;const Ue=Ie.nativeEvent,gt=new Ve({active:E.current,activeNode:qe,event:Ue,options:Wt,context:Y,onAbort(_e){if(!b.get(_e))return;const{onDragAbort:mt}=M.current,_t={id:_e};mt==null||mt(_t),m({type:"onDragAbort",event:_t})},onPending(_e,Xt,mt,_t){if(!b.get(_e))return;const{onDragPending:Xn}=M.current,Yt={id:_e,constraint:Xt,initialCoordinates:mt,offset:_t};Xn==null||Xn(Yt),m({type:"onDragPending",event:Yt})},onStart(_e){const Xt=E.current;if(Xt==null)return;const mt=b.get(Xt);if(!mt)return;const{onDragStart:_t}=M.current,Wn={activatorEvent:Ue,active:{id:Xt,data:mt.data,rect:H}};Tr.unstable_batchedUpdates(()=>{_t==null||_t(Wn),C(_n.Initializing),p({type:be.DragStart,initialCoordinates:_e,active:Xt}),m({type:"onDragStart",event:Wn}),P(fo.current),I(Ue)})},onMove(_e){p({type:be.DragMove,coordinates:_e})},onEnd:wn(be.DragEnd),onCancel:wn(be.DragCancel)});fo.current=gt;function wn(_e){return async function(){const{active:mt,collisions:_t,over:Wn,scrollAdjustedTranslate:Xn}=Y.current;let Yt=null;if(mt&&Xn){const{cancelDrop:Yn}=M.current;Yt={activatorEvent:Ue,active:mt,collisions:_t,delta:Xn,over:Wn},_e===be.DragEnd&&typeof Yn=="function"&&await Promise.resolve(Yn(Yt))&&(_e=be.DragCancel)}E.current=null,Tr.unstable_batchedUpdates(()=>{p({type:_e}),C(_n.Uninitialized),Ri(null),P(null),I(null),fo.current=null;const Yn=_e===be.DragEnd?"onDragEnd":"onDragCancel";if(Yt){const ho=M.current[Yn];ho==null||ho(Yt),m({type:Yn,event:Yt})}})}}},[b]),ea=k.useCallback((Ie,Be)=>(Ve,Wt)=>{const qe=Ve.nativeEvent,Ue=b.get(Wt);if(E.current!==null||!Ue||qe.dndKit||qe.defaultPrevented)return;const gt={active:Ue};Ie(Ve,Be.options,gt)===!0&&(qe.dndKit={capturedBy:Be.sensor},E.current=Wt,zi(Ve,Be))},[b,zi]),ji=vb(c,ea);Nb(c),tn(()=>{X&&w===_n.Initializing&&C(_n.Initialized)},[X,w]),k.useEffect(()=>{const{onDragMove:Ie}=M.current,{active:Be,activatorEvent:Ve,collisions:Wt,over:qe}=Y.current;if(!Be||!Ve)return;const Ue={active:Be,activatorEvent:Ve,collisions:Wt,delta:{x:Ae.x,y:Ae.y},over:qe};Tr.unstable_batchedUpdates(()=>{Ie==null||Ie(Ue),m({type:"onDragMove",event:Ue})})},[Ae.x,Ae.y]),k.useEffect(()=>{const{active:Ie,activatorEvent:Be,collisions:Ve,droppableContainers:Wt,scrollAdjustedTranslate:qe}=Y.current;if(!Ie||E.current==null||!Be||!qe)return;const{onDragOver:Ue}=M.current,gt=Wt.get(yr),wn=gt&&gt.rect.current?{id:gt.id,rect:gt.rect.current,data:gt.data,disabled:gt.disabled}:null,_e={active:Ie,activatorEvent:Be,collisions:Ve,delta:{x:qe.x,y:qe.y},over:wn};Tr.unstable_batchedUpdates(()=>{Ri(wn),Ue==null||Ue(_e),m({type:"onDragOver",event:_e})})},[yr]),tn(()=>{Y.current={activatorEvent:R,active:L,activeNode:G,collisionRect:Ze,collisions:on,droppableRects:U,draggableNodes:b,draggingNode:ne,draggingNodeRect:re,droppableContainers:A,over:Ut,scrollableAncestors:Ce,scrollAdjustedTranslate:Ae},H.current={initial:re,translated:Ze}},[L,G,on,Ze,b,ne,re,U,A,Ut,Ce,Ae]),pb({...F,delta:D,draggingRect:Ze,pointerCoordinates:Bt,scrollableAncestors:Ce,scrollableAncestorRects:Ge});const ta=k.useMemo(()=>({active:L,activeNode:G,activeNodeRect:X,activatorEvent:R,collisions:on,containerNodeRect:J,dragOverlay:te,draggableNodes:b,droppableContainers:A,droppableRects:U,over:Ut,measureDroppableContainers:W,scrollableAncestors:Ce,scrollableAncestorRects:Ge,measuringConfiguration:$,measuringScheduled:Z,windowRect:Ke}),[L,G,X,R,on,J,te,b,A,U,Ut,W,Ce,Ge,$,Z,Ke]),na=k.useMemo(()=>({activatorEvent:R,activators:ji,active:L,activeNodeRect:X,ariaDescribedById:{draggable:j},dispatch:p,draggableNodes:b,over:Ut,measureDroppableContainers:W}),[R,ji,L,X,p,j,b,Ut,W]);return Se.createElement(Ny.Provider,{value:h},Se.createElement(Gl.Provider,{value:na},Se.createElement(Ly.Provider,{value:ta},Se.createElement(Oy.Provider,{value:Jl},u)),Se.createElement($b,{disabled:(l==null?void 0:l.restoreFocus)===!1})),Se.createElement(j2,{...l,hiddenTextDescribedById:j}));function ra(){const Ie=(T==null?void 0:T.autoScrollEnabled)===!1,Be=typeof a=="object"?a.enabled===!1:a===!1,Ve=_&&!Ie&&!Be;return typeof a=="object"?{...a,enabled:Ve}:{enabled:Ve}}}),Bb=k.createContext(null),dp="button",Vb="Draggable";function Ub(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Ti(Vb),{activators:s,activatorEvent:l,active:a,activeNodeRect:u,ariaDescribedById:c,draggableNodes:d,over:f}=k.useContext(Gl),{role:g=dp,roleDescription:y="draggable",tabIndex:v=0}=o??{},x=(a==null?void 0:a.id)===t,p=k.useContext(x?Oy:Bb),[m,h]=pl(),[w,C]=pl(),_=bb(s,t),N=mi(n);tn(()=>(d.set(t,{id:t,key:i,node:m,activatorNode:w,data:N}),()=>{const D=d.get(t);D&&D.key===i&&d.delete(t)}),[d,t]);const b=k.useMemo(()=>({role:g,tabIndex:v,"aria-disabled":r,"aria-pressed":x&&g===dp?!0:void 0,"aria-roledescription":y,"aria-describedby":c.draggable}),[r,g,v,x,y,c.draggable]);return{active:a,activatorEvent:l,activeNodeRect:u,attributes:b,isDragging:x,listeners:r?void 0:_,node:m,over:f,setNodeRef:h,setActivatorNodeRef:C,transform:p}}function Wb(){return k.useContext(Ly)}const Xb="Droppable",Yb={timeout:25};function Qb(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Ti(Xb),{active:s,dispatch:l,over:a,measureDroppableContainers:u}=k.useContext(Gl),c=k.useRef({disabled:n}),d=k.useRef(!1),f=k.useRef(null),g=k.useRef(null),{disabled:y,updateMeasurementsFor:v,timeout:x}={...Yb,...o},p=mi(v??r),m=k.useCallback(()=>{if(!d.current){d.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(p.current)?p.current:[p.current]),g.current=null},x)},[x]),h=Kl({callback:m,disabled:y||!s}),w=k.useCallback((b,D)=>{h&&(D&&(h.unobserve(D),d.current=!1),b&&h.observe(b))},[h]),[C,_]=pl(w),N=mi(t);return k.useEffect(()=>{!h||!C.current||(h.disconnect(),d.current=!1,h.observe(C.current))},[C,h]),k.useEffect(()=>(l({type:be.RegisterDroppable,element:{id:r,key:i,disabled:n,node:C,rect:f,data:N}}),()=>l({type:be.UnregisterDroppable,key:i,id:r})),[r]),k.useEffect(()=>{n!==c.current.disabled&&(l({type:be.SetDroppableDisabled,id:r,key:i,disabled:n}),c.current.disabled=n)},[r,i,n,l]),{active:s,rect:f,isOver:(a==null?void 0:a.id)===r,node:C,over:a,setNodeRef:_}}function Fy(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Kb(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function us(e){return e!==null&&e>=0}function Gb(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Zb(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const cs={scaleX:1,scaleY:1},qb=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:i,index:s}=e;const l=(t=n[o])!=null?t:r;if(!l)return null;const a=Jb(n,s,o);if(s===o){const u=n[i];return u?{x:o<i?u.left+u.width-(l.left+l.width):u.left-l.left,y:0,...cs}:null}return s>o&&s<=i?{x:-l.width-a,y:0,...cs}:s<o&&s>=i?{x:l.width+a,y:0,...cs}:{x:0,y:0,...cs}};function Jb(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return!r||!o&&!i?0:n<t?o?r.left-(o.left+o.width):i.left-(r.left+r.width):i?i.left-(r.left+r.width):r.left-(o.left+o.width)}const Hy=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Fy(t,r,n),s=t[o],l=i[o];return!l||!s?null:{x:l.left-s.left,y:l.top-s.top,scaleX:l.width/s.width,scaleY:l.height/s.height}},ds={scaleX:1,scaleY:1},eM=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:s}=e;const l=(t=i[n])!=null?t:r;if(!l)return null;if(o===n){const u=i[s];return u?{x:0,y:n<s?u.top+u.height-(l.top+l.height):u.top-l.top,...ds}:null}const a=tM(i,o,n);return o>n&&o<=s?{x:0,y:-l.height-a,...ds}:o<n&&o>=s?{x:0,y:l.height+a,...ds}:{x:0,y:0,...ds}};function tM(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const By="Sortable",Vy=Se.createContext({activeIndex:-1,containerId:By,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Hy,disabled:{draggable:!1,droppable:!1}});function nM(e){let{children:t,id:n,items:r,strategy:o=Hy,disabled:i=!1}=e;const{active:s,dragOverlay:l,droppableRects:a,over:u,measureDroppableContainers:c}=Wb(),d=Ti(By,n),f=l.rect!==null,g=k.useMemo(()=>r.map(_=>typeof _=="object"&&"id"in _?_.id:_),[r]),y=s!=null,v=s?g.indexOf(s.id):-1,x=u?g.indexOf(u.id):-1,p=k.useRef(g),m=!Gb(g,p.current),h=x!==-1&&v===-1||m,w=Zb(i);tn(()=>{m&&y&&c(g)},[m,g,y,c]),k.useEffect(()=>{p.current=g},[g]);const C=k.useMemo(()=>({activeIndex:v,containerId:d,disabled:w,disableTransforms:h,items:g,overIndex:x,useDragOverlay:f,sortedRects:Kb(g,a),strategy:o}),[v,d,w.draggable,w.droppable,h,g,x,a,f,o]);return Se.createElement(Vy.Provider,{value:C},t)}const rM=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Fy(n,r,o).indexOf(t)},oM=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:l,previousContainerId:a,transition:u}=e;return!u||!r||l!==i&&o===s?!1:n?!0:s!==o&&t===a},iM={duration:200,easing:"ease"},Uy="transform",sM=yi.Transition.toString({property:Uy,duration:0,easing:"linear"}),lM={roleDescription:"sortable"};function aM(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=k.useState(null),l=k.useRef(n);return tn(()=>{if(!t&&n!==l.current&&r.current){const a=o.current;if(a){const u=co(r.current,{ignoreTransform:!0}),c={x:a.left-u.left,y:a.top-u.top,scaleX:a.width/u.width,scaleY:a.height/u.height};(c.x||c.y)&&s(c)}}n!==l.current&&(l.current=n)},[t,n,r,o]),k.useEffect(()=>{i&&s(null)},[i]),i}function uM(e){let{animateLayoutChanges:t=oM,attributes:n,disabled:r,data:o,getNewIndex:i=rM,id:s,strategy:l,resizeObserverConfig:a,transition:u=iM}=e;const{items:c,containerId:d,activeIndex:f,disabled:g,disableTransforms:y,sortedRects:v,overIndex:x,useDragOverlay:p,strategy:m}=k.useContext(Vy),h=cM(r,g),w=c.indexOf(s),C=k.useMemo(()=>({sortable:{containerId:d,index:w,items:c},...o}),[d,o,w,c]),_=k.useMemo(()=>c.slice(c.indexOf(s)),[c,s]),{rect:N,node:b,isOver:D,setNodeRef:A}=Qb({id:s,data:C,disabled:h.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...a}}),{active:z,activatorEvent:H,activeNodeRect:L,attributes:E,setNodeRef:T,listeners:P,isDragging:R,over:I,setActivatorNodeRef:M,transform:j}=Ub({id:s,data:C,attributes:{...lM,...n},disabled:h.draggable}),O=E2(A,T),$=!!z,U=$&&!y&&us(f)&&us(x),W=!p&&R,Z=W&&U?j:null,q=U?Z??(l??m)({rects:v,activeNodeRect:L,activeIndex:f,overIndex:x,index:w}):null,F=us(f)&&us(x)?i({id:s,items:c,activeIndex:f,overIndex:x}):w,V=z==null?void 0:z.id,X=k.useRef({activeId:V,items:c,newIndex:F,containerId:d}),J=c!==X.current.items,Y=t({active:z,containerId:d,isDragging:R,isSorting:$,id:s,index:w,items:c,newIndex:X.current.newIndex,previousItems:X.current.items,previousContainerId:X.current.containerId,transition:u,wasDragging:X.current.activeId!=null}),K=aM({disabled:!Y,index:w,node:b,rect:N});return k.useEffect(()=>{$&&X.current.newIndex!==F&&(X.current.newIndex=F),d!==X.current.containerId&&(X.current.containerId=d),c!==X.current.items&&(X.current.items=c)},[$,F,d,c]),k.useEffect(()=>{if(V===X.current.activeId)return;if(V!=null&&X.current.activeId==null){X.current.activeId=V;return}const ne=setTimeout(()=>{X.current.activeId=V},50);return()=>clearTimeout(ne)},[V]),{active:z,activeIndex:f,attributes:E,data:C,rect:N,index:w,newIndex:F,items:c,isOver:D,isSorting:$,isDragging:R,listeners:P,node:b,overIndex:x,over:I,setNodeRef:O,setActivatorNodeRef:M,setDroppableNodeRef:A,setDraggableNodeRef:T,transform:K??q,transition:te()};function te(){if(K||J&&X.current.newIndex===w)return sM;if(!(W&&!kd(H)||!u)&&($||Y))return yi.Transition.toString({...u,property:Uy})}}function cM(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}le.Down,le.Right,le.Up,le.Left;function Wy(e){if(!e)return{};const t={};return e.bg&&(t["--wfp-bg"]=e.bg),e.fg&&(t["--wfp-fg"]=e.fg),e.accent&&(t["--wfp-accent"]=e.accent),t}function dM({block:e}){switch(e.type){case"text":{if(e.text)return S.jsx("div",{className:`g-real ${e.sizeHint==="lg"?"g-real-lg":""}`,children:e.text});const t=e.sizeHint==="lg"?5:e.sizeHint==="sm"?2:3;return S.jsx("div",{className:"g-text",children:Array.from({length:t}).map((n,r)=>S.jsx("div",{className:"g-line",style:{width:`${92-r*14}%`}},r))})}case"button":return S.jsx("div",{className:`g-button${e.text?" g-button-labeled":""}`,children:e.text});case"image":return S.jsx("div",{className:"g-image"});case"nav":return S.jsxs("div",{className:"g-nav",children:[S.jsx("div",{className:"g-nav-dot"}),S.jsxs("div",{className:"g-nav-links",children:[S.jsx("span",{}),S.jsx("span",{}),S.jsx("span",{})]}),S.jsx("div",{className:"g-nav-cta"})]});case"hero":return S.jsxs("div",{className:"g-hero",children:[e.text?S.jsx("div",{className:"g-hero-text",children:e.text}):S.jsx("div",{className:"g-hero-title"}),S.jsx("div",{className:"g-line",style:{width:"55%"}}),S.jsx("div",{className:"g-line",style:{width:"40%"}}),S.jsx("div",{className:"g-button",style:{marginTop:8}})]});case"card-grid":return S.jsx("div",{className:"g-grid",children:Array.from({length:6}).map((t,n)=>S.jsxs("div",{className:"g-card",children:[S.jsx("div",{className:"g-card-media"}),S.jsx("div",{className:"g-line",style:{width:"80%"}}),S.jsx("div",{className:"g-line",style:{width:"55%"}})]},n))});case"list":return S.jsx("div",{className:"g-list",children:Array.from({length:3}).map((t,n)=>S.jsxs("div",{className:"g-list-row",children:[S.jsx("div",{className:"g-list-thumb"}),S.jsxs("div",{className:"g-text",style:{flex:1},children:[S.jsx("div",{className:"g-line",style:{width:"70%"}}),S.jsx("div",{className:"g-line",style:{width:"45%"}})]})]},n))});case"form":return S.jsxs("div",{className:"g-form",children:[S.jsx("div",{className:"g-input"}),S.jsx("div",{className:"g-input"}),S.jsx("div",{className:"g-button"})]});case"footer":return S.jsxs("div",{className:"g-footer",children:[S.jsxs("div",{className:"g-text",children:[S.jsx("div",{className:"g-line",style:{width:"30%"}}),S.jsx("div",{className:"g-line",style:{width:"22%"}})]}),S.jsxs("div",{className:"g-nav-links",children:[S.jsx("span",{}),S.jsx("span",{}),S.jsx("span",{})]})]});default:return null}}function fM(e,t,n){var o;const r=["wf-block",`wf-${e.type}`];return t&&r.push("selected"),(o=e.intents)!=null&&o.length&&r.push("has-intents"),e.refImage&&r.push("has-ref"),n||r.push("leaf"),r.join(" ")}function hM({block:e,...t}){const{attributes:n,listeners:r,setNodeRef:o,transform:i,transition:s}=uM({id:e.id});return S.jsx("div",{ref:o,className:"wf-sortable",style:{transform:yi.Transform.toString(i),transition:s,flex:1,minWidth:0},...n,...r,children:S.jsx(Zl,{block:e,...t})})}function Zl({block:e,selectedId:t,onSelect:n,sortable:r,interactive:o}){var u;const i=e.children??[],s=t===e.id,l=i.length>0,a=l?S.jsx("div",{className:"wf-children",style:{flexDirection:e.direction==="row"?"row":"column"},children:o&&r?S.jsx(nM,{items:i.map(c=>c.id),strategy:e.direction==="row"?qb:eM,children:i.map(c=>S.jsx(hM,{block:c,selectedId:t,onSelect:n,sortable:!0,interactive:!0},c.id))}):i.map(c=>S.jsx(Zl,{block:c,selectedId:t,onSelect:n,interactive:o},c.id))}):S.jsx(dM,{block:e});return S.jsxs("div",{className:fM(e,s,l),title:`${e.label}${e.summary?` · ${e.summary}`:""}${(u=e.intents)!=null&&u.length?` — ⚡ ${e.intents.join("; ")}`:""}`,onClick:o&&n?c=>{c.stopPropagation(),n(e.id)}:void 0,children:[o&&S.jsx("span",{className:"wf-tag",children:e.label}),a]})}const pM={skeleton:"Next: open it, tweak the layout, then generate a design",designed:"Designed — open it and switch to Preview"},gM=k.memo(function({data:t}){const{page:n}=t,{select:r,selection:o,openPage:i}=Dt(),s=o.kind==="page"&&o.pageId===n.id;return S.jsxs("div",{className:`page-node${s?" selected":""}`,title:pM[n.status],children:[S.jsxs("header",{onClick:()=>r({kind:"page",pageId:n.id}),onDoubleClick:()=>i(n.id),children:[S.jsx("span",{className:"name",children:n.name}),S.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center"},children:[n.group&&S.jsx("span",{className:"badge",children:n.group}),S.jsx("span",{className:`badge${n.status==="designed"?" designed":""}`,children:n.status}),S.jsx("button",{className:"open-btn",onClick:l=>{l.stopPropagation(),i(n.id)},children:"Open"})]})]}),S.jsx("div",{className:"mini",style:{zoom:.55},children:S.jsx("div",{className:"wf-paper",style:Wy(n.theme),children:S.jsx(Zl,{block:n.layout})})})]})}),mM={page:gM};function fp(e){return e.map(t=>({id:t.id,type:"page",position:t.canvasPos,data:{page:t},dragHandle:"header"}))}function yM(){const{project:e,setProject:t,select:n}=Dt(),[r,o]=k.useState(()=>fp(e.pages));k.useEffect(()=>{o(fp(e.pages))},[e]);const i=k.useCallback(s=>{o(l=>{const a=Q0(s,l);if(s.some(c=>c.type==="position"&&c.dragging===!1)){const c=structuredClone(Dt.getState().project);for(const d of a){const f=c.pages.find(g=>g.id===d.id);f&&(f.canvasPos=d.position)}setTimeout(()=>t(c),0)}return a})},[t]);return S.jsxs(YN,{nodes:r,edges:[],nodeTypes:mM,onNodesChange:i,onPaneClick:()=>n({kind:"none"}),onlyRenderVisibleElements:!0,fitView:!0,minZoom:.15,proOptions:{hideAttribution:!0},colorMode:"dark",children:[S.jsx(qN,{gap:24,color:"#1e2129"}),S.jsx(i2,{})]})}function vM({page:e}){const{selection:t,select:n,mutatePage:r,viewMode:o,setViewMode:i,openPage:s,previewNonce:l}=Dt(),a=t.kind==="block"?t.blockId:void 0,u=$2(A2(bd,{activationConstraint:{distance:6}})),c=d=>{!d.over||d.active.id===d.over.id||r(e.id,f=>{f.layout=Zx(f.layout,String(d.active.id),String(d.over.id))})};return S.jsxs("div",{className:"editor-view",children:[S.jsxs("div",{className:"editor-toolbar",children:[S.jsx("button",{className:"ghost",onClick:()=>s(null),children:"← Canvas"}),S.jsx("strong",{children:e.name}),a&&S.jsx("span",{className:"breadcrumb",children:bm(e.layout,a).map((d,f,g)=>S.jsxs(Se.Fragment,{children:[S.jsx("span",{className:`crumb${f===g.length-1?" current":""}`,onClick:()=>n({kind:"block",pageId:e.id,blockId:d.id}),children:d.label||d.type}),f<g.length-1&&S.jsx("span",{className:"crumb-sep",children:"›"})]},d.id))}),S.jsx("span",{style:{flex:1}}),S.jsx("button",{className:o==="layout"?"":"ghost",onClick:()=>i("layout"),children:"Layout"}),S.jsx("button",{className:o==="replica"?"":"ghost",onClick:()=>i("replica"),disabled:!e.replicaFile,title:e.replicaFile?"1:1 replica of your real page — hover elements to see what they do":"No replica extracted for this page",children:"Replica"}),S.jsx("button",{className:o==="preview"?"":"ghost",onClick:()=>i("preview"),disabled:e.status!=="designed",title:e.status!=="designed"?"Generate a design first":"",children:"Preview"})]}),o==="replica"&&e.replicaFile?S.jsx("iframe",{className:"preview-frame",src:`/replica/${e.id}`,title:"replica"},`r${l}`):o==="preview"&&e.status==="designed"?S.jsx("iframe",{className:"preview-frame",src:`/preview/${e.id}`,title:"preview"},l):S.jsx("div",{className:"editor-scroll",onClick:()=>n({kind:"page",pageId:e.id}),children:S.jsx("div",{className:"editor-page wf-paper",style:Wy(e.theme),children:S.jsx(Hb,{sensors:u,collisionDetection:B2,onDragEnd:c,children:S.jsx(Zl,{block:e.layout,interactive:!0,sortable:!0,selectedId:a,onSelect:d=>n({kind:"block",pageId:e.id,blockId:d})})})})})]})}const wM=[{name:"ux",description:"Working navigation, forms, states, keyboard access, focus, and interaction audits.",dependencies:[],signature:/\b(ux|accessib|a11y|forms?|navigation|keyboard|focus|states?|dashboard|product ui)\b/i},{name:"mobile",description:"Mobile-native composition, touch ergonomics, responsive effects, and phone verification.",dependencies:["ux"],signature:/\b(mobile|phone|tablet|responsive|touch|thumb|small screen)\b/i},{name:"refined",description:"Premium clean business, DTC, and commerce design with restraint and strong photography.",dependencies:["ux","mobile"],signature:/\b(clean (and )?(modern|professional)|modern clean|business (site|website|use)|corporate|professional look|premium (minimal|clean)|dtc|d2c|e[- ]?commerce|ecommerce|shopify|calm|understated)\b/i},{name:"motion",description:"Scroll choreography, entrances, kinetic type, springs, parallax, and transitions.",dependencies:["ux","mobile"],signature:/\b(animat|motion|parallax|scroll[- ]?(driven|trigger|story|choreo)|gsap|framer|lenis|marquee|kinetic|stagger|reveal|transition)\b/i},{name:"interaction",description:"Hover craft, magnetic controls, cursor effects, tactile feedback, and state morphs.",dependencies:["ux","mobile"],signature:/\b(micro[- ]?interaction|hover (effect|state)s?|cursor|magnetic|tilt|spotlight|glow|ripple|tactile|interactive|draggable)\b/i},{name:"media",description:"Generated and sourced image/video production, grading, motion treatments, and media planes.",dependencies:["ux","mobile"],signature:/\b(generated? (image|video|media)|hero video|image treatment|media plane|gallery|photography|video loop|distortion|living thumbnail)\b/i},{name:"3d",description:"Three.js/R3F, WebGL, shaders, particles, models, lighting, and robust fallbacks.",dependencies:["ux","mobile"],signature:/\b(3d|three\.?js|webgl|r3f|shader|glsl|particles?|point ?cloud|globe|mesh gradient|orbit|spline)\b/i},{name:"immersive",description:"Persistent spatial stages, preloaders, scene transitions, and scroll-as-journey.",dependencies:["motion","interaction","media","ux","mobile"],signature:/\b(immersive|award[- ]?(site|winning)|awwwards|spatial|scene[- ]?based|world|camera (move|travel|path)|preloader|scroll (journey|story|as travel)|explorable|experience site)\b/i},{name:"cinematic",description:"Shader-graded experiential interfaces, living surfaces, gesture exploration, and sound.",dependencies:["motion","interaction","media","ux","mobile"],signature:/\b(cinematic|experiential|unseen\.co|fluid (sim(ulation)?|distortion)|gpgpu|drag[- ]to[- ]explore|click ?(&|and) ?hold|film grain|graded|velocity[- ]reactive|sound design|ambient (audio|sound))\b/i},{name:"experimental",description:"Unconventional composition, material shifts, provocations, and high-variance creative direction.",dependencies:["motion","interaction","media","ux","mobile"],signature:/\b(experimental|crazy|bizarre|never seen before|more creative|wow factor|unconventional|unexpected|provocation)\b/i}];new Map(wM.map(e=>[e.name,e]));function fs(e){const t=e.children??[];return e.type==="hero"?"hero":e.type==="card-grid"||e.direction==="row"&&t.length>=3?`grid-${t.length}`:e.direction==="row"&&t.length===2?`split-${t.map(r=>r.type).sort().join("+")}`:`${e.type}-${e.direction??"column"}`}function sc(e,t){return(t(e)?1:0)+(e.children??[]).reduce((n,r)=>n+sc(r,t),0)}function xM(e){const t=[],n=e.children??[];let r=1;for(let u=1;u<n.length;u++)fs(n[u])===fs(n[u-1])?(r++,r===3&&t.push(`3+ consecutive sections share the same layout ("${n[u].label}") — break the pattern with a different family`)):r=1;const o=new Map;n.forEach(u=>o.set(fs(u),(o.get(fs(u))??0)+1));for(const[u,c]of o)c>2&&u!=="hero"&&t.push(`layout family "${u}" used ${c}× — a page needs distinct section compositions`);const i=u=>{const c=u.children??[];c.length>=3&&(u.direction==="row"||u.type==="card-grid")&&c.every(d=>d.type===c[0].type&&(d.sizeHint??"md")===(c[0].sizeHint??"md"))&&t.push(`"${u.label}": ${c.length} identical cells in a row — vary sizes or restructure as an asymmetric bento`),u.type==="list"&&c.length>5&&t.push(`"${u.label}": ${c.length}-item list — group into chunks, cards, or tabs instead of one long list`),c.forEach(i)};i(e);const s=[],l=u=>{var c;u.type==="hero"&&s.push(u),(c=u.children)==null||c.forEach(l)};l(e);for(const u of s){const c=sc(u,d=>d.type==="text"||d.type==="button");c>4&&t.push(`hero "${u.label}" stacks ${c} text/button elements — max 4 (headline, subtext, CTAs, one eyebrow)`)}const a=sc(e,u=>u.type==="button");return a>5&&t.push(`${a} buttons on one page — consolidate duplicate CTA intents (one label per intent)`),t}const SM=["","minimal","editorial","premium","playful","brutalist","dark-tech","trust"],EM=[{key:"variance",label:"Variance",hint:"symmetric ↔ experimental",def:7},{key:"motion",label:"Motion",hint:"static ↔ cinematic",def:5},{key:"density",label:"Density",hint:"airy ↔ packed",def:4}];function kM(){const{project:e,setProject:t}=Dt(),n=e.brief??{},r=o=>{const i=structuredClone(e);i.brief=i.brief??{},o(i.brief),t(i,{history:!1})};return S.jsxs(S.Fragment,{children:[S.jsx("h3",{children:"Design brief"}),S.jsx("p",{className:"hint",children:"Sets the direction for every AI design pass. Leave blank to let the agent read the room."}),S.jsx("select",{value:n.aesthetic??"",onChange:o=>r(i=>i.aesthetic=o.target.value||void 0),children:SM.map(o=>S.jsx("option",{value:o,children:o||"aesthetic: auto"},o))}),S.jsx("input",{type:"text",placeholder:'vibe, e.g. "calm, Linear-style"',value:n.vibe??"",onChange:o=>r(i=>i.vibe=o.target.value||void 0)}),S.jsx("input",{type:"text",placeholder:'audience, e.g. "technical buyers"',value:n.audience??"",onChange:o=>r(i=>i.audience=o.target.value||void 0)}),EM.map(o=>S.jsxs("label",{className:"dial",title:o.hint,children:[S.jsxs("span",{children:[o.label," ",S.jsx("em",{children:n[o.key]??o.def})]}),S.jsx("input",{type:"range",min:1,max:10,value:n[o.key]??o.def,onChange:i=>r(s=>s[o.key]=Number(i.target.value))})]},o.key)),S.jsx("textarea",{rows:2,placeholder:"notes for the designer agent (brand rules, must-keeps…)",value:n.notes??"",onChange:o=>r(i=>i.notes=o.target.value||void 0)})]})}async function Ya(e){const t=await e.arrayBuffer();let n="";const r=new Uint8Array(t);for(let o=0;o<r.length;o+=32768)n+=String.fromCharCode(...r.subarray(o,o+32768));return btoa(n)}function Qa({current:e,onFile:t,hint:n}){const r=k.useRef(null);return S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"drop-ref",onClick:()=>{var o;return(o=r.current)==null?void 0:o.click()},children:e?S.jsx("img",{src:`/${e}`,alt:"ref"}):n}),S.jsx("input",{ref:r,type:"file",accept:"image/*",style:{display:"none"},onChange:o=>{var i;return((i=o.target.files)==null?void 0:i[0])&&t(o.target.files[0])}})]})}function CM(){const{project:e,selection:t,api:n,mutatePage:r,setProject:o,select:i,openPage:s,busy:l}=Dt(),[a,u]=k.useState(""),[c,d]=k.useState("text"),[f,g]=k.useState();if(t.kind==="none")return S.jsxs("aside",{className:"inspector",children:[S.jsx("h3",{children:"How it works"}),S.jsxs("ol",{className:"steps",children:[S.jsxs("li",{children:[S.jsx("b",{children:"Propose"})," — describe pages in the top bar; AI drops wireframe cards on the canvas."]}),S.jsxs("li",{children:[S.jsx("b",{children:"Arrange"})," — open a page, drag blocks anywhere, or select one and tell AI what to change. Behavior notes become ⚡ intents."]}),S.jsxs("li",{children:[S.jsx("b",{children:"Design"})," — attach reference images (whole page, or per block) and generate. Then click elements in Preview to refine."]})]}),S.jsxs("p",{className:"hint",children:["Shortcuts: ",S.jsx("kbd",{children:"Ctrl+Z"})," undo · ",S.jsx("kbd",{children:"Ctrl+Shift+Z"})," redo · ",S.jsx("kbd",{children:"Del"})," delete selected block ·"," ",S.jsx("kbd",{children:"Esc"})," back"]}),S.jsx(kM,{})]});const y=e.pages.find(v=>v.id===t.pageId);if(!y)return S.jsx("aside",{className:"inspector"});if(t.kind==="page"){const v=xM(y.layout);return S.jsxs("aside",{className:"inspector",children:[S.jsx("h3",{children:"Page"}),S.jsx("input",{type:"text",value:y.name,onChange:x=>r(y.id,p=>p.name=x.target.value,{history:!1})}),S.jsxs("div",{className:"btn-row",children:[S.jsx("button",{className:"ghost",onClick:()=>s(y.id),children:"Open editor"}),S.jsx("button",{className:"ghost",title:"Copy this page",disabled:!!l,onClick:()=>n(`/api/pages/${y.id}/duplicate`),children:"Duplicate"})]}),S.jsx("button",{className:"ghost",title:"AI proposes 2 alternative arrangements of this page",disabled:!!l,onClick:()=>n(`/api/pages/${y.id}/variants`),children:"✨ Propose 2 layout variants"}),v.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("h3",{children:"Design hints"}),v.map((x,p)=>S.jsxs("p",{className:"lint",children:["⚠ ",x]},p))]}),S.jsx("h3",{children:"Reference image (whole page)"}),S.jsx(Qa,{current:y.refImage,hint:"Click to attach — the design will match this image's style",onFile:async x=>n(`/api/pages/${y.id}/ref`,{name:x.name,dataBase64:await Ya(x)})}),S.jsx("h3",{children:"Design prompt"}),S.jsx("textarea",{rows:3,placeholder:"e.g. clean SaaS look, dark hero, rounded cards",value:y.designPrompt??"",onChange:x=>r(y.id,p=>p.designPrompt=x.target.value,{history:!1})}),S.jsx("button",{disabled:!!l,onClick:()=>n(`/api/pages/${y.id}/design`,{designPrompt:y.designPrompt}),children:y.status==="designed"?"Regenerate design":"🎨 Generate design"}),y.status==="designed"&&S.jsx("p",{className:"hint",children:"Regenerating keeps the styling of unchanged blocks, including your element-level edits."}),S.jsx("button",{className:"danger",onClick:()=>{if(!confirm(`Delete page "${y.name}"?`))return;const x=structuredClone(e);x.pages=x.pages.filter(p=>p.id!==y.id),o(x),i({kind:"none"})},children:"Delete page"})]})}if(t.kind==="block"){const v=Hr(y.layout,t.blockId);if(!v)return S.jsx("aside",{className:"inspector"});const x=v.id===y.layout.id,p=(m,h=!0)=>r(y.id,w=>{const C=Hr(w.layout,v.id);C&&m(C)},{history:h});return S.jsxs("aside",{className:"inspector",children:[S.jsxs("h3",{children:["Block — ",v.type]}),S.jsx("input",{type:"text",value:v.label,onChange:m=>p(h=>h.label=m.target.value,!1)}),v.summary&&S.jsxs("p",{className:"hint",children:["ℹ ",v.summary]}),S.jsxs("div",{className:"btn-row",children:[S.jsxs("button",{className:"ghost",title:"Cycle relative size (sm → md → lg)",onClick:()=>p(m=>{m.sizeHint=m.sizeHint==="sm"?"md":m.sizeHint==="md"?"lg":"sm"}),children:["Size: ",v.sizeHint??"md"]}),S.jsx("button",{className:"ghost",title:"Toggle whether children stack vertically or sit side-by-side",onClick:()=>p(m=>m.direction=m.direction==="row"?"column":"row"),children:v.direction==="row"?"→ row":"↓ column"})]}),S.jsxs("div",{className:"btn-row",children:[S.jsx("select",{value:c,onChange:m=>d(m.target.value),children:Jx.map(m=>S.jsx("option",{value:m,children:m},m))}),S.jsx("button",{className:"ghost",title:"Add a child block of the selected type inside this block",onClick:()=>r(y.id,m=>m.layout=Im(m.layout,v.id,qx(c))),children:"+ Add child"})]}),!x&&S.jsxs("div",{className:"btn-row",children:[S.jsx("button",{className:"ghost",onClick:()=>r(y.id,m=>{const h=tl(m.layout,v.id),w=Hr(m.layout,v.id);h&&w&&h.parent.children.splice(h.index+1,0,Dm(w))}),children:"Duplicate"}),S.jsx("button",{className:"danger",onClick:()=>{r(y.id,m=>m.layout=zl(m.layout,v.id)),i({kind:"page",pageId:y.id})},children:"Delete"})]}),S.jsx("h3",{children:"Style reference (this block)"}),S.jsx(Qa,{current:v.refImage,hint:"Optional: attach an image just for this block's style",onFile:async m=>n(`/api/pages/${y.id}/blocks/${v.id}/ref`,{name:m.name,dataBase64:await Ya(m)})}),S.jsx("h3",{children:"Edit with AI"}),S.jsx("p",{className:"hint",children:"Describe a structure or functionality change. Behavior notes land in ⚡ intents and get implemented in the design pass."}),S.jsx("textarea",{rows:3,placeholder:'e.g. "make this a 3-card testimonial carousel" or "this button opens a signup modal"',value:a,onChange:m=>u(m.target.value)}),S.jsx("button",{disabled:!!l||!a.trim(),onClick:async()=>{await n(`/api/pages/${y.id}/blocks/${v.id}/edit`,{instruction:a}),u("")},children:"Apply with AI"}),v.intents&&v.intents.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("h3",{children:"Intents"}),v.intents.map((m,h)=>S.jsxs("div",{className:"intent",children:["⚡ ",m,S.jsx("span",{className:"intent-x",title:"Remove intent",onClick:()=>p(w=>w.intents.splice(h,1)),children:"×"})]},h))]})]})}return S.jsxs("aside",{className:"inspector",children:[S.jsx("h3",{children:"Element"}),S.jsxs("p",{className:"hint",children:["Selected ",S.jsx("code",{children:t.elementId})," in the designed page. Describe the change, optionally with a style reference image."]}),S.jsx(Qa,{current:f,hint:"Optional: style reference for this change",onFile:async v=>{const p=await(await fetch(`/api/pages/${y.id}/blocks/${t.elementId}/ref`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:v.name,dataBase64:await Ya(v)})})).json();p.refPath&&g(p.refPath)}}),S.jsx("textarea",{rows:3,placeholder:'e.g. "make the headline bigger and gold" or "match the reference image"',value:a,onChange:v=>u(v.target.value)}),S.jsx("button",{disabled:!!l||!a.trim(),onClick:async()=>{await n(`/api/pages/${y.id}/element/${t.elementId}/edit`,{instruction:a,refPath:f}),u(""),g(void 0)},children:"Apply with AI"})]})}const _M=["Landing page for a specialty coffee brand","SaaS dashboard with sidebar, stats, and activity feed","Portfolio site for a photographer","E-commerce product page with reviews"];function NM({onPick:e}){return S.jsx("div",{className:"empty-state",children:S.jsxs("div",{className:"empty-card",children:[S.jsx("div",{className:"empty-logo",children:"◆"}),S.jsx("h1",{children:"Start with a prompt"}),S.jsxs("p",{children:["Describe what you want to build. AI proposes ",S.jsx("b",{children:"3 wireframe layouts"})," — you arrange the structure, then AI designs each page from your reference image."]}),S.jsx("div",{className:"empty-examples",children:_M.map(t=>S.jsx("button",{className:"ghost",onClick:()=>e(t),children:t},t))})]})})}function bM(){const{project:e,load:t,api:n,busy:r,error:o,openPageId:i,select:s,selection:l,viewMode:a,openPage:u,mutatePage:c}=Dt(),[d,f]=k.useState("");k.useEffect(()=>{t()},[t]),k.useEffect(()=>{const v=x=>{const p=x.target,m=p.tagName==="INPUT"||p.tagName==="TEXTAREA"||p.tagName==="SELECT";if((x.ctrlKey||x.metaKey)&&x.key.toLowerCase()==="z"&&!m){x.preventDefault(),x.shiftKey?Dt.getState().redo():Dt.getState().undo();return}if(m)return;const h=Dt.getState();if(x.key==="Delete"||x.key==="Backspace"){if(h.selection.kind==="block"){const w=h.project.pages.find(C=>C.id===h.selection.pageId);if(w&&h.selection.blockId!==w.layout.id){const C=h.selection.blockId;c(w.id,_=>_.layout=zl(_.layout,C)),s({kind:"page",pageId:w.id})}}}else x.key==="Escape"&&(h.selection.kind==="block"||h.selection.kind==="element"?s({kind:"page",pageId:h.selection.pageId}):h.openPageId?u(null):s({kind:"none"}))};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[c,u,s]),k.useEffect(()=>{const v=x=>{var p,m;((p=x.data)==null?void 0:p.type)==="dreative-select"&&i&&a==="preview"&&s({kind:"element",pageId:i,elementId:x.data.id}),((m=x.data)==null?void 0:m.type)==="dreative-select-block"&&i&&a==="replica"&&s({kind:"block",pageId:i,blockId:x.data.id})};return window.addEventListener("message",v),()=>window.removeEventListener("message",v)},[i,a,s]);const g=e.pages.find(v=>v.id===i),y=async()=>{d.trim()&&(await n("/api/skeletons",{prompt:d}),f(""))};return S.jsxs("div",{className:"app",children:[S.jsxs("div",{className:"topbar",children:[S.jsx("span",{className:"logo",children:"◆ Dreative"}),S.jsx("input",{placeholder:"Describe pages to generate, e.g. “landing page for a specialty coffee brand”",value:d,onChange:v=>f(v.target.value),onKeyDown:v=>v.key==="Enter"&&y()}),S.jsx("button",{disabled:!!r||!d.trim(),onClick:y,title:"AI proposes 3 wireframe layouts",children:"✨ Propose layouts"}),S.jsx("button",{title:"AI designs every page to the project's design brief (doctrine-checked)",disabled:!!r||e.pages.length===0,onClick:()=>n("/api/design-all",{}),children:"🎨 Design all"}),S.jsx("button",{className:"ghost",title:"Copy designed pages as .tsx into ./src/pages",disabled:!e.pages.some(v=>v.status==="designed"),onClick:async()=>{const x=await(await fetch("/api/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})).json();alert(`Exported:
66
+ `},j2={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function z2(e){let{announcements:t=j2,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=R2}=e;const{announce:i,announcement:s}=P2(),l=Ti("DndLiveRegion"),[a,u]=k.useState(!1);if(k.useEffect(()=>{u(!0)},[]),D2(k.useMemo(()=>({onDragStart(d){let{active:f}=d;i(t.onDragStart({active:f}))},onDragMove(d){let{active:f,over:g}=d;t.onDragMove&&i(t.onDragMove({active:f,over:g}))},onDragOver(d){let{active:f,over:g}=d;i(t.onDragOver({active:f,over:g}))},onDragEnd(d){let{active:f,over:g}=d;i(t.onDragEnd({active:f,over:g}))},onDragCancel(d){let{active:f,over:g}=d;i(t.onDragCancel({active:f,over:g}))}}),[i,t])),!a)return null;const c=Se.createElement(Se.Fragment,null,Se.createElement(M2,{id:r,value:o.draggable}),Se.createElement(I2,{id:l,announcement:s}));return n?Tr.createPortal(c,n):c}var be;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(be||(be={}));function ml(){}function A2(e,t){return k.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function $2(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return k.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Ot=Object.freeze({x:0,y:0});function L2(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function O2(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function F2(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function H2(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function tp(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const B2=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=tp(t,t.left,t.top),i=[];for(const s of r){const{id:l}=s,a=n.get(l);if(a){const u=L2(tp(a),o);i.push({id:l,data:{droppableContainer:s,value:u}})}}return i.sort(O2)};function V2(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height),s=o-r,l=i-n;if(r<o&&n<i){const a=t.width*t.height,u=e.width*e.height,c=s*l,d=c/(a+u-c);return Number(d.toFixed(4))}return 0}const U2=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const i of r){const{id:s}=i,l=n.get(s);if(l){const a=V2(l,t);a>0&&o.push({id:s,data:{droppableContainer:i,value:a}})}}return o.sort(F2)};function W2(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function by(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Ot}function X2(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];return o.reduce((s,l)=>({...s,top:s.top+e*l.y,bottom:s.bottom+e*l.y,left:s.left+e*l.x,right:s.right+e*l.x}),{...n})}}const Y2=X2(1);function Q2(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function K2(e,t,n){const r=Q2(t);if(!r)return e;const{scaleX:o,scaleY:i,x:s,y:l}=r,a=e.left-s-(1-o)*parseFloat(n),u=e.top-l-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=o?e.width/o:e.width,d=i?e.height/i:e.height;return{width:c,height:d,top:u,right:a+c,bottom:u+d,left:a}}const G2={ignoreTransform:!1};function co(e,t){t===void 0&&(t=G2);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:c}=it(e).getComputedStyle(e);u&&(n=K2(n,u,c))}const{top:r,left:o,width:i,height:s,bottom:l,right:a}=n;return{top:r,left:o,width:i,height:s,bottom:l,right:a}}function np(e){return co(e,{ignoreTransform:!0})}function Z2(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function q2(e,t){return t===void 0&&(t=it(e).getComputedStyle(e)),t.position==="fixed"}function J2(e,t){t===void 0&&(t=it(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const i=t[o];return typeof i=="string"?n.test(i):!1})}function Cd(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(Sd(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Pi(o)||Cy(o)||n.includes(o))return n;const i=it(e).getComputedStyle(o);return o!==e&&J2(o,i)&&n.push(o),q2(o,i)?n:r(o.parentNode)}return e?r(e):n}function My(e){const[t]=Cd(e,1);return t??null}function Ua(e){return!Ql||!e?null:ao(e)?e:xd(e)?Sd(e)||e===uo(e).scrollingElement?window:Pi(e)?e:null:null}function Iy(e){return ao(e)?e.scrollX:e.scrollLeft}function Py(e){return ao(e)?e.scrollY:e.scrollTop}function rc(e){return{x:Iy(e),y:Py(e)}}var De;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(De||(De={}));function Dy(e){return!Ql||!e?!1:e===document.scrollingElement}function Ty(e){const t={x:0,y:0},n=Dy(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,i=e.scrollLeft<=t.x,s=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:i,isBottom:s,isRight:l,maxScroll:r,minScroll:t}}const eb={x:.2,y:.2};function tb(e,t,n,r,o){let{top:i,left:s,right:l,bottom:a}=n;r===void 0&&(r=10),o===void 0&&(o=eb);const{isTop:u,isBottom:c,isLeft:d,isRight:f}=Ty(e),g={x:0,y:0},y={x:0,y:0},v={height:t.height*o.y,width:t.width*o.x};return!u&&i<=t.top+v.height?(g.y=De.Backward,y.y=r*Math.abs((t.top+v.height-i)/v.height)):!c&&a>=t.bottom-v.height&&(g.y=De.Forward,y.y=r*Math.abs((t.bottom-v.height-a)/v.height)),!f&&l>=t.right-v.width?(g.x=De.Forward,y.x=r*Math.abs((t.right-v.width-l)/v.width)):!d&&s<=t.left+v.width&&(g.x=De.Backward,y.x=r*Math.abs((t.left+v.width-s)/v.width)),{direction:g,speed:y}}function nb(e){if(e===document.scrollingElement){const{innerWidth:i,innerHeight:s}=window;return{top:0,left:0,right:i,bottom:s,width:i,height:s}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function Ry(e){return e.reduce((t,n)=>Ur(t,rc(n)),Ot)}function rb(e){return e.reduce((t,n)=>t+Iy(n),0)}function ob(e){return e.reduce((t,n)=>t+Py(n),0)}function ib(e,t){if(t===void 0&&(t=co),!e)return;const{top:n,left:r,bottom:o,right:i}=t(e);My(e)&&(o<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const sb=[["x",["left","right"],rb],["y",["top","bottom"],ob]];class _d{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Cd(n),o=Ry(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[i,s,l]of sb)for(const a of s)Object.defineProperty(this,a,{get:()=>{const u=l(r),c=o[i]-u;return this.rect[a]+c},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Ho{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function lb(e){const{EventTarget:t}=it(e);return e instanceof t?e:uo(e)}function Wa(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var yt;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(yt||(yt={}));function rp(e){e.preventDefault()}function ab(e){e.stopPropagation()}var le;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(le||(le={}));const jy={start:[le.Space,le.Enter],cancel:[le.Esc],end:[le.Space,le.Enter,le.Tab]},ub=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case le.Right:return{...n,x:n.x+25};case le.Left:return{...n,x:n.x-25};case le.Down:return{...n,y:n.y+25};case le.Up:return{...n,y:n.y-25}}};class zy{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Ho(uo(n)),this.windowListeners=new Ho(it(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(yt.Resize,this.handleCancel),this.windowListeners.add(yt.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(yt.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&ib(r),n(Ot)}handleKeyDown(t){if(kd(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:i=jy,coordinateGetter:s=ub,scrollBehavior:l="smooth"}=o,{code:a}=t;if(i.end.includes(a)){this.handleEnd(t);return}if(i.cancel.includes(a)){this.handleCancel(t);return}const{collisionRect:u}=r.current,c=u?{x:u.left,y:u.top}:Ot;this.referenceCoordinates||(this.referenceCoordinates=c);const d=s(t,{active:n,context:r.current,currentCoordinates:c});if(d){const f=gl(d,c),g={x:0,y:0},{scrollableAncestors:y}=r.current;for(const v of y){const x=t.code,{isTop:p,isRight:m,isLeft:h,isBottom:w,maxScroll:C,minScroll:_}=Ty(v),N=nb(v),b={x:Math.min(x===le.Right?N.right-N.width/2:N.right,Math.max(x===le.Right?N.left:N.left+N.width/2,d.x)),y:Math.min(x===le.Down?N.bottom-N.height/2:N.bottom,Math.max(x===le.Down?N.top:N.top+N.height/2,d.y))},D=x===le.Right&&!m||x===le.Left&&!h,A=x===le.Down&&!w||x===le.Up&&!p;if(D&&b.x!==d.x){const j=v.scrollLeft+f.x,H=x===le.Right&&j<=C.x||x===le.Left&&j>=_.x;if(H&&!f.y){v.scrollTo({left:j,behavior:l});return}H?g.x=v.scrollLeft-j:g.x=x===le.Right?v.scrollLeft-C.x:v.scrollLeft-_.x,g.x&&v.scrollBy({left:-g.x,behavior:l});break}else if(A&&b.y!==d.y){const j=v.scrollTop+f.y,H=x===le.Down&&j<=C.y||x===le.Up&&j>=_.y;if(H&&!f.x){v.scrollTo({top:j,behavior:l});return}H?g.y=v.scrollTop-j:g.y=x===le.Down?v.scrollTop-C.y:v.scrollTop-_.y,g.y&&v.scrollBy({top:-g.y,behavior:l});break}}this.handleMove(t,Ur(gl(d,this.referenceCoordinates),g))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}zy.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=jy,onActivation:o}=t,{active:i}=n;const{code:s}=e.nativeEvent;if(r.start.includes(s)){const l=i.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function op(e){return!!(e&&"distance"in e)}function ip(e){return!!(e&&"delay"in e)}class Nd{constructor(t,n,r){var o;r===void 0&&(r=lb(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:i}=t,{target:s}=i;this.props=t,this.events=n,this.document=uo(s),this.documentListeners=new Ho(this.document),this.listeners=new Ho(r),this.windowListeners=new Ho(it(s)),this.initialCoordinates=(o=nc(i))!=null?o:Ot,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(yt.Resize,this.handleCancel),this.windowListeners.add(yt.DragStart,rp),this.windowListeners.add(yt.VisibilityChange,this.handleCancel),this.windowListeners.add(yt.ContextMenu,rp),this.documentListeners.add(yt.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ip(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(op(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(yt.Click,ab,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(yt.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:i}=this,{onMove:s,options:{activationConstraint:l}}=i;if(!o)return;const a=(n=nc(t))!=null?n:Ot,u=gl(o,a);if(!r&&l){if(op(l)){if(l.tolerance!=null&&Wa(u,l.tolerance))return this.handleCancel();if(Wa(u,l.distance))return this.handleStart()}if(ip(l)&&Wa(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),s(a)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===le.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const cb={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class bd extends Nd{constructor(t){const{event:n}=t,r=uo(n.target);super(t,cb,r)}}bd.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const db={move:{name:"mousemove"},end:{name:"mouseup"}};var oc;(function(e){e[e.RightClick=2]="RightClick"})(oc||(oc={}));class fb extends Nd{constructor(t){super(t,db,uo(t.event.target))}}fb.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===oc.RightClick?!1:(r==null||r({event:n}),!0)}}];const Xa={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class hb extends Nd{constructor(t){super(t,Xa)}static setup(){return window.addEventListener(Xa.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Xa.move.name,t)};function t(){}}}hb.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Bo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Bo||(Bo={}));var yl;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(yl||(yl={}));function pb(e){let{acceleration:t,activator:n=Bo.Pointer,canScroll:r,draggingRect:o,enabled:i,interval:s=5,order:l=yl.TreeOrder,pointerCoordinates:a,scrollableAncestors:u,scrollableAncestorRects:c,delta:d,threshold:f}=e;const g=mb({delta:d,disabled:!i}),[y,v]=k2(),x=k.useRef({x:0,y:0}),p=k.useRef({x:0,y:0}),m=k.useMemo(()=>{switch(n){case Bo.Pointer:return a?{top:a.y,bottom:a.y,left:a.x,right:a.x}:null;case Bo.DraggableRect:return o}},[n,o,a]),h=k.useRef(null),w=k.useCallback(()=>{const _=h.current;if(!_)return;const N=x.current.x*p.current.x,b=x.current.y*p.current.y;_.scrollBy(N,b)},[]),C=k.useMemo(()=>l===yl.TreeOrder?[...u].reverse():u,[l,u]);k.useEffect(()=>{if(!i||!u.length||!m){v();return}for(const _ of C){if((r==null?void 0:r(_))===!1)continue;const N=u.indexOf(_),b=c[N];if(!b)continue;const{direction:D,speed:A}=tb(_,b,m,t,f);for(const j of["x","y"])g[j][D[j]]||(A[j]=0,D[j]=0);if(A.x>0||A.y>0){v(),h.current=_,y(w,s),x.current=A,p.current=D;return}}x.current={x:0,y:0},p.current={x:0,y:0},v()},[t,w,r,v,i,s,JSON.stringify(m),JSON.stringify(g),y,u,C,c,JSON.stringify(f)])}const gb={x:{[De.Backward]:!1,[De.Forward]:!1},y:{[De.Backward]:!1,[De.Forward]:!1}};function mb(e){let{delta:t,disabled:n}=e;const r=tc(t);return Di(o=>{if(n||!r||!o)return gb;const i={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[De.Backward]:o.x[De.Backward]||i.x===-1,[De.Forward]:o.x[De.Forward]||i.x===1},y:{[De.Backward]:o.y[De.Backward]||i.y===-1,[De.Forward]:o.y[De.Forward]||i.y===1}}},[n,t,r])}function yb(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Di(o=>{var i;return t==null?null:(i=r??o)!=null?i:null},[r,t])}function vb(e,t){return k.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,i=o.activators.map(s=>({eventName:s.eventName,handler:t(s.handler,r)}));return[...n,...i]},[]),[e,t])}var vi;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(vi||(vi={}));var ic;(function(e){e.Optimized="optimized"})(ic||(ic={}));const sp=new Map;function wb(e,t){let{dragging:n,dependencies:r,config:o}=t;const[i,s]=k.useState(null),{frequency:l,measure:a,strategy:u}=o,c=k.useRef(e),d=x(),f=mi(d),g=k.useCallback(function(p){p===void 0&&(p=[]),!f.current&&s(m=>m===null?p:m.concat(p.filter(h=>!m.includes(h))))},[f]),y=k.useRef(null),v=Di(p=>{if(d&&!n)return sp;if(!p||p===sp||c.current!==e||i!=null){const m=new Map;for(let h of e){if(!h)continue;if(i&&i.length>0&&!i.includes(h.id)&&h.rect.current){m.set(h.id,h.rect.current);continue}const w=h.node.current,C=w?new _d(a(w),w):null;h.rect.current=C,C&&m.set(h.id,C)}return m}return p},[e,i,n,d,a]);return k.useEffect(()=>{c.current=e},[e]),k.useEffect(()=>{d||g()},[n,d]),k.useEffect(()=>{i&&i.length>0&&s(null)},[JSON.stringify(i)]),k.useEffect(()=>{d||typeof l!="number"||y.current!==null||(y.current=setTimeout(()=>{g(),y.current=null},l))},[l,d,g,...r]),{droppableRects:v,measureDroppableContainers:g,measuringScheduled:i!=null};function x(){switch(u){case vi.Always:return!1;case vi.BeforeDragging:return n;default:return!n}}}function Ay(e,t){return Di(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function xb(e,t){return Ay(e,t)}function Sb(e){let{callback:t,disabled:n}=e;const r=Ed(t),o=k.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:i}=window;return new i(r)},[r,n]);return k.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Kl(e){let{callback:t,disabled:n}=e;const r=Ed(t),o=k.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:i}=window;return new i(r)},[n]);return k.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Eb(e){return new _d(co(e),e)}function lp(e,t,n){t===void 0&&(t=Eb);const[r,o]=k.useState(null);function i(){o(a=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=a??n)!=null?u:null}const c=t(e);return JSON.stringify(a)===JSON.stringify(c)?a:c})}const s=Sb({callback(a){if(e)for(const u of a){const{type:c,target:d}=u;if(c==="childList"&&d instanceof HTMLElement&&d.contains(e)){i();break}}}}),l=Kl({callback:i});return tn(()=>{i(),e?(l==null||l.observe(e),s==null||s.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),s==null||s.disconnect())},[e]),r}function kb(e){const t=Ay(e);return by(e,t)}const ap=[];function Cb(e){const t=k.useRef(e),n=Di(r=>e?r&&r!==ap&&e&&t.current&&e.parentNode===t.current.parentNode?r:Cd(e):ap,[e]);return k.useEffect(()=>{t.current=e},[e]),n}function _b(e){const[t,n]=k.useState(null),r=k.useRef(e),o=k.useCallback(i=>{const s=Ua(i.target);s&&n(l=>l?(l.set(s,rc(s)),new Map(l)):null)},[]);return k.useEffect(()=>{const i=r.current;if(e!==i){s(i);const l=e.map(a=>{const u=Ua(a);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,rc(u)]):null}).filter(a=>a!=null);n(l.length?new Map(l):null),r.current=e}return()=>{s(e),s(i)};function s(l){l.forEach(a=>{const u=Ua(a);u==null||u.removeEventListener("scroll",o)})}},[o,e]),k.useMemo(()=>e.length?t?Array.from(t.values()).reduce((i,s)=>Ur(i,s),Ot):Ry(e):Ot,[e,t])}function up(e,t){t===void 0&&(t=[]);const n=k.useRef(null);return k.useEffect(()=>{n.current=null},t),k.useEffect(()=>{const r=e!==Ot;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?gl(e,n.current):Ot}function Nb(e){k.useEffect(()=>{if(!Ql)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function bb(e,t){return k.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:i}=r;return n[o]=s=>{i(s,t)},n},{}),[e,t])}function $y(e){return k.useMemo(()=>e?Z2(e):null,[e])}const cp=[];function Mb(e,t){t===void 0&&(t=co);const[n]=e,r=$y(n?it(n):null),[o,i]=k.useState(cp);function s(){i(()=>e.length?e.map(a=>Dy(a)?r:new _d(t(a),a)):cp)}const l=Kl({callback:s});return tn(()=>{l==null||l.disconnect(),s(),e.forEach(a=>l==null?void 0:l.observe(a))},[e]),o}function Ib(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Pi(t)?t:e}function Pb(e){let{measure:t}=e;const[n,r]=k.useState(null),o=k.useCallback(u=>{for(const{target:c}of u)if(Pi(c)){r(d=>{const f=t(c);return d?{...d,width:f.width,height:f.height}:f});break}},[t]),i=Kl({callback:o}),s=k.useCallback(u=>{const c=Ib(u);i==null||i.disconnect(),c&&(i==null||i.observe(c)),r(c?t(c):null)},[t,i]),[l,a]=pl(s);return k.useMemo(()=>({nodeRef:l,rect:n,setRef:a}),[n,l,a])}const Db=[{sensor:bd,options:{}},{sensor:zy,options:{}}],Tb={current:{}},Ps={draggable:{measure:np},droppable:{measure:np,strategy:vi.WhileDragging,frequency:ic.Optimized},dragOverlay:{measure:co}};class Vo extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Rb={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new Vo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:ml},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ps,measureDroppableContainers:ml,windowRect:null,measuringScheduled:!1},jb={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:ml,draggableNodes:new Map,over:null,measureDroppableContainers:ml},Gl=k.createContext(jb),Ly=k.createContext(Rb);function zb(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new Vo}}}function Ab(e,t){switch(t.type){case be.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case be.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case be.DragEnd:case be.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case be.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new Vo(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case be.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const s=new Vo(e.droppable.containers);return s.set(n,{...i,disabled:o}),{...e,droppable:{...e.droppable,containers:s}}}case be.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const i=new Vo(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function $b(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=k.useContext(Gl),i=tc(r),s=tc(n==null?void 0:n.id);return k.useEffect(()=>{if(!t&&!r&&i&&s!=null){if(!kd(i)||document.activeElement===i.target)return;const l=o.get(s);if(!l)return;const{activatorNode:a,node:u}=l;if(!a.current&&!u.current)return;requestAnimationFrame(()=>{for(const c of[a.current,u.current]){if(!c)continue;const d=N2(c);if(d){d.focus();break}}})}},[r,t,o,s,i]),null}function Lb(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,i)=>i({transform:o,...r}),n):n}function Ob(e){return k.useMemo(()=>({draggable:{...Ps.draggable,...e==null?void 0:e.draggable},droppable:{...Ps.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ps.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Fb(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const i=k.useRef(!1),{x:s,y:l}=typeof o=="boolean"?{x:o,y:o}:o;tn(()=>{if(!s&&!l||!t){i.current=!1;return}if(i.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const c=n(u),d=by(c,r);if(s||(d.x=0),l||(d.y=0),i.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const f=My(u);f&&f.scrollBy({top:d.y,left:d.x})}},[t,s,l,r,n])}const Oy=k.createContext({...Ot,scaleX:1,scaleY:1});var _n;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(_n||(_n={}));const Hb=k.memo(function(t){var n,r,o,i;let{id:s,accessibility:l,autoScroll:a=!0,children:u,sensors:c=Db,collisionDetection:d=U2,measuring:f,modifiers:g,...y}=t;const v=k.useReducer(Ab,void 0,zb),[x,p]=v,[m,h]=T2(),[w,C]=k.useState(_n.Uninitialized),_=w===_n.Initialized,{draggable:{active:N,nodes:b,translate:D},droppable:{containers:A}}=x,j=N!=null?b.get(N):null,H=k.useRef({initial:null,translated:null}),L=k.useMemo(()=>{var Ie;return N!=null?{id:N,data:(Ie=j==null?void 0:j.data)!=null?Ie:Tb,rect:H}:null},[N,j]),E=k.useRef(null),[T,P]=k.useState(null),[R,I]=k.useState(null),M=mi(y,Object.values(y)),z=Ti("DndDescribedBy",s),O=k.useMemo(()=>A.getEnabled(),[A]),$=Ob(f),{droppableRects:U,measureDroppableContainers:W,measuringScheduled:Z}=wb(O,{dragging:_,dependencies:[D.x,D.y],config:$.droppable}),G=yb(b,N),q=k.useMemo(()=>R?nc(R):null,[R]),F=ra(),V=xb(G,$.draggable.measure);Fb({activeNode:N!=null?b.get(N):null,config:F.layoutShiftCompensation,initialRect:V,measure:$.draggable.measure});const X=lp(G,$.draggable.measure,V),J=lp(G?G.parentElement:null),Y=k.useRef({activatorEvent:null,active:null,activeNode:G,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:b,draggingNode:null,draggingNodeRect:null,droppableContainers:A,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),K=A.getNodeFor((n=Y.current.over)==null?void 0:n.id),te=Pb({measure:$.dragOverlay.measure}),ne=(r=te.nodeRef.current)!=null?r:G,re=_?(o=te.rect)!=null?o:X:null,ce=!!(te.nodeRef.current&&te.rect),He=kb(ce?null:X),Ke=$y(ne?it(ne):null),Ce=Cb(_?K??G:null),Ge=Mb(Ce),Ht=Lb(g,{transform:{x:D.x-He.x,y:D.y-He.y,scaleX:1,scaleY:1},activatorEvent:R,active:L,activeNodeRect:X,containerNodeRect:J,draggingNodeRect:re,over:Y.current.over,overlayNodeRect:te.rect,scrollableAncestors:Ce,scrollableAncestorRects:Ge,windowRect:Ke}),Bt=q?Ur(q,D):null,Vt=_b(Ce),st=up(Vt),Ct=up(Vt,[X]),Ae=Ur(Ht,st),Ze=re?Y2(re,Ht):null,on=L&&Ze?d({active:L,collisionRect:Ze,droppableRects:U,droppableContainers:O,pointerCoordinates:Bt}):null,yr=H2(on,"id"),[Ut,Ri]=k.useState(null),ql=ce?Ht:Ur(Ht,Ct),Jl=W2(ql,(i=Ut==null?void 0:Ut.rect)!=null?i:null,X),fo=k.useRef(null),ji=k.useCallback((Ie,Be)=>{let{sensor:Ve,options:Wt}=Be;if(E.current==null)return;const qe=b.get(E.current);if(!qe)return;const Ue=Ie.nativeEvent,gt=new Ve({active:E.current,activeNode:qe,event:Ue,options:Wt,context:Y,onAbort(_e){if(!b.get(_e))return;const{onDragAbort:mt}=M.current,_t={id:_e};mt==null||mt(_t),m({type:"onDragAbort",event:_t})},onPending(_e,Xt,mt,_t){if(!b.get(_e))return;const{onDragPending:Xn}=M.current,Yt={id:_e,constraint:Xt,initialCoordinates:mt,offset:_t};Xn==null||Xn(Yt),m({type:"onDragPending",event:Yt})},onStart(_e){const Xt=E.current;if(Xt==null)return;const mt=b.get(Xt);if(!mt)return;const{onDragStart:_t}=M.current,Wn={activatorEvent:Ue,active:{id:Xt,data:mt.data,rect:H}};Tr.unstable_batchedUpdates(()=>{_t==null||_t(Wn),C(_n.Initializing),p({type:be.DragStart,initialCoordinates:_e,active:Xt}),m({type:"onDragStart",event:Wn}),P(fo.current),I(Ue)})},onMove(_e){p({type:be.DragMove,coordinates:_e})},onEnd:wn(be.DragEnd),onCancel:wn(be.DragCancel)});fo.current=gt;function wn(_e){return async function(){const{active:mt,collisions:_t,over:Wn,scrollAdjustedTranslate:Xn}=Y.current;let Yt=null;if(mt&&Xn){const{cancelDrop:Yn}=M.current;Yt={activatorEvent:Ue,active:mt,collisions:_t,delta:Xn,over:Wn},_e===be.DragEnd&&typeof Yn=="function"&&await Promise.resolve(Yn(Yt))&&(_e=be.DragCancel)}E.current=null,Tr.unstable_batchedUpdates(()=>{p({type:_e}),C(_n.Uninitialized),Ri(null),P(null),I(null),fo.current=null;const Yn=_e===be.DragEnd?"onDragEnd":"onDragCancel";if(Yt){const ho=M.current[Yn];ho==null||ho(Yt),m({type:Yn,event:Yt})}})}}},[b]),ea=k.useCallback((Ie,Be)=>(Ve,Wt)=>{const qe=Ve.nativeEvent,Ue=b.get(Wt);if(E.current!==null||!Ue||qe.dndKit||qe.defaultPrevented)return;const gt={active:Ue};Ie(Ve,Be.options,gt)===!0&&(qe.dndKit={capturedBy:Be.sensor},E.current=Wt,ji(Ve,Be))},[b,ji]),zi=vb(c,ea);Nb(c),tn(()=>{X&&w===_n.Initializing&&C(_n.Initialized)},[X,w]),k.useEffect(()=>{const{onDragMove:Ie}=M.current,{active:Be,activatorEvent:Ve,collisions:Wt,over:qe}=Y.current;if(!Be||!Ve)return;const Ue={active:Be,activatorEvent:Ve,collisions:Wt,delta:{x:Ae.x,y:Ae.y},over:qe};Tr.unstable_batchedUpdates(()=>{Ie==null||Ie(Ue),m({type:"onDragMove",event:Ue})})},[Ae.x,Ae.y]),k.useEffect(()=>{const{active:Ie,activatorEvent:Be,collisions:Ve,droppableContainers:Wt,scrollAdjustedTranslate:qe}=Y.current;if(!Ie||E.current==null||!Be||!qe)return;const{onDragOver:Ue}=M.current,gt=Wt.get(yr),wn=gt&&gt.rect.current?{id:gt.id,rect:gt.rect.current,data:gt.data,disabled:gt.disabled}:null,_e={active:Ie,activatorEvent:Be,collisions:Ve,delta:{x:qe.x,y:qe.y},over:wn};Tr.unstable_batchedUpdates(()=>{Ri(wn),Ue==null||Ue(_e),m({type:"onDragOver",event:_e})})},[yr]),tn(()=>{Y.current={activatorEvent:R,active:L,activeNode:G,collisionRect:Ze,collisions:on,droppableRects:U,draggableNodes:b,draggingNode:ne,draggingNodeRect:re,droppableContainers:A,over:Ut,scrollableAncestors:Ce,scrollAdjustedTranslate:Ae},H.current={initial:re,translated:Ze}},[L,G,on,Ze,b,ne,re,U,A,Ut,Ce,Ae]),pb({...F,delta:D,draggingRect:Ze,pointerCoordinates:Bt,scrollableAncestors:Ce,scrollableAncestorRects:Ge});const ta=k.useMemo(()=>({active:L,activeNode:G,activeNodeRect:X,activatorEvent:R,collisions:on,containerNodeRect:J,dragOverlay:te,draggableNodes:b,droppableContainers:A,droppableRects:U,over:Ut,measureDroppableContainers:W,scrollableAncestors:Ce,scrollableAncestorRects:Ge,measuringConfiguration:$,measuringScheduled:Z,windowRect:Ke}),[L,G,X,R,on,J,te,b,A,U,Ut,W,Ce,Ge,$,Z,Ke]),na=k.useMemo(()=>({activatorEvent:R,activators:zi,active:L,activeNodeRect:X,ariaDescribedById:{draggable:z},dispatch:p,draggableNodes:b,over:Ut,measureDroppableContainers:W}),[R,zi,L,X,p,z,b,Ut,W]);return Se.createElement(Ny.Provider,{value:h},Se.createElement(Gl.Provider,{value:na},Se.createElement(Ly.Provider,{value:ta},Se.createElement(Oy.Provider,{value:Jl},u)),Se.createElement($b,{disabled:(l==null?void 0:l.restoreFocus)===!1})),Se.createElement(z2,{...l,hiddenTextDescribedById:z}));function ra(){const Ie=(T==null?void 0:T.autoScrollEnabled)===!1,Be=typeof a=="object"?a.enabled===!1:a===!1,Ve=_&&!Ie&&!Be;return typeof a=="object"?{...a,enabled:Ve}:{enabled:Ve}}}),Bb=k.createContext(null),dp="button",Vb="Draggable";function Ub(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const i=Ti(Vb),{activators:s,activatorEvent:l,active:a,activeNodeRect:u,ariaDescribedById:c,draggableNodes:d,over:f}=k.useContext(Gl),{role:g=dp,roleDescription:y="draggable",tabIndex:v=0}=o??{},x=(a==null?void 0:a.id)===t,p=k.useContext(x?Oy:Bb),[m,h]=pl(),[w,C]=pl(),_=bb(s,t),N=mi(n);tn(()=>(d.set(t,{id:t,key:i,node:m,activatorNode:w,data:N}),()=>{const D=d.get(t);D&&D.key===i&&d.delete(t)}),[d,t]);const b=k.useMemo(()=>({role:g,tabIndex:v,"aria-disabled":r,"aria-pressed":x&&g===dp?!0:void 0,"aria-roledescription":y,"aria-describedby":c.draggable}),[r,g,v,x,y,c.draggable]);return{active:a,activatorEvent:l,activeNodeRect:u,attributes:b,isDragging:x,listeners:r?void 0:_,node:m,over:f,setNodeRef:h,setActivatorNodeRef:C,transform:p}}function Wb(){return k.useContext(Ly)}const Xb="Droppable",Yb={timeout:25};function Qb(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const i=Ti(Xb),{active:s,dispatch:l,over:a,measureDroppableContainers:u}=k.useContext(Gl),c=k.useRef({disabled:n}),d=k.useRef(!1),f=k.useRef(null),g=k.useRef(null),{disabled:y,updateMeasurementsFor:v,timeout:x}={...Yb,...o},p=mi(v??r),m=k.useCallback(()=>{if(!d.current){d.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(p.current)?p.current:[p.current]),g.current=null},x)},[x]),h=Kl({callback:m,disabled:y||!s}),w=k.useCallback((b,D)=>{h&&(D&&(h.unobserve(D),d.current=!1),b&&h.observe(b))},[h]),[C,_]=pl(w),N=mi(t);return k.useEffect(()=>{!h||!C.current||(h.disconnect(),d.current=!1,h.observe(C.current))},[C,h]),k.useEffect(()=>(l({type:be.RegisterDroppable,element:{id:r,key:i,disabled:n,node:C,rect:f,data:N}}),()=>l({type:be.UnregisterDroppable,key:i,id:r})),[r]),k.useEffect(()=>{n!==c.current.disabled&&(l({type:be.SetDroppableDisabled,id:r,key:i,disabled:n}),c.current.disabled=n)},[r,i,n,l]),{active:s,rect:f,isOver:(a==null?void 0:a.id)===r,node:C,over:a,setNodeRef:_}}function Fy(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function Kb(e,t){return e.reduce((n,r,o)=>{const i=t.get(r);return i&&(n[o]=i),n},Array(e.length))}function us(e){return e!==null&&e>=0}function Gb(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Zb(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const cs={scaleX:1,scaleY:1},qb=e=>{var t;let{rects:n,activeNodeRect:r,activeIndex:o,overIndex:i,index:s}=e;const l=(t=n[o])!=null?t:r;if(!l)return null;const a=Jb(n,s,o);if(s===o){const u=n[i];return u?{x:o<i?u.left+u.width-(l.left+l.width):u.left-l.left,y:0,...cs}:null}return s>o&&s<=i?{x:-l.width-a,y:0,...cs}:s<o&&s>=i?{x:l.width+a,y:0,...cs}:{x:0,y:0,...cs}};function Jb(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return!r||!o&&!i?0:n<t?o?r.left-(o.left+o.width):i.left-(r.left+r.width):i?i.left-(r.left+r.width):r.left-(o.left+o.width)}const Hy=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const i=Fy(t,r,n),s=t[o],l=i[o];return!l||!s?null:{x:l.left-s.left,y:l.top-s.top,scaleX:l.width/s.width,scaleY:l.height/s.height}},ds={scaleX:1,scaleY:1},eM=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:i,overIndex:s}=e;const l=(t=i[n])!=null?t:r;if(!l)return null;if(o===n){const u=i[s];return u?{x:0,y:n<s?u.top+u.height-(l.top+l.height):u.top-l.top,...ds}:null}const a=tM(i,o,n);return o>n&&o<=s?{x:0,y:-l.height-a,...ds}:o<n&&o>=s?{x:0,y:l.height+a,...ds}:{x:0,y:0,...ds}};function tM(e,t,n){const r=e[t],o=e[t-1],i=e[t+1];return r?n<t?o?r.top-(o.top+o.height):i?i.top-(r.top+r.height):0:i?i.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const By="Sortable",Vy=Se.createContext({activeIndex:-1,containerId:By,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:Hy,disabled:{draggable:!1,droppable:!1}});function nM(e){let{children:t,id:n,items:r,strategy:o=Hy,disabled:i=!1}=e;const{active:s,dragOverlay:l,droppableRects:a,over:u,measureDroppableContainers:c}=Wb(),d=Ti(By,n),f=l.rect!==null,g=k.useMemo(()=>r.map(_=>typeof _=="object"&&"id"in _?_.id:_),[r]),y=s!=null,v=s?g.indexOf(s.id):-1,x=u?g.indexOf(u.id):-1,p=k.useRef(g),m=!Gb(g,p.current),h=x!==-1&&v===-1||m,w=Zb(i);tn(()=>{m&&y&&c(g)},[m,g,y,c]),k.useEffect(()=>{p.current=g},[g]);const C=k.useMemo(()=>({activeIndex:v,containerId:d,disabled:w,disableTransforms:h,items:g,overIndex:x,useDragOverlay:f,sortedRects:Kb(g,a),strategy:o}),[v,d,w.draggable,w.droppable,h,g,x,a,f,o]);return Se.createElement(Vy.Provider,{value:C},t)}const rM=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Fy(n,r,o).indexOf(t)},oM=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:i,newIndex:s,previousItems:l,previousContainerId:a,transition:u}=e;return!u||!r||l!==i&&o===s?!1:n?!0:s!==o&&t===a},iM={duration:200,easing:"ease"},Uy="transform",sM=yi.Transition.toString({property:Uy,duration:0,easing:"linear"}),lM={roleDescription:"sortable"};function aM(e){let{disabled:t,index:n,node:r,rect:o}=e;const[i,s]=k.useState(null),l=k.useRef(n);return tn(()=>{if(!t&&n!==l.current&&r.current){const a=o.current;if(a){const u=co(r.current,{ignoreTransform:!0}),c={x:a.left-u.left,y:a.top-u.top,scaleX:a.width/u.width,scaleY:a.height/u.height};(c.x||c.y)&&s(c)}}n!==l.current&&(l.current=n)},[t,n,r,o]),k.useEffect(()=>{i&&s(null)},[i]),i}function uM(e){let{animateLayoutChanges:t=oM,attributes:n,disabled:r,data:o,getNewIndex:i=rM,id:s,strategy:l,resizeObserverConfig:a,transition:u=iM}=e;const{items:c,containerId:d,activeIndex:f,disabled:g,disableTransforms:y,sortedRects:v,overIndex:x,useDragOverlay:p,strategy:m}=k.useContext(Vy),h=cM(r,g),w=c.indexOf(s),C=k.useMemo(()=>({sortable:{containerId:d,index:w,items:c},...o}),[d,o,w,c]),_=k.useMemo(()=>c.slice(c.indexOf(s)),[c,s]),{rect:N,node:b,isOver:D,setNodeRef:A}=Qb({id:s,data:C,disabled:h.droppable,resizeObserverConfig:{updateMeasurementsFor:_,...a}}),{active:j,activatorEvent:H,activeNodeRect:L,attributes:E,setNodeRef:T,listeners:P,isDragging:R,over:I,setActivatorNodeRef:M,transform:z}=Ub({id:s,data:C,attributes:{...lM,...n},disabled:h.draggable}),O=E2(A,T),$=!!j,U=$&&!y&&us(f)&&us(x),W=!p&&R,Z=W&&U?z:null,q=U?Z??(l??m)({rects:v,activeNodeRect:L,activeIndex:f,overIndex:x,index:w}):null,F=us(f)&&us(x)?i({id:s,items:c,activeIndex:f,overIndex:x}):w,V=j==null?void 0:j.id,X=k.useRef({activeId:V,items:c,newIndex:F,containerId:d}),J=c!==X.current.items,Y=t({active:j,containerId:d,isDragging:R,isSorting:$,id:s,index:w,items:c,newIndex:X.current.newIndex,previousItems:X.current.items,previousContainerId:X.current.containerId,transition:u,wasDragging:X.current.activeId!=null}),K=aM({disabled:!Y,index:w,node:b,rect:N});return k.useEffect(()=>{$&&X.current.newIndex!==F&&(X.current.newIndex=F),d!==X.current.containerId&&(X.current.containerId=d),c!==X.current.items&&(X.current.items=c)},[$,F,d,c]),k.useEffect(()=>{if(V===X.current.activeId)return;if(V!=null&&X.current.activeId==null){X.current.activeId=V;return}const ne=setTimeout(()=>{X.current.activeId=V},50);return()=>clearTimeout(ne)},[V]),{active:j,activeIndex:f,attributes:E,data:C,rect:N,index:w,newIndex:F,items:c,isOver:D,isSorting:$,isDragging:R,listeners:P,node:b,overIndex:x,over:I,setNodeRef:O,setActivatorNodeRef:M,setDroppableNodeRef:A,setDraggableNodeRef:T,transform:K??q,transition:te()};function te(){if(K||J&&X.current.newIndex===w)return sM;if(!(W&&!kd(H)||!u)&&($||Y))return yi.Transition.toString({...u,property:Uy})}}function cM(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}le.Down,le.Right,le.Up,le.Left;function Wy(e){if(!e)return{};const t={};return e.bg&&(t["--wfp-bg"]=e.bg),e.fg&&(t["--wfp-fg"]=e.fg),e.accent&&(t["--wfp-accent"]=e.accent),t}function dM({block:e}){switch(e.type){case"text":{if(e.text)return S.jsx("div",{className:`g-real ${e.sizeHint==="lg"?"g-real-lg":""}`,children:e.text});const t=e.sizeHint==="lg"?5:e.sizeHint==="sm"?2:3;return S.jsx("div",{className:"g-text",children:Array.from({length:t}).map((n,r)=>S.jsx("div",{className:"g-line",style:{width:`${92-r*14}%`}},r))})}case"button":return S.jsx("div",{className:`g-button${e.text?" g-button-labeled":""}`,children:e.text});case"image":return S.jsx("div",{className:"g-image"});case"nav":return S.jsxs("div",{className:"g-nav",children:[S.jsx("div",{className:"g-nav-dot"}),S.jsxs("div",{className:"g-nav-links",children:[S.jsx("span",{}),S.jsx("span",{}),S.jsx("span",{})]}),S.jsx("div",{className:"g-nav-cta"})]});case"hero":return S.jsxs("div",{className:"g-hero",children:[e.text?S.jsx("div",{className:"g-hero-text",children:e.text}):S.jsx("div",{className:"g-hero-title"}),S.jsx("div",{className:"g-line",style:{width:"55%"}}),S.jsx("div",{className:"g-line",style:{width:"40%"}}),S.jsx("div",{className:"g-button",style:{marginTop:8}})]});case"card-grid":return S.jsx("div",{className:"g-grid",children:Array.from({length:6}).map((t,n)=>S.jsxs("div",{className:"g-card",children:[S.jsx("div",{className:"g-card-media"}),S.jsx("div",{className:"g-line",style:{width:"80%"}}),S.jsx("div",{className:"g-line",style:{width:"55%"}})]},n))});case"list":return S.jsx("div",{className:"g-list",children:Array.from({length:3}).map((t,n)=>S.jsxs("div",{className:"g-list-row",children:[S.jsx("div",{className:"g-list-thumb"}),S.jsxs("div",{className:"g-text",style:{flex:1},children:[S.jsx("div",{className:"g-line",style:{width:"70%"}}),S.jsx("div",{className:"g-line",style:{width:"45%"}})]})]},n))});case"form":return S.jsxs("div",{className:"g-form",children:[S.jsx("div",{className:"g-input"}),S.jsx("div",{className:"g-input"}),S.jsx("div",{className:"g-button"})]});case"footer":return S.jsxs("div",{className:"g-footer",children:[S.jsxs("div",{className:"g-text",children:[S.jsx("div",{className:"g-line",style:{width:"30%"}}),S.jsx("div",{className:"g-line",style:{width:"22%"}})]}),S.jsxs("div",{className:"g-nav-links",children:[S.jsx("span",{}),S.jsx("span",{}),S.jsx("span",{})]})]});default:return null}}function fM(e,t,n){var o;const r=["wf-block",`wf-${e.type}`];return t&&r.push("selected"),(o=e.intents)!=null&&o.length&&r.push("has-intents"),e.refImage&&r.push("has-ref"),n||r.push("leaf"),r.join(" ")}function hM({block:e,...t}){const{attributes:n,listeners:r,setNodeRef:o,transform:i,transition:s}=uM({id:e.id});return S.jsx("div",{ref:o,className:"wf-sortable",style:{transform:yi.Transform.toString(i),transition:s,flex:1,minWidth:0},...n,...r,children:S.jsx(Zl,{block:e,...t})})}function Zl({block:e,selectedId:t,onSelect:n,sortable:r,interactive:o}){var u;const i=e.children??[],s=t===e.id,l=i.length>0,a=l?S.jsx("div",{className:"wf-children",style:{flexDirection:e.direction==="row"?"row":"column"},children:o&&r?S.jsx(nM,{items:i.map(c=>c.id),strategy:e.direction==="row"?qb:eM,children:i.map(c=>S.jsx(hM,{block:c,selectedId:t,onSelect:n,sortable:!0,interactive:!0},c.id))}):i.map(c=>S.jsx(Zl,{block:c,selectedId:t,onSelect:n,interactive:o},c.id))}):S.jsx(dM,{block:e});return S.jsxs("div",{className:fM(e,s,l),title:`${e.label}${e.summary?` · ${e.summary}`:""}${(u=e.intents)!=null&&u.length?` — ⚡ ${e.intents.join("; ")}`:""}`,onClick:o&&n?c=>{c.stopPropagation(),n(e.id)}:void 0,children:[o&&S.jsx("span",{className:"wf-tag",children:e.label}),a]})}const pM={skeleton:"Next: open it, tweak the layout, then generate a design",designed:"Designed — open it and switch to Preview"},gM=k.memo(function({data:t}){const{page:n}=t,{select:r,selection:o,openPage:i}=Dt(),s=o.kind==="page"&&o.pageId===n.id;return S.jsxs("div",{className:`page-node${s?" selected":""}`,title:pM[n.status],children:[S.jsxs("header",{onClick:()=>r({kind:"page",pageId:n.id}),onDoubleClick:()=>i(n.id),children:[S.jsx("span",{className:"name",children:n.name}),S.jsxs("span",{style:{display:"flex",gap:6,alignItems:"center"},children:[n.group&&S.jsx("span",{className:"badge",children:n.group}),S.jsx("span",{className:`badge${n.status==="designed"?" designed":""}`,children:n.status}),S.jsx("button",{className:"open-btn",onClick:l=>{l.stopPropagation(),i(n.id)},children:"Open"})]})]}),S.jsx("div",{className:"mini",style:{zoom:.55},children:S.jsx("div",{className:"wf-paper",style:Wy(n.theme),children:S.jsx(Zl,{block:n.layout})})})]})}),mM={page:gM};function fp(e){return e.map(t=>({id:t.id,type:"page",position:t.canvasPos,data:{page:t},dragHandle:"header"}))}function yM(){const{project:e,setProject:t,select:n}=Dt(),[r,o]=k.useState(()=>fp(e.pages));k.useEffect(()=>{o(fp(e.pages))},[e]);const i=k.useCallback(s=>{o(l=>{const a=Q0(s,l);if(s.some(c=>c.type==="position"&&c.dragging===!1)){const c=structuredClone(Dt.getState().project);for(const d of a){const f=c.pages.find(g=>g.id===d.id);f&&(f.canvasPos=d.position)}setTimeout(()=>t(c),0)}return a})},[t]);return S.jsxs(YN,{nodes:r,edges:[],nodeTypes:mM,onNodesChange:i,onPaneClick:()=>n({kind:"none"}),onlyRenderVisibleElements:!0,fitView:!0,minZoom:.15,proOptions:{hideAttribution:!0},colorMode:"dark",children:[S.jsx(qN,{gap:24,color:"#1e2129"}),S.jsx(i2,{})]})}function vM({page:e}){const{selection:t,select:n,mutatePage:r,viewMode:o,setViewMode:i,openPage:s,previewNonce:l}=Dt(),a=t.kind==="block"?t.blockId:void 0,u=$2(A2(bd,{activationConstraint:{distance:6}})),c=d=>{!d.over||d.active.id===d.over.id||r(e.id,f=>{f.layout=Zx(f.layout,String(d.active.id),String(d.over.id))})};return S.jsxs("div",{className:"editor-view",children:[S.jsxs("div",{className:"editor-toolbar",children:[S.jsx("button",{className:"ghost",onClick:()=>s(null),children:"← Canvas"}),S.jsx("strong",{children:e.name}),a&&S.jsx("span",{className:"breadcrumb",children:bm(e.layout,a).map((d,f,g)=>S.jsxs(Se.Fragment,{children:[S.jsx("span",{className:`crumb${f===g.length-1?" current":""}`,onClick:()=>n({kind:"block",pageId:e.id,blockId:d.id}),children:d.label||d.type}),f<g.length-1&&S.jsx("span",{className:"crumb-sep",children:"›"})]},d.id))}),S.jsx("span",{style:{flex:1}}),S.jsx("button",{className:o==="layout"?"":"ghost",onClick:()=>i("layout"),children:"Layout"}),S.jsx("button",{className:o==="replica"?"":"ghost",onClick:()=>i("replica"),disabled:!e.replicaFile,title:e.replicaFile?"1:1 replica of your real page — hover elements to see what they do":"No replica extracted for this page",children:"Replica"}),S.jsx("button",{className:o==="preview"?"":"ghost",onClick:()=>i("preview"),disabled:e.status!=="designed",title:e.status!=="designed"?"Generate a design first":"",children:"Preview"})]}),o==="replica"&&e.replicaFile?S.jsx("iframe",{className:"preview-frame",src:`/replica/${e.id}`,title:"replica"},`r${l}`):o==="preview"&&e.status==="designed"?S.jsx("iframe",{className:"preview-frame",src:`/preview/${e.id}`,title:"preview"},l):S.jsx("div",{className:"editor-scroll",onClick:()=>n({kind:"page",pageId:e.id}),children:S.jsx("div",{className:"editor-page wf-paper",style:Wy(e.theme),children:S.jsx(Hb,{sensors:u,collisionDetection:B2,onDragEnd:c,children:S.jsx(Zl,{block:e.layout,interactive:!0,sortable:!0,selectedId:a,onSelect:d=>n({kind:"block",pageId:e.id,blockId:d})})})})})]})}const wM=[{name:"ux",description:"Working navigation, forms, states, keyboard access, focus, and interaction audits.",dependencies:[],signature:/\b(ux|accessib|a11y|forms?|navigation|keyboard|focus|states?|dashboard|product ui)\b/i},{name:"mobile",description:"Mobile-native composition, touch ergonomics, responsive effects, and phone verification.",dependencies:["ux"],signature:/\b(mobile|phone|tablet|responsive|touch|thumb|small screen)\b/i},{name:"refined",description:"Premium clean business, DTC, and commerce design with restraint and strong photography.",dependencies:["ux","mobile"],signature:/\b(clean (and )?(modern|professional)|modern clean|business (site|website|use)|corporate|professional look|premium (minimal|clean)|dtc|d2c|e[- ]?commerce|ecommerce|shopify|calm|understated)\b/i},{name:"motion",description:"Scroll choreography, entrances, kinetic type, springs, parallax, and transitions.",dependencies:["ux","mobile"],signature:/\b(animat|motion|parallax|scroll[- ]?(driven|trigger|story|choreo)|gsap|framer|lenis|marquee|kinetic|stagger|reveal|transition)\b/i},{name:"interaction",description:"Hover craft, magnetic controls, cursor effects, tactile feedback, and state morphs.",dependencies:["ux","mobile"],signature:/\b(micro[- ]?interaction|hover (effect|state)s?|cursor|magnetic|tilt|spotlight|glow|ripple|tactile|interactive|draggable)\b/i},{name:"media",description:"Generated and sourced image/video production, grading, motion treatments, and media planes.",dependencies:["ux","mobile"],signature:/\b(generated? (image|video|media)|hero video|image treatment|media plane|gallery|photography|video loop|distortion|living thumbnail)\b/i},{name:"3d",description:"Three.js/R3F, WebGL, shaders, particles, models, lighting, and robust fallbacks.",dependencies:["ux","mobile"],signature:/\b(3d|three\.?js|webgl|r3f|shader|glsl|particles?|point ?cloud|globe|mesh gradient|orbit|spline)\b/i},{name:"immersive",description:"Persistent spatial stages, preloaders, scene transitions, and scroll-as-journey.",dependencies:["motion","interaction","media","ux","mobile"],signature:/\b(immersive|award[- ]?(site|winning)|awwwards|spatial|scene[- ]?based|world|camera (move|travel|path)|preloader|scroll (journey|story|as travel)|explorable|experience site)\b/i},{name:"cinematic",description:"Shader-graded experiential interfaces, living surfaces, gesture exploration, and sound.",dependencies:["motion","interaction","media","ux","mobile"],signature:/\b(cinematic|experiential|unseen\.co|fluid (sim(ulation)?|distortion)|gpgpu|drag[- ]to[- ]explore|click ?(&|and) ?hold|film grain|graded|velocity[- ]reactive|sound design|ambient (audio|sound))\b/i},{name:"experimental",description:"Unconventional composition, material shifts, provocations, and high-variance creative direction.",dependencies:["motion","interaction","media","ux","mobile"],signature:/\b(experimental|crazy|bizarre|never seen before|more creative|wow factor|unconventional|unexpected|provocation)\b/i}];new Map(wM.map(e=>[e.name,e]));function fs(e){const t=e.children??[];return e.type==="hero"?"hero":e.type==="card-grid"||e.direction==="row"&&t.length>=3?`grid-${t.length}`:e.direction==="row"&&t.length===2?`split-${t.map(r=>r.type).sort().join("+")}`:`${e.type}-${e.direction??"column"}`}function sc(e,t){return(t(e)?1:0)+(e.children??[]).reduce((n,r)=>n+sc(r,t),0)}function xM(e){const t=[],n=e.children??[];let r=1;for(let u=1;u<n.length;u++)fs(n[u])===fs(n[u-1])?(r++,r===3&&t.push(`3+ consecutive sections share the same layout ("${n[u].label}") — break the pattern with a different family`)):r=1;const o=new Map;n.forEach(u=>o.set(fs(u),(o.get(fs(u))??0)+1));for(const[u,c]of o)c>2&&u!=="hero"&&t.push(`layout family "${u}" used ${c}× — a page needs distinct section compositions`);const i=u=>{const c=u.children??[];c.length>=3&&(u.direction==="row"||u.type==="card-grid")&&c.every(d=>d.type===c[0].type&&(d.sizeHint??"md")===(c[0].sizeHint??"md"))&&t.push(`"${u.label}": ${c.length} identical cells in a row — vary sizes or restructure as an asymmetric bento`),u.type==="list"&&c.length>5&&t.push(`"${u.label}": ${c.length}-item list — group into chunks, cards, or tabs instead of one long list`),c.forEach(i)};i(e);const s=[],l=u=>{var c;u.type==="hero"&&s.push(u),(c=u.children)==null||c.forEach(l)};l(e);for(const u of s){const c=sc(u,d=>d.type==="text"||d.type==="button");c>4&&t.push(`hero "${u.label}" stacks ${c} text/button elements — max 4 (headline, subtext, CTAs, one eyebrow)`)}const a=sc(e,u=>u.type==="button");return a>5&&t.push(`${a} buttons on one page — consolidate duplicate CTA intents (one label per intent)`),t}const SM=["","minimal","editorial","premium","playful","brutalist","dark-tech","trust"],EM=[{key:"variance",label:"Variance",hint:"symmetric ↔ experimental",def:7},{key:"motion",label:"Motion",hint:"static ↔ cinematic",def:5},{key:"density",label:"Density",hint:"airy ↔ packed",def:4}];function kM(){const{project:e,setProject:t}=Dt(),n=e.brief??{},r=o=>{const i=structuredClone(e);i.brief=i.brief??{},o(i.brief),t(i,{history:!1})};return S.jsxs(S.Fragment,{children:[S.jsx("h3",{children:"Design brief"}),S.jsx("p",{className:"hint",children:"Sets the direction for every AI design pass. Leave blank to let the agent read the room."}),S.jsx("select",{value:n.aesthetic??"",onChange:o=>r(i=>i.aesthetic=o.target.value||void 0),children:SM.map(o=>S.jsx("option",{value:o,children:o||"aesthetic: auto"},o))}),S.jsx("label",{children:"Transformation depth"}),S.jsxs("select",{value:n.transformationDepth??"restyle",onChange:o=>r(i=>i.transformationDepth=o.target.value),children:[S.jsx("option",{value:"restyle",children:"Restyle — retain structure"}),S.jsx("option",{value:"relayout",children:"Relayout — recompose hierarchy"}),S.jsx("option",{value:"restructure",children:"Restructure — rebuild architecture"}),S.jsx("option",{value:"reimagine",children:"Reimagine — new experience model"})]}),S.jsx("input",{type:"text",placeholder:'vibe, e.g. "calm, Linear-style"',value:n.vibe??"",onChange:o=>r(i=>i.vibe=o.target.value||void 0)}),S.jsx("input",{type:"text",placeholder:'audience, e.g. "technical buyers"',value:n.audience??"",onChange:o=>r(i=>i.audience=o.target.value||void 0)}),EM.map(o=>S.jsxs("label",{className:"dial",title:o.hint,children:[S.jsxs("span",{children:[o.label," ",S.jsx("em",{children:n[o.key]??o.def})]}),S.jsx("input",{type:"range",min:1,max:10,value:n[o.key]??o.def,onChange:i=>r(s=>s[o.key]=Number(i.target.value))})]},o.key)),S.jsx("textarea",{rows:2,placeholder:"notes for the designer agent (brand rules, must-keeps…)",value:n.notes??"",onChange:o=>r(i=>i.notes=o.target.value||void 0)})]})}async function Ya(e){const t=await e.arrayBuffer();let n="";const r=new Uint8Array(t);for(let o=0;o<r.length;o+=32768)n+=String.fromCharCode(...r.subarray(o,o+32768));return btoa(n)}function Qa({current:e,onFile:t,hint:n}){const r=k.useRef(null);return S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"drop-ref",onClick:()=>{var o;return(o=r.current)==null?void 0:o.click()},children:e?S.jsx("img",{src:`/${e}`,alt:"ref"}):n}),S.jsx("input",{ref:r,type:"file",accept:"image/*",style:{display:"none"},onChange:o=>{var i;return((i=o.target.files)==null?void 0:i[0])&&t(o.target.files[0])}})]})}function CM(){const{project:e,selection:t,api:n,mutatePage:r,setProject:o,select:i,openPage:s,busy:l}=Dt(),[a,u]=k.useState(""),[c,d]=k.useState("text"),[f,g]=k.useState();if(t.kind==="none")return S.jsxs("aside",{className:"inspector",children:[S.jsx("h3",{children:"How it works"}),S.jsxs("ol",{className:"steps",children:[S.jsxs("li",{children:[S.jsx("b",{children:"Propose"})," — describe pages in the top bar; AI drops wireframe cards on the canvas."]}),S.jsxs("li",{children:[S.jsx("b",{children:"Arrange"})," — open a page, drag blocks anywhere, or select one and tell AI what to change. Behavior notes become ⚡ intents."]}),S.jsxs("li",{children:[S.jsx("b",{children:"Design"})," — attach reference images (whole page, or per block) and generate. Then click elements in Preview to refine."]})]}),S.jsxs("p",{className:"hint",children:["Shortcuts: ",S.jsx("kbd",{children:"Ctrl+Z"})," undo · ",S.jsx("kbd",{children:"Ctrl+Shift+Z"})," redo · ",S.jsx("kbd",{children:"Del"})," delete selected block ·"," ",S.jsx("kbd",{children:"Esc"})," back"]}),S.jsx(kM,{})]});const y=e.pages.find(v=>v.id===t.pageId);if(!y)return S.jsx("aside",{className:"inspector"});if(t.kind==="page"){const v=xM(y.layout);return S.jsxs("aside",{className:"inspector",children:[S.jsx("h3",{children:"Page"}),S.jsx("input",{type:"text",value:y.name,onChange:x=>r(y.id,p=>p.name=x.target.value,{history:!1})}),S.jsxs("div",{className:"btn-row",children:[S.jsx("button",{className:"ghost",onClick:()=>s(y.id),children:"Open editor"}),S.jsx("button",{className:"ghost",title:"Copy this page",disabled:!!l,onClick:()=>n(`/api/pages/${y.id}/duplicate`),children:"Duplicate"})]}),S.jsx("button",{className:"ghost",title:"AI proposes 2 alternative arrangements of this page",disabled:!!l,onClick:()=>n(`/api/pages/${y.id}/variants`),children:"✨ Propose 2 layout variants"}),v.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("h3",{children:"Design hints"}),v.map((x,p)=>S.jsxs("p",{className:"lint",children:["⚠ ",x]},p))]}),S.jsx("h3",{children:"Reference image (whole page)"}),S.jsx(Qa,{current:y.refImage,hint:"Click to attach — the design will match this image's style",onFile:async x=>n(`/api/pages/${y.id}/ref`,{name:x.name,dataBase64:await Ya(x)})}),S.jsx("h3",{children:"Design prompt"}),S.jsx("textarea",{rows:3,placeholder:"e.g. clean SaaS look, dark hero, rounded cards",value:y.designPrompt??"",onChange:x=>r(y.id,p=>p.designPrompt=x.target.value,{history:!1})}),S.jsx("button",{disabled:!!l,onClick:()=>n(`/api/pages/${y.id}/design`,{designPrompt:y.designPrompt}),children:y.status==="designed"?"Regenerate design":"🎨 Generate design"}),y.status==="designed"&&S.jsx("p",{className:"hint",children:"Regenerating keeps the styling of unchanged blocks, including your element-level edits."}),S.jsx("button",{className:"danger",onClick:()=>{if(!confirm(`Delete page "${y.name}"?`))return;const x=structuredClone(e);x.pages=x.pages.filter(p=>p.id!==y.id),o(x),i({kind:"none"})},children:"Delete page"})]})}if(t.kind==="block"){const v=Hr(y.layout,t.blockId);if(!v)return S.jsx("aside",{className:"inspector"});const x=v.id===y.layout.id,p=(m,h=!0)=>r(y.id,w=>{const C=Hr(w.layout,v.id);C&&m(C)},{history:h});return S.jsxs("aside",{className:"inspector",children:[S.jsxs("h3",{children:["Block — ",v.type]}),S.jsx("input",{type:"text",value:v.label,onChange:m=>p(h=>h.label=m.target.value,!1)}),v.summary&&S.jsxs("p",{className:"hint",children:["ℹ ",v.summary]}),S.jsxs("div",{className:"btn-row",children:[S.jsxs("button",{className:"ghost",title:"Cycle relative size (sm → md → lg)",onClick:()=>p(m=>{m.sizeHint=m.sizeHint==="sm"?"md":m.sizeHint==="md"?"lg":"sm"}),children:["Size: ",v.sizeHint??"md"]}),S.jsx("button",{className:"ghost",title:"Toggle whether children stack vertically or sit side-by-side",onClick:()=>p(m=>m.direction=m.direction==="row"?"column":"row"),children:v.direction==="row"?"→ row":"↓ column"})]}),S.jsxs("div",{className:"btn-row",children:[S.jsx("select",{value:c,onChange:m=>d(m.target.value),children:Jx.map(m=>S.jsx("option",{value:m,children:m},m))}),S.jsx("button",{className:"ghost",title:"Add a child block of the selected type inside this block",onClick:()=>r(y.id,m=>m.layout=Im(m.layout,v.id,qx(c))),children:"+ Add child"})]}),!x&&S.jsxs("div",{className:"btn-row",children:[S.jsx("button",{className:"ghost",onClick:()=>r(y.id,m=>{const h=tl(m.layout,v.id),w=Hr(m.layout,v.id);h&&w&&h.parent.children.splice(h.index+1,0,Dm(w))}),children:"Duplicate"}),S.jsx("button",{className:"danger",onClick:()=>{r(y.id,m=>m.layout=jl(m.layout,v.id)),i({kind:"page",pageId:y.id})},children:"Delete"})]}),S.jsx("h3",{children:"Style reference (this block)"}),S.jsx(Qa,{current:v.refImage,hint:"Optional: attach an image just for this block's style",onFile:async m=>n(`/api/pages/${y.id}/blocks/${v.id}/ref`,{name:m.name,dataBase64:await Ya(m)})}),S.jsx("h3",{children:"Edit with AI"}),S.jsx("p",{className:"hint",children:"Describe a structure or functionality change. Behavior notes land in ⚡ intents and get implemented in the design pass."}),S.jsx("textarea",{rows:3,placeholder:'e.g. "make this a 3-card testimonial carousel" or "this button opens a signup modal"',value:a,onChange:m=>u(m.target.value)}),S.jsx("button",{disabled:!!l||!a.trim(),onClick:async()=>{await n(`/api/pages/${y.id}/blocks/${v.id}/edit`,{instruction:a}),u("")},children:"Apply with AI"}),v.intents&&v.intents.length>0&&S.jsxs(S.Fragment,{children:[S.jsx("h3",{children:"Intents"}),v.intents.map((m,h)=>S.jsxs("div",{className:"intent",children:["⚡ ",m,S.jsx("span",{className:"intent-x",title:"Remove intent",onClick:()=>p(w=>w.intents.splice(h,1)),children:"×"})]},h))]})]})}return S.jsxs("aside",{className:"inspector",children:[S.jsx("h3",{children:"Element"}),S.jsxs("p",{className:"hint",children:["Selected ",S.jsx("code",{children:t.elementId})," in the designed page. Describe the change, optionally with a style reference image."]}),S.jsx(Qa,{current:f,hint:"Optional: style reference for this change",onFile:async v=>{const p=await(await fetch(`/api/pages/${y.id}/blocks/${t.elementId}/ref`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:v.name,dataBase64:await Ya(v)})})).json();p.refPath&&g(p.refPath)}}),S.jsx("textarea",{rows:3,placeholder:'e.g. "make the headline bigger and gold" or "match the reference image"',value:a,onChange:v=>u(v.target.value)}),S.jsx("button",{disabled:!!l||!a.trim(),onClick:async()=>{await n(`/api/pages/${y.id}/element/${t.elementId}/edit`,{instruction:a,refPath:f}),u(""),g(void 0)},children:"Apply with AI"})]})}const _M=["Landing page for a specialty coffee brand","SaaS dashboard with sidebar, stats, and activity feed","Portfolio site for a photographer","E-commerce product page with reviews"];function NM({onPick:e}){return S.jsx("div",{className:"empty-state",children:S.jsxs("div",{className:"empty-card",children:[S.jsx("div",{className:"empty-logo",children:"◆"}),S.jsx("h1",{children:"Start with a prompt"}),S.jsxs("p",{children:["Describe what you want to build. AI proposes ",S.jsx("b",{children:"3 wireframe layouts"})," — you arrange the structure, then AI designs each page from your reference image."]}),S.jsx("div",{className:"empty-examples",children:_M.map(t=>S.jsx("button",{className:"ghost",onClick:()=>e(t),children:t},t))})]})})}function bM(){const{project:e,load:t,api:n,busy:r,error:o,openPageId:i,select:s,selection:l,viewMode:a,openPage:u,mutatePage:c}=Dt(),[d,f]=k.useState("");k.useEffect(()=>{t()},[t]),k.useEffect(()=>{const v=x=>{const p=x.target,m=p.tagName==="INPUT"||p.tagName==="TEXTAREA"||p.tagName==="SELECT";if((x.ctrlKey||x.metaKey)&&x.key.toLowerCase()==="z"&&!m){x.preventDefault(),x.shiftKey?Dt.getState().redo():Dt.getState().undo();return}if(m)return;const h=Dt.getState();if(x.key==="Delete"||x.key==="Backspace"){if(h.selection.kind==="block"){const w=h.project.pages.find(C=>C.id===h.selection.pageId);if(w&&h.selection.blockId!==w.layout.id){const C=h.selection.blockId;c(w.id,_=>_.layout=jl(_.layout,C)),s({kind:"page",pageId:w.id})}}}else x.key==="Escape"&&(h.selection.kind==="block"||h.selection.kind==="element"?s({kind:"page",pageId:h.selection.pageId}):h.openPageId?u(null):s({kind:"none"}))};return window.addEventListener("keydown",v),()=>window.removeEventListener("keydown",v)},[c,u,s]),k.useEffect(()=>{const v=x=>{var p,m;((p=x.data)==null?void 0:p.type)==="dreative-select"&&i&&a==="preview"&&s({kind:"element",pageId:i,elementId:x.data.id}),((m=x.data)==null?void 0:m.type)==="dreative-select-block"&&i&&a==="replica"&&s({kind:"block",pageId:i,blockId:x.data.id})};return window.addEventListener("message",v),()=>window.removeEventListener("message",v)},[i,a,s]);const g=e.pages.find(v=>v.id===i),y=async()=>{d.trim()&&(await n("/api/skeletons",{prompt:d}),f(""))};return S.jsxs("div",{className:"app",children:[S.jsxs("div",{className:"topbar",children:[S.jsx("span",{className:"logo",children:"◆ Dreative"}),S.jsx("input",{placeholder:"Describe pages to generate, e.g. “landing page for a specialty coffee brand”",value:d,onChange:v=>f(v.target.value),onKeyDown:v=>v.key==="Enter"&&y()}),S.jsx("button",{disabled:!!r||!d.trim(),onClick:y,title:"AI proposes 3 wireframe layouts",children:"✨ Propose layouts"}),S.jsx("button",{title:"AI designs every page to the project's design brief (doctrine-checked)",disabled:!!r||e.pages.length===0,onClick:()=>n("/api/design-all",{}),children:"🎨 Design all"}),S.jsx("button",{className:"ghost",title:"Copy designed pages as .tsx into ./src/pages",disabled:!e.pages.some(v=>v.status==="designed"),onClick:async()=>{const x=await(await fetch("/api/export",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})})).json();alert(`Exported:
67
67
  ${(x.exported??[]).join(`
68
68
  `)||"nothing"}`)},children:"Export"}),S.jsx("button",{title:"Hand the final layout (as a diff vs the extracted baseline) to your coding CLI to apply",disabled:!!r||e.pages.length===0,onClick:async()=>{var m,h,w;const v=await fetch("/api/finish",{method:"POST"}),x=await v.json();if(!v.ok){alert(`Finish failed: ${x.error||v.statusText}`);return}const p=x.diff??{};alert(`Handed to your coding CLI.
69
69
  Added pages: ${((m=p.pagesAdded)==null?void 0:m.length)??0} · Removed: ${((h=p.pagesRemoved)==null?void 0:h.length)??0} · Changed: ${((w=p.pagesChanged)==null?void 0:w.length)??0}