ima2-gen 1.0.4 → 1.0.5

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.
@@ -0,0 +1,16 @@
1
+ (function(){const l=document.createElement("link").relList;if(l&&l.supports&&l.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))u(r);new MutationObserver(r=>{for(const f of r)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&u(d)}).observe(document,{childList:!0,subtree:!0});function o(r){const f={};return r.integrity&&(f.integrity=r.integrity),r.referrerPolicy&&(f.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?f.credentials="include":r.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(r){if(r.ep)return;r.ep=!0;const f=o(r);fetch(r.href,f)}})();function op(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Fc={exports:{}},Wi={};var Hm;function nx(){if(Hm)return Wi;Hm=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function o(u,r,f){var d=null;if(f!==void 0&&(d=""+f),r.key!==void 0&&(d=""+r.key),"key"in r){f={};for(var h in r)h!=="key"&&(f[h]=r[h])}else f=r;return r=f.ref,{$$typeof:n,type:u,key:d,ref:r!==void 0?r:null,props:f}}return Wi.Fragment=l,Wi.jsx=o,Wi.jsxs=o,Wi}var jm;function ax(){return jm||(jm=1,Fc.exports=nx()),Fc.exports}var E=ax(),Wc={exports:{}},Se={};var Um;function lx(){if(Um)return Se;Um=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),d=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.iterator;function S(A){return A===null||typeof A!="object"?null:(A=x&&A[x]||A["@@iterator"],typeof A=="function"?A:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,z={};function N(A,j,P){this.props=A,this.context=j,this.refs=z,this.updater=P||_}N.prototype.isReactComponent={},N.prototype.setState=function(A,j){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,j,"setState")},N.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function U(){}U.prototype=N.prototype;function w(A,j,P){this.props=A,this.context=j,this.refs=z,this.updater=P||_}var C=w.prototype=new U;C.constructor=w,T(C,N.prototype),C.isPureReactComponent=!0;var V=Array.isArray;function L(){}var Y={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function X(A,j,P){var te=P.ref;return{$$typeof:n,type:A,key:j,ref:te!==void 0?te:null,props:P}}function ie(A,j){return X(A.type,j,A.props)}function Z(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function W(A){var j={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(P){return j[P]})}var oe=/\/+/g;function D(A,j){return typeof A=="object"&&A!==null&&A.key!=null?W(""+A.key):j.toString(36)}function Q(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(L,L):(A.status="pending",A.then(function(j){A.status==="pending"&&(A.status="fulfilled",A.value=j)},function(j){A.status==="pending"&&(A.status="rejected",A.reason=j)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function M(A,j,P,te,se){var ce=typeof A;(ce==="undefined"||ce==="boolean")&&(A=null);var re=!1;if(A===null)re=!0;else switch(ce){case"bigint":case"string":case"number":re=!0;break;case"object":switch(A.$$typeof){case n:case l:re=!0;break;case v:return re=A._init,M(re(A._payload),j,P,te,se)}}if(re)return se=se(A),re=te===""?"."+D(A,0):te,V(se)?(P="",re!=null&&(P=re.replace(oe,"$&/")+"/"),M(se,j,P,"",function(Ee){return Ee})):se!=null&&(Z(se)&&(se=ie(se,P+(se.key==null||A&&A.key===se.key?"":(""+se.key).replace(oe,"$&/")+"/")+re)),j.push(se)),1;re=0;var ue=te===""?".":te+":";if(V(A))for(var fe=0;fe<A.length;fe++)te=A[fe],ce=ue+D(te,fe),re+=M(te,j,P,ce,se);else if(fe=S(A),typeof fe=="function")for(A=fe.call(A),fe=0;!(te=A.next()).done;)te=te.value,ce=ue+D(te,fe++),re+=M(te,j,P,ce,se);else if(ce==="object"){if(typeof A.then=="function")return M(Q(A),j,P,te,se);throw j=String(A),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return re}function H(A,j,P){if(A==null)return A;var te=[],se=0;return M(A,te,"","",function(ce){return j.call(P,ce,se++)}),te}function q(A){if(A._status===-1){var j=A._result;j=j(),j.then(function(P){(A._status===0||A._status===-1)&&(A._status=1,A._result=P)},function(P){(A._status===0||A._status===-1)&&(A._status=2,A._result=P)}),A._status===-1&&(A._status=0,A._result=j)}if(A._status===1)return A._result.default;throw A._result}var $=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},ee={map:H,forEach:function(A,j,P){H(A,function(){j.apply(this,arguments)},P)},count:function(A){var j=0;return H(A,function(){j++}),j},toArray:function(A){return H(A,function(j){return j})||[]},only:function(A){if(!Z(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return Se.Activity=y,Se.Children=ee,Se.Component=N,Se.Fragment=o,Se.Profiler=r,Se.PureComponent=w,Se.StrictMode=u,Se.Suspense=m,Se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Y,Se.__COMPILER_RUNTIME={__proto__:null,c:function(A){return Y.H.useMemoCache(A)}},Se.cache=function(A){return function(){return A.apply(null,arguments)}},Se.cacheSignal=function(){return null},Se.cloneElement=function(A,j,P){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var te=T({},A.props),se=A.key;if(j!=null)for(ce in j.key!==void 0&&(se=""+j.key),j)!R.call(j,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&j.ref===void 0||(te[ce]=j[ce]);var ce=arguments.length-2;if(ce===1)te.children=P;else if(1<ce){for(var re=Array(ce),ue=0;ue<ce;ue++)re[ue]=arguments[ue+2];te.children=re}return X(A.type,se,te)},Se.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:f,_context:A},A},Se.createElement=function(A,j,P){var te,se={},ce=null;if(j!=null)for(te in j.key!==void 0&&(ce=""+j.key),j)R.call(j,te)&&te!=="key"&&te!=="__self"&&te!=="__source"&&(se[te]=j[te]);var re=arguments.length-2;if(re===1)se.children=P;else if(1<re){for(var ue=Array(re),fe=0;fe<re;fe++)ue[fe]=arguments[fe+2];se.children=ue}if(A&&A.defaultProps)for(te in re=A.defaultProps,re)se[te]===void 0&&(se[te]=re[te]);return X(A,ce,se)},Se.createRef=function(){return{current:null}},Se.forwardRef=function(A){return{$$typeof:h,render:A}},Se.isValidElement=Z,Se.lazy=function(A){return{$$typeof:v,_payload:{_status:-1,_result:A},_init:q}},Se.memo=function(A,j){return{$$typeof:g,type:A,compare:j===void 0?null:j}},Se.startTransition=function(A){var j=Y.T,P={};Y.T=P;try{var te=A(),se=Y.S;se!==null&&se(P,te),typeof te=="object"&&te!==null&&typeof te.then=="function"&&te.then(L,$)}catch(ce){$(ce)}finally{j!==null&&P.types!==null&&(j.types=P.types),Y.T=j}},Se.unstable_useCacheRefresh=function(){return Y.H.useCacheRefresh()},Se.use=function(A){return Y.H.use(A)},Se.useActionState=function(A,j,P){return Y.H.useActionState(A,j,P)},Se.useCallback=function(A,j){return Y.H.useCallback(A,j)},Se.useContext=function(A){return Y.H.useContext(A)},Se.useDebugValue=function(){},Se.useDeferredValue=function(A,j){return Y.H.useDeferredValue(A,j)},Se.useEffect=function(A,j){return Y.H.useEffect(A,j)},Se.useEffectEvent=function(A){return Y.H.useEffectEvent(A)},Se.useId=function(){return Y.H.useId()},Se.useImperativeHandle=function(A,j,P){return Y.H.useImperativeHandle(A,j,P)},Se.useInsertionEffect=function(A,j){return Y.H.useInsertionEffect(A,j)},Se.useLayoutEffect=function(A,j){return Y.H.useLayoutEffect(A,j)},Se.useMemo=function(A,j){return Y.H.useMemo(A,j)},Se.useOptimistic=function(A,j){return Y.H.useOptimistic(A,j)},Se.useReducer=function(A,j,P){return Y.H.useReducer(A,j,P)},Se.useRef=function(A){return Y.H.useRef(A)},Se.useState=function(A){return Y.H.useState(A)},Se.useSyncExternalStore=function(A,j,P){return Y.H.useSyncExternalStore(A,j,P)},Se.useTransition=function(){return Y.H.useTransition()},Se.version="19.2.5",Se}var Bm;function So(){return Bm||(Bm=1,Wc.exports=lx()),Wc.exports}var J=So();const ao=op(J);var Pc={exports:{}},Pi={},ef={exports:{}},tf={};var qm;function ix(){return qm||(qm=1,(function(n){function l(M,H){var q=M.length;M.push(H);e:for(;0<q;){var $=q-1>>>1,ee=M[$];if(0<r(ee,H))M[$]=H,M[q]=ee,q=$;else break e}}function o(M){return M.length===0?null:M[0]}function u(M){if(M.length===0)return null;var H=M[0],q=M.pop();if(q!==H){M[0]=q;e:for(var $=0,ee=M.length,A=ee>>>1;$<A;){var j=2*($+1)-1,P=M[j],te=j+1,se=M[te];if(0>r(P,q))te<ee&&0>r(se,P)?(M[$]=se,M[te]=q,$=te):(M[$]=P,M[j]=q,$=j);else if(te<ee&&0>r(se,q))M[$]=se,M[te]=q,$=te;else break e}}return H}function r(M,H){var q=M.sortIndex-H.sortIndex;return q!==0?q:M.id-H.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var d=Date,h=d.now();n.unstable_now=function(){return d.now()-h}}var m=[],g=[],v=1,y=null,x=3,S=!1,_=!1,T=!1,z=!1,N=typeof setTimeout=="function"?setTimeout:null,U=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function C(M){for(var H=o(g);H!==null;){if(H.callback===null)u(g);else if(H.startTime<=M)u(g),H.sortIndex=H.expirationTime,l(m,H);else break;H=o(g)}}function V(M){if(T=!1,C(M),!_)if(o(m)!==null)_=!0,L||(L=!0,W());else{var H=o(g);H!==null&&Q(V,H.startTime-M)}}var L=!1,Y=-1,R=5,X=-1;function ie(){return z?!0:!(n.unstable_now()-X<R)}function Z(){if(z=!1,L){var M=n.unstable_now();X=M;var H=!0;try{e:{_=!1,T&&(T=!1,U(Y),Y=-1),S=!0;var q=x;try{t:{for(C(M),y=o(m);y!==null&&!(y.expirationTime>M&&ie());){var $=y.callback;if(typeof $=="function"){y.callback=null,x=y.priorityLevel;var ee=$(y.expirationTime<=M);if(M=n.unstable_now(),typeof ee=="function"){y.callback=ee,C(M),H=!0;break t}y===o(m)&&u(m),C(M)}else u(m);y=o(m)}if(y!==null)H=!0;else{var A=o(g);A!==null&&Q(V,A.startTime-M),H=!1}}break e}finally{y=null,x=q,S=!1}H=void 0}}finally{H?W():L=!1}}}var W;if(typeof w=="function")W=function(){w(Z)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,D=oe.port2;oe.port1.onmessage=Z,W=function(){D.postMessage(null)}}else W=function(){N(Z,0)};function Q(M,H){Y=N(function(){M(n.unstable_now())},H)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(M){M.callback=null},n.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<M?Math.floor(1e3/M):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(M){switch(x){case 1:case 2:case 3:var H=3;break;default:H=x}var q=x;x=H;try{return M()}finally{x=q}},n.unstable_requestPaint=function(){z=!0},n.unstable_runWithPriority=function(M,H){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var q=x;x=M;try{return H()}finally{x=q}},n.unstable_scheduleCallback=function(M,H,q){var $=n.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?$+q:$):q=$,M){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=q+ee,M={id:v++,callback:H,priorityLevel:M,startTime:q,expirationTime:ee,sortIndex:-1},q>$?(M.sortIndex=q,l(g,M),o(m)===null&&M===o(g)&&(T?(U(Y),Y=-1):T=!0,Q(V,q-$))):(M.sortIndex=ee,l(m,M),_||S||(_=!0,L||(L=!0,W()))),M},n.unstable_shouldYield=ie,n.unstable_wrapCallback=function(M){var H=x;return function(){var q=x;x=H;try{return M.apply(this,arguments)}finally{x=q}}}})(tf)),tf}var Lm;function ox(){return Lm||(Lm=1,ef.exports=ix()),ef.exports}var nf={exports:{}},gt={};var Ym;function ux(){if(Ym)return gt;Ym=1;var n=So();function l(m){var g="https://react.dev/errors/"+m;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)g+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var u={d:{f:o,r:function(){throw Error(l(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},r=Symbol.for("react.portal");function f(m,g,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:y==null?null:""+y,children:m,containerInfo:g,implementation:v}}var d=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(m,g){if(m==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return gt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,gt.createPortal=function(m,g){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(l(299));return f(m,g,null,v)},gt.flushSync=function(m){var g=d.T,v=u.p;try{if(d.T=null,u.p=2,m)return m()}finally{d.T=g,u.p=v,u.d.f()}},gt.preconnect=function(m,g){typeof m=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,u.d.C(m,g))},gt.prefetchDNS=function(m){typeof m=="string"&&u.d.D(m)},gt.preinit=function(m,g){if(typeof m=="string"&&g&&typeof g.as=="string"){var v=g.as,y=h(v,g.crossOrigin),x=typeof g.integrity=="string"?g.integrity:void 0,S=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;v==="style"?u.d.S(m,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:y,integrity:x,fetchPriority:S}):v==="script"&&u.d.X(m,{crossOrigin:y,integrity:x,fetchPriority:S,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},gt.preinitModule=function(m,g){if(typeof m=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var v=h(g.as,g.crossOrigin);u.d.M(m,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&u.d.M(m)},gt.preload=function(m,g){if(typeof m=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var v=g.as,y=h(v,g.crossOrigin);u.d.L(m,v,{crossOrigin:y,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},gt.preloadModule=function(m,g){if(typeof m=="string")if(g){var v=h(g.as,g.crossOrigin);u.d.m(m,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else u.d.m(m)},gt.requestFormReset=function(m){u.d.r(m)},gt.unstable_batchedUpdates=function(m,g){return m(g)},gt.useFormState=function(m,g,v){return d.H.useFormState(m,g,v)},gt.useFormStatus=function(){return d.H.useHostTransitionStatus()},gt.version="19.2.5",gt}var Vm;function up(){if(Vm)return nf.exports;Vm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),nf.exports=ux(),nf.exports}var Gm;function sx(){if(Gm)return Pi;Gm=1;var n=ox(),l=So(),o=up();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}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."}function r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function d(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 h(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(f(e)!==e)throw Error(u(188))}function g(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(u(188));return t!==e?null:e}for(var a=e,i=t;;){var s=a.return;if(s===null)break;var c=s.alternate;if(c===null){if(i=s.return,i!==null){a=i;continue}break}if(s.child===c.child){for(c=s.child;c;){if(c===a)return m(s),e;if(c===i)return m(s),t;c=c.sibling}throw Error(u(188))}if(a.return!==i.return)a=s,i=c;else{for(var p=!1,b=s.child;b;){if(b===a){p=!0,a=s,i=c;break}if(b===i){p=!0,i=s,a=c;break}b=b.sibling}if(!p){for(b=c.child;b;){if(b===a){p=!0,a=c,i=s;break}if(b===i){p=!0,i=c,a=s;break}b=b.sibling}if(!p)throw Error(u(189))}}if(a.alternate!==i)throw Error(u(190))}if(a.tag!==3)throw Error(u(188));return a.stateNode.current===a?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),U=Symbol.for("react.consumer"),w=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),X=Symbol.for("react.activity"),ie=Symbol.for("react.memo_cache_sentinel"),Z=Symbol.iterator;function W(e){return e===null||typeof e!="object"?null:(e=Z&&e[Z]||e["@@iterator"],typeof e=="function"?e:null)}var oe=Symbol.for("react.client.reference");function D(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case T:return"Fragment";case N:return"Profiler";case z:return"StrictMode";case V:return"Suspense";case L:return"SuspenseList";case X:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case _:return"Portal";case w:return e.displayName||"Context";case U:return(e._context.displayName||"Context")+".Consumer";case C:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Y:return t=e.displayName||null,t!==null?t:D(e.type)||"Memo";case R:t=e._payload,e=e._init;try{return D(e(t))}catch{}}return null}var Q=Array.isArray,M=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},$=[],ee=-1;function A(e){return{current:e}}function j(e){0>ee||(e.current=$[ee],$[ee]=null,ee--)}function P(e,t){ee++,$[ee]=e.current,e.current=t}var te=A(null),se=A(null),ce=A(null),re=A(null);function ue(e,t){switch(P(ce,t),P(se,e),P(te,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?am(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=am(t),e=lm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}j(te),P(te,e)}function fe(){j(te),j(se),j(ce)}function Ee(e){e.memoizedState!==null&&P(re,e);var t=te.current,a=lm(t,e.type);t!==a&&(P(se,e),P(te,a))}function be(e){se.current===e&&(j(te),j(se)),re.current===e&&(j(re),Ii._currentValue=q)}var ye,xe;function Ae(e){if(ye===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||"",xe=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+ye+e+xe}var qe=!1;function je(e,t){if(!e||qe)return"";qe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(F){var K=F}Reflect.construct(e,[],le)}else{try{le.call()}catch(F){K=F}e.call(le.prototype)}}else{try{throw Error()}catch(F){K=F}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(F){if(F&&K&&typeof F.stack=="string")return[F.stack,K.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=i.DetermineComponentFrameRoot(),p=c[0],b=c[1];if(p&&b){var O=p.split(`
4
+ `),I=b.split(`
5
+ `);for(s=i=0;i<O.length&&!O[i].includes("DetermineComponentFrameRoot");)i++;for(;s<I.length&&!I[s].includes("DetermineComponentFrameRoot");)s++;if(i===O.length||s===I.length)for(i=O.length-1,s=I.length-1;1<=i&&0<=s&&O[i]!==I[s];)s--;for(;1<=i&&0<=s;i--,s--)if(O[i]!==I[s]){if(i!==1||s!==1)do if(i--,s--,0>s||O[i]!==I[s]){var ne=`
6
+ `+O[i].replace(" at new "," at ");return e.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",e.displayName)),ne}while(1<=i&&0<=s);break}}}finally{qe=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Ae(a):""}function ot(e,t){switch(e.tag){case 26:case 27:case 5:return Ae(e.type);case 16:return Ae("Lazy");case 13:return e.child!==t&&t!==null?Ae("Suspense Fallback"):Ae("Suspense");case 19:return Ae("SuspenseList");case 0:case 15:return je(e.type,!1);case 11:return je(e.type.render,!1);case 1:return je(e.type,!0);case 31:return Ae("Activity");default:return""}}function $t(e){try{var t="",a=null;do t+=ot(e,a),a=e,e=e.return;while(e);return t}catch(i){return`
7
+ Error generating stack: `+i.message+`
8
+ `+i.stack}}var Tt=Object.prototype.hasOwnProperty,kt=n.unstable_scheduleCallback,mn=n.unstable_cancelCallback,_a=n.unstable_shouldYield,Ea=n.unstable_requestPaint,st=n.unstable_now,nl=n.unstable_getCurrentPriorityLevel,pn=n.unstable_ImmediatePriority,Xn=n.unstable_UserBlockingPriority,wa=n.unstable_NormalPriority,Hs=n.unstable_LowPriority,al=n.unstable_IdlePriority,js=n.log,Us=n.unstable_setDisableYieldValue,Na=null,mt=null;function an(e){if(typeof js=="function"&&Us(e),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(Na,e)}catch{}}var pt=Math.clz32?Math.clz32:Ls,Bs=Math.log,qs=Math.LN2;function Ls(e){return e>>>=0,e===0?32:31-(Bs(e)/qs|0)|0}var ll=256,il=262144,ol=4194304;function yn(e){var t=e&42;if(t!==0)return t;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ul(e,t,a){var i=e.pendingLanes;if(i===0)return 0;var s=0,c=e.suspendedLanes,p=e.pingedLanes;e=e.warmLanes;var b=i&134217727;return b!==0?(i=b&~c,i!==0?s=yn(i):(p&=b,p!==0?s=yn(p):a||(a=b&~e,a!==0&&(s=yn(a))))):(b=i&~c,b!==0?s=yn(b):p!==0?s=yn(p):a||(a=i&~e,a!==0&&(s=yn(a)))),s===0?0:t!==0&&t!==s&&(t&c)===0&&(c=s&-s,a=t&-t,c>=a||c===32&&(a&4194048)!==0)?t:s}function Ma(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ys(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32: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:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Ao(){var e=ol;return ol<<=1,(ol&62914560)===0&&(ol=4194304),e}function ii(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Aa(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Vs(e,t,a,i,s,c){var p=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var b=e.entanglements,O=e.expirationTimes,I=e.hiddenUpdates;for(a=p&~a;0<a;){var ne=31-pt(a),le=1<<ne;b[ne]=0,O[ne]=-1;var K=I[ne];if(K!==null)for(I[ne]=null,ne=0;ne<K.length;ne++){var F=K[ne];F!==null&&(F.lane&=-536870913)}a&=~le}i!==0&&To(e,i,0),c!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=c&~(p&~t))}function To(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-pt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|a&261930}function zo(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var i=31-pt(a),s=1<<i;s&t|e[i]&t&&(e[i]|=t),a&=~s}}function Co(e,t){var a=t&-t;return a=(a&42)!==0?1:oi(a),(a&(e.suspendedLanes|t))!==0?0:a}function oi(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ui(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Do(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:Am(e.type))}function Oo(e,t){var a=H.p;try{return H.p=e,t()}finally{H.p=a}}var ln=Math.random().toString(36).slice(2),lt="__reactFiber$"+ln,ht="__reactProps$"+ln,vn="__reactContainer$"+ln,sl="__reactEvents$"+ln,Ro="__reactListeners$"+ln,Gs="__reactHandles$"+ln,Ho="__reactResources$"+ln,Ta="__reactMarker$"+ln;function si(e){delete e[lt],delete e[ht],delete e[sl],delete e[Ro],delete e[Gs]}function Zn(e){var t=e[lt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[vn]||a[lt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=fm(e);e!==null;){if(a=e[lt])return a;e=fm(e)}return t}e=a,a=e.parentNode}return null}function Qn(e){if(e=e[lt]||e[vn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function $n(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function kn(e){var t=e[Ho];return t||(t=e[Ho]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function We(e){e[Ta]=!0}var jo=new Set,Uo={};function xn(e,t){In(e,t),In(e+"Capture",t)}function In(e,t){for(Uo[e]=t,e=0;e<t.length;e++)jo.add(t[e])}var Xs=RegExp("^[: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]*$"),ri={},Bo={};function Zs(e){return Tt.call(Bo,e)?!0:Tt.call(ri,e)?!1:Xs.test(e)?Bo[e]=!0:(ri[e]=!0,!1)}function rl(e,t,a){if(Zs(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function cl(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function It(e,t,a,i){if(i===null)e.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+i)}}function vt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function qo(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Qs(e,t,a){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var s=i.get,c=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(p){a=""+p,c.call(this,p)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return a},setValue:function(p){a=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function fl(e){if(!e._valueTracker){var t=qo(e)?"checked":"value";e._valueTracker=Qs(e,t,""+e[t])}}function Lo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),i="";return e&&(i=qo(e)?e.checked?"true":"false":e.value),e=i,e!==a?(t.setValue(e),!0):!1}function za(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}}var $s=/[\n"\\]/g;function xt(e){return e.replace($s,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ca(e,t,a,i,s,c,p,b){e.name="",p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.type=p:e.removeAttribute("type"),t!=null?p==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+vt(t)):e.value!==""+vt(t)&&(e.value=""+vt(t)):p!=="submit"&&p!=="reset"||e.removeAttribute("value"),t!=null?ci(e,p,vt(t)):a!=null?ci(e,p,vt(a)):i!=null&&e.removeAttribute("value"),s==null&&c!=null&&(e.defaultChecked=!!c),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+vt(b):e.removeAttribute("name")}function Yo(e,t,a,i,s,c,p,b){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||a!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){fl(e);return}a=a!=null?""+vt(a):"",t=t!=null?""+vt(t):a,b||t===e.value||(e.value=t),e.defaultValue=t}i=i??s,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=b?e.checked:!!i,e.defaultChecked=!!i,p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.name=p),fl(e)}function ci(e,t,a){t==="number"&&za(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Sn(e,t,a,i){if(e=e.options,t){t={};for(var s=0;s<a.length;s++)t["$"+a[s]]=!0;for(a=0;a<e.length;a++)s=t.hasOwnProperty("$"+e[a].value),e[a].selected!==s&&(e[a].selected=s),s&&i&&(e[a].defaultSelected=!0)}else{for(a=""+vt(a),t=null,s=0;s<e.length;s++){if(e[s].value===a){e[s].selected=!0,i&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function Wf(e,t,a){if(t!=null&&(t=""+vt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+vt(a):""}function Pf(e,t,a,i){if(t==null){if(i!=null){if(a!=null)throw Error(u(92));if(Q(i)){if(1<i.length)throw Error(u(93));i=i[0]}a=i}a==null&&(a=""),t=a}a=vt(t),e.defaultValue=a,i=e.textContent,i===a&&i!==""&&i!==null&&(e.value=i),fl(e)}function dl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Fy=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function ed(e,t,a){var i=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,a):typeof a!="number"||a===0||Fy.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function td(e,t,a){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,a!=null){for(var i in a)!a.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var s in t)i=t[s],t.hasOwnProperty(s)&&a[s]!==i&&ed(e,s,i)}else for(var c in t)t.hasOwnProperty(c)&&ed(e,c,t[c])}function ks(e){if(e.indexOf("-")===-1)return!1;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 Wy=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Py=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Vo(e){return Py.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function bn(){}var Is=null;function Ks(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var hl=null,gl=null;function nd(e){var t=Qn(e);if(t&&(e=t.stateNode)){var a=e[ht]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ca(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+xt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var i=a[t];if(i!==e&&i.form===e.form){var s=i[ht]||null;if(!s)throw Error(u(90));Ca(i,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<a.length;t++)i=a[t],i.form===e.form&&Lo(i)}break e;case"textarea":Wf(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Sn(e,!!a.multiple,t,!1)}}}var Js=!1;function ad(e,t,a){if(Js)return e(t,a);Js=!0;try{var i=e(t);return i}finally{if(Js=!1,(hl!==null||gl!==null)&&(Tu(),hl&&(t=hl,e=gl,gl=hl=null,nd(t),e)))for(t=0;t<e.length;t++)nd(e[t])}}function fi(e,t){var a=e.stateNode;if(a===null)return null;var i=a[ht]||null;if(i===null)return null;a=i[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":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(u(231,t,typeof a));return a}var _n=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fs=!1;if(_n)try{var di={};Object.defineProperty(di,"passive",{get:function(){Fs=!0}}),window.addEventListener("test",di,di),window.removeEventListener("test",di,di)}catch{Fs=!1}var Kn=null,Ws=null,Go=null;function ld(){if(Go)return Go;var e,t=Ws,a=t.length,i,s="value"in Kn?Kn.value:Kn.textContent,c=s.length;for(e=0;e<a&&t[e]===s[e];e++);var p=a-e;for(i=1;i<=p&&t[a-i]===s[c-i];i++);return Go=s.slice(e,1<i?1-i:void 0)}function Xo(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 Zo(){return!0}function id(){return!1}function St(e){function t(a,i,s,c,p){this._reactName=a,this._targetInst=s,this.type=i,this.nativeEvent=c,this.target=p,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(a=e[b],this[b]=a?a(c):c[b]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Zo:id,this.isPropagationStopped=id,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Zo)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Zo)},persist:function(){},isPersistent:Zo}),t}var Da={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qo=St(Da),hi=y({},Da,{view:0,detail:0}),ev=St(hi),Ps,er,gi,$o=y({},hi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nr,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!==gi&&(gi&&e.type==="mousemove"?(Ps=e.screenX-gi.screenX,er=e.screenY-gi.screenY):er=Ps=0,gi=e),Ps)},movementY:function(e){return"movementY"in e?e.movementY:er}}),od=St($o),tv=y({},$o,{dataTransfer:0}),nv=St(tv),av=y({},hi,{relatedTarget:0}),tr=St(av),lv=y({},Da,{animationName:0,elapsedTime:0,pseudoElement:0}),iv=St(lv),ov=y({},Da,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),uv=St(ov),sv=y({},Da,{data:0}),ud=St(sv),rv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cv={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"},fv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=fv[e])?!!t[e]:!1}function nr(){return dv}var hv=y({},hi,{key:function(e){if(e.key){var t=rv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Xo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?cv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nr,charCode:function(e){return e.type==="keypress"?Xo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Xo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),gv=St(hv),mv=y({},$o,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sd=St(mv),pv=y({},hi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nr}),yv=St(pv),vv=y({},Da,{propertyName:0,elapsedTime:0,pseudoElement:0}),xv=St(vv),Sv=y({},$o,{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}),bv=St(Sv),_v=y({},Da,{newState:0,oldState:0}),Ev=St(_v),wv=[9,13,27,32],ar=_n&&"CompositionEvent"in window,mi=null;_n&&"documentMode"in document&&(mi=document.documentMode);var Nv=_n&&"TextEvent"in window&&!mi,rd=_n&&(!ar||mi&&8<mi&&11>=mi),cd=" ",fd=!1;function dd(e,t){switch(e){case"keyup":return wv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ml=!1;function Mv(e,t){switch(e){case"compositionend":return hd(t);case"keypress":return t.which!==32?null:(fd=!0,cd);case"textInput":return e=t.data,e===cd&&fd?null:e;default:return null}}function Av(e,t){if(ml)return e==="compositionend"||!ar&&dd(e,t)?(e=ld(),Go=Ws=Kn=null,ml=!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 rd&&t.locale!=="ko"?null:t.data;default:return null}}var Tv={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 gd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Tv[e.type]:t==="textarea"}function md(e,t,a,i){hl?gl?gl.push(i):gl=[i]:hl=i,t=ju(t,"onChange"),0<t.length&&(a=new Qo("onChange","change",null,a,i),e.push({event:a,listeners:t}))}var pi=null,yi=null;function zv(e){Fg(e,0)}function ko(e){var t=$n(e);if(Lo(t))return e}function pd(e,t){if(e==="change")return t}var yd=!1;if(_n){var lr;if(_n){var ir="oninput"in document;if(!ir){var vd=document.createElement("div");vd.setAttribute("oninput","return;"),ir=typeof vd.oninput=="function"}lr=ir}else lr=!1;yd=lr&&(!document.documentMode||9<document.documentMode)}function xd(){pi&&(pi.detachEvent("onpropertychange",Sd),yi=pi=null)}function Sd(e){if(e.propertyName==="value"&&ko(yi)){var t=[];md(t,yi,e,Ks(e)),ad(zv,t)}}function Cv(e,t,a){e==="focusin"?(xd(),pi=t,yi=a,pi.attachEvent("onpropertychange",Sd)):e==="focusout"&&xd()}function Dv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ko(yi)}function Ov(e,t){if(e==="click")return ko(t)}function Rv(e,t){if(e==="input"||e==="change")return ko(t)}function Hv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var zt=typeof Object.is=="function"?Object.is:Hv;function vi(e,t){if(zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(i=0;i<a.length;i++){var s=a[i];if(!Tt.call(t,s)||!zt(e[s],t[s]))return!1}return!0}function bd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _d(e,t){var a=bd(e);e=0;for(var i;a;){if(a.nodeType===3){if(i=e+a.textContent.length,e<=t&&i>=t)return{node:a,offset:t-e};e=i}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=bd(a)}}function Ed(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ed(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function wd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=za(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=za(e.document)}return t}function or(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")}var jv=_n&&"documentMode"in document&&11>=document.documentMode,pl=null,ur=null,xi=null,sr=!1;function Nd(e,t,a){var i=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;sr||pl==null||pl!==za(i)||(i=pl,"selectionStart"in i&&or(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),xi&&vi(xi,i)||(xi=i,i=ju(ur,"onSelect"),0<i.length&&(t=new Qo("onSelect","select",null,t,a),e.push({event:t,listeners:i}),t.target=pl)))}function Oa(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var yl={animationend:Oa("Animation","AnimationEnd"),animationiteration:Oa("Animation","AnimationIteration"),animationstart:Oa("Animation","AnimationStart"),transitionrun:Oa("Transition","TransitionRun"),transitionstart:Oa("Transition","TransitionStart"),transitioncancel:Oa("Transition","TransitionCancel"),transitionend:Oa("Transition","TransitionEnd")},rr={},Md={};_n&&(Md=document.createElement("div").style,"AnimationEvent"in window||(delete yl.animationend.animation,delete yl.animationiteration.animation,delete yl.animationstart.animation),"TransitionEvent"in window||delete yl.transitionend.transition);function Ra(e){if(rr[e])return rr[e];if(!yl[e])return e;var t=yl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Md)return rr[e]=t[a];return e}var Ad=Ra("animationend"),Td=Ra("animationiteration"),zd=Ra("animationstart"),Uv=Ra("transitionrun"),Bv=Ra("transitionstart"),qv=Ra("transitioncancel"),Cd=Ra("transitionend"),Dd=new Map,cr="abort auxClick beforeToggle 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(" ");cr.push("scrollEnd");function Kt(e,t){Dd.set(e,t),xn(t,[e])}var Io=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},qt=[],vl=0,fr=0;function Ko(){for(var e=vl,t=fr=vl=0;t<e;){var a=qt[t];qt[t++]=null;var i=qt[t];qt[t++]=null;var s=qt[t];qt[t++]=null;var c=qt[t];if(qt[t++]=null,i!==null&&s!==null){var p=i.pending;p===null?s.next=s:(s.next=p.next,p.next=s),i.pending=s}c!==0&&Od(a,s,c)}}function Jo(e,t,a,i){qt[vl++]=e,qt[vl++]=t,qt[vl++]=a,qt[vl++]=i,fr|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function dr(e,t,a,i){return Jo(e,t,a,i),Fo(e)}function Ha(e,t){return Jo(e,null,null,t),Fo(e)}function Od(e,t,a){e.lanes|=a;var i=e.alternate;i!==null&&(i.lanes|=a);for(var s=!1,c=e.return;c!==null;)c.childLanes|=a,i=c.alternate,i!==null&&(i.childLanes|=a),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(s=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,s&&t!==null&&(s=31-pt(a),e=c.hiddenUpdates,i=e[s],i===null?e[s]=[t]:i.push(t),t.lane=a|536870912),c):null}function Fo(e){if(50<Vi)throw Vi=0,bc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var xl={};function Lv(e,t,a,i){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ct(e,t,a,i){return new Lv(e,t,a,i)}function hr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function En(e,t){var a=e.alternate;return a===null?(a=Ct(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Rd(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Wo(e,t,a,i,s,c){var p=0;if(i=e,typeof e=="function")hr(e)&&(p=1);else if(typeof e=="string")p=Z1(e,a,te.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case X:return e=Ct(31,a,t,s),e.elementType=X,e.lanes=c,e;case T:return ja(a.children,s,c,t);case z:p=8,s|=24;break;case N:return e=Ct(12,a,t,s|2),e.elementType=N,e.lanes=c,e;case V:return e=Ct(13,a,t,s),e.elementType=V,e.lanes=c,e;case L:return e=Ct(19,a,t,s),e.elementType=L,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case w:p=10;break e;case U:p=9;break e;case C:p=11;break e;case Y:p=14;break e;case R:p=16,i=null;break e}p=29,a=Error(u(130,e===null?"null":typeof e,"")),i=null}return t=Ct(p,a,t,s),t.elementType=e,t.type=i,t.lanes=c,t}function ja(e,t,a,i){return e=Ct(7,e,i,t),e.lanes=a,e}function gr(e,t,a){return e=Ct(6,e,null,t),e.lanes=a,e}function Hd(e){var t=Ct(18,null,null,0);return t.stateNode=e,t}function mr(e,t,a){return t=Ct(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var jd=new WeakMap;function Lt(e,t){if(typeof e=="object"&&e!==null){var a=jd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:$t(t)},jd.set(e,t),t)}return{value:e,source:t,stack:$t(t)}}var Sl=[],bl=0,Po=null,Si=0,Yt=[],Vt=0,Jn=null,on=1,un="";function wn(e,t){Sl[bl++]=Si,Sl[bl++]=Po,Po=e,Si=t}function Ud(e,t,a){Yt[Vt++]=on,Yt[Vt++]=un,Yt[Vt++]=Jn,Jn=e;var i=on;e=un;var s=32-pt(i)-1;i&=~(1<<s),a+=1;var c=32-pt(t)+s;if(30<c){var p=s-s%5;c=(i&(1<<p)-1).toString(32),i>>=p,s-=p,on=1<<32-pt(t)+s|a<<s|i,un=c+e}else on=1<<c|a<<s|i,un=e}function pr(e){e.return!==null&&(wn(e,1),Ud(e,1,0))}function yr(e){for(;e===Po;)Po=Sl[--bl],Sl[bl]=null,Si=Sl[--bl],Sl[bl]=null;for(;e===Jn;)Jn=Yt[--Vt],Yt[Vt]=null,un=Yt[--Vt],Yt[Vt]=null,on=Yt[--Vt],Yt[Vt]=null}function Bd(e,t){Yt[Vt++]=on,Yt[Vt++]=un,Yt[Vt++]=Jn,on=t.id,un=t.overflow,Jn=e}var rt=null,Xe=null,Ce=!1,Fn=null,Gt=!1,vr=Error(u(519));function Wn(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bi(Lt(t,e)),vr}function qd(e){var t=e.stateNode,a=e.type,i=e.memoizedProps;switch(t[lt]=e,t[ht]=i,a){case"dialog":Me("cancel",t),Me("close",t);break;case"iframe":case"object":case"embed":Me("load",t);break;case"video":case"audio":for(a=0;a<Xi.length;a++)Me(Xi[a],t);break;case"source":Me("error",t);break;case"img":case"image":case"link":Me("error",t),Me("load",t);break;case"details":Me("toggle",t);break;case"input":Me("invalid",t),Yo(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Me("invalid",t);break;case"textarea":Me("invalid",t),Pf(t,i.value,i.defaultValue,i.children)}a=i.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||i.suppressHydrationWarning===!0||tm(t.textContent,a)?(i.popover!=null&&(Me("beforetoggle",t),Me("toggle",t)),i.onScroll!=null&&Me("scroll",t),i.onScrollEnd!=null&&Me("scrollend",t),i.onClick!=null&&(t.onclick=bn),t=!0):t=!1,t||Wn(e,!0)}function Ld(e){for(rt=e.return;rt;)switch(rt.tag){case 5:case 31:case 13:Gt=!1;return;case 27:case 3:Gt=!0;return;default:rt=rt.return}}function _l(e){if(e!==rt)return!1;if(!Ce)return Ld(e),Ce=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Uc(e.type,e.memoizedProps)),a=!a),a&&Xe&&Wn(e),Ld(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Xe=cm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Xe=cm(e)}else t===27?(t=Xe,da(e.type)?(e=Vc,Vc=null,Xe=e):Xe=t):Xe=rt?Zt(e.stateNode.nextSibling):null;return!0}function Ua(){Xe=rt=null,Ce=!1}function xr(){var e=Fn;return e!==null&&(wt===null?wt=e:wt.push.apply(wt,e),Fn=null),e}function bi(e){Fn===null?Fn=[e]:Fn.push(e)}var Sr=A(null),Ba=null,Nn=null;function Pn(e,t,a){P(Sr,t._currentValue),t._currentValue=a}function Mn(e){e._currentValue=Sr.current,j(Sr)}function br(e,t,a){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===a)break;e=e.return}}function _r(e,t,a,i){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var c=s.dependencies;if(c!==null){var p=s.child;c=c.firstContext;e:for(;c!==null;){var b=c;c=s;for(var O=0;O<t.length;O++)if(b.context===t[O]){c.lanes|=a,b=c.alternate,b!==null&&(b.lanes|=a),br(c.return,a,e),i||(p=null);break e}c=b.next}}else if(s.tag===18){if(p=s.return,p===null)throw Error(u(341));p.lanes|=a,c=p.alternate,c!==null&&(c.lanes|=a),br(p,a,e),p=null}else p=s.child;if(p!==null)p.return=s;else for(p=s;p!==null;){if(p===e){p=null;break}if(s=p.sibling,s!==null){s.return=p.return,p=s;break}p=p.return}s=p}}function El(e,t,a,i){e=null;for(var s=t,c=!1;s!==null;){if(!c){if((s.flags&524288)!==0)c=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var p=s.alternate;if(p===null)throw Error(u(387));if(p=p.memoizedProps,p!==null){var b=s.type;zt(s.pendingProps.value,p.value)||(e!==null?e.push(b):e=[b])}}else if(s===re.current){if(p=s.alternate,p===null)throw Error(u(387));p.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(Ii):e=[Ii])}s=s.return}e!==null&&_r(t,e,a,i),t.flags|=262144}function eu(e){for(e=e.firstContext;e!==null;){if(!zt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function qa(e){Ba=e,Nn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ct(e){return Yd(Ba,e)}function tu(e,t){return Ba===null&&qa(e),Yd(e,t)}function Yd(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Nn===null){if(e===null)throw Error(u(308));Nn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Nn=Nn.next=t;return a}var Yv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Vv=n.unstable_scheduleCallback,Gv=n.unstable_NormalPriority,Pe={$$typeof:w,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Er(){return{controller:new Yv,data:new Map,refCount:0}}function _i(e){e.refCount--,e.refCount===0&&Vv(Gv,function(){e.controller.abort()})}var Ei=null,wr=0,wl=0,Nl=null;function Xv(e,t){if(Ei===null){var a=Ei=[];wr=0,wl=Ac(),Nl={status:"pending",value:void 0,then:function(i){a.push(i)}}}return wr++,t.then(Vd,Vd),t}function Vd(){if(--wr===0&&Ei!==null){Nl!==null&&(Nl.status="fulfilled");var e=Ei;Ei=null,wl=0,Nl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Zv(e,t){var a=[],i={status:"pending",value:null,reason:null,then:function(s){a.push(s)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var s=0;s<a.length;s++)(0,a[s])(t)},function(s){for(i.status="rejected",i.reason=s,s=0;s<a.length;s++)(0,a[s])(void 0)}),i}var Gd=M.S;M.S=function(e,t){Ng=st(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Xv(e,t),Gd!==null&&Gd(e,t)};var La=A(null);function Nr(){var e=La.current;return e!==null?e:Ge.pooledCache}function nu(e,t){t===null?P(La,La.current):P(La,t.pool)}function Xd(){var e=Nr();return e===null?null:{parent:Pe._currentValue,pool:e}}var Ml=Error(u(460)),Mr=Error(u(474)),au=Error(u(542)),lu={then:function(){}};function Zd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Qd(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(bn,bn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,kd(e),e;default:if(typeof t.status=="string")t.then(bn,bn);else{if(e=Ge,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=i}},function(i){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,kd(e),e}throw Va=t,Ml}}function Ya(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Va=a,Ml):a}}var Va=null;function $d(){if(Va===null)throw Error(u(459));var e=Va;return Va=null,e}function kd(e){if(e===Ml||e===au)throw Error(u(483))}var Al=null,wi=0;function iu(e){var t=wi;return wi+=1,Al===null&&(Al=[]),Qd(Al,e,t)}function Ni(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ou(e,t){throw t.$$typeof===x?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Id(e){function t(G,B){if(e){var k=G.deletions;k===null?(G.deletions=[B],G.flags|=16):k.push(B)}}function a(G,B){if(!e)return null;for(;B!==null;)t(G,B),B=B.sibling;return null}function i(G){for(var B=new Map;G!==null;)G.key!==null?B.set(G.key,G):B.set(G.index,G),G=G.sibling;return B}function s(G,B){return G=En(G,B),G.index=0,G.sibling=null,G}function c(G,B,k){return G.index=k,e?(k=G.alternate,k!==null?(k=k.index,k<B?(G.flags|=67108866,B):k):(G.flags|=67108866,B)):(G.flags|=1048576,B)}function p(G){return e&&G.alternate===null&&(G.flags|=67108866),G}function b(G,B,k,ae){return B===null||B.tag!==6?(B=gr(k,G.mode,ae),B.return=G,B):(B=s(B,k),B.return=G,B)}function O(G,B,k,ae){var pe=k.type;return pe===T?ne(G,B,k.props.children,ae,k.key):B!==null&&(B.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===R&&Ya(pe)===B.type)?(B=s(B,k.props),Ni(B,k),B.return=G,B):(B=Wo(k.type,k.key,k.props,null,G.mode,ae),Ni(B,k),B.return=G,B)}function I(G,B,k,ae){return B===null||B.tag!==4||B.stateNode.containerInfo!==k.containerInfo||B.stateNode.implementation!==k.implementation?(B=mr(k,G.mode,ae),B.return=G,B):(B=s(B,k.children||[]),B.return=G,B)}function ne(G,B,k,ae,pe){return B===null||B.tag!==7?(B=ja(k,G.mode,ae,pe),B.return=G,B):(B=s(B,k),B.return=G,B)}function le(G,B,k){if(typeof B=="string"&&B!==""||typeof B=="number"||typeof B=="bigint")return B=gr(""+B,G.mode,k),B.return=G,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case S:return k=Wo(B.type,B.key,B.props,null,G.mode,k),Ni(k,B),k.return=G,k;case _:return B=mr(B,G.mode,k),B.return=G,B;case R:return B=Ya(B),le(G,B,k)}if(Q(B)||W(B))return B=ja(B,G.mode,k,null),B.return=G,B;if(typeof B.then=="function")return le(G,iu(B),k);if(B.$$typeof===w)return le(G,tu(G,B),k);ou(G,B)}return null}function K(G,B,k,ae){var pe=B!==null?B.key:null;if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return pe!==null?null:b(G,B,""+k,ae);if(typeof k=="object"&&k!==null){switch(k.$$typeof){case S:return k.key===pe?O(G,B,k,ae):null;case _:return k.key===pe?I(G,B,k,ae):null;case R:return k=Ya(k),K(G,B,k,ae)}if(Q(k)||W(k))return pe!==null?null:ne(G,B,k,ae,null);if(typeof k.then=="function")return K(G,B,iu(k),ae);if(k.$$typeof===w)return K(G,B,tu(G,k),ae);ou(G,k)}return null}function F(G,B,k,ae,pe){if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return G=G.get(k)||null,b(B,G,""+ae,pe);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case S:return G=G.get(ae.key===null?k:ae.key)||null,O(B,G,ae,pe);case _:return G=G.get(ae.key===null?k:ae.key)||null,I(B,G,ae,pe);case R:return ae=Ya(ae),F(G,B,k,ae,pe)}if(Q(ae)||W(ae))return G=G.get(k)||null,ne(B,G,ae,pe,null);if(typeof ae.then=="function")return F(G,B,k,iu(ae),pe);if(ae.$$typeof===w)return F(G,B,k,tu(B,ae),pe);ou(B,ae)}return null}function he(G,B,k,ae){for(var pe=null,Oe=null,ge=B,we=B=0,ze=null;ge!==null&&we<k.length;we++){ge.index>we?(ze=ge,ge=null):ze=ge.sibling;var Re=K(G,ge,k[we],ae);if(Re===null){ge===null&&(ge=ze);break}e&&ge&&Re.alternate===null&&t(G,ge),B=c(Re,B,we),Oe===null?pe=Re:Oe.sibling=Re,Oe=Re,ge=ze}if(we===k.length)return a(G,ge),Ce&&wn(G,we),pe;if(ge===null){for(;we<k.length;we++)ge=le(G,k[we],ae),ge!==null&&(B=c(ge,B,we),Oe===null?pe=ge:Oe.sibling=ge,Oe=ge);return Ce&&wn(G,we),pe}for(ge=i(ge);we<k.length;we++)ze=F(ge,G,we,k[we],ae),ze!==null&&(e&&ze.alternate!==null&&ge.delete(ze.key===null?we:ze.key),B=c(ze,B,we),Oe===null?pe=ze:Oe.sibling=ze,Oe=ze);return e&&ge.forEach(function(ya){return t(G,ya)}),Ce&&wn(G,we),pe}function ve(G,B,k,ae){if(k==null)throw Error(u(151));for(var pe=null,Oe=null,ge=B,we=B=0,ze=null,Re=k.next();ge!==null&&!Re.done;we++,Re=k.next()){ge.index>we?(ze=ge,ge=null):ze=ge.sibling;var ya=K(G,ge,Re.value,ae);if(ya===null){ge===null&&(ge=ze);break}e&&ge&&ya.alternate===null&&t(G,ge),B=c(ya,B,we),Oe===null?pe=ya:Oe.sibling=ya,Oe=ya,ge=ze}if(Re.done)return a(G,ge),Ce&&wn(G,we),pe;if(ge===null){for(;!Re.done;we++,Re=k.next())Re=le(G,Re.value,ae),Re!==null&&(B=c(Re,B,we),Oe===null?pe=Re:Oe.sibling=Re,Oe=Re);return Ce&&wn(G,we),pe}for(ge=i(ge);!Re.done;we++,Re=k.next())Re=F(ge,G,we,Re.value,ae),Re!==null&&(e&&Re.alternate!==null&&ge.delete(Re.key===null?we:Re.key),B=c(Re,B,we),Oe===null?pe=Re:Oe.sibling=Re,Oe=Re);return e&&ge.forEach(function(tx){return t(G,tx)}),Ce&&wn(G,we),pe}function Ve(G,B,k,ae){if(typeof k=="object"&&k!==null&&k.type===T&&k.key===null&&(k=k.props.children),typeof k=="object"&&k!==null){switch(k.$$typeof){case S:e:{for(var pe=k.key;B!==null;){if(B.key===pe){if(pe=k.type,pe===T){if(B.tag===7){a(G,B.sibling),ae=s(B,k.props.children),ae.return=G,G=ae;break e}}else if(B.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===R&&Ya(pe)===B.type){a(G,B.sibling),ae=s(B,k.props),Ni(ae,k),ae.return=G,G=ae;break e}a(G,B);break}else t(G,B);B=B.sibling}k.type===T?(ae=ja(k.props.children,G.mode,ae,k.key),ae.return=G,G=ae):(ae=Wo(k.type,k.key,k.props,null,G.mode,ae),Ni(ae,k),ae.return=G,G=ae)}return p(G);case _:e:{for(pe=k.key;B!==null;){if(B.key===pe)if(B.tag===4&&B.stateNode.containerInfo===k.containerInfo&&B.stateNode.implementation===k.implementation){a(G,B.sibling),ae=s(B,k.children||[]),ae.return=G,G=ae;break e}else{a(G,B);break}else t(G,B);B=B.sibling}ae=mr(k,G.mode,ae),ae.return=G,G=ae}return p(G);case R:return k=Ya(k),Ve(G,B,k,ae)}if(Q(k))return he(G,B,k,ae);if(W(k)){if(pe=W(k),typeof pe!="function")throw Error(u(150));return k=pe.call(k),ve(G,B,k,ae)}if(typeof k.then=="function")return Ve(G,B,iu(k),ae);if(k.$$typeof===w)return Ve(G,B,tu(G,k),ae);ou(G,k)}return typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint"?(k=""+k,B!==null&&B.tag===6?(a(G,B.sibling),ae=s(B,k),ae.return=G,G=ae):(a(G,B),ae=gr(k,G.mode,ae),ae.return=G,G=ae),p(G)):a(G,B)}return function(G,B,k,ae){try{wi=0;var pe=Ve(G,B,k,ae);return Al=null,pe}catch(ge){if(ge===Ml||ge===au)throw ge;var Oe=Ct(29,ge,null,G.mode);return Oe.lanes=ae,Oe.return=G,Oe}}}var Ga=Id(!0),Kd=Id(!1),ea=!1;function Ar(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function ta(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function na(e,t,a){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(He&2)!==0){var s=i.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),i.pending=t,t=Fo(e),Od(e,null,a),t}return Jo(e,i,t,a),Fo(e)}function Mi(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,zo(e,a)}}function zr(e,t){var a=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,a===i)){var s=null,c=null;if(a=a.firstBaseUpdate,a!==null){do{var p={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};c===null?s=c=p:c=c.next=p,a=a.next}while(a!==null);c===null?s=c=t:c=c.next=t}else s=c=t;a={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:c,shared:i.shared,callbacks:i.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Cr=!1;function Ai(){if(Cr){var e=Nl;if(e!==null)throw e}}function Ti(e,t,a,i){Cr=!1;var s=e.updateQueue;ea=!1;var c=s.firstBaseUpdate,p=s.lastBaseUpdate,b=s.shared.pending;if(b!==null){s.shared.pending=null;var O=b,I=O.next;O.next=null,p===null?c=I:p.next=I,p=O;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,b=ne.lastBaseUpdate,b!==p&&(b===null?ne.firstBaseUpdate=I:b.next=I,ne.lastBaseUpdate=O))}if(c!==null){var le=s.baseState;p=0,ne=I=O=null,b=c;do{var K=b.lane&-536870913,F=K!==b.lane;if(F?(Te&K)===K:(i&K)===K){K!==0&&K===wl&&(Cr=!0),ne!==null&&(ne=ne.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var he=e,ve=b;K=t;var Ve=a;switch(ve.tag){case 1:if(he=ve.payload,typeof he=="function"){le=he.call(Ve,le,K);break e}le=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=ve.payload,K=typeof he=="function"?he.call(Ve,le,K):he,K==null)break e;le=y({},le,K);break e;case 2:ea=!0}}K=b.callback,K!==null&&(e.flags|=64,F&&(e.flags|=8192),F=s.callbacks,F===null?s.callbacks=[K]:F.push(K))}else F={lane:K,tag:b.tag,payload:b.payload,callback:b.callback,next:null},ne===null?(I=ne=F,O=le):ne=ne.next=F,p|=K;if(b=b.next,b===null){if(b=s.shared.pending,b===null)break;F=b,b=F.next,F.next=null,s.lastBaseUpdate=F,s.shared.pending=null}}while(!0);ne===null&&(O=le),s.baseState=O,s.firstBaseUpdate=I,s.lastBaseUpdate=ne,c===null&&(s.shared.lanes=0),ua|=p,e.lanes=p,e.memoizedState=le}}function Jd(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Fd(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Jd(a[e],t)}var Tl=A(null),uu=A(0);function Wd(e,t){e=jn,P(uu,e),P(Tl,t),jn=e|t.baseLanes}function Dr(){P(uu,jn),P(Tl,Tl.current)}function Or(){jn=uu.current,j(Tl),j(uu)}var Dt=A(null),Xt=null;function aa(e){var t=e.alternate;P(Je,Je.current&1),P(Dt,e),Xt===null&&(t===null||Tl.current!==null||t.memoizedState!==null)&&(Xt=e)}function Rr(e){P(Je,Je.current),P(Dt,e),Xt===null&&(Xt=e)}function Pd(e){e.tag===22?(P(Je,Je.current),P(Dt,e),Xt===null&&(Xt=e)):la()}function la(){P(Je,Je.current),P(Dt,Dt.current)}function Ot(e){j(Dt),Xt===e&&(Xt=null),j(Je)}var Je=A(0);function su(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Lc(a)||Yc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)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 An=0,_e=null,Le=null,et=null,ru=!1,zl=!1,Xa=!1,cu=0,zi=0,Cl=null,Qv=0;function Ie(){throw Error(u(321))}function Hr(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!zt(e[a],t[a]))return!1;return!0}function jr(e,t,a,i,s,c){return An=c,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?Uh:Jr,Xa=!1,c=a(i,s),Xa=!1,zl&&(c=th(t,a,i,s)),eh(e),c}function eh(e){M.H=Oi;var t=Le!==null&&Le.next!==null;if(An=0,et=Le=_e=null,ru=!1,zi=0,Cl=null,t)throw Error(u(300));e===null||tt||(e=e.dependencies,e!==null&&eu(e)&&(tt=!0))}function th(e,t,a,i){_e=e;var s=0;do{if(zl&&(Cl=null),zi=0,zl=!1,25<=s)throw Error(u(301));if(s+=1,et=Le=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}M.H=Bh,c=t(a,i)}while(zl);return c}function $v(){var e=M.H,t=e.useState()[0];return t=typeof t.then=="function"?Ci(t):t,e=e.useState()[0],(Le!==null?Le.memoizedState:null)!==e&&(_e.flags|=1024),t}function Ur(){var e=cu!==0;return cu=0,e}function Br(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function qr(e){if(ru){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ru=!1}An=0,et=Le=_e=null,zl=!1,zi=cu=0,Cl=null}function yt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return et===null?_e.memoizedState=et=e:et=et.next=e,et}function Fe(){if(Le===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=Le.next;var t=et===null?_e.memoizedState:et.next;if(t!==null)et=t,Le=e;else{if(e===null)throw _e.alternate===null?Error(u(467)):Error(u(310));Le=e,e={memoizedState:Le.memoizedState,baseState:Le.baseState,baseQueue:Le.baseQueue,queue:Le.queue,next:null},et===null?_e.memoizedState=et=e:et=et.next=e}return et}function fu(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ci(e){var t=zi;return zi+=1,Cl===null&&(Cl=[]),e=Qd(Cl,e,t),t=_e,(et===null?t.memoizedState:et.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?Uh:Jr),e}function du(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ci(e);if(e.$$typeof===w)return ct(e)}throw Error(u(438,String(e)))}function Lr(e){var t=null,a=_e.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var i=_e.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=fu(),_e.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),i=0;i<e;i++)a[i]=ie;return t.index++,a}function Tn(e,t){return typeof t=="function"?t(e):t}function hu(e){var t=Fe();return Yr(t,Le,e)}function Yr(e,t,a){var i=e.queue;if(i===null)throw Error(u(311));i.lastRenderedReducer=a;var s=e.baseQueue,c=i.pending;if(c!==null){if(s!==null){var p=s.next;s.next=c.next,c.next=p}t.baseQueue=s=c,i.pending=null}if(c=e.baseState,s===null)e.memoizedState=c;else{t=s.next;var b=p=null,O=null,I=t,ne=!1;do{var le=I.lane&-536870913;if(le!==I.lane?(Te&le)===le:(An&le)===le){var K=I.revertLane;if(K===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null}),le===wl&&(ne=!0);else if((An&K)===K){I=I.next,K===wl&&(ne=!0);continue}else le={lane:0,revertLane:I.revertLane,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},O===null?(b=O=le,p=c):O=O.next=le,_e.lanes|=K,ua|=K;le=I.action,Xa&&a(c,le),c=I.hasEagerState?I.eagerState:a(c,le)}else K={lane:le,revertLane:I.revertLane,gesture:I.gesture,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},O===null?(b=O=K,p=c):O=O.next=K,_e.lanes|=le,ua|=le;I=I.next}while(I!==null&&I!==t);if(O===null?p=c:O.next=b,!zt(c,e.memoizedState)&&(tt=!0,ne&&(a=Nl,a!==null)))throw a;e.memoizedState=c,e.baseState=p,e.baseQueue=O,i.lastRenderedState=c}return s===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Vr(e){var t=Fe(),a=t.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=e;var i=a.dispatch,s=a.pending,c=t.memoizedState;if(s!==null){a.pending=null;var p=s=s.next;do c=e(c,p.action),p=p.next;while(p!==s);zt(c,t.memoizedState)||(tt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),a.lastRenderedState=c}return[c,i]}function nh(e,t,a){var i=_e,s=Fe(),c=Ce;if(c){if(a===void 0)throw Error(u(407));a=a()}else a=t();var p=!zt((Le||s).memoizedState,a);if(p&&(s.memoizedState=a,tt=!0),s=s.queue,Zr(ih.bind(null,i,s,e),[e]),s.getSnapshot!==t||p||et!==null&&et.memoizedState.tag&1){if(i.flags|=2048,Dl(9,{destroy:void 0},lh.bind(null,i,s,a,t),null),Ge===null)throw Error(u(349));c||(An&127)!==0||ah(i,t,a)}return a}function ah(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=_e.updateQueue,t===null?(t=fu(),_e.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function lh(e,t,a,i){t.value=a,t.getSnapshot=i,oh(t)&&uh(e)}function ih(e,t,a){return a(function(){oh(t)&&uh(e)})}function oh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!zt(e,a)}catch{return!0}}function uh(e){var t=Ha(e,2);t!==null&&Nt(t,e,2)}function Gr(e){var t=yt();if(typeof e=="function"){var a=e;if(e=a(),Xa){an(!0);try{a()}finally{an(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tn,lastRenderedState:e},t}function sh(e,t,a,i){return e.baseState=a,Yr(e,Le,typeof i=="function"?i:Tn)}function kv(e,t,a,i,s){if(pu(e))throw Error(u(485));if(e=t.action,e!==null){var c={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(p){c.listeners.push(p)}};M.T!==null?a(!0):c.isTransition=!1,i(c),a=t.pending,a===null?(c.next=t.pending=c,rh(t,c)):(c.next=a.next,t.pending=a.next=c)}}function rh(e,t){var a=t.action,i=t.payload,s=e.state;if(t.isTransition){var c=M.T,p={};M.T=p;try{var b=a(s,i),O=M.S;O!==null&&O(p,b),ch(e,t,b)}catch(I){Xr(e,t,I)}finally{c!==null&&p.types!==null&&(c.types=p.types),M.T=c}}else try{c=a(s,i),ch(e,t,c)}catch(I){Xr(e,t,I)}}function ch(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(i){fh(e,t,i)},function(i){return Xr(e,t,i)}):fh(e,t,a)}function fh(e,t,a){t.status="fulfilled",t.value=a,dh(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,rh(e,a)))}function Xr(e,t,a){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=a,dh(t),t=t.next;while(t!==i)}e.action=null}function dh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function hh(e,t){return t}function gh(e,t){if(Ce){var a=Ge.formState;if(a!==null){e:{var i=_e;if(Ce){if(Xe){t:{for(var s=Xe,c=Gt;s.nodeType!==8;){if(!c){s=null;break t}if(s=Zt(s.nextSibling),s===null){s=null;break t}}c=s.data,s=c==="F!"||c==="F"?s:null}if(s){Xe=Zt(s.nextSibling),i=s.data==="F!";break e}}Wn(i)}i=!1}i&&(t=a[0])}}return a=yt(),a.memoizedState=a.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hh,lastRenderedState:t},a.queue=i,a=Rh.bind(null,_e,i),i.dispatch=a,i=Gr(!1),c=Kr.bind(null,_e,!1,i.queue),i=yt(),s={state:t,dispatch:null,action:e,pending:null},i.queue=s,a=kv.bind(null,_e,s,c,a),s.dispatch=a,i.memoizedState=e,[t,a,!1]}function mh(e){var t=Fe();return ph(t,Le,e)}function ph(e,t,a){if(t=Yr(e,t,hh)[0],e=hu(Tn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Ci(t)}catch(p){throw p===Ml?au:p}else i=t;t=Fe();var s=t.queue,c=s.dispatch;return a!==t.memoizedState&&(_e.flags|=2048,Dl(9,{destroy:void 0},Iv.bind(null,s,a),null)),[i,c,e]}function Iv(e,t){e.action=t}function yh(e){var t=Fe(),a=Le;if(a!==null)return ph(t,a,e);Fe(),t=t.memoizedState,a=Fe();var i=a.queue.dispatch;return a.memoizedState=e,[t,i,!1]}function Dl(e,t,a,i){return e={tag:e,create:a,deps:i,inst:t,next:null},t=_e.updateQueue,t===null&&(t=fu(),_e.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(i=a.next,a.next=e,e.next=i,t.lastEffect=e),e}function vh(){return Fe().memoizedState}function gu(e,t,a,i){var s=yt();_e.flags|=e,s.memoizedState=Dl(1|t,{destroy:void 0},a,i===void 0?null:i)}function mu(e,t,a,i){var s=Fe();i=i===void 0?null:i;var c=s.memoizedState.inst;Le!==null&&i!==null&&Hr(i,Le.memoizedState.deps)?s.memoizedState=Dl(t,c,a,i):(_e.flags|=e,s.memoizedState=Dl(1|t,c,a,i))}function xh(e,t){gu(8390656,8,e,t)}function Zr(e,t){mu(2048,8,e,t)}function Kv(e){_e.flags|=4;var t=_e.updateQueue;if(t===null)t=fu(),_e.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Sh(e){var t=Fe().memoizedState;return Kv({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function bh(e,t){return mu(4,2,e,t)}function _h(e,t){return mu(4,4,e,t)}function Eh(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function wh(e,t,a){a=a!=null?a.concat([e]):null,mu(4,4,Eh.bind(null,t,e),a)}function Qr(){}function Nh(e,t){var a=Fe();t=t===void 0?null:t;var i=a.memoizedState;return t!==null&&Hr(t,i[1])?i[0]:(a.memoizedState=[e,t],e)}function Mh(e,t){var a=Fe();t=t===void 0?null:t;var i=a.memoizedState;if(t!==null&&Hr(t,i[1]))return i[0];if(i=e(),Xa){an(!0);try{e()}finally{an(!1)}}return a.memoizedState=[i,t],i}function $r(e,t,a){return a===void 0||(An&1073741824)!==0&&(Te&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Ag(),_e.lanes|=e,ua|=e,a)}function Ah(e,t,a,i){return zt(a,t)?a:Tl.current!==null?(e=$r(e,a,i),zt(e,t)||(tt=!0),e):(An&42)===0||(An&1073741824)!==0&&(Te&261930)===0?(tt=!0,e.memoizedState=a):(e=Ag(),_e.lanes|=e,ua|=e,t)}function Th(e,t,a,i,s){var c=H.p;H.p=c!==0&&8>c?c:8;var p=M.T,b={};M.T=b,Kr(e,!1,t,a);try{var O=s(),I=M.S;if(I!==null&&I(b,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var ne=Zv(O,i);Di(e,t,ne,jt(e))}else Di(e,t,i,jt(e))}catch(le){Di(e,t,{then:function(){},status:"rejected",reason:le},jt())}finally{H.p=c,p!==null&&b.types!==null&&(p.types=b.types),M.T=p}}function Jv(){}function kr(e,t,a,i){if(e.tag!==5)throw Error(u(476));var s=zh(e).queue;Th(e,s,t,q,a===null?Jv:function(){return Ch(e),a(i)})}function zh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tn,lastRenderedState:q},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ch(e){var t=zh(e);t.next===null&&(t=e.alternate.memoizedState),Di(e,t.next.queue,{},jt())}function Ir(){return ct(Ii)}function Dh(){return Fe().memoizedState}function Oh(){return Fe().memoizedState}function Fv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=jt();e=ta(a);var i=na(t,e,a);i!==null&&(Nt(i,t,a),Mi(i,t,a)),t={cache:Er()},e.payload=t;return}t=t.return}}function Wv(e,t,a){var i=jt();a={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},pu(e)?Hh(t,a):(a=dr(e,t,a,i),a!==null&&(Nt(a,e,i),jh(a,t,i)))}function Rh(e,t,a){var i=jt();Di(e,t,a,i)}function Di(e,t,a,i){var s={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(pu(e))Hh(t,s);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var p=t.lastRenderedState,b=c(p,a);if(s.hasEagerState=!0,s.eagerState=b,zt(b,p))return Jo(e,t,s,0),Ge===null&&Ko(),!1}catch{}if(a=dr(e,t,s,i),a!==null)return Nt(a,e,i),jh(a,t,i),!0}return!1}function Kr(e,t,a,i){if(i={lane:2,revertLane:Ac(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},pu(e)){if(t)throw Error(u(479))}else t=dr(e,a,i,2),t!==null&&Nt(t,e,2)}function pu(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function Hh(e,t){zl=ru=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function jh(e,t,a){if((a&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,zo(e,a)}}var Oi={readContext:ct,use:du,useCallback:Ie,useContext:Ie,useEffect:Ie,useImperativeHandle:Ie,useLayoutEffect:Ie,useInsertionEffect:Ie,useMemo:Ie,useReducer:Ie,useRef:Ie,useState:Ie,useDebugValue:Ie,useDeferredValue:Ie,useTransition:Ie,useSyncExternalStore:Ie,useId:Ie,useHostTransitionStatus:Ie,useFormState:Ie,useActionState:Ie,useOptimistic:Ie,useMemoCache:Ie,useCacheRefresh:Ie};Oi.useEffectEvent=Ie;var Uh={readContext:ct,use:du,useCallback:function(e,t){return yt().memoizedState=[e,t===void 0?null:t],e},useContext:ct,useEffect:xh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,gu(4194308,4,Eh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return gu(4194308,4,e,t)},useInsertionEffect:function(e,t){gu(4,2,e,t)},useMemo:function(e,t){var a=yt();t=t===void 0?null:t;var i=e();if(Xa){an(!0);try{e()}finally{an(!1)}}return a.memoizedState=[i,t],i},useReducer:function(e,t,a){var i=yt();if(a!==void 0){var s=a(t);if(Xa){an(!0);try{a(t)}finally{an(!1)}}}else s=t;return i.memoizedState=i.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},i.queue=e,e=e.dispatch=Wv.bind(null,_e,e),[i.memoizedState,e]},useRef:function(e){var t=yt();return e={current:e},t.memoizedState=e},useState:function(e){e=Gr(e);var t=e.queue,a=Rh.bind(null,_e,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Qr,useDeferredValue:function(e,t){var a=yt();return $r(a,e,t)},useTransition:function(){var e=Gr(!1);return e=Th.bind(null,_e,e.queue,!0,!1),yt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var i=_e,s=yt();if(Ce){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),Ge===null)throw Error(u(349));(Te&127)!==0||ah(i,t,a)}s.memoizedState=a;var c={value:a,getSnapshot:t};return s.queue=c,xh(ih.bind(null,i,c,e),[e]),i.flags|=2048,Dl(9,{destroy:void 0},lh.bind(null,i,c,a,t),null),a},useId:function(){var e=yt(),t=Ge.identifierPrefix;if(Ce){var a=un,i=on;a=(i&~(1<<32-pt(i)-1)).toString(32)+a,t="_"+t+"R_"+a,a=cu++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Qv++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ir,useFormState:gh,useActionState:gh,useOptimistic:function(e){var t=yt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Kr.bind(null,_e,!0,a),a.dispatch=t,[e,t]},useMemoCache:Lr,useCacheRefresh:function(){return yt().memoizedState=Fv.bind(null,_e)},useEffectEvent:function(e){var t=yt(),a={impl:e};return t.memoizedState=a,function(){if((He&2)!==0)throw Error(u(440));return a.impl.apply(void 0,arguments)}}},Jr={readContext:ct,use:du,useCallback:Nh,useContext:ct,useEffect:Zr,useImperativeHandle:wh,useInsertionEffect:bh,useLayoutEffect:_h,useMemo:Mh,useReducer:hu,useRef:vh,useState:function(){return hu(Tn)},useDebugValue:Qr,useDeferredValue:function(e,t){var a=Fe();return Ah(a,Le.memoizedState,e,t)},useTransition:function(){var e=hu(Tn)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:Ci(e),t]},useSyncExternalStore:nh,useId:Dh,useHostTransitionStatus:Ir,useFormState:mh,useActionState:mh,useOptimistic:function(e,t){var a=Fe();return sh(a,Le,e,t)},useMemoCache:Lr,useCacheRefresh:Oh};Jr.useEffectEvent=Sh;var Bh={readContext:ct,use:du,useCallback:Nh,useContext:ct,useEffect:Zr,useImperativeHandle:wh,useInsertionEffect:bh,useLayoutEffect:_h,useMemo:Mh,useReducer:Vr,useRef:vh,useState:function(){return Vr(Tn)},useDebugValue:Qr,useDeferredValue:function(e,t){var a=Fe();return Le===null?$r(a,e,t):Ah(a,Le.memoizedState,e,t)},useTransition:function(){var e=Vr(Tn)[0],t=Fe().memoizedState;return[typeof e=="boolean"?e:Ci(e),t]},useSyncExternalStore:nh,useId:Dh,useHostTransitionStatus:Ir,useFormState:yh,useActionState:yh,useOptimistic:function(e,t){var a=Fe();return Le!==null?sh(a,Le,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Lr,useCacheRefresh:Oh};Bh.useEffectEvent=Sh;function Fr(e,t,a,i){t=e.memoizedState,a=a(i,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Wr={enqueueSetState:function(e,t,a){e=e._reactInternals;var i=jt(),s=ta(i);s.payload=t,a!=null&&(s.callback=a),t=na(e,s,i),t!==null&&(Nt(t,e,i),Mi(t,e,i))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var i=jt(),s=ta(i);s.tag=1,s.payload=t,a!=null&&(s.callback=a),t=na(e,s,i),t!==null&&(Nt(t,e,i),Mi(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=jt(),i=ta(a);i.tag=2,t!=null&&(i.callback=t),t=na(e,i,a),t!==null&&(Nt(t,e,a),Mi(t,e,a))}};function qh(e,t,a,i,s,c,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,c,p):t.prototype&&t.prototype.isPureReactComponent?!vi(a,i)||!vi(s,c):!0}function Lh(e,t,a,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,i),t.state!==e&&Wr.enqueueReplaceState(t,t.state,null)}function Za(e,t){var a=t;if("ref"in t){a={};for(var i in t)i!=="ref"&&(a[i]=t[i])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var s in e)a[s]===void 0&&(a[s]=e[s])}return a}function Yh(e){Io(e)}function Vh(e){console.error(e)}function Gh(e){Io(e)}function yu(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Xh(e,t,a){try{var i=e.onCaughtError;i(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Pr(e,t,a){return a=ta(a),a.tag=3,a.payload={element:null},a.callback=function(){yu(e,t)},a}function Zh(e){return e=ta(e),e.tag=3,e}function Qh(e,t,a,i){var s=a.type.getDerivedStateFromError;if(typeof s=="function"){var c=i.value;e.payload=function(){return s(c)},e.callback=function(){Xh(t,a,i)}}var p=a.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(e.callback=function(){Xh(t,a,i),typeof s!="function"&&(sa===null?sa=new Set([this]):sa.add(this));var b=i.stack;this.componentDidCatch(i.value,{componentStack:b!==null?b:""})})}function Pv(e,t,a,i,s){if(a.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=a.alternate,t!==null&&El(t,a,s,!0),a=Dt.current,a!==null){switch(a.tag){case 31:case 13:return Xt===null?zu():a.alternate===null&&Ke===0&&(Ke=3),a.flags&=-257,a.flags|=65536,a.lanes=s,i===lu?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([i]):t.add(i),wc(e,i,s)),!1;case 22:return a.flags|=65536,i===lu?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([i]):a.add(i)),wc(e,i,s)),!1}throw Error(u(435,a.tag))}return wc(e,i,s),zu(),!1}if(Ce)return t=Dt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,i!==vr&&(e=Error(u(422),{cause:i}),bi(Lt(e,a)))):(i!==vr&&(t=Error(u(423),{cause:i}),bi(Lt(t,a))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,i=Lt(i,a),s=Pr(e.stateNode,i,s),zr(e,s),Ke!==4&&(Ke=2)),!1;var c=Error(u(520),{cause:i});if(c=Lt(c,a),Yi===null?Yi=[c]:Yi.push(c),Ke!==4&&(Ke=2),t===null)return!0;i=Lt(i,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=s&-s,a.lanes|=e,e=Pr(a.stateNode,i,e),zr(a,e),!1;case 1:if(t=a.type,c=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(sa===null||!sa.has(c))))return a.flags|=65536,s&=-s,a.lanes|=s,s=Zh(s),Qh(s,e,a,i),zr(a,s),!1}a=a.return}while(a!==null);return!1}var ec=Error(u(461)),tt=!1;function ft(e,t,a,i){t.child=e===null?Kd(t,null,a,i):Ga(t,e.child,a,i)}function $h(e,t,a,i,s){a=a.render;var c=t.ref;if("ref"in i){var p={};for(var b in i)b!=="ref"&&(p[b]=i[b])}else p=i;return qa(t),i=jr(e,t,a,p,c,s),b=Ur(),e!==null&&!tt?(Br(e,t,s),zn(e,t,s)):(Ce&&b&&pr(t),t.flags|=1,ft(e,t,i,s),t.child)}function kh(e,t,a,i,s){if(e===null){var c=a.type;return typeof c=="function"&&!hr(c)&&c.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=c,Ih(e,t,c,i,s)):(e=Wo(a.type,null,i,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!sc(e,s)){var p=c.memoizedProps;if(a=a.compare,a=a!==null?a:vi,a(p,i)&&e.ref===t.ref)return zn(e,t,s)}return t.flags|=1,e=En(c,i),e.ref=t.ref,e.return=t,t.child=e}function Ih(e,t,a,i,s){if(e!==null){var c=e.memoizedProps;if(vi(c,i)&&e.ref===t.ref)if(tt=!1,t.pendingProps=i=c,sc(e,s))(e.flags&131072)!==0&&(tt=!0);else return t.lanes=e.lanes,zn(e,t,s)}return tc(e,t,a,i,s)}function Kh(e,t,a,i){var s=i.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|a:a,e!==null){for(i=t.child=e.child,s=0;i!==null;)s=s|i.lanes|i.childLanes,i=i.sibling;i=s&~c}else i=0,t.child=null;return Jh(e,t,c,a,i)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&nu(t,c!==null?c.cachePool:null),c!==null?Wd(t,c):Dr(),Pd(t);else return i=t.lanes=536870912,Jh(e,t,c!==null?c.baseLanes|a:a,a,i)}else c!==null?(nu(t,c.cachePool),Wd(t,c),la(),t.memoizedState=null):(e!==null&&nu(t,null),Dr(),la());return ft(e,t,s,a),t.child}function Ri(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Jh(e,t,a,i,s){var c=Nr();return c=c===null?null:{parent:Pe._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&nu(t,null),Dr(),Pd(t),e!==null&&El(e,t,i,!0),t.childLanes=s,null}function vu(e,t){return t=Su({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Fh(e,t,a){return Ga(t,e.child,null,a),e=vu(t,t.pendingProps),e.flags|=2,Ot(t),t.memoizedState=null,e}function e1(e,t,a){var i=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ce){if(i.mode==="hidden")return e=vu(t,i),t.lanes=536870912,Ri(null,e);if(Rr(t),(e=Xe)?(e=rm(e,Gt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Jn!==null?{id:on,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=Hd(e),a.return=t,t.child=a,rt=t,Xe=null)):e=null,e===null)throw Wn(t);return t.lanes=536870912,null}return vu(t,i)}var c=e.memoizedState;if(c!==null){var p=c.dehydrated;if(Rr(t),s)if(t.flags&256)t.flags&=-257,t=Fh(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(tt||El(e,t,a,!1),s=(a&e.childLanes)!==0,tt||s){if(i=Ge,i!==null&&(p=Co(i,a),p!==0&&p!==c.retryLane))throw c.retryLane=p,Ha(e,p),Nt(i,e,p),ec;zu(),t=Fh(e,t,a)}else e=c.treeContext,Xe=Zt(p.nextSibling),rt=t,Ce=!0,Fn=null,Gt=!1,e!==null&&Bd(t,e),t=vu(t,i),t.flags|=4096;return t}return e=En(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function xu(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(u(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function tc(e,t,a,i,s){return qa(t),a=jr(e,t,a,i,void 0,s),i=Ur(),e!==null&&!tt?(Br(e,t,s),zn(e,t,s)):(Ce&&i&&pr(t),t.flags|=1,ft(e,t,a,s),t.child)}function Wh(e,t,a,i,s,c){return qa(t),t.updateQueue=null,a=th(t,i,a,s),eh(e),i=Ur(),e!==null&&!tt?(Br(e,t,c),zn(e,t,c)):(Ce&&i&&pr(t),t.flags|=1,ft(e,t,a,c),t.child)}function Ph(e,t,a,i,s){if(qa(t),t.stateNode===null){var c=xl,p=a.contextType;typeof p=="object"&&p!==null&&(c=ct(p)),c=new a(i,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Wr,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=i,c.state=t.memoizedState,c.refs={},Ar(t),p=a.contextType,c.context=typeof p=="object"&&p!==null?ct(p):xl,c.state=t.memoizedState,p=a.getDerivedStateFromProps,typeof p=="function"&&(Fr(t,a,p,i),c.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(p=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),p!==c.state&&Wr.enqueueReplaceState(c,c.state,null),Ti(t,i,c,s),Ai(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){c=t.stateNode;var b=t.memoizedProps,O=Za(a,b);c.props=O;var I=c.context,ne=a.contextType;p=xl,typeof ne=="object"&&ne!==null&&(p=ct(ne));var le=a.getDerivedStateFromProps;ne=typeof le=="function"||typeof c.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,ne||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(b||I!==p)&&Lh(t,c,i,p),ea=!1;var K=t.memoizedState;c.state=K,Ti(t,i,c,s),Ai(),I=t.memoizedState,b||K!==I||ea?(typeof le=="function"&&(Fr(t,a,le,i),I=t.memoizedState),(O=ea||qh(t,a,O,i,K,I,p))?(ne||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=I),c.props=i,c.state=I,c.context=p,i=O):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{c=t.stateNode,Tr(e,t),p=t.memoizedProps,ne=Za(a,p),c.props=ne,le=t.pendingProps,K=c.context,I=a.contextType,O=xl,typeof I=="object"&&I!==null&&(O=ct(I)),b=a.getDerivedStateFromProps,(I=typeof b=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(p!==le||K!==O)&&Lh(t,c,i,O),ea=!1,K=t.memoizedState,c.state=K,Ti(t,i,c,s),Ai();var F=t.memoizedState;p!==le||K!==F||ea||e!==null&&e.dependencies!==null&&eu(e.dependencies)?(typeof b=="function"&&(Fr(t,a,b,i),F=t.memoizedState),(ne=ea||qh(t,a,ne,i,K,F,O)||e!==null&&e.dependencies!==null&&eu(e.dependencies))?(I||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(i,F,O),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(i,F,O)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||p===e.memoizedProps&&K===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&K===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=F),c.props=i,c.state=F,c.context=O,i=ne):(typeof c.componentDidUpdate!="function"||p===e.memoizedProps&&K===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&K===e.memoizedState||(t.flags|=1024),i=!1)}return c=i,xu(e,t),i=(t.flags&128)!==0,c||i?(c=t.stateNode,a=i&&typeof a.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&i?(t.child=Ga(t,e.child,null,s),t.child=Ga(t,null,a,s)):ft(e,t,a,s),t.memoizedState=c.state,e=t.child):e=zn(e,t,s),e}function eg(e,t,a,i){return Ua(),t.flags|=256,ft(e,t,a,i),t.child}var nc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ac(e){return{baseLanes:e,cachePool:Xd()}}function lc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ht),e}function tg(e,t,a){var i=t.pendingProps,s=!1,c=(t.flags&128)!==0,p;if((p=c)||(p=e!==null&&e.memoizedState===null?!1:(Je.current&2)!==0),p&&(s=!0,t.flags&=-129),p=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ce){if(s?aa(t):la(),(e=Xe)?(e=rm(e,Gt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Jn!==null?{id:on,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=Hd(e),a.return=t,t.child=a,rt=t,Xe=null)):e=null,e===null)throw Wn(t);return Yc(e)?t.lanes=32:t.lanes=536870912,null}var b=i.children;return i=i.fallback,s?(la(),s=t.mode,b=Su({mode:"hidden",children:b},s),i=ja(i,s,a,null),b.return=t,i.return=t,b.sibling=i,t.child=b,i=t.child,i.memoizedState=ac(a),i.childLanes=lc(e,p,a),t.memoizedState=nc,Ri(null,i)):(aa(t),ic(t,b))}var O=e.memoizedState;if(O!==null&&(b=O.dehydrated,b!==null)){if(c)t.flags&256?(aa(t),t.flags&=-257,t=oc(e,t,a)):t.memoizedState!==null?(la(),t.child=e.child,t.flags|=128,t=null):(la(),b=i.fallback,s=t.mode,i=Su({mode:"visible",children:i.children},s),b=ja(b,s,a,null),b.flags|=2,i.return=t,b.return=t,i.sibling=b,t.child=i,Ga(t,e.child,null,a),i=t.child,i.memoizedState=ac(a),i.childLanes=lc(e,p,a),t.memoizedState=nc,t=Ri(null,i));else if(aa(t),Yc(b)){if(p=b.nextSibling&&b.nextSibling.dataset,p)var I=p.dgst;p=I,i=Error(u(419)),i.stack="",i.digest=p,bi({value:i,source:null,stack:null}),t=oc(e,t,a)}else if(tt||El(e,t,a,!1),p=(a&e.childLanes)!==0,tt||p){if(p=Ge,p!==null&&(i=Co(p,a),i!==0&&i!==O.retryLane))throw O.retryLane=i,Ha(e,i),Nt(p,e,i),ec;Lc(b)||zu(),t=oc(e,t,a)}else Lc(b)?(t.flags|=192,t.child=e.child,t=null):(e=O.treeContext,Xe=Zt(b.nextSibling),rt=t,Ce=!0,Fn=null,Gt=!1,e!==null&&Bd(t,e),t=ic(t,i.children),t.flags|=4096);return t}return s?(la(),b=i.fallback,s=t.mode,O=e.child,I=O.sibling,i=En(O,{mode:"hidden",children:i.children}),i.subtreeFlags=O.subtreeFlags&65011712,I!==null?b=En(I,b):(b=ja(b,s,a,null),b.flags|=2),b.return=t,i.return=t,i.sibling=b,t.child=i,Ri(null,i),i=t.child,b=e.child.memoizedState,b===null?b=ac(a):(s=b.cachePool,s!==null?(O=Pe._currentValue,s=s.parent!==O?{parent:O,pool:O}:s):s=Xd(),b={baseLanes:b.baseLanes|a,cachePool:s}),i.memoizedState=b,i.childLanes=lc(e,p,a),t.memoizedState=nc,Ri(e.child,i)):(aa(t),a=e.child,e=a.sibling,a=En(a,{mode:"visible",children:i.children}),a.return=t,a.sibling=null,e!==null&&(p=t.deletions,p===null?(t.deletions=[e],t.flags|=16):p.push(e)),t.child=a,t.memoizedState=null,a)}function ic(e,t){return t=Su({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Su(e,t){return e=Ct(22,e,null,t),e.lanes=0,e}function oc(e,t,a){return Ga(t,e.child,null,a),e=ic(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ng(e,t,a){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),br(e.return,t,a)}function uc(e,t,a,i,s,c){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:a,tailMode:s,treeForkCount:c}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=i,p.tail=a,p.tailMode=s,p.treeForkCount=c)}function ag(e,t,a){var i=t.pendingProps,s=i.revealOrder,c=i.tail;i=i.children;var p=Je.current,b=(p&2)!==0;if(b?(p=p&1|2,t.flags|=128):p&=1,P(Je,p),ft(e,t,i,a),i=Ce?Si:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ng(e,a,t);else if(e.tag===19)ng(e,a,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}switch(s){case"forwards":for(a=t.child,s=null;a!==null;)e=a.alternate,e!==null&&su(e)===null&&(s=a),a=a.sibling;a=s,a===null?(s=t.child,t.child=null):(s=a.sibling,a.sibling=null),uc(t,!1,s,a,c,i);break;case"backwards":case"unstable_legacy-backwards":for(a=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&su(e)===null){t.child=s;break}e=s.sibling,s.sibling=a,a=s,s=e}uc(t,!0,a,null,c,i);break;case"together":uc(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function zn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),ua|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(El(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,a=En(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=En(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function sc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&eu(e)))}function t1(e,t,a){switch(t.tag){case 3:ue(t,t.stateNode.containerInfo),Pn(t,Pe,e.memoizedState.cache),Ua();break;case 27:case 5:Ee(t);break;case 4:ue(t,t.stateNode.containerInfo);break;case 10:Pn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Rr(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(aa(t),t.flags|=128,null):(a&t.child.childLanes)!==0?tg(e,t,a):(aa(t),e=zn(e,t,a),e!==null?e.sibling:null);aa(t);break;case 19:var s=(e.flags&128)!==0;if(i=(a&t.childLanes)!==0,i||(El(e,t,a,!1),i=(a&t.childLanes)!==0),s){if(i)return ag(e,t,a);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),P(Je,Je.current),i)break;return null;case 22:return t.lanes=0,Kh(e,t,a,t.pendingProps);case 24:Pn(t,Pe,e.memoizedState.cache)}return zn(e,t,a)}function lg(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)tt=!0;else{if(!sc(e,a)&&(t.flags&128)===0)return tt=!1,t1(e,t,a);tt=(e.flags&131072)!==0}else tt=!1,Ce&&(t.flags&1048576)!==0&&Ud(t,Si,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Ya(t.elementType),t.type=e,typeof e=="function")hr(e)?(i=Za(e,i),t.tag=1,t=Ph(null,t,e,i,a)):(t.tag=0,t=tc(null,t,e,i,a));else{if(e!=null){var s=e.$$typeof;if(s===C){t.tag=11,t=$h(null,t,e,i,a);break e}else if(s===Y){t.tag=14,t=kh(null,t,e,i,a);break e}}throw t=D(e)||e,Error(u(306,t,""))}}return t;case 0:return tc(e,t,t.type,t.pendingProps,a);case 1:return i=t.type,s=Za(i,t.pendingProps),Ph(e,t,i,s,a);case 3:e:{if(ue(t,t.stateNode.containerInfo),e===null)throw Error(u(387));i=t.pendingProps;var c=t.memoizedState;s=c.element,Tr(e,t),Ti(t,i,null,a);var p=t.memoizedState;if(i=p.cache,Pn(t,Pe,i),i!==c.cache&&_r(t,[Pe],a,!0),Ai(),i=p.element,c.isDehydrated)if(c={element:i,isDehydrated:!1,cache:p.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=eg(e,t,i,a);break e}else if(i!==s){s=Lt(Error(u(424)),t),bi(s),t=eg(e,t,i,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Xe=Zt(e.firstChild),rt=t,Ce=!0,Fn=null,Gt=!0,a=Kd(t,null,i,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Ua(),i===s){t=zn(e,t,a);break e}ft(e,t,i,a)}t=t.child}return t;case 26:return xu(e,t),e===null?(a=mm(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ce||(a=t.type,e=t.pendingProps,i=Uu(ce.current).createElement(a),i[lt]=t,i[ht]=e,dt(i,a,e),We(i),t.stateNode=i):t.memoizedState=mm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ee(t),e===null&&Ce&&(i=t.stateNode=dm(t.type,t.pendingProps,ce.current),rt=t,Gt=!0,s=Xe,da(t.type)?(Vc=s,Xe=Zt(i.firstChild)):Xe=s),ft(e,t,t.pendingProps.children,a),xu(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ce&&((s=i=Xe)&&(i=D1(i,t.type,t.pendingProps,Gt),i!==null?(t.stateNode=i,rt=t,Xe=Zt(i.firstChild),Gt=!1,s=!0):s=!1),s||Wn(t)),Ee(t),s=t.type,c=t.pendingProps,p=e!==null?e.memoizedProps:null,i=c.children,Uc(s,c)?i=null:p!==null&&Uc(s,p)&&(t.flags|=32),t.memoizedState!==null&&(s=jr(e,t,$v,null,null,a),Ii._currentValue=s),xu(e,t),ft(e,t,i,a),t.child;case 6:return e===null&&Ce&&((e=a=Xe)&&(a=O1(a,t.pendingProps,Gt),a!==null?(t.stateNode=a,rt=t,Xe=null,e=!0):e=!1),e||Wn(t)),null;case 13:return tg(e,t,a);case 4:return ue(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Ga(t,null,i,a):ft(e,t,i,a),t.child;case 11:return $h(e,t,t.type,t.pendingProps,a);case 7:return ft(e,t,t.pendingProps,a),t.child;case 8:return ft(e,t,t.pendingProps.children,a),t.child;case 12:return ft(e,t,t.pendingProps.children,a),t.child;case 10:return i=t.pendingProps,Pn(t,t.type,i.value),ft(e,t,i.children,a),t.child;case 9:return s=t.type._context,i=t.pendingProps.children,qa(t),s=ct(s),i=i(s),t.flags|=1,ft(e,t,i,a),t.child;case 14:return kh(e,t,t.type,t.pendingProps,a);case 15:return Ih(e,t,t.type,t.pendingProps,a);case 19:return ag(e,t,a);case 31:return e1(e,t,a);case 22:return Kh(e,t,a,t.pendingProps);case 24:return qa(t),i=ct(Pe),e===null?(s=Nr(),s===null&&(s=Ge,c=Er(),s.pooledCache=c,c.refCount++,c!==null&&(s.pooledCacheLanes|=a),s=c),t.memoizedState={parent:i,cache:s},Ar(t),Pn(t,Pe,s)):((e.lanes&a)!==0&&(Tr(e,t),Ti(t,null,null,a),Ai()),s=e.memoizedState,c=t.memoizedState,s.parent!==i?(s={parent:i,cache:i},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Pn(t,Pe,i)):(i=c.cache,Pn(t,Pe,i),i!==s.cache&&_r(t,[Pe],a,!0))),ft(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function Cn(e){e.flags|=4}function rc(e,t,a,i,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(Dg())e.flags|=8192;else throw Va=lu,Mr}else e.flags&=-16777217}function ig(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Sm(t))if(Dg())e.flags|=8192;else throw Va=lu,Mr}function bu(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ao():536870912,e.lanes|=t,jl|=t)}function Hi(e,t){if(!Ce)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,i=0;if(t)for(var s=e.child;s!==null;)a|=s.lanes|s.childLanes,i|=s.subtreeFlags&65011712,i|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)a|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=i,e.childLanes=a,t}function n1(e,t,a){var i=t.pendingProps;switch(yr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(t),null;case 1:return Ze(t),null;case 3:return a=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Mn(Pe),fe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(_l(t)?Cn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,xr())),Ze(t),null;case 26:var s=t.type,c=t.memoizedState;return e===null?(Cn(t),c!==null?(Ze(t),ig(t,c)):(Ze(t),rc(t,s,null,i,a))):c?c!==e.memoizedState?(Cn(t),Ze(t),ig(t,c)):(Ze(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Cn(t),Ze(t),rc(t,s,e,i,a)),null;case 27:if(be(t),a=ce.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Cn(t);else{if(!i){if(t.stateNode===null)throw Error(u(166));return Ze(t),null}e=te.current,_l(t)?qd(t):(e=dm(s,i,a),t.stateNode=e,Cn(t))}return Ze(t),null;case 5:if(be(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Cn(t);else{if(!i){if(t.stateNode===null)throw Error(u(166));return Ze(t),null}if(c=te.current,_l(t))qd(t);else{var p=Uu(ce.current);switch(c){case 1:c=p.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:c=p.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":c=p.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":c=p.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":c=p.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof i.is=="string"?p.createElement("select",{is:i.is}):p.createElement("select"),i.multiple?c.multiple=!0:i.size&&(c.size=i.size);break;default:c=typeof i.is=="string"?p.createElement(s,{is:i.is}):p.createElement(s)}}c[lt]=t,c[ht]=i;e:for(p=t.child;p!==null;){if(p.tag===5||p.tag===6)c.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}t.stateNode=c;e:switch(dt(c,s,i),s){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Cn(t)}}return Ze(t),rc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Cn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(u(166));if(e=ce.current,_l(t)){if(e=t.stateNode,a=t.memoizedProps,i=null,s=rt,s!==null)switch(s.tag){case 27:case 5:i=s.memoizedProps}e[lt]=t,e=!!(e.nodeValue===a||i!==null&&i.suppressHydrationWarning===!0||tm(e.nodeValue,a)),e||Wn(t,!0)}else e=Uu(e).createTextNode(i),e[lt]=t,t.stateNode=e}return Ze(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(i=_l(t),a!==null){if(e===null){if(!i)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[lt]=t}else Ua(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),e=!1}else a=xr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Ot(t),t):(Ot(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Ze(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=_l(t),i!==null&&i.dehydrated!==null){if(e===null){if(!s)throw Error(u(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(u(317));s[lt]=t}else Ua(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),s=!1}else s=xr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Ot(t),t):(Ot(t),null)}return Ot(t),(t.flags&128)!==0?(t.lanes=a,t):(a=i!==null,e=e!==null&&e.memoizedState!==null,a&&(i=t.child,s=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(s=i.alternate.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==s&&(i.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),bu(t,t.updateQueue),Ze(t),null);case 4:return fe(),e===null&&Dc(t.stateNode.containerInfo),Ze(t),null;case 10:return Mn(t.type),Ze(t),null;case 19:if(j(Je),i=t.memoizedState,i===null)return Ze(t),null;if(s=(t.flags&128)!==0,c=i.rendering,c===null)if(s)Hi(i,!1);else{if(Ke!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=su(e),c!==null){for(t.flags|=128,Hi(i,!1),e=c.updateQueue,t.updateQueue=e,bu(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Rd(a,e),a=a.sibling;return P(Je,Je.current&1|2),Ce&&wn(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&st()>Mu&&(t.flags|=128,s=!0,Hi(i,!1),t.lanes=4194304)}else{if(!s)if(e=su(c),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,bu(t,e),Hi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!c.alternate&&!Ce)return Ze(t),null}else 2*st()-i.renderingStartTime>Mu&&a!==536870912&&(t.flags|=128,s=!0,Hi(i,!1),t.lanes=4194304);i.isBackwards?(c.sibling=t.child,t.child=c):(e=i.last,e!==null?e.sibling=c:t.child=c,i.last=c)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=st(),e.sibling=null,a=Je.current,P(Je,s?a&1|2:a&1),Ce&&wn(t,i.treeForkCount),e):(Ze(t),null);case 22:case 23:return Ot(t),Or(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(a&536870912)!==0&&(t.flags&128)===0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),a=t.updateQueue,a!==null&&bu(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==a&&(t.flags|=2048),e!==null&&j(La),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Mn(Pe),Ze(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function a1(e,t){switch(yr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Mn(Pe),fe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return be(t),null;case 31:if(t.memoizedState!==null){if(Ot(t),t.alternate===null)throw Error(u(340));Ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ot(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));Ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return j(Je),null;case 4:return fe(),null;case 10:return Mn(t.type),null;case 22:case 23:return Ot(t),Or(),e!==null&&j(La),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Mn(Pe),null;case 25:return null;default:return null}}function og(e,t){switch(yr(t),t.tag){case 3:Mn(Pe),fe();break;case 26:case 27:case 5:be(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&Ot(t);break;case 13:Ot(t);break;case 19:j(Je);break;case 10:Mn(t.type);break;case 22:case 23:Ot(t),Or(),e!==null&&j(La);break;case 24:Mn(Pe)}}function ji(e,t){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var s=i.next;a=s;do{if((a.tag&e)===e){i=void 0;var c=a.create,p=a.inst;i=c(),p.destroy=i}a=a.next}while(a!==s)}}catch(b){Be(t,t.return,b)}}function ia(e,t,a){try{var i=t.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var c=s.next;i=c;do{if((i.tag&e)===e){var p=i.inst,b=p.destroy;if(b!==void 0){p.destroy=void 0,s=t;var O=a,I=b;try{I()}catch(ne){Be(s,O,ne)}}}i=i.next}while(i!==c)}}catch(ne){Be(t,t.return,ne)}}function ug(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Fd(t,a)}catch(i){Be(e,e.return,i)}}}function sg(e,t,a){a.props=Za(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(i){Be(e,t,i)}}function Ui(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof a=="function"?e.refCleanup=a(i):a.current=i}}catch(s){Be(e,t,s)}}function sn(e,t){var a=e.ref,i=e.refCleanup;if(a!==null)if(typeof i=="function")try{i()}catch(s){Be(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(s){Be(e,t,s)}else a.current=null}function rg(e){var t=e.type,a=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&i.focus();break e;case"img":a.src?i.src=a.src:a.srcSet&&(i.srcset=a.srcSet)}}catch(s){Be(e,e.return,s)}}function cc(e,t,a){try{var i=e.stateNode;N1(i,e.type,a,t),i[ht]=t}catch(s){Be(e,e.return,s)}}function cg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&da(e.type)||e.tag===4}function fc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cg(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.tag===27&&da(e.type)||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 dc(e,t,a){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=bn));else if(i!==4&&(i===27&&da(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(dc(e,t,a),e=e.sibling;e!==null;)dc(e,t,a),e=e.sibling}function _u(e,t,a){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(i!==4&&(i===27&&da(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(_u(e,t,a),e=e.sibling;e!==null;)_u(e,t,a),e=e.sibling}function fg(e){var t=e.stateNode,a=e.memoizedProps;try{for(var i=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);dt(t,i,a),t[lt]=e,t[ht]=a}catch(c){Be(e,e.return,c)}}var Dn=!1,nt=!1,hc=!1,dg=typeof WeakSet=="function"?WeakSet:Set,ut=null;function l1(e,t){if(e=e.containerInfo,Hc=Xu,e=wd(e),or(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var i=a.getSelection&&a.getSelection();if(i&&i.rangeCount!==0){a=i.anchorNode;var s=i.anchorOffset,c=i.focusNode;i=i.focusOffset;try{a.nodeType,c.nodeType}catch{a=null;break e}var p=0,b=-1,O=-1,I=0,ne=0,le=e,K=null;t:for(;;){for(var F;le!==a||s!==0&&le.nodeType!==3||(b=p+s),le!==c||i!==0&&le.nodeType!==3||(O=p+i),le.nodeType===3&&(p+=le.nodeValue.length),(F=le.firstChild)!==null;)K=le,le=F;for(;;){if(le===e)break t;if(K===a&&++I===s&&(b=p),K===c&&++ne===i&&(O=p),(F=le.nextSibling)!==null)break;le=K,K=le.parentNode}le=F}a=b===-1||O===-1?null:{start:b,end:O}}else a=null}a=a||{start:0,end:0}}else a=null;for(jc={focusedElem:e,selectionRange:a},Xu=!1,ut=t;ut!==null;)if(t=ut,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,ut=e;else for(;ut!==null;){switch(t=ut,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)s=e[a],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,a=t,s=c.memoizedProps,c=c.memoizedState,i=a.stateNode;try{var he=Za(a.type,s);e=i.getSnapshotBeforeUpdate(he,c),i.__reactInternalSnapshotBeforeUpdate=e}catch(ve){Be(a,a.return,ve)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)qc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":qc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,ut=e;break}ut=t.return}}function hg(e,t,a){var i=a.flags;switch(a.tag){case 0:case 11:case 15:Rn(e,a),i&4&&ji(5,a);break;case 1:if(Rn(e,a),i&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(p){Be(a,a.return,p)}else{var s=Za(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(p){Be(a,a.return,p)}}i&64&&ug(a),i&512&&Ui(a,a.return);break;case 3:if(Rn(e,a),i&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Fd(e,t)}catch(p){Be(a,a.return,p)}}break;case 27:t===null&&i&4&&fg(a);case 26:case 5:Rn(e,a),t===null&&i&4&&rg(a),i&512&&Ui(a,a.return);break;case 12:Rn(e,a);break;case 31:Rn(e,a),i&4&&pg(e,a);break;case 13:Rn(e,a),i&4&&yg(e,a),i&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=h1.bind(null,a),R1(e,a))));break;case 22:if(i=a.memoizedState!==null||Dn,!i){t=t!==null&&t.memoizedState!==null||nt,s=Dn;var c=nt;Dn=i,(nt=t)&&!c?Hn(e,a,(a.subtreeFlags&8772)!==0):Rn(e,a),Dn=s,nt=c}break;case 30:break;default:Rn(e,a)}}function gg(e){var t=e.alternate;t!==null&&(e.alternate=null,gg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&si(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Qe=null,bt=!1;function On(e,t,a){for(a=a.child;a!==null;)mg(e,t,a),a=a.sibling}function mg(e,t,a){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(Na,a)}catch{}switch(a.tag){case 26:nt||sn(a,t),On(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:nt||sn(a,t);var i=Qe,s=bt;da(a.type)&&(Qe=a.stateNode,bt=!1),On(e,t,a),Qi(a.stateNode),Qe=i,bt=s;break;case 5:nt||sn(a,t);case 6:if(i=Qe,s=bt,Qe=null,On(e,t,a),Qe=i,bt=s,Qe!==null)if(bt)try{(Qe.nodeType===9?Qe.body:Qe.nodeName==="HTML"?Qe.ownerDocument.body:Qe).removeChild(a.stateNode)}catch(c){Be(a,t,c)}else try{Qe.removeChild(a.stateNode)}catch(c){Be(a,t,c)}break;case 18:Qe!==null&&(bt?(e=Qe,um(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Xl(e)):um(Qe,a.stateNode));break;case 4:i=Qe,s=bt,Qe=a.stateNode.containerInfo,bt=!0,On(e,t,a),Qe=i,bt=s;break;case 0:case 11:case 14:case 15:ia(2,a,t),nt||ia(4,a,t),On(e,t,a);break;case 1:nt||(sn(a,t),i=a.stateNode,typeof i.componentWillUnmount=="function"&&sg(a,t,i)),On(e,t,a);break;case 21:On(e,t,a);break;case 22:nt=(i=nt)||a.memoizedState!==null,On(e,t,a),nt=i;break;default:On(e,t,a)}}function pg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Xl(e)}catch(a){Be(t,t.return,a)}}}function yg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Xl(e)}catch(a){Be(t,t.return,a)}}function i1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new dg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new dg),t;default:throw Error(u(435,e.tag))}}function Eu(e,t){var a=i1(e);t.forEach(function(i){if(!a.has(i)){a.add(i);var s=g1.bind(null,e,i);i.then(s,s)}})}function _t(e,t){var a=t.deletions;if(a!==null)for(var i=0;i<a.length;i++){var s=a[i],c=e,p=t,b=p;e:for(;b!==null;){switch(b.tag){case 27:if(da(b.type)){Qe=b.stateNode,bt=!1;break e}break;case 5:Qe=b.stateNode,bt=!1;break e;case 3:case 4:Qe=b.stateNode.containerInfo,bt=!0;break e}b=b.return}if(Qe===null)throw Error(u(160));mg(c,p,s),Qe=null,bt=!1,c=s.alternate,c!==null&&(c.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)vg(t,e),t=t.sibling}var Jt=null;function vg(e,t){var a=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:_t(t,e),Et(e),i&4&&(ia(3,e,e.return),ji(3,e),ia(5,e,e.return));break;case 1:_t(t,e),Et(e),i&512&&(nt||a===null||sn(a,a.return)),i&64&&Dn&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?i:a.concat(i))));break;case 26:var s=Jt;if(_t(t,e),Et(e),i&512&&(nt||a===null||sn(a,a.return)),i&4){var c=a!==null?a.memoizedState:null;if(i=e.memoizedState,a===null)if(i===null)if(e.stateNode===null){e:{i=e.type,a=e.memoizedProps,s=s.ownerDocument||s;t:switch(i){case"title":c=s.getElementsByTagName("title")[0],(!c||c[Ta]||c[lt]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=s.createElement(i),s.head.insertBefore(c,s.querySelector("head > title"))),dt(c,i,a),c[lt]=e,We(c),i=c;break e;case"link":var p=vm("link","href",s).get(i+(a.href||""));if(p){for(var b=0;b<p.length;b++)if(c=p[b],c.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&c.getAttribute("rel")===(a.rel==null?null:a.rel)&&c.getAttribute("title")===(a.title==null?null:a.title)&&c.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){p.splice(b,1);break t}}c=s.createElement(i),dt(c,i,a),s.head.appendChild(c);break;case"meta":if(p=vm("meta","content",s).get(i+(a.content||""))){for(b=0;b<p.length;b++)if(c=p[b],c.getAttribute("content")===(a.content==null?null:""+a.content)&&c.getAttribute("name")===(a.name==null?null:a.name)&&c.getAttribute("property")===(a.property==null?null:a.property)&&c.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&c.getAttribute("charset")===(a.charSet==null?null:a.charSet)){p.splice(b,1);break t}}c=s.createElement(i),dt(c,i,a),s.head.appendChild(c);break;default:throw Error(u(468,i))}c[lt]=e,We(c),i=c}e.stateNode=i}else xm(s,e.type,e.stateNode);else e.stateNode=ym(s,i,e.memoizedProps);else c!==i?(c===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):c.count--,i===null?xm(s,e.type,e.stateNode):ym(s,i,e.memoizedProps)):i===null&&e.stateNode!==null&&cc(e,e.memoizedProps,a.memoizedProps)}break;case 27:_t(t,e),Et(e),i&512&&(nt||a===null||sn(a,a.return)),a!==null&&i&4&&cc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(_t(t,e),Et(e),i&512&&(nt||a===null||sn(a,a.return)),e.flags&32){s=e.stateNode;try{dl(s,"")}catch(he){Be(e,e.return,he)}}i&4&&e.stateNode!=null&&(s=e.memoizedProps,cc(e,s,a!==null?a.memoizedProps:s)),i&1024&&(hc=!0);break;case 6:if(_t(t,e),Et(e),i&4){if(e.stateNode===null)throw Error(u(162));i=e.memoizedProps,a=e.stateNode;try{a.nodeValue=i}catch(he){Be(e,e.return,he)}}break;case 3:if(Lu=null,s=Jt,Jt=Bu(t.containerInfo),_t(t,e),Jt=s,Et(e),i&4&&a!==null&&a.memoizedState.isDehydrated)try{Xl(t.containerInfo)}catch(he){Be(e,e.return,he)}hc&&(hc=!1,xg(e));break;case 4:i=Jt,Jt=Bu(e.stateNode.containerInfo),_t(t,e),Et(e),Jt=i;break;case 12:_t(t,e),Et(e);break;case 31:_t(t,e),Et(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Eu(e,i)));break;case 13:_t(t,e),Et(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Nu=st()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Eu(e,i)));break;case 22:s=e.memoizedState!==null;var O=a!==null&&a.memoizedState!==null,I=Dn,ne=nt;if(Dn=I||s,nt=ne||O,_t(t,e),nt=ne,Dn=I,Et(e),i&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(a===null||O||Dn||nt||Qa(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){O=a=t;try{if(c=O.stateNode,s)p=c.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none";else{b=O.stateNode;var le=O.memoizedProps.style,K=le!=null&&le.hasOwnProperty("display")?le.display:null;b.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(he){Be(O,O.return,he)}}}else if(t.tag===6){if(a===null){O=t;try{O.stateNode.nodeValue=s?"":O.memoizedProps}catch(he){Be(O,O.return,he)}}}else if(t.tag===18){if(a===null){O=t;try{var F=O.stateNode;s?sm(F,!0):sm(O.stateNode,!1)}catch(he){Be(O,O.return,he)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(a=i.retryQueue,a!==null&&(i.retryQueue=null,Eu(e,a))));break;case 19:_t(t,e),Et(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Eu(e,i)));break;case 30:break;case 21:break;default:_t(t,e),Et(e)}}function Et(e){var t=e.flags;if(t&2){try{for(var a,i=e.return;i!==null;){if(cg(i)){a=i;break}i=i.return}if(a==null)throw Error(u(160));switch(a.tag){case 27:var s=a.stateNode,c=fc(e);_u(e,c,s);break;case 5:var p=a.stateNode;a.flags&32&&(dl(p,""),a.flags&=-33);var b=fc(e);_u(e,b,p);break;case 3:case 4:var O=a.stateNode.containerInfo,I=fc(e);dc(e,I,O);break;default:throw Error(u(161))}}catch(ne){Be(e,e.return,ne)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function xg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;xg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Rn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)hg(e,t.alternate,t),t=t.sibling}function Qa(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ia(4,t,t.return),Qa(t);break;case 1:sn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&sg(t,t.return,a),Qa(t);break;case 27:Qi(t.stateNode);case 26:case 5:sn(t,t.return),Qa(t);break;case 22:t.memoizedState===null&&Qa(t);break;case 30:Qa(t);break;default:Qa(t)}e=e.sibling}}function Hn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,s=e,c=t,p=c.flags;switch(c.tag){case 0:case 11:case 15:Hn(s,c,a),ji(4,c);break;case 1:if(Hn(s,c,a),i=c,s=i.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(I){Be(i,i.return,I)}if(i=c,s=i.updateQueue,s!==null){var b=i.stateNode;try{var O=s.shared.hiddenCallbacks;if(O!==null)for(s.shared.hiddenCallbacks=null,s=0;s<O.length;s++)Jd(O[s],b)}catch(I){Be(i,i.return,I)}}a&&p&64&&ug(c),Ui(c,c.return);break;case 27:fg(c);case 26:case 5:Hn(s,c,a),a&&i===null&&p&4&&rg(c),Ui(c,c.return);break;case 12:Hn(s,c,a);break;case 31:Hn(s,c,a),a&&p&4&&pg(s,c);break;case 13:Hn(s,c,a),a&&p&4&&yg(s,c);break;case 22:c.memoizedState===null&&Hn(s,c,a),Ui(c,c.return);break;case 30:break;default:Hn(s,c,a)}t=t.sibling}}function gc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&_i(a))}function mc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_i(e))}function Ft(e,t,a,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Sg(e,t,a,i),t=t.sibling}function Sg(e,t,a,i){var s=t.flags;switch(t.tag){case 0:case 11:case 15:Ft(e,t,a,i),s&2048&&ji(9,t);break;case 1:Ft(e,t,a,i);break;case 3:Ft(e,t,a,i),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&_i(e)));break;case 12:if(s&2048){Ft(e,t,a,i),e=t.stateNode;try{var c=t.memoizedProps,p=c.id,b=c.onPostCommit;typeof b=="function"&&b(p,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(O){Be(t,t.return,O)}}else Ft(e,t,a,i);break;case 31:Ft(e,t,a,i);break;case 13:Ft(e,t,a,i);break;case 23:break;case 22:c=t.stateNode,p=t.alternate,t.memoizedState!==null?c._visibility&2?Ft(e,t,a,i):Bi(e,t):c._visibility&2?Ft(e,t,a,i):(c._visibility|=2,Ol(e,t,a,i,(t.subtreeFlags&10256)!==0||!1)),s&2048&&gc(p,t);break;case 24:Ft(e,t,a,i),s&2048&&mc(t.alternate,t);break;default:Ft(e,t,a,i)}}function Ol(e,t,a,i,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,p=t,b=a,O=i,I=p.flags;switch(p.tag){case 0:case 11:case 15:Ol(c,p,b,O,s),ji(8,p);break;case 23:break;case 22:var ne=p.stateNode;p.memoizedState!==null?ne._visibility&2?Ol(c,p,b,O,s):Bi(c,p):(ne._visibility|=2,Ol(c,p,b,O,s)),s&&I&2048&&gc(p.alternate,p);break;case 24:Ol(c,p,b,O,s),s&&I&2048&&mc(p.alternate,p);break;default:Ol(c,p,b,O,s)}t=t.sibling}}function Bi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,i=t,s=i.flags;switch(i.tag){case 22:Bi(a,i),s&2048&&gc(i.alternate,i);break;case 24:Bi(a,i),s&2048&&mc(i.alternate,i);break;default:Bi(a,i)}t=t.sibling}}var qi=8192;function Rl(e,t,a){if(e.subtreeFlags&qi)for(e=e.child;e!==null;)bg(e,t,a),e=e.sibling}function bg(e,t,a){switch(e.tag){case 26:Rl(e,t,a),e.flags&qi&&e.memoizedState!==null&&Q1(a,Jt,e.memoizedState,e.memoizedProps);break;case 5:Rl(e,t,a);break;case 3:case 4:var i=Jt;Jt=Bu(e.stateNode.containerInfo),Rl(e,t,a),Jt=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=qi,qi=16777216,Rl(e,t,a),qi=i):Rl(e,t,a));break;default:Rl(e,t,a)}}function _g(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Li(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var i=t[a];ut=i,wg(i,e)}_g(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Eg(e),e=e.sibling}function Eg(e){switch(e.tag){case 0:case 11:case 15:Li(e),e.flags&2048&&ia(9,e,e.return);break;case 3:Li(e);break;case 12:Li(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,wu(e)):Li(e);break;default:Li(e)}}function wu(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var i=t[a];ut=i,wg(i,e)}_g(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ia(8,t,t.return),wu(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,wu(t));break;default:wu(t)}e=e.sibling}}function wg(e,t){for(;ut!==null;){var a=ut;switch(a.tag){case 0:case 11:case 15:ia(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var i=a.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:_i(a.memoizedState.cache)}if(i=a.child,i!==null)i.return=a,ut=i;else e:for(a=e;ut!==null;){i=ut;var s=i.sibling,c=i.return;if(gg(i),i===a){ut=null;break e}if(s!==null){s.return=c,ut=s;break e}ut=c}}}var o1={getCacheForType:function(e){var t=ct(Pe),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return ct(Pe).controller.signal}},u1=typeof WeakMap=="function"?WeakMap:Map,He=0,Ge=null,Ne=null,Te=0,Ue=0,Rt=null,oa=!1,Hl=!1,pc=!1,jn=0,Ke=0,ua=0,$a=0,yc=0,Ht=0,jl=0,Yi=null,wt=null,vc=!1,Nu=0,Ng=0,Mu=1/0,Au=null,sa=null,it=0,ra=null,Ul=null,Un=0,xc=0,Sc=null,Mg=null,Vi=0,bc=null;function jt(){return(He&2)!==0&&Te!==0?Te&-Te:M.T!==null?Ac():Do()}function Ag(){if(Ht===0)if((Te&536870912)===0||Ce){var e=il;il<<=1,(il&3932160)===0&&(il=262144),Ht=e}else Ht=536870912;return e=Dt.current,e!==null&&(e.flags|=32),Ht}function Nt(e,t,a){(e===Ge&&(Ue===2||Ue===9)||e.cancelPendingCommit!==null)&&(Bl(e,0),ca(e,Te,Ht,!1)),Aa(e,a),((He&2)===0||e!==Ge)&&(e===Ge&&((He&2)===0&&($a|=a),Ke===4&&ca(e,Te,Ht,!1)),rn(e))}function Tg(e,t,a){if((He&6)!==0)throw Error(u(327));var i=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Ma(e,t),s=i?c1(e,t):Ec(e,t,!0),c=i;do{if(s===0){Hl&&!i&&ca(e,t,0,!1);break}else{if(a=e.current.alternate,c&&!s1(a)){s=Ec(e,t,!1),c=!1;continue}if(s===2){if(c=t,e.errorRecoveryDisabledLanes&c)var p=0;else p=e.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){t=p;e:{var b=e;s=Yi;var O=b.current.memoizedState.isDehydrated;if(O&&(Bl(b,p).flags|=256),p=Ec(b,p,!1),p!==2){if(pc&&!O){b.errorRecoveryDisabledLanes|=c,$a|=c,s=4;break e}c=wt,wt=s,c!==null&&(wt===null?wt=c:wt.push.apply(wt,c))}s=p}if(c=!1,s!==2)continue}}if(s===1){Bl(e,0),ca(e,t,0,!0);break}e:{switch(i=e,c=s,c){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:ca(i,t,Ht,!oa);break e;case 2:wt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(s=Nu+300-st(),10<s)){if(ca(i,t,Ht,!oa),ul(i,0,!0)!==0)break e;Un=t,i.timeoutHandle=im(zg.bind(null,i,a,wt,Au,vc,t,Ht,$a,jl,oa,c,"Throttled",-0,0),s);break e}zg(i,a,wt,Au,vc,t,Ht,$a,jl,oa,c,null,-0,0)}}break}while(!0);rn(e)}function zg(e,t,a,i,s,c,p,b,O,I,ne,le,K,F){if(e.timeoutHandle=-1,le=t.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bn},bg(t,c,le);var he=(c&62914560)===c?Nu-st():(c&4194048)===c?Ng-st():0;if(he=$1(le,he),he!==null){Un=c,e.cancelPendingCommit=he(Bg.bind(null,e,t,c,a,i,s,p,b,O,ne,le,null,K,F)),ca(e,c,p,!I);return}}Bg(e,t,c,a,i,s,p,b,O)}function s1(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var i=0;i<a.length;i++){var s=a[i],c=s.getSnapshot;s=s.value;try{if(!zt(c(),s))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;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 ca(e,t,a,i){t&=~yc,t&=~$a,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var s=t;0<s;){var c=31-pt(s),p=1<<c;i[c]=-1,s&=~p}a!==0&&To(e,a,t)}function Tu(){return(He&6)===0?(Gi(0),!1):!0}function _c(){if(Ne!==null){if(Ue===0)var e=Ne.return;else e=Ne,Nn=Ba=null,qr(e),Al=null,wi=0,e=Ne;for(;e!==null;)og(e.alternate,e),e=e.return;Ne=null}}function Bl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,T1(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Un=0,_c(),Ge=e,Ne=a=En(e.current,null),Te=t,Ue=0,Rt=null,oa=!1,Hl=Ma(e,t),pc=!1,jl=Ht=yc=$a=ua=Ke=0,wt=Yi=null,vc=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var s=31-pt(i),c=1<<s;t|=e[s],i&=~c}return jn=t,Ko(),a}function Cg(e,t){_e=null,M.H=Oi,t===Ml||t===au?(t=$d(),Ue=3):t===Mr?(t=$d(),Ue=4):Ue=t===ec?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Rt=t,Ne===null&&(Ke=1,yu(e,Lt(t,e.current)))}function Dg(){var e=Dt.current;return e===null?!0:(Te&4194048)===Te?Xt===null:(Te&62914560)===Te||(Te&536870912)!==0?e===Xt:!1}function Og(){var e=M.H;return M.H=Oi,e===null?Oi:e}function Rg(){var e=M.A;return M.A=o1,e}function zu(){Ke=4,oa||(Te&4194048)!==Te&&Dt.current!==null||(Hl=!0),(ua&134217727)===0&&($a&134217727)===0||Ge===null||ca(Ge,Te,Ht,!1)}function Ec(e,t,a){var i=He;He|=2;var s=Og(),c=Rg();(Ge!==e||Te!==t)&&(Au=null,Bl(e,t)),t=!1;var p=Ke;e:do try{if(Ue!==0&&Ne!==null){var b=Ne,O=Rt;switch(Ue){case 8:_c(),p=6;break e;case 3:case 2:case 9:case 6:Dt.current===null&&(t=!0);var I=Ue;if(Ue=0,Rt=null,ql(e,b,O,I),a&&Hl){p=0;break e}break;default:I=Ue,Ue=0,Rt=null,ql(e,b,O,I)}}r1(),p=Ke;break}catch(ne){Cg(e,ne)}while(!0);return t&&e.shellSuspendCounter++,Nn=Ba=null,He=i,M.H=s,M.A=c,Ne===null&&(Ge=null,Te=0,Ko()),p}function r1(){for(;Ne!==null;)Hg(Ne)}function c1(e,t){var a=He;He|=2;var i=Og(),s=Rg();Ge!==e||Te!==t?(Au=null,Mu=st()+500,Bl(e,t)):Hl=Ma(e,t);e:do try{if(Ue!==0&&Ne!==null){t=Ne;var c=Rt;t:switch(Ue){case 1:Ue=0,Rt=null,ql(e,t,c,1);break;case 2:case 9:if(Zd(c)){Ue=0,Rt=null,jg(t);break}t=function(){Ue!==2&&Ue!==9||Ge!==e||(Ue=7),rn(e)},c.then(t,t);break e;case 3:Ue=7;break e;case 4:Ue=5;break e;case 7:Zd(c)?(Ue=0,Rt=null,jg(t)):(Ue=0,Rt=null,ql(e,t,c,7));break;case 5:var p=null;switch(Ne.tag){case 26:p=Ne.memoizedState;case 5:case 27:var b=Ne;if(p?Sm(p):b.stateNode.complete){Ue=0,Rt=null;var O=b.sibling;if(O!==null)Ne=O;else{var I=b.return;I!==null?(Ne=I,Cu(I)):Ne=null}break t}}Ue=0,Rt=null,ql(e,t,c,5);break;case 6:Ue=0,Rt=null,ql(e,t,c,6);break;case 8:_c(),Ke=6;break e;default:throw Error(u(462))}}f1();break}catch(ne){Cg(e,ne)}while(!0);return Nn=Ba=null,M.H=i,M.A=s,He=a,Ne!==null?0:(Ge=null,Te=0,Ko(),Ke)}function f1(){for(;Ne!==null&&!_a();)Hg(Ne)}function Hg(e){var t=lg(e.alternate,e,jn);e.memoizedProps=e.pendingProps,t===null?Cu(e):Ne=t}function jg(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Wh(a,t,t.pendingProps,t.type,void 0,Te);break;case 11:t=Wh(a,t,t.pendingProps,t.type.render,t.ref,Te);break;case 5:qr(t);default:og(a,t),t=Ne=Rd(t,jn),t=lg(a,t,jn)}e.memoizedProps=e.pendingProps,t===null?Cu(e):Ne=t}function ql(e,t,a,i){Nn=Ba=null,qr(t),Al=null,wi=0;var s=t.return;try{if(Pv(e,s,t,a,Te)){Ke=1,yu(e,Lt(a,e.current)),Ne=null;return}}catch(c){if(s!==null)throw Ne=s,c;Ke=1,yu(e,Lt(a,e.current)),Ne=null;return}t.flags&32768?(Ce||i===1?e=!0:Hl||(Te&536870912)!==0?e=!1:(oa=e=!0,(i===2||i===9||i===3||i===6)&&(i=Dt.current,i!==null&&i.tag===13&&(i.flags|=16384))),Ug(t,e)):Cu(t)}function Cu(e){var t=e;do{if((t.flags&32768)!==0){Ug(t,oa);return}e=t.return;var a=n1(t.alternate,t,jn);if(a!==null){Ne=a;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);Ke===0&&(Ke=5)}function Ug(e,t){do{var a=a1(e.alternate,e);if(a!==null){a.flags&=32767,Ne=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ne=e;return}Ne=e=a}while(e!==null);Ke=6,Ne=null}function Bg(e,t,a,i,s,c,p,b,O){e.cancelPendingCommit=null;do Du();while(it!==0);if((He&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(c=t.lanes|t.childLanes,c|=fr,Vs(e,a,c,p,b,O),e===Ge&&(Ne=Ge=null,Te=0),Ul=t,ra=e,Un=a,xc=c,Sc=s,Mg=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,m1(wa,function(){return Gg(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=M.T,M.T=null,s=H.p,H.p=2,p=He,He|=4;try{l1(e,t,a)}finally{He=p,H.p=s,M.T=i}}it=1,qg(),Lg(),Yg()}}function qg(){if(it===1){it=0;var e=ra,t=Ul,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=M.T,M.T=null;var i=H.p;H.p=2;var s=He;He|=4;try{vg(t,e);var c=jc,p=wd(e.containerInfo),b=c.focusedElem,O=c.selectionRange;if(p!==b&&b&&b.ownerDocument&&Ed(b.ownerDocument.documentElement,b)){if(O!==null&&or(b)){var I=O.start,ne=O.end;if(ne===void 0&&(ne=I),"selectionStart"in b)b.selectionStart=I,b.selectionEnd=Math.min(ne,b.value.length);else{var le=b.ownerDocument||document,K=le&&le.defaultView||window;if(K.getSelection){var F=K.getSelection(),he=b.textContent.length,ve=Math.min(O.start,he),Ve=O.end===void 0?ve:Math.min(O.end,he);!F.extend&&ve>Ve&&(p=Ve,Ve=ve,ve=p);var G=_d(b,ve),B=_d(b,Ve);if(G&&B&&(F.rangeCount!==1||F.anchorNode!==G.node||F.anchorOffset!==G.offset||F.focusNode!==B.node||F.focusOffset!==B.offset)){var k=le.createRange();k.setStart(G.node,G.offset),F.removeAllRanges(),ve>Ve?(F.addRange(k),F.extend(B.node,B.offset)):(k.setEnd(B.node,B.offset),F.addRange(k))}}}}for(le=[],F=b;F=F.parentNode;)F.nodeType===1&&le.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<le.length;b++){var ae=le[b];ae.element.scrollLeft=ae.left,ae.element.scrollTop=ae.top}}Xu=!!Hc,jc=Hc=null}finally{He=s,H.p=i,M.T=a}}e.current=t,it=2}}function Lg(){if(it===2){it=0;var e=ra,t=Ul,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=M.T,M.T=null;var i=H.p;H.p=2;var s=He;He|=4;try{hg(e,t.alternate,t)}finally{He=s,H.p=i,M.T=a}}it=3}}function Yg(){if(it===4||it===3){it=0,Ea();var e=ra,t=Ul,a=Un,i=Mg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?it=5:(it=0,Ul=ra=null,Vg(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(sa=null),ui(a),t=t.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(Na,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=M.T,s=H.p,H.p=2,M.T=null;try{for(var c=e.onRecoverableError,p=0;p<i.length;p++){var b=i[p];c(b.value,{componentStack:b.stack})}}finally{M.T=t,H.p=s}}(Un&3)!==0&&Du(),rn(e),s=e.pendingLanes,(a&261930)!==0&&(s&42)!==0?e===bc?Vi++:(Vi=0,bc=e):Vi=0,Gi(0)}}function Vg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,_i(t)))}function Du(){return qg(),Lg(),Yg(),Gg()}function Gg(){if(it!==5)return!1;var e=ra,t=xc;xc=0;var a=ui(Un),i=M.T,s=H.p;try{H.p=32>a?32:a,M.T=null,a=Sc,Sc=null;var c=ra,p=Un;if(it=0,Ul=ra=null,Un=0,(He&6)!==0)throw Error(u(331));var b=He;if(He|=4,Eg(c.current),Sg(c,c.current,p,a),He=b,Gi(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(Na,c)}catch{}return!0}finally{H.p=s,M.T=i,Vg(e,t)}}function Xg(e,t,a){t=Lt(a,t),t=Pr(e.stateNode,t,2),e=na(e,t,2),e!==null&&(Aa(e,2),rn(e))}function Be(e,t,a){if(e.tag===3)Xg(e,e,a);else for(;t!==null;){if(t.tag===3){Xg(t,e,a);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(sa===null||!sa.has(i))){e=Lt(a,e),a=Zh(2),i=na(t,a,2),i!==null&&(Qh(a,i,t,e),Aa(i,2),rn(i));break}}t=t.return}}function wc(e,t,a){var i=e.pingCache;if(i===null){i=e.pingCache=new u1;var s=new Set;i.set(t,s)}else s=i.get(t),s===void 0&&(s=new Set,i.set(t,s));s.has(a)||(pc=!0,s.add(a),e=d1.bind(null,e,t,a),t.then(e,e))}function d1(e,t,a){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ge===e&&(Te&a)===a&&(Ke===4||Ke===3&&(Te&62914560)===Te&&300>st()-Nu?(He&2)===0&&Bl(e,0):yc|=a,jl===Te&&(jl=0)),rn(e)}function Zg(e,t){t===0&&(t=Ao()),e=Ha(e,t),e!==null&&(Aa(e,t),rn(e))}function h1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Zg(e,a)}function g1(e,t){var a=0;switch(e.tag){case 31:case 13:var i=e.stateNode,s=e.memoizedState;s!==null&&(a=s.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(t),Zg(e,a)}function m1(e,t){return kt(e,t)}var Ou=null,Ll=null,Nc=!1,Ru=!1,Mc=!1,fa=0;function rn(e){e!==Ll&&e.next===null&&(Ll===null?Ou=Ll=e:Ll=Ll.next=e),Ru=!0,Nc||(Nc=!0,y1())}function Gi(e,t){if(!Mc&&Ru){Mc=!0;do for(var a=!1,i=Ou;i!==null;){if(e!==0){var s=i.pendingLanes;if(s===0)var c=0;else{var p=i.suspendedLanes,b=i.pingedLanes;c=(1<<31-pt(42|e)+1)-1,c&=s&~(p&~b),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(a=!0,Ig(i,c))}else c=Te,c=ul(i,i===Ge?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||Ma(i,c)||(a=!0,Ig(i,c));i=i.next}while(a);Mc=!1}}function p1(){Qg()}function Qg(){Ru=Nc=!1;var e=0;fa!==0&&A1()&&(e=fa);for(var t=st(),a=null,i=Ou;i!==null;){var s=i.next,c=$g(i,t);c===0?(i.next=null,a===null?Ou=s:a.next=s,s===null&&(Ll=a)):(a=i,(e!==0||(c&3)!==0)&&(Ru=!0)),i=s}it!==0&&it!==5||Gi(e),fa!==0&&(fa=0)}function $g(e,t){for(var a=e.suspendedLanes,i=e.pingedLanes,s=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var p=31-pt(c),b=1<<p,O=s[p];O===-1?((b&a)===0||(b&i)!==0)&&(s[p]=Ys(b,t)):O<=t&&(e.expiredLanes|=b),c&=~b}if(t=Ge,a=Te,a=ul(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,a===0||e===t&&(Ue===2||Ue===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&mn(i),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Ma(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(i!==null&&mn(i),ui(a)){case 2:case 8:a=Xn;break;case 32:a=wa;break;case 268435456:a=al;break;default:a=wa}return i=kg.bind(null,e),a=kt(a,i),e.callbackPriority=t,e.callbackNode=a,t}return i!==null&&i!==null&&mn(i),e.callbackPriority=2,e.callbackNode=null,2}function kg(e,t){if(it!==0&&it!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Du()&&e.callbackNode!==a)return null;var i=Te;return i=ul(e,e===Ge?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Tg(e,i,t),$g(e,st()),e.callbackNode!=null&&e.callbackNode===a?kg.bind(null,e):null)}function Ig(e,t){if(Du())return null;Tg(e,t,!0)}function y1(){z1(function(){(He&6)!==0?kt(pn,p1):Qg()})}function Ac(){if(fa===0){var e=wl;e===0&&(e=ll,ll<<=1,(ll&261888)===0&&(ll=256)),fa=e}return fa}function Kg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Vo(""+e)}function Jg(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function v1(e,t,a,i,s){if(t==="submit"&&a&&a.stateNode===s){var c=Kg((s[ht]||null).action),p=i.submitter;p&&(t=(t=p[ht]||null)?Kg(t.formAction):p.getAttribute("formAction"),t!==null&&(c=t,p=null));var b=new Qo("action","action",null,i,s);e.push({event:b,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(fa!==0){var O=p?Jg(s,p):new FormData(s);kr(a,{pending:!0,data:O,method:s.method,action:c},null,O)}}else typeof c=="function"&&(b.preventDefault(),O=p?Jg(s,p):new FormData(s),kr(a,{pending:!0,data:O,method:s.method,action:c},c,O))},currentTarget:s}]})}}for(var Tc=0;Tc<cr.length;Tc++){var zc=cr[Tc],x1=zc.toLowerCase(),S1=zc[0].toUpperCase()+zc.slice(1);Kt(x1,"on"+S1)}Kt(Ad,"onAnimationEnd"),Kt(Td,"onAnimationIteration"),Kt(zd,"onAnimationStart"),Kt("dblclick","onDoubleClick"),Kt("focusin","onFocus"),Kt("focusout","onBlur"),Kt(Uv,"onTransitionRun"),Kt(Bv,"onTransitionStart"),Kt(qv,"onTransitionCancel"),Kt(Cd,"onTransitionEnd"),In("onMouseEnter",["mouseout","mouseover"]),In("onMouseLeave",["mouseout","mouseover"]),In("onPointerEnter",["pointerout","pointerover"]),In("onPointerLeave",["pointerout","pointerover"]),xn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),xn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),xn("onBeforeInput",["compositionend","keypress","textInput","paste"]),xn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),xn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),xn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Xi="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(" "),b1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Xi));function Fg(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var i=e[a],s=i.event;i=i.listeners;e:{var c=void 0;if(t)for(var p=i.length-1;0<=p;p--){var b=i[p],O=b.instance,I=b.currentTarget;if(b=b.listener,O!==c&&s.isPropagationStopped())break e;c=b,s.currentTarget=I;try{c(s)}catch(ne){Io(ne)}s.currentTarget=null,c=O}else for(p=0;p<i.length;p++){if(b=i[p],O=b.instance,I=b.currentTarget,b=b.listener,O!==c&&s.isPropagationStopped())break e;c=b,s.currentTarget=I;try{c(s)}catch(ne){Io(ne)}s.currentTarget=null,c=O}}}}function Me(e,t){var a=t[sl];a===void 0&&(a=t[sl]=new Set);var i=e+"__bubble";a.has(i)||(Wg(t,e,2,!1),a.add(i))}function Cc(e,t,a){var i=0;t&&(i|=4),Wg(a,e,i,t)}var Hu="_reactListening"+Math.random().toString(36).slice(2);function Dc(e){if(!e[Hu]){e[Hu]=!0,jo.forEach(function(a){a!=="selectionchange"&&(b1.has(a)||Cc(a,!1,e),Cc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hu]||(t[Hu]=!0,Cc("selectionchange",!1,t))}}function Wg(e,t,a,i){switch(Am(t)){case 2:var s=K1;break;case 8:s=J1;break;default:s=$c}a=s.bind(null,t,a,e),s=void 0,!Fs||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),i?s!==void 0?e.addEventListener(t,a,{capture:!0,passive:s}):e.addEventListener(t,a,!0):s!==void 0?e.addEventListener(t,a,{passive:s}):e.addEventListener(t,a,!1)}function Oc(e,t,a,i,s){var c=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var p=i.tag;if(p===3||p===4){var b=i.stateNode.containerInfo;if(b===s)break;if(p===4)for(p=i.return;p!==null;){var O=p.tag;if((O===3||O===4)&&p.stateNode.containerInfo===s)return;p=p.return}for(;b!==null;){if(p=Zn(b),p===null)return;if(O=p.tag,O===5||O===6||O===26||O===27){i=c=p;continue e}b=b.parentNode}}i=i.return}ad(function(){var I=c,ne=Ks(a),le=[];e:{var K=Dd.get(e);if(K!==void 0){var F=Qo,he=e;switch(e){case"keypress":if(Xo(a)===0)break e;case"keydown":case"keyup":F=gv;break;case"focusin":he="focus",F=tr;break;case"focusout":he="blur",F=tr;break;case"beforeblur":case"afterblur":F=tr;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":F=od;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=nv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=yv;break;case Ad:case Td:case zd:F=iv;break;case Cd:F=xv;break;case"scroll":case"scrollend":F=ev;break;case"wheel":F=bv;break;case"copy":case"cut":case"paste":F=uv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=sd;break;case"toggle":case"beforetoggle":F=Ev}var ve=(t&4)!==0,Ve=!ve&&(e==="scroll"||e==="scrollend"),G=ve?K!==null?K+"Capture":null:K;ve=[];for(var B=I,k;B!==null;){var ae=B;if(k=ae.stateNode,ae=ae.tag,ae!==5&&ae!==26&&ae!==27||k===null||G===null||(ae=fi(B,G),ae!=null&&ve.push(Zi(B,ae,k))),Ve)break;B=B.return}0<ve.length&&(K=new F(K,he,null,a,ne),le.push({event:K,listeners:ve}))}}if((t&7)===0){e:{if(K=e==="mouseover"||e==="pointerover",F=e==="mouseout"||e==="pointerout",K&&a!==Is&&(he=a.relatedTarget||a.fromElement)&&(Zn(he)||he[vn]))break e;if((F||K)&&(K=ne.window===ne?ne:(K=ne.ownerDocument)?K.defaultView||K.parentWindow:window,F?(he=a.relatedTarget||a.toElement,F=I,he=he?Zn(he):null,he!==null&&(Ve=f(he),ve=he.tag,he!==Ve||ve!==5&&ve!==27&&ve!==6)&&(he=null)):(F=null,he=I),F!==he)){if(ve=od,ae="onMouseLeave",G="onMouseEnter",B="mouse",(e==="pointerout"||e==="pointerover")&&(ve=sd,ae="onPointerLeave",G="onPointerEnter",B="pointer"),Ve=F==null?K:$n(F),k=he==null?K:$n(he),K=new ve(ae,B+"leave",F,a,ne),K.target=Ve,K.relatedTarget=k,ae=null,Zn(ne)===I&&(ve=new ve(G,B+"enter",he,a,ne),ve.target=k,ve.relatedTarget=Ve,ae=ve),Ve=ae,F&&he)t:{for(ve=_1,G=F,B=he,k=0,ae=G;ae;ae=ve(ae))k++;ae=0;for(var pe=B;pe;pe=ve(pe))ae++;for(;0<k-ae;)G=ve(G),k--;for(;0<ae-k;)B=ve(B),ae--;for(;k--;){if(G===B||B!==null&&G===B.alternate){ve=G;break t}G=ve(G),B=ve(B)}ve=null}else ve=null;F!==null&&Pg(le,K,F,ve,!1),he!==null&&Ve!==null&&Pg(le,Ve,he,ve,!0)}}e:{if(K=I?$n(I):window,F=K.nodeName&&K.nodeName.toLowerCase(),F==="select"||F==="input"&&K.type==="file")var Oe=pd;else if(gd(K))if(yd)Oe=Rv;else{Oe=Dv;var ge=Cv}else F=K.nodeName,!F||F.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?I&&ks(I.elementType)&&(Oe=pd):Oe=Ov;if(Oe&&(Oe=Oe(e,I))){md(le,Oe,a,ne);break e}ge&&ge(e,K,I),e==="focusout"&&I&&K.type==="number"&&I.memoizedProps.value!=null&&ci(K,"number",K.value)}switch(ge=I?$n(I):window,e){case"focusin":(gd(ge)||ge.contentEditable==="true")&&(pl=ge,ur=I,xi=null);break;case"focusout":xi=ur=pl=null;break;case"mousedown":sr=!0;break;case"contextmenu":case"mouseup":case"dragend":sr=!1,Nd(le,a,ne);break;case"selectionchange":if(jv)break;case"keydown":case"keyup":Nd(le,a,ne)}var we;if(ar)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else ml?dd(e,a)&&(ze="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ze="onCompositionStart");ze&&(rd&&a.locale!=="ko"&&(ml||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&ml&&(we=ld()):(Kn=ne,Ws="value"in Kn?Kn.value:Kn.textContent,ml=!0)),ge=ju(I,ze),0<ge.length&&(ze=new ud(ze,e,null,a,ne),le.push({event:ze,listeners:ge}),we?ze.data=we:(we=hd(a),we!==null&&(ze.data=we)))),(we=Nv?Mv(e,a):Av(e,a))&&(ze=ju(I,"onBeforeInput"),0<ze.length&&(ge=new ud("onBeforeInput","beforeinput",null,a,ne),le.push({event:ge,listeners:ze}),ge.data=we)),v1(le,e,I,a,ne)}Fg(le,t)})}function Zi(e,t,a){return{instance:e,listener:t,currentTarget:a}}function ju(e,t){for(var a=t+"Capture",i=[];e!==null;){var s=e,c=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||c===null||(s=fi(e,a),s!=null&&i.unshift(Zi(e,s,c)),s=fi(e,t),s!=null&&i.push(Zi(e,s,c))),e.tag===3)return i;e=e.return}return[]}function _1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Pg(e,t,a,i,s){for(var c=t._reactName,p=[];a!==null&&a!==i;){var b=a,O=b.alternate,I=b.stateNode;if(b=b.tag,O!==null&&O===i)break;b!==5&&b!==26&&b!==27||I===null||(O=I,s?(I=fi(a,c),I!=null&&p.unshift(Zi(a,I,O))):s||(I=fi(a,c),I!=null&&p.push(Zi(a,I,O)))),a=a.return}p.length!==0&&e.push({event:t,listeners:p})}var E1=/\r\n?/g,w1=/\u0000|\uFFFD/g;function em(e){return(typeof e=="string"?e:""+e).replace(E1,`
9
+ `).replace(w1,"")}function tm(e,t){return t=em(t),em(e)===t}function Ye(e,t,a,i,s,c){switch(a){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||dl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&dl(e,""+i);break;case"className":cl(e,"class",i);break;case"tabIndex":cl(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":cl(e,a,i);break;case"style":td(e,i,c);break;case"data":if(t!=="object"){cl(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(a);break}i=Vo(""+i),e.setAttribute(a,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(a==="formAction"?(t!=="input"&&Ye(e,t,"name",s.name,s,null),Ye(e,t,"formEncType",s.formEncType,s,null),Ye(e,t,"formMethod",s.formMethod,s,null),Ye(e,t,"formTarget",s.formTarget,s,null)):(Ye(e,t,"encType",s.encType,s,null),Ye(e,t,"method",s.method,s,null),Ye(e,t,"target",s.target,s,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(a);break}i=Vo(""+i),e.setAttribute(a,i);break;case"onClick":i!=null&&(e.onclick=bn);break;case"onScroll":i!=null&&Me("scroll",e);break;case"onScrollEnd":i!=null&&Me("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(a=i.__html,a!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}a=Vo(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,""+i):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":i===!0?e.setAttribute(a,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,i):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(a,i):e.removeAttribute(a);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(a):e.setAttribute(a,i);break;case"popover":Me("beforetoggle",e),Me("toggle",e),rl(e,"popover",i);break;case"xlinkActuate":It(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":It(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":It(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":It(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":It(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":It(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":It(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":It(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":It(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":rl(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Wy.get(a)||a,rl(e,a,i))}}function Rc(e,t,a,i,s,c){switch(a){case"style":td(e,i,c);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(a=i.__html,a!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"children":typeof i=="string"?dl(e,i):(typeof i=="number"||typeof i=="bigint")&&dl(e,""+i);break;case"onScroll":i!=null&&Me("scroll",e);break;case"onScrollEnd":i!=null&&Me("scrollend",e);break;case"onClick":i!=null&&(e.onclick=bn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Uo.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(s=a.endsWith("Capture"),t=a.slice(2,s?a.length-7:void 0),c=e[ht]||null,c=c!=null?c[a]:null,typeof c=="function"&&e.removeEventListener(t,c,s),typeof i=="function")){typeof c!="function"&&c!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,i,s);break e}a in e?e[a]=i:i===!0?e.setAttribute(a,""):rl(e,a,i)}}}function dt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",e),Me("load",e);var i=!1,s=!1,c;for(c in a)if(a.hasOwnProperty(c)){var p=a[c];if(p!=null)switch(c){case"src":i=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ye(e,t,c,p,a,null)}}s&&Ye(e,t,"srcSet",a.srcSet,a,null),i&&Ye(e,t,"src",a.src,a,null);return;case"input":Me("invalid",e);var b=c=p=s=null,O=null,I=null;for(i in a)if(a.hasOwnProperty(i)){var ne=a[i];if(ne!=null)switch(i){case"name":s=ne;break;case"type":p=ne;break;case"checked":O=ne;break;case"defaultChecked":I=ne;break;case"value":c=ne;break;case"defaultValue":b=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(u(137,t));break;default:Ye(e,t,i,ne,a,null)}}Yo(e,c,b,O,I,p,s,!1);return;case"select":Me("invalid",e),i=p=c=null;for(s in a)if(a.hasOwnProperty(s)&&(b=a[s],b!=null))switch(s){case"value":c=b;break;case"defaultValue":p=b;break;case"multiple":i=b;default:Ye(e,t,s,b,a,null)}t=c,a=p,e.multiple=!!i,t!=null?Sn(e,!!i,t,!1):a!=null&&Sn(e,!!i,a,!0);return;case"textarea":Me("invalid",e),c=s=i=null;for(p in a)if(a.hasOwnProperty(p)&&(b=a[p],b!=null))switch(p){case"value":i=b;break;case"defaultValue":s=b;break;case"children":c=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(u(91));break;default:Ye(e,t,p,b,a,null)}Pf(e,i,s,c);return;case"option":for(O in a)a.hasOwnProperty(O)&&(i=a[O],i!=null)&&(O==="selected"?e.selected=i&&typeof i!="function"&&typeof i!="symbol":Ye(e,t,O,i,a,null));return;case"dialog":Me("beforetoggle",e),Me("toggle",e),Me("cancel",e),Me("close",e);break;case"iframe":case"object":Me("load",e);break;case"video":case"audio":for(i=0;i<Xi.length;i++)Me(Xi[i],e);break;case"image":Me("error",e),Me("load",e);break;case"details":Me("toggle",e);break;case"embed":case"source":case"link":Me("error",e),Me("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(I in a)if(a.hasOwnProperty(I)&&(i=a[I],i!=null))switch(I){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Ye(e,t,I,i,a,null)}return;default:if(ks(t)){for(ne in a)a.hasOwnProperty(ne)&&(i=a[ne],i!==void 0&&Rc(e,t,ne,i,a,void 0));return}}for(b in a)a.hasOwnProperty(b)&&(i=a[b],i!=null&&Ye(e,t,b,i,a,null))}function N1(e,t,a,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,c=null,p=null,b=null,O=null,I=null,ne=null;for(F in a){var le=a[F];if(a.hasOwnProperty(F)&&le!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":O=le;default:i.hasOwnProperty(F)||Ye(e,t,F,null,i,le)}}for(var K in i){var F=i[K];if(le=a[K],i.hasOwnProperty(K)&&(F!=null||le!=null))switch(K){case"type":c=F;break;case"name":s=F;break;case"checked":I=F;break;case"defaultChecked":ne=F;break;case"value":p=F;break;case"defaultValue":b=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(u(137,t));break;default:F!==le&&Ye(e,t,K,F,i,le)}}Ca(e,p,b,O,I,ne,c,s);return;case"select":F=p=b=K=null;for(c in a)if(O=a[c],a.hasOwnProperty(c)&&O!=null)switch(c){case"value":break;case"multiple":F=O;default:i.hasOwnProperty(c)||Ye(e,t,c,null,i,O)}for(s in i)if(c=i[s],O=a[s],i.hasOwnProperty(s)&&(c!=null||O!=null))switch(s){case"value":K=c;break;case"defaultValue":b=c;break;case"multiple":p=c;default:c!==O&&Ye(e,t,s,c,i,O)}t=b,a=p,i=F,K!=null?Sn(e,!!a,K,!1):!!i!=!!a&&(t!=null?Sn(e,!!a,t,!0):Sn(e,!!a,a?[]:"",!1));return;case"textarea":F=K=null;for(b in a)if(s=a[b],a.hasOwnProperty(b)&&s!=null&&!i.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Ye(e,t,b,null,i,s)}for(p in i)if(s=i[p],c=a[p],i.hasOwnProperty(p)&&(s!=null||c!=null))switch(p){case"value":K=s;break;case"defaultValue":F=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==c&&Ye(e,t,p,s,i,c)}Wf(e,K,F);return;case"option":for(var he in a)K=a[he],a.hasOwnProperty(he)&&K!=null&&!i.hasOwnProperty(he)&&(he==="selected"?e.selected=!1:Ye(e,t,he,null,i,K));for(O in i)K=i[O],F=a[O],i.hasOwnProperty(O)&&K!==F&&(K!=null||F!=null)&&(O==="selected"?e.selected=K&&typeof K!="function"&&typeof K!="symbol":Ye(e,t,O,K,i,F));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ve in a)K=a[ve],a.hasOwnProperty(ve)&&K!=null&&!i.hasOwnProperty(ve)&&Ye(e,t,ve,null,i,K);for(I in i)if(K=i[I],F=a[I],i.hasOwnProperty(I)&&K!==F&&(K!=null||F!=null))switch(I){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(u(137,t));break;default:Ye(e,t,I,K,i,F)}return;default:if(ks(t)){for(var Ve in a)K=a[Ve],a.hasOwnProperty(Ve)&&K!==void 0&&!i.hasOwnProperty(Ve)&&Rc(e,t,Ve,void 0,i,K);for(ne in i)K=i[ne],F=a[ne],!i.hasOwnProperty(ne)||K===F||K===void 0&&F===void 0||Rc(e,t,ne,K,i,F);return}}for(var G in a)K=a[G],a.hasOwnProperty(G)&&K!=null&&!i.hasOwnProperty(G)&&Ye(e,t,G,null,i,K);for(le in i)K=i[le],F=a[le],!i.hasOwnProperty(le)||K===F||K==null&&F==null||Ye(e,t,le,K,i,F)}function nm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function M1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),i=0;i<a.length;i++){var s=a[i],c=s.transferSize,p=s.initiatorType,b=s.duration;if(c&&b&&nm(p)){for(p=0,b=s.responseEnd,i+=1;i<a.length;i++){var O=a[i],I=O.startTime;if(I>b)break;var ne=O.transferSize,le=O.initiatorType;ne&&nm(le)&&(O=O.responseEnd,p+=ne*(O<b?1:(b-I)/(O-I)))}if(--i,t+=8*(c+p)/(s.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Hc=null,jc=null;function Uu(e){return e.nodeType===9?e:e.ownerDocument}function am(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function lm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Uc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Bc=null;function A1(){var e=window.event;return e&&e.type==="popstate"?e===Bc?!1:(Bc=e,!0):(Bc=null,!1)}var im=typeof setTimeout=="function"?setTimeout:void 0,T1=typeof clearTimeout=="function"?clearTimeout:void 0,om=typeof Promise=="function"?Promise:void 0,z1=typeof queueMicrotask=="function"?queueMicrotask:typeof om<"u"?function(e){return om.resolve(null).then(e).catch(C1)}:im;function C1(e){setTimeout(function(){throw e})}function da(e){return e==="head"}function um(e,t){var a=t,i=0;do{var s=a.nextSibling;if(e.removeChild(a),s&&s.nodeType===8)if(a=s.data,a==="/$"||a==="/&"){if(i===0){e.removeChild(s),Xl(t);return}i--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")i++;else if(a==="html")Qi(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Qi(a);for(var c=a.firstChild;c;){var p=c.nextSibling,b=c.nodeName;c[Ta]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&c.rel.toLowerCase()==="stylesheet"||a.removeChild(c),c=p}}else a==="body"&&Qi(e.ownerDocument.body);a=s}while(a);Xl(t)}function sm(e,t){var a=e;e=0;do{var i=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),i&&i.nodeType===8)if(a=i.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=i}while(a)}function qc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":qc(a),si(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function D1(e,t,a,i){for(;e.nodeType===1;){var s=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Ta])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=Zt(e.nextSibling),e===null)break}return null}function O1(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Zt(e.nextSibling),e===null))return null;return e}function rm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Zt(e.nextSibling),e===null))return null;return e}function Lc(e){return e.data==="$?"||e.data==="$~"}function Yc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function R1(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var i=function(){t(),a.removeEventListener("DOMContentLoaded",i)};a.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Zt(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==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Vc=null;function cm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Zt(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function fm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function dm(e,t,a){switch(t=Uu(a),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Qi(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);si(e)}var Qt=new Map,hm=new Set;function Bu(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Bn=H.d;H.d={f:H1,r:j1,D:U1,C:B1,L:q1,m:L1,X:V1,S:Y1,M:G1};function H1(){var e=Bn.f(),t=Tu();return e||t}function j1(e){var t=Qn(e);t!==null&&t.tag===5&&t.type==="form"?Ch(t):Bn.r(e)}var Yl=typeof document>"u"?null:document;function gm(e,t,a){var i=Yl;if(i&&typeof t=="string"&&t){var s=xt(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof a=="string"&&(s+='[crossorigin="'+a+'"]'),hm.has(s)||(hm.add(s),e={rel:e,crossOrigin:a,href:t},i.querySelector(s)===null&&(t=i.createElement("link"),dt(t,"link",e),We(t),i.head.appendChild(t)))}}function U1(e){Bn.D(e),gm("dns-prefetch",e,null)}function B1(e,t){Bn.C(e,t),gm("preconnect",e,t)}function q1(e,t,a){Bn.L(e,t,a);var i=Yl;if(i&&e&&t){var s='link[rel="preload"][as="'+xt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(s+='[imagesrcset="'+xt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(s+='[imagesizes="'+xt(a.imageSizes)+'"]')):s+='[href="'+xt(e)+'"]';var c=s;switch(t){case"style":c=Vl(e);break;case"script":c=Gl(e)}Qt.has(c)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Qt.set(c,e),i.querySelector(s)!==null||t==="style"&&i.querySelector($i(c))||t==="script"&&i.querySelector(ki(c))||(t=i.createElement("link"),dt(t,"link",e),We(t),i.head.appendChild(t)))}}function L1(e,t){Bn.m(e,t);var a=Yl;if(a&&e){var i=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+xt(i)+'"][href="'+xt(e)+'"]',c=s;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Gl(e)}if(!Qt.has(c)&&(e=y({rel:"modulepreload",href:e},t),Qt.set(c,e),a.querySelector(s)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ki(c)))return}i=a.createElement("link"),dt(i,"link",e),We(i),a.head.appendChild(i)}}}function Y1(e,t,a){Bn.S(e,t,a);var i=Yl;if(i&&e){var s=kn(i).hoistableStyles,c=Vl(e);t=t||"default";var p=s.get(c);if(!p){var b={loading:0,preload:null};if(p=i.querySelector($i(c)))b.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Qt.get(c))&&Gc(e,a);var O=p=i.createElement("link");We(O),dt(O,"link",e),O._p=new Promise(function(I,ne){O.onload=I,O.onerror=ne}),O.addEventListener("load",function(){b.loading|=1}),O.addEventListener("error",function(){b.loading|=2}),b.loading|=4,qu(p,t,i)}p={type:"stylesheet",instance:p,count:1,state:b},s.set(c,p)}}}function V1(e,t){Bn.X(e,t);var a=Yl;if(a&&e){var i=kn(a).hoistableScripts,s=Gl(e),c=i.get(s);c||(c=a.querySelector(ki(s)),c||(e=y({src:e,async:!0},t),(t=Qt.get(s))&&Xc(e,t),c=a.createElement("script"),We(c),dt(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(s,c))}}function G1(e,t){Bn.M(e,t);var a=Yl;if(a&&e){var i=kn(a).hoistableScripts,s=Gl(e),c=i.get(s);c||(c=a.querySelector(ki(s)),c||(e=y({src:e,async:!0,type:"module"},t),(t=Qt.get(s))&&Xc(e,t),c=a.createElement("script"),We(c),dt(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(s,c))}}function mm(e,t,a,i){var s=(s=ce.current)?Bu(s):null;if(!s)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Vl(a.href),a=kn(s).hoistableStyles,i=a.get(t),i||(i={type:"style",instance:null,count:0,state:null},a.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Vl(a.href);var c=kn(s).hoistableStyles,p=c.get(e);if(p||(s=s.ownerDocument||s,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,p),(c=s.querySelector($i(e)))&&!c._p&&(p.instance=c,p.state.loading=5),Qt.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Qt.set(e,a),c||X1(s,e,a,p.state))),t&&i===null)throw Error(u(528,""));return p}if(t&&i!==null)throw Error(u(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Gl(a),a=kn(s).hoistableScripts,i=a.get(t),i||(i={type:"script",instance:null,count:0,state:null},a.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Vl(e){return'href="'+xt(e)+'"'}function $i(e){return'link[rel="stylesheet"]['+e+"]"}function pm(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function X1(e,t,a,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),dt(t,"link",a),We(t),e.head.appendChild(t))}function Gl(e){return'[src="'+xt(e)+'"]'}function ki(e){return"script[async]"+e}function ym(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+xt(a.href)+'"]');if(i)return t.instance=i,We(i),i;var s=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),We(i),dt(i,"style",s),qu(i,a.precedence,e),t.instance=i;case"stylesheet":s=Vl(a.href);var c=e.querySelector($i(s));if(c)return t.state.loading|=4,t.instance=c,We(c),c;i=pm(a),(s=Qt.get(s))&&Gc(i,s),c=(e.ownerDocument||e).createElement("link"),We(c);var p=c;return p._p=new Promise(function(b,O){p.onload=b,p.onerror=O}),dt(c,"link",i),t.state.loading|=4,qu(c,a.precedence,e),t.instance=c;case"script":return c=Gl(a.src),(s=e.querySelector(ki(c)))?(t.instance=s,We(s),s):(i=a,(s=Qt.get(c))&&(i=y({},a),Xc(i,s)),e=e.ownerDocument||e,s=e.createElement("script"),We(s),dt(s,"link",i),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,qu(i,a.precedence,e));return t.instance}function qu(e,t,a){for(var i=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=i.length?i[i.length-1]:null,c=s,p=0;p<i.length;p++){var b=i[p];if(b.dataset.precedence===t)c=b;else if(c!==s)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Gc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Xc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Lu=null;function vm(e,t,a){if(Lu===null){var i=new Map,s=Lu=new Map;s.set(a,i)}else s=Lu,i=s.get(a),i||(i=new Map,s.set(a,i));if(i.has(e))return i;for(i.set(e,null),a=a.getElementsByTagName(e),s=0;s<a.length;s++){var c=a[s];if(!(c[Ta]||c[lt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var p=c.getAttribute(t)||"";p=e+p;var b=i.get(p);b?b.push(c):i.set(p,[c])}}return i}function xm(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Z1(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Sm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Q1(e,t,a,i){if(a.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var s=Vl(i.href),c=t.querySelector($i(s));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Yu.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=c,We(c);return}c=t.ownerDocument||t,i=pm(i),(s=Qt.get(s))&&Gc(i,s),c=c.createElement("link"),We(c);var p=c;p._p=new Promise(function(b,O){p.onload=b,p.onerror=O}),dt(c,"link",i),a.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Yu.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Zc=0;function $1(e,t){return e.stylesheets&&e.count===0&&Gu(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var i=setTimeout(function(){if(e.stylesheets&&Gu(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Zc===0&&(Zc=62500*M1());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Gu(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Zc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(s)}}:null}function Yu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Gu(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Vu=null;function Gu(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Vu=new Map,t.forEach(k1,e),Vu=null,Yu.call(e))}function k1(e,t){if(!(t.state.loading&4)){var a=Vu.get(e);if(a)var i=a.get(null);else{a=new Map,Vu.set(e,a);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<s.length;c++){var p=s[c];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(a.set(p.dataset.precedence,p),i=p)}i&&a.set(null,i)}s=t.instance,p=s.getAttribute("data-precedence"),c=a.get(p)||i,c===i&&a.set(null,s),a.set(p,s),this.count++,i=Yu.bind(this),s.addEventListener("load",i),s.addEventListener("error",i),c?c.parentNode.insertBefore(s,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var Ii={$$typeof:w,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function I1(e,t,a,i,s,c,p,b,O){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ii(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ii(0),this.hiddenUpdates=ii(null),this.identifierPrefix=i,this.onUncaughtError=s,this.onCaughtError=c,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function bm(e,t,a,i,s,c,p,b,O,I,ne,le){return e=new I1(e,t,a,p,O,I,ne,le,b),t=1,c===!0&&(t|=24),c=Ct(3,null,null,t),e.current=c,c.stateNode=e,t=Er(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:i,isDehydrated:a,cache:t},Ar(c),e}function _m(e){return e?(e=xl,e):xl}function Em(e,t,a,i,s,c){s=_m(s),i.context===null?i.context=s:i.pendingContext=s,i=ta(t),i.payload={element:a},c=c===void 0?null:c,c!==null&&(i.callback=c),a=na(e,i,t),a!==null&&(Nt(a,e,t),Mi(a,e,t))}function wm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Qc(e,t){wm(e,t),(e=e.alternate)&&wm(e,t)}function Nm(e){if(e.tag===13||e.tag===31){var t=Ha(e,67108864);t!==null&&Nt(t,e,67108864),Qc(e,67108864)}}function Mm(e){if(e.tag===13||e.tag===31){var t=jt();t=oi(t);var a=Ha(e,t);a!==null&&Nt(a,e,t),Qc(e,t)}}var Xu=!0;function K1(e,t,a,i){var s=M.T;M.T=null;var c=H.p;try{H.p=2,$c(e,t,a,i)}finally{H.p=c,M.T=s}}function J1(e,t,a,i){var s=M.T;M.T=null;var c=H.p;try{H.p=8,$c(e,t,a,i)}finally{H.p=c,M.T=s}}function $c(e,t,a,i){if(Xu){var s=kc(i);if(s===null)Oc(e,t,i,Zu,a),Tm(e,i);else if(W1(s,e,t,a,i))i.stopPropagation();else if(Tm(e,i),t&4&&-1<F1.indexOf(e)){for(;s!==null;){var c=Qn(s);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var p=yn(c.pendingLanes);if(p!==0){var b=c;for(b.pendingLanes|=2,b.entangledLanes|=2;p;){var O=1<<31-pt(p);b.entanglements[1]|=O,p&=~O}rn(c),(He&6)===0&&(Mu=st()+500,Gi(0))}}break;case 31:case 13:b=Ha(c,2),b!==null&&Nt(b,c,2),Tu(),Qc(c,2)}if(c=kc(i),c===null&&Oc(e,t,i,Zu,a),c===s)break;s=c}s!==null&&i.stopPropagation()}else Oc(e,t,i,null,a)}}function kc(e){return e=Ks(e),Ic(e)}var Zu=null;function Ic(e){if(Zu=null,e=Zn(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=d(t),e!==null)return e;e=null}else if(a===31){if(e=h(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Zu=e,null}function Am(e){switch(e){case"beforetoggle":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"toggle":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 2;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"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(nl()){case pn:return 2;case Xn:return 8;case wa:case Hs:return 32;case al:return 268435456;default:return 32}default:return 32}}var Kc=!1,ha=null,ga=null,ma=null,Ki=new Map,Ji=new Map,pa=[],F1="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".split(" ");function Tm(e,t){switch(e){case"focusin":case"focusout":ha=null;break;case"dragenter":case"dragleave":ga=null;break;case"mouseover":case"mouseout":ma=null;break;case"pointerover":case"pointerout":Ki.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ji.delete(t.pointerId)}}function Fi(e,t,a,i,s,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:a,eventSystemFlags:i,nativeEvent:c,targetContainers:[s]},t!==null&&(t=Qn(t),t!==null&&Nm(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function W1(e,t,a,i,s){switch(t){case"focusin":return ha=Fi(ha,e,t,a,i,s),!0;case"dragenter":return ga=Fi(ga,e,t,a,i,s),!0;case"mouseover":return ma=Fi(ma,e,t,a,i,s),!0;case"pointerover":var c=s.pointerId;return Ki.set(c,Fi(Ki.get(c)||null,e,t,a,i,s)),!0;case"gotpointercapture":return c=s.pointerId,Ji.set(c,Fi(Ji.get(c)||null,e,t,a,i,s)),!0}return!1}function zm(e){var t=Zn(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=d(a),t!==null){e.blockedOn=t,Oo(e.priority,function(){Mm(a)});return}}else if(t===31){if(t=h(a),t!==null){e.blockedOn=t,Oo(e.priority,function(){Mm(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Qu(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=kc(e.nativeEvent);if(a===null){a=e.nativeEvent;var i=new a.constructor(a.type,a);Is=i,a.target.dispatchEvent(i),Is=null}else return t=Qn(a),t!==null&&Nm(t),e.blockedOn=a,!1;t.shift()}return!0}function Cm(e,t,a){Qu(e)&&a.delete(t)}function P1(){Kc=!1,ha!==null&&Qu(ha)&&(ha=null),ga!==null&&Qu(ga)&&(ga=null),ma!==null&&Qu(ma)&&(ma=null),Ki.forEach(Cm),Ji.forEach(Cm)}function $u(e,t){e.blockedOn===t&&(e.blockedOn=null,Kc||(Kc=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,P1)))}var ku=null;function Dm(e){ku!==e&&(ku=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){ku===e&&(ku=null);for(var t=0;t<e.length;t+=3){var a=e[t],i=e[t+1],s=e[t+2];if(typeof i!="function"){if(Ic(i||a)===null)continue;break}var c=Qn(a);c!==null&&(e.splice(t,3),t-=3,kr(c,{pending:!0,data:s,method:a.method,action:i},i,s))}}))}function Xl(e){function t(O){return $u(O,e)}ha!==null&&$u(ha,e),ga!==null&&$u(ga,e),ma!==null&&$u(ma,e),Ki.forEach(t),Ji.forEach(t);for(var a=0;a<pa.length;a++){var i=pa[a];i.blockedOn===e&&(i.blockedOn=null)}for(;0<pa.length&&(a=pa[0],a.blockedOn===null);)zm(a),a.blockedOn===null&&pa.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(i=0;i<a.length;i+=3){var s=a[i],c=a[i+1],p=s[ht]||null;if(typeof c=="function")p||Dm(a);else if(p){var b=null;if(c&&c.hasAttribute("formAction")){if(s=c,p=c[ht]||null)b=p.formAction;else if(Ic(s)!==null)continue}else b=p.action;typeof b=="function"?a[i+1]=b:(a.splice(i,3),i-=3),Dm(a)}}}function Om(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(p){return s=p})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),i||setTimeout(a,20)}function a(){if(!i&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,s=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),s!==null&&(s(),s=null)}}}function Jc(e){this._internalRoot=e}Iu.prototype.render=Jc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var a=t.current,i=jt();Em(a,i,e,t,null,null)},Iu.prototype.unmount=Jc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Em(e.current,2,null,e,null,null),Tu(),t[vn]=null}};function Iu(e){this._internalRoot=e}Iu.prototype.unstable_scheduleHydration=function(e){if(e){var t=Do();e={blockedOn:null,target:e,priority:t};for(var a=0;a<pa.length&&t!==0&&t<pa[a].priority;a++);pa.splice(a,0,e),a===0&&zm(e)}};var Rm=l.version;if(Rm!=="19.2.5")throw Error(u(527,Rm,"19.2.5"));H.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=g(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var ex={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ku=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ku.isDisabled&&Ku.supportsFiber)try{Na=Ku.inject(ex),mt=Ku}catch{}}return Pi.createRoot=function(e,t){if(!r(e))throw Error(u(299));var a=!1,i="",s=Yh,c=Vh,p=Gh;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(p=t.onRecoverableError)),t=bm(e,1,!1,null,null,a,i,null,s,c,p,Om),e[vn]=t.current,Dc(e),new Jc(t)},Pi.hydrateRoot=function(e,t,a){if(!r(e))throw Error(u(299));var i=!1,s="",c=Yh,p=Vh,b=Gh,O=null;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(s=a.identifierPrefix),a.onUncaughtError!==void 0&&(c=a.onUncaughtError),a.onCaughtError!==void 0&&(p=a.onCaughtError),a.onRecoverableError!==void 0&&(b=a.onRecoverableError),a.formState!==void 0&&(O=a.formState)),t=bm(e,1,!0,t,a??null,i,s,O,c,p,b,Om),t.context=_m(null),a=t.current,i=jt(),i=oi(i),s=ta(i),s.callback=null,na(a,s,i),a=i,t.current.lanes=a,Aa(t,a),rn(t),e[vn]=t.current,Dc(e),new Iu(t)},Pi.version="19.2.5",Pi}var Xm;function rx(){if(Xm)return Pc.exports;Xm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Pc.exports=sx(),Pc.exports}var cx=rx();const Zm=n=>{let l;const o=new Set,u=(g,v)=>{const y=typeof g=="function"?g(l):g;if(!Object.is(y,l)){const x=l;l=v??(typeof y!="object"||y===null)?y:Object.assign({},l,y),o.forEach(S=>S(l,x))}},r=()=>l,h={setState:u,getState:r,getInitialState:()=>m,subscribe:g=>(o.add(g),()=>o.delete(g))},m=l=n(u,r,h);return h},fx=(n=>n?Zm(n):Zm),dx=n=>n;function hx(n,l=dx){const o=ao.useSyncExternalStore(n.subscribe,ao.useCallback(()=>l(n.getState()),[n,l]),ao.useCallback(()=>l(n.getInitialState()),[n,l]));return ao.useDebugValue(o),o}const Qm=n=>{const l=fx(n),o=u=>hx(l,u);return Object.assign(o,l),o},gx=(n=>n?Qm(n):Qm);function $m(n){return Array.isArray(n.images)}async function At(n,l){const o=await fetch(n,l),u=await o.json().catch(()=>({}));if(!o.ok){const r=u.error,f=typeof r=="string"?r:r?.message??`Request failed: ${o.status}`,d=new Error(f);throw d.status=o.status,typeof r!="string"&&r?.code&&(d.code=r.code),typeof u.currentVersion=="number"&&(d.currentVersion=u.currentVersion),d}return u}function af(n){const l=new URLSearchParams;n?.kind&&l.set("kind",n.kind),n?.sessionId&&l.set("sessionId",n.sessionId);const o=l.size>0?`?${l.toString()}`:"";return At(`/api/inflight${o}`)}async function km(n){await fetch(`/api/inflight/${encodeURIComponent(n)}`,{method:"DELETE"}).catch(()=>{})}function mx(){return At("/api/oauth/status")}function px(){return At("/api/billing")}function yx(n){return At("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}function Im(n={}){const l=new URLSearchParams;return l.set("limit",String(n.limit??50)),n.since!=null&&l.set("since",String(n.since)),n.cursor&&(l.set("before",String(n.cursor.before)),l.set("beforeFilename",n.cursor.beforeFilename)),n.sessionId&&l.set("sessionId",n.sessionId),At(`/api/history?${l.toString()}`)}function vx(n={}){const l=new URLSearchParams;return l.set("groupBy","session"),l.set("limit",String(n.limit??200)),n.cursor&&(l.set("before",String(n.cursor.before)),l.set("beforeFilename",n.cursor.beforeFilename)),At(`/api/history?${l.toString()}`)}function xx(n){return At(`/api/history/${encodeURIComponent(n)}`,{method:"DELETE"})}function Sx(n,l){return At(`/api/history/${encodeURIComponent(n)}/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({trashId:l})})}async function bx(n){const l=await fetch("/api/node/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),o=await l.json().catch(()=>({}));if(!l.ok){const u=o,r=u?.error?.message??`Request failed: ${l.status}`,f=new Error(r);throw f.code=u?.error?.code,f}return o}function _x(){return At("/api/sessions")}function Ex(n){return At("/api/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:n})})}function sp(n){return At(`/api/sessions/${encodeURIComponent(n)}`)}function wx(n,l){return At(`/api/sessions/${encodeURIComponent(n)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:l})})}function Nx(n){return At(`/api/sessions/${encodeURIComponent(n)}`,{method:"DELETE"})}function Mx(n,l,o,u){return At(`/api/sessions/${encodeURIComponent(n)}/graph`,{method:"PUT",headers:{"Content-Type":"application/json","If-Match":String(l)},body:JSON.stringify({nodes:o,edges:u})})}function Ax(n,l=256){return new Promise(o=>{const u=new Image;u.onload=()=>{const r=Math.min(1,l/Math.max(u.width,u.height)),f=document.createElement("canvas");f.width=u.width*r,f.height=u.height*r;const d=f.getContext("2d");if(!d)return o(n);d.drawImage(u,0,0,f.width,f.height),o(f.toDataURL("image/jpeg",.6))},u.onerror=()=>o(n),u.src=n})}function Km(n){return Math.round(n/16)*16}const Tx=[{value:"1024x1024",label:"1024²",sub:"1:1"},{value:"1536x1024",label:"1536×1024",sub:"3:2"},{value:"1024x1536",label:"1024×1536",sub:"2:3"}],zx=[{value:"1360x1024",label:"1360×1024",sub:"4:3"},{value:"1024x1360",label:"1024×1360",sub:"3:4"},{value:"1824x1024",label:"1824×1024",sub:"16:9"}],Cx=[{value:"1024x1824",label:"1024×1824",sub:"9:16"},{value:"2048x2048",label:"2048²",sub:"2K 1:1"},{value:"2048x1152",label:"2048×1152",sub:"2K 16:9"}],Dx=[{value:"1152x2048",label:"1152×2048",sub:"2K 9:16"},{value:"3824x2160",label:"3824×2160",sub:"4K 16:9"},{value:"2160x3824",label:"2160×3824",sub:"4K 9:16"}],Ox=[{value:"auto",label:"auto",sub:"model"},{value:"custom",label:"Custom",sub:"free"}],Zl=()=>"nc_"+Math.random().toString(36).slice(2,10);function Jm(n,l){return{x:n*360,y:l*320}}function Rx(){try{const n=localStorage.getItem("ima2.rightPanelOpen");return n===null?!0:JSON.parse(n)===!0}catch{return!0}}function Hx(){try{const n=localStorage.getItem("ima2.uiMode");if(n==="node"||n==="classic")return n}catch{}return"classic"}const rp=18e4;function lf(){try{const n=localStorage.getItem("ima2.inFlight");if(!n)return[];const l=JSON.parse(n);if(!Array.isArray(l))return[];const o=Date.now();return l.filter(u=>u&&typeof u.id=="string"&&typeof u.prompt=="string"&&typeof u.startedAt=="number"&&o-u.startedAt<rp).map(u=>({id:u.id,prompt:u.prompt,startedAt:u.startedAt}))}catch{return[]}}function ka(n){try{localStorage.setItem("ima2.inFlight",JSON.stringify(n))}catch(l){const o=window;if(!o.__ima2QuotaWarned){o.__ima2QuotaWarned=!0,console.warn("[ima2] localStorage write failed:",l);try{de.getState().showToast("Local storage full — recent state may not persist",!0)}catch{}}}}function Fm(){try{const n=localStorage.getItem("ima2.selectedFilename");return typeof n=="string"&&n.length>0?n:null}catch{return null}}function lo(n){try{n?localStorage.setItem("ima2.selectedFilename",n):localStorage.removeItem("ima2.selectedFilename")}catch{}}const io=500;function cp(n){const l=n.nodes.map(u=>{const r=u.data??{},f=typeof r.imageUrl=="string"&&r.imageUrl.length>0?r.imageUrl:null,d=typeof r.serverNodeId=="string"&&r.serverNodeId.length>0?`/generated/${r.serverNodeId}.png`:null,h=f??d,m={clientId:u.id,serverNodeId:r.serverNodeId??null,parentServerNodeId:r.parentServerNodeId??null,prompt:typeof r.prompt=="string"?r.prompt:"",imageUrl:h,status:r.status??(h?"ready":"empty"),pendingRequestId:r.pendingRequestId??null,pendingPhase:r.pendingPhase??null,error:r.error,elapsed:r.elapsed,webSearchCalls:r.webSearchCalls};return{id:u.id,type:"imageNode",position:{x:u.x,y:u.y},data:m}}),o=n.edges.map(u=>({id:u.id,source:u.source,target:u.target}));return{graphNodes:l,graphEdges:o,graphVersion:n.graphVersion}}const de=gx((n,l)=>({provider:"oauth",quality:"low",sizePreset:"1024x1024",customW:1920,customH:1088,format:"png",moderation:"low",count:1,prompt:"",referenceImages:[],addReferences:async o=>{const u=5-l().referenceImages.length,r=o.slice(0,Math.max(0,u)),d=(await Promise.all(r.map(h=>new Promise(m=>{const g=new FileReader;g.onload=()=>m(typeof g.result=="string"?g.result:null),g.onerror=()=>m(null),g.readAsDataURL(h)})))).filter(h=>!!h);n(h=>({referenceImages:[...h.referenceImages,...d].slice(0,5)})),o.length>u&&l().showToast("Maximum 5 references; extras ignored",!0)},addReferenceDataUrl:o=>{n(u=>u.referenceImages.length>=5?u:{referenceImages:[...u.referenceImages,o]})},removeReference:o=>{n(u=>({referenceImages:u.referenceImages.filter((r,f)=>f!==o)}))},clearReferences:()=>n({referenceImages:[]}),useCurrentAsReference:async()=>{const o=l().currentImage;if(!o){l().showToast("No current image to use",!0);return}if(l().referenceImages.length>=5){l().showToast("Reference slots are full (max 5)",!0);return}let u=o.image;if(!u.startsWith("data:"))try{const f=await(await fetch(u)).blob();u=await new Promise((d,h)=>{const m=new FileReader;m.onload=()=>typeof m.result=="string"?d(m.result):h(new Error("read failed")),m.onerror=()=>h(m.error??new Error("read failed")),m.readAsDataURL(f)})}catch{l().showToast("Could not fetch current image",!0);return}n(r=>({referenceImages:[...r.referenceImages,u]})),l().showToast("Added current image as reference")},activeGenerations:lf().length,inFlight:lf(),startInFlightPolling:()=>{if(typeof window>"u")return;const o=window;if(o.__ima2InflightTimer)return;const u=async()=>{if(l().inFlight.length===0){o.__ima2InflightTimer&&(clearInterval(o.__ima2InflightTimer),o.__ima2InflightTimer=void 0);return}try{const f=l().uiMode==="node"?"node":"classic",d=f==="node"?l().activeSessionId??void 0:void 0,{jobs:h}=await af({kind:f,sessionId:d}),m=new Map(h.map(S=>[S.requestId,S.phase]));let g=!1;const v=Date.now(),y=5e3,x=[];for(const S of l().inFlight){if(!m.has(S.id)&&v-S.startedAt>y){g=!0;continue}const _=m.get(S.id);_&&_!==S.phase?(g=!0,x.push({...S,phase:_})):x.push(S)}g&&(ka(x),n({inFlight:x,activeGenerations:x.length}))}catch{}try{const f=l().history.reduce((x,S)=>S.createdAt&&S.createdAt>x?S.createdAt:x,0),{items:d}=await Im({limit:io,since:f}),h=d.map(x=>({image:x.url,url:x.url,filename:x.filename,thumb:x.url,prompt:x.prompt??void 0,size:x.size??void 0,quality:x.quality??void 0,format:x.format,createdAt:x.createdAt})),m=l().history,g=h.filter(x=>!m.some(S=>S.filename===x.filename));g.length>0&&n(x=>{const S=x.currentImage??g[0];return!x.currentImage&&g[0]?.filename&&lo(g[0].filename),{history:[...g,...x.history].slice(0,io),currentImage:S}});const v=Date.now(),y=l().inFlight.filter(x=>v-x.startedAt<rp);y.length!==l().inFlight.length&&(ka(y),n({inFlight:y,activeGenerations:y.length}))}catch{}};o.__ima2InflightTimer=window.setInterval(u,1500)},reconcileInflight:async()=>{try{const o=l().uiMode==="node"?"node":"classic",u=o==="node"?l().activeSessionId??void 0:void 0,{jobs:r}=await af({kind:o,sessionId:u}),f=new Set(r.map(v=>v.requestId)),d=Date.now(),m=l().inFlight.filter(v=>f.has(v.id)||d-v.startedAt<1e4),g=new Set(m.map(v=>v.id));for(const v of r)g.has(v.requestId)||m.push({id:v.requestId,prompt:v.prompt||"",startedAt:v.startedAt});ka(m),n({inFlight:m,activeGenerations:m.length}),m.length>0&&l().startInFlightPolling()}catch{}},syncFromStorage:()=>{const o=lf(),u=Fm();n(r=>({inFlight:o,activeGenerations:o.length,currentImage:u&&r.currentImage?.filename!==u?r.history.find(f=>f.filename===u)??r.currentImage:r.currentImage})),o.length>0&&l().startInFlightPolling()},currentImage:null,history:[],toast:null,rightPanelOpen:Rx(),toggleRightPanel:()=>n(o=>{const u=!o.rightPanelOpen;try{localStorage.setItem("ima2.rightPanelOpen",JSON.stringify(u))}catch{}return{rightPanelOpen:u}}),galleryOpen:!1,openGallery:()=>n({galleryOpen:!0}),closeGallery:()=>n({galleryOpen:!1}),uiMode:Hx(),setUIMode:o=>{try{localStorage.setItem("ima2.uiMode",o)}catch{}n({uiMode:o})},graphNodes:[],graphEdges:[],setGraphNodes:o=>{n({graphNodes:o}),l().scheduleGraphSave()},setGraphEdges:o=>{n({graphEdges:o}),l().scheduleGraphSave()},sessions:[],activeSessionId:null,activeSessionGraphVersion:null,sessionLoading:!1,async loadSessions(){try{const{sessions:o}=await _x();n({sessions:o});const u=l().activeSessionId;!u&&o.length>0?await l().switchSession(o[0].id):!u&&o.length===0&&await l().createAndSwitchSession("My first graph")}catch(o){console.warn("[sessions] load failed:",o)}},async switchSession(o){n({sessionLoading:!0}),await l().flushGraphSave();try{const{session:u}=await sp(o),{graphNodes:r,graphEdges:f,graphVersion:d}=cp(u);n({activeSessionId:o,activeSessionGraphVersion:d,graphNodes:r,graphEdges:f,sessionLoading:!1}),l().reconcileGraphPending()}catch(u){console.warn("[sessions] switch failed:",u),n({sessionLoading:!1}),l().showToast("Session load failed",!0)}},async reconcileGraphPending(){const o=l().activeSessionId;if(!o||l().graphNodes.filter(h=>h.data?.pendingRequestId&&(h.data.status==="pending"||h.data.status==="reconciling")).length===0)return;let r=[];try{r=(await af({kind:"node",sessionId:o})).jobs}catch{return}const f=new Map(r.map(h=>[h.requestId,h.phase])),d=l().graphNodes.map(h=>{const m=h.data?.pendingRequestId;if(!m||h.data.status!=="pending"&&h.data.status!=="reconciling")return h;if(f.has(m)){const v=f.get(m)??null;return{...h,data:{...h.data,status:"reconciling",pendingPhase:v}}}const g=!!h.data.imageUrl||!!h.data.serverNodeId;return{...h,data:{...h.data,pendingRequestId:null,pendingPhase:null,status:g?"ready":"stale",error:g?void 0:"Generation did not complete. Retry from this node."}}});n({graphNodes:d})},async createAndSwitchSession(o="Untitled"){try{const{session:u}=await Ex(o);n({sessions:[u,...l().sessions],activeSessionId:u.id,activeSessionGraphVersion:u.graphVersion,graphNodes:[],graphEdges:[]})}catch(u){console.warn("[sessions] create failed:",u),l().showToast("Create session failed",!0)}},async renameCurrentSession(o){const u=l().activeSessionId;if(u)try{await wx(u,o),n({sessions:l().sessions.map(r=>r.id===u?{...r,title:o,updatedAt:Date.now()}:r)})}catch{l().showToast("Rename failed",!0)}},async deleteSessionById(o){try{await Nx(o);const u=l().sessions.filter(r=>r.id!==o);n({sessions:u}),l().activeSessionId===o&&(n({activeSessionId:null,activeSessionGraphVersion:null,graphNodes:[],graphEdges:[]}),u.length>0?await l().switchSession(u[0].id):await l().createAndSwitchSession("My first graph"))}catch{l().showToast("Delete failed",!0)}},scheduleGraphSave(){Bx(l,n)},async flushGraphSave(){await qx(l,n)},addRootNode:()=>{const o=Zl(),u=0,r=l().graphNodes.filter(d=>!d.data.parentServerNodeId).length,f={id:o,type:"imageNode",position:Jm(u,r),data:{clientId:o,serverNodeId:null,parentServerNodeId:null,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return n({graphNodes:[...l().graphNodes,f]}),l().scheduleGraphSave(),o},addChildNode:o=>{const u=l().graphNodes.find(m=>m.id===o);if(!u)return o;const r=Zl(),f=l().graphEdges.filter(m=>m.source===o).length,d={id:r,type:"imageNode",position:{x:u.position.x+360,y:u.position.y+f*320},data:{clientId:r,serverNodeId:null,parentServerNodeId:u.data.serverNodeId,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},h={id:`${o}->${r}`,source:o,target:r};return n({graphNodes:[...l().graphNodes,d],graphEdges:[...l().graphEdges,h]}),l().scheduleGraphSave(),r},addSiblingNode:o=>{const u=l().graphNodes.find(y=>y.id===o);if(!u)return o;const r=l().graphEdges.find(y=>y.target===o);if(!r){const y=Zl(),x=0,S=l().graphNodes.filter(T=>!T.data.parentServerNodeId).length,_={id:y,type:"imageNode",position:Jm(x,S),data:{clientId:y,serverNodeId:null,parentServerNodeId:null,prompt:u.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return n({graphNodes:[...l().graphNodes,_]}),l().scheduleGraphSave(),y}const f=r.source,d=l().graphNodes.find(y=>y.id===f);if(!d)return o;const h=Zl(),m=l().graphEdges.filter(y=>y.source===f).length,g={id:h,type:"imageNode",position:{x:d.position.x+360,y:d.position.y+m*320},data:{clientId:h,serverNodeId:null,parentServerNodeId:u.data.parentServerNodeId,prompt:u.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},v={id:`${f}->${h}`,source:f,target:h};return n({graphNodes:[...l().graphNodes,g],graphEdges:[...l().graphEdges,v]}),l().scheduleGraphSave(),h},updateNodePrompt:(o,u)=>{n({graphNodes:l().graphNodes.map(r=>r.id===o?{...r,data:{...r.data,prompt:u}}:r)}),l().scheduleGraphSave()},duplicateBranchRoot:o=>{const u=l().graphNodes.find(d=>d.id===o);if(!u)return o;const r=Zl();l().graphNodes.filter(d=>!d.data.parentServerNodeId).length;const f={id:r,type:"imageNode",position:{x:u.position.x+420,y:u.position.y+40},data:{clientId:r,serverNodeId:null,parentServerNodeId:null,prompt:u.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return n({graphNodes:[...l().graphNodes,f]}),l().scheduleGraphSave(),r},async generateNode(o){const r=l().graphNodes.find(S=>S.id===o)?.data.status==="ready"?l().addSiblingNode(o):o,f=l().graphNodes.find(S=>S.id===r);if(!f)return;const{prompt:d,parentServerNodeId:h}=f.data;if(!d.trim()){l().showToast("Prompt required",!0);return}const m=l(),g=m.getResolvedSize(),v=`fn_${r}`,y=Date.now(),x=[...m.inFlight,{id:v,prompt:d,startedAt:y}];ka(x),n({graphNodes:l().graphNodes.map(S=>S.id===r?{...S,data:{...S.data,status:"pending",pendingRequestId:v,pendingPhase:"queued",error:void 0}}:S),activeGenerations:m.activeGenerations+1,inFlight:x}),l().startInFlightPolling();try{const S=await bx({parentNodeId:h,prompt:d,quality:m.quality,size:g,format:m.format,requestId:v,sessionId:m.activeSessionId,clientNodeId:r,...m.referenceImages.length&&!h?{references:m.referenceImages.map(_=>_.replace(/^data:[^;]+;base64,/,""))}:{}});n({graphNodes:l().graphNodes.map(_=>_.id===r?{..._,data:{..._.data,serverNodeId:S.nodeId,imageUrl:S.url,status:"ready",pendingRequestId:null,pendingPhase:null,elapsed:S.elapsed,webSearchCalls:S.webSearchCalls}}:_)}),l().showToast(`Node ${S.nodeId.slice(0,8)}… in ${S.elapsed}s`)}catch(S){const _=S instanceof Error?S.message:"Node generation failed";n({graphNodes:l().graphNodes.map(T=>T.id===r?{...T,data:{...T.data,status:"error",pendingRequestId:null,pendingPhase:null,error:_}}:T)}),l().showToast(_,!0)}finally{const S=l().inFlight.filter(_=>_.id!==v);ka(S),n({activeGenerations:Math.max(0,l().activeGenerations-1),inFlight:S}),l().scheduleGraphSave()}},deleteNode:o=>{const r=l().graphNodes.find(f=>f.id===o)?.data?.pendingRequestId;r&&km(r),n({graphNodes:l().graphNodes.filter(f=>f.id!==o),graphEdges:l().graphEdges.filter(f=>f.source!==o&&f.target!==o)}),l().scheduleGraphSave()},deleteNodes:o=>{const u=new Set(o);for(const r of l().graphNodes)u.has(r.id)&&r.data?.pendingRequestId&&km(r.data.pendingRequestId);n({graphNodes:l().graphNodes.filter(r=>!u.has(r.id)),graphEdges:l().graphEdges.filter(r=>!u.has(r.source)&&!u.has(r.target))}),l().scheduleGraphSave()},addChildNodeAt:(o,u)=>{const r=l().graphNodes.find(m=>m.id===o);if(!r)return o;const f=Zl(),d={id:f,type:"imageNode",position:u,data:{clientId:f,serverNodeId:null,parentServerNodeId:r.data.serverNodeId,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},h={id:`${o}->${f}`,source:o,target:f};return n({graphNodes:[...l().graphNodes,d],graphEdges:[...l().graphEdges,h]}),l().scheduleGraphSave(),f},connectNodes:(o,u)=>{if(o===u||l().graphEdges.find(d=>d.source===o&&d.target===u))return;const f=l().graphNodes.find(d=>d.id===o);f&&(n({graphNodes:l().graphNodes.map(d=>d.id===u?{...d,data:{...d.data,parentServerNodeId:f.data.serverNodeId}}:d),graphEdges:[...l().graphEdges,{id:`${o}->${u}`,source:o,target:u}]}),l().scheduleGraphSave())},setProvider:o=>n({provider:o}),setQuality:o=>n({quality:o}),setSizePreset:o=>n({sizePreset:o}),setCustomSize:(o,u)=>n({customW:Km(o),customH:Km(u)}),setFormat:o=>n({format:o}),setModeration:o=>n({moderation:o}),setCount:o=>n({count:o}),setPrompt:o=>n({prompt:o}),selectHistory:o=>{lo(o.filename??null),n({currentImage:o})},removeFromHistory:o=>{const u=l(),r=u.history.filter(d=>d.filename!==o),f=u.currentImage&&u.currentImage.filename===o?null:u.currentImage;n({history:r,currentImage:f}),f===null&&lo(null)},addHistoryItem:o=>{const u=l();if(u.history.some(d=>o.filename&&d.filename===o.filename))return;const f={...o,createdAt:o.createdAt||Date.now()};n({history:[f,...u.history].slice(0,io)})},getResolvedSize:()=>{const{sizePreset:o,customW:u,customH:r}=l();return o==="custom"?`${u}x${r}`:o},async generate(){const o=l(),u=o.prompt.trim();if(!u)return;const r=o.getResolvedSize(),f=`f_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,d=Date.now(),h=[...o.inFlight,{id:f,prompt:u,startedAt:d}];ka(h),n({activeGenerations:o.activeGenerations+1,inFlight:h}),l().startInFlightPolling();try{const m={prompt:u,quality:o.quality,size:r,format:o.format,moderation:o.moderation,provider:o.provider,n:o.count,requestId:f,...o.referenceImages.length?{references:o.referenceImages.map(v=>v.replace(/^data:[^;]+;base64,/,""))}:{}},g=await yx(m);if($m(g)&&g.images.length>1){for(const v of g.images){const y={image:v.image,filename:v.filename,prompt:u,elapsed:g.elapsed,provider:g.provider,usage:g.usage,quality:g.quality??o.quality,size:g.size??r};await Wm(y,n,l)}l().showToast(`${g.images.length} images in ${g.elapsed}s`)}else{let v;if($m(g)){const y=g.images[0];v={image:y.image,filename:y.filename,prompt:u,elapsed:g.elapsed,provider:g.provider,usage:g.usage,quality:g.quality??o.quality,size:g.size??r}}else v={image:g.image,filename:g.filename,prompt:u,elapsed:g.elapsed,provider:g.provider,usage:g.usage,quality:g.quality??o.quality,size:g.size??r};await Wm(v,n,l),l().showToast(`Generated in ${g.elapsed}s`)}}catch(m){const g=m instanceof Error?m.message:"Generation failed";l().showToast(g,!0)}finally{const m=l().inFlight.filter(g=>g.id!==f);ka(m),n({activeGenerations:Math.max(0,l().activeGenerations-1),inFlight:m})}},hydrateHistory(){(async()=>{try{const u=(await Im({limit:io})).items.map(r=>({image:r.url,url:r.url,filename:r.filename,prompt:r.prompt||void 0,provider:r.provider,quality:r.quality||void 0,size:r.size||void 0,usage:r.usage??void 0,thumb:r.url,createdAt:r.createdAt}));if(u.length>0){const r=Fm(),f=r?u.find(d=>d.filename===r):null;n({history:u,currentImage:f??u[0]}),f||lo(u[0]?.filename??null)}}catch(o){console.warn("[history] load failed:",o)}})()},showToast(o,u=!1){n({toast:{message:o,error:u,id:Date.now()+Math.random()}})}})),jx=800;let fn=null,cs=null;async function Ux(n,l){const o=n().activeSessionId;if(!o)return;const{session:u}=await sp(o),{graphNodes:r,graphEdges:f,graphVersion:d}=cp(u);l({graphNodes:r,graphEdges:f,activeSessionGraphVersion:d}),n().showToast("Session changed in another tab — reloaded latest graph",!0)}function fp(n,l){const o=n().activeSessionId,u=n().activeSessionGraphVersion;if(!o||u==null)return Promise.resolve();const{graphNodes:r,graphEdges:f}=n(),d=r.map(m=>({id:m.id,x:m.position.x,y:m.position.y,data:m.data})),h=f.map(m=>({id:m.id,source:m.source,target:m.target,data:{}}));return Mx(o,u,d,h).then(m=>{l({activeSessionGraphVersion:m.graphVersion})}).catch(async m=>{if(m.status===409){await Ux(n,l);return}console.warn("[sessions] save failed:",m)})}function Bx(n,l){const o=n();o.activeSessionId&&(o.sessionLoading||(fn&&clearTimeout(fn),fn=setTimeout(()=>{fn=null,cs=fp(n,l).finally(()=>{cs=null})},jx)))}async function qx(n,l){fn?(clearTimeout(fn),fn=null,await fp(n,l)):cs&&await cs}function Lx(n){const l=n();if(!l.activeSessionId||l.activeSessionGraphVersion==null)return;fn&&(clearTimeout(fn),fn=null);const o=l.graphNodes.map(d=>({id:d.id,x:d.position.x,y:d.position.y,data:d.data})),u=l.graphEdges.map(d=>({id:d.id,source:d.source,target:d.target,data:{}})),r=`/api/sessions/${encodeURIComponent(l.activeSessionId)}/graph`,f=JSON.stringify({nodes:o,edges:u});try{fetch(r,{method:"PUT",headers:{"Content-Type":"application/json","If-Match":String(l.activeSessionGraphVersion)},body:f,keepalive:!0})}catch{}}async function Wm(n,l,o){const u=await Ax(n.image).catch(()=>n.image),r=n.filename?`/generated/${n.filename}`:n.image,f={...n,thumb:u,url:r,createdAt:n.createdAt||Date.now()},d=[f,...o().history].slice(0,io);lo(f.filename??null),l({history:d,currentImage:f})}function Yx(){const[n,l]=J.useState(null);return J.useEffect(()=>{let o=!1,u=null;const r=async()=>{try{const f=await mx();if(o)return;l(f),f.status==="starting"&&(u=setTimeout(r,3e3))}catch{o||l(null)}};return r(),()=>{o=!0,u&&clearTimeout(u)}},[]),n}function dp(){const[n,l]=J.useState(null),[o,u]=J.useState(!1);return J.useEffect(()=>{let r=!1;return px().then(f=>{r||l(f)}).catch(()=>{r||u(!0)}),()=>{r=!0}},[]),{data:n,error:o}}function Vx({open:n,providerLabel:l,reason:o,hint:u,onClose:r}){return J.useEffect(()=>{if(!n)return;const f=d=>{d.key==="Escape"&&r()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n,r]),n?E.jsx("div",{className:"modal-backdrop",onClick:r,role:"presentation",children:E.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true","aria-label":`${l} unavailable`,onClick:f=>f.stopPropagation(),children:[E.jsxs("div",{className:"modal__title",children:[l," unavailable"]}),E.jsxs("div",{className:"modal__body",children:[E.jsx("p",{children:o}),u?E.jsx("p",{className:"modal__hint",children:u}):null]}),E.jsx("div",{className:"modal__actions",children:E.jsx("button",{type:"button",className:"modal__btn",onClick:r,children:"OK"})})]})}):null}function Gx(){const n=Yx(),{data:l}=dp(),o=n?.status==="ready";let u="OAuth proxy not ready yet.",r;n?.status==="auth_required"?(u="Codex login required.",r="Run `codex login` in a terminal, then reload this page."):n?.status==="starting"?u="OAuth proxy is starting. Wait a few seconds and try again.":n||(u="Cannot reach the server. Check that the backend is running.");const f=l?.apiKeyValid===!0;return{oauth:{ok:o,reason:u,hint:r},api:{ok:f,reason:f?"":"API key is not configured or invalid. Set OPENAI_API_KEY in the server .env file."}}}const Pm=[{value:"oauth",label:"OAuth"},{value:"api",label:"API Key"}];function Xx(){const n=de(h=>h.provider),l=de(h=>h.setProvider),o=Gx(),[u,r]=J.useState(null),f=h=>{o[h].ok?l(h):r(h)},d=u?{label:Pm.find(h=>h.value===u).label,...o[u]}:null;return E.jsxs(E.Fragment,{children:[E.jsx("div",{className:"section-title",children:"Provider"}),E.jsx("div",{className:"provider-row",children:Pm.map(h=>{const m=n===h.value,g=o[h.value].ok;return E.jsxs("button",{type:"button",className:`provider-pill${m?" selected":""}`,onClick:()=>f(h.value),title:g?`${h.label} ready`:o[h.value].reason,"aria-label":`${h.label}: ${g?"ready":"unavailable"}`,"aria-pressed":m,children:[E.jsx("span",{className:`status-dot ${g?"status-dot--ok":"status-dot--bad"}`,"aria-hidden":"true"}),E.jsx("span",{children:h.label}),E.jsx("span",{className:"sr-only",children:g?"(ready)":"(unavailable)"})]},h.value)})}),E.jsx(Vx,{open:!!d,providerLabel:d?.label??"",reason:d?.reason??"",hint:d?.hint,onClose:()=>r(null)})]})}function Zx(){return de(n=>n.uiMode),de(n=>n.setUIMode),null}const Ql=5;function Qx(){const n=de(N=>N.prompt),l=de(N=>N.setPrompt),o=de(N=>N.generate),u=de(N=>N.referenceImages),r=de(N=>N.addReferences),f=de(N=>N.removeReference),d=de(N=>N.useCurrentAsReference),h=de(N=>N.currentImage),m=J.useRef(null),[g,v]=J.useState(!1),y=u.length<Ql,x=N=>{N.preventDefault(),v(!1);const U=Array.from(N.dataTransfer.files).filter(w=>w.type.startsWith("image/"));U.length>0&&r(U)},S=N=>{N.preventDefault(),g||v(!0)},_=N=>{N.currentTarget.contains(N.relatedTarget)||v(!1)},T=N=>{if(!N)return[];const U=[];for(const w of Array.from(N)){if(w.kind!=="file"||!w.type.startsWith("image/"))continue;const C=w.getAsFile();C&&U.push(C)}return U},z=N=>{if(!y)return;const U=T(N.clipboardData?.items??null);if(U.length===0)return;N.preventDefault();const w=Ql-u.length;r(U.slice(0,w))};return J.useEffect(()=>{const N=U=>{const w=U.target,C=w?.tagName;if(C==="INPUT"||C==="TEXTAREA"||w?.isContentEditable)return;const V=T(U.clipboardData?.items??null);if(V.length===0||u.length>=Ql)return;U.preventDefault();const L=Ql-u.length;r(V.slice(0,L))};return window.addEventListener("paste",N),()=>window.removeEventListener("paste",N)},[u.length,r]),E.jsxs("div",{className:`composer${g?" composer--drag":""}`,onDrop:x,onDragOver:S,onDragLeave:_,onPaste:z,children:[E.jsxs("div",{className:"composer__header",children:[E.jsx("span",{className:"section-title composer__label",children:"Prompt"}),u.length>0&&E.jsxs("span",{className:"composer__count",children:[u.length,"/",Ql," refs"]})]}),u.length>0&&E.jsx("div",{className:"composer__chips",children:u.map((N,U)=>E.jsxs("div",{className:"composer__chip",title:`Reference ${U+1}`,children:[E.jsx("img",{src:N,alt:`reference ${U+1}`}),E.jsx("button",{type:"button",className:"composer__chip-remove",onClick:()=>f(U),"aria-label":`Remove reference ${U+1}`,children:"✕"})]},U))}),E.jsx("textarea",{className:"prompt-area composer__textarea",value:n,placeholder:u.length>0?"Describe what to do with the attached image(s)…":"Describe the image, drag & drop, or paste (⌘/Ctrl+V) to attach…",onChange:N=>l(N.target.value),onKeyDown:N=>{N.key==="Enter"&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),o())}}),E.jsxs("div",{className:"composer__toolbar",children:[E.jsxs("button",{type:"button",className:"composer__tool",onClick:()=>y&&m.current?.click(),disabled:!y,title:"Attach reference image","aria-label":"Attach reference image",children:[E.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:E.jsx("path",{d:"M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48"})}),E.jsx("span",{children:"Attach"})]}),E.jsxs("button",{type:"button",className:"composer__tool",onClick:()=>{d()},disabled:!h||!y,title:"Use current result as reference",children:[E.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[E.jsx("polyline",{points:"23 4 23 10 17 10"}),E.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),E.jsx("span",{children:"Use current"})]}),E.jsx("span",{className:"composer__hint",children:"⌘/Ctrl + Enter to generate"})]}),g&&E.jsxs("div",{className:"composer__dropzone","aria-hidden":"true",children:["Drop to attach as reference (max ",Ql,")"]}),E.jsx("input",{ref:m,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:N=>{const U=Array.from(N.target.files??[]);U.length>0&&r(U),N.target.value=""}})]})}function $x(){const n=de(r=>r.activeGenerations),l=de(r=>r.generate),o=n>0,u=o?`Generate (${n})`:"Generate";return E.jsx("button",{type:"button",className:`generate-btn${o?" loading":""}`,onClick:()=>{l()},children:u})}function kx(n,l=28){const o=n.trim().replace(/\s+/g," ");return o.length>l?o.slice(0,l)+"…":o}const Ix={queued:"queued",streaming:"streaming",decoding:"finalizing"};function Kx(){const n=de(l=>l.inFlight);return n.length===0?null:E.jsx("ul",{className:"in-flight-list",children:n.map(l=>{const o=l.phase?Ix[l.phase]??l.phase:"queued";return E.jsxs("li",{className:"in-flight-item","data-phase":l.phase??"queued",children:[E.jsx("span",{className:"in-flight-prompt",children:kx(l.prompt)}),E.jsx("span",{className:"in-flight-phase",children:o}),E.jsx("span",{className:"in-flight-spinner","aria-hidden":"true"})]},l.id)})})}function Jx(){const n=de(r=>r.history),l=de(r=>r.currentImage),o=de(r=>r.selectHistory),u=de(r=>r.openGallery);return E.jsxs("div",{className:"history-strip",children:[E.jsx("button",{type:"button",className:"history-thumb history-thumb--add",onClick:u,"aria-label":"Open gallery",title:"Open full gallery",children:E.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[E.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),E.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),E.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),E.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})}),n.map((r,f)=>{const d=r.filename?l?.filename===r.filename:l?.image===r.image;return E.jsx("img",{src:r.thumb||r.url||r.image,alt:"",className:`history-thumb${d?" active":""}`,onClick:()=>o(r)},r.filename??`${f}-${r.image}`)})]})}function Fx(){return de(n=>n.uiMode),E.jsxs("aside",{className:"sidebar",children:[E.jsxs("div",{className:"sidebar__scroll",children:[E.jsxs("div",{className:"logo",children:[E.jsx("div",{className:"logo-dot"}),"Image Gen",E.jsx("span",{className:"logo-badge",children:"gpt-image-2"})]}),E.jsx(Zx,{}),E.jsxs(E.Fragment,{children:[E.jsx(Xx,{}),E.jsx(Qx,{}),E.jsx($x,{}),E.jsx(Kx,{})]})]}),E.jsx(Jx,{})]})}function Wx(){const n=de(h=>h.currentImage),l=de(h=>h.showToast),o=de(h=>h.setPrompt);if(!n)return null;const u=()=>{const h=document.createElement("a");h.href=n.image,h.download=n.filename||"generated.png",h.click()},r=async()=>{try{const m=await(await fetch(n.image)).blob();await navigator.clipboard.write([new ClipboardItem({[m.type]:m})]),l("Copied to clipboard")}catch{l("Copy failed",!0)}},f=()=>{n.prompt&&(navigator.clipboard.writeText(n.prompt),l("Prompt copied"))},d=()=>{if(!n.prompt){l("No prompt to seed from",!0);return}o(n.prompt);const h=document.querySelector('textarea[name="prompt"], textarea#prompt, .sidebar textarea');h&&(h.focus(),h.setSelectionRange(h.value.length,h.value.length)),l("Seeded from this image — edit and generate")};return E.jsxs("div",{className:"result-actions",children:[E.jsx("button",{type:"button",className:"action-btn",onClick:u,children:"Download"}),E.jsx("button",{type:"button",className:"action-btn",onClick:r,children:"Copy to clipboard"}),E.jsx("button",{type:"button",className:"action-btn",onClick:f,children:"Copy prompt"}),E.jsx("button",{type:"button",className:"action-btn action-btn--primary",onClick:d,title:"Seed prompt from this image and continue",children:"New from here"})]})}function Px(){const n=de(m=>m.currentImage),l=de(m=>m.activeGenerations),o=de(m=>m.quality),u=de(m=>m.getResolvedSize),r=de(m=>m.showToast),f=()=>{n?.prompt&&(navigator.clipboard.writeText(n.prompt),r("Prompt copied"))},d=n?.quality??o,h=n?.size??u();return E.jsxs("main",{className:"canvas",children:[E.jsx("div",{className:`progress-bar${l>0?" active":""}`}),n?E.jsxs("div",{className:"result-container visible",children:[E.jsx("img",{className:"result-img",src:n.url??n.image,alt:"result"},n.filename??n.url??n.image),n.prompt?E.jsx("div",{className:"result-prompt",onClick:f,children:n.prompt}):null,E.jsx("div",{className:"result-meta",children:[n.elapsed!=null?`${n.elapsed}s`:null,n.usage?`${n.usage.total_tokens??"?"} tokens`:null,d,h,n.provider??null].filter(m=>!!m).join(" · ")}),E.jsx(Wx,{})]}):null]})}function at(n){if(typeof n=="string"||typeof n=="number")return""+n;let l="";if(Array.isArray(n))for(let o=0,u;o<n.length;o++)(u=at(n[o]))!==""&&(l+=(l&&" ")+u);else for(let o in n)n[o]&&(l+=(l&&" ")+o);return l}var eS={value:()=>{}};function _s(){for(var n=0,l=arguments.length,o={},u;n<l;++n){if(!(u=arguments[n]+"")||u in o||/[\s.]/.test(u))throw new Error("illegal type: "+u);o[u]=[]}return new is(o)}function is(n){this._=n}function tS(n,l){return n.trim().split(/^|\s+/).map(function(o){var u="",r=o.indexOf(".");if(r>=0&&(u=o.slice(r+1),o=o.slice(0,r)),o&&!l.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:u}})}is.prototype=_s.prototype={constructor:is,on:function(n,l){var o=this._,u=tS(n+"",o),r,f=-1,d=u.length;if(arguments.length<2){for(;++f<d;)if((r=(n=u[f]).type)&&(r=nS(o[r],n.name)))return r;return}if(l!=null&&typeof l!="function")throw new Error("invalid callback: "+l);for(;++f<d;)if(r=(n=u[f]).type)o[r]=e0(o[r],n.name,l);else if(l==null)for(r in o)o[r]=e0(o[r],n.name,null);return this},copy:function(){var n={},l=this._;for(var o in l)n[o]=l[o].slice();return new is(n)},call:function(n,l){if((r=arguments.length-2)>0)for(var o=new Array(r),u=0,r,f;u<r;++u)o[u]=arguments[u+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(f=this._[n],u=0,r=f.length;u<r;++u)f[u].value.apply(l,o)},apply:function(n,l,o){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var u=this._[n],r=0,f=u.length;r<f;++r)u[r].value.apply(l,o)}};function nS(n,l){for(var o=0,u=n.length,r;o<u;++o)if((r=n[o]).name===l)return r.value}function e0(n,l,o){for(var u=0,r=n.length;u<r;++u)if(n[u].name===l){n[u]=eS,n=n.slice(0,u).concat(n.slice(u+1));break}return o!=null&&n.push({name:l,value:o}),n}var xf="http://www.w3.org/1999/xhtml";const t0={svg:"http://www.w3.org/2000/svg",xhtml:xf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Es(n){var l=n+="",o=l.indexOf(":");return o>=0&&(l=n.slice(0,o))!=="xmlns"&&(n=n.slice(o+1)),t0.hasOwnProperty(l)?{space:t0[l],local:n}:n}function aS(n){return function(){var l=this.ownerDocument,o=this.namespaceURI;return o===xf&&l.documentElement.namespaceURI===xf?l.createElement(n):l.createElementNS(o,n)}}function lS(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function hp(n){var l=Es(n);return(l.local?lS:aS)(l)}function iS(){}function Hf(n){return n==null?iS:function(){return this.querySelector(n)}}function oS(n){typeof n!="function"&&(n=Hf(n));for(var l=this._groups,o=l.length,u=new Array(o),r=0;r<o;++r)for(var f=l[r],d=f.length,h=u[r]=new Array(d),m,g,v=0;v<d;++v)(m=f[v])&&(g=n.call(m,m.__data__,v,f))&&("__data__"in m&&(g.__data__=m.__data__),h[v]=g);return new Bt(u,this._parents)}function uS(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function sS(){return[]}function gp(n){return n==null?sS:function(){return this.querySelectorAll(n)}}function rS(n){return function(){return uS(n.apply(this,arguments))}}function cS(n){typeof n=="function"?n=rS(n):n=gp(n);for(var l=this._groups,o=l.length,u=[],r=[],f=0;f<o;++f)for(var d=l[f],h=d.length,m,g=0;g<h;++g)(m=d[g])&&(u.push(n.call(m,m.__data__,g,d)),r.push(m));return new Bt(u,r)}function mp(n){return function(){return this.matches(n)}}function pp(n){return function(l){return l.matches(n)}}var fS=Array.prototype.find;function dS(n){return function(){return fS.call(this.children,n)}}function hS(){return this.firstElementChild}function gS(n){return this.select(n==null?hS:dS(typeof n=="function"?n:pp(n)))}var mS=Array.prototype.filter;function pS(){return Array.from(this.children)}function yS(n){return function(){return mS.call(this.children,n)}}function vS(n){return this.selectAll(n==null?pS:yS(typeof n=="function"?n:pp(n)))}function xS(n){typeof n!="function"&&(n=mp(n));for(var l=this._groups,o=l.length,u=new Array(o),r=0;r<o;++r)for(var f=l[r],d=f.length,h=u[r]=[],m,g=0;g<d;++g)(m=f[g])&&n.call(m,m.__data__,g,f)&&h.push(m);return new Bt(u,this._parents)}function yp(n){return new Array(n.length)}function SS(){return new Bt(this._enter||this._groups.map(yp),this._parents)}function fs(n,l){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=l}fs.prototype={constructor:fs,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,l){return this._parent.insertBefore(n,l)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};function bS(n){return function(){return n}}function _S(n,l,o,u,r,f){for(var d=0,h,m=l.length,g=f.length;d<g;++d)(h=l[d])?(h.__data__=f[d],u[d]=h):o[d]=new fs(n,f[d]);for(;d<m;++d)(h=l[d])&&(r[d]=h)}function ES(n,l,o,u,r,f,d){var h,m,g=new Map,v=l.length,y=f.length,x=new Array(v),S;for(h=0;h<v;++h)(m=l[h])&&(x[h]=S=d.call(m,m.__data__,h,l)+"",g.has(S)?r[h]=m:g.set(S,m));for(h=0;h<y;++h)S=d.call(n,f[h],h,f)+"",(m=g.get(S))?(u[h]=m,m.__data__=f[h],g.delete(S)):o[h]=new fs(n,f[h]);for(h=0;h<v;++h)(m=l[h])&&g.get(x[h])===m&&(r[h]=m)}function wS(n){return n.__data__}function NS(n,l){if(!arguments.length)return Array.from(this,wS);var o=l?ES:_S,u=this._parents,r=this._groups;typeof n!="function"&&(n=bS(n));for(var f=r.length,d=new Array(f),h=new Array(f),m=new Array(f),g=0;g<f;++g){var v=u[g],y=r[g],x=y.length,S=MS(n.call(v,v&&v.__data__,g,u)),_=S.length,T=h[g]=new Array(_),z=d[g]=new Array(_),N=m[g]=new Array(x);o(v,y,T,z,N,S,l);for(var U=0,w=0,C,V;U<_;++U)if(C=T[U]){for(U>=w&&(w=U+1);!(V=z[w])&&++w<_;);C._next=V||null}}return d=new Bt(d,u),d._enter=h,d._exit=m,d}function MS(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function AS(){return new Bt(this._exit||this._groups.map(yp),this._parents)}function TS(n,l,o){var u=this.enter(),r=this,f=this.exit();return typeof n=="function"?(u=n(u),u&&(u=u.selection())):u=u.append(n+""),l!=null&&(r=l(r),r&&(r=r.selection())),o==null?f.remove():o(f),u&&r?u.merge(r).order():r}function zS(n){for(var l=n.selection?n.selection():n,o=this._groups,u=l._groups,r=o.length,f=u.length,d=Math.min(r,f),h=new Array(r),m=0;m<d;++m)for(var g=o[m],v=u[m],y=g.length,x=h[m]=new Array(y),S,_=0;_<y;++_)(S=g[_]||v[_])&&(x[_]=S);for(;m<r;++m)h[m]=o[m];return new Bt(h,this._parents)}function CS(){for(var n=this._groups,l=-1,o=n.length;++l<o;)for(var u=n[l],r=u.length-1,f=u[r],d;--r>=0;)(d=u[r])&&(f&&d.compareDocumentPosition(f)^4&&f.parentNode.insertBefore(d,f),f=d);return this}function DS(n){n||(n=OS);function l(y,x){return y&&x?n(y.__data__,x.__data__):!y-!x}for(var o=this._groups,u=o.length,r=new Array(u),f=0;f<u;++f){for(var d=o[f],h=d.length,m=r[f]=new Array(h),g,v=0;v<h;++v)(g=d[v])&&(m[v]=g);m.sort(l)}return new Bt(r,this._parents).order()}function OS(n,l){return n<l?-1:n>l?1:n>=l?0:NaN}function RS(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function HS(){return Array.from(this)}function jS(){for(var n=this._groups,l=0,o=n.length;l<o;++l)for(var u=n[l],r=0,f=u.length;r<f;++r){var d=u[r];if(d)return d}return null}function US(){let n=0;for(const l of this)++n;return n}function BS(){return!this.node()}function qS(n){for(var l=this._groups,o=0,u=l.length;o<u;++o)for(var r=l[o],f=0,d=r.length,h;f<d;++f)(h=r[f])&&n.call(h,h.__data__,f,r);return this}function LS(n){return function(){this.removeAttribute(n)}}function YS(n){return function(){this.removeAttributeNS(n.space,n.local)}}function VS(n,l){return function(){this.setAttribute(n,l)}}function GS(n,l){return function(){this.setAttributeNS(n.space,n.local,l)}}function XS(n,l){return function(){var o=l.apply(this,arguments);o==null?this.removeAttribute(n):this.setAttribute(n,o)}}function ZS(n,l){return function(){var o=l.apply(this,arguments);o==null?this.removeAttributeNS(n.space,n.local):this.setAttributeNS(n.space,n.local,o)}}function QS(n,l){var o=Es(n);if(arguments.length<2){var u=this.node();return o.local?u.getAttributeNS(o.space,o.local):u.getAttribute(o)}return this.each((l==null?o.local?YS:LS:typeof l=="function"?o.local?ZS:XS:o.local?GS:VS)(o,l))}function vp(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function $S(n){return function(){this.style.removeProperty(n)}}function kS(n,l,o){return function(){this.style.setProperty(n,l,o)}}function IS(n,l,o){return function(){var u=l.apply(this,arguments);u==null?this.style.removeProperty(n):this.style.setProperty(n,u,o)}}function KS(n,l,o){return arguments.length>1?this.each((l==null?$S:typeof l=="function"?IS:kS)(n,l,o??"")):Fl(this.node(),n)}function Fl(n,l){return n.style.getPropertyValue(l)||vp(n).getComputedStyle(n,null).getPropertyValue(l)}function JS(n){return function(){delete this[n]}}function FS(n,l){return function(){this[n]=l}}function WS(n,l){return function(){var o=l.apply(this,arguments);o==null?delete this[n]:this[n]=o}}function PS(n,l){return arguments.length>1?this.each((l==null?JS:typeof l=="function"?WS:FS)(n,l)):this.node()[n]}function xp(n){return n.trim().split(/^|\s+/)}function jf(n){return n.classList||new Sp(n)}function Sp(n){this._node=n,this._names=xp(n.getAttribute("class")||"")}Sp.prototype={add:function(n){var l=this._names.indexOf(n);l<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var l=this._names.indexOf(n);l>=0&&(this._names.splice(l,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function bp(n,l){for(var o=jf(n),u=-1,r=l.length;++u<r;)o.add(l[u])}function _p(n,l){for(var o=jf(n),u=-1,r=l.length;++u<r;)o.remove(l[u])}function eb(n){return function(){bp(this,n)}}function tb(n){return function(){_p(this,n)}}function nb(n,l){return function(){(l.apply(this,arguments)?bp:_p)(this,n)}}function ab(n,l){var o=xp(n+"");if(arguments.length<2){for(var u=jf(this.node()),r=-1,f=o.length;++r<f;)if(!u.contains(o[r]))return!1;return!0}return this.each((typeof l=="function"?nb:l?eb:tb)(o,l))}function lb(){this.textContent=""}function ib(n){return function(){this.textContent=n}}function ob(n){return function(){var l=n.apply(this,arguments);this.textContent=l??""}}function ub(n){return arguments.length?this.each(n==null?lb:(typeof n=="function"?ob:ib)(n)):this.node().textContent}function sb(){this.innerHTML=""}function rb(n){return function(){this.innerHTML=n}}function cb(n){return function(){var l=n.apply(this,arguments);this.innerHTML=l??""}}function fb(n){return arguments.length?this.each(n==null?sb:(typeof n=="function"?cb:rb)(n)):this.node().innerHTML}function db(){this.nextSibling&&this.parentNode.appendChild(this)}function hb(){return this.each(db)}function gb(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function mb(){return this.each(gb)}function pb(n){var l=typeof n=="function"?n:hp(n);return this.select(function(){return this.appendChild(l.apply(this,arguments))})}function yb(){return null}function vb(n,l){var o=typeof n=="function"?n:hp(n),u=l==null?yb:typeof l=="function"?l:Hf(l);return this.select(function(){return this.insertBefore(o.apply(this,arguments),u.apply(this,arguments)||null)})}function xb(){var n=this.parentNode;n&&n.removeChild(this)}function Sb(){return this.each(xb)}function bb(){var n=this.cloneNode(!1),l=this.parentNode;return l?l.insertBefore(n,this.nextSibling):n}function _b(){var n=this.cloneNode(!0),l=this.parentNode;return l?l.insertBefore(n,this.nextSibling):n}function Eb(n){return this.select(n?_b:bb)}function wb(n){return arguments.length?this.property("__data__",n):this.node().__data__}function Nb(n){return function(l){n.call(this,l,this.__data__)}}function Mb(n){return n.trim().split(/^|\s+/).map(function(l){var o="",u=l.indexOf(".");return u>=0&&(o=l.slice(u+1),l=l.slice(0,u)),{type:l,name:o}})}function Ab(n){return function(){var l=this.__on;if(l){for(var o=0,u=-1,r=l.length,f;o<r;++o)f=l[o],(!n.type||f.type===n.type)&&f.name===n.name?this.removeEventListener(f.type,f.listener,f.options):l[++u]=f;++u?l.length=u:delete this.__on}}}function Tb(n,l,o){return function(){var u=this.__on,r,f=Nb(l);if(u){for(var d=0,h=u.length;d<h;++d)if((r=u[d]).type===n.type&&r.name===n.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=f,r.options=o),r.value=l;return}}this.addEventListener(n.type,f,o),r={type:n.type,name:n.name,value:l,listener:f,options:o},u?u.push(r):this.__on=[r]}}function zb(n,l,o){var u=Mb(n+""),r,f=u.length,d;if(arguments.length<2){var h=this.node().__on;if(h){for(var m=0,g=h.length,v;m<g;++m)for(r=0,v=h[m];r<f;++r)if((d=u[r]).type===v.type&&d.name===v.name)return v.value}return}for(h=l?Tb:Ab,r=0;r<f;++r)this.each(h(u[r],l,o));return this}function Ep(n,l,o){var u=vp(n),r=u.CustomEvent;typeof r=="function"?r=new r(l,o):(r=u.document.createEvent("Event"),o?(r.initEvent(l,o.bubbles,o.cancelable),r.detail=o.detail):r.initEvent(l,!1,!1)),n.dispatchEvent(r)}function Cb(n,l){return function(){return Ep(this,n,l)}}function Db(n,l){return function(){return Ep(this,n,l.apply(this,arguments))}}function Ob(n,l){return this.each((typeof l=="function"?Db:Cb)(n,l))}function*Rb(){for(var n=this._groups,l=0,o=n.length;l<o;++l)for(var u=n[l],r=0,f=u.length,d;r<f;++r)(d=u[r])&&(yield d)}var wp=[null];function Bt(n,l){this._groups=n,this._parents=l}function bo(){return new Bt([[document.documentElement]],wp)}function Hb(){return this}Bt.prototype=bo.prototype={constructor:Bt,select:oS,selectAll:cS,selectChild:gS,selectChildren:vS,filter:xS,data:NS,enter:SS,exit:AS,join:TS,merge:zS,selection:Hb,order:CS,sort:DS,call:RS,nodes:HS,node:jS,size:US,empty:BS,each:qS,attr:QS,style:KS,property:PS,classed:ab,text:ub,html:fb,raise:hb,lower:mb,append:pb,insert:vb,remove:Sb,clone:Eb,datum:wb,on:zb,dispatch:Ob,[Symbol.iterator]:Rb};function Ut(n){return typeof n=="string"?new Bt([[document.querySelector(n)]],[document.documentElement]):new Bt([[n]],wp)}function jb(n){let l;for(;l=n.sourceEvent;)n=l;return n}function Wt(n,l){if(n=jb(n),l===void 0&&(l=n.currentTarget),l){var o=l.ownerSVGElement||l;if(o.createSVGPoint){var u=o.createSVGPoint();return u.x=n.clientX,u.y=n.clientY,u=u.matrixTransform(l.getScreenCTM().inverse()),[u.x,u.y]}if(l.getBoundingClientRect){var r=l.getBoundingClientRect();return[n.clientX-r.left-l.clientLeft,n.clientY-r.top-l.clientTop]}}return[n.pageX,n.pageY]}const Ub={passive:!1},co={capture:!0,passive:!1};function of(n){n.stopImmediatePropagation()}function Kl(n){n.preventDefault(),n.stopImmediatePropagation()}function Np(n){var l=n.document.documentElement,o=Ut(n).on("dragstart.drag",Kl,co);"onselectstart"in l?o.on("selectstart.drag",Kl,co):(l.__noselect=l.style.MozUserSelect,l.style.MozUserSelect="none")}function Mp(n,l){var o=n.document.documentElement,u=Ut(n).on("dragstart.drag",null);l&&(u.on("click.drag",Kl,co),setTimeout(function(){u.on("click.drag",null)},0)),"onselectstart"in o?u.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const Ju=n=>()=>n;function Sf(n,{sourceEvent:l,subject:o,target:u,identifier:r,active:f,x:d,y:h,dx:m,dy:g,dispatch:v}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:l,enumerable:!0,configurable:!0},subject:{value:o,enumerable:!0,configurable:!0},target:{value:u,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:f,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:h,enumerable:!0,configurable:!0},dx:{value:m,enumerable:!0,configurable:!0},dy:{value:g,enumerable:!0,configurable:!0},_:{value:v}})}Sf.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function Bb(n){return!n.ctrlKey&&!n.button}function qb(){return this.parentNode}function Lb(n,l){return l??{x:n.x,y:n.y}}function Yb(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ap(){var n=Bb,l=qb,o=Lb,u=Yb,r={},f=_s("start","drag","end"),d=0,h,m,g,v,y=0;function x(C){C.on("mousedown.drag",S).filter(u).on("touchstart.drag",z).on("touchmove.drag",N,Ub).on("touchend.drag touchcancel.drag",U).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function S(C,V){if(!(v||!n.call(this,C,V))){var L=w(this,l.call(this,C,V),C,V,"mouse");L&&(Ut(C.view).on("mousemove.drag",_,co).on("mouseup.drag",T,co),Np(C.view),of(C),g=!1,h=C.clientX,m=C.clientY,L("start",C))}}function _(C){if(Kl(C),!g){var V=C.clientX-h,L=C.clientY-m;g=V*V+L*L>y}r.mouse("drag",C)}function T(C){Ut(C.view).on("mousemove.drag mouseup.drag",null),Mp(C.view,g),Kl(C),r.mouse("end",C)}function z(C,V){if(n.call(this,C,V)){var L=C.changedTouches,Y=l.call(this,C,V),R=L.length,X,ie;for(X=0;X<R;++X)(ie=w(this,Y,C,V,L[X].identifier,L[X]))&&(of(C),ie("start",C,L[X]))}}function N(C){var V=C.changedTouches,L=V.length,Y,R;for(Y=0;Y<L;++Y)(R=r[V[Y].identifier])&&(Kl(C),R("drag",C,V[Y]))}function U(C){var V=C.changedTouches,L=V.length,Y,R;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),Y=0;Y<L;++Y)(R=r[V[Y].identifier])&&(of(C),R("end",C,V[Y]))}function w(C,V,L,Y,R,X){var ie=f.copy(),Z=Wt(X||L,V),W,oe,D;if((D=o.call(C,new Sf("beforestart",{sourceEvent:L,target:x,identifier:R,active:d,x:Z[0],y:Z[1],dx:0,dy:0,dispatch:ie}),Y))!=null)return W=D.x-Z[0]||0,oe=D.y-Z[1]||0,function Q(M,H,q){var $=Z,ee;switch(M){case"start":r[R]=Q,ee=d++;break;case"end":delete r[R],--d;case"drag":Z=Wt(q||H,V),ee=d;break}ie.call(M,C,new Sf(M,{sourceEvent:H,subject:D,target:x,identifier:R,active:ee,x:Z[0]+W,y:Z[1]+oe,dx:Z[0]-$[0],dy:Z[1]-$[1],dispatch:ie}),Y)}}return x.filter=function(C){return arguments.length?(n=typeof C=="function"?C:Ju(!!C),x):n},x.container=function(C){return arguments.length?(l=typeof C=="function"?C:Ju(C),x):l},x.subject=function(C){return arguments.length?(o=typeof C=="function"?C:Ju(C),x):o},x.touchable=function(C){return arguments.length?(u=typeof C=="function"?C:Ju(!!C),x):u},x.on=function(){var C=f.on.apply(f,arguments);return C===f?x:C},x.clickDistance=function(C){return arguments.length?(y=(C=+C)*C,x):Math.sqrt(y)},x}function Uf(n,l,o){n.prototype=l.prototype=o,o.constructor=n}function Tp(n,l){var o=Object.create(n.prototype);for(var u in l)o[u]=l[u];return o}function _o(){}var fo=.7,ds=1/fo,Jl="\\s*([+-]?\\d+)\\s*",ho="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",dn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",Vb=/^#([0-9a-f]{3,8})$/,Gb=new RegExp(`^rgb\\(${Jl},${Jl},${Jl}\\)$`),Xb=new RegExp(`^rgb\\(${dn},${dn},${dn}\\)$`),Zb=new RegExp(`^rgba\\(${Jl},${Jl},${Jl},${ho}\\)$`),Qb=new RegExp(`^rgba\\(${dn},${dn},${dn},${ho}\\)$`),$b=new RegExp(`^hsl\\(${ho},${dn},${dn}\\)$`),kb=new RegExp(`^hsla\\(${ho},${dn},${dn},${ho}\\)$`),n0={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};Uf(_o,Wa,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:a0,formatHex:a0,formatHex8:Ib,formatHsl:Kb,formatRgb:l0,toString:l0});function a0(){return this.rgb().formatHex()}function Ib(){return this.rgb().formatHex8()}function Kb(){return zp(this).formatHsl()}function l0(){return this.rgb().formatRgb()}function Wa(n){var l,o;return n=(n+"").trim().toLowerCase(),(l=Vb.exec(n))?(o=l[1].length,l=parseInt(l[1],16),o===6?i0(l):o===3?new Mt(l>>8&15|l>>4&240,l>>4&15|l&240,(l&15)<<4|l&15,1):o===8?Fu(l>>24&255,l>>16&255,l>>8&255,(l&255)/255):o===4?Fu(l>>12&15|l>>8&240,l>>8&15|l>>4&240,l>>4&15|l&240,((l&15)<<4|l&15)/255):null):(l=Gb.exec(n))?new Mt(l[1],l[2],l[3],1):(l=Xb.exec(n))?new Mt(l[1]*255/100,l[2]*255/100,l[3]*255/100,1):(l=Zb.exec(n))?Fu(l[1],l[2],l[3],l[4]):(l=Qb.exec(n))?Fu(l[1]*255/100,l[2]*255/100,l[3]*255/100,l[4]):(l=$b.exec(n))?s0(l[1],l[2]/100,l[3]/100,1):(l=kb.exec(n))?s0(l[1],l[2]/100,l[3]/100,l[4]):n0.hasOwnProperty(n)?i0(n0[n]):n==="transparent"?new Mt(NaN,NaN,NaN,0):null}function i0(n){return new Mt(n>>16&255,n>>8&255,n&255,1)}function Fu(n,l,o,u){return u<=0&&(n=l=o=NaN),new Mt(n,l,o,u)}function Jb(n){return n instanceof _o||(n=Wa(n)),n?(n=n.rgb(),new Mt(n.r,n.g,n.b,n.opacity)):new Mt}function bf(n,l,o,u){return arguments.length===1?Jb(n):new Mt(n,l,o,u??1)}function Mt(n,l,o,u){this.r=+n,this.g=+l,this.b=+o,this.opacity=+u}Uf(Mt,bf,Tp(_o,{brighter(n){return n=n==null?ds:Math.pow(ds,n),new Mt(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?fo:Math.pow(fo,n),new Mt(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Mt(Ja(this.r),Ja(this.g),Ja(this.b),hs(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:o0,formatHex:o0,formatHex8:Fb,formatRgb:u0,toString:u0}));function o0(){return`#${Ka(this.r)}${Ka(this.g)}${Ka(this.b)}`}function Fb(){return`#${Ka(this.r)}${Ka(this.g)}${Ka(this.b)}${Ka((isNaN(this.opacity)?1:this.opacity)*255)}`}function u0(){const n=hs(this.opacity);return`${n===1?"rgb(":"rgba("}${Ja(this.r)}, ${Ja(this.g)}, ${Ja(this.b)}${n===1?")":`, ${n})`}`}function hs(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Ja(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Ka(n){return n=Ja(n),(n<16?"0":"")+n.toString(16)}function s0(n,l,o,u){return u<=0?n=l=o=NaN:o<=0||o>=1?n=l=NaN:l<=0&&(n=NaN),new Pt(n,l,o,u)}function zp(n){if(n instanceof Pt)return new Pt(n.h,n.s,n.l,n.opacity);if(n instanceof _o||(n=Wa(n)),!n)return new Pt;if(n instanceof Pt)return n;n=n.rgb();var l=n.r/255,o=n.g/255,u=n.b/255,r=Math.min(l,o,u),f=Math.max(l,o,u),d=NaN,h=f-r,m=(f+r)/2;return h?(l===f?d=(o-u)/h+(o<u)*6:o===f?d=(u-l)/h+2:d=(l-o)/h+4,h/=m<.5?f+r:2-f-r,d*=60):h=m>0&&m<1?0:d,new Pt(d,h,m,n.opacity)}function Wb(n,l,o,u){return arguments.length===1?zp(n):new Pt(n,l,o,u??1)}function Pt(n,l,o,u){this.h=+n,this.s=+l,this.l=+o,this.opacity=+u}Uf(Pt,Wb,Tp(_o,{brighter(n){return n=n==null?ds:Math.pow(ds,n),new Pt(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?fo:Math.pow(fo,n),new Pt(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,l=isNaN(n)||isNaN(this.s)?0:this.s,o=this.l,u=o+(o<.5?o:1-o)*l,r=2*o-u;return new Mt(uf(n>=240?n-240:n+120,r,u),uf(n,r,u),uf(n<120?n+240:n-120,r,u),this.opacity)},clamp(){return new Pt(r0(this.h),Wu(this.s),Wu(this.l),hs(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 n=hs(this.opacity);return`${n===1?"hsl(":"hsla("}${r0(this.h)}, ${Wu(this.s)*100}%, ${Wu(this.l)*100}%${n===1?")":`, ${n})`}`}}));function r0(n){return n=(n||0)%360,n<0?n+360:n}function Wu(n){return Math.max(0,Math.min(1,n||0))}function uf(n,l,o){return(n<60?l+(o-l)*n/60:n<180?o:n<240?l+(o-l)*(240-n)/60:l)*255}const Bf=n=>()=>n;function Pb(n,l){return function(o){return n+o*l}}function e2(n,l,o){return n=Math.pow(n,o),l=Math.pow(l,o)-n,o=1/o,function(u){return Math.pow(n+u*l,o)}}function t2(n){return(n=+n)==1?Cp:function(l,o){return o-l?e2(l,o,n):Bf(isNaN(l)?o:l)}}function Cp(n,l){var o=l-n;return o?Pb(n,o):Bf(isNaN(n)?l:n)}const gs=(function n(l){var o=t2(l);function u(r,f){var d=o((r=bf(r)).r,(f=bf(f)).r),h=o(r.g,f.g),m=o(r.b,f.b),g=Cp(r.opacity,f.opacity);return function(v){return r.r=d(v),r.g=h(v),r.b=m(v),r.opacity=g(v),r+""}}return u.gamma=n,u})(1);function n2(n,l){l||(l=[]);var o=n?Math.min(l.length,n.length):0,u=l.slice(),r;return function(f){for(r=0;r<o;++r)u[r]=n[r]*(1-f)+l[r]*f;return u}}function a2(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function l2(n,l){var o=l?l.length:0,u=n?Math.min(o,n.length):0,r=new Array(u),f=new Array(o),d;for(d=0;d<u;++d)r[d]=so(n[d],l[d]);for(;d<o;++d)f[d]=l[d];return function(h){for(d=0;d<u;++d)f[d]=r[d](h);return f}}function i2(n,l){var o=new Date;return n=+n,l=+l,function(u){return o.setTime(n*(1-u)+l*u),o}}function cn(n,l){return n=+n,l=+l,function(o){return n*(1-o)+l*o}}function o2(n,l){var o={},u={},r;(n===null||typeof n!="object")&&(n={}),(l===null||typeof l!="object")&&(l={});for(r in l)r in n?o[r]=so(n[r],l[r]):u[r]=l[r];return function(f){for(r in o)u[r]=o[r](f);return u}}var _f=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sf=new RegExp(_f.source,"g");function u2(n){return function(){return n}}function s2(n){return function(l){return n(l)+""}}function Dp(n,l){var o=_f.lastIndex=sf.lastIndex=0,u,r,f,d=-1,h=[],m=[];for(n=n+"",l=l+"";(u=_f.exec(n))&&(r=sf.exec(l));)(f=r.index)>o&&(f=l.slice(o,f),h[d]?h[d]+=f:h[++d]=f),(u=u[0])===(r=r[0])?h[d]?h[d]+=r:h[++d]=r:(h[++d]=null,m.push({i:d,x:cn(u,r)})),o=sf.lastIndex;return o<l.length&&(f=l.slice(o),h[d]?h[d]+=f:h[++d]=f),h.length<2?m[0]?s2(m[0].x):u2(l):(l=m.length,function(g){for(var v=0,y;v<l;++v)h[(y=m[v]).i]=y.x(g);return h.join("")})}function so(n,l){var o=typeof l,u;return l==null||o==="boolean"?Bf(l):(o==="number"?cn:o==="string"?(u=Wa(l))?(l=u,gs):Dp:l instanceof Wa?gs:l instanceof Date?i2:a2(l)?n2:Array.isArray(l)?l2:typeof l.valueOf!="function"&&typeof l.toString!="function"||isNaN(l)?o2:cn)(n,l)}var c0=180/Math.PI,Ef={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Op(n,l,o,u,r,f){var d,h,m;return(d=Math.sqrt(n*n+l*l))&&(n/=d,l/=d),(m=n*o+l*u)&&(o-=n*m,u-=l*m),(h=Math.sqrt(o*o+u*u))&&(o/=h,u/=h,m/=h),n*u<l*o&&(n=-n,l=-l,m=-m,d=-d),{translateX:r,translateY:f,rotate:Math.atan2(l,n)*c0,skewX:Math.atan(m)*c0,scaleX:d,scaleY:h}}var Pu;function r2(n){const l=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return l.isIdentity?Ef:Op(l.a,l.b,l.c,l.d,l.e,l.f)}function c2(n){return n==null||(Pu||(Pu=document.createElementNS("http://www.w3.org/2000/svg","g")),Pu.setAttribute("transform",n),!(n=Pu.transform.baseVal.consolidate()))?Ef:(n=n.matrix,Op(n.a,n.b,n.c,n.d,n.e,n.f))}function Rp(n,l,o,u){function r(g){return g.length?g.pop()+" ":""}function f(g,v,y,x,S,_){if(g!==y||v!==x){var T=S.push("translate(",null,l,null,o);_.push({i:T-4,x:cn(g,y)},{i:T-2,x:cn(v,x)})}else(y||x)&&S.push("translate("+y+l+x+o)}function d(g,v,y,x){g!==v?(g-v>180?v+=360:v-g>180&&(g+=360),x.push({i:y.push(r(y)+"rotate(",null,u)-2,x:cn(g,v)})):v&&y.push(r(y)+"rotate("+v+u)}function h(g,v,y,x){g!==v?x.push({i:y.push(r(y)+"skewX(",null,u)-2,x:cn(g,v)}):v&&y.push(r(y)+"skewX("+v+u)}function m(g,v,y,x,S,_){if(g!==y||v!==x){var T=S.push(r(S)+"scale(",null,",",null,")");_.push({i:T-4,x:cn(g,y)},{i:T-2,x:cn(v,x)})}else(y!==1||x!==1)&&S.push(r(S)+"scale("+y+","+x+")")}return function(g,v){var y=[],x=[];return g=n(g),v=n(v),f(g.translateX,g.translateY,v.translateX,v.translateY,y,x),d(g.rotate,v.rotate,y,x),h(g.skewX,v.skewX,y,x),m(g.scaleX,g.scaleY,v.scaleX,v.scaleY,y,x),g=v=null,function(S){for(var _=-1,T=x.length,z;++_<T;)y[(z=x[_]).i]=z.x(S);return y.join("")}}}var f2=Rp(r2,"px, ","px)","deg)"),d2=Rp(c2,", ",")",")"),h2=1e-12;function f0(n){return((n=Math.exp(n))+1/n)/2}function g2(n){return((n=Math.exp(n))-1/n)/2}function m2(n){return((n=Math.exp(2*n))-1)/(n+1)}const os=(function n(l,o,u){function r(f,d){var h=f[0],m=f[1],g=f[2],v=d[0],y=d[1],x=d[2],S=v-h,_=y-m,T=S*S+_*_,z,N;if(T<h2)N=Math.log(x/g)/l,z=function(Y){return[h+Y*S,m+Y*_,g*Math.exp(l*Y*N)]};else{var U=Math.sqrt(T),w=(x*x-g*g+u*T)/(2*g*o*U),C=(x*x-g*g-u*T)/(2*x*o*U),V=Math.log(Math.sqrt(w*w+1)-w),L=Math.log(Math.sqrt(C*C+1)-C);N=(L-V)/l,z=function(Y){var R=Y*N,X=f0(V),ie=g/(o*U)*(X*m2(l*R+V)-g2(V));return[h+ie*S,m+ie*_,g*X/f0(l*R+V)]}}return z.duration=N*1e3*l/Math.SQRT2,z}return r.rho=function(f){var d=Math.max(.001,+f),h=d*d,m=h*h;return n(d,h,m)},r})(Math.SQRT2,2,4);var Wl=0,oo=0,eo=0,Hp=1e3,ms,uo,ps=0,Pa=0,ws=0,go=typeof performance=="object"&&performance.now?performance:Date,jp=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function qf(){return Pa||(jp(p2),Pa=go.now()+ws)}function p2(){Pa=0}function ys(){this._call=this._time=this._next=null}ys.prototype=Up.prototype={constructor:ys,restart:function(n,l,o){if(typeof n!="function")throw new TypeError("callback is not a function");o=(o==null?qf():+o)+(l==null?0:+l),!this._next&&uo!==this&&(uo?uo._next=this:ms=this,uo=this),this._call=n,this._time=o,wf()},stop:function(){this._call&&(this._call=null,this._time=1/0,wf())}};function Up(n,l,o){var u=new ys;return u.restart(n,l,o),u}function y2(){qf(),++Wl;for(var n=ms,l;n;)(l=Pa-n._time)>=0&&n._call.call(void 0,l),n=n._next;--Wl}function d0(){Pa=(ps=go.now())+ws,Wl=oo=0;try{y2()}finally{Wl=0,x2(),Pa=0}}function v2(){var n=go.now(),l=n-ps;l>Hp&&(ws-=l,ps=n)}function x2(){for(var n,l=ms,o,u=1/0;l;)l._call?(u>l._time&&(u=l._time),n=l,l=l._next):(o=l._next,l._next=null,l=n?n._next=o:ms=o);uo=n,wf(u)}function wf(n){if(!Wl){oo&&(oo=clearTimeout(oo));var l=n-Pa;l>24?(n<1/0&&(oo=setTimeout(d0,n-go.now()-ws)),eo&&(eo=clearInterval(eo))):(eo||(ps=go.now(),eo=setInterval(v2,Hp)),Wl=1,jp(d0))}}function h0(n,l,o){var u=new ys;return l=l==null?0:+l,u.restart(r=>{u.stop(),n(r+l)},l,o),u}var S2=_s("start","end","cancel","interrupt"),b2=[],Bp=0,g0=1,Nf=2,us=3,m0=4,Mf=5,ss=6;function Ns(n,l,o,u,r,f){var d=n.__transition;if(!d)n.__transition={};else if(o in d)return;_2(n,o,{name:l,index:u,group:r,on:S2,tween:b2,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:Bp})}function Lf(n,l){var o=nn(n,l);if(o.state>Bp)throw new Error("too late; already scheduled");return o}function gn(n,l){var o=nn(n,l);if(o.state>us)throw new Error("too late; already running");return o}function nn(n,l){var o=n.__transition;if(!o||!(o=o[l]))throw new Error("transition not found");return o}function _2(n,l,o){var u=n.__transition,r;u[l]=o,o.timer=Up(f,0,o.time);function f(g){o.state=g0,o.timer.restart(d,o.delay,o.time),o.delay<=g&&d(g-o.delay)}function d(g){var v,y,x,S;if(o.state!==g0)return m();for(v in u)if(S=u[v],S.name===o.name){if(S.state===us)return h0(d);S.state===m0?(S.state=ss,S.timer.stop(),S.on.call("interrupt",n,n.__data__,S.index,S.group),delete u[v]):+v<l&&(S.state=ss,S.timer.stop(),S.on.call("cancel",n,n.__data__,S.index,S.group),delete u[v])}if(h0(function(){o.state===us&&(o.state=m0,o.timer.restart(h,o.delay,o.time),h(g))}),o.state=Nf,o.on.call("start",n,n.__data__,o.index,o.group),o.state===Nf){for(o.state=us,r=new Array(x=o.tween.length),v=0,y=-1;v<x;++v)(S=o.tween[v].value.call(n,n.__data__,o.index,o.group))&&(r[++y]=S);r.length=y+1}}function h(g){for(var v=g<o.duration?o.ease.call(null,g/o.duration):(o.timer.restart(m),o.state=Mf,1),y=-1,x=r.length;++y<x;)r[y].call(n,v);o.state===Mf&&(o.on.call("end",n,n.__data__,o.index,o.group),m())}function m(){o.state=ss,o.timer.stop(),delete u[l];for(var g in u)return;delete n.__transition}}function rs(n,l){var o=n.__transition,u,r,f=!0,d;if(o){l=l==null?null:l+"";for(d in o){if((u=o[d]).name!==l){f=!1;continue}r=u.state>Nf&&u.state<Mf,u.state=ss,u.timer.stop(),u.on.call(r?"interrupt":"cancel",n,n.__data__,u.index,u.group),delete o[d]}f&&delete n.__transition}}function E2(n){return this.each(function(){rs(this,n)})}function w2(n,l){var o,u;return function(){var r=gn(this,n),f=r.tween;if(f!==o){u=o=f;for(var d=0,h=u.length;d<h;++d)if(u[d].name===l){u=u.slice(),u.splice(d,1);break}}r.tween=u}}function N2(n,l,o){var u,r;if(typeof o!="function")throw new Error;return function(){var f=gn(this,n),d=f.tween;if(d!==u){r=(u=d).slice();for(var h={name:l,value:o},m=0,g=r.length;m<g;++m)if(r[m].name===l){r[m]=h;break}m===g&&r.push(h)}f.tween=r}}function M2(n,l){var o=this._id;if(n+="",arguments.length<2){for(var u=nn(this.node(),o).tween,r=0,f=u.length,d;r<f;++r)if((d=u[r]).name===n)return d.value;return null}return this.each((l==null?w2:N2)(o,n,l))}function Yf(n,l,o){var u=n._id;return n.each(function(){var r=gn(this,u);(r.value||(r.value={}))[l]=o.apply(this,arguments)}),function(r){return nn(r,u).value[l]}}function qp(n,l){var o;return(typeof l=="number"?cn:l instanceof Wa?gs:(o=Wa(l))?(l=o,gs):Dp)(n,l)}function A2(n){return function(){this.removeAttribute(n)}}function T2(n){return function(){this.removeAttributeNS(n.space,n.local)}}function z2(n,l,o){var u,r=o+"",f;return function(){var d=this.getAttribute(n);return d===r?null:d===u?f:f=l(u=d,o)}}function C2(n,l,o){var u,r=o+"",f;return function(){var d=this.getAttributeNS(n.space,n.local);return d===r?null:d===u?f:f=l(u=d,o)}}function D2(n,l,o){var u,r,f;return function(){var d,h=o(this),m;return h==null?void this.removeAttribute(n):(d=this.getAttribute(n),m=h+"",d===m?null:d===u&&m===r?f:(r=m,f=l(u=d,h)))}}function O2(n,l,o){var u,r,f;return function(){var d,h=o(this),m;return h==null?void this.removeAttributeNS(n.space,n.local):(d=this.getAttributeNS(n.space,n.local),m=h+"",d===m?null:d===u&&m===r?f:(r=m,f=l(u=d,h)))}}function R2(n,l){var o=Es(n),u=o==="transform"?d2:qp;return this.attrTween(n,typeof l=="function"?(o.local?O2:D2)(o,u,Yf(this,"attr."+n,l)):l==null?(o.local?T2:A2)(o):(o.local?C2:z2)(o,u,l))}function H2(n,l){return function(o){this.setAttribute(n,l.call(this,o))}}function j2(n,l){return function(o){this.setAttributeNS(n.space,n.local,l.call(this,o))}}function U2(n,l){var o,u;function r(){var f=l.apply(this,arguments);return f!==u&&(o=(u=f)&&j2(n,f)),o}return r._value=l,r}function B2(n,l){var o,u;function r(){var f=l.apply(this,arguments);return f!==u&&(o=(u=f)&&H2(n,f)),o}return r._value=l,r}function q2(n,l){var o="attr."+n;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(l==null)return this.tween(o,null);if(typeof l!="function")throw new Error;var u=Es(n);return this.tween(o,(u.local?U2:B2)(u,l))}function L2(n,l){return function(){Lf(this,n).delay=+l.apply(this,arguments)}}function Y2(n,l){return l=+l,function(){Lf(this,n).delay=l}}function V2(n){var l=this._id;return arguments.length?this.each((typeof n=="function"?L2:Y2)(l,n)):nn(this.node(),l).delay}function G2(n,l){return function(){gn(this,n).duration=+l.apply(this,arguments)}}function X2(n,l){return l=+l,function(){gn(this,n).duration=l}}function Z2(n){var l=this._id;return arguments.length?this.each((typeof n=="function"?G2:X2)(l,n)):nn(this.node(),l).duration}function Q2(n,l){if(typeof l!="function")throw new Error;return function(){gn(this,n).ease=l}}function $2(n){var l=this._id;return arguments.length?this.each(Q2(l,n)):nn(this.node(),l).ease}function k2(n,l){return function(){var o=l.apply(this,arguments);if(typeof o!="function")throw new Error;gn(this,n).ease=o}}function I2(n){if(typeof n!="function")throw new Error;return this.each(k2(this._id,n))}function K2(n){typeof n!="function"&&(n=mp(n));for(var l=this._groups,o=l.length,u=new Array(o),r=0;r<o;++r)for(var f=l[r],d=f.length,h=u[r]=[],m,g=0;g<d;++g)(m=f[g])&&n.call(m,m.__data__,g,f)&&h.push(m);return new Vn(u,this._parents,this._name,this._id)}function J2(n){if(n._id!==this._id)throw new Error;for(var l=this._groups,o=n._groups,u=l.length,r=o.length,f=Math.min(u,r),d=new Array(u),h=0;h<f;++h)for(var m=l[h],g=o[h],v=m.length,y=d[h]=new Array(v),x,S=0;S<v;++S)(x=m[S]||g[S])&&(y[S]=x);for(;h<u;++h)d[h]=l[h];return new Vn(d,this._parents,this._name,this._id)}function F2(n){return(n+"").trim().split(/^|\s+/).every(function(l){var o=l.indexOf(".");return o>=0&&(l=l.slice(0,o)),!l||l==="start"})}function W2(n,l,o){var u,r,f=F2(l)?Lf:gn;return function(){var d=f(this,n),h=d.on;h!==u&&(r=(u=h).copy()).on(l,o),d.on=r}}function P2(n,l){var o=this._id;return arguments.length<2?nn(this.node(),o).on.on(n):this.each(W2(o,n,l))}function e_(n){return function(){var l=this.parentNode;for(var o in this.__transition)if(+o!==n)return;l&&l.removeChild(this)}}function t_(){return this.on("end.remove",e_(this._id))}function n_(n){var l=this._name,o=this._id;typeof n!="function"&&(n=Hf(n));for(var u=this._groups,r=u.length,f=new Array(r),d=0;d<r;++d)for(var h=u[d],m=h.length,g=f[d]=new Array(m),v,y,x=0;x<m;++x)(v=h[x])&&(y=n.call(v,v.__data__,x,h))&&("__data__"in v&&(y.__data__=v.__data__),g[x]=y,Ns(g[x],l,o,x,g,nn(v,o)));return new Vn(f,this._parents,l,o)}function a_(n){var l=this._name,o=this._id;typeof n!="function"&&(n=gp(n));for(var u=this._groups,r=u.length,f=[],d=[],h=0;h<r;++h)for(var m=u[h],g=m.length,v,y=0;y<g;++y)if(v=m[y]){for(var x=n.call(v,v.__data__,y,m),S,_=nn(v,o),T=0,z=x.length;T<z;++T)(S=x[T])&&Ns(S,l,o,T,x,_);f.push(x),d.push(v)}return new Vn(f,d,l,o)}var l_=bo.prototype.constructor;function i_(){return new l_(this._groups,this._parents)}function o_(n,l){var o,u,r;return function(){var f=Fl(this,n),d=(this.style.removeProperty(n),Fl(this,n));return f===d?null:f===o&&d===u?r:r=l(o=f,u=d)}}function Lp(n){return function(){this.style.removeProperty(n)}}function u_(n,l,o){var u,r=o+"",f;return function(){var d=Fl(this,n);return d===r?null:d===u?f:f=l(u=d,o)}}function s_(n,l,o){var u,r,f;return function(){var d=Fl(this,n),h=o(this),m=h+"";return h==null&&(m=h=(this.style.removeProperty(n),Fl(this,n))),d===m?null:d===u&&m===r?f:(r=m,f=l(u=d,h))}}function r_(n,l){var o,u,r,f="style."+l,d="end."+f,h;return function(){var m=gn(this,n),g=m.on,v=m.value[f]==null?h||(h=Lp(l)):void 0;(g!==o||r!==v)&&(u=(o=g).copy()).on(d,r=v),m.on=u}}function c_(n,l,o){var u=(n+="")=="transform"?f2:qp;return l==null?this.styleTween(n,o_(n,u)).on("end.style."+n,Lp(n)):typeof l=="function"?this.styleTween(n,s_(n,u,Yf(this,"style."+n,l))).each(r_(this._id,n)):this.styleTween(n,u_(n,u,l),o).on("end.style."+n,null)}function f_(n,l,o){return function(u){this.style.setProperty(n,l.call(this,u),o)}}function d_(n,l,o){var u,r;function f(){var d=l.apply(this,arguments);return d!==r&&(u=(r=d)&&f_(n,d,o)),u}return f._value=l,f}function h_(n,l,o){var u="style."+(n+="");if(arguments.length<2)return(u=this.tween(u))&&u._value;if(l==null)return this.tween(u,null);if(typeof l!="function")throw new Error;return this.tween(u,d_(n,l,o??""))}function g_(n){return function(){this.textContent=n}}function m_(n){return function(){var l=n(this);this.textContent=l??""}}function p_(n){return this.tween("text",typeof n=="function"?m_(Yf(this,"text",n)):g_(n==null?"":n+""))}function y_(n){return function(l){this.textContent=n.call(this,l)}}function v_(n){var l,o;function u(){var r=n.apply(this,arguments);return r!==o&&(l=(o=r)&&y_(r)),l}return u._value=n,u}function x_(n){var l="text";if(arguments.length<1)return(l=this.tween(l))&&l._value;if(n==null)return this.tween(l,null);if(typeof n!="function")throw new Error;return this.tween(l,v_(n))}function S_(){for(var n=this._name,l=this._id,o=Yp(),u=this._groups,r=u.length,f=0;f<r;++f)for(var d=u[f],h=d.length,m,g=0;g<h;++g)if(m=d[g]){var v=nn(m,l);Ns(m,n,o,g,d,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new Vn(u,this._parents,n,o)}function b_(){var n,l,o=this,u=o._id,r=o.size();return new Promise(function(f,d){var h={value:d},m={value:function(){--r===0&&f()}};o.each(function(){var g=gn(this,u),v=g.on;v!==n&&(l=(n=v).copy(),l._.cancel.push(h),l._.interrupt.push(h),l._.end.push(m)),g.on=l}),r===0&&f()})}var __=0;function Vn(n,l,o,u){this._groups=n,this._parents=l,this._name=o,this._id=u}function Yp(){return++__}var qn=bo.prototype;Vn.prototype={constructor:Vn,select:n_,selectAll:a_,selectChild:qn.selectChild,selectChildren:qn.selectChildren,filter:K2,merge:J2,selection:i_,transition:S_,call:qn.call,nodes:qn.nodes,node:qn.node,size:qn.size,empty:qn.empty,each:qn.each,on:P2,attr:R2,attrTween:q2,style:c_,styleTween:h_,text:p_,textTween:x_,remove:t_,tween:M2,delay:V2,duration:Z2,ease:$2,easeVarying:I2,end:b_,[Symbol.iterator]:qn[Symbol.iterator]};function E_(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var w_={time:null,delay:0,duration:250,ease:E_};function N_(n,l){for(var o;!(o=n.__transition)||!(o=o[l]);)if(!(n=n.parentNode))throw new Error(`transition ${l} not found`);return o}function M_(n){var l,o;n instanceof Vn?(l=n._id,n=n._name):(l=Yp(),(o=w_).time=qf(),n=n==null?null:n+"");for(var u=this._groups,r=u.length,f=0;f<r;++f)for(var d=u[f],h=d.length,m,g=0;g<h;++g)(m=d[g])&&Ns(m,n,l,g,d,o||N_(m,l));return new Vn(u,this._parents,n,l)}bo.prototype.interrupt=E2;bo.prototype.transition=M_;const es=n=>()=>n;function A_(n,{sourceEvent:l,target:o,transform:u,dispatch:r}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:l,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:u,enumerable:!0,configurable:!0},_:{value:r}})}function Yn(n,l,o){this.k=n,this.x=l,this.y=o}Yn.prototype={constructor:Yn,scale:function(n){return n===1?this:new Yn(this.k*n,this.x,this.y)},translate:function(n,l){return n===0&l===0?this:new Yn(this.k,this.x+this.k*n,this.y+this.k*l)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ms=new Yn(1,0,0);Vp.prototype=Yn.prototype;function Vp(n){for(;!n.__zoom;)if(!(n=n.parentNode))return Ms;return n.__zoom}function rf(n){n.stopImmediatePropagation()}function to(n){n.preventDefault(),n.stopImmediatePropagation()}function T_(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function z_(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function p0(){return this.__zoom||Ms}function C_(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function D_(){return navigator.maxTouchPoints||"ontouchstart"in this}function O_(n,l,o){var u=n.invertX(l[0][0])-o[0][0],r=n.invertX(l[1][0])-o[1][0],f=n.invertY(l[0][1])-o[0][1],d=n.invertY(l[1][1])-o[1][1];return n.translate(r>u?(u+r)/2:Math.min(0,u)||Math.max(0,r),d>f?(f+d)/2:Math.min(0,f)||Math.max(0,d))}function Gp(){var n=T_,l=z_,o=O_,u=C_,r=D_,f=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],h=250,m=os,g=_s("start","zoom","end"),v,y,x,S=500,_=150,T=0,z=10;function N(D){D.property("__zoom",p0).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",X).on("dblclick.zoom",ie).filter(r).on("touchstart.zoom",Z).on("touchmove.zoom",W).on("touchend.zoom touchcancel.zoom",oe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(D,Q,M,H){var q=D.selection?D.selection():D;q.property("__zoom",p0),D!==q?V(D,Q,M,H):q.interrupt().each(function(){L(this,arguments).event(H).start().zoom(null,typeof Q=="function"?Q.apply(this,arguments):Q).end()})},N.scaleBy=function(D,Q,M,H){N.scaleTo(D,function(){var q=this.__zoom.k,$=typeof Q=="function"?Q.apply(this,arguments):Q;return q*$},M,H)},N.scaleTo=function(D,Q,M,H){N.transform(D,function(){var q=l.apply(this,arguments),$=this.__zoom,ee=M==null?C(q):typeof M=="function"?M.apply(this,arguments):M,A=$.invert(ee),j=typeof Q=="function"?Q.apply(this,arguments):Q;return o(w(U($,j),ee,A),q,d)},M,H)},N.translateBy=function(D,Q,M,H){N.transform(D,function(){return o(this.__zoom.translate(typeof Q=="function"?Q.apply(this,arguments):Q,typeof M=="function"?M.apply(this,arguments):M),l.apply(this,arguments),d)},null,H)},N.translateTo=function(D,Q,M,H,q){N.transform(D,function(){var $=l.apply(this,arguments),ee=this.__zoom,A=H==null?C($):typeof H=="function"?H.apply(this,arguments):H;return o(Ms.translate(A[0],A[1]).scale(ee.k).translate(typeof Q=="function"?-Q.apply(this,arguments):-Q,typeof M=="function"?-M.apply(this,arguments):-M),$,d)},H,q)};function U(D,Q){return Q=Math.max(f[0],Math.min(f[1],Q)),Q===D.k?D:new Yn(Q,D.x,D.y)}function w(D,Q,M){var H=Q[0]-M[0]*D.k,q=Q[1]-M[1]*D.k;return H===D.x&&q===D.y?D:new Yn(D.k,H,q)}function C(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function V(D,Q,M,H){D.on("start.zoom",function(){L(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(H).end()}).tween("zoom",function(){var q=this,$=arguments,ee=L(q,$).event(H),A=l.apply(q,$),j=M==null?C(A):typeof M=="function"?M.apply(q,$):M,P=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),te=q.__zoom,se=typeof Q=="function"?Q.apply(q,$):Q,ce=m(te.invert(j).concat(P/te.k),se.invert(j).concat(P/se.k));return function(re){if(re===1)re=se;else{var ue=ce(re),fe=P/ue[2];re=new Yn(fe,j[0]-ue[0]*fe,j[1]-ue[1]*fe)}ee.zoom(null,re)}})}function L(D,Q,M){return!M&&D.__zooming||new Y(D,Q)}function Y(D,Q){this.that=D,this.args=Q,this.active=0,this.sourceEvent=null,this.extent=l.apply(D,Q),this.taps=0}Y.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,Q){return this.mouse&&D!=="mouse"&&(this.mouse[1]=Q.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=Q.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=Q.invert(this.touch1[0])),this.that.__zoom=Q,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var Q=Ut(this.that).datum();g.call(D,this.that,new A_(D,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:g}),Q)}};function R(D,...Q){if(!n.apply(this,arguments))return;var M=L(this,Q).event(D),H=this.__zoom,q=Math.max(f[0],Math.min(f[1],H.k*Math.pow(2,u.apply(this,arguments)))),$=Wt(D);if(M.wheel)(M.mouse[0][0]!==$[0]||M.mouse[0][1]!==$[1])&&(M.mouse[1]=H.invert(M.mouse[0]=$)),clearTimeout(M.wheel);else{if(H.k===q)return;M.mouse=[$,H.invert($)],rs(this),M.start()}to(D),M.wheel=setTimeout(ee,_),M.zoom("mouse",o(w(U(H,q),M.mouse[0],M.mouse[1]),M.extent,d));function ee(){M.wheel=null,M.end()}}function X(D,...Q){if(x||!n.apply(this,arguments))return;var M=D.currentTarget,H=L(this,Q,!0).event(D),q=Ut(D.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",P,!0),$=Wt(D,M),ee=D.clientX,A=D.clientY;Np(D.view),rf(D),H.mouse=[$,this.__zoom.invert($)],rs(this),H.start();function j(te){if(to(te),!H.moved){var se=te.clientX-ee,ce=te.clientY-A;H.moved=se*se+ce*ce>T}H.event(te).zoom("mouse",o(w(H.that.__zoom,H.mouse[0]=Wt(te,M),H.mouse[1]),H.extent,d))}function P(te){q.on("mousemove.zoom mouseup.zoom",null),Mp(te.view,H.moved),to(te),H.event(te).end()}}function ie(D,...Q){if(n.apply(this,arguments)){var M=this.__zoom,H=Wt(D.changedTouches?D.changedTouches[0]:D,this),q=M.invert(H),$=M.k*(D.shiftKey?.5:2),ee=o(w(U(M,$),H,q),l.apply(this,Q),d);to(D),h>0?Ut(this).transition().duration(h).call(V,ee,H,D):Ut(this).call(N.transform,ee,H,D)}}function Z(D,...Q){if(n.apply(this,arguments)){var M=D.touches,H=M.length,q=L(this,Q,D.changedTouches.length===H).event(D),$,ee,A,j;for(rf(D),ee=0;ee<H;++ee)A=M[ee],j=Wt(A,this),j=[j,this.__zoom.invert(j),A.identifier],q.touch0?!q.touch1&&q.touch0[2]!==j[2]&&(q.touch1=j,q.taps=0):(q.touch0=j,$=!0,q.taps=1+!!v);v&&(v=clearTimeout(v)),$&&(q.taps<2&&(y=j[0],v=setTimeout(function(){v=null},S)),rs(this),q.start())}}function W(D,...Q){if(this.__zooming){var M=L(this,Q).event(D),H=D.changedTouches,q=H.length,$,ee,A,j;for(to(D),$=0;$<q;++$)ee=H[$],A=Wt(ee,this),M.touch0&&M.touch0[2]===ee.identifier?M.touch0[0]=A:M.touch1&&M.touch1[2]===ee.identifier&&(M.touch1[0]=A);if(ee=M.that.__zoom,M.touch1){var P=M.touch0[0],te=M.touch0[1],se=M.touch1[0],ce=M.touch1[1],re=(re=se[0]-P[0])*re+(re=se[1]-P[1])*re,ue=(ue=ce[0]-te[0])*ue+(ue=ce[1]-te[1])*ue;ee=U(ee,Math.sqrt(re/ue)),A=[(P[0]+se[0])/2,(P[1]+se[1])/2],j=[(te[0]+ce[0])/2,(te[1]+ce[1])/2]}else if(M.touch0)A=M.touch0[0],j=M.touch0[1];else return;M.zoom("touch",o(w(ee,A,j),M.extent,d))}}function oe(D,...Q){if(this.__zooming){var M=L(this,Q).event(D),H=D.changedTouches,q=H.length,$,ee;for(rf(D),x&&clearTimeout(x),x=setTimeout(function(){x=null},S),$=0;$<q;++$)ee=H[$],M.touch0&&M.touch0[2]===ee.identifier?delete M.touch0:M.touch1&&M.touch1[2]===ee.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(ee=Wt(ee,this),Math.hypot(y[0]-ee[0],y[1]-ee[1])<z)){var A=Ut(this).on("dblclick.zoom");A&&A.apply(this,arguments)}}}return N.wheelDelta=function(D){return arguments.length?(u=typeof D=="function"?D:es(+D),N):u},N.filter=function(D){return arguments.length?(n=typeof D=="function"?D:es(!!D),N):n},N.touchable=function(D){return arguments.length?(r=typeof D=="function"?D:es(!!D),N):r},N.extent=function(D){return arguments.length?(l=typeof D=="function"?D:es([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),N):l},N.scaleExtent=function(D){return arguments.length?(f[0]=+D[0],f[1]=+D[1],N):[f[0],f[1]]},N.translateExtent=function(D){return arguments.length?(d[0][0]=+D[0][0],d[1][0]=+D[1][0],d[0][1]=+D[0][1],d[1][1]=+D[1][1],N):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},N.constrain=function(D){return arguments.length?(o=D,N):o},N.duration=function(D){return arguments.length?(h=+D,N):h},N.interpolate=function(D){return arguments.length?(m=D,N):m},N.on=function(){var D=g.on.apply(g,arguments);return D===g?N:D},N.clickDistance=function(D){return arguments.length?(T=(D=+D)*D,N):Math.sqrt(T)},N.tapDistance=function(D){return arguments.length?(z=+D,N):z},N}const hn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:n=>`Node type "${n}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:n=>`The old edge with id=${n} does not exist.`,error009:n=>`Marker type "${n}" doesn't exist.`,error008:(n,{id:l,sourceHandle:o,targetHandle:u})=>`Couldn't create edge for ${n} handle id: "${n==="source"?o:u}", edge id: ${l}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:n=>`Edge type "${n}" not found. Using fallback type "default".`,error012:n=>`Node with id "${n}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(n="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${n}/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."},mo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Xp=["Enter"," ","Escape"],Zp={"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:n,x:l,y:o})=>`Moved selected node ${n}. New position, x: ${l}, y: ${o}`,"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 Pl;(function(n){n.Strict="strict",n.Loose="loose"})(Pl||(Pl={}));var Fa;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(Fa||(Fa={}));var po;(function(n){n.Partial="partial",n.Full="full"})(po||(po={}));const Qp={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Sa;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(Sa||(Sa={}));var vs;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(vs||(vs={}));var me;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(me||(me={}));const y0={[me.Left]:me.Right,[me.Right]:me.Left,[me.Top]:me.Bottom,[me.Bottom]:me.Top};function $p(n){return n===null?null:n?"valid":"invalid"}const kp=n=>"id"in n&&"source"in n&&"target"in n,R_=n=>"id"in n&&"position"in n&&!("source"in n)&&!("target"in n),Vf=n=>"id"in n&&"internals"in n&&!("source"in n)&&!("target"in n),Eo=(n,l=[0,0])=>{const{width:o,height:u}=Gn(n),r=n.origin??l,f=o*r[0],d=u*r[1];return{x:n.position.x-f,y:n.position.y-d}},H_=(n,l={nodeOrigin:[0,0]})=>{if(n.length===0)return{x:0,y:0,width:0,height:0};const o=n.reduce((u,r)=>{const f=typeof r=="string";let d=!l.nodeLookup&&!f?r:void 0;l.nodeLookup&&(d=f?l.nodeLookup.get(r):Vf(r)?r:l.nodeLookup.get(r.id));const h=d?xs(d,l.nodeOrigin):{x:0,y:0,x2:0,y2:0};return As(u,h)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ts(o)},wo=(n,l={})=>{let o={x:1/0,y:1/0,x2:-1/0,y2:-1/0},u=!1;return n.forEach(r=>{(l.filter===void 0||l.filter(r))&&(o=As(o,xs(r)),u=!0)}),u?Ts(o):{x:0,y:0,width:0,height:0}},Gf=(n,l,[o,u,r]=[0,0,1],f=!1,d=!1)=>{const h={...Mo(l,[o,u,r]),width:l.width/r,height:l.height/r},m=[];for(const g of n.values()){const{measured:v,selectable:y=!0,hidden:x=!1}=g;if(d&&!y||x)continue;const S=v.width??g.width??g.initialWidth??null,_=v.height??g.height??g.initialHeight??null,T=yo(h,ti(g)),z=(S??0)*(_??0),N=f&&T>0;(!g.internals.handleBounds||N||T>=z||g.dragging)&&m.push(g)}return m},j_=(n,l)=>{const o=new Set;return n.forEach(u=>{o.add(u.id)}),l.filter(u=>o.has(u.source)||o.has(u.target))};function U_(n,l){const o=new Map,u=l?.nodes?new Set(l.nodes.map(r=>r.id)):null;return n.forEach(r=>{r.measured.width&&r.measured.height&&(l?.includeHiddenNodes||!r.hidden)&&(!u||u.has(r.id))&&o.set(r.id,r)}),o}async function B_({nodes:n,width:l,height:o,panZoom:u,minZoom:r,maxZoom:f},d){if(n.size===0)return Promise.resolve(!0);const h=U_(n,d),m=wo(h),g=Xf(m,l,o,d?.minZoom??r,d?.maxZoom??f,d?.padding??.1);return await u.setViewport(g,{duration:d?.duration,ease:d?.ease,interpolate:d?.interpolate}),Promise.resolve(!0)}function Ip({nodeId:n,nextPosition:l,nodeLookup:o,nodeOrigin:u=[0,0],nodeExtent:r,onError:f}){const d=o.get(n),h=d.parentId?o.get(d.parentId):void 0,{x:m,y:g}=h?h.internals.positionAbsolute:{x:0,y:0},v=d.origin??u;let y=d.extent||r;if(d.extent==="parent"&&!d.expandParent)if(!h)f?.("005",hn.error005());else{const S=h.measured.width,_=h.measured.height;S&&_&&(y=[[m,g],[m+S,g+_]])}else h&&ni(d.extent)&&(y=[[d.extent[0][0]+m,d.extent[0][1]+g],[d.extent[1][0]+m,d.extent[1][1]+g]]);const x=ni(y)?el(l,y,d.measured):l;return(d.measured.width===void 0||d.measured.height===void 0)&&f?.("015",hn.error015()),{position:{x:x.x-m+(d.measured.width??0)*v[0],y:x.y-g+(d.measured.height??0)*v[1]},positionAbsolute:x}}async function q_({nodesToRemove:n=[],edgesToRemove:l=[],nodes:o,edges:u,onBeforeDelete:r}){const f=new Set(n.map(x=>x.id)),d=[];for(const x of o){if(x.deletable===!1)continue;const S=f.has(x.id),_=!S&&x.parentId&&d.find(T=>T.id===x.parentId);(S||_)&&d.push(x)}const h=new Set(l.map(x=>x.id)),m=u.filter(x=>x.deletable!==!1),v=j_(d,m);for(const x of m)h.has(x.id)&&!v.find(_=>_.id===x.id)&&v.push(x);if(!r)return{edges:v,nodes:d};const y=await r({nodes:d,edges:v});return typeof y=="boolean"?y?{edges:v,nodes:d}:{edges:[],nodes:[]}:y}const ei=(n,l=0,o=1)=>Math.min(Math.max(n,l),o),el=(n={x:0,y:0},l,o)=>({x:ei(n.x,l[0][0],l[1][0]-(o?.width??0)),y:ei(n.y,l[0][1],l[1][1]-(o?.height??0))});function Kp(n,l,o){const{width:u,height:r}=Gn(o),{x:f,y:d}=o.internals.positionAbsolute;return el(n,[[f,d],[f+u,d+r]],l)}const v0=(n,l,o)=>n<l?ei(Math.abs(n-l),1,l)/l:n>o?-ei(Math.abs(n-o),1,l)/l:0,Jp=(n,l,o=15,u=40)=>{const r=v0(n.x,u,l.width-u)*o,f=v0(n.y,u,l.height-u)*o;return[r,f]},As=(n,l)=>({x:Math.min(n.x,l.x),y:Math.min(n.y,l.y),x2:Math.max(n.x2,l.x2),y2:Math.max(n.y2,l.y2)}),Af=({x:n,y:l,width:o,height:u})=>({x:n,y:l,x2:n+o,y2:l+u}),Ts=({x:n,y:l,x2:o,y2:u})=>({x:n,y:l,width:o-n,height:u-l}),ti=(n,l=[0,0])=>{const{x:o,y:u}=Vf(n)?n.internals.positionAbsolute:Eo(n,l);return{x:o,y:u,width:n.measured?.width??n.width??n.initialWidth??0,height:n.measured?.height??n.height??n.initialHeight??0}},xs=(n,l=[0,0])=>{const{x:o,y:u}=Vf(n)?n.internals.positionAbsolute:Eo(n,l);return{x:o,y:u,x2:o+(n.measured?.width??n.width??n.initialWidth??0),y2:u+(n.measured?.height??n.height??n.initialHeight??0)}},Fp=(n,l)=>Ts(As(Af(n),Af(l))),yo=(n,l)=>{const o=Math.max(0,Math.min(n.x+n.width,l.x+l.width)-Math.max(n.x,l.x)),u=Math.max(0,Math.min(n.y+n.height,l.y+l.height)-Math.max(n.y,l.y));return Math.ceil(o*u)},x0=n=>en(n.width)&&en(n.height)&&en(n.x)&&en(n.y),en=n=>!isNaN(n)&&isFinite(n),L_=(n,l)=>{},No=(n,l=[1,1])=>({x:l[0]*Math.round(n.x/l[0]),y:l[1]*Math.round(n.y/l[1])}),Mo=({x:n,y:l},[o,u,r],f=!1,d=[1,1])=>{const h={x:(n-o)/r,y:(l-u)/r};return f?No(h,d):h},Ss=({x:n,y:l},[o,u,r])=>({x:n*r+o,y:l*r+u});function $l(n,l){if(typeof n=="number")return Math.floor((l-l/(1+n))*.5);if(typeof n=="string"&&n.endsWith("px")){const o=parseFloat(n);if(!Number.isNaN(o))return Math.floor(o)}if(typeof n=="string"&&n.endsWith("%")){const o=parseFloat(n);if(!Number.isNaN(o))return Math.floor(l*o*.01)}return console.error(`[React Flow] The padding value "${n}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Y_(n,l,o){if(typeof n=="string"||typeof n=="number"){const u=$l(n,o),r=$l(n,l);return{top:u,right:r,bottom:u,left:r,x:r*2,y:u*2}}if(typeof n=="object"){const u=$l(n.top??n.y??0,o),r=$l(n.bottom??n.y??0,o),f=$l(n.left??n.x??0,l),d=$l(n.right??n.x??0,l);return{top:u,right:d,bottom:r,left:f,x:f+d,y:u+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function V_(n,l,o,u,r,f){const{x:d,y:h}=Ss(n,[l,o,u]),{x:m,y:g}=Ss({x:n.x+n.width,y:n.y+n.height},[l,o,u]),v=r-m,y=f-g;return{left:Math.floor(d),top:Math.floor(h),right:Math.floor(v),bottom:Math.floor(y)}}const Xf=(n,l,o,u,r,f)=>{const d=Y_(f,l,o),h=(l-d.x)/n.width,m=(o-d.y)/n.height,g=Math.min(h,m),v=ei(g,u,r),y=n.x+n.width/2,x=n.y+n.height/2,S=l/2-y*v,_=o/2-x*v,T=V_(n,S,_,v,l,o),z={left:Math.min(T.left-d.left,0),top:Math.min(T.top-d.top,0),right:Math.min(T.right-d.right,0),bottom:Math.min(T.bottom-d.bottom,0)};return{x:S-z.left+z.right,y:_-z.top+z.bottom,zoom:v}},vo=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function ni(n){return n!=null&&n!=="parent"}function Gn(n){return{width:n.measured?.width??n.width??n.initialWidth??0,height:n.measured?.height??n.height??n.initialHeight??0}}function Wp(n){return(n.measured?.width??n.width??n.initialWidth)!==void 0&&(n.measured?.height??n.height??n.initialHeight)!==void 0}function Pp(n,l={width:0,height:0},o,u,r){const f={...n},d=u.get(o);if(d){const h=d.origin||r;f.x+=d.internals.positionAbsolute.x-(l.width??0)*h[0],f.y+=d.internals.positionAbsolute.y-(l.height??0)*h[1]}return f}function S0(n,l){if(n.size!==l.size)return!1;for(const o of n)if(!l.has(o))return!1;return!0}function G_(){let n,l;return{promise:new Promise((u,r)=>{n=u,l=r}),resolve:n,reject:l}}function X_(n){return{...Zp,...n||{}}}function ro(n,{snapGrid:l=[0,0],snapToGrid:o=!1,transform:u,containerBounds:r}){const{x:f,y:d}=tn(n),h=Mo({x:f-(r?.left??0),y:d-(r?.top??0)},u),{x:m,y:g}=o?No(h,l):h;return{xSnapped:m,ySnapped:g,...h}}const Zf=n=>({width:n.offsetWidth,height:n.offsetHeight}),ey=n=>n?.getRootNode?.()||window?.document,Z_=["INPUT","SELECT","TEXTAREA"];function ty(n){const l=n.composedPath?.()?.[0]||n.target;return l?.nodeType!==1?!1:Z_.includes(l.nodeName)||l.hasAttribute("contenteditable")||!!l.closest(".nokey")}const ny=n=>"clientX"in n,tn=(n,l)=>{const o=ny(n),u=o?n.clientX:n.touches?.[0].clientX,r=o?n.clientY:n.touches?.[0].clientY;return{x:u-(l?.left??0),y:r-(l?.top??0)}},b0=(n,l,o,u,r)=>{const f=l.querySelectorAll(`.${n}`);return!f||!f.length?null:Array.from(f).map(d=>{const h=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:n,nodeId:r,position:d.getAttribute("data-handlepos"),x:(h.left-o.left)/u,y:(h.top-o.top)/u,...Zf(d)}})};function ay({sourceX:n,sourceY:l,targetX:o,targetY:u,sourceControlX:r,sourceControlY:f,targetControlX:d,targetControlY:h}){const m=n*.125+r*.375+d*.375+o*.125,g=l*.125+f*.375+h*.375+u*.125,v=Math.abs(m-n),y=Math.abs(g-l);return[m,g,v,y]}function ts(n,l){return n>=0?.5*n:l*25*Math.sqrt(-n)}function _0({pos:n,x1:l,y1:o,x2:u,y2:r,c:f}){switch(n){case me.Left:return[l-ts(l-u,f),o];case me.Right:return[l+ts(u-l,f),o];case me.Top:return[l,o-ts(o-r,f)];case me.Bottom:return[l,o+ts(r-o,f)]}}function ly({sourceX:n,sourceY:l,sourcePosition:o=me.Bottom,targetX:u,targetY:r,targetPosition:f=me.Top,curvature:d=.25}){const[h,m]=_0({pos:o,x1:n,y1:l,x2:u,y2:r,c:d}),[g,v]=_0({pos:f,x1:u,y1:r,x2:n,y2:l,c:d}),[y,x,S,_]=ay({sourceX:n,sourceY:l,targetX:u,targetY:r,sourceControlX:h,sourceControlY:m,targetControlX:g,targetControlY:v});return[`M${n},${l} C${h},${m} ${g},${v} ${u},${r}`,y,x,S,_]}function iy({sourceX:n,sourceY:l,targetX:o,targetY:u}){const r=Math.abs(o-n)/2,f=o<n?o+r:o-r,d=Math.abs(u-l)/2,h=u<l?u+d:u-d;return[f,h,r,d]}function Q_({sourceNode:n,targetNode:l,selected:o=!1,zIndex:u=0,elevateOnSelect:r=!1,zIndexMode:f="basic"}){if(f==="manual")return u;const d=r&&o?u+1e3:u,h=Math.max(n.parentId||r&&n.selected?n.internals.z:0,l.parentId||r&&l.selected?l.internals.z:0);return d+h}function $_({sourceNode:n,targetNode:l,width:o,height:u,transform:r}){const f=As(xs(n),xs(l));f.x===f.x2&&(f.x2+=1),f.y===f.y2&&(f.y2+=1);const d={x:-r[0]/r[2],y:-r[1]/r[2],width:o/r[2],height:u/r[2]};return yo(d,Ts(f))>0}const k_=({source:n,sourceHandle:l,target:o,targetHandle:u})=>`xy-edge__${n}${l||""}-${o}${u||""}`,I_=(n,l)=>l.some(o=>o.source===n.source&&o.target===n.target&&(o.sourceHandle===n.sourceHandle||!o.sourceHandle&&!n.sourceHandle)&&(o.targetHandle===n.targetHandle||!o.targetHandle&&!n.targetHandle)),K_=(n,l,o={})=>{if(!n.source||!n.target)return l;const u=o.getEdgeId||k_;let r;return kp(n)?r={...n}:r={...n,id:u(n)},I_(r,l)?l:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,l.concat(r))};function oy({sourceX:n,sourceY:l,targetX:o,targetY:u}){const[r,f,d,h]=iy({sourceX:n,sourceY:l,targetX:o,targetY:u});return[`M ${n},${l}L ${o},${u}`,r,f,d,h]}const E0={[me.Left]:{x:-1,y:0},[me.Right]:{x:1,y:0},[me.Top]:{x:0,y:-1},[me.Bottom]:{x:0,y:1}},J_=({source:n,sourcePosition:l=me.Bottom,target:o})=>l===me.Left||l===me.Right?n.x<o.x?{x:1,y:0}:{x:-1,y:0}:n.y<o.y?{x:0,y:1}:{x:0,y:-1},w0=(n,l)=>Math.sqrt(Math.pow(l.x-n.x,2)+Math.pow(l.y-n.y,2));function F_({source:n,sourcePosition:l=me.Bottom,target:o,targetPosition:u=me.Top,center:r,offset:f,stepPosition:d}){const h=E0[l],m=E0[u],g={x:n.x+h.x*f,y:n.y+h.y*f},v={x:o.x+m.x*f,y:o.y+m.y*f},y=J_({source:g,sourcePosition:l,target:v}),x=y.x!==0?"x":"y",S=y[x];let _=[],T,z;const N={x:0,y:0},U={x:0,y:0},[,,w,C]=iy({sourceX:n.x,sourceY:n.y,targetX:o.x,targetY:o.y});if(h[x]*m[x]===-1){x==="x"?(T=r.x??g.x+(v.x-g.x)*d,z=r.y??(g.y+v.y)/2):(T=r.x??(g.x+v.x)/2,z=r.y??g.y+(v.y-g.y)*d);const R=[{x:T,y:g.y},{x:T,y:v.y}],X=[{x:g.x,y:z},{x:v.x,y:z}];h[x]===S?_=x==="x"?R:X:_=x==="x"?X:R}else{const R=[{x:g.x,y:v.y}],X=[{x:v.x,y:g.y}];if(x==="x"?_=h.x===S?X:R:_=h.y===S?R:X,l===u){const D=Math.abs(n[x]-o[x]);if(D<=f){const Q=Math.min(f-1,f-D);h[x]===S?N[x]=(g[x]>n[x]?-1:1)*Q:U[x]=(v[x]>o[x]?-1:1)*Q}}if(l!==u){const D=x==="x"?"y":"x",Q=h[x]===m[D],M=g[D]>v[D],H=g[D]<v[D];(h[x]===1&&(!Q&&M||Q&&H)||h[x]!==1&&(!Q&&H||Q&&M))&&(_=x==="x"?R:X)}const ie={x:g.x+N.x,y:g.y+N.y},Z={x:v.x+U.x,y:v.y+U.y},W=Math.max(Math.abs(ie.x-_[0].x),Math.abs(Z.x-_[0].x)),oe=Math.max(Math.abs(ie.y-_[0].y),Math.abs(Z.y-_[0].y));W>=oe?(T=(ie.x+Z.x)/2,z=_[0].y):(T=_[0].x,z=(ie.y+Z.y)/2)}const V={x:g.x+N.x,y:g.y+N.y},L={x:v.x+U.x,y:v.y+U.y};return[[n,...V.x!==_[0].x||V.y!==_[0].y?[V]:[],..._,...L.x!==_[_.length-1].x||L.y!==_[_.length-1].y?[L]:[],o],T,z,w,C]}function W_(n,l,o,u){const r=Math.min(w0(n,l)/2,w0(l,o)/2,u),{x:f,y:d}=l;if(n.x===f&&f===o.x||n.y===d&&d===o.y)return`L${f} ${d}`;if(n.y===d){const g=n.x<o.x?-1:1,v=n.y<o.y?1:-1;return`L ${f+r*g},${d}Q ${f},${d} ${f},${d+r*v}`}const h=n.x<o.x?1:-1,m=n.y<o.y?-1:1;return`L ${f},${d+r*m}Q ${f},${d} ${f+r*h},${d}`}function Tf({sourceX:n,sourceY:l,sourcePosition:o=me.Bottom,targetX:u,targetY:r,targetPosition:f=me.Top,borderRadius:d=5,centerX:h,centerY:m,offset:g=20,stepPosition:v=.5}){const[y,x,S,_,T]=F_({source:{x:n,y:l},sourcePosition:o,target:{x:u,y:r},targetPosition:f,center:{x:h,y:m},offset:g,stepPosition:v});let z=`M${y[0].x} ${y[0].y}`;for(let N=1;N<y.length-1;N++)z+=W_(y[N-1],y[N],y[N+1],d);return z+=`L${y[y.length-1].x} ${y[y.length-1].y}`,[z,x,S,_,T]}function N0(n){return n&&!!(n.internals.handleBounds||n.handles?.length)&&!!(n.measured.width||n.width||n.initialWidth)}function P_(n){const{sourceNode:l,targetNode:o}=n;if(!N0(l)||!N0(o))return null;const u=l.internals.handleBounds||M0(l.handles),r=o.internals.handleBounds||M0(o.handles),f=A0(u?.source??[],n.sourceHandle),d=A0(n.connectionMode===Pl.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),n.targetHandle);if(!f||!d)return n.onError?.("008",hn.error008(f?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;const h=f?.position||me.Bottom,m=d?.position||me.Top,g=tl(l,f,h),v=tl(o,d,m);return{sourceX:g.x,sourceY:g.y,targetX:v.x,targetY:v.y,sourcePosition:h,targetPosition:m}}function M0(n){if(!n)return null;const l=[],o=[];for(const u of n)u.width=u.width??1,u.height=u.height??1,u.type==="source"?l.push(u):u.type==="target"&&o.push(u);return{source:l,target:o}}function tl(n,l,o=me.Left,u=!1){const r=(l?.x??0)+n.internals.positionAbsolute.x,f=(l?.y??0)+n.internals.positionAbsolute.y,{width:d,height:h}=l??Gn(n);if(u)return{x:r+d/2,y:f+h/2};switch(l?.position??o){case me.Top:return{x:r+d/2,y:f};case me.Right:return{x:r+d,y:f+h/2};case me.Bottom:return{x:r+d/2,y:f+h};case me.Left:return{x:r,y:f+h/2}}}function A0(n,l){return n&&(l?n.find(o=>o.id===l):n[0])||null}function zf(n,l){return n?typeof n=="string"?n:`${l?`${l}__`:""}${Object.keys(n).sort().map(u=>`${u}=${n[u]}`).join("&")}`:""}function eE(n,{id:l,defaultColor:o,defaultMarkerStart:u,defaultMarkerEnd:r}){const f=new Set;return n.reduce((d,h)=>([h.markerStart||u,h.markerEnd||r].forEach(m=>{if(m&&typeof m=="object"){const g=zf(m,l);f.has(g)||(d.push({id:g,color:m.color||o,...m}),f.add(g))}}),d),[]).sort((d,h)=>d.id.localeCompare(h.id))}const uy=1e3,tE=10,Qf={nodeOrigin:[0,0],nodeExtent:mo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},nE={...Qf,checkEquality:!0};function $f(n,l){const o={...n};for(const u in l)l[u]!==void 0&&(o[u]=l[u]);return o}function aE(n,l,o){const u=$f(Qf,o);for(const r of n.values())if(r.parentId)If(r,n,l,u);else{const f=Eo(r,u.nodeOrigin),d=ni(r.extent)?r.extent:u.nodeExtent,h=el(f,d,Gn(r));r.internals.positionAbsolute=h}}function lE(n,l){if(!n.handles)return n.measured?l?.internals.handleBounds:void 0;const o=[],u=[];for(const r of n.handles){const f={id:r.id,width:r.width??1,height:r.height??1,nodeId:n.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?o.push(f):r.type==="target"&&u.push(f)}return{source:o,target:u}}function kf(n){return n==="manual"}function Cf(n,l,o,u={}){const r=$f(nE,u),f={i:0},d=new Map(l),h=r?.elevateNodesOnSelect&&!kf(r.zIndexMode)?uy:0;let m=n.length>0,g=!1;l.clear(),o.clear();for(const v of n){let y=d.get(v.id);if(r.checkEquality&&v===y?.internals.userNode)l.set(v.id,y);else{const x=Eo(v,r.nodeOrigin),S=ni(v.extent)?v.extent:r.nodeExtent,_=el(x,S,Gn(v));y={...r.defaults,...v,measured:{width:v.measured?.width,height:v.measured?.height},internals:{positionAbsolute:_,handleBounds:lE(v,y),z:sy(v,h,r.zIndexMode),userNode:v}},l.set(v.id,y)}(y.measured===void 0||y.measured.width===void 0||y.measured.height===void 0)&&!y.hidden&&(m=!1),v.parentId&&If(y,l,o,u,f),g||=v.selected??!1}return{nodesInitialized:m,hasSelectedNodes:g}}function iE(n,l){if(!n.parentId)return;const o=l.get(n.parentId);o?o.set(n.id,n):l.set(n.parentId,new Map([[n.id,n]]))}function If(n,l,o,u,r){const{elevateNodesOnSelect:f,nodeOrigin:d,nodeExtent:h,zIndexMode:m}=$f(Qf,u),g=n.parentId,v=l.get(g);if(!v){console.warn(`Parent node ${g} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}iE(n,o),r&&!v.parentId&&v.internals.rootParentIndex===void 0&&m==="auto"&&(v.internals.rootParentIndex=++r.i,v.internals.z=v.internals.z+r.i*tE),r&&v.internals.rootParentIndex!==void 0&&(r.i=v.internals.rootParentIndex);const y=f&&!kf(m)?uy:0,{x,y:S,z:_}=oE(n,v,d,h,y,m),{positionAbsolute:T}=n.internals,z=x!==T.x||S!==T.y;(z||_!==n.internals.z)&&l.set(n.id,{...n,internals:{...n.internals,positionAbsolute:z?{x,y:S}:T,z:_}})}function sy(n,l,o){const u=en(n.zIndex)?n.zIndex:0;return kf(o)?u:u+(n.selected?l:0)}function oE(n,l,o,u,r,f){const{x:d,y:h}=l.internals.positionAbsolute,m=Gn(n),g=Eo(n,o),v=ni(n.extent)?el(g,n.extent,m):g;let y=el({x:d+v.x,y:h+v.y},u,m);n.extent==="parent"&&(y=Kp(y,m,l));const x=sy(n,r,f),S=l.internals.z??0;return{x:y.x,y:y.y,z:S>=x?S+1:x}}function Kf(n,l,o,u=[0,0]){const r=[],f=new Map;for(const d of n){const h=l.get(d.parentId);if(!h)continue;const m=f.get(d.parentId)?.expandedRect??ti(h),g=Fp(m,d.rect);f.set(d.parentId,{expandedRect:g,parent:h})}return f.size>0&&f.forEach(({expandedRect:d,parent:h},m)=>{const g=h.internals.positionAbsolute,v=Gn(h),y=h.origin??u,x=d.x<g.x?Math.round(Math.abs(g.x-d.x)):0,S=d.y<g.y?Math.round(Math.abs(g.y-d.y)):0,_=Math.max(v.width,Math.round(d.width)),T=Math.max(v.height,Math.round(d.height)),z=(_-v.width)*y[0],N=(T-v.height)*y[1];(x>0||S>0||z||N)&&(r.push({id:m,type:"position",position:{x:h.position.x-x+z,y:h.position.y-S+N}}),o.get(m)?.forEach(U=>{n.some(w=>w.id===U.id)||r.push({id:U.id,type:"position",position:{x:U.position.x+x,y:U.position.y+S}})})),(v.width<d.width||v.height<d.height||x||S)&&r.push({id:m,type:"dimensions",setAttributes:!0,dimensions:{width:_+(x?y[0]*x-z:0),height:T+(S?y[1]*S-N:0)}})}),r}function uE(n,l,o,u,r,f,d){const h=u?.querySelector(".xyflow__viewport");let m=!1;if(!h)return{changes:[],updatedInternals:m};const g=[],v=window.getComputedStyle(h),{m22:y}=new window.DOMMatrixReadOnly(v.transform),x=[];for(const S of n.values()){const _=l.get(S.id);if(!_)continue;if(_.hidden){l.set(_.id,{..._,internals:{..._.internals,handleBounds:void 0}}),m=!0;continue}const T=Zf(S.nodeElement),z=_.measured.width!==T.width||_.measured.height!==T.height;if(!!(T.width&&T.height&&(z||!_.internals.handleBounds||S.force))){const U=S.nodeElement.getBoundingClientRect(),w=ni(_.extent)?_.extent:f;let{positionAbsolute:C}=_.internals;_.parentId&&_.extent==="parent"?C=Kp(C,T,l.get(_.parentId)):w&&(C=el(C,w,T));const V={..._,measured:T,internals:{..._.internals,positionAbsolute:C,handleBounds:{source:b0("source",S.nodeElement,U,y,_.id),target:b0("target",S.nodeElement,U,y,_.id)}}};l.set(_.id,V),_.parentId&&If(V,l,o,{nodeOrigin:r,zIndexMode:d}),m=!0,z&&(g.push({id:_.id,type:"dimensions",dimensions:T}),_.expandParent&&_.parentId&&x.push({id:_.id,parentId:_.parentId,rect:ti(V,r)}))}}if(x.length>0){const S=Kf(x,l,o,r);g.push(...S)}return{changes:g,updatedInternals:m}}async function sE({delta:n,panZoom:l,transform:o,translateExtent:u,width:r,height:f}){if(!l||!n.x&&!n.y)return Promise.resolve(!1);const d=await l.setViewportConstrained({x:o[0]+n.x,y:o[1]+n.y,zoom:o[2]},[[0,0],[r,f]],u),h=!!d&&(d.x!==o[0]||d.y!==o[1]||d.k!==o[2]);return Promise.resolve(h)}function T0(n,l,o,u,r,f){let d=r;const h=u.get(d)||new Map;u.set(d,h.set(o,l)),d=`${r}-${n}`;const m=u.get(d)||new Map;if(u.set(d,m.set(o,l)),f){d=`${r}-${n}-${f}`;const g=u.get(d)||new Map;u.set(d,g.set(o,l))}}function ry(n,l,o){n.clear(),l.clear();for(const u of o){const{source:r,target:f,sourceHandle:d=null,targetHandle:h=null}=u,m={edgeId:u.id,source:r,target:f,sourceHandle:d,targetHandle:h},g=`${r}-${d}--${f}-${h}`,v=`${f}-${h}--${r}-${d}`;T0("source",m,v,n,r,d),T0("target",m,g,n,f,h),l.set(u.id,u)}}function cy(n,l){if(!n.parentId)return!1;const o=l.get(n.parentId);return o?o.selected?!0:cy(o,l):!1}function z0(n,l,o){let u=n;do{if(u?.matches?.(l))return!0;if(u===o)return!1;u=u?.parentElement}while(u);return!1}function rE(n,l,o,u){const r=new Map;for(const[f,d]of n)if((d.selected||d.id===u)&&(!d.parentId||!cy(d,n))&&(d.draggable||l&&typeof d.draggable>"u")){const h=n.get(f);h&&r.set(f,{id:f,position:h.position||{x:0,y:0},distance:{x:o.x-h.internals.positionAbsolute.x,y:o.y-h.internals.positionAbsolute.y},extent:h.extent,parentId:h.parentId,origin:h.origin,expandParent:h.expandParent,internals:{positionAbsolute:h.internals.positionAbsolute||{x:0,y:0}},measured:{width:h.measured.width??0,height:h.measured.height??0}})}return r}function cf({nodeId:n,dragItems:l,nodeLookup:o,dragging:u=!0}){const r=[];for(const[d,h]of l){const m=o.get(d)?.internals.userNode;m&&r.push({...m,position:h.position,dragging:u})}if(!n)return[r[0],r];const f=o.get(n)?.internals.userNode;return[f?{...f,position:l.get(n)?.position||f.position,dragging:u}:r[0],r]}function cE({dragItems:n,snapGrid:l,x:o,y:u}){const r=n.values().next().value;if(!r)return null;const f={x:o-r.distance.x,y:u-r.distance.y},d=No(f,l);return{x:d.x-f.x,y:d.y-f.y}}function fE({onNodeMouseDown:n,getStoreItems:l,onDragStart:o,onDrag:u,onDragStop:r}){let f={x:null,y:null},d=0,h=new Map,m=!1,g={x:0,y:0},v=null,y=!1,x=null,S=!1,_=!1,T=null;function z({noDragClassName:U,handleSelector:w,domNode:C,isSelectable:V,nodeId:L,nodeClickDistance:Y=0}){x=Ut(C);function R({x:W,y:oe}){const{nodeLookup:D,nodeExtent:Q,snapGrid:M,snapToGrid:H,nodeOrigin:q,onNodeDrag:$,onSelectionDrag:ee,onError:A,updateNodePositions:j}=l();f={x:W,y:oe};let P=!1;const te=h.size>1,se=te&&Q?Af(wo(h)):null,ce=te&&H?cE({dragItems:h,snapGrid:M,x:W,y:oe}):null;for(const[re,ue]of h){if(!D.has(re))continue;let fe={x:W-ue.distance.x,y:oe-ue.distance.y};H&&(fe=ce?{x:Math.round(fe.x+ce.x),y:Math.round(fe.y+ce.y)}:No(fe,M));let Ee=null;if(te&&Q&&!ue.extent&&se){const{positionAbsolute:xe}=ue.internals,Ae=xe.x-se.x+Q[0][0],qe=xe.x+ue.measured.width-se.x2+Q[1][0],je=xe.y-se.y+Q[0][1],ot=xe.y+ue.measured.height-se.y2+Q[1][1];Ee=[[Ae,je],[qe,ot]]}const{position:be,positionAbsolute:ye}=Ip({nodeId:re,nextPosition:fe,nodeLookup:D,nodeExtent:Ee||Q,nodeOrigin:q,onError:A});P=P||ue.position.x!==be.x||ue.position.y!==be.y,ue.position=be,ue.internals.positionAbsolute=ye}if(_=_||P,!!P&&(j(h,!0),T&&(u||$||!L&&ee))){const[re,ue]=cf({nodeId:L,dragItems:h,nodeLookup:D});u?.(T,h,re,ue),$?.(T,re,ue),L||ee?.(T,ue)}}async function X(){if(!v)return;const{transform:W,panBy:oe,autoPanSpeed:D,autoPanOnNodeDrag:Q}=l();if(!Q){m=!1,cancelAnimationFrame(d);return}const[M,H]=Jp(g,v,D);(M!==0||H!==0)&&(f.x=(f.x??0)-M/W[2],f.y=(f.y??0)-H/W[2],await oe({x:M,y:H})&&R(f)),d=requestAnimationFrame(X)}function ie(W){const{nodeLookup:oe,multiSelectionActive:D,nodesDraggable:Q,transform:M,snapGrid:H,snapToGrid:q,selectNodesOnDrag:$,onNodeDragStart:ee,onSelectionDragStart:A,unselectNodesAndEdges:j}=l();y=!0,(!$||!V)&&!D&&L&&(oe.get(L)?.selected||j()),V&&$&&L&&n?.(L);const P=ro(W.sourceEvent,{transform:M,snapGrid:H,snapToGrid:q,containerBounds:v});if(f=P,h=rE(oe,Q,P,L),h.size>0&&(o||ee||!L&&A)){const[te,se]=cf({nodeId:L,dragItems:h,nodeLookup:oe});o?.(W.sourceEvent,h,te,se),ee?.(W.sourceEvent,te,se),L||A?.(W.sourceEvent,se)}}const Z=Ap().clickDistance(Y).on("start",W=>{const{domNode:oe,nodeDragThreshold:D,transform:Q,snapGrid:M,snapToGrid:H}=l();v=oe?.getBoundingClientRect()||null,S=!1,_=!1,T=W.sourceEvent,D===0&&ie(W),f=ro(W.sourceEvent,{transform:Q,snapGrid:M,snapToGrid:H,containerBounds:v}),g=tn(W.sourceEvent,v)}).on("drag",W=>{const{autoPanOnNodeDrag:oe,transform:D,snapGrid:Q,snapToGrid:M,nodeDragThreshold:H,nodeLookup:q}=l(),$=ro(W.sourceEvent,{transform:D,snapGrid:Q,snapToGrid:M,containerBounds:v});if(T=W.sourceEvent,(W.sourceEvent.type==="touchmove"&&W.sourceEvent.touches.length>1||L&&!q.has(L))&&(S=!0),!S){if(!m&&oe&&y&&(m=!0,X()),!y){const ee=tn(W.sourceEvent,v),A=ee.x-g.x,j=ee.y-g.y;Math.sqrt(A*A+j*j)>H&&ie(W)}(f.x!==$.xSnapped||f.y!==$.ySnapped)&&h&&y&&(g=tn(W.sourceEvent,v),R($))}}).on("end",W=>{if(!(!y||S)&&(m=!1,y=!1,cancelAnimationFrame(d),h.size>0)){const{nodeLookup:oe,updateNodePositions:D,onNodeDragStop:Q,onSelectionDragStop:M}=l();if(_&&(D(h,!1),_=!1),r||Q||!L&&M){const[H,q]=cf({nodeId:L,dragItems:h,nodeLookup:oe,dragging:!1});r?.(W.sourceEvent,h,H,q),Q?.(W.sourceEvent,H,q),L||M?.(W.sourceEvent,q)}}}).filter(W=>{const oe=W.target;return!W.button&&(!U||!z0(oe,`.${U}`,C))&&(!w||z0(oe,w,C))});x.call(Z)}function N(){x?.on(".drag",null)}return{update:z,destroy:N}}function dE(n,l,o){const u=[],r={x:n.x-o,y:n.y-o,width:o*2,height:o*2};for(const f of l.values())yo(r,ti(f))>0&&u.push(f);return u}const hE=250;function gE(n,l,o,u){let r=[],f=1/0;const d=dE(n,o,l+hE);for(const h of d){const m=[...h.internals.handleBounds?.source??[],...h.internals.handleBounds?.target??[]];for(const g of m){if(u.nodeId===g.nodeId&&u.type===g.type&&u.id===g.id)continue;const{x:v,y}=tl(h,g,g.position,!0),x=Math.sqrt(Math.pow(v-n.x,2)+Math.pow(y-n.y,2));x>l||(x<f?(r=[{...g,x:v,y}],f=x):x===f&&r.push({...g,x:v,y}))}}if(!r.length)return null;if(r.length>1){const h=u.type==="source"?"target":"source";return r.find(m=>m.type===h)??r[0]}return r[0]}function fy(n,l,o,u,r,f=!1){const d=u.get(n);if(!d)return null;const h=r==="strict"?d.internals.handleBounds?.[l]:[...d.internals.handleBounds?.source??[],...d.internals.handleBounds?.target??[]],m=(o?h?.find(g=>g.id===o):h?.[0])??null;return m&&f?{...m,...tl(d,m,m.position,!0)}:m}function dy(n,l){return n||(l?.classList.contains("target")?"target":l?.classList.contains("source")?"source":null)}function mE(n,l){let o=null;return l?o=!0:n&&!l&&(o=!1),o}const hy=()=>!0;function pE(n,{connectionMode:l,connectionRadius:o,handleId:u,nodeId:r,edgeUpdaterType:f,isTarget:d,domNode:h,nodeLookup:m,lib:g,autoPanOnConnect:v,flowId:y,panBy:x,cancelConnection:S,onConnectStart:_,onConnect:T,onConnectEnd:z,isValidConnection:N=hy,onReconnectEnd:U,updateConnection:w,getTransform:C,getFromHandle:V,autoPanSpeed:L,dragThreshold:Y=1,handleDomNode:R}){const X=ey(n.target);let ie=0,Z;const{x:W,y:oe}=tn(n),D=dy(f,R),Q=h?.getBoundingClientRect();let M=!1;if(!Q||!D)return;const H=fy(r,D,u,m,l);if(!H)return;let q=tn(n,Q),$=!1,ee=null,A=!1,j=null;function P(){if(!v||!Q)return;const[be,ye]=Jp(q,Q,L);x({x:be,y:ye}),ie=requestAnimationFrame(P)}const te={...H,nodeId:r,type:D,position:H.position},se=m.get(r);let re={inProgress:!0,isValid:null,from:tl(se,te,me.Left,!0),fromHandle:te,fromPosition:te.position,fromNode:se,to:q,toHandle:null,toPosition:y0[te.position],toNode:null,pointer:q};function ue(){M=!0,w(re),_?.(n,{nodeId:r,handleId:u,handleType:D})}Y===0&&ue();function fe(be){if(!M){const{x:ot,y:$t}=tn(be),Tt=ot-W,kt=$t-oe;if(!(Tt*Tt+kt*kt>Y*Y))return;ue()}if(!V()||!te){Ee(be);return}const ye=C();q=tn(be,Q),Z=gE(Mo(q,ye,!1,[1,1]),o,m,te),$||(P(),$=!0);const xe=gy(be,{handle:Z,connectionMode:l,fromNodeId:r,fromHandleId:u,fromType:d?"target":"source",isValidConnection:N,doc:X,lib:g,flowId:y,nodeLookup:m});j=xe.handleDomNode,ee=xe.connection,A=mE(!!Z,xe.isValid);const Ae=m.get(r),qe=Ae?tl(Ae,te,me.Left,!0):re.from,je={...re,from:qe,isValid:A,to:xe.toHandle&&A?Ss({x:xe.toHandle.x,y:xe.toHandle.y},ye):q,toHandle:xe.toHandle,toPosition:A&&xe.toHandle?xe.toHandle.position:y0[te.position],toNode:xe.toHandle?m.get(xe.toHandle.nodeId):null,pointer:q};w(je),re=je}function Ee(be){if(!("touches"in be&&be.touches.length>0)){if(M){(Z||j)&&ee&&A&&T?.(ee);const{inProgress:ye,...xe}=re,Ae={...xe,toPosition:re.toHandle?re.toPosition:null};z?.(be,Ae),f&&U?.(be,Ae)}S(),cancelAnimationFrame(ie),$=!1,A=!1,ee=null,j=null,X.removeEventListener("mousemove",fe),X.removeEventListener("mouseup",Ee),X.removeEventListener("touchmove",fe),X.removeEventListener("touchend",Ee)}}X.addEventListener("mousemove",fe),X.addEventListener("mouseup",Ee),X.addEventListener("touchmove",fe),X.addEventListener("touchend",Ee)}function gy(n,{handle:l,connectionMode:o,fromNodeId:u,fromHandleId:r,fromType:f,doc:d,lib:h,flowId:m,isValidConnection:g=hy,nodeLookup:v}){const y=f==="target",x=l?d.querySelector(`.${h}-flow__handle[data-id="${m}-${l?.nodeId}-${l?.id}-${l?.type}"]`):null,{x:S,y:_}=tn(n),T=d.elementFromPoint(S,_),z=T?.classList.contains(`${h}-flow__handle`)?T:x,N={handleDomNode:z,isValid:!1,connection:null,toHandle:null};if(z){const U=dy(void 0,z),w=z.getAttribute("data-nodeid"),C=z.getAttribute("data-handleid"),V=z.classList.contains("connectable"),L=z.classList.contains("connectableend");if(!w||!U)return N;const Y={source:y?w:u,sourceHandle:y?C:r,target:y?u:w,targetHandle:y?r:C};N.connection=Y;const X=V&&L&&(o===Pl.Strict?y&&U==="source"||!y&&U==="target":w!==u||C!==r);N.isValid=X&&g(Y),N.toHandle=fy(w,U,C,v,o,!0)}return N}const Df={onPointerDown:pE,isValid:gy};function yE({domNode:n,panZoom:l,getTransform:o,getViewScale:u}){const r=Ut(n);function f({translateExtent:h,width:m,height:g,zoomStep:v=1,pannable:y=!0,zoomable:x=!0,inversePan:S=!1}){const _=w=>{if(w.sourceEvent.type!=="wheel"||!l)return;const C=o(),V=w.sourceEvent.ctrlKey&&vo()?10:1,L=-w.sourceEvent.deltaY*(w.sourceEvent.deltaMode===1?.05:w.sourceEvent.deltaMode?1:.002)*v,Y=C[2]*Math.pow(2,L*V);l.scaleTo(Y)};let T=[0,0];const z=w=>{(w.sourceEvent.type==="mousedown"||w.sourceEvent.type==="touchstart")&&(T=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY])},N=w=>{const C=o();if(w.sourceEvent.type!=="mousemove"&&w.sourceEvent.type!=="touchmove"||!l)return;const V=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY],L=[V[0]-T[0],V[1]-T[1]];T=V;const Y=u()*Math.max(C[2],Math.log(C[2]))*(S?-1:1),R={x:C[0]-L[0]*Y,y:C[1]-L[1]*Y},X=[[0,0],[m,g]];l.setViewportConstrained({x:R.x,y:R.y,zoom:C[2]},X,h)},U=Gp().on("start",z).on("zoom",y?N:null).on("zoom.wheel",x?_:null);r.call(U,{})}function d(){r.on("zoom",null)}return{update:f,destroy:d,pointer:Wt}}const zs=n=>({x:n.x,y:n.y,zoom:n.k}),ff=({x:n,y:l,zoom:o})=>Ms.translate(n,l).scale(o),kl=(n,l)=>n.target.closest(`.${l}`),my=(n,l)=>l===2&&Array.isArray(n)&&n.includes(2),vE=n=>((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2,df=(n,l=0,o=vE,u=()=>{})=>{const r=typeof l=="number"&&l>0;return r||u(),r?n.transition().duration(l).ease(o).on("end",u):n},py=n=>{const l=n.ctrlKey&&vo()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*l};function xE({zoomPanValues:n,noWheelClassName:l,d3Selection:o,d3Zoom:u,panOnScrollMode:r,panOnScrollSpeed:f,zoomOnPinch:d,onPanZoomStart:h,onPanZoom:m,onPanZoomEnd:g}){return v=>{if(kl(v,l))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const y=o.property("__zoom").k||1;if(v.ctrlKey&&d){const z=Wt(v),N=py(v),U=y*Math.pow(2,N);u.scaleTo(o,U,z,v);return}const x=v.deltaMode===1?20:1;let S=r===Fa.Vertical?0:v.deltaX*x,_=r===Fa.Horizontal?0:v.deltaY*x;!vo()&&v.shiftKey&&r!==Fa.Vertical&&(S=v.deltaY*x,_=0),u.translateBy(o,-(S/y)*f,-(_/y)*f,{internal:!0});const T=zs(o.property("__zoom"));clearTimeout(n.panScrollTimeout),n.isPanScrolling?(m?.(v,T),n.panScrollTimeout=setTimeout(()=>{g?.(v,T),n.isPanScrolling=!1},150)):(n.isPanScrolling=!0,h?.(v,T))}}function SE({noWheelClassName:n,preventScrolling:l,d3ZoomHandler:o}){return function(u,r){const f=u.type==="wheel",d=!l&&f&&!u.ctrlKey,h=kl(u,n);if(u.ctrlKey&&f&&h&&u.preventDefault(),d||h)return null;u.preventDefault(),o.call(this,u,r)}}function bE({zoomPanValues:n,onDraggingChange:l,onPanZoomStart:o}){return u=>{if(u.sourceEvent?.internal)return;const r=zs(u.transform);n.mouseButton=u.sourceEvent?.button||0,n.isZoomingOrPanning=!0,n.prevViewport=r,u.sourceEvent?.type==="mousedown"&&l(!0),o&&o?.(u.sourceEvent,r)}}function _E({zoomPanValues:n,panOnDrag:l,onPaneContextMenu:o,onTransformChange:u,onPanZoom:r}){return f=>{n.usedRightMouseButton=!!(o&&my(l,n.mouseButton??0)),f.sourceEvent?.sync||u([f.transform.x,f.transform.y,f.transform.k]),r&&!f.sourceEvent?.internal&&r?.(f.sourceEvent,zs(f.transform))}}function EE({zoomPanValues:n,panOnDrag:l,panOnScroll:o,onDraggingChange:u,onPanZoomEnd:r,onPaneContextMenu:f}){return d=>{if(!d.sourceEvent?.internal&&(n.isZoomingOrPanning=!1,f&&my(l,n.mouseButton??0)&&!n.usedRightMouseButton&&d.sourceEvent&&f(d.sourceEvent),n.usedRightMouseButton=!1,u(!1),r)){const h=zs(d.transform);n.prevViewport=h,clearTimeout(n.timerId),n.timerId=setTimeout(()=>{r?.(d.sourceEvent,h)},o?150:0)}}}function wE({zoomActivationKeyPressed:n,zoomOnScroll:l,zoomOnPinch:o,panOnDrag:u,panOnScroll:r,zoomOnDoubleClick:f,userSelectionActive:d,noWheelClassName:h,noPanClassName:m,lib:g,connectionInProgress:v}){return y=>{const x=n||l,S=o&&y.ctrlKey,_=y.type==="wheel";if(y.button===1&&y.type==="mousedown"&&(kl(y,`${g}-flow__node`)||kl(y,`${g}-flow__edge`)))return!0;if(!u&&!x&&!r&&!f&&!o||d||v&&!_||kl(y,h)&&_||kl(y,m)&&(!_||r&&_&&!n)||!o&&y.ctrlKey&&_)return!1;if(!o&&y.type==="touchstart"&&y.touches?.length>1)return y.preventDefault(),!1;if(!x&&!r&&!S&&_||!u&&(y.type==="mousedown"||y.type==="touchstart")||Array.isArray(u)&&!u.includes(y.button)&&y.type==="mousedown")return!1;const T=Array.isArray(u)&&u.includes(y.button)||!y.button||y.button<=1;return(!y.ctrlKey||_)&&T}}function NE({domNode:n,minZoom:l,maxZoom:o,translateExtent:u,viewport:r,onPanZoom:f,onPanZoomStart:d,onPanZoomEnd:h,onDraggingChange:m}){const g={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=n.getBoundingClientRect(),y=Gp().scaleExtent([l,o]).translateExtent(u),x=Ut(n).call(y);U({x:r.x,y:r.y,zoom:ei(r.zoom,l,o)},[[0,0],[v.width,v.height]],u);const S=x.on("wheel.zoom"),_=x.on("dblclick.zoom");y.wheelDelta(py);function T(Z,W){return x?new Promise(oe=>{y?.interpolate(W?.interpolate==="linear"?so:os).transform(df(x,W?.duration,W?.ease,()=>oe(!0)),Z)}):Promise.resolve(!1)}function z({noWheelClassName:Z,noPanClassName:W,onPaneContextMenu:oe,userSelectionActive:D,panOnScroll:Q,panOnDrag:M,panOnScrollMode:H,panOnScrollSpeed:q,preventScrolling:$,zoomOnPinch:ee,zoomOnScroll:A,zoomOnDoubleClick:j,zoomActivationKeyPressed:P,lib:te,onTransformChange:se,connectionInProgress:ce,paneClickDistance:re,selectionOnDrag:ue}){D&&!g.isZoomingOrPanning&&N();const fe=Q&&!P&&!D;y.clickDistance(ue?1/0:!en(re)||re<0?0:re);const Ee=fe?xE({zoomPanValues:g,noWheelClassName:Z,d3Selection:x,d3Zoom:y,panOnScrollMode:H,panOnScrollSpeed:q,zoomOnPinch:ee,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:h}):SE({noWheelClassName:Z,preventScrolling:$,d3ZoomHandler:S});if(x.on("wheel.zoom",Ee,{passive:!1}),!D){const ye=bE({zoomPanValues:g,onDraggingChange:m,onPanZoomStart:d});y.on("start",ye);const xe=_E({zoomPanValues:g,panOnDrag:M,onPaneContextMenu:!!oe,onPanZoom:f,onTransformChange:se});y.on("zoom",xe);const Ae=EE({zoomPanValues:g,panOnDrag:M,panOnScroll:Q,onPaneContextMenu:oe,onPanZoomEnd:h,onDraggingChange:m});y.on("end",Ae)}const be=wE({zoomActivationKeyPressed:P,panOnDrag:M,zoomOnScroll:A,panOnScroll:Q,zoomOnDoubleClick:j,zoomOnPinch:ee,userSelectionActive:D,noPanClassName:W,noWheelClassName:Z,lib:te,connectionInProgress:ce});y.filter(be),j?x.on("dblclick.zoom",_):x.on("dblclick.zoom",null)}function N(){y.on("zoom",null)}async function U(Z,W,oe){const D=ff(Z),Q=y?.constrain()(D,W,oe);return Q&&await T(Q),new Promise(M=>M(Q))}async function w(Z,W){const oe=ff(Z);return await T(oe,W),new Promise(D=>D(oe))}function C(Z){if(x){const W=ff(Z),oe=x.property("__zoom");(oe.k!==Z.zoom||oe.x!==Z.x||oe.y!==Z.y)&&y?.transform(x,W,null,{sync:!0})}}function V(){const Z=x?Vp(x.node()):{x:0,y:0,k:1};return{x:Z.x,y:Z.y,zoom:Z.k}}function L(Z,W){return x?new Promise(oe=>{y?.interpolate(W?.interpolate==="linear"?so:os).scaleTo(df(x,W?.duration,W?.ease,()=>oe(!0)),Z)}):Promise.resolve(!1)}function Y(Z,W){return x?new Promise(oe=>{y?.interpolate(W?.interpolate==="linear"?so:os).scaleBy(df(x,W?.duration,W?.ease,()=>oe(!0)),Z)}):Promise.resolve(!1)}function R(Z){y?.scaleExtent(Z)}function X(Z){y?.translateExtent(Z)}function ie(Z){const W=!en(Z)||Z<0?0:Z;y?.clickDistance(W)}return{update:z,destroy:N,setViewport:w,setViewportConstrained:U,getViewport:V,scaleTo:L,scaleBy:Y,setScaleExtent:R,setTranslateExtent:X,syncViewport:C,setClickDistance:ie}}var ai;(function(n){n.Line="line",n.Handle="handle"})(ai||(ai={}));function ME({width:n,prevWidth:l,height:o,prevHeight:u,affectsX:r,affectsY:f}){const d=n-l,h=o-u,m=[d>0?1:d<0?-1:0,h>0?1:h<0?-1:0];return d&&r&&(m[0]=m[0]*-1),h&&f&&(m[1]=m[1]*-1),m}function C0(n){const l=n.includes("right")||n.includes("left"),o=n.includes("bottom")||n.includes("top"),u=n.includes("left"),r=n.includes("top");return{isHorizontal:l,isVertical:o,affectsX:u,affectsY:r}}function va(n,l){return Math.max(0,l-n)}function xa(n,l){return Math.max(0,n-l)}function ns(n,l,o){return Math.max(0,l-n,n-o)}function D0(n,l){return n?!l:l}function AE(n,l,o,u,r,f,d,h){let{affectsX:m,affectsY:g}=l;const{isHorizontal:v,isVertical:y}=l,x=v&&y,{xSnapped:S,ySnapped:_}=o,{minWidth:T,maxWidth:z,minHeight:N,maxHeight:U}=u,{x:w,y:C,width:V,height:L,aspectRatio:Y}=n;let R=Math.floor(v?S-n.pointerX:0),X=Math.floor(y?_-n.pointerY:0);const ie=V+(m?-R:R),Z=L+(g?-X:X),W=-f[0]*V,oe=-f[1]*L;let D=ns(ie,T,z),Q=ns(Z,N,U);if(d){let q=0,$=0;m&&R<0?q=va(w+R+W,d[0][0]):!m&&R>0&&(q=xa(w+ie+W,d[1][0])),g&&X<0?$=va(C+X+oe,d[0][1]):!g&&X>0&&($=xa(C+Z+oe,d[1][1])),D=Math.max(D,q),Q=Math.max(Q,$)}if(h){let q=0,$=0;m&&R>0?q=xa(w+R,h[0][0]):!m&&R<0&&(q=va(w+ie,h[1][0])),g&&X>0?$=xa(C+X,h[0][1]):!g&&X<0&&($=va(C+Z,h[1][1])),D=Math.max(D,q),Q=Math.max(Q,$)}if(r){if(v){const q=ns(ie/Y,N,U)*Y;if(D=Math.max(D,q),d){let $=0;!m&&!g||m&&!g&&x?$=xa(C+oe+ie/Y,d[1][1])*Y:$=va(C+oe+(m?R:-R)/Y,d[0][1])*Y,D=Math.max(D,$)}if(h){let $=0;!m&&!g||m&&!g&&x?$=va(C+ie/Y,h[1][1])*Y:$=xa(C+(m?R:-R)/Y,h[0][1])*Y,D=Math.max(D,$)}}if(y){const q=ns(Z*Y,T,z)/Y;if(Q=Math.max(Q,q),d){let $=0;!m&&!g||g&&!m&&x?$=xa(w+Z*Y+W,d[1][0])/Y:$=va(w+(g?X:-X)*Y+W,d[0][0])/Y,Q=Math.max(Q,$)}if(h){let $=0;!m&&!g||g&&!m&&x?$=va(w+Z*Y,h[1][0])/Y:$=xa(w+(g?X:-X)*Y,h[0][0])/Y,Q=Math.max(Q,$)}}}X=X+(X<0?Q:-Q),R=R+(R<0?D:-D),r&&(x?ie>Z*Y?X=(D0(m,g)?-R:R)/Y:R=(D0(m,g)?-X:X)*Y:v?(X=R/Y,g=m):(R=X*Y,m=g));const M=m?w+R:w,H=g?C+X:C;return{width:V+(m?-R:R),height:L+(g?-X:X),x:f[0]*R*(m?-1:1)+M,y:f[1]*X*(g?-1:1)+H}}const yy={width:0,height:0,x:0,y:0},TE={...yy,pointerX:0,pointerY:0,aspectRatio:1};function zE(n){return[[0,0],[n.measured.width,n.measured.height]]}function CE(n,l,o){const u=l.position.x+n.position.x,r=l.position.y+n.position.y,f=n.measured.width??0,d=n.measured.height??0,h=o[0]*f,m=o[1]*d;return[[u-h,r-m],[u+f-h,r+d-m]]}function DE({domNode:n,nodeId:l,getStoreItems:o,onChange:u,onEnd:r}){const f=Ut(n);let d={controlDirection:C0("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function h({controlPosition:g,boundaries:v,keepAspectRatio:y,resizeDirection:x,onResizeStart:S,onResize:_,onResizeEnd:T,shouldResize:z}){let N={...yy},U={...TE};d={boundaries:v,resizeDirection:x,keepAspectRatio:y,controlDirection:C0(g)};let w,C=null,V=[],L,Y,R,X=!1;const ie=Ap().on("start",Z=>{const{nodeLookup:W,transform:oe,snapGrid:D,snapToGrid:Q,nodeOrigin:M,paneDomNode:H}=o();if(w=W.get(l),!w)return;C=H?.getBoundingClientRect()??null;const{xSnapped:q,ySnapped:$}=ro(Z.sourceEvent,{transform:oe,snapGrid:D,snapToGrid:Q,containerBounds:C});N={width:w.measured.width??0,height:w.measured.height??0,x:w.position.x??0,y:w.position.y??0},U={...N,pointerX:q,pointerY:$,aspectRatio:N.width/N.height},L=void 0,w.parentId&&(w.extent==="parent"||w.expandParent)&&(L=W.get(w.parentId),Y=L&&w.extent==="parent"?zE(L):void 0),V=[],R=void 0;for(const[ee,A]of W)if(A.parentId===l&&(V.push({id:ee,position:{...A.position},extent:A.extent}),A.extent==="parent"||A.expandParent)){const j=CE(A,w,A.origin??M);R?R=[[Math.min(j[0][0],R[0][0]),Math.min(j[0][1],R[0][1])],[Math.max(j[1][0],R[1][0]),Math.max(j[1][1],R[1][1])]]:R=j}S?.(Z,{...N})}).on("drag",Z=>{const{transform:W,snapGrid:oe,snapToGrid:D,nodeOrigin:Q}=o(),M=ro(Z.sourceEvent,{transform:W,snapGrid:oe,snapToGrid:D,containerBounds:C}),H=[];if(!w)return;const{x:q,y:$,width:ee,height:A}=N,j={},P=w.origin??Q,{width:te,height:se,x:ce,y:re}=AE(U,d.controlDirection,M,d.boundaries,d.keepAspectRatio,P,Y,R),ue=te!==ee,fe=se!==A,Ee=ce!==q&&ue,be=re!==$&&fe;if(!Ee&&!be&&!ue&&!fe)return;if((Ee||be||P[0]===1||P[1]===1)&&(j.x=Ee?ce:N.x,j.y=be?re:N.y,N.x=j.x,N.y=j.y,V.length>0)){const qe=ce-q,je=re-$;for(const ot of V)ot.position={x:ot.position.x-qe+P[0]*(te-ee),y:ot.position.y-je+P[1]*(se-A)},H.push(ot)}if((ue||fe)&&(j.width=ue&&(!d.resizeDirection||d.resizeDirection==="horizontal")?te:N.width,j.height=fe&&(!d.resizeDirection||d.resizeDirection==="vertical")?se:N.height,N.width=j.width,N.height=j.height),L&&w.expandParent){const qe=P[0]*(j.width??0);j.x&&j.x<qe&&(N.x=qe,U.x=U.x-(j.x-qe));const je=P[1]*(j.height??0);j.y&&j.y<je&&(N.y=je,U.y=U.y-(j.y-je))}const ye=ME({width:N.width,prevWidth:ee,height:N.height,prevHeight:A,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),xe={...N,direction:ye};z?.(Z,xe)!==!1&&(X=!0,_?.(Z,xe),u(j,H))}).on("end",Z=>{X&&(T?.(Z,{...N}),r?.({...N}),X=!1)});f.call(ie)}function m(){f.on(".drag",null)}return{update:h,destroy:m}}var hf={exports:{}},gf={},mf={exports:{}},pf={};var O0;function OE(){if(O0)return pf;O0=1;var n=So();function l(y,x){return y===x&&(y!==0||1/y===1/x)||y!==y&&x!==x}var o=typeof Object.is=="function"?Object.is:l,u=n.useState,r=n.useEffect,f=n.useLayoutEffect,d=n.useDebugValue;function h(y,x){var S=x(),_=u({inst:{value:S,getSnapshot:x}}),T=_[0].inst,z=_[1];return f(function(){T.value=S,T.getSnapshot=x,m(T)&&z({inst:T})},[y,S,x]),r(function(){return m(T)&&z({inst:T}),y(function(){m(T)&&z({inst:T})})},[y]),d(S),S}function m(y){var x=y.getSnapshot;y=y.value;try{var S=x();return!o(y,S)}catch{return!0}}function g(y,x){return x()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:h;return pf.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:v,pf}var R0;function RE(){return R0||(R0=1,mf.exports=OE()),mf.exports}var H0;function HE(){if(H0)return gf;H0=1;var n=So(),l=RE();function o(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var u=typeof Object.is=="function"?Object.is:o,r=l.useSyncExternalStore,f=n.useRef,d=n.useEffect,h=n.useMemo,m=n.useDebugValue;return gf.useSyncExternalStoreWithSelector=function(g,v,y,x,S){var _=f(null);if(_.current===null){var T={hasValue:!1,value:null};_.current=T}else T=_.current;_=h(function(){function N(L){if(!U){if(U=!0,w=L,L=x(L),S!==void 0&&T.hasValue){var Y=T.value;if(S(Y,L))return C=Y}return C=L}if(Y=C,u(w,L))return Y;var R=x(L);return S!==void 0&&S(Y,R)?(w=L,Y):(w=L,C=R)}var U=!1,w,C,V=y===void 0?null:y;return[function(){return N(v())},V===null?void 0:function(){return N(V())}]},[v,y,x,S]);var z=r(g,_[0],_[1]);return d(function(){T.hasValue=!0,T.value=z},[z]),m(z),z},gf}var j0;function jE(){return j0||(j0=1,hf.exports=HE()),hf.exports}var UE=jE();const BE=op(UE),qE={},U0=n=>{let l;const o=new Set,u=(v,y)=>{const x=typeof v=="function"?v(l):v;if(!Object.is(x,l)){const S=l;l=y??(typeof x!="object"||x===null)?x:Object.assign({},l,x),o.forEach(_=>_(l,S))}},r=()=>l,m={setState:u,getState:r,getInitialState:()=>g,subscribe:v=>(o.add(v),()=>o.delete(v)),destroy:()=>{(qE?"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."),o.clear()}},g=l=n(u,r,m);return m},LE=n=>n?U0(n):U0,{useDebugValue:YE}=ao,{useSyncExternalStoreWithSelector:VE}=BE,GE=n=>n;function vy(n,l=GE,o){const u=VE(n.subscribe,n.getState,n.getServerState||n.getInitialState,l,o);return YE(u),u}const B0=(n,l)=>{const o=LE(n),u=(r,f=l)=>vy(o,r,f);return Object.assign(u,o),u},XE=(n,l)=>n?B0(n,l):B0;function $e(n,l){if(Object.is(n,l))return!0;if(typeof n!="object"||n===null||typeof l!="object"||l===null)return!1;if(n instanceof Map&&l instanceof Map){if(n.size!==l.size)return!1;for(const[u,r]of n)if(!Object.is(r,l.get(u)))return!1;return!0}if(n instanceof Set&&l instanceof Set){if(n.size!==l.size)return!1;for(const u of n)if(!l.has(u))return!1;return!0}const o=Object.keys(n);if(o.length!==Object.keys(l).length)return!1;for(const u of o)if(!Object.prototype.hasOwnProperty.call(l,u)||!Object.is(n[u],l[u]))return!1;return!0}up();const Cs=J.createContext(null),ZE=Cs.Provider,xy=hn.error001();function De(n,l){const o=J.useContext(Cs);if(o===null)throw new Error(xy);return vy(o,n,l)}function ke(){const n=J.useContext(Cs);if(n===null)throw new Error(xy);return J.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe}),[n])}const q0={display:"none"},QE={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Sy="react-flow__node-desc",by="react-flow__edge-desc",$E="react-flow__aria-live",kE=n=>n.ariaLiveMessage,IE=n=>n.ariaLabelConfig;function KE({rfId:n}){const l=De(kE);return E.jsx("div",{id:`${$E}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:QE,children:l})}function JE({rfId:n,disableKeyboardA11y:l}){const o=De(IE);return E.jsxs(E.Fragment,{children:[E.jsx("div",{id:`${Sy}-${n}`,style:q0,children:l?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),E.jsx("div",{id:`${by}-${n}`,style:q0,children:o["edge.a11yDescription.default"]}),!l&&E.jsx(KE,{rfId:n})]})}const Ds=J.forwardRef(({position:n="top-left",children:l,className:o,style:u,...r},f)=>{const d=`${n}`.split("-");return E.jsx("div",{className:at(["react-flow__panel",o,...d]),style:u,ref:f,...r,children:l})});Ds.displayName="Panel";function FE({proOptions:n,position:l="bottom-right"}){return n?.hideAttribution?null:E.jsx(Ds,{position:l,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:E.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const WE=n=>{const l=[],o=[];for(const[,u]of n.nodeLookup)u.selected&&l.push(u.internals.userNode);for(const[,u]of n.edgeLookup)u.selected&&o.push(u);return{selectedNodes:l,selectedEdges:o}},as=n=>n.id;function PE(n,l){return $e(n.selectedNodes.map(as),l.selectedNodes.map(as))&&$e(n.selectedEdges.map(as),l.selectedEdges.map(as))}function ew({onSelectionChange:n}){const l=ke(),{selectedNodes:o,selectedEdges:u}=De(WE,PE);return J.useEffect(()=>{const r={nodes:o,edges:u};n?.(r),l.getState().onSelectionChangeHandlers.forEach(f=>f(r))},[o,u,n]),null}const tw=n=>!!n.onSelectionChangeHandlers;function nw({onSelectionChange:n}){const l=De(tw);return n||l?E.jsx(ew,{onSelectionChange:n}):null}const Of=typeof window<"u"?J.useLayoutEffect:J.useEffect,_y=[0,0],aw={x:0,y:0,zoom:1},lw=["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"],L0=[...lw,"rfId"],iw=n=>({setNodes:n.setNodes,setEdges:n.setEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges}),Y0={translateExtent:mo,nodeOrigin:_y,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function ow(n){const{setNodes:l,setEdges:o,setMinZoom:u,setMaxZoom:r,setTranslateExtent:f,setNodeExtent:d,reset:h,setDefaultNodesAndEdges:m}=De(iw,$e),g=ke();Of(()=>(m(n.defaultNodes,n.defaultEdges),()=>{v.current=Y0,h()}),[]);const v=J.useRef(Y0);return Of(()=>{for(const y of L0){const x=n[y],S=v.current[y];x!==S&&(typeof n[y]>"u"||(y==="nodes"?l(x):y==="edges"?o(x):y==="minZoom"?u(x):y==="maxZoom"?r(x):y==="translateExtent"?f(x):y==="nodeExtent"?d(x):y==="ariaLabelConfig"?g.setState({ariaLabelConfig:X_(x)}):y==="fitView"?g.setState({fitViewQueued:x}):y==="fitViewOptions"?g.setState({fitViewOptions:x}):g.setState({[y]:x})))}v.current=n},L0.map(y=>n[y])),null}function V0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function uw(n){const[l,o]=J.useState(n==="system"?null:n);return J.useEffect(()=>{if(n!=="system"){o(n);return}const u=V0(),r=()=>o(u?.matches?"dark":"light");return r(),u?.addEventListener("change",r),()=>{u?.removeEventListener("change",r)}},[n]),l!==null?l:V0()?.matches?"dark":"light"}const G0=typeof document<"u"?document:null;function xo(n=null,l={target:G0,actInsideInputWithModifier:!0}){const[o,u]=J.useState(!1),r=J.useRef(!1),f=J.useRef(new Set([])),[d,h]=J.useMemo(()=>{if(n!==null){const g=(Array.isArray(n)?n:[n]).filter(y=>typeof y=="string").map(y=>y.replace("+",`
10
+ `).replace(`
11
+
12
+ `,`
13
+ +`).split(`
14
+ `)),v=g.reduce((y,x)=>y.concat(...x),[]);return[g,v]}return[[],[]]},[n]);return J.useEffect(()=>{const m=l?.target??G0,g=l?.actInsideInputWithModifier??!0;if(n!==null){const v=S=>{if(r.current=S.ctrlKey||S.metaKey||S.shiftKey||S.altKey,(!r.current||r.current&&!g)&&ty(S))return!1;const T=Z0(S.code,h);if(f.current.add(S[T]),X0(d,f.current,!1)){const z=S.composedPath?.()?.[0]||S.target,N=z?.nodeName==="BUTTON"||z?.nodeName==="A";l.preventDefault!==!1&&(r.current||!N)&&S.preventDefault(),u(!0)}},y=S=>{const _=Z0(S.code,h);X0(d,f.current,!0)?(u(!1),f.current.clear()):f.current.delete(S[_]),S.key==="Meta"&&f.current.clear(),r.current=!1},x=()=>{f.current.clear(),u(!1)};return m?.addEventListener("keydown",v),m?.addEventListener("keyup",y),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{m?.removeEventListener("keydown",v),m?.removeEventListener("keyup",y),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[n,u]),o}function X0(n,l,o){return n.filter(u=>o||u.length===l.size).some(u=>u.every(r=>l.has(r)))}function Z0(n,l){return l.includes(n)?"code":"key"}const sw=()=>{const n=ke();return J.useMemo(()=>({zoomIn:l=>{const{panZoom:o}=n.getState();return o?o.scaleBy(1.2,l):Promise.resolve(!1)},zoomOut:l=>{const{panZoom:o}=n.getState();return o?o.scaleBy(1/1.2,l):Promise.resolve(!1)},zoomTo:(l,o)=>{const{panZoom:u}=n.getState();return u?u.scaleTo(l,o):Promise.resolve(!1)},getZoom:()=>n.getState().transform[2],setViewport:async(l,o)=>{const{transform:[u,r,f],panZoom:d}=n.getState();return d?(await d.setViewport({x:l.x??u,y:l.y??r,zoom:l.zoom??f},o),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[l,o,u]=n.getState().transform;return{x:l,y:o,zoom:u}},setCenter:async(l,o,u)=>n.getState().setCenter(l,o,u),fitBounds:async(l,o)=>{const{width:u,height:r,minZoom:f,maxZoom:d,panZoom:h}=n.getState(),m=Xf(l,u,r,f,d,o?.padding??.1);return h?(await h.setViewport(m,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(l,o={})=>{const{transform:u,snapGrid:r,snapToGrid:f,domNode:d}=n.getState();if(!d)return l;const{x:h,y:m}=d.getBoundingClientRect(),g={x:l.x-h,y:l.y-m},v=o.snapGrid??r,y=o.snapToGrid??f;return Mo(g,u,y,v)},flowToScreenPosition:l=>{const{transform:o,domNode:u}=n.getState();if(!u)return l;const{x:r,y:f}=u.getBoundingClientRect(),d=Ss(l,o);return{x:d.x+r,y:d.y+f}}}),[])};function Ey(n,l){const o=[],u=new Map,r=[];for(const f of n)if(f.type==="add"){r.push(f);continue}else if(f.type==="remove"||f.type==="replace")u.set(f.id,[f]);else{const d=u.get(f.id);d?d.push(f):u.set(f.id,[f])}for(const f of l){const d=u.get(f.id);if(!d){o.push(f);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){o.push({...d[0].item});continue}const h={...f};for(const m of d)rw(m,h);o.push(h)}return r.length&&r.forEach(f=>{f.index!==void 0?o.splice(f.index,0,{...f.item}):o.push({...f.item})}),o}function rw(n,l){switch(n.type){case"select":{l.selected=n.selected;break}case"position":{typeof n.position<"u"&&(l.position=n.position),typeof n.dragging<"u"&&(l.dragging=n.dragging);break}case"dimensions":{typeof n.dimensions<"u"&&(l.measured={...n.dimensions},n.setAttributes&&((n.setAttributes===!0||n.setAttributes==="width")&&(l.width=n.dimensions.width),(n.setAttributes===!0||n.setAttributes==="height")&&(l.height=n.dimensions.height))),typeof n.resizing=="boolean"&&(l.resizing=n.resizing);break}}}function cw(n,l){return Ey(n,l)}function fw(n,l){return Ey(n,l)}function Ia(n,l){return{id:n,type:"select",selected:l}}function Il(n,l=new Set,o=!1){const u=[];for(const[r,f]of n){const d=l.has(r);!(f.selected===void 0&&!d)&&f.selected!==d&&(o&&(f.selected=d),u.push(Ia(f.id,d)))}return u}function Q0({items:n=[],lookup:l}){const o=[],u=new Map(n.map(r=>[r.id,r]));for(const[r,f]of n.entries()){const d=l.get(f.id),h=d?.internals?.userNode??d;h!==void 0&&h!==f&&o.push({id:f.id,item:f,type:"replace"}),h===void 0&&o.push({item:f,type:"add",index:r})}for(const[r]of l)u.get(r)===void 0&&o.push({id:r,type:"remove"});return o}function $0(n){return{id:n.id,type:"remove"}}const k0=n=>R_(n),dw=n=>kp(n);function wy(n){return J.forwardRef(n)}function I0(n){const[l,o]=J.useState(BigInt(0)),[u]=J.useState(()=>hw(()=>o(r=>r+BigInt(1))));return Of(()=>{const r=u.get();r.length&&(n(r),u.reset())},[l]),u}function hw(n){let l=[];return{get:()=>l,reset:()=>{l=[]},push:o=>{l.push(o),n()}}}const Ny=J.createContext(null);function gw({children:n}){const l=ke(),o=J.useCallback(h=>{const{nodes:m=[],setNodes:g,hasDefaultNodes:v,onNodesChange:y,nodeLookup:x,fitViewQueued:S,onNodesChangeMiddlewareMap:_}=l.getState();let T=m;for(const N of h)T=typeof N=="function"?N(T):N;let z=Q0({items:T,lookup:x});for(const N of _.values())z=N(z);v&&g(T),z.length>0?y?.(z):S&&window.requestAnimationFrame(()=>{const{fitViewQueued:N,nodes:U,setNodes:w}=l.getState();N&&w(U)})},[]),u=I0(o),r=J.useCallback(h=>{const{edges:m=[],setEdges:g,hasDefaultEdges:v,onEdgesChange:y,edgeLookup:x}=l.getState();let S=m;for(const _ of h)S=typeof _=="function"?_(S):_;v?g(S):y&&y(Q0({items:S,lookup:x}))},[]),f=I0(r),d=J.useMemo(()=>({nodeQueue:u,edgeQueue:f}),[]);return E.jsx(Ny.Provider,{value:d,children:n})}function mw(){const n=J.useContext(Ny);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}const pw=n=>!!n.panZoom;function Jf(){const n=sw(),l=ke(),o=mw(),u=De(pw),r=J.useMemo(()=>{const f=y=>l.getState().nodeLookup.get(y),d=y=>{o.nodeQueue.push(y)},h=y=>{o.edgeQueue.push(y)},m=y=>{const{nodeLookup:x,nodeOrigin:S}=l.getState(),_=k0(y)?y:x.get(y.id),T=_.parentId?Pp(_.position,_.measured,_.parentId,x,S):_.position,z={..._,position:T,width:_.measured?.width??_.width,height:_.measured?.height??_.height};return ti(z)},g=(y,x,S={replace:!1})=>{d(_=>_.map(T=>{if(T.id===y){const z=typeof x=="function"?x(T):x;return S.replace&&k0(z)?z:{...T,...z}}return T}))},v=(y,x,S={replace:!1})=>{h(_=>_.map(T=>{if(T.id===y){const z=typeof x=="function"?x(T):x;return S.replace&&dw(z)?z:{...T,...z}}return T}))};return{getNodes:()=>l.getState().nodes.map(y=>({...y})),getNode:y=>f(y)?.internals.userNode,getInternalNode:f,getEdges:()=>{const{edges:y=[]}=l.getState();return y.map(x=>({...x}))},getEdge:y=>l.getState().edgeLookup.get(y),setNodes:d,setEdges:h,addNodes:y=>{const x=Array.isArray(y)?y:[y];o.nodeQueue.push(S=>[...S,...x])},addEdges:y=>{const x=Array.isArray(y)?y:[y];o.edgeQueue.push(S=>[...S,...x])},toObject:()=>{const{nodes:y=[],edges:x=[],transform:S}=l.getState(),[_,T,z]=S;return{nodes:y.map(N=>({...N})),edges:x.map(N=>({...N})),viewport:{x:_,y:T,zoom:z}}},deleteElements:async({nodes:y=[],edges:x=[]})=>{const{nodes:S,edges:_,onNodesDelete:T,onEdgesDelete:z,triggerNodeChanges:N,triggerEdgeChanges:U,onDelete:w,onBeforeDelete:C}=l.getState(),{nodes:V,edges:L}=await q_({nodesToRemove:y,edgesToRemove:x,nodes:S,edges:_,onBeforeDelete:C}),Y=L.length>0,R=V.length>0;if(Y){const X=L.map($0);z?.(L),U(X)}if(R){const X=V.map($0);T?.(V),N(X)}return(R||Y)&&w?.({nodes:V,edges:L}),{deletedNodes:V,deletedEdges:L}},getIntersectingNodes:(y,x=!0,S)=>{const _=x0(y),T=_?y:m(y),z=S!==void 0;return T?(S||l.getState().nodes).filter(N=>{const U=l.getState().nodeLookup.get(N.id);if(U&&!_&&(N.id===y.id||!U.internals.positionAbsolute))return!1;const w=ti(z?N:U),C=yo(w,T);return x&&C>0||C>=w.width*w.height||C>=T.width*T.height}):[]},isNodeIntersecting:(y,x,S=!0)=>{const T=x0(y)?y:m(y);if(!T)return!1;const z=yo(T,x);return S&&z>0||z>=x.width*x.height||z>=T.width*T.height},updateNode:g,updateNodeData:(y,x,S={replace:!1})=>{g(y,_=>{const T=typeof x=="function"?x(_):x;return S.replace?{..._,data:T}:{..._,data:{..._.data,...T}}},S)},updateEdge:v,updateEdgeData:(y,x,S={replace:!1})=>{v(y,_=>{const T=typeof x=="function"?x(_):x;return S.replace?{..._,data:T}:{..._,data:{..._.data,...T}}},S)},getNodesBounds:y=>{const{nodeLookup:x,nodeOrigin:S}=l.getState();return H_(y,{nodeLookup:x,nodeOrigin:S})},getHandleConnections:({type:y,id:x,nodeId:S})=>Array.from(l.getState().connectionLookup.get(`${S}-${y}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:y,handleId:x,nodeId:S})=>Array.from(l.getState().connectionLookup.get(`${S}${y?x?`-${y}-${x}`:`-${y}`:""}`)?.values()??[]),fitView:async y=>{const x=l.getState().fitViewResolver??G_();return l.setState({fitViewQueued:!0,fitViewOptions:y,fitViewResolver:x}),o.nodeQueue.push(S=>[...S]),x.promise}}},[]);return J.useMemo(()=>({...r,...n,viewportInitialized:u}),[u])}const K0=n=>n.selected,yw=typeof window<"u"?window:void 0;function vw({deleteKeyCode:n,multiSelectionKeyCode:l}){const o=ke(),{deleteElements:u}=Jf(),r=xo(n,{actInsideInputWithModifier:!1}),f=xo(l,{target:yw});J.useEffect(()=>{if(r){const{edges:d,nodes:h}=o.getState();u({nodes:h.filter(K0),edges:d.filter(K0)}),o.setState({nodesSelectionActive:!1})}},[r]),J.useEffect(()=>{o.setState({multiSelectionActive:f})},[f])}function xw(n){const l=ke();J.useEffect(()=>{const o=()=>{if(!n.current||!(n.current.checkVisibility?.()??!0))return!1;const u=Zf(n.current);(u.height===0||u.width===0)&&l.getState().onError?.("004",hn.error004()),l.setState({width:u.width||500,height:u.height||500})};if(n.current){o(),window.addEventListener("resize",o);const u=new ResizeObserver(()=>o());return u.observe(n.current),()=>{window.removeEventListener("resize",o),u&&n.current&&u.unobserve(n.current)}}},[])}const Os={position:"absolute",width:"100%",height:"100%",top:0,left:0},Sw=n=>({userSelectionActive:n.userSelectionActive,lib:n.lib,connectionInProgress:n.connection.inProgress});function bw({onPaneContextMenu:n,zoomOnScroll:l=!0,zoomOnPinch:o=!0,panOnScroll:u=!1,panOnScrollSpeed:r=.5,panOnScrollMode:f=Fa.Free,zoomOnDoubleClick:d=!0,panOnDrag:h=!0,defaultViewport:m,translateExtent:g,minZoom:v,maxZoom:y,zoomActivationKeyCode:x,preventScrolling:S=!0,children:_,noWheelClassName:T,noPanClassName:z,onViewportChange:N,isControlledViewport:U,paneClickDistance:w,selectionOnDrag:C}){const V=ke(),L=J.useRef(null),{userSelectionActive:Y,lib:R,connectionInProgress:X}=De(Sw,$e),ie=xo(x),Z=J.useRef();xw(L);const W=J.useCallback(oe=>{N?.({x:oe[0],y:oe[1],zoom:oe[2]}),U||V.setState({transform:oe})},[N,U]);return J.useEffect(()=>{if(L.current){Z.current=NE({domNode:L.current,minZoom:v,maxZoom:y,translateExtent:g,viewport:m,onDraggingChange:M=>V.setState(H=>H.paneDragging===M?H:{paneDragging:M}),onPanZoomStart:(M,H)=>{const{onViewportChangeStart:q,onMoveStart:$}=V.getState();$?.(M,H),q?.(H)},onPanZoom:(M,H)=>{const{onViewportChange:q,onMove:$}=V.getState();$?.(M,H),q?.(H)},onPanZoomEnd:(M,H)=>{const{onViewportChangeEnd:q,onMoveEnd:$}=V.getState();$?.(M,H),q?.(H)}});const{x:oe,y:D,zoom:Q}=Z.current.getViewport();return V.setState({panZoom:Z.current,transform:[oe,D,Q],domNode:L.current.closest(".react-flow")}),()=>{Z.current?.destroy()}}},[]),J.useEffect(()=>{Z.current?.update({onPaneContextMenu:n,zoomOnScroll:l,zoomOnPinch:o,panOnScroll:u,panOnScrollSpeed:r,panOnScrollMode:f,zoomOnDoubleClick:d,panOnDrag:h,zoomActivationKeyPressed:ie,preventScrolling:S,noPanClassName:z,userSelectionActive:Y,noWheelClassName:T,lib:R,onTransformChange:W,connectionInProgress:X,selectionOnDrag:C,paneClickDistance:w})},[n,l,o,u,r,f,d,h,ie,S,z,Y,T,R,W,X,C,w]),E.jsx("div",{className:"react-flow__renderer",ref:L,style:Os,children:_})}const _w=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function Ew(){const{userSelectionActive:n,userSelectionRect:l}=De(_w,$e);return n&&l?E.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:l.width,height:l.height,transform:`translate(${l.x}px, ${l.y}px)`}}):null}const yf=(n,l)=>o=>{o.target===l.current&&n?.(o)},ww=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,connectionInProgress:n.connection.inProgress,dragging:n.paneDragging});function Nw({isSelecting:n,selectionKeyPressed:l,selectionMode:o=po.Full,panOnDrag:u,paneClickDistance:r,selectionOnDrag:f,onSelectionStart:d,onSelectionEnd:h,onPaneClick:m,onPaneContextMenu:g,onPaneScroll:v,onPaneMouseEnter:y,onPaneMouseMove:x,onPaneMouseLeave:S,children:_}){const T=ke(),{userSelectionActive:z,elementsSelectable:N,dragging:U,connectionInProgress:w}=De(ww,$e),C=N&&(n||z),V=J.useRef(null),L=J.useRef(),Y=J.useRef(new Set),R=J.useRef(new Set),X=J.useRef(!1),ie=q=>{if(X.current||w){X.current=!1;return}m?.(q),T.getState().resetSelectedElements(),T.setState({nodesSelectionActive:!1})},Z=q=>{if(Array.isArray(u)&&u?.includes(2)){q.preventDefault();return}g?.(q)},W=v?q=>v(q):void 0,oe=q=>{X.current&&(q.stopPropagation(),X.current=!1)},D=q=>{const{domNode:$}=T.getState();if(L.current=$?.getBoundingClientRect(),!L.current)return;const ee=q.target===V.current;if(!ee&&!!q.target.closest(".nokey")||!n||!(f&&ee||l)||q.button!==0||!q.isPrimary)return;q.target?.setPointerCapture?.(q.pointerId),X.current=!1;const{x:P,y:te}=tn(q.nativeEvent,L.current);T.setState({userSelectionRect:{width:0,height:0,startX:P,startY:te,x:P,y:te}}),ee||(q.stopPropagation(),q.preventDefault())},Q=q=>{const{userSelectionRect:$,transform:ee,nodeLookup:A,edgeLookup:j,connectionLookup:P,triggerNodeChanges:te,triggerEdgeChanges:se,defaultEdgeOptions:ce,resetSelectedElements:re}=T.getState();if(!L.current||!$)return;const{x:ue,y:fe}=tn(q.nativeEvent,L.current),{startX:Ee,startY:be}=$;if(!X.current){const je=l?0:r;if(Math.hypot(ue-Ee,fe-be)<=je)return;re(),d?.(q)}X.current=!0;const ye={startX:Ee,startY:be,x:ue<Ee?ue:Ee,y:fe<be?fe:be,width:Math.abs(ue-Ee),height:Math.abs(fe-be)},xe=Y.current,Ae=R.current;Y.current=new Set(Gf(A,ye,ee,o===po.Partial,!0).map(je=>je.id)),R.current=new Set;const qe=ce?.selectable??!0;for(const je of Y.current){const ot=P.get(je);if(ot)for(const{edgeId:$t}of ot.values()){const Tt=j.get($t);Tt&&(Tt.selectable??qe)&&R.current.add($t)}}if(!S0(xe,Y.current)){const je=Il(A,Y.current,!0);te(je)}if(!S0(Ae,R.current)){const je=Il(j,R.current);se(je)}T.setState({userSelectionRect:ye,userSelectionActive:!0,nodesSelectionActive:!1})},M=q=>{q.button===0&&(q.target?.releasePointerCapture?.(q.pointerId),!z&&q.target===V.current&&T.getState().userSelectionRect&&ie?.(q),T.setState({userSelectionActive:!1,userSelectionRect:null}),X.current&&(h?.(q),T.setState({nodesSelectionActive:Y.current.size>0})))},H=u===!0||Array.isArray(u)&&u.includes(0);return E.jsxs("div",{className:at(["react-flow__pane",{draggable:H,dragging:U,selection:n}]),onClick:C?void 0:yf(ie,V),onContextMenu:yf(Z,V),onWheel:yf(W,V),onPointerEnter:C?void 0:y,onPointerMove:C?Q:x,onPointerUp:C?M:void 0,onPointerDownCapture:C?D:void 0,onClickCapture:C?oe:void 0,onPointerLeave:S,ref:V,style:Os,children:[_,E.jsx(Ew,{})]})}function Rf({id:n,store:l,unselect:o=!1,nodeRef:u}){const{addSelectedNodes:r,unselectNodesAndEdges:f,multiSelectionActive:d,nodeLookup:h,onError:m}=l.getState(),g=h.get(n);if(!g){m?.("012",hn.error012(n));return}l.setState({nodesSelectionActive:!1}),g.selected?(o||g.selected&&d)&&(f({nodes:[g],edges:[]}),requestAnimationFrame(()=>u?.current?.blur())):r([n])}function My({nodeRef:n,disabled:l=!1,noDragClassName:o,handleSelector:u,nodeId:r,isSelectable:f,nodeClickDistance:d}){const h=ke(),[m,g]=J.useState(!1),v=J.useRef();return J.useEffect(()=>{v.current=fE({getStoreItems:()=>h.getState(),onNodeMouseDown:y=>{Rf({id:y,store:h,nodeRef:n})},onDragStart:()=>{g(!0)},onDragStop:()=>{g(!1)}})},[]),J.useEffect(()=>{if(!(l||!n.current||!v.current))return v.current.update({noDragClassName:o,handleSelector:u,domNode:n.current,isSelectable:f,nodeId:r,nodeClickDistance:d}),()=>{v.current?.destroy()}},[o,u,l,f,n,r,d]),m}const Mw=n=>l=>l.selected&&(l.draggable||n&&typeof l.draggable>"u");function Ay(){const n=ke();return J.useCallback(o=>{const{nodeExtent:u,snapToGrid:r,snapGrid:f,nodesDraggable:d,onError:h,updateNodePositions:m,nodeLookup:g,nodeOrigin:v}=n.getState(),y=new Map,x=Mw(d),S=r?f[0]:5,_=r?f[1]:5,T=o.direction.x*S*o.factor,z=o.direction.y*_*o.factor;for(const[,N]of g){if(!x(N))continue;let U={x:N.internals.positionAbsolute.x+T,y:N.internals.positionAbsolute.y+z};r&&(U=No(U,f));const{position:w,positionAbsolute:C}=Ip({nodeId:N.id,nextPosition:U,nodeLookup:g,nodeExtent:u,nodeOrigin:v,onError:h});N.position=w,N.internals.positionAbsolute=C,y.set(N.id,N)}m(y)},[])}const Ff=J.createContext(null),Aw=Ff.Provider;Ff.Consumer;const Ty=()=>J.useContext(Ff),Tw=n=>({connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}),zw=(n,l,o)=>u=>{const{connectionClickStartHandle:r,connectionMode:f,connection:d}=u,{fromHandle:h,toHandle:m,isValid:g}=d,v=m?.nodeId===n&&m?.id===l&&m?.type===o;return{connectingFrom:h?.nodeId===n&&h?.id===l&&h?.type===o,connectingTo:v,clickConnecting:r?.nodeId===n&&r?.id===l&&r?.type===o,isPossibleEndHandle:f===Pl.Strict?h?.type!==o:n!==h?.nodeId||l!==h?.id,connectionInProcess:!!h,clickConnectionInProcess:!!r,valid:v&&g}};function Cw({type:n="source",position:l=me.Top,isValidConnection:o,isConnectable:u=!0,isConnectableStart:r=!0,isConnectableEnd:f=!0,id:d,onConnect:h,children:m,className:g,onMouseDown:v,onTouchStart:y,...x},S){const _=d||null,T=n==="target",z=ke(),N=Ty(),{connectOnClick:U,noPanClassName:w,rfId:C}=De(Tw,$e),{connectingFrom:V,connectingTo:L,clickConnecting:Y,isPossibleEndHandle:R,connectionInProcess:X,clickConnectionInProcess:ie,valid:Z}=De(zw(N,_,n),$e);N||z.getState().onError?.("010",hn.error010());const W=Q=>{const{defaultEdgeOptions:M,onConnect:H,hasDefaultEdges:q}=z.getState(),$={...M,...Q};if(q){const{edges:ee,setEdges:A}=z.getState();A(K_($,ee))}H?.($),h?.($)},oe=Q=>{if(!N)return;const M=ny(Q.nativeEvent);if(r&&(M&&Q.button===0||!M)){const H=z.getState();Df.onPointerDown(Q.nativeEvent,{handleDomNode:Q.currentTarget,autoPanOnConnect:H.autoPanOnConnect,connectionMode:H.connectionMode,connectionRadius:H.connectionRadius,domNode:H.domNode,nodeLookup:H.nodeLookup,lib:H.lib,isTarget:T,handleId:_,nodeId:N,flowId:H.rfId,panBy:H.panBy,cancelConnection:H.cancelConnection,onConnectStart:H.onConnectStart,onConnectEnd:(...q)=>z.getState().onConnectEnd?.(...q),updateConnection:H.updateConnection,onConnect:W,isValidConnection:o||((...q)=>z.getState().isValidConnection?.(...q)??!0),getTransform:()=>z.getState().transform,getFromHandle:()=>z.getState().connection.fromHandle,autoPanSpeed:H.autoPanSpeed,dragThreshold:H.connectionDragThreshold})}M?v?.(Q):y?.(Q)},D=Q=>{const{onClickConnectStart:M,onClickConnectEnd:H,connectionClickStartHandle:q,connectionMode:$,isValidConnection:ee,lib:A,rfId:j,nodeLookup:P,connection:te}=z.getState();if(!N||!q&&!r)return;if(!q){M?.(Q.nativeEvent,{nodeId:N,handleId:_,handleType:n}),z.setState({connectionClickStartHandle:{nodeId:N,type:n,id:_}});return}const se=ey(Q.target),ce=o||ee,{connection:re,isValid:ue}=Df.isValid(Q.nativeEvent,{handle:{nodeId:N,id:_,type:n},connectionMode:$,fromNodeId:q.nodeId,fromHandleId:q.id||null,fromType:q.type,isValidConnection:ce,flowId:j,doc:se,lib:A,nodeLookup:P});ue&&re&&W(re);const fe=structuredClone(te);delete fe.inProgress,fe.toPosition=fe.toHandle?fe.toHandle.position:null,H?.(Q,fe),z.setState({connectionClickStartHandle:null})};return E.jsx("div",{"data-handleid":_,"data-nodeid":N,"data-handlepos":l,"data-id":`${C}-${N}-${_}-${n}`,className:at(["react-flow__handle",`react-flow__handle-${l}`,"nodrag",w,g,{source:!T,target:T,connectable:u,connectablestart:r,connectableend:f,clickconnecting:Y,connectingfrom:V,connectingto:L,valid:Z,connectionindicator:u&&(!X||R)&&(X||ie?f:r)}]),onMouseDown:oe,onTouchStart:oe,onClick:U?D:void 0,ref:S,...x,children:m})}const li=J.memo(wy(Cw));function Dw({data:n,isConnectable:l,sourcePosition:o=me.Bottom}){return E.jsxs(E.Fragment,{children:[n?.label,E.jsx(li,{type:"source",position:o,isConnectable:l})]})}function Ow({data:n,isConnectable:l,targetPosition:o=me.Top,sourcePosition:u=me.Bottom}){return E.jsxs(E.Fragment,{children:[E.jsx(li,{type:"target",position:o,isConnectable:l}),n?.label,E.jsx(li,{type:"source",position:u,isConnectable:l})]})}function Rw(){return null}function Hw({data:n,isConnectable:l,targetPosition:o=me.Top}){return E.jsxs(E.Fragment,{children:[E.jsx(li,{type:"target",position:o,isConnectable:l}),n?.label]})}const bs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},J0={input:Dw,default:Ow,output:Hw,group:Rw};function jw(n){return n.internals.handleBounds===void 0?{width:n.width??n.initialWidth??n.style?.width,height:n.height??n.initialHeight??n.style?.height}:{width:n.width??n.style?.width,height:n.height??n.style?.height}}const Uw=n=>{const{width:l,height:o,x:u,y:r}=wo(n.nodeLookup,{filter:f=>!!f.selected});return{width:en(l)?l:null,height:en(o)?o:null,userSelectionActive:n.userSelectionActive,transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]}) translate(${u}px,${r}px)`}};function Bw({onSelectionContextMenu:n,noPanClassName:l,disableKeyboardA11y:o}){const u=ke(),{width:r,height:f,transformString:d,userSelectionActive:h}=De(Uw,$e),m=Ay(),g=J.useRef(null);J.useEffect(()=>{o||g.current?.focus({preventScroll:!0})},[o]);const v=!h&&r!==null&&f!==null;if(My({nodeRef:g,disabled:!v}),!v)return null;const y=n?S=>{const _=u.getState().nodes.filter(T=>T.selected);n(S,_)}:void 0,x=S=>{Object.prototype.hasOwnProperty.call(bs,S.key)&&(S.preventDefault(),m({direction:bs[S.key],factor:S.shiftKey?4:1}))};return E.jsx("div",{className:at(["react-flow__nodesselection","react-flow__container",l]),style:{transform:d},children:E.jsx("div",{ref:g,className:"react-flow__nodesselection-rect",onContextMenu:y,tabIndex:o?void 0:-1,onKeyDown:o?void 0:x,style:{width:r,height:f}})})}const F0=typeof window<"u"?window:void 0,qw=n=>({nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive});function zy({children:n,onPaneClick:l,onPaneMouseEnter:o,onPaneMouseMove:u,onPaneMouseLeave:r,onPaneContextMenu:f,onPaneScroll:d,paneClickDistance:h,deleteKeyCode:m,selectionKeyCode:g,selectionOnDrag:v,selectionMode:y,onSelectionStart:x,onSelectionEnd:S,multiSelectionKeyCode:_,panActivationKeyCode:T,zoomActivationKeyCode:z,elementsSelectable:N,zoomOnScroll:U,zoomOnPinch:w,panOnScroll:C,panOnScrollSpeed:V,panOnScrollMode:L,zoomOnDoubleClick:Y,panOnDrag:R,defaultViewport:X,translateExtent:ie,minZoom:Z,maxZoom:W,preventScrolling:oe,onSelectionContextMenu:D,noWheelClassName:Q,noPanClassName:M,disableKeyboardA11y:H,onViewportChange:q,isControlledViewport:$}){const{nodesSelectionActive:ee,userSelectionActive:A}=De(qw,$e),j=xo(g,{target:F0}),P=xo(T,{target:F0}),te=P||R,se=P||C,ce=v&&te!==!0,re=j||A||ce;return vw({deleteKeyCode:m,multiSelectionKeyCode:_}),E.jsx(bw,{onPaneContextMenu:f,elementsSelectable:N,zoomOnScroll:U,zoomOnPinch:w,panOnScroll:se,panOnScrollSpeed:V,panOnScrollMode:L,zoomOnDoubleClick:Y,panOnDrag:!j&&te,defaultViewport:X,translateExtent:ie,minZoom:Z,maxZoom:W,zoomActivationKeyCode:z,preventScrolling:oe,noWheelClassName:Q,noPanClassName:M,onViewportChange:q,isControlledViewport:$,paneClickDistance:h,selectionOnDrag:ce,children:E.jsxs(Nw,{onSelectionStart:x,onSelectionEnd:S,onPaneClick:l,onPaneMouseEnter:o,onPaneMouseMove:u,onPaneMouseLeave:r,onPaneContextMenu:f,onPaneScroll:d,panOnDrag:te,isSelecting:!!re,selectionMode:y,selectionKeyPressed:j,paneClickDistance:h,selectionOnDrag:ce,children:[n,ee&&E.jsx(Bw,{onSelectionContextMenu:D,noPanClassName:M,disableKeyboardA11y:H})]})})}zy.displayName="FlowRenderer";const Lw=J.memo(zy),Yw=n=>l=>n?Gf(l.nodeLookup,{x:0,y:0,width:l.width,height:l.height},l.transform,!0).map(o=>o.id):Array.from(l.nodeLookup.keys());function Vw(n){return De(J.useCallback(Yw(n),[n]),$e)}const Gw=n=>n.updateNodeInternals;function Xw(){const n=De(Gw),[l]=J.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(o=>{const u=new Map;o.forEach(r=>{const f=r.target.getAttribute("data-id");u.set(f,{id:f,nodeElement:r.target,force:!0})}),n(u)}));return J.useEffect(()=>()=>{l?.disconnect()},[l]),l}function Zw({node:n,nodeType:l,hasDimensions:o,resizeObserver:u}){const r=ke(),f=J.useRef(null),d=J.useRef(null),h=J.useRef(n.sourcePosition),m=J.useRef(n.targetPosition),g=J.useRef(l),v=o&&!!n.internals.handleBounds;return J.useEffect(()=>{f.current&&!n.hidden&&(!v||d.current!==f.current)&&(d.current&&u?.unobserve(d.current),u?.observe(f.current),d.current=f.current)},[v,n.hidden]),J.useEffect(()=>()=>{d.current&&(u?.unobserve(d.current),d.current=null)},[]),J.useEffect(()=>{if(f.current){const y=g.current!==l,x=h.current!==n.sourcePosition,S=m.current!==n.targetPosition;(y||x||S)&&(g.current=l,h.current=n.sourcePosition,m.current=n.targetPosition,r.getState().updateNodeInternals(new Map([[n.id,{id:n.id,nodeElement:f.current,force:!0}]])))}},[n.id,l,n.sourcePosition,n.targetPosition]),f}function Qw({id:n,onClick:l,onMouseEnter:o,onMouseMove:u,onMouseLeave:r,onContextMenu:f,onDoubleClick:d,nodesDraggable:h,elementsSelectable:m,nodesConnectable:g,nodesFocusable:v,resizeObserver:y,noDragClassName:x,noPanClassName:S,disableKeyboardA11y:_,rfId:T,nodeTypes:z,nodeClickDistance:N,onError:U}){const{node:w,internals:C,isParent:V}=De(ue=>{const fe=ue.nodeLookup.get(n),Ee=ue.parentLookup.has(n);return{node:fe,internals:fe.internals,isParent:Ee}},$e);let L=w.type||"default",Y=z?.[L]||J0[L];Y===void 0&&(U?.("003",hn.error003(L)),L="default",Y=z?.default||J0.default);const R=!!(w.draggable||h&&typeof w.draggable>"u"),X=!!(w.selectable||m&&typeof w.selectable>"u"),ie=!!(w.connectable||g&&typeof w.connectable>"u"),Z=!!(w.focusable||v&&typeof w.focusable>"u"),W=ke(),oe=Wp(w),D=Zw({node:w,nodeType:L,hasDimensions:oe,resizeObserver:y}),Q=My({nodeRef:D,disabled:w.hidden||!R,noDragClassName:x,handleSelector:w.dragHandle,nodeId:n,isSelectable:X,nodeClickDistance:N}),M=Ay();if(w.hidden)return null;const H=Gn(w),q=jw(w),$=X||R||l||o||u||r,ee=o?ue=>o(ue,{...C.userNode}):void 0,A=u?ue=>u(ue,{...C.userNode}):void 0,j=r?ue=>r(ue,{...C.userNode}):void 0,P=f?ue=>f(ue,{...C.userNode}):void 0,te=d?ue=>d(ue,{...C.userNode}):void 0,se=ue=>{const{selectNodesOnDrag:fe,nodeDragThreshold:Ee}=W.getState();X&&(!fe||!R||Ee>0)&&Rf({id:n,store:W,nodeRef:D}),l&&l(ue,{...C.userNode})},ce=ue=>{if(!(ty(ue.nativeEvent)||_)){if(Xp.includes(ue.key)&&X){const fe=ue.key==="Escape";Rf({id:n,store:W,unselect:fe,nodeRef:D})}else if(R&&w.selected&&Object.prototype.hasOwnProperty.call(bs,ue.key)){ue.preventDefault();const{ariaLabelConfig:fe}=W.getState();W.setState({ariaLiveMessage:fe["node.a11yDescription.ariaLiveMessage"]({direction:ue.key.replace("Arrow","").toLowerCase(),x:~~C.positionAbsolute.x,y:~~C.positionAbsolute.y})}),M({direction:bs[ue.key],factor:ue.shiftKey?4:1})}}},re=()=>{if(_||!D.current?.matches(":focus-visible"))return;const{transform:ue,width:fe,height:Ee,autoPanOnNodeFocus:be,setCenter:ye}=W.getState();if(!be)return;Gf(new Map([[n,w]]),{x:0,y:0,width:fe,height:Ee},ue,!0).length>0||ye(w.position.x+H.width/2,w.position.y+H.height/2,{zoom:ue[2]})};return E.jsx("div",{className:at(["react-flow__node",`react-flow__node-${L}`,{[S]:R},w.className,{selected:w.selected,selectable:X,parent:V,draggable:R,dragging:Q}]),ref:D,style:{zIndex:C.z,transform:`translate(${C.positionAbsolute.x}px,${C.positionAbsolute.y}px)`,pointerEvents:$?"all":"none",visibility:oe?"visible":"hidden",...w.style,...q},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:ee,onMouseMove:A,onMouseLeave:j,onContextMenu:P,onClick:se,onDoubleClick:te,onKeyDown:Z?ce:void 0,tabIndex:Z?0:void 0,onFocus:Z?re:void 0,role:w.ariaRole??(Z?"group":void 0),"aria-roledescription":"node","aria-describedby":_?void 0:`${Sy}-${T}`,"aria-label":w.ariaLabel,...w.domAttributes,children:E.jsx(Aw,{value:n,children:E.jsx(Y,{id:n,data:w.data,type:L,positionAbsoluteX:C.positionAbsolute.x,positionAbsoluteY:C.positionAbsolute.y,selected:w.selected??!1,selectable:X,draggable:R,deletable:w.deletable??!0,isConnectable:ie,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:Q,dragHandle:w.dragHandle,zIndex:C.z,parentId:w.parentId,...H})})})}var $w=J.memo(Qw);const kw=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError});function Cy(n){const{nodesDraggable:l,nodesConnectable:o,nodesFocusable:u,elementsSelectable:r,onError:f}=De(kw,$e),d=Vw(n.onlyRenderVisibleElements),h=Xw();return E.jsx("div",{className:"react-flow__nodes",style:Os,children:d.map(m=>E.jsx($w,{id:m,nodeTypes:n.nodeTypes,nodeExtent:n.nodeExtent,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,resizeObserver:h,nodesDraggable:l,nodesConnectable:o,nodesFocusable:u,elementsSelectable:r,nodeClickDistance:n.nodeClickDistance,onError:f},m))})}Cy.displayName="NodeRenderer";const Iw=J.memo(Cy);function Kw(n){return De(J.useCallback(o=>{if(!n)return o.edges.map(r=>r.id);const u=[];if(o.width&&o.height)for(const r of o.edges){const f=o.nodeLookup.get(r.source),d=o.nodeLookup.get(r.target);f&&d&&$_({sourceNode:f,targetNode:d,width:o.width,height:o.height,transform:o.transform})&&u.push(r.id)}return u},[n]),$e)}const Jw=({color:n="none",strokeWidth:l=1})=>{const o={strokeWidth:l,...n&&{stroke:n}};return E.jsx("polyline",{className:"arrow",style:o,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Fw=({color:n="none",strokeWidth:l=1})=>{const o={strokeWidth:l,...n&&{stroke:n,fill:n}};return E.jsx("polyline",{className:"arrowclosed",style:o,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},W0={[vs.Arrow]:Jw,[vs.ArrowClosed]:Fw};function Ww(n){const l=ke();return J.useMemo(()=>Object.prototype.hasOwnProperty.call(W0,n)?W0[n]:(l.getState().onError?.("009",hn.error009(n)),null),[n])}const Pw=({id:n,type:l,color:o,width:u=12.5,height:r=12.5,markerUnits:f="strokeWidth",strokeWidth:d,orient:h="auto-start-reverse"})=>{const m=Ww(l);return m?E.jsx("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${u}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:f,orient:h,refX:"0",refY:"0",children:E.jsx(m,{color:o,strokeWidth:d})}):null},Dy=({defaultColor:n,rfId:l})=>{const o=De(f=>f.edges),u=De(f=>f.defaultEdgeOptions),r=J.useMemo(()=>eE(o,{id:l,defaultColor:n,defaultMarkerStart:u?.markerStart,defaultMarkerEnd:u?.markerEnd}),[o,u,l,n]);return r.length?E.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:E.jsx("defs",{children:r.map(f=>E.jsx(Pw,{id:f.id,type:f.type,color:f.color,width:f.width,height:f.height,markerUnits:f.markerUnits,strokeWidth:f.strokeWidth,orient:f.orient},f.id))})}):null};Dy.displayName="MarkerDefinitions";var eN=J.memo(Dy);function Oy({x:n,y:l,label:o,labelStyle:u,labelShowBg:r=!0,labelBgStyle:f,labelBgPadding:d=[2,4],labelBgBorderRadius:h=2,children:m,className:g,...v}){const[y,x]=J.useState({x:1,y:0,width:0,height:0}),S=at(["react-flow__edge-textwrapper",g]),_=J.useRef(null);return J.useEffect(()=>{if(_.current){const T=_.current.getBBox();x({x:T.x,y:T.y,width:T.width,height:T.height})}},[o]),o?E.jsxs("g",{transform:`translate(${n-y.width/2} ${l-y.height/2})`,className:S,visibility:y.width?"visible":"hidden",...v,children:[r&&E.jsx("rect",{width:y.width+2*d[0],x:-d[0],y:-d[1],height:y.height+2*d[1],className:"react-flow__edge-textbg",style:f,rx:h,ry:h}),E.jsx("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:_,style:u,children:o}),m]}):null}Oy.displayName="EdgeText";const tN=J.memo(Oy);function Rs({path:n,labelX:l,labelY:o,label:u,labelStyle:r,labelShowBg:f,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m,interactionWidth:g=20,...v}){return E.jsxs(E.Fragment,{children:[E.jsx("path",{...v,d:n,fill:"none",className:at(["react-flow__edge-path",v.className])}),g?E.jsx("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}):null,u&&en(l)&&en(o)?E.jsx(tN,{x:l,y:o,label:u,labelStyle:r,labelShowBg:f,labelBgStyle:d,labelBgPadding:h,labelBgBorderRadius:m}):null]})}function P0({pos:n,x1:l,y1:o,x2:u,y2:r}){return n===me.Left||n===me.Right?[.5*(l+u),o]:[l,.5*(o+r)]}function Ry({sourceX:n,sourceY:l,sourcePosition:o=me.Bottom,targetX:u,targetY:r,targetPosition:f=me.Top}){const[d,h]=P0({pos:o,x1:n,y1:l,x2:u,y2:r}),[m,g]=P0({pos:f,x1:u,y1:r,x2:n,y2:l}),[v,y,x,S]=ay({sourceX:n,sourceY:l,targetX:u,targetY:r,sourceControlX:d,sourceControlY:h,targetControlX:m,targetControlY:g});return[`M${n},${l} C${d},${h} ${m},${g} ${u},${r}`,v,y,x,S]}function Hy(n){return J.memo(({id:l,sourceX:o,sourceY:u,targetX:r,targetY:f,sourcePosition:d,targetPosition:h,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:S,style:_,markerEnd:T,markerStart:z,interactionWidth:N})=>{const[U,w,C]=Ry({sourceX:o,sourceY:u,sourcePosition:d,targetX:r,targetY:f,targetPosition:h}),V=n.isInternal?void 0:l;return E.jsx(Rs,{id:V,path:U,labelX:w,labelY:C,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:S,style:_,markerEnd:T,markerStart:z,interactionWidth:N})})}const nN=Hy({isInternal:!1}),jy=Hy({isInternal:!0});nN.displayName="SimpleBezierEdge";jy.displayName="SimpleBezierEdgeInternal";function Uy(n){return J.memo(({id:l,sourceX:o,sourceY:u,targetX:r,targetY:f,label:d,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,sourcePosition:S=me.Bottom,targetPosition:_=me.Top,markerEnd:T,markerStart:z,pathOptions:N,interactionWidth:U})=>{const[w,C,V]=Tf({sourceX:o,sourceY:u,sourcePosition:S,targetX:r,targetY:f,targetPosition:_,borderRadius:N?.borderRadius,offset:N?.offset,stepPosition:N?.stepPosition}),L=n.isInternal?void 0:l;return E.jsx(Rs,{id:L,path:w,labelX:C,labelY:V,label:d,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:T,markerStart:z,interactionWidth:U})})}const By=Uy({isInternal:!1}),qy=Uy({isInternal:!0});By.displayName="SmoothStepEdge";qy.displayName="SmoothStepEdgeInternal";function Ly(n){return J.memo(({id:l,...o})=>{const u=n.isInternal?void 0:l;return E.jsx(By,{...o,id:u,pathOptions:J.useMemo(()=>({borderRadius:0,offset:o.pathOptions?.offset}),[o.pathOptions?.offset])})})}const aN=Ly({isInternal:!1}),Yy=Ly({isInternal:!0});aN.displayName="StepEdge";Yy.displayName="StepEdgeInternal";function Vy(n){return J.memo(({id:l,sourceX:o,sourceY:u,targetX:r,targetY:f,label:d,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:S,markerStart:_,interactionWidth:T})=>{const[z,N,U]=oy({sourceX:o,sourceY:u,targetX:r,targetY:f}),w=n.isInternal?void 0:l;return E.jsx(Rs,{id:w,path:z,labelX:N,labelY:U,label:d,labelStyle:h,labelShowBg:m,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:S,markerStart:_,interactionWidth:T})})}const lN=Vy({isInternal:!1}),Gy=Vy({isInternal:!0});lN.displayName="StraightEdge";Gy.displayName="StraightEdgeInternal";function Xy(n){return J.memo(({id:l,sourceX:o,sourceY:u,targetX:r,targetY:f,sourcePosition:d=me.Bottom,targetPosition:h=me.Top,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:S,style:_,markerEnd:T,markerStart:z,pathOptions:N,interactionWidth:U})=>{const[w,C,V]=ly({sourceX:o,sourceY:u,sourcePosition:d,targetX:r,targetY:f,targetPosition:h,curvature:N?.curvature}),L=n.isInternal?void 0:l;return E.jsx(Rs,{id:L,path:w,labelX:C,labelY:V,label:m,labelStyle:g,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:S,style:_,markerEnd:T,markerStart:z,interactionWidth:U})})}const iN=Xy({isInternal:!1}),Zy=Xy({isInternal:!0});iN.displayName="BezierEdge";Zy.displayName="BezierEdgeInternal";const ep={default:Zy,straight:Gy,step:Yy,smoothstep:qy,simplebezier:jy},tp={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},oN=(n,l,o)=>o===me.Left?n-l:o===me.Right?n+l:n,uN=(n,l,o)=>o===me.Top?n-l:o===me.Bottom?n+l:n,np="react-flow__edgeupdater";function ap({position:n,centerX:l,centerY:o,radius:u=10,onMouseDown:r,onMouseEnter:f,onMouseOut:d,type:h}){return E.jsx("circle",{onMouseDown:r,onMouseEnter:f,onMouseOut:d,className:at([np,`${np}-${h}`]),cx:oN(l,u,n),cy:uN(o,u,n),r:u,stroke:"transparent",fill:"transparent"})}function sN({isReconnectable:n,reconnectRadius:l,edge:o,sourceX:u,sourceY:r,targetX:f,targetY:d,sourcePosition:h,targetPosition:m,onReconnect:g,onReconnectStart:v,onReconnectEnd:y,setReconnecting:x,setUpdateHover:S}){const _=ke(),T=(C,V)=>{if(C.button!==0)return;const{autoPanOnConnect:L,domNode:Y,connectionMode:R,connectionRadius:X,lib:ie,onConnectStart:Z,cancelConnection:W,nodeLookup:oe,rfId:D,panBy:Q,updateConnection:M}=_.getState(),H=V.type==="target",q=(A,j)=>{x(!1),y?.(A,o,V.type,j)},$=A=>g?.(o,A),ee=(A,j)=>{x(!0),v?.(C,o,V.type),Z?.(A,j)};Df.onPointerDown(C.nativeEvent,{autoPanOnConnect:L,connectionMode:R,connectionRadius:X,domNode:Y,handleId:V.id,nodeId:V.nodeId,nodeLookup:oe,isTarget:H,edgeUpdaterType:V.type,lib:ie,flowId:D,cancelConnection:W,panBy:Q,isValidConnection:(...A)=>_.getState().isValidConnection?.(...A)??!0,onConnect:$,onConnectStart:ee,onConnectEnd:(...A)=>_.getState().onConnectEnd?.(...A),onReconnectEnd:q,updateConnection:M,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,dragThreshold:_.getState().connectionDragThreshold,handleDomNode:C.currentTarget})},z=C=>T(C,{nodeId:o.target,id:o.targetHandle??null,type:"target"}),N=C=>T(C,{nodeId:o.source,id:o.sourceHandle??null,type:"source"}),U=()=>S(!0),w=()=>S(!1);return E.jsxs(E.Fragment,{children:[(n===!0||n==="source")&&E.jsx(ap,{position:h,centerX:u,centerY:r,radius:l,onMouseDown:z,onMouseEnter:U,onMouseOut:w,type:"source"}),(n===!0||n==="target")&&E.jsx(ap,{position:m,centerX:f,centerY:d,radius:l,onMouseDown:N,onMouseEnter:U,onMouseOut:w,type:"target"})]})}function rN({id:n,edgesFocusable:l,edgesReconnectable:o,elementsSelectable:u,onClick:r,onDoubleClick:f,onContextMenu:d,onMouseEnter:h,onMouseMove:m,onMouseLeave:g,reconnectRadius:v,onReconnect:y,onReconnectStart:x,onReconnectEnd:S,rfId:_,edgeTypes:T,noPanClassName:z,onError:N,disableKeyboardA11y:U}){let w=De(ye=>ye.edgeLookup.get(n));const C=De(ye=>ye.defaultEdgeOptions);w=C?{...C,...w}:w;let V=w.type||"default",L=T?.[V]||ep[V];L===void 0&&(N?.("011",hn.error011(V)),V="default",L=T?.default||ep.default);const Y=!!(w.focusable||l&&typeof w.focusable>"u"),R=typeof y<"u"&&(w.reconnectable||o&&typeof w.reconnectable>"u"),X=!!(w.selectable||u&&typeof w.selectable>"u"),ie=J.useRef(null),[Z,W]=J.useState(!1),[oe,D]=J.useState(!1),Q=ke(),{zIndex:M,sourceX:H,sourceY:q,targetX:$,targetY:ee,sourcePosition:A,targetPosition:j}=De(J.useCallback(ye=>{const xe=ye.nodeLookup.get(w.source),Ae=ye.nodeLookup.get(w.target);if(!xe||!Ae)return{zIndex:w.zIndex,...tp};const qe=P_({id:n,sourceNode:xe,targetNode:Ae,sourceHandle:w.sourceHandle||null,targetHandle:w.targetHandle||null,connectionMode:ye.connectionMode,onError:N});return{zIndex:Q_({selected:w.selected,zIndex:w.zIndex,sourceNode:xe,targetNode:Ae,elevateOnSelect:ye.elevateEdgesOnSelect,zIndexMode:ye.zIndexMode}),...qe||tp}},[w.source,w.target,w.sourceHandle,w.targetHandle,w.selected,w.zIndex]),$e),P=J.useMemo(()=>w.markerStart?`url('#${zf(w.markerStart,_)}')`:void 0,[w.markerStart,_]),te=J.useMemo(()=>w.markerEnd?`url('#${zf(w.markerEnd,_)}')`:void 0,[w.markerEnd,_]);if(w.hidden||H===null||q===null||$===null||ee===null)return null;const se=ye=>{const{addSelectedEdges:xe,unselectNodesAndEdges:Ae,multiSelectionActive:qe}=Q.getState();X&&(Q.setState({nodesSelectionActive:!1}),w.selected&&qe?(Ae({nodes:[],edges:[w]}),ie.current?.blur()):xe([n])),r&&r(ye,w)},ce=f?ye=>{f(ye,{...w})}:void 0,re=d?ye=>{d(ye,{...w})}:void 0,ue=h?ye=>{h(ye,{...w})}:void 0,fe=m?ye=>{m(ye,{...w})}:void 0,Ee=g?ye=>{g(ye,{...w})}:void 0,be=ye=>{if(!U&&Xp.includes(ye.key)&&X){const{unselectNodesAndEdges:xe,addSelectedEdges:Ae}=Q.getState();ye.key==="Escape"?(ie.current?.blur(),xe({edges:[w]})):Ae([n])}};return E.jsx("svg",{style:{zIndex:M},children:E.jsxs("g",{className:at(["react-flow__edge",`react-flow__edge-${V}`,w.className,z,{selected:w.selected,animated:w.animated,inactive:!X&&!r,updating:Z,selectable:X}]),onClick:se,onDoubleClick:ce,onContextMenu:re,onMouseEnter:ue,onMouseMove:fe,onMouseLeave:Ee,onKeyDown:Y?be:void 0,tabIndex:Y?0:void 0,role:w.ariaRole??(Y?"group":"img"),"aria-roledescription":"edge","data-id":n,"data-testid":`rf__edge-${n}`,"aria-label":w.ariaLabel===null?void 0:w.ariaLabel||`Edge from ${w.source} to ${w.target}`,"aria-describedby":Y?`${by}-${_}`:void 0,ref:ie,...w.domAttributes,children:[!oe&&E.jsx(L,{id:n,source:w.source,target:w.target,type:w.type,selected:w.selected,animated:w.animated,selectable:X,deletable:w.deletable??!0,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,sourceX:H,sourceY:q,targetX:$,targetY:ee,sourcePosition:A,targetPosition:j,data:w.data,style:w.style,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerStart:P,markerEnd:te,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth}),R&&E.jsx(sN,{edge:w,isReconnectable:R,reconnectRadius:v,onReconnect:y,onReconnectStart:x,onReconnectEnd:S,sourceX:H,sourceY:q,targetX:$,targetY:ee,sourcePosition:A,targetPosition:j,setUpdateHover:W,setReconnecting:D})]})})}var cN=J.memo(rN);const fN=n=>({edgesFocusable:n.edgesFocusable,edgesReconnectable:n.edgesReconnectable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError});function Qy({defaultMarkerColor:n,onlyRenderVisibleElements:l,rfId:o,edgeTypes:u,noPanClassName:r,onReconnect:f,onEdgeContextMenu:d,onEdgeMouseEnter:h,onEdgeMouseMove:m,onEdgeMouseLeave:g,onEdgeClick:v,reconnectRadius:y,onEdgeDoubleClick:x,onReconnectStart:S,onReconnectEnd:_,disableKeyboardA11y:T}){const{edgesFocusable:z,edgesReconnectable:N,elementsSelectable:U,onError:w}=De(fN,$e),C=Kw(l);return E.jsxs("div",{className:"react-flow__edges",children:[E.jsx(eN,{defaultColor:n,rfId:o}),C.map(V=>E.jsx(cN,{id:V,edgesFocusable:z,edgesReconnectable:N,elementsSelectable:U,noPanClassName:r,onReconnect:f,onContextMenu:d,onMouseEnter:h,onMouseMove:m,onMouseLeave:g,onClick:v,reconnectRadius:y,onDoubleClick:x,onReconnectStart:S,onReconnectEnd:_,rfId:o,onError:w,edgeTypes:u,disableKeyboardA11y:T},V))]})}Qy.displayName="EdgeRenderer";const dN=J.memo(Qy),hN=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function gN({children:n}){const l=De(hN);return E.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:l},children:n})}function mN(n){const l=Jf(),o=J.useRef(!1);J.useEffect(()=>{!o.current&&l.viewportInitialized&&n&&(setTimeout(()=>n(l),1),o.current=!0)},[n,l.viewportInitialized])}const pN=n=>n.panZoom?.syncViewport;function yN(n){const l=De(pN),o=ke();return J.useEffect(()=>{n&&(l?.(n),o.setState({transform:[n.x,n.y,n.zoom]}))},[n,l]),null}function vN(n){return n.connection.inProgress?{...n.connection,to:Mo(n.connection.to,n.transform)}:{...n.connection}}function xN(n){return vN}function SN(n){const l=xN();return De(l,$e)}const bN=n=>({nodesConnectable:n.nodesConnectable,isValid:n.connection.isValid,inProgress:n.connection.inProgress,width:n.width,height:n.height});function _N({containerStyle:n,style:l,type:o,component:u}){const{nodesConnectable:r,width:f,height:d,isValid:h,inProgress:m}=De(bN,$e);return!(f&&r&&m)?null:E.jsx("svg",{style:n,width:f,height:d,className:"react-flow__connectionline react-flow__container",children:E.jsx("g",{className:at(["react-flow__connection",$p(h)]),children:E.jsx($y,{style:l,type:o,CustomComponent:u,isValid:h})})})}const $y=({style:n,type:l=Sa.Bezier,CustomComponent:o,isValid:u})=>{const{inProgress:r,from:f,fromNode:d,fromHandle:h,fromPosition:m,to:g,toNode:v,toHandle:y,toPosition:x,pointer:S}=SN();if(!r)return;if(o)return E.jsx(o,{connectionLineType:l,connectionLineStyle:n,fromNode:d,fromHandle:h,fromX:f.x,fromY:f.y,toX:g.x,toY:g.y,fromPosition:m,toPosition:x,connectionStatus:$p(u),toNode:v,toHandle:y,pointer:S});let _="";const T={sourceX:f.x,sourceY:f.y,sourcePosition:m,targetX:g.x,targetY:g.y,targetPosition:x};switch(l){case Sa.Bezier:[_]=ly(T);break;case Sa.SimpleBezier:[_]=Ry(T);break;case Sa.Step:[_]=Tf({...T,borderRadius:0});break;case Sa.SmoothStep:[_]=Tf(T);break;default:[_]=oy(T)}return E.jsx("path",{d:_,fill:"none",className:"react-flow__connection-path",style:n})};$y.displayName="ConnectionLine";const EN={};function lp(n=EN){J.useRef(n),ke(),J.useEffect(()=>{},[n])}function wN(){ke(),J.useRef(!1),J.useEffect(()=>{},[])}function ky({nodeTypes:n,edgeTypes:l,onInit:o,onNodeClick:u,onEdgeClick:r,onNodeDoubleClick:f,onEdgeDoubleClick:d,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:v,onSelectionContextMenu:y,onSelectionStart:x,onSelectionEnd:S,connectionLineType:_,connectionLineStyle:T,connectionLineComponent:z,connectionLineContainerStyle:N,selectionKeyCode:U,selectionOnDrag:w,selectionMode:C,multiSelectionKeyCode:V,panActivationKeyCode:L,zoomActivationKeyCode:Y,deleteKeyCode:R,onlyRenderVisibleElements:X,elementsSelectable:ie,defaultViewport:Z,translateExtent:W,minZoom:oe,maxZoom:D,preventScrolling:Q,defaultMarkerColor:M,zoomOnScroll:H,zoomOnPinch:q,panOnScroll:$,panOnScrollSpeed:ee,panOnScrollMode:A,zoomOnDoubleClick:j,panOnDrag:P,onPaneClick:te,onPaneMouseEnter:se,onPaneMouseMove:ce,onPaneMouseLeave:re,onPaneScroll:ue,onPaneContextMenu:fe,paneClickDistance:Ee,nodeClickDistance:be,onEdgeContextMenu:ye,onEdgeMouseEnter:xe,onEdgeMouseMove:Ae,onEdgeMouseLeave:qe,reconnectRadius:je,onReconnect:ot,onReconnectStart:$t,onReconnectEnd:Tt,noDragClassName:kt,noWheelClassName:mn,noPanClassName:_a,disableKeyboardA11y:Ea,nodeExtent:st,rfId:nl,viewport:pn,onViewportChange:Xn}){return lp(n),lp(l),wN(),mN(o),yN(pn),E.jsx(Lw,{onPaneClick:te,onPaneMouseEnter:se,onPaneMouseMove:ce,onPaneMouseLeave:re,onPaneContextMenu:fe,onPaneScroll:ue,paneClickDistance:Ee,deleteKeyCode:R,selectionKeyCode:U,selectionOnDrag:w,selectionMode:C,onSelectionStart:x,onSelectionEnd:S,multiSelectionKeyCode:V,panActivationKeyCode:L,zoomActivationKeyCode:Y,elementsSelectable:ie,zoomOnScroll:H,zoomOnPinch:q,zoomOnDoubleClick:j,panOnScroll:$,panOnScrollSpeed:ee,panOnScrollMode:A,panOnDrag:P,defaultViewport:Z,translateExtent:W,minZoom:oe,maxZoom:D,onSelectionContextMenu:y,preventScrolling:Q,noDragClassName:kt,noWheelClassName:mn,noPanClassName:_a,disableKeyboardA11y:Ea,onViewportChange:Xn,isControlledViewport:!!pn,children:E.jsxs(gN,{children:[E.jsx(dN,{edgeTypes:l,onEdgeClick:r,onEdgeDoubleClick:d,onReconnect:ot,onReconnectStart:$t,onReconnectEnd:Tt,onlyRenderVisibleElements:X,onEdgeContextMenu:ye,onEdgeMouseEnter:xe,onEdgeMouseMove:Ae,onEdgeMouseLeave:qe,reconnectRadius:je,defaultMarkerColor:M,noPanClassName:_a,disableKeyboardA11y:Ea,rfId:nl}),E.jsx(_N,{style:T,type:_,component:z,containerStyle:N}),E.jsx("div",{className:"react-flow__edgelabel-renderer"}),E.jsx(Iw,{nodeTypes:n,onNodeClick:u,onNodeDoubleClick:f,onNodeMouseEnter:h,onNodeMouseMove:m,onNodeMouseLeave:g,onNodeContextMenu:v,nodeClickDistance:be,onlyRenderVisibleElements:X,noPanClassName:_a,noDragClassName:kt,disableKeyboardA11y:Ea,nodeExtent:st,rfId:nl}),E.jsx("div",{className:"react-flow__viewport-portal"})]})})}ky.displayName="GraphView";const NN=J.memo(ky),ip=({nodes:n,edges:l,defaultNodes:o,defaultEdges:u,width:r,height:f,fitView:d,fitViewOptions:h,minZoom:m=.5,maxZoom:g=2,nodeOrigin:v,nodeExtent:y,zIndexMode:x="basic"}={})=>{const S=new Map,_=new Map,T=new Map,z=new Map,N=u??l??[],U=o??n??[],w=v??[0,0],C=y??mo;ry(T,z,N);const{nodesInitialized:V}=Cf(U,S,_,{nodeOrigin:w,nodeExtent:C,zIndexMode:x});let L=[0,0,1];if(d&&r&&f){const Y=wo(S,{filter:Z=>!!((Z.width||Z.initialWidth)&&(Z.height||Z.initialHeight))}),{x:R,y:X,zoom:ie}=Xf(Y,r,f,m,g,h?.padding??.1);L=[R,X,ie]}return{rfId:"1",width:r??0,height:f??0,transform:L,nodes:U,nodesInitialized:V,nodeLookup:S,parentLookup:_,edges:N,edgeLookup:z,connectionLookup:T,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:o!==void 0,hasDefaultEdges:u!==void 0,panZoom:null,minZoom:m,maxZoom:g,translateExtent:mo,nodeExtent:C,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Pl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:w,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:d??!1,fitViewOptions:h,fitViewResolver:null,connection:{...Qp},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:L_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Zp,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},MN=({nodes:n,edges:l,defaultNodes:o,defaultEdges:u,width:r,height:f,fitView:d,fitViewOptions:h,minZoom:m,maxZoom:g,nodeOrigin:v,nodeExtent:y,zIndexMode:x})=>XE((S,_)=>{async function T(){const{nodeLookup:z,panZoom:N,fitViewOptions:U,fitViewResolver:w,width:C,height:V,minZoom:L,maxZoom:Y}=_();N&&(await B_({nodes:z,width:C,height:V,panZoom:N,minZoom:L,maxZoom:Y},U),w?.resolve(!0),S({fitViewResolver:null}))}return{...ip({nodes:n,edges:l,width:r,height:f,fitView:d,fitViewOptions:h,minZoom:m,maxZoom:g,nodeOrigin:v,nodeExtent:y,defaultNodes:o,defaultEdges:u,zIndexMode:x}),setNodes:z=>{const{nodeLookup:N,parentLookup:U,nodeOrigin:w,elevateNodesOnSelect:C,fitViewQueued:V,zIndexMode:L,nodesSelectionActive:Y}=_(),{nodesInitialized:R,hasSelectedNodes:X}=Cf(z,N,U,{nodeOrigin:w,nodeExtent:y,elevateNodesOnSelect:C,checkEquality:!0,zIndexMode:L}),ie=Y&&X;V&&R?(T(),S({nodes:z,nodesInitialized:R,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:ie})):S({nodes:z,nodesInitialized:R,nodesSelectionActive:ie})},setEdges:z=>{const{connectionLookup:N,edgeLookup:U}=_();ry(N,U,z),S({edges:z})},setDefaultNodesAndEdges:(z,N)=>{if(z){const{setNodes:U}=_();U(z),S({hasDefaultNodes:!0})}if(N){const{setEdges:U}=_();U(N),S({hasDefaultEdges:!0})}},updateNodeInternals:z=>{const{triggerNodeChanges:N,nodeLookup:U,parentLookup:w,domNode:C,nodeOrigin:V,nodeExtent:L,debug:Y,fitViewQueued:R,zIndexMode:X}=_(),{changes:ie,updatedInternals:Z}=uE(z,U,w,C,V,L,X);Z&&(aE(U,w,{nodeOrigin:V,nodeExtent:L,zIndexMode:X}),R?(T(),S({fitViewQueued:!1,fitViewOptions:void 0})):S({}),ie?.length>0&&(Y&&console.log("React Flow: trigger node changes",ie),N?.(ie)))},updateNodePositions:(z,N=!1)=>{const U=[];let w=[];const{nodeLookup:C,triggerNodeChanges:V,connection:L,updateConnection:Y,onNodesChangeMiddlewareMap:R}=_();for(const[X,ie]of z){const Z=C.get(X),W=!!(Z?.expandParent&&Z?.parentId&&ie?.position),oe={id:X,type:"position",position:W?{x:Math.max(0,ie.position.x),y:Math.max(0,ie.position.y)}:ie.position,dragging:N};if(Z&&L.inProgress&&L.fromNode.id===Z.id){const D=tl(Z,L.fromHandle,me.Left,!0);Y({...L,from:D})}W&&Z.parentId&&U.push({id:X,parentId:Z.parentId,rect:{...ie.internals.positionAbsolute,width:ie.measured.width??0,height:ie.measured.height??0}}),w.push(oe)}if(U.length>0){const{parentLookup:X,nodeOrigin:ie}=_(),Z=Kf(U,C,X,ie);w.push(...Z)}for(const X of R.values())w=X(w);V(w)},triggerNodeChanges:z=>{const{onNodesChange:N,setNodes:U,nodes:w,hasDefaultNodes:C,debug:V}=_();if(z?.length){if(C){const L=cw(z,w);U(L)}V&&console.log("React Flow: trigger node changes",z),N?.(z)}},triggerEdgeChanges:z=>{const{onEdgesChange:N,setEdges:U,edges:w,hasDefaultEdges:C,debug:V}=_();if(z?.length){if(C){const L=fw(z,w);U(L)}V&&console.log("React Flow: trigger edge changes",z),N?.(z)}},addSelectedNodes:z=>{const{multiSelectionActive:N,edgeLookup:U,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:V}=_();if(N){const L=z.map(Y=>Ia(Y,!0));C(L);return}C(Il(w,new Set([...z]),!0)),V(Il(U))},addSelectedEdges:z=>{const{multiSelectionActive:N,edgeLookup:U,nodeLookup:w,triggerNodeChanges:C,triggerEdgeChanges:V}=_();if(N){const L=z.map(Y=>Ia(Y,!0));V(L);return}V(Il(U,new Set([...z]))),C(Il(w,new Set,!0))},unselectNodesAndEdges:({nodes:z,edges:N}={})=>{const{edges:U,nodes:w,nodeLookup:C,triggerNodeChanges:V,triggerEdgeChanges:L}=_(),Y=z||w,R=N||U,X=[];for(const Z of Y){if(!Z.selected)continue;const W=C.get(Z.id);W&&(W.selected=!1),X.push(Ia(Z.id,!1))}const ie=[];for(const Z of R)Z.selected&&ie.push(Ia(Z.id,!1));V(X),L(ie)},setMinZoom:z=>{const{panZoom:N,maxZoom:U}=_();N?.setScaleExtent([z,U]),S({minZoom:z})},setMaxZoom:z=>{const{panZoom:N,minZoom:U}=_();N?.setScaleExtent([U,z]),S({maxZoom:z})},setTranslateExtent:z=>{_().panZoom?.setTranslateExtent(z),S({translateExtent:z})},resetSelectedElements:()=>{const{edges:z,nodes:N,triggerNodeChanges:U,triggerEdgeChanges:w,elementsSelectable:C}=_();if(!C)return;const V=N.reduce((Y,R)=>R.selected?[...Y,Ia(R.id,!1)]:Y,[]),L=z.reduce((Y,R)=>R.selected?[...Y,Ia(R.id,!1)]:Y,[]);U(V),w(L)},setNodeExtent:z=>{const{nodes:N,nodeLookup:U,parentLookup:w,nodeOrigin:C,elevateNodesOnSelect:V,nodeExtent:L,zIndexMode:Y}=_();z[0][0]===L[0][0]&&z[0][1]===L[0][1]&&z[1][0]===L[1][0]&&z[1][1]===L[1][1]||(Cf(N,U,w,{nodeOrigin:C,nodeExtent:z,elevateNodesOnSelect:V,checkEquality:!1,zIndexMode:Y}),S({nodeExtent:z}))},panBy:z=>{const{transform:N,width:U,height:w,panZoom:C,translateExtent:V}=_();return sE({delta:z,panZoom:C,transform:N,translateExtent:V,width:U,height:w})},setCenter:async(z,N,U)=>{const{width:w,height:C,maxZoom:V,panZoom:L}=_();if(!L)return Promise.resolve(!1);const Y=typeof U?.zoom<"u"?U.zoom:V;return await L.setViewport({x:w/2-z*Y,y:C/2-N*Y,zoom:Y},{duration:U?.duration,ease:U?.ease,interpolate:U?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{S({connection:{...Qp}})},updateConnection:z=>{S({connection:z})},reset:()=>S({...ip()})}},Object.is);function AN({initialNodes:n,initialEdges:l,defaultNodes:o,defaultEdges:u,initialWidth:r,initialHeight:f,initialMinZoom:d,initialMaxZoom:h,initialFitViewOptions:m,fitView:g,nodeOrigin:v,nodeExtent:y,zIndexMode:x,children:S}){const[_]=J.useState(()=>MN({nodes:n,edges:l,defaultNodes:o,defaultEdges:u,width:r,height:f,fitView:g,minZoom:d,maxZoom:h,fitViewOptions:m,nodeOrigin:v,nodeExtent:y,zIndexMode:x}));return E.jsx(ZE,{value:_,children:E.jsx(gw,{children:S})})}function TN({children:n,nodes:l,edges:o,defaultNodes:u,defaultEdges:r,width:f,height:d,fitView:h,fitViewOptions:m,minZoom:g,maxZoom:v,nodeOrigin:y,nodeExtent:x,zIndexMode:S}){return J.useContext(Cs)?E.jsx(E.Fragment,{children:n}):E.jsx(AN,{initialNodes:l,initialEdges:o,defaultNodes:u,defaultEdges:r,initialWidth:f,initialHeight:d,fitView:h,initialFitViewOptions:m,initialMinZoom:g,initialMaxZoom:v,nodeOrigin:y,nodeExtent:x,zIndexMode:S,children:n})}const zN={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function CN({nodes:n,edges:l,defaultNodes:o,defaultEdges:u,className:r,nodeTypes:f,edgeTypes:d,onNodeClick:h,onEdgeClick:m,onInit:g,onMove:v,onMoveStart:y,onMoveEnd:x,onConnect:S,onConnectStart:_,onConnectEnd:T,onClickConnectStart:z,onClickConnectEnd:N,onNodeMouseEnter:U,onNodeMouseMove:w,onNodeMouseLeave:C,onNodeContextMenu:V,onNodeDoubleClick:L,onNodeDragStart:Y,onNodeDrag:R,onNodeDragStop:X,onNodesDelete:ie,onEdgesDelete:Z,onDelete:W,onSelectionChange:oe,onSelectionDragStart:D,onSelectionDrag:Q,onSelectionDragStop:M,onSelectionContextMenu:H,onSelectionStart:q,onSelectionEnd:$,onBeforeDelete:ee,connectionMode:A,connectionLineType:j=Sa.Bezier,connectionLineStyle:P,connectionLineComponent:te,connectionLineContainerStyle:se,deleteKeyCode:ce="Backspace",selectionKeyCode:re="Shift",selectionOnDrag:ue=!1,selectionMode:fe=po.Full,panActivationKeyCode:Ee="Space",multiSelectionKeyCode:be=vo()?"Meta":"Control",zoomActivationKeyCode:ye=vo()?"Meta":"Control",snapToGrid:xe,snapGrid:Ae,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:je,nodesDraggable:ot,autoPanOnNodeFocus:$t,nodesConnectable:Tt,nodesFocusable:kt,nodeOrigin:mn=_y,edgesFocusable:_a,edgesReconnectable:Ea,elementsSelectable:st=!0,defaultViewport:nl=aw,minZoom:pn=.5,maxZoom:Xn=2,translateExtent:wa=mo,preventScrolling:Hs=!0,nodeExtent:al,defaultMarkerColor:js="#b1b1b7",zoomOnScroll:Us=!0,zoomOnPinch:Na=!0,panOnScroll:mt=!1,panOnScrollSpeed:an=.5,panOnScrollMode:pt=Fa.Free,zoomOnDoubleClick:Bs=!0,panOnDrag:qs=!0,onPaneClick:Ls,onPaneMouseEnter:ll,onPaneMouseMove:il,onPaneMouseLeave:ol,onPaneScroll:yn,onPaneContextMenu:ul,paneClickDistance:Ma=1,nodeClickDistance:Ys=0,children:Ao,onReconnect:ii,onReconnectStart:Aa,onReconnectEnd:Vs,onEdgeContextMenu:To,onEdgeDoubleClick:zo,onEdgeMouseEnter:Co,onEdgeMouseMove:oi,onEdgeMouseLeave:ui,reconnectRadius:Do=10,onNodesChange:Oo,onEdgesChange:ln,noDragClassName:lt="nodrag",noWheelClassName:ht="nowheel",noPanClassName:vn="nopan",fitView:sl,fitViewOptions:Ro,connectOnClick:Gs,attributionPosition:Ho,proOptions:Ta,defaultEdgeOptions:si,elevateNodesOnSelect:Zn=!0,elevateEdgesOnSelect:Qn=!1,disableKeyboardA11y:$n=!1,autoPanOnConnect:kn,autoPanOnNodeDrag:We,autoPanSpeed:jo,connectionRadius:Uo,isValidConnection:xn,onError:In,style:Xs,id:ri,nodeDragThreshold:Bo,connectionDragThreshold:Zs,viewport:rl,onViewportChange:cl,width:It,height:vt,colorMode:qo="light",debug:Qs,onScroll:fl,ariaLabelConfig:Lo,zIndexMode:za="basic",...$s},xt){const Ca=ri||"1",Yo=uw(qo),ci=J.useCallback(Sn=>{Sn.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),fl?.(Sn)},[fl]);return E.jsx("div",{"data-testid":"rf__wrapper",...$s,onScroll:ci,style:{...Xs,...zN},ref:xt,className:at(["react-flow",r,Yo]),id:ri,role:"application",children:E.jsxs(TN,{nodes:n,edges:l,width:It,height:vt,fitView:sl,fitViewOptions:Ro,minZoom:pn,maxZoom:Xn,nodeOrigin:mn,nodeExtent:al,zIndexMode:za,children:[E.jsx(ow,{nodes:n,edges:l,defaultNodes:o,defaultEdges:u,onConnect:S,onConnectStart:_,onConnectEnd:T,onClickConnectStart:z,onClickConnectEnd:N,nodesDraggable:ot,autoPanOnNodeFocus:$t,nodesConnectable:Tt,nodesFocusable:kt,edgesFocusable:_a,edgesReconnectable:Ea,elementsSelectable:st,elevateNodesOnSelect:Zn,elevateEdgesOnSelect:Qn,minZoom:pn,maxZoom:Xn,nodeExtent:al,onNodesChange:Oo,onEdgesChange:ln,snapToGrid:xe,snapGrid:Ae,connectionMode:A,translateExtent:wa,connectOnClick:Gs,defaultEdgeOptions:si,fitView:sl,fitViewOptions:Ro,onNodesDelete:ie,onEdgesDelete:Z,onDelete:W,onNodeDragStart:Y,onNodeDrag:R,onNodeDragStop:X,onSelectionDrag:Q,onSelectionDragStart:D,onSelectionDragStop:M,onMove:v,onMoveStart:y,onMoveEnd:x,noPanClassName:vn,nodeOrigin:mn,rfId:Ca,autoPanOnConnect:kn,autoPanOnNodeDrag:We,autoPanSpeed:jo,onError:In,connectionRadius:Uo,isValidConnection:xn,selectNodesOnDrag:je,nodeDragThreshold:Bo,connectionDragThreshold:Zs,onBeforeDelete:ee,debug:Qs,ariaLabelConfig:Lo,zIndexMode:za}),E.jsx(NN,{onInit:g,onNodeClick:h,onEdgeClick:m,onNodeMouseEnter:U,onNodeMouseMove:w,onNodeMouseLeave:C,onNodeContextMenu:V,onNodeDoubleClick:L,nodeTypes:f,edgeTypes:d,connectionLineType:j,connectionLineStyle:P,connectionLineComponent:te,connectionLineContainerStyle:se,selectionKeyCode:re,selectionOnDrag:ue,selectionMode:fe,deleteKeyCode:ce,multiSelectionKeyCode:be,panActivationKeyCode:Ee,zoomActivationKeyCode:ye,onlyRenderVisibleElements:qe,defaultViewport:nl,translateExtent:wa,minZoom:pn,maxZoom:Xn,preventScrolling:Hs,zoomOnScroll:Us,zoomOnPinch:Na,zoomOnDoubleClick:Bs,panOnScroll:mt,panOnScrollSpeed:an,panOnScrollMode:pt,panOnDrag:qs,onPaneClick:Ls,onPaneMouseEnter:ll,onPaneMouseMove:il,onPaneMouseLeave:ol,onPaneScroll:yn,onPaneContextMenu:ul,paneClickDistance:Ma,nodeClickDistance:Ys,onSelectionContextMenu:H,onSelectionStart:q,onSelectionEnd:$,onReconnect:ii,onReconnectStart:Aa,onReconnectEnd:Vs,onEdgeContextMenu:To,onEdgeDoubleClick:zo,onEdgeMouseEnter:Co,onEdgeMouseMove:oi,onEdgeMouseLeave:ui,reconnectRadius:Do,defaultMarkerColor:js,noDragClassName:lt,noWheelClassName:ht,noPanClassName:vn,rfId:Ca,disableKeyboardA11y:$n,nodeExtent:al,viewport:rl,onViewportChange:cl}),E.jsx(nw,{onSelectionChange:oe}),Ao,E.jsx(FE,{proOptions:Ta,position:Ho}),E.jsx(JE,{rfId:Ca,disableKeyboardA11y:$n})]})})}wy(CN);function DN({dimensions:n,lineWidth:l,variant:o,className:u}){return E.jsx("path",{strokeWidth:l,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`,className:at(["react-flow__background-pattern",o,u])})}function ON({radius:n,className:l}){return E.jsx("circle",{cx:n,cy:n,r:n,className:at(["react-flow__background-pattern","dots",l])})}var ba;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(ba||(ba={}));const RN={[ba.Dots]:1,[ba.Lines]:1,[ba.Cross]:6},HN=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function Iy({id:n,variant:l=ba.Dots,gap:o=20,size:u,lineWidth:r=1,offset:f=0,color:d,bgColor:h,style:m,className:g,patternClassName:v}){const y=J.useRef(null),{transform:x,patternId:S}=De(HN,$e),_=u||RN[l],T=l===ba.Dots,z=l===ba.Cross,N=Array.isArray(o)?o:[o,o],U=[N[0]*x[2]||1,N[1]*x[2]||1],w=_*x[2],C=Array.isArray(f)?f:[f,f],V=z?[w,w]:U,L=[C[0]*x[2]||1+V[0]/2,C[1]*x[2]||1+V[1]/2],Y=`${S}${n||""}`;return E.jsxs("svg",{className:at(["react-flow__background",g]),style:{...m,...Os,"--xy-background-color-props":h,"--xy-background-pattern-color-props":d},ref:y,"data-testid":"rf__background",children:[E.jsx("pattern",{id:Y,x:x[0]%U[0],y:x[1]%U[1],width:U[0],height:U[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${L[0]},-${L[1]})`,children:T?E.jsx(ON,{radius:w/2,className:v}):E.jsx(DN,{dimensions:V,lineWidth:r,variant:l,className:v})}),E.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${Y})`})]})}Iy.displayName="Background";J.memo(Iy);function jN(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:E.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function UN(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:E.jsx("path",{d:"M0 0h32v4.2H0z"})})}function BN(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:E.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 qN(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:E.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 LN(){return E.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:E.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 ls({children:n,className:l,...o}){return E.jsx("button",{type:"button",className:at(["react-flow__controls-button",l]),...o,children:n})}const YN=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom,ariaLabelConfig:n.ariaLabelConfig});function Ky({style:n,showZoom:l=!0,showFitView:o=!0,showInteractive:u=!0,fitViewOptions:r,onZoomIn:f,onZoomOut:d,onFitView:h,onInteractiveChange:m,className:g,children:v,position:y="bottom-left",orientation:x="vertical","aria-label":S}){const _=ke(),{isInteractive:T,minZoomReached:z,maxZoomReached:N,ariaLabelConfig:U}=De(YN,$e),{zoomIn:w,zoomOut:C,fitView:V}=Jf(),L=()=>{w(),f?.()},Y=()=>{C(),d?.()},R=()=>{V(r),h?.()},X=()=>{_.setState({nodesDraggable:!T,nodesConnectable:!T,elementsSelectable:!T}),m?.(!T)},ie=x==="horizontal"?"horizontal":"vertical";return E.jsxs(Ds,{className:at(["react-flow__controls",ie,g]),position:y,style:n,"data-testid":"rf__controls","aria-label":S??U["controls.ariaLabel"],children:[l&&E.jsxs(E.Fragment,{children:[E.jsx(ls,{onClick:L,className:"react-flow__controls-zoomin",title:U["controls.zoomIn.ariaLabel"],"aria-label":U["controls.zoomIn.ariaLabel"],disabled:N,children:E.jsx(jN,{})}),E.jsx(ls,{onClick:Y,className:"react-flow__controls-zoomout",title:U["controls.zoomOut.ariaLabel"],"aria-label":U["controls.zoomOut.ariaLabel"],disabled:z,children:E.jsx(UN,{})})]}),o&&E.jsx(ls,{className:"react-flow__controls-fitview",onClick:R,title:U["controls.fitView.ariaLabel"],"aria-label":U["controls.fitView.ariaLabel"],children:E.jsx(BN,{})}),u&&E.jsx(ls,{className:"react-flow__controls-interactive",onClick:X,title:U["controls.interactive.ariaLabel"],"aria-label":U["controls.interactive.ariaLabel"],children:T?E.jsx(LN,{}):E.jsx(qN,{})}),v]})}Ky.displayName="Controls";J.memo(Ky);function VN({id:n,x:l,y:o,width:u,height:r,style:f,color:d,strokeColor:h,strokeWidth:m,className:g,borderRadius:v,shapeRendering:y,selected:x,onClick:S}){const{background:_,backgroundColor:T}=f||{},z=d||_||T;return E.jsx("rect",{className:at(["react-flow__minimap-node",{selected:x},g]),x:l,y:o,rx:v,ry:v,width:u,height:r,style:{fill:z,stroke:h,strokeWidth:m},shapeRendering:y,onClick:S?N=>S(N,n):void 0})}const GN=J.memo(VN),XN=n=>n.nodes.map(l=>l.id),vf=n=>n instanceof Function?n:()=>n;function ZN({nodeStrokeColor:n,nodeColor:l,nodeClassName:o="",nodeBorderRadius:u=5,nodeStrokeWidth:r,nodeComponent:f=GN,onClick:d}){const h=De(XN,$e),m=vf(l),g=vf(n),v=vf(o),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return E.jsx(E.Fragment,{children:h.map(x=>E.jsx($N,{id:x,nodeColorFunc:m,nodeStrokeColorFunc:g,nodeClassNameFunc:v,nodeBorderRadius:u,nodeStrokeWidth:r,NodeComponent:f,onClick:d,shapeRendering:y},x))})}function QN({id:n,nodeColorFunc:l,nodeStrokeColorFunc:o,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:f,shapeRendering:d,NodeComponent:h,onClick:m}){const{node:g,x:v,y,width:x,height:S}=De(_=>{const T=_.nodeLookup.get(n);if(!T)return{node:void 0,x:0,y:0,width:0,height:0};const z=T.internals.userNode,{x:N,y:U}=T.internals.positionAbsolute,{width:w,height:C}=Gn(z);return{node:z,x:N,y:U,width:w,height:C}},$e);return!g||g.hidden||!Wp(g)?null:E.jsx(h,{x:v,y,width:x,height:S,style:g.style,selected:!!g.selected,className:u(g),color:l(g),borderRadius:r,strokeColor:o(g),strokeWidth:f,shapeRendering:d,onClick:m,id:g.id})}const $N=J.memo(QN);var kN=J.memo(ZN);const IN=200,KN=150,JN=n=>!n.hidden,FN=n=>{const l={x:-n.transform[0]/n.transform[2],y:-n.transform[1]/n.transform[2],width:n.width/n.transform[2],height:n.height/n.transform[2]};return{viewBB:l,boundingRect:n.nodeLookup.size>0?Fp(wo(n.nodeLookup,{filter:JN}),l):l,rfId:n.rfId,panZoom:n.panZoom,translateExtent:n.translateExtent,flowWidth:n.width,flowHeight:n.height,ariaLabelConfig:n.ariaLabelConfig}},WN="react-flow__minimap-desc";function Jy({style:n,className:l,nodeStrokeColor:o,nodeColor:u,nodeClassName:r="",nodeBorderRadius:f=5,nodeStrokeWidth:d,nodeComponent:h,bgColor:m,maskColor:g,maskStrokeColor:v,maskStrokeWidth:y,position:x="bottom-right",onClick:S,onNodeClick:_,pannable:T=!1,zoomable:z=!1,ariaLabel:N,inversePan:U,zoomStep:w=1,offsetScale:C=5}){const V=ke(),L=J.useRef(null),{boundingRect:Y,viewBB:R,rfId:X,panZoom:ie,translateExtent:Z,flowWidth:W,flowHeight:oe,ariaLabelConfig:D}=De(FN,$e),Q=n?.width??IN,M=n?.height??KN,H=Y.width/Q,q=Y.height/M,$=Math.max(H,q),ee=$*Q,A=$*M,j=C*$,P=Y.x-(ee-Y.width)/2-j,te=Y.y-(A-Y.height)/2-j,se=ee+j*2,ce=A+j*2,re=`${WN}-${X}`,ue=J.useRef(0),fe=J.useRef();ue.current=$,J.useEffect(()=>{if(L.current&&ie)return fe.current=yE({domNode:L.current,panZoom:ie,getTransform:()=>V.getState().transform,getViewScale:()=>ue.current}),()=>{fe.current?.destroy()}},[ie]),J.useEffect(()=>{fe.current?.update({translateExtent:Z,width:W,height:oe,inversePan:U,pannable:T,zoomStep:w,zoomable:z})},[T,z,U,w,Z,W,oe]);const Ee=S?xe=>{const[Ae,qe]=fe.current?.pointer(xe)||[0,0];S(xe,{x:Ae,y:qe})}:void 0,be=_?J.useCallback((xe,Ae)=>{const qe=V.getState().nodeLookup.get(Ae).internals.userNode;_(xe,qe)},[]):void 0,ye=N??D["minimap.ariaLabel"];return E.jsx(Ds,{position:x,style:{...n,"--xy-minimap-background-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-background-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof y=="number"?y*$:void 0,"--xy-minimap-node-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-node-stroke-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-width-props":typeof d=="number"?d:void 0},className:at(["react-flow__minimap",l]),"data-testid":"rf__minimap",children:E.jsxs("svg",{width:Q,height:M,viewBox:`${P} ${te} ${se} ${ce}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":re,ref:L,onClick:Ee,children:[ye&&E.jsx("title",{id:re,children:ye}),E.jsx(kN,{onClick:be,nodeColor:u,nodeStrokeColor:o,nodeBorderRadius:f,nodeClassName:r,nodeStrokeWidth:d,nodeComponent:h}),E.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-j},${te-j}h${se+j*2}v${ce+j*2}h${-se-j*2}z
15
+ M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Jy.displayName="MiniMap";J.memo(Jy);const PN=n=>l=>n?`${Math.max(1/l.transform[2],1)}`:void 0,e3={[ai.Line]:"right",[ai.Handle]:"bottom-right"};function t3({nodeId:n,position:l,variant:o=ai.Handle,className:u,style:r=void 0,children:f,color:d,minWidth:h=10,minHeight:m=10,maxWidth:g=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:y=!1,resizeDirection:x,autoScale:S=!0,shouldResize:_,onResizeStart:T,onResize:z,onResizeEnd:N}){const U=Ty(),w=typeof n=="string"?n:U,C=ke(),V=J.useRef(null),L=o===ai.Handle,Y=De(J.useCallback(PN(L&&S),[L,S]),$e),R=J.useRef(null),X=l??e3[o];J.useEffect(()=>{if(!(!V.current||!w))return R.current||(R.current=DE({domNode:V.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:Z,transform:W,snapGrid:oe,snapToGrid:D,nodeOrigin:Q,domNode:M}=C.getState();return{nodeLookup:Z,transform:W,snapGrid:oe,snapToGrid:D,nodeOrigin:Q,paneDomNode:M}},onChange:(Z,W)=>{const{triggerNodeChanges:oe,nodeLookup:D,parentLookup:Q,nodeOrigin:M}=C.getState(),H=[],q={x:Z.x,y:Z.y},$=D.get(w);if($&&$.expandParent&&$.parentId){const ee=$.origin??M,A=Z.width??$.measured.width??0,j=Z.height??$.measured.height??0,P={id:$.id,parentId:$.parentId,rect:{width:A,height:j,...Pp({x:Z.x??$.position.x,y:Z.y??$.position.y},{width:A,height:j},$.parentId,D,ee)}},te=Kf([P],D,Q,M);H.push(...te),q.x=Z.x?Math.max(ee[0]*A,Z.x):void 0,q.y=Z.y?Math.max(ee[1]*j,Z.y):void 0}if(q.x!==void 0&&q.y!==void 0){const ee={id:w,type:"position",position:{...q}};H.push(ee)}if(Z.width!==void 0&&Z.height!==void 0){const A={id:w,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:Z.width,height:Z.height}};H.push(A)}for(const ee of W){const A={...ee,type:"position"};H.push(A)}oe(H)},onEnd:({width:Z,height:W})=>{const oe={id:w,type:"dimensions",resizing:!1,dimensions:{width:Z,height:W}};C.getState().triggerNodeChanges([oe])}})),R.current.update({controlPosition:X,boundaries:{minWidth:h,minHeight:m,maxWidth:g,maxHeight:v},keepAspectRatio:y,resizeDirection:x,onResizeStart:T,onResize:z,onResizeEnd:N,shouldResize:_}),()=>{R.current?.destroy()}},[X,h,m,g,v,y,T,z,N,_]);const ie=X.split("-");return E.jsx("div",{className:at(["react-flow__resize-control","nodrag",...ie,o,u]),ref:V,style:{...r,scale:Y,...d&&{[L?"backgroundColor":"borderColor"]:d}},children:f})}J.memo(t3);function n3({id:n,data:l,selected:o}){const u=l,r=de(z=>z.updateNodePrompt),f=de(z=>z.generateNode),d=de(z=>z.addChildNode),h=de(z=>z.duplicateBranchRoot),m=de(z=>z.deleteNode),g=J.useCallback(z=>r(n,z.target.value),[n,r]),v=J.useCallback(()=>{f(n)},[n,f]),y=J.useCallback(()=>{u.status==="ready"&&d(n)},[n,u.status,d]),x=J.useCallback(()=>{h(n)},[n,h]),S=J.useCallback(()=>m(n),[n,m]),_=u.status==="pending"||u.status==="reconciling",T={empty:"empty",pending:"generating…",reconciling:`reconciling…${u.pendingPhase?` · ${u.pendingPhase}`:""}`,ready:`ready · ${u.elapsed??"?"}s${u.webSearchCalls?` · ws×${u.webSearchCalls}`:""}`,stale:`stale${u.error?`: ${u.error}`:""}`,"asset-missing":`asset missing${u.error?`: ${u.error}`:""}`,error:`error: ${u.error??"unknown"}`}[u.status];return E.jsxs("div",{className:`image-node image-node--${u.status}${o?" image-node--selected":""}`,children:[u.parentServerNodeId?E.jsx(li,{type:"target",position:me.Left,className:"image-node__handle"}):null,E.jsx("div",{className:"image-node__preview",children:u.imageUrl&&u.status!=="asset-missing"?E.jsx("img",{src:u.imageUrl,alt:"node"}):_?E.jsx("div",{className:"image-node__skeleton",children:"⏳"}):u.status==="asset-missing"?E.jsx("div",{className:"image-node__placeholder",children:"missing asset"}):u.status==="stale"?E.jsx("div",{className:"image-node__placeholder",children:"stale"}):E.jsx("div",{className:"image-node__placeholder",children:"no image"})}),E.jsx("textarea",{className:"image-node__prompt nodrag",value:u.prompt,onChange:g,onKeyDown:z=>z.stopPropagation(),placeholder:u.parentServerNodeId?"Edit prompt…":"Prompt…",rows:2,disabled:_}),E.jsxs("div",{className:"image-node__footer",children:[E.jsx("span",{className:"image-node__status",children:T}),E.jsxs("div",{className:"image-node__actions nodrag",children:[E.jsx("button",{type:"button",onClick:v,disabled:_,children:u.status==="ready"?"Regenerate":"Generate"}),u.status==="ready"?E.jsxs(E.Fragment,{children:[E.jsx("button",{type:"button",onClick:y,children:"+ Child"}),E.jsx("button",{type:"button",onClick:x,title:"Duplicate as new branch root",children:"⎘ Branch"})]}):null,E.jsx("button",{type:"button",onClick:S,className:"image-node__del",title:"Delete",children:"✕"})]})]}),E.jsx(li,{type:"source",position:me.Right,className:"image-node__handle image-node__handle--source"})]})}J.memo(n3);function a3(){const{data:n,error:l}=dp();let o="checking...",u="var(--text-dim)";if(l||!n)l&&(o="offline",u="var(--red)");else if(n.credits){const r=n.credits.total_granted??0,f=n.credits.total_used??0,d=r-f;o=`$${d.toFixed(2)} remaining`,u=d>5?"var(--green)":d>1?"var(--amber)":"var(--red)"}else n.costs?.data?.length?(o=`$${(n.costs.data.reduce((f,d)=>f+d.results.reduce((h,m)=>h+(m.amount?.value??0),0),0)/100).toFixed(2)} this month`,u="var(--accent)"):n.oauth?(o="OAuth · free via codex",u="var(--green)"):n.apiKeyValid?(o="API key disabled (OAuth only)",u="var(--text-dim)"):(o="OAuth mode",u="var(--text-dim)");return E.jsxs("div",{className:"billing-bar",children:[E.jsx("div",{className:"label",children:"API Status"}),E.jsx("div",{className:"value",style:{color:u},children:o})]})}function Ln({title:n,items:l,value:o,onChange:u}){return E.jsxs("div",{className:"option-group",children:[n?E.jsx("div",{className:"section-title",children:n}):null,E.jsx("div",{className:"option-row",children:l.map(r=>E.jsxs("button",{className:`option-btn${r.value===o?" active":""}`,style:r.color?{color:r.color}:void 0,onClick:()=>u(r.value),type:"button",children:[r.label,r.sub?E.jsxs(E.Fragment,{children:[E.jsx("br",{}),E.jsx("span",{className:"option-sub",children:r.sub})]}):null]},r.value))})]})}function no(n){return n.map(l=>({value:l.value,label:l.label,sub:l.sub}))}function l3(){const n=de(d=>d.sizePreset),l=de(d=>d.setSizePreset),o=de(d=>d.customW),u=de(d=>d.customH),r=de(d=>d.setCustomSize),f=n==="custom";return E.jsxs("div",{className:"option-group",children:[E.jsx("div",{className:"section-title",children:"Size"}),E.jsx(Ln,{title:"",items:no(Tx),value:n,onChange:l}),E.jsx(Ln,{title:"",items:no(zx),value:n,onChange:l}),E.jsx(Ln,{title:"",items:no(Cx),value:n,onChange:l}),E.jsx(Ln,{title:"",items:no(Dx),value:n,onChange:l}),E.jsx(Ln,{title:"",items:no(Ox),value:n,onChange:l}),f?E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"option-row",children:[E.jsx("input",{type:"number",className:"custom-size-input",min:1024,max:3824,step:16,value:o,onChange:d=>r(parseInt(d.target.value)||1024,u),placeholder:"W"}),E.jsx("span",{style:{color:"var(--text-dim)",alignSelf:"center",fontFamily:"var(--mono)",fontSize:12},children:"x"}),E.jsx("input",{type:"number",className:"custom-size-input",min:1024,max:3824,step:16,value:u,onChange:d=>r(o,parseInt(d.target.value)||1024),placeholder:"H"})]}),E.jsx("div",{className:"size-hint",children:"Min 1024 per side, max 3824, multiples of 16, ratio ≤ 3:1"})]}):null]})}const i3={low:{"1024x1024":.006,"1024x1536":.005,"1536x1024":.005,"1024x1360":.005,"1360x1024":.005,"1024x1824":.006,"1824x1024":.006,"2048x2048":.012,"2048x1152":.009,"1152x2048":.009,"3824x2160":.023,"2160x3824":.023,auto:.006},medium:{"1024x1024":.053,"1024x1536":.041,"1536x1024":.041,"1024x1360":.041,"1360x1024":.041,"1024x1824":.05,"1824x1024":.05,"2048x2048":.106,"2048x1152":.08,"1152x2048":.08,"3824x2160":.2,"2160x3824":.2,auto:.053},high:{"1024x1024":.211,"1024x1536":.165,"1536x1024":.165,"1024x1360":.165,"1360x1024":.165,"1024x1824":.2,"1824x1024":.2,"2048x2048":.422,"2048x1152":.32,"1152x2048":.32,"3824x2160":.8,"2160x3824":.8,auto:.211}};function o3(n,l){return i3[n]?.[l]??0}function u3(){const n=de(m=>m.provider),l=de(m=>m.quality),u=de(m=>m.getResolvedSize)(),r=n==="oauth",f=o3(l,u),d=r?"free":`~$${f.toFixed(3)}`,h=r?"var(--green)":void 0;return E.jsxs("div",{className:"cost-estimate",children:[E.jsx("span",{children:"Est. cost"}),E.jsx("span",{className:"price",style:h?{color:h}:void 0,children:d})]})}const s3=[{value:"low",label:"Low",sub:"fast"},{value:"medium",label:"Medium",sub:"balanced"},{value:"high",label:"High",sub:"best"}],r3=[{value:"png",label:"PNG"},{value:"jpeg",label:"JPEG"},{value:"webp",label:"WebP"}],c3=[{value:"low",label:"Low",sub:"less restrictive",color:"var(--amber)"},{value:"auto",label:"Auto",sub:"standard"}],f3=[{value:"1",label:"1"},{value:"2",label:"2"},{value:"4",label:"4"}];function d3(){const n=de(S=>S.rightPanelOpen),l=de(S=>S.toggleRightPanel),[o,u]=J.useState(typeof window<"u"?window.matchMedia("(max-width: 800px)").matches:!1);J.useEffect(()=>{if(typeof window>"u")return;const S=window.matchMedia("(max-width: 800px)"),_=()=>u(S.matches);return S.addEventListener("change",_),()=>S.removeEventListener("change",_)},[]);const r=o?n:!0,f=de(S=>S.quality),d=de(S=>S.setQuality),h=de(S=>S.format),m=de(S=>S.setFormat),g=de(S=>S.moderation),v=de(S=>S.setModeration),y=de(S=>S.count),x=de(S=>S.setCount);return E.jsxs(E.Fragment,{children:[o&&n?E.jsx("div",{className:"right-panel-backdrop",role:"button","aria-label":"Close settings",onClick:l}):null,E.jsxs("aside",{className:`right-panel${n?"":" collapsed"}${o&&r?" drawer-open":""}`,"aria-label":"Detail settings",children:[E.jsx("button",{type:"button",className:"right-panel-toggle","aria-expanded":n,"aria-controls":"right-panel-body",onClick:l,title:n?"Hide details":"Show details",children:o?n?"✕":"☰":n?"▶":"◀"}),E.jsxs("div",{id:"right-panel-body",className:"right-panel-body",hidden:!n,children:[E.jsx(a3,{}),E.jsx("div",{className:"section-title",children:"Details"}),E.jsx(Ln,{title:"Quality",items:s3,value:f,onChange:d}),E.jsx(l3,{}),E.jsx(Ln,{title:"Format",items:r3,value:h,onChange:m}),E.jsx(Ln,{title:"Moderation",items:c3,value:g,onChange:v}),E.jsx(Ln,{title:"Count",items:f3,value:String(y),onChange:S=>x(Number(S))}),E.jsx(u3,{})]})]})]})}function h3(){const n=de(r=>r.toast),[l,o]=J.useState(!1);if(J.useEffect(()=>{if(!n)return;o(!0);const r=setTimeout(()=>o(!1),3e3);return()=>clearTimeout(r)},[n]),!n)return null;const u=["toast",l?"visible":"",n.error?"error":""].filter(Boolean).join(" ");return E.jsx("div",{className:u,children:n.message})}function g3(n){if(!n)return"Older";const l=new Date(n);if(Number.isNaN(l.getTime()))return"Older";const u=Math.floor((new Date().getTime()-l.getTime())/864e5);return u===0?"Today":u===1?"Yesterday":u<7?"This week":l.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function m3(){const n=de(R=>R.galleryOpen),l=de(R=>R.closeGallery),o=de(R=>R.history),u=de(R=>R.selectHistory),r=de(R=>R.currentImage),f=de(R=>R.removeFromHistory),d=de(R=>R.addHistoryItem),[h,m]=J.useState(""),[g,v]=J.useState("date"),[y,x]=J.useState([]),[S,_]=J.useState([]),[T,z]=J.useState(null);J.useEffect(()=>{if(!n)return;const R=X=>{X.key==="Escape"&&l()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[n,l]),J.useEffect(()=>{n||(m(""),z(null))},[n]),J.useEffect(()=>{if(!n||g!=="session")return;let R=!1;return(async()=>{try{const X=await vx({limit:500});if(R)return;const ie=Z=>({image:Z.url,url:Z.url,filename:Z.filename,prompt:Z.prompt??void 0,size:Z.size??void 0,quality:Z.quality??void 0,provider:Z.provider,createdAt:Z.createdAt});x(X.sessions.map(Z=>({sessionId:Z.sessionId,label:Z.sessionId.slice(0,8),lastUsedAt:Z.lastUsedAt,items:Z.items.map(ie)}))),_(X.loose.map(ie))}catch{}})(),()=>{R=!0}},[n,g]);const N=J.useMemo(()=>{const R=h.trim().toLowerCase().normalize("NFC");return R?o.filter(X=>(X.prompt??"").toLowerCase().normalize("NFC").includes(R)||(X.filename??"").toLowerCase().normalize("NFC").includes(R)):o},[o,h]),U=J.useMemo(()=>{const R=new Map;for(const X of N){const ie=g3(X.createdAt);R.has(ie)||R.set(ie,[]),R.get(ie).push(X)}return Array.from(R.entries())},[N]);J.useEffect(()=>{if(!T)return;const R=setInterval(()=>{z(X=>!X||Date.now()>=X.expiresAt?null:{...X})},500);return()=>clearInterval(R)},[T]);async function w(R,X){if(X.stopPropagation(),!!R.filename)try{const ie=await xx(R.filename);f(R.filename),z({filename:R.filename,trashId:ie.trashId,item:R,expiresAt:Date.now()+9500})}catch(ie){console.error("[gallery] delete failed",ie)}}async function C(){if(T)try{await Sx(T.filename,T.trashId),d(T.item)}catch(R){console.error("[gallery] restore failed",R)}finally{z(null)}}if(!n)return null;const V=(R,X,ie)=>{const Z=r?.image===R.image;return E.jsxs("div",{className:`gallery__tile-wrap${Z?" gallery__tile-wrap--active":""}`,children:[E.jsxs("button",{type:"button",className:`gallery__tile${Z?" gallery__tile--active":""}`,onClick:()=>{u(R),l()},title:R.prompt??"",children:[E.jsx("img",{src:R.thumb||R.image,alt:R.prompt??"",loading:"lazy",decoding:"async"}),R.prompt&&E.jsx("div",{className:"gallery__caption",children:E.jsx("span",{className:"gallery__caption-text",children:R.prompt})})]}),R.filename&&E.jsx("button",{type:"button",className:"gallery__delete",onClick:W=>w(R,W),title:"Delete (10s undo)","aria-label":"Delete image",children:"✕"})]},`${X}-${ie}-${R.filename??ie}`)},L=g==="session",Y=L?y.reduce((R,X)=>R+X.items.length,0)+S.length:N.length;return E.jsx("div",{className:"gallery-backdrop",onClick:l,role:"presentation",children:E.jsxs("div",{className:"gallery",role:"dialog","aria-modal":"true","aria-label":"Image gallery",onClick:R=>R.stopPropagation(),children:[E.jsxs("div",{className:"gallery__header",children:[E.jsxs("div",{className:"gallery__title-row",children:[E.jsx("div",{className:"gallery__title",children:"Gallery"}),E.jsxs("div",{className:"gallery__meta",children:[Y,h?` / ${o.length}`:""," images"]}),E.jsxs("div",{className:"gallery__group-toggle",role:"tablist","aria-label":"Group by",children:[E.jsx("button",{type:"button",role:"tab","aria-selected":g==="date",className:g==="date"?"active":"",onClick:()=>v("date"),children:"Date"}),E.jsx("button",{type:"button",role:"tab","aria-selected":g==="session",className:g==="session"?"active":"",onClick:()=>v("session"),children:"Session"})]})]}),E.jsx("input",{type:"text",className:"gallery__search",placeholder:"Search prompt or filename…",value:h,onChange:R=>m(R.target.value),autoFocus:!0,disabled:L}),E.jsx("button",{type:"button",className:"gallery__close",onClick:l,"aria-label":"Close gallery",title:"Close (Esc)",children:"✕"})]}),E.jsx("div",{className:"gallery__scroll",children:L?E.jsxs(E.Fragment,{children:[y.map(R=>E.jsxs("section",{className:"gallery__group",children:[E.jsxs("header",{className:"gallery__group-header",children:[E.jsxs("span",{className:"gallery__group-label",children:["📦 ",R.label]}),E.jsx("span",{className:"gallery__group-count",children:R.items.length})]}),E.jsx("div",{className:"gallery__grid",children:R.items.map((X,ie)=>V(X,R.sessionId,ie))})]},R.sessionId)),S.length>0&&E.jsxs("section",{className:"gallery__group",children:[E.jsxs("header",{className:"gallery__group-header",children:[E.jsx("span",{className:"gallery__group-label",children:"Loose images"}),E.jsx("span",{className:"gallery__group-count",children:S.length})]}),E.jsx("div",{className:"gallery__grid",children:S.map((R,X)=>V(R,"loose",X))})]}),y.length===0&&S.length===0&&E.jsx("div",{className:"gallery__empty",children:"No sessions yet."})]}):N.length===0?E.jsx("div",{className:"gallery__empty",children:o.length===0?"No images yet. Generate something!":"No matches for that query."}):U.map(([R,X])=>E.jsxs("section",{className:"gallery__group",children:[E.jsxs("header",{className:"gallery__group-header",children:[E.jsx("span",{className:"gallery__group-label",children:R}),E.jsx("span",{className:"gallery__group-count",children:X.length})]}),E.jsx("div",{className:"gallery__grid",children:X.map((ie,Z)=>V(ie,R,Z))})]},R))}),T&&E.jsxs("div",{className:"gallery__undo",children:[E.jsxs("span",{children:["Deleted ",T.filename]}),E.jsx("button",{type:"button",onClick:C,children:"Undo"}),E.jsxs("span",{className:"gallery__undo-timer",children:[Math.max(0,Math.ceil((T.expiresAt-Date.now())/1e3)),"s"]})]})]})})}function p3(){const n=de(f=>f.hydrateHistory),l=de(f=>f.loadSessions),o=de(f=>f.startInFlightPolling),u=de(f=>f.reconcileInflight),r=de(f=>f.syncFromStorage);return de(f=>f.uiMode),J.useEffect(()=>{n(),l(),u(),o()},[n,l,u,o]),J.useEffect(()=>{const f=d=>{d.key&&(d.key==="ima2.inFlight"||d.key==="ima2.selectedFilename")&&r()};return window.addEventListener("storage",f),()=>window.removeEventListener("storage",f)},[r]),J.useEffect(()=>{const f=()=>{Lx(de.getState)};return window.addEventListener("beforeunload",f),document.addEventListener("visibilitychange",f),()=>{window.removeEventListener("beforeunload",f),document.removeEventListener("visibilitychange",f)}},[]),E.jsxs(E.Fragment,{children:[E.jsxs("div",{className:"app",children:[E.jsx(Fx,{}),E.jsx(Px,{}),E.jsx(d3,{})]}),E.jsx(h3,{}),E.jsx(m3,{})]})}cx.createRoot(document.getElementById("root")).render(E.jsx(J.StrictMode,{children:E.jsx(p3,{})}));
16
+ //# sourceMappingURL=index-BlTTpUh8.js.map