ima2-gen 1.0.7 → 1.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/config.js +2 -2
- package/lib/assetLifecycle.js +5 -3
- package/lib/historyList.js +1 -0
- package/lib/nodeStore.js +16 -14
- package/lib/oauthProxy.js +43 -3
- package/lib/storageMigration.js +91 -0
- package/package.json +1 -1
- package/routes/nodes.js +89 -15
- package/routes/sessions.js +3 -1
- package/server.js +2 -0
- package/ui/dist/assets/{index-Jcs5Q1sj.css → index-CBrmEeD7.css} +1 -1
- package/ui/dist/assets/index-DRST1V_0.js +22 -0
- package/ui/dist/assets/index-DRST1V_0.js.map +1 -0
- package/ui/dist/index.html +2 -2
- package/ui/dist/assets/index-D1MUxZaB.js +0 -16
- package/ui/dist/assets/index-D1MUxZaB.js.map +0 -1
|
@@ -1,16 +0,0 @@
|
|
|
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"]'))s(r);new MutationObserver(r=>{for(const c of r)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function o(r){const c={};return r.integrity&&(c.integrity=r.integrity),r.referrerPolicy&&(c.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?c.credentials="include":r.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(r){if(r.ep)return;r.ep=!0;const c=o(r);fetch(r.href,c)}})();function Cy(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var of={exports:{}},no={};var $m;function DS(){if($m)return no;$m=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function o(s,r,c){var d=null;if(c!==void 0&&(d=""+c),r.key!==void 0&&(d=""+r.key),"key"in r){c={};for(var g in r)g!=="key"&&(c[g]=r[g])}else c=r;return r=c.ref,{$$typeof:n,type:s,key:d,ref:r!==void 0?r:null,props:c}}return no.Fragment=l,no.jsx=o,no.jsxs=o,no}var Qm;function RS(){return Qm||(Qm=1,of.exports=DS()),of.exports}var b=RS(),sf={exports:{}},be={};var Km;function OS(){if(Km)return be;Km=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),p=Symbol.iterator;function x(C){return C===null||typeof C!="object"?null:(C=p&&C[p]||C["@@iterator"],typeof C=="function"?C:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,A={};function T(C,U,ee){this.props=C,this.context=U,this.refs=A,this.updater=ee||_}T.prototype.isReactComponent={},T.prototype.setState=function(C,U){if(typeof C!="object"&&typeof C!="function"&&C!=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,C,U,"setState")},T.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function B(){}B.prototype=T.prototype;function E(C,U,ee){this.props=C,this.context=U,this.refs=A,this.updater=ee||_}var D=E.prototype=new B;D.constructor=E,M(D,T.prototype),D.isPureReactComponent=!0;var Y=Array.isArray;function R(){}var L={H:null,A:null,T:null,S:null},H=Object.prototype.hasOwnProperty;function $(C,U,ee){var ae=ee.ref;return{$$typeof:n,type:C,key:U,ref:ae!==void 0?ae:null,props:ee}}function V(C,U){return $(C.type,U,C.props)}function k(C){return typeof C=="object"&&C!==null&&C.$$typeof===n}function P(C){var U={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(ee){return U[ee]})}var te=/\/+/g;function z(C,U){return typeof C=="object"&&C!==null&&C.key!=null?P(""+C.key):U.toString(36)}function I(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(R,R):(C.status="pending",C.then(function(U){C.status==="pending"&&(C.status="fulfilled",C.value=U)},function(U){C.status==="pending"&&(C.status="rejected",C.reason=U)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function N(C,U,ee,ae,ue){var fe=typeof C;(fe==="undefined"||fe==="boolean")&&(C=null);var ce=!1;if(C===null)ce=!0;else switch(fe){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(C.$$typeof){case n:case l:ce=!0;break;case y:return ce=C._init,N(ce(C._payload),U,ee,ae,ue)}}if(ce)return ue=ue(C),ce=ae===""?"."+z(C,0):ae,Y(ue)?(ee="",ce!=null&&(ee=ce.replace(te,"$&/")+"/"),N(ue,U,ee,"",function(we){return we})):ue!=null&&(k(ue)&&(ue=V(ue,ee+(ue.key==null||C&&C.key===ue.key?"":(""+ue.key).replace(te,"$&/")+"/")+ce)),U.push(ue)),1;ce=0;var re=ae===""?".":ae+":";if(Y(C))for(var de=0;de<C.length;de++)ae=C[de],fe=re+z(ae,de),ce+=N(ae,U,ee,fe,ue);else if(de=x(C),typeof de=="function")for(C=de.call(C),de=0;!(ae=C.next()).done;)ae=ae.value,fe=re+z(ae,de++),ce+=N(ae,U,ee,fe,ue);else if(fe==="object"){if(typeof C.then=="function")return N(I(C),U,ee,ae,ue);throw U=String(C),Error("Objects are not valid as a React child (found: "+(U==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":U)+"). If you meant to render a collection of children, use an array instead.")}return ce}function j(C,U,ee){if(C==null)return C;var ae=[],ue=0;return N(C,ae,"","",function(fe){return U.call(ee,fe,ue++)}),ae}function G(C){if(C._status===-1){var U=C._result;U=U(),U.then(function(ee){(C._status===0||C._status===-1)&&(C._status=1,C._result=ee)},function(ee){(C._status===0||C._status===-1)&&(C._status=2,C._result=ee)}),C._status===-1&&(C._status=0,C._result=U)}if(C._status===1)return C._result.default;throw C._result}var Q=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var U=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent(U))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},ne={map:j,forEach:function(C,U,ee){j(C,function(){U.apply(this,arguments)},ee)},count:function(C){var U=0;return j(C,function(){U++}),U},toArray:function(C){return j(C,function(U){return U})||[]},only:function(C){if(!k(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return be.Activity=v,be.Children=ne,be.Component=T,be.Fragment=o,be.Profiler=r,be.PureComponent=E,be.StrictMode=s,be.Suspense=m,be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,be.__COMPILER_RUNTIME={__proto__:null,c:function(C){return L.H.useMemoCache(C)}},be.cache=function(C){return function(){return C.apply(null,arguments)}},be.cacheSignal=function(){return null},be.cloneElement=function(C,U,ee){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var ae=M({},C.props),ue=C.key;if(U!=null)for(fe in U.key!==void 0&&(ue=""+U.key),U)!H.call(U,fe)||fe==="key"||fe==="__self"||fe==="__source"||fe==="ref"&&U.ref===void 0||(ae[fe]=U[fe]);var fe=arguments.length-2;if(fe===1)ae.children=ee;else if(1<fe){for(var ce=Array(fe),re=0;re<fe;re++)ce[re]=arguments[re+2];ae.children=ce}return $(C.type,ue,ae)},be.createContext=function(C){return C={$$typeof:d,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:c,_context:C},C},be.createElement=function(C,U,ee){var ae,ue={},fe=null;if(U!=null)for(ae in U.key!==void 0&&(fe=""+U.key),U)H.call(U,ae)&&ae!=="key"&&ae!=="__self"&&ae!=="__source"&&(ue[ae]=U[ae]);var ce=arguments.length-2;if(ce===1)ue.children=ee;else if(1<ce){for(var re=Array(ce),de=0;de<ce;de++)re[de]=arguments[de+2];ue.children=re}if(C&&C.defaultProps)for(ae in ce=C.defaultProps,ce)ue[ae]===void 0&&(ue[ae]=ce[ae]);return $(C,fe,ue)},be.createRef=function(){return{current:null}},be.forwardRef=function(C){return{$$typeof:g,render:C}},be.isValidElement=k,be.lazy=function(C){return{$$typeof:y,_payload:{_status:-1,_result:C},_init:G}},be.memo=function(C,U){return{$$typeof:h,type:C,compare:U===void 0?null:U}},be.startTransition=function(C){var U=L.T,ee={};L.T=ee;try{var ae=C(),ue=L.S;ue!==null&&ue(ee,ae),typeof ae=="object"&&ae!==null&&typeof ae.then=="function"&&ae.then(R,Q)}catch(fe){Q(fe)}finally{U!==null&&ee.types!==null&&(U.types=ee.types),L.T=U}},be.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},be.use=function(C){return L.H.use(C)},be.useActionState=function(C,U,ee){return L.H.useActionState(C,U,ee)},be.useCallback=function(C,U){return L.H.useCallback(C,U)},be.useContext=function(C){return L.H.useContext(C)},be.useDebugValue=function(){},be.useDeferredValue=function(C,U){return L.H.useDeferredValue(C,U)},be.useEffect=function(C,U){return L.H.useEffect(C,U)},be.useEffectEvent=function(C){return L.H.useEffectEvent(C)},be.useId=function(){return L.H.useId()},be.useImperativeHandle=function(C,U,ee){return L.H.useImperativeHandle(C,U,ee)},be.useInsertionEffect=function(C,U){return L.H.useInsertionEffect(C,U)},be.useLayoutEffect=function(C,U){return L.H.useLayoutEffect(C,U)},be.useMemo=function(C,U){return L.H.useMemo(C,U)},be.useOptimistic=function(C,U){return L.H.useOptimistic(C,U)},be.useReducer=function(C,U,ee){return L.H.useReducer(C,U,ee)},be.useRef=function(C){return L.H.useRef(C)},be.useState=function(C){return L.H.useState(C)},be.useSyncExternalStore=function(C,U,ee){return L.H.useSyncExternalStore(C,U,ee)},be.useTransition=function(){return L.H.useTransition()},be.version="19.2.5",be}var Fm;function _o(){return Fm||(Fm=1,sf.exports=OS()),sf.exports}var Z=_o();const so=Cy(Z);var rf={exports:{}},ao={},uf={exports:{}},cf={};var Jm;function jS(){return Jm||(Jm=1,(function(n){function l(N,j){var G=N.length;N.push(j);e:for(;0<G;){var Q=G-1>>>1,ne=N[Q];if(0<r(ne,j))N[Q]=j,N[G]=ne,G=Q;else break e}}function o(N){return N.length===0?null:N[0]}function s(N){if(N.length===0)return null;var j=N[0],G=N.pop();if(G!==j){N[0]=G;e:for(var Q=0,ne=N.length,C=ne>>>1;Q<C;){var U=2*(Q+1)-1,ee=N[U],ae=U+1,ue=N[ae];if(0>r(ee,G))ae<ne&&0>r(ue,ee)?(N[Q]=ue,N[ae]=G,Q=ae):(N[Q]=ee,N[U]=G,Q=U);else if(ae<ne&&0>r(ue,G))N[Q]=ue,N[ae]=G,Q=ae;else break e}}return j}function r(N,j){var G=N.sortIndex-j.sortIndex;return G!==0?G:N.id-j.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var d=Date,g=d.now();n.unstable_now=function(){return d.now()-g}}var m=[],h=[],y=1,v=null,p=3,x=!1,_=!1,M=!1,A=!1,T=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function D(N){for(var j=o(h);j!==null;){if(j.callback===null)s(h);else if(j.startTime<=N)s(h),j.sortIndex=j.expirationTime,l(m,j);else break;j=o(h)}}function Y(N){if(M=!1,D(N),!_)if(o(m)!==null)_=!0,R||(R=!0,P());else{var j=o(h);j!==null&&I(Y,j.startTime-N)}}var R=!1,L=-1,H=5,$=-1;function V(){return A?!0:!(n.unstable_now()-$<H)}function k(){if(A=!1,R){var N=n.unstable_now();$=N;var j=!0;try{e:{_=!1,M&&(M=!1,B(L),L=-1),x=!0;var G=p;try{t:{for(D(N),v=o(m);v!==null&&!(v.expirationTime>N&&V());){var Q=v.callback;if(typeof Q=="function"){v.callback=null,p=v.priorityLevel;var ne=Q(v.expirationTime<=N);if(N=n.unstable_now(),typeof ne=="function"){v.callback=ne,D(N),j=!0;break t}v===o(m)&&s(m),D(N)}else s(m);v=o(m)}if(v!==null)j=!0;else{var C=o(h);C!==null&&I(Y,C.startTime-N),j=!1}}break e}finally{v=null,p=G,x=!1}j=void 0}}finally{j?P():R=!1}}}var P;if(typeof E=="function")P=function(){E(k)};else if(typeof MessageChannel<"u"){var te=new MessageChannel,z=te.port2;te.port1.onmessage=k,P=function(){z.postMessage(null)}}else P=function(){T(k,0)};function I(N,j){L=T(function(){N(n.unstable_now())},j)}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(N){N.callback=null},n.unstable_forceFrameRate=function(N){0>N||125<N?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):H=0<N?Math.floor(1e3/N):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_next=function(N){switch(p){case 1:case 2:case 3:var j=3;break;default:j=p}var G=p;p=j;try{return N()}finally{p=G}},n.unstable_requestPaint=function(){A=!0},n.unstable_runWithPriority=function(N,j){switch(N){case 1:case 2:case 3:case 4:case 5:break;default:N=3}var G=p;p=N;try{return j()}finally{p=G}},n.unstable_scheduleCallback=function(N,j,G){var Q=n.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?Q+G:Q):G=Q,N){case 1:var ne=-1;break;case 2:ne=250;break;case 5:ne=1073741823;break;case 4:ne=1e4;break;default:ne=5e3}return ne=G+ne,N={id:y++,callback:j,priorityLevel:N,startTime:G,expirationTime:ne,sortIndex:-1},G>Q?(N.sortIndex=G,l(h,N),o(m)===null&&N===o(h)&&(M?(B(L),L=-1):M=!0,I(Y,G-Q))):(N.sortIndex=ne,l(m,N),_||x||(_=!0,R||(R=!0,P()))),N},n.unstable_shouldYield=V,n.unstable_wrapCallback=function(N){var j=p;return function(){var G=p;p=j;try{return N.apply(this,arguments)}finally{p=G}}}})(cf)),cf}var Pm;function HS(){return Pm||(Pm=1,uf.exports=jS()),uf.exports}var ff={exports:{}},yt={};var Wm;function LS(){if(Wm)return yt;Wm=1;var n=_o();function l(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)h+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var s={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 c(m,h,y){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:v==null?null:""+v,children:m,containerInfo:h,implementation:y}}var d=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(m,h){if(m==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return yt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,yt.createPortal=function(m,h){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(l(299));return c(m,h,null,y)},yt.flushSync=function(m){var h=d.T,y=s.p;try{if(d.T=null,s.p=2,m)return m()}finally{d.T=h,s.p=y,s.d.f()}},yt.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,s.d.C(m,h))},yt.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},yt.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var y=h.as,v=g(y,h.crossOrigin),p=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;y==="style"?s.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:v,integrity:p,fetchPriority:x}):y==="script"&&s.d.X(m,{crossOrigin:v,integrity:p,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},yt.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var y=g(h.as,h.crossOrigin);s.d.M(m,{crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&s.d.M(m)},yt.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var y=h.as,v=g(y,h.crossOrigin);s.d.L(m,y,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},yt.preloadModule=function(m,h){if(typeof m=="string")if(h){var y=g(h.as,h.crossOrigin);s.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:y,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else s.d.m(m)},yt.requestFormReset=function(m){s.d.r(m)},yt.unstable_batchedUpdates=function(m,h){return m(h)},yt.useFormState=function(m,h,y){return d.H.useFormState(m,h,y)},yt.useFormStatus=function(){return d.H.useHostTransitionStatus()},yt.version="19.2.5",yt}var ep;function My(){if(ep)return ff.exports;ep=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(),ff.exports=LS(),ff.exports}var tp;function US(){if(tp)return ao;tp=1;var n=HS(),l=_o(),o=My();function s(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 c(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 g(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(c(e)!==e)throw Error(s(188))}function h(e){var t=e.alternate;if(!t){if(t=c(e),t===null)throw Error(s(188));return t!==e?null:e}for(var a=e,i=t;;){var u=a.return;if(u===null)break;var f=u.alternate;if(f===null){if(i=u.return,i!==null){a=i;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===a)return m(u),e;if(f===i)return m(u),t;f=f.sibling}throw Error(s(188))}if(a.return!==i.return)a=u,i=f;else{for(var S=!1,w=u.child;w;){if(w===a){S=!0,a=u,i=f;break}if(w===i){S=!0,i=u,a=f;break}w=w.sibling}if(!S){for(w=f.child;w;){if(w===a){S=!0,a=f,i=u;break}if(w===i){S=!0,i=f,a=u;break}w=w.sibling}if(!S)throw Error(s(189))}}if(a.alternate!==i)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?e:t}function y(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=y(e),t!==null)return t;e=e.sibling}return null}var v=Object.assign,p=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),E=Symbol.for("react.context"),D=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),k=Symbol.iterator;function P(e){return e===null||typeof e!="object"?null:(e=k&&e[k]||e["@@iterator"],typeof e=="function"?e:null)}var te=Symbol.for("react.client.reference");function z(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===te?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case M:return"Fragment";case T:return"Profiler";case A:return"StrictMode";case Y:return"Suspense";case R:return"SuspenseList";case $:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case _:return"Portal";case E:return e.displayName||"Context";case B:return(e._context.displayName||"Context")+".Consumer";case D:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case L:return t=e.displayName||null,t!==null?t:z(e.type)||"Memo";case H:t=e._payload,e=e._init;try{return z(e(t))}catch{}}return null}var I=Array.isArray,N=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,j=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},Q=[],ne=-1;function C(e){return{current:e}}function U(e){0>ne||(e.current=Q[ne],Q[ne]=null,ne--)}function ee(e,t){ne++,Q[ne]=e.current,e.current=t}var ae=C(null),ue=C(null),fe=C(null),ce=C(null);function re(e,t){switch(ee(fe,t),ee(ue,e),ee(ae,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?pm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=pm(t),e=ym(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}U(ae),ee(ae,e)}function de(){U(ae),U(ue),U(fe)}function we(e){e.memoizedState!==null&&ee(ce,e);var t=ae.current,a=ym(t,e.type);t!==a&&(ee(ue,e),ee(ae,a))}function xe(e){ue.current===e&&(U(ae),U(ue)),ce.current===e&&(U(ce),Pi._currentValue=G)}var ye,Se;function Ce(e){if(ye===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||"",Se=-1<a.stack.indexOf(`
|
|
2
|
-
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
-
`+ye+e+Se}var qe=!1;function Le(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 se=function(){throw Error()};if(Object.defineProperty(se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(se,[])}catch(W){var J=W}Reflect.construct(e,[],se)}else{try{se.call()}catch(W){J=W}e.call(se.prototype)}}else{try{throw Error()}catch(W){J=W}(se=e())&&typeof se.catch=="function"&&se.catch(function(){})}}catch(W){if(W&&J&&typeof W.stack=="string")return[W.stack,J.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=i.DetermineComponentFrameRoot(),S=f[0],w=f[1];if(S&&w){var O=S.split(`
|
|
4
|
-
`),F=w.split(`
|
|
5
|
-
`);for(u=i=0;i<O.length&&!O[i].includes("DetermineComponentFrameRoot");)i++;for(;u<F.length&&!F[u].includes("DetermineComponentFrameRoot");)u++;if(i===O.length||u===F.length)for(i=O.length-1,u=F.length-1;1<=i&&0<=u&&O[i]!==F[u];)u--;for(;1<=i&&0<=u;i--,u--)if(O[i]!==F[u]){if(i!==1||u!==1)do if(i--,u--,0>u||O[i]!==F[u]){var le=`
|
|
6
|
-
`+O[i].replace(" at new "," at ");return e.displayName&&le.includes("<anonymous>")&&(le=le.replace("<anonymous>",e.displayName)),le}while(1<=i&&0<=u);break}}}finally{qe=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Ce(a):""}function rt(e,t){switch(e.tag){case 26:case 27:case 5:return Ce(e.type);case 16:return Ce("Lazy");case 13:return e.child!==t&&t!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return Le(e.type,!1);case 11:return Le(e.type.render,!1);case 1:return Le(e.type,!0);case 31:return Ce("Activity");default:return""}}function Qt(e){try{var t="",a=null;do t+=rt(e,a),a=e,e=e.return;while(e);return t}catch(i){return`
|
|
7
|
-
Error generating stack: `+i.message+`
|
|
8
|
-
`+i.stack}}var zt=Object.prototype.hasOwnProperty,Kt=n.unstable_scheduleCallback,yn=n.unstable_cancelCallback,Na=n.unstable_shouldYield,Aa=n.unstable_requestPaint,ft=n.unstable_now,il=n.unstable_getCurrentPriorityLevel,vn=n.unstable_ImmediatePriority,Xn=n.unstable_UserBlockingPriority,Ta=n.unstable_NormalPriority,kr=n.unstable_LowPriority,ol=n.unstable_IdlePriority,Ir=n.log,Vr=n.unstable_setDisableYieldValue,Ca=null,vt=null;function on(e){if(typeof Ir=="function"&&Vr(e),vt&&typeof vt.setStrictMode=="function")try{vt.setStrictMode(Ca,e)}catch{}}var St=Math.clz32?Math.clz32:$r,Xr=Math.log,Zr=Math.LN2;function $r(e){return e>>>=0,e===0?32:31-(Xr(e)/Zr|0)|0}var sl=256,rl=262144,ul=4194304;function Sn(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 cl(e,t,a){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,S=e.pingedLanes;e=e.warmLanes;var w=i&134217727;return w!==0?(i=w&~f,i!==0?u=Sn(i):(S&=w,S!==0?u=Sn(S):a||(a=w&~e,a!==0&&(u=Sn(a))))):(w=i&~f,w!==0?u=Sn(w):S!==0?u=Sn(S):a||(a=i&~e,a!==0&&(u=Sn(a)))),u===0?0:t!==0&&t!==u&&(t&f)===0&&(f=u&-u,a=t&-t,f>=a||f===32&&(a&4194048)!==0)?t:u}function Ma(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Qr(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 Do(){var e=ul;return ul<<=1,(ul&62914560)===0&&(ul=4194304),e}function ui(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function za(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Kr(e,t,a,i,u,f){var S=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 w=e.entanglements,O=e.expirationTimes,F=e.hiddenUpdates;for(a=S&~a;0<a;){var le=31-St(a),se=1<<le;w[le]=0,O[le]=-1;var J=F[le];if(J!==null)for(F[le]=null,le=0;le<J.length;le++){var W=J[le];W!==null&&(W.lane&=-536870913)}a&=~se}i!==0&&Ro(e,i,0),f!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=f&~(S&~t))}function Ro(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-St(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|a&261930}function Oo(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var i=31-St(a),u=1<<i;u&t|e[i]&t&&(e[i]|=t),a&=~u}}function jo(e,t){var a=t&-t;return a=(a&42)!==0?1:ci(a),(a&(e.suspendedLanes|t))!==0?0:a}function ci(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 fi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ho(){var e=j.p;return e!==0?e:(e=window.event,e===void 0?32:Gm(e.type))}function Lo(e,t){var a=j.p;try{return j.p=e,t()}finally{j.p=a}}var sn=Math.random().toString(36).slice(2),ot="__reactFiber$"+sn,pt="__reactProps$"+sn,bn="__reactContainer$"+sn,fl="__reactEvents$"+sn,Uo="__reactListeners$"+sn,Fr="__reactHandles$"+sn,Bo="__reactResources$"+sn,Da="__reactMarker$"+sn;function di(e){delete e[ot],delete e[pt],delete e[fl],delete e[Uo],delete e[Fr]}function Zn(e){var t=e[ot];if(t)return t;for(var a=e.parentNode;a;){if(t=a[bn]||a[ot]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=_m(e);e!==null;){if(a=e[ot])return a;e=_m(e)}return t}e=a,a=e.parentNode}return null}function $n(e){if(e=e[ot]||e[bn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Qn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Kn(e){var t=e[Bo];return t||(t=e[Bo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function et(e){e[Da]=!0}var qo=new Set,Go={};function xn(e,t){Fn(e,t),Fn(e+"Capture",t)}function Fn(e,t){for(Go[e]=t,e=0;e<t.length;e++)qo.add(t[e])}var Jr=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]*$"),hi={},Yo={};function Pr(e){return zt.call(Yo,e)?!0:zt.call(hi,e)?!1:Jr.test(e)?Yo[e]=!0:(hi[e]=!0,!1)}function dl(e,t,a){if(Pr(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 hl(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 Ft(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 xt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ko(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Wr(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 u=i.get,f=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(S){a=""+S,f.call(this,S)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return a},setValue:function(S){a=""+S},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function gl(e){if(!e._valueTracker){var t=ko(e)?"checked":"value";e._valueTracker=Wr(e,t,""+e[t])}}function Io(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),i="";return e&&(i=ko(e)?e.checked?"true":"false":e.value),e=i,e!==a?(t.setValue(e),!0):!1}function Ra(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 eu=/[\n"\\]/g;function Et(e){return e.replace(eu,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Oa(e,t,a,i,u,f,S,w){e.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.type=S:e.removeAttribute("type"),t!=null?S==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+xt(t)):e.value!==""+xt(t)&&(e.value=""+xt(t)):S!=="submit"&&S!=="reset"||e.removeAttribute("value"),t!=null?gi(e,S,xt(t)):a!=null?gi(e,S,xt(a)):i!=null&&e.removeAttribute("value"),u==null&&f!=null&&(e.defaultChecked=!!f),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.name=""+xt(w):e.removeAttribute("name")}function Vo(e,t,a,i,u,f,S,w){if(f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.type=f),t!=null||a!=null){if(!(f!=="submit"&&f!=="reset"||t!=null)){gl(e);return}a=a!=null?""+xt(a):"",t=t!=null?""+xt(t):a,w||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=w?e.checked:!!i,e.defaultChecked=!!i,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(e.name=S),gl(e)}function gi(e,t,a){t==="number"&&Ra(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function En(e,t,a,i){if(e=e.options,t){t={};for(var u=0;u<a.length;u++)t["$"+a[u]]=!0;for(a=0;a<e.length;a++)u=t.hasOwnProperty("$"+e[a].value),e[a].selected!==u&&(e[a].selected=u),u&&i&&(e[a].defaultSelected=!0)}else{for(a=""+xt(a),t=null,u=0;u<e.length;u++){if(e[u].value===a){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function fd(e,t,a){if(t!=null&&(t=""+xt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+xt(a):""}function dd(e,t,a,i){if(t==null){if(i!=null){if(a!=null)throw Error(s(92));if(I(i)){if(1<i.length)throw Error(s(93));i=i[0]}a=i}a==null&&(a=""),t=a}a=xt(t),e.defaultValue=a,i=e.textContent,i===a&&i!==""&&i!==null&&(e.value=i),gl(e)}function ml(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Av=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 hd(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||Av.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function gd(e,t,a){if(t!=null&&typeof t!="object")throw Error(s(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 u in t)i=t[u],t.hasOwnProperty(u)&&a[u]!==i&&hd(e,u,i)}else for(var f in t)t.hasOwnProperty(f)&&hd(e,f,t[f])}function tu(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 Tv=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"]]),Cv=/^[\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 Xo(e){return Cv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function wn(){}var nu=null;function au(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var pl=null,yl=null;function md(e){var t=$n(e);if(t&&(e=t.stateNode)){var a=e[pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Oa(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="'+Et(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var i=a[t];if(i!==e&&i.form===e.form){var u=i[pt]||null;if(!u)throw Error(s(90));Oa(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<a.length;t++)i=a[t],i.form===e.form&&Io(i)}break e;case"textarea":fd(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&En(e,!!a.multiple,t,!1)}}}var lu=!1;function pd(e,t,a){if(lu)return e(t,a);lu=!0;try{var i=e(t);return i}finally{if(lu=!1,(pl!==null||yl!==null)&&(Rs(),pl&&(t=pl,e=yl,yl=pl=null,md(t),e)))for(t=0;t<e.length;t++)md(e[t])}}function mi(e,t){var a=e.stateNode;if(a===null)return null;var i=a[pt]||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(s(231,t,typeof a));return a}var _n=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),iu=!1;if(_n)try{var pi={};Object.defineProperty(pi,"passive",{get:function(){iu=!0}}),window.addEventListener("test",pi,pi),window.removeEventListener("test",pi,pi)}catch{iu=!1}var Jn=null,ou=null,Zo=null;function yd(){if(Zo)return Zo;var e,t=ou,a=t.length,i,u="value"in Jn?Jn.value:Jn.textContent,f=u.length;for(e=0;e<a&&t[e]===u[e];e++);var S=a-e;for(i=1;i<=S&&t[a-i]===u[f-i];i++);return Zo=u.slice(e,1<i?1-i:void 0)}function $o(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 Qo(){return!0}function vd(){return!1}function wt(e){function t(a,i,u,f,S){this._reactName=a,this._targetInst=u,this.type=i,this.nativeEvent=f,this.target=S,this.currentTarget=null;for(var w in e)e.hasOwnProperty(w)&&(a=e[w],this[w]=a?a(f):f[w]);return this.isDefaultPrevented=(f.defaultPrevented!=null?f.defaultPrevented:f.returnValue===!1)?Qo:vd,this.isPropagationStopped=vd,this}return v(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=Qo)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Qo)},persist:function(){},isPersistent:Qo}),t}var ja={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ko=wt(ja),yi=v({},ja,{view:0,detail:0}),Mv=wt(yi),su,ru,vi,Fo=v({},yi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:cu,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!==vi&&(vi&&e.type==="mousemove"?(su=e.screenX-vi.screenX,ru=e.screenY-vi.screenY):ru=su=0,vi=e),su)},movementY:function(e){return"movementY"in e?e.movementY:ru}}),Sd=wt(Fo),zv=v({},Fo,{dataTransfer:0}),Dv=wt(zv),Rv=v({},yi,{relatedTarget:0}),uu=wt(Rv),Ov=v({},ja,{animationName:0,elapsedTime:0,pseudoElement:0}),jv=wt(Ov),Hv=v({},ja,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Lv=wt(Hv),Uv=v({},ja,{data:0}),bd=wt(Uv),Bv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},qv={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"},Gv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Yv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Gv[e])?!!t[e]:!1}function cu(){return Yv}var kv=v({},yi,{key:function(e){if(e.key){var t=Bv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$o(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?qv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:cu,charCode:function(e){return e.type==="keypress"?$o(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$o(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Iv=wt(kv),Vv=v({},Fo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xd=wt(Vv),Xv=v({},yi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:cu}),Zv=wt(Xv),$v=v({},ja,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qv=wt($v),Kv=v({},Fo,{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}),Fv=wt(Kv),Jv=v({},ja,{newState:0,oldState:0}),Pv=wt(Jv),Wv=[9,13,27,32],fu=_n&&"CompositionEvent"in window,Si=null;_n&&"documentMode"in document&&(Si=document.documentMode);var e1=_n&&"TextEvent"in window&&!Si,Ed=_n&&(!fu||Si&&8<Si&&11>=Si),wd=" ",_d=!1;function Nd(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 Ad(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var vl=!1;function t1(e,t){switch(e){case"compositionend":return Ad(t);case"keypress":return t.which!==32?null:(_d=!0,wd);case"textInput":return e=t.data,e===wd&&_d?null:e;default:return null}}function n1(e,t){if(vl)return e==="compositionend"||!fu&&Nd(e,t)?(e=yd(),Zo=ou=Jn=null,vl=!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 Ed&&t.locale!=="ko"?null:t.data;default:return null}}var a1={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 Td(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!a1[e.type]:t==="textarea"}function Cd(e,t,a,i){pl?yl?yl.push(i):yl=[i]:pl=i,t=qs(t,"onChange"),0<t.length&&(a=new Ko("onChange","change",null,a,i),e.push({event:a,listeners:t}))}var bi=null,xi=null;function l1(e){cm(e,0)}function Jo(e){var t=Qn(e);if(Io(t))return e}function Md(e,t){if(e==="change")return t}var zd=!1;if(_n){var du;if(_n){var hu="oninput"in document;if(!hu){var Dd=document.createElement("div");Dd.setAttribute("oninput","return;"),hu=typeof Dd.oninput=="function"}du=hu}else du=!1;zd=du&&(!document.documentMode||9<document.documentMode)}function Rd(){bi&&(bi.detachEvent("onpropertychange",Od),xi=bi=null)}function Od(e){if(e.propertyName==="value"&&Jo(xi)){var t=[];Cd(t,xi,e,au(e)),pd(l1,t)}}function i1(e,t,a){e==="focusin"?(Rd(),bi=t,xi=a,bi.attachEvent("onpropertychange",Od)):e==="focusout"&&Rd()}function o1(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Jo(xi)}function s1(e,t){if(e==="click")return Jo(t)}function r1(e,t){if(e==="input"||e==="change")return Jo(t)}function u1(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dt=typeof Object.is=="function"?Object.is:u1;function Ei(e,t){if(Dt(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 u=a[i];if(!zt.call(t,u)||!Dt(e[u],t[u]))return!1}return!0}function jd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Hd(e,t){var a=jd(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=jd(a)}}function Ld(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ld(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Ud(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Ra(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=Ra(e.document)}return t}function gu(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 c1=_n&&"documentMode"in document&&11>=document.documentMode,Sl=null,mu=null,wi=null,pu=!1;function Bd(e,t,a){var i=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;pu||Sl==null||Sl!==Ra(i)||(i=Sl,"selectionStart"in i&&gu(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}),wi&&Ei(wi,i)||(wi=i,i=qs(mu,"onSelect"),0<i.length&&(t=new Ko("onSelect","select",null,t,a),e.push({event:t,listeners:i}),t.target=Sl)))}function Ha(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var bl={animationend:Ha("Animation","AnimationEnd"),animationiteration:Ha("Animation","AnimationIteration"),animationstart:Ha("Animation","AnimationStart"),transitionrun:Ha("Transition","TransitionRun"),transitionstart:Ha("Transition","TransitionStart"),transitioncancel:Ha("Transition","TransitionCancel"),transitionend:Ha("Transition","TransitionEnd")},yu={},qd={};_n&&(qd=document.createElement("div").style,"AnimationEvent"in window||(delete bl.animationend.animation,delete bl.animationiteration.animation,delete bl.animationstart.animation),"TransitionEvent"in window||delete bl.transitionend.transition);function La(e){if(yu[e])return yu[e];if(!bl[e])return e;var t=bl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in qd)return yu[e]=t[a];return e}var Gd=La("animationend"),Yd=La("animationiteration"),kd=La("animationstart"),f1=La("transitionrun"),d1=La("transitionstart"),h1=La("transitioncancel"),Id=La("transitionend"),Vd=new Map,vu="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(" ");vu.push("scrollEnd");function Jt(e,t){Vd.set(e,t),xn(t,[e])}var Po=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)},Gt=[],xl=0,Su=0;function Wo(){for(var e=xl,t=Su=xl=0;t<e;){var a=Gt[t];Gt[t++]=null;var i=Gt[t];Gt[t++]=null;var u=Gt[t];Gt[t++]=null;var f=Gt[t];if(Gt[t++]=null,i!==null&&u!==null){var S=i.pending;S===null?u.next=u:(u.next=S.next,S.next=u),i.pending=u}f!==0&&Xd(a,u,f)}}function es(e,t,a,i){Gt[xl++]=e,Gt[xl++]=t,Gt[xl++]=a,Gt[xl++]=i,Su|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function bu(e,t,a,i){return es(e,t,a,i),ts(e)}function Ua(e,t){return es(e,null,null,t),ts(e)}function Xd(e,t,a){e.lanes|=a;var i=e.alternate;i!==null&&(i.lanes|=a);for(var u=!1,f=e.return;f!==null;)f.childLanes|=a,i=f.alternate,i!==null&&(i.childLanes|=a),f.tag===22&&(e=f.stateNode,e===null||e._visibility&1||(u=!0)),e=f,f=f.return;return e.tag===3?(f=e.stateNode,u&&t!==null&&(u=31-St(a),e=f.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=a|536870912),f):null}function ts(e){if(50<Xi)throw Xi=0,Mc=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var El={};function g1(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 Rt(e,t,a,i){return new g1(e,t,a,i)}function xu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nn(e,t){var a=e.alternate;return a===null?(a=Rt(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 Zd(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 ns(e,t,a,i,u,f){var S=0;if(i=e,typeof e=="function")xu(e)&&(S=1);else if(typeof e=="string")S=SS(e,a,ae.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case $:return e=Rt(31,a,t,u),e.elementType=$,e.lanes=f,e;case M:return Ba(a.children,u,f,t);case A:S=8,u|=24;break;case T:return e=Rt(12,a,t,u|2),e.elementType=T,e.lanes=f,e;case Y:return e=Rt(13,a,t,u),e.elementType=Y,e.lanes=f,e;case R:return e=Rt(19,a,t,u),e.elementType=R,e.lanes=f,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case E:S=10;break e;case B:S=9;break e;case D:S=11;break e;case L:S=14;break e;case H:S=16,i=null;break e}S=29,a=Error(s(130,e===null?"null":typeof e,"")),i=null}return t=Rt(S,a,t,u),t.elementType=e,t.type=i,t.lanes=f,t}function Ba(e,t,a,i){return e=Rt(7,e,i,t),e.lanes=a,e}function Eu(e,t,a){return e=Rt(6,e,null,t),e.lanes=a,e}function $d(e){var t=Rt(18,null,null,0);return t.stateNode=e,t}function wu(e,t,a){return t=Rt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Qd=new WeakMap;function Yt(e,t){if(typeof e=="object"&&e!==null){var a=Qd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Qt(t)},Qd.set(e,t),t)}return{value:e,source:t,stack:Qt(t)}}var wl=[],_l=0,as=null,_i=0,kt=[],It=0,Pn=null,rn=1,un="";function An(e,t){wl[_l++]=_i,wl[_l++]=as,as=e,_i=t}function Kd(e,t,a){kt[It++]=rn,kt[It++]=un,kt[It++]=Pn,Pn=e;var i=rn;e=un;var u=32-St(i)-1;i&=~(1<<u),a+=1;var f=32-St(t)+u;if(30<f){var S=u-u%5;f=(i&(1<<S)-1).toString(32),i>>=S,u-=S,rn=1<<32-St(t)+u|a<<u|i,un=f+e}else rn=1<<f|a<<u|i,un=e}function _u(e){e.return!==null&&(An(e,1),Kd(e,1,0))}function Nu(e){for(;e===as;)as=wl[--_l],wl[_l]=null,_i=wl[--_l],wl[_l]=null;for(;e===Pn;)Pn=kt[--It],kt[It]=null,un=kt[--It],kt[It]=null,rn=kt[--It],kt[It]=null}function Fd(e,t){kt[It++]=rn,kt[It++]=un,kt[It++]=Pn,rn=t.id,un=t.overflow,Pn=e}var dt=null,Ve=null,De=!1,Wn=null,Vt=!1,Au=Error(s(519));function ea(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ni(Yt(t,e)),Au}function Jd(e){var t=e.stateNode,a=e.type,i=e.memoizedProps;switch(t[ot]=e,t[pt]=i,a){case"dialog":Te("cancel",t),Te("close",t);break;case"iframe":case"object":case"embed":Te("load",t);break;case"video":case"audio":for(a=0;a<$i.length;a++)Te($i[a],t);break;case"source":Te("error",t);break;case"img":case"image":case"link":Te("error",t),Te("load",t);break;case"details":Te("toggle",t);break;case"input":Te("invalid",t),Vo(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Te("invalid",t);break;case"textarea":Te("invalid",t),dd(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||gm(t.textContent,a)?(i.popover!=null&&(Te("beforetoggle",t),Te("toggle",t)),i.onScroll!=null&&Te("scroll",t),i.onScrollEnd!=null&&Te("scrollend",t),i.onClick!=null&&(t.onclick=wn),t=!0):t=!1,t||ea(e,!0)}function Pd(e){for(dt=e.return;dt;)switch(dt.tag){case 5:case 31:case 13:Vt=!1;return;case 27:case 3:Vt=!0;return;default:dt=dt.return}}function Nl(e){if(e!==dt)return!1;if(!De)return Pd(e),De=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Vc(e.type,e.memoizedProps)),a=!a),a&&Ve&&ea(e),Pd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Ve=wm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Ve=wm(e)}else t===27?(t=Ve,ga(e.type)?(e=Kc,Kc=null,Ve=e):Ve=t):Ve=dt?Zt(e.stateNode.nextSibling):null;return!0}function qa(){Ve=dt=null,De=!1}function Tu(){var e=Wn;return e!==null&&(Tt===null?Tt=e:Tt.push.apply(Tt,e),Wn=null),e}function Ni(e){Wn===null?Wn=[e]:Wn.push(e)}var Cu=C(null),Ga=null,Tn=null;function ta(e,t,a){ee(Cu,t._currentValue),t._currentValue=a}function Cn(e){e._currentValue=Cu.current,U(Cu)}function Mu(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 zu(e,t,a,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var f=u.dependencies;if(f!==null){var S=u.child;f=f.firstContext;e:for(;f!==null;){var w=f;f=u;for(var O=0;O<t.length;O++)if(w.context===t[O]){f.lanes|=a,w=f.alternate,w!==null&&(w.lanes|=a),Mu(f.return,a,e),i||(S=null);break e}f=w.next}}else if(u.tag===18){if(S=u.return,S===null)throw Error(s(341));S.lanes|=a,f=S.alternate,f!==null&&(f.lanes|=a),Mu(S,a,e),S=null}else S=u.child;if(S!==null)S.return=u;else for(S=u;S!==null;){if(S===e){S=null;break}if(u=S.sibling,u!==null){u.return=S.return,S=u;break}S=S.return}u=S}}function Al(e,t,a,i){e=null;for(var u=t,f=!1;u!==null;){if(!f){if((u.flags&524288)!==0)f=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var S=u.alternate;if(S===null)throw Error(s(387));if(S=S.memoizedProps,S!==null){var w=u.type;Dt(u.pendingProps.value,S.value)||(e!==null?e.push(w):e=[w])}}else if(u===ce.current){if(S=u.alternate,S===null)throw Error(s(387));S.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Pi):e=[Pi])}u=u.return}e!==null&&zu(t,e,a,i),t.flags|=262144}function ls(e){for(e=e.firstContext;e!==null;){if(!Dt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ya(e){Ga=e,Tn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ht(e){return Wd(Ga,e)}function is(e,t){return Ga===null&&Ya(e),Wd(e,t)}function Wd(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Tn===null){if(e===null)throw Error(s(308));Tn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Tn=Tn.next=t;return a}var m1=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()})}},p1=n.unstable_scheduleCallback,y1=n.unstable_NormalPriority,tt={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Du(){return{controller:new m1,data:new Map,refCount:0}}function Ai(e){e.refCount--,e.refCount===0&&p1(y1,function(){e.controller.abort()})}var Ti=null,Ru=0,Tl=0,Cl=null;function v1(e,t){if(Ti===null){var a=Ti=[];Ru=0,Tl=Hc(),Cl={status:"pending",value:void 0,then:function(i){a.push(i)}}}return Ru++,t.then(eh,eh),t}function eh(){if(--Ru===0&&Ti!==null){Cl!==null&&(Cl.status="fulfilled");var e=Ti;Ti=null,Tl=0,Cl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function S1(e,t){var a=[],i={status:"pending",value:null,reason:null,then:function(u){a.push(u)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var u=0;u<a.length;u++)(0,a[u])(t)},function(u){for(i.status="rejected",i.reason=u,u=0;u<a.length;u++)(0,a[u])(void 0)}),i}var th=N.S;N.S=function(e,t){Bg=ft(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&v1(e,t),th!==null&&th(e,t)};var ka=C(null);function Ou(){var e=ka.current;return e!==null?e:Ie.pooledCache}function os(e,t){t===null?ee(ka,ka.current):ee(ka,t.pool)}function nh(){var e=Ou();return e===null?null:{parent:tt._currentValue,pool:e}}var Ml=Error(s(460)),ju=Error(s(474)),ss=Error(s(542)),rs={then:function(){}};function ah(e){return e=e.status,e==="fulfilled"||e==="rejected"}function lh(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(wn,wn),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,oh(e),e;default:if(typeof t.status=="string")t.then(wn,wn);else{if(e=Ie,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=i}},function(i){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,oh(e),e}throw Va=t,Ml}}function Ia(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 ih(){if(Va===null)throw Error(s(459));var e=Va;return Va=null,e}function oh(e){if(e===Ml||e===ss)throw Error(s(483))}var zl=null,Ci=0;function us(e){var t=Ci;return Ci+=1,zl===null&&(zl=[]),lh(zl,e,t)}function Mi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function cs(e,t){throw t.$$typeof===p?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function sh(e){function t(X,q){if(e){var K=X.deletions;K===null?(X.deletions=[q],X.flags|=16):K.push(q)}}function a(X,q){if(!e)return null;for(;q!==null;)t(X,q),q=q.sibling;return null}function i(X){for(var q=new Map;X!==null;)X.key!==null?q.set(X.key,X):q.set(X.index,X),X=X.sibling;return q}function u(X,q){return X=Nn(X,q),X.index=0,X.sibling=null,X}function f(X,q,K){return X.index=K,e?(K=X.alternate,K!==null?(K=K.index,K<q?(X.flags|=67108866,q):K):(X.flags|=67108866,q)):(X.flags|=1048576,q)}function S(X){return e&&X.alternate===null&&(X.flags|=67108866),X}function w(X,q,K,ie){return q===null||q.tag!==6?(q=Eu(K,X.mode,ie),q.return=X,q):(q=u(q,K),q.return=X,q)}function O(X,q,K,ie){var pe=K.type;return pe===M?le(X,q,K.props.children,ie,K.key):q!==null&&(q.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===H&&Ia(pe)===q.type)?(q=u(q,K.props),Mi(q,K),q.return=X,q):(q=ns(K.type,K.key,K.props,null,X.mode,ie),Mi(q,K),q.return=X,q)}function F(X,q,K,ie){return q===null||q.tag!==4||q.stateNode.containerInfo!==K.containerInfo||q.stateNode.implementation!==K.implementation?(q=wu(K,X.mode,ie),q.return=X,q):(q=u(q,K.children||[]),q.return=X,q)}function le(X,q,K,ie,pe){return q===null||q.tag!==7?(q=Ba(K,X.mode,ie,pe),q.return=X,q):(q=u(q,K),q.return=X,q)}function se(X,q,K){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Eu(""+q,X.mode,K),q.return=X,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case x:return K=ns(q.type,q.key,q.props,null,X.mode,K),Mi(K,q),K.return=X,K;case _:return q=wu(q,X.mode,K),q.return=X,q;case H:return q=Ia(q),se(X,q,K)}if(I(q)||P(q))return q=Ba(q,X.mode,K,null),q.return=X,q;if(typeof q.then=="function")return se(X,us(q),K);if(q.$$typeof===E)return se(X,is(X,q),K);cs(X,q)}return null}function J(X,q,K,ie){var pe=q!==null?q.key:null;if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return pe!==null?null:w(X,q,""+K,ie);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case x:return K.key===pe?O(X,q,K,ie):null;case _:return K.key===pe?F(X,q,K,ie):null;case H:return K=Ia(K),J(X,q,K,ie)}if(I(K)||P(K))return pe!==null?null:le(X,q,K,ie,null);if(typeof K.then=="function")return J(X,q,us(K),ie);if(K.$$typeof===E)return J(X,q,is(X,K),ie);cs(X,K)}return null}function W(X,q,K,ie,pe){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return X=X.get(K)||null,w(q,X,""+ie,pe);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:return X=X.get(ie.key===null?K:ie.key)||null,O(q,X,ie,pe);case _:return X=X.get(ie.key===null?K:ie.key)||null,F(q,X,ie,pe);case H:return ie=Ia(ie),W(X,q,K,ie,pe)}if(I(ie)||P(ie))return X=X.get(K)||null,le(q,X,ie,pe,null);if(typeof ie.then=="function")return W(X,q,K,us(ie),pe);if(ie.$$typeof===E)return W(X,q,K,is(q,ie),pe);cs(q,ie)}return null}function he(X,q,K,ie){for(var pe=null,Oe=null,ge=q,_e=q=0,ze=null;ge!==null&&_e<K.length;_e++){ge.index>_e?(ze=ge,ge=null):ze=ge.sibling;var je=J(X,ge,K[_e],ie);if(je===null){ge===null&&(ge=ze);break}e&&ge&&je.alternate===null&&t(X,ge),q=f(je,q,_e),Oe===null?pe=je:Oe.sibling=je,Oe=je,ge=ze}if(_e===K.length)return a(X,ge),De&&An(X,_e),pe;if(ge===null){for(;_e<K.length;_e++)ge=se(X,K[_e],ie),ge!==null&&(q=f(ge,q,_e),Oe===null?pe=ge:Oe.sibling=ge,Oe=ge);return De&&An(X,_e),pe}for(ge=i(ge);_e<K.length;_e++)ze=W(ge,X,_e,K[_e],ie),ze!==null&&(e&&ze.alternate!==null&&ge.delete(ze.key===null?_e:ze.key),q=f(ze,q,_e),Oe===null?pe=ze:Oe.sibling=ze,Oe=ze);return e&&ge.forEach(function(Sa){return t(X,Sa)}),De&&An(X,_e),pe}function ve(X,q,K,ie){if(K==null)throw Error(s(151));for(var pe=null,Oe=null,ge=q,_e=q=0,ze=null,je=K.next();ge!==null&&!je.done;_e++,je=K.next()){ge.index>_e?(ze=ge,ge=null):ze=ge.sibling;var Sa=J(X,ge,je.value,ie);if(Sa===null){ge===null&&(ge=ze);break}e&&ge&&Sa.alternate===null&&t(X,ge),q=f(Sa,q,_e),Oe===null?pe=Sa:Oe.sibling=Sa,Oe=Sa,ge=ze}if(je.done)return a(X,ge),De&&An(X,_e),pe;if(ge===null){for(;!je.done;_e++,je=K.next())je=se(X,je.value,ie),je!==null&&(q=f(je,q,_e),Oe===null?pe=je:Oe.sibling=je,Oe=je);return De&&An(X,_e),pe}for(ge=i(ge);!je.done;_e++,je=K.next())je=W(ge,X,_e,je.value,ie),je!==null&&(e&&je.alternate!==null&&ge.delete(je.key===null?_e:je.key),q=f(je,q,_e),Oe===null?pe=je:Oe.sibling=je,Oe=je);return e&&ge.forEach(function(zS){return t(X,zS)}),De&&An(X,_e),pe}function ke(X,q,K,ie){if(typeof K=="object"&&K!==null&&K.type===M&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case x:e:{for(var pe=K.key;q!==null;){if(q.key===pe){if(pe=K.type,pe===M){if(q.tag===7){a(X,q.sibling),ie=u(q,K.props.children),ie.return=X,X=ie;break e}}else if(q.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===H&&Ia(pe)===q.type){a(X,q.sibling),ie=u(q,K.props),Mi(ie,K),ie.return=X,X=ie;break e}a(X,q);break}else t(X,q);q=q.sibling}K.type===M?(ie=Ba(K.props.children,X.mode,ie,K.key),ie.return=X,X=ie):(ie=ns(K.type,K.key,K.props,null,X.mode,ie),Mi(ie,K),ie.return=X,X=ie)}return S(X);case _:e:{for(pe=K.key;q!==null;){if(q.key===pe)if(q.tag===4&&q.stateNode.containerInfo===K.containerInfo&&q.stateNode.implementation===K.implementation){a(X,q.sibling),ie=u(q,K.children||[]),ie.return=X,X=ie;break e}else{a(X,q);break}else t(X,q);q=q.sibling}ie=wu(K,X.mode,ie),ie.return=X,X=ie}return S(X);case H:return K=Ia(K),ke(X,q,K,ie)}if(I(K))return he(X,q,K,ie);if(P(K)){if(pe=P(K),typeof pe!="function")throw Error(s(150));return K=pe.call(K),ve(X,q,K,ie)}if(typeof K.then=="function")return ke(X,q,us(K),ie);if(K.$$typeof===E)return ke(X,q,is(X,K),ie);cs(X,K)}return typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint"?(K=""+K,q!==null&&q.tag===6?(a(X,q.sibling),ie=u(q,K),ie.return=X,X=ie):(a(X,q),ie=Eu(K,X.mode,ie),ie.return=X,X=ie),S(X)):a(X,q)}return function(X,q,K,ie){try{Ci=0;var pe=ke(X,q,K,ie);return zl=null,pe}catch(ge){if(ge===Ml||ge===ss)throw ge;var Oe=Rt(29,ge,null,X.mode);return Oe.lanes=ie,Oe.return=X,Oe}}}var Xa=sh(!0),rh=sh(!1),na=!1;function Hu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Lu(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 aa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function la(e,t,a){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(He&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=ts(e),Xd(e,null,a),t}return es(e,i,t,a),ts(e)}function zi(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,Oo(e,a)}}function Uu(e,t){var a=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,a===i)){var u=null,f=null;if(a=a.firstBaseUpdate,a!==null){do{var S={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};f===null?u=f=S:f=f.next=S,a=a.next}while(a!==null);f===null?u=f=t:f=f.next=t}else u=f=t;a={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:f,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 Bu=!1;function Di(){if(Bu){var e=Cl;if(e!==null)throw e}}function Ri(e,t,a,i){Bu=!1;var u=e.updateQueue;na=!1;var f=u.firstBaseUpdate,S=u.lastBaseUpdate,w=u.shared.pending;if(w!==null){u.shared.pending=null;var O=w,F=O.next;O.next=null,S===null?f=F:S.next=F,S=O;var le=e.alternate;le!==null&&(le=le.updateQueue,w=le.lastBaseUpdate,w!==S&&(w===null?le.firstBaseUpdate=F:w.next=F,le.lastBaseUpdate=O))}if(f!==null){var se=u.baseState;S=0,le=F=O=null,w=f;do{var J=w.lane&-536870913,W=J!==w.lane;if(W?(Me&J)===J:(i&J)===J){J!==0&&J===Tl&&(Bu=!0),le!==null&&(le=le.next={lane:0,tag:w.tag,payload:w.payload,callback:null,next:null});e:{var he=e,ve=w;J=t;var ke=a;switch(ve.tag){case 1:if(he=ve.payload,typeof he=="function"){se=he.call(ke,se,J);break e}se=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=ve.payload,J=typeof he=="function"?he.call(ke,se,J):he,J==null)break e;se=v({},se,J);break e;case 2:na=!0}}J=w.callback,J!==null&&(e.flags|=64,W&&(e.flags|=8192),W=u.callbacks,W===null?u.callbacks=[J]:W.push(J))}else W={lane:J,tag:w.tag,payload:w.payload,callback:w.callback,next:null},le===null?(F=le=W,O=se):le=le.next=W,S|=J;if(w=w.next,w===null){if(w=u.shared.pending,w===null)break;W=w,w=W.next,W.next=null,u.lastBaseUpdate=W,u.shared.pending=null}}while(!0);le===null&&(O=se),u.baseState=O,u.firstBaseUpdate=F,u.lastBaseUpdate=le,f===null&&(u.shared.lanes=0),ua|=S,e.lanes=S,e.memoizedState=se}}function uh(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function ch(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)uh(a[e],t)}var Dl=C(null),fs=C(0);function fh(e,t){e=Un,ee(fs,e),ee(Dl,t),Un=e|t.baseLanes}function qu(){ee(fs,Un),ee(Dl,Dl.current)}function Gu(){Un=fs.current,U(Dl),U(fs)}var Ot=C(null),Xt=null;function ia(e){var t=e.alternate;ee(Pe,Pe.current&1),ee(Ot,e),Xt===null&&(t===null||Dl.current!==null||t.memoizedState!==null)&&(Xt=e)}function Yu(e){ee(Pe,Pe.current),ee(Ot,e),Xt===null&&(Xt=e)}function dh(e){e.tag===22?(ee(Pe,Pe.current),ee(Ot,e),Xt===null&&(Xt=e)):oa()}function oa(){ee(Pe,Pe.current),ee(Ot,Ot.current)}function jt(e){U(Ot),Xt===e&&(Xt=null),U(Pe)}var Pe=C(0);function ds(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||$c(a)||Qc(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 Mn=0,Ee=null,Ge=null,nt=null,hs=!1,Rl=!1,Za=!1,gs=0,Oi=0,Ol=null,b1=0;function Fe(){throw Error(s(321))}function ku(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Dt(e[a],t[a]))return!1;return!0}function Iu(e,t,a,i,u,f){return Mn=f,Ee=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,N.H=e===null||e.memoizedState===null?Kh:lc,Za=!1,f=a(i,u),Za=!1,Rl&&(f=gh(t,a,i,u)),hh(e),f}function hh(e){N.H=Li;var t=Ge!==null&&Ge.next!==null;if(Mn=0,nt=Ge=Ee=null,hs=!1,Oi=0,Ol=null,t)throw Error(s(300));e===null||at||(e=e.dependencies,e!==null&&ls(e)&&(at=!0))}function gh(e,t,a,i){Ee=e;var u=0;do{if(Rl&&(Ol=null),Oi=0,Rl=!1,25<=u)throw Error(s(301));if(u+=1,nt=Ge=null,e.updateQueue!=null){var f=e.updateQueue;f.lastEffect=null,f.events=null,f.stores=null,f.memoCache!=null&&(f.memoCache.index=0)}N.H=Fh,f=t(a,i)}while(Rl);return f}function x1(){var e=N.H,t=e.useState()[0];return t=typeof t.then=="function"?ji(t):t,e=e.useState()[0],(Ge!==null?Ge.memoizedState:null)!==e&&(Ee.flags|=1024),t}function Vu(){var e=gs!==0;return gs=0,e}function Xu(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Zu(e){if(hs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}hs=!1}Mn=0,nt=Ge=Ee=null,Rl=!1,Oi=gs=0,Ol=null}function bt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return nt===null?Ee.memoizedState=nt=e:nt=nt.next=e,nt}function We(){if(Ge===null){var e=Ee.alternate;e=e!==null?e.memoizedState:null}else e=Ge.next;var t=nt===null?Ee.memoizedState:nt.next;if(t!==null)nt=t,Ge=e;else{if(e===null)throw Ee.alternate===null?Error(s(467)):Error(s(310));Ge=e,e={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},nt===null?Ee.memoizedState=nt=e:nt=nt.next=e}return nt}function ms(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ji(e){var t=Oi;return Oi+=1,Ol===null&&(Ol=[]),e=lh(Ol,e,t),t=Ee,(nt===null?t.memoizedState:nt.next)===null&&(t=t.alternate,N.H=t===null||t.memoizedState===null?Kh:lc),e}function ps(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ji(e);if(e.$$typeof===E)return ht(e)}throw Error(s(438,String(e)))}function $u(e){var t=null,a=Ee.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var i=Ee.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=ms(),Ee.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]=V;return t.index++,a}function zn(e,t){return typeof t=="function"?t(e):t}function ys(e){var t=We();return Qu(t,Ge,e)}function Qu(e,t,a){var i=e.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=a;var u=e.baseQueue,f=i.pending;if(f!==null){if(u!==null){var S=u.next;u.next=f.next,f.next=S}t.baseQueue=u=f,i.pending=null}if(f=e.baseState,u===null)e.memoizedState=f;else{t=u.next;var w=S=null,O=null,F=t,le=!1;do{var se=F.lane&-536870913;if(se!==F.lane?(Me&se)===se:(Mn&se)===se){var J=F.revertLane;if(J===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),se===Tl&&(le=!0);else if((Mn&J)===J){F=F.next,J===Tl&&(le=!0);continue}else se={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},O===null?(w=O=se,S=f):O=O.next=se,Ee.lanes|=J,ua|=J;se=F.action,Za&&a(f,se),f=F.hasEagerState?F.eagerState:a(f,se)}else J={lane:se,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},O===null?(w=O=J,S=f):O=O.next=J,Ee.lanes|=se,ua|=se;F=F.next}while(F!==null&&F!==t);if(O===null?S=f:O.next=w,!Dt(f,e.memoizedState)&&(at=!0,le&&(a=Cl,a!==null)))throw a;e.memoizedState=f,e.baseState=S,e.baseQueue=O,i.lastRenderedState=f}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Ku(e){var t=We(),a=t.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=e;var i=a.dispatch,u=a.pending,f=t.memoizedState;if(u!==null){a.pending=null;var S=u=u.next;do f=e(f,S.action),S=S.next;while(S!==u);Dt(f,t.memoizedState)||(at=!0),t.memoizedState=f,t.baseQueue===null&&(t.baseState=f),a.lastRenderedState=f}return[f,i]}function mh(e,t,a){var i=Ee,u=We(),f=De;if(f){if(a===void 0)throw Error(s(407));a=a()}else a=t();var S=!Dt((Ge||u).memoizedState,a);if(S&&(u.memoizedState=a,at=!0),u=u.queue,Pu(vh.bind(null,i,u,e),[e]),u.getSnapshot!==t||S||nt!==null&&nt.memoizedState.tag&1){if(i.flags|=2048,jl(9,{destroy:void 0},yh.bind(null,i,u,a,t),null),Ie===null)throw Error(s(349));f||(Mn&127)!==0||ph(i,t,a)}return a}function ph(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ee.updateQueue,t===null?(t=ms(),Ee.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function yh(e,t,a,i){t.value=a,t.getSnapshot=i,Sh(t)&&bh(e)}function vh(e,t,a){return a(function(){Sh(t)&&bh(e)})}function Sh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Dt(e,a)}catch{return!0}}function bh(e){var t=Ua(e,2);t!==null&&Ct(t,e,2)}function Fu(e){var t=bt();if(typeof e=="function"){var a=e;if(e=a(),Za){on(!0);try{a()}finally{on(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:e},t}function xh(e,t,a,i){return e.baseState=a,Qu(e,Ge,typeof i=="function"?i:zn)}function E1(e,t,a,i,u){if(bs(e))throw Error(s(485));if(e=t.action,e!==null){var f={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(S){f.listeners.push(S)}};N.T!==null?a(!0):f.isTransition=!1,i(f),a=t.pending,a===null?(f.next=t.pending=f,Eh(t,f)):(f.next=a.next,t.pending=a.next=f)}}function Eh(e,t){var a=t.action,i=t.payload,u=e.state;if(t.isTransition){var f=N.T,S={};N.T=S;try{var w=a(u,i),O=N.S;O!==null&&O(S,w),wh(e,t,w)}catch(F){Ju(e,t,F)}finally{f!==null&&S.types!==null&&(f.types=S.types),N.T=f}}else try{f=a(u,i),wh(e,t,f)}catch(F){Ju(e,t,F)}}function wh(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(i){_h(e,t,i)},function(i){return Ju(e,t,i)}):_h(e,t,a)}function _h(e,t,a){t.status="fulfilled",t.value=a,Nh(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Eh(e,a)))}function Ju(e,t,a){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=a,Nh(t),t=t.next;while(t!==i)}e.action=null}function Nh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ah(e,t){return t}function Th(e,t){if(De){var a=Ie.formState;if(a!==null){e:{var i=Ee;if(De){if(Ve){t:{for(var u=Ve,f=Vt;u.nodeType!==8;){if(!f){u=null;break t}if(u=Zt(u.nextSibling),u===null){u=null;break t}}f=u.data,u=f==="F!"||f==="F"?u:null}if(u){Ve=Zt(u.nextSibling),i=u.data==="F!";break e}}ea(i)}i=!1}i&&(t=a[0])}}return a=bt(),a.memoizedState=a.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ah,lastRenderedState:t},a.queue=i,a=Zh.bind(null,Ee,i),i.dispatch=a,i=Fu(!1),f=ac.bind(null,Ee,!1,i.queue),i=bt(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,a=E1.bind(null,Ee,u,f,a),u.dispatch=a,i.memoizedState=e,[t,a,!1]}function Ch(e){var t=We();return Mh(t,Ge,e)}function Mh(e,t,a){if(t=Qu(e,t,Ah)[0],e=ys(zn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=ji(t)}catch(S){throw S===Ml?ss:S}else i=t;t=We();var u=t.queue,f=u.dispatch;return a!==t.memoizedState&&(Ee.flags|=2048,jl(9,{destroy:void 0},w1.bind(null,u,a),null)),[i,f,e]}function w1(e,t){e.action=t}function zh(e){var t=We(),a=Ge;if(a!==null)return Mh(t,a,e);We(),t=t.memoizedState,a=We();var i=a.queue.dispatch;return a.memoizedState=e,[t,i,!1]}function jl(e,t,a,i){return e={tag:e,create:a,deps:i,inst:t,next:null},t=Ee.updateQueue,t===null&&(t=ms(),Ee.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 Dh(){return We().memoizedState}function vs(e,t,a,i){var u=bt();Ee.flags|=e,u.memoizedState=jl(1|t,{destroy:void 0},a,i===void 0?null:i)}function Ss(e,t,a,i){var u=We();i=i===void 0?null:i;var f=u.memoizedState.inst;Ge!==null&&i!==null&&ku(i,Ge.memoizedState.deps)?u.memoizedState=jl(t,f,a,i):(Ee.flags|=e,u.memoizedState=jl(1|t,f,a,i))}function Rh(e,t){vs(8390656,8,e,t)}function Pu(e,t){Ss(2048,8,e,t)}function _1(e){Ee.flags|=4;var t=Ee.updateQueue;if(t===null)t=ms(),Ee.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Oh(e){var t=We().memoizedState;return _1({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function jh(e,t){return Ss(4,2,e,t)}function Hh(e,t){return Ss(4,4,e,t)}function Lh(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 Uh(e,t,a){a=a!=null?a.concat([e]):null,Ss(4,4,Lh.bind(null,t,e),a)}function Wu(){}function Bh(e,t){var a=We();t=t===void 0?null:t;var i=a.memoizedState;return t!==null&&ku(t,i[1])?i[0]:(a.memoizedState=[e,t],e)}function qh(e,t){var a=We();t=t===void 0?null:t;var i=a.memoizedState;if(t!==null&&ku(t,i[1]))return i[0];if(i=e(),Za){on(!0);try{e()}finally{on(!1)}}return a.memoizedState=[i,t],i}function ec(e,t,a){return a===void 0||(Mn&1073741824)!==0&&(Me&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Gg(),Ee.lanes|=e,ua|=e,a)}function Gh(e,t,a,i){return Dt(a,t)?a:Dl.current!==null?(e=ec(e,a,i),Dt(e,t)||(at=!0),e):(Mn&42)===0||(Mn&1073741824)!==0&&(Me&261930)===0?(at=!0,e.memoizedState=a):(e=Gg(),Ee.lanes|=e,ua|=e,t)}function Yh(e,t,a,i,u){var f=j.p;j.p=f!==0&&8>f?f:8;var S=N.T,w={};N.T=w,ac(e,!1,t,a);try{var O=u(),F=N.S;if(F!==null&&F(w,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var le=S1(O,i);Hi(e,t,le,Ut(e))}else Hi(e,t,i,Ut(e))}catch(se){Hi(e,t,{then:function(){},status:"rejected",reason:se},Ut())}finally{j.p=f,S!==null&&w.types!==null&&(S.types=w.types),N.T=S}}function N1(){}function tc(e,t,a,i){if(e.tag!==5)throw Error(s(476));var u=kh(e).queue;Yh(e,u,t,G,a===null?N1:function(){return Ih(e),a(i)})}function kh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:G},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ih(e){var t=kh(e);t.next===null&&(t=e.alternate.memoizedState),Hi(e,t.next.queue,{},Ut())}function nc(){return ht(Pi)}function Vh(){return We().memoizedState}function Xh(){return We().memoizedState}function A1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Ut();e=aa(a);var i=la(t,e,a);i!==null&&(Ct(i,t,a),zi(i,t,a)),t={cache:Du()},e.payload=t;return}t=t.return}}function T1(e,t,a){var i=Ut();a={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},bs(e)?$h(t,a):(a=bu(e,t,a,i),a!==null&&(Ct(a,e,i),Qh(a,t,i)))}function Zh(e,t,a){var i=Ut();Hi(e,t,a,i)}function Hi(e,t,a,i){var u={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(bs(e))$h(t,u);else{var f=e.alternate;if(e.lanes===0&&(f===null||f.lanes===0)&&(f=t.lastRenderedReducer,f!==null))try{var S=t.lastRenderedState,w=f(S,a);if(u.hasEagerState=!0,u.eagerState=w,Dt(w,S))return es(e,t,u,0),Ie===null&&Wo(),!1}catch{}if(a=bu(e,t,u,i),a!==null)return Ct(a,e,i),Qh(a,t,i),!0}return!1}function ac(e,t,a,i){if(i={lane:2,revertLane:Hc(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},bs(e)){if(t)throw Error(s(479))}else t=bu(e,a,i,2),t!==null&&Ct(t,e,2)}function bs(e){var t=e.alternate;return e===Ee||t!==null&&t===Ee}function $h(e,t){Rl=hs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Qh(e,t,a){if((a&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,Oo(e,a)}}var Li={readContext:ht,use:ps,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useLayoutEffect:Fe,useInsertionEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useSyncExternalStore:Fe,useId:Fe,useHostTransitionStatus:Fe,useFormState:Fe,useActionState:Fe,useOptimistic:Fe,useMemoCache:Fe,useCacheRefresh:Fe};Li.useEffectEvent=Fe;var Kh={readContext:ht,use:ps,useCallback:function(e,t){return bt().memoizedState=[e,t===void 0?null:t],e},useContext:ht,useEffect:Rh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,vs(4194308,4,Lh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return vs(4194308,4,e,t)},useInsertionEffect:function(e,t){vs(4,2,e,t)},useMemo:function(e,t){var a=bt();t=t===void 0?null:t;var i=e();if(Za){on(!0);try{e()}finally{on(!1)}}return a.memoizedState=[i,t],i},useReducer:function(e,t,a){var i=bt();if(a!==void 0){var u=a(t);if(Za){on(!0);try{a(t)}finally{on(!1)}}}else u=t;return i.memoizedState=i.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},i.queue=e,e=e.dispatch=T1.bind(null,Ee,e),[i.memoizedState,e]},useRef:function(e){var t=bt();return e={current:e},t.memoizedState=e},useState:function(e){e=Fu(e);var t=e.queue,a=Zh.bind(null,Ee,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Wu,useDeferredValue:function(e,t){var a=bt();return ec(a,e,t)},useTransition:function(){var e=Fu(!1);return e=Yh.bind(null,Ee,e.queue,!0,!1),bt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var i=Ee,u=bt();if(De){if(a===void 0)throw Error(s(407));a=a()}else{if(a=t(),Ie===null)throw Error(s(349));(Me&127)!==0||ph(i,t,a)}u.memoizedState=a;var f={value:a,getSnapshot:t};return u.queue=f,Rh(vh.bind(null,i,f,e),[e]),i.flags|=2048,jl(9,{destroy:void 0},yh.bind(null,i,f,a,t),null),a},useId:function(){var e=bt(),t=Ie.identifierPrefix;if(De){var a=un,i=rn;a=(i&~(1<<32-St(i)-1)).toString(32)+a,t="_"+t+"R_"+a,a=gs++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=b1++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:nc,useFormState:Th,useActionState:Th,useOptimistic:function(e){var t=bt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=ac.bind(null,Ee,!0,a),a.dispatch=t,[e,t]},useMemoCache:$u,useCacheRefresh:function(){return bt().memoizedState=A1.bind(null,Ee)},useEffectEvent:function(e){var t=bt(),a={impl:e};return t.memoizedState=a,function(){if((He&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},lc={readContext:ht,use:ps,useCallback:Bh,useContext:ht,useEffect:Pu,useImperativeHandle:Uh,useInsertionEffect:jh,useLayoutEffect:Hh,useMemo:qh,useReducer:ys,useRef:Dh,useState:function(){return ys(zn)},useDebugValue:Wu,useDeferredValue:function(e,t){var a=We();return Gh(a,Ge.memoizedState,e,t)},useTransition:function(){var e=ys(zn)[0],t=We().memoizedState;return[typeof e=="boolean"?e:ji(e),t]},useSyncExternalStore:mh,useId:Vh,useHostTransitionStatus:nc,useFormState:Ch,useActionState:Ch,useOptimistic:function(e,t){var a=We();return xh(a,Ge,e,t)},useMemoCache:$u,useCacheRefresh:Xh};lc.useEffectEvent=Oh;var Fh={readContext:ht,use:ps,useCallback:Bh,useContext:ht,useEffect:Pu,useImperativeHandle:Uh,useInsertionEffect:jh,useLayoutEffect:Hh,useMemo:qh,useReducer:Ku,useRef:Dh,useState:function(){return Ku(zn)},useDebugValue:Wu,useDeferredValue:function(e,t){var a=We();return Ge===null?ec(a,e,t):Gh(a,Ge.memoizedState,e,t)},useTransition:function(){var e=Ku(zn)[0],t=We().memoizedState;return[typeof e=="boolean"?e:ji(e),t]},useSyncExternalStore:mh,useId:Vh,useHostTransitionStatus:nc,useFormState:zh,useActionState:zh,useOptimistic:function(e,t){var a=We();return Ge!==null?xh(a,Ge,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:$u,useCacheRefresh:Xh};Fh.useEffectEvent=Oh;function ic(e,t,a,i){t=e.memoizedState,a=a(i,t),a=a==null?t:v({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var oc={enqueueSetState:function(e,t,a){e=e._reactInternals;var i=Ut(),u=aa(i);u.payload=t,a!=null&&(u.callback=a),t=la(e,u,i),t!==null&&(Ct(t,e,i),zi(t,e,i))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var i=Ut(),u=aa(i);u.tag=1,u.payload=t,a!=null&&(u.callback=a),t=la(e,u,i),t!==null&&(Ct(t,e,i),zi(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Ut(),i=aa(a);i.tag=2,t!=null&&(i.callback=t),t=la(e,i,a),t!==null&&(Ct(t,e,a),zi(t,e,a))}};function Jh(e,t,a,i,u,f,S){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,f,S):t.prototype&&t.prototype.isPureReactComponent?!Ei(a,i)||!Ei(u,f):!0}function Ph(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&&oc.enqueueReplaceState(t,t.state,null)}function $a(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=v({},a));for(var u in e)a[u]===void 0&&(a[u]=e[u])}return a}function Wh(e){Po(e)}function eg(e){console.error(e)}function tg(e){Po(e)}function xs(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function ng(e,t,a){try{var i=e.onCaughtError;i(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function sc(e,t,a){return a=aa(a),a.tag=3,a.payload={element:null},a.callback=function(){xs(e,t)},a}function ag(e){return e=aa(e),e.tag=3,e}function lg(e,t,a,i){var u=a.type.getDerivedStateFromError;if(typeof u=="function"){var f=i.value;e.payload=function(){return u(f)},e.callback=function(){ng(t,a,i)}}var S=a.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(e.callback=function(){ng(t,a,i),typeof u!="function"&&(ca===null?ca=new Set([this]):ca.add(this));var w=i.stack;this.componentDidCatch(i.value,{componentStack:w!==null?w:""})})}function C1(e,t,a,i,u){if(a.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=a.alternate,t!==null&&Al(t,a,u,!0),a=Ot.current,a!==null){switch(a.tag){case 31:case 13:return Xt===null?Os():a.alternate===null&&Je===0&&(Je=3),a.flags&=-257,a.flags|=65536,a.lanes=u,i===rs?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([i]):t.add(i),Rc(e,i,u)),!1;case 22:return a.flags|=65536,i===rs?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)),Rc(e,i,u)),!1}throw Error(s(435,a.tag))}return Rc(e,i,u),Os(),!1}if(De)return t=Ot.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==Au&&(e=Error(s(422),{cause:i}),Ni(Yt(e,a)))):(i!==Au&&(t=Error(s(423),{cause:i}),Ni(Yt(t,a))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=Yt(i,a),u=sc(e.stateNode,i,u),Uu(e,u),Je!==4&&(Je=2)),!1;var f=Error(s(520),{cause:i});if(f=Yt(f,a),Vi===null?Vi=[f]:Vi.push(f),Je!==4&&(Je=2),t===null)return!0;i=Yt(i,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=u&-u,a.lanes|=e,e=sc(a.stateNode,i,e),Uu(a,e),!1;case 1:if(t=a.type,f=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(ca===null||!ca.has(f))))return a.flags|=65536,u&=-u,a.lanes|=u,u=ag(u),lg(u,e,a,i),Uu(a,u),!1}a=a.return}while(a!==null);return!1}var rc=Error(s(461)),at=!1;function gt(e,t,a,i){t.child=e===null?rh(t,null,a,i):Xa(t,e.child,a,i)}function ig(e,t,a,i,u){a=a.render;var f=t.ref;if("ref"in i){var S={};for(var w in i)w!=="ref"&&(S[w]=i[w])}else S=i;return Ya(t),i=Iu(e,t,a,S,f,u),w=Vu(),e!==null&&!at?(Xu(e,t,u),Dn(e,t,u)):(De&&w&&_u(t),t.flags|=1,gt(e,t,i,u),t.child)}function og(e,t,a,i,u){if(e===null){var f=a.type;return typeof f=="function"&&!xu(f)&&f.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=f,sg(e,t,f,i,u)):(e=ns(a.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(f=e.child,!pc(e,u)){var S=f.memoizedProps;if(a=a.compare,a=a!==null?a:Ei,a(S,i)&&e.ref===t.ref)return Dn(e,t,u)}return t.flags|=1,e=Nn(f,i),e.ref=t.ref,e.return=t,t.child=e}function sg(e,t,a,i,u){if(e!==null){var f=e.memoizedProps;if(Ei(f,i)&&e.ref===t.ref)if(at=!1,t.pendingProps=i=f,pc(e,u))(e.flags&131072)!==0&&(at=!0);else return t.lanes=e.lanes,Dn(e,t,u)}return uc(e,t,a,i,u)}function rg(e,t,a,i){var u=i.children,f=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(f=f!==null?f.baseLanes|a:a,e!==null){for(i=t.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~f}else i=0,t.child=null;return ug(e,t,f,a,i)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&os(t,f!==null?f.cachePool:null),f!==null?fh(t,f):qu(),dh(t);else return i=t.lanes=536870912,ug(e,t,f!==null?f.baseLanes|a:a,a,i)}else f!==null?(os(t,f.cachePool),fh(t,f),oa(),t.memoizedState=null):(e!==null&&os(t,null),qu(),oa());return gt(e,t,u,a),t.child}function Ui(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function ug(e,t,a,i,u){var f=Ou();return f=f===null?null:{parent:tt._currentValue,pool:f},t.memoizedState={baseLanes:a,cachePool:f},e!==null&&os(t,null),qu(),dh(t),e!==null&&Al(e,t,i,!0),t.childLanes=u,null}function Es(e,t){return t=_s({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function cg(e,t,a){return Xa(t,e.child,null,a),e=Es(t,t.pendingProps),e.flags|=2,jt(t),t.memoizedState=null,e}function M1(e,t,a){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(De){if(i.mode==="hidden")return e=Es(t,i),t.lanes=536870912,Ui(null,e);if(Yu(t),(e=Ve)?(e=Em(e,Vt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pn!==null?{id:rn,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=$d(e),a.return=t,t.child=a,dt=t,Ve=null)):e=null,e===null)throw ea(t);return t.lanes=536870912,null}return Es(t,i)}var f=e.memoizedState;if(f!==null){var S=f.dehydrated;if(Yu(t),u)if(t.flags&256)t.flags&=-257,t=cg(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(at||Al(e,t,a,!1),u=(a&e.childLanes)!==0,at||u){if(i=Ie,i!==null&&(S=jo(i,a),S!==0&&S!==f.retryLane))throw f.retryLane=S,Ua(e,S),Ct(i,e,S),rc;Os(),t=cg(e,t,a)}else e=f.treeContext,Ve=Zt(S.nextSibling),dt=t,De=!0,Wn=null,Vt=!1,e!==null&&Fd(t,e),t=Es(t,i),t.flags|=4096;return t}return e=Nn(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ws(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(s(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function uc(e,t,a,i,u){return Ya(t),a=Iu(e,t,a,i,void 0,u),i=Vu(),e!==null&&!at?(Xu(e,t,u),Dn(e,t,u)):(De&&i&&_u(t),t.flags|=1,gt(e,t,a,u),t.child)}function fg(e,t,a,i,u,f){return Ya(t),t.updateQueue=null,a=gh(t,i,a,u),hh(e),i=Vu(),e!==null&&!at?(Xu(e,t,f),Dn(e,t,f)):(De&&i&&_u(t),t.flags|=1,gt(e,t,a,f),t.child)}function dg(e,t,a,i,u){if(Ya(t),t.stateNode===null){var f=El,S=a.contextType;typeof S=="object"&&S!==null&&(f=ht(S)),f=new a(i,f),t.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,f.updater=oc,t.stateNode=f,f._reactInternals=t,f=t.stateNode,f.props=i,f.state=t.memoizedState,f.refs={},Hu(t),S=a.contextType,f.context=typeof S=="object"&&S!==null?ht(S):El,f.state=t.memoizedState,S=a.getDerivedStateFromProps,typeof S=="function"&&(ic(t,a,S,i),f.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(S=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),S!==f.state&&oc.enqueueReplaceState(f,f.state,null),Ri(t,i,f,u),Di(),f.state=t.memoizedState),typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){f=t.stateNode;var w=t.memoizedProps,O=$a(a,w);f.props=O;var F=f.context,le=a.contextType;S=El,typeof le=="object"&&le!==null&&(S=ht(le));var se=a.getDerivedStateFromProps;le=typeof se=="function"||typeof f.getSnapshotBeforeUpdate=="function",w=t.pendingProps!==w,le||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(w||F!==S)&&Ph(t,f,i,S),na=!1;var J=t.memoizedState;f.state=J,Ri(t,i,f,u),Di(),F=t.memoizedState,w||J!==F||na?(typeof se=="function"&&(ic(t,a,se,i),F=t.memoizedState),(O=na||Jh(t,a,O,i,J,F,S))?(le||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount()),typeof f.componentDidMount=="function"&&(t.flags|=4194308)):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=F),f.props=i,f.state=F,f.context=S,i=O):(typeof f.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{f=t.stateNode,Lu(e,t),S=t.memoizedProps,le=$a(a,S),f.props=le,se=t.pendingProps,J=f.context,F=a.contextType,O=El,typeof F=="object"&&F!==null&&(O=ht(F)),w=a.getDerivedStateFromProps,(F=typeof w=="function"||typeof f.getSnapshotBeforeUpdate=="function")||typeof f.UNSAFE_componentWillReceiveProps!="function"&&typeof f.componentWillReceiveProps!="function"||(S!==se||J!==O)&&Ph(t,f,i,O),na=!1,J=t.memoizedState,f.state=J,Ri(t,i,f,u),Di();var W=t.memoizedState;S!==se||J!==W||na||e!==null&&e.dependencies!==null&&ls(e.dependencies)?(typeof w=="function"&&(ic(t,a,w,i),W=t.memoizedState),(le=na||Jh(t,a,le,i,J,W,O)||e!==null&&e.dependencies!==null&&ls(e.dependencies))?(F||typeof f.UNSAFE_componentWillUpdate!="function"&&typeof f.componentWillUpdate!="function"||(typeof f.componentWillUpdate=="function"&&f.componentWillUpdate(i,W,O),typeof f.UNSAFE_componentWillUpdate=="function"&&f.UNSAFE_componentWillUpdate(i,W,O)),typeof f.componentDidUpdate=="function"&&(t.flags|=4),typeof f.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof f.componentDidUpdate!="function"||S===e.memoizedProps&&J===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&J===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=W),f.props=i,f.state=W,f.context=O,i=le):(typeof f.componentDidUpdate!="function"||S===e.memoizedProps&&J===e.memoizedState||(t.flags|=4),typeof f.getSnapshotBeforeUpdate!="function"||S===e.memoizedProps&&J===e.memoizedState||(t.flags|=1024),i=!1)}return f=i,ws(e,t),i=(t.flags&128)!==0,f||i?(f=t.stateNode,a=i&&typeof a.getDerivedStateFromError!="function"?null:f.render(),t.flags|=1,e!==null&&i?(t.child=Xa(t,e.child,null,u),t.child=Xa(t,null,a,u)):gt(e,t,a,u),t.memoizedState=f.state,e=t.child):e=Dn(e,t,u),e}function hg(e,t,a,i){return qa(),t.flags|=256,gt(e,t,a,i),t.child}var cc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function fc(e){return{baseLanes:e,cachePool:nh()}}function dc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Lt),e}function gg(e,t,a){var i=t.pendingProps,u=!1,f=(t.flags&128)!==0,S;if((S=f)||(S=e!==null&&e.memoizedState===null?!1:(Pe.current&2)!==0),S&&(u=!0,t.flags&=-129),S=(t.flags&32)!==0,t.flags&=-33,e===null){if(De){if(u?ia(t):oa(),(e=Ve)?(e=Em(e,Vt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Pn!==null?{id:rn,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=$d(e),a.return=t,t.child=a,dt=t,Ve=null)):e=null,e===null)throw ea(t);return Qc(e)?t.lanes=32:t.lanes=536870912,null}var w=i.children;return i=i.fallback,u?(oa(),u=t.mode,w=_s({mode:"hidden",children:w},u),i=Ba(i,u,a,null),w.return=t,i.return=t,w.sibling=i,t.child=w,i=t.child,i.memoizedState=fc(a),i.childLanes=dc(e,S,a),t.memoizedState=cc,Ui(null,i)):(ia(t),hc(t,w))}var O=e.memoizedState;if(O!==null&&(w=O.dehydrated,w!==null)){if(f)t.flags&256?(ia(t),t.flags&=-257,t=gc(e,t,a)):t.memoizedState!==null?(oa(),t.child=e.child,t.flags|=128,t=null):(oa(),w=i.fallback,u=t.mode,i=_s({mode:"visible",children:i.children},u),w=Ba(w,u,a,null),w.flags|=2,i.return=t,w.return=t,i.sibling=w,t.child=i,Xa(t,e.child,null,a),i=t.child,i.memoizedState=fc(a),i.childLanes=dc(e,S,a),t.memoizedState=cc,t=Ui(null,i));else if(ia(t),Qc(w)){if(S=w.nextSibling&&w.nextSibling.dataset,S)var F=S.dgst;S=F,i=Error(s(419)),i.stack="",i.digest=S,Ni({value:i,source:null,stack:null}),t=gc(e,t,a)}else if(at||Al(e,t,a,!1),S=(a&e.childLanes)!==0,at||S){if(S=Ie,S!==null&&(i=jo(S,a),i!==0&&i!==O.retryLane))throw O.retryLane=i,Ua(e,i),Ct(S,e,i),rc;$c(w)||Os(),t=gc(e,t,a)}else $c(w)?(t.flags|=192,t.child=e.child,t=null):(e=O.treeContext,Ve=Zt(w.nextSibling),dt=t,De=!0,Wn=null,Vt=!1,e!==null&&Fd(t,e),t=hc(t,i.children),t.flags|=4096);return t}return u?(oa(),w=i.fallback,u=t.mode,O=e.child,F=O.sibling,i=Nn(O,{mode:"hidden",children:i.children}),i.subtreeFlags=O.subtreeFlags&65011712,F!==null?w=Nn(F,w):(w=Ba(w,u,a,null),w.flags|=2),w.return=t,i.return=t,i.sibling=w,t.child=i,Ui(null,i),i=t.child,w=e.child.memoizedState,w===null?w=fc(a):(u=w.cachePool,u!==null?(O=tt._currentValue,u=u.parent!==O?{parent:O,pool:O}:u):u=nh(),w={baseLanes:w.baseLanes|a,cachePool:u}),i.memoizedState=w,i.childLanes=dc(e,S,a),t.memoizedState=cc,Ui(e.child,i)):(ia(t),a=e.child,e=a.sibling,a=Nn(a,{mode:"visible",children:i.children}),a.return=t,a.sibling=null,e!==null&&(S=t.deletions,S===null?(t.deletions=[e],t.flags|=16):S.push(e)),t.child=a,t.memoizedState=null,a)}function hc(e,t){return t=_s({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function _s(e,t){return e=Rt(22,e,null,t),e.lanes=0,e}function gc(e,t,a){return Xa(t,e.child,null,a),e=hc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function mg(e,t,a){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Mu(e.return,t,a)}function mc(e,t,a,i,u,f){var S=e.memoizedState;S===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:a,tailMode:u,treeForkCount:f}:(S.isBackwards=t,S.rendering=null,S.renderingStartTime=0,S.last=i,S.tail=a,S.tailMode=u,S.treeForkCount=f)}function pg(e,t,a){var i=t.pendingProps,u=i.revealOrder,f=i.tail;i=i.children;var S=Pe.current,w=(S&2)!==0;if(w?(S=S&1|2,t.flags|=128):S&=1,ee(Pe,S),gt(e,t,i,a),i=De?_i:0,!w&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&mg(e,a,t);else if(e.tag===19)mg(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(u){case"forwards":for(a=t.child,u=null;a!==null;)e=a.alternate,e!==null&&ds(e)===null&&(u=a),a=a.sibling;a=u,a===null?(u=t.child,t.child=null):(u=a.sibling,a.sibling=null),mc(t,!1,u,a,f,i);break;case"backwards":case"unstable_legacy-backwards":for(a=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&ds(e)===null){t.child=u;break}e=u.sibling,u.sibling=a,a=u,u=e}mc(t,!0,a,null,f,i);break;case"together":mc(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function Dn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),ua|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Al(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,a=Nn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Nn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function pc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ls(e)))}function z1(e,t,a){switch(t.tag){case 3:re(t,t.stateNode.containerInfo),ta(t,tt,e.memoizedState.cache),qa();break;case 27:case 5:we(t);break;case 4:re(t,t.stateNode.containerInfo);break;case 10:ta(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Yu(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(ia(t),t.flags|=128,null):(a&t.child.childLanes)!==0?gg(e,t,a):(ia(t),e=Dn(e,t,a),e!==null?e.sibling:null);ia(t);break;case 19:var u=(e.flags&128)!==0;if(i=(a&t.childLanes)!==0,i||(Al(e,t,a,!1),i=(a&t.childLanes)!==0),u){if(i)return pg(e,t,a);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ee(Pe,Pe.current),i)break;return null;case 22:return t.lanes=0,rg(e,t,a,t.pendingProps);case 24:ta(t,tt,e.memoizedState.cache)}return Dn(e,t,a)}function yg(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)at=!0;else{if(!pc(e,a)&&(t.flags&128)===0)return at=!1,z1(e,t,a);at=(e.flags&131072)!==0}else at=!1,De&&(t.flags&1048576)!==0&&Kd(t,_i,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Ia(t.elementType),t.type=e,typeof e=="function")xu(e)?(i=$a(e,i),t.tag=1,t=dg(null,t,e,i,a)):(t.tag=0,t=uc(null,t,e,i,a));else{if(e!=null){var u=e.$$typeof;if(u===D){t.tag=11,t=ig(null,t,e,i,a);break e}else if(u===L){t.tag=14,t=og(null,t,e,i,a);break e}}throw t=z(e)||e,Error(s(306,t,""))}}return t;case 0:return uc(e,t,t.type,t.pendingProps,a);case 1:return i=t.type,u=$a(i,t.pendingProps),dg(e,t,i,u,a);case 3:e:{if(re(t,t.stateNode.containerInfo),e===null)throw Error(s(387));i=t.pendingProps;var f=t.memoizedState;u=f.element,Lu(e,t),Ri(t,i,null,a);var S=t.memoizedState;if(i=S.cache,ta(t,tt,i),i!==f.cache&&zu(t,[tt],a,!0),Di(),i=S.element,f.isDehydrated)if(f={element:i,isDehydrated:!1,cache:S.cache},t.updateQueue.baseState=f,t.memoizedState=f,t.flags&256){t=hg(e,t,i,a);break e}else if(i!==u){u=Yt(Error(s(424)),t),Ni(u),t=hg(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,Ve=Zt(e.firstChild),dt=t,De=!0,Wn=null,Vt=!0,a=rh(t,null,i,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(qa(),i===u){t=Dn(e,t,a);break e}gt(e,t,i,a)}t=t.child}return t;case 26:return ws(e,t),e===null?(a=Cm(t.type,null,t.pendingProps,null))?t.memoizedState=a:De||(a=t.type,e=t.pendingProps,i=Gs(fe.current).createElement(a),i[ot]=t,i[pt]=e,mt(i,a,e),et(i),t.stateNode=i):t.memoizedState=Cm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return we(t),e===null&&De&&(i=t.stateNode=Nm(t.type,t.pendingProps,fe.current),dt=t,Vt=!0,u=Ve,ga(t.type)?(Kc=u,Ve=Zt(i.firstChild)):Ve=u),gt(e,t,t.pendingProps.children,a),ws(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&De&&((u=i=Ve)&&(i=oS(i,t.type,t.pendingProps,Vt),i!==null?(t.stateNode=i,dt=t,Ve=Zt(i.firstChild),Vt=!1,u=!0):u=!1),u||ea(t)),we(t),u=t.type,f=t.pendingProps,S=e!==null?e.memoizedProps:null,i=f.children,Vc(u,f)?i=null:S!==null&&Vc(u,S)&&(t.flags|=32),t.memoizedState!==null&&(u=Iu(e,t,x1,null,null,a),Pi._currentValue=u),ws(e,t),gt(e,t,i,a),t.child;case 6:return e===null&&De&&((e=a=Ve)&&(a=sS(a,t.pendingProps,Vt),a!==null?(t.stateNode=a,dt=t,Ve=null,e=!0):e=!1),e||ea(t)),null;case 13:return gg(e,t,a);case 4:return re(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Xa(t,null,i,a):gt(e,t,i,a),t.child;case 11:return ig(e,t,t.type,t.pendingProps,a);case 7:return gt(e,t,t.pendingProps,a),t.child;case 8:return gt(e,t,t.pendingProps.children,a),t.child;case 12:return gt(e,t,t.pendingProps.children,a),t.child;case 10:return i=t.pendingProps,ta(t,t.type,i.value),gt(e,t,i.children,a),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,Ya(t),u=ht(u),i=i(u),t.flags|=1,gt(e,t,i,a),t.child;case 14:return og(e,t,t.type,t.pendingProps,a);case 15:return sg(e,t,t.type,t.pendingProps,a);case 19:return pg(e,t,a);case 31:return M1(e,t,a);case 22:return rg(e,t,a,t.pendingProps);case 24:return Ya(t),i=ht(tt),e===null?(u=Ou(),u===null&&(u=Ie,f=Du(),u.pooledCache=f,f.refCount++,f!==null&&(u.pooledCacheLanes|=a),u=f),t.memoizedState={parent:i,cache:u},Hu(t),ta(t,tt,u)):((e.lanes&a)!==0&&(Lu(e,t),Ri(t,null,null,a),Di()),u=e.memoizedState,f=t.memoizedState,u.parent!==i?(u={parent:i,cache:i},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),ta(t,tt,i)):(i=f.cache,ta(t,tt,i),i!==u.cache&&zu(t,[tt],a,!0))),gt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function Rn(e){e.flags|=4}function yc(e,t,a,i,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Vg())e.flags|=8192;else throw Va=rs,ju}else e.flags&=-16777217}function vg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Om(t))if(Vg())e.flags|=8192;else throw Va=rs,ju}function Ns(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Do():536870912,e.lanes|=t,Bl|=t)}function Bi(e,t){if(!De)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 Xe(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,i=0;if(t)for(var u=e.child;u!==null;)a|=u.lanes|u.childLanes,i|=u.subtreeFlags&65011712,i|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)a|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=a,t}function D1(e,t,a){var i=t.pendingProps;switch(Nu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xe(t),null;case 1:return Xe(t),null;case 3:return a=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Cn(tt),de(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Nl(t)?Rn(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Tu())),Xe(t),null;case 26:var u=t.type,f=t.memoizedState;return e===null?(Rn(t),f!==null?(Xe(t),vg(t,f)):(Xe(t),yc(t,u,null,i,a))):f?f!==e.memoizedState?(Rn(t),Xe(t),vg(t,f)):(Xe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&Rn(t),Xe(t),yc(t,u,e,i,a)),null;case 27:if(xe(t),a=fe.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Rn(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return Xe(t),null}e=ae.current,Nl(t)?Jd(t):(e=Nm(u,i,a),t.stateNode=e,Rn(t))}return Xe(t),null;case 5:if(xe(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&Rn(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return Xe(t),null}if(f=ae.current,Nl(t))Jd(t);else{var S=Gs(fe.current);switch(f){case 1:f=S.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:f=S.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":f=S.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":f=S.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":f=S.createElement("div"),f.innerHTML="<script><\/script>",f=f.removeChild(f.firstChild);break;case"select":f=typeof i.is=="string"?S.createElement("select",{is:i.is}):S.createElement("select"),i.multiple?f.multiple=!0:i.size&&(f.size=i.size);break;default:f=typeof i.is=="string"?S.createElement(u,{is:i.is}):S.createElement(u)}}f[ot]=t,f[pt]=i;e:for(S=t.child;S!==null;){if(S.tag===5||S.tag===6)f.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===t)break e;for(;S.sibling===null;){if(S.return===null||S.return===t)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}t.stateNode=f;e:switch(mt(f,u,i),u){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&Rn(t)}}return Xe(t),yc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&Rn(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(s(166));if(e=fe.current,Nl(t)){if(e=t.stateNode,a=t.memoizedProps,i=null,u=dt,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[ot]=t,e=!!(e.nodeValue===a||i!==null&&i.suppressHydrationWarning===!0||gm(e.nodeValue,a)),e||ea(t,!0)}else e=Gs(e).createTextNode(i),e[ot]=t,t.stateNode=e}return Xe(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(i=Nl(t),a!==null){if(e===null){if(!i)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[ot]=t}else qa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xe(t),e=!1}else a=Tu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(jt(t),t):(jt(t),null);if((t.flags&128)!==0)throw Error(s(558))}return Xe(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Nl(t),i!==null&&i.dehydrated!==null){if(e===null){if(!u)throw Error(s(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));u[ot]=t}else qa(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Xe(t),u=!1}else u=Tu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(jt(t),t):(jt(t),null)}return jt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=i!==null,e=e!==null&&e.memoizedState!==null,a&&(i=t.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Ns(t,t.updateQueue),Xe(t),null);case 4:return de(),e===null&&qc(t.stateNode.containerInfo),Xe(t),null;case 10:return Cn(t.type),Xe(t),null;case 19:if(U(Pe),i=t.memoizedState,i===null)return Xe(t),null;if(u=(t.flags&128)!==0,f=i.rendering,f===null)if(u)Bi(i,!1);else{if(Je!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(f=ds(e),f!==null){for(t.flags|=128,Bi(i,!1),e=f.updateQueue,t.updateQueue=e,Ns(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Zd(a,e),a=a.sibling;return ee(Pe,Pe.current&1|2),De&&An(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&ft()>zs&&(t.flags|=128,u=!0,Bi(i,!1),t.lanes=4194304)}else{if(!u)if(e=ds(f),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Ns(t,e),Bi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!f.alternate&&!De)return Xe(t),null}else 2*ft()-i.renderingStartTime>zs&&a!==536870912&&(t.flags|=128,u=!0,Bi(i,!1),t.lanes=4194304);i.isBackwards?(f.sibling=t.child,t.child=f):(e=i.last,e!==null?e.sibling=f:t.child=f,i.last=f)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=ft(),e.sibling=null,a=Pe.current,ee(Pe,u?a&1|2:a&1),De&&An(t,i.treeForkCount),e):(Xe(t),null);case 22:case 23:return jt(t),Gu(),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&&(Xe(t),t.subtreeFlags&6&&(t.flags|=8192)):Xe(t),a=t.updateQueue,a!==null&&Ns(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&&U(ka),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Cn(tt),Xe(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function R1(e,t){switch(Nu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Cn(tt),de(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if(jt(t),t.alternate===null)throw Error(s(340));qa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));qa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return U(Pe),null;case 4:return de(),null;case 10:return Cn(t.type),null;case 22:case 23:return jt(t),Gu(),e!==null&&U(ka),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Cn(tt),null;case 25:return null;default:return null}}function Sg(e,t){switch(Nu(t),t.tag){case 3:Cn(tt),de();break;case 26:case 27:case 5:xe(t);break;case 4:de();break;case 31:t.memoizedState!==null&&jt(t);break;case 13:jt(t);break;case 19:U(Pe);break;case 10:Cn(t.type);break;case 22:case 23:jt(t),Gu(),e!==null&&U(ka);break;case 24:Cn(tt)}}function qi(e,t){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var u=i.next;a=u;do{if((a.tag&e)===e){i=void 0;var f=a.create,S=a.inst;i=f(),S.destroy=i}a=a.next}while(a!==u)}}catch(w){Be(t,t.return,w)}}function sa(e,t,a){try{var i=t.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var f=u.next;i=f;do{if((i.tag&e)===e){var S=i.inst,w=S.destroy;if(w!==void 0){S.destroy=void 0,u=t;var O=a,F=w;try{F()}catch(le){Be(u,O,le)}}}i=i.next}while(i!==f)}}catch(le){Be(t,t.return,le)}}function bg(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{ch(t,a)}catch(i){Be(e,e.return,i)}}}function xg(e,t,a){a.props=$a(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(i){Be(e,t,i)}}function Gi(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(u){Be(e,t,u)}}function cn(e,t){var a=e.ref,i=e.refCleanup;if(a!==null)if(typeof i=="function")try{i()}catch(u){Be(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){Be(e,t,u)}else a.current=null}function Eg(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(u){Be(e,e.return,u)}}function vc(e,t,a){try{var i=e.stateNode;eS(i,e.type,a,t),i[pt]=t}catch(u){Be(e,e.return,u)}}function wg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ga(e.type)||e.tag===4}function Sc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||wg(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&&ga(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 bc(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=wn));else if(i!==4&&(i===27&&ga(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(bc(e,t,a),e=e.sibling;e!==null;)bc(e,t,a),e=e.sibling}function As(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&&ga(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(As(e,t,a),e=e.sibling;e!==null;)As(e,t,a),e=e.sibling}function _g(e){var t=e.stateNode,a=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);mt(t,i,a),t[ot]=e,t[pt]=a}catch(f){Be(e,e.return,f)}}var On=!1,lt=!1,xc=!1,Ng=typeof WeakSet=="function"?WeakSet:Set,ut=null;function O1(e,t){if(e=e.containerInfo,kc=$s,e=Ud(e),gu(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 u=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{a.nodeType,f.nodeType}catch{a=null;break e}var S=0,w=-1,O=-1,F=0,le=0,se=e,J=null;t:for(;;){for(var W;se!==a||u!==0&&se.nodeType!==3||(w=S+u),se!==f||i!==0&&se.nodeType!==3||(O=S+i),se.nodeType===3&&(S+=se.nodeValue.length),(W=se.firstChild)!==null;)J=se,se=W;for(;;){if(se===e)break t;if(J===a&&++F===u&&(w=S),J===f&&++le===i&&(O=S),(W=se.nextSibling)!==null)break;se=J,J=se.parentNode}se=W}a=w===-1||O===-1?null:{start:w,end:O}}else a=null}a=a||{start:0,end:0}}else a=null;for(Ic={focusedElem:e,selectionRange:a},$s=!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,f=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++)u=e[a],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&f!==null){e=void 0,a=t,u=f.memoizedProps,f=f.memoizedState,i=a.stateNode;try{var he=$a(a.type,u);e=i.getSnapshotBeforeUpdate(he,f),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)Zc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Zc(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(s(163))}if(e=t.sibling,e!==null){e.return=t.return,ut=e;break}ut=t.return}}function Ag(e,t,a){var i=a.flags;switch(a.tag){case 0:case 11:case 15:Hn(e,a),i&4&&qi(5,a);break;case 1:if(Hn(e,a),i&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(S){Be(a,a.return,S)}else{var u=$a(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(S){Be(a,a.return,S)}}i&64&&bg(a),i&512&&Gi(a,a.return);break;case 3:if(Hn(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{ch(e,t)}catch(S){Be(a,a.return,S)}}break;case 27:t===null&&i&4&&_g(a);case 26:case 5:Hn(e,a),t===null&&i&4&&Eg(a),i&512&&Gi(a,a.return);break;case 12:Hn(e,a);break;case 31:Hn(e,a),i&4&&Mg(e,a);break;case 13:Hn(e,a),i&4&&zg(e,a),i&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=k1.bind(null,a),rS(e,a))));break;case 22:if(i=a.memoizedState!==null||On,!i){t=t!==null&&t.memoizedState!==null||lt,u=On;var f=lt;On=i,(lt=t)&&!f?Ln(e,a,(a.subtreeFlags&8772)!==0):Hn(e,a),On=u,lt=f}break;case 30:break;default:Hn(e,a)}}function Tg(e){var t=e.alternate;t!==null&&(e.alternate=null,Tg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&di(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 Ze=null,_t=!1;function jn(e,t,a){for(a=a.child;a!==null;)Cg(e,t,a),a=a.sibling}function Cg(e,t,a){if(vt&&typeof vt.onCommitFiberUnmount=="function")try{vt.onCommitFiberUnmount(Ca,a)}catch{}switch(a.tag){case 26:lt||cn(a,t),jn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:lt||cn(a,t);var i=Ze,u=_t;ga(a.type)&&(Ze=a.stateNode,_t=!1),jn(e,t,a),Ki(a.stateNode),Ze=i,_t=u;break;case 5:lt||cn(a,t);case 6:if(i=Ze,u=_t,Ze=null,jn(e,t,a),Ze=i,_t=u,Ze!==null)if(_t)try{(Ze.nodeType===9?Ze.body:Ze.nodeName==="HTML"?Ze.ownerDocument.body:Ze).removeChild(a.stateNode)}catch(f){Be(a,t,f)}else try{Ze.removeChild(a.stateNode)}catch(f){Be(a,t,f)}break;case 18:Ze!==null&&(_t?(e=Ze,bm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Zl(e)):bm(Ze,a.stateNode));break;case 4:i=Ze,u=_t,Ze=a.stateNode.containerInfo,_t=!0,jn(e,t,a),Ze=i,_t=u;break;case 0:case 11:case 14:case 15:sa(2,a,t),lt||sa(4,a,t),jn(e,t,a);break;case 1:lt||(cn(a,t),i=a.stateNode,typeof i.componentWillUnmount=="function"&&xg(a,t,i)),jn(e,t,a);break;case 21:jn(e,t,a);break;case 22:lt=(i=lt)||a.memoizedState!==null,jn(e,t,a),lt=i;break;default:jn(e,t,a)}}function Mg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Zl(e)}catch(a){Be(t,t.return,a)}}}function zg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Zl(e)}catch(a){Be(t,t.return,a)}}function j1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Ng),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Ng),t;default:throw Error(s(435,e.tag))}}function Ts(e,t){var a=j1(e);t.forEach(function(i){if(!a.has(i)){a.add(i);var u=I1.bind(null,e,i);i.then(u,u)}})}function Nt(e,t){var a=t.deletions;if(a!==null)for(var i=0;i<a.length;i++){var u=a[i],f=e,S=t,w=S;e:for(;w!==null;){switch(w.tag){case 27:if(ga(w.type)){Ze=w.stateNode,_t=!1;break e}break;case 5:Ze=w.stateNode,_t=!1;break e;case 3:case 4:Ze=w.stateNode.containerInfo,_t=!0;break e}w=w.return}if(Ze===null)throw Error(s(160));Cg(f,S,u),Ze=null,_t=!1,f=u.alternate,f!==null&&(f.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Dg(t,e),t=t.sibling}var Pt=null;function Dg(e,t){var a=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Nt(t,e),At(e),i&4&&(sa(3,e,e.return),qi(3,e),sa(5,e,e.return));break;case 1:Nt(t,e),At(e),i&512&&(lt||a===null||cn(a,a.return)),i&64&&On&&(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 u=Pt;if(Nt(t,e),At(e),i&512&&(lt||a===null||cn(a,a.return)),i&4){var f=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,u=u.ownerDocument||u;t:switch(i){case"title":f=u.getElementsByTagName("title")[0],(!f||f[Da]||f[ot]||f.namespaceURI==="http://www.w3.org/2000/svg"||f.hasAttribute("itemprop"))&&(f=u.createElement(i),u.head.insertBefore(f,u.querySelector("head > title"))),mt(f,i,a),f[ot]=e,et(f),i=f;break e;case"link":var S=Dm("link","href",u).get(i+(a.href||""));if(S){for(var w=0;w<S.length;w++)if(f=S[w],f.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&f.getAttribute("rel")===(a.rel==null?null:a.rel)&&f.getAttribute("title")===(a.title==null?null:a.title)&&f.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){S.splice(w,1);break t}}f=u.createElement(i),mt(f,i,a),u.head.appendChild(f);break;case"meta":if(S=Dm("meta","content",u).get(i+(a.content||""))){for(w=0;w<S.length;w++)if(f=S[w],f.getAttribute("content")===(a.content==null?null:""+a.content)&&f.getAttribute("name")===(a.name==null?null:a.name)&&f.getAttribute("property")===(a.property==null?null:a.property)&&f.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&f.getAttribute("charset")===(a.charSet==null?null:a.charSet)){S.splice(w,1);break t}}f=u.createElement(i),mt(f,i,a),u.head.appendChild(f);break;default:throw Error(s(468,i))}f[ot]=e,et(f),i=f}e.stateNode=i}else Rm(u,e.type,e.stateNode);else e.stateNode=zm(u,i,e.memoizedProps);else f!==i?(f===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):f.count--,i===null?Rm(u,e.type,e.stateNode):zm(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&vc(e,e.memoizedProps,a.memoizedProps)}break;case 27:Nt(t,e),At(e),i&512&&(lt||a===null||cn(a,a.return)),a!==null&&i&4&&vc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Nt(t,e),At(e),i&512&&(lt||a===null||cn(a,a.return)),e.flags&32){u=e.stateNode;try{ml(u,"")}catch(he){Be(e,e.return,he)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,vc(e,u,a!==null?a.memoizedProps:u)),i&1024&&(xc=!0);break;case 6:if(Nt(t,e),At(e),i&4){if(e.stateNode===null)throw Error(s(162));i=e.memoizedProps,a=e.stateNode;try{a.nodeValue=i}catch(he){Be(e,e.return,he)}}break;case 3:if(Is=null,u=Pt,Pt=Ys(t.containerInfo),Nt(t,e),Pt=u,At(e),i&4&&a!==null&&a.memoizedState.isDehydrated)try{Zl(t.containerInfo)}catch(he){Be(e,e.return,he)}xc&&(xc=!1,Rg(e));break;case 4:i=Pt,Pt=Ys(e.stateNode.containerInfo),Nt(t,e),At(e),Pt=i;break;case 12:Nt(t,e),At(e);break;case 31:Nt(t,e),At(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Ts(e,i)));break;case 13:Nt(t,e),At(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ms=ft()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Ts(e,i)));break;case 22:u=e.memoizedState!==null;var O=a!==null&&a.memoizedState!==null,F=On,le=lt;if(On=F||u,lt=le||O,Nt(t,e),lt=le,On=F,At(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(a===null||O||On||lt||Qa(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){O=a=t;try{if(f=O.stateNode,u)S=f.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{w=O.stateNode;var se=O.memoizedProps.style,J=se!=null&&se.hasOwnProperty("display")?se.display:null;w.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(he){Be(O,O.return,he)}}}else if(t.tag===6){if(a===null){O=t;try{O.stateNode.nodeValue=u?"":O.memoizedProps}catch(he){Be(O,O.return,he)}}}else if(t.tag===18){if(a===null){O=t;try{var W=O.stateNode;u?xm(W,!0):xm(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,Ts(e,a))));break;case 19:Nt(t,e),At(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Ts(e,i)));break;case 30:break;case 21:break;default:Nt(t,e),At(e)}}function At(e){var t=e.flags;if(t&2){try{for(var a,i=e.return;i!==null;){if(wg(i)){a=i;break}i=i.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var u=a.stateNode,f=Sc(e);As(e,f,u);break;case 5:var S=a.stateNode;a.flags&32&&(ml(S,""),a.flags&=-33);var w=Sc(e);As(e,w,S);break;case 3:case 4:var O=a.stateNode.containerInfo,F=Sc(e);bc(e,F,O);break;default:throw Error(s(161))}}catch(le){Be(e,e.return,le)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Rg(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Rg(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Hn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Ag(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:sa(4,t,t.return),Qa(t);break;case 1:cn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&xg(t,t.return,a),Qa(t);break;case 27:Ki(t.stateNode);case 26:case 5:cn(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 Ln(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,u=e,f=t,S=f.flags;switch(f.tag){case 0:case 11:case 15:Ln(u,f,a),qi(4,f);break;case 1:if(Ln(u,f,a),i=f,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(F){Be(i,i.return,F)}if(i=f,u=i.updateQueue,u!==null){var w=i.stateNode;try{var O=u.shared.hiddenCallbacks;if(O!==null)for(u.shared.hiddenCallbacks=null,u=0;u<O.length;u++)uh(O[u],w)}catch(F){Be(i,i.return,F)}}a&&S&64&&bg(f),Gi(f,f.return);break;case 27:_g(f);case 26:case 5:Ln(u,f,a),a&&i===null&&S&4&&Eg(f),Gi(f,f.return);break;case 12:Ln(u,f,a);break;case 31:Ln(u,f,a),a&&S&4&&Mg(u,f);break;case 13:Ln(u,f,a),a&&S&4&&zg(u,f);break;case 22:f.memoizedState===null&&Ln(u,f,a),Gi(f,f.return);break;case 30:break;default:Ln(u,f,a)}t=t.sibling}}function Ec(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&&Ai(a))}function wc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ai(e))}function Wt(e,t,a,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Og(e,t,a,i),t=t.sibling}function Og(e,t,a,i){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Wt(e,t,a,i),u&2048&&qi(9,t);break;case 1:Wt(e,t,a,i);break;case 3:Wt(e,t,a,i),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ai(e)));break;case 12:if(u&2048){Wt(e,t,a,i),e=t.stateNode;try{var f=t.memoizedProps,S=f.id,w=f.onPostCommit;typeof w=="function"&&w(S,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(O){Be(t,t.return,O)}}else Wt(e,t,a,i);break;case 31:Wt(e,t,a,i);break;case 13:Wt(e,t,a,i);break;case 23:break;case 22:f=t.stateNode,S=t.alternate,t.memoizedState!==null?f._visibility&2?Wt(e,t,a,i):Yi(e,t):f._visibility&2?Wt(e,t,a,i):(f._visibility|=2,Hl(e,t,a,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&Ec(S,t);break;case 24:Wt(e,t,a,i),u&2048&&wc(t.alternate,t);break;default:Wt(e,t,a,i)}}function Hl(e,t,a,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var f=e,S=t,w=a,O=i,F=S.flags;switch(S.tag){case 0:case 11:case 15:Hl(f,S,w,O,u),qi(8,S);break;case 23:break;case 22:var le=S.stateNode;S.memoizedState!==null?le._visibility&2?Hl(f,S,w,O,u):Yi(f,S):(le._visibility|=2,Hl(f,S,w,O,u)),u&&F&2048&&Ec(S.alternate,S);break;case 24:Hl(f,S,w,O,u),u&&F&2048&&wc(S.alternate,S);break;default:Hl(f,S,w,O,u)}t=t.sibling}}function Yi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,i=t,u=i.flags;switch(i.tag){case 22:Yi(a,i),u&2048&&Ec(i.alternate,i);break;case 24:Yi(a,i),u&2048&&wc(i.alternate,i);break;default:Yi(a,i)}t=t.sibling}}var ki=8192;function Ll(e,t,a){if(e.subtreeFlags&ki)for(e=e.child;e!==null;)jg(e,t,a),e=e.sibling}function jg(e,t,a){switch(e.tag){case 26:Ll(e,t,a),e.flags&ki&&e.memoizedState!==null&&bS(a,Pt,e.memoizedState,e.memoizedProps);break;case 5:Ll(e,t,a);break;case 3:case 4:var i=Pt;Pt=Ys(e.stateNode.containerInfo),Ll(e,t,a),Pt=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=ki,ki=16777216,Ll(e,t,a),ki=i):Ll(e,t,a));break;default:Ll(e,t,a)}}function Hg(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 Ii(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,Ug(i,e)}Hg(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Lg(e),e=e.sibling}function Lg(e){switch(e.tag){case 0:case 11:case 15:Ii(e),e.flags&2048&&sa(9,e,e.return);break;case 3:Ii(e);break;case 12:Ii(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Cs(e)):Ii(e);break;default:Ii(e)}}function Cs(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,Ug(i,e)}Hg(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:sa(8,t,t.return),Cs(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Cs(t));break;default:Cs(t)}e=e.sibling}}function Ug(e,t){for(;ut!==null;){var a=ut;switch(a.tag){case 0:case 11:case 15:sa(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:Ai(a.memoizedState.cache)}if(i=a.child,i!==null)i.return=a,ut=i;else e:for(a=e;ut!==null;){i=ut;var u=i.sibling,f=i.return;if(Tg(i),i===a){ut=null;break e}if(u!==null){u.return=f,ut=u;break e}ut=f}}}var H1={getCacheForType:function(e){var t=ht(tt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return ht(tt).controller.signal}},L1=typeof WeakMap=="function"?WeakMap:Map,He=0,Ie=null,Ae=null,Me=0,Ue=0,Ht=null,ra=!1,Ul=!1,_c=!1,Un=0,Je=0,ua=0,Ka=0,Nc=0,Lt=0,Bl=0,Vi=null,Tt=null,Ac=!1,Ms=0,Bg=0,zs=1/0,Ds=null,ca=null,st=0,fa=null,ql=null,Bn=0,Tc=0,Cc=null,qg=null,Xi=0,Mc=null;function Ut(){return(He&2)!==0&&Me!==0?Me&-Me:N.T!==null?Hc():Ho()}function Gg(){if(Lt===0)if((Me&536870912)===0||De){var e=rl;rl<<=1,(rl&3932160)===0&&(rl=262144),Lt=e}else Lt=536870912;return e=Ot.current,e!==null&&(e.flags|=32),Lt}function Ct(e,t,a){(e===Ie&&(Ue===2||Ue===9)||e.cancelPendingCommit!==null)&&(Gl(e,0),da(e,Me,Lt,!1)),za(e,a),((He&2)===0||e!==Ie)&&(e===Ie&&((He&2)===0&&(Ka|=a),Je===4&&da(e,Me,Lt,!1)),fn(e))}function Yg(e,t,a){if((He&6)!==0)throw Error(s(327));var i=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Ma(e,t),u=i?q1(e,t):Dc(e,t,!0),f=i;do{if(u===0){Ul&&!i&&da(e,t,0,!1);break}else{if(a=e.current.alternate,f&&!U1(a)){u=Dc(e,t,!1),f=!1;continue}if(u===2){if(f=t,e.errorRecoveryDisabledLanes&f)var S=0;else S=e.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){t=S;e:{var w=e;u=Vi;var O=w.current.memoizedState.isDehydrated;if(O&&(Gl(w,S).flags|=256),S=Dc(w,S,!1),S!==2){if(_c&&!O){w.errorRecoveryDisabledLanes|=f,Ka|=f,u=4;break e}f=Tt,Tt=u,f!==null&&(Tt===null?Tt=f:Tt.push.apply(Tt,f))}u=S}if(f=!1,u!==2)continue}}if(u===1){Gl(e,0),da(e,t,0,!0);break}e:{switch(i=e,f=u,f){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:da(i,t,Lt,!ra);break e;case 2:Tt=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(u=Ms+300-ft(),10<u)){if(da(i,t,Lt,!ra),cl(i,0,!0)!==0)break e;Bn=t,i.timeoutHandle=vm(kg.bind(null,i,a,Tt,Ds,Ac,t,Lt,Ka,Bl,ra,f,"Throttled",-0,0),u);break e}kg(i,a,Tt,Ds,Ac,t,Lt,Ka,Bl,ra,f,null,-0,0)}}break}while(!0);fn(e)}function kg(e,t,a,i,u,f,S,w,O,F,le,se,J,W){if(e.timeoutHandle=-1,se=t.subtreeFlags,se&8192||(se&16785408)===16785408){se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:wn},jg(t,f,se);var he=(f&62914560)===f?Ms-ft():(f&4194048)===f?Bg-ft():0;if(he=xS(se,he),he!==null){Bn=f,e.cancelPendingCommit=he(Fg.bind(null,e,t,f,a,i,u,S,w,O,le,se,null,J,W)),da(e,f,S,!F);return}}Fg(e,t,f,a,i,u,S,w,O)}function U1(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 u=a[i],f=u.getSnapshot;u=u.value;try{if(!Dt(f(),u))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 da(e,t,a,i){t&=~Nc,t&=~Ka,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var f=31-St(u),S=1<<f;i[f]=-1,u&=~S}a!==0&&Ro(e,a,t)}function Rs(){return(He&6)===0?(Zi(0),!1):!0}function zc(){if(Ae!==null){if(Ue===0)var e=Ae.return;else e=Ae,Tn=Ga=null,Zu(e),zl=null,Ci=0,e=Ae;for(;e!==null;)Sg(e.alternate,e),e=e.return;Ae=null}}function Gl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,aS(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Bn=0,zc(),Ie=e,Ae=a=Nn(e.current,null),Me=t,Ue=0,Ht=null,ra=!1,Ul=Ma(e,t),_c=!1,Bl=Lt=Nc=Ka=ua=Je=0,Tt=Vi=null,Ac=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var u=31-St(i),f=1<<u;t|=e[u],i&=~f}return Un=t,Wo(),a}function Ig(e,t){Ee=null,N.H=Li,t===Ml||t===ss?(t=ih(),Ue=3):t===ju?(t=ih(),Ue=4):Ue=t===rc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ht=t,Ae===null&&(Je=1,xs(e,Yt(t,e.current)))}function Vg(){var e=Ot.current;return e===null?!0:(Me&4194048)===Me?Xt===null:(Me&62914560)===Me||(Me&536870912)!==0?e===Xt:!1}function Xg(){var e=N.H;return N.H=Li,e===null?Li:e}function Zg(){var e=N.A;return N.A=H1,e}function Os(){Je=4,ra||(Me&4194048)!==Me&&Ot.current!==null||(Ul=!0),(ua&134217727)===0&&(Ka&134217727)===0||Ie===null||da(Ie,Me,Lt,!1)}function Dc(e,t,a){var i=He;He|=2;var u=Xg(),f=Zg();(Ie!==e||Me!==t)&&(Ds=null,Gl(e,t)),t=!1;var S=Je;e:do try{if(Ue!==0&&Ae!==null){var w=Ae,O=Ht;switch(Ue){case 8:zc(),S=6;break e;case 3:case 2:case 9:case 6:Ot.current===null&&(t=!0);var F=Ue;if(Ue=0,Ht=null,Yl(e,w,O,F),a&&Ul){S=0;break e}break;default:F=Ue,Ue=0,Ht=null,Yl(e,w,O,F)}}B1(),S=Je;break}catch(le){Ig(e,le)}while(!0);return t&&e.shellSuspendCounter++,Tn=Ga=null,He=i,N.H=u,N.A=f,Ae===null&&(Ie=null,Me=0,Wo()),S}function B1(){for(;Ae!==null;)$g(Ae)}function q1(e,t){var a=He;He|=2;var i=Xg(),u=Zg();Ie!==e||Me!==t?(Ds=null,zs=ft()+500,Gl(e,t)):Ul=Ma(e,t);e:do try{if(Ue!==0&&Ae!==null){t=Ae;var f=Ht;t:switch(Ue){case 1:Ue=0,Ht=null,Yl(e,t,f,1);break;case 2:case 9:if(ah(f)){Ue=0,Ht=null,Qg(t);break}t=function(){Ue!==2&&Ue!==9||Ie!==e||(Ue=7),fn(e)},f.then(t,t);break e;case 3:Ue=7;break e;case 4:Ue=5;break e;case 7:ah(f)?(Ue=0,Ht=null,Qg(t)):(Ue=0,Ht=null,Yl(e,t,f,7));break;case 5:var S=null;switch(Ae.tag){case 26:S=Ae.memoizedState;case 5:case 27:var w=Ae;if(S?Om(S):w.stateNode.complete){Ue=0,Ht=null;var O=w.sibling;if(O!==null)Ae=O;else{var F=w.return;F!==null?(Ae=F,js(F)):Ae=null}break t}}Ue=0,Ht=null,Yl(e,t,f,5);break;case 6:Ue=0,Ht=null,Yl(e,t,f,6);break;case 8:zc(),Je=6;break e;default:throw Error(s(462))}}G1();break}catch(le){Ig(e,le)}while(!0);return Tn=Ga=null,N.H=i,N.A=u,He=a,Ae!==null?0:(Ie=null,Me=0,Wo(),Je)}function G1(){for(;Ae!==null&&!Na();)$g(Ae)}function $g(e){var t=yg(e.alternate,e,Un);e.memoizedProps=e.pendingProps,t===null?js(e):Ae=t}function Qg(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=fg(a,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=fg(a,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:Zu(t);default:Sg(a,t),t=Ae=Zd(t,Un),t=yg(a,t,Un)}e.memoizedProps=e.pendingProps,t===null?js(e):Ae=t}function Yl(e,t,a,i){Tn=Ga=null,Zu(t),zl=null,Ci=0;var u=t.return;try{if(C1(e,u,t,a,Me)){Je=1,xs(e,Yt(a,e.current)),Ae=null;return}}catch(f){if(u!==null)throw Ae=u,f;Je=1,xs(e,Yt(a,e.current)),Ae=null;return}t.flags&32768?(De||i===1?e=!0:Ul||(Me&536870912)!==0?e=!1:(ra=e=!0,(i===2||i===9||i===3||i===6)&&(i=Ot.current,i!==null&&i.tag===13&&(i.flags|=16384))),Kg(t,e)):js(t)}function js(e){var t=e;do{if((t.flags&32768)!==0){Kg(t,ra);return}e=t.return;var a=D1(t.alternate,t,Un);if(a!==null){Ae=a;return}if(t=t.sibling,t!==null){Ae=t;return}Ae=t=e}while(t!==null);Je===0&&(Je=5)}function Kg(e,t){do{var a=R1(e.alternate,e);if(a!==null){a.flags&=32767,Ae=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=a}while(e!==null);Je=6,Ae=null}function Fg(e,t,a,i,u,f,S,w,O){e.cancelPendingCommit=null;do Hs();while(st!==0);if((He&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(f=t.lanes|t.childLanes,f|=Su,Kr(e,a,f,S,w,O),e===Ie&&(Ae=Ie=null,Me=0),ql=t,fa=e,Bn=a,Tc=f,Cc=u,qg=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,V1(Ta,function(){return tm(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=N.T,N.T=null,u=j.p,j.p=2,S=He,He|=4;try{O1(e,t,a)}finally{He=S,j.p=u,N.T=i}}st=1,Jg(),Pg(),Wg()}}function Jg(){if(st===1){st=0;var e=fa,t=ql,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=N.T,N.T=null;var i=j.p;j.p=2;var u=He;He|=4;try{Dg(t,e);var f=Ic,S=Ud(e.containerInfo),w=f.focusedElem,O=f.selectionRange;if(S!==w&&w&&w.ownerDocument&&Ld(w.ownerDocument.documentElement,w)){if(O!==null&&gu(w)){var F=O.start,le=O.end;if(le===void 0&&(le=F),"selectionStart"in w)w.selectionStart=F,w.selectionEnd=Math.min(le,w.value.length);else{var se=w.ownerDocument||document,J=se&&se.defaultView||window;if(J.getSelection){var W=J.getSelection(),he=w.textContent.length,ve=Math.min(O.start,he),ke=O.end===void 0?ve:Math.min(O.end,he);!W.extend&&ve>ke&&(S=ke,ke=ve,ve=S);var X=Hd(w,ve),q=Hd(w,ke);if(X&&q&&(W.rangeCount!==1||W.anchorNode!==X.node||W.anchorOffset!==X.offset||W.focusNode!==q.node||W.focusOffset!==q.offset)){var K=se.createRange();K.setStart(X.node,X.offset),W.removeAllRanges(),ve>ke?(W.addRange(K),W.extend(q.node,q.offset)):(K.setEnd(q.node,q.offset),W.addRange(K))}}}}for(se=[],W=w;W=W.parentNode;)W.nodeType===1&&se.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof w.focus=="function"&&w.focus(),w=0;w<se.length;w++){var ie=se[w];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}$s=!!kc,Ic=kc=null}finally{He=u,j.p=i,N.T=a}}e.current=t,st=2}}function Pg(){if(st===2){st=0;var e=fa,t=ql,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=N.T,N.T=null;var i=j.p;j.p=2;var u=He;He|=4;try{Ag(e,t.alternate,t)}finally{He=u,j.p=i,N.T=a}}st=3}}function Wg(){if(st===4||st===3){st=0,Aa();var e=fa,t=ql,a=Bn,i=qg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?st=5:(st=0,ql=fa=null,em(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(ca=null),fi(a),t=t.stateNode,vt&&typeof vt.onCommitFiberRoot=="function")try{vt.onCommitFiberRoot(Ca,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=N.T,u=j.p,j.p=2,N.T=null;try{for(var f=e.onRecoverableError,S=0;S<i.length;S++){var w=i[S];f(w.value,{componentStack:w.stack})}}finally{N.T=t,j.p=u}}(Bn&3)!==0&&Hs(),fn(e),u=e.pendingLanes,(a&261930)!==0&&(u&42)!==0?e===Mc?Xi++:(Xi=0,Mc=e):Xi=0,Zi(0)}}function em(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ai(t)))}function Hs(){return Jg(),Pg(),Wg(),tm()}function tm(){if(st!==5)return!1;var e=fa,t=Tc;Tc=0;var a=fi(Bn),i=N.T,u=j.p;try{j.p=32>a?32:a,N.T=null,a=Cc,Cc=null;var f=fa,S=Bn;if(st=0,ql=fa=null,Bn=0,(He&6)!==0)throw Error(s(331));var w=He;if(He|=4,Lg(f.current),Og(f,f.current,S,a),He=w,Zi(0,!1),vt&&typeof vt.onPostCommitFiberRoot=="function")try{vt.onPostCommitFiberRoot(Ca,f)}catch{}return!0}finally{j.p=u,N.T=i,em(e,t)}}function nm(e,t,a){t=Yt(a,t),t=sc(e.stateNode,t,2),e=la(e,t,2),e!==null&&(za(e,2),fn(e))}function Be(e,t,a){if(e.tag===3)nm(e,e,a);else for(;t!==null;){if(t.tag===3){nm(t,e,a);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(ca===null||!ca.has(i))){e=Yt(a,e),a=ag(2),i=la(t,a,2),i!==null&&(lg(a,i,t,e),za(i,2),fn(i));break}}t=t.return}}function Rc(e,t,a){var i=e.pingCache;if(i===null){i=e.pingCache=new L1;var u=new Set;i.set(t,u)}else u=i.get(t),u===void 0&&(u=new Set,i.set(t,u));u.has(a)||(_c=!0,u.add(a),e=Y1.bind(null,e,t,a),t.then(e,e))}function Y1(e,t,a){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ie===e&&(Me&a)===a&&(Je===4||Je===3&&(Me&62914560)===Me&&300>ft()-Ms?(He&2)===0&&Gl(e,0):Nc|=a,Bl===Me&&(Bl=0)),fn(e)}function am(e,t){t===0&&(t=Do()),e=Ua(e,t),e!==null&&(za(e,t),fn(e))}function k1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),am(e,a)}function I1(e,t){var a=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(a=u.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(t),am(e,a)}function V1(e,t){return Kt(e,t)}var Ls=null,kl=null,Oc=!1,Us=!1,jc=!1,ha=0;function fn(e){e!==kl&&e.next===null&&(kl===null?Ls=kl=e:kl=kl.next=e),Us=!0,Oc||(Oc=!0,Z1())}function Zi(e,t){if(!jc&&Us){jc=!0;do for(var a=!1,i=Ls;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var f=0;else{var S=i.suspendedLanes,w=i.pingedLanes;f=(1<<31-St(42|e)+1)-1,f&=u&~(S&~w),f=f&201326741?f&201326741|1:f?f|2:0}f!==0&&(a=!0,sm(i,f))}else f=Me,f=cl(i,i===Ie?f:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(f&3)===0||Ma(i,f)||(a=!0,sm(i,f));i=i.next}while(a);jc=!1}}function X1(){lm()}function lm(){Us=Oc=!1;var e=0;ha!==0&&nS()&&(e=ha);for(var t=ft(),a=null,i=Ls;i!==null;){var u=i.next,f=im(i,t);f===0?(i.next=null,a===null?Ls=u:a.next=u,u===null&&(kl=a)):(a=i,(e!==0||(f&3)!==0)&&(Us=!0)),i=u}st!==0&&st!==5||Zi(e),ha!==0&&(ha=0)}function im(e,t){for(var a=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,f=e.pendingLanes&-62914561;0<f;){var S=31-St(f),w=1<<S,O=u[S];O===-1?((w&a)===0||(w&i)!==0)&&(u[S]=Qr(w,t)):O<=t&&(e.expiredLanes|=w),f&=~w}if(t=Ie,a=Me,a=cl(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&&yn(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&&yn(i),fi(a)){case 2:case 8:a=Xn;break;case 32:a=Ta;break;case 268435456:a=ol;break;default:a=Ta}return i=om.bind(null,e),a=Kt(a,i),e.callbackPriority=t,e.callbackNode=a,t}return i!==null&&i!==null&&yn(i),e.callbackPriority=2,e.callbackNode=null,2}function om(e,t){if(st!==0&&st!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Hs()&&e.callbackNode!==a)return null;var i=Me;return i=cl(e,e===Ie?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Yg(e,i,t),im(e,ft()),e.callbackNode!=null&&e.callbackNode===a?om.bind(null,e):null)}function sm(e,t){if(Hs())return null;Yg(e,t,!0)}function Z1(){lS(function(){(He&6)!==0?Kt(vn,X1):lm()})}function Hc(){if(ha===0){var e=Tl;e===0&&(e=sl,sl<<=1,(sl&261888)===0&&(sl=256)),ha=e}return ha}function rm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Xo(""+e)}function um(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 $1(e,t,a,i,u){if(t==="submit"&&a&&a.stateNode===u){var f=rm((u[pt]||null).action),S=i.submitter;S&&(t=(t=S[pt]||null)?rm(t.formAction):S.getAttribute("formAction"),t!==null&&(f=t,S=null));var w=new Ko("action","action",null,i,u);e.push({event:w,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(ha!==0){var O=S?um(u,S):new FormData(u);tc(a,{pending:!0,data:O,method:u.method,action:f},null,O)}}else typeof f=="function"&&(w.preventDefault(),O=S?um(u,S):new FormData(u),tc(a,{pending:!0,data:O,method:u.method,action:f},f,O))},currentTarget:u}]})}}for(var Lc=0;Lc<vu.length;Lc++){var Uc=vu[Lc],Q1=Uc.toLowerCase(),K1=Uc[0].toUpperCase()+Uc.slice(1);Jt(Q1,"on"+K1)}Jt(Gd,"onAnimationEnd"),Jt(Yd,"onAnimationIteration"),Jt(kd,"onAnimationStart"),Jt("dblclick","onDoubleClick"),Jt("focusin","onFocus"),Jt("focusout","onBlur"),Jt(f1,"onTransitionRun"),Jt(d1,"onTransitionStart"),Jt(h1,"onTransitionCancel"),Jt(Id,"onTransitionEnd"),Fn("onMouseEnter",["mouseout","mouseover"]),Fn("onMouseLeave",["mouseout","mouseover"]),Fn("onPointerEnter",["pointerout","pointerover"]),Fn("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 $i="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(" "),F1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat($i));function cm(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var i=e[a],u=i.event;i=i.listeners;e:{var f=void 0;if(t)for(var S=i.length-1;0<=S;S--){var w=i[S],O=w.instance,F=w.currentTarget;if(w=w.listener,O!==f&&u.isPropagationStopped())break e;f=w,u.currentTarget=F;try{f(u)}catch(le){Po(le)}u.currentTarget=null,f=O}else for(S=0;S<i.length;S++){if(w=i[S],O=w.instance,F=w.currentTarget,w=w.listener,O!==f&&u.isPropagationStopped())break e;f=w,u.currentTarget=F;try{f(u)}catch(le){Po(le)}u.currentTarget=null,f=O}}}}function Te(e,t){var a=t[fl];a===void 0&&(a=t[fl]=new Set);var i=e+"__bubble";a.has(i)||(fm(t,e,2,!1),a.add(i))}function Bc(e,t,a){var i=0;t&&(i|=4),fm(a,e,i,t)}var Bs="_reactListening"+Math.random().toString(36).slice(2);function qc(e){if(!e[Bs]){e[Bs]=!0,qo.forEach(function(a){a!=="selectionchange"&&(F1.has(a)||Bc(a,!1,e),Bc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Bs]||(t[Bs]=!0,Bc("selectionchange",!1,t))}}function fm(e,t,a,i){switch(Gm(t)){case 2:var u=_S;break;case 8:u=NS;break;default:u=ef}a=u.bind(null,t,a,e),u=void 0,!iu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(t,a,{capture:!0,passive:u}):e.addEventListener(t,a,!0):u!==void 0?e.addEventListener(t,a,{passive:u}):e.addEventListener(t,a,!1)}function Gc(e,t,a,i,u){var f=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var S=i.tag;if(S===3||S===4){var w=i.stateNode.containerInfo;if(w===u)break;if(S===4)for(S=i.return;S!==null;){var O=S.tag;if((O===3||O===4)&&S.stateNode.containerInfo===u)return;S=S.return}for(;w!==null;){if(S=Zn(w),S===null)return;if(O=S.tag,O===5||O===6||O===26||O===27){i=f=S;continue e}w=w.parentNode}}i=i.return}pd(function(){var F=f,le=au(a),se=[];e:{var J=Vd.get(e);if(J!==void 0){var W=Ko,he=e;switch(e){case"keypress":if($o(a)===0)break e;case"keydown":case"keyup":W=Iv;break;case"focusin":he="focus",W=uu;break;case"focusout":he="blur",W=uu;break;case"beforeblur":case"afterblur":W=uu;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":W=Sd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=Dv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=Zv;break;case Gd:case Yd:case kd:W=jv;break;case Id:W=Qv;break;case"scroll":case"scrollend":W=Mv;break;case"wheel":W=Fv;break;case"copy":case"cut":case"paste":W=Lv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=xd;break;case"toggle":case"beforetoggle":W=Pv}var ve=(t&4)!==0,ke=!ve&&(e==="scroll"||e==="scrollend"),X=ve?J!==null?J+"Capture":null:J;ve=[];for(var q=F,K;q!==null;){var ie=q;if(K=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||K===null||X===null||(ie=mi(q,X),ie!=null&&ve.push(Qi(q,ie,K))),ke)break;q=q.return}0<ve.length&&(J=new W(J,he,null,a,le),se.push({event:J,listeners:ve}))}}if((t&7)===0){e:{if(J=e==="mouseover"||e==="pointerover",W=e==="mouseout"||e==="pointerout",J&&a!==nu&&(he=a.relatedTarget||a.fromElement)&&(Zn(he)||he[bn]))break e;if((W||J)&&(J=le.window===le?le:(J=le.ownerDocument)?J.defaultView||J.parentWindow:window,W?(he=a.relatedTarget||a.toElement,W=F,he=he?Zn(he):null,he!==null&&(ke=c(he),ve=he.tag,he!==ke||ve!==5&&ve!==27&&ve!==6)&&(he=null)):(W=null,he=F),W!==he)){if(ve=Sd,ie="onMouseLeave",X="onMouseEnter",q="mouse",(e==="pointerout"||e==="pointerover")&&(ve=xd,ie="onPointerLeave",X="onPointerEnter",q="pointer"),ke=W==null?J:Qn(W),K=he==null?J:Qn(he),J=new ve(ie,q+"leave",W,a,le),J.target=ke,J.relatedTarget=K,ie=null,Zn(le)===F&&(ve=new ve(X,q+"enter",he,a,le),ve.target=K,ve.relatedTarget=ke,ie=ve),ke=ie,W&&he)t:{for(ve=J1,X=W,q=he,K=0,ie=X;ie;ie=ve(ie))K++;ie=0;for(var pe=q;pe;pe=ve(pe))ie++;for(;0<K-ie;)X=ve(X),K--;for(;0<ie-K;)q=ve(q),ie--;for(;K--;){if(X===q||q!==null&&X===q.alternate){ve=X;break t}X=ve(X),q=ve(q)}ve=null}else ve=null;W!==null&&dm(se,J,W,ve,!1),he!==null&&ke!==null&&dm(se,ke,he,ve,!0)}}e:{if(J=F?Qn(F):window,W=J.nodeName&&J.nodeName.toLowerCase(),W==="select"||W==="input"&&J.type==="file")var Oe=Md;else if(Td(J))if(zd)Oe=r1;else{Oe=o1;var ge=i1}else W=J.nodeName,!W||W.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?F&&tu(F.elementType)&&(Oe=Md):Oe=s1;if(Oe&&(Oe=Oe(e,F))){Cd(se,Oe,a,le);break e}ge&&ge(e,J,F),e==="focusout"&&F&&J.type==="number"&&F.memoizedProps.value!=null&&gi(J,"number",J.value)}switch(ge=F?Qn(F):window,e){case"focusin":(Td(ge)||ge.contentEditable==="true")&&(Sl=ge,mu=F,wi=null);break;case"focusout":wi=mu=Sl=null;break;case"mousedown":pu=!0;break;case"contextmenu":case"mouseup":case"dragend":pu=!1,Bd(se,a,le);break;case"selectionchange":if(c1)break;case"keydown":case"keyup":Bd(se,a,le)}var _e;if(fu)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 vl?Nd(e,a)&&(ze="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ze="onCompositionStart");ze&&(Ed&&a.locale!=="ko"&&(vl||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&vl&&(_e=yd()):(Jn=le,ou="value"in Jn?Jn.value:Jn.textContent,vl=!0)),ge=qs(F,ze),0<ge.length&&(ze=new bd(ze,e,null,a,le),se.push({event:ze,listeners:ge}),_e?ze.data=_e:(_e=Ad(a),_e!==null&&(ze.data=_e)))),(_e=e1?t1(e,a):n1(e,a))&&(ze=qs(F,"onBeforeInput"),0<ze.length&&(ge=new bd("onBeforeInput","beforeinput",null,a,le),se.push({event:ge,listeners:ze}),ge.data=_e)),$1(se,e,F,a,le)}cm(se,t)})}function Qi(e,t,a){return{instance:e,listener:t,currentTarget:a}}function qs(e,t){for(var a=t+"Capture",i=[];e!==null;){var u=e,f=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||f===null||(u=mi(e,a),u!=null&&i.unshift(Qi(e,u,f)),u=mi(e,t),u!=null&&i.push(Qi(e,u,f))),e.tag===3)return i;e=e.return}return[]}function J1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function dm(e,t,a,i,u){for(var f=t._reactName,S=[];a!==null&&a!==i;){var w=a,O=w.alternate,F=w.stateNode;if(w=w.tag,O!==null&&O===i)break;w!==5&&w!==26&&w!==27||F===null||(O=F,u?(F=mi(a,f),F!=null&&S.unshift(Qi(a,F,O))):u||(F=mi(a,f),F!=null&&S.push(Qi(a,F,O)))),a=a.return}S.length!==0&&e.push({event:t,listeners:S})}var P1=/\r\n?/g,W1=/\u0000|\uFFFD/g;function hm(e){return(typeof e=="string"?e:""+e).replace(P1,`
|
|
9
|
-
`).replace(W1,"")}function gm(e,t){return t=hm(t),hm(e)===t}function Ye(e,t,a,i,u,f){switch(a){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||ml(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&ml(e,""+i);break;case"className":hl(e,"class",i);break;case"tabIndex":hl(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":hl(e,a,i);break;case"style":gd(e,i,f);break;case"data":if(t!=="object"){hl(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=Xo(""+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 f=="function"&&(a==="formAction"?(t!=="input"&&Ye(e,t,"name",u.name,u,null),Ye(e,t,"formEncType",u.formEncType,u,null),Ye(e,t,"formMethod",u.formMethod,u,null),Ye(e,t,"formTarget",u.formTarget,u,null)):(Ye(e,t,"encType",u.encType,u,null),Ye(e,t,"method",u.method,u,null),Ye(e,t,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(a);break}i=Xo(""+i),e.setAttribute(a,i);break;case"onClick":i!=null&&(e.onclick=wn);break;case"onScroll":i!=null&&Te("scroll",e);break;case"onScrollEnd":i!=null&&Te("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(a=i.__html,a!=null){if(u.children!=null)throw Error(s(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=Xo(""+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":Te("beforetoggle",e),Te("toggle",e),dl(e,"popover",i);break;case"xlinkActuate":Ft(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Ft(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Ft(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Ft(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Ft(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Ft(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Ft(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Ft(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Ft(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":dl(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=Tv.get(a)||a,dl(e,a,i))}}function Yc(e,t,a,i,u,f){switch(a){case"style":gd(e,i,f);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(a=i.__html,a!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"children":typeof i=="string"?ml(e,i):(typeof i=="number"||typeof i=="bigint")&&ml(e,""+i);break;case"onScroll":i!=null&&Te("scroll",e);break;case"onScrollEnd":i!=null&&Te("scrollend",e);break;case"onClick":i!=null&&(e.onclick=wn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Go.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(u=a.endsWith("Capture"),t=a.slice(2,u?a.length-7:void 0),f=e[pt]||null,f=f!=null?f[a]:null,typeof f=="function"&&e.removeEventListener(t,f,u),typeof i=="function")){typeof f!="function"&&f!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,i,u);break e}a in e?e[a]=i:i===!0?e.setAttribute(a,""):dl(e,a,i)}}}function mt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Te("error",e),Te("load",e);var i=!1,u=!1,f;for(f in a)if(a.hasOwnProperty(f)){var S=a[f];if(S!=null)switch(f){case"src":i=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Ye(e,t,f,S,a,null)}}u&&Ye(e,t,"srcSet",a.srcSet,a,null),i&&Ye(e,t,"src",a.src,a,null);return;case"input":Te("invalid",e);var w=f=S=u=null,O=null,F=null;for(i in a)if(a.hasOwnProperty(i)){var le=a[i];if(le!=null)switch(i){case"name":u=le;break;case"type":S=le;break;case"checked":O=le;break;case"defaultChecked":F=le;break;case"value":f=le;break;case"defaultValue":w=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(s(137,t));break;default:Ye(e,t,i,le,a,null)}}Vo(e,f,w,O,F,S,u,!1);return;case"select":Te("invalid",e),i=S=f=null;for(u in a)if(a.hasOwnProperty(u)&&(w=a[u],w!=null))switch(u){case"value":f=w;break;case"defaultValue":S=w;break;case"multiple":i=w;default:Ye(e,t,u,w,a,null)}t=f,a=S,e.multiple=!!i,t!=null?En(e,!!i,t,!1):a!=null&&En(e,!!i,a,!0);return;case"textarea":Te("invalid",e),f=u=i=null;for(S in a)if(a.hasOwnProperty(S)&&(w=a[S],w!=null))switch(S){case"value":i=w;break;case"defaultValue":u=w;break;case"children":f=w;break;case"dangerouslySetInnerHTML":if(w!=null)throw Error(s(91));break;default:Ye(e,t,S,w,a,null)}dd(e,i,u,f);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":Te("beforetoggle",e),Te("toggle",e),Te("cancel",e),Te("close",e);break;case"iframe":case"object":Te("load",e);break;case"video":case"audio":for(i=0;i<$i.length;i++)Te($i[i],e);break;case"image":Te("error",e),Te("load",e);break;case"details":Te("toggle",e);break;case"embed":case"source":case"link":Te("error",e),Te("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(F in a)if(a.hasOwnProperty(F)&&(i=a[F],i!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Ye(e,t,F,i,a,null)}return;default:if(tu(t)){for(le in a)a.hasOwnProperty(le)&&(i=a[le],i!==void 0&&Yc(e,t,le,i,a,void 0));return}}for(w in a)a.hasOwnProperty(w)&&(i=a[w],i!=null&&Ye(e,t,w,i,a,null))}function eS(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 u=null,f=null,S=null,w=null,O=null,F=null,le=null;for(W in a){var se=a[W];if(a.hasOwnProperty(W)&&se!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":O=se;default:i.hasOwnProperty(W)||Ye(e,t,W,null,i,se)}}for(var J in i){var W=i[J];if(se=a[J],i.hasOwnProperty(J)&&(W!=null||se!=null))switch(J){case"type":f=W;break;case"name":u=W;break;case"checked":F=W;break;case"defaultChecked":le=W;break;case"value":S=W;break;case"defaultValue":w=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(s(137,t));break;default:W!==se&&Ye(e,t,J,W,i,se)}}Oa(e,S,w,O,F,le,f,u);return;case"select":W=S=w=J=null;for(f in a)if(O=a[f],a.hasOwnProperty(f)&&O!=null)switch(f){case"value":break;case"multiple":W=O;default:i.hasOwnProperty(f)||Ye(e,t,f,null,i,O)}for(u in i)if(f=i[u],O=a[u],i.hasOwnProperty(u)&&(f!=null||O!=null))switch(u){case"value":J=f;break;case"defaultValue":w=f;break;case"multiple":S=f;default:f!==O&&Ye(e,t,u,f,i,O)}t=w,a=S,i=W,J!=null?En(e,!!a,J,!1):!!i!=!!a&&(t!=null?En(e,!!a,t,!0):En(e,!!a,a?[]:"",!1));return;case"textarea":W=J=null;for(w in a)if(u=a[w],a.hasOwnProperty(w)&&u!=null&&!i.hasOwnProperty(w))switch(w){case"value":break;case"children":break;default:Ye(e,t,w,null,i,u)}for(S in i)if(u=i[S],f=a[S],i.hasOwnProperty(S)&&(u!=null||f!=null))switch(S){case"value":J=u;break;case"defaultValue":W=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(s(91));break;default:u!==f&&Ye(e,t,S,u,i,f)}fd(e,J,W);return;case"option":for(var he in a)J=a[he],a.hasOwnProperty(he)&&J!=null&&!i.hasOwnProperty(he)&&(he==="selected"?e.selected=!1:Ye(e,t,he,null,i,J));for(O in i)J=i[O],W=a[O],i.hasOwnProperty(O)&&J!==W&&(J!=null||W!=null)&&(O==="selected"?e.selected=J&&typeof J!="function"&&typeof J!="symbol":Ye(e,t,O,J,i,W));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)J=a[ve],a.hasOwnProperty(ve)&&J!=null&&!i.hasOwnProperty(ve)&&Ye(e,t,ve,null,i,J);for(F in i)if(J=i[F],W=a[F],i.hasOwnProperty(F)&&J!==W&&(J!=null||W!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(s(137,t));break;default:Ye(e,t,F,J,i,W)}return;default:if(tu(t)){for(var ke in a)J=a[ke],a.hasOwnProperty(ke)&&J!==void 0&&!i.hasOwnProperty(ke)&&Yc(e,t,ke,void 0,i,J);for(le in i)J=i[le],W=a[le],!i.hasOwnProperty(le)||J===W||J===void 0&&W===void 0||Yc(e,t,le,J,i,W);return}}for(var X in a)J=a[X],a.hasOwnProperty(X)&&J!=null&&!i.hasOwnProperty(X)&&Ye(e,t,X,null,i,J);for(se in i)J=i[se],W=a[se],!i.hasOwnProperty(se)||J===W||J==null&&W==null||Ye(e,t,se,J,i,W)}function mm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function tS(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),i=0;i<a.length;i++){var u=a[i],f=u.transferSize,S=u.initiatorType,w=u.duration;if(f&&w&&mm(S)){for(S=0,w=u.responseEnd,i+=1;i<a.length;i++){var O=a[i],F=O.startTime;if(F>w)break;var le=O.transferSize,se=O.initiatorType;le&&mm(se)&&(O=O.responseEnd,S+=le*(O<w?1:(w-F)/(O-F)))}if(--i,t+=8*(f+S)/(u.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 kc=null,Ic=null;function Gs(e){return e.nodeType===9?e:e.ownerDocument}function pm(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 ym(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 Vc(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 Xc=null;function nS(){var e=window.event;return e&&e.type==="popstate"?e===Xc?!1:(Xc=e,!0):(Xc=null,!1)}var vm=typeof setTimeout=="function"?setTimeout:void 0,aS=typeof clearTimeout=="function"?clearTimeout:void 0,Sm=typeof Promise=="function"?Promise:void 0,lS=typeof queueMicrotask=="function"?queueMicrotask:typeof Sm<"u"?function(e){return Sm.resolve(null).then(e).catch(iS)}:vm;function iS(e){setTimeout(function(){throw e})}function ga(e){return e==="head"}function bm(e,t){var a=t,i=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"||a==="/&"){if(i===0){e.removeChild(u),Zl(t);return}i--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")i++;else if(a==="html")Ki(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Ki(a);for(var f=a.firstChild;f;){var S=f.nextSibling,w=f.nodeName;f[Da]||w==="SCRIPT"||w==="STYLE"||w==="LINK"&&f.rel.toLowerCase()==="stylesheet"||a.removeChild(f),f=S}}else a==="body"&&Ki(e.ownerDocument.body);a=u}while(a);Zl(t)}function xm(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 Zc(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":Zc(a),di(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function oS(e,t,a,i){for(;e.nodeType===1;){var u=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[Da])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(f=e.getAttribute("rel"),f==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(f!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(f=e.getAttribute("src"),(f!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&f&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var f=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===f)return e}else return e;if(e=Zt(e.nextSibling),e===null)break}return null}function sS(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 Em(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 $c(e){return e.data==="$?"||e.data==="$~"}function Qc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function rS(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 Kc=null;function wm(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 _m(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 Nm(e,t,a){switch(t=Gs(a),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function Ki(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);di(e)}var $t=new Map,Am=new Set;function Ys(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var qn=j.d;j.d={f:uS,r:cS,D:fS,C:dS,L:hS,m:gS,X:pS,S:mS,M:yS};function uS(){var e=qn.f(),t=Rs();return e||t}function cS(e){var t=$n(e);t!==null&&t.tag===5&&t.type==="form"?Ih(t):qn.r(e)}var Il=typeof document>"u"?null:document;function Tm(e,t,a){var i=Il;if(i&&typeof t=="string"&&t){var u=Et(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),Am.has(u)||(Am.add(u),e={rel:e,crossOrigin:a,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),mt(t,"link",e),et(t),i.head.appendChild(t)))}}function fS(e){qn.D(e),Tm("dns-prefetch",e,null)}function dS(e,t){qn.C(e,t),Tm("preconnect",e,t)}function hS(e,t,a){qn.L(e,t,a);var i=Il;if(i&&e&&t){var u='link[rel="preload"][as="'+Et(t)+'"]';t==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+Et(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+Et(a.imageSizes)+'"]')):u+='[href="'+Et(e)+'"]';var f=u;switch(t){case"style":f=Vl(e);break;case"script":f=Xl(e)}$t.has(f)||(e=v({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),$t.set(f,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(Fi(f))||t==="script"&&i.querySelector(Ji(f))||(t=i.createElement("link"),mt(t,"link",e),et(t),i.head.appendChild(t)))}}function gS(e,t){qn.m(e,t);var a=Il;if(a&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+Et(i)+'"][href="'+Et(e)+'"]',f=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":f=Xl(e)}if(!$t.has(f)&&(e=v({rel:"modulepreload",href:e},t),$t.set(f,e),a.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ji(f)))return}i=a.createElement("link"),mt(i,"link",e),et(i),a.head.appendChild(i)}}}function mS(e,t,a){qn.S(e,t,a);var i=Il;if(i&&e){var u=Kn(i).hoistableStyles,f=Vl(e);t=t||"default";var S=u.get(f);if(!S){var w={loading:0,preload:null};if(S=i.querySelector(Fi(f)))w.loading=5;else{e=v({rel:"stylesheet",href:e,"data-precedence":t},a),(a=$t.get(f))&&Fc(e,a);var O=S=i.createElement("link");et(O),mt(O,"link",e),O._p=new Promise(function(F,le){O.onload=F,O.onerror=le}),O.addEventListener("load",function(){w.loading|=1}),O.addEventListener("error",function(){w.loading|=2}),w.loading|=4,ks(S,t,i)}S={type:"stylesheet",instance:S,count:1,state:w},u.set(f,S)}}}function pS(e,t){qn.X(e,t);var a=Il;if(a&&e){var i=Kn(a).hoistableScripts,u=Xl(e),f=i.get(u);f||(f=a.querySelector(Ji(u)),f||(e=v({src:e,async:!0},t),(t=$t.get(u))&&Jc(e,t),f=a.createElement("script"),et(f),mt(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function yS(e,t){qn.M(e,t);var a=Il;if(a&&e){var i=Kn(a).hoistableScripts,u=Xl(e),f=i.get(u);f||(f=a.querySelector(Ji(u)),f||(e=v({src:e,async:!0,type:"module"},t),(t=$t.get(u))&&Jc(e,t),f=a.createElement("script"),et(f),mt(f,"link",e),a.head.appendChild(f)),f={type:"script",instance:f,count:1,state:null},i.set(u,f))}}function Cm(e,t,a,i){var u=(u=fe.current)?Ys(u):null;if(!u)throw Error(s(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(u).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 f=Kn(u).hoistableStyles,S=f.get(e);if(S||(u=u.ownerDocument||u,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},f.set(e,S),(f=u.querySelector(Fi(e)))&&!f._p&&(S.instance=f,S.state.loading=5),$t.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},$t.set(e,a),f||vS(u,e,a,S.state))),t&&i===null)throw Error(s(528,""));return S}if(t&&i!==null)throw Error(s(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Xl(a),a=Kn(u).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(s(444,e))}}function Vl(e){return'href="'+Et(e)+'"'}function Fi(e){return'link[rel="stylesheet"]['+e+"]"}function Mm(e){return v({},e,{"data-precedence":e.precedence,precedence:null})}function vS(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}),mt(t,"link",a),et(t),e.head.appendChild(t))}function Xl(e){return'[src="'+Et(e)+'"]'}function Ji(e){return"script[async]"+e}function zm(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+Et(a.href)+'"]');if(i)return t.instance=i,et(i),i;var u=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),et(i),mt(i,"style",u),ks(i,a.precedence,e),t.instance=i;case"stylesheet":u=Vl(a.href);var f=e.querySelector(Fi(u));if(f)return t.state.loading|=4,t.instance=f,et(f),f;i=Mm(a),(u=$t.get(u))&&Fc(i,u),f=(e.ownerDocument||e).createElement("link"),et(f);var S=f;return S._p=new Promise(function(w,O){S.onload=w,S.onerror=O}),mt(f,"link",i),t.state.loading|=4,ks(f,a.precedence,e),t.instance=f;case"script":return f=Xl(a.src),(u=e.querySelector(Ji(f)))?(t.instance=u,et(u),u):(i=a,(u=$t.get(f))&&(i=v({},a),Jc(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),et(u),mt(u,"link",i),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,ks(i,a.precedence,e));return t.instance}function ks(e,t,a){for(var i=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,f=u,S=0;S<i.length;S++){var w=i[S];if(w.dataset.precedence===t)f=w;else if(f!==u)break}f?f.parentNode.insertBefore(e,f.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Fc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Jc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Is=null;function Dm(e,t,a){if(Is===null){var i=new Map,u=Is=new Map;u.set(a,i)}else u=Is,i=u.get(a),i||(i=new Map,u.set(a,i));if(i.has(e))return i;for(i.set(e,null),a=a.getElementsByTagName(e),u=0;u<a.length;u++){var f=a[u];if(!(f[Da]||f[ot]||e==="link"&&f.getAttribute("rel")==="stylesheet")&&f.namespaceURI!=="http://www.w3.org/2000/svg"){var S=f.getAttribute(t)||"";S=e+S;var w=i.get(S);w?w.push(f):i.set(S,[f])}}return i}function Rm(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function SS(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 Om(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function bS(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 u=Vl(i.href),f=t.querySelector(Fi(u));if(f){t=f._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Vs.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=f,et(f);return}f=t.ownerDocument||t,i=Mm(i),(u=$t.get(u))&&Fc(i,u),f=f.createElement("link"),et(f);var S=f;S._p=new Promise(function(w,O){S.onload=w,S.onerror=O}),mt(f,"link",i),a.instance=f}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Vs.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Pc=0;function xS(e,t){return e.stylesheets&&e.count===0&&Zs(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var i=setTimeout(function(){if(e.stylesheets&&Zs(e,e.stylesheets),e.unsuspend){var f=e.unsuspend;e.unsuspend=null,f()}},6e4+t);0<e.imgBytes&&Pc===0&&(Pc=62500*tS());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zs(e,e.stylesheets),e.unsuspend)){var f=e.unsuspend;e.unsuspend=null,f()}},(e.imgBytes>Pc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function Vs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xs=null;function Zs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xs=new Map,t.forEach(ES,e),Xs=null,Vs.call(e))}function ES(e,t){if(!(t.state.loading&4)){var a=Xs.get(e);if(a)var i=a.get(null);else{a=new Map,Xs.set(e,a);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),f=0;f<u.length;f++){var S=u[f];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(a.set(S.dataset.precedence,S),i=S)}i&&a.set(null,i)}u=t.instance,S=u.getAttribute("data-precedence"),f=a.get(S)||i,f===i&&a.set(null,u),a.set(S,u),this.count++,i=Vs.bind(this),u.addEventListener("load",i),u.addEventListener("error",i),f?f.parentNode.insertBefore(u,f.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Pi={$$typeof:E,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function wS(e,t,a,i,u,f,S,w,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=ui(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ui(0),this.hiddenUpdates=ui(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=f,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function jm(e,t,a,i,u,f,S,w,O,F,le,se){return e=new wS(e,t,a,S,O,F,le,se,w),t=1,f===!0&&(t|=24),f=Rt(3,null,null,t),e.current=f,f.stateNode=e,t=Du(),t.refCount++,e.pooledCache=t,t.refCount++,f.memoizedState={element:i,isDehydrated:a,cache:t},Hu(f),e}function Hm(e){return e?(e=El,e):El}function Lm(e,t,a,i,u,f){u=Hm(u),i.context===null?i.context=u:i.pendingContext=u,i=aa(t),i.payload={element:a},f=f===void 0?null:f,f!==null&&(i.callback=f),a=la(e,i,t),a!==null&&(Ct(a,e,t),zi(a,e,t))}function Um(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Wc(e,t){Um(e,t),(e=e.alternate)&&Um(e,t)}function Bm(e){if(e.tag===13||e.tag===31){var t=Ua(e,67108864);t!==null&&Ct(t,e,67108864),Wc(e,67108864)}}function qm(e){if(e.tag===13||e.tag===31){var t=Ut();t=ci(t);var a=Ua(e,t);a!==null&&Ct(a,e,t),Wc(e,t)}}var $s=!0;function _S(e,t,a,i){var u=N.T;N.T=null;var f=j.p;try{j.p=2,ef(e,t,a,i)}finally{j.p=f,N.T=u}}function NS(e,t,a,i){var u=N.T;N.T=null;var f=j.p;try{j.p=8,ef(e,t,a,i)}finally{j.p=f,N.T=u}}function ef(e,t,a,i){if($s){var u=tf(i);if(u===null)Gc(e,t,i,Qs,a),Ym(e,i);else if(TS(u,e,t,a,i))i.stopPropagation();else if(Ym(e,i),t&4&&-1<AS.indexOf(e)){for(;u!==null;){var f=$n(u);if(f!==null)switch(f.tag){case 3:if(f=f.stateNode,f.current.memoizedState.isDehydrated){var S=Sn(f.pendingLanes);if(S!==0){var w=f;for(w.pendingLanes|=2,w.entangledLanes|=2;S;){var O=1<<31-St(S);w.entanglements[1]|=O,S&=~O}fn(f),(He&6)===0&&(zs=ft()+500,Zi(0))}}break;case 31:case 13:w=Ua(f,2),w!==null&&Ct(w,f,2),Rs(),Wc(f,2)}if(f=tf(i),f===null&&Gc(e,t,i,Qs,a),f===u)break;u=f}u!==null&&i.stopPropagation()}else Gc(e,t,i,null,a)}}function tf(e){return e=au(e),nf(e)}var Qs=null;function nf(e){if(Qs=null,e=Zn(e),e!==null){var t=c(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=g(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 Qs=e,null}function Gm(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(il()){case vn:return 2;case Xn:return 8;case Ta:case kr:return 32;case ol:return 268435456;default:return 32}default:return 32}}var af=!1,ma=null,pa=null,ya=null,Wi=new Map,eo=new Map,va=[],AS="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 Ym(e,t){switch(e){case"focusin":case"focusout":ma=null;break;case"dragenter":case"dragleave":pa=null;break;case"mouseover":case"mouseout":ya=null;break;case"pointerover":case"pointerout":Wi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":eo.delete(t.pointerId)}}function to(e,t,a,i,u,f){return e===null||e.nativeEvent!==f?(e={blockedOn:t,domEventName:a,eventSystemFlags:i,nativeEvent:f,targetContainers:[u]},t!==null&&(t=$n(t),t!==null&&Bm(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function TS(e,t,a,i,u){switch(t){case"focusin":return ma=to(ma,e,t,a,i,u),!0;case"dragenter":return pa=to(pa,e,t,a,i,u),!0;case"mouseover":return ya=to(ya,e,t,a,i,u),!0;case"pointerover":var f=u.pointerId;return Wi.set(f,to(Wi.get(f)||null,e,t,a,i,u)),!0;case"gotpointercapture":return f=u.pointerId,eo.set(f,to(eo.get(f)||null,e,t,a,i,u)),!0}return!1}function km(e){var t=Zn(e.target);if(t!==null){var a=c(t);if(a!==null){if(t=a.tag,t===13){if(t=d(a),t!==null){e.blockedOn=t,Lo(e.priority,function(){qm(a)});return}}else if(t===31){if(t=g(a),t!==null){e.blockedOn=t,Lo(e.priority,function(){qm(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 Ks(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=tf(e.nativeEvent);if(a===null){a=e.nativeEvent;var i=new a.constructor(a.type,a);nu=i,a.target.dispatchEvent(i),nu=null}else return t=$n(a),t!==null&&Bm(t),e.blockedOn=a,!1;t.shift()}return!0}function Im(e,t,a){Ks(e)&&a.delete(t)}function CS(){af=!1,ma!==null&&Ks(ma)&&(ma=null),pa!==null&&Ks(pa)&&(pa=null),ya!==null&&Ks(ya)&&(ya=null),Wi.forEach(Im),eo.forEach(Im)}function Fs(e,t){e.blockedOn===t&&(e.blockedOn=null,af||(af=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,CS)))}var Js=null;function Vm(e){Js!==e&&(Js=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Js===e&&(Js=null);for(var t=0;t<e.length;t+=3){var a=e[t],i=e[t+1],u=e[t+2];if(typeof i!="function"){if(nf(i||a)===null)continue;break}var f=$n(a);f!==null&&(e.splice(t,3),t-=3,tc(f,{pending:!0,data:u,method:a.method,action:i},i,u))}}))}function Zl(e){function t(O){return Fs(O,e)}ma!==null&&Fs(ma,e),pa!==null&&Fs(pa,e),ya!==null&&Fs(ya,e),Wi.forEach(t),eo.forEach(t);for(var a=0;a<va.length;a++){var i=va[a];i.blockedOn===e&&(i.blockedOn=null)}for(;0<va.length&&(a=va[0],a.blockedOn===null);)km(a),a.blockedOn===null&&va.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(i=0;i<a.length;i+=3){var u=a[i],f=a[i+1],S=u[pt]||null;if(typeof f=="function")S||Vm(a);else if(S){var w=null;if(f&&f.hasAttribute("formAction")){if(u=f,S=f[pt]||null)w=S.formAction;else if(nf(u)!==null)continue}else w=S.action;typeof w=="function"?a[i+1]=w:(a.splice(i,3),i-=3),Vm(a)}}}function Xm(){function e(f){f.canIntercept&&f.info==="react-transition"&&f.intercept({handler:function(){return new Promise(function(S){return u=S})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),i||setTimeout(a,20)}function a(){if(!i&&!navigation.transition){var f=navigation.currentEntry;f&&f.url!=null&&navigation.navigate(f.url,{state:f.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,u=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),u!==null&&(u(),u=null)}}}function lf(e){this._internalRoot=e}Ps.prototype.render=lf.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var a=t.current,i=Ut();Lm(a,i,e,t,null,null)},Ps.prototype.unmount=lf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Lm(e.current,2,null,e,null,null),Rs(),t[bn]=null}};function Ps(e){this._internalRoot=e}Ps.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ho();e={blockedOn:null,target:e,priority:t};for(var a=0;a<va.length&&t!==0&&t<va[a].priority;a++);va.splice(a,0,e),a===0&&km(e)}};var Zm=l.version;if(Zm!=="19.2.5")throw Error(s(527,Zm,"19.2.5"));j.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=h(t),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var MS={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:N,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ws=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ws.isDisabled&&Ws.supportsFiber)try{Ca=Ws.inject(MS),vt=Ws}catch{}}return ao.createRoot=function(e,t){if(!r(e))throw Error(s(299));var a=!1,i="",u=Wh,f=eg,S=tg;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(f=t.onCaughtError),t.onRecoverableError!==void 0&&(S=t.onRecoverableError)),t=jm(e,1,!1,null,null,a,i,null,u,f,S,Xm),e[bn]=t.current,qc(e),new lf(t)},ao.hydrateRoot=function(e,t,a){if(!r(e))throw Error(s(299));var i=!1,u="",f=Wh,S=eg,w=tg,O=null;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(f=a.onUncaughtError),a.onCaughtError!==void 0&&(S=a.onCaughtError),a.onRecoverableError!==void 0&&(w=a.onRecoverableError),a.formState!==void 0&&(O=a.formState)),t=jm(e,1,!0,t,a??null,i,u,O,f,S,w,Xm),t.context=Hm(null),a=t.current,i=Ut(),i=ci(i),u=aa(i),u.callback=null,la(a,u,i),a=i,t.current.lanes=a,za(t,a),fn(t),e[bn]=t.current,qc(e),new Ps(t)},ao.version="19.2.5",ao}var np;function BS(){if(np)return rf.exports;np=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(),rf.exports=US(),rf.exports}var qS=BS();const ap=n=>{let l;const o=new Set,s=(h,y)=>{const v=typeof h=="function"?h(l):h;if(!Object.is(v,l)){const p=l;l=y??(typeof v!="object"||v===null)?v:Object.assign({},l,v),o.forEach(x=>x(l,p))}},r=()=>l,g={setState:s,getState:r,getInitialState:()=>m,subscribe:h=>(o.add(h),()=>o.delete(h))},m=l=n(s,r,g);return g},GS=(n=>n?ap(n):ap),YS=n=>n;function kS(n,l=YS){const o=so.useSyncExternalStore(n.subscribe,so.useCallback(()=>l(n.getState()),[n,l]),so.useCallback(()=>l(n.getInitialState()),[n,l]));return so.useDebugValue(o),o}const lp=n=>{const l=GS(n),o=s=>kS(l,s);return Object.assign(o,l),o},IS=(n=>n?lp(n):lp);function ip(n){return Array.isArray(n.images)}async function ct(n,l){const o=await fetch(n,l),s=await o.json().catch(()=>({}));if(!o.ok){const r=s.error,c=s.code,d=typeof r=="string"?r:r?.message??`Request failed: ${o.status}`,g=new Error(d);throw g.status=o.status,typeof r!="string"&&r?.code?g.code=r.code:c&&(g.code=c),typeof s.currentVersion=="number"&&(g.currentVersion=s.currentVersion),g}return s}function df(n){const l=new URLSearchParams;n?.kind&&l.set("kind",n.kind),n?.sessionId&&l.set("sessionId",n.sessionId),n?.includeTerminal&&l.set("includeTerminal","1");const o=l.size>0?`?${l.toString()}`:"";return ct(`/api/inflight${o}`)}async function op(n){await fetch(`/api/inflight/${encodeURIComponent(n)}`,{method:"DELETE"}).catch(()=>{})}function VS(){return ct("/api/oauth/status")}function XS(){return ct("/api/billing")}function ZS(n){return ct("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}function Rf(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),ct(`/api/history?${l.toString()}`)}function $S(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)),ct(`/api/history?${l.toString()}`)}function QS(n){return ct(`/api/history/${encodeURIComponent(n)}`,{method:"DELETE"})}function KS(n,l){return ct(`/api/history/${encodeURIComponent(n)}/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({trashId:l})})}async function FS(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 s=o,r=s?.error?.message??`Request failed: ${l.status}`,c=new Error(r);throw c.code=s?.error?.code,c}return o}function JS(){return ct("/api/sessions")}function PS(n){return ct("/api/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:n})})}function zy(n){return ct(`/api/sessions/${encodeURIComponent(n)}`)}function WS(n,l){return ct(`/api/sessions/${encodeURIComponent(n)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:l})})}function eb(n){return ct(`/api/sessions/${encodeURIComponent(n)}`,{method:"DELETE"})}function tb(n,l,o,s){return ct(`/api/sessions/${encodeURIComponent(n)}/graph`,{method:"PUT",headers:{"Content-Type":"application/json","If-Match":String(l)},body:JSON.stringify({nodes:o,edges:s})})}function nb(n){return ct(`/api/sessions/${encodeURIComponent(n)}/style-sheet`)}function ab(n,l,o){return ct(`/api/sessions/${encodeURIComponent(n)}/style-sheet`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({styleSheet:l,enabled:o})})}function lb(n,l){return ct(`/api/sessions/${encodeURIComponent(n)}/style-sheet/enabled`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:l})})}function ib(n,l,o){return ct(`/api/sessions/${encodeURIComponent(n)}/style-sheet/extract`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({prompt:l,referenceDataUrl:o})})}function ob(n,l=256){return new Promise(o=>{const s=new Image;s.onload=()=>{const r=Math.min(1,l/Math.max(s.width,s.height)),c=document.createElement("canvas");c.width=s.width*r,c.height=s.height*r;const d=c.getContext("2d");if(!d)return o(n);d.drawImage(s,0,0,c.width,c.height),o(c.toDataURL("image/jpeg",.6))},s.onerror=()=>o(n),s.src=n})}const sb={maxB64Bytes:6e6,preserveTransparency:!1,maxEdge:4096,qualityLadder:[.85,.7,.55]},sp=16777216;function rb(n,l,o){let s=n,r=l;if(s<=0||r<=0)return{w:1,h:1};const c=Math.max(s,r);if(c>o){const d=o/c;s=Math.round(s*d),r=Math.round(r*d)}if(s*r>sp){const d=Math.sqrt(sp/(s*r));s=Math.max(1,Math.floor(s*d)),r=Math.max(1,Math.floor(r*d))}return{w:s,h:r}}function hf(n){return new Promise((l,o)=>{const s=new FileReader;s.onload=()=>{typeof s.result=="string"?l(s.result):o(new Error("FileReader returned non-string"))},s.onerror=()=>o(s.error??new Error("FileReader failed")),s.readAsDataURL(n)})}function rp(n,l,o){return new Promise((s,r)=>{n.toBlob(c=>c?s(c):r(new Error("canvas.toBlob returned null")),l,o)})}function gf(n){const l=n.indexOf(",");return l<0?n.length:n.length-l-1}async function up(n,l={}){const o={...sb,...l},s=await hf(n);if(gf(s)<=o.maxB64Bytes)return s;let r;try{r=await createImageBitmap(n)}catch(c){throw new Error("이미지 디코드 실패. JPEG/PNG로 변환 후 다시 시도해 주세요.",{cause:c})}try{const{w:c,h:d}=rb(r.width,r.height,o.maxEdge),g=document.createElement("canvas");g.width=c,g.height=d;const m=g.getContext("2d");if(!m)throw new Error("canvas 2d context unavailable");if(m.drawImage(r,0,0,c,d),o.preserveTransparency){const h=await rp(g,"image/png"),y=await hf(h);if(gf(y)>o.maxB64Bytes)throw new Error("이미지 압축 실패. JPEG/PNG로 미리 변환 후 다시 시도해 주세요.");return y}for(const h of o.qualityLadder){const y=await rp(g,"image/jpeg",h),v=await hf(y);if(gf(v)<=o.maxB64Bytes)return v}throw new Error("이미지 압축 실패. JPEG/PNG로 미리 변환 후 다시 시도해 주세요.")}finally{r.close?.()}}function er(n){const l=(n.type||"").toLowerCase();if(l.includes("heic")||l.includes("heif"))return!0;const o=(n.name||"").toLowerCase();return o.endsWith(".heic")||o.endsWith(".heif")}function cp(n){return(n.type||"").toLowerCase()==="image/png"}const ub={ok:"확인",cancel:"취소",delete:"삭제",close:"닫기"},cb={localStorageFull:"로컬 저장소가 가득 차서 최근 상태가 저장되지 않을 수 있습니다.",refLimitExceeded:"참조 이미지는 최대 5장까지 추가할 수 있습니다. 초과한 이미지는 제외되었습니다.",refTooLarge:"이미지가 너무 큽니다. JPEG/PNG로 미리 변환하거나 해상도를 낮춰 다시 시도해 주세요.",refNotBase64:"이미지 파일이 손상되었거나 지원하지 않는 형식입니다.",refEmpty:"빈 이미지 파일입니다. 다른 파일을 선택해 주세요.",refHeicUnsupported:"HEIC/HEIF는 지원하지 않습니다. JPEG 또는 PNG로 변환 후 다시 시도해 주세요.",noCurrentImageForRef:"참조로 사용할 현재 이미지가 없습니다.",refSlotFull:"참조 이미지 슬롯이 가득 찼습니다. 최대 5장까지 가능합니다.",currentImageLoadFailed:"현재 이미지를 불러오지 못했습니다.",addedCurrentAsRef:"현재 이미지를 참조에 추가했습니다.",sessionLoadFailed:"세션을 불러오지 못했습니다.",sessionCreateFailed:"세션을 만들지 못했습니다.",sessionRenameFailed:"세션 이름을 바꾸지 못했습니다.",sessionDeleteFailed:"세션을 삭제하지 못했습니다.",promptRequired:"프롬프트를 입력하세요.",nodeCreated:"노드 {id} 생성 완료 ({elapsed}초)",nodeCreateFailed:"노드 생성에 실패했습니다.",generatedBatch:"{count}장을 {elapsed}초 만에 생성했습니다.",generatedSingle:"{elapsed}초 만에 생성했습니다.",generateFailed:"생성에 실패했습니다.",sessionReloadedElsewhere:"다른 탭에서 세션이 변경되어 최신 그래프를 다시 불러왔습니다.",promptCopied:"프롬프트를 복사했습니다",imageCopied:"클립보드에 복사했습니다",copyFailed:"복사에 실패했습니다",noPromptToFork:"가져올 프롬프트가 없습니다",forkStarted:"이 이미지의 프롬프트를 가져왔습니다. 수정 후 다시 생성하세요"},fb={queued:"대기 중",streaming:"생성 중",decoding:"마무리 중"},db={title:"크기",width:"가로",height:"세로",hint:"한 변 최소 1024, 최대 3824, 16의 배수, 비율은 최대 3:1",autoLabel:"자동",autoSub:"모델 추천",customLabel:"직접 입력",customSub:"자유 설정"},hb={title:"품질",lowLabel:"낮음",lowSub:"빠름",mediumLabel:"중간",mediumSub:"균형",highLabel:"높음",highSub:"최상"},gb={title:"모더레이션",autoLabel:"자동",autoSub:"표준 필터",lowLabel:"낮음",lowSub:"완화 필터",explain:"자동은 표준 안전 필터를 사용합니다. 낮음은 제한을 조금 완화해 경계선 프롬프트가 더 통과할 수 있습니다."},mb={title:"포맷"},pb={title:"개수"},yb={button:"생성",buttonLoading:"생성 중 ({n})"},vb={label:"API 상태",checking:"확인 중...",offline:"오프라인",remaining:"${remaining} 남음",thisMonth:"이번 달 ${amount}",oauthFree:"OAuth 무료 사용 가능",apiDisabled:"API 키 비활성화됨 (OAuth 전용)",oauthMode:"OAuth 모드"},Sb={openGalleryAria:"갤러리 열기",openGalleryTitle:"전체 갤러리 열기"},bb={closeSettings:"설정 닫기",detailSettings:"세부 설정",toggleShow:"세부 설정 보기",toggleHide:"세부 설정 숨기기",open:"열기",close:"닫기"},xb={label:"프롬프트",refCount:"참조 {count}/{max}",refChipTitle:"참조 이미지 {n}",refChipAlt:"참조 이미지 {n}",refRemoveAria:"참조 이미지 {n} 제거",placeholder:"원하는 이미지를 설명하고, 드래그 앤 드롭이나 붙여넣기로 참조 이미지를 추가할 수 있어요...",placeholderWithRefs:"첨부한 이미지로 무엇을 만들지 설명해 주세요...",attach:"첨부",attachTitle:"참조 이미지 첨부",useCurrent:"현재 결과 사용",useCurrentTitle:"현재 결과를 참조로 사용",style:"스타일",styleTitle:"스타일 일관성 설정 열기",directMode:"Direct",directModeTitle:"프롬프트를 원문 그대로 전달 (Direct 모드)",hint:"Ctrl + Enter로 생성",dropHere:"놓아서 참조 이미지로 추가 ({max}장까지)"},Eb={resultAlt:"생성 결과",tokens:"{n} 토큰"},wb={today:"오늘",yesterday:"어제",thisWeek:"이번 주",earlier:"이전",imageAltFallback:"생성 이미지",deleteTitle:"삭제 (10초 내 복구 가능)",deleteAria:"이미지 삭제",ariaLabel:"이미지 갤러리",title:"갤러리",total:"총 {n}장",totalFiltered:" / 전체 {n}장",sortByAria:"정렬 기준",sortByDate:"날짜",sortBySession:"세션",searchPlaceholder:"프롬프트나 파일명을 검색",searchDisabledPlaceholder:"세션 보기에서는 검색이 비활성화됩니다",closeAria:"갤러리 닫기",closeTitle:"닫기 (Esc)",sessionLabel:"세션 {name}",standalone:"독립 이미지",emptySessions:"아직 저장된 세션이 없습니다.",emptyAll:"아직 생성된 이미지가 없습니다. 먼저 하나 만들어보세요.",noResults:"검색 결과가 없습니다.",deleted:"삭제됨: {filename}",undo:"되돌리기",secondsSuffix:"{n}초"},_b={empty:"비어 있음",pending:"생성 중",reconciling:"동기화 중",reconcilingPhase:"동기화 중 · {phase}",ready:"완료 · {elapsed}s",readyWithSearch:"완료 · {elapsed}s · 검색 {searches}",stale:"오래된 상태",staleWithError:"오래된 상태: {error}",assetMissing:"에셋 누락",assetMissingWithError:"에셋 누락: {error}",error:"오류: {error}",errorUnknown:"알 수 없음",nodeImageAlt:"노드 이미지",noAsset:"에셋 없음",stateStale:"상태 오래됨",noImage:"이미지 없음",editPromptPlaceholder:"수정 프롬프트...",promptPlaceholder:"프롬프트...",regenerate:"다시 생성",generate:"생성",addChild:"자식 추가",duplicateBranch:"브랜치 복제",duplicateBranchTitle:"새 브랜치 루트로 복제",deleteTitle:"삭제",attachRef:"첨부",attachRefTitle:"노드 참조 이미지 첨부",refAlt:"노드 참조 이미지 {n}",removeRef:"참조 이미지 {n} 제거",dropRefs:"이미지를 여기에 놓기",nodeRefsUnsupportedForEdit:"추가 참조 이미지는 현재 루트 노드에서만 지원합니다.",classicRefsParkedTitle:"클래식 참조 이미지가 보관 중입니다",classicRefsParkedBody:"이 이미지는 클래식 작성창용이라 노드 모드 생성에는 사용되지 않습니다.",clearParkedRefs:"보관된 참조 비우기",styleSheetActive:"세션 스타일 시트 적용 중"},Nb={authTitle:"인증 방식",apiLabel:"API 키",oauthNotReady:"OAuth 프록시가 아직 준비되지 않았습니다.",codexLoginRequired:"Codex 로그인이 필요합니다.",codexLoginHint:"터미널에서 `codex login`을 실행한 뒤 이 페이지를 새로고침하세요.",oauthStarting:"OAuth 프록시가 시작 중입니다. 몇 초 후 다시 시도하세요.",serverUnreachable:"서버에 연결할 수 없습니다. 백엔드가 실행 중인지 확인하세요.",apiInvalid:"API 키가 없거나 유효하지 않습니다. 서버의 .env 파일에서 OPENAI_API_KEY를 확인하세요.",availableTitle:"{name} 사용 가능",availableAria:"{name}: 사용 가능",unavailableAria:"{name}: 사용 불가",availableSr:"(사용 가능)",unavailableSr:"(사용 불가)"},Ab={free:"무료",approx:"약 ${amount}",label:"예상 비용"},Tb={download:"다운로드",copyImage:"이미지 복사",copyPrompt:"프롬프트 복사",continueHere:"여기서 이어서",continueHereTitle:"이 이미지의 프롬프트를 가져와 이어서 작업"},Cb={switchTitle:"세션 전환",loading:"불러오는 중...",newSession:"새 세션",newSessionTitle:"새 세션",renameTitle:"이름 변경",renamePrompt:"세션 이름",deleteTitle:"삭제",deleteConfirm:'"{title}" 세션을 삭제할까요? 이 작업은 되돌릴 수 없습니다.',empty:"아직 세션이 없습니다",firstGraph:"첫 번째 그래프",untitled:"제목 없는 세션",assetAbortedError:"생성이 정상적으로 끝나지 않았습니다. 이 노드에서 다시 시도하세요."},Mb={ariaLabel:"UI 모드",classic:"기본",node:"노드"},zb={appName:"이미지 생성기",nodeModeHint:"노드 모드에서는 노드를 눌러 프롬프트를 수정한 뒤 생성하세요. 오른쪽 패널의 설정 (품질/크기)은 새로 만드는 모든 결과에 적용됩니다."},Db={openAria:"설정 열기",openTitle:"설정",closeAria:"설정 닫기",closeTitle:"캔버스로 돌아가기",navAria:"설정 섹션",contentAria:"설정 내용",jumpTo:"{section} 섹션으로 이동",eyebrow:"작업공간 설정",title:"설정",subtitle:"계정, 화면, 앞으로 늘어날 작업공간 옵션을 이곳에 모아 생성 흐름은 가볍게 유지합니다.",sections:{account:{title:"계정",hint:"OAuth 상태"},appearance:{title:"화면",hint:"라이트/다크"},language:{title:"언어",hint:"UI 문구"},future:{title:"예정",hint:"확장 공간"}},account:{primaryEyebrow:"현재 공급자",oauthTitle:"OAuth 사용 중",oauthBody:"현재 생성은 Codex OAuth 세션으로 실행됩니다. 이 빌드에서는 API-Key 생성 모드가 비활성화되어 있습니다.",apiSourceEnv:"OPENAI_API_KEY 감지됨",apiSourceConfig:"config.json API 키 감지됨",apiTitle:"Configured but disabled",apiBody:"env/config에서 API 키를 찾았지만, 지금 ima2-gen은 OAuth 전용으로 동작합니다. 이 상태 표시를 숨기고 싶을 때만 키를 제거하세요.",apiDisabled:"비활성화",apiUnknown:"상태 불명"},appearance:{themeTitle:"테마",themeBody:"이 기기에서 작업공간을 어떤 톤으로 볼지 선택합니다."},language:{title:"언어",body:"생성 프롬프트와 무관하게 인터페이스 언어만 바꿉니다."},future:{title:"나중을 위한 자리",body:"OAuth 복구 도구나 작업공간 옵션이 실제로 필요해지면 이곳에 추가합니다."}},Rb={loading:"세션 불러오는 중...",addFirst:"+ 첫 노드 추가",addRootTitle:"루트 노드 추가",hint:"핸들을 빈 공간으로 드래그하면 새 브랜치가 생깁니다. Delete 또는 Backspace로 삭제할 수 있습니다."},Ob={title:"{provider} 사용 불가",ariaLabel:"{provider} 사용 불가"},jb={label:"언어",ko:"한국어",en:"English"},Hb={label:"테마",system:"시스템",dark:"다크",light:"라이트"},Lb={toggle:"스타일 일관성 적용",extract:"프롬프트에서 추출",extracting:"추출 중…",edit:"편집",save:"저장",cancel:"취소",emptyHint:"아직 스타일 시트가 없어요. 현재 프롬프트에서 추출해서 룩을 고정하세요.",noPrompt:"먼저 프롬프트를 입력하세요",extracted:"스타일 시트가 추출됐어요",editorTitle:"스타일 시트 편집",saved:"스타일 시트를 저장했어요",errNoKey:"스타일 시트 추출에는 OpenAI API 키가 필요해요. setup에서 연결해주세요.",errBadOutput:"모델이 사용 가능한 시트를 못 만들었어요 — 프롬프트를 더 구체적으로 적어주세요.",placeholderMedium:"예: 유화, 시네마틱 사진",placeholderComposition:"예: 중앙 인물, 와이드 풍경",placeholderMood:"예: 시네마틱, 몽환적",placeholderSubject:"예: 빨간 재킷 입은 젊은 여성",placeholderPalette:"#0a0a0a, #f97316, 따뜻한 앰버",placeholderNegative:"blur, 워터마크, 텍스트",fields:{medium:"매체",composition:"구도",mood:"분위기",subject:"피사체 디테일",palette:"팔레트 (쉼표로 구분된 hex 또는 이름)",negative:"네거티브 (쉼표로 구분)"}},Ub={close:"닫기",details:"자세한 원본 오류 보기",unknown:{title:"알 수 없는 오류가 발생했어요",body:"잠시 후 다시 시도해 주세요. 문제가 계속되면 원본 오류 메시지를 복사해 제보해 주세요."},moderationRefused:{title:"프롬프트가 모더레이션에 걸렸어요",body:"표현 수위를 낮추거나 다른 문구로 바꿔 보세요. 레퍼런스 이미지의 선정적/폭력적 요소도 영향을 줄 수 있어요.",cta:"프롬프트 수정"},upstream5xx:{title:"OpenAI 서버가 혼잡합니다",body:"잠시 후 다시 시도하면 대부분 해결돼요. 상태 페이지(status.openai.com)도 확인해 보세요.",cta:"다시 시도"},authChatgptExpired:{title:"Codex ChatGPT 로그인이 만료됐어요",body:"터미널에서 `npx @openai/codex login`을 다시 실행한 뒤 앱을 새로고침해 주세요.",cta:"새로고침"},authApiKeyInvalid:{title:"API 키 인증 실패",body:"키가 잘못됐거나 한도/조직 권한 문제예요. 본 앱은 API-Key 모드가 비활성화되어 있어 OAuth(ChatGPT 로그인)로 전환하는 편이 좋아요.",cta:"확인"},networkFailed:{title:"네트워크 연결 실패",body:"OpenAI/로컬 OAuth 프록시에 연결하지 못했어요. VPN/방화벽이나 `status.openai.com`을 확인해 주세요.",cta:"새로고침"},oauthUnavailable:{title:"OAuth 프록시를 사용할 수 없어요",body:"로컬 OAuth 프록시가 실행 중이 아니에요. `ima2 serve`를 재시작한 뒤 다시 시도해 주세요.",cta:"새로고침"},apikeyDisabled:{title:"API-Key 모드가 비활성화되어 있어요",body:"본 앱은 OAuth(ChatGPT 로그인) 전용으로 동작합니다. 공급자를 OAuth로 전환해 주세요.",cta:"확인"}},Bb={common:ub,toast:cb,inflight:fb,size:db,quality:hb,moderation:gb,format:mb,count:pb,generate:yb,billing:vb,history:Sb,panel:bb,prompt:xb,canvas:Eb,gallery:wb,node:_b,provider:Nb,cost:Ab,result:Tb,session:Cb,uiMode:Mb,sidebar:zb,settings:Db,nodeCanvas:Rb,apiDisabled:Ob,language:jb,theme:Hb,styleSheet:Lb,errorCard:Ub},qb={ok:"OK",cancel:"Cancel",delete:"Delete",close:"Close"},Gb={localStorageFull:"Local storage is full — recent state may not persist.",refLimitExceeded:"References are capped at 5. Extra images were dropped.",refTooLarge:"Image is too large. Convert to JPEG/PNG or lower the resolution and try again.",refNotBase64:"Image file is corrupted or uses an unsupported encoding.",refEmpty:"Empty image file. Please pick a different file.",refHeicUnsupported:"HEIC/HEIF is not supported. Convert to JPEG or PNG and try again.",noCurrentImageForRef:"No current image to use as reference.",refSlotFull:"Reference slots are full (max 5).",currentImageLoadFailed:"Failed to load current image.",addedCurrentAsRef:"Added current image as a reference.",sessionLoadFailed:"Failed to load session.",sessionCreateFailed:"Failed to create session.",sessionRenameFailed:"Failed to rename session.",sessionDeleteFailed:"Failed to delete session.",promptRequired:"Enter a prompt.",nodeCreated:"Node {id} created ({elapsed}s)",nodeCreateFailed:"Node generation failed.",generatedBatch:"Generated {count} images in {elapsed}s.",generatedSingle:"Generated in {elapsed}s.",generateFailed:"Generation failed.",sessionReloadedElsewhere:"Session was changed in another tab — reloaded the latest graph.",promptCopied:"Prompt copied",imageCopied:"Copied to clipboard",copyFailed:"Copy failed",noPromptToFork:"No prompt to fork",forkStarted:"Prompt imported. Edit and generate again."},Yb={queued:"Queued",streaming:"Generating",decoding:"Finalizing"},kb={title:"Size",width:"Width",height:"Height",hint:"Each side 1024–3824, multiple of 16, ratio up to 3:1",autoLabel:"Auto",autoSub:"Model pick",customLabel:"Custom",customSub:"Free form"},Ib={title:"Quality",lowLabel:"Low",lowSub:"Fast",mediumLabel:"Medium",mediumSub:"Balanced",highLabel:"High",highSub:"Best"},Vb={title:"Moderation",autoLabel:"Auto",autoSub:"Standard filter",lowLabel:"Low",lowSub:"Relaxed filter",explain:"Auto uses the standard safety filter. Low relaxes limits so borderline prompts may pass through."},Xb={title:"Format"},Zb={title:"Count"},$b={button:"Generate",buttonLoading:"Generating ({n})"},Qb={label:"API Status",checking:"Checking...",offline:"Offline",remaining:"${remaining} remaining",thisMonth:"${amount} this month",oauthFree:"OAuth · free via codex",apiDisabled:"API key disabled (OAuth only)",oauthMode:"OAuth mode"},Kb={openGalleryAria:"Open gallery",openGalleryTitle:"Open full gallery"},Fb={closeSettings:"Close settings",detailSettings:"Settings",toggleShow:"Show settings",toggleHide:"Hide settings",open:"Open",close:"Close"},Jb={label:"Prompt",refCount:"Refs {count}/{max}",refChipTitle:"Reference {n}",refChipAlt:"Reference {n}",refRemoveAria:"Remove reference {n}",placeholder:"Describe the image you want. Drag & drop or paste to attach reference images...",placeholderWithRefs:"Describe what to do with the attached images...",attach:"Attach",attachTitle:"Attach reference images",useCurrent:"Use current",useCurrentTitle:"Use current result as a reference",style:"Style",styleTitle:"Open style consistency settings",directMode:"Direct",directModeTitle:"Pass prompt through verbatim (Direct mode)",hint:"Ctrl + Enter to generate",dropHere:"Drop to attach as reference (up to {max})"},Pb={resultAlt:"result",tokens:"{n} tokens"},Wb={today:"Today",yesterday:"Yesterday",thisWeek:"This week",earlier:"Earlier",imageAltFallback:"Generated image",deleteTitle:"Delete (10s undo)",deleteAria:"Delete image",ariaLabel:"Image gallery",title:"Gallery",total:"{n} total",totalFiltered:" / {n} total",sortByAria:"Sort by",sortByDate:"Date",sortBySession:"Session",searchPlaceholder:"Search prompts or filenames",searchDisabledPlaceholder:"Search is disabled in session view",closeAria:"Close gallery",closeTitle:"Close (Esc)",sessionLabel:"Session {name}",standalone:"Standalone images",emptySessions:"No sessions saved yet.",emptyAll:"No images yet. Create one first.",noResults:"No results.",deleted:"Deleted: {filename}",undo:"Undo",secondsSuffix:"{n}s"},ex={empty:"Empty",pending:"Generating",reconciling:"Syncing",reconcilingPhase:"Syncing · {phase}",ready:"Done · {elapsed}s",readyWithSearch:"Done · {elapsed}s · searched {searches}",stale:"Stale",staleWithError:"Stale: {error}",assetMissing:"Asset missing",assetMissingWithError:"Asset missing: {error}",error:"Error: {error}",errorUnknown:"unknown",nodeImageAlt:"Node image",noAsset:"No asset",stateStale:"State stale",noImage:"No image",editPromptPlaceholder:"Edit prompt...",promptPlaceholder:"Prompt...",regenerate:"Regenerate",generate:"Generate",addChild:"Add child",duplicateBranch:"Duplicate branch",duplicateBranchTitle:"Duplicate as a new branch root",deleteTitle:"Delete",attachRef:"Attach",attachRefTitle:"Attach node reference images",refAlt:"Node reference {n}",removeRef:"Remove reference {n}",dropRefs:"Drop images here",nodeRefsUnsupportedForEdit:"Extra references are only supported on root nodes for now.",classicRefsParkedTitle:"Classic references are parked",classicRefsParkedBody:"These images belong to the classic composer and are inactive in node mode.",clearParkedRefs:"Clear parked references",styleSheetActive:"Session style sheet active"},tx={authTitle:"Authentication",apiLabel:"API Key",oauthNotReady:"OAuth proxy is not ready yet.",codexLoginRequired:"Codex login required.",codexLoginHint:"Run `codex login` in your terminal, then refresh this page.",oauthStarting:"OAuth proxy is starting. Try again in a few seconds.",serverUnreachable:"Cannot reach the server. Make sure the backend is running.",apiInvalid:"API key is missing or invalid. Check OPENAI_API_KEY in the server's .env.",availableTitle:"{name} available",availableAria:"{name}: available",unavailableAria:"{name}: unavailable",availableSr:"(available)",unavailableSr:"(unavailable)"},nx={free:"free",approx:"~${amount}",label:"Est. cost"},ax={download:"Download",copyImage:"Copy image",copyPrompt:"Copy prompt",continueHere:"Continue here",continueHereTitle:"Import this image's prompt and keep working"},lx={switchTitle:"Switch session",loading:"Loading...",newSession:"New session",newSessionTitle:"New session",renameTitle:"Rename",renamePrompt:"Session name",deleteTitle:"Delete",deleteConfirm:'Delete session "{title}"? This cannot be undone.',empty:"No sessions yet",firstGraph:"My first graph",untitled:"Untitled session",assetAbortedError:"Generation did not finish cleanly. Retry from this node."},ix={ariaLabel:"UI mode",classic:"Classic",node:"Node"},ox={appName:"Image Generator",nodeModeHint:"In node mode, click a node to edit its prompt and generate. Settings on the right panel (quality/size) apply to every new result."},sx={openAria:"Open settings",openTitle:"Settings",closeAria:"Close settings",closeTitle:"Return to canvas",navAria:"Settings sections",contentAria:"Settings content",jumpTo:"Jump to {section}",eyebrow:"Workspace settings",title:"Settings",subtitle:"Account, display, and future workspace controls live here so the generator stays focused.",sections:{account:{title:"Account",hint:"OAuth status"},appearance:{title:"Appearance",hint:"Light and dark"},language:{title:"Language",hint:"Interface copy"},future:{title:"Future",hint:"Reserved"}},account:{primaryEyebrow:"Active provider",oauthTitle:"OAuth is active",oauthBody:"Generation currently runs through your Codex OAuth session. API-key generation remains disabled in this build.",apiSourceEnv:"OPENAI_API_KEY detected",apiSourceConfig:"config.json API key detected",apiTitle:"Configured but disabled",apiBody:"ima2-gen found an API key in env/config, but the app is OAuth-only right now. Remove the key only if you do not want this status shown.",apiDisabled:"Disabled",apiUnknown:"Status unknown"},appearance:{themeTitle:"Theme",themeBody:"Choose how the workspace should look on this device."},language:{title:"Language",body:"Switch the UI language without changing generated content."},future:{title:"Reserved for later",body:"Future provider repair and workspace controls will appear here when they become useful."}},rx={loading:"Loading session...",addFirst:"+ Add first node",addRootTitle:"Add root node",hint:"Drag a handle into empty space to branch. Press Delete or Backspace to remove."},ux={title:"{provider} unavailable",ariaLabel:"{provider} unavailable"},cx={label:"Language",ko:"한국어",en:"English"},fx={label:"Theme",system:"System",dark:"Dark",light:"Light"},dx={toggle:"Apply style consistency",extract:"Extract from prompt",extracting:"Extracting…",edit:"Edit",save:"Save",cancel:"Cancel",emptyHint:"No style sheet yet. Extract from the current prompt to lock in a look.",noPrompt:"Enter a prompt first",extracted:"Style sheet extracted",editorTitle:"Edit style sheet",saved:"Style sheet saved",errNoKey:"Style-sheet extraction needs an OpenAI API key. Connect one via setup.",errBadOutput:"Model returned an unusable sheet — try a more specific prompt.",placeholderMedium:"e.g. oil painting, cinematic photo",placeholderComposition:"e.g. centered portrait, wide landscape",placeholderMood:"e.g. cinematic, dreamlike",placeholderSubject:"e.g. young woman in red jacket",placeholderPalette:"#0a0a0a, #f97316, warm amber",placeholderNegative:"blur, watermark, text",fields:{medium:"Medium",composition:"Composition",mood:"Mood",subject:"Subject details",palette:"Palette (comma-separated hex or names)",negative:"Negative (comma-separated)"}},hx={close:"Close",details:"Show raw error details",unknown:{title:"An unexpected error occurred",body:"Please try again shortly. If it persists, copy the raw error message below and report it."},moderationRefused:{title:"Prompt blocked by moderation",body:"Soften the wording or rephrase. Sensitive/violent content in reference images can also trigger this.",cta:"Edit prompt"},upstream5xx:{title:"OpenAI is currently busy",body:"Retrying usually resolves this. Check status.openai.com if it persists.",cta:"Retry"},authChatgptExpired:{title:"Codex ChatGPT session expired",body:"Run `npx @openai/codex login` in your terminal, then reload this app.",cta:"Reload"},authApiKeyInvalid:{title:"API key authentication failed",body:"The key is invalid, revoked, out of quota, or tied to the wrong org. This app runs in OAuth mode, so switch to ChatGPT login.",cta:"OK"},networkFailed:{title:"Network connection failed",body:"Could not reach OpenAI or the local OAuth proxy. Check VPN/firewall and status.openai.com.",cta:"Reload"},oauthUnavailable:{title:"OAuth proxy unavailable",body:"The local OAuth proxy is not running. Restart `ima2 serve` and try again.",cta:"Reload"},apikeyDisabled:{title:"API-key mode is disabled",body:"This app is OAuth-only (ChatGPT login). Switch the provider to OAuth.",cta:"OK"}},gx={common:qb,toast:Gb,inflight:Yb,size:kb,quality:Ib,moderation:Vb,format:Xb,count:Zb,generate:$b,billing:Qb,history:Kb,panel:Fb,prompt:Jb,canvas:Pb,gallery:Wb,node:ex,provider:tx,cost:nx,result:ax,session:lx,uiMode:ix,sidebar:ox,settings:sx,nodeCanvas:rx,apiDisabled:ux,language:cx,theme:fx,styleSheet:dx,errorCard:hx},fp={ko:Bb,en:gx};function dp(n,l){return l.split(".").reduce((o,s)=>{if(o!=null)return o[s]},n)}function mx(n,l){return n.replace(/\{(\w+)\}/g,(o,s)=>s in l?String(l[s]):`{${s}}`)}function Ne(n,l){const o=oe.getState().locale;return Dy(o,n,l)}function Dy(n,l,o){const s=dp(fp[n],l),r=typeof s=="string"?s:dp(fp.en,l),c=typeof r=="string"?r:l;return o?mx(c,o):c}function Qe(){const n=oe(l=>l.locale);return{locale:n,t:(l,o)=>Dy(n,l,o)}}const px=["ko","en"];function yx(){try{const n=localStorage.getItem("ima2.locale");if(n==="ko"||n==="en")return n}catch{}return typeof navigator<"u"&&(navigator.language||"").toLowerCase().startsWith("ko")?"ko":"en"}function vx(n){try{localStorage.setItem("ima2.locale",n)}catch{}}function hp(n){return Math.round(n/16)*16}const Sx=[{value:"1024x1024",label:"1024×1024",sub:"1:1"},{value:"1536x1024",label:"1536×1024",sub:"3:2"},{value:"1024x1536",label:"1024×1536",sub:"2:3"}],bx=[{value:"1360x1024",label:"1360×1024",sub:"4:3"},{value:"1024x1360",label:"1024×1360",sub:"3:4"},{value:"1824x1024",label:"1824×1024",sub:"16:9"}],xx=[{value:"1024x1824",label:"1024×1824",sub:"9:16"},{value:"2048x2048",label:"2048×2048",sub:"2K 1:1"},{value:"2048x1152",label:"2048×1152",sub:"2K 16:9"}],Ex=[{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"}];function wx(){return[{value:"auto",label:Ne("size.autoLabel"),sub:Ne("size.autoSub")},{value:"custom",label:Ne("size.customLabel"),sub:Ne("size.customSub")}]}const $l=()=>"nc_"+Math.random().toString(36).slice(2,10);function gp(n,l){return{x:n*360,y:l*320}}const fo={REF_TOO_LARGE:{surface:"toast",toastKey:"toast.refTooLarge"},REF_NOT_BASE64:{surface:"toast",toastKey:"toast.refNotBase64"},REF_EMPTY:{surface:"toast",toastKey:"toast.refEmpty"},REF_TOO_MANY:{surface:"toast",toastKey:"toast.refLimitExceeded"},MODERATION_REFUSED:{surface:"card",cardKey:"errorCard.moderationRefused",cta:"dismiss"},SAFETY_REFUSAL:{surface:"card",cardKey:"errorCard.moderationRefused",cta:"dismiss"},UPSTREAM_5XX:{surface:"card",cardKey:"errorCard.upstream5xx",cta:"retry"},AUTH_CHATGPT_EXPIRED:{surface:"card",cardKey:"errorCard.authChatgptExpired",cta:"reauth"},AUTH_API_KEY_INVALID:{surface:"card",cardKey:"errorCard.authApiKeyInvalid",cta:"dismiss"},NETWORK_FAILED:{surface:"card",cardKey:"errorCard.networkFailed",cta:"reload"},OAUTH_UNAVAILABLE:{surface:"card",cardKey:"errorCard.oauthUnavailable",cta:"reload"},INVALID_MODERATION:{surface:"toast",toastKey:"toast.generateFailed"},APIKEY_DISABLED:{surface:"card",cardKey:"errorCard.apikeyDisabled",cta:"dismiss"},DB_ERROR:{surface:"toast",toastKey:"toast.generateFailed"},UNKNOWN:{surface:"toast",toastKey:"toast.generateFailed"}};function _x(n){const l=(n||"").toLowerCase();return l?l.includes("content generation refused")||l.includes("moderation_blocked")||l.includes("moderation refused")?"MODERATION_REFUSED":l.includes("token is expired")||l.includes("sign in again")||l.includes("access token")&&l.includes("expired")||l.includes("token")&&l.includes("expired")&&!l.includes("api key")?"AUTH_CHATGPT_EXPIRED":l.includes("incorrect api key")||l.includes("invalid authentication")||l.includes("exceeded your current quota")||l.includes("incorrect organization")?"AUTH_API_KEY_INVALID":l.includes("failed to fetch")||l.includes("econnrefused")||l.includes("econnreset")||l.includes("enotfound")||l.includes("etimedout")||l.includes("network error")?"NETWORK_FAILED":l.includes("oauth")&&(l.includes("not running")||l.includes("unavailable"))?"OAUTH_UNAVAILABLE":l.includes("an error occurred while processing")||/\b5\d\d\b/.test(l)?"UPSTREAM_5XX":"UNKNOWN":"UNKNOWN"}function Nx(n){const l=n,o=typeof l?.message=="string"?l.message:String(n??""),s=typeof l?.code=="string"?l.code:"",r=s&&s in fo?s:_x(o),c=fo[r]??fo.UNKNOWN;return{code:r,spec:c,message:o}}function mp(n,l){const{code:o,spec:s,message:r}=Nx(n);if(s.surface==="card")l.showErrorCard(o,{fallbackMessage:r});else{const c=s.toastKey?Ne(s.toastKey):r||Ne("toast.generateFailed");l.showToast(c,!0)}return{code:o,message:r}}function Ax(){try{const n=localStorage.getItem("ima2.rightPanelOpen");return n===null?!0:JSON.parse(n)===!0}catch{return!0}}function Tx(){try{const n=localStorage.getItem("ima2.uiMode");if(n==="node"||n==="classic")return n}catch{}return"classic"}function mf(){try{const n=localStorage.getItem("ima2:theme");if(n==="system"||n==="dark"||n==="light")return n}catch{}return"system"}function tr(n){return n==="dark"||n==="light"?n:typeof window>"u"||typeof window.matchMedia!="function"?"dark":window.matchMedia("(prefers-color-scheme: light)").matches?"light":"dark"}const Ry=18e4;function pf(){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(s=>s&&typeof s.id=="string"&&typeof s.prompt=="string"&&typeof s.startedAt=="number"&&o-s.startedAt<Ry).map(s=>({id:s.id,prompt:s.prompt,startedAt:s.startedAt,phase:typeof s.phase=="string"?s.phase:void 0,sessionId:typeof s.sessionId=="string"?s.sessionId:null,clientNodeId:typeof s.clientNodeId=="string"?s.clientNodeId:null,kind:s.kind==="classic"||s.kind==="node"?s.kind:void 0}))}catch{return[]}}function Fa(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{oe.getState().showToast(Ne("toast.localStorageFull"),!0)}catch{}}}}function pp(){try{const n=localStorage.getItem("ima2.selectedFilename");return typeof n=="string"&&n.length>0?n:null}catch{return null}}function ro(n){try{n?localStorage.setItem("ima2.selectedFilename",n):localStorage.removeItem("ima2.selectedFilename")}catch{}}const Fl=500,ba=5;function yp(n){return n==="classic"||n==="edit"||n==="generate"?n:null}function vp(n){return n.replace(/^data:[^;]+;base64,/,"")}function Oy(n){const l=n.nodes.map(s=>{const r=s.data??{},c=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,g=c??d,m={clientId:s.id,serverNodeId:r.serverNodeId??null,parentServerNodeId:r.parentServerNodeId??null,prompt:typeof r.prompt=="string"?r.prompt:"",imageUrl:g,status:r.status??(g?"ready":"empty"),pendingRequestId:r.pendingRequestId??null,pendingPhase:r.pendingPhase??null,pendingStartedAt:typeof r.pendingStartedAt=="number"?r.pendingStartedAt:null,error:r.error,elapsed:r.elapsed,webSearchCalls:r.webSearchCalls};return{id:s.id,type:"imageNode",position:{x:s.x,y:s.y},data:m}}),o=n.edges.map(s=>({id:s.id,source:s.source,target:s.target}));return{graphNodes:l,graphEdges:o,graphVersion:n.graphVersion}}const oe=IS((n,l)=>({provider:"oauth",quality:"medium",sizePreset:"1024x1024",customW:1920,customH:1088,format:"png",moderation:"low",count:1,promptMode:"auto",prompt:"",referenceImages:[],addReferences:async o=>{const s=ba-l().referenceImages.length,r=o.slice(0,Math.max(0,s)),c=r.filter(er),d=r.filter(y=>!er(y)),m=(await Promise.all(d.map(async y=>{try{return await up(y,{preserveTransparency:cp(y)})}catch(v){return console.warn("[addReferences] compress failed",v),null}}))).filter(y=>!!y);n(y=>({referenceImages:[...y.referenceImages,...m].slice(0,ba)})),c.length>0&&l().showToast(Ne("toast.refHeicUnsupported"),!0),d.length-m.length>0&&l().showToast(Ne("toast.refTooLarge"),!0),o.length>s&&l().showToast(Ne("toast.refLimitExceeded"),!0)},addReferenceDataUrl:o=>{n(s=>s.referenceImages.length>=ba?s:{referenceImages:[...s.referenceImages,o]})},removeReference:o=>{n(s=>({referenceImages:s.referenceImages.filter((r,c)=>c!==o)}))},clearReferences:()=>n({referenceImages:[]}),useCurrentAsReference:async()=>{const o=l().currentImage;if(!o){l().showToast(Ne("toast.noCurrentImageForRef"),!0);return}if(l().referenceImages.length>=ba){l().showToast(Ne("toast.refSlotFull"),!0);return}let s=o.image;if(!s.startsWith("data:"))try{const c=await(await fetch(s)).blob();s=await new Promise((d,g)=>{const m=new FileReader;m.onload=()=>typeof m.result=="string"?d(m.result):g(new Error("read failed")),m.onerror=()=>g(m.error??new Error("read failed")),m.readAsDataURL(c)})}catch{l().showToast(Ne("toast.currentImageLoadFailed"),!0);return}n(r=>({referenceImages:[...r.referenceImages,s].slice(0,ba)})),l().showToast(Ne("toast.addedCurrentAsRef"))},activeGenerations:pf().length,inFlight:pf(),startInFlightPolling:()=>{if(typeof window>"u")return;const o=window;if(o.__ima2InflightTimer)return;const s=async()=>{if(l().inFlight.length===0){o.__ima2InflightTimer&&(clearInterval(o.__ima2InflightTimer),o.__ima2InflightTimer=void 0);return}try{const c=l().uiMode==="node"?"node":"classic",d=c==="node"?l().activeSessionId??void 0:void 0,{jobs:g}=await df({kind:c,sessionId:d}),m=new Map(g.map(x=>[x.requestId,x.phase]));let h=!1;const y=Date.now(),v=5e3,p=[];for(const x of l().inFlight){if(!((x.kind??"classic")===c&&(c!=="node"||(x.sessionId??null)===(d??null)))){p.push(x);continue}if(!m.has(x.id)&&y-x.startedAt>v){h=!0;continue}const A=m.get(x.id);A&&A!==x.phase?(h=!0,p.push({...x,phase:A})):p.push(x)}h&&(Fa(p),n({inFlight:p,activeGenerations:p.length}))}catch{}try{const c=l().history.reduce((p,x)=>x.createdAt&&x.createdAt>p?x.createdAt:p,0),{items:d}=await Rf({limit:Fl,since:c}),g=d.map(p=>({image:p.url,url:p.url,filename:p.filename,thumb:p.url,prompt:p.prompt??void 0,size:p.size??void 0,quality:p.quality??void 0,format:p.format,createdAt:p.createdAt,sessionId:p.sessionId??null,nodeId:p.nodeId??null,clientNodeId:p.clientNodeId??null,kind:yp(p.kind),refsCount:p.refsCount??0})),m=l().history,h=g.filter(p=>!m.some(x=>x.filename===p.filename));h.length>0&&n(p=>{const x=p.currentImage??h[0];return!p.currentImage&&h[0]?.filename&&ro(h[0].filename),{history:[...h,...p.history].slice(0,Fl),currentImage:x}});const y=Date.now(),v=l().inFlight.filter(p=>y-p.startedAt<Ry);v.length!==l().inFlight.length&&(Fa(v),n({inFlight:v,activeGenerations:v.length}))}catch{}};o.__ima2InflightTimer=window.setInterval(s,1500)},reconcileInflight:async()=>{try{const o=l().uiMode==="node"?"node":"classic",s=o==="node"?l().activeSessionId??void 0:void 0,{jobs:r}=await df({kind:o,sessionId:s}),c=new Set(r.map(y=>y.requestId)),d=Date.now(),m=l().inFlight.filter(y=>c.has(y.id)||d-y.startedAt<1e4),h=new Set(m.map(y=>y.id));for(const y of r)h.has(y.requestId)||m.push({id:y.requestId,prompt:y.prompt||"",startedAt:y.startedAt});Fa(m),n({inFlight:m,activeGenerations:m.length}),m.length>0&&l().startInFlightPolling()}catch{}},syncFromStorage:()=>{const o=pf(),s=pp();n(r=>({inFlight:o,activeGenerations:o.length,currentImage:s&&r.currentImage?.filename!==s?r.history.find(c=>c.filename===s)??r.currentImage:r.currentImage})),o.length>0&&l().startInFlightPolling()},currentImage:null,history:[],toast:null,errorCard:null,rightPanelOpen:Ax(),toggleRightPanel:()=>n(o=>{const s=!o.rightPanelOpen;try{localStorage.setItem("ima2.rightPanelOpen",JSON.stringify(s))}catch{}return{rightPanelOpen:s}}),galleryOpen:!1,openGallery:()=>n({galleryOpen:!0}),closeGallery:()=>n({galleryOpen:!1}),settingsOpen:!1,activeSettingsSection:"account",openSettings:(o="account")=>n({settingsOpen:!0,activeSettingsSection:o}),closeSettings:()=>n({settingsOpen:!1}),toggleSettings:()=>n(o=>({settingsOpen:!o.settingsOpen,activeSettingsSection:o.settingsOpen?o.activeSettingsSection:"account"})),setActiveSettingsSection:o=>n({activeSettingsSection:o}),uiMode:Tx(),setUIMode:o=>{try{localStorage.setItem("ima2.uiMode",o)}catch{}n({uiMode:o})},theme:mf(),resolvedTheme:tr(mf()),setTheme:o=>{try{localStorage.setItem("ima2:theme",o)}catch{}n({theme:o,resolvedTheme:tr(o)})},syncThemeFromStorage:()=>{const o=mf();n({theme:o,resolvedTheme:tr(o)})},refreshResolvedTheme:()=>{n(o=>({resolvedTheme:tr(o.theme)}))},locale:yx(),setLocale:o=>{vx(o),n({locale:o})},graphNodes:[],graphEdges:[],setGraphNodes:o=>{n({graphNodes:o}),l().scheduleGraphSave()},setGraphEdges:o=>{n({graphEdges:o}),l().scheduleGraphSave()},sessions:[],activeSessionId:null,activeSessionGraphVersion:null,sessionLoading:!1,styleSheet:null,styleSheetEnabled:!1,styleSheetExtracting:!1,async loadStyleSheet(){const o=l().activeSessionId;if(!o){n({styleSheet:null,styleSheetEnabled:!1});return}try{const s=await nb(o);if(l().activeSessionId!==o)return;n({styleSheet:s.styleSheet,styleSheetEnabled:!!s.enabled})}catch(s){console.warn("[styleSheet] load failed:",s)}},async saveStyleSheet(o,s){const r=l().activeSessionId;if(r)try{if(await ab(r,o,s),l().activeSessionId!==r)return;n({styleSheet:o,...typeof s=="boolean"?{styleSheetEnabled:s}:{}}),l().showToast(Ne("styleSheet.saved"))}catch(c){console.warn("[styleSheet] save failed:",c),l().showToast(c.message,!0)}},async toggleStyleSheetEnabled(){const o=l().activeSessionId;if(!o)return;const s=!l().styleSheetEnabled;try{if(await lb(o,s),l().activeSessionId!==o)return;n({styleSheetEnabled:s})}catch(r){console.warn("[styleSheet] toggle failed:",r),l().showToast(r.message,!0)}},async extractStyleSheet(){const o=l().activeSessionId;if(!o)return;const s=l().prompt.trim();if(!s){l().showToast(Ne("styleSheet.noPrompt"),!0);return}const r=l().referenceImages[0];n({styleSheetExtracting:!0});try{const{styleSheet:c}=await ib(o,s,r);if(l().activeSessionId!==o){n({styleSheetExtracting:!1});return}n({styleSheet:c,styleSheetEnabled:!0,styleSheetExtracting:!1}),l().showToast(Ne("styleSheet.extracted"))}catch(c){n({styleSheetExtracting:!1}),console.warn("[styleSheet] extract failed:",c);const d=c.code,g=d==="STYLE_SHEET_NO_KEY"?Ne("styleSheet.errNoKey"):d==="STYLE_SHEET_EMPTY"||d==="STYLE_SHEET_PARSE"||d==="STYLE_SHEET_SHAPE"?Ne("styleSheet.errBadOutput"):c.message;l().showToast(g,!0)}},async loadSessions(){try{const{sessions:o}=await JS();n({sessions:o});const s=l().activeSessionId;!s&&o.length>0?await l().switchSession(o[0].id):!s&&o.length===0&&await l().createAndSwitchSession(Ne("session.firstGraph"))}catch(o){console.warn("[sessions] load failed:",o)}},async switchSession(o){n({sessionLoading:!0}),await l().flushGraphSave();try{const{session:s}=await zy(o),{graphNodes:r,graphEdges:c,graphVersion:d}=Oy(s);n({activeSessionId:o,activeSessionGraphVersion:d,graphNodes:r,graphEdges:c,sessionLoading:!1}),await l().reconcileGraphPending().catch(()=>{}),l().loadStyleSheet().catch(()=>{})}catch(s){console.warn("[sessions] switch failed:",s),n({sessionLoading:!1}),l().showToast(Ne("toast.sessionLoadFailed"),!0)}},async reconcileGraphPending(){const o=l().activeSessionId;if(!o)return;if(l().graphNodes.filter(r=>r.data?.pendingRequestId&&(r.data.status==="pending"||r.data.status==="reconciling")).length>0){let r=[];try{r=(await df({kind:"node",sessionId:o})).jobs}catch{r=[]}const c=new Map(r.map(h=>[h.requestId,h.phase])),d=Date.now(),g=1e4,m=l().graphNodes.map(h=>{const y=h.data?.pendingRequestId;if(!y||h.data.status!=="pending"&&h.data.status!=="reconciling")return h;if(c.has(y)){const x=c.get(y)??null;return{...h,data:{...h.data,status:"reconciling",pendingPhase:x}}}const v=h.data.pendingStartedAt??0;if(v&&d-v<g)return{...h,data:{...h.data,status:"reconciling"}};const p=!!h.data.imageUrl||!!h.data.serverNodeId;return{...h,data:{...h.data,pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,status:p?"ready":"stale",error:p?void 0:Ne("session.assetAbortedError")}}});n({graphNodes:m})}await Hy(l,n).catch(()=>{})},async createAndSwitchSession(o){o==null&&(o=Ne("session.untitled"));try{const{session:s}=await PS(o);n({sessions:[s,...l().sessions],activeSessionId:s.id,activeSessionGraphVersion:s.graphVersion,graphNodes:[],graphEdges:[]})}catch(s){console.warn("[sessions] create failed:",s),l().showToast(Ne("toast.sessionCreateFailed"),!0)}},async renameCurrentSession(o){const s=l().activeSessionId;if(s)try{await WS(s,o),n({sessions:l().sessions.map(r=>r.id===s?{...r,title:o,updatedAt:Date.now()}:r)})}catch{l().showToast(Ne("toast.sessionRenameFailed"),!0)}},async deleteSessionById(o){try{await eb(o);const s=l().sessions.filter(r=>r.id!==o);n({sessions:s}),l().activeSessionId===o&&(n({activeSessionId:null,activeSessionGraphVersion:null,graphNodes:[],graphEdges:[]}),s.length>0?await l().switchSession(s[0].id):await l().createAndSwitchSession(Ne("session.firstGraph")))}catch{l().showToast(Ne("toast.sessionDeleteFailed"),!0)}},scheduleGraphSave(){Uy(l,n)},async flushGraphSave(){await zx(l,n)},addRootNode:()=>{const o=$l(),s=0,r=l().graphNodes.filter(d=>!d.data.parentServerNodeId).length,c={id:o,type:"imageNode",position:gp(s,r),data:{clientId:o,serverNodeId:null,parentServerNodeId:null,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return n({graphNodes:[...l().graphNodes,c]}),l().scheduleGraphSave(),o},addChildNode:o=>{const s=l().graphNodes.find(m=>m.id===o);if(!s)return o;const r=$l(),c=l().graphEdges.filter(m=>m.source===o).length,d={id:r,type:"imageNode",position:{x:s.position.x+360,y:s.position.y+c*320},data:{clientId:r,serverNodeId:null,parentServerNodeId:s.data.serverNodeId,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},g={id:`${o}->${r}`,source:o,target:r};return n({graphNodes:[...l().graphNodes,d],graphEdges:[...l().graphEdges,g]}),l().scheduleGraphSave(),r},addSiblingNode:o=>{const s=l().graphNodes.find(v=>v.id===o);if(!s)return o;const r=l().graphEdges.find(v=>v.target===o);if(!r){const v=$l(),p=0,x=l().graphNodes.filter(M=>!M.data.parentServerNodeId).length,_={id:v,type:"imageNode",position:gp(p,x),data:{clientId:v,serverNodeId:null,parentServerNodeId:null,prompt:s.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return n({graphNodes:[...l().graphNodes,_]}),l().scheduleGraphSave(),v}const c=r.source,d=l().graphNodes.find(v=>v.id===c);if(!d)return o;const g=$l(),m=l().graphEdges.filter(v=>v.source===c).length,h={id:g,type:"imageNode",position:{x:d.position.x+360,y:d.position.y+m*320},data:{clientId:g,serverNodeId:null,parentServerNodeId:s.data.parentServerNodeId,prompt:s.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},y={id:`${c}->${g}`,source:c,target:g};return n({graphNodes:[...l().graphNodes,h],graphEdges:[...l().graphEdges,y]}),l().scheduleGraphSave(),g},updateNodePrompt:(o,s)=>{n({graphNodes:l().graphNodes.map(r=>r.id===o?{...r,data:{...r.data,prompt:s}}:r)}),l().scheduleGraphSave()},addNodeReferences:async(o,s)=>{const r=l().graphNodes.find(x=>x.id===o);if(!r)return;if(r.data.parentServerNodeId){l().showToast(Ne("node.nodeRefsUnsupportedForEdit"),!0);return}const c=r.data.referenceImages??[],d=ba-c.length;if(d<=0){l().showToast(Ne("toast.refLimitExceeded"),!0);return}const g=s.slice(0,Math.max(0,d)),m=g.filter(er),h=g.filter(x=>!er(x)),v=(await Promise.all(h.map(async x=>{try{return await up(x,{preserveTransparency:cp(x)})}catch(_){return console.warn("[addNodeReferences] compress failed",_),null}}))).filter(x=>!!x);v.length>0&&n({graphNodes:l().graphNodes.map(x=>x.id===o?{...x,data:{...x.data,referenceImages:[...x.data.referenceImages??[],...v].slice(0,ba)}}:x)}),m.length>0&&l().showToast(Ne("toast.refHeicUnsupported"),!0),h.length-v.length>0&&l().showToast(Ne("toast.refTooLarge"),!0),s.length>d&&l().showToast(Ne("toast.refLimitExceeded"),!0)},addNodeReferenceDataUrl:(o,s)=>{const r=l().graphNodes.find(c=>c.id===o);if(r){if(r.data.parentServerNodeId){l().showToast(Ne("node.nodeRefsUnsupportedForEdit"),!0);return}n({graphNodes:l().graphNodes.map(c=>{if(c.id!==o)return c;const d=c.data.referenceImages??[];return d.length>=ba?c:{...c,data:{...c.data,referenceImages:[...d,s]}}})})}},removeNodeReference:(o,s)=>{n({graphNodes:l().graphNodes.map(r=>r.id===o?{...r,data:{...r.data,referenceImages:(r.data.referenceImages??[]).filter((c,d)=>d!==s)}}:r)})},clearNodeReferences:o=>{n({graphNodes:l().graphNodes.map(s=>s.id===o?{...s,data:{...s.data,referenceImages:void 0}}:s)})},duplicateBranchRoot:o=>{const s=l().graphNodes.find(d=>d.id===o);if(!s)return o;const r=$l();l().graphNodes.filter(d=>!d.data.parentServerNodeId).length;const c={id:r,type:"imageNode",position:{x:s.position.x+420,y:s.position.y+40},data:{clientId:r,serverNodeId:null,parentServerNodeId:null,prompt:s.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};if(n({graphNodes:[...l().graphNodes,c]}),l().scheduleGraphSave(),s.data.imageUrl){const d=s.data.imageUrl;(async()=>{try{const m=await(await fetch(d)).blob(),h=await new Promise((y,v)=>{const p=new FileReader;p.onload=()=>typeof p.result=="string"?y(p.result):v(new Error("read failed")),p.onerror=()=>v(p.error??new Error("read failed")),p.readAsDataURL(m)});n({graphNodes:l().graphNodes.map(y=>y.id===r?{...y,data:{...y.data,referenceImages:[h]}}:y)})}catch{}})()}return r},async generateNode(o){const r=l().graphNodes.find(T=>T.id===o)?.data.status==="ready"?l().addSiblingNode(o):o,c=l().graphNodes.find(T=>T.id===r);if(!c)return;const{prompt:d,parentServerNodeId:g}=c.data;if(!d.trim()){l().showToast(Ne("toast.promptRequired"),!0);return}const m=c.data.referenceImages??[];if(g&&m.length>0){l().showToast(Ne("node.nodeRefsUnsupportedForEdit"),!0);return}const h=l(),y=h.getResolvedSize(),v=h.activeSessionId,p=Date.now(),x=Math.random().toString(36).slice(2,6),_=`fn_${r}_${p}_${x}`,M=[...h.inFlight,{id:_,prompt:d,startedAt:p,kind:"node",sessionId:v,clientNodeId:r}];Fa(M),n({graphNodes:l().graphNodes.map(T=>T.id===r?{...T,data:{...T.data,status:"pending",pendingRequestId:_,pendingPhase:"queued",pendingStartedAt:p,error:void 0}}:T),activeGenerations:h.activeGenerations+1,inFlight:M}),l().startInFlightPolling();let A=!0;try{const T=await FS({parentNodeId:g,prompt:d,quality:h.quality,size:y,format:h.format,moderation:h.moderation,requestId:_,sessionId:v,clientNodeId:r,...m.length&&!g?{references:m.map(vp)}:{}});l().activeSessionId===v&&(n({graphNodes:l().graphNodes.map(B=>{if(B.id!==r)return B;const E={...B.data};return delete E.referenceImages,{...B,data:{...E,serverNodeId:T.nodeId,imageUrl:T.url,status:"ready",pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,elapsed:T.elapsed,webSearchCalls:T.webSearchCalls}}})}),A=!0,l().showToast(Ne("toast.nodeCreated",{id:T.nodeId.slice(0,8),elapsed:T.elapsed})))}catch(T){const B=T instanceof Error?T.message:Ne("toast.nodeCreateFailed");l().activeSessionId===v&&(n({graphNodes:l().graphNodes.map(E=>E.id===r?{...E,data:{...E.data,status:"error",pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,error:B}}:E)}),A=!0,mp(T,l()))}finally{const T=l().inFlight.filter(B=>B.id!==_);Fa(T),n({activeGenerations:Math.max(0,l().activeGenerations-1),inFlight:T}),l().activeSessionId===v&&A&&l().scheduleGraphSave()}},deleteNode:o=>{const r=l().graphNodes.find(c=>c.id===o)?.data?.pendingRequestId;r&&op(r),n({graphNodes:l().graphNodes.filter(c=>c.id!==o),graphEdges:l().graphEdges.filter(c=>c.source!==o&&c.target!==o)}),l().scheduleGraphSave()},deleteNodes:o=>{const s=new Set(o);for(const r of l().graphNodes)s.has(r.id)&&r.data?.pendingRequestId&&op(r.data.pendingRequestId);n({graphNodes:l().graphNodes.filter(r=>!s.has(r.id)),graphEdges:l().graphEdges.filter(r=>!s.has(r.source)&&!s.has(r.target))}),l().scheduleGraphSave()},addChildNodeAt:(o,s)=>{const r=l().graphNodes.find(m=>m.id===o);if(!r)return o;const c=$l(),d={id:c,type:"imageNode",position:s,data:{clientId:c,serverNodeId:null,parentServerNodeId:r.data.serverNodeId,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},g={id:`${o}->${c}`,source:o,target:c};return n({graphNodes:[...l().graphNodes,d],graphEdges:[...l().graphEdges,g]}),l().scheduleGraphSave(),c},connectNodes:(o,s)=>{if(o===s||l().graphEdges.find(d=>d.source===o&&d.target===s))return;const c=l().graphNodes.find(d=>d.id===o);c&&(n({graphNodes:l().graphNodes.map(d=>d.id===s?{...d,data:{...d.data,parentServerNodeId:c.data.serverNodeId}}:d),graphEdges:[...l().graphEdges,{id:`${o}->${s}`,source:o,target:s}]}),l().scheduleGraphSave())},setProvider:o=>n({provider:o}),setQuality:o=>n({quality:o}),setSizePreset:o=>n({sizePreset:o}),setCustomSize:(o,s)=>n({customW:hp(o),customH:hp(s)}),setFormat:o=>n({format:o}),setModeration:o=>n({moderation:o}),setCount:o=>n({count:o}),setPromptMode:o=>n({promptMode:o}),setPrompt:o=>n({prompt:o}),selectHistory:o=>{ro(o.filename??null),n({currentImage:o})},removeFromHistory:o=>{const s=l(),r=s.history.filter(d=>d.filename!==o),c=s.currentImage&&s.currentImage.filename===o?null:s.currentImage;n({history:r,currentImage:c}),c===null&&ro(null)},addHistoryItem:o=>{const s=l();if(s.history.some(d=>o.filename&&d.filename===o.filename))return;const c={...o,createdAt:o.createdAt||Date.now()};n({history:[c,...s.history].slice(0,Fl)})},getResolvedSize:()=>{const{sizePreset:o,customW:s,customH:r}=l();return o==="custom"?`${s}x${r}`:o},async generate(){const o=l(),s=o.prompt.trim();if(!s)return;const r=o.getResolvedSize(),c=`f_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,d=Date.now(),g=[...o.inFlight,{id:c,prompt:s,startedAt:d}];Fa(g),n({activeGenerations:o.activeGenerations+1,inFlight:g}),l().startInFlightPolling();try{const m={prompt:s,quality:o.quality,size:r,format:o.format,moderation:o.moderation,provider:o.provider,n:o.count,requestId:c,mode:o.promptMode,...o.referenceImages.length?{references:o.referenceImages.map(vp)}:{}},h=await ZS(m);if(ip(h)&&h.images.length>1){for(const y of h.images){const v={image:y.image,filename:y.filename,prompt:s,elapsed:h.elapsed,provider:h.provider,usage:h.usage,quality:h.quality??o.quality,size:h.size??r};await Sp(v,n,l)}l().showToast(Ne("toast.generatedBatch",{count:h.images.length,elapsed:h.elapsed}))}else{let y;if(ip(h)){const v=h.images[0];y={image:v.image,filename:v.filename,prompt:s,elapsed:h.elapsed,provider:h.provider,usage:h.usage,quality:h.quality??o.quality,size:h.size??r}}else y={image:h.image,filename:h.filename,prompt:s,elapsed:h.elapsed,provider:h.provider,usage:h.usage,quality:h.quality??o.quality,size:h.size??r};await Sp(y,n,l),l().showToast(Ne("toast.generatedSingle",{elapsed:h.elapsed}))}}catch(m){mp(m,l())}finally{const m=l().inFlight.filter(h=>h.id!==c);Fa(m),n({activeGenerations:Math.max(0,l().activeGenerations-1),inFlight:m})}},hydrateHistory(){(async()=>{try{const s=(await Rf({limit:Fl})).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,sessionId:r.sessionId??null,nodeId:r.nodeId??null,clientNodeId:r.clientNodeId??null,kind:yp(r.kind)}));if(s.length>0){const r=pp(),c=r?s.find(d=>d.filename===r):null;n({history:s,currentImage:c??s[0]}),c||ro(s[0]?.filename??null)}}catch(o){console.warn("[history] load failed:",o)}})()},showToast(o,s=!1){n({toast:{message:o,error:s,id:Date.now()+Math.random()}})},showErrorCard(o,s){n({errorCard:{code:o,fallbackMessage:s?.fallbackMessage,id:Date.now()+Math.random()}})},dismissErrorCard(){n({errorCard:null})}})),Cx=800;let hn=null,yr=null;function jy(n){const l={...n};return delete l.referenceImages,n.status==="pending"||n.status==="reconciling"?{...l,status:"empty",pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,error:void 0}:l}async function Hy(n,l){const o=n().activeSessionId;if(!o||n().graphNodes.filter(g=>!g.data.imageUrl&&!g.data.serverNodeId).length===0)return;let r=[];try{r=(await Rf({sessionId:o,limit:Fl})).items}catch{return}let c=!1;const d=n().graphNodes.map(g=>{if(g.data.imageUrl||g.data.serverNodeId)return g;const m=g.data.pendingStartedAt??0,h=r.find(y=>(y.sessionId??null)===o&&(y.clientNodeId??null)===g.id&&(!m||(y.createdAt??0)>=m));return h?(c=!0,{...g,data:{...g.data,status:"ready",imageUrl:h.url,serverNodeId:h.nodeId??g.data.serverNodeId,pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,error:void 0}}):g});c&&(l({graphNodes:d}),Uy(n,l))}async function Mx(n,l){const o=n().activeSessionId;if(!o)return;const{session:s}=await zy(o),{graphNodes:r,graphEdges:c,graphVersion:d}=Oy(s);l({graphNodes:r,graphEdges:c,activeSessionGraphVersion:d}),n().showToast(Ne("toast.sessionReloadedElsewhere"),!0),await Hy(n,l).catch(()=>{})}function Ly(n,l){const o=n().activeSessionId,s=n().activeSessionGraphVersion;if(!o||s==null)return Promise.resolve();const{graphNodes:r,graphEdges:c}=n(),d=r.map(m=>({id:m.id,x:m.position.x,y:m.position.y,data:jy(m.data)})),g=c.map(m=>({id:m.id,source:m.source,target:m.target,data:{}}));return tb(o,s,d,g).then(m=>{l({activeSessionGraphVersion:m.graphVersion})}).catch(async m=>{if(m.status===409){await Mx(n,l);return}console.warn("[sessions] save failed:",m)})}function Uy(n,l){const o=n();o.activeSessionId&&(o.sessionLoading||(hn&&clearTimeout(hn),hn=setTimeout(()=>{hn=null,yr=Ly(n,l).finally(()=>{yr=null})},Cx)))}async function zx(n,l){hn?(clearTimeout(hn),hn=null,await Ly(n,l)):yr&&await yr}function Dx(n){const l=n();if(!l.activeSessionId||l.activeSessionGraphVersion==null)return;hn&&(clearTimeout(hn),hn=null);const o=l.graphNodes.map(d=>({id:d.id,x:d.position.x,y:d.position.y,data:jy(d.data)})),s=l.graphEdges.map(d=>({id:d.id,source:d.source,target:d.target,data:{}})),r=`/api/sessions/${encodeURIComponent(l.activeSessionId)}/graph`,c=JSON.stringify({nodes:o,edges:s});try{fetch(r,{method:"PUT",headers:{"Content-Type":"application/json","If-Match":String(l.activeSessionGraphVersion)},body:c,keepalive:!0})}catch{}}async function Sp(n,l,o){const s=await ob(n.image).catch(()=>n.image),r=n.filename?`/generated/${n.filename}`:n.image,c={...n,thumb:s,url:r,createdAt:n.createdAt||Date.now()},d=[c,...o().history].slice(0,Fl);ro(c.filename??null),l({history:d,currentImage:c})}function Rx(){const{t:n}=Qe(),l=oe(s=>s.uiMode),o=oe(s=>s.setUIMode);return b.jsxs("div",{className:"ui-mode-switch",role:"tablist","aria-label":n("uiMode.ariaLabel"),children:[b.jsx("button",{type:"button",role:"tab","aria-selected":l==="classic",className:`ui-mode-switch__tab${l==="classic"?" active":""}`,onClick:()=>o("classic"),children:n("uiMode.classic")}),b.jsx("button",{type:"button",role:"tab","aria-selected":l==="node",className:`ui-mode-switch__tab${l==="node"?" active":""}`,onClick:()=>o("node"),children:n("uiMode.node")})]})}const bp={palette:[],composition:"",mood:"",medium:"",subject_details:"",negative:[]};function By({open:n,onClose:l}){const{t:o}=Qe(),s=oe(R=>R.styleSheet),r=oe(R=>R.styleSheetEnabled),c=oe(R=>R.styleSheetExtracting),d=oe(R=>R.activeSessionId),g=oe(R=>R.toggleStyleSheetEnabled),m=oe(R=>R.extractStyleSheet),h=oe(R=>R.saveStyleSheet),[y,v]=Z.useState(!1),[p,x]=Z.useState(s??bp),[_,M]=Z.useState(!1),[A,T]=Z.useState(!1);if(Z.useEffect(()=>{n?x(s??bp):(v(!1),M(!1))},[n,s]),Z.useEffect(()=>{if(!n)return;const R=L=>{L.key==="Escape"&&!_&&l()};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[n,_,l]),!n||!d)return null;const B=!!s&&(s.composition||s.mood||s.medium||s.subject_details||s.palette.length>0),E=async()=>{if(!_){M(!0);try{await h(p,r),v(!1)}finally{M(!1)}}},D=async()=>{if(!A){T(!0);try{await g()}finally{T(!1)}}},Y=R=>x(L=>({...L,...R}));return b.jsx("div",{className:"style-sheet-editor__backdrop",onClick:_?void 0:l,role:"presentation",children:b.jsxs("div",{className:"style-sheet-editor",role:"dialog","aria-modal":"true","aria-label":o("styleSheet.editorTitle"),onClick:R=>R.stopPropagation(),children:[b.jsxs("div",{className:"style-sheet-panel__header",children:[b.jsx("h3",{style:{margin:0,fontSize:16},children:o("styleSheet.editorTitle")}),b.jsxs("label",{className:"style-sheet-panel__toggle",style:{marginLeft:"auto"},children:[b.jsx("input",{type:"checkbox",checked:r,disabled:!B||A,onChange:()=>{D()}}),b.jsx("span",{children:o("styleSheet.toggle")})]})]}),!y&&b.jsxs(b.Fragment,{children:[B?b.jsxs("div",{className:"style-sheet-panel__summary",children:[s.medium&&b.jsxs("div",{children:[b.jsxs("b",{children:[o("styleSheet.fields.medium"),":"]})," ",s.medium]}),s.palette.length>0&&b.jsx("div",{className:"style-sheet-panel__chips",children:s.palette.slice(0,6).map((R,L)=>b.jsx("span",{className:"style-sheet-panel__chip",title:R,children:R},L))}),s.mood&&b.jsxs("div",{className:"style-sheet-panel__muted",children:[o("styleSheet.fields.mood"),": ",s.mood]})]}):b.jsx("div",{className:"style-sheet-panel__muted",children:o("styleSheet.emptyHint")}),b.jsxs("div",{className:"style-sheet-panel__actions",children:[b.jsx("button",{type:"button",className:"btn btn--secondary btn--sm",onClick:()=>{m()},disabled:c,children:o(c?"styleSheet.extracting":"styleSheet.extract")}),b.jsx("button",{type:"button",className:"btn btn--ghost btn--sm",onClick:()=>v(!0),disabled:c,children:o("styleSheet.edit")}),b.jsx("button",{type:"button",className:"btn btn--ghost btn--sm",style:{marginLeft:"auto"},onClick:l,children:o("styleSheet.cancel")})]})]}),y&&b.jsxs(b.Fragment,{children:[b.jsxs("label",{children:[o("styleSheet.fields.medium"),b.jsx("input",{value:p.medium,onChange:R=>Y({medium:R.target.value}),placeholder:o("styleSheet.placeholderMedium")})]}),b.jsxs("label",{children:[o("styleSheet.fields.composition"),b.jsx("textarea",{rows:2,value:p.composition,onChange:R=>Y({composition:R.target.value}),placeholder:o("styleSheet.placeholderComposition")})]}),b.jsxs("label",{children:[o("styleSheet.fields.mood"),b.jsx("input",{value:p.mood,onChange:R=>Y({mood:R.target.value}),placeholder:o("styleSheet.placeholderMood")})]}),b.jsxs("label",{children:[o("styleSheet.fields.subject"),b.jsx("textarea",{rows:2,value:p.subject_details,onChange:R=>Y({subject_details:R.target.value}),placeholder:o("styleSheet.placeholderSubject")})]}),b.jsxs("label",{children:[o("styleSheet.fields.palette"),b.jsx("input",{value:p.palette.join(", "),onChange:R=>Y({palette:R.target.value.split(",").map(L=>L.trim()).filter(Boolean).slice(0,6)}),placeholder:o("styleSheet.placeholderPalette")})]}),b.jsxs("label",{children:[o("styleSheet.fields.negative"),b.jsx("input",{value:p.negative.join(", "),onChange:R=>Y({negative:R.target.value.split(",").map(L=>L.trim()).filter(Boolean).slice(0,4)}),placeholder:o("styleSheet.placeholderNegative")})]}),b.jsxs("div",{className:"style-sheet-editor__actions",children:[b.jsx("button",{type:"button",className:"btn btn--ghost",onClick:()=>v(!1),disabled:_,children:o("styleSheet.cancel")}),b.jsx("button",{type:"button",className:"btn btn--primary",onClick:()=>{E()},disabled:_,children:o(_?"styleSheet.extracting":"styleSheet.save")})]})]})]})})}const Ql=5;function Ox(){const n=oe(H=>H.prompt),l=oe(H=>H.setPrompt),o=oe(H=>H.generate),{t:s}=Qe(),r=oe(H=>H.referenceImages),c=oe(H=>H.addReferences),d=oe(H=>H.removeReference),g=oe(H=>H.useCurrentAsReference),m=oe(H=>H.currentImage),h=Z.useRef(null),[y,v]=Z.useState(!1),[p,x]=Z.useState(!1),_=oe(H=>H.activeSessionId),M=oe(H=>H.styleSheetEnabled),A=oe(H=>H.promptMode),T=oe(H=>H.setPromptMode),B=r.length<Ql,E=H=>{H.preventDefault(),v(!1);const $=Array.from(H.dataTransfer.files).filter(V=>V.type.startsWith("image/"));$.length>0&&c($)},D=H=>{H.preventDefault(),y||v(!0)},Y=H=>{H.currentTarget.contains(H.relatedTarget)||v(!1)},R=H=>{if(!H)return[];const $=[];for(const V of Array.from(H)){if(V.kind!=="file"||!V.type.startsWith("image/"))continue;const k=V.getAsFile();k&&$.push(k)}return $},L=H=>{if(!B)return;const $=R(H.clipboardData?.items??null);if($.length===0)return;H.preventDefault();const V=Ql-r.length;c($.slice(0,V))};return Z.useEffect(()=>{const H=$=>{const V=$.target,k=V?.tagName;if(k==="INPUT"||k==="TEXTAREA"||V?.isContentEditable)return;const P=R($.clipboardData?.items??null);if(P.length===0||r.length>=Ql)return;$.preventDefault();const te=Ql-r.length;c(P.slice(0,te))};return window.addEventListener("paste",H),()=>window.removeEventListener("paste",H)},[r.length,c]),b.jsxs("div",{className:`composer${y?" composer--drag":""}`,onDrop:E,onDragOver:D,onDragLeave:Y,onPaste:L,children:[b.jsxs("div",{className:"composer__header",children:[b.jsx("span",{className:"section-title composer__label",children:s("prompt.label")}),r.length>0&&b.jsx("span",{className:"composer__count",children:s("prompt.refCount",{count:r.length,max:Ql})})]}),r.length>0&&b.jsx("div",{className:"composer__chips",children:r.map((H,$)=>b.jsxs("div",{className:"composer__chip",title:s("prompt.refChipTitle",{n:$+1}),children:[b.jsx("img",{src:H,alt:s("prompt.refChipAlt",{n:$+1})}),b.jsx("button",{type:"button",className:"composer__chip-remove",onClick:()=>d($),"aria-label":s("prompt.refRemoveAria",{n:$+1}),children:"×"})]},$))}),b.jsx("textarea",{className:"prompt-area composer__textarea",value:n,placeholder:r.length>0?s("prompt.placeholderWithRefs"):s("prompt.placeholder"),onChange:H=>l(H.target.value),onKeyDown:H=>{H.key==="Enter"&&(H.metaKey||H.ctrlKey)&&(H.preventDefault(),o())}}),b.jsxs("div",{className:"composer__toolbar",children:[b.jsxs("button",{type:"button",className:"composer__tool",onClick:()=>B&&h.current?.click(),disabled:!B,title:s("prompt.attachTitle"),"aria-label":s("prompt.attachTitle"),children:[b.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:b.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"})}),b.jsx("span",{children:s("prompt.attach")})]}),b.jsxs("button",{type:"button",className:"composer__tool",onClick:()=>{g()},disabled:!m||!B,title:s("prompt.useCurrentTitle"),children:[b.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:[b.jsx("polyline",{points:"23 4 23 10 17 10"}),b.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),b.jsx("span",{children:s("prompt.useCurrent")})]}),_&&b.jsxs("button",{type:"button",className:`composer__tool${M?" composer__tool--on":""}`,onClick:()=>x(!0),title:s("prompt.styleTitle"),"aria-label":s("prompt.styleTitle"),"aria-pressed":M,children:[b.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:[b.jsx("circle",{cx:"12",cy:"12",r:"9"}),b.jsx("circle",{cx:"8",cy:"10",r:"1",fill:"currentColor"}),b.jsx("circle",{cx:"12",cy:"8",r:"1",fill:"currentColor"}),b.jsx("circle",{cx:"16",cy:"10",r:"1",fill:"currentColor"}),b.jsx("path",{d:"M14 14c2 0 3 1 3 3 0 1-1 2-2 2-2 0-3-2-5-2"})]}),b.jsx("span",{children:s("prompt.style")})]}),b.jsxs("button",{type:"button",className:`composer__tool${A==="direct"?" composer__tool--on":""}`,onClick:()=>T(A==="direct"?"auto":"direct"),title:s("prompt.directModeTitle"),"aria-label":s("prompt.directModeTitle"),"aria-pressed":A==="direct",children:[b.jsx("span",{"aria-hidden":"true",style:{fontWeight:700,fontSize:11},children:"1:1"}),b.jsx("span",{children:s("prompt.directMode")})]}),b.jsx("span",{className:"composer__hint",children:s("prompt.hint")})]}),y&&b.jsx("div",{className:"composer__dropzone","aria-hidden":"true",children:s("prompt.dropHere",{max:Ql})}),b.jsx("input",{ref:h,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:H=>{const $=Array.from(H.target.files??[]);$.length>0&&c($),H.target.value=""}}),b.jsx(By,{open:p,onClose:()=>x(!1)})]})}function jx(){const n=oe(c=>c.activeGenerations),l=oe(c=>c.generate),{t:o}=Qe(),s=n>0,r=s?o("generate.buttonLoading",{n}):o("generate.button");return b.jsx("button",{type:"button",className:`generate-btn${s?" loading":""}`,onClick:()=>{l()},children:r})}function Hx(n,l=28){const o=n.trim().replace(/\s+/g," ");return o.length>l?`${o.slice(0,l)}...`:o}function xp(){const n=oe(s=>s.inFlight),{t:l}=Qe(),o={queued:l("inflight.queued"),streaming:l("inflight.streaming"),decoding:l("inflight.decoding")};return n.length===0?null:b.jsx("ul",{className:"in-flight-list",children:n.map(s=>{const r=s.phase?o[s.phase]??s.phase:l("inflight.queued");return b.jsxs("li",{className:"in-flight-item","data-phase":s.phase??"queued",children:[b.jsx("span",{className:"in-flight-prompt",children:Hx(s.prompt)}),b.jsx("span",{className:"in-flight-phase",children:r}),b.jsx("span",{className:"in-flight-spinner","aria-hidden":"true"})]},s.id)})})}function Lx(){const n=oe(c=>c.history),l=oe(c=>c.currentImage),o=oe(c=>c.selectHistory),s=oe(c=>c.openGallery),{t:r}=Qe();return b.jsxs("div",{className:"history-strip",children:[b.jsx("button",{type:"button",className:"history-thumb history-thumb--add",onClick:s,"aria-label":r("history.openGalleryAria"),title:r("history.openGalleryTitle"),children:b.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),b.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),b.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),b.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})}),n.map((c,d)=>{const g=c.filename?l?.filename===c.filename:l?.image===c.image;return b.jsx("img",{src:c.thumb||c.url||c.image,alt:"",className:`history-thumb${g?" active":""}`,onClick:()=>o(c)},c.filename??`${d}-${c.image}`)})]})}function Ux(){const{t:n}=Qe(),l=oe(p=>p.sessions),o=oe(p=>p.activeSessionId),s=oe(p=>p.switchSession),r=oe(p=>p.createAndSwitchSession),c=oe(p=>p.renameCurrentSession),d=oe(p=>p.deleteSessionById),[g,m]=Z.useState(!1),h=l.find(p=>p.id===o),y=()=>{const p=window.prompt(n("session.renamePrompt"),h?.title??n("session.newSession"));p&&p.trim()&&c(p.trim())},v=(p,x)=>{window.confirm(n("session.deleteConfirm",{title:x}))&&d(p)};return b.jsxs("div",{className:"session-picker",children:[b.jsxs("div",{className:"session-picker-row",children:[b.jsxs("button",{type:"button",className:"session-current",onClick:()=>m(p=>!p),title:n("session.switchTitle"),children:[b.jsx("span",{className:"session-title",children:h?.title??n("session.loading")}),b.jsx("span",{className:"session-caret",children:g?"▴":"▾"})]}),b.jsx("button",{type:"button",className:"session-btn",onClick:()=>{r(n("session.newSession"))},title:n("session.newSessionTitle"),children:"+"}),b.jsx("button",{type:"button",className:"session-btn",onClick:y,title:n("session.renameTitle"),disabled:!h,children:"✎"})]}),g&&b.jsxs("ul",{className:"session-list",children:[l.map(p=>b.jsxs("li",{className:p.id===o?"is-active":"",children:[b.jsxs("button",{type:"button",className:"session-item",onClick:()=>{m(!1),s(p.id)},children:[b.jsx("span",{className:"session-item-title",children:p.title}),b.jsx("span",{className:"session-item-count",children:p.nodeCount})]}),b.jsx("button",{type:"button",className:"session-del",onClick:()=>v(p.id,p.title),title:n("session.deleteTitle"),children:"×"})]},p.id)),l.length===0&&b.jsx("li",{className:"session-empty",children:n("session.empty")})]})]})}function Bx(){const{t:n}=Qe(),l=oe(c=>c.activeSessionId),o=oe(c=>c.styleSheetEnabled),[s,r]=Z.useState(!1);return l?b.jsxs(b.Fragment,{children:[b.jsx("button",{type:"button",className:`btn btn--secondary btn--sm${o?" is-on":""}`,onClick:()=>r(!0),"aria-pressed":o,title:n("prompt.styleTitle"),children:n("prompt.style")}),b.jsx(By,{open:s,onClose:()=>r(!1)})]}):null}function qx(){const{t:n}=Qe(),l=oe(s=>s.settingsOpen),o=oe(s=>s.toggleSettings);return b.jsx("button",{type:"button",className:`settings-button${l?" is-active":""}`,onClick:o,"aria-label":n("settings.openAria"),"aria-pressed":l,title:n("settings.openTitle"),children:b.jsxs("svg",{viewBox:"0 0 24 24","aria-hidden":"true",children:[b.jsx("path",{d:"M12 8.2a3.8 3.8 0 1 0 0 7.6 3.8 3.8 0 0 0 0-7.6Zm0 5.7a1.9 1.9 0 1 1 0-3.8 1.9 1.9 0 0 1 0 3.8Z"}),b.jsx("path",{d:"m20.3 13.4.1-1.4-.1-1.4-2.2-.5a6.9 6.9 0 0 0-.6-1.3l1.2-1.9a9.6 9.6 0 0 0-2-2l-1.9 1.2c-.4-.2-.9-.4-1.3-.6L13 3.3a9.5 9.5 0 0 0-2.8 0l-.5 2.2c-.5.2-.9.3-1.3.6L6.5 4.9a9.6 9.6 0 0 0-2 2l1.2 1.9c-.2.4-.4.9-.6 1.3l-2.2.5a9.5 9.5 0 0 0 0 2.8l2.2.5c.2.5.3.9.6 1.3l-1.2 1.9a9.6 9.6 0 0 0 2 2l1.9-1.2c.4.2.9.4 1.3.6l.5 2.2a9.5 9.5 0 0 0 2.8 0l.5-2.2c.5-.2.9-.3 1.3-.6l1.9 1.2a9.6 9.6 0 0 0 2-2l-1.2-1.9c.2-.4.4-.9.6-1.3l2.2-.5Z"})]})})}function Gx(){const{t:n}=Qe(),l=oe(d=>d.uiMode),o=oe(d=>d.referenceImages),s=oe(d=>d.clearReferences),r=oe(d=>d.styleSheetEnabled),c=l;return b.jsxs("aside",{className:"sidebar",children:[b.jsxs("div",{className:"sidebar__scroll",children:[b.jsxs("div",{className:"logo",children:[b.jsx("div",{className:"logo-mark","aria-hidden":"true"}),b.jsxs("div",{className:"logo-copy",children:[b.jsx("div",{className:"logo-title",children:"ima2-gen"}),b.jsx("div",{className:"logo-subtitle",children:"gpt-image-2 studio"})]}),b.jsx(qx,{})]}),b.jsx(Rx,{}),c==="classic"?b.jsxs(b.Fragment,{children:[b.jsx(Ox,{}),b.jsx(jx,{}),b.jsx(xp,{})]}):b.jsxs(b.Fragment,{children:[b.jsx(Ux,{}),b.jsx(Bx,{}),o.length>0?b.jsxs("div",{className:"node-mode-ref-warning",role:"status",children:[b.jsx("strong",{children:n("node.classicRefsParkedTitle")}),b.jsx("span",{children:n("node.classicRefsParkedBody")}),b.jsx("button",{type:"button",onClick:s,children:n("node.clearParkedRefs")})]}):null,r?b.jsx("div",{className:"node-mode-style-badge",role:"status",children:n("node.styleSheetActive")}):null,b.jsx("div",{className:"sidebar__node-hint",children:n("sidebar.nodeModeHint")}),b.jsx(xp,{})]})]}),b.jsx(Lx,{})]})}function Yx(){const{t:n}=Qe(),l=oe(m=>m.currentImage),o=oe(m=>m.showToast),s=oe(m=>m.setPrompt);if(!l)return null;const r=()=>{const m=document.createElement("a");m.href=l.image,m.download=l.filename||"generated.png",m.click()},c=async()=>{try{const h=await(await fetch(l.image)).blob();await navigator.clipboard.write([new ClipboardItem({[h.type]:h})]),o(n("toast.imageCopied"))}catch{o(n("toast.copyFailed"),!0)}},d=()=>{l.prompt&&(navigator.clipboard.writeText(l.prompt),o(n("toast.promptCopied")))},g=async()=>{if(!l.prompt){o(n("toast.noPromptToFork"),!0);return}s(l.prompt);try{await oe.getState().useCurrentAsReference()}catch{}const m=document.querySelector('textarea[name="prompt"], textarea#prompt, .sidebar textarea');m&&(m.focus(),m.setSelectionRange(m.value.length,m.value.length)),o(n("toast.forkStarted"))};return b.jsxs("div",{className:"result-actions",children:[b.jsx("button",{type:"button",className:"action-btn",onClick:r,children:n("result.download")}),b.jsx("button",{type:"button",className:"action-btn",onClick:c,children:n("result.copyImage")}),b.jsx("button",{type:"button",className:"action-btn",onClick:d,children:n("result.copyPrompt")}),b.jsx("button",{type:"button",className:"action-btn action-btn--primary",onClick:g,title:n("result.continueHereTitle"),children:n("result.continueHere")})]})}function kx(){const n=oe(h=>h.currentImage),l=oe(h=>h.activeGenerations),o=oe(h=>h.quality),s=oe(h=>h.getResolvedSize),r=oe(h=>h.showToast),{t:c}=Qe(),d=()=>{n?.prompt&&(navigator.clipboard.writeText(n.prompt),r(c("toast.promptCopied")))},g=n?.quality??o,m=n?.size??s();return b.jsxs("main",{className:"canvas",children:[b.jsx("div",{className:`progress-bar${l>0?" active":""}`}),n?b.jsxs("div",{className:"result-container visible",children:[b.jsx("img",{className:"result-img",src:n.url??n.image,alt:c("canvas.resultAlt")},n.filename??n.url??n.image),n.prompt?b.jsx("div",{className:"result-prompt",onClick:d,children:n.prompt}):null,b.jsx("div",{className:"result-meta",children:[n.elapsed!=null?`${n.elapsed}s`:null,n.usage?c("canvas.tokens",{n:n.usage.total_tokens??"?"}):null,g,m,n.provider??null].filter(h=>!!h).join(" · ")}),b.jsx(Yx,{})]}):null]})}function it(n){if(typeof n=="string"||typeof n=="number")return""+n;let l="";if(Array.isArray(n))for(let o=0,s;o<n.length;o++)(s=it(n[o]))!==""&&(l+=(l&&" ")+s);else for(let o in n)n[o]&&(l+=(l&&" ")+o);return l}var Ix={value:()=>{}};function Mr(){for(var n=0,l=arguments.length,o={},s;n<l;++n){if(!(s=arguments[n]+"")||s in o||/[\s.]/.test(s))throw new Error("illegal type: "+s);o[s]=[]}return new dr(o)}function dr(n){this._=n}function Vx(n,l){return n.trim().split(/^|\s+/).map(function(o){var s="",r=o.indexOf(".");if(r>=0&&(s=o.slice(r+1),o=o.slice(0,r)),o&&!l.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:s}})}dr.prototype=Mr.prototype={constructor:dr,on:function(n,l){var o=this._,s=Vx(n+"",o),r,c=-1,d=s.length;if(arguments.length<2){for(;++c<d;)if((r=(n=s[c]).type)&&(r=Xx(o[r],n.name)))return r;return}if(l!=null&&typeof l!="function")throw new Error("invalid callback: "+l);for(;++c<d;)if(r=(n=s[c]).type)o[r]=Ep(o[r],n.name,l);else if(l==null)for(r in o)o[r]=Ep(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 dr(n)},call:function(n,l){if((r=arguments.length-2)>0)for(var o=new Array(r),s=0,r,c;s<r;++s)o[s]=arguments[s+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(c=this._[n],s=0,r=c.length;s<r;++s)c[s].value.apply(l,o)},apply:function(n,l,o){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var s=this._[n],r=0,c=s.length;r<c;++r)s[r].value.apply(l,o)}};function Xx(n,l){for(var o=0,s=n.length,r;o<s;++o)if((r=n[o]).name===l)return r.value}function Ep(n,l,o){for(var s=0,r=n.length;s<r;++s)if(n[s].name===l){n[s]=Ix,n=n.slice(0,s).concat(n.slice(s+1));break}return o!=null&&n.push({name:l,value:o}),n}var Of="http://www.w3.org/1999/xhtml";const wp={svg:"http://www.w3.org/2000/svg",xhtml:Of,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function zr(n){var l=n+="",o=l.indexOf(":");return o>=0&&(l=n.slice(0,o))!=="xmlns"&&(n=n.slice(o+1)),wp.hasOwnProperty(l)?{space:wp[l],local:n}:n}function Zx(n){return function(){var l=this.ownerDocument,o=this.namespaceURI;return o===Of&&l.documentElement.namespaceURI===Of?l.createElement(n):l.createElementNS(o,n)}}function $x(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function qy(n){var l=zr(n);return(l.local?$x:Zx)(l)}function Qx(){}function Qf(n){return n==null?Qx:function(){return this.querySelector(n)}}function Kx(n){typeof n!="function"&&(n=Qf(n));for(var l=this._groups,o=l.length,s=new Array(o),r=0;r<o;++r)for(var c=l[r],d=c.length,g=s[r]=new Array(d),m,h,y=0;y<d;++y)(m=c[y])&&(h=n.call(m,m.__data__,y,c))&&("__data__"in m&&(h.__data__=m.__data__),g[y]=h);return new qt(s,this._parents)}function Fx(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function Jx(){return[]}function Gy(n){return n==null?Jx:function(){return this.querySelectorAll(n)}}function Px(n){return function(){return Fx(n.apply(this,arguments))}}function Wx(n){typeof n=="function"?n=Px(n):n=Gy(n);for(var l=this._groups,o=l.length,s=[],r=[],c=0;c<o;++c)for(var d=l[c],g=d.length,m,h=0;h<g;++h)(m=d[h])&&(s.push(n.call(m,m.__data__,h,d)),r.push(m));return new qt(s,r)}function Yy(n){return function(){return this.matches(n)}}function ky(n){return function(l){return l.matches(n)}}var e2=Array.prototype.find;function t2(n){return function(){return e2.call(this.children,n)}}function n2(){return this.firstElementChild}function a2(n){return this.select(n==null?n2:t2(typeof n=="function"?n:ky(n)))}var l2=Array.prototype.filter;function i2(){return Array.from(this.children)}function o2(n){return function(){return l2.call(this.children,n)}}function s2(n){return this.selectAll(n==null?i2:o2(typeof n=="function"?n:ky(n)))}function r2(n){typeof n!="function"&&(n=Yy(n));for(var l=this._groups,o=l.length,s=new Array(o),r=0;r<o;++r)for(var c=l[r],d=c.length,g=s[r]=[],m,h=0;h<d;++h)(m=c[h])&&n.call(m,m.__data__,h,c)&&g.push(m);return new qt(s,this._parents)}function Iy(n){return new Array(n.length)}function u2(){return new qt(this._enter||this._groups.map(Iy),this._parents)}function vr(n,l){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=l}vr.prototype={constructor:vr,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 c2(n){return function(){return n}}function f2(n,l,o,s,r,c){for(var d=0,g,m=l.length,h=c.length;d<h;++d)(g=l[d])?(g.__data__=c[d],s[d]=g):o[d]=new vr(n,c[d]);for(;d<m;++d)(g=l[d])&&(r[d]=g)}function d2(n,l,o,s,r,c,d){var g,m,h=new Map,y=l.length,v=c.length,p=new Array(y),x;for(g=0;g<y;++g)(m=l[g])&&(p[g]=x=d.call(m,m.__data__,g,l)+"",h.has(x)?r[g]=m:h.set(x,m));for(g=0;g<v;++g)x=d.call(n,c[g],g,c)+"",(m=h.get(x))?(s[g]=m,m.__data__=c[g],h.delete(x)):o[g]=new vr(n,c[g]);for(g=0;g<y;++g)(m=l[g])&&h.get(p[g])===m&&(r[g]=m)}function h2(n){return n.__data__}function g2(n,l){if(!arguments.length)return Array.from(this,h2);var o=l?d2:f2,s=this._parents,r=this._groups;typeof n!="function"&&(n=c2(n));for(var c=r.length,d=new Array(c),g=new Array(c),m=new Array(c),h=0;h<c;++h){var y=s[h],v=r[h],p=v.length,x=m2(n.call(y,y&&y.__data__,h,s)),_=x.length,M=g[h]=new Array(_),A=d[h]=new Array(_),T=m[h]=new Array(p);o(y,v,M,A,T,x,l);for(var B=0,E=0,D,Y;B<_;++B)if(D=M[B]){for(B>=E&&(E=B+1);!(Y=A[E])&&++E<_;);D._next=Y||null}}return d=new qt(d,s),d._enter=g,d._exit=m,d}function m2(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function p2(){return new qt(this._exit||this._groups.map(Iy),this._parents)}function y2(n,l,o){var s=this.enter(),r=this,c=this.exit();return typeof n=="function"?(s=n(s),s&&(s=s.selection())):s=s.append(n+""),l!=null&&(r=l(r),r&&(r=r.selection())),o==null?c.remove():o(c),s&&r?s.merge(r).order():r}function v2(n){for(var l=n.selection?n.selection():n,o=this._groups,s=l._groups,r=o.length,c=s.length,d=Math.min(r,c),g=new Array(r),m=0;m<d;++m)for(var h=o[m],y=s[m],v=h.length,p=g[m]=new Array(v),x,_=0;_<v;++_)(x=h[_]||y[_])&&(p[_]=x);for(;m<r;++m)g[m]=o[m];return new qt(g,this._parents)}function S2(){for(var n=this._groups,l=-1,o=n.length;++l<o;)for(var s=n[l],r=s.length-1,c=s[r],d;--r>=0;)(d=s[r])&&(c&&d.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(d,c),c=d);return this}function b2(n){n||(n=x2);function l(v,p){return v&&p?n(v.__data__,p.__data__):!v-!p}for(var o=this._groups,s=o.length,r=new Array(s),c=0;c<s;++c){for(var d=o[c],g=d.length,m=r[c]=new Array(g),h,y=0;y<g;++y)(h=d[y])&&(m[y]=h);m.sort(l)}return new qt(r,this._parents).order()}function x2(n,l){return n<l?-1:n>l?1:n>=l?0:NaN}function E2(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function w2(){return Array.from(this)}function _2(){for(var n=this._groups,l=0,o=n.length;l<o;++l)for(var s=n[l],r=0,c=s.length;r<c;++r){var d=s[r];if(d)return d}return null}function N2(){let n=0;for(const l of this)++n;return n}function A2(){return!this.node()}function T2(n){for(var l=this._groups,o=0,s=l.length;o<s;++o)for(var r=l[o],c=0,d=r.length,g;c<d;++c)(g=r[c])&&n.call(g,g.__data__,c,r);return this}function C2(n){return function(){this.removeAttribute(n)}}function M2(n){return function(){this.removeAttributeNS(n.space,n.local)}}function z2(n,l){return function(){this.setAttribute(n,l)}}function D2(n,l){return function(){this.setAttributeNS(n.space,n.local,l)}}function R2(n,l){return function(){var o=l.apply(this,arguments);o==null?this.removeAttribute(n):this.setAttribute(n,o)}}function O2(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 j2(n,l){var o=zr(n);if(arguments.length<2){var s=this.node();return o.local?s.getAttributeNS(o.space,o.local):s.getAttribute(o)}return this.each((l==null?o.local?M2:C2:typeof l=="function"?o.local?O2:R2:o.local?D2:z2)(o,l))}function Vy(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function H2(n){return function(){this.style.removeProperty(n)}}function L2(n,l,o){return function(){this.style.setProperty(n,l,o)}}function U2(n,l,o){return function(){var s=l.apply(this,arguments);s==null?this.style.removeProperty(n):this.style.setProperty(n,s,o)}}function B2(n,l,o){return arguments.length>1?this.each((l==null?H2:typeof l=="function"?U2:L2)(n,l,o??"")):ti(this.node(),n)}function ti(n,l){return n.style.getPropertyValue(l)||Vy(n).getComputedStyle(n,null).getPropertyValue(l)}function q2(n){return function(){delete this[n]}}function G2(n,l){return function(){this[n]=l}}function Y2(n,l){return function(){var o=l.apply(this,arguments);o==null?delete this[n]:this[n]=o}}function k2(n,l){return arguments.length>1?this.each((l==null?q2:typeof l=="function"?Y2:G2)(n,l)):this.node()[n]}function Xy(n){return n.trim().split(/^|\s+/)}function Kf(n){return n.classList||new Zy(n)}function Zy(n){this._node=n,this._names=Xy(n.getAttribute("class")||"")}Zy.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 $y(n,l){for(var o=Kf(n),s=-1,r=l.length;++s<r;)o.add(l[s])}function Qy(n,l){for(var o=Kf(n),s=-1,r=l.length;++s<r;)o.remove(l[s])}function I2(n){return function(){$y(this,n)}}function V2(n){return function(){Qy(this,n)}}function X2(n,l){return function(){(l.apply(this,arguments)?$y:Qy)(this,n)}}function Z2(n,l){var o=Xy(n+"");if(arguments.length<2){for(var s=Kf(this.node()),r=-1,c=o.length;++r<c;)if(!s.contains(o[r]))return!1;return!0}return this.each((typeof l=="function"?X2:l?I2:V2)(o,l))}function $2(){this.textContent=""}function Q2(n){return function(){this.textContent=n}}function K2(n){return function(){var l=n.apply(this,arguments);this.textContent=l??""}}function F2(n){return arguments.length?this.each(n==null?$2:(typeof n=="function"?K2:Q2)(n)):this.node().textContent}function J2(){this.innerHTML=""}function P2(n){return function(){this.innerHTML=n}}function W2(n){return function(){var l=n.apply(this,arguments);this.innerHTML=l??""}}function eE(n){return arguments.length?this.each(n==null?J2:(typeof n=="function"?W2:P2)(n)):this.node().innerHTML}function tE(){this.nextSibling&&this.parentNode.appendChild(this)}function nE(){return this.each(tE)}function aE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function lE(){return this.each(aE)}function iE(n){var l=typeof n=="function"?n:qy(n);return this.select(function(){return this.appendChild(l.apply(this,arguments))})}function oE(){return null}function sE(n,l){var o=typeof n=="function"?n:qy(n),s=l==null?oE:typeof l=="function"?l:Qf(l);return this.select(function(){return this.insertBefore(o.apply(this,arguments),s.apply(this,arguments)||null)})}function rE(){var n=this.parentNode;n&&n.removeChild(this)}function uE(){return this.each(rE)}function cE(){var n=this.cloneNode(!1),l=this.parentNode;return l?l.insertBefore(n,this.nextSibling):n}function fE(){var n=this.cloneNode(!0),l=this.parentNode;return l?l.insertBefore(n,this.nextSibling):n}function dE(n){return this.select(n?fE:cE)}function hE(n){return arguments.length?this.property("__data__",n):this.node().__data__}function gE(n){return function(l){n.call(this,l,this.__data__)}}function mE(n){return n.trim().split(/^|\s+/).map(function(l){var o="",s=l.indexOf(".");return s>=0&&(o=l.slice(s+1),l=l.slice(0,s)),{type:l,name:o}})}function pE(n){return function(){var l=this.__on;if(l){for(var o=0,s=-1,r=l.length,c;o<r;++o)c=l[o],(!n.type||c.type===n.type)&&c.name===n.name?this.removeEventListener(c.type,c.listener,c.options):l[++s]=c;++s?l.length=s:delete this.__on}}}function yE(n,l,o){return function(){var s=this.__on,r,c=gE(l);if(s){for(var d=0,g=s.length;d<g;++d)if((r=s[d]).type===n.type&&r.name===n.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=c,r.options=o),r.value=l;return}}this.addEventListener(n.type,c,o),r={type:n.type,name:n.name,value:l,listener:c,options:o},s?s.push(r):this.__on=[r]}}function vE(n,l,o){var s=mE(n+""),r,c=s.length,d;if(arguments.length<2){var g=this.node().__on;if(g){for(var m=0,h=g.length,y;m<h;++m)for(r=0,y=g[m];r<c;++r)if((d=s[r]).type===y.type&&d.name===y.name)return y.value}return}for(g=l?yE:pE,r=0;r<c;++r)this.each(g(s[r],l,o));return this}function Ky(n,l,o){var s=Vy(n),r=s.CustomEvent;typeof r=="function"?r=new r(l,o):(r=s.document.createEvent("Event"),o?(r.initEvent(l,o.bubbles,o.cancelable),r.detail=o.detail):r.initEvent(l,!1,!1)),n.dispatchEvent(r)}function SE(n,l){return function(){return Ky(this,n,l)}}function bE(n,l){return function(){return Ky(this,n,l.apply(this,arguments))}}function xE(n,l){return this.each((typeof l=="function"?bE:SE)(n,l))}function*EE(){for(var n=this._groups,l=0,o=n.length;l<o;++l)for(var s=n[l],r=0,c=s.length,d;r<c;++r)(d=s[r])&&(yield d)}var Fy=[null];function qt(n,l){this._groups=n,this._parents=l}function No(){return new qt([[document.documentElement]],Fy)}function wE(){return this}qt.prototype=No.prototype={constructor:qt,select:Kx,selectAll:Wx,selectChild:a2,selectChildren:s2,filter:r2,data:g2,enter:u2,exit:p2,join:y2,merge:v2,selection:wE,order:S2,sort:b2,call:E2,nodes:w2,node:_2,size:N2,empty:A2,each:T2,attr:j2,style:B2,property:k2,classed:Z2,text:F2,html:eE,raise:nE,lower:lE,append:iE,insert:sE,remove:uE,clone:dE,datum:hE,on:vE,dispatch:xE,[Symbol.iterator]:EE};function Bt(n){return typeof n=="string"?new qt([[document.querySelector(n)]],[document.documentElement]):new qt([[n]],Fy)}function _E(n){let l;for(;l=n.sourceEvent;)n=l;return n}function en(n,l){if(n=_E(n),l===void 0&&(l=n.currentTarget),l){var o=l.ownerSVGElement||l;if(o.createSVGPoint){var s=o.createSVGPoint();return s.x=n.clientX,s.y=n.clientY,s=s.matrixTransform(l.getScreenCTM().inverse()),[s.x,s.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 NE={passive:!1},mo={capture:!0,passive:!1};function yf(n){n.stopImmediatePropagation()}function Wl(n){n.preventDefault(),n.stopImmediatePropagation()}function Jy(n){var l=n.document.documentElement,o=Bt(n).on("dragstart.drag",Wl,mo);"onselectstart"in l?o.on("selectstart.drag",Wl,mo):(l.__noselect=l.style.MozUserSelect,l.style.MozUserSelect="none")}function Py(n,l){var o=n.document.documentElement,s=Bt(n).on("dragstart.drag",null);l&&(s.on("click.drag",Wl,mo),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in o?s.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const nr=n=>()=>n;function jf(n,{sourceEvent:l,subject:o,target:s,identifier:r,active:c,x:d,y:g,dx:m,dy:h,dispatch:y}){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:s,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:g,enumerable:!0,configurable:!0},dx:{value:m,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:y}})}jf.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function AE(n){return!n.ctrlKey&&!n.button}function TE(){return this.parentNode}function CE(n,l){return l??{x:n.x,y:n.y}}function ME(){return navigator.maxTouchPoints||"ontouchstart"in this}function Wy(){var n=AE,l=TE,o=CE,s=ME,r={},c=Mr("start","drag","end"),d=0,g,m,h,y,v=0;function p(D){D.on("mousedown.drag",x).filter(s).on("touchstart.drag",A).on("touchmove.drag",T,NE).on("touchend.drag touchcancel.drag",B).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(D,Y){if(!(y||!n.call(this,D,Y))){var R=E(this,l.call(this,D,Y),D,Y,"mouse");R&&(Bt(D.view).on("mousemove.drag",_,mo).on("mouseup.drag",M,mo),Jy(D.view),yf(D),h=!1,g=D.clientX,m=D.clientY,R("start",D))}}function _(D){if(Wl(D),!h){var Y=D.clientX-g,R=D.clientY-m;h=Y*Y+R*R>v}r.mouse("drag",D)}function M(D){Bt(D.view).on("mousemove.drag mouseup.drag",null),Py(D.view,h),Wl(D),r.mouse("end",D)}function A(D,Y){if(n.call(this,D,Y)){var R=D.changedTouches,L=l.call(this,D,Y),H=R.length,$,V;for($=0;$<H;++$)(V=E(this,L,D,Y,R[$].identifier,R[$]))&&(yf(D),V("start",D,R[$]))}}function T(D){var Y=D.changedTouches,R=Y.length,L,H;for(L=0;L<R;++L)(H=r[Y[L].identifier])&&(Wl(D),H("drag",D,Y[L]))}function B(D){var Y=D.changedTouches,R=Y.length,L,H;for(y&&clearTimeout(y),y=setTimeout(function(){y=null},500),L=0;L<R;++L)(H=r[Y[L].identifier])&&(yf(D),H("end",D,Y[L]))}function E(D,Y,R,L,H,$){var V=c.copy(),k=en($||R,Y),P,te,z;if((z=o.call(D,new jf("beforestart",{sourceEvent:R,target:p,identifier:H,active:d,x:k[0],y:k[1],dx:0,dy:0,dispatch:V}),L))!=null)return P=z.x-k[0]||0,te=z.y-k[1]||0,function I(N,j,G){var Q=k,ne;switch(N){case"start":r[H]=I,ne=d++;break;case"end":delete r[H],--d;case"drag":k=en(G||j,Y),ne=d;break}V.call(N,D,new jf(N,{sourceEvent:j,subject:z,target:p,identifier:H,active:ne,x:k[0]+P,y:k[1]+te,dx:k[0]-Q[0],dy:k[1]-Q[1],dispatch:V}),L)}}return p.filter=function(D){return arguments.length?(n=typeof D=="function"?D:nr(!!D),p):n},p.container=function(D){return arguments.length?(l=typeof D=="function"?D:nr(D),p):l},p.subject=function(D){return arguments.length?(o=typeof D=="function"?D:nr(D),p):o},p.touchable=function(D){return arguments.length?(s=typeof D=="function"?D:nr(!!D),p):s},p.on=function(){var D=c.on.apply(c,arguments);return D===c?p:D},p.clickDistance=function(D){return arguments.length?(v=(D=+D)*D,p):Math.sqrt(v)},p}function Ff(n,l,o){n.prototype=l.prototype=o,o.constructor=n}function e0(n,l){var o=Object.create(n.prototype);for(var s in l)o[s]=l[s];return o}function Ao(){}var po=.7,Sr=1/po,ei="\\s*([+-]?\\d+)\\s*",yo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",zE=/^#([0-9a-f]{3,8})$/,DE=new RegExp(`^rgb\\(${ei},${ei},${ei}\\)$`),RE=new RegExp(`^rgb\\(${gn},${gn},${gn}\\)$`),OE=new RegExp(`^rgba\\(${ei},${ei},${ei},${yo}\\)$`),jE=new RegExp(`^rgba\\(${gn},${gn},${gn},${yo}\\)$`),HE=new RegExp(`^hsl\\(${yo},${gn},${gn}\\)$`),LE=new RegExp(`^hsla\\(${yo},${gn},${gn},${yo}\\)$`),_p={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};Ff(Ao,tl,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:Np,formatHex:Np,formatHex8:UE,formatHsl:BE,formatRgb:Ap,toString:Ap});function Np(){return this.rgb().formatHex()}function UE(){return this.rgb().formatHex8()}function BE(){return t0(this).formatHsl()}function Ap(){return this.rgb().formatRgb()}function tl(n){var l,o;return n=(n+"").trim().toLowerCase(),(l=zE.exec(n))?(o=l[1].length,l=parseInt(l[1],16),o===6?Tp(l):o===3?new Mt(l>>8&15|l>>4&240,l>>4&15|l&240,(l&15)<<4|l&15,1):o===8?ar(l>>24&255,l>>16&255,l>>8&255,(l&255)/255):o===4?ar(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=DE.exec(n))?new Mt(l[1],l[2],l[3],1):(l=RE.exec(n))?new Mt(l[1]*255/100,l[2]*255/100,l[3]*255/100,1):(l=OE.exec(n))?ar(l[1],l[2],l[3],l[4]):(l=jE.exec(n))?ar(l[1]*255/100,l[2]*255/100,l[3]*255/100,l[4]):(l=HE.exec(n))?zp(l[1],l[2]/100,l[3]/100,1):(l=LE.exec(n))?zp(l[1],l[2]/100,l[3]/100,l[4]):_p.hasOwnProperty(n)?Tp(_p[n]):n==="transparent"?new Mt(NaN,NaN,NaN,0):null}function Tp(n){return new Mt(n>>16&255,n>>8&255,n&255,1)}function ar(n,l,o,s){return s<=0&&(n=l=o=NaN),new Mt(n,l,o,s)}function qE(n){return n instanceof Ao||(n=tl(n)),n?(n=n.rgb(),new Mt(n.r,n.g,n.b,n.opacity)):new Mt}function Hf(n,l,o,s){return arguments.length===1?qE(n):new Mt(n,l,o,s??1)}function Mt(n,l,o,s){this.r=+n,this.g=+l,this.b=+o,this.opacity=+s}Ff(Mt,Hf,e0(Ao,{brighter(n){return n=n==null?Sr:Math.pow(Sr,n),new Mt(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?po:Math.pow(po,n),new Mt(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Mt(Wa(this.r),Wa(this.g),Wa(this.b),br(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:Cp,formatHex:Cp,formatHex8:GE,formatRgb:Mp,toString:Mp}));function Cp(){return`#${Pa(this.r)}${Pa(this.g)}${Pa(this.b)}`}function GE(){return`#${Pa(this.r)}${Pa(this.g)}${Pa(this.b)}${Pa((isNaN(this.opacity)?1:this.opacity)*255)}`}function Mp(){const n=br(this.opacity);return`${n===1?"rgb(":"rgba("}${Wa(this.r)}, ${Wa(this.g)}, ${Wa(this.b)}${n===1?")":`, ${n})`}`}function br(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Wa(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Pa(n){return n=Wa(n),(n<16?"0":"")+n.toString(16)}function zp(n,l,o,s){return s<=0?n=l=o=NaN:o<=0||o>=1?n=l=NaN:l<=0&&(n=NaN),new tn(n,l,o,s)}function t0(n){if(n instanceof tn)return new tn(n.h,n.s,n.l,n.opacity);if(n instanceof Ao||(n=tl(n)),!n)return new tn;if(n instanceof tn)return n;n=n.rgb();var l=n.r/255,o=n.g/255,s=n.b/255,r=Math.min(l,o,s),c=Math.max(l,o,s),d=NaN,g=c-r,m=(c+r)/2;return g?(l===c?d=(o-s)/g+(o<s)*6:o===c?d=(s-l)/g+2:d=(l-o)/g+4,g/=m<.5?c+r:2-c-r,d*=60):g=m>0&&m<1?0:d,new tn(d,g,m,n.opacity)}function YE(n,l,o,s){return arguments.length===1?t0(n):new tn(n,l,o,s??1)}function tn(n,l,o,s){this.h=+n,this.s=+l,this.l=+o,this.opacity=+s}Ff(tn,YE,e0(Ao,{brighter(n){return n=n==null?Sr:Math.pow(Sr,n),new tn(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?po:Math.pow(po,n),new tn(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,s=o+(o<.5?o:1-o)*l,r=2*o-s;return new Mt(vf(n>=240?n-240:n+120,r,s),vf(n,r,s),vf(n<120?n+240:n-120,r,s),this.opacity)},clamp(){return new tn(Dp(this.h),lr(this.s),lr(this.l),br(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=br(this.opacity);return`${n===1?"hsl(":"hsla("}${Dp(this.h)}, ${lr(this.s)*100}%, ${lr(this.l)*100}%${n===1?")":`, ${n})`}`}}));function Dp(n){return n=(n||0)%360,n<0?n+360:n}function lr(n){return Math.max(0,Math.min(1,n||0))}function vf(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 Jf=n=>()=>n;function kE(n,l){return function(o){return n+o*l}}function IE(n,l,o){return n=Math.pow(n,o),l=Math.pow(l,o)-n,o=1/o,function(s){return Math.pow(n+s*l,o)}}function VE(n){return(n=+n)==1?n0:function(l,o){return o-l?IE(l,o,n):Jf(isNaN(l)?o:l)}}function n0(n,l){var o=l-n;return o?kE(n,o):Jf(isNaN(n)?l:n)}const xr=(function n(l){var o=VE(l);function s(r,c){var d=o((r=Hf(r)).r,(c=Hf(c)).r),g=o(r.g,c.g),m=o(r.b,c.b),h=n0(r.opacity,c.opacity);return function(y){return r.r=d(y),r.g=g(y),r.b=m(y),r.opacity=h(y),r+""}}return s.gamma=n,s})(1);function XE(n,l){l||(l=[]);var o=n?Math.min(l.length,n.length):0,s=l.slice(),r;return function(c){for(r=0;r<o;++r)s[r]=n[r]*(1-c)+l[r]*c;return s}}function ZE(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function $E(n,l){var o=l?l.length:0,s=n?Math.min(o,n.length):0,r=new Array(s),c=new Array(o),d;for(d=0;d<s;++d)r[d]=ho(n[d],l[d]);for(;d<o;++d)c[d]=l[d];return function(g){for(d=0;d<s;++d)c[d]=r[d](g);return c}}function QE(n,l){var o=new Date;return n=+n,l=+l,function(s){return o.setTime(n*(1-s)+l*s),o}}function dn(n,l){return n=+n,l=+l,function(o){return n*(1-o)+l*o}}function KE(n,l){var o={},s={},r;(n===null||typeof n!="object")&&(n={}),(l===null||typeof l!="object")&&(l={});for(r in l)r in n?o[r]=ho(n[r],l[r]):s[r]=l[r];return function(c){for(r in o)s[r]=o[r](c);return s}}var Lf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Sf=new RegExp(Lf.source,"g");function FE(n){return function(){return n}}function JE(n){return function(l){return n(l)+""}}function a0(n,l){var o=Lf.lastIndex=Sf.lastIndex=0,s,r,c,d=-1,g=[],m=[];for(n=n+"",l=l+"";(s=Lf.exec(n))&&(r=Sf.exec(l));)(c=r.index)>o&&(c=l.slice(o,c),g[d]?g[d]+=c:g[++d]=c),(s=s[0])===(r=r[0])?g[d]?g[d]+=r:g[++d]=r:(g[++d]=null,m.push({i:d,x:dn(s,r)})),o=Sf.lastIndex;return o<l.length&&(c=l.slice(o),g[d]?g[d]+=c:g[++d]=c),g.length<2?m[0]?JE(m[0].x):FE(l):(l=m.length,function(h){for(var y=0,v;y<l;++y)g[(v=m[y]).i]=v.x(h);return g.join("")})}function ho(n,l){var o=typeof l,s;return l==null||o==="boolean"?Jf(l):(o==="number"?dn:o==="string"?(s=tl(l))?(l=s,xr):a0:l instanceof tl?xr:l instanceof Date?QE:ZE(l)?XE:Array.isArray(l)?$E:typeof l.valueOf!="function"&&typeof l.toString!="function"||isNaN(l)?KE:dn)(n,l)}var Rp=180/Math.PI,Uf={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function l0(n,l,o,s,r,c){var d,g,m;return(d=Math.sqrt(n*n+l*l))&&(n/=d,l/=d),(m=n*o+l*s)&&(o-=n*m,s-=l*m),(g=Math.sqrt(o*o+s*s))&&(o/=g,s/=g,m/=g),n*s<l*o&&(n=-n,l=-l,m=-m,d=-d),{translateX:r,translateY:c,rotate:Math.atan2(l,n)*Rp,skewX:Math.atan(m)*Rp,scaleX:d,scaleY:g}}var ir;function PE(n){const l=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return l.isIdentity?Uf:l0(l.a,l.b,l.c,l.d,l.e,l.f)}function WE(n){return n==null||(ir||(ir=document.createElementNS("http://www.w3.org/2000/svg","g")),ir.setAttribute("transform",n),!(n=ir.transform.baseVal.consolidate()))?Uf:(n=n.matrix,l0(n.a,n.b,n.c,n.d,n.e,n.f))}function i0(n,l,o,s){function r(h){return h.length?h.pop()+" ":""}function c(h,y,v,p,x,_){if(h!==v||y!==p){var M=x.push("translate(",null,l,null,o);_.push({i:M-4,x:dn(h,v)},{i:M-2,x:dn(y,p)})}else(v||p)&&x.push("translate("+v+l+p+o)}function d(h,y,v,p){h!==y?(h-y>180?y+=360:y-h>180&&(h+=360),p.push({i:v.push(r(v)+"rotate(",null,s)-2,x:dn(h,y)})):y&&v.push(r(v)+"rotate("+y+s)}function g(h,y,v,p){h!==y?p.push({i:v.push(r(v)+"skewX(",null,s)-2,x:dn(h,y)}):y&&v.push(r(v)+"skewX("+y+s)}function m(h,y,v,p,x,_){if(h!==v||y!==p){var M=x.push(r(x)+"scale(",null,",",null,")");_.push({i:M-4,x:dn(h,v)},{i:M-2,x:dn(y,p)})}else(v!==1||p!==1)&&x.push(r(x)+"scale("+v+","+p+")")}return function(h,y){var v=[],p=[];return h=n(h),y=n(y),c(h.translateX,h.translateY,y.translateX,y.translateY,v,p),d(h.rotate,y.rotate,v,p),g(h.skewX,y.skewX,v,p),m(h.scaleX,h.scaleY,y.scaleX,y.scaleY,v,p),h=y=null,function(x){for(var _=-1,M=p.length,A;++_<M;)v[(A=p[_]).i]=A.x(x);return v.join("")}}}var ew=i0(PE,"px, ","px)","deg)"),tw=i0(WE,", ",")",")"),nw=1e-12;function Op(n){return((n=Math.exp(n))+1/n)/2}function aw(n){return((n=Math.exp(n))-1/n)/2}function lw(n){return((n=Math.exp(2*n))-1)/(n+1)}const hr=(function n(l,o,s){function r(c,d){var g=c[0],m=c[1],h=c[2],y=d[0],v=d[1],p=d[2],x=y-g,_=v-m,M=x*x+_*_,A,T;if(M<nw)T=Math.log(p/h)/l,A=function(L){return[g+L*x,m+L*_,h*Math.exp(l*L*T)]};else{var B=Math.sqrt(M),E=(p*p-h*h+s*M)/(2*h*o*B),D=(p*p-h*h-s*M)/(2*p*o*B),Y=Math.log(Math.sqrt(E*E+1)-E),R=Math.log(Math.sqrt(D*D+1)-D);T=(R-Y)/l,A=function(L){var H=L*T,$=Op(Y),V=h/(o*B)*($*lw(l*H+Y)-aw(Y));return[g+V*x,m+V*_,h*$/Op(l*H+Y)]}}return A.duration=T*1e3*l/Math.SQRT2,A}return r.rho=function(c){var d=Math.max(.001,+c),g=d*d,m=g*g;return n(d,g,m)},r})(Math.SQRT2,2,4);var ni=0,uo=0,lo=0,o0=1e3,Er,co,wr=0,nl=0,Dr=0,vo=typeof performance=="object"&&performance.now?performance:Date,s0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function Pf(){return nl||(s0(iw),nl=vo.now()+Dr)}function iw(){nl=0}function _r(){this._call=this._time=this._next=null}_r.prototype=r0.prototype={constructor:_r,restart:function(n,l,o){if(typeof n!="function")throw new TypeError("callback is not a function");o=(o==null?Pf():+o)+(l==null?0:+l),!this._next&&co!==this&&(co?co._next=this:Er=this,co=this),this._call=n,this._time=o,Bf()},stop:function(){this._call&&(this._call=null,this._time=1/0,Bf())}};function r0(n,l,o){var s=new _r;return s.restart(n,l,o),s}function ow(){Pf(),++ni;for(var n=Er,l;n;)(l=nl-n._time)>=0&&n._call.call(void 0,l),n=n._next;--ni}function jp(){nl=(wr=vo.now())+Dr,ni=uo=0;try{ow()}finally{ni=0,rw(),nl=0}}function sw(){var n=vo.now(),l=n-wr;l>o0&&(Dr-=l,wr=n)}function rw(){for(var n,l=Er,o,s=1/0;l;)l._call?(s>l._time&&(s=l._time),n=l,l=l._next):(o=l._next,l._next=null,l=n?n._next=o:Er=o);co=n,Bf(s)}function Bf(n){if(!ni){uo&&(uo=clearTimeout(uo));var l=n-nl;l>24?(n<1/0&&(uo=setTimeout(jp,n-vo.now()-Dr)),lo&&(lo=clearInterval(lo))):(lo||(wr=vo.now(),lo=setInterval(sw,o0)),ni=1,s0(jp))}}function Hp(n,l,o){var s=new _r;return l=l==null?0:+l,s.restart(r=>{s.stop(),n(r+l)},l,o),s}var uw=Mr("start","end","cancel","interrupt"),cw=[],u0=0,Lp=1,qf=2,gr=3,Up=4,Gf=5,mr=6;function Rr(n,l,o,s,r,c){var d=n.__transition;if(!d)n.__transition={};else if(o in d)return;fw(n,o,{name:l,index:s,group:r,on:uw,tween:cw,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:u0})}function Wf(n,l){var o=ln(n,l);if(o.state>u0)throw new Error("too late; already scheduled");return o}function pn(n,l){var o=ln(n,l);if(o.state>gr)throw new Error("too late; already running");return o}function ln(n,l){var o=n.__transition;if(!o||!(o=o[l]))throw new Error("transition not found");return o}function fw(n,l,o){var s=n.__transition,r;s[l]=o,o.timer=r0(c,0,o.time);function c(h){o.state=Lp,o.timer.restart(d,o.delay,o.time),o.delay<=h&&d(h-o.delay)}function d(h){var y,v,p,x;if(o.state!==Lp)return m();for(y in s)if(x=s[y],x.name===o.name){if(x.state===gr)return Hp(d);x.state===Up?(x.state=mr,x.timer.stop(),x.on.call("interrupt",n,n.__data__,x.index,x.group),delete s[y]):+y<l&&(x.state=mr,x.timer.stop(),x.on.call("cancel",n,n.__data__,x.index,x.group),delete s[y])}if(Hp(function(){o.state===gr&&(o.state=Up,o.timer.restart(g,o.delay,o.time),g(h))}),o.state=qf,o.on.call("start",n,n.__data__,o.index,o.group),o.state===qf){for(o.state=gr,r=new Array(p=o.tween.length),y=0,v=-1;y<p;++y)(x=o.tween[y].value.call(n,n.__data__,o.index,o.group))&&(r[++v]=x);r.length=v+1}}function g(h){for(var y=h<o.duration?o.ease.call(null,h/o.duration):(o.timer.restart(m),o.state=Gf,1),v=-1,p=r.length;++v<p;)r[v].call(n,y);o.state===Gf&&(o.on.call("end",n,n.__data__,o.index,o.group),m())}function m(){o.state=mr,o.timer.stop(),delete s[l];for(var h in s)return;delete n.__transition}}function pr(n,l){var o=n.__transition,s,r,c=!0,d;if(o){l=l==null?null:l+"";for(d in o){if((s=o[d]).name!==l){c=!1;continue}r=s.state>qf&&s.state<Gf,s.state=mr,s.timer.stop(),s.on.call(r?"interrupt":"cancel",n,n.__data__,s.index,s.group),delete o[d]}c&&delete n.__transition}}function dw(n){return this.each(function(){pr(this,n)})}function hw(n,l){var o,s;return function(){var r=pn(this,n),c=r.tween;if(c!==o){s=o=c;for(var d=0,g=s.length;d<g;++d)if(s[d].name===l){s=s.slice(),s.splice(d,1);break}}r.tween=s}}function gw(n,l,o){var s,r;if(typeof o!="function")throw new Error;return function(){var c=pn(this,n),d=c.tween;if(d!==s){r=(s=d).slice();for(var g={name:l,value:o},m=0,h=r.length;m<h;++m)if(r[m].name===l){r[m]=g;break}m===h&&r.push(g)}c.tween=r}}function mw(n,l){var o=this._id;if(n+="",arguments.length<2){for(var s=ln(this.node(),o).tween,r=0,c=s.length,d;r<c;++r)if((d=s[r]).name===n)return d.value;return null}return this.each((l==null?hw:gw)(o,n,l))}function ed(n,l,o){var s=n._id;return n.each(function(){var r=pn(this,s);(r.value||(r.value={}))[l]=o.apply(this,arguments)}),function(r){return ln(r,s).value[l]}}function c0(n,l){var o;return(typeof l=="number"?dn:l instanceof tl?xr:(o=tl(l))?(l=o,xr):a0)(n,l)}function pw(n){return function(){this.removeAttribute(n)}}function yw(n){return function(){this.removeAttributeNS(n.space,n.local)}}function vw(n,l,o){var s,r=o+"",c;return function(){var d=this.getAttribute(n);return d===r?null:d===s?c:c=l(s=d,o)}}function Sw(n,l,o){var s,r=o+"",c;return function(){var d=this.getAttributeNS(n.space,n.local);return d===r?null:d===s?c:c=l(s=d,o)}}function bw(n,l,o){var s,r,c;return function(){var d,g=o(this),m;return g==null?void this.removeAttribute(n):(d=this.getAttribute(n),m=g+"",d===m?null:d===s&&m===r?c:(r=m,c=l(s=d,g)))}}function xw(n,l,o){var s,r,c;return function(){var d,g=o(this),m;return g==null?void this.removeAttributeNS(n.space,n.local):(d=this.getAttributeNS(n.space,n.local),m=g+"",d===m?null:d===s&&m===r?c:(r=m,c=l(s=d,g)))}}function Ew(n,l){var o=zr(n),s=o==="transform"?tw:c0;return this.attrTween(n,typeof l=="function"?(o.local?xw:bw)(o,s,ed(this,"attr."+n,l)):l==null?(o.local?yw:pw)(o):(o.local?Sw:vw)(o,s,l))}function ww(n,l){return function(o){this.setAttribute(n,l.call(this,o))}}function _w(n,l){return function(o){this.setAttributeNS(n.space,n.local,l.call(this,o))}}function Nw(n,l){var o,s;function r(){var c=l.apply(this,arguments);return c!==s&&(o=(s=c)&&_w(n,c)),o}return r._value=l,r}function Aw(n,l){var o,s;function r(){var c=l.apply(this,arguments);return c!==s&&(o=(s=c)&&ww(n,c)),o}return r._value=l,r}function Tw(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 s=zr(n);return this.tween(o,(s.local?Nw:Aw)(s,l))}function Cw(n,l){return function(){Wf(this,n).delay=+l.apply(this,arguments)}}function Mw(n,l){return l=+l,function(){Wf(this,n).delay=l}}function zw(n){var l=this._id;return arguments.length?this.each((typeof n=="function"?Cw:Mw)(l,n)):ln(this.node(),l).delay}function Dw(n,l){return function(){pn(this,n).duration=+l.apply(this,arguments)}}function Rw(n,l){return l=+l,function(){pn(this,n).duration=l}}function Ow(n){var l=this._id;return arguments.length?this.each((typeof n=="function"?Dw:Rw)(l,n)):ln(this.node(),l).duration}function jw(n,l){if(typeof l!="function")throw new Error;return function(){pn(this,n).ease=l}}function Hw(n){var l=this._id;return arguments.length?this.each(jw(l,n)):ln(this.node(),l).ease}function Lw(n,l){return function(){var o=l.apply(this,arguments);if(typeof o!="function")throw new Error;pn(this,n).ease=o}}function Uw(n){if(typeof n!="function")throw new Error;return this.each(Lw(this._id,n))}function Bw(n){typeof n!="function"&&(n=Yy(n));for(var l=this._groups,o=l.length,s=new Array(o),r=0;r<o;++r)for(var c=l[r],d=c.length,g=s[r]=[],m,h=0;h<d;++h)(m=c[h])&&n.call(m,m.__data__,h,c)&&g.push(m);return new In(s,this._parents,this._name,this._id)}function qw(n){if(n._id!==this._id)throw new Error;for(var l=this._groups,o=n._groups,s=l.length,r=o.length,c=Math.min(s,r),d=new Array(s),g=0;g<c;++g)for(var m=l[g],h=o[g],y=m.length,v=d[g]=new Array(y),p,x=0;x<y;++x)(p=m[x]||h[x])&&(v[x]=p);for(;g<s;++g)d[g]=l[g];return new In(d,this._parents,this._name,this._id)}function Gw(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 Yw(n,l,o){var s,r,c=Gw(l)?Wf:pn;return function(){var d=c(this,n),g=d.on;g!==s&&(r=(s=g).copy()).on(l,o),d.on=r}}function kw(n,l){var o=this._id;return arguments.length<2?ln(this.node(),o).on.on(n):this.each(Yw(o,n,l))}function Iw(n){return function(){var l=this.parentNode;for(var o in this.__transition)if(+o!==n)return;l&&l.removeChild(this)}}function Vw(){return this.on("end.remove",Iw(this._id))}function Xw(n){var l=this._name,o=this._id;typeof n!="function"&&(n=Qf(n));for(var s=this._groups,r=s.length,c=new Array(r),d=0;d<r;++d)for(var g=s[d],m=g.length,h=c[d]=new Array(m),y,v,p=0;p<m;++p)(y=g[p])&&(v=n.call(y,y.__data__,p,g))&&("__data__"in y&&(v.__data__=y.__data__),h[p]=v,Rr(h[p],l,o,p,h,ln(y,o)));return new In(c,this._parents,l,o)}function Zw(n){var l=this._name,o=this._id;typeof n!="function"&&(n=Gy(n));for(var s=this._groups,r=s.length,c=[],d=[],g=0;g<r;++g)for(var m=s[g],h=m.length,y,v=0;v<h;++v)if(y=m[v]){for(var p=n.call(y,y.__data__,v,m),x,_=ln(y,o),M=0,A=p.length;M<A;++M)(x=p[M])&&Rr(x,l,o,M,p,_);c.push(p),d.push(y)}return new In(c,d,l,o)}var $w=No.prototype.constructor;function Qw(){return new $w(this._groups,this._parents)}function Kw(n,l){var o,s,r;return function(){var c=ti(this,n),d=(this.style.removeProperty(n),ti(this,n));return c===d?null:c===o&&d===s?r:r=l(o=c,s=d)}}function f0(n){return function(){this.style.removeProperty(n)}}function Fw(n,l,o){var s,r=o+"",c;return function(){var d=ti(this,n);return d===r?null:d===s?c:c=l(s=d,o)}}function Jw(n,l,o){var s,r,c;return function(){var d=ti(this,n),g=o(this),m=g+"";return g==null&&(m=g=(this.style.removeProperty(n),ti(this,n))),d===m?null:d===s&&m===r?c:(r=m,c=l(s=d,g))}}function Pw(n,l){var o,s,r,c="style."+l,d="end."+c,g;return function(){var m=pn(this,n),h=m.on,y=m.value[c]==null?g||(g=f0(l)):void 0;(h!==o||r!==y)&&(s=(o=h).copy()).on(d,r=y),m.on=s}}function Ww(n,l,o){var s=(n+="")=="transform"?ew:c0;return l==null?this.styleTween(n,Kw(n,s)).on("end.style."+n,f0(n)):typeof l=="function"?this.styleTween(n,Jw(n,s,ed(this,"style."+n,l))).each(Pw(this._id,n)):this.styleTween(n,Fw(n,s,l),o).on("end.style."+n,null)}function e_(n,l,o){return function(s){this.style.setProperty(n,l.call(this,s),o)}}function t_(n,l,o){var s,r;function c(){var d=l.apply(this,arguments);return d!==r&&(s=(r=d)&&e_(n,d,o)),s}return c._value=l,c}function n_(n,l,o){var s="style."+(n+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(l==null)return this.tween(s,null);if(typeof l!="function")throw new Error;return this.tween(s,t_(n,l,o??""))}function a_(n){return function(){this.textContent=n}}function l_(n){return function(){var l=n(this);this.textContent=l??""}}function i_(n){return this.tween("text",typeof n=="function"?l_(ed(this,"text",n)):a_(n==null?"":n+""))}function o_(n){return function(l){this.textContent=n.call(this,l)}}function s_(n){var l,o;function s(){var r=n.apply(this,arguments);return r!==o&&(l=(o=r)&&o_(r)),l}return s._value=n,s}function r_(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,s_(n))}function u_(){for(var n=this._name,l=this._id,o=d0(),s=this._groups,r=s.length,c=0;c<r;++c)for(var d=s[c],g=d.length,m,h=0;h<g;++h)if(m=d[h]){var y=ln(m,l);Rr(m,n,o,h,d,{time:y.time+y.delay+y.duration,delay:0,duration:y.duration,ease:y.ease})}return new In(s,this._parents,n,o)}function c_(){var n,l,o=this,s=o._id,r=o.size();return new Promise(function(c,d){var g={value:d},m={value:function(){--r===0&&c()}};o.each(function(){var h=pn(this,s),y=h.on;y!==n&&(l=(n=y).copy(),l._.cancel.push(g),l._.interrupt.push(g),l._.end.push(m)),h.on=l}),r===0&&c()})}var f_=0;function In(n,l,o,s){this._groups=n,this._parents=l,this._name=o,this._id=s}function d0(){return++f_}var Gn=No.prototype;In.prototype={constructor:In,select:Xw,selectAll:Zw,selectChild:Gn.selectChild,selectChildren:Gn.selectChildren,filter:Bw,merge:qw,selection:Qw,transition:u_,call:Gn.call,nodes:Gn.nodes,node:Gn.node,size:Gn.size,empty:Gn.empty,each:Gn.each,on:kw,attr:Ew,attrTween:Tw,style:Ww,styleTween:n_,text:i_,textTween:r_,remove:Vw,tween:mw,delay:zw,duration:Ow,ease:Hw,easeVarying:Uw,end:c_,[Symbol.iterator]:Gn[Symbol.iterator]};function d_(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var h_={time:null,delay:0,duration:250,ease:d_};function g_(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 In?(l=n._id,n=n._name):(l=d0(),(o=h_).time=Pf(),n=n==null?null:n+"");for(var s=this._groups,r=s.length,c=0;c<r;++c)for(var d=s[c],g=d.length,m,h=0;h<g;++h)(m=d[h])&&Rr(m,n,l,h,d,o||g_(m,l));return new In(s,this._parents,n,l)}No.prototype.interrupt=dw;No.prototype.transition=m_;const or=n=>()=>n;function p_(n,{sourceEvent:l,target:o,transform:s,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:s,enumerable:!0,configurable:!0},_:{value:r}})}function kn(n,l,o){this.k=n,this.x=l,this.y=o}kn.prototype={constructor:kn,scale:function(n){return n===1?this:new kn(this.k*n,this.x,this.y)},translate:function(n,l){return n===0&l===0?this:new kn(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 Or=new kn(1,0,0);h0.prototype=kn.prototype;function h0(n){for(;!n.__zoom;)if(!(n=n.parentNode))return Or;return n.__zoom}function bf(n){n.stopImmediatePropagation()}function io(n){n.preventDefault(),n.stopImmediatePropagation()}function y_(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function v_(){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 Bp(){return this.__zoom||Or}function S_(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function b_(){return navigator.maxTouchPoints||"ontouchstart"in this}function x_(n,l,o){var s=n.invertX(l[0][0])-o[0][0],r=n.invertX(l[1][0])-o[1][0],c=n.invertY(l[0][1])-o[0][1],d=n.invertY(l[1][1])-o[1][1];return n.translate(r>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),d>c?(c+d)/2:Math.min(0,c)||Math.max(0,d))}function g0(){var n=y_,l=v_,o=x_,s=S_,r=b_,c=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],g=250,m=hr,h=Mr("start","zoom","end"),y,v,p,x=500,_=150,M=0,A=10;function T(z){z.property("__zoom",Bp).on("wheel.zoom",H,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",V).filter(r).on("touchstart.zoom",k).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",te).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}T.transform=function(z,I,N,j){var G=z.selection?z.selection():z;G.property("__zoom",Bp),z!==G?Y(z,I,N,j):G.interrupt().each(function(){R(this,arguments).event(j).start().zoom(null,typeof I=="function"?I.apply(this,arguments):I).end()})},T.scaleBy=function(z,I,N,j){T.scaleTo(z,function(){var G=this.__zoom.k,Q=typeof I=="function"?I.apply(this,arguments):I;return G*Q},N,j)},T.scaleTo=function(z,I,N,j){T.transform(z,function(){var G=l.apply(this,arguments),Q=this.__zoom,ne=N==null?D(G):typeof N=="function"?N.apply(this,arguments):N,C=Q.invert(ne),U=typeof I=="function"?I.apply(this,arguments):I;return o(E(B(Q,U),ne,C),G,d)},N,j)},T.translateBy=function(z,I,N,j){T.transform(z,function(){return o(this.__zoom.translate(typeof I=="function"?I.apply(this,arguments):I,typeof N=="function"?N.apply(this,arguments):N),l.apply(this,arguments),d)},null,j)},T.translateTo=function(z,I,N,j,G){T.transform(z,function(){var Q=l.apply(this,arguments),ne=this.__zoom,C=j==null?D(Q):typeof j=="function"?j.apply(this,arguments):j;return o(Or.translate(C[0],C[1]).scale(ne.k).translate(typeof I=="function"?-I.apply(this,arguments):-I,typeof N=="function"?-N.apply(this,arguments):-N),Q,d)},j,G)};function B(z,I){return I=Math.max(c[0],Math.min(c[1],I)),I===z.k?z:new kn(I,z.x,z.y)}function E(z,I,N){var j=I[0]-N[0]*z.k,G=I[1]-N[1]*z.k;return j===z.x&&G===z.y?z:new kn(z.k,j,G)}function D(z){return[(+z[0][0]+ +z[1][0])/2,(+z[0][1]+ +z[1][1])/2]}function Y(z,I,N,j){z.on("start.zoom",function(){R(this,arguments).event(j).start()}).on("interrupt.zoom end.zoom",function(){R(this,arguments).event(j).end()}).tween("zoom",function(){var G=this,Q=arguments,ne=R(G,Q).event(j),C=l.apply(G,Q),U=N==null?D(C):typeof N=="function"?N.apply(G,Q):N,ee=Math.max(C[1][0]-C[0][0],C[1][1]-C[0][1]),ae=G.__zoom,ue=typeof I=="function"?I.apply(G,Q):I,fe=m(ae.invert(U).concat(ee/ae.k),ue.invert(U).concat(ee/ue.k));return function(ce){if(ce===1)ce=ue;else{var re=fe(ce),de=ee/re[2];ce=new kn(de,U[0]-re[0]*de,U[1]-re[1]*de)}ne.zoom(null,ce)}})}function R(z,I,N){return!N&&z.__zooming||new L(z,I)}function L(z,I){this.that=z,this.args=I,this.active=0,this.sourceEvent=null,this.extent=l.apply(z,I),this.taps=0}L.prototype={event:function(z){return z&&(this.sourceEvent=z),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(z,I){return this.mouse&&z!=="mouse"&&(this.mouse[1]=I.invert(this.mouse[0])),this.touch0&&z!=="touch"&&(this.touch0[1]=I.invert(this.touch0[0])),this.touch1&&z!=="touch"&&(this.touch1[1]=I.invert(this.touch1[0])),this.that.__zoom=I,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(z){var I=Bt(this.that).datum();h.call(z,this.that,new p_(z,{sourceEvent:this.sourceEvent,target:T,transform:this.that.__zoom,dispatch:h}),I)}};function H(z,...I){if(!n.apply(this,arguments))return;var N=R(this,I).event(z),j=this.__zoom,G=Math.max(c[0],Math.min(c[1],j.k*Math.pow(2,s.apply(this,arguments)))),Q=en(z);if(N.wheel)(N.mouse[0][0]!==Q[0]||N.mouse[0][1]!==Q[1])&&(N.mouse[1]=j.invert(N.mouse[0]=Q)),clearTimeout(N.wheel);else{if(j.k===G)return;N.mouse=[Q,j.invert(Q)],pr(this),N.start()}io(z),N.wheel=setTimeout(ne,_),N.zoom("mouse",o(E(B(j,G),N.mouse[0],N.mouse[1]),N.extent,d));function ne(){N.wheel=null,N.end()}}function $(z,...I){if(p||!n.apply(this,arguments))return;var N=z.currentTarget,j=R(this,I,!0).event(z),G=Bt(z.view).on("mousemove.zoom",U,!0).on("mouseup.zoom",ee,!0),Q=en(z,N),ne=z.clientX,C=z.clientY;Jy(z.view),bf(z),j.mouse=[Q,this.__zoom.invert(Q)],pr(this),j.start();function U(ae){if(io(ae),!j.moved){var ue=ae.clientX-ne,fe=ae.clientY-C;j.moved=ue*ue+fe*fe>M}j.event(ae).zoom("mouse",o(E(j.that.__zoom,j.mouse[0]=en(ae,N),j.mouse[1]),j.extent,d))}function ee(ae){G.on("mousemove.zoom mouseup.zoom",null),Py(ae.view,j.moved),io(ae),j.event(ae).end()}}function V(z,...I){if(n.apply(this,arguments)){var N=this.__zoom,j=en(z.changedTouches?z.changedTouches[0]:z,this),G=N.invert(j),Q=N.k*(z.shiftKey?.5:2),ne=o(E(B(N,Q),j,G),l.apply(this,I),d);io(z),g>0?Bt(this).transition().duration(g).call(Y,ne,j,z):Bt(this).call(T.transform,ne,j,z)}}function k(z,...I){if(n.apply(this,arguments)){var N=z.touches,j=N.length,G=R(this,I,z.changedTouches.length===j).event(z),Q,ne,C,U;for(bf(z),ne=0;ne<j;++ne)C=N[ne],U=en(C,this),U=[U,this.__zoom.invert(U),C.identifier],G.touch0?!G.touch1&&G.touch0[2]!==U[2]&&(G.touch1=U,G.taps=0):(G.touch0=U,Q=!0,G.taps=1+!!y);y&&(y=clearTimeout(y)),Q&&(G.taps<2&&(v=U[0],y=setTimeout(function(){y=null},x)),pr(this),G.start())}}function P(z,...I){if(this.__zooming){var N=R(this,I).event(z),j=z.changedTouches,G=j.length,Q,ne,C,U;for(io(z),Q=0;Q<G;++Q)ne=j[Q],C=en(ne,this),N.touch0&&N.touch0[2]===ne.identifier?N.touch0[0]=C:N.touch1&&N.touch1[2]===ne.identifier&&(N.touch1[0]=C);if(ne=N.that.__zoom,N.touch1){var ee=N.touch0[0],ae=N.touch0[1],ue=N.touch1[0],fe=N.touch1[1],ce=(ce=ue[0]-ee[0])*ce+(ce=ue[1]-ee[1])*ce,re=(re=fe[0]-ae[0])*re+(re=fe[1]-ae[1])*re;ne=B(ne,Math.sqrt(ce/re)),C=[(ee[0]+ue[0])/2,(ee[1]+ue[1])/2],U=[(ae[0]+fe[0])/2,(ae[1]+fe[1])/2]}else if(N.touch0)C=N.touch0[0],U=N.touch0[1];else return;N.zoom("touch",o(E(ne,C,U),N.extent,d))}}function te(z,...I){if(this.__zooming){var N=R(this,I).event(z),j=z.changedTouches,G=j.length,Q,ne;for(bf(z),p&&clearTimeout(p),p=setTimeout(function(){p=null},x),Q=0;Q<G;++Q)ne=j[Q],N.touch0&&N.touch0[2]===ne.identifier?delete N.touch0:N.touch1&&N.touch1[2]===ne.identifier&&delete N.touch1;if(N.touch1&&!N.touch0&&(N.touch0=N.touch1,delete N.touch1),N.touch0)N.touch0[1]=this.__zoom.invert(N.touch0[0]);else if(N.end(),N.taps===2&&(ne=en(ne,this),Math.hypot(v[0]-ne[0],v[1]-ne[1])<A)){var C=Bt(this).on("dblclick.zoom");C&&C.apply(this,arguments)}}}return T.wheelDelta=function(z){return arguments.length?(s=typeof z=="function"?z:or(+z),T):s},T.filter=function(z){return arguments.length?(n=typeof z=="function"?z:or(!!z),T):n},T.touchable=function(z){return arguments.length?(r=typeof z=="function"?z:or(!!z),T):r},T.extent=function(z){return arguments.length?(l=typeof z=="function"?z:or([[+z[0][0],+z[0][1]],[+z[1][0],+z[1][1]]]),T):l},T.scaleExtent=function(z){return arguments.length?(c[0]=+z[0],c[1]=+z[1],T):[c[0],c[1]]},T.translateExtent=function(z){return arguments.length?(d[0][0]=+z[0][0],d[1][0]=+z[1][0],d[0][1]=+z[0][1],d[1][1]=+z[1][1],T):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},T.constrain=function(z){return arguments.length?(o=z,T):o},T.duration=function(z){return arguments.length?(g=+z,T):g},T.interpolate=function(z){return arguments.length?(m=z,T):m},T.on=function(){var z=h.on.apply(h,arguments);return z===h?T:z},T.clickDistance=function(z){return arguments.length?(M=(z=+z)*z,T):Math.sqrt(M)},T.tapDistance=function(z){return arguments.length?(A=+z,T):A},T}const mn={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:s})=>`Couldn't create edge for ${n} handle id: "${n==="source"?o:s}", 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."},So=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],m0=["Enter"," ","Escape"],p0={"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 ai;(function(n){n.Strict="strict",n.Loose="loose"})(ai||(ai={}));var el;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(el||(el={}));var bo;(function(n){n.Partial="partial",n.Full="full"})(bo||(bo={}));const y0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var wa;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(wa||(wa={}));var Nr;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(Nr||(Nr={}));var me;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(me||(me={}));const qp={[me.Left]:me.Right,[me.Right]:me.Left,[me.Top]:me.Bottom,[me.Bottom]:me.Top};function v0(n){return n===null?null:n?"valid":"invalid"}const S0=n=>"id"in n&&"source"in n&&"target"in n,E_=n=>"id"in n&&"position"in n&&!("source"in n)&&!("target"in n),td=n=>"id"in n&&"internals"in n&&!("source"in n)&&!("target"in n),To=(n,l=[0,0])=>{const{width:o,height:s}=Vn(n),r=n.origin??l,c=o*r[0],d=s*r[1];return{x:n.position.x-c,y:n.position.y-d}},w_=(n,l={nodeOrigin:[0,0]})=>{if(n.length===0)return{x:0,y:0,width:0,height:0};const o=n.reduce((s,r)=>{const c=typeof r=="string";let d=!l.nodeLookup&&!c?r:void 0;l.nodeLookup&&(d=c?l.nodeLookup.get(r):td(r)?r:l.nodeLookup.get(r.id));const g=d?Ar(d,l.nodeOrigin):{x:0,y:0,x2:0,y2:0};return jr(s,g)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Hr(o)},Co=(n,l={})=>{let o={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return n.forEach(r=>{(l.filter===void 0||l.filter(r))&&(o=jr(o,Ar(r)),s=!0)}),s?Hr(o):{x:0,y:0,width:0,height:0}},nd=(n,l,[o,s,r]=[0,0,1],c=!1,d=!1)=>{const g={...zo(l,[o,s,r]),width:l.width/r,height:l.height/r},m=[];for(const h of n.values()){const{measured:y,selectable:v=!0,hidden:p=!1}=h;if(d&&!v||p)continue;const x=y.width??h.width??h.initialWidth??null,_=y.height??h.height??h.initialHeight??null,M=xo(g,ii(h)),A=(x??0)*(_??0),T=c&&M>0;(!h.internals.handleBounds||T||M>=A||h.dragging)&&m.push(h)}return m},__=(n,l)=>{const o=new Set;return n.forEach(s=>{o.add(s.id)}),l.filter(s=>o.has(s.source)||o.has(s.target))};function N_(n,l){const o=new Map,s=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)&&(!s||s.has(r.id))&&o.set(r.id,r)}),o}async function A_({nodes:n,width:l,height:o,panZoom:s,minZoom:r,maxZoom:c},d){if(n.size===0)return Promise.resolve(!0);const g=N_(n,d),m=Co(g),h=ad(m,l,o,d?.minZoom??r,d?.maxZoom??c,d?.padding??.1);return await s.setViewport(h,{duration:d?.duration,ease:d?.ease,interpolate:d?.interpolate}),Promise.resolve(!0)}function b0({nodeId:n,nextPosition:l,nodeLookup:o,nodeOrigin:s=[0,0],nodeExtent:r,onError:c}){const d=o.get(n),g=d.parentId?o.get(d.parentId):void 0,{x:m,y:h}=g?g.internals.positionAbsolute:{x:0,y:0},y=d.origin??s;let v=d.extent||r;if(d.extent==="parent"&&!d.expandParent)if(!g)c?.("005",mn.error005());else{const x=g.measured.width,_=g.measured.height;x&&_&&(v=[[m,h],[m+x,h+_]])}else g&&oi(d.extent)&&(v=[[d.extent[0][0]+m,d.extent[0][1]+h],[d.extent[1][0]+m,d.extent[1][1]+h]]);const p=oi(v)?al(l,v,d.measured):l;return(d.measured.width===void 0||d.measured.height===void 0)&&c?.("015",mn.error015()),{position:{x:p.x-m+(d.measured.width??0)*y[0],y:p.y-h+(d.measured.height??0)*y[1]},positionAbsolute:p}}async function T_({nodesToRemove:n=[],edgesToRemove:l=[],nodes:o,edges:s,onBeforeDelete:r}){const c=new Set(n.map(p=>p.id)),d=[];for(const p of o){if(p.deletable===!1)continue;const x=c.has(p.id),_=!x&&p.parentId&&d.find(M=>M.id===p.parentId);(x||_)&&d.push(p)}const g=new Set(l.map(p=>p.id)),m=s.filter(p=>p.deletable!==!1),y=__(d,m);for(const p of m)g.has(p.id)&&!y.find(_=>_.id===p.id)&&y.push(p);if(!r)return{edges:y,nodes:d};const v=await r({nodes:d,edges:y});return typeof v=="boolean"?v?{edges:y,nodes:d}:{edges:[],nodes:[]}:v}const li=(n,l=0,o=1)=>Math.min(Math.max(n,l),o),al=(n={x:0,y:0},l,o)=>({x:li(n.x,l[0][0],l[1][0]-(o?.width??0)),y:li(n.y,l[0][1],l[1][1]-(o?.height??0))});function x0(n,l,o){const{width:s,height:r}=Vn(o),{x:c,y:d}=o.internals.positionAbsolute;return al(n,[[c,d],[c+s,d+r]],l)}const Gp=(n,l,o)=>n<l?li(Math.abs(n-l),1,l)/l:n>o?-li(Math.abs(n-o),1,l)/l:0,E0=(n,l,o=15,s=40)=>{const r=Gp(n.x,s,l.width-s)*o,c=Gp(n.y,s,l.height-s)*o;return[r,c]},jr=(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)}),Yf=({x:n,y:l,width:o,height:s})=>({x:n,y:l,x2:n+o,y2:l+s}),Hr=({x:n,y:l,x2:o,y2:s})=>({x:n,y:l,width:o-n,height:s-l}),ii=(n,l=[0,0])=>{const{x:o,y:s}=td(n)?n.internals.positionAbsolute:To(n,l);return{x:o,y:s,width:n.measured?.width??n.width??n.initialWidth??0,height:n.measured?.height??n.height??n.initialHeight??0}},Ar=(n,l=[0,0])=>{const{x:o,y:s}=td(n)?n.internals.positionAbsolute:To(n,l);return{x:o,y:s,x2:o+(n.measured?.width??n.width??n.initialWidth??0),y2:s+(n.measured?.height??n.height??n.initialHeight??0)}},w0=(n,l)=>Hr(jr(Yf(n),Yf(l))),xo=(n,l)=>{const o=Math.max(0,Math.min(n.x+n.width,l.x+l.width)-Math.max(n.x,l.x)),s=Math.max(0,Math.min(n.y+n.height,l.y+l.height)-Math.max(n.y,l.y));return Math.ceil(o*s)},Yp=n=>nn(n.width)&&nn(n.height)&&nn(n.x)&&nn(n.y),nn=n=>!isNaN(n)&&isFinite(n),C_=(n,l)=>{},Mo=(n,l=[1,1])=>({x:l[0]*Math.round(n.x/l[0]),y:l[1]*Math.round(n.y/l[1])}),zo=({x:n,y:l},[o,s,r],c=!1,d=[1,1])=>{const g={x:(n-o)/r,y:(l-s)/r};return c?Mo(g,d):g},Tr=({x:n,y:l},[o,s,r])=>({x:n*r+o,y:l*r+s});function Kl(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 M_(n,l,o){if(typeof n=="string"||typeof n=="number"){const s=Kl(n,o),r=Kl(n,l);return{top:s,right:r,bottom:s,left:r,x:r*2,y:s*2}}if(typeof n=="object"){const s=Kl(n.top??n.y??0,o),r=Kl(n.bottom??n.y??0,o),c=Kl(n.left??n.x??0,l),d=Kl(n.right??n.x??0,l);return{top:s,right:d,bottom:r,left:c,x:c+d,y:s+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function z_(n,l,o,s,r,c){const{x:d,y:g}=Tr(n,[l,o,s]),{x:m,y:h}=Tr({x:n.x+n.width,y:n.y+n.height},[l,o,s]),y=r-m,v=c-h;return{left:Math.floor(d),top:Math.floor(g),right:Math.floor(y),bottom:Math.floor(v)}}const ad=(n,l,o,s,r,c)=>{const d=M_(c,l,o),g=(l-d.x)/n.width,m=(o-d.y)/n.height,h=Math.min(g,m),y=li(h,s,r),v=n.x+n.width/2,p=n.y+n.height/2,x=l/2-v*y,_=o/2-p*y,M=z_(n,x,_,y,l,o),A={left:Math.min(M.left-d.left,0),top:Math.min(M.top-d.top,0),right:Math.min(M.right-d.right,0),bottom:Math.min(M.bottom-d.bottom,0)};return{x:x-A.left+A.right,y:_-A.top+A.bottom,zoom:y}},Eo=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function oi(n){return n!=null&&n!=="parent"}function Vn(n){return{width:n.measured?.width??n.width??n.initialWidth??0,height:n.measured?.height??n.height??n.initialHeight??0}}function _0(n){return(n.measured?.width??n.width??n.initialWidth)!==void 0&&(n.measured?.height??n.height??n.initialHeight)!==void 0}function N0(n,l={width:0,height:0},o,s,r){const c={...n},d=s.get(o);if(d){const g=d.origin||r;c.x+=d.internals.positionAbsolute.x-(l.width??0)*g[0],c.y+=d.internals.positionAbsolute.y-(l.height??0)*g[1]}return c}function kp(n,l){if(n.size!==l.size)return!1;for(const o of n)if(!l.has(o))return!1;return!0}function D_(){let n,l;return{promise:new Promise((s,r)=>{n=s,l=r}),resolve:n,reject:l}}function R_(n){return{...p0,...n||{}}}function go(n,{snapGrid:l=[0,0],snapToGrid:o=!1,transform:s,containerBounds:r}){const{x:c,y:d}=an(n),g=zo({x:c-(r?.left??0),y:d-(r?.top??0)},s),{x:m,y:h}=o?Mo(g,l):g;return{xSnapped:m,ySnapped:h,...g}}const ld=n=>({width:n.offsetWidth,height:n.offsetHeight}),A0=n=>n?.getRootNode?.()||window?.document,O_=["INPUT","SELECT","TEXTAREA"];function T0(n){const l=n.composedPath?.()?.[0]||n.target;return l?.nodeType!==1?!1:O_.includes(l.nodeName)||l.hasAttribute("contenteditable")||!!l.closest(".nokey")}const C0=n=>"clientX"in n,an=(n,l)=>{const o=C0(n),s=o?n.clientX:n.touches?.[0].clientX,r=o?n.clientY:n.touches?.[0].clientY;return{x:s-(l?.left??0),y:r-(l?.top??0)}},Ip=(n,l,o,s,r)=>{const c=l.querySelectorAll(`.${n}`);return!c||!c.length?null:Array.from(c).map(d=>{const g=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:n,nodeId:r,position:d.getAttribute("data-handlepos"),x:(g.left-o.left)/s,y:(g.top-o.top)/s,...ld(d)}})};function M0({sourceX:n,sourceY:l,targetX:o,targetY:s,sourceControlX:r,sourceControlY:c,targetControlX:d,targetControlY:g}){const m=n*.125+r*.375+d*.375+o*.125,h=l*.125+c*.375+g*.375+s*.125,y=Math.abs(m-n),v=Math.abs(h-l);return[m,h,y,v]}function sr(n,l){return n>=0?.5*n:l*25*Math.sqrt(-n)}function Vp({pos:n,x1:l,y1:o,x2:s,y2:r,c}){switch(n){case me.Left:return[l-sr(l-s,c),o];case me.Right:return[l+sr(s-l,c),o];case me.Top:return[l,o-sr(o-r,c)];case me.Bottom:return[l,o+sr(r-o,c)]}}function z0({sourceX:n,sourceY:l,sourcePosition:o=me.Bottom,targetX:s,targetY:r,targetPosition:c=me.Top,curvature:d=.25}){const[g,m]=Vp({pos:o,x1:n,y1:l,x2:s,y2:r,c:d}),[h,y]=Vp({pos:c,x1:s,y1:r,x2:n,y2:l,c:d}),[v,p,x,_]=M0({sourceX:n,sourceY:l,targetX:s,targetY:r,sourceControlX:g,sourceControlY:m,targetControlX:h,targetControlY:y});return[`M${n},${l} C${g},${m} ${h},${y} ${s},${r}`,v,p,x,_]}function D0({sourceX:n,sourceY:l,targetX:o,targetY:s}){const r=Math.abs(o-n)/2,c=o<n?o+r:o-r,d=Math.abs(s-l)/2,g=s<l?s+d:s-d;return[c,g,r,d]}function j_({sourceNode:n,targetNode:l,selected:o=!1,zIndex:s=0,elevateOnSelect:r=!1,zIndexMode:c="basic"}){if(c==="manual")return s;const d=r&&o?s+1e3:s,g=Math.max(n.parentId||r&&n.selected?n.internals.z:0,l.parentId||r&&l.selected?l.internals.z:0);return d+g}function H_({sourceNode:n,targetNode:l,width:o,height:s,transform:r}){const c=jr(Ar(n),Ar(l));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const d={x:-r[0]/r[2],y:-r[1]/r[2],width:o/r[2],height:s/r[2]};return xo(d,Hr(c))>0}const L_=({source:n,sourceHandle:l,target:o,targetHandle:s})=>`xy-edge__${n}${l||""}-${o}${s||""}`,U_=(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)),B_=(n,l,o={})=>{if(!n.source||!n.target)return l;const s=o.getEdgeId||L_;let r;return S0(n)?r={...n}:r={...n,id:s(n)},U_(r,l)?l:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,l.concat(r))};function R0({sourceX:n,sourceY:l,targetX:o,targetY:s}){const[r,c,d,g]=D0({sourceX:n,sourceY:l,targetX:o,targetY:s});return[`M ${n},${l}L ${o},${s}`,r,c,d,g]}const Xp={[me.Left]:{x:-1,y:0},[me.Right]:{x:1,y:0},[me.Top]:{x:0,y:-1},[me.Bottom]:{x:0,y:1}},q_=({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},Zp=(n,l)=>Math.sqrt(Math.pow(l.x-n.x,2)+Math.pow(l.y-n.y,2));function G_({source:n,sourcePosition:l=me.Bottom,target:o,targetPosition:s=me.Top,center:r,offset:c,stepPosition:d}){const g=Xp[l],m=Xp[s],h={x:n.x+g.x*c,y:n.y+g.y*c},y={x:o.x+m.x*c,y:o.y+m.y*c},v=q_({source:h,sourcePosition:l,target:y}),p=v.x!==0?"x":"y",x=v[p];let _=[],M,A;const T={x:0,y:0},B={x:0,y:0},[,,E,D]=D0({sourceX:n.x,sourceY:n.y,targetX:o.x,targetY:o.y});if(g[p]*m[p]===-1){p==="x"?(M=r.x??h.x+(y.x-h.x)*d,A=r.y??(h.y+y.y)/2):(M=r.x??(h.x+y.x)/2,A=r.y??h.y+(y.y-h.y)*d);const H=[{x:M,y:h.y},{x:M,y:y.y}],$=[{x:h.x,y:A},{x:y.x,y:A}];g[p]===x?_=p==="x"?H:$:_=p==="x"?$:H}else{const H=[{x:h.x,y:y.y}],$=[{x:y.x,y:h.y}];if(p==="x"?_=g.x===x?$:H:_=g.y===x?H:$,l===s){const z=Math.abs(n[p]-o[p]);if(z<=c){const I=Math.min(c-1,c-z);g[p]===x?T[p]=(h[p]>n[p]?-1:1)*I:B[p]=(y[p]>o[p]?-1:1)*I}}if(l!==s){const z=p==="x"?"y":"x",I=g[p]===m[z],N=h[z]>y[z],j=h[z]<y[z];(g[p]===1&&(!I&&N||I&&j)||g[p]!==1&&(!I&&j||I&&N))&&(_=p==="x"?H:$)}const V={x:h.x+T.x,y:h.y+T.y},k={x:y.x+B.x,y:y.y+B.y},P=Math.max(Math.abs(V.x-_[0].x),Math.abs(k.x-_[0].x)),te=Math.max(Math.abs(V.y-_[0].y),Math.abs(k.y-_[0].y));P>=te?(M=(V.x+k.x)/2,A=_[0].y):(M=_[0].x,A=(V.y+k.y)/2)}const Y={x:h.x+T.x,y:h.y+T.y},R={x:y.x+B.x,y:y.y+B.y};return[[n,...Y.x!==_[0].x||Y.y!==_[0].y?[Y]:[],..._,...R.x!==_[_.length-1].x||R.y!==_[_.length-1].y?[R]:[],o],M,A,E,D]}function Y_(n,l,o,s){const r=Math.min(Zp(n,l)/2,Zp(l,o)/2,s),{x:c,y:d}=l;if(n.x===c&&c===o.x||n.y===d&&d===o.y)return`L${c} ${d}`;if(n.y===d){const h=n.x<o.x?-1:1,y=n.y<o.y?1:-1;return`L ${c+r*h},${d}Q ${c},${d} ${c},${d+r*y}`}const g=n.x<o.x?1:-1,m=n.y<o.y?-1:1;return`L ${c},${d+r*m}Q ${c},${d} ${c+r*g},${d}`}function kf({sourceX:n,sourceY:l,sourcePosition:o=me.Bottom,targetX:s,targetY:r,targetPosition:c=me.Top,borderRadius:d=5,centerX:g,centerY:m,offset:h=20,stepPosition:y=.5}){const[v,p,x,_,M]=G_({source:{x:n,y:l},sourcePosition:o,target:{x:s,y:r},targetPosition:c,center:{x:g,y:m},offset:h,stepPosition:y});let A=`M${v[0].x} ${v[0].y}`;for(let T=1;T<v.length-1;T++)A+=Y_(v[T-1],v[T],v[T+1],d);return A+=`L${v[v.length-1].x} ${v[v.length-1].y}`,[A,p,x,_,M]}function $p(n){return n&&!!(n.internals.handleBounds||n.handles?.length)&&!!(n.measured.width||n.width||n.initialWidth)}function k_(n){const{sourceNode:l,targetNode:o}=n;if(!$p(l)||!$p(o))return null;const s=l.internals.handleBounds||Qp(l.handles),r=o.internals.handleBounds||Qp(o.handles),c=Kp(s?.source??[],n.sourceHandle),d=Kp(n.connectionMode===ai.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),n.targetHandle);if(!c||!d)return n.onError?.("008",mn.error008(c?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;const g=c?.position||me.Bottom,m=d?.position||me.Top,h=ll(l,c,g),y=ll(o,d,m);return{sourceX:h.x,sourceY:h.y,targetX:y.x,targetY:y.y,sourcePosition:g,targetPosition:m}}function Qp(n){if(!n)return null;const l=[],o=[];for(const s of n)s.width=s.width??1,s.height=s.height??1,s.type==="source"?l.push(s):s.type==="target"&&o.push(s);return{source:l,target:o}}function ll(n,l,o=me.Left,s=!1){const r=(l?.x??0)+n.internals.positionAbsolute.x,c=(l?.y??0)+n.internals.positionAbsolute.y,{width:d,height:g}=l??Vn(n);if(s)return{x:r+d/2,y:c+g/2};switch(l?.position??o){case me.Top:return{x:r+d/2,y:c};case me.Right:return{x:r+d,y:c+g/2};case me.Bottom:return{x:r+d/2,y:c+g};case me.Left:return{x:r,y:c+g/2}}}function Kp(n,l){return n&&(l?n.find(o=>o.id===l):n[0])||null}function If(n,l){return n?typeof n=="string"?n:`${l?`${l}__`:""}${Object.keys(n).sort().map(s=>`${s}=${n[s]}`).join("&")}`:""}function I_(n,{id:l,defaultColor:o,defaultMarkerStart:s,defaultMarkerEnd:r}){const c=new Set;return n.reduce((d,g)=>([g.markerStart||s,g.markerEnd||r].forEach(m=>{if(m&&typeof m=="object"){const h=If(m,l);c.has(h)||(d.push({id:h,color:m.color||o,...m}),c.add(h))}}),d),[]).sort((d,g)=>d.id.localeCompare(g.id))}const O0=1e3,V_=10,id={nodeOrigin:[0,0],nodeExtent:So,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},X_={...id,checkEquality:!0};function od(n,l){const o={...n};for(const s in l)l[s]!==void 0&&(o[s]=l[s]);return o}function Z_(n,l,o){const s=od(id,o);for(const r of n.values())if(r.parentId)rd(r,n,l,s);else{const c=To(r,s.nodeOrigin),d=oi(r.extent)?r.extent:s.nodeExtent,g=al(c,d,Vn(r));r.internals.positionAbsolute=g}}function $_(n,l){if(!n.handles)return n.measured?l?.internals.handleBounds:void 0;const o=[],s=[];for(const r of n.handles){const c={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(c):r.type==="target"&&s.push(c)}return{source:o,target:s}}function sd(n){return n==="manual"}function Vf(n,l,o,s={}){const r=od(X_,s),c={i:0},d=new Map(l),g=r?.elevateNodesOnSelect&&!sd(r.zIndexMode)?O0:0;let m=n.length>0,h=!1;l.clear(),o.clear();for(const y of n){let v=d.get(y.id);if(r.checkEquality&&y===v?.internals.userNode)l.set(y.id,v);else{const p=To(y,r.nodeOrigin),x=oi(y.extent)?y.extent:r.nodeExtent,_=al(p,x,Vn(y));v={...r.defaults,...y,measured:{width:y.measured?.width,height:y.measured?.height},internals:{positionAbsolute:_,handleBounds:$_(y,v),z:j0(y,g,r.zIndexMode),userNode:y}},l.set(y.id,v)}(v.measured===void 0||v.measured.width===void 0||v.measured.height===void 0)&&!v.hidden&&(m=!1),y.parentId&&rd(v,l,o,s,c),h||=y.selected??!1}return{nodesInitialized:m,hasSelectedNodes:h}}function Q_(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 rd(n,l,o,s,r){const{elevateNodesOnSelect:c,nodeOrigin:d,nodeExtent:g,zIndexMode:m}=od(id,s),h=n.parentId,y=l.get(h);if(!y){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}Q_(n,o),r&&!y.parentId&&y.internals.rootParentIndex===void 0&&m==="auto"&&(y.internals.rootParentIndex=++r.i,y.internals.z=y.internals.z+r.i*V_),r&&y.internals.rootParentIndex!==void 0&&(r.i=y.internals.rootParentIndex);const v=c&&!sd(m)?O0:0,{x:p,y:x,z:_}=K_(n,y,d,g,v,m),{positionAbsolute:M}=n.internals,A=p!==M.x||x!==M.y;(A||_!==n.internals.z)&&l.set(n.id,{...n,internals:{...n.internals,positionAbsolute:A?{x:p,y:x}:M,z:_}})}function j0(n,l,o){const s=nn(n.zIndex)?n.zIndex:0;return sd(o)?s:s+(n.selected?l:0)}function K_(n,l,o,s,r,c){const{x:d,y:g}=l.internals.positionAbsolute,m=Vn(n),h=To(n,o),y=oi(n.extent)?al(h,n.extent,m):h;let v=al({x:d+y.x,y:g+y.y},s,m);n.extent==="parent"&&(v=x0(v,m,l));const p=j0(n,r,c),x=l.internals.z??0;return{x:v.x,y:v.y,z:x>=p?x+1:p}}function ud(n,l,o,s=[0,0]){const r=[],c=new Map;for(const d of n){const g=l.get(d.parentId);if(!g)continue;const m=c.get(d.parentId)?.expandedRect??ii(g),h=w0(m,d.rect);c.set(d.parentId,{expandedRect:h,parent:g})}return c.size>0&&c.forEach(({expandedRect:d,parent:g},m)=>{const h=g.internals.positionAbsolute,y=Vn(g),v=g.origin??s,p=d.x<h.x?Math.round(Math.abs(h.x-d.x)):0,x=d.y<h.y?Math.round(Math.abs(h.y-d.y)):0,_=Math.max(y.width,Math.round(d.width)),M=Math.max(y.height,Math.round(d.height)),A=(_-y.width)*v[0],T=(M-y.height)*v[1];(p>0||x>0||A||T)&&(r.push({id:m,type:"position",position:{x:g.position.x-p+A,y:g.position.y-x+T}}),o.get(m)?.forEach(B=>{n.some(E=>E.id===B.id)||r.push({id:B.id,type:"position",position:{x:B.position.x+p,y:B.position.y+x}})})),(y.width<d.width||y.height<d.height||p||x)&&r.push({id:m,type:"dimensions",setAttributes:!0,dimensions:{width:_+(p?v[0]*p-A:0),height:M+(x?v[1]*x-T:0)}})}),r}function F_(n,l,o,s,r,c,d){const g=s?.querySelector(".xyflow__viewport");let m=!1;if(!g)return{changes:[],updatedInternals:m};const h=[],y=window.getComputedStyle(g),{m22:v}=new window.DOMMatrixReadOnly(y.transform),p=[];for(const x of n.values()){const _=l.get(x.id);if(!_)continue;if(_.hidden){l.set(_.id,{..._,internals:{..._.internals,handleBounds:void 0}}),m=!0;continue}const M=ld(x.nodeElement),A=_.measured.width!==M.width||_.measured.height!==M.height;if(!!(M.width&&M.height&&(A||!_.internals.handleBounds||x.force))){const B=x.nodeElement.getBoundingClientRect(),E=oi(_.extent)?_.extent:c;let{positionAbsolute:D}=_.internals;_.parentId&&_.extent==="parent"?D=x0(D,M,l.get(_.parentId)):E&&(D=al(D,E,M));const Y={..._,measured:M,internals:{..._.internals,positionAbsolute:D,handleBounds:{source:Ip("source",x.nodeElement,B,v,_.id),target:Ip("target",x.nodeElement,B,v,_.id)}}};l.set(_.id,Y),_.parentId&&rd(Y,l,o,{nodeOrigin:r,zIndexMode:d}),m=!0,A&&(h.push({id:_.id,type:"dimensions",dimensions:M}),_.expandParent&&_.parentId&&p.push({id:_.id,parentId:_.parentId,rect:ii(Y,r)}))}}if(p.length>0){const x=ud(p,l,o,r);h.push(...x)}return{changes:h,updatedInternals:m}}async function J_({delta:n,panZoom:l,transform:o,translateExtent:s,width:r,height:c}){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,c]],s),g=!!d&&(d.x!==o[0]||d.y!==o[1]||d.k!==o[2]);return Promise.resolve(g)}function Fp(n,l,o,s,r,c){let d=r;const g=s.get(d)||new Map;s.set(d,g.set(o,l)),d=`${r}-${n}`;const m=s.get(d)||new Map;if(s.set(d,m.set(o,l)),c){d=`${r}-${n}-${c}`;const h=s.get(d)||new Map;s.set(d,h.set(o,l))}}function H0(n,l,o){n.clear(),l.clear();for(const s of o){const{source:r,target:c,sourceHandle:d=null,targetHandle:g=null}=s,m={edgeId:s.id,source:r,target:c,sourceHandle:d,targetHandle:g},h=`${r}-${d}--${c}-${g}`,y=`${c}-${g}--${r}-${d}`;Fp("source",m,y,n,r,d),Fp("target",m,h,n,c,g),l.set(s.id,s)}}function L0(n,l){if(!n.parentId)return!1;const o=l.get(n.parentId);return o?o.selected?!0:L0(o,l):!1}function Jp(n,l,o){let s=n;do{if(s?.matches?.(l))return!0;if(s===o)return!1;s=s?.parentElement}while(s);return!1}function P_(n,l,o,s){const r=new Map;for(const[c,d]of n)if((d.selected||d.id===s)&&(!d.parentId||!L0(d,n))&&(d.draggable||l&&typeof d.draggable>"u")){const g=n.get(c);g&&r.set(c,{id:c,position:g.position||{x:0,y:0},distance:{x:o.x-g.internals.positionAbsolute.x,y:o.y-g.internals.positionAbsolute.y},extent:g.extent,parentId:g.parentId,origin:g.origin,expandParent:g.expandParent,internals:{positionAbsolute:g.internals.positionAbsolute||{x:0,y:0}},measured:{width:g.measured.width??0,height:g.measured.height??0}})}return r}function xf({nodeId:n,dragItems:l,nodeLookup:o,dragging:s=!0}){const r=[];for(const[d,g]of l){const m=o.get(d)?.internals.userNode;m&&r.push({...m,position:g.position,dragging:s})}if(!n)return[r[0],r];const c=o.get(n)?.internals.userNode;return[c?{...c,position:l.get(n)?.position||c.position,dragging:s}:r[0],r]}function W_({dragItems:n,snapGrid:l,x:o,y:s}){const r=n.values().next().value;if(!r)return null;const c={x:o-r.distance.x,y:s-r.distance.y},d=Mo(c,l);return{x:d.x-c.x,y:d.y-c.y}}function eN({onNodeMouseDown:n,getStoreItems:l,onDragStart:o,onDrag:s,onDragStop:r}){let c={x:null,y:null},d=0,g=new Map,m=!1,h={x:0,y:0},y=null,v=!1,p=null,x=!1,_=!1,M=null;function A({noDragClassName:B,handleSelector:E,domNode:D,isSelectable:Y,nodeId:R,nodeClickDistance:L=0}){p=Bt(D);function H({x:P,y:te}){const{nodeLookup:z,nodeExtent:I,snapGrid:N,snapToGrid:j,nodeOrigin:G,onNodeDrag:Q,onSelectionDrag:ne,onError:C,updateNodePositions:U}=l();c={x:P,y:te};let ee=!1;const ae=g.size>1,ue=ae&&I?Yf(Co(g)):null,fe=ae&&j?W_({dragItems:g,snapGrid:N,x:P,y:te}):null;for(const[ce,re]of g){if(!z.has(ce))continue;let de={x:P-re.distance.x,y:te-re.distance.y};j&&(de=fe?{x:Math.round(de.x+fe.x),y:Math.round(de.y+fe.y)}:Mo(de,N));let we=null;if(ae&&I&&!re.extent&&ue){const{positionAbsolute:Se}=re.internals,Ce=Se.x-ue.x+I[0][0],qe=Se.x+re.measured.width-ue.x2+I[1][0],Le=Se.y-ue.y+I[0][1],rt=Se.y+re.measured.height-ue.y2+I[1][1];we=[[Ce,Le],[qe,rt]]}const{position:xe,positionAbsolute:ye}=b0({nodeId:ce,nextPosition:de,nodeLookup:z,nodeExtent:we||I,nodeOrigin:G,onError:C});ee=ee||re.position.x!==xe.x||re.position.y!==xe.y,re.position=xe,re.internals.positionAbsolute=ye}if(_=_||ee,!!ee&&(U(g,!0),M&&(s||Q||!R&&ne))){const[ce,re]=xf({nodeId:R,dragItems:g,nodeLookup:z});s?.(M,g,ce,re),Q?.(M,ce,re),R||ne?.(M,re)}}async function $(){if(!y)return;const{transform:P,panBy:te,autoPanSpeed:z,autoPanOnNodeDrag:I}=l();if(!I){m=!1,cancelAnimationFrame(d);return}const[N,j]=E0(h,y,z);(N!==0||j!==0)&&(c.x=(c.x??0)-N/P[2],c.y=(c.y??0)-j/P[2],await te({x:N,y:j})&&H(c)),d=requestAnimationFrame($)}function V(P){const{nodeLookup:te,multiSelectionActive:z,nodesDraggable:I,transform:N,snapGrid:j,snapToGrid:G,selectNodesOnDrag:Q,onNodeDragStart:ne,onSelectionDragStart:C,unselectNodesAndEdges:U}=l();v=!0,(!Q||!Y)&&!z&&R&&(te.get(R)?.selected||U()),Y&&Q&&R&&n?.(R);const ee=go(P.sourceEvent,{transform:N,snapGrid:j,snapToGrid:G,containerBounds:y});if(c=ee,g=P_(te,I,ee,R),g.size>0&&(o||ne||!R&&C)){const[ae,ue]=xf({nodeId:R,dragItems:g,nodeLookup:te});o?.(P.sourceEvent,g,ae,ue),ne?.(P.sourceEvent,ae,ue),R||C?.(P.sourceEvent,ue)}}const k=Wy().clickDistance(L).on("start",P=>{const{domNode:te,nodeDragThreshold:z,transform:I,snapGrid:N,snapToGrid:j}=l();y=te?.getBoundingClientRect()||null,x=!1,_=!1,M=P.sourceEvent,z===0&&V(P),c=go(P.sourceEvent,{transform:I,snapGrid:N,snapToGrid:j,containerBounds:y}),h=an(P.sourceEvent,y)}).on("drag",P=>{const{autoPanOnNodeDrag:te,transform:z,snapGrid:I,snapToGrid:N,nodeDragThreshold:j,nodeLookup:G}=l(),Q=go(P.sourceEvent,{transform:z,snapGrid:I,snapToGrid:N,containerBounds:y});if(M=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||R&&!G.has(R))&&(x=!0),!x){if(!m&&te&&v&&(m=!0,$()),!v){const ne=an(P.sourceEvent,y),C=ne.x-h.x,U=ne.y-h.y;Math.sqrt(C*C+U*U)>j&&V(P)}(c.x!==Q.xSnapped||c.y!==Q.ySnapped)&&g&&v&&(h=an(P.sourceEvent,y),H(Q))}}).on("end",P=>{if(!(!v||x)&&(m=!1,v=!1,cancelAnimationFrame(d),g.size>0)){const{nodeLookup:te,updateNodePositions:z,onNodeDragStop:I,onSelectionDragStop:N}=l();if(_&&(z(g,!1),_=!1),r||I||!R&&N){const[j,G]=xf({nodeId:R,dragItems:g,nodeLookup:te,dragging:!1});r?.(P.sourceEvent,g,j,G),I?.(P.sourceEvent,j,G),R||N?.(P.sourceEvent,G)}}}).filter(P=>{const te=P.target;return!P.button&&(!B||!Jp(te,`.${B}`,D))&&(!E||Jp(te,E,D))});p.call(k)}function T(){p?.on(".drag",null)}return{update:A,destroy:T}}function tN(n,l,o){const s=[],r={x:n.x-o,y:n.y-o,width:o*2,height:o*2};for(const c of l.values())xo(r,ii(c))>0&&s.push(c);return s}const nN=250;function aN(n,l,o,s){let r=[],c=1/0;const d=tN(n,o,l+nN);for(const g of d){const m=[...g.internals.handleBounds?.source??[],...g.internals.handleBounds?.target??[]];for(const h of m){if(s.nodeId===h.nodeId&&s.type===h.type&&s.id===h.id)continue;const{x:y,y:v}=ll(g,h,h.position,!0),p=Math.sqrt(Math.pow(y-n.x,2)+Math.pow(v-n.y,2));p>l||(p<c?(r=[{...h,x:y,y:v}],c=p):p===c&&r.push({...h,x:y,y:v}))}}if(!r.length)return null;if(r.length>1){const g=s.type==="source"?"target":"source";return r.find(m=>m.type===g)??r[0]}return r[0]}function U0(n,l,o,s,r,c=!1){const d=s.get(n);if(!d)return null;const g=r==="strict"?d.internals.handleBounds?.[l]:[...d.internals.handleBounds?.source??[],...d.internals.handleBounds?.target??[]],m=(o?g?.find(h=>h.id===o):g?.[0])??null;return m&&c?{...m,...ll(d,m,m.position,!0)}:m}function B0(n,l){return n||(l?.classList.contains("target")?"target":l?.classList.contains("source")?"source":null)}function lN(n,l){let o=null;return l?o=!0:n&&!l&&(o=!1),o}const q0=()=>!0;function iN(n,{connectionMode:l,connectionRadius:o,handleId:s,nodeId:r,edgeUpdaterType:c,isTarget:d,domNode:g,nodeLookup:m,lib:h,autoPanOnConnect:y,flowId:v,panBy:p,cancelConnection:x,onConnectStart:_,onConnect:M,onConnectEnd:A,isValidConnection:T=q0,onReconnectEnd:B,updateConnection:E,getTransform:D,getFromHandle:Y,autoPanSpeed:R,dragThreshold:L=1,handleDomNode:H}){const $=A0(n.target);let V=0,k;const{x:P,y:te}=an(n),z=B0(c,H),I=g?.getBoundingClientRect();let N=!1;if(!I||!z)return;const j=U0(r,z,s,m,l);if(!j)return;let G=an(n,I),Q=!1,ne=null,C=!1,U=null;function ee(){if(!y||!I)return;const[xe,ye]=E0(G,I,R);p({x:xe,y:ye}),V=requestAnimationFrame(ee)}const ae={...j,nodeId:r,type:z,position:j.position},ue=m.get(r);let ce={inProgress:!0,isValid:null,from:ll(ue,ae,me.Left,!0),fromHandle:ae,fromPosition:ae.position,fromNode:ue,to:G,toHandle:null,toPosition:qp[ae.position],toNode:null,pointer:G};function re(){N=!0,E(ce),_?.(n,{nodeId:r,handleId:s,handleType:z})}L===0&&re();function de(xe){if(!N){const{x:rt,y:Qt}=an(xe),zt=rt-P,Kt=Qt-te;if(!(zt*zt+Kt*Kt>L*L))return;re()}if(!Y()||!ae){we(xe);return}const ye=D();G=an(xe,I),k=aN(zo(G,ye,!1,[1,1]),o,m,ae),Q||(ee(),Q=!0);const Se=G0(xe,{handle:k,connectionMode:l,fromNodeId:r,fromHandleId:s,fromType:d?"target":"source",isValidConnection:T,doc:$,lib:h,flowId:v,nodeLookup:m});U=Se.handleDomNode,ne=Se.connection,C=lN(!!k,Se.isValid);const Ce=m.get(r),qe=Ce?ll(Ce,ae,me.Left,!0):ce.from,Le={...ce,from:qe,isValid:C,to:Se.toHandle&&C?Tr({x:Se.toHandle.x,y:Se.toHandle.y},ye):G,toHandle:Se.toHandle,toPosition:C&&Se.toHandle?Se.toHandle.position:qp[ae.position],toNode:Se.toHandle?m.get(Se.toHandle.nodeId):null,pointer:G};E(Le),ce=Le}function we(xe){if(!("touches"in xe&&xe.touches.length>0)){if(N){(k||U)&&ne&&C&&M?.(ne);const{inProgress:ye,...Se}=ce,Ce={...Se,toPosition:ce.toHandle?ce.toPosition:null};A?.(xe,Ce),c&&B?.(xe,Ce)}x(),cancelAnimationFrame(V),Q=!1,C=!1,ne=null,U=null,$.removeEventListener("mousemove",de),$.removeEventListener("mouseup",we),$.removeEventListener("touchmove",de),$.removeEventListener("touchend",we)}}$.addEventListener("mousemove",de),$.addEventListener("mouseup",we),$.addEventListener("touchmove",de),$.addEventListener("touchend",we)}function G0(n,{handle:l,connectionMode:o,fromNodeId:s,fromHandleId:r,fromType:c,doc:d,lib:g,flowId:m,isValidConnection:h=q0,nodeLookup:y}){const v=c==="target",p=l?d.querySelector(`.${g}-flow__handle[data-id="${m}-${l?.nodeId}-${l?.id}-${l?.type}"]`):null,{x,y:_}=an(n),M=d.elementFromPoint(x,_),A=M?.classList.contains(`${g}-flow__handle`)?M:p,T={handleDomNode:A,isValid:!1,connection:null,toHandle:null};if(A){const B=B0(void 0,A),E=A.getAttribute("data-nodeid"),D=A.getAttribute("data-handleid"),Y=A.classList.contains("connectable"),R=A.classList.contains("connectableend");if(!E||!B)return T;const L={source:v?E:s,sourceHandle:v?D:r,target:v?s:E,targetHandle:v?r:D};T.connection=L;const $=Y&&R&&(o===ai.Strict?v&&B==="source"||!v&&B==="target":E!==s||D!==r);T.isValid=$&&h(L),T.toHandle=U0(E,B,D,y,o,!0)}return T}const Xf={onPointerDown:iN,isValid:G0};function oN({domNode:n,panZoom:l,getTransform:o,getViewScale:s}){const r=Bt(n);function c({translateExtent:g,width:m,height:h,zoomStep:y=1,pannable:v=!0,zoomable:p=!0,inversePan:x=!1}){const _=E=>{if(E.sourceEvent.type!=="wheel"||!l)return;const D=o(),Y=E.sourceEvent.ctrlKey&&Eo()?10:1,R=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*y,L=D[2]*Math.pow(2,R*Y);l.scaleTo(L)};let M=[0,0];const A=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(M=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},T=E=>{const D=o();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!l)return;const Y=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],R=[Y[0]-M[0],Y[1]-M[1]];M=Y;const L=s()*Math.max(D[2],Math.log(D[2]))*(x?-1:1),H={x:D[0]-R[0]*L,y:D[1]-R[1]*L},$=[[0,0],[m,h]];l.setViewportConstrained({x:H.x,y:H.y,zoom:D[2]},$,g)},B=g0().on("start",A).on("zoom",v?T:null).on("zoom.wheel",p?_:null);r.call(B,{})}function d(){r.on("zoom",null)}return{update:c,destroy:d,pointer:en}}const Lr=n=>({x:n.x,y:n.y,zoom:n.k}),Ef=({x:n,y:l,zoom:o})=>Or.translate(n,l).scale(o),Jl=(n,l)=>n.target.closest(`.${l}`),Y0=(n,l)=>l===2&&Array.isArray(n)&&n.includes(2),sN=n=>((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2,wf=(n,l=0,o=sN,s=()=>{})=>{const r=typeof l=="number"&&l>0;return r||s(),r?n.transition().duration(l).ease(o).on("end",s):n},k0=n=>{const l=n.ctrlKey&&Eo()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*l};function rN({zoomPanValues:n,noWheelClassName:l,d3Selection:o,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:c,zoomOnPinch:d,onPanZoomStart:g,onPanZoom:m,onPanZoomEnd:h}){return y=>{if(Jl(y,l))return y.ctrlKey&&y.preventDefault(),!1;y.preventDefault(),y.stopImmediatePropagation();const v=o.property("__zoom").k||1;if(y.ctrlKey&&d){const A=en(y),T=k0(y),B=v*Math.pow(2,T);s.scaleTo(o,B,A,y);return}const p=y.deltaMode===1?20:1;let x=r===el.Vertical?0:y.deltaX*p,_=r===el.Horizontal?0:y.deltaY*p;!Eo()&&y.shiftKey&&r!==el.Vertical&&(x=y.deltaY*p,_=0),s.translateBy(o,-(x/v)*c,-(_/v)*c,{internal:!0});const M=Lr(o.property("__zoom"));clearTimeout(n.panScrollTimeout),n.isPanScrolling?(m?.(y,M),n.panScrollTimeout=setTimeout(()=>{h?.(y,M),n.isPanScrolling=!1},150)):(n.isPanScrolling=!0,g?.(y,M))}}function uN({noWheelClassName:n,preventScrolling:l,d3ZoomHandler:o}){return function(s,r){const c=s.type==="wheel",d=!l&&c&&!s.ctrlKey,g=Jl(s,n);if(s.ctrlKey&&c&&g&&s.preventDefault(),d||g)return null;s.preventDefault(),o.call(this,s,r)}}function cN({zoomPanValues:n,onDraggingChange:l,onPanZoomStart:o}){return s=>{if(s.sourceEvent?.internal)return;const r=Lr(s.transform);n.mouseButton=s.sourceEvent?.button||0,n.isZoomingOrPanning=!0,n.prevViewport=r,s.sourceEvent?.type==="mousedown"&&l(!0),o&&o?.(s.sourceEvent,r)}}function fN({zoomPanValues:n,panOnDrag:l,onPaneContextMenu:o,onTransformChange:s,onPanZoom:r}){return c=>{n.usedRightMouseButton=!!(o&&Y0(l,n.mouseButton??0)),c.sourceEvent?.sync||s([c.transform.x,c.transform.y,c.transform.k]),r&&!c.sourceEvent?.internal&&r?.(c.sourceEvent,Lr(c.transform))}}function dN({zoomPanValues:n,panOnDrag:l,panOnScroll:o,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:c}){return d=>{if(!d.sourceEvent?.internal&&(n.isZoomingOrPanning=!1,c&&Y0(l,n.mouseButton??0)&&!n.usedRightMouseButton&&d.sourceEvent&&c(d.sourceEvent),n.usedRightMouseButton=!1,s(!1),r)){const g=Lr(d.transform);n.prevViewport=g,clearTimeout(n.timerId),n.timerId=setTimeout(()=>{r?.(d.sourceEvent,g)},o?150:0)}}}function hN({zoomActivationKeyPressed:n,zoomOnScroll:l,zoomOnPinch:o,panOnDrag:s,panOnScroll:r,zoomOnDoubleClick:c,userSelectionActive:d,noWheelClassName:g,noPanClassName:m,lib:h,connectionInProgress:y}){return v=>{const p=n||l,x=o&&v.ctrlKey,_=v.type==="wheel";if(v.button===1&&v.type==="mousedown"&&(Jl(v,`${h}-flow__node`)||Jl(v,`${h}-flow__edge`)))return!0;if(!s&&!p&&!r&&!c&&!o||d||y&&!_||Jl(v,g)&&_||Jl(v,m)&&(!_||r&&_&&!n)||!o&&v.ctrlKey&&_)return!1;if(!o&&v.type==="touchstart"&&v.touches?.length>1)return v.preventDefault(),!1;if(!p&&!r&&!x&&_||!s&&(v.type==="mousedown"||v.type==="touchstart")||Array.isArray(s)&&!s.includes(v.button)&&v.type==="mousedown")return!1;const M=Array.isArray(s)&&s.includes(v.button)||!v.button||v.button<=1;return(!v.ctrlKey||_)&&M}}function gN({domNode:n,minZoom:l,maxZoom:o,translateExtent:s,viewport:r,onPanZoom:c,onPanZoomStart:d,onPanZoomEnd:g,onDraggingChange:m}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},y=n.getBoundingClientRect(),v=g0().scaleExtent([l,o]).translateExtent(s),p=Bt(n).call(v);B({x:r.x,y:r.y,zoom:li(r.zoom,l,o)},[[0,0],[y.width,y.height]],s);const x=p.on("wheel.zoom"),_=p.on("dblclick.zoom");v.wheelDelta(k0);function M(k,P){return p?new Promise(te=>{v?.interpolate(P?.interpolate==="linear"?ho:hr).transform(wf(p,P?.duration,P?.ease,()=>te(!0)),k)}):Promise.resolve(!1)}function A({noWheelClassName:k,noPanClassName:P,onPaneContextMenu:te,userSelectionActive:z,panOnScroll:I,panOnDrag:N,panOnScrollMode:j,panOnScrollSpeed:G,preventScrolling:Q,zoomOnPinch:ne,zoomOnScroll:C,zoomOnDoubleClick:U,zoomActivationKeyPressed:ee,lib:ae,onTransformChange:ue,connectionInProgress:fe,paneClickDistance:ce,selectionOnDrag:re}){z&&!h.isZoomingOrPanning&&T();const de=I&&!ee&&!z;v.clickDistance(re?1/0:!nn(ce)||ce<0?0:ce);const we=de?rN({zoomPanValues:h,noWheelClassName:k,d3Selection:p,d3Zoom:v,panOnScrollMode:j,panOnScrollSpeed:G,zoomOnPinch:ne,onPanZoomStart:d,onPanZoom:c,onPanZoomEnd:g}):uN({noWheelClassName:k,preventScrolling:Q,d3ZoomHandler:x});if(p.on("wheel.zoom",we,{passive:!1}),!z){const ye=cN({zoomPanValues:h,onDraggingChange:m,onPanZoomStart:d});v.on("start",ye);const Se=fN({zoomPanValues:h,panOnDrag:N,onPaneContextMenu:!!te,onPanZoom:c,onTransformChange:ue});v.on("zoom",Se);const Ce=dN({zoomPanValues:h,panOnDrag:N,panOnScroll:I,onPaneContextMenu:te,onPanZoomEnd:g,onDraggingChange:m});v.on("end",Ce)}const xe=hN({zoomActivationKeyPressed:ee,panOnDrag:N,zoomOnScroll:C,panOnScroll:I,zoomOnDoubleClick:U,zoomOnPinch:ne,userSelectionActive:z,noPanClassName:P,noWheelClassName:k,lib:ae,connectionInProgress:fe});v.filter(xe),U?p.on("dblclick.zoom",_):p.on("dblclick.zoom",null)}function T(){v.on("zoom",null)}async function B(k,P,te){const z=Ef(k),I=v?.constrain()(z,P,te);return I&&await M(I),new Promise(N=>N(I))}async function E(k,P){const te=Ef(k);return await M(te,P),new Promise(z=>z(te))}function D(k){if(p){const P=Ef(k),te=p.property("__zoom");(te.k!==k.zoom||te.x!==k.x||te.y!==k.y)&&v?.transform(p,P,null,{sync:!0})}}function Y(){const k=p?h0(p.node()):{x:0,y:0,k:1};return{x:k.x,y:k.y,zoom:k.k}}function R(k,P){return p?new Promise(te=>{v?.interpolate(P?.interpolate==="linear"?ho:hr).scaleTo(wf(p,P?.duration,P?.ease,()=>te(!0)),k)}):Promise.resolve(!1)}function L(k,P){return p?new Promise(te=>{v?.interpolate(P?.interpolate==="linear"?ho:hr).scaleBy(wf(p,P?.duration,P?.ease,()=>te(!0)),k)}):Promise.resolve(!1)}function H(k){v?.scaleExtent(k)}function $(k){v?.translateExtent(k)}function V(k){const P=!nn(k)||k<0?0:k;v?.clickDistance(P)}return{update:A,destroy:T,setViewport:E,setViewportConstrained:B,getViewport:Y,scaleTo:R,scaleBy:L,setScaleExtent:H,setTranslateExtent:$,syncViewport:D,setClickDistance:V}}var si;(function(n){n.Line="line",n.Handle="handle"})(si||(si={}));function mN({width:n,prevWidth:l,height:o,prevHeight:s,affectsX:r,affectsY:c}){const d=n-l,g=o-s,m=[d>0?1:d<0?-1:0,g>0?1:g<0?-1:0];return d&&r&&(m[0]=m[0]*-1),g&&c&&(m[1]=m[1]*-1),m}function Pp(n){const l=n.includes("right")||n.includes("left"),o=n.includes("bottom")||n.includes("top"),s=n.includes("left"),r=n.includes("top");return{isHorizontal:l,isVertical:o,affectsX:s,affectsY:r}}function xa(n,l){return Math.max(0,l-n)}function Ea(n,l){return Math.max(0,n-l)}function rr(n,l,o){return Math.max(0,l-n,n-o)}function Wp(n,l){return n?!l:l}function pN(n,l,o,s,r,c,d,g){let{affectsX:m,affectsY:h}=l;const{isHorizontal:y,isVertical:v}=l,p=y&&v,{xSnapped:x,ySnapped:_}=o,{minWidth:M,maxWidth:A,minHeight:T,maxHeight:B}=s,{x:E,y:D,width:Y,height:R,aspectRatio:L}=n;let H=Math.floor(y?x-n.pointerX:0),$=Math.floor(v?_-n.pointerY:0);const V=Y+(m?-H:H),k=R+(h?-$:$),P=-c[0]*Y,te=-c[1]*R;let z=rr(V,M,A),I=rr(k,T,B);if(d){let G=0,Q=0;m&&H<0?G=xa(E+H+P,d[0][0]):!m&&H>0&&(G=Ea(E+V+P,d[1][0])),h&&$<0?Q=xa(D+$+te,d[0][1]):!h&&$>0&&(Q=Ea(D+k+te,d[1][1])),z=Math.max(z,G),I=Math.max(I,Q)}if(g){let G=0,Q=0;m&&H>0?G=Ea(E+H,g[0][0]):!m&&H<0&&(G=xa(E+V,g[1][0])),h&&$>0?Q=Ea(D+$,g[0][1]):!h&&$<0&&(Q=xa(D+k,g[1][1])),z=Math.max(z,G),I=Math.max(I,Q)}if(r){if(y){const G=rr(V/L,T,B)*L;if(z=Math.max(z,G),d){let Q=0;!m&&!h||m&&!h&&p?Q=Ea(D+te+V/L,d[1][1])*L:Q=xa(D+te+(m?H:-H)/L,d[0][1])*L,z=Math.max(z,Q)}if(g){let Q=0;!m&&!h||m&&!h&&p?Q=xa(D+V/L,g[1][1])*L:Q=Ea(D+(m?H:-H)/L,g[0][1])*L,z=Math.max(z,Q)}}if(v){const G=rr(k*L,M,A)/L;if(I=Math.max(I,G),d){let Q=0;!m&&!h||h&&!m&&p?Q=Ea(E+k*L+P,d[1][0])/L:Q=xa(E+(h?$:-$)*L+P,d[0][0])/L,I=Math.max(I,Q)}if(g){let Q=0;!m&&!h||h&&!m&&p?Q=xa(E+k*L,g[1][0])/L:Q=Ea(E+(h?$:-$)*L,g[0][0])/L,I=Math.max(I,Q)}}}$=$+($<0?I:-I),H=H+(H<0?z:-z),r&&(p?V>k*L?$=(Wp(m,h)?-H:H)/L:H=(Wp(m,h)?-$:$)*L:y?($=H/L,h=m):(H=$*L,m=h));const N=m?E+H:E,j=h?D+$:D;return{width:Y+(m?-H:H),height:R+(h?-$:$),x:c[0]*H*(m?-1:1)+N,y:c[1]*$*(h?-1:1)+j}}const I0={width:0,height:0,x:0,y:0},yN={...I0,pointerX:0,pointerY:0,aspectRatio:1};function vN(n){return[[0,0],[n.measured.width,n.measured.height]]}function SN(n,l,o){const s=l.position.x+n.position.x,r=l.position.y+n.position.y,c=n.measured.width??0,d=n.measured.height??0,g=o[0]*c,m=o[1]*d;return[[s-g,r-m],[s+c-g,r+d-m]]}function bN({domNode:n,nodeId:l,getStoreItems:o,onChange:s,onEnd:r}){const c=Bt(n);let d={controlDirection:Pp("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function g({controlPosition:h,boundaries:y,keepAspectRatio:v,resizeDirection:p,onResizeStart:x,onResize:_,onResizeEnd:M,shouldResize:A}){let T={...I0},B={...yN};d={boundaries:y,resizeDirection:p,keepAspectRatio:v,controlDirection:Pp(h)};let E,D=null,Y=[],R,L,H,$=!1;const V=Wy().on("start",k=>{const{nodeLookup:P,transform:te,snapGrid:z,snapToGrid:I,nodeOrigin:N,paneDomNode:j}=o();if(E=P.get(l),!E)return;D=j?.getBoundingClientRect()??null;const{xSnapped:G,ySnapped:Q}=go(k.sourceEvent,{transform:te,snapGrid:z,snapToGrid:I,containerBounds:D});T={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},B={...T,pointerX:G,pointerY:Q,aspectRatio:T.width/T.height},R=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(R=P.get(E.parentId),L=R&&E.extent==="parent"?vN(R):void 0),Y=[],H=void 0;for(const[ne,C]of P)if(C.parentId===l&&(Y.push({id:ne,position:{...C.position},extent:C.extent}),C.extent==="parent"||C.expandParent)){const U=SN(C,E,C.origin??N);H?H=[[Math.min(U[0][0],H[0][0]),Math.min(U[0][1],H[0][1])],[Math.max(U[1][0],H[1][0]),Math.max(U[1][1],H[1][1])]]:H=U}x?.(k,{...T})}).on("drag",k=>{const{transform:P,snapGrid:te,snapToGrid:z,nodeOrigin:I}=o(),N=go(k.sourceEvent,{transform:P,snapGrid:te,snapToGrid:z,containerBounds:D}),j=[];if(!E)return;const{x:G,y:Q,width:ne,height:C}=T,U={},ee=E.origin??I,{width:ae,height:ue,x:fe,y:ce}=pN(B,d.controlDirection,N,d.boundaries,d.keepAspectRatio,ee,L,H),re=ae!==ne,de=ue!==C,we=fe!==G&&re,xe=ce!==Q&&de;if(!we&&!xe&&!re&&!de)return;if((we||xe||ee[0]===1||ee[1]===1)&&(U.x=we?fe:T.x,U.y=xe?ce:T.y,T.x=U.x,T.y=U.y,Y.length>0)){const qe=fe-G,Le=ce-Q;for(const rt of Y)rt.position={x:rt.position.x-qe+ee[0]*(ae-ne),y:rt.position.y-Le+ee[1]*(ue-C)},j.push(rt)}if((re||de)&&(U.width=re&&(!d.resizeDirection||d.resizeDirection==="horizontal")?ae:T.width,U.height=de&&(!d.resizeDirection||d.resizeDirection==="vertical")?ue:T.height,T.width=U.width,T.height=U.height),R&&E.expandParent){const qe=ee[0]*(U.width??0);U.x&&U.x<qe&&(T.x=qe,B.x=B.x-(U.x-qe));const Le=ee[1]*(U.height??0);U.y&&U.y<Le&&(T.y=Le,B.y=B.y-(U.y-Le))}const ye=mN({width:T.width,prevWidth:ne,height:T.height,prevHeight:C,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),Se={...T,direction:ye};A?.(k,Se)!==!1&&($=!0,_?.(k,Se),s(U,j))}).on("end",k=>{$&&(M?.(k,{...T}),r?.({...T}),$=!1)});c.call(V)}function m(){c.on(".drag",null)}return{update:g,destroy:m}}var _f={exports:{}},Nf={},Af={exports:{}},Tf={};var ey;function xN(){if(ey)return Tf;ey=1;var n=_o();function l(v,p){return v===p&&(v!==0||1/v===1/p)||v!==v&&p!==p}var o=typeof Object.is=="function"?Object.is:l,s=n.useState,r=n.useEffect,c=n.useLayoutEffect,d=n.useDebugValue;function g(v,p){var x=p(),_=s({inst:{value:x,getSnapshot:p}}),M=_[0].inst,A=_[1];return c(function(){M.value=x,M.getSnapshot=p,m(M)&&A({inst:M})},[v,x,p]),r(function(){return m(M)&&A({inst:M}),v(function(){m(M)&&A({inst:M})})},[v]),d(x),x}function m(v){var p=v.getSnapshot;v=v.value;try{var x=p();return!o(v,x)}catch{return!0}}function h(v,p){return p()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:g;return Tf.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:y,Tf}var ty;function EN(){return ty||(ty=1,Af.exports=xN()),Af.exports}var ny;function wN(){if(ny)return Nf;ny=1;var n=_o(),l=EN();function o(h,y){return h===y&&(h!==0||1/h===1/y)||h!==h&&y!==y}var s=typeof Object.is=="function"?Object.is:o,r=l.useSyncExternalStore,c=n.useRef,d=n.useEffect,g=n.useMemo,m=n.useDebugValue;return Nf.useSyncExternalStoreWithSelector=function(h,y,v,p,x){var _=c(null);if(_.current===null){var M={hasValue:!1,value:null};_.current=M}else M=_.current;_=g(function(){function T(R){if(!B){if(B=!0,E=R,R=p(R),x!==void 0&&M.hasValue){var L=M.value;if(x(L,R))return D=L}return D=R}if(L=D,s(E,R))return L;var H=p(R);return x!==void 0&&x(L,H)?(E=R,L):(E=R,D=H)}var B=!1,E,D,Y=v===void 0?null:v;return[function(){return T(y())},Y===null?void 0:function(){return T(Y())}]},[y,v,p,x]);var A=r(h,_[0],_[1]);return d(function(){M.hasValue=!0,M.value=A},[A]),m(A),A},Nf}var ay;function _N(){return ay||(ay=1,_f.exports=wN()),_f.exports}var NN=_N();const AN=Cy(NN),TN={},ly=n=>{let l;const o=new Set,s=(y,v)=>{const p=typeof y=="function"?y(l):y;if(!Object.is(p,l)){const x=l;l=v??(typeof p!="object"||p===null)?p:Object.assign({},l,p),o.forEach(_=>_(l,x))}},r=()=>l,m={setState:s,getState:r,getInitialState:()=>h,subscribe:y=>(o.add(y),()=>o.delete(y)),destroy:()=>{(TN?"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()}},h=l=n(s,r,m);return m},CN=n=>n?ly(n):ly,{useDebugValue:MN}=so,{useSyncExternalStoreWithSelector:zN}=AN,DN=n=>n;function V0(n,l=DN,o){const s=zN(n.subscribe,n.getState,n.getServerState||n.getInitialState,l,o);return MN(s),s}const iy=(n,l)=>{const o=CN(n),s=(r,c=l)=>V0(o,r,c);return Object.assign(s,o),s},RN=(n,l)=>n?iy(n,l):iy;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[s,r]of n)if(!Object.is(r,l.get(s)))return!1;return!0}if(n instanceof Set&&l instanceof Set){if(n.size!==l.size)return!1;for(const s of n)if(!l.has(s))return!1;return!0}const o=Object.keys(n);if(o.length!==Object.keys(l).length)return!1;for(const s of o)if(!Object.prototype.hasOwnProperty.call(l,s)||!Object.is(n[s],l[s]))return!1;return!0}My();const Ur=Z.createContext(null),ON=Ur.Provider,X0=mn.error001();function Re(n,l){const o=Z.useContext(Ur);if(o===null)throw new Error(X0);return V0(o,n,l)}function Ke(){const n=Z.useContext(Ur);if(n===null)throw new Error(X0);return Z.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe}),[n])}const oy={display:"none"},jN={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Z0="react-flow__node-desc",$0="react-flow__edge-desc",HN="react-flow__aria-live",LN=n=>n.ariaLiveMessage,UN=n=>n.ariaLabelConfig;function BN({rfId:n}){const l=Re(LN);return b.jsx("div",{id:`${HN}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:jN,children:l})}function qN({rfId:n,disableKeyboardA11y:l}){const o=Re(UN);return b.jsxs(b.Fragment,{children:[b.jsx("div",{id:`${Z0}-${n}`,style:oy,children:l?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),b.jsx("div",{id:`${$0}-${n}`,style:oy,children:o["edge.a11yDescription.default"]}),!l&&b.jsx(BN,{rfId:n})]})}const Br=Z.forwardRef(({position:n="top-left",children:l,className:o,style:s,...r},c)=>{const d=`${n}`.split("-");return b.jsx("div",{className:it(["react-flow__panel",o,...d]),style:s,ref:c,...r,children:l})});Br.displayName="Panel";function GN({proOptions:n,position:l="bottom-right"}){return n?.hideAttribution?null:b.jsx(Br,{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:b.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const YN=n=>{const l=[],o=[];for(const[,s]of n.nodeLookup)s.selected&&l.push(s.internals.userNode);for(const[,s]of n.edgeLookup)s.selected&&o.push(s);return{selectedNodes:l,selectedEdges:o}},ur=n=>n.id;function kN(n,l){return $e(n.selectedNodes.map(ur),l.selectedNodes.map(ur))&&$e(n.selectedEdges.map(ur),l.selectedEdges.map(ur))}function IN({onSelectionChange:n}){const l=Ke(),{selectedNodes:o,selectedEdges:s}=Re(YN,kN);return Z.useEffect(()=>{const r={nodes:o,edges:s};n?.(r),l.getState().onSelectionChangeHandlers.forEach(c=>c(r))},[o,s,n]),null}const VN=n=>!!n.onSelectionChangeHandlers;function XN({onSelectionChange:n}){const l=Re(VN);return n||l?b.jsx(IN,{onSelectionChange:n}):null}const Zf=typeof window<"u"?Z.useLayoutEffect:Z.useEffect,Q0=[0,0],ZN={x:0,y:0,zoom:1},$N=["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"],sy=[...$N,"rfId"],QN=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}),ry={translateExtent:So,nodeOrigin:Q0,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function KN(n){const{setNodes:l,setEdges:o,setMinZoom:s,setMaxZoom:r,setTranslateExtent:c,setNodeExtent:d,reset:g,setDefaultNodesAndEdges:m}=Re(QN,$e),h=Ke();Zf(()=>(m(n.defaultNodes,n.defaultEdges),()=>{y.current=ry,g()}),[]);const y=Z.useRef(ry);return Zf(()=>{for(const v of sy){const p=n[v],x=y.current[v];p!==x&&(typeof n[v]>"u"||(v==="nodes"?l(p):v==="edges"?o(p):v==="minZoom"?s(p):v==="maxZoom"?r(p):v==="translateExtent"?c(p):v==="nodeExtent"?d(p):v==="ariaLabelConfig"?h.setState({ariaLabelConfig:R_(p)}):v==="fitView"?h.setState({fitViewQueued:p}):v==="fitViewOptions"?h.setState({fitViewOptions:p}):h.setState({[v]:p})))}y.current=n},sy.map(v=>n[v])),null}function uy(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function FN(n){const[l,o]=Z.useState(n==="system"?null:n);return Z.useEffect(()=>{if(n!=="system"){o(n);return}const s=uy(),r=()=>o(s?.matches?"dark":"light");return r(),s?.addEventListener("change",r),()=>{s?.removeEventListener("change",r)}},[n]),l!==null?l:uy()?.matches?"dark":"light"}const cy=typeof document<"u"?document:null;function wo(n=null,l={target:cy,actInsideInputWithModifier:!0}){const[o,s]=Z.useState(!1),r=Z.useRef(!1),c=Z.useRef(new Set([])),[d,g]=Z.useMemo(()=>{if(n!==null){const h=(Array.isArray(n)?n:[n]).filter(v=>typeof v=="string").map(v=>v.replace("+",`
|
|
10
|
-
`).replace(`
|
|
11
|
-
|
|
12
|
-
`,`
|
|
13
|
-
+`).split(`
|
|
14
|
-
`)),y=h.reduce((v,p)=>v.concat(...p),[]);return[h,y]}return[[],[]]},[n]);return Z.useEffect(()=>{const m=l?.target??cy,h=l?.actInsideInputWithModifier??!0;if(n!==null){const y=x=>{if(r.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!r.current||r.current&&!h)&&T0(x))return!1;const M=dy(x.code,g);if(c.current.add(x[M]),fy(d,c.current,!1)){const A=x.composedPath?.()?.[0]||x.target,T=A?.nodeName==="BUTTON"||A?.nodeName==="A";l.preventDefault!==!1&&(r.current||!T)&&x.preventDefault(),s(!0)}},v=x=>{const _=dy(x.code,g);fy(d,c.current,!0)?(s(!1),c.current.clear()):c.current.delete(x[_]),x.key==="Meta"&&c.current.clear(),r.current=!1},p=()=>{c.current.clear(),s(!1)};return m?.addEventListener("keydown",y),m?.addEventListener("keyup",v),window.addEventListener("blur",p),window.addEventListener("contextmenu",p),()=>{m?.removeEventListener("keydown",y),m?.removeEventListener("keyup",v),window.removeEventListener("blur",p),window.removeEventListener("contextmenu",p)}}},[n,s]),o}function fy(n,l,o){return n.filter(s=>o||s.length===l.size).some(s=>s.every(r=>l.has(r)))}function dy(n,l){return l.includes(n)?"code":"key"}const JN=()=>{const n=Ke();return Z.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:s}=n.getState();return s?s.scaleTo(l,o):Promise.resolve(!1)},getZoom:()=>n.getState().transform[2],setViewport:async(l,o)=>{const{transform:[s,r,c],panZoom:d}=n.getState();return d?(await d.setViewport({x:l.x??s,y:l.y??r,zoom:l.zoom??c},o),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[l,o,s]=n.getState().transform;return{x:l,y:o,zoom:s}},setCenter:async(l,o,s)=>n.getState().setCenter(l,o,s),fitBounds:async(l,o)=>{const{width:s,height:r,minZoom:c,maxZoom:d,panZoom:g}=n.getState(),m=ad(l,s,r,c,d,o?.padding??.1);return g?(await g.setViewport(m,{duration:o?.duration,ease:o?.ease,interpolate:o?.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(l,o={})=>{const{transform:s,snapGrid:r,snapToGrid:c,domNode:d}=n.getState();if(!d)return l;const{x:g,y:m}=d.getBoundingClientRect(),h={x:l.x-g,y:l.y-m},y=o.snapGrid??r,v=o.snapToGrid??c;return zo(h,s,v,y)},flowToScreenPosition:l=>{const{transform:o,domNode:s}=n.getState();if(!s)return l;const{x:r,y:c}=s.getBoundingClientRect(),d=Tr(l,o);return{x:d.x+r,y:d.y+c}}}),[])};function K0(n,l){const o=[],s=new Map,r=[];for(const c of n)if(c.type==="add"){r.push(c);continue}else if(c.type==="remove"||c.type==="replace")s.set(c.id,[c]);else{const d=s.get(c.id);d?d.push(c):s.set(c.id,[c])}for(const c of l){const d=s.get(c.id);if(!d){o.push(c);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){o.push({...d[0].item});continue}const g={...c};for(const m of d)PN(m,g);o.push(g)}return r.length&&r.forEach(c=>{c.index!==void 0?o.splice(c.index,0,{...c.item}):o.push({...c.item})}),o}function PN(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 F0(n,l){return K0(n,l)}function J0(n,l){return K0(n,l)}function Ja(n,l){return{id:n,type:"select",selected:l}}function Pl(n,l=new Set,o=!1){const s=[];for(const[r,c]of n){const d=l.has(r);!(c.selected===void 0&&!d)&&c.selected!==d&&(o&&(c.selected=d),s.push(Ja(c.id,d)))}return s}function hy({items:n=[],lookup:l}){const o=[],s=new Map(n.map(r=>[r.id,r]));for(const[r,c]of n.entries()){const d=l.get(c.id),g=d?.internals?.userNode??d;g!==void 0&&g!==c&&o.push({id:c.id,item:c,type:"replace"}),g===void 0&&o.push({item:c,type:"add",index:r})}for(const[r]of l)s.get(r)===void 0&&o.push({id:r,type:"remove"});return o}function gy(n){return{id:n.id,type:"remove"}}const my=n=>E_(n),WN=n=>S0(n);function P0(n){return Z.forwardRef(n)}function py(n){const[l,o]=Z.useState(BigInt(0)),[s]=Z.useState(()=>eA(()=>o(r=>r+BigInt(1))));return Zf(()=>{const r=s.get();r.length&&(n(r),s.reset())},[l]),s}function eA(n){let l=[];return{get:()=>l,reset:()=>{l=[]},push:o=>{l.push(o),n()}}}const W0=Z.createContext(null);function tA({children:n}){const l=Ke(),o=Z.useCallback(g=>{const{nodes:m=[],setNodes:h,hasDefaultNodes:y,onNodesChange:v,nodeLookup:p,fitViewQueued:x,onNodesChangeMiddlewareMap:_}=l.getState();let M=m;for(const T of g)M=typeof T=="function"?T(M):T;let A=hy({items:M,lookup:p});for(const T of _.values())A=T(A);y&&h(M),A.length>0?v?.(A):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:T,nodes:B,setNodes:E}=l.getState();T&&E(B)})},[]),s=py(o),r=Z.useCallback(g=>{const{edges:m=[],setEdges:h,hasDefaultEdges:y,onEdgesChange:v,edgeLookup:p}=l.getState();let x=m;for(const _ of g)x=typeof _=="function"?_(x):_;y?h(x):v&&v(hy({items:x,lookup:p}))},[]),c=py(r),d=Z.useMemo(()=>({nodeQueue:s,edgeQueue:c}),[]);return b.jsx(W0.Provider,{value:d,children:n})}function nA(){const n=Z.useContext(W0);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}const aA=n=>!!n.panZoom;function qr(){const n=JN(),l=Ke(),o=nA(),s=Re(aA),r=Z.useMemo(()=>{const c=v=>l.getState().nodeLookup.get(v),d=v=>{o.nodeQueue.push(v)},g=v=>{o.edgeQueue.push(v)},m=v=>{const{nodeLookup:p,nodeOrigin:x}=l.getState(),_=my(v)?v:p.get(v.id),M=_.parentId?N0(_.position,_.measured,_.parentId,p,x):_.position,A={..._,position:M,width:_.measured?.width??_.width,height:_.measured?.height??_.height};return ii(A)},h=(v,p,x={replace:!1})=>{d(_=>_.map(M=>{if(M.id===v){const A=typeof p=="function"?p(M):p;return x.replace&&my(A)?A:{...M,...A}}return M}))},y=(v,p,x={replace:!1})=>{g(_=>_.map(M=>{if(M.id===v){const A=typeof p=="function"?p(M):p;return x.replace&&WN(A)?A:{...M,...A}}return M}))};return{getNodes:()=>l.getState().nodes.map(v=>({...v})),getNode:v=>c(v)?.internals.userNode,getInternalNode:c,getEdges:()=>{const{edges:v=[]}=l.getState();return v.map(p=>({...p}))},getEdge:v=>l.getState().edgeLookup.get(v),setNodes:d,setEdges:g,addNodes:v=>{const p=Array.isArray(v)?v:[v];o.nodeQueue.push(x=>[...x,...p])},addEdges:v=>{const p=Array.isArray(v)?v:[v];o.edgeQueue.push(x=>[...x,...p])},toObject:()=>{const{nodes:v=[],edges:p=[],transform:x}=l.getState(),[_,M,A]=x;return{nodes:v.map(T=>({...T})),edges:p.map(T=>({...T})),viewport:{x:_,y:M,zoom:A}}},deleteElements:async({nodes:v=[],edges:p=[]})=>{const{nodes:x,edges:_,onNodesDelete:M,onEdgesDelete:A,triggerNodeChanges:T,triggerEdgeChanges:B,onDelete:E,onBeforeDelete:D}=l.getState(),{nodes:Y,edges:R}=await T_({nodesToRemove:v,edgesToRemove:p,nodes:x,edges:_,onBeforeDelete:D}),L=R.length>0,H=Y.length>0;if(L){const $=R.map(gy);A?.(R),B($)}if(H){const $=Y.map(gy);M?.(Y),T($)}return(H||L)&&E?.({nodes:Y,edges:R}),{deletedNodes:Y,deletedEdges:R}},getIntersectingNodes:(v,p=!0,x)=>{const _=Yp(v),M=_?v:m(v),A=x!==void 0;return M?(x||l.getState().nodes).filter(T=>{const B=l.getState().nodeLookup.get(T.id);if(B&&!_&&(T.id===v.id||!B.internals.positionAbsolute))return!1;const E=ii(A?T:B),D=xo(E,M);return p&&D>0||D>=E.width*E.height||D>=M.width*M.height}):[]},isNodeIntersecting:(v,p,x=!0)=>{const M=Yp(v)?v:m(v);if(!M)return!1;const A=xo(M,p);return x&&A>0||A>=p.width*p.height||A>=M.width*M.height},updateNode:h,updateNodeData:(v,p,x={replace:!1})=>{h(v,_=>{const M=typeof p=="function"?p(_):p;return x.replace?{..._,data:M}:{..._,data:{..._.data,...M}}},x)},updateEdge:y,updateEdgeData:(v,p,x={replace:!1})=>{y(v,_=>{const M=typeof p=="function"?p(_):p;return x.replace?{..._,data:M}:{..._,data:{..._.data,...M}}},x)},getNodesBounds:v=>{const{nodeLookup:p,nodeOrigin:x}=l.getState();return w_(v,{nodeLookup:p,nodeOrigin:x})},getHandleConnections:({type:v,id:p,nodeId:x})=>Array.from(l.getState().connectionLookup.get(`${x}-${v}${p?`-${p}`:""}`)?.values()??[]),getNodeConnections:({type:v,handleId:p,nodeId:x})=>Array.from(l.getState().connectionLookup.get(`${x}${v?p?`-${v}-${p}`:`-${v}`:""}`)?.values()??[]),fitView:async v=>{const p=l.getState().fitViewResolver??D_();return l.setState({fitViewQueued:!0,fitViewOptions:v,fitViewResolver:p}),o.nodeQueue.push(x=>[...x]),p.promise}}},[]);return Z.useMemo(()=>({...r,...n,viewportInitialized:s}),[s])}const yy=n=>n.selected,lA=typeof window<"u"?window:void 0;function iA({deleteKeyCode:n,multiSelectionKeyCode:l}){const o=Ke(),{deleteElements:s}=qr(),r=wo(n,{actInsideInputWithModifier:!1}),c=wo(l,{target:lA});Z.useEffect(()=>{if(r){const{edges:d,nodes:g}=o.getState();s({nodes:g.filter(yy),edges:d.filter(yy)}),o.setState({nodesSelectionActive:!1})}},[r]),Z.useEffect(()=>{o.setState({multiSelectionActive:c})},[c])}function oA(n){const l=Ke();Z.useEffect(()=>{const o=()=>{if(!n.current||!(n.current.checkVisibility?.()??!0))return!1;const s=ld(n.current);(s.height===0||s.width===0)&&l.getState().onError?.("004",mn.error004()),l.setState({width:s.width||500,height:s.height||500})};if(n.current){o(),window.addEventListener("resize",o);const s=new ResizeObserver(()=>o());return s.observe(n.current),()=>{window.removeEventListener("resize",o),s&&n.current&&s.unobserve(n.current)}}},[])}const Gr={position:"absolute",width:"100%",height:"100%",top:0,left:0},sA=n=>({userSelectionActive:n.userSelectionActive,lib:n.lib,connectionInProgress:n.connection.inProgress});function rA({onPaneContextMenu:n,zoomOnScroll:l=!0,zoomOnPinch:o=!0,panOnScroll:s=!1,panOnScrollSpeed:r=.5,panOnScrollMode:c=el.Free,zoomOnDoubleClick:d=!0,panOnDrag:g=!0,defaultViewport:m,translateExtent:h,minZoom:y,maxZoom:v,zoomActivationKeyCode:p,preventScrolling:x=!0,children:_,noWheelClassName:M,noPanClassName:A,onViewportChange:T,isControlledViewport:B,paneClickDistance:E,selectionOnDrag:D}){const Y=Ke(),R=Z.useRef(null),{userSelectionActive:L,lib:H,connectionInProgress:$}=Re(sA,$e),V=wo(p),k=Z.useRef();oA(R);const P=Z.useCallback(te=>{T?.({x:te[0],y:te[1],zoom:te[2]}),B||Y.setState({transform:te})},[T,B]);return Z.useEffect(()=>{if(R.current){k.current=gN({domNode:R.current,minZoom:y,maxZoom:v,translateExtent:h,viewport:m,onDraggingChange:N=>Y.setState(j=>j.paneDragging===N?j:{paneDragging:N}),onPanZoomStart:(N,j)=>{const{onViewportChangeStart:G,onMoveStart:Q}=Y.getState();Q?.(N,j),G?.(j)},onPanZoom:(N,j)=>{const{onViewportChange:G,onMove:Q}=Y.getState();Q?.(N,j),G?.(j)},onPanZoomEnd:(N,j)=>{const{onViewportChangeEnd:G,onMoveEnd:Q}=Y.getState();Q?.(N,j),G?.(j)}});const{x:te,y:z,zoom:I}=k.current.getViewport();return Y.setState({panZoom:k.current,transform:[te,z,I],domNode:R.current.closest(".react-flow")}),()=>{k.current?.destroy()}}},[]),Z.useEffect(()=>{k.current?.update({onPaneContextMenu:n,zoomOnScroll:l,zoomOnPinch:o,panOnScroll:s,panOnScrollSpeed:r,panOnScrollMode:c,zoomOnDoubleClick:d,panOnDrag:g,zoomActivationKeyPressed:V,preventScrolling:x,noPanClassName:A,userSelectionActive:L,noWheelClassName:M,lib:H,onTransformChange:P,connectionInProgress:$,selectionOnDrag:D,paneClickDistance:E})},[n,l,o,s,r,c,d,g,V,x,A,L,M,H,P,$,D,E]),b.jsx("div",{className:"react-flow__renderer",ref:R,style:Gr,children:_})}const uA=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function cA(){const{userSelectionActive:n,userSelectionRect:l}=Re(uA,$e);return n&&l?b.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 Cf=(n,l)=>o=>{o.target===l.current&&n?.(o)},fA=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,connectionInProgress:n.connection.inProgress,dragging:n.paneDragging});function dA({isSelecting:n,selectionKeyPressed:l,selectionMode:o=bo.Full,panOnDrag:s,paneClickDistance:r,selectionOnDrag:c,onSelectionStart:d,onSelectionEnd:g,onPaneClick:m,onPaneContextMenu:h,onPaneScroll:y,onPaneMouseEnter:v,onPaneMouseMove:p,onPaneMouseLeave:x,children:_}){const M=Ke(),{userSelectionActive:A,elementsSelectable:T,dragging:B,connectionInProgress:E}=Re(fA,$e),D=T&&(n||A),Y=Z.useRef(null),R=Z.useRef(),L=Z.useRef(new Set),H=Z.useRef(new Set),$=Z.useRef(!1),V=G=>{if($.current||E){$.current=!1;return}m?.(G),M.getState().resetSelectedElements(),M.setState({nodesSelectionActive:!1})},k=G=>{if(Array.isArray(s)&&s?.includes(2)){G.preventDefault();return}h?.(G)},P=y?G=>y(G):void 0,te=G=>{$.current&&(G.stopPropagation(),$.current=!1)},z=G=>{const{domNode:Q}=M.getState();if(R.current=Q?.getBoundingClientRect(),!R.current)return;const ne=G.target===Y.current;if(!ne&&!!G.target.closest(".nokey")||!n||!(c&&ne||l)||G.button!==0||!G.isPrimary)return;G.target?.setPointerCapture?.(G.pointerId),$.current=!1;const{x:ee,y:ae}=an(G.nativeEvent,R.current);M.setState({userSelectionRect:{width:0,height:0,startX:ee,startY:ae,x:ee,y:ae}}),ne||(G.stopPropagation(),G.preventDefault())},I=G=>{const{userSelectionRect:Q,transform:ne,nodeLookup:C,edgeLookup:U,connectionLookup:ee,triggerNodeChanges:ae,triggerEdgeChanges:ue,defaultEdgeOptions:fe,resetSelectedElements:ce}=M.getState();if(!R.current||!Q)return;const{x:re,y:de}=an(G.nativeEvent,R.current),{startX:we,startY:xe}=Q;if(!$.current){const Le=l?0:r;if(Math.hypot(re-we,de-xe)<=Le)return;ce(),d?.(G)}$.current=!0;const ye={startX:we,startY:xe,x:re<we?re:we,y:de<xe?de:xe,width:Math.abs(re-we),height:Math.abs(de-xe)},Se=L.current,Ce=H.current;L.current=new Set(nd(C,ye,ne,o===bo.Partial,!0).map(Le=>Le.id)),H.current=new Set;const qe=fe?.selectable??!0;for(const Le of L.current){const rt=ee.get(Le);if(rt)for(const{edgeId:Qt}of rt.values()){const zt=U.get(Qt);zt&&(zt.selectable??qe)&&H.current.add(Qt)}}if(!kp(Se,L.current)){const Le=Pl(C,L.current,!0);ae(Le)}if(!kp(Ce,H.current)){const Le=Pl(U,H.current);ue(Le)}M.setState({userSelectionRect:ye,userSelectionActive:!0,nodesSelectionActive:!1})},N=G=>{G.button===0&&(G.target?.releasePointerCapture?.(G.pointerId),!A&&G.target===Y.current&&M.getState().userSelectionRect&&V?.(G),M.setState({userSelectionActive:!1,userSelectionRect:null}),$.current&&(g?.(G),M.setState({nodesSelectionActive:L.current.size>0})))},j=s===!0||Array.isArray(s)&&s.includes(0);return b.jsxs("div",{className:it(["react-flow__pane",{draggable:j,dragging:B,selection:n}]),onClick:D?void 0:Cf(V,Y),onContextMenu:Cf(k,Y),onWheel:Cf(P,Y),onPointerEnter:D?void 0:v,onPointerMove:D?I:p,onPointerUp:D?N:void 0,onPointerDownCapture:D?z:void 0,onClickCapture:D?te:void 0,onPointerLeave:x,ref:Y,style:Gr,children:[_,b.jsx(cA,{})]})}function $f({id:n,store:l,unselect:o=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:c,multiSelectionActive:d,nodeLookup:g,onError:m}=l.getState(),h=g.get(n);if(!h){m?.("012",mn.error012(n));return}l.setState({nodesSelectionActive:!1}),h.selected?(o||h.selected&&d)&&(c({nodes:[h],edges:[]}),requestAnimationFrame(()=>s?.current?.blur())):r([n])}function ev({nodeRef:n,disabled:l=!1,noDragClassName:o,handleSelector:s,nodeId:r,isSelectable:c,nodeClickDistance:d}){const g=Ke(),[m,h]=Z.useState(!1),y=Z.useRef();return Z.useEffect(()=>{y.current=eN({getStoreItems:()=>g.getState(),onNodeMouseDown:v=>{$f({id:v,store:g,nodeRef:n})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),Z.useEffect(()=>{if(!(l||!n.current||!y.current))return y.current.update({noDragClassName:o,handleSelector:s,domNode:n.current,isSelectable:c,nodeId:r,nodeClickDistance:d}),()=>{y.current?.destroy()}},[o,s,l,c,n,r,d]),m}const hA=n=>l=>l.selected&&(l.draggable||n&&typeof l.draggable>"u");function tv(){const n=Ke();return Z.useCallback(o=>{const{nodeExtent:s,snapToGrid:r,snapGrid:c,nodesDraggable:d,onError:g,updateNodePositions:m,nodeLookup:h,nodeOrigin:y}=n.getState(),v=new Map,p=hA(d),x=r?c[0]:5,_=r?c[1]:5,M=o.direction.x*x*o.factor,A=o.direction.y*_*o.factor;for(const[,T]of h){if(!p(T))continue;let B={x:T.internals.positionAbsolute.x+M,y:T.internals.positionAbsolute.y+A};r&&(B=Mo(B,c));const{position:E,positionAbsolute:D}=b0({nodeId:T.id,nextPosition:B,nodeLookup:h,nodeExtent:s,nodeOrigin:y,onError:g});T.position=E,T.internals.positionAbsolute=D,v.set(T.id,T)}m(v)},[])}const cd=Z.createContext(null),gA=cd.Provider;cd.Consumer;const nv=()=>Z.useContext(cd),mA=n=>({connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}),pA=(n,l,o)=>s=>{const{connectionClickStartHandle:r,connectionMode:c,connection:d}=s,{fromHandle:g,toHandle:m,isValid:h}=d,y=m?.nodeId===n&&m?.id===l&&m?.type===o;return{connectingFrom:g?.nodeId===n&&g?.id===l&&g?.type===o,connectingTo:y,clickConnecting:r?.nodeId===n&&r?.id===l&&r?.type===o,isPossibleEndHandle:c===ai.Strict?g?.type!==o:n!==g?.nodeId||l!==g?.id,connectionInProcess:!!g,clickConnectionInProcess:!!r,valid:y&&h}};function yA({type:n="source",position:l=me.Top,isValidConnection:o,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:c=!0,id:d,onConnect:g,children:m,className:h,onMouseDown:y,onTouchStart:v,...p},x){const _=d||null,M=n==="target",A=Ke(),T=nv(),{connectOnClick:B,noPanClassName:E,rfId:D}=Re(mA,$e),{connectingFrom:Y,connectingTo:R,clickConnecting:L,isPossibleEndHandle:H,connectionInProcess:$,clickConnectionInProcess:V,valid:k}=Re(pA(T,_,n),$e);T||A.getState().onError?.("010",mn.error010());const P=I=>{const{defaultEdgeOptions:N,onConnect:j,hasDefaultEdges:G}=A.getState(),Q={...N,...I};if(G){const{edges:ne,setEdges:C}=A.getState();C(B_(Q,ne))}j?.(Q),g?.(Q)},te=I=>{if(!T)return;const N=C0(I.nativeEvent);if(r&&(N&&I.button===0||!N)){const j=A.getState();Xf.onPointerDown(I.nativeEvent,{handleDomNode:I.currentTarget,autoPanOnConnect:j.autoPanOnConnect,connectionMode:j.connectionMode,connectionRadius:j.connectionRadius,domNode:j.domNode,nodeLookup:j.nodeLookup,lib:j.lib,isTarget:M,handleId:_,nodeId:T,flowId:j.rfId,panBy:j.panBy,cancelConnection:j.cancelConnection,onConnectStart:j.onConnectStart,onConnectEnd:(...G)=>A.getState().onConnectEnd?.(...G),updateConnection:j.updateConnection,onConnect:P,isValidConnection:o||((...G)=>A.getState().isValidConnection?.(...G)??!0),getTransform:()=>A.getState().transform,getFromHandle:()=>A.getState().connection.fromHandle,autoPanSpeed:j.autoPanSpeed,dragThreshold:j.connectionDragThreshold})}N?y?.(I):v?.(I)},z=I=>{const{onClickConnectStart:N,onClickConnectEnd:j,connectionClickStartHandle:G,connectionMode:Q,isValidConnection:ne,lib:C,rfId:U,nodeLookup:ee,connection:ae}=A.getState();if(!T||!G&&!r)return;if(!G){N?.(I.nativeEvent,{nodeId:T,handleId:_,handleType:n}),A.setState({connectionClickStartHandle:{nodeId:T,type:n,id:_}});return}const ue=A0(I.target),fe=o||ne,{connection:ce,isValid:re}=Xf.isValid(I.nativeEvent,{handle:{nodeId:T,id:_,type:n},connectionMode:Q,fromNodeId:G.nodeId,fromHandleId:G.id||null,fromType:G.type,isValidConnection:fe,flowId:U,doc:ue,lib:C,nodeLookup:ee});re&&ce&&P(ce);const de=structuredClone(ae);delete de.inProgress,de.toPosition=de.toHandle?de.toHandle.position:null,j?.(I,de),A.setState({connectionClickStartHandle:null})};return b.jsx("div",{"data-handleid":_,"data-nodeid":T,"data-handlepos":l,"data-id":`${D}-${T}-${_}-${n}`,className:it(["react-flow__handle",`react-flow__handle-${l}`,"nodrag",E,h,{source:!M,target:M,connectable:s,connectablestart:r,connectableend:c,clickconnecting:L,connectingfrom:Y,connectingto:R,valid:k,connectionindicator:s&&(!$||H)&&($||V?c:r)}]),onMouseDown:te,onTouchStart:te,onClick:B?z:void 0,ref:x,...p,children:m})}const ri=Z.memo(P0(yA));function vA({data:n,isConnectable:l,sourcePosition:o=me.Bottom}){return b.jsxs(b.Fragment,{children:[n?.label,b.jsx(ri,{type:"source",position:o,isConnectable:l})]})}function SA({data:n,isConnectable:l,targetPosition:o=me.Top,sourcePosition:s=me.Bottom}){return b.jsxs(b.Fragment,{children:[b.jsx(ri,{type:"target",position:o,isConnectable:l}),n?.label,b.jsx(ri,{type:"source",position:s,isConnectable:l})]})}function bA(){return null}function xA({data:n,isConnectable:l,targetPosition:o=me.Top}){return b.jsxs(b.Fragment,{children:[b.jsx(ri,{type:"target",position:o,isConnectable:l}),n?.label]})}const Cr={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},vy={input:vA,default:SA,output:xA,group:bA};function EA(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 wA=n=>{const{width:l,height:o,x:s,y:r}=Co(n.nodeLookup,{filter:c=>!!c.selected});return{width:nn(l)?l:null,height:nn(o)?o:null,userSelectionActive:n.userSelectionActive,transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]}) translate(${s}px,${r}px)`}};function _A({onSelectionContextMenu:n,noPanClassName:l,disableKeyboardA11y:o}){const s=Ke(),{width:r,height:c,transformString:d,userSelectionActive:g}=Re(wA,$e),m=tv(),h=Z.useRef(null);Z.useEffect(()=>{o||h.current?.focus({preventScroll:!0})},[o]);const y=!g&&r!==null&&c!==null;if(ev({nodeRef:h,disabled:!y}),!y)return null;const v=n?x=>{const _=s.getState().nodes.filter(M=>M.selected);n(x,_)}:void 0,p=x=>{Object.prototype.hasOwnProperty.call(Cr,x.key)&&(x.preventDefault(),m({direction:Cr[x.key],factor:x.shiftKey?4:1}))};return b.jsx("div",{className:it(["react-flow__nodesselection","react-flow__container",l]),style:{transform:d},children:b.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:v,tabIndex:o?void 0:-1,onKeyDown:o?void 0:p,style:{width:r,height:c}})})}const Sy=typeof window<"u"?window:void 0,NA=n=>({nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive});function av({children:n,onPaneClick:l,onPaneMouseEnter:o,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:c,onPaneScroll:d,paneClickDistance:g,deleteKeyCode:m,selectionKeyCode:h,selectionOnDrag:y,selectionMode:v,onSelectionStart:p,onSelectionEnd:x,multiSelectionKeyCode:_,panActivationKeyCode:M,zoomActivationKeyCode:A,elementsSelectable:T,zoomOnScroll:B,zoomOnPinch:E,panOnScroll:D,panOnScrollSpeed:Y,panOnScrollMode:R,zoomOnDoubleClick:L,panOnDrag:H,defaultViewport:$,translateExtent:V,minZoom:k,maxZoom:P,preventScrolling:te,onSelectionContextMenu:z,noWheelClassName:I,noPanClassName:N,disableKeyboardA11y:j,onViewportChange:G,isControlledViewport:Q}){const{nodesSelectionActive:ne,userSelectionActive:C}=Re(NA,$e),U=wo(h,{target:Sy}),ee=wo(M,{target:Sy}),ae=ee||H,ue=ee||D,fe=y&&ae!==!0,ce=U||C||fe;return iA({deleteKeyCode:m,multiSelectionKeyCode:_}),b.jsx(rA,{onPaneContextMenu:c,elementsSelectable:T,zoomOnScroll:B,zoomOnPinch:E,panOnScroll:ue,panOnScrollSpeed:Y,panOnScrollMode:R,zoomOnDoubleClick:L,panOnDrag:!U&&ae,defaultViewport:$,translateExtent:V,minZoom:k,maxZoom:P,zoomActivationKeyCode:A,preventScrolling:te,noWheelClassName:I,noPanClassName:N,onViewportChange:G,isControlledViewport:Q,paneClickDistance:g,selectionOnDrag:fe,children:b.jsxs(dA,{onSelectionStart:p,onSelectionEnd:x,onPaneClick:l,onPaneMouseEnter:o,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:c,onPaneScroll:d,panOnDrag:ae,isSelecting:!!ce,selectionMode:v,selectionKeyPressed:U,paneClickDistance:g,selectionOnDrag:fe,children:[n,ne&&b.jsx(_A,{onSelectionContextMenu:z,noPanClassName:N,disableKeyboardA11y:j})]})})}av.displayName="FlowRenderer";const AA=Z.memo(av),TA=n=>l=>n?nd(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 CA(n){return Re(Z.useCallback(TA(n),[n]),$e)}const MA=n=>n.updateNodeInternals;function zA(){const n=Re(MA),[l]=Z.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(o=>{const s=new Map;o.forEach(r=>{const c=r.target.getAttribute("data-id");s.set(c,{id:c,nodeElement:r.target,force:!0})}),n(s)}));return Z.useEffect(()=>()=>{l?.disconnect()},[l]),l}function DA({node:n,nodeType:l,hasDimensions:o,resizeObserver:s}){const r=Ke(),c=Z.useRef(null),d=Z.useRef(null),g=Z.useRef(n.sourcePosition),m=Z.useRef(n.targetPosition),h=Z.useRef(l),y=o&&!!n.internals.handleBounds;return Z.useEffect(()=>{c.current&&!n.hidden&&(!y||d.current!==c.current)&&(d.current&&s?.unobserve(d.current),s?.observe(c.current),d.current=c.current)},[y,n.hidden]),Z.useEffect(()=>()=>{d.current&&(s?.unobserve(d.current),d.current=null)},[]),Z.useEffect(()=>{if(c.current){const v=h.current!==l,p=g.current!==n.sourcePosition,x=m.current!==n.targetPosition;(v||p||x)&&(h.current=l,g.current=n.sourcePosition,m.current=n.targetPosition,r.getState().updateNodeInternals(new Map([[n.id,{id:n.id,nodeElement:c.current,force:!0}]])))}},[n.id,l,n.sourcePosition,n.targetPosition]),c}function RA({id:n,onClick:l,onMouseEnter:o,onMouseMove:s,onMouseLeave:r,onContextMenu:c,onDoubleClick:d,nodesDraggable:g,elementsSelectable:m,nodesConnectable:h,nodesFocusable:y,resizeObserver:v,noDragClassName:p,noPanClassName:x,disableKeyboardA11y:_,rfId:M,nodeTypes:A,nodeClickDistance:T,onError:B}){const{node:E,internals:D,isParent:Y}=Re(re=>{const de=re.nodeLookup.get(n),we=re.parentLookup.has(n);return{node:de,internals:de.internals,isParent:we}},$e);let R=E.type||"default",L=A?.[R]||vy[R];L===void 0&&(B?.("003",mn.error003(R)),R="default",L=A?.default||vy.default);const H=!!(E.draggable||g&&typeof E.draggable>"u"),$=!!(E.selectable||m&&typeof E.selectable>"u"),V=!!(E.connectable||h&&typeof E.connectable>"u"),k=!!(E.focusable||y&&typeof E.focusable>"u"),P=Ke(),te=_0(E),z=DA({node:E,nodeType:R,hasDimensions:te,resizeObserver:v}),I=ev({nodeRef:z,disabled:E.hidden||!H,noDragClassName:p,handleSelector:E.dragHandle,nodeId:n,isSelectable:$,nodeClickDistance:T}),N=tv();if(E.hidden)return null;const j=Vn(E),G=EA(E),Q=$||H||l||o||s||r,ne=o?re=>o(re,{...D.userNode}):void 0,C=s?re=>s(re,{...D.userNode}):void 0,U=r?re=>r(re,{...D.userNode}):void 0,ee=c?re=>c(re,{...D.userNode}):void 0,ae=d?re=>d(re,{...D.userNode}):void 0,ue=re=>{const{selectNodesOnDrag:de,nodeDragThreshold:we}=P.getState();$&&(!de||!H||we>0)&&$f({id:n,store:P,nodeRef:z}),l&&l(re,{...D.userNode})},fe=re=>{if(!(T0(re.nativeEvent)||_)){if(m0.includes(re.key)&&$){const de=re.key==="Escape";$f({id:n,store:P,unselect:de,nodeRef:z})}else if(H&&E.selected&&Object.prototype.hasOwnProperty.call(Cr,re.key)){re.preventDefault();const{ariaLabelConfig:de}=P.getState();P.setState({ariaLiveMessage:de["node.a11yDescription.ariaLiveMessage"]({direction:re.key.replace("Arrow","").toLowerCase(),x:~~D.positionAbsolute.x,y:~~D.positionAbsolute.y})}),N({direction:Cr[re.key],factor:re.shiftKey?4:1})}}},ce=()=>{if(_||!z.current?.matches(":focus-visible"))return;const{transform:re,width:de,height:we,autoPanOnNodeFocus:xe,setCenter:ye}=P.getState();if(!xe)return;nd(new Map([[n,E]]),{x:0,y:0,width:de,height:we},re,!0).length>0||ye(E.position.x+j.width/2,E.position.y+j.height/2,{zoom:re[2]})};return b.jsx("div",{className:it(["react-flow__node",`react-flow__node-${R}`,{[x]:H},E.className,{selected:E.selected,selectable:$,parent:Y,draggable:H,dragging:I}]),ref:z,style:{zIndex:D.z,transform:`translate(${D.positionAbsolute.x}px,${D.positionAbsolute.y}px)`,pointerEvents:Q?"all":"none",visibility:te?"visible":"hidden",...E.style,...G},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:ne,onMouseMove:C,onMouseLeave:U,onContextMenu:ee,onClick:ue,onDoubleClick:ae,onKeyDown:k?fe:void 0,tabIndex:k?0:void 0,onFocus:k?ce:void 0,role:E.ariaRole??(k?"group":void 0),"aria-roledescription":"node","aria-describedby":_?void 0:`${Z0}-${M}`,"aria-label":E.ariaLabel,...E.domAttributes,children:b.jsx(gA,{value:n,children:b.jsx(L,{id:n,data:E.data,type:R,positionAbsoluteX:D.positionAbsolute.x,positionAbsoluteY:D.positionAbsolute.y,selected:E.selected??!1,selectable:$,draggable:H,deletable:E.deletable??!0,isConnectable:V,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:I,dragHandle:E.dragHandle,zIndex:D.z,parentId:E.parentId,...j})})})}var OA=Z.memo(RA);const jA=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError});function lv(n){const{nodesDraggable:l,nodesConnectable:o,nodesFocusable:s,elementsSelectable:r,onError:c}=Re(jA,$e),d=CA(n.onlyRenderVisibleElements),g=zA();return b.jsx("div",{className:"react-flow__nodes",style:Gr,children:d.map(m=>b.jsx(OA,{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:g,nodesDraggable:l,nodesConnectable:o,nodesFocusable:s,elementsSelectable:r,nodeClickDistance:n.nodeClickDistance,onError:c},m))})}lv.displayName="NodeRenderer";const HA=Z.memo(lv);function LA(n){return Re(Z.useCallback(o=>{if(!n)return o.edges.map(r=>r.id);const s=[];if(o.width&&o.height)for(const r of o.edges){const c=o.nodeLookup.get(r.source),d=o.nodeLookup.get(r.target);c&&d&&H_({sourceNode:c,targetNode:d,width:o.width,height:o.height,transform:o.transform})&&s.push(r.id)}return s},[n]),$e)}const UA=({color:n="none",strokeWidth:l=1})=>{const o={strokeWidth:l,...n&&{stroke:n}};return b.jsx("polyline",{className:"arrow",style:o,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},BA=({color:n="none",strokeWidth:l=1})=>{const o={strokeWidth:l,...n&&{stroke:n,fill:n}};return b.jsx("polyline",{className:"arrowclosed",style:o,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},by={[Nr.Arrow]:UA,[Nr.ArrowClosed]:BA};function qA(n){const l=Ke();return Z.useMemo(()=>Object.prototype.hasOwnProperty.call(by,n)?by[n]:(l.getState().onError?.("009",mn.error009(n)),null),[n])}const GA=({id:n,type:l,color:o,width:s=12.5,height:r=12.5,markerUnits:c="strokeWidth",strokeWidth:d,orient:g="auto-start-reverse"})=>{const m=qA(l);return m?b.jsx("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:g,refX:"0",refY:"0",children:b.jsx(m,{color:o,strokeWidth:d})}):null},iv=({defaultColor:n,rfId:l})=>{const o=Re(c=>c.edges),s=Re(c=>c.defaultEdgeOptions),r=Z.useMemo(()=>I_(o,{id:l,defaultColor:n,defaultMarkerStart:s?.markerStart,defaultMarkerEnd:s?.markerEnd}),[o,s,l,n]);return r.length?b.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:b.jsx("defs",{children:r.map(c=>b.jsx(GA,{id:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,strokeWidth:c.strokeWidth,orient:c.orient},c.id))})}):null};iv.displayName="MarkerDefinitions";var YA=Z.memo(iv);function ov({x:n,y:l,label:o,labelStyle:s,labelShowBg:r=!0,labelBgStyle:c,labelBgPadding:d=[2,4],labelBgBorderRadius:g=2,children:m,className:h,...y}){const[v,p]=Z.useState({x:1,y:0,width:0,height:0}),x=it(["react-flow__edge-textwrapper",h]),_=Z.useRef(null);return Z.useEffect(()=>{if(_.current){const M=_.current.getBBox();p({x:M.x,y:M.y,width:M.width,height:M.height})}},[o]),o?b.jsxs("g",{transform:`translate(${n-v.width/2} ${l-v.height/2})`,className:x,visibility:v.width?"visible":"hidden",...y,children:[r&&b.jsx("rect",{width:v.width+2*d[0],x:-d[0],y:-d[1],height:v.height+2*d[1],className:"react-flow__edge-textbg",style:c,rx:g,ry:g}),b.jsx("text",{className:"react-flow__edge-text",y:v.height/2,dy:"0.3em",ref:_,style:s,children:o}),m]}):null}ov.displayName="EdgeText";const kA=Z.memo(ov);function Yr({path:n,labelX:l,labelY:o,label:s,labelStyle:r,labelShowBg:c,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,interactionWidth:h=20,...y}){return b.jsxs(b.Fragment,{children:[b.jsx("path",{...y,d:n,fill:"none",className:it(["react-flow__edge-path",y.className])}),h?b.jsx("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,s&&nn(l)&&nn(o)?b.jsx(kA,{x:l,y:o,label:s,labelStyle:r,labelShowBg:c,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m}):null]})}function xy({pos:n,x1:l,y1:o,x2:s,y2:r}){return n===me.Left||n===me.Right?[.5*(l+s),o]:[l,.5*(o+r)]}function sv({sourceX:n,sourceY:l,sourcePosition:o=me.Bottom,targetX:s,targetY:r,targetPosition:c=me.Top}){const[d,g]=xy({pos:o,x1:n,y1:l,x2:s,y2:r}),[m,h]=xy({pos:c,x1:s,y1:r,x2:n,y2:l}),[y,v,p,x]=M0({sourceX:n,sourceY:l,targetX:s,targetY:r,sourceControlX:d,sourceControlY:g,targetControlX:m,targetControlY:h});return[`M${n},${l} C${d},${g} ${m},${h} ${s},${r}`,y,v,p,x]}function rv(n){return Z.memo(({id:l,sourceX:o,sourceY:s,targetX:r,targetY:c,sourcePosition:d,targetPosition:g,label:m,labelStyle:h,labelShowBg:y,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:x,style:_,markerEnd:M,markerStart:A,interactionWidth:T})=>{const[B,E,D]=sv({sourceX:o,sourceY:s,sourcePosition:d,targetX:r,targetY:c,targetPosition:g}),Y=n.isInternal?void 0:l;return b.jsx(Yr,{id:Y,path:B,labelX:E,labelY:D,label:m,labelStyle:h,labelShowBg:y,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:x,style:_,markerEnd:M,markerStart:A,interactionWidth:T})})}const IA=rv({isInternal:!1}),uv=rv({isInternal:!0});IA.displayName="SimpleBezierEdge";uv.displayName="SimpleBezierEdgeInternal";function cv(n){return Z.memo(({id:l,sourceX:o,sourceY:s,targetX:r,targetY:c,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:y,labelBgBorderRadius:v,style:p,sourcePosition:x=me.Bottom,targetPosition:_=me.Top,markerEnd:M,markerStart:A,pathOptions:T,interactionWidth:B})=>{const[E,D,Y]=kf({sourceX:o,sourceY:s,sourcePosition:x,targetX:r,targetY:c,targetPosition:_,borderRadius:T?.borderRadius,offset:T?.offset,stepPosition:T?.stepPosition}),R=n.isInternal?void 0:l;return b.jsx(Yr,{id:R,path:E,labelX:D,labelY:Y,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:y,labelBgBorderRadius:v,style:p,markerEnd:M,markerStart:A,interactionWidth:B})})}const fv=cv({isInternal:!1}),dv=cv({isInternal:!0});fv.displayName="SmoothStepEdge";dv.displayName="SmoothStepEdgeInternal";function hv(n){return Z.memo(({id:l,...o})=>{const s=n.isInternal?void 0:l;return b.jsx(fv,{...o,id:s,pathOptions:Z.useMemo(()=>({borderRadius:0,offset:o.pathOptions?.offset}),[o.pathOptions?.offset])})})}const VA=hv({isInternal:!1}),gv=hv({isInternal:!0});VA.displayName="StepEdge";gv.displayName="StepEdgeInternal";function mv(n){return Z.memo(({id:l,sourceX:o,sourceY:s,targetX:r,targetY:c,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:y,labelBgBorderRadius:v,style:p,markerEnd:x,markerStart:_,interactionWidth:M})=>{const[A,T,B]=R0({sourceX:o,sourceY:s,targetX:r,targetY:c}),E=n.isInternal?void 0:l;return b.jsx(Yr,{id:E,path:A,labelX:T,labelY:B,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:y,labelBgBorderRadius:v,style:p,markerEnd:x,markerStart:_,interactionWidth:M})})}const XA=mv({isInternal:!1}),pv=mv({isInternal:!0});XA.displayName="StraightEdge";pv.displayName="StraightEdgeInternal";function yv(n){return Z.memo(({id:l,sourceX:o,sourceY:s,targetX:r,targetY:c,sourcePosition:d=me.Bottom,targetPosition:g=me.Top,label:m,labelStyle:h,labelShowBg:y,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:x,style:_,markerEnd:M,markerStart:A,pathOptions:T,interactionWidth:B})=>{const[E,D,Y]=z0({sourceX:o,sourceY:s,sourcePosition:d,targetX:r,targetY:c,targetPosition:g,curvature:T?.curvature}),R=n.isInternal?void 0:l;return b.jsx(Yr,{id:R,path:E,labelX:D,labelY:Y,label:m,labelStyle:h,labelShowBg:y,labelBgStyle:v,labelBgPadding:p,labelBgBorderRadius:x,style:_,markerEnd:M,markerStart:A,interactionWidth:B})})}const ZA=yv({isInternal:!1}),vv=yv({isInternal:!0});ZA.displayName="BezierEdge";vv.displayName="BezierEdgeInternal";const Ey={default:vv,straight:pv,step:gv,smoothstep:dv,simplebezier:uv},wy={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},$A=(n,l,o)=>o===me.Left?n-l:o===me.Right?n+l:n,QA=(n,l,o)=>o===me.Top?n-l:o===me.Bottom?n+l:n,_y="react-flow__edgeupdater";function Ny({position:n,centerX:l,centerY:o,radius:s=10,onMouseDown:r,onMouseEnter:c,onMouseOut:d,type:g}){return b.jsx("circle",{onMouseDown:r,onMouseEnter:c,onMouseOut:d,className:it([_y,`${_y}-${g}`]),cx:$A(l,s,n),cy:QA(o,s,n),r:s,stroke:"transparent",fill:"transparent"})}function KA({isReconnectable:n,reconnectRadius:l,edge:o,sourceX:s,sourceY:r,targetX:c,targetY:d,sourcePosition:g,targetPosition:m,onReconnect:h,onReconnectStart:y,onReconnectEnd:v,setReconnecting:p,setUpdateHover:x}){const _=Ke(),M=(D,Y)=>{if(D.button!==0)return;const{autoPanOnConnect:R,domNode:L,connectionMode:H,connectionRadius:$,lib:V,onConnectStart:k,cancelConnection:P,nodeLookup:te,rfId:z,panBy:I,updateConnection:N}=_.getState(),j=Y.type==="target",G=(C,U)=>{p(!1),v?.(C,o,Y.type,U)},Q=C=>h?.(o,C),ne=(C,U)=>{p(!0),y?.(D,o,Y.type),k?.(C,U)};Xf.onPointerDown(D.nativeEvent,{autoPanOnConnect:R,connectionMode:H,connectionRadius:$,domNode:L,handleId:Y.id,nodeId:Y.nodeId,nodeLookup:te,isTarget:j,edgeUpdaterType:Y.type,lib:V,flowId:z,cancelConnection:P,panBy:I,isValidConnection:(...C)=>_.getState().isValidConnection?.(...C)??!0,onConnect:Q,onConnectStart:ne,onConnectEnd:(...C)=>_.getState().onConnectEnd?.(...C),onReconnectEnd:G,updateConnection:N,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,dragThreshold:_.getState().connectionDragThreshold,handleDomNode:D.currentTarget})},A=D=>M(D,{nodeId:o.target,id:o.targetHandle??null,type:"target"}),T=D=>M(D,{nodeId:o.source,id:o.sourceHandle??null,type:"source"}),B=()=>x(!0),E=()=>x(!1);return b.jsxs(b.Fragment,{children:[(n===!0||n==="source")&&b.jsx(Ny,{position:g,centerX:s,centerY:r,radius:l,onMouseDown:A,onMouseEnter:B,onMouseOut:E,type:"source"}),(n===!0||n==="target")&&b.jsx(Ny,{position:m,centerX:c,centerY:d,radius:l,onMouseDown:T,onMouseEnter:B,onMouseOut:E,type:"target"})]})}function FA({id:n,edgesFocusable:l,edgesReconnectable:o,elementsSelectable:s,onClick:r,onDoubleClick:c,onContextMenu:d,onMouseEnter:g,onMouseMove:m,onMouseLeave:h,reconnectRadius:y,onReconnect:v,onReconnectStart:p,onReconnectEnd:x,rfId:_,edgeTypes:M,noPanClassName:A,onError:T,disableKeyboardA11y:B}){let E=Re(ye=>ye.edgeLookup.get(n));const D=Re(ye=>ye.defaultEdgeOptions);E=D?{...D,...E}:E;let Y=E.type||"default",R=M?.[Y]||Ey[Y];R===void 0&&(T?.("011",mn.error011(Y)),Y="default",R=M?.default||Ey.default);const L=!!(E.focusable||l&&typeof E.focusable>"u"),H=typeof v<"u"&&(E.reconnectable||o&&typeof E.reconnectable>"u"),$=!!(E.selectable||s&&typeof E.selectable>"u"),V=Z.useRef(null),[k,P]=Z.useState(!1),[te,z]=Z.useState(!1),I=Ke(),{zIndex:N,sourceX:j,sourceY:G,targetX:Q,targetY:ne,sourcePosition:C,targetPosition:U}=Re(Z.useCallback(ye=>{const Se=ye.nodeLookup.get(E.source),Ce=ye.nodeLookup.get(E.target);if(!Se||!Ce)return{zIndex:E.zIndex,...wy};const qe=k_({id:n,sourceNode:Se,targetNode:Ce,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:ye.connectionMode,onError:T});return{zIndex:j_({selected:E.selected,zIndex:E.zIndex,sourceNode:Se,targetNode:Ce,elevateOnSelect:ye.elevateEdgesOnSelect,zIndexMode:ye.zIndexMode}),...qe||wy}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),$e),ee=Z.useMemo(()=>E.markerStart?`url('#${If(E.markerStart,_)}')`:void 0,[E.markerStart,_]),ae=Z.useMemo(()=>E.markerEnd?`url('#${If(E.markerEnd,_)}')`:void 0,[E.markerEnd,_]);if(E.hidden||j===null||G===null||Q===null||ne===null)return null;const ue=ye=>{const{addSelectedEdges:Se,unselectNodesAndEdges:Ce,multiSelectionActive:qe}=I.getState();$&&(I.setState({nodesSelectionActive:!1}),E.selected&&qe?(Ce({nodes:[],edges:[E]}),V.current?.blur()):Se([n])),r&&r(ye,E)},fe=c?ye=>{c(ye,{...E})}:void 0,ce=d?ye=>{d(ye,{...E})}:void 0,re=g?ye=>{g(ye,{...E})}:void 0,de=m?ye=>{m(ye,{...E})}:void 0,we=h?ye=>{h(ye,{...E})}:void 0,xe=ye=>{if(!B&&m0.includes(ye.key)&&$){const{unselectNodesAndEdges:Se,addSelectedEdges:Ce}=I.getState();ye.key==="Escape"?(V.current?.blur(),Se({edges:[E]})):Ce([n])}};return b.jsx("svg",{style:{zIndex:N},children:b.jsxs("g",{className:it(["react-flow__edge",`react-flow__edge-${Y}`,E.className,A,{selected:E.selected,animated:E.animated,inactive:!$&&!r,updating:k,selectable:$}]),onClick:ue,onDoubleClick:fe,onContextMenu:ce,onMouseEnter:re,onMouseMove:de,onMouseLeave:we,onKeyDown:L?xe:void 0,tabIndex:L?0:void 0,role:E.ariaRole??(L?"group":"img"),"aria-roledescription":"edge","data-id":n,"data-testid":`rf__edge-${n}`,"aria-label":E.ariaLabel===null?void 0:E.ariaLabel||`Edge from ${E.source} to ${E.target}`,"aria-describedby":L?`${$0}-${_}`:void 0,ref:V,...E.domAttributes,children:[!te&&b.jsx(R,{id:n,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:$,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:j,sourceY:G,targetX:Q,targetY:ne,sourcePosition:C,targetPosition:U,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:ee,markerEnd:ae,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),H&&b.jsx(KA,{edge:E,isReconnectable:H,reconnectRadius:y,onReconnect:v,onReconnectStart:p,onReconnectEnd:x,sourceX:j,sourceY:G,targetX:Q,targetY:ne,sourcePosition:C,targetPosition:U,setUpdateHover:P,setReconnecting:z})]})})}var JA=Z.memo(FA);const PA=n=>({edgesFocusable:n.edgesFocusable,edgesReconnectable:n.edgesReconnectable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError});function Sv({defaultMarkerColor:n,onlyRenderVisibleElements:l,rfId:o,edgeTypes:s,noPanClassName:r,onReconnect:c,onEdgeContextMenu:d,onEdgeMouseEnter:g,onEdgeMouseMove:m,onEdgeMouseLeave:h,onEdgeClick:y,reconnectRadius:v,onEdgeDoubleClick:p,onReconnectStart:x,onReconnectEnd:_,disableKeyboardA11y:M}){const{edgesFocusable:A,edgesReconnectable:T,elementsSelectable:B,onError:E}=Re(PA,$e),D=LA(l);return b.jsxs("div",{className:"react-flow__edges",children:[b.jsx(YA,{defaultColor:n,rfId:o}),D.map(Y=>b.jsx(JA,{id:Y,edgesFocusable:A,edgesReconnectable:T,elementsSelectable:B,noPanClassName:r,onReconnect:c,onContextMenu:d,onMouseEnter:g,onMouseMove:m,onMouseLeave:h,onClick:y,reconnectRadius:v,onDoubleClick:p,onReconnectStart:x,onReconnectEnd:_,rfId:o,onError:E,edgeTypes:s,disableKeyboardA11y:M},Y))]})}Sv.displayName="EdgeRenderer";const WA=Z.memo(Sv),eT=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function tT({children:n}){const l=Re(eT);return b.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:l},children:n})}function nT(n){const l=qr(),o=Z.useRef(!1);Z.useEffect(()=>{!o.current&&l.viewportInitialized&&n&&(setTimeout(()=>n(l),1),o.current=!0)},[n,l.viewportInitialized])}const aT=n=>n.panZoom?.syncViewport;function lT(n){const l=Re(aT),o=Ke();return Z.useEffect(()=>{n&&(l?.(n),o.setState({transform:[n.x,n.y,n.zoom]}))},[n,l]),null}function iT(n){return n.connection.inProgress?{...n.connection,to:zo(n.connection.to,n.transform)}:{...n.connection}}function oT(n){return iT}function sT(n){const l=oT();return Re(l,$e)}const rT=n=>({nodesConnectable:n.nodesConnectable,isValid:n.connection.isValid,inProgress:n.connection.inProgress,width:n.width,height:n.height});function uT({containerStyle:n,style:l,type:o,component:s}){const{nodesConnectable:r,width:c,height:d,isValid:g,inProgress:m}=Re(rT,$e);return!(c&&r&&m)?null:b.jsx("svg",{style:n,width:c,height:d,className:"react-flow__connectionline react-flow__container",children:b.jsx("g",{className:it(["react-flow__connection",v0(g)]),children:b.jsx(bv,{style:l,type:o,CustomComponent:s,isValid:g})})})}const bv=({style:n,type:l=wa.Bezier,CustomComponent:o,isValid:s})=>{const{inProgress:r,from:c,fromNode:d,fromHandle:g,fromPosition:m,to:h,toNode:y,toHandle:v,toPosition:p,pointer:x}=sT();if(!r)return;if(o)return b.jsx(o,{connectionLineType:l,connectionLineStyle:n,fromNode:d,fromHandle:g,fromX:c.x,fromY:c.y,toX:h.x,toY:h.y,fromPosition:m,toPosition:p,connectionStatus:v0(s),toNode:y,toHandle:v,pointer:x});let _="";const M={sourceX:c.x,sourceY:c.y,sourcePosition:m,targetX:h.x,targetY:h.y,targetPosition:p};switch(l){case wa.Bezier:[_]=z0(M);break;case wa.SimpleBezier:[_]=sv(M);break;case wa.Step:[_]=kf({...M,borderRadius:0});break;case wa.SmoothStep:[_]=kf(M);break;default:[_]=R0(M)}return b.jsx("path",{d:_,fill:"none",className:"react-flow__connection-path",style:n})};bv.displayName="ConnectionLine";const cT={};function Ay(n=cT){Z.useRef(n),Ke(),Z.useEffect(()=>{},[n])}function fT(){Ke(),Z.useRef(!1),Z.useEffect(()=>{},[])}function xv({nodeTypes:n,edgeTypes:l,onInit:o,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:c,onEdgeDoubleClick:d,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:h,onNodeContextMenu:y,onSelectionContextMenu:v,onSelectionStart:p,onSelectionEnd:x,connectionLineType:_,connectionLineStyle:M,connectionLineComponent:A,connectionLineContainerStyle:T,selectionKeyCode:B,selectionOnDrag:E,selectionMode:D,multiSelectionKeyCode:Y,panActivationKeyCode:R,zoomActivationKeyCode:L,deleteKeyCode:H,onlyRenderVisibleElements:$,elementsSelectable:V,defaultViewport:k,translateExtent:P,minZoom:te,maxZoom:z,preventScrolling:I,defaultMarkerColor:N,zoomOnScroll:j,zoomOnPinch:G,panOnScroll:Q,panOnScrollSpeed:ne,panOnScrollMode:C,zoomOnDoubleClick:U,panOnDrag:ee,onPaneClick:ae,onPaneMouseEnter:ue,onPaneMouseMove:fe,onPaneMouseLeave:ce,onPaneScroll:re,onPaneContextMenu:de,paneClickDistance:we,nodeClickDistance:xe,onEdgeContextMenu:ye,onEdgeMouseEnter:Se,onEdgeMouseMove:Ce,onEdgeMouseLeave:qe,reconnectRadius:Le,onReconnect:rt,onReconnectStart:Qt,onReconnectEnd:zt,noDragClassName:Kt,noWheelClassName:yn,noPanClassName:Na,disableKeyboardA11y:Aa,nodeExtent:ft,rfId:il,viewport:vn,onViewportChange:Xn}){return Ay(n),Ay(l),fT(),nT(o),lT(vn),b.jsx(AA,{onPaneClick:ae,onPaneMouseEnter:ue,onPaneMouseMove:fe,onPaneMouseLeave:ce,onPaneContextMenu:de,onPaneScroll:re,paneClickDistance:we,deleteKeyCode:H,selectionKeyCode:B,selectionOnDrag:E,selectionMode:D,onSelectionStart:p,onSelectionEnd:x,multiSelectionKeyCode:Y,panActivationKeyCode:R,zoomActivationKeyCode:L,elementsSelectable:V,zoomOnScroll:j,zoomOnPinch:G,zoomOnDoubleClick:U,panOnScroll:Q,panOnScrollSpeed:ne,panOnScrollMode:C,panOnDrag:ee,defaultViewport:k,translateExtent:P,minZoom:te,maxZoom:z,onSelectionContextMenu:v,preventScrolling:I,noDragClassName:Kt,noWheelClassName:yn,noPanClassName:Na,disableKeyboardA11y:Aa,onViewportChange:Xn,isControlledViewport:!!vn,children:b.jsxs(tT,{children:[b.jsx(WA,{edgeTypes:l,onEdgeClick:r,onEdgeDoubleClick:d,onReconnect:rt,onReconnectStart:Qt,onReconnectEnd:zt,onlyRenderVisibleElements:$,onEdgeContextMenu:ye,onEdgeMouseEnter:Se,onEdgeMouseMove:Ce,onEdgeMouseLeave:qe,reconnectRadius:Le,defaultMarkerColor:N,noPanClassName:Na,disableKeyboardA11y:Aa,rfId:il}),b.jsx(uT,{style:M,type:_,component:A,containerStyle:T}),b.jsx("div",{className:"react-flow__edgelabel-renderer"}),b.jsx(HA,{nodeTypes:n,onNodeClick:s,onNodeDoubleClick:c,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:h,onNodeContextMenu:y,nodeClickDistance:xe,onlyRenderVisibleElements:$,noPanClassName:Na,noDragClassName:Kt,disableKeyboardA11y:Aa,nodeExtent:ft,rfId:il}),b.jsx("div",{className:"react-flow__viewport-portal"})]})})}xv.displayName="GraphView";const dT=Z.memo(xv),Ty=({nodes:n,edges:l,defaultNodes:o,defaultEdges:s,width:r,height:c,fitView:d,fitViewOptions:g,minZoom:m=.5,maxZoom:h=2,nodeOrigin:y,nodeExtent:v,zIndexMode:p="basic"}={})=>{const x=new Map,_=new Map,M=new Map,A=new Map,T=s??l??[],B=o??n??[],E=y??[0,0],D=v??So;H0(M,A,T);const{nodesInitialized:Y}=Vf(B,x,_,{nodeOrigin:E,nodeExtent:D,zIndexMode:p});let R=[0,0,1];if(d&&r&&c){const L=Co(x,{filter:k=>!!((k.width||k.initialWidth)&&(k.height||k.initialHeight))}),{x:H,y:$,zoom:V}=ad(L,r,c,m,h,g?.padding??.1);R=[H,$,V]}return{rfId:"1",width:r??0,height:c??0,transform:R,nodes:B,nodesInitialized:Y,nodeLookup:x,parentLookup:_,edges:T,edgeLookup:A,connectionLookup:M,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:o!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:m,maxZoom:h,translateExtent:So,nodeExtent:D,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ai.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:E,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:g,fitViewResolver:null,connection:{...y0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:C_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:p0,zIndexMode:p,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},hT=({nodes:n,edges:l,defaultNodes:o,defaultEdges:s,width:r,height:c,fitView:d,fitViewOptions:g,minZoom:m,maxZoom:h,nodeOrigin:y,nodeExtent:v,zIndexMode:p})=>RN((x,_)=>{async function M(){const{nodeLookup:A,panZoom:T,fitViewOptions:B,fitViewResolver:E,width:D,height:Y,minZoom:R,maxZoom:L}=_();T&&(await A_({nodes:A,width:D,height:Y,panZoom:T,minZoom:R,maxZoom:L},B),E?.resolve(!0),x({fitViewResolver:null}))}return{...Ty({nodes:n,edges:l,width:r,height:c,fitView:d,fitViewOptions:g,minZoom:m,maxZoom:h,nodeOrigin:y,nodeExtent:v,defaultNodes:o,defaultEdges:s,zIndexMode:p}),setNodes:A=>{const{nodeLookup:T,parentLookup:B,nodeOrigin:E,elevateNodesOnSelect:D,fitViewQueued:Y,zIndexMode:R,nodesSelectionActive:L}=_(),{nodesInitialized:H,hasSelectedNodes:$}=Vf(A,T,B,{nodeOrigin:E,nodeExtent:v,elevateNodesOnSelect:D,checkEquality:!0,zIndexMode:R}),V=L&&$;Y&&H?(M(),x({nodes:A,nodesInitialized:H,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:V})):x({nodes:A,nodesInitialized:H,nodesSelectionActive:V})},setEdges:A=>{const{connectionLookup:T,edgeLookup:B}=_();H0(T,B,A),x({edges:A})},setDefaultNodesAndEdges:(A,T)=>{if(A){const{setNodes:B}=_();B(A),x({hasDefaultNodes:!0})}if(T){const{setEdges:B}=_();B(T),x({hasDefaultEdges:!0})}},updateNodeInternals:A=>{const{triggerNodeChanges:T,nodeLookup:B,parentLookup:E,domNode:D,nodeOrigin:Y,nodeExtent:R,debug:L,fitViewQueued:H,zIndexMode:$}=_(),{changes:V,updatedInternals:k}=F_(A,B,E,D,Y,R,$);k&&(Z_(B,E,{nodeOrigin:Y,nodeExtent:R,zIndexMode:$}),H?(M(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),V?.length>0&&(L&&console.log("React Flow: trigger node changes",V),T?.(V)))},updateNodePositions:(A,T=!1)=>{const B=[];let E=[];const{nodeLookup:D,triggerNodeChanges:Y,connection:R,updateConnection:L,onNodesChangeMiddlewareMap:H}=_();for(const[$,V]of A){const k=D.get($),P=!!(k?.expandParent&&k?.parentId&&V?.position),te={id:$,type:"position",position:P?{x:Math.max(0,V.position.x),y:Math.max(0,V.position.y)}:V.position,dragging:T};if(k&&R.inProgress&&R.fromNode.id===k.id){const z=ll(k,R.fromHandle,me.Left,!0);L({...R,from:z})}P&&k.parentId&&B.push({id:$,parentId:k.parentId,rect:{...V.internals.positionAbsolute,width:V.measured.width??0,height:V.measured.height??0}}),E.push(te)}if(B.length>0){const{parentLookup:$,nodeOrigin:V}=_(),k=ud(B,D,$,V);E.push(...k)}for(const $ of H.values())E=$(E);Y(E)},triggerNodeChanges:A=>{const{onNodesChange:T,setNodes:B,nodes:E,hasDefaultNodes:D,debug:Y}=_();if(A?.length){if(D){const R=F0(A,E);B(R)}Y&&console.log("React Flow: trigger node changes",A),T?.(A)}},triggerEdgeChanges:A=>{const{onEdgesChange:T,setEdges:B,edges:E,hasDefaultEdges:D,debug:Y}=_();if(A?.length){if(D){const R=J0(A,E);B(R)}Y&&console.log("React Flow: trigger edge changes",A),T?.(A)}},addSelectedNodes:A=>{const{multiSelectionActive:T,edgeLookup:B,nodeLookup:E,triggerNodeChanges:D,triggerEdgeChanges:Y}=_();if(T){const R=A.map(L=>Ja(L,!0));D(R);return}D(Pl(E,new Set([...A]),!0)),Y(Pl(B))},addSelectedEdges:A=>{const{multiSelectionActive:T,edgeLookup:B,nodeLookup:E,triggerNodeChanges:D,triggerEdgeChanges:Y}=_();if(T){const R=A.map(L=>Ja(L,!0));Y(R);return}Y(Pl(B,new Set([...A]))),D(Pl(E,new Set,!0))},unselectNodesAndEdges:({nodes:A,edges:T}={})=>{const{edges:B,nodes:E,nodeLookup:D,triggerNodeChanges:Y,triggerEdgeChanges:R}=_(),L=A||E,H=T||B,$=[];for(const k of L){if(!k.selected)continue;const P=D.get(k.id);P&&(P.selected=!1),$.push(Ja(k.id,!1))}const V=[];for(const k of H)k.selected&&V.push(Ja(k.id,!1));Y($),R(V)},setMinZoom:A=>{const{panZoom:T,maxZoom:B}=_();T?.setScaleExtent([A,B]),x({minZoom:A})},setMaxZoom:A=>{const{panZoom:T,minZoom:B}=_();T?.setScaleExtent([B,A]),x({maxZoom:A})},setTranslateExtent:A=>{_().panZoom?.setTranslateExtent(A),x({translateExtent:A})},resetSelectedElements:()=>{const{edges:A,nodes:T,triggerNodeChanges:B,triggerEdgeChanges:E,elementsSelectable:D}=_();if(!D)return;const Y=T.reduce((L,H)=>H.selected?[...L,Ja(H.id,!1)]:L,[]),R=A.reduce((L,H)=>H.selected?[...L,Ja(H.id,!1)]:L,[]);B(Y),E(R)},setNodeExtent:A=>{const{nodes:T,nodeLookup:B,parentLookup:E,nodeOrigin:D,elevateNodesOnSelect:Y,nodeExtent:R,zIndexMode:L}=_();A[0][0]===R[0][0]&&A[0][1]===R[0][1]&&A[1][0]===R[1][0]&&A[1][1]===R[1][1]||(Vf(T,B,E,{nodeOrigin:D,nodeExtent:A,elevateNodesOnSelect:Y,checkEquality:!1,zIndexMode:L}),x({nodeExtent:A}))},panBy:A=>{const{transform:T,width:B,height:E,panZoom:D,translateExtent:Y}=_();return J_({delta:A,panZoom:D,transform:T,translateExtent:Y,width:B,height:E})},setCenter:async(A,T,B)=>{const{width:E,height:D,maxZoom:Y,panZoom:R}=_();if(!R)return Promise.resolve(!1);const L=typeof B?.zoom<"u"?B.zoom:Y;return await R.setViewport({x:E/2-A*L,y:D/2-T*L,zoom:L},{duration:B?.duration,ease:B?.ease,interpolate:B?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{x({connection:{...y0}})},updateConnection:A=>{x({connection:A})},reset:()=>x({...Ty()})}},Object.is);function Ev({initialNodes:n,initialEdges:l,defaultNodes:o,defaultEdges:s,initialWidth:r,initialHeight:c,initialMinZoom:d,initialMaxZoom:g,initialFitViewOptions:m,fitView:h,nodeOrigin:y,nodeExtent:v,zIndexMode:p,children:x}){const[_]=Z.useState(()=>hT({nodes:n,edges:l,defaultNodes:o,defaultEdges:s,width:r,height:c,fitView:h,minZoom:d,maxZoom:g,fitViewOptions:m,nodeOrigin:y,nodeExtent:v,zIndexMode:p}));return b.jsx(ON,{value:_,children:b.jsx(tA,{children:x})})}function gT({children:n,nodes:l,edges:o,defaultNodes:s,defaultEdges:r,width:c,height:d,fitView:g,fitViewOptions:m,minZoom:h,maxZoom:y,nodeOrigin:v,nodeExtent:p,zIndexMode:x}){return Z.useContext(Ur)?b.jsx(b.Fragment,{children:n}):b.jsx(Ev,{initialNodes:l,initialEdges:o,defaultNodes:s,defaultEdges:r,initialWidth:c,initialHeight:d,fitView:g,initialFitViewOptions:m,initialMinZoom:h,initialMaxZoom:y,nodeOrigin:v,nodeExtent:p,zIndexMode:x,children:n})}const mT={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function pT({nodes:n,edges:l,defaultNodes:o,defaultEdges:s,className:r,nodeTypes:c,edgeTypes:d,onNodeClick:g,onEdgeClick:m,onInit:h,onMove:y,onMoveStart:v,onMoveEnd:p,onConnect:x,onConnectStart:_,onConnectEnd:M,onClickConnectStart:A,onClickConnectEnd:T,onNodeMouseEnter:B,onNodeMouseMove:E,onNodeMouseLeave:D,onNodeContextMenu:Y,onNodeDoubleClick:R,onNodeDragStart:L,onNodeDrag:H,onNodeDragStop:$,onNodesDelete:V,onEdgesDelete:k,onDelete:P,onSelectionChange:te,onSelectionDragStart:z,onSelectionDrag:I,onSelectionDragStop:N,onSelectionContextMenu:j,onSelectionStart:G,onSelectionEnd:Q,onBeforeDelete:ne,connectionMode:C,connectionLineType:U=wa.Bezier,connectionLineStyle:ee,connectionLineComponent:ae,connectionLineContainerStyle:ue,deleteKeyCode:fe="Backspace",selectionKeyCode:ce="Shift",selectionOnDrag:re=!1,selectionMode:de=bo.Full,panActivationKeyCode:we="Space",multiSelectionKeyCode:xe=Eo()?"Meta":"Control",zoomActivationKeyCode:ye=Eo()?"Meta":"Control",snapToGrid:Se,snapGrid:Ce,onlyRenderVisibleElements:qe=!1,selectNodesOnDrag:Le,nodesDraggable:rt,autoPanOnNodeFocus:Qt,nodesConnectable:zt,nodesFocusable:Kt,nodeOrigin:yn=Q0,edgesFocusable:Na,edgesReconnectable:Aa,elementsSelectable:ft=!0,defaultViewport:il=ZN,minZoom:vn=.5,maxZoom:Xn=2,translateExtent:Ta=So,preventScrolling:kr=!0,nodeExtent:ol,defaultMarkerColor:Ir="#b1b1b7",zoomOnScroll:Vr=!0,zoomOnPinch:Ca=!0,panOnScroll:vt=!1,panOnScrollSpeed:on=.5,panOnScrollMode:St=el.Free,zoomOnDoubleClick:Xr=!0,panOnDrag:Zr=!0,onPaneClick:$r,onPaneMouseEnter:sl,onPaneMouseMove:rl,onPaneMouseLeave:ul,onPaneScroll:Sn,onPaneContextMenu:cl,paneClickDistance:Ma=1,nodeClickDistance:Qr=0,children:Do,onReconnect:ui,onReconnectStart:za,onReconnectEnd:Kr,onEdgeContextMenu:Ro,onEdgeDoubleClick:Oo,onEdgeMouseEnter:jo,onEdgeMouseMove:ci,onEdgeMouseLeave:fi,reconnectRadius:Ho=10,onNodesChange:Lo,onEdgesChange:sn,noDragClassName:ot="nodrag",noWheelClassName:pt="nowheel",noPanClassName:bn="nopan",fitView:fl,fitViewOptions:Uo,connectOnClick:Fr,attributionPosition:Bo,proOptions:Da,defaultEdgeOptions:di,elevateNodesOnSelect:Zn=!0,elevateEdgesOnSelect:$n=!1,disableKeyboardA11y:Qn=!1,autoPanOnConnect:Kn,autoPanOnNodeDrag:et,autoPanSpeed:qo,connectionRadius:Go,isValidConnection:xn,onError:Fn,style:Jr,id:hi,nodeDragThreshold:Yo,connectionDragThreshold:Pr,viewport:dl,onViewportChange:hl,width:Ft,height:xt,colorMode:ko="light",debug:Wr,onScroll:gl,ariaLabelConfig:Io,zIndexMode:Ra="basic",...eu},Et){const Oa=hi||"1",Vo=FN(ko),gi=Z.useCallback(En=>{En.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),gl?.(En)},[gl]);return b.jsx("div",{"data-testid":"rf__wrapper",...eu,onScroll:gi,style:{...Jr,...mT},ref:Et,className:it(["react-flow",r,Vo]),id:hi,role:"application",children:b.jsxs(gT,{nodes:n,edges:l,width:Ft,height:xt,fitView:fl,fitViewOptions:Uo,minZoom:vn,maxZoom:Xn,nodeOrigin:yn,nodeExtent:ol,zIndexMode:Ra,children:[b.jsx(KN,{nodes:n,edges:l,defaultNodes:o,defaultEdges:s,onConnect:x,onConnectStart:_,onConnectEnd:M,onClickConnectStart:A,onClickConnectEnd:T,nodesDraggable:rt,autoPanOnNodeFocus:Qt,nodesConnectable:zt,nodesFocusable:Kt,edgesFocusable:Na,edgesReconnectable:Aa,elementsSelectable:ft,elevateNodesOnSelect:Zn,elevateEdgesOnSelect:$n,minZoom:vn,maxZoom:Xn,nodeExtent:ol,onNodesChange:Lo,onEdgesChange:sn,snapToGrid:Se,snapGrid:Ce,connectionMode:C,translateExtent:Ta,connectOnClick:Fr,defaultEdgeOptions:di,fitView:fl,fitViewOptions:Uo,onNodesDelete:V,onEdgesDelete:k,onDelete:P,onNodeDragStart:L,onNodeDrag:H,onNodeDragStop:$,onSelectionDrag:I,onSelectionDragStart:z,onSelectionDragStop:N,onMove:y,onMoveStart:v,onMoveEnd:p,noPanClassName:bn,nodeOrigin:yn,rfId:Oa,autoPanOnConnect:Kn,autoPanOnNodeDrag:et,autoPanSpeed:qo,onError:Fn,connectionRadius:Go,isValidConnection:xn,selectNodesOnDrag:Le,nodeDragThreshold:Yo,connectionDragThreshold:Pr,onBeforeDelete:ne,debug:Wr,ariaLabelConfig:Io,zIndexMode:Ra}),b.jsx(dT,{onInit:h,onNodeClick:g,onEdgeClick:m,onNodeMouseEnter:B,onNodeMouseMove:E,onNodeMouseLeave:D,onNodeContextMenu:Y,onNodeDoubleClick:R,nodeTypes:c,edgeTypes:d,connectionLineType:U,connectionLineStyle:ee,connectionLineComponent:ae,connectionLineContainerStyle:ue,selectionKeyCode:ce,selectionOnDrag:re,selectionMode:de,deleteKeyCode:fe,multiSelectionKeyCode:xe,panActivationKeyCode:we,zoomActivationKeyCode:ye,onlyRenderVisibleElements:qe,defaultViewport:il,translateExtent:Ta,minZoom:vn,maxZoom:Xn,preventScrolling:kr,zoomOnScroll:Vr,zoomOnPinch:Ca,zoomOnDoubleClick:Xr,panOnScroll:vt,panOnScrollSpeed:on,panOnScrollMode:St,panOnDrag:Zr,onPaneClick:$r,onPaneMouseEnter:sl,onPaneMouseMove:rl,onPaneMouseLeave:ul,onPaneScroll:Sn,onPaneContextMenu:cl,paneClickDistance:Ma,nodeClickDistance:Qr,onSelectionContextMenu:j,onSelectionStart:G,onSelectionEnd:Q,onReconnect:ui,onReconnectStart:za,onReconnectEnd:Kr,onEdgeContextMenu:Ro,onEdgeDoubleClick:Oo,onEdgeMouseEnter:jo,onEdgeMouseMove:ci,onEdgeMouseLeave:fi,reconnectRadius:Ho,defaultMarkerColor:Ir,noDragClassName:ot,noWheelClassName:pt,noPanClassName:bn,rfId:Oa,disableKeyboardA11y:Qn,nodeExtent:ol,viewport:dl,onViewportChange:hl}),b.jsx(XN,{onSelectionChange:te}),Do,b.jsx(GN,{proOptions:Da,position:Bo}),b.jsx(qN,{rfId:Oa,disableKeyboardA11y:Qn})]})})}var yT=P0(pT);function vT({dimensions:n,lineWidth:l,variant:o,className:s}){return b.jsx("path",{strokeWidth:l,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`,className:it(["react-flow__background-pattern",o,s])})}function ST({radius:n,className:l}){return b.jsx("circle",{cx:n,cy:n,r:n,className:it(["react-flow__background-pattern","dots",l])})}var _a;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(_a||(_a={}));const bT={[_a.Dots]:1,[_a.Lines]:1,[_a.Cross]:6},xT=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function wv({id:n,variant:l=_a.Dots,gap:o=20,size:s,lineWidth:r=1,offset:c=0,color:d,bgColor:g,style:m,className:h,patternClassName:y}){const v=Z.useRef(null),{transform:p,patternId:x}=Re(xT,$e),_=s||bT[l],M=l===_a.Dots,A=l===_a.Cross,T=Array.isArray(o)?o:[o,o],B=[T[0]*p[2]||1,T[1]*p[2]||1],E=_*p[2],D=Array.isArray(c)?c:[c,c],Y=A?[E,E]:B,R=[D[0]*p[2]||1+Y[0]/2,D[1]*p[2]||1+Y[1]/2],L=`${x}${n||""}`;return b.jsxs("svg",{className:it(["react-flow__background",h]),style:{...m,...Gr,"--xy-background-color-props":g,"--xy-background-pattern-color-props":d},ref:v,"data-testid":"rf__background",children:[b.jsx("pattern",{id:L,x:p[0]%B[0],y:p[1]%B[1],width:B[0],height:B[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${R[0]},-${R[1]})`,children:M?b.jsx(ST,{radius:E/2,className:y}):b.jsx(vT,{dimensions:Y,lineWidth:r,variant:l,className:y})}),b.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${L})`})]})}wv.displayName="Background";const ET=Z.memo(wv);function wT(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:b.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function _T(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:b.jsx("path",{d:"M0 0h32v4.2H0z"})})}function NT(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:b.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 AT(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.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 TT(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.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 cr({children:n,className:l,...o}){return b.jsx("button",{type:"button",className:it(["react-flow__controls-button",l]),...o,children:n})}const CT=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom,ariaLabelConfig:n.ariaLabelConfig});function _v({style:n,showZoom:l=!0,showFitView:o=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:c,onZoomOut:d,onFitView:g,onInteractiveChange:m,className:h,children:y,position:v="bottom-left",orientation:p="vertical","aria-label":x}){const _=Ke(),{isInteractive:M,minZoomReached:A,maxZoomReached:T,ariaLabelConfig:B}=Re(CT,$e),{zoomIn:E,zoomOut:D,fitView:Y}=qr(),R=()=>{E(),c?.()},L=()=>{D(),d?.()},H=()=>{Y(r),g?.()},$=()=>{_.setState({nodesDraggable:!M,nodesConnectable:!M,elementsSelectable:!M}),m?.(!M)},V=p==="horizontal"?"horizontal":"vertical";return b.jsxs(Br,{className:it(["react-flow__controls",V,h]),position:v,style:n,"data-testid":"rf__controls","aria-label":x??B["controls.ariaLabel"],children:[l&&b.jsxs(b.Fragment,{children:[b.jsx(cr,{onClick:R,className:"react-flow__controls-zoomin",title:B["controls.zoomIn.ariaLabel"],"aria-label":B["controls.zoomIn.ariaLabel"],disabled:T,children:b.jsx(wT,{})}),b.jsx(cr,{onClick:L,className:"react-flow__controls-zoomout",title:B["controls.zoomOut.ariaLabel"],"aria-label":B["controls.zoomOut.ariaLabel"],disabled:A,children:b.jsx(_T,{})})]}),o&&b.jsx(cr,{className:"react-flow__controls-fitview",onClick:H,title:B["controls.fitView.ariaLabel"],"aria-label":B["controls.fitView.ariaLabel"],children:b.jsx(NT,{})}),s&&b.jsx(cr,{className:"react-flow__controls-interactive",onClick:$,title:B["controls.interactive.ariaLabel"],"aria-label":B["controls.interactive.ariaLabel"],children:M?b.jsx(TT,{}):b.jsx(AT,{})}),y]})}_v.displayName="Controls";const MT=Z.memo(_v);function zT({id:n,x:l,y:o,width:s,height:r,style:c,color:d,strokeColor:g,strokeWidth:m,className:h,borderRadius:y,shapeRendering:v,selected:p,onClick:x}){const{background:_,backgroundColor:M}=c||{},A=d||_||M;return b.jsx("rect",{className:it(["react-flow__minimap-node",{selected:p},h]),x:l,y:o,rx:y,ry:y,width:s,height:r,style:{fill:A,stroke:g,strokeWidth:m},shapeRendering:v,onClick:x?T=>x(T,n):void 0})}const DT=Z.memo(zT),RT=n=>n.nodes.map(l=>l.id),Mf=n=>n instanceof Function?n:()=>n;function OT({nodeStrokeColor:n,nodeColor:l,nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:c=DT,onClick:d}){const g=Re(RT,$e),m=Mf(l),h=Mf(n),y=Mf(o),v=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return b.jsx(b.Fragment,{children:g.map(p=>b.jsx(HT,{id:p,nodeColorFunc:m,nodeStrokeColorFunc:h,nodeClassNameFunc:y,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:c,onClick:d,shapeRendering:v},p))})}function jT({id:n,nodeColorFunc:l,nodeStrokeColorFunc:o,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:c,shapeRendering:d,NodeComponent:g,onClick:m}){const{node:h,x:y,y:v,width:p,height:x}=Re(_=>{const M=_.nodeLookup.get(n);if(!M)return{node:void 0,x:0,y:0,width:0,height:0};const A=M.internals.userNode,{x:T,y:B}=M.internals.positionAbsolute,{width:E,height:D}=Vn(A);return{node:A,x:T,y:B,width:E,height:D}},$e);return!h||h.hidden||!_0(h)?null:b.jsx(g,{x:y,y:v,width:p,height:x,style:h.style,selected:!!h.selected,className:s(h),color:l(h),borderRadius:r,strokeColor:o(h),strokeWidth:c,shapeRendering:d,onClick:m,id:h.id})}const HT=Z.memo(jT);var LT=Z.memo(OT);const UT=200,BT=150,qT=n=>!n.hidden,GT=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?w0(Co(n.nodeLookup,{filter:qT}),l):l,rfId:n.rfId,panZoom:n.panZoom,translateExtent:n.translateExtent,flowWidth:n.width,flowHeight:n.height,ariaLabelConfig:n.ariaLabelConfig}},YT="react-flow__minimap-desc";function Nv({style:n,className:l,nodeStrokeColor:o,nodeColor:s,nodeClassName:r="",nodeBorderRadius:c=5,nodeStrokeWidth:d,nodeComponent:g,bgColor:m,maskColor:h,maskStrokeColor:y,maskStrokeWidth:v,position:p="bottom-right",onClick:x,onNodeClick:_,pannable:M=!1,zoomable:A=!1,ariaLabel:T,inversePan:B,zoomStep:E=1,offsetScale:D=5}){const Y=Ke(),R=Z.useRef(null),{boundingRect:L,viewBB:H,rfId:$,panZoom:V,translateExtent:k,flowWidth:P,flowHeight:te,ariaLabelConfig:z}=Re(GT,$e),I=n?.width??UT,N=n?.height??BT,j=L.width/I,G=L.height/N,Q=Math.max(j,G),ne=Q*I,C=Q*N,U=D*Q,ee=L.x-(ne-L.width)/2-U,ae=L.y-(C-L.height)/2-U,ue=ne+U*2,fe=C+U*2,ce=`${YT}-${$}`,re=Z.useRef(0),de=Z.useRef();re.current=Q,Z.useEffect(()=>{if(R.current&&V)return de.current=oN({domNode:R.current,panZoom:V,getTransform:()=>Y.getState().transform,getViewScale:()=>re.current}),()=>{de.current?.destroy()}},[V]),Z.useEffect(()=>{de.current?.update({translateExtent:k,width:P,height:te,inversePan:B,pannable:M,zoomStep:E,zoomable:A})},[M,A,B,E,k,P,te]);const we=x?Se=>{const[Ce,qe]=de.current?.pointer(Se)||[0,0];x(Se,{x:Ce,y:qe})}:void 0,xe=_?Z.useCallback((Se,Ce)=>{const qe=Y.getState().nodeLookup.get(Ce).internals.userNode;_(Se,qe)},[]):void 0,ye=T??z["minimap.ariaLabel"];return b.jsx(Br,{position:p,style:{...n,"--xy-minimap-background-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof y=="string"?y:void 0,"--xy-minimap-mask-stroke-width-props":typeof v=="number"?v*Q:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s: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:it(["react-flow__minimap",l]),"data-testid":"rf__minimap",children:b.jsxs("svg",{width:I,height:N,viewBox:`${ee} ${ae} ${ue} ${fe}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ce,ref:R,onClick:we,children:[ye&&b.jsx("title",{id:ce,children:ye}),b.jsx(LT,{onClick:xe,nodeColor:s,nodeStrokeColor:o,nodeBorderRadius:c,nodeClassName:r,nodeStrokeWidth:d,nodeComponent:g}),b.jsx("path",{className:"react-flow__minimap-mask",d:`M${ee-U},${ae-U}h${ue+U*2}v${fe+U*2}h${-ue-U*2}z
|
|
15
|
-
M${H.x},${H.y}h${H.width}v${H.height}h${-H.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Nv.displayName="MiniMap";const kT=Z.memo(Nv),IT=n=>l=>n?`${Math.max(1/l.transform[2],1)}`:void 0,VT={[si.Line]:"right",[si.Handle]:"bottom-right"};function XT({nodeId:n,position:l,variant:o=si.Handle,className:s,style:r=void 0,children:c,color:d,minWidth:g=10,minHeight:m=10,maxWidth:h=Number.MAX_VALUE,maxHeight:y=Number.MAX_VALUE,keepAspectRatio:v=!1,resizeDirection:p,autoScale:x=!0,shouldResize:_,onResizeStart:M,onResize:A,onResizeEnd:T}){const B=nv(),E=typeof n=="string"?n:B,D=Ke(),Y=Z.useRef(null),R=o===si.Handle,L=Re(Z.useCallback(IT(R&&x),[R,x]),$e),H=Z.useRef(null),$=l??VT[o];Z.useEffect(()=>{if(!(!Y.current||!E))return H.current||(H.current=bN({domNode:Y.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:k,transform:P,snapGrid:te,snapToGrid:z,nodeOrigin:I,domNode:N}=D.getState();return{nodeLookup:k,transform:P,snapGrid:te,snapToGrid:z,nodeOrigin:I,paneDomNode:N}},onChange:(k,P)=>{const{triggerNodeChanges:te,nodeLookup:z,parentLookup:I,nodeOrigin:N}=D.getState(),j=[],G={x:k.x,y:k.y},Q=z.get(E);if(Q&&Q.expandParent&&Q.parentId){const ne=Q.origin??N,C=k.width??Q.measured.width??0,U=k.height??Q.measured.height??0,ee={id:Q.id,parentId:Q.parentId,rect:{width:C,height:U,...N0({x:k.x??Q.position.x,y:k.y??Q.position.y},{width:C,height:U},Q.parentId,z,ne)}},ae=ud([ee],z,I,N);j.push(...ae),G.x=k.x?Math.max(ne[0]*C,k.x):void 0,G.y=k.y?Math.max(ne[1]*U,k.y):void 0}if(G.x!==void 0&&G.y!==void 0){const ne={id:E,type:"position",position:{...G}};j.push(ne)}if(k.width!==void 0&&k.height!==void 0){const C={id:E,type:"dimensions",resizing:!0,setAttributes:p?p==="horizontal"?"width":"height":!0,dimensions:{width:k.width,height:k.height}};j.push(C)}for(const ne of P){const C={...ne,type:"position"};j.push(C)}te(j)},onEnd:({width:k,height:P})=>{const te={id:E,type:"dimensions",resizing:!1,dimensions:{width:k,height:P}};D.getState().triggerNodeChanges([te])}})),H.current.update({controlPosition:$,boundaries:{minWidth:g,minHeight:m,maxWidth:h,maxHeight:y},keepAspectRatio:v,resizeDirection:p,onResizeStart:M,onResize:A,onResizeEnd:T,shouldResize:_}),()=>{H.current?.destroy()}},[$,g,m,h,y,v,M,A,T,_]);const V=$.split("-");return b.jsx("div",{className:it(["react-flow__resize-control","nodrag",...V,o,s]),ref:Y,style:{...r,scale:L,...d&&{[R?"backgroundColor":"borderColor"]:d}},children:c})}Z.memo(XT);const zf=5;function ZT({id:n,data:l,selected:o}){const{t:s}=Qe(),r=l,c=oe(z=>z.updateNodePrompt),d=oe(z=>z.addNodeReferences),g=oe(z=>z.removeNodeReference),m=oe(z=>z.generateNode),h=oe(z=>z.addChildNode),y=oe(z=>z.duplicateBranchRoot),v=oe(z=>z.deleteNode),p=Z.useRef(null),[x,_]=Z.useState(!1),M=r.referenceImages??[],A=r.status==="pending"||r.status==="reconciling",T=!r.parentServerNodeId&&!A&&M.length<zf,B=Z.useCallback(z=>c(n,z.target.value),[n,c]),E=Z.useCallback(()=>{m(n)},[n,m]),D=Z.useCallback(()=>{r.status==="ready"&&h(n)},[n,r.status,h]),Y=Z.useCallback(()=>{y(n)},[n,y]),R=Z.useCallback(()=>v(n),[n,v]),L=z=>{if(!z)return[];const I=[];for(const N of Array.from(z)){if(N.kind!=="file"||!N.type.startsWith("image/"))continue;const j=N.getAsFile();j&&I.push(j)}return I},H=z=>{if(z.preventDefault(),z.stopPropagation(),_(!1),!T)return;const I=Array.from(z.dataTransfer.files).filter(N=>N.type.startsWith("image/"));I.length>0&&d(n,I)},$=z=>{z.preventDefault(),z.stopPropagation(),T&&!x&&_(!0)},V=z=>{z.currentTarget.contains(z.relatedTarget)||_(!1)},k=z=>{const I=L(z.clipboardData?.items??null);if(I.length===0||(z.preventDefault(),z.stopPropagation(),!T))return;const N=zf-M.length;d(n,I.slice(0,N))},te=(()=>{switch(r.status){case"empty":return s("node.empty");case"pending":return s("node.pending");case"reconciling":return r.pendingPhase?s("node.reconcilingPhase",{phase:r.pendingPhase}):s("node.reconciling");case"ready":return r.webSearchCalls?s("node.readyWithSearch",{elapsed:r.elapsed??"?",searches:r.webSearchCalls}):s("node.ready",{elapsed:r.elapsed??"?"});case"stale":return r.error?s("node.staleWithError",{error:r.error}):s("node.stale");case"asset-missing":return r.error?s("node.assetMissingWithError",{error:r.error}):s("node.assetMissing");case"error":return s("node.error",{error:r.error??s("node.errorUnknown")});default:return""}})();return b.jsxs("div",{className:`image-node image-node--${r.status}${o?" image-node--selected":""}`,children:[r.parentServerNodeId?b.jsx(ri,{type:"target",position:me.Left,className:"image-node__handle"}):null,b.jsx("div",{className:"image-node__preview",children:r.imageUrl&&r.status!=="asset-missing"?b.jsx("img",{src:r.imageUrl,alt:s("node.nodeImageAlt")}):A?b.jsx("div",{className:"image-node__skeleton"}):r.status==="asset-missing"?b.jsx("div",{className:"image-node__placeholder",children:s("node.noAsset")}):r.status==="stale"?b.jsx("div",{className:"image-node__placeholder",children:s("node.stateStale")}):b.jsx("div",{className:"image-node__placeholder",children:s("node.noImage")})}),b.jsxs("div",{className:`image-node__composer nodrag${x?" is-dragging":""}`,onDrop:H,onDragOver:$,onDragLeave:V,onPaste:k,children:[M.length>0?b.jsx("div",{className:"image-node__refs",children:M.map((z,I)=>b.jsxs("div",{className:"image-node__ref-chip",title:s("node.refAlt",{n:I+1}),children:[b.jsx("img",{src:z,alt:s("node.refAlt",{n:I+1})}),b.jsx("button",{type:"button",className:"image-node__ref-remove",onClick:()=>g(n,I),disabled:A,"aria-label":s("node.removeRef",{n:I+1}),children:"×"})]},I))}):null,b.jsx("textarea",{className:"image-node__prompt",value:r.prompt,onChange:B,onKeyDown:z=>z.stopPropagation(),placeholder:r.parentServerNodeId?s("node.editPromptPlaceholder"):s("node.promptPlaceholder"),rows:2,disabled:A}),b.jsxs("div",{className:"image-node__composer-bar",children:[b.jsx("button",{type:"button",className:"image-node__attach",onClick:()=>T&&p.current?.click(),disabled:!T,title:r.parentServerNodeId?s("node.nodeRefsUnsupportedForEdit"):s("node.attachRefTitle"),children:s("node.attachRef")}),x?b.jsx("span",{className:"image-node__drop-hint",children:s("node.dropRefs")}):M.length>0?b.jsxs("span",{className:"image-node__ref-count",children:[M.length,"/",zf]}):null]}),b.jsx("input",{ref:p,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:z=>{const I=Array.from(z.target.files??[]);I.length>0&&d(n,I),z.target.value=""}})]}),b.jsxs("div",{className:"image-node__footer",children:[b.jsx("span",{className:"image-node__status",children:te}),b.jsxs("div",{className:"image-node__actions nodrag",children:[b.jsx("button",{type:"button",onClick:E,disabled:A,children:r.status==="ready"?s("node.regenerate"):s("node.generate")}),r.status==="ready"?b.jsxs(b.Fragment,{children:[b.jsx("button",{type:"button",onClick:D,children:s("node.addChild")}),b.jsx("button",{type:"button",onClick:Y,title:s("node.duplicateBranchTitle"),children:s("node.duplicateBranch")})]}):null,b.jsx("button",{type:"button",onClick:R,className:"image-node__del",title:s("node.deleteTitle"),children:"×"})]})]}),b.jsx(ri,{type:"source",position:me.Right,className:"image-node__handle image-node__handle--source"})]})}const $T=Z.memo(ZT);function QT(){const{t:n}=Qe(),l=oe(E=>E.graphNodes),o=oe(E=>E.graphEdges),s=oe(E=>E.setGraphNodes),r=oe(E=>E.setGraphEdges),c=oe(E=>E.addRootNode),d=oe(E=>E.addChildNodeAt),g=oe(E=>E.connectNodes),m=oe(E=>E.deleteNodes),h=oe(E=>E.sessionLoading),y=oe(E=>E.resolvedTheme),{screenToFlowPosition:v}=qr(),p=Z.useRef(null),x=Z.useMemo(()=>({imageNode:$T}),[]),_=Z.useCallback(E=>s(F0(E,l)),[l,s]),M=Z.useCallback(E=>r(J0(E,o)),[o,r]),A=Z.useCallback(E=>{E.source&&E.target&&g(E.source,E.target)},[g]),T=Z.useCallback((E,D)=>{if(D.isValid)return;const Y=D.fromNode?.id;if(!Y)return;const R="touches"in E?E.changedTouches[0].clientX:E.clientX,L="touches"in E?E.changedTouches[0].clientY:E.clientY,H=v({x:R,y:L});d(Y,H)},[d,v]),B=Z.useCallback(E=>m(E.map(D=>D.id)),[m]);return b.jsxs("main",{className:"node-canvas",ref:p,children:[h&&b.jsx("div",{className:"node-canvas__loading",children:n("nodeCanvas.loading")}),l.length===0?b.jsx("button",{type:"button",className:"node-canvas__plus",onClick:()=>c(),children:n("nodeCanvas.addFirst")}):b.jsxs(b.Fragment,{children:[b.jsxs(yT,{nodes:l,edges:o,onNodesChange:_,onEdgesChange:M,onConnect:A,onConnectEnd:T,onNodesDelete:B,nodeTypes:x,fitView:!0,deleteKeyCode:["Delete","Backspace"],proOptions:{hideAttribution:!0},children:[b.jsx(ET,{gap:24,color:y==="light"?"#d9dee6":"#2a2a2a"}),b.jsx(MT,{className:"node-canvas__controls"}),b.jsx(kT,{pannable:!0,zoomable:!0,maskColor:y==="light"?"rgba(246, 247, 251, 0.72)":"rgba(10, 10, 10, 0.7)",nodeColor:y==="light"?"#1f2430":"#f0f0f0",nodeStrokeColor:y==="light"?"#ffffff":"#1a1a1a",style:{background:y==="light"?"#ffffff":"#141414",border:`1px solid ${y==="light"?"#d9dee6":"#2a2a2a"}`}})]}),b.jsx("button",{type:"button",className:"node-canvas__add-root",onClick:()=>c(),title:n("nodeCanvas.addRootTitle"),children:"+"}),b.jsx("div",{className:"node-canvas__hint",children:n("nodeCanvas.hint")})]})]})}function KT(){return b.jsx(Ev,{children:b.jsx(QT,{})})}function Yn({title:n,help:l,items:o,value:s,onChange:r}){return b.jsxs("div",{className:"option-group",children:[n?b.jsx("div",{className:"section-title",children:n}):null,b.jsx("div",{className:"option-row",children:o.map(c=>b.jsxs("button",{className:`option-btn${c.value===s?" active":""}`,style:c.color?{color:c.color}:void 0,disabled:c.disabled,onClick:()=>r(c.value),type:"button",children:[c.label,c.sub?b.jsxs(b.Fragment,{children:[b.jsx("br",{}),b.jsx("span",{className:"option-sub",children:c.sub})]}):null]},c.value))}),l?b.jsx("p",{className:"option-help",children:l}):null]})}function oo(n){return n.map(l=>({value:l.value,label:l.label,sub:l.sub}))}function FT(){const n=oe(g=>g.sizePreset),l=oe(g=>g.setSizePreset),o=oe(g=>g.customW),s=oe(g=>g.customH),r=oe(g=>g.setCustomSize),{t:c}=Qe(),d=n==="custom";return b.jsxs("div",{className:"option-group",children:[b.jsx("div",{className:"section-title",children:c("size.title")}),b.jsx(Yn,{title:"",items:oo(Sx),value:n,onChange:l}),b.jsx(Yn,{title:"",items:oo(bx),value:n,onChange:l}),b.jsx(Yn,{title:"",items:oo(xx),value:n,onChange:l}),b.jsx(Yn,{title:"",items:oo(Ex),value:n,onChange:l}),b.jsx(Yn,{title:"",items:oo(wx()),value:n,onChange:l}),d?b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"option-row",children:[b.jsx("input",{type:"number",className:"custom-size-input",min:1024,max:3824,step:16,value:o,onChange:g=>r(parseInt(g.target.value)||1024,s),placeholder:c("size.width")}),b.jsx("span",{style:{color:"var(--text-dim)",alignSelf:"center",fontFamily:"var(--mono)",fontSize:12},children:"x"}),b.jsx("input",{type:"number",className:"custom-size-input",min:1024,max:3824,step:16,value:s,onChange:g=>r(o,parseInt(g.target.value)||1024),placeholder:c("size.height")})]}),b.jsx("div",{className:"size-hint",children:c("size.hint")})]}):null]})}const JT={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 PT(n,l){return JT[n]?.[l]??0}function WT(){const{t:n}=Qe(),l=oe(h=>h.provider),o=oe(h=>h.quality),r=oe(h=>h.getResolvedSize)(),c=l==="oauth",d=PT(o,r),g=c?n("cost.free"):n("cost.approx",{amount:d.toFixed(3)}),m=c?"var(--green)":void 0;return b.jsxs("div",{className:"cost-estimate",children:[b.jsx("span",{children:n("cost.label")}),b.jsx("span",{className:"price",style:m?{color:m}:void 0,children:g})]})}const eC=[{value:"png",label:"PNG"},{value:"jpeg",label:"JPEG"},{value:"webp",label:"WebP"}],tC=[{value:"1",label:"1"},{value:"2",label:"2"},{value:"4",label:"4"}];function nC(){const n=oe(A=>A.rightPanelOpen),l=oe(A=>A.toggleRightPanel),{t:o}=Qe(),[s,r]=Z.useState(typeof window<"u"?window.matchMedia("(max-width: 800px)").matches:!1);Z.useEffect(()=>{if(typeof window>"u")return;const A=window.matchMedia("(max-width: 800px)"),T=()=>r(A.matches);return A.addEventListener("change",T),()=>A.removeEventListener("change",T)},[]);const c=s?n:!0,d=oe(A=>A.quality),g=oe(A=>A.setQuality),m=oe(A=>A.format),h=oe(A=>A.setFormat),y=oe(A=>A.moderation),v=oe(A=>A.setModeration),p=oe(A=>A.count),x=oe(A=>A.setCount),_=[{value:"low",label:o("quality.lowLabel"),sub:o("quality.lowSub")},{value:"medium",label:o("quality.mediumLabel"),sub:o("quality.mediumSub")},{value:"high",label:o("quality.highLabel"),sub:o("quality.highSub")}],M=[{value:"auto",label:o("moderation.autoLabel"),sub:o("moderation.autoSub")},{value:"low",label:o("moderation.lowLabel"),sub:o("moderation.lowSub"),color:"var(--amber)"}];return b.jsxs(b.Fragment,{children:[s&&n?b.jsx("div",{className:"right-panel-backdrop",role:"button","aria-label":o("panel.closeSettings"),onClick:l}):null,b.jsxs("aside",{className:`right-panel${n?"":" collapsed"}${s&&c?" drawer-open":""}`,"aria-label":o("panel.detailSettings"),children:[b.jsx("button",{type:"button",className:"right-panel-toggle","aria-expanded":n,"aria-controls":"right-panel-body",onClick:l,title:o(n?"panel.toggleHide":"panel.toggleShow"),children:s?o(n?"panel.close":"panel.open"):n?">":"<"}),b.jsxs("div",{id:"right-panel-body",className:"right-panel-body",hidden:!n,children:[b.jsx("div",{className:"section-title",children:o("panel.detailSettings")}),b.jsx(Yn,{title:o("quality.title"),items:_,value:d,onChange:g}),b.jsx(FT,{}),b.jsx(Yn,{title:o("format.title"),items:eC,value:m,onChange:h}),b.jsx(Yn,{title:o("moderation.title"),items:M,value:y,onChange:v}),b.jsx("p",{className:"option-help",children:o("moderation.explain")}),b.jsx(Yn,{title:o("count.title"),items:tC,value:String(p),onChange:A=>x(Number(A))}),b.jsx(WT,{})]})]})]})}function aC(){const[n,l]=Z.useState(null),[o,s]=Z.useState(!1);return Z.useEffect(()=>{let r=!1;return XS().then(c=>{r||l(c)}).catch(()=>{r||s(!0)}),()=>{r=!0}},[]),{data:n,error:o}}function lC(){const[n,l]=Z.useState(null);return Z.useEffect(()=>{let o=!1,s=null;const r=async()=>{try{const c=await VS();if(o)return;l(c),c.status==="starting"&&(s=setTimeout(r,3e3))}catch{o||l(null)}};return r(),()=>{o=!0,s&&clearTimeout(s)}},[]),n}function iC(n){return n==="ready"?"Ready":n==="auth_required"?"Login required":n==="starting"?"Starting":n==="offline"?"Offline":"Checking"}function oC(){const{t:n}=Qe(),l=lC(),{data:o,error:s}=aC(),r=o?.apiKeySource==="env"||o?.apiKeySource==="config"||o?.apiKeyValid===!0,c=l?.status==="ready",d=o?.apiKeySource==="config"?n("settings.account.apiSourceConfig"):n("settings.account.apiSourceEnv");return b.jsxs(b.Fragment,{children:[b.jsxs("article",{className:"settings-row",children:[b.jsxs("div",{className:"settings-row__copy",children:[b.jsx("p",{className:"settings-eyebrow",children:n("settings.account.primaryEyebrow")}),b.jsx("h4",{children:n("settings.account.oauthTitle")}),b.jsx("p",{children:n("settings.account.oauthBody")})]}),b.jsxs("div",{className:`settings-status${c?" is-ok":""}`,children:[b.jsx("span",{"aria-hidden":"true"}),iC(l?.status)]})]}),r?b.jsxs("article",{className:"settings-row",children:[b.jsxs("div",{className:"settings-row__copy",children:[b.jsx("p",{className:"settings-eyebrow",children:d}),b.jsx("h4",{children:n("settings.account.apiTitle")}),b.jsx("p",{children:n("settings.account.apiBody")})]}),b.jsxs("div",{className:"settings-status is-muted",children:[b.jsx("span",{"aria-hidden":"true"}),n(s?"settings.account.apiUnknown":"settings.account.apiDisabled")]})]}):null]})}const sC={ko:"KO",en:"EN"};function rC(){const{t:n,locale:l}=Qe(),o=oe(s=>s.setLocale);return b.jsx("div",{className:"lang-toggle",role:"group","aria-label":n("language.label"),children:px.map(s=>b.jsx("button",{type:"button",className:`lang-toggle__btn ${l===s?"is-active":""}`,onClick:()=>o(s),"aria-pressed":l===s,title:n(`language.${s}`),children:b.jsx("span",{className:"lang-toggle__label",children:sC[s]})},s))})}const uC=["system","dark","light"];function cC(){const{t:n}=Qe(),l=oe(s=>s.theme),o=oe(s=>s.setTheme);return b.jsx("div",{className:"theme-toggle",role:"group","aria-label":n("theme.label"),children:uC.map(s=>b.jsx("button",{type:"button",className:`theme-toggle__btn ${l===s?"is-active":""}`,onClick:()=>o(s),"aria-pressed":l===s,title:n(`theme.${s}`),children:n(`theme.${s}`)},s))})}const Df=["account","appearance","language","future"];function fr({id:n,setRef:l,children:o}){const{t:s}=Qe();return b.jsxs("section",{id:n,ref:r=>l(n,r),className:"settings-section","aria-labelledby":`settings-section-${n}`,children:[b.jsx("header",{className:"settings-section__header",children:b.jsxs("div",{children:[b.jsx("h3",{id:`settings-section-${n}`,children:s(`settings.sections.${n}.title`)}),b.jsx("p",{children:s(`settings.sections.${n}.hint`)})]})}),b.jsx("div",{className:"settings-section__body",children:o})]})}function fC(){const{t:n}=Qe(),l=oe(y=>y.activeSettingsSection),o=oe(y=>y.setActiveSettingsSection),s=oe(y=>y.closeSettings),r=Z.useRef(null),c=Z.useRef(null),d=Z.useRef(!1),g=Z.useRef({account:null,appearance:null,language:null,future:null}),m=(y,v)=>{g.current[y]=v},h=y=>{o(y),d.current=!0,g.current[y]?.scrollIntoView({behavior:"auto",block:"start"}),c.current!==null&&window.clearTimeout(c.current),c.current=window.setTimeout(()=>{d.current=!1,c.current=null},120)};return Z.useEffect(()=>{const y=v=>{v.key==="Escape"&&s()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[s]),Z.useEffect(()=>{const y=r.current;if(!y||typeof IntersectionObserver!="function")return;const v=new IntersectionObserver(p=>{if(d.current)return;const _=p.filter(M=>M.isIntersecting).sort((M,A)=>A.intersectionRatio-M.intersectionRatio)[0]?.target.id;_&&Df.includes(_)&&o(_)},{root:y,threshold:[.35,.6]});for(const p of Df){const x=g.current[p];x&&v.observe(x)}return()=>v.disconnect()},[o]),Z.useEffect(()=>()=>{c.current!==null&&window.clearTimeout(c.current)},[]),b.jsx("main",{ref:r,className:"settings-workspace","aria-labelledby":"settings-title",children:b.jsxs("div",{className:"settings-shell",children:[b.jsxs("header",{className:"settings-header",children:[b.jsxs("div",{children:[b.jsx("p",{className:"settings-eyebrow",children:n("settings.eyebrow")}),b.jsx("h2",{id:"settings-title",children:n("settings.title")}),b.jsx("p",{children:n("settings.subtitle")})]}),b.jsx("button",{type:"button",className:"settings-close",onClick:s,"aria-label":n("settings.closeAria"),title:n("settings.closeTitle"),children:"X"})]}),b.jsxs("div",{className:"settings-layout",children:[b.jsx("nav",{className:"settings-nav","aria-label":n("settings.navAria"),children:Df.map(y=>b.jsxs("button",{type:"button",className:`settings-nav__item${l===y?" is-active":""}`,onClick:()=>h(y),"aria-label":n("settings.jumpTo",{section:n(`settings.sections.${y}.title`)}),children:[b.jsx("span",{children:n(`settings.sections.${y}.title`)}),b.jsx("small",{children:n(`settings.sections.${y}.hint`)})]},y))}),b.jsxs("section",{className:"settings-content","aria-label":n("settings.contentAria"),children:[b.jsx(fr,{id:"account",setRef:m,children:b.jsx(oC,{})}),b.jsx(fr,{id:"appearance",setRef:m,children:b.jsxs("article",{className:"settings-row",children:[b.jsxs("div",{className:"settings-row__copy",children:[b.jsx("h4",{children:n("settings.appearance.themeTitle")}),b.jsx("p",{children:n("settings.appearance.themeBody")})]}),b.jsx("div",{className:"settings-row__control",children:b.jsx(cC,{})})]})}),b.jsx(fr,{id:"language",setRef:m,children:b.jsxs("article",{className:"settings-row",children:[b.jsxs("div",{className:"settings-row__copy",children:[b.jsx("h4",{children:n("settings.language.title")}),b.jsx("p",{children:n("settings.language.body")})]}),b.jsx("div",{className:"settings-row__control",children:b.jsx(rC,{})})]})}),b.jsx(fr,{id:"future",setRef:m,children:b.jsxs("article",{className:"settings-note",children:[b.jsx("h4",{children:n("settings.future.title")}),b.jsx("p",{children:n("settings.future.body")})]})})]})]})]})})}function dC(){const n=oe(r=>r.toast),[l,o]=Z.useState(!1);if(Z.useEffect(()=>{if(!n)return;o(!0);const r=setTimeout(()=>o(!1),3e3);return()=>clearTimeout(r)},[n]),!n)return null;const s=["toast",l?"visible":"",n.error?"error":""].filter(Boolean).join(" ");return b.jsx("div",{className:s,children:n.message})}function hC(){const{t:n}=Qe(),l=oe(v=>v.errorCard),o=oe(v=>v.dismissErrorCard);if(!l)return null;const s=fo[l.code]??fo.UNKNOWN,r=`${s.cardKey??"errorCard.unknown"}.title`,c=`${s.cardKey??"errorCard.unknown"}.body`,d=s.cta?`${s.cardKey??"errorCard.unknown"}.cta`:null,g=n(r),m=n(c),h=d?n(d):null,y=()=>{if(s.cta==="reload"){window.location.reload();return}else o()};return b.jsx("div",{className:"error-card-backdrop",role:"alertdialog","aria-labelledby":"error-card-title",children:b.jsxs("div",{className:"error-card",children:[b.jsx("div",{className:"error-card__icon","aria-hidden":"true",children:b.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[b.jsx("circle",{cx:"12",cy:"12",r:"10"}),b.jsx("line",{x1:"12",y1:"8",x2:"12",y2:"12"}),b.jsx("line",{x1:"12",y1:"16",x2:"12.01",y2:"16"})]})}),b.jsxs("div",{className:"error-card__content",children:[b.jsx("h3",{id:"error-card-title",className:"error-card__title",children:g}),b.jsx("p",{className:"error-card__body",children:m}),l.fallbackMessage&&b.jsxs("details",{className:"error-card__details",children:[b.jsx("summary",{children:n("errorCard.details")}),b.jsx("pre",{children:l.fallbackMessage})]}),b.jsxs("div",{className:"error-card__actions",children:[b.jsx("button",{type:"button",className:"btn btn--ghost",onClick:o,children:n("errorCard.close")}),h&&b.jsx("button",{type:"button",className:"btn btn--primary",onClick:y,children:h})]})]})]})})}function gC(n){if(!n)return"earlier";const l=new Date(n);if(Number.isNaN(l.getTime()))return"earlier";const s=Math.floor((new Date().getTime()-l.getTime())/864e5);return s===0?"today":s===1?"yesterday":s<7?"thisWeek":l.toLocaleDateString("ko-KR",{year:"numeric",month:"short",day:"numeric"})}function mC(){const{t:n}=Qe(),l=oe(V=>V.galleryOpen),o=oe(V=>V.closeGallery),s=oe(V=>V.history),r=oe(V=>V.selectHistory),c=oe(V=>V.currentImage),d=oe(V=>V.removeFromHistory),g=oe(V=>V.addHistoryItem),[m,h]=Z.useState(""),[y,v]=Z.useState("date"),[p,x]=Z.useState([]),[_,M]=Z.useState([]),[A,T]=Z.useState(null);Z.useEffect(()=>{if(!l)return;const V=k=>{k.key==="Escape"&&o()};return window.addEventListener("keydown",V),()=>window.removeEventListener("keydown",V)},[l,o]),Z.useEffect(()=>{l||(h(""),T(null))},[l]),Z.useEffect(()=>{if(!l||y!=="session")return;let V=!1;return(async()=>{try{const k=await $S({limit:500});if(V)return;const P=te=>{const z=te.kind,I=z==="classic"||z==="edit"||z==="generate"?z:null;return{image:te.url,url:te.url,filename:te.filename,prompt:te.prompt??void 0,size:te.size??void 0,quality:te.quality??void 0,provider:te.provider,createdAt:te.createdAt,sessionId:te.sessionId??null,nodeId:te.nodeId??null,clientNodeId:te.clientNodeId??null,kind:I}};x(k.sessions.map(te=>({sessionId:te.sessionId,title:te.title??null,label:te.label??null,displayLabel:te.title||te.label||te.sessionId.slice(0,8),items:te.items.map(P)}))),M(k.loose.map(P))}catch{}})(),()=>{V=!0}},[l,y]);const B=Z.useMemo(()=>{const V=m.trim().toLowerCase().normalize("NFC");return V?s.filter(k=>(k.prompt??"").toLowerCase().normalize("NFC").includes(V)||(k.filename??"").toLowerCase().normalize("NFC").includes(V)):s},[s,m]),E=Z.useMemo(()=>{const V=new Map;for(const k of B){const P=gC(k.createdAt);V.has(P)||V.set(P,[]),V.get(P).push(k)}return Array.from(V.entries())},[B]);Z.useEffect(()=>{if(!A)return;const V=setInterval(()=>{T(k=>!k||Date.now()>=k.expiresAt?null:{...k})},500);return()=>clearInterval(V)},[A]);async function D(V,k){if(k.stopPropagation(),!!V.filename)try{const P=await QS(V.filename);d(V.filename),T({filename:V.filename,trashId:P.trashId,item:V,expiresAt:Date.now()+9500})}catch(P){console.error("[gallery] delete failed",P)}}async function Y(){if(A)try{await KS(A.filename,A.trashId),g(A.item)}catch(V){console.error("[gallery] restore failed",V)}finally{T(null)}}if(!l)return null;const R=V=>V==="earlier"||V==="today"||V==="yesterday"||V==="thisWeek"?n(`gallery.${V}`):V,L=(V,k,P)=>{const te=c?.image===V.image;return b.jsxs("div",{className:`gallery__tile-wrap${te?" gallery__tile-wrap--active":""}`,children:[b.jsxs("button",{type:"button",className:`gallery__tile${te?" gallery__tile--active":""}`,onClick:()=>{r(V),o()},title:V.prompt??"",children:[b.jsx("img",{src:V.thumb||V.image,alt:V.prompt??n("gallery.imageAltFallback"),loading:"lazy",decoding:"async"}),V.prompt&&b.jsx("div",{className:"gallery__caption",children:b.jsx("span",{className:"gallery__caption-text",children:V.prompt})})]}),V.filename&&b.jsx("button",{type:"button",className:"gallery__delete",onClick:z=>D(V,z),title:n("gallery.deleteTitle"),"aria-label":n("gallery.deleteAria"),children:"×"})]},`${k}-${P}-${V.filename??P}`)},H=y==="session",$=H?p.reduce((V,k)=>V+k.items.length,0)+_.length:B.length;return b.jsx("div",{className:"gallery-backdrop",onClick:o,role:"presentation",children:b.jsxs("div",{className:"gallery",role:"dialog","aria-modal":"true","aria-label":n("gallery.ariaLabel"),onClick:V=>V.stopPropagation(),children:[b.jsxs("div",{className:"gallery__header",children:[b.jsxs("div",{className:"gallery__title-row",children:[b.jsx("div",{className:"gallery__title",children:n("gallery.title")}),b.jsxs("div",{className:"gallery__meta",children:[n("gallery.total",{n:$}),m?n("gallery.totalFiltered",{n:s.length}):""]}),b.jsxs("div",{className:"gallery__group-toggle",role:"tablist","aria-label":n("gallery.sortByAria"),children:[b.jsx("button",{type:"button",role:"tab","aria-selected":y==="date",className:y==="date"?"active":"",onClick:()=>v("date"),children:n("gallery.sortByDate")}),b.jsx("button",{type:"button",role:"tab","aria-selected":y==="session",className:y==="session"?"active":"",onClick:()=>v("session"),children:n("gallery.sortBySession")})]})]}),b.jsx("input",{type:"text",className:"gallery__search",placeholder:n(H?"gallery.searchDisabledPlaceholder":"gallery.searchPlaceholder"),value:m,onChange:V=>h(V.target.value),autoFocus:!0,disabled:H}),b.jsx("button",{type:"button",className:"gallery__close",onClick:o,"aria-label":n("gallery.closeAria"),title:n("gallery.closeTitle"),children:"×"})]}),b.jsx("div",{className:"gallery__scroll",children:H?b.jsxs(b.Fragment,{children:[p.map(V=>b.jsxs("section",{className:"gallery__group",children:[b.jsxs("header",{className:"gallery__group-header",children:[b.jsx("span",{className:"gallery__group-label",title:V.sessionId,children:V.title?V.displayLabel:n("gallery.sessionLabel",{name:V.displayLabel})}),b.jsx("span",{className:"gallery__group-count",children:V.items.length})]}),b.jsx("div",{className:"gallery__grid",children:V.items.map((k,P)=>L(k,V.sessionId,P))})]},V.sessionId)),_.length>0&&b.jsxs("section",{className:"gallery__group",children:[b.jsxs("header",{className:"gallery__group-header",children:[b.jsx("span",{className:"gallery__group-label",children:n("gallery.standalone")}),b.jsx("span",{className:"gallery__group-count",children:_.length})]}),b.jsx("div",{className:"gallery__grid",children:_.map((V,k)=>L(V,"loose",k))})]}),p.length===0&&_.length===0&&b.jsx("div",{className:"gallery__empty",children:n("gallery.emptySessions")})]}):B.length===0?b.jsx("div",{className:"gallery__empty",children:s.length===0?n("gallery.emptyAll"):n("gallery.noResults")}):E.map(([V,k])=>b.jsxs("section",{className:"gallery__group",children:[b.jsxs("header",{className:"gallery__group-header",children:[b.jsx("span",{className:"gallery__group-label",children:R(V)}),b.jsx("span",{className:"gallery__group-count",children:k.length})]}),b.jsx("div",{className:"gallery__grid",children:k.map((P,te)=>L(P,V,te))})]},V))}),A&&b.jsxs("div",{className:"gallery__undo",children:[b.jsx("span",{children:n("gallery.deleted",{filename:A.filename})}),b.jsx("button",{type:"button",onClick:Y,children:n("gallery.undo")}),b.jsx("span",{className:"gallery__undo-timer",children:n("gallery.secondsSuffix",{n:Math.max(0,Math.ceil((A.expiresAt-Date.now())/1e3))})})]})]})})}function pC(){const n=oe(p=>p.hydrateHistory),l=oe(p=>p.loadSessions),o=oe(p=>p.startInFlightPolling),s=oe(p=>p.reconcileInflight),r=oe(p=>p.syncFromStorage),c=oe(p=>p.theme),d=oe(p=>p.resolvedTheme),g=oe(p=>p.settingsOpen),m=oe(p=>p.syncThemeFromStorage),h=oe(p=>p.refreshResolvedTheme),v=oe(p=>p.uiMode);return Z.useEffect(()=>{n(),l(),s(),o()},[n,l,s,o]),Z.useEffect(()=>{const p=x=>{x.key&&(x.key==="ima2.inFlight"||x.key==="ima2.selectedFilename"?r():x.key==="ima2:theme"&&m())};return window.addEventListener("storage",p),()=>window.removeEventListener("storage",p)},[r,m]),Z.useEffect(()=>{document.documentElement.dataset.theme=d,document.documentElement.style.colorScheme=d},[d]),Z.useEffect(()=>{if(c!=="system")return;const p=window.matchMedia("(prefers-color-scheme: light)");return p.addEventListener("change",h),()=>p.removeEventListener("change",h)},[h,c]),Z.useEffect(()=>{const p=()=>{Dx(oe.getState)};return window.addEventListener("beforeunload",p),document.addEventListener("visibilitychange",p),()=>{window.removeEventListener("beforeunload",p),document.removeEventListener("visibilitychange",p)}},[]),b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:`app${g?" app--settings-open":""}`,"data-theme":d,children:[b.jsx(Gx,{}),g?b.jsx(fC,{}):v==="classic"?b.jsx(kx,{}):b.jsx(KT,{}),b.jsx(nC,{})]}),b.jsx(dC,{}),b.jsx(hC,{}),b.jsx(mC,{})]})}qS.createRoot(document.getElementById("root")).render(b.jsx(Z.StrictMode,{children:b.jsx(pC,{})}));
|
|
16
|
-
//# sourceMappingURL=index-D1MUxZaB.js.map
|