ima2-gen 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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"]'))u(r);new MutationObserver(r=>{for(const f of r)if(f.type==="childList")for(const d of f.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&u(d)}).observe(document,{childList:!0,subtree:!0});function o(r){const f={};return r.integrity&&(f.integrity=r.integrity),r.referrerPolicy&&(f.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?f.credentials="include":r.crossOrigin==="anonymous"?f.credentials="omit":f.credentials="same-origin",f}function u(r){if(r.ep)return;r.ep=!0;const f=o(r);fetch(r.href,f)}})();function op(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Fc={exports:{}},Fi={};var Hm;function nx(){if(Hm)return Fi;Hm=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function o(u,r,f){var d=null;if(f!==void 0&&(d=""+f),r.key!==void 0&&(d=""+r.key),"key"in r){f={};for(var g in r)g!=="key"&&(f[g]=r[g])}else f=r;return r=f.ref,{$$typeof:n,type:u,key:d,ref:r!==void 0?r:null,props:f}}return Fi.Fragment=l,Fi.jsx=o,Fi.jsxs=o,Fi}var jm;function ax(){return jm||(jm=1,Fc.exports=nx()),Fc.exports}var w=ax(),Wc={exports:{}},St={};var Um;function lx(){if(Um)return St;Um=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),d=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.iterator;function S(A){return A===null||typeof A!="object"?null:(A=x&&A[x]||A["@@iterator"],typeof A=="function"?A:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,C={};function N(A,H,W){this.props=A,this.context=H,this.refs=C,this.updater=W||_}N.prototype.isReactComponent={},N.prototype.setState=function(A,H){if(typeof A!="object"&&typeof A!="function"&&A!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,A,H,"setState")},N.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function j(){}j.prototype=N.prototype;function E(A,H,W){this.props=A,this.context=H,this.refs=C,this.updater=W||_}var z=E.prototype=new j;z.constructor=E,T(z,N.prototype),z.isPureReactComponent=!0;var Y=Array.isArray;function q(){}var L={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function I(A,H,W){var et=W.ref;return{$$typeof:n,type:A,key:H,ref:et!==void 0?et:null,props:W}}function ot(A,H){return I(A.type,H,A.props)}function $(A){return typeof A=="object"&&A!==null&&A.$$typeof===n}function P(A){var H={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(W){return H[W]})}var it=/\/+/g;function D(A,H){return typeof A=="object"&&A!==null&&A.key!=null?P(""+A.key):H.toString(36)}function G(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(q,q):(A.status="pending",A.then(function(H){A.status==="pending"&&(A.status="fulfilled",A.value=H)},function(H){A.status==="pending"&&(A.status="rejected",A.reason=H)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function M(A,H,W,et,st){var ct=typeof A;(ct==="undefined"||ct==="boolean")&&(A=null);var rt=!1;if(A===null)rt=!0;else switch(ct){case"bigint":case"string":case"number":rt=!0;break;case"object":switch(A.$$typeof){case n:case l:rt=!0;break;case v:return rt=A._init,M(rt(A._payload),H,W,et,st)}}if(rt)return st=st(A),rt=et===""?"."+D(A,0):et,Y(st)?(W="",rt!=null&&(W=rt.replace(it,"$&/")+"/"),M(st,H,W,"",function(Et){return Et})):st!=null&&($(st)&&(st=ot(st,W+(st.key==null||A&&A.key===st.key?"":(""+st.key).replace(it,"$&/")+"/")+rt)),H.push(st)),1;rt=0;var ut=et===""?".":et+":";if(Y(A))for(var ft=0;ft<A.length;ft++)et=A[ft],ct=ut+D(et,ft),rt+=M(et,H,W,ct,st);else if(ft=S(A),typeof ft=="function")for(A=ft.call(A),ft=0;!(et=A.next()).done;)et=et.value,ct=ut+D(et,ft++),rt+=M(et,H,W,ct,st);else if(ct==="object"){if(typeof A.then=="function")return M(G(A),H,W,et,st);throw H=String(A),Error("Objects are not valid as a React child (found: "+(H==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":H)+"). If you meant to render a collection of children, use an array instead.")}return rt}function R(A,H,W){if(A==null)return A;var et=[],st=0;return M(A,et,"","",function(ct){return H.call(W,ct,st++)}),et}function B(A){if(A._status===-1){var H=A._result;H=H(),H.then(function(W){(A._status===0||A._status===-1)&&(A._status=1,A._result=W)},function(W){(A._status===0||A._status===-1)&&(A._status=2,A._result=W)}),A._status===-1&&(A._status=0,A._result=H)}if(A._status===1)return A._result.default;throw A._result}var X=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var H=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof A=="object"&&A!==null&&typeof A.message=="string"?String(A.message):String(A),error:A});if(!window.dispatchEvent(H))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},tt={map:R,forEach:function(A,H,W){R(A,function(){H.apply(this,arguments)},W)},count:function(A){var H=0;return R(A,function(){H++}),H},toArray:function(A){return R(A,function(H){return H})||[]},only:function(A){if(!$(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return St.Activity=y,St.Children=tt,St.Component=N,St.Fragment=o,St.Profiler=r,St.PureComponent=E,St.StrictMode=u,St.Suspense=m,St.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,St.__COMPILER_RUNTIME={__proto__:null,c:function(A){return L.H.useMemoCache(A)}},St.cache=function(A){return function(){return A.apply(null,arguments)}},St.cacheSignal=function(){return null},St.cloneElement=function(A,H,W){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var et=T({},A.props),st=A.key;if(H!=null)for(ct in H.key!==void 0&&(st=""+H.key),H)!k.call(H,ct)||ct==="key"||ct==="__self"||ct==="__source"||ct==="ref"&&H.ref===void 0||(et[ct]=H[ct]);var ct=arguments.length-2;if(ct===1)et.children=W;else if(1<ct){for(var rt=Array(ct),ut=0;ut<ct;ut++)rt[ut]=arguments[ut+2];et.children=rt}return I(A.type,st,et)},St.createContext=function(A){return A={$$typeof:d,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:f,_context:A},A},St.createElement=function(A,H,W){var et,st={},ct=null;if(H!=null)for(et in H.key!==void 0&&(ct=""+H.key),H)k.call(H,et)&&et!=="key"&&et!=="__self"&&et!=="__source"&&(st[et]=H[et]);var rt=arguments.length-2;if(rt===1)st.children=W;else if(1<rt){for(var ut=Array(rt),ft=0;ft<rt;ft++)ut[ft]=arguments[ft+2];st.children=ut}if(A&&A.defaultProps)for(et in rt=A.defaultProps,rt)st[et]===void 0&&(st[et]=rt[et]);return I(A,ct,st)},St.createRef=function(){return{current:null}},St.forwardRef=function(A){return{$$typeof:g,render:A}},St.isValidElement=$,St.lazy=function(A){return{$$typeof:v,_payload:{_status:-1,_result:A},_init:B}},St.memo=function(A,H){return{$$typeof:h,type:A,compare:H===void 0?null:H}},St.startTransition=function(A){var H=L.T,W={};L.T=W;try{var et=A(),st=L.S;st!==null&&st(W,et),typeof et=="object"&&et!==null&&typeof et.then=="function"&&et.then(q,X)}catch(ct){X(ct)}finally{H!==null&&W.types!==null&&(H.types=W.types),L.T=H}},St.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},St.use=function(A){return L.H.use(A)},St.useActionState=function(A,H,W){return L.H.useActionState(A,H,W)},St.useCallback=function(A,H){return L.H.useCallback(A,H)},St.useContext=function(A){return L.H.useContext(A)},St.useDebugValue=function(){},St.useDeferredValue=function(A,H){return L.H.useDeferredValue(A,H)},St.useEffect=function(A,H){return L.H.useEffect(A,H)},St.useEffectEvent=function(A){return L.H.useEffectEvent(A)},St.useId=function(){return L.H.useId()},St.useImperativeHandle=function(A,H,W){return L.H.useImperativeHandle(A,H,W)},St.useInsertionEffect=function(A,H){return L.H.useInsertionEffect(A,H)},St.useLayoutEffect=function(A,H){return L.H.useLayoutEffect(A,H)},St.useMemo=function(A,H){return L.H.useMemo(A,H)},St.useOptimistic=function(A,H){return L.H.useOptimistic(A,H)},St.useReducer=function(A,H,W){return L.H.useReducer(A,H,W)},St.useRef=function(A){return L.H.useRef(A)},St.useState=function(A){return L.H.useState(A)},St.useSyncExternalStore=function(A,H,W){return L.H.useSyncExternalStore(A,H,W)},St.useTransition=function(){return L.H.useTransition()},St.version="19.2.5",St}var Bm;function vo(){return Bm||(Bm=1,Wc.exports=lx()),Wc.exports}var J=vo();const ao=op(J);var Pc={exports:{}},Wi={},tf={exports:{}},ef={};var qm;function ix(){return qm||(qm=1,(function(n){function l(M,R){var B=M.length;M.push(R);t:for(;0<B;){var X=B-1>>>1,tt=M[X];if(0<r(tt,R))M[X]=R,M[B]=tt,B=X;else break t}}function o(M){return M.length===0?null:M[0]}function u(M){if(M.length===0)return null;var R=M[0],B=M.pop();if(B!==R){M[0]=B;t:for(var X=0,tt=M.length,A=tt>>>1;X<A;){var H=2*(X+1)-1,W=M[H],et=H+1,st=M[et];if(0>r(W,B))et<tt&&0>r(st,W)?(M[X]=st,M[et]=B,X=et):(M[X]=W,M[H]=B,X=H);else if(et<tt&&0>r(st,B))M[X]=st,M[et]=B,X=et;else break t}}return R}function r(M,R){var B=M.sortIndex-R.sortIndex;return B!==0?B:M.id-R.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var d=Date,g=d.now();n.unstable_now=function(){return d.now()-g}}var m=[],h=[],v=1,y=null,x=3,S=!1,_=!1,T=!1,C=!1,N=typeof setTimeout=="function"?setTimeout:null,j=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function z(M){for(var R=o(h);R!==null;){if(R.callback===null)u(h);else if(R.startTime<=M)u(h),R.sortIndex=R.expirationTime,l(m,R);else break;R=o(h)}}function Y(M){if(T=!1,z(M),!_)if(o(m)!==null)_=!0,q||(q=!0,P());else{var R=o(h);R!==null&&G(Y,R.startTime-M)}}var q=!1,L=-1,k=5,I=-1;function ot(){return C?!0:!(n.unstable_now()-I<k)}function $(){if(C=!1,q){var M=n.unstable_now();I=M;var R=!0;try{t:{_=!1,T&&(T=!1,j(L),L=-1),S=!0;var B=x;try{e:{for(z(M),y=o(m);y!==null&&!(y.expirationTime>M&&ot());){var X=y.callback;if(typeof X=="function"){y.callback=null,x=y.priorityLevel;var tt=X(y.expirationTime<=M);if(M=n.unstable_now(),typeof tt=="function"){y.callback=tt,z(M),R=!0;break e}y===o(m)&&u(m),z(M)}else u(m);y=o(m)}if(y!==null)R=!0;else{var A=o(h);A!==null&&G(Y,A.startTime-M),R=!1}}break t}finally{y=null,x=B,S=!1}R=void 0}}finally{R?P():q=!1}}}var P;if(typeof E=="function")P=function(){E($)};else if(typeof MessageChannel<"u"){var it=new MessageChannel,D=it.port2;it.port1.onmessage=$,P=function(){D.postMessage(null)}}else P=function(){N($,0)};function G(M,R){L=N(function(){M(n.unstable_now())},R)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(M){M.callback=null},n.unstable_forceFrameRate=function(M){0>M||125<M?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<M?Math.floor(1e3/M):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(M){switch(x){case 1:case 2:case 3:var R=3;break;default:R=x}var B=x;x=R;try{return M()}finally{x=B}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(M,R){switch(M){case 1:case 2:case 3:case 4:case 5:break;default:M=3}var B=x;x=M;try{return R()}finally{x=B}},n.unstable_scheduleCallback=function(M,R,B){var X=n.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?X+B:X):B=X,M){case 1:var tt=-1;break;case 2:tt=250;break;case 5:tt=1073741823;break;case 4:tt=1e4;break;default:tt=5e3}return tt=B+tt,M={id:v++,callback:R,priorityLevel:M,startTime:B,expirationTime:tt,sortIndex:-1},B>X?(M.sortIndex=B,l(h,M),o(m)===null&&M===o(h)&&(T?(j(L),L=-1):T=!0,G(Y,B-X))):(M.sortIndex=tt,l(m,M),_||S||(_=!0,q||(q=!0,P()))),M},n.unstable_shouldYield=ot,n.unstable_wrapCallback=function(M){var R=x;return function(){var B=x;x=R;try{return M.apply(this,arguments)}finally{x=B}}}})(ef)),ef}var Lm;function ox(){return Lm||(Lm=1,tf.exports=ix()),tf.exports}var nf={exports:{}},ge={};var Ym;function ux(){if(Ym)return ge;Ym=1;var n=vo();function l(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)h+="&args[]="+encodeURIComponent(arguments[v])}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 u={d:{f:o,r:function(){throw Error(l(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},r=Symbol.for("react.portal");function f(m,h,v){var y=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:y==null?null:""+y,children:m,containerInfo:h,implementation:v}}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 ge.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,ge.createPortal=function(m,h){var v=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 f(m,h,null,v)},ge.flushSync=function(m){var h=d.T,v=u.p;try{if(d.T=null,u.p=2,m)return m()}finally{d.T=h,u.p=v,u.d.f()}},ge.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,u.d.C(m,h))},ge.prefetchDNS=function(m){typeof m=="string"&&u.d.D(m)},ge.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var v=h.as,y=g(v,h.crossOrigin),x=typeof h.integrity=="string"?h.integrity:void 0,S=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;v==="style"?u.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:x,fetchPriority:S}):v==="script"&&u.d.X(m,{crossOrigin:y,integrity:x,fetchPriority:S,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},ge.preinitModule=function(m,h){if(typeof m=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var v=g(h.as,h.crossOrigin);u.d.M(m,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&u.d.M(m)},ge.preload=function(m,h){if(typeof m=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var v=h.as,y=g(v,h.crossOrigin);u.d.L(m,v,{crossOrigin:y,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})}},ge.preloadModule=function(m,h){if(typeof m=="string")if(h){var v=g(h.as,h.crossOrigin);u.d.m(m,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else u.d.m(m)},ge.requestFormReset=function(m){u.d.r(m)},ge.unstable_batchedUpdates=function(m,h){return m(h)},ge.useFormState=function(m,h,v){return d.H.useFormState(m,h,v)},ge.useFormStatus=function(){return d.H.useHostTransitionStatus()},ge.version="19.2.5",ge}var Vm;function up(){if(Vm)return nf.exports;Vm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),nf.exports=ux(),nf.exports}var Gm;function sx(){if(Gm)return Wi;Gm=1;var n=ox(),l=vo(),o=up();function u(t){var e="https://react.dev/errors/"+t;if(1<arguments.length){e+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)e+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function f(t){var e=t,a=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,(e.flags&4098)!==0&&(a=e.return),t=e.return;while(t)}return e.tag===3?a:null}function d(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function g(t){if(t.tag===31){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function m(t){if(f(t)!==t)throw Error(u(188))}function h(t){var e=t.alternate;if(!e){if(e=f(t),e===null)throw Error(u(188));return e!==t?null:t}for(var a=t,i=e;;){var s=a.return;if(s===null)break;var c=s.alternate;if(c===null){if(i=s.return,i!==null){a=i;continue}break}if(s.child===c.child){for(c=s.child;c;){if(c===a)return m(s),t;if(c===i)return m(s),e;c=c.sibling}throw Error(u(188))}if(a.return!==i.return)a=s,i=c;else{for(var p=!1,b=s.child;b;){if(b===a){p=!0,a=s,i=c;break}if(b===i){p=!0,i=s,a=c;break}b=b.sibling}if(!p){for(b=c.child;b;){if(b===a){p=!0,a=c,i=s;break}if(b===i){p=!0,i=c,a=s;break}b=b.sibling}if(!p)throw Error(u(189))}}if(a.alternate!==i)throw Error(u(190))}if(a.tag!==3)throw Error(u(188));return a.stateNode.current===a?t:e}function v(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t;for(t=t.child;t!==null;){if(e=v(t),e!==null)return e;t=t.sibling}return null}var y=Object.assign,x=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),C=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),j=Symbol.for("react.consumer"),E=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),Y=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),I=Symbol.for("react.activity"),ot=Symbol.for("react.memo_cache_sentinel"),$=Symbol.iterator;function P(t){return t===null||typeof t!="object"?null:(t=$&&t[$]||t["@@iterator"],typeof t=="function"?t:null)}var it=Symbol.for("react.client.reference");function D(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===it?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case T:return"Fragment";case N:return"Profiler";case C:return"StrictMode";case Y:return"Suspense";case q:return"SuspenseList";case I:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case _:return"Portal";case E:return t.displayName||"Context";case j:return(t._context.displayName||"Context")+".Consumer";case z:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case L:return e=t.displayName||null,e!==null?e:D(t.type)||"Memo";case k:e=t._payload,t=t._init;try{return D(t(e))}catch{}}return null}var G=Array.isArray,M=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,R=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},X=[],tt=-1;function A(t){return{current:t}}function H(t){0>tt||(t.current=X[tt],X[tt]=null,tt--)}function W(t,e){tt++,X[tt]=t.current,t.current=e}var et=A(null),st=A(null),ct=A(null),rt=A(null);function ut(t,e){switch(W(ct,e),W(st,t),W(et,null),e.nodeType){case 9:case 11:t=(t=e.documentElement)&&(t=t.namespaceURI)?am(t):0;break;default:if(t=e.tagName,e=e.namespaceURI)e=am(e),t=lm(e,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(et),W(et,t)}function ft(){H(et),H(st),H(ct)}function Et(t){t.memoizedState!==null&&W(rt,t);var e=et.current,a=lm(e,t.type);e!==a&&(W(st,t),W(et,a))}function bt(t){st.current===t&&(H(et),H(st)),rt.current===t&&(H(rt),ki._currentValue=B)}var yt,xt;function At(t){if(yt===void 0)try{throw Error()}catch(a){var e=a.stack.trim().match(/\n( *(at )?)/);yt=e&&e[1]||"",xt=-1<a.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+yt+t+xt}var qt=!1;function jt(t,e){if(!t||qt)return"";qt=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(e){var lt=function(){throw Error()};if(Object.defineProperty(lt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(lt,[])}catch(F){var K=F}Reflect.construct(t,[],lt)}else{try{lt.call()}catch(F){K=F}t.call(lt.prototype)}}else{try{throw Error()}catch(F){K=F}(lt=t())&&typeof lt.catch=="function"&&lt.catch(function(){})}}catch(F){if(F&&K&&typeof F.stack=="string")return[F.stack,K.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=i.DetermineComponentFrameRoot(),p=c[0],b=c[1];if(p&&b){var O=p.split(`
4
- `),Q=b.split(`
5
- `);for(s=i=0;i<O.length&&!O[i].includes("DetermineComponentFrameRoot");)i++;for(;s<Q.length&&!Q[s].includes("DetermineComponentFrameRoot");)s++;if(i===O.length||s===Q.length)for(i=O.length-1,s=Q.length-1;1<=i&&0<=s&&O[i]!==Q[s];)s--;for(;1<=i&&0<=s;i--,s--)if(O[i]!==Q[s]){if(i!==1||s!==1)do if(i--,s--,0>s||O[i]!==Q[s]){var nt=`
6
- `+O[i].replace(" at new "," at ");return t.displayName&&nt.includes("<anonymous>")&&(nt=nt.replace("<anonymous>",t.displayName)),nt}while(1<=i&&0<=s);break}}}finally{qt=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?At(a):""}function oe(t,e){switch(t.tag){case 26:case 27:case 5:return At(t.type);case 16:return At("Lazy");case 13:return t.child!==e&&e!==null?At("Suspense Fallback"):At("Suspense");case 19:return At("SuspenseList");case 0:case 15:return jt(t.type,!1);case 11:return jt(t.type.render,!1);case 1:return jt(t.type,!0);case 31:return At("Activity");default:return""}}function Qe(t){try{var e="",a=null;do e+=oe(t,a),a=t,t=t.return;while(t);return e}catch(i){return`
7
- Error generating stack: `+i.message+`
8
- `+i.stack}}var Ae=Object.prototype.hasOwnProperty,$e=n.unstable_scheduleCallback,mn=n.unstable_cancelCallback,_a=n.unstable_shouldYield,Ea=n.unstable_requestPaint,se=n.unstable_now,nl=n.unstable_getCurrentPriorityLevel,pn=n.unstable_ImmediatePriority,Xn=n.unstable_UserBlockingPriority,wa=n.unstable_NormalPriority,Hs=n.unstable_LowPriority,al=n.unstable_IdlePriority,js=n.log,Us=n.unstable_setDisableYieldValue,Na=null,me=null;function an(t){if(typeof js=="function"&&Us(t),me&&typeof me.setStrictMode=="function")try{me.setStrictMode(Na,t)}catch{}}var pe=Math.clz32?Math.clz32:Ls,Bs=Math.log,qs=Math.LN2;function Ls(t){return t>>>=0,t===0?32:31-(Bs(t)/qs|0)|0}var ll=256,il=262144,ol=4194304;function yn(t){var e=t&42;if(e!==0)return e;switch(t&-t){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 t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function ul(t,e,a){var i=t.pendingLanes;if(i===0)return 0;var s=0,c=t.suspendedLanes,p=t.pingedLanes;t=t.warmLanes;var b=i&134217727;return b!==0?(i=b&~c,i!==0?s=yn(i):(p&=b,p!==0?s=yn(p):a||(a=b&~t,a!==0&&(s=yn(a))))):(b=i&~c,b!==0?s=yn(b):p!==0?s=yn(p):a||(a=i&~t,a!==0&&(s=yn(a)))),s===0?0:e!==0&&e!==s&&(e&c)===0&&(c=s&-s,a=e&-e,c>=a||c===32&&(a&4194048)!==0)?e:s}function Ma(t,e){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&e)===0}function Ys(t,e){switch(t){case 1:case 2:case 4:case 8:case 64:return e+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 e+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 No(){var t=ol;return ol<<=1,(ol&62914560)===0&&(ol=4194304),t}function li(t){for(var e=[],a=0;31>a;a++)e.push(t);return e}function Aa(t,e){t.pendingLanes|=e,e!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Vs(t,e,a,i,s,c){var p=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var b=t.entanglements,O=t.expirationTimes,Q=t.hiddenUpdates;for(a=p&~a;0<a;){var nt=31-pe(a),lt=1<<nt;b[nt]=0,O[nt]=-1;var K=Q[nt];if(K!==null)for(Q[nt]=null,nt=0;nt<K.length;nt++){var F=K[nt];F!==null&&(F.lane&=-536870913)}a&=~lt}i!==0&&Mo(t,i,0),c!==0&&s===0&&t.tag!==0&&(t.suspendedLanes|=c&~(p&~e))}function Mo(t,e,a){t.pendingLanes|=e,t.suspendedLanes&=~e;var i=31-pe(e);t.entangledLanes|=e,t.entanglements[i]=t.entanglements[i]|1073741824|a&261930}function Ao(t,e){var a=t.entangledLanes|=e;for(t=t.entanglements;a;){var i=31-pe(a),s=1<<i;s&e|t[i]&e&&(t[i]|=e),a&=~s}}function To(t,e){var a=e&-e;return a=(a&42)!==0?1:ii(a),(a&(t.suspendedLanes|e))!==0?0:a}function ii(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=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:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function oi(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function zo(){var t=R.p;return t!==0?t:(t=window.event,t===void 0?32:Am(t.type))}function Co(t,e){var a=R.p;try{return R.p=t,e()}finally{R.p=a}}var ln=Math.random().toString(36).slice(2),le="__reactFiber$"+ln,he="__reactProps$"+ln,vn="__reactContainer$"+ln,sl="__reactEvents$"+ln,Do="__reactListeners$"+ln,Gs="__reactHandles$"+ln,Oo="__reactResources$"+ln,Ta="__reactMarker$"+ln;function ui(t){delete t[le],delete t[he],delete t[sl],delete t[Do],delete t[Gs]}function Zn(t){var e=t[le];if(e)return e;for(var a=t.parentNode;a;){if(e=a[vn]||a[le]){if(a=e.alternate,e.child!==null||a!==null&&a.child!==null)for(t=fm(t);t!==null;){if(a=t[le])return a;t=fm(t)}return e}t=a,a=t.parentNode}return null}function Qn(t){if(t=t[le]||t[vn]){var e=t.tag;if(e===5||e===6||e===13||e===31||e===26||e===27||e===3)return t}return null}function $n(t){var e=t.tag;if(e===5||e===26||e===27||e===6)return t.stateNode;throw Error(u(33))}function kn(t){var e=t[Oo];return e||(e=t[Oo]={hoistableStyles:new Map,hoistableScripts:new Map}),e}function Wt(t){t[Ta]=!0}var Ro=new Set,Ho={};function xn(t,e){Kn(t,e),Kn(t+"Capture",e)}function Kn(t,e){for(Ho[t]=e,t=0;t<e.length;t++)Ro.add(e[t])}var Xs=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),si={},jo={};function Zs(t){return Ae.call(jo,t)?!0:Ae.call(si,t)?!1:Xs.test(t)?jo[t]=!0:(si[t]=!0,!1)}function rl(t,e,a){if(Zs(e))if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(e);return;case"boolean":var i=e.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){t.removeAttribute(e);return}}t.setAttribute(e,""+a)}}function cl(t,e,a){if(a===null)t.removeAttribute(e);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(e);return}t.setAttribute(e,""+a)}}function ke(t,e,a,i){if(i===null)t.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(e,a,""+i)}}function ve(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Uo(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function Qs(t,e,a){var i=Object.getOwnPropertyDescriptor(t.constructor.prototype,e);if(!t.hasOwnProperty(e)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var s=i.get,c=i.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(p){a=""+p,c.call(this,p)}}),Object.defineProperty(t,e,{enumerable:i.enumerable}),{getValue:function(){return a},setValue:function(p){a=""+p},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function fl(t){if(!t._valueTracker){var e=Uo(t)?"checked":"value";t._valueTracker=Qs(t,e,""+t[e])}}function Bo(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var a=e.getValue(),i="";return t&&(i=Uo(t)?t.checked?"true":"false":t.value),t=i,t!==a?(e.setValue(t),!0):!1}function za(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var $s=/[\n"\\]/g;function xe(t){return t.replace($s,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function Ca(t,e,a,i,s,c,p,b){t.name="",p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?t.type=p:t.removeAttribute("type"),e!=null?p==="number"?(e===0&&t.value===""||t.value!=e)&&(t.value=""+ve(e)):t.value!==""+ve(e)&&(t.value=""+ve(e)):p!=="submit"&&p!=="reset"||t.removeAttribute("value"),e!=null?ri(t,p,ve(e)):a!=null?ri(t,p,ve(a)):i!=null&&t.removeAttribute("value"),s==null&&c!=null&&(t.defaultChecked=!!c),s!=null&&(t.checked=s&&typeof s!="function"&&typeof s!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?t.name=""+ve(b):t.removeAttribute("name")}function qo(t,e,a,i,s,c,p,b){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(t.type=c),e!=null||a!=null){if(!(c!=="submit"&&c!=="reset"||e!=null)){fl(t);return}a=a!=null?""+ve(a):"",e=e!=null?""+ve(e):a,b||e===t.value||(t.value=e),t.defaultValue=e}i=i??s,i=typeof i!="function"&&typeof i!="symbol"&&!!i,t.checked=b?t.checked:!!i,t.defaultChecked=!!i,p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(t.name=p),fl(t)}function ri(t,e,a){e==="number"&&za(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function Sn(t,e,a,i){if(t=t.options,e){e={};for(var s=0;s<a.length;s++)e["$"+a[s]]=!0;for(a=0;a<t.length;a++)s=e.hasOwnProperty("$"+t[a].value),t[a].selected!==s&&(t[a].selected=s),s&&i&&(t[a].defaultSelected=!0)}else{for(a=""+ve(a),e=null,s=0;s<t.length;s++){if(t[s].value===a){t[s].selected=!0,i&&(t[s].defaultSelected=!0);return}e!==null||t[s].disabled||(e=t[s])}e!==null&&(e.selected=!0)}}function Wf(t,e,a){if(e!=null&&(e=""+ve(e),e!==t.value&&(t.value=e),a==null)){t.defaultValue!==e&&(t.defaultValue=e);return}t.defaultValue=a!=null?""+ve(a):""}function Pf(t,e,a,i){if(e==null){if(i!=null){if(a!=null)throw Error(u(92));if(G(i)){if(1<i.length)throw Error(u(93));i=i[0]}a=i}a==null&&(a=""),e=a}a=ve(e),t.defaultValue=a,i=t.textContent,i===a&&i!==""&&i!==null&&(t.value=i),fl(t)}function dl(t,e){if(e){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=e;return}}t.textContent=e}var Fy=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function td(t,e,a){var i=e.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?i?t.setProperty(e,""):e==="float"?t.cssFloat="":t[e]="":i?t.setProperty(e,a):typeof a!="number"||a===0||Fy.has(e)?e==="float"?t.cssFloat=a:t[e]=(""+a).trim():t[e]=a+"px"}function ed(t,e,a){if(e!=null&&typeof e!="object")throw Error(u(62));if(t=t.style,a!=null){for(var i in a)!a.hasOwnProperty(i)||e!=null&&e.hasOwnProperty(i)||(i.indexOf("--")===0?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="");for(var s in e)i=e[s],e.hasOwnProperty(s)&&a[s]!==i&&td(t,s,i)}else for(var c in e)e.hasOwnProperty(c)&&td(t,c,e[c])}function ks(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Wy=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Py=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Lo(t){return Py.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function bn(){}var Ks=null;function Is(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var hl=null,gl=null;function nd(t){var e=Qn(t);if(e&&(t=e.stateNode)){var a=t[he]||null;t:switch(t=e.stateNode,e.type){case"input":if(Ca(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),e=a.name,a.type==="radio"&&e!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+xe(""+e)+'"][type="radio"]'),e=0;e<a.length;e++){var i=a[e];if(i!==t&&i.form===t.form){var s=i[he]||null;if(!s)throw Error(u(90));Ca(i,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(e=0;e<a.length;e++)i=a[e],i.form===t.form&&Bo(i)}break t;case"textarea":Wf(t,a.value,a.defaultValue);break t;case"select":e=a.value,e!=null&&Sn(t,!!a.multiple,e,!1)}}}var Js=!1;function ad(t,e,a){if(Js)return t(e,a);Js=!0;try{var i=t(e);return i}finally{if(Js=!1,(hl!==null||gl!==null)&&(Mu(),hl&&(e=hl,t=gl,gl=hl=null,nd(e),t)))for(e=0;e<t.length;e++)nd(t[e])}}function ci(t,e){var a=t.stateNode;if(a===null)return null;var i=a[he]||null;if(i===null)return null;a=i[e];t:switch(e){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)||(t=t.type,i=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!i;break t;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(u(231,e,typeof a));return a}var _n=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Fs=!1;if(_n)try{var fi={};Object.defineProperty(fi,"passive",{get:function(){Fs=!0}}),window.addEventListener("test",fi,fi),window.removeEventListener("test",fi,fi)}catch{Fs=!1}var In=null,Ws=null,Yo=null;function ld(){if(Yo)return Yo;var t,e=Ws,a=e.length,i,s="value"in In?In.value:In.textContent,c=s.length;for(t=0;t<a&&e[t]===s[t];t++);var p=a-t;for(i=1;i<=p&&e[a-i]===s[c-i];i++);return Yo=s.slice(t,1<i?1-i:void 0)}function Vo(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Go(){return!0}function id(){return!1}function Se(t){function e(a,i,s,c,p){this._reactName=a,this._targetInst=s,this.type=i,this.nativeEvent=c,this.target=p,this.currentTarget=null;for(var b in t)t.hasOwnProperty(b)&&(a=t[b],this[b]=a?a(c):c[b]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Go:id,this.isPropagationStopped=id,this}return y(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Go)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Go)},persist:function(){},isPersistent:Go}),e}var Da={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xo=Se(Da),di=y({},Da,{view:0,detail:0}),tv=Se(di),Ps,tr,hi,Zo=y({},di,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nr,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==hi&&(hi&&t.type==="mousemove"?(Ps=t.screenX-hi.screenX,tr=t.screenY-hi.screenY):tr=Ps=0,hi=t),Ps)},movementY:function(t){return"movementY"in t?t.movementY:tr}}),od=Se(Zo),ev=y({},Zo,{dataTransfer:0}),nv=Se(ev),av=y({},di,{relatedTarget:0}),er=Se(av),lv=y({},Da,{animationName:0,elapsedTime:0,pseudoElement:0}),iv=Se(lv),ov=y({},Da,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),uv=Se(ov),sv=y({},Da,{data:0}),ud=Se(sv),rv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},cv={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},fv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function dv(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=fv[t])?!!e[t]:!1}function nr(){return dv}var hv=y({},di,{key:function(t){if(t.key){var e=rv[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=Vo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?cv[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nr,charCode:function(t){return t.type==="keypress"?Vo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Vo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),gv=Se(hv),mv=y({},Zo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sd=Se(mv),pv=y({},di,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nr}),yv=Se(pv),vv=y({},Da,{propertyName:0,elapsedTime:0,pseudoElement:0}),xv=Se(vv),Sv=y({},Zo,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),bv=Se(Sv),_v=y({},Da,{newState:0,oldState:0}),Ev=Se(_v),wv=[9,13,27,32],ar=_n&&"CompositionEvent"in window,gi=null;_n&&"documentMode"in document&&(gi=document.documentMode);var Nv=_n&&"TextEvent"in window&&!gi,rd=_n&&(!ar||gi&&8<gi&&11>=gi),cd=" ",fd=!1;function dd(t,e){switch(t){case"keyup":return wv.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hd(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ml=!1;function Mv(t,e){switch(t){case"compositionend":return hd(e);case"keypress":return e.which!==32?null:(fd=!0,cd);case"textInput":return t=e.data,t===cd&&fd?null:t;default:return null}}function Av(t,e){if(ml)return t==="compositionend"||!ar&&dd(t,e)?(t=ld(),Yo=Ws=In=null,ml=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1<e.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return rd&&e.locale!=="ko"?null:e.data;default:return null}}var Tv={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function gd(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!Tv[t.type]:e==="textarea"}function md(t,e,a,i){hl?gl?gl.push(i):gl=[i]:hl=i,e=Ru(e,"onChange"),0<e.length&&(a=new Xo("onChange","change",null,a,i),t.push({event:a,listeners:e}))}var mi=null,pi=null;function zv(t){Fg(t,0)}function Qo(t){var e=$n(t);if(Bo(e))return t}function pd(t,e){if(t==="change")return e}var yd=!1;if(_n){var lr;if(_n){var ir="oninput"in document;if(!ir){var vd=document.createElement("div");vd.setAttribute("oninput","return;"),ir=typeof vd.oninput=="function"}lr=ir}else lr=!1;yd=lr&&(!document.documentMode||9<document.documentMode)}function xd(){mi&&(mi.detachEvent("onpropertychange",Sd),pi=mi=null)}function Sd(t){if(t.propertyName==="value"&&Qo(pi)){var e=[];md(e,pi,t,Is(t)),ad(zv,e)}}function Cv(t,e,a){t==="focusin"?(xd(),mi=e,pi=a,mi.attachEvent("onpropertychange",Sd)):t==="focusout"&&xd()}function Dv(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Qo(pi)}function Ov(t,e){if(t==="click")return Qo(e)}function Rv(t,e){if(t==="input"||t==="change")return Qo(e)}function Hv(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Te=typeof Object.is=="function"?Object.is:Hv;function yi(t,e){if(Te(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var a=Object.keys(t),i=Object.keys(e);if(a.length!==i.length)return!1;for(i=0;i<a.length;i++){var s=a[i];if(!Ae.call(e,s)||!Te(t[s],e[s]))return!1}return!0}function bd(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function _d(t,e){var a=bd(t);t=0;for(var i;a;){if(a.nodeType===3){if(i=t+a.textContent.length,t<=e&&i>=e)return{node:a,offset:e-t};t=i}t:{for(;a;){if(a.nextSibling){a=a.nextSibling;break t}a=a.parentNode}a=void 0}a=bd(a)}}function Ed(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Ed(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function wd(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var e=za(t.document);e instanceof t.HTMLIFrameElement;){try{var a=typeof e.contentWindow.location.href=="string"}catch{a=!1}if(a)t=e.contentWindow;else break;e=za(t.document)}return e}function or(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}var jv=_n&&"documentMode"in document&&11>=document.documentMode,pl=null,ur=null,vi=null,sr=!1;function Nd(t,e,a){var i=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;sr||pl==null||pl!==za(i)||(i=pl,"selectionStart"in i&&or(i)?i={start:i.selectionStart,end:i.selectionEnd}:(i=(i.ownerDocument&&i.ownerDocument.defaultView||window).getSelection(),i={anchorNode:i.anchorNode,anchorOffset:i.anchorOffset,focusNode:i.focusNode,focusOffset:i.focusOffset}),vi&&yi(vi,i)||(vi=i,i=Ru(ur,"onSelect"),0<i.length&&(e=new Xo("onSelect","select",null,e,a),t.push({event:e,listeners:i}),e.target=pl)))}function Oa(t,e){var a={};return a[t.toLowerCase()]=e.toLowerCase(),a["Webkit"+t]="webkit"+e,a["Moz"+t]="moz"+e,a}var yl={animationend:Oa("Animation","AnimationEnd"),animationiteration:Oa("Animation","AnimationIteration"),animationstart:Oa("Animation","AnimationStart"),transitionrun:Oa("Transition","TransitionRun"),transitionstart:Oa("Transition","TransitionStart"),transitioncancel:Oa("Transition","TransitionCancel"),transitionend:Oa("Transition","TransitionEnd")},rr={},Md={};_n&&(Md=document.createElement("div").style,"AnimationEvent"in window||(delete yl.animationend.animation,delete yl.animationiteration.animation,delete yl.animationstart.animation),"TransitionEvent"in window||delete yl.transitionend.transition);function Ra(t){if(rr[t])return rr[t];if(!yl[t])return t;var e=yl[t],a;for(a in e)if(e.hasOwnProperty(a)&&a in Md)return rr[t]=e[a];return t}var Ad=Ra("animationend"),Td=Ra("animationiteration"),zd=Ra("animationstart"),Uv=Ra("transitionrun"),Bv=Ra("transitionstart"),qv=Ra("transitioncancel"),Cd=Ra("transitionend"),Dd=new Map,cr="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");cr.push("scrollEnd");function Ke(t,e){Dd.set(t,e),xn(e,[t])}var $o=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var e=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(e))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Be=[],vl=0,fr=0;function ko(){for(var t=vl,e=fr=vl=0;e<t;){var a=Be[e];Be[e++]=null;var i=Be[e];Be[e++]=null;var s=Be[e];Be[e++]=null;var c=Be[e];if(Be[e++]=null,i!==null&&s!==null){var p=i.pending;p===null?s.next=s:(s.next=p.next,p.next=s),i.pending=s}c!==0&&Od(a,s,c)}}function Ko(t,e,a,i){Be[vl++]=t,Be[vl++]=e,Be[vl++]=a,Be[vl++]=i,fr|=i,t.lanes|=i,t=t.alternate,t!==null&&(t.lanes|=i)}function dr(t,e,a,i){return Ko(t,e,a,i),Io(t)}function Ha(t,e){return Ko(t,null,null,e),Io(t)}function Od(t,e,a){t.lanes|=a;var i=t.alternate;i!==null&&(i.lanes|=a);for(var s=!1,c=t.return;c!==null;)c.childLanes|=a,i=c.alternate,i!==null&&(i.childLanes|=a),c.tag===22&&(t=c.stateNode,t===null||t._visibility&1||(s=!0)),t=c,c=c.return;return t.tag===3?(c=t.stateNode,s&&e!==null&&(s=31-pe(a),t=c.hiddenUpdates,i=t[s],i===null?t[s]=[e]:i.push(e),e.lane=a|536870912),c):null}function Io(t){if(50<Yi)throw Yi=0,bc=null,Error(u(185));for(var e=t.return;e!==null;)t=e,e=t.return;return t.tag===3?t.stateNode:null}var xl={};function Lv(t,e,a,i){this.tag=t,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=e,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 ze(t,e,a,i){return new Lv(t,e,a,i)}function hr(t){return t=t.prototype,!(!t||!t.isReactComponent)}function En(t,e){var a=t.alternate;return a===null?(a=ze(t.tag,e,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=e,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,e=t.dependencies,a.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function Rd(t,e){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=e,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,e=a.dependencies,t.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),t}function Jo(t,e,a,i,s,c){var p=0;if(i=t,typeof t=="function")hr(t)&&(p=1);else if(typeof t=="string")p=Z1(t,a,et.current)?26:t==="html"||t==="head"||t==="body"?27:5;else t:switch(t){case I:return t=ze(31,a,e,s),t.elementType=I,t.lanes=c,t;case T:return ja(a.children,s,c,e);case C:p=8,s|=24;break;case N:return t=ze(12,a,e,s|2),t.elementType=N,t.lanes=c,t;case Y:return t=ze(13,a,e,s),t.elementType=Y,t.lanes=c,t;case q:return t=ze(19,a,e,s),t.elementType=q,t.lanes=c,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case E:p=10;break t;case j:p=9;break t;case z:p=11;break t;case L:p=14;break t;case k:p=16,i=null;break t}p=29,a=Error(u(130,t===null?"null":typeof t,"")),i=null}return e=ze(p,a,e,s),e.elementType=t,e.type=i,e.lanes=c,e}function ja(t,e,a,i){return t=ze(7,t,i,e),t.lanes=a,t}function gr(t,e,a){return t=ze(6,t,null,e),t.lanes=a,t}function Hd(t){var e=ze(18,null,null,0);return e.stateNode=t,e}function mr(t,e,a){return e=ze(4,t.children!==null?t.children:[],t.key,e),e.lanes=a,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}var jd=new WeakMap;function qe(t,e){if(typeof t=="object"&&t!==null){var a=jd.get(t);return a!==void 0?a:(e={value:t,source:e,stack:Qe(e)},jd.set(t,e),e)}return{value:t,source:e,stack:Qe(e)}}var Sl=[],bl=0,Fo=null,xi=0,Le=[],Ye=0,Jn=null,on=1,un="";function wn(t,e){Sl[bl++]=xi,Sl[bl++]=Fo,Fo=t,xi=e}function Ud(t,e,a){Le[Ye++]=on,Le[Ye++]=un,Le[Ye++]=Jn,Jn=t;var i=on;t=un;var s=32-pe(i)-1;i&=~(1<<s),a+=1;var c=32-pe(e)+s;if(30<c){var p=s-s%5;c=(i&(1<<p)-1).toString(32),i>>=p,s-=p,on=1<<32-pe(e)+s|a<<s|i,un=c+t}else on=1<<c|a<<s|i,un=t}function pr(t){t.return!==null&&(wn(t,1),Ud(t,1,0))}function yr(t){for(;t===Fo;)Fo=Sl[--bl],Sl[bl]=null,xi=Sl[--bl],Sl[bl]=null;for(;t===Jn;)Jn=Le[--Ye],Le[Ye]=null,un=Le[--Ye],Le[Ye]=null,on=Le[--Ye],Le[Ye]=null}function Bd(t,e){Le[Ye++]=on,Le[Ye++]=un,Le[Ye++]=Jn,on=e.id,un=e.overflow,Jn=t}var re=null,Xt=null,Ct=!1,Fn=null,Ve=!1,vr=Error(u(519));function Wn(t){var e=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Si(qe(e,t)),vr}function qd(t){var e=t.stateNode,a=t.type,i=t.memoizedProps;switch(e[le]=t,e[he]=i,a){case"dialog":Mt("cancel",e),Mt("close",e);break;case"iframe":case"object":case"embed":Mt("load",e);break;case"video":case"audio":for(a=0;a<Gi.length;a++)Mt(Gi[a],e);break;case"source":Mt("error",e);break;case"img":case"image":case"link":Mt("error",e),Mt("load",e);break;case"details":Mt("toggle",e);break;case"input":Mt("invalid",e),qo(e,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Mt("invalid",e);break;case"textarea":Mt("invalid",e),Pf(e,i.value,i.defaultValue,i.children)}a=i.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||e.textContent===""+a||i.suppressHydrationWarning===!0||em(e.textContent,a)?(i.popover!=null&&(Mt("beforetoggle",e),Mt("toggle",e)),i.onScroll!=null&&Mt("scroll",e),i.onScrollEnd!=null&&Mt("scrollend",e),i.onClick!=null&&(e.onclick=bn),e=!0):e=!1,e||Wn(t,!0)}function Ld(t){for(re=t.return;re;)switch(re.tag){case 5:case 31:case 13:Ve=!1;return;case 27:case 3:Ve=!0;return;default:re=re.return}}function _l(t){if(t!==re)return!1;if(!Ct)return Ld(t),Ct=!0,!1;var e=t.tag,a;if((a=e!==3&&e!==27)&&((a=e===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||Uc(t.type,t.memoizedProps)),a=!a),a&&Xt&&Wn(t),Ld(t),e===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(u(317));Xt=cm(t)}else if(e===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(u(317));Xt=cm(t)}else e===27?(e=Xt,da(t.type)?(t=Vc,Vc=null,Xt=t):Xt=e):Xt=re?Xe(t.stateNode.nextSibling):null;return!0}function Ua(){Xt=re=null,Ct=!1}function xr(){var t=Fn;return t!==null&&(we===null?we=t:we.push.apply(we,t),Fn=null),t}function Si(t){Fn===null?Fn=[t]:Fn.push(t)}var Sr=A(null),Ba=null,Nn=null;function Pn(t,e,a){W(Sr,e._currentValue),e._currentValue=a}function Mn(t){t._currentValue=Sr.current,H(Sr)}function br(t,e,a){for(;t!==null;){var i=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,i!==null&&(i.childLanes|=e)):i!==null&&(i.childLanes&e)!==e&&(i.childLanes|=e),t===a)break;t=t.return}}function _r(t,e,a,i){var s=t.child;for(s!==null&&(s.return=t);s!==null;){var c=s.dependencies;if(c!==null){var p=s.child;c=c.firstContext;t:for(;c!==null;){var b=c;c=s;for(var O=0;O<e.length;O++)if(b.context===e[O]){c.lanes|=a,b=c.alternate,b!==null&&(b.lanes|=a),br(c.return,a,t),i||(p=null);break t}c=b.next}}else if(s.tag===18){if(p=s.return,p===null)throw Error(u(341));p.lanes|=a,c=p.alternate,c!==null&&(c.lanes|=a),br(p,a,t),p=null}else p=s.child;if(p!==null)p.return=s;else for(p=s;p!==null;){if(p===t){p=null;break}if(s=p.sibling,s!==null){s.return=p.return,p=s;break}p=p.return}s=p}}function El(t,e,a,i){t=null;for(var s=e,c=!1;s!==null;){if(!c){if((s.flags&524288)!==0)c=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var p=s.alternate;if(p===null)throw Error(u(387));if(p=p.memoizedProps,p!==null){var b=s.type;Te(s.pendingProps.value,p.value)||(t!==null?t.push(b):t=[b])}}else if(s===rt.current){if(p=s.alternate,p===null)throw Error(u(387));p.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(t!==null?t.push(ki):t=[ki])}s=s.return}t!==null&&_r(e,t,a,i),e.flags|=262144}function Wo(t){for(t=t.firstContext;t!==null;){if(!Te(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function qa(t){Ba=t,Nn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function ce(t){return Yd(Ba,t)}function Po(t,e){return Ba===null&&qa(t),Yd(t,e)}function Yd(t,e){var a=e._currentValue;if(e={context:e,memoizedValue:a,next:null},Nn===null){if(t===null)throw Error(u(308));Nn=e,t.dependencies={lanes:0,firstContext:e},t.flags|=524288}else Nn=Nn.next=e;return a}var Yv=typeof AbortController<"u"?AbortController:function(){var t=[],e=this.signal={aborted:!1,addEventListener:function(a,i){t.push(i)}};this.abort=function(){e.aborted=!0,t.forEach(function(a){return a()})}},Vv=n.unstable_scheduleCallback,Gv=n.unstable_NormalPriority,Pt={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Er(){return{controller:new Yv,data:new Map,refCount:0}}function bi(t){t.refCount--,t.refCount===0&&Vv(Gv,function(){t.controller.abort()})}var _i=null,wr=0,wl=0,Nl=null;function Xv(t,e){if(_i===null){var a=_i=[];wr=0,wl=Ac(),Nl={status:"pending",value:void 0,then:function(i){a.push(i)}}}return wr++,e.then(Vd,Vd),e}function Vd(){if(--wr===0&&_i!==null){Nl!==null&&(Nl.status="fulfilled");var t=_i;_i=null,wl=0,Nl=null;for(var e=0;e<t.length;e++)(0,t[e])()}}function Zv(t,e){var a=[],i={status:"pending",value:null,reason:null,then:function(s){a.push(s)}};return t.then(function(){i.status="fulfilled",i.value=e;for(var s=0;s<a.length;s++)(0,a[s])(e)},function(s){for(i.status="rejected",i.reason=s,s=0;s<a.length;s++)(0,a[s])(void 0)}),i}var Gd=M.S;M.S=function(t,e){Ng=se(),typeof e=="object"&&e!==null&&typeof e.then=="function"&&Xv(t,e),Gd!==null&&Gd(t,e)};var La=A(null);function Nr(){var t=La.current;return t!==null?t:Gt.pooledCache}function tu(t,e){e===null?W(La,La.current):W(La,e.pool)}function Xd(){var t=Nr();return t===null?null:{parent:Pt._currentValue,pool:t}}var Ml=Error(u(460)),Mr=Error(u(474)),eu=Error(u(542)),nu={then:function(){}};function Zd(t){return t=t.status,t==="fulfilled"||t==="rejected"}function Qd(t,e,a){switch(a=t[a],a===void 0?t.push(e):a!==e&&(e.then(bn,bn),e=a),e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,kd(t),t;default:if(typeof e.status=="string")e.then(bn,bn);else{if(t=Gt,t!==null&&100<t.shellSuspendCounter)throw Error(u(482));t=e,t.status="pending",t.then(function(i){if(e.status==="pending"){var s=e;s.status="fulfilled",s.value=i}},function(i){if(e.status==="pending"){var s=e;s.status="rejected",s.reason=i}})}switch(e.status){case"fulfilled":return e.value;case"rejected":throw t=e.reason,kd(t),t}throw Va=e,Ml}}function Ya(t){try{var e=t._init;return e(t._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Va=a,Ml):a}}var Va=null;function $d(){if(Va===null)throw Error(u(459));var t=Va;return Va=null,t}function kd(t){if(t===Ml||t===eu)throw Error(u(483))}var Al=null,Ei=0;function au(t){var e=Ei;return Ei+=1,Al===null&&(Al=[]),Qd(Al,t,e)}function wi(t,e){e=e.props.ref,t.ref=e!==void 0?e:null}function lu(t,e){throw e.$$typeof===x?Error(u(525)):(t=Object.prototype.toString.call(e),Error(u(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)))}function Kd(t){function e(V,U){if(t){var Z=V.deletions;Z===null?(V.deletions=[U],V.flags|=16):Z.push(U)}}function a(V,U){if(!t)return null;for(;U!==null;)e(V,U),U=U.sibling;return null}function i(V){for(var U=new Map;V!==null;)V.key!==null?U.set(V.key,V):U.set(V.index,V),V=V.sibling;return U}function s(V,U){return V=En(V,U),V.index=0,V.sibling=null,V}function c(V,U,Z){return V.index=Z,t?(Z=V.alternate,Z!==null?(Z=Z.index,Z<U?(V.flags|=67108866,U):Z):(V.flags|=67108866,U)):(V.flags|=1048576,U)}function p(V){return t&&V.alternate===null&&(V.flags|=67108866),V}function b(V,U,Z,at){return U===null||U.tag!==6?(U=gr(Z,V.mode,at),U.return=V,U):(U=s(U,Z),U.return=V,U)}function O(V,U,Z,at){var pt=Z.type;return pt===T?nt(V,U,Z.props.children,at,Z.key):U!==null&&(U.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===k&&Ya(pt)===U.type)?(U=s(U,Z.props),wi(U,Z),U.return=V,U):(U=Jo(Z.type,Z.key,Z.props,null,V.mode,at),wi(U,Z),U.return=V,U)}function Q(V,U,Z,at){return U===null||U.tag!==4||U.stateNode.containerInfo!==Z.containerInfo||U.stateNode.implementation!==Z.implementation?(U=mr(Z,V.mode,at),U.return=V,U):(U=s(U,Z.children||[]),U.return=V,U)}function nt(V,U,Z,at,pt){return U===null||U.tag!==7?(U=ja(Z,V.mode,at,pt),U.return=V,U):(U=s(U,Z),U.return=V,U)}function lt(V,U,Z){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=gr(""+U,V.mode,Z),U.return=V,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case S:return Z=Jo(U.type,U.key,U.props,null,V.mode,Z),wi(Z,U),Z.return=V,Z;case _:return U=mr(U,V.mode,Z),U.return=V,U;case k:return U=Ya(U),lt(V,U,Z)}if(G(U)||P(U))return U=ja(U,V.mode,Z,null),U.return=V,U;if(typeof U.then=="function")return lt(V,au(U),Z);if(U.$$typeof===E)return lt(V,Po(V,U),Z);lu(V,U)}return null}function K(V,U,Z,at){var pt=U!==null?U.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return pt!==null?null:b(V,U,""+Z,at);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:return Z.key===pt?O(V,U,Z,at):null;case _:return Z.key===pt?Q(V,U,Z,at):null;case k:return Z=Ya(Z),K(V,U,Z,at)}if(G(Z)||P(Z))return pt!==null?null:nt(V,U,Z,at,null);if(typeof Z.then=="function")return K(V,U,au(Z),at);if(Z.$$typeof===E)return K(V,U,Po(V,Z),at);lu(V,Z)}return null}function F(V,U,Z,at,pt){if(typeof at=="string"&&at!==""||typeof at=="number"||typeof at=="bigint")return V=V.get(Z)||null,b(U,V,""+at,pt);if(typeof at=="object"&&at!==null){switch(at.$$typeof){case S:return V=V.get(at.key===null?Z:at.key)||null,O(U,V,at,pt);case _:return V=V.get(at.key===null?Z:at.key)||null,Q(U,V,at,pt);case k:return at=Ya(at),F(V,U,Z,at,pt)}if(G(at)||P(at))return V=V.get(Z)||null,nt(U,V,at,pt,null);if(typeof at.then=="function")return F(V,U,Z,au(at),pt);if(at.$$typeof===E)return F(V,U,Z,Po(U,at),pt);lu(U,at)}return null}function dt(V,U,Z,at){for(var pt=null,Ot=null,gt=U,wt=U=0,zt=null;gt!==null&&wt<Z.length;wt++){gt.index>wt?(zt=gt,gt=null):zt=gt.sibling;var Rt=K(V,gt,Z[wt],at);if(Rt===null){gt===null&&(gt=zt);break}t&&gt&&Rt.alternate===null&&e(V,gt),U=c(Rt,U,wt),Ot===null?pt=Rt:Ot.sibling=Rt,Ot=Rt,gt=zt}if(wt===Z.length)return a(V,gt),Ct&&wn(V,wt),pt;if(gt===null){for(;wt<Z.length;wt++)gt=lt(V,Z[wt],at),gt!==null&&(U=c(gt,U,wt),Ot===null?pt=gt:Ot.sibling=gt,Ot=gt);return Ct&&wn(V,wt),pt}for(gt=i(gt);wt<Z.length;wt++)zt=F(gt,V,wt,Z[wt],at),zt!==null&&(t&&zt.alternate!==null&&gt.delete(zt.key===null?wt:zt.key),U=c(zt,U,wt),Ot===null?pt=zt:Ot.sibling=zt,Ot=zt);return t&&gt.forEach(function(ya){return e(V,ya)}),Ct&&wn(V,wt),pt}function vt(V,U,Z,at){if(Z==null)throw Error(u(151));for(var pt=null,Ot=null,gt=U,wt=U=0,zt=null,Rt=Z.next();gt!==null&&!Rt.done;wt++,Rt=Z.next()){gt.index>wt?(zt=gt,gt=null):zt=gt.sibling;var ya=K(V,gt,Rt.value,at);if(ya===null){gt===null&&(gt=zt);break}t&&gt&&ya.alternate===null&&e(V,gt),U=c(ya,U,wt),Ot===null?pt=ya:Ot.sibling=ya,Ot=ya,gt=zt}if(Rt.done)return a(V,gt),Ct&&wn(V,wt),pt;if(gt===null){for(;!Rt.done;wt++,Rt=Z.next())Rt=lt(V,Rt.value,at),Rt!==null&&(U=c(Rt,U,wt),Ot===null?pt=Rt:Ot.sibling=Rt,Ot=Rt);return Ct&&wn(V,wt),pt}for(gt=i(gt);!Rt.done;wt++,Rt=Z.next())Rt=F(gt,V,wt,Rt.value,at),Rt!==null&&(t&&Rt.alternate!==null&&gt.delete(Rt.key===null?wt:Rt.key),U=c(Rt,U,wt),Ot===null?pt=Rt:Ot.sibling=Rt,Ot=Rt);return t&&gt.forEach(function(ex){return e(V,ex)}),Ct&&wn(V,wt),pt}function Vt(V,U,Z,at){if(typeof Z=="object"&&Z!==null&&Z.type===T&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:t:{for(var pt=Z.key;U!==null;){if(U.key===pt){if(pt=Z.type,pt===T){if(U.tag===7){a(V,U.sibling),at=s(U,Z.props.children),at.return=V,V=at;break t}}else if(U.elementType===pt||typeof pt=="object"&&pt!==null&&pt.$$typeof===k&&Ya(pt)===U.type){a(V,U.sibling),at=s(U,Z.props),wi(at,Z),at.return=V,V=at;break t}a(V,U);break}else e(V,U);U=U.sibling}Z.type===T?(at=ja(Z.props.children,V.mode,at,Z.key),at.return=V,V=at):(at=Jo(Z.type,Z.key,Z.props,null,V.mode,at),wi(at,Z),at.return=V,V=at)}return p(V);case _:t:{for(pt=Z.key;U!==null;){if(U.key===pt)if(U.tag===4&&U.stateNode.containerInfo===Z.containerInfo&&U.stateNode.implementation===Z.implementation){a(V,U.sibling),at=s(U,Z.children||[]),at.return=V,V=at;break t}else{a(V,U);break}else e(V,U);U=U.sibling}at=mr(Z,V.mode,at),at.return=V,V=at}return p(V);case k:return Z=Ya(Z),Vt(V,U,Z,at)}if(G(Z))return dt(V,U,Z,at);if(P(Z)){if(pt=P(Z),typeof pt!="function")throw Error(u(150));return Z=pt.call(Z),vt(V,U,Z,at)}if(typeof Z.then=="function")return Vt(V,U,au(Z),at);if(Z.$$typeof===E)return Vt(V,U,Po(V,Z),at);lu(V,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,U!==null&&U.tag===6?(a(V,U.sibling),at=s(U,Z),at.return=V,V=at):(a(V,U),at=gr(Z,V.mode,at),at.return=V,V=at),p(V)):a(V,U)}return function(V,U,Z,at){try{Ei=0;var pt=Vt(V,U,Z,at);return Al=null,pt}catch(gt){if(gt===Ml||gt===eu)throw gt;var Ot=ze(29,gt,null,V.mode);return Ot.lanes=at,Ot.return=V,Ot}}}var Ga=Kd(!0),Id=Kd(!1),ta=!1;function Ar(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Tr(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ea(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function na(t,e,a){var i=t.updateQueue;if(i===null)return null;if(i=i.shared,(Ht&2)!==0){var s=i.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),i.pending=e,e=Io(t),Od(t,null,a),e}return Ko(t,i,e,a),Io(t)}function Ni(t,e,a){if(e=e.updateQueue,e!==null&&(e=e.shared,(a&4194048)!==0)){var i=e.lanes;i&=t.pendingLanes,a|=i,e.lanes=a,Ao(t,a)}}function zr(t,e){var a=t.updateQueue,i=t.alternate;if(i!==null&&(i=i.updateQueue,a===i)){var s=null,c=null;if(a=a.firstBaseUpdate,a!==null){do{var p={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};c===null?s=c=p:c=c.next=p,a=a.next}while(a!==null);c===null?s=c=e:c=c.next=e}else s=c=e;a={baseState:i.baseState,firstBaseUpdate:s,lastBaseUpdate:c,shared:i.shared,callbacks:i.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=e:t.next=e,a.lastBaseUpdate=e}var Cr=!1;function Mi(){if(Cr){var t=Nl;if(t!==null)throw t}}function Ai(t,e,a,i){Cr=!1;var s=t.updateQueue;ta=!1;var c=s.firstBaseUpdate,p=s.lastBaseUpdate,b=s.shared.pending;if(b!==null){s.shared.pending=null;var O=b,Q=O.next;O.next=null,p===null?c=Q:p.next=Q,p=O;var nt=t.alternate;nt!==null&&(nt=nt.updateQueue,b=nt.lastBaseUpdate,b!==p&&(b===null?nt.firstBaseUpdate=Q:b.next=Q,nt.lastBaseUpdate=O))}if(c!==null){var lt=s.baseState;p=0,nt=Q=O=null,b=c;do{var K=b.lane&-536870913,F=K!==b.lane;if(F?(Tt&K)===K:(i&K)===K){K!==0&&K===wl&&(Cr=!0),nt!==null&&(nt=nt.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});t:{var dt=t,vt=b;K=e;var Vt=a;switch(vt.tag){case 1:if(dt=vt.payload,typeof dt=="function"){lt=dt.call(Vt,lt,K);break t}lt=dt;break t;case 3:dt.flags=dt.flags&-65537|128;case 0:if(dt=vt.payload,K=typeof dt=="function"?dt.call(Vt,lt,K):dt,K==null)break t;lt=y({},lt,K);break t;case 2:ta=!0}}K=b.callback,K!==null&&(t.flags|=64,F&&(t.flags|=8192),F=s.callbacks,F===null?s.callbacks=[K]:F.push(K))}else F={lane:K,tag:b.tag,payload:b.payload,callback:b.callback,next:null},nt===null?(Q=nt=F,O=lt):nt=nt.next=F,p|=K;if(b=b.next,b===null){if(b=s.shared.pending,b===null)break;F=b,b=F.next,F.next=null,s.lastBaseUpdate=F,s.shared.pending=null}}while(!0);nt===null&&(O=lt),s.baseState=O,s.firstBaseUpdate=Q,s.lastBaseUpdate=nt,c===null&&(s.shared.lanes=0),ua|=p,t.lanes=p,t.memoizedState=lt}}function Jd(t,e){if(typeof t!="function")throw Error(u(191,t));t.call(e)}function Fd(t,e){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)Jd(a[t],e)}var Tl=A(null),iu=A(0);function Wd(t,e){t=jn,W(iu,t),W(Tl,e),jn=t|e.baseLanes}function Dr(){W(iu,jn),W(Tl,Tl.current)}function Or(){jn=iu.current,H(Tl),H(iu)}var Ce=A(null),Ge=null;function aa(t){var e=t.alternate;W(Jt,Jt.current&1),W(Ce,t),Ge===null&&(e===null||Tl.current!==null||e.memoizedState!==null)&&(Ge=t)}function Rr(t){W(Jt,Jt.current),W(Ce,t),Ge===null&&(Ge=t)}function Pd(t){t.tag===22?(W(Jt,Jt.current),W(Ce,t),Ge===null&&(Ge=t)):la()}function la(){W(Jt,Jt.current),W(Ce,Ce.current)}function De(t){H(Ce),Ge===t&&(Ge=null),H(Jt)}var Jt=A(0);function ou(t){for(var e=t;e!==null;){if(e.tag===13){var a=e.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Lc(a)||Yc(a)))return e}else if(e.tag===19&&(e.memoizedProps.revealOrder==="forwards"||e.memoizedProps.revealOrder==="backwards"||e.memoizedProps.revealOrder==="unstable_legacy-backwards"||e.memoizedProps.revealOrder==="together")){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var An=0,_t=null,Lt=null,te=null,uu=!1,zl=!1,Xa=!1,su=0,Ti=0,Cl=null,Qv=0;function Kt(){throw Error(u(321))}function Hr(t,e){if(e===null)return!1;for(var a=0;a<e.length&&a<t.length;a++)if(!Te(t[a],e[a]))return!1;return!0}function jr(t,e,a,i,s,c){return An=c,_t=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,M.H=t===null||t.memoizedState===null?Uh:Jr,Xa=!1,c=a(i,s),Xa=!1,zl&&(c=eh(e,a,i,s)),th(t),c}function th(t){M.H=Di;var e=Lt!==null&&Lt.next!==null;if(An=0,te=Lt=_t=null,uu=!1,Ti=0,Cl=null,e)throw Error(u(300));t===null||ee||(t=t.dependencies,t!==null&&Wo(t)&&(ee=!0))}function eh(t,e,a,i){_t=t;var s=0;do{if(zl&&(Cl=null),Ti=0,zl=!1,25<=s)throw Error(u(301));if(s+=1,te=Lt=null,t.updateQueue!=null){var c=t.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}M.H=Bh,c=e(a,i)}while(zl);return c}function $v(){var t=M.H,e=t.useState()[0];return e=typeof e.then=="function"?zi(e):e,t=t.useState()[0],(Lt!==null?Lt.memoizedState:null)!==t&&(_t.flags|=1024),e}function Ur(){var t=su!==0;return su=0,t}function Br(t,e,a){e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~a}function qr(t){if(uu){for(t=t.memoizedState;t!==null;){var e=t.queue;e!==null&&(e.pending=null),t=t.next}uu=!1}An=0,te=Lt=_t=null,zl=!1,Ti=su=0,Cl=null}function ye(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return te===null?_t.memoizedState=te=t:te=te.next=t,te}function Ft(){if(Lt===null){var t=_t.alternate;t=t!==null?t.memoizedState:null}else t=Lt.next;var e=te===null?_t.memoizedState:te.next;if(e!==null)te=e,Lt=t;else{if(t===null)throw _t.alternate===null?Error(u(467)):Error(u(310));Lt=t,t={memoizedState:Lt.memoizedState,baseState:Lt.baseState,baseQueue:Lt.baseQueue,queue:Lt.queue,next:null},te===null?_t.memoizedState=te=t:te=te.next=t}return te}function ru(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function zi(t){var e=Ti;return Ti+=1,Cl===null&&(Cl=[]),t=Qd(Cl,t,e),e=_t,(te===null?e.memoizedState:te.next)===null&&(e=e.alternate,M.H=e===null||e.memoizedState===null?Uh:Jr),t}function cu(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return zi(t);if(t.$$typeof===E)return ce(t)}throw Error(u(438,String(t)))}function Lr(t){var e=null,a=_t.updateQueue;if(a!==null&&(e=a.memoCache),e==null){var i=_t.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(e={data:i.data.map(function(s){return s.slice()}),index:0})))}if(e==null&&(e={data:[],index:0}),a===null&&(a=ru(),_t.updateQueue=a),a.memoCache=e,a=e.data[e.index],a===void 0)for(a=e.data[e.index]=Array(t),i=0;i<t;i++)a[i]=ot;return e.index++,a}function Tn(t,e){return typeof e=="function"?e(t):e}function fu(t){var e=Ft();return Yr(e,Lt,t)}function Yr(t,e,a){var i=t.queue;if(i===null)throw Error(u(311));i.lastRenderedReducer=a;var s=t.baseQueue,c=i.pending;if(c!==null){if(s!==null){var p=s.next;s.next=c.next,c.next=p}e.baseQueue=s=c,i.pending=null}if(c=t.baseState,s===null)t.memoizedState=c;else{e=s.next;var b=p=null,O=null,Q=e,nt=!1;do{var lt=Q.lane&-536870913;if(lt!==Q.lane?(Tt&lt)===lt:(An&lt)===lt){var K=Q.revertLane;if(K===0)O!==null&&(O=O.next={lane:0,revertLane:0,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),lt===wl&&(nt=!0);else if((An&K)===K){Q=Q.next,K===wl&&(nt=!0);continue}else lt={lane:0,revertLane:Q.revertLane,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},O===null?(b=O=lt,p=c):O=O.next=lt,_t.lanes|=K,ua|=K;lt=Q.action,Xa&&a(c,lt),c=Q.hasEagerState?Q.eagerState:a(c,lt)}else K={lane:lt,revertLane:Q.revertLane,gesture:Q.gesture,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},O===null?(b=O=K,p=c):O=O.next=K,_t.lanes|=lt,ua|=lt;Q=Q.next}while(Q!==null&&Q!==e);if(O===null?p=c:O.next=b,!Te(c,t.memoizedState)&&(ee=!0,nt&&(a=Nl,a!==null)))throw a;t.memoizedState=c,t.baseState=p,t.baseQueue=O,i.lastRenderedState=c}return s===null&&(i.lanes=0),[t.memoizedState,i.dispatch]}function Vr(t){var e=Ft(),a=e.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=t;var i=a.dispatch,s=a.pending,c=e.memoizedState;if(s!==null){a.pending=null;var p=s=s.next;do c=t(c,p.action),p=p.next;while(p!==s);Te(c,e.memoizedState)||(ee=!0),e.memoizedState=c,e.baseQueue===null&&(e.baseState=c),a.lastRenderedState=c}return[c,i]}function nh(t,e,a){var i=_t,s=Ft(),c=Ct;if(c){if(a===void 0)throw Error(u(407));a=a()}else a=e();var p=!Te((Lt||s).memoizedState,a);if(p&&(s.memoizedState=a,ee=!0),s=s.queue,Zr(ih.bind(null,i,s,t),[t]),s.getSnapshot!==e||p||te!==null&&te.memoizedState.tag&1){if(i.flags|=2048,Dl(9,{destroy:void 0},lh.bind(null,i,s,a,e),null),Gt===null)throw Error(u(349));c||(An&127)!==0||ah(i,e,a)}return a}function ah(t,e,a){t.flags|=16384,t={getSnapshot:e,value:a},e=_t.updateQueue,e===null?(e=ru(),_t.updateQueue=e,e.stores=[t]):(a=e.stores,a===null?e.stores=[t]:a.push(t))}function lh(t,e,a,i){e.value=a,e.getSnapshot=i,oh(e)&&uh(t)}function ih(t,e,a){return a(function(){oh(e)&&uh(t)})}function oh(t){var e=t.getSnapshot;t=t.value;try{var a=e();return!Te(t,a)}catch{return!0}}function uh(t){var e=Ha(t,2);e!==null&&Ne(e,t,2)}function Gr(t){var e=ye();if(typeof t=="function"){var a=t;if(t=a(),Xa){an(!0);try{a()}finally{an(!1)}}}return e.memoizedState=e.baseState=t,e.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tn,lastRenderedState:t},e}function sh(t,e,a,i){return t.baseState=a,Yr(t,Lt,typeof i=="function"?i:Tn)}function kv(t,e,a,i,s){if(gu(t))throw Error(u(485));if(t=e.action,t!==null){var c={payload:s,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(p){c.listeners.push(p)}};M.T!==null?a(!0):c.isTransition=!1,i(c),a=e.pending,a===null?(c.next=e.pending=c,rh(e,c)):(c.next=a.next,e.pending=a.next=c)}}function rh(t,e){var a=e.action,i=e.payload,s=t.state;if(e.isTransition){var c=M.T,p={};M.T=p;try{var b=a(s,i),O=M.S;O!==null&&O(p,b),ch(t,e,b)}catch(Q){Xr(t,e,Q)}finally{c!==null&&p.types!==null&&(c.types=p.types),M.T=c}}else try{c=a(s,i),ch(t,e,c)}catch(Q){Xr(t,e,Q)}}function ch(t,e,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(i){fh(t,e,i)},function(i){return Xr(t,e,i)}):fh(t,e,a)}function fh(t,e,a){e.status="fulfilled",e.value=a,dh(e),t.state=a,e=t.pending,e!==null&&(a=e.next,a===e?t.pending=null:(a=a.next,e.next=a,rh(t,a)))}function Xr(t,e,a){var i=t.pending;if(t.pending=null,i!==null){i=i.next;do e.status="rejected",e.reason=a,dh(e),e=e.next;while(e!==i)}t.action=null}function dh(t){t=t.listeners;for(var e=0;e<t.length;e++)(0,t[e])()}function hh(t,e){return e}function gh(t,e){if(Ct){var a=Gt.formState;if(a!==null){t:{var i=_t;if(Ct){if(Xt){e:{for(var s=Xt,c=Ve;s.nodeType!==8;){if(!c){s=null;break e}if(s=Xe(s.nextSibling),s===null){s=null;break e}}c=s.data,s=c==="F!"||c==="F"?s:null}if(s){Xt=Xe(s.nextSibling),i=s.data==="F!";break t}}Wn(i)}i=!1}i&&(e=a[0])}}return a=ye(),a.memoizedState=a.baseState=e,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hh,lastRenderedState:e},a.queue=i,a=Rh.bind(null,_t,i),i.dispatch=a,i=Gr(!1),c=Ir.bind(null,_t,!1,i.queue),i=ye(),s={state:e,dispatch:null,action:t,pending:null},i.queue=s,a=kv.bind(null,_t,s,c,a),s.dispatch=a,i.memoizedState=t,[e,a,!1]}function mh(t){var e=Ft();return ph(e,Lt,t)}function ph(t,e,a){if(e=Yr(t,e,hh)[0],t=fu(Tn)[0],typeof e=="object"&&e!==null&&typeof e.then=="function")try{var i=zi(e)}catch(p){throw p===Ml?eu:p}else i=e;e=Ft();var s=e.queue,c=s.dispatch;return a!==e.memoizedState&&(_t.flags|=2048,Dl(9,{destroy:void 0},Kv.bind(null,s,a),null)),[i,c,t]}function Kv(t,e){t.action=e}function yh(t){var e=Ft(),a=Lt;if(a!==null)return ph(e,a,t);Ft(),e=e.memoizedState,a=Ft();var i=a.queue.dispatch;return a.memoizedState=t,[e,i,!1]}function Dl(t,e,a,i){return t={tag:t,create:a,deps:i,inst:e,next:null},e=_t.updateQueue,e===null&&(e=ru(),_t.updateQueue=e),a=e.lastEffect,a===null?e.lastEffect=t.next=t:(i=a.next,a.next=t,t.next=i,e.lastEffect=t),t}function vh(){return Ft().memoizedState}function du(t,e,a,i){var s=ye();_t.flags|=t,s.memoizedState=Dl(1|e,{destroy:void 0},a,i===void 0?null:i)}function hu(t,e,a,i){var s=Ft();i=i===void 0?null:i;var c=s.memoizedState.inst;Lt!==null&&i!==null&&Hr(i,Lt.memoizedState.deps)?s.memoizedState=Dl(e,c,a,i):(_t.flags|=t,s.memoizedState=Dl(1|e,c,a,i))}function xh(t,e){du(8390656,8,t,e)}function Zr(t,e){hu(2048,8,t,e)}function Iv(t){_t.flags|=4;var e=_t.updateQueue;if(e===null)e=ru(),_t.updateQueue=e,e.events=[t];else{var a=e.events;a===null?e.events=[t]:a.push(t)}}function Sh(t){var e=Ft().memoizedState;return Iv({ref:e,nextImpl:t}),function(){if((Ht&2)!==0)throw Error(u(440));return e.impl.apply(void 0,arguments)}}function bh(t,e){return hu(4,2,t,e)}function _h(t,e){return hu(4,4,t,e)}function Eh(t,e){if(typeof e=="function"){t=t();var a=e(t);return function(){typeof a=="function"?a():e(null)}}if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function wh(t,e,a){a=a!=null?a.concat([t]):null,hu(4,4,Eh.bind(null,e,t),a)}function Qr(){}function Nh(t,e){var a=Ft();e=e===void 0?null:e;var i=a.memoizedState;return e!==null&&Hr(e,i[1])?i[0]:(a.memoizedState=[t,e],t)}function Mh(t,e){var a=Ft();e=e===void 0?null:e;var i=a.memoizedState;if(e!==null&&Hr(e,i[1]))return i[0];if(i=t(),Xa){an(!0);try{t()}finally{an(!1)}}return a.memoizedState=[i,e],i}function $r(t,e,a){return a===void 0||(An&1073741824)!==0&&(Tt&261930)===0?t.memoizedState=e:(t.memoizedState=a,t=Ag(),_t.lanes|=t,ua|=t,a)}function Ah(t,e,a,i){return Te(a,e)?a:Tl.current!==null?(t=$r(t,a,i),Te(t,e)||(ee=!0),t):(An&42)===0||(An&1073741824)!==0&&(Tt&261930)===0?(ee=!0,t.memoizedState=a):(t=Ag(),_t.lanes|=t,ua|=t,e)}function Th(t,e,a,i,s){var c=R.p;R.p=c!==0&&8>c?c:8;var p=M.T,b={};M.T=b,Ir(t,!1,e,a);try{var O=s(),Q=M.S;if(Q!==null&&Q(b,O),O!==null&&typeof O=="object"&&typeof O.then=="function"){var nt=Zv(O,i);Ci(t,e,nt,He(t))}else Ci(t,e,i,He(t))}catch(lt){Ci(t,e,{then:function(){},status:"rejected",reason:lt},He())}finally{R.p=c,p!==null&&b.types!==null&&(p.types=b.types),M.T=p}}function Jv(){}function kr(t,e,a,i){if(t.tag!==5)throw Error(u(476));var s=zh(t).queue;Th(t,s,e,B,a===null?Jv:function(){return Ch(t),a(i)})}function zh(t){var e=t.memoizedState;if(e!==null)return e;e={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tn,lastRenderedState:B},next:null};var a={};return e.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tn,lastRenderedState:a},next:null},t.memoizedState=e,t=t.alternate,t!==null&&(t.memoizedState=e),e}function Ch(t){var e=zh(t);e.next===null&&(e=t.alternate.memoizedState),Ci(t,e.next.queue,{},He())}function Kr(){return ce(ki)}function Dh(){return Ft().memoizedState}function Oh(){return Ft().memoizedState}function Fv(t){for(var e=t.return;e!==null;){switch(e.tag){case 24:case 3:var a=He();t=ea(a);var i=na(e,t,a);i!==null&&(Ne(i,e,a),Ni(i,e,a)),e={cache:Er()},t.payload=e;return}e=e.return}}function Wv(t,e,a){var i=He();a={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},gu(t)?Hh(e,a):(a=dr(t,e,a,i),a!==null&&(Ne(a,t,i),jh(a,e,i)))}function Rh(t,e,a){var i=He();Ci(t,e,a,i)}function Ci(t,e,a,i){var s={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(gu(t))Hh(e,s);else{var c=t.alternate;if(t.lanes===0&&(c===null||c.lanes===0)&&(c=e.lastRenderedReducer,c!==null))try{var p=e.lastRenderedState,b=c(p,a);if(s.hasEagerState=!0,s.eagerState=b,Te(b,p))return Ko(t,e,s,0),Gt===null&&ko(),!1}catch{}if(a=dr(t,e,s,i),a!==null)return Ne(a,t,i),jh(a,e,i),!0}return!1}function Ir(t,e,a,i){if(i={lane:2,revertLane:Ac(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},gu(t)){if(e)throw Error(u(479))}else e=dr(t,a,i,2),e!==null&&Ne(e,t,2)}function gu(t){var e=t.alternate;return t===_t||e!==null&&e===_t}function Hh(t,e){zl=uu=!0;var a=t.pending;a===null?e.next=e:(e.next=a.next,a.next=e),t.pending=e}function jh(t,e,a){if((a&4194048)!==0){var i=e.lanes;i&=t.pendingLanes,a|=i,e.lanes=a,Ao(t,a)}}var Di={readContext:ce,use:cu,useCallback:Kt,useContext:Kt,useEffect:Kt,useImperativeHandle:Kt,useLayoutEffect:Kt,useInsertionEffect:Kt,useMemo:Kt,useReducer:Kt,useRef:Kt,useState:Kt,useDebugValue:Kt,useDeferredValue:Kt,useTransition:Kt,useSyncExternalStore:Kt,useId:Kt,useHostTransitionStatus:Kt,useFormState:Kt,useActionState:Kt,useOptimistic:Kt,useMemoCache:Kt,useCacheRefresh:Kt};Di.useEffectEvent=Kt;var Uh={readContext:ce,use:cu,useCallback:function(t,e){return ye().memoizedState=[t,e===void 0?null:e],t},useContext:ce,useEffect:xh,useImperativeHandle:function(t,e,a){a=a!=null?a.concat([t]):null,du(4194308,4,Eh.bind(null,e,t),a)},useLayoutEffect:function(t,e){return du(4194308,4,t,e)},useInsertionEffect:function(t,e){du(4,2,t,e)},useMemo:function(t,e){var a=ye();e=e===void 0?null:e;var i=t();if(Xa){an(!0);try{t()}finally{an(!1)}}return a.memoizedState=[i,e],i},useReducer:function(t,e,a){var i=ye();if(a!==void 0){var s=a(e);if(Xa){an(!0);try{a(e)}finally{an(!1)}}}else s=e;return i.memoizedState=i.baseState=s,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:s},i.queue=t,t=t.dispatch=Wv.bind(null,_t,t),[i.memoizedState,t]},useRef:function(t){var e=ye();return t={current:t},e.memoizedState=t},useState:function(t){t=Gr(t);var e=t.queue,a=Rh.bind(null,_t,e);return e.dispatch=a,[t.memoizedState,a]},useDebugValue:Qr,useDeferredValue:function(t,e){var a=ye();return $r(a,t,e)},useTransition:function(){var t=Gr(!1);return t=Th.bind(null,_t,t.queue,!0,!1),ye().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,e,a){var i=_t,s=ye();if(Ct){if(a===void 0)throw Error(u(407));a=a()}else{if(a=e(),Gt===null)throw Error(u(349));(Tt&127)!==0||ah(i,e,a)}s.memoizedState=a;var c={value:a,getSnapshot:e};return s.queue=c,xh(ih.bind(null,i,c,t),[t]),i.flags|=2048,Dl(9,{destroy:void 0},lh.bind(null,i,c,a,e),null),a},useId:function(){var t=ye(),e=Gt.identifierPrefix;if(Ct){var a=un,i=on;a=(i&~(1<<32-pe(i)-1)).toString(32)+a,e="_"+e+"R_"+a,a=su++,0<a&&(e+="H"+a.toString(32)),e+="_"}else a=Qv++,e="_"+e+"r_"+a.toString(32)+"_";return t.memoizedState=e},useHostTransitionStatus:Kr,useFormState:gh,useActionState:gh,useOptimistic:function(t){var e=ye();e.memoizedState=e.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return e.queue=a,e=Ir.bind(null,_t,!0,a),a.dispatch=e,[t,e]},useMemoCache:Lr,useCacheRefresh:function(){return ye().memoizedState=Fv.bind(null,_t)},useEffectEvent:function(t){var e=ye(),a={impl:t};return e.memoizedState=a,function(){if((Ht&2)!==0)throw Error(u(440));return a.impl.apply(void 0,arguments)}}},Jr={readContext:ce,use:cu,useCallback:Nh,useContext:ce,useEffect:Zr,useImperativeHandle:wh,useInsertionEffect:bh,useLayoutEffect:_h,useMemo:Mh,useReducer:fu,useRef:vh,useState:function(){return fu(Tn)},useDebugValue:Qr,useDeferredValue:function(t,e){var a=Ft();return Ah(a,Lt.memoizedState,t,e)},useTransition:function(){var t=fu(Tn)[0],e=Ft().memoizedState;return[typeof t=="boolean"?t:zi(t),e]},useSyncExternalStore:nh,useId:Dh,useHostTransitionStatus:Kr,useFormState:mh,useActionState:mh,useOptimistic:function(t,e){var a=Ft();return sh(a,Lt,t,e)},useMemoCache:Lr,useCacheRefresh:Oh};Jr.useEffectEvent=Sh;var Bh={readContext:ce,use:cu,useCallback:Nh,useContext:ce,useEffect:Zr,useImperativeHandle:wh,useInsertionEffect:bh,useLayoutEffect:_h,useMemo:Mh,useReducer:Vr,useRef:vh,useState:function(){return Vr(Tn)},useDebugValue:Qr,useDeferredValue:function(t,e){var a=Ft();return Lt===null?$r(a,t,e):Ah(a,Lt.memoizedState,t,e)},useTransition:function(){var t=Vr(Tn)[0],e=Ft().memoizedState;return[typeof t=="boolean"?t:zi(t),e]},useSyncExternalStore:nh,useId:Dh,useHostTransitionStatus:Kr,useFormState:yh,useActionState:yh,useOptimistic:function(t,e){var a=Ft();return Lt!==null?sh(a,Lt,t,e):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:Lr,useCacheRefresh:Oh};Bh.useEffectEvent=Sh;function Fr(t,e,a,i){e=t.memoizedState,a=a(i,e),a=a==null?e:y({},e,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var Wr={enqueueSetState:function(t,e,a){t=t._reactInternals;var i=He(),s=ea(i);s.payload=e,a!=null&&(s.callback=a),e=na(t,s,i),e!==null&&(Ne(e,t,i),Ni(e,t,i))},enqueueReplaceState:function(t,e,a){t=t._reactInternals;var i=He(),s=ea(i);s.tag=1,s.payload=e,a!=null&&(s.callback=a),e=na(t,s,i),e!==null&&(Ne(e,t,i),Ni(e,t,i))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var a=He(),i=ea(a);i.tag=2,e!=null&&(i.callback=e),e=na(t,i,a),e!==null&&(Ne(e,t,a),Ni(e,t,a))}};function qh(t,e,a,i,s,c,p){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(i,c,p):e.prototype&&e.prototype.isPureReactComponent?!yi(a,i)||!yi(s,c):!0}function Lh(t,e,a,i){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(a,i),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(a,i),e.state!==t&&Wr.enqueueReplaceState(e,e.state,null)}function Za(t,e){var a=e;if("ref"in e){a={};for(var i in e)i!=="ref"&&(a[i]=e[i])}if(t=t.defaultProps){a===e&&(a=y({},a));for(var s in t)a[s]===void 0&&(a[s]=t[s])}return a}function Yh(t){$o(t)}function Vh(t){console.error(t)}function Gh(t){$o(t)}function mu(t,e){try{var a=t.onUncaughtError;a(e.value,{componentStack:e.stack})}catch(i){setTimeout(function(){throw i})}}function Xh(t,e,a){try{var i=t.onCaughtError;i(a.value,{componentStack:a.stack,errorBoundary:e.tag===1?e.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Pr(t,e,a){return a=ea(a),a.tag=3,a.payload={element:null},a.callback=function(){mu(t,e)},a}function Zh(t){return t=ea(t),t.tag=3,t}function Qh(t,e,a,i){var s=a.type.getDerivedStateFromError;if(typeof s=="function"){var c=i.value;t.payload=function(){return s(c)},t.callback=function(){Xh(e,a,i)}}var p=a.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(t.callback=function(){Xh(e,a,i),typeof s!="function"&&(sa===null?sa=new Set([this]):sa.add(this));var b=i.stack;this.componentDidCatch(i.value,{componentStack:b!==null?b:""})})}function Pv(t,e,a,i,s){if(a.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(e=a.alternate,e!==null&&El(e,a,s,!0),a=Ce.current,a!==null){switch(a.tag){case 31:case 13:return Ge===null?Au():a.alternate===null&&It===0&&(It=3),a.flags&=-257,a.flags|=65536,a.lanes=s,i===nu?a.flags|=16384:(e=a.updateQueue,e===null?a.updateQueue=new Set([i]):e.add(i),wc(t,i,s)),!1;case 22:return a.flags|=65536,i===nu?a.flags|=16384:(e=a.updateQueue,e===null?(e={transitions:null,markerInstances:null,retryQueue:new Set([i])},a.updateQueue=e):(a=e.retryQueue,a===null?e.retryQueue=new Set([i]):a.add(i)),wc(t,i,s)),!1}throw Error(u(435,a.tag))}return wc(t,i,s),Au(),!1}if(Ct)return e=Ce.current,e!==null?((e.flags&65536)===0&&(e.flags|=256),e.flags|=65536,e.lanes=s,i!==vr&&(t=Error(u(422),{cause:i}),Si(qe(t,a)))):(i!==vr&&(e=Error(u(423),{cause:i}),Si(qe(e,a))),t=t.current.alternate,t.flags|=65536,s&=-s,t.lanes|=s,i=qe(i,a),s=Pr(t.stateNode,i,s),zr(t,s),It!==4&&(It=2)),!1;var c=Error(u(520),{cause:i});if(c=qe(c,a),Li===null?Li=[c]:Li.push(c),It!==4&&(It=2),e===null)return!0;i=qe(i,a),a=e;do{switch(a.tag){case 3:return a.flags|=65536,t=s&-s,a.lanes|=t,t=Pr(a.stateNode,i,t),zr(a,t),!1;case 1:if(e=a.type,c=a.stateNode,(a.flags&128)===0&&(typeof e.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(sa===null||!sa.has(c))))return a.flags|=65536,s&=-s,a.lanes|=s,s=Zh(s),Qh(s,t,a,i),zr(a,s),!1}a=a.return}while(a!==null);return!1}var tc=Error(u(461)),ee=!1;function fe(t,e,a,i){e.child=t===null?Id(e,null,a,i):Ga(e,t.child,a,i)}function $h(t,e,a,i,s){a=a.render;var c=e.ref;if("ref"in i){var p={};for(var b in i)b!=="ref"&&(p[b]=i[b])}else p=i;return qa(e),i=jr(t,e,a,p,c,s),b=Ur(),t!==null&&!ee?(Br(t,e,s),zn(t,e,s)):(Ct&&b&&pr(e),e.flags|=1,fe(t,e,i,s),e.child)}function kh(t,e,a,i,s){if(t===null){var c=a.type;return typeof c=="function"&&!hr(c)&&c.defaultProps===void 0&&a.compare===null?(e.tag=15,e.type=c,Kh(t,e,c,i,s)):(t=Jo(a.type,null,i,e,e.mode,s),t.ref=e.ref,t.return=e,e.child=t)}if(c=t.child,!sc(t,s)){var p=c.memoizedProps;if(a=a.compare,a=a!==null?a:yi,a(p,i)&&t.ref===e.ref)return zn(t,e,s)}return e.flags|=1,t=En(c,i),t.ref=e.ref,t.return=e,e.child=t}function Kh(t,e,a,i,s){if(t!==null){var c=t.memoizedProps;if(yi(c,i)&&t.ref===e.ref)if(ee=!1,e.pendingProps=i=c,sc(t,s))(t.flags&131072)!==0&&(ee=!0);else return e.lanes=t.lanes,zn(t,e,s)}return ec(t,e,a,i,s)}function Ih(t,e,a,i){var s=i.children,c=t!==null?t.memoizedState:null;if(t===null&&e.stateNode===null&&(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((e.flags&128)!==0){if(c=c!==null?c.baseLanes|a:a,t!==null){for(i=e.child=t.child,s=0;i!==null;)s=s|i.lanes|i.childLanes,i=i.sibling;i=s&~c}else i=0,e.child=null;return Jh(t,e,c,a,i)}if((a&536870912)!==0)e.memoizedState={baseLanes:0,cachePool:null},t!==null&&tu(e,c!==null?c.cachePool:null),c!==null?Wd(e,c):Dr(),Pd(e);else return i=e.lanes=536870912,Jh(t,e,c!==null?c.baseLanes|a:a,a,i)}else c!==null?(tu(e,c.cachePool),Wd(e,c),la(),e.memoizedState=null):(t!==null&&tu(e,null),Dr(),la());return fe(t,e,s,a),e.child}function Oi(t,e){return t!==null&&t.tag===22||e.stateNode!==null||(e.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),e.sibling}function Jh(t,e,a,i,s){var c=Nr();return c=c===null?null:{parent:Pt._currentValue,pool:c},e.memoizedState={baseLanes:a,cachePool:c},t!==null&&tu(e,null),Dr(),Pd(e),t!==null&&El(t,e,i,!0),e.childLanes=s,null}function pu(t,e){return e=vu({mode:e.mode,children:e.children},t.mode),e.ref=t.ref,t.child=e,e.return=t,e}function Fh(t,e,a){return Ga(e,t.child,null,a),t=pu(e,e.pendingProps),t.flags|=2,De(e),e.memoizedState=null,t}function t1(t,e,a){var i=e.pendingProps,s=(e.flags&128)!==0;if(e.flags&=-129,t===null){if(Ct){if(i.mode==="hidden")return t=pu(e,i),e.lanes=536870912,Oi(null,t);if(Rr(e),(t=Xt)?(t=rm(t,Ve),t=t!==null&&t.data==="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Jn!==null?{id:on,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=Hd(t),a.return=e,e.child=a,re=e,Xt=null)):t=null,t===null)throw Wn(e);return e.lanes=536870912,null}return pu(e,i)}var c=t.memoizedState;if(c!==null){var p=c.dehydrated;if(Rr(e),s)if(e.flags&256)e.flags&=-257,e=Fh(t,e,a);else if(e.memoizedState!==null)e.child=t.child,e.flags|=128,e=null;else throw Error(u(558));else if(ee||El(t,e,a,!1),s=(a&t.childLanes)!==0,ee||s){if(i=Gt,i!==null&&(p=To(i,a),p!==0&&p!==c.retryLane))throw c.retryLane=p,Ha(t,p),Ne(i,t,p),tc;Au(),e=Fh(t,e,a)}else t=c.treeContext,Xt=Xe(p.nextSibling),re=e,Ct=!0,Fn=null,Ve=!1,t!==null&&Bd(e,t),e=pu(e,i),e.flags|=4096;return e}return t=En(t.child,{mode:i.mode,children:i.children}),t.ref=e.ref,e.child=t,t.return=e,t}function yu(t,e){var a=e.ref;if(a===null)t!==null&&t.ref!==null&&(e.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(u(284));(t===null||t.ref!==a)&&(e.flags|=4194816)}}function ec(t,e,a,i,s){return qa(e),a=jr(t,e,a,i,void 0,s),i=Ur(),t!==null&&!ee?(Br(t,e,s),zn(t,e,s)):(Ct&&i&&pr(e),e.flags|=1,fe(t,e,a,s),e.child)}function Wh(t,e,a,i,s,c){return qa(e),e.updateQueue=null,a=eh(e,i,a,s),th(t),i=Ur(),t!==null&&!ee?(Br(t,e,c),zn(t,e,c)):(Ct&&i&&pr(e),e.flags|=1,fe(t,e,a,c),e.child)}function Ph(t,e,a,i,s){if(qa(e),e.stateNode===null){var c=xl,p=a.contextType;typeof p=="object"&&p!==null&&(c=ce(p)),c=new a(i,c),e.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Wr,e.stateNode=c,c._reactInternals=e,c=e.stateNode,c.props=i,c.state=e.memoizedState,c.refs={},Ar(e),p=a.contextType,c.context=typeof p=="object"&&p!==null?ce(p):xl,c.state=e.memoizedState,p=a.getDerivedStateFromProps,typeof p=="function"&&(Fr(e,a,p,i),c.state=e.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(p=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),p!==c.state&&Wr.enqueueReplaceState(c,c.state,null),Ai(e,i,c,s),Mi(),c.state=e.memoizedState),typeof c.componentDidMount=="function"&&(e.flags|=4194308),i=!0}else if(t===null){c=e.stateNode;var b=e.memoizedProps,O=Za(a,b);c.props=O;var Q=c.context,nt=a.contextType;p=xl,typeof nt=="object"&&nt!==null&&(p=ce(nt));var lt=a.getDerivedStateFromProps;nt=typeof lt=="function"||typeof c.getSnapshotBeforeUpdate=="function",b=e.pendingProps!==b,nt||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(b||Q!==p)&&Lh(e,c,i,p),ta=!1;var K=e.memoizedState;c.state=K,Ai(e,i,c,s),Mi(),Q=e.memoizedState,b||K!==Q||ta?(typeof lt=="function"&&(Fr(e,a,lt,i),Q=e.memoizedState),(O=ta||qh(e,a,O,i,K,Q,p))?(nt||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(e.flags|=4194308)):(typeof c.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=i,e.memoizedState=Q),c.props=i,c.state=Q,c.context=p,i=O):(typeof c.componentDidMount=="function"&&(e.flags|=4194308),i=!1)}else{c=e.stateNode,Tr(t,e),p=e.memoizedProps,nt=Za(a,p),c.props=nt,lt=e.pendingProps,K=c.context,Q=a.contextType,O=xl,typeof Q=="object"&&Q!==null&&(O=ce(Q)),b=a.getDerivedStateFromProps,(Q=typeof b=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(p!==lt||K!==O)&&Lh(e,c,i,O),ta=!1,K=e.memoizedState,c.state=K,Ai(e,i,c,s),Mi();var F=e.memoizedState;p!==lt||K!==F||ta||t!==null&&t.dependencies!==null&&Wo(t.dependencies)?(typeof b=="function"&&(Fr(e,a,b,i),F=e.memoizedState),(nt=ta||qh(e,a,nt,i,K,F,O)||t!==null&&t.dependencies!==null&&Wo(t.dependencies))?(Q||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(i,F,O),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(i,F,O)),typeof c.componentDidUpdate=="function"&&(e.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof c.componentDidUpdate!="function"||p===t.memoizedProps&&K===t.memoizedState||(e.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||p===t.memoizedProps&&K===t.memoizedState||(e.flags|=1024),e.memoizedProps=i,e.memoizedState=F),c.props=i,c.state=F,c.context=O,i=nt):(typeof c.componentDidUpdate!="function"||p===t.memoizedProps&&K===t.memoizedState||(e.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||p===t.memoizedProps&&K===t.memoizedState||(e.flags|=1024),i=!1)}return c=i,yu(t,e),i=(e.flags&128)!==0,c||i?(c=e.stateNode,a=i&&typeof a.getDerivedStateFromError!="function"?null:c.render(),e.flags|=1,t!==null&&i?(e.child=Ga(e,t.child,null,s),e.child=Ga(e,null,a,s)):fe(t,e,a,s),e.memoizedState=c.state,t=e.child):t=zn(t,e,s),t}function tg(t,e,a,i){return Ua(),e.flags|=256,fe(t,e,a,i),e.child}var nc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ac(t){return{baseLanes:t,cachePool:Xd()}}function lc(t,e,a){return t=t!==null?t.childLanes&~a:0,e&&(t|=Re),t}function eg(t,e,a){var i=e.pendingProps,s=!1,c=(e.flags&128)!==0,p;if((p=c)||(p=t!==null&&t.memoizedState===null?!1:(Jt.current&2)!==0),p&&(s=!0,e.flags&=-129),p=(e.flags&32)!==0,e.flags&=-33,t===null){if(Ct){if(s?aa(e):la(),(t=Xt)?(t=rm(t,Ve),t=t!==null&&t.data!=="&"?t:null,t!==null&&(e.memoizedState={dehydrated:t,treeContext:Jn!==null?{id:on,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=Hd(t),a.return=e,e.child=a,re=e,Xt=null)):t=null,t===null)throw Wn(e);return Yc(t)?e.lanes=32:e.lanes=536870912,null}var b=i.children;return i=i.fallback,s?(la(),s=e.mode,b=vu({mode:"hidden",children:b},s),i=ja(i,s,a,null),b.return=e,i.return=e,b.sibling=i,e.child=b,i=e.child,i.memoizedState=ac(a),i.childLanes=lc(t,p,a),e.memoizedState=nc,Oi(null,i)):(aa(e),ic(e,b))}var O=t.memoizedState;if(O!==null&&(b=O.dehydrated,b!==null)){if(c)e.flags&256?(aa(e),e.flags&=-257,e=oc(t,e,a)):e.memoizedState!==null?(la(),e.child=t.child,e.flags|=128,e=null):(la(),b=i.fallback,s=e.mode,i=vu({mode:"visible",children:i.children},s),b=ja(b,s,a,null),b.flags|=2,i.return=e,b.return=e,i.sibling=b,e.child=i,Ga(e,t.child,null,a),i=e.child,i.memoizedState=ac(a),i.childLanes=lc(t,p,a),e.memoizedState=nc,e=Oi(null,i));else if(aa(e),Yc(b)){if(p=b.nextSibling&&b.nextSibling.dataset,p)var Q=p.dgst;p=Q,i=Error(u(419)),i.stack="",i.digest=p,Si({value:i,source:null,stack:null}),e=oc(t,e,a)}else if(ee||El(t,e,a,!1),p=(a&t.childLanes)!==0,ee||p){if(p=Gt,p!==null&&(i=To(p,a),i!==0&&i!==O.retryLane))throw O.retryLane=i,Ha(t,i),Ne(p,t,i),tc;Lc(b)||Au(),e=oc(t,e,a)}else Lc(b)?(e.flags|=192,e.child=t.child,e=null):(t=O.treeContext,Xt=Xe(b.nextSibling),re=e,Ct=!0,Fn=null,Ve=!1,t!==null&&Bd(e,t),e=ic(e,i.children),e.flags|=4096);return e}return s?(la(),b=i.fallback,s=e.mode,O=t.child,Q=O.sibling,i=En(O,{mode:"hidden",children:i.children}),i.subtreeFlags=O.subtreeFlags&65011712,Q!==null?b=En(Q,b):(b=ja(b,s,a,null),b.flags|=2),b.return=e,i.return=e,i.sibling=b,e.child=i,Oi(null,i),i=e.child,b=t.child.memoizedState,b===null?b=ac(a):(s=b.cachePool,s!==null?(O=Pt._currentValue,s=s.parent!==O?{parent:O,pool:O}:s):s=Xd(),b={baseLanes:b.baseLanes|a,cachePool:s}),i.memoizedState=b,i.childLanes=lc(t,p,a),e.memoizedState=nc,Oi(t.child,i)):(aa(e),a=t.child,t=a.sibling,a=En(a,{mode:"visible",children:i.children}),a.return=e,a.sibling=null,t!==null&&(p=e.deletions,p===null?(e.deletions=[t],e.flags|=16):p.push(t)),e.child=a,e.memoizedState=null,a)}function ic(t,e){return e=vu({mode:"visible",children:e},t.mode),e.return=t,t.child=e}function vu(t,e){return t=ze(22,t,null,e),t.lanes=0,t}function oc(t,e,a){return Ga(e,t.child,null,a),t=ic(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function ng(t,e,a){t.lanes|=e;var i=t.alternate;i!==null&&(i.lanes|=e),br(t.return,e,a)}function uc(t,e,a,i,s,c){var p=t.memoizedState;p===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:i,tail:a,tailMode:s,treeForkCount:c}:(p.isBackwards=e,p.rendering=null,p.renderingStartTime=0,p.last=i,p.tail=a,p.tailMode=s,p.treeForkCount=c)}function ag(t,e,a){var i=e.pendingProps,s=i.revealOrder,c=i.tail;i=i.children;var p=Jt.current,b=(p&2)!==0;if(b?(p=p&1|2,e.flags|=128):p&=1,W(Jt,p),fe(t,e,i,a),i=Ct?xi:0,!b&&t!==null&&(t.flags&128)!==0)t:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&ng(t,a,e);else if(t.tag===19)ng(t,a,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break t;for(;t.sibling===null;){if(t.return===null||t.return===e)break t;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(s){case"forwards":for(a=e.child,s=null;a!==null;)t=a.alternate,t!==null&&ou(t)===null&&(s=a),a=a.sibling;a=s,a===null?(s=e.child,e.child=null):(s=a.sibling,a.sibling=null),uc(e,!1,s,a,c,i);break;case"backwards":case"unstable_legacy-backwards":for(a=null,s=e.child,e.child=null;s!==null;){if(t=s.alternate,t!==null&&ou(t)===null){e.child=s;break}t=s.sibling,s.sibling=a,a=s,s=t}uc(e,!0,a,null,c,i);break;case"together":uc(e,!1,null,null,void 0,i);break;default:e.memoizedState=null}return e.child}function zn(t,e,a){if(t!==null&&(e.dependencies=t.dependencies),ua|=e.lanes,(a&e.childLanes)===0)if(t!==null){if(El(t,e,a,!1),(a&e.childLanes)===0)return null}else return null;if(t!==null&&e.child!==t.child)throw Error(u(153));if(e.child!==null){for(t=e.child,a=En(t,t.pendingProps),e.child=a,a.return=e;t.sibling!==null;)t=t.sibling,a=a.sibling=En(t,t.pendingProps),a.return=e;a.sibling=null}return e.child}function sc(t,e){return(t.lanes&e)!==0?!0:(t=t.dependencies,!!(t!==null&&Wo(t)))}function e1(t,e,a){switch(e.tag){case 3:ut(e,e.stateNode.containerInfo),Pn(e,Pt,t.memoizedState.cache),Ua();break;case 27:case 5:Et(e);break;case 4:ut(e,e.stateNode.containerInfo);break;case 10:Pn(e,e.type,e.memoizedProps.value);break;case 31:if(e.memoizedState!==null)return e.flags|=128,Rr(e),null;break;case 13:var i=e.memoizedState;if(i!==null)return i.dehydrated!==null?(aa(e),e.flags|=128,null):(a&e.child.childLanes)!==0?eg(t,e,a):(aa(e),t=zn(t,e,a),t!==null?t.sibling:null);aa(e);break;case 19:var s=(t.flags&128)!==0;if(i=(a&e.childLanes)!==0,i||(El(t,e,a,!1),i=(a&e.childLanes)!==0),s){if(i)return ag(t,e,a);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),W(Jt,Jt.current),i)break;return null;case 22:return e.lanes=0,Ih(t,e,a,e.pendingProps);case 24:Pn(e,Pt,t.memoizedState.cache)}return zn(t,e,a)}function lg(t,e,a){if(t!==null)if(t.memoizedProps!==e.pendingProps)ee=!0;else{if(!sc(t,a)&&(e.flags&128)===0)return ee=!1,e1(t,e,a);ee=(t.flags&131072)!==0}else ee=!1,Ct&&(e.flags&1048576)!==0&&Ud(e,xi,e.index);switch(e.lanes=0,e.tag){case 16:t:{var i=e.pendingProps;if(t=Ya(e.elementType),e.type=t,typeof t=="function")hr(t)?(i=Za(t,i),e.tag=1,e=Ph(null,e,t,i,a)):(e.tag=0,e=ec(null,e,t,i,a));else{if(t!=null){var s=t.$$typeof;if(s===z){e.tag=11,e=$h(null,e,t,i,a);break t}else if(s===L){e.tag=14,e=kh(null,e,t,i,a);break t}}throw e=D(t)||t,Error(u(306,e,""))}}return e;case 0:return ec(t,e,e.type,e.pendingProps,a);case 1:return i=e.type,s=Za(i,e.pendingProps),Ph(t,e,i,s,a);case 3:t:{if(ut(e,e.stateNode.containerInfo),t===null)throw Error(u(387));i=e.pendingProps;var c=e.memoizedState;s=c.element,Tr(t,e),Ai(e,i,null,a);var p=e.memoizedState;if(i=p.cache,Pn(e,Pt,i),i!==c.cache&&_r(e,[Pt],a,!0),Mi(),i=p.element,c.isDehydrated)if(c={element:i,isDehydrated:!1,cache:p.cache},e.updateQueue.baseState=c,e.memoizedState=c,e.flags&256){e=tg(t,e,i,a);break t}else if(i!==s){s=qe(Error(u(424)),e),Si(s),e=tg(t,e,i,a);break t}else for(t=e.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Xt=Xe(t.firstChild),re=e,Ct=!0,Fn=null,Ve=!0,a=Id(e,null,i,a),e.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Ua(),i===s){e=zn(t,e,a);break t}fe(t,e,i,a)}e=e.child}return e;case 26:return yu(t,e),t===null?(a=mm(e.type,null,e.pendingProps,null))?e.memoizedState=a:Ct||(a=e.type,t=e.pendingProps,i=Hu(ct.current).createElement(a),i[le]=e,i[he]=t,de(i,a,t),Wt(i),e.stateNode=i):e.memoizedState=mm(e.type,t.memoizedProps,e.pendingProps,t.memoizedState),null;case 27:return Et(e),t===null&&Ct&&(i=e.stateNode=dm(e.type,e.pendingProps,ct.current),re=e,Ve=!0,s=Xt,da(e.type)?(Vc=s,Xt=Xe(i.firstChild)):Xt=s),fe(t,e,e.pendingProps.children,a),yu(t,e),t===null&&(e.flags|=4194304),e.child;case 5:return t===null&&Ct&&((s=i=Xt)&&(i=D1(i,e.type,e.pendingProps,Ve),i!==null?(e.stateNode=i,re=e,Xt=Xe(i.firstChild),Ve=!1,s=!0):s=!1),s||Wn(e)),Et(e),s=e.type,c=e.pendingProps,p=t!==null?t.memoizedProps:null,i=c.children,Uc(s,c)?i=null:p!==null&&Uc(s,p)&&(e.flags|=32),e.memoizedState!==null&&(s=jr(t,e,$v,null,null,a),ki._currentValue=s),yu(t,e),fe(t,e,i,a),e.child;case 6:return t===null&&Ct&&((t=a=Xt)&&(a=O1(a,e.pendingProps,Ve),a!==null?(e.stateNode=a,re=e,Xt=null,t=!0):t=!1),t||Wn(e)),null;case 13:return eg(t,e,a);case 4:return ut(e,e.stateNode.containerInfo),i=e.pendingProps,t===null?e.child=Ga(e,null,i,a):fe(t,e,i,a),e.child;case 11:return $h(t,e,e.type,e.pendingProps,a);case 7:return fe(t,e,e.pendingProps,a),e.child;case 8:return fe(t,e,e.pendingProps.children,a),e.child;case 12:return fe(t,e,e.pendingProps.children,a),e.child;case 10:return i=e.pendingProps,Pn(e,e.type,i.value),fe(t,e,i.children,a),e.child;case 9:return s=e.type._context,i=e.pendingProps.children,qa(e),s=ce(s),i=i(s),e.flags|=1,fe(t,e,i,a),e.child;case 14:return kh(t,e,e.type,e.pendingProps,a);case 15:return Kh(t,e,e.type,e.pendingProps,a);case 19:return ag(t,e,a);case 31:return t1(t,e,a);case 22:return Ih(t,e,a,e.pendingProps);case 24:return qa(e),i=ce(Pt),t===null?(s=Nr(),s===null&&(s=Gt,c=Er(),s.pooledCache=c,c.refCount++,c!==null&&(s.pooledCacheLanes|=a),s=c),e.memoizedState={parent:i,cache:s},Ar(e),Pn(e,Pt,s)):((t.lanes&a)!==0&&(Tr(t,e),Ai(e,null,null,a),Mi()),s=t.memoizedState,c=e.memoizedState,s.parent!==i?(s={parent:i,cache:i},e.memoizedState=s,e.lanes===0&&(e.memoizedState=e.updateQueue.baseState=s),Pn(e,Pt,i)):(i=c.cache,Pn(e,Pt,i),i!==s.cache&&_r(e,[Pt],a,!0))),fe(t,e,e.pendingProps.children,a),e.child;case 29:throw e.pendingProps}throw Error(u(156,e.tag))}function Cn(t){t.flags|=4}function rc(t,e,a,i,s){if((e=(t.mode&32)!==0)&&(e=!1),e){if(t.flags|=16777216,(s&335544128)===s)if(t.stateNode.complete)t.flags|=8192;else if(Dg())t.flags|=8192;else throw Va=nu,Mr}else t.flags&=-16777217}function ig(t,e){if(e.type!=="stylesheet"||(e.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Sm(e))if(Dg())t.flags|=8192;else throw Va=nu,Mr}function xu(t,e){e!==null&&(t.flags|=4),t.flags&16384&&(e=t.tag!==22?No():536870912,t.lanes|=e,jl|=e)}function Ri(t,e){if(!Ct)switch(t.tailMode){case"hidden":e=t.tail;for(var a=null;e!==null;)e.alternate!==null&&(a=e),e=e.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:i.sibling=null}}function Zt(t){var e=t.alternate!==null&&t.alternate.child===t.child,a=0,i=0;if(e)for(var s=t.child;s!==null;)a|=s.lanes|s.childLanes,i|=s.subtreeFlags&65011712,i|=s.flags&65011712,s.return=t,s=s.sibling;else for(s=t.child;s!==null;)a|=s.lanes|s.childLanes,i|=s.subtreeFlags,i|=s.flags,s.return=t,s=s.sibling;return t.subtreeFlags|=i,t.childLanes=a,e}function n1(t,e,a){var i=e.pendingProps;switch(yr(e),e.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Zt(e),null;case 1:return Zt(e),null;case 3:return a=e.stateNode,i=null,t!==null&&(i=t.memoizedState.cache),e.memoizedState.cache!==i&&(e.flags|=2048),Mn(Pt),ft(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(_l(e)?Cn(e):t===null||t.memoizedState.isDehydrated&&(e.flags&256)===0||(e.flags|=1024,xr())),Zt(e),null;case 26:var s=e.type,c=e.memoizedState;return t===null?(Cn(e),c!==null?(Zt(e),ig(e,c)):(Zt(e),rc(e,s,null,i,a))):c?c!==t.memoizedState?(Cn(e),Zt(e),ig(e,c)):(Zt(e),e.flags&=-16777217):(t=t.memoizedProps,t!==i&&Cn(e),Zt(e),rc(e,s,t,i,a)),null;case 27:if(bt(e),a=ct.current,s=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Cn(e);else{if(!i){if(e.stateNode===null)throw Error(u(166));return Zt(e),null}t=et.current,_l(e)?qd(e):(t=dm(s,i,a),e.stateNode=t,Cn(e))}return Zt(e),null;case 5:if(bt(e),s=e.type,t!==null&&e.stateNode!=null)t.memoizedProps!==i&&Cn(e);else{if(!i){if(e.stateNode===null)throw Error(u(166));return Zt(e),null}if(c=et.current,_l(e))qd(e);else{var p=Hu(ct.current);switch(c){case 1:c=p.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:c=p.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":c=p.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":c=p.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":c=p.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof i.is=="string"?p.createElement("select",{is:i.is}):p.createElement("select"),i.multiple?c.multiple=!0:i.size&&(c.size=i.size);break;default:c=typeof i.is=="string"?p.createElement(s,{is:i.is}):p.createElement(s)}}c[le]=e,c[he]=i;t:for(p=e.child;p!==null;){if(p.tag===5||p.tag===6)c.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===e)break t;for(;p.sibling===null;){if(p.return===null||p.return===e)break t;p=p.return}p.sibling.return=p.return,p=p.sibling}e.stateNode=c;t:switch(de(c,s,i),s){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break t;case"img":i=!0;break t;default:i=!1}i&&Cn(e)}}return Zt(e),rc(e,e.type,t===null?null:t.memoizedProps,e.pendingProps,a),null;case 6:if(t&&e.stateNode!=null)t.memoizedProps!==i&&Cn(e);else{if(typeof i!="string"&&e.stateNode===null)throw Error(u(166));if(t=ct.current,_l(e)){if(t=e.stateNode,a=e.memoizedProps,i=null,s=re,s!==null)switch(s.tag){case 27:case 5:i=s.memoizedProps}t[le]=e,t=!!(t.nodeValue===a||i!==null&&i.suppressHydrationWarning===!0||em(t.nodeValue,a)),t||Wn(e,!0)}else t=Hu(t).createTextNode(i),t[le]=e,e.stateNode=t}return Zt(e),null;case 31:if(a=e.memoizedState,t===null||t.memoizedState!==null){if(i=_l(e),a!==null){if(t===null){if(!i)throw Error(u(318));if(t=e.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(u(557));t[le]=e}else Ua(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Zt(e),t=!1}else a=xr(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=a),t=!0;if(!t)return e.flags&256?(De(e),e):(De(e),null);if((e.flags&128)!==0)throw Error(u(558))}return Zt(e),null;case 13:if(i=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(s=_l(e),i!==null&&i.dehydrated!==null){if(t===null){if(!s)throw Error(u(318));if(s=e.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(u(317));s[le]=e}else Ua(),(e.flags&128)===0&&(e.memoizedState=null),e.flags|=4;Zt(e),s=!1}else s=xr(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=s),s=!0;if(!s)return e.flags&256?(De(e),e):(De(e),null)}return De(e),(e.flags&128)!==0?(e.lanes=a,e):(a=i!==null,t=t!==null&&t.memoizedState!==null,a&&(i=e.child,s=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(s=i.alternate.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==s&&(i.flags|=2048)),a!==t&&a&&(e.child.flags|=8192),xu(e,e.updateQueue),Zt(e),null);case 4:return ft(),t===null&&Dc(e.stateNode.containerInfo),Zt(e),null;case 10:return Mn(e.type),Zt(e),null;case 19:if(H(Jt),i=e.memoizedState,i===null)return Zt(e),null;if(s=(e.flags&128)!==0,c=i.rendering,c===null)if(s)Ri(i,!1);else{if(It!==0||t!==null&&(t.flags&128)!==0)for(t=e.child;t!==null;){if(c=ou(t),c!==null){for(e.flags|=128,Ri(i,!1),t=c.updateQueue,e.updateQueue=t,xu(e,t),e.subtreeFlags=0,t=a,a=e.child;a!==null;)Rd(a,t),a=a.sibling;return W(Jt,Jt.current&1|2),Ct&&wn(e,i.treeForkCount),e.child}t=t.sibling}i.tail!==null&&se()>wu&&(e.flags|=128,s=!0,Ri(i,!1),e.lanes=4194304)}else{if(!s)if(t=ou(c),t!==null){if(e.flags|=128,s=!0,t=t.updateQueue,e.updateQueue=t,xu(e,t),Ri(i,!0),i.tail===null&&i.tailMode==="hidden"&&!c.alternate&&!Ct)return Zt(e),null}else 2*se()-i.renderingStartTime>wu&&a!==536870912&&(e.flags|=128,s=!0,Ri(i,!1),e.lanes=4194304);i.isBackwards?(c.sibling=e.child,e.child=c):(t=i.last,t!==null?t.sibling=c:e.child=c,i.last=c)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=se(),t.sibling=null,a=Jt.current,W(Jt,s?a&1|2:a&1),Ct&&wn(e,i.treeForkCount),t):(Zt(e),null);case 22:case 23:return De(e),Or(),i=e.memoizedState!==null,t!==null?t.memoizedState!==null!==i&&(e.flags|=8192):i&&(e.flags|=8192),i?(a&536870912)!==0&&(e.flags&128)===0&&(Zt(e),e.subtreeFlags&6&&(e.flags|=8192)):Zt(e),a=e.updateQueue,a!==null&&xu(e,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),i=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),i!==a&&(e.flags|=2048),t!==null&&H(La),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),e.memoizedState.cache!==a&&(e.flags|=2048),Mn(Pt),Zt(e),null;case 25:return null;case 30:return null}throw Error(u(156,e.tag))}function a1(t,e){switch(yr(e),e.tag){case 1:return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Mn(Pt),ft(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 26:case 27:case 5:return bt(e),null;case 31:if(e.memoizedState!==null){if(De(e),e.alternate===null)throw Error(u(340));Ua()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 13:if(De(e),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(u(340));Ua()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return H(Jt),null;case 4:return ft(),null;case 10:return Mn(e.type),null;case 22:case 23:return De(e),Or(),t!==null&&H(La),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 24:return Mn(Pt),null;case 25:return null;default:return null}}function og(t,e){switch(yr(e),e.tag){case 3:Mn(Pt),ft();break;case 26:case 27:case 5:bt(e);break;case 4:ft();break;case 31:e.memoizedState!==null&&De(e);break;case 13:De(e);break;case 19:H(Jt);break;case 10:Mn(e.type);break;case 22:case 23:De(e),Or(),t!==null&&H(La);break;case 24:Mn(Pt)}}function Hi(t,e){try{var a=e.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var s=i.next;a=s;do{if((a.tag&t)===t){i=void 0;var c=a.create,p=a.inst;i=c(),p.destroy=i}a=a.next}while(a!==s)}}catch(b){Bt(e,e.return,b)}}function ia(t,e,a){try{var i=e.updateQueue,s=i!==null?i.lastEffect:null;if(s!==null){var c=s.next;i=c;do{if((i.tag&t)===t){var p=i.inst,b=p.destroy;if(b!==void 0){p.destroy=void 0,s=e;var O=a,Q=b;try{Q()}catch(nt){Bt(s,O,nt)}}}i=i.next}while(i!==c)}}catch(nt){Bt(e,e.return,nt)}}function ug(t){var e=t.updateQueue;if(e!==null){var a=t.stateNode;try{Fd(e,a)}catch(i){Bt(t,t.return,i)}}}function sg(t,e,a){a.props=Za(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(i){Bt(t,e,i)}}function ji(t,e){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var i=t.stateNode;break;case 30:i=t.stateNode;break;default:i=t.stateNode}typeof a=="function"?t.refCleanup=a(i):a.current=i}}catch(s){Bt(t,e,s)}}function sn(t,e){var a=t.ref,i=t.refCleanup;if(a!==null)if(typeof i=="function")try{i()}catch(s){Bt(t,e,s)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(s){Bt(t,e,s)}else a.current=null}function rg(t){var e=t.type,a=t.memoizedProps,i=t.stateNode;try{t:switch(e){case"button":case"input":case"select":case"textarea":a.autoFocus&&i.focus();break t;case"img":a.src?i.src=a.src:a.srcSet&&(i.srcset=a.srcSet)}}catch(s){Bt(t,t.return,s)}}function cc(t,e,a){try{var i=t.stateNode;N1(i,t.type,a,e),i[he]=e}catch(s){Bt(t,t.return,s)}}function cg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&da(t.type)||t.tag===4}function fc(t){t:for(;;){for(;t.sibling===null;){if(t.return===null||cg(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&da(t.type)||t.flags&2||t.child===null||t.tag===4)continue t;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function dc(t,e,a){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,e):(e=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,e.appendChild(t),a=a._reactRootContainer,a!=null||e.onclick!==null||(e.onclick=bn));else if(i!==4&&(i===27&&da(t.type)&&(a=t.stateNode,e=null),t=t.child,t!==null))for(dc(t,e,a),t=t.sibling;t!==null;)dc(t,e,a),t=t.sibling}function Su(t,e,a){var i=t.tag;if(i===5||i===6)t=t.stateNode,e?a.insertBefore(t,e):a.appendChild(t);else if(i!==4&&(i===27&&da(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(Su(t,e,a),t=t.sibling;t!==null;)Su(t,e,a),t=t.sibling}function fg(t){var e=t.stateNode,a=t.memoizedProps;try{for(var i=t.type,s=e.attributes;s.length;)e.removeAttributeNode(s[0]);de(e,i,a),e[le]=t,e[he]=a}catch(c){Bt(t,t.return,c)}}var Dn=!1,ne=!1,hc=!1,dg=typeof WeakSet=="function"?WeakSet:Set,ue=null;function l1(t,e){if(t=t.containerInfo,Hc=Vu,t=wd(t),or(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else t:{a=(a=t.ownerDocument)&&a.defaultView||window;var i=a.getSelection&&a.getSelection();if(i&&i.rangeCount!==0){a=i.anchorNode;var s=i.anchorOffset,c=i.focusNode;i=i.focusOffset;try{a.nodeType,c.nodeType}catch{a=null;break t}var p=0,b=-1,O=-1,Q=0,nt=0,lt=t,K=null;e:for(;;){for(var F;lt!==a||s!==0&&lt.nodeType!==3||(b=p+s),lt!==c||i!==0&&lt.nodeType!==3||(O=p+i),lt.nodeType===3&&(p+=lt.nodeValue.length),(F=lt.firstChild)!==null;)K=lt,lt=F;for(;;){if(lt===t)break e;if(K===a&&++Q===s&&(b=p),K===c&&++nt===i&&(O=p),(F=lt.nextSibling)!==null)break;lt=K,K=lt.parentNode}lt=F}a=b===-1||O===-1?null:{start:b,end:O}}else a=null}a=a||{start:0,end:0}}else a=null;for(jc={focusedElem:t,selectionRange:a},Vu=!1,ue=e;ue!==null;)if(e=ue,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ue=t;else for(;ue!==null;){switch(e=ue,c=e.alternate,t=e.flags,e.tag){case 0:if((t&4)!==0&&(t=e.updateQueue,t=t!==null?t.events:null,t!==null))for(a=0;a<t.length;a++)s=t[a],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&c!==null){t=void 0,a=e,s=c.memoizedProps,c=c.memoizedState,i=a.stateNode;try{var dt=Za(a.type,s);t=i.getSnapshotBeforeUpdate(dt,c),i.__reactInternalSnapshotBeforeUpdate=t}catch(vt){Bt(a,a.return,vt)}}break;case 3:if((t&1024)!==0){if(t=e.stateNode.containerInfo,a=t.nodeType,a===9)qc(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":qc(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(u(163))}if(t=e.sibling,t!==null){t.return=e.return,ue=t;break}ue=e.return}}function hg(t,e,a){var i=a.flags;switch(a.tag){case 0:case 11:case 15:Rn(t,a),i&4&&Hi(5,a);break;case 1:if(Rn(t,a),i&4)if(t=a.stateNode,e===null)try{t.componentDidMount()}catch(p){Bt(a,a.return,p)}else{var s=Za(a.type,e.memoizedProps);e=e.memoizedState;try{t.componentDidUpdate(s,e,t.__reactInternalSnapshotBeforeUpdate)}catch(p){Bt(a,a.return,p)}}i&64&&ug(a),i&512&&ji(a,a.return);break;case 3:if(Rn(t,a),i&64&&(t=a.updateQueue,t!==null)){if(e=null,a.child!==null)switch(a.child.tag){case 27:case 5:e=a.child.stateNode;break;case 1:e=a.child.stateNode}try{Fd(t,e)}catch(p){Bt(a,a.return,p)}}break;case 27:e===null&&i&4&&fg(a);case 26:case 5:Rn(t,a),e===null&&i&4&&rg(a),i&512&&ji(a,a.return);break;case 12:Rn(t,a);break;case 31:Rn(t,a),i&4&&pg(t,a);break;case 13:Rn(t,a),i&4&&yg(t,a),i&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=h1.bind(null,a),R1(t,a))));break;case 22:if(i=a.memoizedState!==null||Dn,!i){e=e!==null&&e.memoizedState!==null||ne,s=Dn;var c=ne;Dn=i,(ne=e)&&!c?Hn(t,a,(a.subtreeFlags&8772)!==0):Rn(t,a),Dn=s,ne=c}break;case 30:break;default:Rn(t,a)}}function gg(t){var e=t.alternate;e!==null&&(t.alternate=null,gg(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&ui(e)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Qt=null,be=!1;function On(t,e,a){for(a=a.child;a!==null;)mg(t,e,a),a=a.sibling}function mg(t,e,a){if(me&&typeof me.onCommitFiberUnmount=="function")try{me.onCommitFiberUnmount(Na,a)}catch{}switch(a.tag){case 26:ne||sn(a,e),On(t,e,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ne||sn(a,e);var i=Qt,s=be;da(a.type)&&(Qt=a.stateNode,be=!1),On(t,e,a),Zi(a.stateNode),Qt=i,be=s;break;case 5:ne||sn(a,e);case 6:if(i=Qt,s=be,Qt=null,On(t,e,a),Qt=i,be=s,Qt!==null)if(be)try{(Qt.nodeType===9?Qt.body:Qt.nodeName==="HTML"?Qt.ownerDocument.body:Qt).removeChild(a.stateNode)}catch(c){Bt(a,e,c)}else try{Qt.removeChild(a.stateNode)}catch(c){Bt(a,e,c)}break;case 18:Qt!==null&&(be?(t=Qt,um(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),Xl(t)):um(Qt,a.stateNode));break;case 4:i=Qt,s=be,Qt=a.stateNode.containerInfo,be=!0,On(t,e,a),Qt=i,be=s;break;case 0:case 11:case 14:case 15:ia(2,a,e),ne||ia(4,a,e),On(t,e,a);break;case 1:ne||(sn(a,e),i=a.stateNode,typeof i.componentWillUnmount=="function"&&sg(a,e,i)),On(t,e,a);break;case 21:On(t,e,a);break;case 22:ne=(i=ne)||a.memoizedState!==null,On(t,e,a),ne=i;break;default:On(t,e,a)}}function pg(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Xl(t)}catch(a){Bt(e,e.return,a)}}}function yg(t,e){if(e.memoizedState===null&&(t=e.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Xl(t)}catch(a){Bt(e,e.return,a)}}function i1(t){switch(t.tag){case 31:case 13:case 19:var e=t.stateNode;return e===null&&(e=t.stateNode=new dg),e;case 22:return t=t.stateNode,e=t._retryCache,e===null&&(e=t._retryCache=new dg),e;default:throw Error(u(435,t.tag))}}function bu(t,e){var a=i1(t);e.forEach(function(i){if(!a.has(i)){a.add(i);var s=g1.bind(null,t,i);i.then(s,s)}})}function _e(t,e){var a=e.deletions;if(a!==null)for(var i=0;i<a.length;i++){var s=a[i],c=t,p=e,b=p;t:for(;b!==null;){switch(b.tag){case 27:if(da(b.type)){Qt=b.stateNode,be=!1;break t}break;case 5:Qt=b.stateNode,be=!1;break t;case 3:case 4:Qt=b.stateNode.containerInfo,be=!0;break t}b=b.return}if(Qt===null)throw Error(u(160));mg(c,p,s),Qt=null,be=!1,c=s.alternate,c!==null&&(c.return=null),s.return=null}if(e.subtreeFlags&13886)for(e=e.child;e!==null;)vg(e,t),e=e.sibling}var Ie=null;function vg(t,e){var a=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:_e(e,t),Ee(t),i&4&&(ia(3,t,t.return),Hi(3,t),ia(5,t,t.return));break;case 1:_e(e,t),Ee(t),i&512&&(ne||a===null||sn(a,a.return)),i&64&&Dn&&(t=t.updateQueue,t!==null&&(i=t.callbacks,i!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?i:a.concat(i))));break;case 26:var s=Ie;if(_e(e,t),Ee(t),i&512&&(ne||a===null||sn(a,a.return)),i&4){var c=a!==null?a.memoizedState:null;if(i=t.memoizedState,a===null)if(i===null)if(t.stateNode===null){t:{i=t.type,a=t.memoizedProps,s=s.ownerDocument||s;e:switch(i){case"title":c=s.getElementsByTagName("title")[0],(!c||c[Ta]||c[le]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=s.createElement(i),s.head.insertBefore(c,s.querySelector("head > title"))),de(c,i,a),c[le]=t,Wt(c),i=c;break t;case"link":var p=vm("link","href",s).get(i+(a.href||""));if(p){for(var b=0;b<p.length;b++)if(c=p[b],c.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&c.getAttribute("rel")===(a.rel==null?null:a.rel)&&c.getAttribute("title")===(a.title==null?null:a.title)&&c.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){p.splice(b,1);break e}}c=s.createElement(i),de(c,i,a),s.head.appendChild(c);break;case"meta":if(p=vm("meta","content",s).get(i+(a.content||""))){for(b=0;b<p.length;b++)if(c=p[b],c.getAttribute("content")===(a.content==null?null:""+a.content)&&c.getAttribute("name")===(a.name==null?null:a.name)&&c.getAttribute("property")===(a.property==null?null:a.property)&&c.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&c.getAttribute("charset")===(a.charSet==null?null:a.charSet)){p.splice(b,1);break e}}c=s.createElement(i),de(c,i,a),s.head.appendChild(c);break;default:throw Error(u(468,i))}c[le]=t,Wt(c),i=c}t.stateNode=i}else xm(s,t.type,t.stateNode);else t.stateNode=ym(s,i,t.memoizedProps);else c!==i?(c===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):c.count--,i===null?xm(s,t.type,t.stateNode):ym(s,i,t.memoizedProps)):i===null&&t.stateNode!==null&&cc(t,t.memoizedProps,a.memoizedProps)}break;case 27:_e(e,t),Ee(t),i&512&&(ne||a===null||sn(a,a.return)),a!==null&&i&4&&cc(t,t.memoizedProps,a.memoizedProps);break;case 5:if(_e(e,t),Ee(t),i&512&&(ne||a===null||sn(a,a.return)),t.flags&32){s=t.stateNode;try{dl(s,"")}catch(dt){Bt(t,t.return,dt)}}i&4&&t.stateNode!=null&&(s=t.memoizedProps,cc(t,s,a!==null?a.memoizedProps:s)),i&1024&&(hc=!0);break;case 6:if(_e(e,t),Ee(t),i&4){if(t.stateNode===null)throw Error(u(162));i=t.memoizedProps,a=t.stateNode;try{a.nodeValue=i}catch(dt){Bt(t,t.return,dt)}}break;case 3:if(Bu=null,s=Ie,Ie=ju(e.containerInfo),_e(e,t),Ie=s,Ee(t),i&4&&a!==null&&a.memoizedState.isDehydrated)try{Xl(e.containerInfo)}catch(dt){Bt(t,t.return,dt)}hc&&(hc=!1,xg(t));break;case 4:i=Ie,Ie=ju(t.stateNode.containerInfo),_e(e,t),Ee(t),Ie=i;break;case 12:_e(e,t),Ee(t);break;case 31:_e(e,t),Ee(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,bu(t,i)));break;case 13:_e(e,t),Ee(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Eu=se()),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,bu(t,i)));break;case 22:s=t.memoizedState!==null;var O=a!==null&&a.memoizedState!==null,Q=Dn,nt=ne;if(Dn=Q||s,ne=nt||O,_e(e,t),ne=nt,Dn=Q,Ee(t),i&8192)t:for(e=t.stateNode,e._visibility=s?e._visibility&-2:e._visibility|1,s&&(a===null||O||Dn||ne||Qa(t)),a=null,e=t;;){if(e.tag===5||e.tag===26){if(a===null){O=a=e;try{if(c=O.stateNode,s)p=c.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none";else{b=O.stateNode;var lt=O.memoizedProps.style,K=lt!=null&&lt.hasOwnProperty("display")?lt.display:null;b.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(dt){Bt(O,O.return,dt)}}}else if(e.tag===6){if(a===null){O=e;try{O.stateNode.nodeValue=s?"":O.memoizedProps}catch(dt){Bt(O,O.return,dt)}}}else if(e.tag===18){if(a===null){O=e;try{var F=O.stateNode;s?sm(F,!0):sm(O.stateNode,!1)}catch(dt){Bt(O,O.return,dt)}}}else if((e.tag!==22&&e.tag!==23||e.memoizedState===null||e===t)&&e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break t;for(;e.sibling===null;){if(e.return===null||e.return===t)break t;a===e&&(a=null),e=e.return}a===e&&(a=null),e.sibling.return=e.return,e=e.sibling}i&4&&(i=t.updateQueue,i!==null&&(a=i.retryQueue,a!==null&&(i.retryQueue=null,bu(t,a))));break;case 19:_e(e,t),Ee(t),i&4&&(i=t.updateQueue,i!==null&&(t.updateQueue=null,bu(t,i)));break;case 30:break;case 21:break;default:_e(e,t),Ee(t)}}function Ee(t){var e=t.flags;if(e&2){try{for(var a,i=t.return;i!==null;){if(cg(i)){a=i;break}i=i.return}if(a==null)throw Error(u(160));switch(a.tag){case 27:var s=a.stateNode,c=fc(t);Su(t,c,s);break;case 5:var p=a.stateNode;a.flags&32&&(dl(p,""),a.flags&=-33);var b=fc(t);Su(t,b,p);break;case 3:case 4:var O=a.stateNode.containerInfo,Q=fc(t);dc(t,Q,O);break;default:throw Error(u(161))}}catch(nt){Bt(t,t.return,nt)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function xg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var e=t;xg(e),e.tag===5&&e.flags&1024&&e.stateNode.reset(),t=t.sibling}}function Rn(t,e){if(e.subtreeFlags&8772)for(e=e.child;e!==null;)hg(t,e.alternate,e),e=e.sibling}function Qa(t){for(t=t.child;t!==null;){var e=t;switch(e.tag){case 0:case 11:case 14:case 15:ia(4,e,e.return),Qa(e);break;case 1:sn(e,e.return);var a=e.stateNode;typeof a.componentWillUnmount=="function"&&sg(e,e.return,a),Qa(e);break;case 27:Zi(e.stateNode);case 26:case 5:sn(e,e.return),Qa(e);break;case 22:e.memoizedState===null&&Qa(e);break;case 30:Qa(e);break;default:Qa(e)}t=t.sibling}}function Hn(t,e,a){for(a=a&&(e.subtreeFlags&8772)!==0,e=e.child;e!==null;){var i=e.alternate,s=t,c=e,p=c.flags;switch(c.tag){case 0:case 11:case 15:Hn(s,c,a),Hi(4,c);break;case 1:if(Hn(s,c,a),i=c,s=i.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(Q){Bt(i,i.return,Q)}if(i=c,s=i.updateQueue,s!==null){var b=i.stateNode;try{var O=s.shared.hiddenCallbacks;if(O!==null)for(s.shared.hiddenCallbacks=null,s=0;s<O.length;s++)Jd(O[s],b)}catch(Q){Bt(i,i.return,Q)}}a&&p&64&&ug(c),ji(c,c.return);break;case 27:fg(c);case 26:case 5:Hn(s,c,a),a&&i===null&&p&4&&rg(c),ji(c,c.return);break;case 12:Hn(s,c,a);break;case 31:Hn(s,c,a),a&&p&4&&pg(s,c);break;case 13:Hn(s,c,a),a&&p&4&&yg(s,c);break;case 22:c.memoizedState===null&&Hn(s,c,a),ji(c,c.return);break;case 30:break;default:Hn(s,c,a)}e=e.sibling}}function gc(t,e){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(t=e.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&bi(a))}function mc(t,e){t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&bi(t))}function Je(t,e,a,i){if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Sg(t,e,a,i),e=e.sibling}function Sg(t,e,a,i){var s=e.flags;switch(e.tag){case 0:case 11:case 15:Je(t,e,a,i),s&2048&&Hi(9,e);break;case 1:Je(t,e,a,i);break;case 3:Je(t,e,a,i),s&2048&&(t=null,e.alternate!==null&&(t=e.alternate.memoizedState.cache),e=e.memoizedState.cache,e!==t&&(e.refCount++,t!=null&&bi(t)));break;case 12:if(s&2048){Je(t,e,a,i),t=e.stateNode;try{var c=e.memoizedProps,p=c.id,b=c.onPostCommit;typeof b=="function"&&b(p,e.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(O){Bt(e,e.return,O)}}else Je(t,e,a,i);break;case 31:Je(t,e,a,i);break;case 13:Je(t,e,a,i);break;case 23:break;case 22:c=e.stateNode,p=e.alternate,e.memoizedState!==null?c._visibility&2?Je(t,e,a,i):Ui(t,e):c._visibility&2?Je(t,e,a,i):(c._visibility|=2,Ol(t,e,a,i,(e.subtreeFlags&10256)!==0||!1)),s&2048&&gc(p,e);break;case 24:Je(t,e,a,i),s&2048&&mc(e.alternate,e);break;default:Je(t,e,a,i)}}function Ol(t,e,a,i,s){for(s=s&&((e.subtreeFlags&10256)!==0||!1),e=e.child;e!==null;){var c=t,p=e,b=a,O=i,Q=p.flags;switch(p.tag){case 0:case 11:case 15:Ol(c,p,b,O,s),Hi(8,p);break;case 23:break;case 22:var nt=p.stateNode;p.memoizedState!==null?nt._visibility&2?Ol(c,p,b,O,s):Ui(c,p):(nt._visibility|=2,Ol(c,p,b,O,s)),s&&Q&2048&&gc(p.alternate,p);break;case 24:Ol(c,p,b,O,s),s&&Q&2048&&mc(p.alternate,p);break;default:Ol(c,p,b,O,s)}e=e.sibling}}function Ui(t,e){if(e.subtreeFlags&10256)for(e=e.child;e!==null;){var a=t,i=e,s=i.flags;switch(i.tag){case 22:Ui(a,i),s&2048&&gc(i.alternate,i);break;case 24:Ui(a,i),s&2048&&mc(i.alternate,i);break;default:Ui(a,i)}e=e.sibling}}var Bi=8192;function Rl(t,e,a){if(t.subtreeFlags&Bi)for(t=t.child;t!==null;)bg(t,e,a),t=t.sibling}function bg(t,e,a){switch(t.tag){case 26:Rl(t,e,a),t.flags&Bi&&t.memoizedState!==null&&Q1(a,Ie,t.memoizedState,t.memoizedProps);break;case 5:Rl(t,e,a);break;case 3:case 4:var i=Ie;Ie=ju(t.stateNode.containerInfo),Rl(t,e,a),Ie=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=Bi,Bi=16777216,Rl(t,e,a),Bi=i):Rl(t,e,a));break;default:Rl(t,e,a)}}function _g(t){var e=t.alternate;if(e!==null&&(t=e.child,t!==null)){e.child=null;do e=t.sibling,t.sibling=null,t=e;while(t!==null)}}function qi(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var i=e[a];ue=i,wg(i,t)}_g(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Eg(t),t=t.sibling}function Eg(t){switch(t.tag){case 0:case 11:case 15:qi(t),t.flags&2048&&ia(9,t,t.return);break;case 3:qi(t);break;case 12:qi(t);break;case 22:var e=t.stateNode;t.memoizedState!==null&&e._visibility&2&&(t.return===null||t.return.tag!==13)?(e._visibility&=-3,_u(t)):qi(t);break;default:qi(t)}}function _u(t){var e=t.deletions;if((t.flags&16)!==0){if(e!==null)for(var a=0;a<e.length;a++){var i=e[a];ue=i,wg(i,t)}_g(t)}for(t=t.child;t!==null;){switch(e=t,e.tag){case 0:case 11:case 15:ia(8,e,e.return),_u(e);break;case 22:a=e.stateNode,a._visibility&2&&(a._visibility&=-3,_u(e));break;default:_u(e)}t=t.sibling}}function wg(t,e){for(;ue!==null;){var a=ue;switch(a.tag){case 0:case 11:case 15:ia(8,a,e);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:bi(a.memoizedState.cache)}if(i=a.child,i!==null)i.return=a,ue=i;else t:for(a=t;ue!==null;){i=ue;var s=i.sibling,c=i.return;if(gg(i),i===a){ue=null;break t}if(s!==null){s.return=c,ue=s;break t}ue=c}}}var o1={getCacheForType:function(t){var e=ce(Pt),a=e.data.get(t);return a===void 0&&(a=t(),e.data.set(t,a)),a},cacheSignal:function(){return ce(Pt).controller.signal}},u1=typeof WeakMap=="function"?WeakMap:Map,Ht=0,Gt=null,Nt=null,Tt=0,Ut=0,Oe=null,oa=!1,Hl=!1,pc=!1,jn=0,It=0,ua=0,$a=0,yc=0,Re=0,jl=0,Li=null,we=null,vc=!1,Eu=0,Ng=0,wu=1/0,Nu=null,sa=null,ie=0,ra=null,Ul=null,Un=0,xc=0,Sc=null,Mg=null,Yi=0,bc=null;function He(){return(Ht&2)!==0&&Tt!==0?Tt&-Tt:M.T!==null?Ac():zo()}function Ag(){if(Re===0)if((Tt&536870912)===0||Ct){var t=il;il<<=1,(il&3932160)===0&&(il=262144),Re=t}else Re=536870912;return t=Ce.current,t!==null&&(t.flags|=32),Re}function Ne(t,e,a){(t===Gt&&(Ut===2||Ut===9)||t.cancelPendingCommit!==null)&&(Bl(t,0),ca(t,Tt,Re,!1)),Aa(t,a),((Ht&2)===0||t!==Gt)&&(t===Gt&&((Ht&2)===0&&($a|=a),It===4&&ca(t,Tt,Re,!1)),rn(t))}function Tg(t,e,a){if((Ht&6)!==0)throw Error(u(327));var i=!a&&(e&127)===0&&(e&t.expiredLanes)===0||Ma(t,e),s=i?c1(t,e):Ec(t,e,!0),c=i;do{if(s===0){Hl&&!i&&ca(t,e,0,!1);break}else{if(a=t.current.alternate,c&&!s1(a)){s=Ec(t,e,!1),c=!1;continue}if(s===2){if(c=e,t.errorRecoveryDisabledLanes&c)var p=0;else p=t.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){e=p;t:{var b=t;s=Li;var O=b.current.memoizedState.isDehydrated;if(O&&(Bl(b,p).flags|=256),p=Ec(b,p,!1),p!==2){if(pc&&!O){b.errorRecoveryDisabledLanes|=c,$a|=c,s=4;break t}c=we,we=s,c!==null&&(we===null?we=c:we.push.apply(we,c))}s=p}if(c=!1,s!==2)continue}}if(s===1){Bl(t,0),ca(t,e,0,!0);break}t:{switch(i=t,c=s,c){case 0:case 1:throw Error(u(345));case 4:if((e&4194048)!==e)break;case 6:ca(i,e,Re,!oa);break t;case 2:we=null;break;case 3:case 5:break;default:throw Error(u(329))}if((e&62914560)===e&&(s=Eu+300-se(),10<s)){if(ca(i,e,Re,!oa),ul(i,0,!0)!==0)break t;Un=e,i.timeoutHandle=im(zg.bind(null,i,a,we,Nu,vc,e,Re,$a,jl,oa,c,"Throttled",-0,0),s);break t}zg(i,a,we,Nu,vc,e,Re,$a,jl,oa,c,null,-0,0)}}break}while(!0);rn(t)}function zg(t,e,a,i,s,c,p,b,O,Q,nt,lt,K,F){if(t.timeoutHandle=-1,lt=e.subtreeFlags,lt&8192||(lt&16785408)===16785408){lt={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:bn},bg(e,c,lt);var dt=(c&62914560)===c?Eu-se():(c&4194048)===c?Ng-se():0;if(dt=$1(lt,dt),dt!==null){Un=c,t.cancelPendingCommit=dt(Bg.bind(null,t,e,c,a,i,s,p,b,O,nt,lt,null,K,F)),ca(t,c,p,!Q);return}}Bg(t,e,c,a,i,s,p,b,O)}function s1(t){for(var e=t;;){var a=e.tag;if((a===0||a===11||a===15)&&e.flags&16384&&(a=e.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var i=0;i<a.length;i++){var s=a[i],c=s.getSnapshot;s=s.value;try{if(!Te(c(),s))return!1}catch{return!1}}if(a=e.child,e.subtreeFlags&16384&&a!==null)a.return=e,e=a;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ca(t,e,a,i){e&=~yc,e&=~$a,t.suspendedLanes|=e,t.pingedLanes&=~e,i&&(t.warmLanes|=e),i=t.expirationTimes;for(var s=e;0<s;){var c=31-pe(s),p=1<<c;i[c]=-1,s&=~p}a!==0&&Mo(t,a,e)}function Mu(){return(Ht&6)===0?(Vi(0),!1):!0}function _c(){if(Nt!==null){if(Ut===0)var t=Nt.return;else t=Nt,Nn=Ba=null,qr(t),Al=null,Ei=0,t=Nt;for(;t!==null;)og(t.alternate,t),t=t.return;Nt=null}}function Bl(t,e){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,T1(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Un=0,_c(),Gt=t,Nt=a=En(t.current,null),Tt=e,Ut=0,Oe=null,oa=!1,Hl=Ma(t,e),pc=!1,jl=Re=yc=$a=ua=It=0,we=Li=null,vc=!1,(e&8)!==0&&(e|=e&32);var i=t.entangledLanes;if(i!==0)for(t=t.entanglements,i&=e;0<i;){var s=31-pe(i),c=1<<s;e|=t[s],i&=~c}return jn=e,ko(),a}function Cg(t,e){_t=null,M.H=Di,e===Ml||e===eu?(e=$d(),Ut=3):e===Mr?(e=$d(),Ut=4):Ut=e===tc?8:e!==null&&typeof e=="object"&&typeof e.then=="function"?6:1,Oe=e,Nt===null&&(It=1,mu(t,qe(e,t.current)))}function Dg(){var t=Ce.current;return t===null?!0:(Tt&4194048)===Tt?Ge===null:(Tt&62914560)===Tt||(Tt&536870912)!==0?t===Ge:!1}function Og(){var t=M.H;return M.H=Di,t===null?Di:t}function Rg(){var t=M.A;return M.A=o1,t}function Au(){It=4,oa||(Tt&4194048)!==Tt&&Ce.current!==null||(Hl=!0),(ua&134217727)===0&&($a&134217727)===0||Gt===null||ca(Gt,Tt,Re,!1)}function Ec(t,e,a){var i=Ht;Ht|=2;var s=Og(),c=Rg();(Gt!==t||Tt!==e)&&(Nu=null,Bl(t,e)),e=!1;var p=It;t:do try{if(Ut!==0&&Nt!==null){var b=Nt,O=Oe;switch(Ut){case 8:_c(),p=6;break t;case 3:case 2:case 9:case 6:Ce.current===null&&(e=!0);var Q=Ut;if(Ut=0,Oe=null,ql(t,b,O,Q),a&&Hl){p=0;break t}break;default:Q=Ut,Ut=0,Oe=null,ql(t,b,O,Q)}}r1(),p=It;break}catch(nt){Cg(t,nt)}while(!0);return e&&t.shellSuspendCounter++,Nn=Ba=null,Ht=i,M.H=s,M.A=c,Nt===null&&(Gt=null,Tt=0,ko()),p}function r1(){for(;Nt!==null;)Hg(Nt)}function c1(t,e){var a=Ht;Ht|=2;var i=Og(),s=Rg();Gt!==t||Tt!==e?(Nu=null,wu=se()+500,Bl(t,e)):Hl=Ma(t,e);t:do try{if(Ut!==0&&Nt!==null){e=Nt;var c=Oe;e:switch(Ut){case 1:Ut=0,Oe=null,ql(t,e,c,1);break;case 2:case 9:if(Zd(c)){Ut=0,Oe=null,jg(e);break}e=function(){Ut!==2&&Ut!==9||Gt!==t||(Ut=7),rn(t)},c.then(e,e);break t;case 3:Ut=7;break t;case 4:Ut=5;break t;case 7:Zd(c)?(Ut=0,Oe=null,jg(e)):(Ut=0,Oe=null,ql(t,e,c,7));break;case 5:var p=null;switch(Nt.tag){case 26:p=Nt.memoizedState;case 5:case 27:var b=Nt;if(p?Sm(p):b.stateNode.complete){Ut=0,Oe=null;var O=b.sibling;if(O!==null)Nt=O;else{var Q=b.return;Q!==null?(Nt=Q,Tu(Q)):Nt=null}break e}}Ut=0,Oe=null,ql(t,e,c,5);break;case 6:Ut=0,Oe=null,ql(t,e,c,6);break;case 8:_c(),It=6;break t;default:throw Error(u(462))}}f1();break}catch(nt){Cg(t,nt)}while(!0);return Nn=Ba=null,M.H=i,M.A=s,Ht=a,Nt!==null?0:(Gt=null,Tt=0,ko(),It)}function f1(){for(;Nt!==null&&!_a();)Hg(Nt)}function Hg(t){var e=lg(t.alternate,t,jn);t.memoizedProps=t.pendingProps,e===null?Tu(t):Nt=e}function jg(t){var e=t,a=e.alternate;switch(e.tag){case 15:case 0:e=Wh(a,e,e.pendingProps,e.type,void 0,Tt);break;case 11:e=Wh(a,e,e.pendingProps,e.type.render,e.ref,Tt);break;case 5:qr(e);default:og(a,e),e=Nt=Rd(e,jn),e=lg(a,e,jn)}t.memoizedProps=t.pendingProps,e===null?Tu(t):Nt=e}function ql(t,e,a,i){Nn=Ba=null,qr(e),Al=null,Ei=0;var s=e.return;try{if(Pv(t,s,e,a,Tt)){It=1,mu(t,qe(a,t.current)),Nt=null;return}}catch(c){if(s!==null)throw Nt=s,c;It=1,mu(t,qe(a,t.current)),Nt=null;return}e.flags&32768?(Ct||i===1?t=!0:Hl||(Tt&536870912)!==0?t=!1:(oa=t=!0,(i===2||i===9||i===3||i===6)&&(i=Ce.current,i!==null&&i.tag===13&&(i.flags|=16384))),Ug(e,t)):Tu(e)}function Tu(t){var e=t;do{if((e.flags&32768)!==0){Ug(e,oa);return}t=e.return;var a=n1(e.alternate,e,jn);if(a!==null){Nt=a;return}if(e=e.sibling,e!==null){Nt=e;return}Nt=e=t}while(e!==null);It===0&&(It=5)}function Ug(t,e){do{var a=a1(t.alternate,t);if(a!==null){a.flags&=32767,Nt=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!e&&(t=t.sibling,t!==null)){Nt=t;return}Nt=t=a}while(t!==null);It=6,Nt=null}function Bg(t,e,a,i,s,c,p,b,O){t.cancelPendingCommit=null;do zu();while(ie!==0);if((Ht&6)!==0)throw Error(u(327));if(e!==null){if(e===t.current)throw Error(u(177));if(c=e.lanes|e.childLanes,c|=fr,Vs(t,a,c,p,b,O),t===Gt&&(Nt=Gt=null,Tt=0),Ul=e,ra=t,Un=a,xc=c,Sc=s,Mg=i,(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,m1(wa,function(){return Gg(),null})):(t.callbackNode=null,t.callbackPriority=0),i=(e.flags&13878)!==0,(e.subtreeFlags&13878)!==0||i){i=M.T,M.T=null,s=R.p,R.p=2,p=Ht,Ht|=4;try{l1(t,e,a)}finally{Ht=p,R.p=s,M.T=i}}ie=1,qg(),Lg(),Yg()}}function qg(){if(ie===1){ie=0;var t=ra,e=Ul,a=(e.flags&13878)!==0;if((e.subtreeFlags&13878)!==0||a){a=M.T,M.T=null;var i=R.p;R.p=2;var s=Ht;Ht|=4;try{vg(e,t);var c=jc,p=wd(t.containerInfo),b=c.focusedElem,O=c.selectionRange;if(p!==b&&b&&b.ownerDocument&&Ed(b.ownerDocument.documentElement,b)){if(O!==null&&or(b)){var Q=O.start,nt=O.end;if(nt===void 0&&(nt=Q),"selectionStart"in b)b.selectionStart=Q,b.selectionEnd=Math.min(nt,b.value.length);else{var lt=b.ownerDocument||document,K=lt&&lt.defaultView||window;if(K.getSelection){var F=K.getSelection(),dt=b.textContent.length,vt=Math.min(O.start,dt),Vt=O.end===void 0?vt:Math.min(O.end,dt);!F.extend&&vt>Vt&&(p=Vt,Vt=vt,vt=p);var V=_d(b,vt),U=_d(b,Vt);if(V&&U&&(F.rangeCount!==1||F.anchorNode!==V.node||F.anchorOffset!==V.offset||F.focusNode!==U.node||F.focusOffset!==U.offset)){var Z=lt.createRange();Z.setStart(V.node,V.offset),F.removeAllRanges(),vt>Vt?(F.addRange(Z),F.extend(U.node,U.offset)):(Z.setEnd(U.node,U.offset),F.addRange(Z))}}}}for(lt=[],F=b;F=F.parentNode;)F.nodeType===1&&lt.push({element:F,left:F.scrollLeft,top:F.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<lt.length;b++){var at=lt[b];at.element.scrollLeft=at.left,at.element.scrollTop=at.top}}Vu=!!Hc,jc=Hc=null}finally{Ht=s,R.p=i,M.T=a}}t.current=e,ie=2}}function Lg(){if(ie===2){ie=0;var t=ra,e=Ul,a=(e.flags&8772)!==0;if((e.subtreeFlags&8772)!==0||a){a=M.T,M.T=null;var i=R.p;R.p=2;var s=Ht;Ht|=4;try{hg(t,e.alternate,e)}finally{Ht=s,R.p=i,M.T=a}}ie=3}}function Yg(){if(ie===4||ie===3){ie=0,Ea();var t=ra,e=Ul,a=Un,i=Mg;(e.subtreeFlags&10256)!==0||(e.flags&10256)!==0?ie=5:(ie=0,Ul=ra=null,Vg(t,t.pendingLanes));var s=t.pendingLanes;if(s===0&&(sa=null),oi(a),e=e.stateNode,me&&typeof me.onCommitFiberRoot=="function")try{me.onCommitFiberRoot(Na,e,void 0,(e.current.flags&128)===128)}catch{}if(i!==null){e=M.T,s=R.p,R.p=2,M.T=null;try{for(var c=t.onRecoverableError,p=0;p<i.length;p++){var b=i[p];c(b.value,{componentStack:b.stack})}}finally{M.T=e,R.p=s}}(Un&3)!==0&&zu(),rn(t),s=t.pendingLanes,(a&261930)!==0&&(s&42)!==0?t===bc?Yi++:(Yi=0,bc=t):Yi=0,Vi(0)}}function Vg(t,e){(t.pooledCacheLanes&=e)===0&&(e=t.pooledCache,e!=null&&(t.pooledCache=null,bi(e)))}function zu(){return qg(),Lg(),Yg(),Gg()}function Gg(){if(ie!==5)return!1;var t=ra,e=xc;xc=0;var a=oi(Un),i=M.T,s=R.p;try{R.p=32>a?32:a,M.T=null,a=Sc,Sc=null;var c=ra,p=Un;if(ie=0,Ul=ra=null,Un=0,(Ht&6)!==0)throw Error(u(331));var b=Ht;if(Ht|=4,Eg(c.current),Sg(c,c.current,p,a),Ht=b,Vi(0,!1),me&&typeof me.onPostCommitFiberRoot=="function")try{me.onPostCommitFiberRoot(Na,c)}catch{}return!0}finally{R.p=s,M.T=i,Vg(t,e)}}function Xg(t,e,a){e=qe(a,e),e=Pr(t.stateNode,e,2),t=na(t,e,2),t!==null&&(Aa(t,2),rn(t))}function Bt(t,e,a){if(t.tag===3)Xg(t,t,a);else for(;e!==null;){if(e.tag===3){Xg(e,t,a);break}else if(e.tag===1){var i=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(sa===null||!sa.has(i))){t=qe(a,t),a=Zh(2),i=na(e,a,2),i!==null&&(Qh(a,i,e,t),Aa(i,2),rn(i));break}}e=e.return}}function wc(t,e,a){var i=t.pingCache;if(i===null){i=t.pingCache=new u1;var s=new Set;i.set(e,s)}else s=i.get(e),s===void 0&&(s=new Set,i.set(e,s));s.has(a)||(pc=!0,s.add(a),t=d1.bind(null,t,e,a),e.then(t,t))}function d1(t,e,a){var i=t.pingCache;i!==null&&i.delete(e),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,Gt===t&&(Tt&a)===a&&(It===4||It===3&&(Tt&62914560)===Tt&&300>se()-Eu?(Ht&2)===0&&Bl(t,0):yc|=a,jl===Tt&&(jl=0)),rn(t)}function Zg(t,e){e===0&&(e=No()),t=Ha(t,e),t!==null&&(Aa(t,e),rn(t))}function h1(t){var e=t.memoizedState,a=0;e!==null&&(a=e.retryLane),Zg(t,a)}function g1(t,e){var a=0;switch(t.tag){case 31:case 13:var i=t.stateNode,s=t.memoizedState;s!==null&&(a=s.retryLane);break;case 19:i=t.stateNode;break;case 22:i=t.stateNode._retryCache;break;default:throw Error(u(314))}i!==null&&i.delete(e),Zg(t,a)}function m1(t,e){return $e(t,e)}var Cu=null,Ll=null,Nc=!1,Du=!1,Mc=!1,fa=0;function rn(t){t!==Ll&&t.next===null&&(Ll===null?Cu=Ll=t:Ll=Ll.next=t),Du=!0,Nc||(Nc=!0,y1())}function Vi(t,e){if(!Mc&&Du){Mc=!0;do for(var a=!1,i=Cu;i!==null;){if(t!==0){var s=i.pendingLanes;if(s===0)var c=0;else{var p=i.suspendedLanes,b=i.pingedLanes;c=(1<<31-pe(42|t)+1)-1,c&=s&~(p&~b),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(a=!0,Kg(i,c))}else c=Tt,c=ul(i,i===Gt?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||Ma(i,c)||(a=!0,Kg(i,c));i=i.next}while(a);Mc=!1}}function p1(){Qg()}function Qg(){Du=Nc=!1;var t=0;fa!==0&&A1()&&(t=fa);for(var e=se(),a=null,i=Cu;i!==null;){var s=i.next,c=$g(i,e);c===0?(i.next=null,a===null?Cu=s:a.next=s,s===null&&(Ll=a)):(a=i,(t!==0||(c&3)!==0)&&(Du=!0)),i=s}ie!==0&&ie!==5||Vi(t),fa!==0&&(fa=0)}function $g(t,e){for(var a=t.suspendedLanes,i=t.pingedLanes,s=t.expirationTimes,c=t.pendingLanes&-62914561;0<c;){var p=31-pe(c),b=1<<p,O=s[p];O===-1?((b&a)===0||(b&i)!==0)&&(s[p]=Ys(b,e)):O<=e&&(t.expiredLanes|=b),c&=~b}if(e=Gt,a=Tt,a=ul(t,t===e?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i=t.callbackNode,a===0||t===e&&(Ut===2||Ut===9)||t.cancelPendingCommit!==null)return i!==null&&i!==null&&mn(i),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Ma(t,a)){if(e=a&-a,e===t.callbackPriority)return e;switch(i!==null&&mn(i),oi(a)){case 2:case 8:a=Xn;break;case 32:a=wa;break;case 268435456:a=al;break;default:a=wa}return i=kg.bind(null,t),a=$e(a,i),t.callbackPriority=e,t.callbackNode=a,e}return i!==null&&i!==null&&mn(i),t.callbackPriority=2,t.callbackNode=null,2}function kg(t,e){if(ie!==0&&ie!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(zu()&&t.callbackNode!==a)return null;var i=Tt;return i=ul(t,t===Gt?i:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),i===0?null:(Tg(t,i,e),$g(t,se()),t.callbackNode!=null&&t.callbackNode===a?kg.bind(null,t):null)}function Kg(t,e){if(zu())return null;Tg(t,e,!0)}function y1(){z1(function(){(Ht&6)!==0?$e(pn,p1):Qg()})}function Ac(){if(fa===0){var t=wl;t===0&&(t=ll,ll<<=1,(ll&261888)===0&&(ll=256)),fa=t}return fa}function Ig(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Lo(""+t)}function Jg(t,e){var a=e.ownerDocument.createElement("input");return a.name=e.name,a.value=e.value,t.id&&a.setAttribute("form",t.id),e.parentNode.insertBefore(a,e),t=new FormData(t),a.parentNode.removeChild(a),t}function v1(t,e,a,i,s){if(e==="submit"&&a&&a.stateNode===s){var c=Ig((s[he]||null).action),p=i.submitter;p&&(e=(e=p[he]||null)?Ig(e.formAction):p.getAttribute("formAction"),e!==null&&(c=e,p=null));var b=new Xo("action","action",null,i,s);t.push({event:b,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(fa!==0){var O=p?Jg(s,p):new FormData(s);kr(a,{pending:!0,data:O,method:s.method,action:c},null,O)}}else typeof c=="function"&&(b.preventDefault(),O=p?Jg(s,p):new FormData(s),kr(a,{pending:!0,data:O,method:s.method,action:c},c,O))},currentTarget:s}]})}}for(var Tc=0;Tc<cr.length;Tc++){var zc=cr[Tc],x1=zc.toLowerCase(),S1=zc[0].toUpperCase()+zc.slice(1);Ke(x1,"on"+S1)}Ke(Ad,"onAnimationEnd"),Ke(Td,"onAnimationIteration"),Ke(zd,"onAnimationStart"),Ke("dblclick","onDoubleClick"),Ke("focusin","onFocus"),Ke("focusout","onBlur"),Ke(Uv,"onTransitionRun"),Ke(Bv,"onTransitionStart"),Ke(qv,"onTransitionCancel"),Ke(Cd,"onTransitionEnd"),Kn("onMouseEnter",["mouseout","mouseover"]),Kn("onMouseLeave",["mouseout","mouseover"]),Kn("onPointerEnter",["pointerout","pointerover"]),Kn("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 Gi="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),b1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Gi));function Fg(t,e){e=(e&4)!==0;for(var a=0;a<t.length;a++){var i=t[a],s=i.event;i=i.listeners;t:{var c=void 0;if(e)for(var p=i.length-1;0<=p;p--){var b=i[p],O=b.instance,Q=b.currentTarget;if(b=b.listener,O!==c&&s.isPropagationStopped())break t;c=b,s.currentTarget=Q;try{c(s)}catch(nt){$o(nt)}s.currentTarget=null,c=O}else for(p=0;p<i.length;p++){if(b=i[p],O=b.instance,Q=b.currentTarget,b=b.listener,O!==c&&s.isPropagationStopped())break t;c=b,s.currentTarget=Q;try{c(s)}catch(nt){$o(nt)}s.currentTarget=null,c=O}}}}function Mt(t,e){var a=e[sl];a===void 0&&(a=e[sl]=new Set);var i=t+"__bubble";a.has(i)||(Wg(e,t,2,!1),a.add(i))}function Cc(t,e,a){var i=0;e&&(i|=4),Wg(a,t,i,e)}var Ou="_reactListening"+Math.random().toString(36).slice(2);function Dc(t){if(!t[Ou]){t[Ou]=!0,Ro.forEach(function(a){a!=="selectionchange"&&(b1.has(a)||Cc(a,!1,t),Cc(a,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[Ou]||(e[Ou]=!0,Cc("selectionchange",!1,e))}}function Wg(t,e,a,i){switch(Am(e)){case 2:var s=I1;break;case 8:s=J1;break;default:s=$c}a=s.bind(null,e,a,t),s=void 0,!Fs||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(s=!0),i?s!==void 0?t.addEventListener(e,a,{capture:!0,passive:s}):t.addEventListener(e,a,!0):s!==void 0?t.addEventListener(e,a,{passive:s}):t.addEventListener(e,a,!1)}function Oc(t,e,a,i,s){var c=i;if((e&1)===0&&(e&2)===0&&i!==null)t:for(;;){if(i===null)return;var p=i.tag;if(p===3||p===4){var b=i.stateNode.containerInfo;if(b===s)break;if(p===4)for(p=i.return;p!==null;){var O=p.tag;if((O===3||O===4)&&p.stateNode.containerInfo===s)return;p=p.return}for(;b!==null;){if(p=Zn(b),p===null)return;if(O=p.tag,O===5||O===6||O===26||O===27){i=c=p;continue t}b=b.parentNode}}i=i.return}ad(function(){var Q=c,nt=Is(a),lt=[];t:{var K=Dd.get(t);if(K!==void 0){var F=Xo,dt=t;switch(t){case"keypress":if(Vo(a)===0)break t;case"keydown":case"keyup":F=gv;break;case"focusin":dt="focus",F=er;break;case"focusout":dt="blur",F=er;break;case"beforeblur":case"afterblur":F=er;break;case"click":if(a.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":F=od;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":F=nv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":F=yv;break;case Ad:case Td:case zd:F=iv;break;case Cd:F=xv;break;case"scroll":case"scrollend":F=tv;break;case"wheel":F=bv;break;case"copy":case"cut":case"paste":F=uv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":F=sd;break;case"toggle":case"beforetoggle":F=Ev}var vt=(e&4)!==0,Vt=!vt&&(t==="scroll"||t==="scrollend"),V=vt?K!==null?K+"Capture":null:K;vt=[];for(var U=Q,Z;U!==null;){var at=U;if(Z=at.stateNode,at=at.tag,at!==5&&at!==26&&at!==27||Z===null||V===null||(at=ci(U,V),at!=null&&vt.push(Xi(U,at,Z))),Vt)break;U=U.return}0<vt.length&&(K=new F(K,dt,null,a,nt),lt.push({event:K,listeners:vt}))}}if((e&7)===0){t:{if(K=t==="mouseover"||t==="pointerover",F=t==="mouseout"||t==="pointerout",K&&a!==Ks&&(dt=a.relatedTarget||a.fromElement)&&(Zn(dt)||dt[vn]))break t;if((F||K)&&(K=nt.window===nt?nt:(K=nt.ownerDocument)?K.defaultView||K.parentWindow:window,F?(dt=a.relatedTarget||a.toElement,F=Q,dt=dt?Zn(dt):null,dt!==null&&(Vt=f(dt),vt=dt.tag,dt!==Vt||vt!==5&&vt!==27&&vt!==6)&&(dt=null)):(F=null,dt=Q),F!==dt)){if(vt=od,at="onMouseLeave",V="onMouseEnter",U="mouse",(t==="pointerout"||t==="pointerover")&&(vt=sd,at="onPointerLeave",V="onPointerEnter",U="pointer"),Vt=F==null?K:$n(F),Z=dt==null?K:$n(dt),K=new vt(at,U+"leave",F,a,nt),K.target=Vt,K.relatedTarget=Z,at=null,Zn(nt)===Q&&(vt=new vt(V,U+"enter",dt,a,nt),vt.target=Z,vt.relatedTarget=Vt,at=vt),Vt=at,F&&dt)e:{for(vt=_1,V=F,U=dt,Z=0,at=V;at;at=vt(at))Z++;at=0;for(var pt=U;pt;pt=vt(pt))at++;for(;0<Z-at;)V=vt(V),Z--;for(;0<at-Z;)U=vt(U),at--;for(;Z--;){if(V===U||U!==null&&V===U.alternate){vt=V;break e}V=vt(V),U=vt(U)}vt=null}else vt=null;F!==null&&Pg(lt,K,F,vt,!1),dt!==null&&Vt!==null&&Pg(lt,Vt,dt,vt,!0)}}t:{if(K=Q?$n(Q):window,F=K.nodeName&&K.nodeName.toLowerCase(),F==="select"||F==="input"&&K.type==="file")var Ot=pd;else if(gd(K))if(yd)Ot=Rv;else{Ot=Dv;var gt=Cv}else F=K.nodeName,!F||F.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?Q&&ks(Q.elementType)&&(Ot=pd):Ot=Ov;if(Ot&&(Ot=Ot(t,Q))){md(lt,Ot,a,nt);break t}gt&&gt(t,K,Q),t==="focusout"&&Q&&K.type==="number"&&Q.memoizedProps.value!=null&&ri(K,"number",K.value)}switch(gt=Q?$n(Q):window,t){case"focusin":(gd(gt)||gt.contentEditable==="true")&&(pl=gt,ur=Q,vi=null);break;case"focusout":vi=ur=pl=null;break;case"mousedown":sr=!0;break;case"contextmenu":case"mouseup":case"dragend":sr=!1,Nd(lt,a,nt);break;case"selectionchange":if(jv)break;case"keydown":case"keyup":Nd(lt,a,nt)}var wt;if(ar)t:{switch(t){case"compositionstart":var zt="onCompositionStart";break t;case"compositionend":zt="onCompositionEnd";break t;case"compositionupdate":zt="onCompositionUpdate";break t}zt=void 0}else ml?dd(t,a)&&(zt="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(zt="onCompositionStart");zt&&(rd&&a.locale!=="ko"&&(ml||zt!=="onCompositionStart"?zt==="onCompositionEnd"&&ml&&(wt=ld()):(In=nt,Ws="value"in In?In.value:In.textContent,ml=!0)),gt=Ru(Q,zt),0<gt.length&&(zt=new ud(zt,t,null,a,nt),lt.push({event:zt,listeners:gt}),wt?zt.data=wt:(wt=hd(a),wt!==null&&(zt.data=wt)))),(wt=Nv?Mv(t,a):Av(t,a))&&(zt=Ru(Q,"onBeforeInput"),0<zt.length&&(gt=new ud("onBeforeInput","beforeinput",null,a,nt),lt.push({event:gt,listeners:zt}),gt.data=wt)),v1(lt,t,Q,a,nt)}Fg(lt,e)})}function Xi(t,e,a){return{instance:t,listener:e,currentTarget:a}}function Ru(t,e){for(var a=e+"Capture",i=[];t!==null;){var s=t,c=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||c===null||(s=ci(t,a),s!=null&&i.unshift(Xi(t,s,c)),s=ci(t,e),s!=null&&i.push(Xi(t,s,c))),t.tag===3)return i;t=t.return}return[]}function _1(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Pg(t,e,a,i,s){for(var c=e._reactName,p=[];a!==null&&a!==i;){var b=a,O=b.alternate,Q=b.stateNode;if(b=b.tag,O!==null&&O===i)break;b!==5&&b!==26&&b!==27||Q===null||(O=Q,s?(Q=ci(a,c),Q!=null&&p.unshift(Xi(a,Q,O))):s||(Q=ci(a,c),Q!=null&&p.push(Xi(a,Q,O)))),a=a.return}p.length!==0&&t.push({event:e,listeners:p})}var E1=/\r\n?/g,w1=/\u0000|\uFFFD/g;function tm(t){return(typeof t=="string"?t:""+t).replace(E1,`
9
- `).replace(w1,"")}function em(t,e){return e=tm(e),tm(t)===e}function Yt(t,e,a,i,s,c){switch(a){case"children":typeof i=="string"?e==="body"||e==="textarea"&&i===""||dl(t,i):(typeof i=="number"||typeof i=="bigint")&&e!=="body"&&dl(t,""+i);break;case"className":cl(t,"class",i);break;case"tabIndex":cl(t,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":cl(t,a,i);break;case"style":ed(t,i,c);break;case"data":if(e!=="object"){cl(t,"data",i);break}case"src":case"href":if(i===""&&(e!=="a"||a!=="href")){t.removeAttribute(a);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(a);break}i=Lo(""+i),t.setAttribute(a,i);break;case"action":case"formAction":if(typeof i=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(a==="formAction"?(e!=="input"&&Yt(t,e,"name",s.name,s,null),Yt(t,e,"formEncType",s.formEncType,s,null),Yt(t,e,"formMethod",s.formMethod,s,null),Yt(t,e,"formTarget",s.formTarget,s,null)):(Yt(t,e,"encType",s.encType,s,null),Yt(t,e,"method",s.method,s,null),Yt(t,e,"target",s.target,s,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){t.removeAttribute(a);break}i=Lo(""+i),t.setAttribute(a,i);break;case"onClick":i!=null&&(t.onclick=bn);break;case"onScroll":i!=null&&Mt("scroll",t);break;case"onScrollEnd":i!=null&&Mt("scrollend",t);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(a=i.__html,a!=null){if(s.children!=null)throw Error(u(60));t.innerHTML=a}}break;case"multiple":t.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":t.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"){t.removeAttribute("xlink:href");break}a=Lo(""+i),t.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"?t.setAttribute(a,""+i):t.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"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":i===!0?t.setAttribute(a,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?t.setAttribute(a,i):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?t.setAttribute(a,i):t.removeAttribute(a);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?t.removeAttribute(a):t.setAttribute(a,i);break;case"popover":Mt("beforetoggle",t),Mt("toggle",t),rl(t,"popover",i);break;case"xlinkActuate":ke(t,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":ke(t,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":ke(t,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":ke(t,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":ke(t,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":ke(t,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":ke(t,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":ke(t,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":ke(t,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":rl(t,"is",i);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Wy.get(a)||a,rl(t,a,i))}}function Rc(t,e,a,i,s,c){switch(a){case"style":ed(t,i,c);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(u(61));if(a=i.__html,a!=null){if(s.children!=null)throw Error(u(60));t.innerHTML=a}}break;case"children":typeof i=="string"?dl(t,i):(typeof i=="number"||typeof i=="bigint")&&dl(t,""+i);break;case"onScroll":i!=null&&Mt("scroll",t);break;case"onScrollEnd":i!=null&&Mt("scrollend",t);break;case"onClick":i!=null&&(t.onclick=bn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ho.hasOwnProperty(a))t:{if(a[0]==="o"&&a[1]==="n"&&(s=a.endsWith("Capture"),e=a.slice(2,s?a.length-7:void 0),c=t[he]||null,c=c!=null?c[a]:null,typeof c=="function"&&t.removeEventListener(e,c,s),typeof i=="function")){typeof c!="function"&&c!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(e,i,s);break t}a in t?t[a]=i:i===!0?t.setAttribute(a,""):rl(t,a,i)}}}function de(t,e,a){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Mt("error",t),Mt("load",t);var i=!1,s=!1,c;for(c in a)if(a.hasOwnProperty(c)){var p=a[c];if(p!=null)switch(c){case"src":i=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,e));default:Yt(t,e,c,p,a,null)}}s&&Yt(t,e,"srcSet",a.srcSet,a,null),i&&Yt(t,e,"src",a.src,a,null);return;case"input":Mt("invalid",t);var b=c=p=s=null,O=null,Q=null;for(i in a)if(a.hasOwnProperty(i)){var nt=a[i];if(nt!=null)switch(i){case"name":s=nt;break;case"type":p=nt;break;case"checked":O=nt;break;case"defaultChecked":Q=nt;break;case"value":c=nt;break;case"defaultValue":b=nt;break;case"children":case"dangerouslySetInnerHTML":if(nt!=null)throw Error(u(137,e));break;default:Yt(t,e,i,nt,a,null)}}qo(t,c,b,O,Q,p,s,!1);return;case"select":Mt("invalid",t),i=p=c=null;for(s in a)if(a.hasOwnProperty(s)&&(b=a[s],b!=null))switch(s){case"value":c=b;break;case"defaultValue":p=b;break;case"multiple":i=b;default:Yt(t,e,s,b,a,null)}e=c,a=p,t.multiple=!!i,e!=null?Sn(t,!!i,e,!1):a!=null&&Sn(t,!!i,a,!0);return;case"textarea":Mt("invalid",t),c=s=i=null;for(p in a)if(a.hasOwnProperty(p)&&(b=a[p],b!=null))switch(p){case"value":i=b;break;case"defaultValue":s=b;break;case"children":c=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(u(91));break;default:Yt(t,e,p,b,a,null)}Pf(t,i,s,c);return;case"option":for(O in a)a.hasOwnProperty(O)&&(i=a[O],i!=null)&&(O==="selected"?t.selected=i&&typeof i!="function"&&typeof i!="symbol":Yt(t,e,O,i,a,null));return;case"dialog":Mt("beforetoggle",t),Mt("toggle",t),Mt("cancel",t),Mt("close",t);break;case"iframe":case"object":Mt("load",t);break;case"video":case"audio":for(i=0;i<Gi.length;i++)Mt(Gi[i],t);break;case"image":Mt("error",t),Mt("load",t);break;case"details":Mt("toggle",t);break;case"embed":case"source":case"link":Mt("error",t),Mt("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Q in a)if(a.hasOwnProperty(Q)&&(i=a[Q],i!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,e));default:Yt(t,e,Q,i,a,null)}return;default:if(ks(e)){for(nt in a)a.hasOwnProperty(nt)&&(i=a[nt],i!==void 0&&Rc(t,e,nt,i,a,void 0));return}}for(b in a)a.hasOwnProperty(b)&&(i=a[b],i!=null&&Yt(t,e,b,i,a,null))}function N1(t,e,a,i){switch(e){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var s=null,c=null,p=null,b=null,O=null,Q=null,nt=null;for(F in a){var lt=a[F];if(a.hasOwnProperty(F)&&lt!=null)switch(F){case"checked":break;case"value":break;case"defaultValue":O=lt;default:i.hasOwnProperty(F)||Yt(t,e,F,null,i,lt)}}for(var K in i){var F=i[K];if(lt=a[K],i.hasOwnProperty(K)&&(F!=null||lt!=null))switch(K){case"type":c=F;break;case"name":s=F;break;case"checked":Q=F;break;case"defaultChecked":nt=F;break;case"value":p=F;break;case"defaultValue":b=F;break;case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(u(137,e));break;default:F!==lt&&Yt(t,e,K,F,i,lt)}}Ca(t,p,b,O,Q,nt,c,s);return;case"select":F=p=b=K=null;for(c in a)if(O=a[c],a.hasOwnProperty(c)&&O!=null)switch(c){case"value":break;case"multiple":F=O;default:i.hasOwnProperty(c)||Yt(t,e,c,null,i,O)}for(s in i)if(c=i[s],O=a[s],i.hasOwnProperty(s)&&(c!=null||O!=null))switch(s){case"value":K=c;break;case"defaultValue":b=c;break;case"multiple":p=c;default:c!==O&&Yt(t,e,s,c,i,O)}e=b,a=p,i=F,K!=null?Sn(t,!!a,K,!1):!!i!=!!a&&(e!=null?Sn(t,!!a,e,!0):Sn(t,!!a,a?[]:"",!1));return;case"textarea":F=K=null;for(b in a)if(s=a[b],a.hasOwnProperty(b)&&s!=null&&!i.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Yt(t,e,b,null,i,s)}for(p in i)if(s=i[p],c=a[p],i.hasOwnProperty(p)&&(s!=null||c!=null))switch(p){case"value":K=s;break;case"defaultValue":F=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==c&&Yt(t,e,p,s,i,c)}Wf(t,K,F);return;case"option":for(var dt in a)K=a[dt],a.hasOwnProperty(dt)&&K!=null&&!i.hasOwnProperty(dt)&&(dt==="selected"?t.selected=!1:Yt(t,e,dt,null,i,K));for(O in i)K=i[O],F=a[O],i.hasOwnProperty(O)&&K!==F&&(K!=null||F!=null)&&(O==="selected"?t.selected=K&&typeof K!="function"&&typeof K!="symbol":Yt(t,e,O,K,i,F));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var vt in a)K=a[vt],a.hasOwnProperty(vt)&&K!=null&&!i.hasOwnProperty(vt)&&Yt(t,e,vt,null,i,K);for(Q in i)if(K=i[Q],F=a[Q],i.hasOwnProperty(Q)&&K!==F&&(K!=null||F!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(u(137,e));break;default:Yt(t,e,Q,K,i,F)}return;default:if(ks(e)){for(var Vt in a)K=a[Vt],a.hasOwnProperty(Vt)&&K!==void 0&&!i.hasOwnProperty(Vt)&&Rc(t,e,Vt,void 0,i,K);for(nt in i)K=i[nt],F=a[nt],!i.hasOwnProperty(nt)||K===F||K===void 0&&F===void 0||Rc(t,e,nt,K,i,F);return}}for(var V in a)K=a[V],a.hasOwnProperty(V)&&K!=null&&!i.hasOwnProperty(V)&&Yt(t,e,V,null,i,K);for(lt in i)K=i[lt],F=a[lt],!i.hasOwnProperty(lt)||K===F||K==null&&F==null||Yt(t,e,lt,K,i,F)}function nm(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function M1(){if(typeof performance.getEntriesByType=="function"){for(var t=0,e=0,a=performance.getEntriesByType("resource"),i=0;i<a.length;i++){var s=a[i],c=s.transferSize,p=s.initiatorType,b=s.duration;if(c&&b&&nm(p)){for(p=0,b=s.responseEnd,i+=1;i<a.length;i++){var O=a[i],Q=O.startTime;if(Q>b)break;var nt=O.transferSize,lt=O.initiatorType;nt&&nm(lt)&&(O=O.responseEnd,p+=nt*(O<b?1:(b-Q)/(O-Q)))}if(--i,e+=8*(c+p)/(s.duration/1e3),t++,10<t)break}}if(0<t)return e/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var Hc=null,jc=null;function Hu(t){return t.nodeType===9?t:t.ownerDocument}function am(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function lm(t,e){if(t===0)switch(e){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&e==="foreignObject"?0:t}function Uc(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.children=="bigint"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Bc=null;function A1(){var t=window.event;return t&&t.type==="popstate"?t===Bc?!1:(Bc=t,!0):(Bc=null,!1)}var im=typeof setTimeout=="function"?setTimeout:void 0,T1=typeof clearTimeout=="function"?clearTimeout:void 0,om=typeof Promise=="function"?Promise:void 0,z1=typeof queueMicrotask=="function"?queueMicrotask:typeof om<"u"?function(t){return om.resolve(null).then(t).catch(C1)}:im;function C1(t){setTimeout(function(){throw t})}function da(t){return t==="head"}function um(t,e){var a=e,i=0;do{var s=a.nextSibling;if(t.removeChild(a),s&&s.nodeType===8)if(a=s.data,a==="/$"||a==="/&"){if(i===0){t.removeChild(s),Xl(e);return}i--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")i++;else if(a==="html")Zi(t.ownerDocument.documentElement);else if(a==="head"){a=t.ownerDocument.head,Zi(a);for(var c=a.firstChild;c;){var p=c.nextSibling,b=c.nodeName;c[Ta]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&c.rel.toLowerCase()==="stylesheet"||a.removeChild(c),c=p}}else a==="body"&&Zi(t.ownerDocument.body);a=s}while(a);Xl(e)}function sm(t,e){var a=t;t=0;do{var i=a.nextSibling;if(a.nodeType===1?e?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(e?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),i&&i.nodeType===8)if(a=i.data,a==="/$"){if(t===0)break;t--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||t++;a=i}while(a)}function qc(t){var e=t.firstChild;for(e&&e.nodeType===10&&(e=e.nextSibling);e;){var a=e;switch(e=e.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":qc(a),ui(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function D1(t,e,a,i){for(;t.nodeType===1;){var s=a;if(t.nodeName.toLowerCase()!==e.toLowerCase()){if(!i&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(i){if(!t[Ta])switch(e){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(c=t.getAttribute("rel"),c==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(c!==s.rel||t.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||t.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||t.getAttribute("title")!==(s.title==null?null:s.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(c=t.getAttribute("src"),(c!==(s.src==null?null:s.src)||t.getAttribute("type")!==(s.type==null?null:s.type)||t.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&c&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(e==="input"&&t.type==="hidden"){var c=s.name==null?null:""+s.name;if(s.type==="hidden"&&t.getAttribute("name")===c)return t}else return t;if(t=Xe(t.nextSibling),t===null)break}return null}function O1(t,e,a){if(e==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=Xe(t.nextSibling),t===null))return null;return t}function rm(t,e){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!e||(t=Xe(t.nextSibling),t===null))return null;return t}function Lc(t){return t.data==="$?"||t.data==="$~"}function Yc(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function R1(t,e){var a=t.ownerDocument;if(t.data==="$~")t._reactRetry=e;else if(t.data!=="$?"||a.readyState!=="loading")e();else{var i=function(){e(),a.removeEventListener("DOMContentLoaded",i)};a.addEventListener("DOMContentLoaded",i),t._reactRetry=i}}function Xe(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?"||e==="$~"||e==="&"||e==="F!"||e==="F")break;if(e==="/$"||e==="/&")return null}}return t}var Vc=null;function cm(t){t=t.nextSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="/$"||a==="/&"){if(e===0)return Xe(t.nextSibling);e--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||e++}t=t.nextSibling}return null}function fm(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(e===0)return t;e--}else a!=="/$"&&a!=="/&"||e++}t=t.previousSibling}return null}function dm(t,e,a){switch(e=Hu(a),t){case"html":if(t=e.documentElement,!t)throw Error(u(452));return t;case"head":if(t=e.head,!t)throw Error(u(453));return t;case"body":if(t=e.body,!t)throw Error(u(454));return t;default:throw Error(u(451))}}function Zi(t){for(var e=t.attributes;e.length;)t.removeAttributeNode(e[0]);ui(t)}var Ze=new Map,hm=new Set;function ju(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Bn=R.d;R.d={f:H1,r:j1,D:U1,C:B1,L:q1,m:L1,X:V1,S:Y1,M:G1};function H1(){var t=Bn.f(),e=Mu();return t||e}function j1(t){var e=Qn(t);e!==null&&e.tag===5&&e.type==="form"?Ch(e):Bn.r(t)}var Yl=typeof document>"u"?null:document;function gm(t,e,a){var i=Yl;if(i&&typeof e=="string"&&e){var s=xe(e);s='link[rel="'+t+'"][href="'+s+'"]',typeof a=="string"&&(s+='[crossorigin="'+a+'"]'),hm.has(s)||(hm.add(s),t={rel:t,crossOrigin:a,href:e},i.querySelector(s)===null&&(e=i.createElement("link"),de(e,"link",t),Wt(e),i.head.appendChild(e)))}}function U1(t){Bn.D(t),gm("dns-prefetch",t,null)}function B1(t,e){Bn.C(t,e),gm("preconnect",t,e)}function q1(t,e,a){Bn.L(t,e,a);var i=Yl;if(i&&t&&e){var s='link[rel="preload"][as="'+xe(e)+'"]';e==="image"&&a&&a.imageSrcSet?(s+='[imagesrcset="'+xe(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(s+='[imagesizes="'+xe(a.imageSizes)+'"]')):s+='[href="'+xe(t)+'"]';var c=s;switch(e){case"style":c=Vl(t);break;case"script":c=Gl(t)}Ze.has(c)||(t=y({rel:"preload",href:e==="image"&&a&&a.imageSrcSet?void 0:t,as:e},a),Ze.set(c,t),i.querySelector(s)!==null||e==="style"&&i.querySelector(Qi(c))||e==="script"&&i.querySelector($i(c))||(e=i.createElement("link"),de(e,"link",t),Wt(e),i.head.appendChild(e)))}}function L1(t,e){Bn.m(t,e);var a=Yl;if(a&&t){var i=e&&typeof e.as=="string"?e.as:"script",s='link[rel="modulepreload"][as="'+xe(i)+'"][href="'+xe(t)+'"]',c=s;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Gl(t)}if(!Ze.has(c)&&(t=y({rel:"modulepreload",href:t},e),Ze.set(c,t),a.querySelector(s)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector($i(c)))return}i=a.createElement("link"),de(i,"link",t),Wt(i),a.head.appendChild(i)}}}function Y1(t,e,a){Bn.S(t,e,a);var i=Yl;if(i&&t){var s=kn(i).hoistableStyles,c=Vl(t);e=e||"default";var p=s.get(c);if(!p){var b={loading:0,preload:null};if(p=i.querySelector(Qi(c)))b.loading=5;else{t=y({rel:"stylesheet",href:t,"data-precedence":e},a),(a=Ze.get(c))&&Gc(t,a);var O=p=i.createElement("link");Wt(O),de(O,"link",t),O._p=new Promise(function(Q,nt){O.onload=Q,O.onerror=nt}),O.addEventListener("load",function(){b.loading|=1}),O.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Uu(p,e,i)}p={type:"stylesheet",instance:p,count:1,state:b},s.set(c,p)}}}function V1(t,e){Bn.X(t,e);var a=Yl;if(a&&t){var i=kn(a).hoistableScripts,s=Gl(t),c=i.get(s);c||(c=a.querySelector($i(s)),c||(t=y({src:t,async:!0},e),(e=Ze.get(s))&&Xc(t,e),c=a.createElement("script"),Wt(c),de(c,"link",t),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(s,c))}}function G1(t,e){Bn.M(t,e);var a=Yl;if(a&&t){var i=kn(a).hoistableScripts,s=Gl(t),c=i.get(s);c||(c=a.querySelector($i(s)),c||(t=y({src:t,async:!0,type:"module"},e),(e=Ze.get(s))&&Xc(t,e),c=a.createElement("script"),Wt(c),de(c,"link",t),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(s,c))}}function mm(t,e,a,i){var s=(s=ct.current)?ju(s):null;if(!s)throw Error(u(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(e=Vl(a.href),a=kn(s).hoistableStyles,i=a.get(e),i||(i={type:"style",instance:null,count:0,state:null},a.set(e,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=Vl(a.href);var c=kn(s).hoistableStyles,p=c.get(t);if(p||(s=s.ownerDocument||s,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(t,p),(c=s.querySelector(Qi(t)))&&!c._p&&(p.instance=c,p.state.loading=5),Ze.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ze.set(t,a),c||X1(s,t,a,p.state))),e&&i===null)throw Error(u(528,""));return p}if(e&&i!==null)throw Error(u(529,""));return null;case"script":return e=a.async,a=a.src,typeof a=="string"&&e&&typeof e!="function"&&typeof e!="symbol"?(e=Gl(a),a=kn(s).hoistableScripts,i=a.get(e),i||(i={type:"script",instance:null,count:0,state:null},a.set(e,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,t))}}function Vl(t){return'href="'+xe(t)+'"'}function Qi(t){return'link[rel="stylesheet"]['+t+"]"}function pm(t){return y({},t,{"data-precedence":t.precedence,precedence:null})}function X1(t,e,a,i){t.querySelector('link[rel="preload"][as="style"]['+e+"]")?i.loading=1:(e=t.createElement("link"),i.preload=e,e.addEventListener("load",function(){return i.loading|=1}),e.addEventListener("error",function(){return i.loading|=2}),de(e,"link",a),Wt(e),t.head.appendChild(e))}function Gl(t){return'[src="'+xe(t)+'"]'}function $i(t){return"script[async]"+t}function ym(t,e,a){if(e.count++,e.instance===null)switch(e.type){case"style":var i=t.querySelector('style[data-href~="'+xe(a.href)+'"]');if(i)return e.instance=i,Wt(i),i;var s=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return i=(t.ownerDocument||t).createElement("style"),Wt(i),de(i,"style",s),Uu(i,a.precedence,t),e.instance=i;case"stylesheet":s=Vl(a.href);var c=t.querySelector(Qi(s));if(c)return e.state.loading|=4,e.instance=c,Wt(c),c;i=pm(a),(s=Ze.get(s))&&Gc(i,s),c=(t.ownerDocument||t).createElement("link"),Wt(c);var p=c;return p._p=new Promise(function(b,O){p.onload=b,p.onerror=O}),de(c,"link",i),e.state.loading|=4,Uu(c,a.precedence,t),e.instance=c;case"script":return c=Gl(a.src),(s=t.querySelector($i(c)))?(e.instance=s,Wt(s),s):(i=a,(s=Ze.get(c))&&(i=y({},a),Xc(i,s)),t=t.ownerDocument||t,s=t.createElement("script"),Wt(s),de(s,"link",i),t.head.appendChild(s),e.instance=s);case"void":return null;default:throw Error(u(443,e.type))}else e.type==="stylesheet"&&(e.state.loading&4)===0&&(i=e.instance,e.state.loading|=4,Uu(i,a.precedence,t));return e.instance}function Uu(t,e,a){for(var i=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=i.length?i[i.length-1]:null,c=s,p=0;p<i.length;p++){var b=i[p];if(b.dataset.precedence===e)c=b;else if(c!==s)break}c?c.parentNode.insertBefore(t,c.nextSibling):(e=a.nodeType===9?a.head:a,e.insertBefore(t,e.firstChild))}function Gc(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.title==null&&(t.title=e.title)}function Xc(t,e){t.crossOrigin==null&&(t.crossOrigin=e.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=e.referrerPolicy),t.integrity==null&&(t.integrity=e.integrity)}var Bu=null;function vm(t,e,a){if(Bu===null){var i=new Map,s=Bu=new Map;s.set(a,i)}else s=Bu,i=s.get(a),i||(i=new Map,s.set(a,i));if(i.has(t))return i;for(i.set(t,null),a=a.getElementsByTagName(t),s=0;s<a.length;s++){var c=a[s];if(!(c[Ta]||c[le]||t==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var p=c.getAttribute(e)||"";p=t+p;var b=i.get(p);b?b.push(c):i.set(p,[c])}}return i}function xm(t,e,a){t=t.ownerDocument||t,t.head.insertBefore(a,e==="title"?t.querySelector("head > title"):null)}function Z1(t,e,a){if(a===1||e.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof e.precedence!="string"||typeof e.href!="string"||e.href==="")break;return!0;case"link":if(typeof e.rel!="string"||typeof e.href!="string"||e.href===""||e.onLoad||e.onError)break;return e.rel==="stylesheet"?(t=e.disabled,typeof e.precedence=="string"&&t==null):!0;case"script":if(e.async&&typeof e.async!="function"&&typeof e.async!="symbol"&&!e.onLoad&&!e.onError&&e.src&&typeof e.src=="string")return!0}return!1}function Sm(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function Q1(t,e,a,i){if(a.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var s=Vl(i.href),c=e.querySelector(Qi(s));if(c){e=c._p,e!==null&&typeof e=="object"&&typeof e.then=="function"&&(t.count++,t=qu.bind(t),e.then(t,t)),a.state.loading|=4,a.instance=c,Wt(c);return}c=e.ownerDocument||e,i=pm(i),(s=Ze.get(s))&&Gc(i,s),c=c.createElement("link"),Wt(c);var p=c;p._p=new Promise(function(b,O){p.onload=b,p.onerror=O}),de(c,"link",i),a.instance=c}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(a,e),(e=a.state.preload)&&(a.state.loading&3)===0&&(t.count++,a=qu.bind(t),e.addEventListener("load",a),e.addEventListener("error",a))}}var Zc=0;function $1(t,e){return t.stylesheets&&t.count===0&&Yu(t,t.stylesheets),0<t.count||0<t.imgCount?function(a){var i=setTimeout(function(){if(t.stylesheets&&Yu(t,t.stylesheets),t.unsuspend){var c=t.unsuspend;t.unsuspend=null,c()}},6e4+e);0<t.imgBytes&&Zc===0&&(Zc=62500*M1());var s=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Yu(t,t.stylesheets),t.unsuspend)){var c=t.unsuspend;t.unsuspend=null,c()}},(t.imgBytes>Zc?50:800)+e);return t.unsuspend=a,function(){t.unsuspend=null,clearTimeout(i),clearTimeout(s)}}:null}function qu(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Yu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Lu=null;function Yu(t,e){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Lu=new Map,e.forEach(k1,t),Lu=null,qu.call(t))}function k1(t,e){if(!(e.state.loading&4)){var a=Lu.get(t);if(a)var i=a.get(null);else{a=new Map,Lu.set(t,a);for(var s=t.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<s.length;c++){var p=s[c];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(a.set(p.dataset.precedence,p),i=p)}i&&a.set(null,i)}s=e.instance,p=s.getAttribute("data-precedence"),c=a.get(p)||i,c===i&&a.set(null,s),a.set(p,s),this.count++,i=qu.bind(this),s.addEventListener("load",i),s.addEventListener("error",i),c?c.parentNode.insertBefore(s,c.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(s,t.firstChild)),e.state.loading|=4}}var ki={$$typeof:E,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function K1(t,e,a,i,s,c,p,b,O){this.tag=1,this.containerInfo=t,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=li(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=li(0),this.hiddenUpdates=li(null),this.identifierPrefix=i,this.onUncaughtError=s,this.onCaughtError=c,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=O,this.incompleteTransitions=new Map}function bm(t,e,a,i,s,c,p,b,O,Q,nt,lt){return t=new K1(t,e,a,p,O,Q,nt,lt,b),e=1,c===!0&&(e|=24),c=ze(3,null,null,e),t.current=c,c.stateNode=t,e=Er(),e.refCount++,t.pooledCache=e,e.refCount++,c.memoizedState={element:i,isDehydrated:a,cache:e},Ar(c),t}function _m(t){return t?(t=xl,t):xl}function Em(t,e,a,i,s,c){s=_m(s),i.context===null?i.context=s:i.pendingContext=s,i=ea(e),i.payload={element:a},c=c===void 0?null:c,c!==null&&(i.callback=c),a=na(t,i,e),a!==null&&(Ne(a,t,e),Ni(a,t,e))}function wm(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<e?a:e}}function Qc(t,e){wm(t,e),(t=t.alternate)&&wm(t,e)}function Nm(t){if(t.tag===13||t.tag===31){var e=Ha(t,67108864);e!==null&&Ne(e,t,67108864),Qc(t,67108864)}}function Mm(t){if(t.tag===13||t.tag===31){var e=He();e=ii(e);var a=Ha(t,e);a!==null&&Ne(a,t,e),Qc(t,e)}}var Vu=!0;function I1(t,e,a,i){var s=M.T;M.T=null;var c=R.p;try{R.p=2,$c(t,e,a,i)}finally{R.p=c,M.T=s}}function J1(t,e,a,i){var s=M.T;M.T=null;var c=R.p;try{R.p=8,$c(t,e,a,i)}finally{R.p=c,M.T=s}}function $c(t,e,a,i){if(Vu){var s=kc(i);if(s===null)Oc(t,e,i,Gu,a),Tm(t,i);else if(W1(s,t,e,a,i))i.stopPropagation();else if(Tm(t,i),e&4&&-1<F1.indexOf(t)){for(;s!==null;){var c=Qn(s);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var p=yn(c.pendingLanes);if(p!==0){var b=c;for(b.pendingLanes|=2,b.entangledLanes|=2;p;){var O=1<<31-pe(p);b.entanglements[1]|=O,p&=~O}rn(c),(Ht&6)===0&&(wu=se()+500,Vi(0))}}break;case 31:case 13:b=Ha(c,2),b!==null&&Ne(b,c,2),Mu(),Qc(c,2)}if(c=kc(i),c===null&&Oc(t,e,i,Gu,a),c===s)break;s=c}s!==null&&i.stopPropagation()}else Oc(t,e,i,null,a)}}function kc(t){return t=Is(t),Kc(t)}var Gu=null;function Kc(t){if(Gu=null,t=Zn(t),t!==null){var e=f(t);if(e===null)t=null;else{var a=e.tag;if(a===13){if(t=d(e),t!==null)return t;t=null}else if(a===31){if(t=g(e),t!==null)return t;t=null}else if(a===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null)}}return Gu=t,null}function Am(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(nl()){case pn:return 2;case Xn:return 8;case wa:case Hs:return 32;case al:return 268435456;default:return 32}default:return 32}}var Ic=!1,ha=null,ga=null,ma=null,Ki=new Map,Ii=new Map,pa=[],F1="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Tm(t,e){switch(t){case"focusin":case"focusout":ha=null;break;case"dragenter":case"dragleave":ga=null;break;case"mouseover":case"mouseout":ma=null;break;case"pointerover":case"pointerout":Ki.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ii.delete(e.pointerId)}}function Ji(t,e,a,i,s,c){return t===null||t.nativeEvent!==c?(t={blockedOn:e,domEventName:a,eventSystemFlags:i,nativeEvent:c,targetContainers:[s]},e!==null&&(e=Qn(e),e!==null&&Nm(e)),t):(t.eventSystemFlags|=i,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function W1(t,e,a,i,s){switch(e){case"focusin":return ha=Ji(ha,t,e,a,i,s),!0;case"dragenter":return ga=Ji(ga,t,e,a,i,s),!0;case"mouseover":return ma=Ji(ma,t,e,a,i,s),!0;case"pointerover":var c=s.pointerId;return Ki.set(c,Ji(Ki.get(c)||null,t,e,a,i,s)),!0;case"gotpointercapture":return c=s.pointerId,Ii.set(c,Ji(Ii.get(c)||null,t,e,a,i,s)),!0}return!1}function zm(t){var e=Zn(t.target);if(e!==null){var a=f(e);if(a!==null){if(e=a.tag,e===13){if(e=d(a),e!==null){t.blockedOn=e,Co(t.priority,function(){Mm(a)});return}}else if(e===31){if(e=g(a),e!==null){t.blockedOn=e,Co(t.priority,function(){Mm(a)});return}}else if(e===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Xu(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var a=kc(t.nativeEvent);if(a===null){a=t.nativeEvent;var i=new a.constructor(a.type,a);Ks=i,a.target.dispatchEvent(i),Ks=null}else return e=Qn(a),e!==null&&Nm(e),t.blockedOn=a,!1;e.shift()}return!0}function Cm(t,e,a){Xu(t)&&a.delete(e)}function P1(){Ic=!1,ha!==null&&Xu(ha)&&(ha=null),ga!==null&&Xu(ga)&&(ga=null),ma!==null&&Xu(ma)&&(ma=null),Ki.forEach(Cm),Ii.forEach(Cm)}function Zu(t,e){t.blockedOn===e&&(t.blockedOn=null,Ic||(Ic=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,P1)))}var Qu=null;function Dm(t){Qu!==t&&(Qu=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Qu===t&&(Qu=null);for(var e=0;e<t.length;e+=3){var a=t[e],i=t[e+1],s=t[e+2];if(typeof i!="function"){if(Kc(i||a)===null)continue;break}var c=Qn(a);c!==null&&(t.splice(e,3),e-=3,kr(c,{pending:!0,data:s,method:a.method,action:i},i,s))}}))}function Xl(t){function e(O){return Zu(O,t)}ha!==null&&Zu(ha,t),ga!==null&&Zu(ga,t),ma!==null&&Zu(ma,t),Ki.forEach(e),Ii.forEach(e);for(var a=0;a<pa.length;a++){var i=pa[a];i.blockedOn===t&&(i.blockedOn=null)}for(;0<pa.length&&(a=pa[0],a.blockedOn===null);)zm(a),a.blockedOn===null&&pa.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(i=0;i<a.length;i+=3){var s=a[i],c=a[i+1],p=s[he]||null;if(typeof c=="function")p||Dm(a);else if(p){var b=null;if(c&&c.hasAttribute("formAction")){if(s=c,p=c[he]||null)b=p.formAction;else if(Kc(s)!==null)continue}else b=p.action;typeof b=="function"?a[i+1]=b:(a.splice(i,3),i-=3),Dm(a)}}}function Om(){function t(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(p){return s=p})},focusReset:"manual",scroll:"manual"})}function e(){s!==null&&(s(),s=null),i||setTimeout(a,20)}function a(){if(!i&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var i=!1,s=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",e),navigation.addEventListener("navigateerror",e),setTimeout(a,100),function(){i=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",e),navigation.removeEventListener("navigateerror",e),s!==null&&(s(),s=null)}}}function Jc(t){this._internalRoot=t}$u.prototype.render=Jc.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(u(409));var a=e.current,i=He();Em(a,i,t,e,null,null)},$u.prototype.unmount=Jc.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Em(t.current,2,null,t,null,null),Mu(),e[vn]=null}};function $u(t){this._internalRoot=t}$u.prototype.unstable_scheduleHydration=function(t){if(t){var e=zo();t={blockedOn:null,target:t,priority:e};for(var a=0;a<pa.length&&e!==0&&e<pa[a].priority;a++);pa.splice(a,0,t),a===0&&zm(t)}};var Rm=l.version;if(Rm!=="19.2.5")throw Error(u(527,Rm,"19.2.5"));R.findDOMNode=function(t){var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(u(188)):(t=Object.keys(t).join(","),Error(u(268,t)));return t=h(e),t=t!==null?v(t):null,t=t===null?null:t.stateNode,t};var tx={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:M,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ku=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ku.isDisabled&&ku.supportsFiber)try{Na=ku.inject(tx),me=ku}catch{}}return Wi.createRoot=function(t,e){if(!r(t))throw Error(u(299));var a=!1,i="",s=Yh,c=Vh,p=Gh;return e!=null&&(e.unstable_strictMode===!0&&(a=!0),e.identifierPrefix!==void 0&&(i=e.identifierPrefix),e.onUncaughtError!==void 0&&(s=e.onUncaughtError),e.onCaughtError!==void 0&&(c=e.onCaughtError),e.onRecoverableError!==void 0&&(p=e.onRecoverableError)),e=bm(t,1,!1,null,null,a,i,null,s,c,p,Om),t[vn]=e.current,Dc(t),new Jc(e)},Wi.hydrateRoot=function(t,e,a){if(!r(t))throw Error(u(299));var i=!1,s="",c=Yh,p=Vh,b=Gh,O=null;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(s=a.identifierPrefix),a.onUncaughtError!==void 0&&(c=a.onUncaughtError),a.onCaughtError!==void 0&&(p=a.onCaughtError),a.onRecoverableError!==void 0&&(b=a.onRecoverableError),a.formState!==void 0&&(O=a.formState)),e=bm(t,1,!0,e,a??null,i,s,O,c,p,b,Om),e.context=_m(null),a=e.current,i=He(),i=ii(i),s=ea(i),s.callback=null,na(a,s,i),a=i,e.current.lanes=a,Aa(e,a),rn(e),t[vn]=e.current,Dc(t),new $u(e)},Wi.version="19.2.5",Wi}var Xm;function rx(){if(Xm)return Pc.exports;Xm=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(l){console.error(l)}}return n(),Pc.exports=sx(),Pc.exports}var cx=rx();const Zm=n=>{let l;const o=new Set,u=(h,v)=>{const y=typeof h=="function"?h(l):h;if(!Object.is(y,l)){const x=l;l=v??(typeof y!="object"||y===null)?y:Object.assign({},l,y),o.forEach(S=>S(l,x))}},r=()=>l,g={setState:u,getState:r,getInitialState:()=>m,subscribe:h=>(o.add(h),()=>o.delete(h))},m=l=n(u,r,g);return g},fx=(n=>n?Zm(n):Zm),dx=n=>n;function hx(n,l=dx){const o=ao.useSyncExternalStore(n.subscribe,ao.useCallback(()=>l(n.getState()),[n,l]),ao.useCallback(()=>l(n.getInitialState()),[n,l]));return ao.useDebugValue(o),o}const Qm=n=>{const l=fx(n),o=u=>hx(l,u);return Object.assign(o,l),o},gx=(n=>n?Qm(n):Qm);function $m(n){return Array.isArray(n.images)}async function en(n,l){const o=await fetch(n,l),u=await o.json().catch(()=>({}));if(!o.ok){const r=u.error,f=typeof r=="string"?r:r?.message??`Request failed: ${o.status}`,d=new Error(f);throw d.status=o.status,typeof r!="string"&&r?.code&&(d.code=r.code),typeof u.currentVersion=="number"&&(d.currentVersion=u.currentVersion),d}return u}function af(n){const l=new URLSearchParams;n?.kind&&l.set("kind",n.kind),n?.sessionId&&l.set("sessionId",n.sessionId);const o=l.size>0?`?${l.toString()}`:"";return en(`/api/inflight${o}`)}async function km(n){await fetch(`/api/inflight/${encodeURIComponent(n)}`,{method:"DELETE"}).catch(()=>{})}function mx(){return en("/api/oauth/status")}function px(){return en("/api/billing")}function yx(n){return en("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}function Km(n=50){return en(`/api/history?limit=${n}`)}async function vx(n){const l=await fetch("/api/node/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),o=await l.json().catch(()=>({}));if(!l.ok){const u=o,r=u?.error?.message??`Request failed: ${l.status}`,f=new Error(r);throw f.code=u?.error?.code,f}return o}function xx(){return en("/api/sessions")}function Sx(n){return en("/api/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:n})})}function sp(n){return en(`/api/sessions/${encodeURIComponent(n)}`)}function bx(n,l){return en(`/api/sessions/${encodeURIComponent(n)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:l})})}function _x(n){return en(`/api/sessions/${encodeURIComponent(n)}`,{method:"DELETE"})}function Ex(n,l,o,u){return en(`/api/sessions/${encodeURIComponent(n)}/graph`,{method:"PUT",headers:{"Content-Type":"application/json","If-Match":String(l)},body:JSON.stringify({nodes:o,edges:u})})}function wx(n,l=256){return new Promise(o=>{const u=new Image;u.onload=()=>{const r=Math.min(1,l/Math.max(u.width,u.height)),f=document.createElement("canvas");f.width=u.width*r,f.height=u.height*r;const d=f.getContext("2d");if(!d)return o(n);d.drawImage(u,0,0,f.width,f.height),o(f.toDataURL("image/jpeg",.6))},u.onerror=()=>o(n),u.src=n})}function Im(n){return Math.round(n/16)*16}const Nx=[{value:"1024x1024",label:"1024²",sub:"1:1"},{value:"1536x1024",label:"1536×1024",sub:"3:2"},{value:"1024x1536",label:"1024×1536",sub:"2:3"}],Mx=[{value:"1360x1024",label:"1360×1024",sub:"4:3"},{value:"1024x1360",label:"1024×1360",sub:"3:4"},{value:"1824x1024",label:"1824×1024",sub:"16:9"}],Ax=[{value:"1024x1824",label:"1024×1824",sub:"9:16"},{value:"2048x2048",label:"2048²",sub:"2K 1:1"},{value:"2048x1152",label:"2048×1152",sub:"2K 16:9"}],Tx=[{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"}],zx=[{value:"auto",label:"auto",sub:"model"},{value:"custom",label:"Custom",sub:"free"}],Pi=()=>"nc_"+Math.random().toString(36).slice(2,10);function Jm(n,l){return{x:n*360,y:l*320}}function Cx(){try{const n=localStorage.getItem("ima2.rightPanelOpen");return n===null?!0:JSON.parse(n)===!0}catch{return!0}}function Dx(){try{const n=localStorage.getItem("ima2.uiMode");if(n==="node"||n==="classic")return n}catch{}return"classic"}const rp=18e4;function lf(){try{const n=localStorage.getItem("ima2.inFlight");if(!n)return[];const l=JSON.parse(n);if(!Array.isArray(l))return[];const o=Date.now();return l.filter(u=>u&&typeof u.id=="string"&&typeof u.prompt=="string"&&typeof u.startedAt=="number"&&o-u.startedAt<rp).map(u=>({id:u.id,prompt:u.prompt,startedAt:u.startedAt}))}catch{return[]}}function ka(n){try{localStorage.setItem("ima2.inFlight",JSON.stringify(n))}catch(l){const o=window;if(!o.__ima2QuotaWarned){o.__ima2QuotaWarned=!0,console.warn("[ima2] localStorage write failed:",l);try{ht.getState().showToast("Local storage full — recent state may not persist",!0)}catch{}}}}function Fm(){try{const n=localStorage.getItem("ima2.selectedFilename");return typeof n=="string"&&n.length>0?n:null}catch{return null}}function as(n){try{n?localStorage.setItem("ima2.selectedFilename",n):localStorage.removeItem("ima2.selectedFilename")}catch{}}const ls=200;function cp(n){const l=n.nodes.map(u=>{const r=u.data??{},f=typeof r.imageUrl=="string"&&r.imageUrl.length>0?r.imageUrl:null,d=typeof r.serverNodeId=="string"&&r.serverNodeId.length>0?`/generated/${r.serverNodeId}.png`:null,g=f??d,m={clientId:u.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,error:r.error,elapsed:r.elapsed,webSearchCalls:r.webSearchCalls};return{id:u.id,type:"imageNode",position:{x:u.x,y:u.y},data:m}}),o=n.edges.map(u=>({id:u.id,source:u.source,target:u.target}));return{graphNodes:l,graphEdges:o,graphVersion:n.graphVersion}}const ht=gx((n,l)=>({provider:"oauth",quality:"low",sizePreset:"1024x1024",customW:1920,customH:1088,format:"png",moderation:"low",count:1,prompt:"",referenceImages:[],addReferences:async o=>{const u=5-l().referenceImages.length,r=o.slice(0,Math.max(0,u)),d=(await Promise.all(r.map(g=>new Promise(m=>{const h=new FileReader;h.onload=()=>m(typeof h.result=="string"?h.result:null),h.onerror=()=>m(null),h.readAsDataURL(g)})))).filter(g=>!!g);n(g=>({referenceImages:[...g.referenceImages,...d].slice(0,5)})),o.length>u&&l().showToast("Maximum 5 references; extras ignored",!0)},addReferenceDataUrl:o=>{n(u=>u.referenceImages.length>=5?u:{referenceImages:[...u.referenceImages,o]})},removeReference:o=>{n(u=>({referenceImages:u.referenceImages.filter((r,f)=>f!==o)}))},clearReferences:()=>n({referenceImages:[]}),useCurrentAsReference:async()=>{const o=l().currentImage;if(!o){l().showToast("No current image to use",!0);return}if(l().referenceImages.length>=5){l().showToast("Reference slots are full (max 5)",!0);return}let u=o.image;if(!u.startsWith("data:"))try{const f=await(await fetch(u)).blob();u=await new Promise((d,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(f)})}catch{l().showToast("Could not fetch current image",!0);return}n(r=>({referenceImages:[...r.referenceImages,u]})),l().showToast("Added current image as reference")},activeGenerations:lf().length,inFlight:lf(),startInFlightPolling:()=>{if(typeof window>"u")return;const o=window;if(o.__ima2InflightTimer)return;const u=async()=>{if(l().inFlight.length===0){o.__ima2InflightTimer&&(clearInterval(o.__ima2InflightTimer),o.__ima2InflightTimer=void 0);return}try{const f=l().uiMode==="node"?"node":"classic",d=f==="node"?l().activeSessionId??void 0:void 0,{jobs:g}=await af({kind:f,sessionId:d}),m=new Map(g.map(S=>[S.requestId,S.phase]));let h=!1;const v=Date.now(),y=5e3,x=[];for(const S of l().inFlight){if(!m.has(S.id)&&v-S.startedAt>y){h=!0;continue}const _=m.get(S.id);_&&_!==S.phase?(h=!0,x.push({...S,phase:_})):x.push(S)}h&&(ka(x),n({inFlight:x,activeGenerations:x.length}))}catch{}try{const{items:f}=await Km(ls),d=f.map(y=>({image:y.url,filename:y.filename,thumb:y.url,prompt:y.prompt??void 0,size:y.size??void 0,quality:y.quality??void 0,format:y.format,createdAt:y.createdAt})),g=l().history,m=d.filter(y=>!g.some(x=>x.filename===y.filename));m.length>0&&n(y=>{const x=y.currentImage??m[0];return!y.currentImage&&m[0]?.filename&&as(m[0].filename),{history:[...m,...y.history].slice(0,ls),currentImage:x}});const h=Date.now(),v=l().inFlight.filter(y=>h-y.startedAt<rp);v.length!==l().inFlight.length&&(ka(v),n({inFlight:v,activeGenerations:v.length}))}catch{}};o.__ima2InflightTimer=window.setInterval(u,1500)},reconcileInflight:async()=>{try{const o=l().uiMode==="node"?"node":"classic",u=o==="node"?l().activeSessionId??void 0:void 0,{jobs:r}=await af({kind:o,sessionId:u}),f=new Set(r.map(v=>v.requestId)),d=Date.now(),m=l().inFlight.filter(v=>f.has(v.id)||d-v.startedAt<1e4),h=new Set(m.map(v=>v.id));for(const v of r)h.has(v.requestId)||m.push({id:v.requestId,prompt:v.prompt||"",startedAt:v.startedAt});ka(m),n({inFlight:m,activeGenerations:m.length}),m.length>0&&l().startInFlightPolling()}catch{}},syncFromStorage:()=>{const o=lf(),u=Fm();n(r=>({inFlight:o,activeGenerations:o.length,currentImage:u&&r.currentImage?.filename!==u?r.history.find(f=>f.filename===u)??r.currentImage:r.currentImage})),o.length>0&&l().startInFlightPolling()},currentImage:null,history:[],toast:null,rightPanelOpen:Cx(),toggleRightPanel:()=>n(o=>{const u=!o.rightPanelOpen;try{localStorage.setItem("ima2.rightPanelOpen",JSON.stringify(u))}catch{}return{rightPanelOpen:u}}),galleryOpen:!1,openGallery:()=>n({galleryOpen:!0}),closeGallery:()=>n({galleryOpen:!1}),uiMode:Dx(),setUIMode:o=>{try{localStorage.setItem("ima2.uiMode",o)}catch{}n({uiMode:o})},graphNodes:[],graphEdges:[],setGraphNodes:o=>{n({graphNodes:o}),l().scheduleGraphSave()},setGraphEdges:o=>{n({graphEdges:o}),l().scheduleGraphSave()},sessions:[],activeSessionId:null,activeSessionGraphVersion:null,sessionLoading:!1,async loadSessions(){try{const{sessions:o}=await xx();n({sessions:o});const u=l().activeSessionId;!u&&o.length>0?await l().switchSession(o[0].id):!u&&o.length===0&&await l().createAndSwitchSession("My first graph")}catch(o){console.warn("[sessions] load failed:",o)}},async switchSession(o){n({sessionLoading:!0}),await l().flushGraphSave();try{const{session:u}=await sp(o),{graphNodes:r,graphEdges:f,graphVersion:d}=cp(u);n({activeSessionId:o,activeSessionGraphVersion:d,graphNodes:r,graphEdges:f,sessionLoading:!1}),l().reconcileGraphPending()}catch(u){console.warn("[sessions] switch failed:",u),n({sessionLoading:!1}),l().showToast("Session load failed",!0)}},async reconcileGraphPending(){const o=l().activeSessionId;if(!o||l().graphNodes.filter(g=>g.data?.pendingRequestId&&(g.data.status==="pending"||g.data.status==="reconciling")).length===0)return;let r=[];try{r=(await af({kind:"node",sessionId:o})).jobs}catch{return}const f=new Map(r.map(g=>[g.requestId,g.phase])),d=l().graphNodes.map(g=>{const m=g.data?.pendingRequestId;if(!m||g.data.status!=="pending"&&g.data.status!=="reconciling")return g;if(f.has(m)){const v=f.get(m)??null;return{...g,data:{...g.data,status:"reconciling",pendingPhase:v}}}const h=!!g.data.imageUrl||!!g.data.serverNodeId;return{...g,data:{...g.data,pendingRequestId:null,pendingPhase:null,status:h?"ready":"stale",error:h?void 0:"Generation did not complete. Retry from this node."}}});n({graphNodes:d})},async createAndSwitchSession(o="Untitled"){try{const{session:u}=await Sx(o);n({sessions:[u,...l().sessions],activeSessionId:u.id,activeSessionGraphVersion:u.graphVersion,graphNodes:[],graphEdges:[]})}catch(u){console.warn("[sessions] create failed:",u),l().showToast("Create session failed",!0)}},async renameCurrentSession(o){const u=l().activeSessionId;if(u)try{await bx(u,o),n({sessions:l().sessions.map(r=>r.id===u?{...r,title:o,updatedAt:Date.now()}:r)})}catch{l().showToast("Rename failed",!0)}},async deleteSessionById(o){try{await _x(o);const u=l().sessions.filter(r=>r.id!==o);n({sessions:u}),l().activeSessionId===o&&(n({activeSessionId:null,activeSessionGraphVersion:null,graphNodes:[],graphEdges:[]}),u.length>0?await l().switchSession(u[0].id):await l().createAndSwitchSession("My first graph"))}catch{l().showToast("Delete failed",!0)}},scheduleGraphSave(){Hx(l,n)},async flushGraphSave(){await jx(l,n)},addRootNode:()=>{const o=Pi(),u=0,r=l().graphNodes.filter(d=>!d.data.parentServerNodeId).length,f={id:o,type:"imageNode",position:Jm(u,r),data:{clientId:o,serverNodeId:null,parentServerNodeId:null,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return n({graphNodes:[...l().graphNodes,f]}),l().scheduleGraphSave(),o},addChildNode:o=>{const u=l().graphNodes.find(m=>m.id===o);if(!u)return o;const r=Pi(),f=l().graphEdges.filter(m=>m.source===o).length,d={id:r,type:"imageNode",position:{x:u.position.x+360,y:u.position.y+f*320},data:{clientId:r,serverNodeId:null,parentServerNodeId:u.data.serverNodeId,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},g={id:`${o}->${r}`,source:o,target:r};return n({graphNodes:[...l().graphNodes,d],graphEdges:[...l().graphEdges,g]}),l().scheduleGraphSave(),r},addSiblingNode:o=>{const u=l().graphNodes.find(y=>y.id===o);if(!u)return o;const r=l().graphEdges.find(y=>y.target===o);if(!r){const y=Pi(),x=0,S=l().graphNodes.filter(T=>!T.data.parentServerNodeId).length,_={id:y,type:"imageNode",position:Jm(x,S),data:{clientId:y,serverNodeId:null,parentServerNodeId:null,prompt:u.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return n({graphNodes:[...l().graphNodes,_]}),l().scheduleGraphSave(),y}const f=r.source,d=l().graphNodes.find(y=>y.id===f);if(!d)return o;const g=Pi(),m=l().graphEdges.filter(y=>y.source===f).length,h={id:g,type:"imageNode",position:{x:d.position.x+360,y:d.position.y+m*320},data:{clientId:g,serverNodeId:null,parentServerNodeId:u.data.parentServerNodeId,prompt:u.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},v={id:`${f}->${g}`,source:f,target:g};return n({graphNodes:[...l().graphNodes,h],graphEdges:[...l().graphEdges,v]}),l().scheduleGraphSave(),g},updateNodePrompt:(o,u)=>{n({graphNodes:l().graphNodes.map(r=>r.id===o?{...r,data:{...r.data,prompt:u}}:r)}),l().scheduleGraphSave()},async generateNode(o){const r=l().graphNodes.find(S=>S.id===o)?.data.status==="ready"?l().addSiblingNode(o):o,f=l().graphNodes.find(S=>S.id===r);if(!f)return;const{prompt:d,parentServerNodeId:g}=f.data;if(!d.trim()){l().showToast("Prompt required",!0);return}const m=l(),h=m.getResolvedSize(),v=`fn_${r}`,y=Date.now(),x=[...m.inFlight,{id:v,prompt:d,startedAt:y}];ka(x),n({graphNodes:l().graphNodes.map(S=>S.id===r?{...S,data:{...S.data,status:"pending",pendingRequestId:v,pendingPhase:"queued",error:void 0}}:S),activeGenerations:m.activeGenerations+1,inFlight:x}),l().startInFlightPolling();try{const S=await vx({parentNodeId:g,prompt:d,quality:m.quality,size:h,format:m.format,requestId:v,...m.referenceImages.length&&!g?{references:m.referenceImages.map(_=>_.replace(/^data:[^;]+;base64,/,""))}:{}});n({graphNodes:l().graphNodes.map(_=>_.id===r?{..._,data:{..._.data,serverNodeId:S.nodeId,imageUrl:S.url,status:"ready",pendingRequestId:null,pendingPhase:null,elapsed:S.elapsed,webSearchCalls:S.webSearchCalls}}:_)}),l().showToast(`Node ${S.nodeId.slice(0,8)}… in ${S.elapsed}s`)}catch(S){const _=S instanceof Error?S.message:"Node generation failed";n({graphNodes:l().graphNodes.map(T=>T.id===r?{...T,data:{...T.data,status:"error",pendingRequestId:null,pendingPhase:null,error:_}}:T)}),l().showToast(_,!0)}finally{const S=l().inFlight.filter(_=>_.id!==v);ka(S),n({activeGenerations:Math.max(0,l().activeGenerations-1),inFlight:S}),l().scheduleGraphSave()}},deleteNode:o=>{const r=l().graphNodes.find(f=>f.id===o)?.data?.pendingRequestId;r&&km(r),n({graphNodes:l().graphNodes.filter(f=>f.id!==o),graphEdges:l().graphEdges.filter(f=>f.source!==o&&f.target!==o)}),l().scheduleGraphSave()},deleteNodes:o=>{const u=new Set(o);for(const r of l().graphNodes)u.has(r.id)&&r.data?.pendingRequestId&&km(r.data.pendingRequestId);n({graphNodes:l().graphNodes.filter(r=>!u.has(r.id)),graphEdges:l().graphEdges.filter(r=>!u.has(r.source)&&!u.has(r.target))}),l().scheduleGraphSave()},addChildNodeAt:(o,u)=>{const r=l().graphNodes.find(m=>m.id===o);if(!r)return o;const f=Pi(),d={id:f,type:"imageNode",position:u,data:{clientId:f,serverNodeId:null,parentServerNodeId:r.data.serverNodeId,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},g={id:`${o}->${f}`,source:o,target:f};return n({graphNodes:[...l().graphNodes,d],graphEdges:[...l().graphEdges,g]}),l().scheduleGraphSave(),f},connectNodes:(o,u)=>{if(o===u||l().graphEdges.find(d=>d.source===o&&d.target===u))return;const f=l().graphNodes.find(d=>d.id===o);f&&(n({graphNodes:l().graphNodes.map(d=>d.id===u?{...d,data:{...d.data,parentServerNodeId:f.data.serverNodeId}}:d),graphEdges:[...l().graphEdges,{id:`${o}->${u}`,source:o,target:u}]}),l().scheduleGraphSave())},setProvider:o=>n({provider:o}),setQuality:o=>n({quality:o}),setSizePreset:o=>n({sizePreset:o}),setCustomSize:(o,u)=>n({customW:Im(o),customH:Im(u)}),setFormat:o=>n({format:o}),setModeration:o=>n({moderation:o}),setCount:o=>n({count:o}),setPrompt:o=>n({prompt:o}),selectHistory:o=>{as(o.filename??null),n({currentImage:o})},getResolvedSize:()=>{const{sizePreset:o,customW:u,customH:r}=l();return o==="custom"?`${u}x${r}`:o},async generate(){const o=l(),u=o.prompt.trim();if(!u)return;const r=o.getResolvedSize(),f=`f_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,d=Date.now(),g=[...o.inFlight,{id:f,prompt:u,startedAt:d}];ka(g),n({activeGenerations:o.activeGenerations+1,inFlight:g}),l().startInFlightPolling();try{const m={prompt:u,quality:o.quality,size:r,format:o.format,moderation:o.moderation,provider:o.provider,n:o.count,requestId:f,...o.referenceImages.length?{references:o.referenceImages.map(v=>v.replace(/^data:[^;]+;base64,/,""))}:{}},h=await yx(m);if($m(h)&&h.images.length>1){for(const v of h.images){const y={image:v.image,filename:v.filename,prompt:u,elapsed:h.elapsed,provider:h.provider,usage:h.usage,quality:h.quality??o.quality,size:h.size??r};await Wm(y,n,l)}l().showToast(`${h.images.length} images in ${h.elapsed}s`)}else{let v;if($m(h)){const y=h.images[0];v={image:y.image,filename:y.filename,prompt:u,elapsed:h.elapsed,provider:h.provider,usage:h.usage,quality:h.quality??o.quality,size:h.size??r}}else v={image:h.image,filename:h.filename,prompt:u,elapsed:h.elapsed,provider:h.provider,usage:h.usage,quality:h.quality??o.quality,size:h.size??r};await Wm(v,n,l),l().showToast(`Generated in ${h.elapsed}s`)}}catch(m){const h=m instanceof Error?m.message:"Generation failed";l().showToast(h,!0)}finally{const m=l().inFlight.filter(h=>h.id!==f);ka(m),n({activeGenerations:Math.max(0,l().activeGenerations-1),inFlight:m})}},hydrateHistory(){(async()=>{try{const u=(await Km(ls)).items.map(r=>({image:r.url,url:r.url,filename:r.filename,prompt:r.prompt||void 0,provider:r.provider,quality:r.quality||void 0,size:r.size||void 0,usage:r.usage??void 0,thumb:r.url,createdAt:r.createdAt}));if(u.length>0){const r=Fm(),f=r?u.find(d=>d.filename===r):null;n({history:u,currentImage:f??u[0]}),f||as(u[0]?.filename??null)}}catch(o){console.warn("[history] load failed:",o)}})()},showToast(o,u=!1){n({toast:{message:o,error:u,id:Date.now()+Math.random()}})}})),Ox=800;let fn=null,cs=null;async function Rx(n,l){const o=n().activeSessionId;if(!o)return;const{session:u}=await sp(o),{graphNodes:r,graphEdges:f,graphVersion:d}=cp(u);l({graphNodes:r,graphEdges:f,activeSessionGraphVersion:d}),n().showToast("Session changed in another tab — reloaded latest graph",!0)}function fp(n,l){const o=n().activeSessionId,u=n().activeSessionGraphVersion;if(!o||u==null)return Promise.resolve();const{graphNodes:r,graphEdges:f}=n(),d=r.map(m=>({id:m.id,x:m.position.x,y:m.position.y,data:m.data})),g=f.map(m=>({id:m.id,source:m.source,target:m.target,data:{}}));return Ex(o,u,d,g).then(m=>{l({activeSessionGraphVersion:m.graphVersion})}).catch(async m=>{if(m.status===409){await Rx(n,l);return}console.warn("[sessions] save failed:",m)})}function Hx(n,l){const o=n();o.activeSessionId&&(o.sessionLoading||(fn&&clearTimeout(fn),fn=setTimeout(()=>{fn=null,cs=fp(n,l).finally(()=>{cs=null})},Ox)))}async function jx(n,l){fn?(clearTimeout(fn),fn=null,await fp(n,l)):cs&&await cs}function Ux(n){const l=n();if(!l.activeSessionId||l.activeSessionGraphVersion==null)return;fn&&(clearTimeout(fn),fn=null);const o=l.graphNodes.map(d=>({id:d.id,x:d.position.x,y:d.position.y,data:d.data})),u=l.graphEdges.map(d=>({id:d.id,source:d.source,target:d.target,data:{}})),r=`/api/sessions/${encodeURIComponent(l.activeSessionId)}/graph`,f=JSON.stringify({nodes:o,edges:u});try{fetch(r,{method:"PUT",headers:{"Content-Type":"application/json","If-Match":String(l.activeSessionGraphVersion)},body:f,keepalive:!0})}catch{}}async function Wm(n,l,o){const u=await wx(n.image).catch(()=>n.image),r=n.filename?`/generated/${n.filename}`:n.image,f={...n,thumb:u,url:r,createdAt:n.createdAt||Date.now()},d=[f,...o().history].slice(0,ls);as(f.filename??null),l({history:d,currentImage:f})}function Bx(){const[n,l]=J.useState(null);return J.useEffect(()=>{let o=!1,u=null;const r=async()=>{try{const f=await mx();if(o)return;l(f),f.status==="starting"&&(u=setTimeout(r,3e3))}catch{o||l(null)}};return r(),()=>{o=!0,u&&clearTimeout(u)}},[]),n}function dp(){const[n,l]=J.useState(null),[o,u]=J.useState(!1);return J.useEffect(()=>{let r=!1;return px().then(f=>{r||l(f)}).catch(()=>{r||u(!0)}),()=>{r=!0}},[]),{data:n,error:o}}function qx({open:n,providerLabel:l,reason:o,hint:u,onClose:r}){return J.useEffect(()=>{if(!n)return;const f=d=>{d.key==="Escape"&&r()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[n,r]),n?w.jsx("div",{className:"modal-backdrop",onClick:r,role:"presentation",children:w.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true","aria-label":`${l} unavailable`,onClick:f=>f.stopPropagation(),children:[w.jsxs("div",{className:"modal__title",children:[l," unavailable"]}),w.jsxs("div",{className:"modal__body",children:[w.jsx("p",{children:o}),u?w.jsx("p",{className:"modal__hint",children:u}):null]}),w.jsx("div",{className:"modal__actions",children:w.jsx("button",{type:"button",className:"modal__btn",onClick:r,children:"OK"})})]})}):null}function Lx(){const n=Bx(),{data:l}=dp(),o=n?.status==="ready";let u="OAuth proxy not ready yet.",r;n?.status==="auth_required"?(u="Codex login required.",r="Run `codex login` in a terminal, then reload this page."):n?.status==="starting"?u="OAuth proxy is starting. Wait a few seconds and try again.":n||(u="Cannot reach the server. Check that the backend is running.");const f=l?.apiKeyValid===!0;return{oauth:{ok:o,reason:u,hint:r},api:{ok:f,reason:f?"":"API key is not configured or invalid. Set OPENAI_API_KEY in the server .env file."}}}const Pm=[{value:"oauth",label:"OAuth"},{value:"api",label:"API Key"}];function Yx(){const n=ht(g=>g.provider),l=ht(g=>g.setProvider),o=Lx(),[u,r]=J.useState(null),f=g=>{o[g].ok?l(g):r(g)},d=u?{label:Pm.find(g=>g.value===u).label,...o[u]}:null;return w.jsxs(w.Fragment,{children:[w.jsx("div",{className:"section-title",children:"Provider"}),w.jsx("div",{className:"provider-row",children:Pm.map(g=>{const m=n===g.value,h=o[g.value].ok;return w.jsxs("button",{type:"button",className:`provider-pill${m?" selected":""}`,onClick:()=>f(g.value),title:h?`${g.label} ready`:o[g.value].reason,"aria-label":`${g.label}: ${h?"ready":"unavailable"}`,"aria-pressed":m,children:[w.jsx("span",{className:`status-dot ${h?"status-dot--ok":"status-dot--bad"}`,"aria-hidden":"true"}),w.jsx("span",{children:g.label}),w.jsx("span",{className:"sr-only",children:h?"(ready)":"(unavailable)"})]},g.value)})}),w.jsx(qx,{open:!!d,providerLabel:d?.label??"",reason:d?.reason??"",hint:d?.hint,onClose:()=>r(null)})]})}function Vx(){return ht(n=>n.uiMode),ht(n=>n.setUIMode),null}const Zl=5;function Gx(){const n=ht(N=>N.prompt),l=ht(N=>N.setPrompt),o=ht(N=>N.generate),u=ht(N=>N.referenceImages),r=ht(N=>N.addReferences),f=ht(N=>N.removeReference),d=ht(N=>N.useCurrentAsReference),g=ht(N=>N.currentImage),m=J.useRef(null),[h,v]=J.useState(!1),y=u.length<Zl,x=N=>{N.preventDefault(),v(!1);const j=Array.from(N.dataTransfer.files).filter(E=>E.type.startsWith("image/"));j.length>0&&r(j)},S=N=>{N.preventDefault(),h||v(!0)},_=N=>{N.currentTarget.contains(N.relatedTarget)||v(!1)},T=N=>{if(!N)return[];const j=[];for(const E of Array.from(N)){if(E.kind!=="file"||!E.type.startsWith("image/"))continue;const z=E.getAsFile();z&&j.push(z)}return j},C=N=>{if(!y)return;const j=T(N.clipboardData?.items??null);if(j.length===0)return;N.preventDefault();const E=Zl-u.length;r(j.slice(0,E))};return J.useEffect(()=>{const N=j=>{const E=j.target,z=E?.tagName;if(z==="INPUT"||z==="TEXTAREA"||E?.isContentEditable)return;const Y=T(j.clipboardData?.items??null);if(Y.length===0||u.length>=Zl)return;j.preventDefault();const q=Zl-u.length;r(Y.slice(0,q))};return window.addEventListener("paste",N),()=>window.removeEventListener("paste",N)},[u.length,r]),w.jsxs("div",{className:`composer${h?" composer--drag":""}`,onDrop:x,onDragOver:S,onDragLeave:_,onPaste:C,children:[w.jsxs("div",{className:"composer__header",children:[w.jsx("span",{className:"section-title composer__label",children:"Prompt"}),u.length>0&&w.jsxs("span",{className:"composer__count",children:[u.length,"/",Zl," refs"]})]}),u.length>0&&w.jsx("div",{className:"composer__chips",children:u.map((N,j)=>w.jsxs("div",{className:"composer__chip",title:`Reference ${j+1}`,children:[w.jsx("img",{src:N,alt:`reference ${j+1}`}),w.jsx("button",{type:"button",className:"composer__chip-remove",onClick:()=>f(j),"aria-label":`Remove reference ${j+1}`,children:"✕"})]},j))}),w.jsx("textarea",{className:"prompt-area composer__textarea",value:n,placeholder:u.length>0?"Describe what to do with the attached image(s)…":"Describe the image, drag & drop, or paste (⌘/Ctrl+V) to attach…",onChange:N=>l(N.target.value),onKeyDown:N=>{N.key==="Enter"&&(N.metaKey||N.ctrlKey)&&(N.preventDefault(),o())}}),w.jsxs("div",{className:"composer__toolbar",children:[w.jsxs("button",{type:"button",className:"composer__tool",onClick:()=>y&&m.current?.click(),disabled:!y,title:"Attach reference image","aria-label":"Attach reference image",children:[w.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:w.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"})}),w.jsx("span",{children:"Attach"})]}),w.jsxs("button",{type:"button",className:"composer__tool",onClick:()=>{d()},disabled:!g||!y,title:"Use current result as reference",children:[w.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:[w.jsx("polyline",{points:"23 4 23 10 17 10"}),w.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),w.jsx("span",{children:"Use current"})]}),w.jsx("span",{className:"composer__hint",children:"⌘/Ctrl + Enter to generate"})]}),h&&w.jsxs("div",{className:"composer__dropzone","aria-hidden":"true",children:["Drop to attach as reference (max ",Zl,")"]}),w.jsx("input",{ref:m,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:N=>{const j=Array.from(N.target.files??[]);j.length>0&&r(j),N.target.value=""}})]})}function Xx(){const n=ht(r=>r.activeGenerations),l=ht(r=>r.generate),o=n>0,u=o?`Generate (${n})`:"Generate";return w.jsx("button",{type:"button",className:`generate-btn${o?" loading":""}`,onClick:()=>{l()},children:u})}function Zx(n,l=28){const o=n.trim().replace(/\s+/g," ");return o.length>l?o.slice(0,l)+"…":o}const Qx={queued:"queued",streaming:"streaming",decoding:"finalizing"};function $x(){const n=ht(l=>l.inFlight);return n.length===0?null:w.jsx("ul",{className:"in-flight-list",children:n.map(l=>{const o=l.phase?Qx[l.phase]??l.phase:"queued";return w.jsxs("li",{className:"in-flight-item","data-phase":l.phase??"queued",children:[w.jsx("span",{className:"in-flight-prompt",children:Zx(l.prompt)}),w.jsx("span",{className:"in-flight-phase",children:o}),w.jsx("span",{className:"in-flight-spinner","aria-hidden":"true"})]},l.id)})})}function kx(){const n=ht(r=>r.history),l=ht(r=>r.currentImage),o=ht(r=>r.selectHistory),u=ht(r=>r.openGallery);return w.jsxs("div",{className:"history-strip",children:[w.jsx("button",{type:"button",className:"history-thumb history-thumb--add",onClick:u,"aria-label":"Open gallery",title:"Open full gallery",children:w.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[w.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),w.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),w.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),w.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})}),n.map((r,f)=>{const d=l?.image===r.image;return w.jsx("img",{src:r.thumb||r.image,alt:"",className:`history-thumb${d?" active":""}`,onClick:()=>o(r)},`${f}-${r.filename??f}`)})]})}function Kx(){return ht(n=>n.uiMode),w.jsxs("aside",{className:"sidebar",children:[w.jsxs("div",{className:"sidebar__scroll",children:[w.jsxs("div",{className:"logo",children:[w.jsx("div",{className:"logo-dot"}),"Image Gen",w.jsx("span",{className:"logo-badge",children:"gpt-image-2"})]}),w.jsx(Vx,{}),w.jsxs(w.Fragment,{children:[w.jsx(Yx,{}),w.jsx(Gx,{}),w.jsx(Xx,{}),w.jsx($x,{})]})]}),w.jsx(kx,{})]})}function Ix(){const n=ht(f=>f.currentImage),l=ht(f=>f.showToast);if(!n)return null;const o=()=>{const f=document.createElement("a");f.href=n.image,f.download=n.filename||"generated.png",f.click()},u=async()=>{try{const d=await(await fetch(n.image)).blob();await navigator.clipboard.write([new ClipboardItem({[d.type]:d})]),l("Copied to clipboard")}catch{l("Copy failed",!0)}},r=()=>{n.prompt&&(navigator.clipboard.writeText(n.prompt),l("Prompt copied"))};return w.jsxs("div",{className:"result-actions",children:[w.jsx("button",{type:"button",className:"action-btn",onClick:o,children:"Download"}),w.jsx("button",{type:"button",className:"action-btn",onClick:u,children:"Copy to clipboard"}),w.jsx("button",{type:"button",className:"action-btn",onClick:r,children:"Copy prompt"})]})}function Jx(){const n=ht(m=>m.currentImage),l=ht(m=>m.activeGenerations),o=ht(m=>m.quality),u=ht(m=>m.getResolvedSize),r=ht(m=>m.showToast),f=()=>{n?.prompt&&(navigator.clipboard.writeText(n.prompt),r("Prompt copied"))},d=n?.quality??o,g=n?.size??u();return w.jsxs("main",{className:"canvas",children:[w.jsx("div",{className:`progress-bar${l>0?" active":""}`}),n?w.jsxs("div",{className:"result-container visible",children:[w.jsx("img",{className:"result-img",src:n.url??n.image,alt:"result"}),n.prompt?w.jsx("div",{className:"result-prompt",onClick:f,children:n.prompt}):null,w.jsx("div",{className:"result-meta",children:[n.elapsed!=null?`${n.elapsed}s`:null,n.usage?`${n.usage.total_tokens??"?"} tokens`:null,d,g,n.provider??null].filter(m=>!!m).join(" · ")}),w.jsx(Ix,{})]}):null]})}function ae(n){if(typeof n=="string"||typeof n=="number")return""+n;let l="";if(Array.isArray(n))for(let o=0,u;o<n.length;o++)(u=ae(n[o]))!==""&&(l+=(l&&" ")+u);else for(let o in n)n[o]&&(l+=(l&&" ")+o);return l}var Fx={value:()=>{}};function _s(){for(var n=0,l=arguments.length,o={},u;n<l;++n){if(!(u=arguments[n]+"")||u in o||/[\s.]/.test(u))throw new Error("illegal type: "+u);o[u]=[]}return new is(o)}function is(n){this._=n}function Wx(n,l){return n.trim().split(/^|\s+/).map(function(o){var u="",r=o.indexOf(".");if(r>=0&&(u=o.slice(r+1),o=o.slice(0,r)),o&&!l.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:u}})}is.prototype=_s.prototype={constructor:is,on:function(n,l){var o=this._,u=Wx(n+"",o),r,f=-1,d=u.length;if(arguments.length<2){for(;++f<d;)if((r=(n=u[f]).type)&&(r=Px(o[r],n.name)))return r;return}if(l!=null&&typeof l!="function")throw new Error("invalid callback: "+l);for(;++f<d;)if(r=(n=u[f]).type)o[r]=t0(o[r],n.name,l);else if(l==null)for(r in o)o[r]=t0(o[r],n.name,null);return this},copy:function(){var n={},l=this._;for(var o in l)n[o]=l[o].slice();return new is(n)},call:function(n,l){if((r=arguments.length-2)>0)for(var o=new Array(r),u=0,r,f;u<r;++u)o[u]=arguments[u+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(f=this._[n],u=0,r=f.length;u<r;++u)f[u].value.apply(l,o)},apply:function(n,l,o){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var u=this._[n],r=0,f=u.length;r<f;++r)u[r].value.apply(l,o)}};function Px(n,l){for(var o=0,u=n.length,r;o<u;++o)if((r=n[o]).name===l)return r.value}function t0(n,l,o){for(var u=0,r=n.length;u<r;++u)if(n[u].name===l){n[u]=Fx,n=n.slice(0,u).concat(n.slice(u+1));break}return o!=null&&n.push({name:l,value:o}),n}var xf="http://www.w3.org/1999/xhtml";const e0={svg:"http://www.w3.org/2000/svg",xhtml:xf,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Es(n){var l=n+="",o=l.indexOf(":");return o>=0&&(l=n.slice(0,o))!=="xmlns"&&(n=n.slice(o+1)),e0.hasOwnProperty(l)?{space:e0[l],local:n}:n}function tS(n){return function(){var l=this.ownerDocument,o=this.namespaceURI;return o===xf&&l.documentElement.namespaceURI===xf?l.createElement(n):l.createElementNS(o,n)}}function eS(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function hp(n){var l=Es(n);return(l.local?eS:tS)(l)}function nS(){}function Hf(n){return n==null?nS:function(){return this.querySelector(n)}}function aS(n){typeof n!="function"&&(n=Hf(n));for(var l=this._groups,o=l.length,u=new Array(o),r=0;r<o;++r)for(var f=l[r],d=f.length,g=u[r]=new Array(d),m,h,v=0;v<d;++v)(m=f[v])&&(h=n.call(m,m.__data__,v,f))&&("__data__"in m&&(h.__data__=m.__data__),g[v]=h);return new Ue(u,this._parents)}function lS(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function iS(){return[]}function gp(n){return n==null?iS:function(){return this.querySelectorAll(n)}}function oS(n){return function(){return lS(n.apply(this,arguments))}}function uS(n){typeof n=="function"?n=oS(n):n=gp(n);for(var l=this._groups,o=l.length,u=[],r=[],f=0;f<o;++f)for(var d=l[f],g=d.length,m,h=0;h<g;++h)(m=d[h])&&(u.push(n.call(m,m.__data__,h,d)),r.push(m));return new Ue(u,r)}function mp(n){return function(){return this.matches(n)}}function pp(n){return function(l){return l.matches(n)}}var sS=Array.prototype.find;function rS(n){return function(){return sS.call(this.children,n)}}function cS(){return this.firstElementChild}function fS(n){return this.select(n==null?cS:rS(typeof n=="function"?n:pp(n)))}var dS=Array.prototype.filter;function hS(){return Array.from(this.children)}function gS(n){return function(){return dS.call(this.children,n)}}function mS(n){return this.selectAll(n==null?hS:gS(typeof n=="function"?n:pp(n)))}function pS(n){typeof n!="function"&&(n=mp(n));for(var l=this._groups,o=l.length,u=new Array(o),r=0;r<o;++r)for(var f=l[r],d=f.length,g=u[r]=[],m,h=0;h<d;++h)(m=f[h])&&n.call(m,m.__data__,h,f)&&g.push(m);return new Ue(u,this._parents)}function yp(n){return new Array(n.length)}function yS(){return new Ue(this._enter||this._groups.map(yp),this._parents)}function fs(n,l){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=l}fs.prototype={constructor:fs,appendChild:function(n){return this._parent.insertBefore(n,this._next)},insertBefore:function(n,l){return this._parent.insertBefore(n,l)},querySelector:function(n){return this._parent.querySelector(n)},querySelectorAll:function(n){return this._parent.querySelectorAll(n)}};function vS(n){return function(){return n}}function xS(n,l,o,u,r,f){for(var d=0,g,m=l.length,h=f.length;d<h;++d)(g=l[d])?(g.__data__=f[d],u[d]=g):o[d]=new fs(n,f[d]);for(;d<m;++d)(g=l[d])&&(r[d]=g)}function SS(n,l,o,u,r,f,d){var g,m,h=new Map,v=l.length,y=f.length,x=new Array(v),S;for(g=0;g<v;++g)(m=l[g])&&(x[g]=S=d.call(m,m.__data__,g,l)+"",h.has(S)?r[g]=m:h.set(S,m));for(g=0;g<y;++g)S=d.call(n,f[g],g,f)+"",(m=h.get(S))?(u[g]=m,m.__data__=f[g],h.delete(S)):o[g]=new fs(n,f[g]);for(g=0;g<v;++g)(m=l[g])&&h.get(x[g])===m&&(r[g]=m)}function bS(n){return n.__data__}function _S(n,l){if(!arguments.length)return Array.from(this,bS);var o=l?SS:xS,u=this._parents,r=this._groups;typeof n!="function"&&(n=vS(n));for(var f=r.length,d=new Array(f),g=new Array(f),m=new Array(f),h=0;h<f;++h){var v=u[h],y=r[h],x=y.length,S=ES(n.call(v,v&&v.__data__,h,u)),_=S.length,T=g[h]=new Array(_),C=d[h]=new Array(_),N=m[h]=new Array(x);o(v,y,T,C,N,S,l);for(var j=0,E=0,z,Y;j<_;++j)if(z=T[j]){for(j>=E&&(E=j+1);!(Y=C[E])&&++E<_;);z._next=Y||null}}return d=new Ue(d,u),d._enter=g,d._exit=m,d}function ES(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function wS(){return new Ue(this._exit||this._groups.map(yp),this._parents)}function NS(n,l,o){var u=this.enter(),r=this,f=this.exit();return typeof n=="function"?(u=n(u),u&&(u=u.selection())):u=u.append(n+""),l!=null&&(r=l(r),r&&(r=r.selection())),o==null?f.remove():o(f),u&&r?u.merge(r).order():r}function MS(n){for(var l=n.selection?n.selection():n,o=this._groups,u=l._groups,r=o.length,f=u.length,d=Math.min(r,f),g=new Array(r),m=0;m<d;++m)for(var h=o[m],v=u[m],y=h.length,x=g[m]=new Array(y),S,_=0;_<y;++_)(S=h[_]||v[_])&&(x[_]=S);for(;m<r;++m)g[m]=o[m];return new Ue(g,this._parents)}function AS(){for(var n=this._groups,l=-1,o=n.length;++l<o;)for(var u=n[l],r=u.length-1,f=u[r],d;--r>=0;)(d=u[r])&&(f&&d.compareDocumentPosition(f)^4&&f.parentNode.insertBefore(d,f),f=d);return this}function TS(n){n||(n=zS);function l(y,x){return y&&x?n(y.__data__,x.__data__):!y-!x}for(var o=this._groups,u=o.length,r=new Array(u),f=0;f<u;++f){for(var d=o[f],g=d.length,m=r[f]=new Array(g),h,v=0;v<g;++v)(h=d[v])&&(m[v]=h);m.sort(l)}return new Ue(r,this._parents).order()}function zS(n,l){return n<l?-1:n>l?1:n>=l?0:NaN}function CS(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function DS(){return Array.from(this)}function OS(){for(var n=this._groups,l=0,o=n.length;l<o;++l)for(var u=n[l],r=0,f=u.length;r<f;++r){var d=u[r];if(d)return d}return null}function RS(){let n=0;for(const l of this)++n;return n}function HS(){return!this.node()}function jS(n){for(var l=this._groups,o=0,u=l.length;o<u;++o)for(var r=l[o],f=0,d=r.length,g;f<d;++f)(g=r[f])&&n.call(g,g.__data__,f,r);return this}function US(n){return function(){this.removeAttribute(n)}}function BS(n){return function(){this.removeAttributeNS(n.space,n.local)}}function qS(n,l){return function(){this.setAttribute(n,l)}}function LS(n,l){return function(){this.setAttributeNS(n.space,n.local,l)}}function YS(n,l){return function(){var o=l.apply(this,arguments);o==null?this.removeAttribute(n):this.setAttribute(n,o)}}function VS(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 GS(n,l){var o=Es(n);if(arguments.length<2){var u=this.node();return o.local?u.getAttributeNS(o.space,o.local):u.getAttribute(o)}return this.each((l==null?o.local?BS:US:typeof l=="function"?o.local?VS:YS:o.local?LS:qS)(o,l))}function vp(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function XS(n){return function(){this.style.removeProperty(n)}}function ZS(n,l,o){return function(){this.style.setProperty(n,l,o)}}function QS(n,l,o){return function(){var u=l.apply(this,arguments);u==null?this.style.removeProperty(n):this.style.setProperty(n,u,o)}}function $S(n,l,o){return arguments.length>1?this.each((l==null?XS:typeof l=="function"?QS:ZS)(n,l,o??"")):Jl(this.node(),n)}function Jl(n,l){return n.style.getPropertyValue(l)||vp(n).getComputedStyle(n,null).getPropertyValue(l)}function kS(n){return function(){delete this[n]}}function KS(n,l){return function(){this[n]=l}}function IS(n,l){return function(){var o=l.apply(this,arguments);o==null?delete this[n]:this[n]=o}}function JS(n,l){return arguments.length>1?this.each((l==null?kS:typeof l=="function"?IS:KS)(n,l)):this.node()[n]}function xp(n){return n.trim().split(/^|\s+/)}function jf(n){return n.classList||new Sp(n)}function Sp(n){this._node=n,this._names=xp(n.getAttribute("class")||"")}Sp.prototype={add:function(n){var l=this._names.indexOf(n);l<0&&(this._names.push(n),this._node.setAttribute("class",this._names.join(" ")))},remove:function(n){var l=this._names.indexOf(n);l>=0&&(this._names.splice(l,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(n){return this._names.indexOf(n)>=0}};function bp(n,l){for(var o=jf(n),u=-1,r=l.length;++u<r;)o.add(l[u])}function _p(n,l){for(var o=jf(n),u=-1,r=l.length;++u<r;)o.remove(l[u])}function FS(n){return function(){bp(this,n)}}function WS(n){return function(){_p(this,n)}}function PS(n,l){return function(){(l.apply(this,arguments)?bp:_p)(this,n)}}function tb(n,l){var o=xp(n+"");if(arguments.length<2){for(var u=jf(this.node()),r=-1,f=o.length;++r<f;)if(!u.contains(o[r]))return!1;return!0}return this.each((typeof l=="function"?PS:l?FS:WS)(o,l))}function eb(){this.textContent=""}function nb(n){return function(){this.textContent=n}}function ab(n){return function(){var l=n.apply(this,arguments);this.textContent=l??""}}function lb(n){return arguments.length?this.each(n==null?eb:(typeof n=="function"?ab:nb)(n)):this.node().textContent}function ib(){this.innerHTML=""}function ob(n){return function(){this.innerHTML=n}}function ub(n){return function(){var l=n.apply(this,arguments);this.innerHTML=l??""}}function sb(n){return arguments.length?this.each(n==null?ib:(typeof n=="function"?ub:ob)(n)):this.node().innerHTML}function rb(){this.nextSibling&&this.parentNode.appendChild(this)}function cb(){return this.each(rb)}function fb(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function db(){return this.each(fb)}function hb(n){var l=typeof n=="function"?n:hp(n);return this.select(function(){return this.appendChild(l.apply(this,arguments))})}function gb(){return null}function mb(n,l){var o=typeof n=="function"?n:hp(n),u=l==null?gb:typeof l=="function"?l:Hf(l);return this.select(function(){return this.insertBefore(o.apply(this,arguments),u.apply(this,arguments)||null)})}function pb(){var n=this.parentNode;n&&n.removeChild(this)}function yb(){return this.each(pb)}function vb(){var n=this.cloneNode(!1),l=this.parentNode;return l?l.insertBefore(n,this.nextSibling):n}function xb(){var n=this.cloneNode(!0),l=this.parentNode;return l?l.insertBefore(n,this.nextSibling):n}function Sb(n){return this.select(n?xb:vb)}function bb(n){return arguments.length?this.property("__data__",n):this.node().__data__}function _b(n){return function(l){n.call(this,l,this.__data__)}}function Eb(n){return n.trim().split(/^|\s+/).map(function(l){var o="",u=l.indexOf(".");return u>=0&&(o=l.slice(u+1),l=l.slice(0,u)),{type:l,name:o}})}function wb(n){return function(){var l=this.__on;if(l){for(var o=0,u=-1,r=l.length,f;o<r;++o)f=l[o],(!n.type||f.type===n.type)&&f.name===n.name?this.removeEventListener(f.type,f.listener,f.options):l[++u]=f;++u?l.length=u:delete this.__on}}}function Nb(n,l,o){return function(){var u=this.__on,r,f=_b(l);if(u){for(var d=0,g=u.length;d<g;++d)if((r=u[d]).type===n.type&&r.name===n.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=f,r.options=o),r.value=l;return}}this.addEventListener(n.type,f,o),r={type:n.type,name:n.name,value:l,listener:f,options:o},u?u.push(r):this.__on=[r]}}function Mb(n,l,o){var u=Eb(n+""),r,f=u.length,d;if(arguments.length<2){var g=this.node().__on;if(g){for(var m=0,h=g.length,v;m<h;++m)for(r=0,v=g[m];r<f;++r)if((d=u[r]).type===v.type&&d.name===v.name)return v.value}return}for(g=l?Nb:wb,r=0;r<f;++r)this.each(g(u[r],l,o));return this}function Ep(n,l,o){var u=vp(n),r=u.CustomEvent;typeof r=="function"?r=new r(l,o):(r=u.document.createEvent("Event"),o?(r.initEvent(l,o.bubbles,o.cancelable),r.detail=o.detail):r.initEvent(l,!1,!1)),n.dispatchEvent(r)}function Ab(n,l){return function(){return Ep(this,n,l)}}function Tb(n,l){return function(){return Ep(this,n,l.apply(this,arguments))}}function zb(n,l){return this.each((typeof l=="function"?Tb:Ab)(n,l))}function*Cb(){for(var n=this._groups,l=0,o=n.length;l<o;++l)for(var u=n[l],r=0,f=u.length,d;r<f;++r)(d=u[r])&&(yield d)}var wp=[null];function Ue(n,l){this._groups=n,this._parents=l}function xo(){return new Ue([[document.documentElement]],wp)}function Db(){return this}Ue.prototype=xo.prototype={constructor:Ue,select:aS,selectAll:uS,selectChild:fS,selectChildren:mS,filter:pS,data:_S,enter:yS,exit:wS,join:NS,merge:MS,selection:Db,order:AS,sort:TS,call:CS,nodes:DS,node:OS,size:RS,empty:HS,each:jS,attr:GS,style:$S,property:JS,classed:tb,text:lb,html:sb,raise:cb,lower:db,append:hb,insert:mb,remove:yb,clone:Sb,datum:bb,on:Mb,dispatch:zb,[Symbol.iterator]:Cb};function je(n){return typeof n=="string"?new Ue([[document.querySelector(n)]],[document.documentElement]):new Ue([[n]],wp)}function Ob(n){let l;for(;l=n.sourceEvent;)n=l;return n}function Fe(n,l){if(n=Ob(n),l===void 0&&(l=n.currentTarget),l){var o=l.ownerSVGElement||l;if(o.createSVGPoint){var u=o.createSVGPoint();return u.x=n.clientX,u.y=n.clientY,u=u.matrixTransform(l.getScreenCTM().inverse()),[u.x,u.y]}if(l.getBoundingClientRect){var r=l.getBoundingClientRect();return[n.clientX-r.left-l.clientLeft,n.clientY-r.top-l.clientTop]}}return[n.pageX,n.pageY]}const Rb={passive:!1},so={capture:!0,passive:!1};function of(n){n.stopImmediatePropagation()}function Kl(n){n.preventDefault(),n.stopImmediatePropagation()}function Np(n){var l=n.document.documentElement,o=je(n).on("dragstart.drag",Kl,so);"onselectstart"in l?o.on("selectstart.drag",Kl,so):(l.__noselect=l.style.MozUserSelect,l.style.MozUserSelect="none")}function Mp(n,l){var o=n.document.documentElement,u=je(n).on("dragstart.drag",null);l&&(u.on("click.drag",Kl,so),setTimeout(function(){u.on("click.drag",null)},0)),"onselectstart"in o?u.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const Ku=n=>()=>n;function Sf(n,{sourceEvent:l,subject:o,target:u,identifier:r,active:f,x:d,y:g,dx:m,dy:h,dispatch:v}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:l,enumerable:!0,configurable:!0},subject:{value:o,enumerable:!0,configurable:!0},target:{value:u,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:f,enumerable:!0,configurable:!0},x:{value:d,enumerable:!0,configurable:!0},y:{value:g,enumerable:!0,configurable:!0},dx:{value:m,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:v}})}Sf.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function Hb(n){return!n.ctrlKey&&!n.button}function jb(){return this.parentNode}function Ub(n,l){return l??{x:n.x,y:n.y}}function Bb(){return navigator.maxTouchPoints||"ontouchstart"in this}function Ap(){var n=Hb,l=jb,o=Ub,u=Bb,r={},f=_s("start","drag","end"),d=0,g,m,h,v,y=0;function x(z){z.on("mousedown.drag",S).filter(u).on("touchstart.drag",C).on("touchmove.drag",N,Rb).on("touchend.drag touchcancel.drag",j).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function S(z,Y){if(!(v||!n.call(this,z,Y))){var q=E(this,l.call(this,z,Y),z,Y,"mouse");q&&(je(z.view).on("mousemove.drag",_,so).on("mouseup.drag",T,so),Np(z.view),of(z),h=!1,g=z.clientX,m=z.clientY,q("start",z))}}function _(z){if(Kl(z),!h){var Y=z.clientX-g,q=z.clientY-m;h=Y*Y+q*q>y}r.mouse("drag",z)}function T(z){je(z.view).on("mousemove.drag mouseup.drag",null),Mp(z.view,h),Kl(z),r.mouse("end",z)}function C(z,Y){if(n.call(this,z,Y)){var q=z.changedTouches,L=l.call(this,z,Y),k=q.length,I,ot;for(I=0;I<k;++I)(ot=E(this,L,z,Y,q[I].identifier,q[I]))&&(of(z),ot("start",z,q[I]))}}function N(z){var Y=z.changedTouches,q=Y.length,L,k;for(L=0;L<q;++L)(k=r[Y[L].identifier])&&(Kl(z),k("drag",z,Y[L]))}function j(z){var Y=z.changedTouches,q=Y.length,L,k;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),L=0;L<q;++L)(k=r[Y[L].identifier])&&(of(z),k("end",z,Y[L]))}function E(z,Y,q,L,k,I){var ot=f.copy(),$=Fe(I||q,Y),P,it,D;if((D=o.call(z,new Sf("beforestart",{sourceEvent:q,target:x,identifier:k,active:d,x:$[0],y:$[1],dx:0,dy:0,dispatch:ot}),L))!=null)return P=D.x-$[0]||0,it=D.y-$[1]||0,function G(M,R,B){var X=$,tt;switch(M){case"start":r[k]=G,tt=d++;break;case"end":delete r[k],--d;case"drag":$=Fe(B||R,Y),tt=d;break}ot.call(M,z,new Sf(M,{sourceEvent:R,subject:D,target:x,identifier:k,active:tt,x:$[0]+P,y:$[1]+it,dx:$[0]-X[0],dy:$[1]-X[1],dispatch:ot}),L)}}return x.filter=function(z){return arguments.length?(n=typeof z=="function"?z:Ku(!!z),x):n},x.container=function(z){return arguments.length?(l=typeof z=="function"?z:Ku(z),x):l},x.subject=function(z){return arguments.length?(o=typeof z=="function"?z:Ku(z),x):o},x.touchable=function(z){return arguments.length?(u=typeof z=="function"?z:Ku(!!z),x):u},x.on=function(){var z=f.on.apply(f,arguments);return z===f?x:z},x.clickDistance=function(z){return arguments.length?(y=(z=+z)*z,x):Math.sqrt(y)},x}function Uf(n,l,o){n.prototype=l.prototype=o,o.constructor=n}function Tp(n,l){var o=Object.create(n.prototype);for(var u in l)o[u]=l[u];return o}function So(){}var ro=.7,ds=1/ro,Il="\\s*([+-]?\\d+)\\s*",co="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",dn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",qb=/^#([0-9a-f]{3,8})$/,Lb=new RegExp(`^rgb\\(${Il},${Il},${Il}\\)$`),Yb=new RegExp(`^rgb\\(${dn},${dn},${dn}\\)$`),Vb=new RegExp(`^rgba\\(${Il},${Il},${Il},${co}\\)$`),Gb=new RegExp(`^rgba\\(${dn},${dn},${dn},${co}\\)$`),Xb=new RegExp(`^hsl\\(${co},${dn},${dn}\\)$`),Zb=new RegExp(`^hsla\\(${co},${dn},${dn},${co}\\)$`),n0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Uf(So,Wa,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:a0,formatHex:a0,formatHex8:Qb,formatHsl:$b,formatRgb:l0,toString:l0});function a0(){return this.rgb().formatHex()}function Qb(){return this.rgb().formatHex8()}function $b(){return zp(this).formatHsl()}function l0(){return this.rgb().formatRgb()}function Wa(n){var l,o;return n=(n+"").trim().toLowerCase(),(l=qb.exec(n))?(o=l[1].length,l=parseInt(l[1],16),o===6?i0(l):o===3?new Me(l>>8&15|l>>4&240,l>>4&15|l&240,(l&15)<<4|l&15,1):o===8?Iu(l>>24&255,l>>16&255,l>>8&255,(l&255)/255):o===4?Iu(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=Lb.exec(n))?new Me(l[1],l[2],l[3],1):(l=Yb.exec(n))?new Me(l[1]*255/100,l[2]*255/100,l[3]*255/100,1):(l=Vb.exec(n))?Iu(l[1],l[2],l[3],l[4]):(l=Gb.exec(n))?Iu(l[1]*255/100,l[2]*255/100,l[3]*255/100,l[4]):(l=Xb.exec(n))?s0(l[1],l[2]/100,l[3]/100,1):(l=Zb.exec(n))?s0(l[1],l[2]/100,l[3]/100,l[4]):n0.hasOwnProperty(n)?i0(n0[n]):n==="transparent"?new Me(NaN,NaN,NaN,0):null}function i0(n){return new Me(n>>16&255,n>>8&255,n&255,1)}function Iu(n,l,o,u){return u<=0&&(n=l=o=NaN),new Me(n,l,o,u)}function kb(n){return n instanceof So||(n=Wa(n)),n?(n=n.rgb(),new Me(n.r,n.g,n.b,n.opacity)):new Me}function bf(n,l,o,u){return arguments.length===1?kb(n):new Me(n,l,o,u??1)}function Me(n,l,o,u){this.r=+n,this.g=+l,this.b=+o,this.opacity=+u}Uf(Me,bf,Tp(So,{brighter(n){return n=n==null?ds:Math.pow(ds,n),new Me(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?ro:Math.pow(ro,n),new Me(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Me(Ja(this.r),Ja(this.g),Ja(this.b),hs(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:o0,formatHex:o0,formatHex8:Kb,formatRgb:u0,toString:u0}));function o0(){return`#${Ia(this.r)}${Ia(this.g)}${Ia(this.b)}`}function Kb(){return`#${Ia(this.r)}${Ia(this.g)}${Ia(this.b)}${Ia((isNaN(this.opacity)?1:this.opacity)*255)}`}function u0(){const n=hs(this.opacity);return`${n===1?"rgb(":"rgba("}${Ja(this.r)}, ${Ja(this.g)}, ${Ja(this.b)}${n===1?")":`, ${n})`}`}function hs(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Ja(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Ia(n){return n=Ja(n),(n<16?"0":"")+n.toString(16)}function s0(n,l,o,u){return u<=0?n=l=o=NaN:o<=0||o>=1?n=l=NaN:l<=0&&(n=NaN),new We(n,l,o,u)}function zp(n){if(n instanceof We)return new We(n.h,n.s,n.l,n.opacity);if(n instanceof So||(n=Wa(n)),!n)return new We;if(n instanceof We)return n;n=n.rgb();var l=n.r/255,o=n.g/255,u=n.b/255,r=Math.min(l,o,u),f=Math.max(l,o,u),d=NaN,g=f-r,m=(f+r)/2;return g?(l===f?d=(o-u)/g+(o<u)*6:o===f?d=(u-l)/g+2:d=(l-o)/g+4,g/=m<.5?f+r:2-f-r,d*=60):g=m>0&&m<1?0:d,new We(d,g,m,n.opacity)}function Ib(n,l,o,u){return arguments.length===1?zp(n):new We(n,l,o,u??1)}function We(n,l,o,u){this.h=+n,this.s=+l,this.l=+o,this.opacity=+u}Uf(We,Ib,Tp(So,{brighter(n){return n=n==null?ds:Math.pow(ds,n),new We(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?ro:Math.pow(ro,n),new We(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,l=isNaN(n)||isNaN(this.s)?0:this.s,o=this.l,u=o+(o<.5?o:1-o)*l,r=2*o-u;return new Me(uf(n>=240?n-240:n+120,r,u),uf(n,r,u),uf(n<120?n+240:n-120,r,u),this.opacity)},clamp(){return new We(r0(this.h),Ju(this.s),Ju(this.l),hs(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=hs(this.opacity);return`${n===1?"hsl(":"hsla("}${r0(this.h)}, ${Ju(this.s)*100}%, ${Ju(this.l)*100}%${n===1?")":`, ${n})`}`}}));function r0(n){return n=(n||0)%360,n<0?n+360:n}function Ju(n){return Math.max(0,Math.min(1,n||0))}function uf(n,l,o){return(n<60?l+(o-l)*n/60:n<180?o:n<240?l+(o-l)*(240-n)/60:l)*255}const Bf=n=>()=>n;function Jb(n,l){return function(o){return n+o*l}}function Fb(n,l,o){return n=Math.pow(n,o),l=Math.pow(l,o)-n,o=1/o,function(u){return Math.pow(n+u*l,o)}}function Wb(n){return(n=+n)==1?Cp:function(l,o){return o-l?Fb(l,o,n):Bf(isNaN(l)?o:l)}}function Cp(n,l){var o=l-n;return o?Jb(n,o):Bf(isNaN(n)?l:n)}const gs=(function n(l){var o=Wb(l);function u(r,f){var d=o((r=bf(r)).r,(f=bf(f)).r),g=o(r.g,f.g),m=o(r.b,f.b),h=Cp(r.opacity,f.opacity);return function(v){return r.r=d(v),r.g=g(v),r.b=m(v),r.opacity=h(v),r+""}}return u.gamma=n,u})(1);function Pb(n,l){l||(l=[]);var o=n?Math.min(l.length,n.length):0,u=l.slice(),r;return function(f){for(r=0;r<o;++r)u[r]=n[r]*(1-f)+l[r]*f;return u}}function t2(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function e2(n,l){var o=l?l.length:0,u=n?Math.min(o,n.length):0,r=new Array(u),f=new Array(o),d;for(d=0;d<u;++d)r[d]=oo(n[d],l[d]);for(;d<o;++d)f[d]=l[d];return function(g){for(d=0;d<u;++d)f[d]=r[d](g);return f}}function n2(n,l){var o=new Date;return n=+n,l=+l,function(u){return o.setTime(n*(1-u)+l*u),o}}function cn(n,l){return n=+n,l=+l,function(o){return n*(1-o)+l*o}}function a2(n,l){var o={},u={},r;(n===null||typeof n!="object")&&(n={}),(l===null||typeof l!="object")&&(l={});for(r in l)r in n?o[r]=oo(n[r],l[r]):u[r]=l[r];return function(f){for(r in o)u[r]=o[r](f);return u}}var _f=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,sf=new RegExp(_f.source,"g");function l2(n){return function(){return n}}function i2(n){return function(l){return n(l)+""}}function Dp(n,l){var o=_f.lastIndex=sf.lastIndex=0,u,r,f,d=-1,g=[],m=[];for(n=n+"",l=l+"";(u=_f.exec(n))&&(r=sf.exec(l));)(f=r.index)>o&&(f=l.slice(o,f),g[d]?g[d]+=f:g[++d]=f),(u=u[0])===(r=r[0])?g[d]?g[d]+=r:g[++d]=r:(g[++d]=null,m.push({i:d,x:cn(u,r)})),o=sf.lastIndex;return o<l.length&&(f=l.slice(o),g[d]?g[d]+=f:g[++d]=f),g.length<2?m[0]?i2(m[0].x):l2(l):(l=m.length,function(h){for(var v=0,y;v<l;++v)g[(y=m[v]).i]=y.x(h);return g.join("")})}function oo(n,l){var o=typeof l,u;return l==null||o==="boolean"?Bf(l):(o==="number"?cn:o==="string"?(u=Wa(l))?(l=u,gs):Dp:l instanceof Wa?gs:l instanceof Date?n2:t2(l)?Pb:Array.isArray(l)?e2:typeof l.valueOf!="function"&&typeof l.toString!="function"||isNaN(l)?a2:cn)(n,l)}var c0=180/Math.PI,Ef={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Op(n,l,o,u,r,f){var d,g,m;return(d=Math.sqrt(n*n+l*l))&&(n/=d,l/=d),(m=n*o+l*u)&&(o-=n*m,u-=l*m),(g=Math.sqrt(o*o+u*u))&&(o/=g,u/=g,m/=g),n*u<l*o&&(n=-n,l=-l,m=-m,d=-d),{translateX:r,translateY:f,rotate:Math.atan2(l,n)*c0,skewX:Math.atan(m)*c0,scaleX:d,scaleY:g}}var Fu;function o2(n){const l=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return l.isIdentity?Ef:Op(l.a,l.b,l.c,l.d,l.e,l.f)}function u2(n){return n==null||(Fu||(Fu=document.createElementNS("http://www.w3.org/2000/svg","g")),Fu.setAttribute("transform",n),!(n=Fu.transform.baseVal.consolidate()))?Ef:(n=n.matrix,Op(n.a,n.b,n.c,n.d,n.e,n.f))}function Rp(n,l,o,u){function r(h){return h.length?h.pop()+" ":""}function f(h,v,y,x,S,_){if(h!==y||v!==x){var T=S.push("translate(",null,l,null,o);_.push({i:T-4,x:cn(h,y)},{i:T-2,x:cn(v,x)})}else(y||x)&&S.push("translate("+y+l+x+o)}function d(h,v,y,x){h!==v?(h-v>180?v+=360:v-h>180&&(h+=360),x.push({i:y.push(r(y)+"rotate(",null,u)-2,x:cn(h,v)})):v&&y.push(r(y)+"rotate("+v+u)}function g(h,v,y,x){h!==v?x.push({i:y.push(r(y)+"skewX(",null,u)-2,x:cn(h,v)}):v&&y.push(r(y)+"skewX("+v+u)}function m(h,v,y,x,S,_){if(h!==y||v!==x){var T=S.push(r(S)+"scale(",null,",",null,")");_.push({i:T-4,x:cn(h,y)},{i:T-2,x:cn(v,x)})}else(y!==1||x!==1)&&S.push(r(S)+"scale("+y+","+x+")")}return function(h,v){var y=[],x=[];return h=n(h),v=n(v),f(h.translateX,h.translateY,v.translateX,v.translateY,y,x),d(h.rotate,v.rotate,y,x),g(h.skewX,v.skewX,y,x),m(h.scaleX,h.scaleY,v.scaleX,v.scaleY,y,x),h=v=null,function(S){for(var _=-1,T=x.length,C;++_<T;)y[(C=x[_]).i]=C.x(S);return y.join("")}}}var s2=Rp(o2,"px, ","px)","deg)"),r2=Rp(u2,", ",")",")"),c2=1e-12;function f0(n){return((n=Math.exp(n))+1/n)/2}function f2(n){return((n=Math.exp(n))-1/n)/2}function d2(n){return((n=Math.exp(2*n))-1)/(n+1)}const os=(function n(l,o,u){function r(f,d){var g=f[0],m=f[1],h=f[2],v=d[0],y=d[1],x=d[2],S=v-g,_=y-m,T=S*S+_*_,C,N;if(T<c2)N=Math.log(x/h)/l,C=function(L){return[g+L*S,m+L*_,h*Math.exp(l*L*N)]};else{var j=Math.sqrt(T),E=(x*x-h*h+u*T)/(2*h*o*j),z=(x*x-h*h-u*T)/(2*x*o*j),Y=Math.log(Math.sqrt(E*E+1)-E),q=Math.log(Math.sqrt(z*z+1)-z);N=(q-Y)/l,C=function(L){var k=L*N,I=f0(Y),ot=h/(o*j)*(I*d2(l*k+Y)-f2(Y));return[g+ot*S,m+ot*_,h*I/f0(l*k+Y)]}}return C.duration=N*1e3*l/Math.SQRT2,C}return r.rho=function(f){var d=Math.max(.001,+f),g=d*d,m=g*g;return n(d,g,m)},r})(Math.SQRT2,2,4);var Fl=0,lo=0,to=0,Hp=1e3,ms,io,ps=0,Pa=0,ws=0,fo=typeof performance=="object"&&performance.now?performance:Date,jp=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function qf(){return Pa||(jp(h2),Pa=fo.now()+ws)}function h2(){Pa=0}function ys(){this._call=this._time=this._next=null}ys.prototype=Up.prototype={constructor:ys,restart:function(n,l,o){if(typeof n!="function")throw new TypeError("callback is not a function");o=(o==null?qf():+o)+(l==null?0:+l),!this._next&&io!==this&&(io?io._next=this:ms=this,io=this),this._call=n,this._time=o,wf()},stop:function(){this._call&&(this._call=null,this._time=1/0,wf())}};function Up(n,l,o){var u=new ys;return u.restart(n,l,o),u}function g2(){qf(),++Fl;for(var n=ms,l;n;)(l=Pa-n._time)>=0&&n._call.call(void 0,l),n=n._next;--Fl}function d0(){Pa=(ps=fo.now())+ws,Fl=lo=0;try{g2()}finally{Fl=0,p2(),Pa=0}}function m2(){var n=fo.now(),l=n-ps;l>Hp&&(ws-=l,ps=n)}function p2(){for(var n,l=ms,o,u=1/0;l;)l._call?(u>l._time&&(u=l._time),n=l,l=l._next):(o=l._next,l._next=null,l=n?n._next=o:ms=o);io=n,wf(u)}function wf(n){if(!Fl){lo&&(lo=clearTimeout(lo));var l=n-Pa;l>24?(n<1/0&&(lo=setTimeout(d0,n-fo.now()-ws)),to&&(to=clearInterval(to))):(to||(ps=fo.now(),to=setInterval(m2,Hp)),Fl=1,jp(d0))}}function h0(n,l,o){var u=new ys;return l=l==null?0:+l,u.restart(r=>{u.stop(),n(r+l)},l,o),u}var y2=_s("start","end","cancel","interrupt"),v2=[],Bp=0,g0=1,Nf=2,us=3,m0=4,Mf=5,ss=6;function Ns(n,l,o,u,r,f){var d=n.__transition;if(!d)n.__transition={};else if(o in d)return;x2(n,o,{name:l,index:u,group:r,on:y2,tween:v2,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:Bp})}function Lf(n,l){var o=nn(n,l);if(o.state>Bp)throw new Error("too late; already scheduled");return o}function gn(n,l){var o=nn(n,l);if(o.state>us)throw new Error("too late; already running");return o}function nn(n,l){var o=n.__transition;if(!o||!(o=o[l]))throw new Error("transition not found");return o}function x2(n,l,o){var u=n.__transition,r;u[l]=o,o.timer=Up(f,0,o.time);function f(h){o.state=g0,o.timer.restart(d,o.delay,o.time),o.delay<=h&&d(h-o.delay)}function d(h){var v,y,x,S;if(o.state!==g0)return m();for(v in u)if(S=u[v],S.name===o.name){if(S.state===us)return h0(d);S.state===m0?(S.state=ss,S.timer.stop(),S.on.call("interrupt",n,n.__data__,S.index,S.group),delete u[v]):+v<l&&(S.state=ss,S.timer.stop(),S.on.call("cancel",n,n.__data__,S.index,S.group),delete u[v])}if(h0(function(){o.state===us&&(o.state=m0,o.timer.restart(g,o.delay,o.time),g(h))}),o.state=Nf,o.on.call("start",n,n.__data__,o.index,o.group),o.state===Nf){for(o.state=us,r=new Array(x=o.tween.length),v=0,y=-1;v<x;++v)(S=o.tween[v].value.call(n,n.__data__,o.index,o.group))&&(r[++y]=S);r.length=y+1}}function g(h){for(var v=h<o.duration?o.ease.call(null,h/o.duration):(o.timer.restart(m),o.state=Mf,1),y=-1,x=r.length;++y<x;)r[y].call(n,v);o.state===Mf&&(o.on.call("end",n,n.__data__,o.index,o.group),m())}function m(){o.state=ss,o.timer.stop(),delete u[l];for(var h in u)return;delete n.__transition}}function rs(n,l){var o=n.__transition,u,r,f=!0,d;if(o){l=l==null?null:l+"";for(d in o){if((u=o[d]).name!==l){f=!1;continue}r=u.state>Nf&&u.state<Mf,u.state=ss,u.timer.stop(),u.on.call(r?"interrupt":"cancel",n,n.__data__,u.index,u.group),delete o[d]}f&&delete n.__transition}}function S2(n){return this.each(function(){rs(this,n)})}function b2(n,l){var o,u;return function(){var r=gn(this,n),f=r.tween;if(f!==o){u=o=f;for(var d=0,g=u.length;d<g;++d)if(u[d].name===l){u=u.slice(),u.splice(d,1);break}}r.tween=u}}function _2(n,l,o){var u,r;if(typeof o!="function")throw new Error;return function(){var f=gn(this,n),d=f.tween;if(d!==u){r=(u=d).slice();for(var 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)}f.tween=r}}function E2(n,l){var o=this._id;if(n+="",arguments.length<2){for(var u=nn(this.node(),o).tween,r=0,f=u.length,d;r<f;++r)if((d=u[r]).name===n)return d.value;return null}return this.each((l==null?b2:_2)(o,n,l))}function Yf(n,l,o){var u=n._id;return n.each(function(){var r=gn(this,u);(r.value||(r.value={}))[l]=o.apply(this,arguments)}),function(r){return nn(r,u).value[l]}}function qp(n,l){var o;return(typeof l=="number"?cn:l instanceof Wa?gs:(o=Wa(l))?(l=o,gs):Dp)(n,l)}function w2(n){return function(){this.removeAttribute(n)}}function N2(n){return function(){this.removeAttributeNS(n.space,n.local)}}function M2(n,l,o){var u,r=o+"",f;return function(){var d=this.getAttribute(n);return d===r?null:d===u?f:f=l(u=d,o)}}function A2(n,l,o){var u,r=o+"",f;return function(){var d=this.getAttributeNS(n.space,n.local);return d===r?null:d===u?f:f=l(u=d,o)}}function T2(n,l,o){var u,r,f;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===u&&m===r?f:(r=m,f=l(u=d,g)))}}function z2(n,l,o){var u,r,f;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===u&&m===r?f:(r=m,f=l(u=d,g)))}}function C2(n,l){var o=Es(n),u=o==="transform"?r2:qp;return this.attrTween(n,typeof l=="function"?(o.local?z2:T2)(o,u,Yf(this,"attr."+n,l)):l==null?(o.local?N2:w2)(o):(o.local?A2:M2)(o,u,l))}function D2(n,l){return function(o){this.setAttribute(n,l.call(this,o))}}function O2(n,l){return function(o){this.setAttributeNS(n.space,n.local,l.call(this,o))}}function R2(n,l){var o,u;function r(){var f=l.apply(this,arguments);return f!==u&&(o=(u=f)&&O2(n,f)),o}return r._value=l,r}function H2(n,l){var o,u;function r(){var f=l.apply(this,arguments);return f!==u&&(o=(u=f)&&D2(n,f)),o}return r._value=l,r}function j2(n,l){var o="attr."+n;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(l==null)return this.tween(o,null);if(typeof l!="function")throw new Error;var u=Es(n);return this.tween(o,(u.local?R2:H2)(u,l))}function U2(n,l){return function(){Lf(this,n).delay=+l.apply(this,arguments)}}function B2(n,l){return l=+l,function(){Lf(this,n).delay=l}}function q2(n){var l=this._id;return arguments.length?this.each((typeof n=="function"?U2:B2)(l,n)):nn(this.node(),l).delay}function L2(n,l){return function(){gn(this,n).duration=+l.apply(this,arguments)}}function Y2(n,l){return l=+l,function(){gn(this,n).duration=l}}function V2(n){var l=this._id;return arguments.length?this.each((typeof n=="function"?L2:Y2)(l,n)):nn(this.node(),l).duration}function G2(n,l){if(typeof l!="function")throw new Error;return function(){gn(this,n).ease=l}}function X2(n){var l=this._id;return arguments.length?this.each(G2(l,n)):nn(this.node(),l).ease}function Z2(n,l){return function(){var o=l.apply(this,arguments);if(typeof o!="function")throw new Error;gn(this,n).ease=o}}function Q2(n){if(typeof n!="function")throw new Error;return this.each(Z2(this._id,n))}function $2(n){typeof n!="function"&&(n=mp(n));for(var l=this._groups,o=l.length,u=new Array(o),r=0;r<o;++r)for(var f=l[r],d=f.length,g=u[r]=[],m,h=0;h<d;++h)(m=f[h])&&n.call(m,m.__data__,h,f)&&g.push(m);return new Vn(u,this._parents,this._name,this._id)}function k2(n){if(n._id!==this._id)throw new Error;for(var l=this._groups,o=n._groups,u=l.length,r=o.length,f=Math.min(u,r),d=new Array(u),g=0;g<f;++g)for(var m=l[g],h=o[g],v=m.length,y=d[g]=new Array(v),x,S=0;S<v;++S)(x=m[S]||h[S])&&(y[S]=x);for(;g<u;++g)d[g]=l[g];return new Vn(d,this._parents,this._name,this._id)}function K2(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 I2(n,l,o){var u,r,f=K2(l)?Lf:gn;return function(){var d=f(this,n),g=d.on;g!==u&&(r=(u=g).copy()).on(l,o),d.on=r}}function J2(n,l){var o=this._id;return arguments.length<2?nn(this.node(),o).on.on(n):this.each(I2(o,n,l))}function F2(n){return function(){var l=this.parentNode;for(var o in this.__transition)if(+o!==n)return;l&&l.removeChild(this)}}function W2(){return this.on("end.remove",F2(this._id))}function P2(n){var l=this._name,o=this._id;typeof n!="function"&&(n=Hf(n));for(var u=this._groups,r=u.length,f=new Array(r),d=0;d<r;++d)for(var g=u[d],m=g.length,h=f[d]=new Array(m),v,y,x=0;x<m;++x)(v=g[x])&&(y=n.call(v,v.__data__,x,g))&&("__data__"in v&&(y.__data__=v.__data__),h[x]=y,Ns(h[x],l,o,x,h,nn(v,o)));return new Vn(f,this._parents,l,o)}function t_(n){var l=this._name,o=this._id;typeof n!="function"&&(n=gp(n));for(var u=this._groups,r=u.length,f=[],d=[],g=0;g<r;++g)for(var m=u[g],h=m.length,v,y=0;y<h;++y)if(v=m[y]){for(var x=n.call(v,v.__data__,y,m),S,_=nn(v,o),T=0,C=x.length;T<C;++T)(S=x[T])&&Ns(S,l,o,T,x,_);f.push(x),d.push(v)}return new Vn(f,d,l,o)}var e_=xo.prototype.constructor;function n_(){return new e_(this._groups,this._parents)}function a_(n,l){var o,u,r;return function(){var f=Jl(this,n),d=(this.style.removeProperty(n),Jl(this,n));return f===d?null:f===o&&d===u?r:r=l(o=f,u=d)}}function Lp(n){return function(){this.style.removeProperty(n)}}function l_(n,l,o){var u,r=o+"",f;return function(){var d=Jl(this,n);return d===r?null:d===u?f:f=l(u=d,o)}}function i_(n,l,o){var u,r,f;return function(){var d=Jl(this,n),g=o(this),m=g+"";return g==null&&(m=g=(this.style.removeProperty(n),Jl(this,n))),d===m?null:d===u&&m===r?f:(r=m,f=l(u=d,g))}}function o_(n,l){var o,u,r,f="style."+l,d="end."+f,g;return function(){var m=gn(this,n),h=m.on,v=m.value[f]==null?g||(g=Lp(l)):void 0;(h!==o||r!==v)&&(u=(o=h).copy()).on(d,r=v),m.on=u}}function u_(n,l,o){var u=(n+="")=="transform"?s2:qp;return l==null?this.styleTween(n,a_(n,u)).on("end.style."+n,Lp(n)):typeof l=="function"?this.styleTween(n,i_(n,u,Yf(this,"style."+n,l))).each(o_(this._id,n)):this.styleTween(n,l_(n,u,l),o).on("end.style."+n,null)}function s_(n,l,o){return function(u){this.style.setProperty(n,l.call(this,u),o)}}function r_(n,l,o){var u,r;function f(){var d=l.apply(this,arguments);return d!==r&&(u=(r=d)&&s_(n,d,o)),u}return f._value=l,f}function c_(n,l,o){var u="style."+(n+="");if(arguments.length<2)return(u=this.tween(u))&&u._value;if(l==null)return this.tween(u,null);if(typeof l!="function")throw new Error;return this.tween(u,r_(n,l,o??""))}function f_(n){return function(){this.textContent=n}}function d_(n){return function(){var l=n(this);this.textContent=l??""}}function h_(n){return this.tween("text",typeof n=="function"?d_(Yf(this,"text",n)):f_(n==null?"":n+""))}function g_(n){return function(l){this.textContent=n.call(this,l)}}function m_(n){var l,o;function u(){var r=n.apply(this,arguments);return r!==o&&(l=(o=r)&&g_(r)),l}return u._value=n,u}function p_(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,m_(n))}function y_(){for(var n=this._name,l=this._id,o=Yp(),u=this._groups,r=u.length,f=0;f<r;++f)for(var d=u[f],g=d.length,m,h=0;h<g;++h)if(m=d[h]){var v=nn(m,l);Ns(m,n,o,h,d,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new Vn(u,this._parents,n,o)}function v_(){var n,l,o=this,u=o._id,r=o.size();return new Promise(function(f,d){var g={value:d},m={value:function(){--r===0&&f()}};o.each(function(){var h=gn(this,u),v=h.on;v!==n&&(l=(n=v).copy(),l._.cancel.push(g),l._.interrupt.push(g),l._.end.push(m)),h.on=l}),r===0&&f()})}var x_=0;function Vn(n,l,o,u){this._groups=n,this._parents=l,this._name=o,this._id=u}function Yp(){return++x_}var qn=xo.prototype;Vn.prototype={constructor:Vn,select:P2,selectAll:t_,selectChild:qn.selectChild,selectChildren:qn.selectChildren,filter:$2,merge:k2,selection:n_,transition:y_,call:qn.call,nodes:qn.nodes,node:qn.node,size:qn.size,empty:qn.empty,each:qn.each,on:J2,attr:C2,attrTween:j2,style:u_,styleTween:c_,text:h_,textTween:p_,remove:W2,tween:E2,delay:q2,duration:V2,ease:X2,easeVarying:Q2,end:v_,[Symbol.iterator]:qn[Symbol.iterator]};function S_(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var b_={time:null,delay:0,duration:250,ease:S_};function __(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 E_(n){var l,o;n instanceof Vn?(l=n._id,n=n._name):(l=Yp(),(o=b_).time=qf(),n=n==null?null:n+"");for(var u=this._groups,r=u.length,f=0;f<r;++f)for(var d=u[f],g=d.length,m,h=0;h<g;++h)(m=d[h])&&Ns(m,n,l,h,d,o||__(m,l));return new Vn(u,this._parents,n,l)}xo.prototype.interrupt=S2;xo.prototype.transition=E_;const Wu=n=>()=>n;function w_(n,{sourceEvent:l,target:o,transform:u,dispatch:r}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:l,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:u,enumerable:!0,configurable:!0},_:{value:r}})}function Yn(n,l,o){this.k=n,this.x=l,this.y=o}Yn.prototype={constructor:Yn,scale:function(n){return n===1?this:new Yn(this.k*n,this.x,this.y)},translate:function(n,l){return n===0&l===0?this:new Yn(this.k,this.x+this.k*n,this.y+this.k*l)},apply:function(n){return[n[0]*this.k+this.x,n[1]*this.k+this.y]},applyX:function(n){return n*this.k+this.x},applyY:function(n){return n*this.k+this.y},invert:function(n){return[(n[0]-this.x)/this.k,(n[1]-this.y)/this.k]},invertX:function(n){return(n-this.x)/this.k},invertY:function(n){return(n-this.y)/this.k},rescaleX:function(n){return n.copy().domain(n.range().map(this.invertX,this).map(n.invert,n))},rescaleY:function(n){return n.copy().domain(n.range().map(this.invertY,this).map(n.invert,n))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var Ms=new Yn(1,0,0);Vp.prototype=Yn.prototype;function Vp(n){for(;!n.__zoom;)if(!(n=n.parentNode))return Ms;return n.__zoom}function rf(n){n.stopImmediatePropagation()}function eo(n){n.preventDefault(),n.stopImmediatePropagation()}function N_(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function M_(){var n=this;return n instanceof SVGElement?(n=n.ownerSVGElement||n,n.hasAttribute("viewBox")?(n=n.viewBox.baseVal,[[n.x,n.y],[n.x+n.width,n.y+n.height]]):[[0,0],[n.width.baseVal.value,n.height.baseVal.value]]):[[0,0],[n.clientWidth,n.clientHeight]]}function p0(){return this.__zoom||Ms}function A_(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function T_(){return navigator.maxTouchPoints||"ontouchstart"in this}function z_(n,l,o){var u=n.invertX(l[0][0])-o[0][0],r=n.invertX(l[1][0])-o[1][0],f=n.invertY(l[0][1])-o[0][1],d=n.invertY(l[1][1])-o[1][1];return n.translate(r>u?(u+r)/2:Math.min(0,u)||Math.max(0,r),d>f?(f+d)/2:Math.min(0,f)||Math.max(0,d))}function Gp(){var n=N_,l=M_,o=z_,u=A_,r=T_,f=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],g=250,m=os,h=_s("start","zoom","end"),v,y,x,S=500,_=150,T=0,C=10;function N(D){D.property("__zoom",p0).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",I).on("dblclick.zoom",ot).filter(r).on("touchstart.zoom",$).on("touchmove.zoom",P).on("touchend.zoom touchcancel.zoom",it).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(D,G,M,R){var B=D.selection?D.selection():D;B.property("__zoom",p0),D!==B?Y(D,G,M,R):B.interrupt().each(function(){q(this,arguments).event(R).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},N.scaleBy=function(D,G,M,R){N.scaleTo(D,function(){var B=this.__zoom.k,X=typeof G=="function"?G.apply(this,arguments):G;return B*X},M,R)},N.scaleTo=function(D,G,M,R){N.transform(D,function(){var B=l.apply(this,arguments),X=this.__zoom,tt=M==null?z(B):typeof M=="function"?M.apply(this,arguments):M,A=X.invert(tt),H=typeof G=="function"?G.apply(this,arguments):G;return o(E(j(X,H),tt,A),B,d)},M,R)},N.translateBy=function(D,G,M,R){N.transform(D,function(){return o(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof M=="function"?M.apply(this,arguments):M),l.apply(this,arguments),d)},null,R)},N.translateTo=function(D,G,M,R,B){N.transform(D,function(){var X=l.apply(this,arguments),tt=this.__zoom,A=R==null?z(X):typeof R=="function"?R.apply(this,arguments):R;return o(Ms.translate(A[0],A[1]).scale(tt.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof M=="function"?-M.apply(this,arguments):-M),X,d)},R,B)};function j(D,G){return G=Math.max(f[0],Math.min(f[1],G)),G===D.k?D:new Yn(G,D.x,D.y)}function E(D,G,M){var R=G[0]-M[0]*D.k,B=G[1]-M[1]*D.k;return R===D.x&&B===D.y?D:new Yn(D.k,R,B)}function z(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function Y(D,G,M,R){D.on("start.zoom",function(){q(this,arguments).event(R).start()}).on("interrupt.zoom end.zoom",function(){q(this,arguments).event(R).end()}).tween("zoom",function(){var B=this,X=arguments,tt=q(B,X).event(R),A=l.apply(B,X),H=M==null?z(A):typeof M=="function"?M.apply(B,X):M,W=Math.max(A[1][0]-A[0][0],A[1][1]-A[0][1]),et=B.__zoom,st=typeof G=="function"?G.apply(B,X):G,ct=m(et.invert(H).concat(W/et.k),st.invert(H).concat(W/st.k));return function(rt){if(rt===1)rt=st;else{var ut=ct(rt),ft=W/ut[2];rt=new Yn(ft,H[0]-ut[0]*ft,H[1]-ut[1]*ft)}tt.zoom(null,rt)}})}function q(D,G,M){return!M&&D.__zooming||new L(D,G)}function L(D,G){this.that=D,this.args=G,this.active=0,this.sourceEvent=null,this.extent=l.apply(D,G),this.taps=0}L.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,G){return this.mouse&&D!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var G=je(this.that).datum();h.call(D,this.that,new w_(D,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:h}),G)}};function k(D,...G){if(!n.apply(this,arguments))return;var M=q(this,G).event(D),R=this.__zoom,B=Math.max(f[0],Math.min(f[1],R.k*Math.pow(2,u.apply(this,arguments)))),X=Fe(D);if(M.wheel)(M.mouse[0][0]!==X[0]||M.mouse[0][1]!==X[1])&&(M.mouse[1]=R.invert(M.mouse[0]=X)),clearTimeout(M.wheel);else{if(R.k===B)return;M.mouse=[X,R.invert(X)],rs(this),M.start()}eo(D),M.wheel=setTimeout(tt,_),M.zoom("mouse",o(E(j(R,B),M.mouse[0],M.mouse[1]),M.extent,d));function tt(){M.wheel=null,M.end()}}function I(D,...G){if(x||!n.apply(this,arguments))return;var M=D.currentTarget,R=q(this,G,!0).event(D),B=je(D.view).on("mousemove.zoom",H,!0).on("mouseup.zoom",W,!0),X=Fe(D,M),tt=D.clientX,A=D.clientY;Np(D.view),rf(D),R.mouse=[X,this.__zoom.invert(X)],rs(this),R.start();function H(et){if(eo(et),!R.moved){var st=et.clientX-tt,ct=et.clientY-A;R.moved=st*st+ct*ct>T}R.event(et).zoom("mouse",o(E(R.that.__zoom,R.mouse[0]=Fe(et,M),R.mouse[1]),R.extent,d))}function W(et){B.on("mousemove.zoom mouseup.zoom",null),Mp(et.view,R.moved),eo(et),R.event(et).end()}}function ot(D,...G){if(n.apply(this,arguments)){var M=this.__zoom,R=Fe(D.changedTouches?D.changedTouches[0]:D,this),B=M.invert(R),X=M.k*(D.shiftKey?.5:2),tt=o(E(j(M,X),R,B),l.apply(this,G),d);eo(D),g>0?je(this).transition().duration(g).call(Y,tt,R,D):je(this).call(N.transform,tt,R,D)}}function $(D,...G){if(n.apply(this,arguments)){var M=D.touches,R=M.length,B=q(this,G,D.changedTouches.length===R).event(D),X,tt,A,H;for(rf(D),tt=0;tt<R;++tt)A=M[tt],H=Fe(A,this),H=[H,this.__zoom.invert(H),A.identifier],B.touch0?!B.touch1&&B.touch0[2]!==H[2]&&(B.touch1=H,B.taps=0):(B.touch0=H,X=!0,B.taps=1+!!v);v&&(v=clearTimeout(v)),X&&(B.taps<2&&(y=H[0],v=setTimeout(function(){v=null},S)),rs(this),B.start())}}function P(D,...G){if(this.__zooming){var M=q(this,G).event(D),R=D.changedTouches,B=R.length,X,tt,A,H;for(eo(D),X=0;X<B;++X)tt=R[X],A=Fe(tt,this),M.touch0&&M.touch0[2]===tt.identifier?M.touch0[0]=A:M.touch1&&M.touch1[2]===tt.identifier&&(M.touch1[0]=A);if(tt=M.that.__zoom,M.touch1){var W=M.touch0[0],et=M.touch0[1],st=M.touch1[0],ct=M.touch1[1],rt=(rt=st[0]-W[0])*rt+(rt=st[1]-W[1])*rt,ut=(ut=ct[0]-et[0])*ut+(ut=ct[1]-et[1])*ut;tt=j(tt,Math.sqrt(rt/ut)),A=[(W[0]+st[0])/2,(W[1]+st[1])/2],H=[(et[0]+ct[0])/2,(et[1]+ct[1])/2]}else if(M.touch0)A=M.touch0[0],H=M.touch0[1];else return;M.zoom("touch",o(E(tt,A,H),M.extent,d))}}function it(D,...G){if(this.__zooming){var M=q(this,G).event(D),R=D.changedTouches,B=R.length,X,tt;for(rf(D),x&&clearTimeout(x),x=setTimeout(function(){x=null},S),X=0;X<B;++X)tt=R[X],M.touch0&&M.touch0[2]===tt.identifier?delete M.touch0:M.touch1&&M.touch1[2]===tt.identifier&&delete M.touch1;if(M.touch1&&!M.touch0&&(M.touch0=M.touch1,delete M.touch1),M.touch0)M.touch0[1]=this.__zoom.invert(M.touch0[0]);else if(M.end(),M.taps===2&&(tt=Fe(tt,this),Math.hypot(y[0]-tt[0],y[1]-tt[1])<C)){var A=je(this).on("dblclick.zoom");A&&A.apply(this,arguments)}}}return N.wheelDelta=function(D){return arguments.length?(u=typeof D=="function"?D:Wu(+D),N):u},N.filter=function(D){return arguments.length?(n=typeof D=="function"?D:Wu(!!D),N):n},N.touchable=function(D){return arguments.length?(r=typeof D=="function"?D:Wu(!!D),N):r},N.extent=function(D){return arguments.length?(l=typeof D=="function"?D:Wu([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),N):l},N.scaleExtent=function(D){return arguments.length?(f[0]=+D[0],f[1]=+D[1],N):[f[0],f[1]]},N.translateExtent=function(D){return arguments.length?(d[0][0]=+D[0][0],d[1][0]=+D[1][0],d[0][1]=+D[0][1],d[1][1]=+D[1][1],N):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},N.constrain=function(D){return arguments.length?(o=D,N):o},N.duration=function(D){return arguments.length?(g=+D,N):g},N.interpolate=function(D){return arguments.length?(m=D,N):m},N.on=function(){var D=h.on.apply(h,arguments);return D===h?N:D},N.clickDistance=function(D){return arguments.length?(T=(D=+D)*D,N):Math.sqrt(T)},N.tapDistance=function(D){return arguments.length?(C=+D,N):C},N}const hn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:n=>`Node type "${n}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:n=>`The old edge with id=${n} does not exist.`,error009:n=>`Marker type "${n}" doesn't exist.`,error008:(n,{id:l,sourceHandle:o,targetHandle:u})=>`Couldn't create edge for ${n} handle id: "${n==="source"?o:u}", edge id: ${l}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:n=>`Edge type "${n}" not found. Using fallback type "default".`,error012:n=>`Node with id "${n}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(n="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${n}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},ho=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Xp=["Enter"," ","Escape"],Zp={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:n,x:l,y:o})=>`Moved selected node ${n}. New position, x: ${l}, y: ${o}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Wl;(function(n){n.Strict="strict",n.Loose="loose"})(Wl||(Wl={}));var Fa;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(Fa||(Fa={}));var go;(function(n){n.Partial="partial",n.Full="full"})(go||(go={}));const Qp={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Sa;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(Sa||(Sa={}));var vs;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(vs||(vs={}));var mt;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(mt||(mt={}));const y0={[mt.Left]:mt.Right,[mt.Right]:mt.Left,[mt.Top]:mt.Bottom,[mt.Bottom]:mt.Top};function $p(n){return n===null?null:n?"valid":"invalid"}const kp=n=>"id"in n&&"source"in n&&"target"in n,C_=n=>"id"in n&&"position"in n&&!("source"in n)&&!("target"in n),Vf=n=>"id"in n&&"internals"in n&&!("source"in n)&&!("target"in n),bo=(n,l=[0,0])=>{const{width:o,height:u}=Gn(n),r=n.origin??l,f=o*r[0],d=u*r[1];return{x:n.position.x-f,y:n.position.y-d}},D_=(n,l={nodeOrigin:[0,0]})=>{if(n.length===0)return{x:0,y:0,width:0,height:0};const o=n.reduce((u,r)=>{const f=typeof r=="string";let d=!l.nodeLookup&&!f?r:void 0;l.nodeLookup&&(d=f?l.nodeLookup.get(r):Vf(r)?r:l.nodeLookup.get(r.id));const g=d?xs(d,l.nodeOrigin):{x:0,y:0,x2:0,y2:0};return As(u,g)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ts(o)},_o=(n,l={})=>{let o={x:1/0,y:1/0,x2:-1/0,y2:-1/0},u=!1;return n.forEach(r=>{(l.filter===void 0||l.filter(r))&&(o=As(o,xs(r)),u=!0)}),u?Ts(o):{x:0,y:0,width:0,height:0}},Gf=(n,l,[o,u,r]=[0,0,1],f=!1,d=!1)=>{const g={...wo(l,[o,u,r]),width:l.width/r,height:l.height/r},m=[];for(const h of n.values()){const{measured:v,selectable:y=!0,hidden:x=!1}=h;if(d&&!y||x)continue;const S=v.width??h.width??h.initialWidth??null,_=v.height??h.height??h.initialHeight??null,T=mo(g,ti(h)),C=(S??0)*(_??0),N=f&&T>0;(!h.internals.handleBounds||N||T>=C||h.dragging)&&m.push(h)}return m},O_=(n,l)=>{const o=new Set;return n.forEach(u=>{o.add(u.id)}),l.filter(u=>o.has(u.source)||o.has(u.target))};function R_(n,l){const o=new Map,u=l?.nodes?new Set(l.nodes.map(r=>r.id)):null;return n.forEach(r=>{r.measured.width&&r.measured.height&&(l?.includeHiddenNodes||!r.hidden)&&(!u||u.has(r.id))&&o.set(r.id,r)}),o}async function H_({nodes:n,width:l,height:o,panZoom:u,minZoom:r,maxZoom:f},d){if(n.size===0)return Promise.resolve(!0);const g=R_(n,d),m=_o(g),h=Xf(m,l,o,d?.minZoom??r,d?.maxZoom??f,d?.padding??.1);return await u.setViewport(h,{duration:d?.duration,ease:d?.ease,interpolate:d?.interpolate}),Promise.resolve(!0)}function Kp({nodeId:n,nextPosition:l,nodeLookup:o,nodeOrigin:u=[0,0],nodeExtent:r,onError:f}){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},v=d.origin??u;let y=d.extent||r;if(d.extent==="parent"&&!d.expandParent)if(!g)f?.("005",hn.error005());else{const S=g.measured.width,_=g.measured.height;S&&_&&(y=[[m,h],[m+S,h+_]])}else g&&ei(d.extent)&&(y=[[d.extent[0][0]+m,d.extent[0][1]+h],[d.extent[1][0]+m,d.extent[1][1]+h]]);const x=ei(y)?tl(l,y,d.measured):l;return(d.measured.width===void 0||d.measured.height===void 0)&&f?.("015",hn.error015()),{position:{x:x.x-m+(d.measured.width??0)*v[0],y:x.y-h+(d.measured.height??0)*v[1]},positionAbsolute:x}}async function j_({nodesToRemove:n=[],edgesToRemove:l=[],nodes:o,edges:u,onBeforeDelete:r}){const f=new Set(n.map(x=>x.id)),d=[];for(const x of o){if(x.deletable===!1)continue;const S=f.has(x.id),_=!S&&x.parentId&&d.find(T=>T.id===x.parentId);(S||_)&&d.push(x)}const g=new Set(l.map(x=>x.id)),m=u.filter(x=>x.deletable!==!1),v=O_(d,m);for(const x of m)g.has(x.id)&&!v.find(_=>_.id===x.id)&&v.push(x);if(!r)return{edges:v,nodes:d};const y=await r({nodes:d,edges:v});return typeof y=="boolean"?y?{edges:v,nodes:d}:{edges:[],nodes:[]}:y}const Pl=(n,l=0,o=1)=>Math.min(Math.max(n,l),o),tl=(n={x:0,y:0},l,o)=>({x:Pl(n.x,l[0][0],l[1][0]-(o?.width??0)),y:Pl(n.y,l[0][1],l[1][1]-(o?.height??0))});function Ip(n,l,o){const{width:u,height:r}=Gn(o),{x:f,y:d}=o.internals.positionAbsolute;return tl(n,[[f,d],[f+u,d+r]],l)}const v0=(n,l,o)=>n<l?Pl(Math.abs(n-l),1,l)/l:n>o?-Pl(Math.abs(n-o),1,l)/l:0,Jp=(n,l,o=15,u=40)=>{const r=v0(n.x,u,l.width-u)*o,f=v0(n.y,u,l.height-u)*o;return[r,f]},As=(n,l)=>({x:Math.min(n.x,l.x),y:Math.min(n.y,l.y),x2:Math.max(n.x2,l.x2),y2:Math.max(n.y2,l.y2)}),Af=({x:n,y:l,width:o,height:u})=>({x:n,y:l,x2:n+o,y2:l+u}),Ts=({x:n,y:l,x2:o,y2:u})=>({x:n,y:l,width:o-n,height:u-l}),ti=(n,l=[0,0])=>{const{x:o,y:u}=Vf(n)?n.internals.positionAbsolute:bo(n,l);return{x:o,y:u,width:n.measured?.width??n.width??n.initialWidth??0,height:n.measured?.height??n.height??n.initialHeight??0}},xs=(n,l=[0,0])=>{const{x:o,y:u}=Vf(n)?n.internals.positionAbsolute:bo(n,l);return{x:o,y:u,x2:o+(n.measured?.width??n.width??n.initialWidth??0),y2:u+(n.measured?.height??n.height??n.initialHeight??0)}},Fp=(n,l)=>Ts(As(Af(n),Af(l))),mo=(n,l)=>{const o=Math.max(0,Math.min(n.x+n.width,l.x+l.width)-Math.max(n.x,l.x)),u=Math.max(0,Math.min(n.y+n.height,l.y+l.height)-Math.max(n.y,l.y));return Math.ceil(o*u)},x0=n=>Pe(n.width)&&Pe(n.height)&&Pe(n.x)&&Pe(n.y),Pe=n=>!isNaN(n)&&isFinite(n),U_=(n,l)=>{},Eo=(n,l=[1,1])=>({x:l[0]*Math.round(n.x/l[0]),y:l[1]*Math.round(n.y/l[1])}),wo=({x:n,y:l},[o,u,r],f=!1,d=[1,1])=>{const g={x:(n-o)/r,y:(l-u)/r};return f?Eo(g,d):g},Ss=({x:n,y:l},[o,u,r])=>({x:n*r+o,y:l*r+u});function Ql(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 B_(n,l,o){if(typeof n=="string"||typeof n=="number"){const u=Ql(n,o),r=Ql(n,l);return{top:u,right:r,bottom:u,left:r,x:r*2,y:u*2}}if(typeof n=="object"){const u=Ql(n.top??n.y??0,o),r=Ql(n.bottom??n.y??0,o),f=Ql(n.left??n.x??0,l),d=Ql(n.right??n.x??0,l);return{top:u,right:d,bottom:r,left:f,x:f+d,y:u+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function q_(n,l,o,u,r,f){const{x:d,y:g}=Ss(n,[l,o,u]),{x:m,y:h}=Ss({x:n.x+n.width,y:n.y+n.height},[l,o,u]),v=r-m,y=f-h;return{left:Math.floor(d),top:Math.floor(g),right:Math.floor(v),bottom:Math.floor(y)}}const Xf=(n,l,o,u,r,f)=>{const d=B_(f,l,o),g=(l-d.x)/n.width,m=(o-d.y)/n.height,h=Math.min(g,m),v=Pl(h,u,r),y=n.x+n.width/2,x=n.y+n.height/2,S=l/2-y*v,_=o/2-x*v,T=q_(n,S,_,v,l,o),C={left:Math.min(T.left-d.left,0),top:Math.min(T.top-d.top,0),right:Math.min(T.right-d.right,0),bottom:Math.min(T.bottom-d.bottom,0)};return{x:S-C.left+C.right,y:_-C.top+C.bottom,zoom:v}},po=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function ei(n){return n!=null&&n!=="parent"}function Gn(n){return{width:n.measured?.width??n.width??n.initialWidth??0,height:n.measured?.height??n.height??n.initialHeight??0}}function Wp(n){return(n.measured?.width??n.width??n.initialWidth)!==void 0&&(n.measured?.height??n.height??n.initialHeight)!==void 0}function Pp(n,l={width:0,height:0},o,u,r){const f={...n},d=u.get(o);if(d){const g=d.origin||r;f.x+=d.internals.positionAbsolute.x-(l.width??0)*g[0],f.y+=d.internals.positionAbsolute.y-(l.height??0)*g[1]}return f}function S0(n,l){if(n.size!==l.size)return!1;for(const o of n)if(!l.has(o))return!1;return!0}function L_(){let n,l;return{promise:new Promise((u,r)=>{n=u,l=r}),resolve:n,reject:l}}function Y_(n){return{...Zp,...n||{}}}function uo(n,{snapGrid:l=[0,0],snapToGrid:o=!1,transform:u,containerBounds:r}){const{x:f,y:d}=tn(n),g=wo({x:f-(r?.left??0),y:d-(r?.top??0)},u),{x:m,y:h}=o?Eo(g,l):g;return{xSnapped:m,ySnapped:h,...g}}const Zf=n=>({width:n.offsetWidth,height:n.offsetHeight}),ty=n=>n?.getRootNode?.()||window?.document,V_=["INPUT","SELECT","TEXTAREA"];function ey(n){const l=n.composedPath?.()?.[0]||n.target;return l?.nodeType!==1?!1:V_.includes(l.nodeName)||l.hasAttribute("contenteditable")||!!l.closest(".nokey")}const ny=n=>"clientX"in n,tn=(n,l)=>{const o=ny(n),u=o?n.clientX:n.touches?.[0].clientX,r=o?n.clientY:n.touches?.[0].clientY;return{x:u-(l?.left??0),y:r-(l?.top??0)}},b0=(n,l,o,u,r)=>{const f=l.querySelectorAll(`.${n}`);return!f||!f.length?null:Array.from(f).map(d=>{const g=d.getBoundingClientRect();return{id:d.getAttribute("data-handleid"),type:n,nodeId:r,position:d.getAttribute("data-handlepos"),x:(g.left-o.left)/u,y:(g.top-o.top)/u,...Zf(d)}})};function ay({sourceX:n,sourceY:l,targetX:o,targetY:u,sourceControlX:r,sourceControlY:f,targetControlX:d,targetControlY:g}){const m=n*.125+r*.375+d*.375+o*.125,h=l*.125+f*.375+g*.375+u*.125,v=Math.abs(m-n),y=Math.abs(h-l);return[m,h,v,y]}function Pu(n,l){return n>=0?.5*n:l*25*Math.sqrt(-n)}function _0({pos:n,x1:l,y1:o,x2:u,y2:r,c:f}){switch(n){case mt.Left:return[l-Pu(l-u,f),o];case mt.Right:return[l+Pu(u-l,f),o];case mt.Top:return[l,o-Pu(o-r,f)];case mt.Bottom:return[l,o+Pu(r-o,f)]}}function ly({sourceX:n,sourceY:l,sourcePosition:o=mt.Bottom,targetX:u,targetY:r,targetPosition:f=mt.Top,curvature:d=.25}){const[g,m]=_0({pos:o,x1:n,y1:l,x2:u,y2:r,c:d}),[h,v]=_0({pos:f,x1:u,y1:r,x2:n,y2:l,c:d}),[y,x,S,_]=ay({sourceX:n,sourceY:l,targetX:u,targetY:r,sourceControlX:g,sourceControlY:m,targetControlX:h,targetControlY:v});return[`M${n},${l} C${g},${m} ${h},${v} ${u},${r}`,y,x,S,_]}function iy({sourceX:n,sourceY:l,targetX:o,targetY:u}){const r=Math.abs(o-n)/2,f=o<n?o+r:o-r,d=Math.abs(u-l)/2,g=u<l?u+d:u-d;return[f,g,r,d]}function G_({sourceNode:n,targetNode:l,selected:o=!1,zIndex:u=0,elevateOnSelect:r=!1,zIndexMode:f="basic"}){if(f==="manual")return u;const d=r&&o?u+1e3:u,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 X_({sourceNode:n,targetNode:l,width:o,height:u,transform:r}){const f=As(xs(n),xs(l));f.x===f.x2&&(f.x2+=1),f.y===f.y2&&(f.y2+=1);const d={x:-r[0]/r[2],y:-r[1]/r[2],width:o/r[2],height:u/r[2]};return mo(d,Ts(f))>0}const Z_=({source:n,sourceHandle:l,target:o,targetHandle:u})=>`xy-edge__${n}${l||""}-${o}${u||""}`,Q_=(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)),$_=(n,l,o={})=>{if(!n.source||!n.target)return l;const u=o.getEdgeId||Z_;let r;return kp(n)?r={...n}:r={...n,id:u(n)},Q_(r,l)?l:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,l.concat(r))};function oy({sourceX:n,sourceY:l,targetX:o,targetY:u}){const[r,f,d,g]=iy({sourceX:n,sourceY:l,targetX:o,targetY:u});return[`M ${n},${l}L ${o},${u}`,r,f,d,g]}const E0={[mt.Left]:{x:-1,y:0},[mt.Right]:{x:1,y:0},[mt.Top]:{x:0,y:-1},[mt.Bottom]:{x:0,y:1}},k_=({source:n,sourcePosition:l=mt.Bottom,target:o})=>l===mt.Left||l===mt.Right?n.x<o.x?{x:1,y:0}:{x:-1,y:0}:n.y<o.y?{x:0,y:1}:{x:0,y:-1},w0=(n,l)=>Math.sqrt(Math.pow(l.x-n.x,2)+Math.pow(l.y-n.y,2));function K_({source:n,sourcePosition:l=mt.Bottom,target:o,targetPosition:u=mt.Top,center:r,offset:f,stepPosition:d}){const g=E0[l],m=E0[u],h={x:n.x+g.x*f,y:n.y+g.y*f},v={x:o.x+m.x*f,y:o.y+m.y*f},y=k_({source:h,sourcePosition:l,target:v}),x=y.x!==0?"x":"y",S=y[x];let _=[],T,C;const N={x:0,y:0},j={x:0,y:0},[,,E,z]=iy({sourceX:n.x,sourceY:n.y,targetX:o.x,targetY:o.y});if(g[x]*m[x]===-1){x==="x"?(T=r.x??h.x+(v.x-h.x)*d,C=r.y??(h.y+v.y)/2):(T=r.x??(h.x+v.x)/2,C=r.y??h.y+(v.y-h.y)*d);const k=[{x:T,y:h.y},{x:T,y:v.y}],I=[{x:h.x,y:C},{x:v.x,y:C}];g[x]===S?_=x==="x"?k:I:_=x==="x"?I:k}else{const k=[{x:h.x,y:v.y}],I=[{x:v.x,y:h.y}];if(x==="x"?_=g.x===S?I:k:_=g.y===S?k:I,l===u){const D=Math.abs(n[x]-o[x]);if(D<=f){const G=Math.min(f-1,f-D);g[x]===S?N[x]=(h[x]>n[x]?-1:1)*G:j[x]=(v[x]>o[x]?-1:1)*G}}if(l!==u){const D=x==="x"?"y":"x",G=g[x]===m[D],M=h[D]>v[D],R=h[D]<v[D];(g[x]===1&&(!G&&M||G&&R)||g[x]!==1&&(!G&&R||G&&M))&&(_=x==="x"?k:I)}const ot={x:h.x+N.x,y:h.y+N.y},$={x:v.x+j.x,y:v.y+j.y},P=Math.max(Math.abs(ot.x-_[0].x),Math.abs($.x-_[0].x)),it=Math.max(Math.abs(ot.y-_[0].y),Math.abs($.y-_[0].y));P>=it?(T=(ot.x+$.x)/2,C=_[0].y):(T=_[0].x,C=(ot.y+$.y)/2)}const Y={x:h.x+N.x,y:h.y+N.y},q={x:v.x+j.x,y:v.y+j.y};return[[n,...Y.x!==_[0].x||Y.y!==_[0].y?[Y]:[],..._,...q.x!==_[_.length-1].x||q.y!==_[_.length-1].y?[q]:[],o],T,C,E,z]}function I_(n,l,o,u){const r=Math.min(w0(n,l)/2,w0(l,o)/2,u),{x:f,y:d}=l;if(n.x===f&&f===o.x||n.y===d&&d===o.y)return`L${f} ${d}`;if(n.y===d){const h=n.x<o.x?-1:1,v=n.y<o.y?1:-1;return`L ${f+r*h},${d}Q ${f},${d} ${f},${d+r*v}`}const g=n.x<o.x?1:-1,m=n.y<o.y?-1:1;return`L ${f},${d+r*m}Q ${f},${d} ${f+r*g},${d}`}function Tf({sourceX:n,sourceY:l,sourcePosition:o=mt.Bottom,targetX:u,targetY:r,targetPosition:f=mt.Top,borderRadius:d=5,centerX:g,centerY:m,offset:h=20,stepPosition:v=.5}){const[y,x,S,_,T]=K_({source:{x:n,y:l},sourcePosition:o,target:{x:u,y:r},targetPosition:f,center:{x:g,y:m},offset:h,stepPosition:v});let C=`M${y[0].x} ${y[0].y}`;for(let N=1;N<y.length-1;N++)C+=I_(y[N-1],y[N],y[N+1],d);return C+=`L${y[y.length-1].x} ${y[y.length-1].y}`,[C,x,S,_,T]}function N0(n){return n&&!!(n.internals.handleBounds||n.handles?.length)&&!!(n.measured.width||n.width||n.initialWidth)}function J_(n){const{sourceNode:l,targetNode:o}=n;if(!N0(l)||!N0(o))return null;const u=l.internals.handleBounds||M0(l.handles),r=o.internals.handleBounds||M0(o.handles),f=A0(u?.source??[],n.sourceHandle),d=A0(n.connectionMode===Wl.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),n.targetHandle);if(!f||!d)return n.onError?.("008",hn.error008(f?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;const g=f?.position||mt.Bottom,m=d?.position||mt.Top,h=el(l,f,g),v=el(o,d,m);return{sourceX:h.x,sourceY:h.y,targetX:v.x,targetY:v.y,sourcePosition:g,targetPosition:m}}function M0(n){if(!n)return null;const l=[],o=[];for(const u of n)u.width=u.width??1,u.height=u.height??1,u.type==="source"?l.push(u):u.type==="target"&&o.push(u);return{source:l,target:o}}function el(n,l,o=mt.Left,u=!1){const r=(l?.x??0)+n.internals.positionAbsolute.x,f=(l?.y??0)+n.internals.positionAbsolute.y,{width:d,height:g}=l??Gn(n);if(u)return{x:r+d/2,y:f+g/2};switch(l?.position??o){case mt.Top:return{x:r+d/2,y:f};case mt.Right:return{x:r+d,y:f+g/2};case mt.Bottom:return{x:r+d/2,y:f+g};case mt.Left:return{x:r,y:f+g/2}}}function A0(n,l){return n&&(l?n.find(o=>o.id===l):n[0])||null}function zf(n,l){return n?typeof n=="string"?n:`${l?`${l}__`:""}${Object.keys(n).sort().map(u=>`${u}=${n[u]}`).join("&")}`:""}function F_(n,{id:l,defaultColor:o,defaultMarkerStart:u,defaultMarkerEnd:r}){const f=new Set;return n.reduce((d,g)=>([g.markerStart||u,g.markerEnd||r].forEach(m=>{if(m&&typeof m=="object"){const h=zf(m,l);f.has(h)||(d.push({id:h,color:m.color||o,...m}),f.add(h))}}),d),[]).sort((d,g)=>d.id.localeCompare(g.id))}const uy=1e3,W_=10,Qf={nodeOrigin:[0,0],nodeExtent:ho,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},P_={...Qf,checkEquality:!0};function $f(n,l){const o={...n};for(const u in l)l[u]!==void 0&&(o[u]=l[u]);return o}function tE(n,l,o){const u=$f(Qf,o);for(const r of n.values())if(r.parentId)Kf(r,n,l,u);else{const f=bo(r,u.nodeOrigin),d=ei(r.extent)?r.extent:u.nodeExtent,g=tl(f,d,Gn(r));r.internals.positionAbsolute=g}}function eE(n,l){if(!n.handles)return n.measured?l?.internals.handleBounds:void 0;const o=[],u=[];for(const r of n.handles){const f={id:r.id,width:r.width??1,height:r.height??1,nodeId:n.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?o.push(f):r.type==="target"&&u.push(f)}return{source:o,target:u}}function kf(n){return n==="manual"}function Cf(n,l,o,u={}){const r=$f(P_,u),f={i:0},d=new Map(l),g=r?.elevateNodesOnSelect&&!kf(r.zIndexMode)?uy:0;let m=n.length>0,h=!1;l.clear(),o.clear();for(const v of n){let y=d.get(v.id);if(r.checkEquality&&v===y?.internals.userNode)l.set(v.id,y);else{const x=bo(v,r.nodeOrigin),S=ei(v.extent)?v.extent:r.nodeExtent,_=tl(x,S,Gn(v));y={...r.defaults,...v,measured:{width:v.measured?.width,height:v.measured?.height},internals:{positionAbsolute:_,handleBounds:eE(v,y),z:sy(v,g,r.zIndexMode),userNode:v}},l.set(v.id,y)}(y.measured===void 0||y.measured.width===void 0||y.measured.height===void 0)&&!y.hidden&&(m=!1),v.parentId&&Kf(y,l,o,u,f),h||=v.selected??!1}return{nodesInitialized:m,hasSelectedNodes:h}}function nE(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 Kf(n,l,o,u,r){const{elevateNodesOnSelect:f,nodeOrigin:d,nodeExtent:g,zIndexMode:m}=$f(Qf,u),h=n.parentId,v=l.get(h);if(!v){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}nE(n,o),r&&!v.parentId&&v.internals.rootParentIndex===void 0&&m==="auto"&&(v.internals.rootParentIndex=++r.i,v.internals.z=v.internals.z+r.i*W_),r&&v.internals.rootParentIndex!==void 0&&(r.i=v.internals.rootParentIndex);const y=f&&!kf(m)?uy:0,{x,y:S,z:_}=aE(n,v,d,g,y,m),{positionAbsolute:T}=n.internals,C=x!==T.x||S!==T.y;(C||_!==n.internals.z)&&l.set(n.id,{...n,internals:{...n.internals,positionAbsolute:C?{x,y:S}:T,z:_}})}function sy(n,l,o){const u=Pe(n.zIndex)?n.zIndex:0;return kf(o)?u:u+(n.selected?l:0)}function aE(n,l,o,u,r,f){const{x:d,y:g}=l.internals.positionAbsolute,m=Gn(n),h=bo(n,o),v=ei(n.extent)?tl(h,n.extent,m):h;let y=tl({x:d+v.x,y:g+v.y},u,m);n.extent==="parent"&&(y=Ip(y,m,l));const x=sy(n,r,f),S=l.internals.z??0;return{x:y.x,y:y.y,z:S>=x?S+1:x}}function If(n,l,o,u=[0,0]){const r=[],f=new Map;for(const d of n){const g=l.get(d.parentId);if(!g)continue;const m=f.get(d.parentId)?.expandedRect??ti(g),h=Fp(m,d.rect);f.set(d.parentId,{expandedRect:h,parent:g})}return f.size>0&&f.forEach(({expandedRect:d,parent:g},m)=>{const h=g.internals.positionAbsolute,v=Gn(g),y=g.origin??u,x=d.x<h.x?Math.round(Math.abs(h.x-d.x)):0,S=d.y<h.y?Math.round(Math.abs(h.y-d.y)):0,_=Math.max(v.width,Math.round(d.width)),T=Math.max(v.height,Math.round(d.height)),C=(_-v.width)*y[0],N=(T-v.height)*y[1];(x>0||S>0||C||N)&&(r.push({id:m,type:"position",position:{x:g.position.x-x+C,y:g.position.y-S+N}}),o.get(m)?.forEach(j=>{n.some(E=>E.id===j.id)||r.push({id:j.id,type:"position",position:{x:j.position.x+x,y:j.position.y+S}})})),(v.width<d.width||v.height<d.height||x||S)&&r.push({id:m,type:"dimensions",setAttributes:!0,dimensions:{width:_+(x?y[0]*x-C:0),height:T+(S?y[1]*S-N:0)}})}),r}function lE(n,l,o,u,r,f,d){const g=u?.querySelector(".xyflow__viewport");let m=!1;if(!g)return{changes:[],updatedInternals:m};const h=[],v=window.getComputedStyle(g),{m22:y}=new window.DOMMatrixReadOnly(v.transform),x=[];for(const S of n.values()){const _=l.get(S.id);if(!_)continue;if(_.hidden){l.set(_.id,{..._,internals:{..._.internals,handleBounds:void 0}}),m=!0;continue}const T=Zf(S.nodeElement),C=_.measured.width!==T.width||_.measured.height!==T.height;if(!!(T.width&&T.height&&(C||!_.internals.handleBounds||S.force))){const j=S.nodeElement.getBoundingClientRect(),E=ei(_.extent)?_.extent:f;let{positionAbsolute:z}=_.internals;_.parentId&&_.extent==="parent"?z=Ip(z,T,l.get(_.parentId)):E&&(z=tl(z,E,T));const Y={..._,measured:T,internals:{..._.internals,positionAbsolute:z,handleBounds:{source:b0("source",S.nodeElement,j,y,_.id),target:b0("target",S.nodeElement,j,y,_.id)}}};l.set(_.id,Y),_.parentId&&Kf(Y,l,o,{nodeOrigin:r,zIndexMode:d}),m=!0,C&&(h.push({id:_.id,type:"dimensions",dimensions:T}),_.expandParent&&_.parentId&&x.push({id:_.id,parentId:_.parentId,rect:ti(Y,r)}))}}if(x.length>0){const S=If(x,l,o,r);h.push(...S)}return{changes:h,updatedInternals:m}}async function iE({delta:n,panZoom:l,transform:o,translateExtent:u,width:r,height:f}){if(!l||!n.x&&!n.y)return Promise.resolve(!1);const d=await l.setViewportConstrained({x:o[0]+n.x,y:o[1]+n.y,zoom:o[2]},[[0,0],[r,f]],u),g=!!d&&(d.x!==o[0]||d.y!==o[1]||d.k!==o[2]);return Promise.resolve(g)}function T0(n,l,o,u,r,f){let d=r;const g=u.get(d)||new Map;u.set(d,g.set(o,l)),d=`${r}-${n}`;const m=u.get(d)||new Map;if(u.set(d,m.set(o,l)),f){d=`${r}-${n}-${f}`;const h=u.get(d)||new Map;u.set(d,h.set(o,l))}}function ry(n,l,o){n.clear(),l.clear();for(const u of o){const{source:r,target:f,sourceHandle:d=null,targetHandle:g=null}=u,m={edgeId:u.id,source:r,target:f,sourceHandle:d,targetHandle:g},h=`${r}-${d}--${f}-${g}`,v=`${f}-${g}--${r}-${d}`;T0("source",m,v,n,r,d),T0("target",m,h,n,f,g),l.set(u.id,u)}}function cy(n,l){if(!n.parentId)return!1;const o=l.get(n.parentId);return o?o.selected?!0:cy(o,l):!1}function z0(n,l,o){let u=n;do{if(u?.matches?.(l))return!0;if(u===o)return!1;u=u?.parentElement}while(u);return!1}function oE(n,l,o,u){const r=new Map;for(const[f,d]of n)if((d.selected||d.id===u)&&(!d.parentId||!cy(d,n))&&(d.draggable||l&&typeof d.draggable>"u")){const g=n.get(f);g&&r.set(f,{id:f,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 cf({nodeId:n,dragItems:l,nodeLookup:o,dragging:u=!0}){const r=[];for(const[d,g]of l){const m=o.get(d)?.internals.userNode;m&&r.push({...m,position:g.position,dragging:u})}if(!n)return[r[0],r];const f=o.get(n)?.internals.userNode;return[f?{...f,position:l.get(n)?.position||f.position,dragging:u}:r[0],r]}function uE({dragItems:n,snapGrid:l,x:o,y:u}){const r=n.values().next().value;if(!r)return null;const f={x:o-r.distance.x,y:u-r.distance.y},d=Eo(f,l);return{x:d.x-f.x,y:d.y-f.y}}function sE({onNodeMouseDown:n,getStoreItems:l,onDragStart:o,onDrag:u,onDragStop:r}){let f={x:null,y:null},d=0,g=new Map,m=!1,h={x:0,y:0},v=null,y=!1,x=null,S=!1,_=!1,T=null;function C({noDragClassName:j,handleSelector:E,domNode:z,isSelectable:Y,nodeId:q,nodeClickDistance:L=0}){x=je(z);function k({x:P,y:it}){const{nodeLookup:D,nodeExtent:G,snapGrid:M,snapToGrid:R,nodeOrigin:B,onNodeDrag:X,onSelectionDrag:tt,onError:A,updateNodePositions:H}=l();f={x:P,y:it};let W=!1;const et=g.size>1,st=et&&G?Af(_o(g)):null,ct=et&&R?uE({dragItems:g,snapGrid:M,x:P,y:it}):null;for(const[rt,ut]of g){if(!D.has(rt))continue;let ft={x:P-ut.distance.x,y:it-ut.distance.y};R&&(ft=ct?{x:Math.round(ft.x+ct.x),y:Math.round(ft.y+ct.y)}:Eo(ft,M));let Et=null;if(et&&G&&!ut.extent&&st){const{positionAbsolute:xt}=ut.internals,At=xt.x-st.x+G[0][0],qt=xt.x+ut.measured.width-st.x2+G[1][0],jt=xt.y-st.y+G[0][1],oe=xt.y+ut.measured.height-st.y2+G[1][1];Et=[[At,jt],[qt,oe]]}const{position:bt,positionAbsolute:yt}=Kp({nodeId:rt,nextPosition:ft,nodeLookup:D,nodeExtent:Et||G,nodeOrigin:B,onError:A});W=W||ut.position.x!==bt.x||ut.position.y!==bt.y,ut.position=bt,ut.internals.positionAbsolute=yt}if(_=_||W,!!W&&(H(g,!0),T&&(u||X||!q&&tt))){const[rt,ut]=cf({nodeId:q,dragItems:g,nodeLookup:D});u?.(T,g,rt,ut),X?.(T,rt,ut),q||tt?.(T,ut)}}async function I(){if(!v)return;const{transform:P,panBy:it,autoPanSpeed:D,autoPanOnNodeDrag:G}=l();if(!G){m=!1,cancelAnimationFrame(d);return}const[M,R]=Jp(h,v,D);(M!==0||R!==0)&&(f.x=(f.x??0)-M/P[2],f.y=(f.y??0)-R/P[2],await it({x:M,y:R})&&k(f)),d=requestAnimationFrame(I)}function ot(P){const{nodeLookup:it,multiSelectionActive:D,nodesDraggable:G,transform:M,snapGrid:R,snapToGrid:B,selectNodesOnDrag:X,onNodeDragStart:tt,onSelectionDragStart:A,unselectNodesAndEdges:H}=l();y=!0,(!X||!Y)&&!D&&q&&(it.get(q)?.selected||H()),Y&&X&&q&&n?.(q);const W=uo(P.sourceEvent,{transform:M,snapGrid:R,snapToGrid:B,containerBounds:v});if(f=W,g=oE(it,G,W,q),g.size>0&&(o||tt||!q&&A)){const[et,st]=cf({nodeId:q,dragItems:g,nodeLookup:it});o?.(P.sourceEvent,g,et,st),tt?.(P.sourceEvent,et,st),q||A?.(P.sourceEvent,st)}}const $=Ap().clickDistance(L).on("start",P=>{const{domNode:it,nodeDragThreshold:D,transform:G,snapGrid:M,snapToGrid:R}=l();v=it?.getBoundingClientRect()||null,S=!1,_=!1,T=P.sourceEvent,D===0&&ot(P),f=uo(P.sourceEvent,{transform:G,snapGrid:M,snapToGrid:R,containerBounds:v}),h=tn(P.sourceEvent,v)}).on("drag",P=>{const{autoPanOnNodeDrag:it,transform:D,snapGrid:G,snapToGrid:M,nodeDragThreshold:R,nodeLookup:B}=l(),X=uo(P.sourceEvent,{transform:D,snapGrid:G,snapToGrid:M,containerBounds:v});if(T=P.sourceEvent,(P.sourceEvent.type==="touchmove"&&P.sourceEvent.touches.length>1||q&&!B.has(q))&&(S=!0),!S){if(!m&&it&&y&&(m=!0,I()),!y){const tt=tn(P.sourceEvent,v),A=tt.x-h.x,H=tt.y-h.y;Math.sqrt(A*A+H*H)>R&&ot(P)}(f.x!==X.xSnapped||f.y!==X.ySnapped)&&g&&y&&(h=tn(P.sourceEvent,v),k(X))}}).on("end",P=>{if(!(!y||S)&&(m=!1,y=!1,cancelAnimationFrame(d),g.size>0)){const{nodeLookup:it,updateNodePositions:D,onNodeDragStop:G,onSelectionDragStop:M}=l();if(_&&(D(g,!1),_=!1),r||G||!q&&M){const[R,B]=cf({nodeId:q,dragItems:g,nodeLookup:it,dragging:!1});r?.(P.sourceEvent,g,R,B),G?.(P.sourceEvent,R,B),q||M?.(P.sourceEvent,B)}}}).filter(P=>{const it=P.target;return!P.button&&(!j||!z0(it,`.${j}`,z))&&(!E||z0(it,E,z))});x.call($)}function N(){x?.on(".drag",null)}return{update:C,destroy:N}}function rE(n,l,o){const u=[],r={x:n.x-o,y:n.y-o,width:o*2,height:o*2};for(const f of l.values())mo(r,ti(f))>0&&u.push(f);return u}const cE=250;function fE(n,l,o,u){let r=[],f=1/0;const d=rE(n,o,l+cE);for(const g of d){const m=[...g.internals.handleBounds?.source??[],...g.internals.handleBounds?.target??[]];for(const h of m){if(u.nodeId===h.nodeId&&u.type===h.type&&u.id===h.id)continue;const{x:v,y}=el(g,h,h.position,!0),x=Math.sqrt(Math.pow(v-n.x,2)+Math.pow(y-n.y,2));x>l||(x<f?(r=[{...h,x:v,y}],f=x):x===f&&r.push({...h,x:v,y}))}}if(!r.length)return null;if(r.length>1){const g=u.type==="source"?"target":"source";return r.find(m=>m.type===g)??r[0]}return r[0]}function fy(n,l,o,u,r,f=!1){const d=u.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&&f?{...m,...el(d,m,m.position,!0)}:m}function dy(n,l){return n||(l?.classList.contains("target")?"target":l?.classList.contains("source")?"source":null)}function dE(n,l){let o=null;return l?o=!0:n&&!l&&(o=!1),o}const hy=()=>!0;function hE(n,{connectionMode:l,connectionRadius:o,handleId:u,nodeId:r,edgeUpdaterType:f,isTarget:d,domNode:g,nodeLookup:m,lib:h,autoPanOnConnect:v,flowId:y,panBy:x,cancelConnection:S,onConnectStart:_,onConnect:T,onConnectEnd:C,isValidConnection:N=hy,onReconnectEnd:j,updateConnection:E,getTransform:z,getFromHandle:Y,autoPanSpeed:q,dragThreshold:L=1,handleDomNode:k}){const I=ty(n.target);let ot=0,$;const{x:P,y:it}=tn(n),D=dy(f,k),G=g?.getBoundingClientRect();let M=!1;if(!G||!D)return;const R=fy(r,D,u,m,l);if(!R)return;let B=tn(n,G),X=!1,tt=null,A=!1,H=null;function W(){if(!v||!G)return;const[bt,yt]=Jp(B,G,q);x({x:bt,y:yt}),ot=requestAnimationFrame(W)}const et={...R,nodeId:r,type:D,position:R.position},st=m.get(r);let rt={inProgress:!0,isValid:null,from:el(st,et,mt.Left,!0),fromHandle:et,fromPosition:et.position,fromNode:st,to:B,toHandle:null,toPosition:y0[et.position],toNode:null,pointer:B};function ut(){M=!0,E(rt),_?.(n,{nodeId:r,handleId:u,handleType:D})}L===0&&ut();function ft(bt){if(!M){const{x:oe,y:Qe}=tn(bt),Ae=oe-P,$e=Qe-it;if(!(Ae*Ae+$e*$e>L*L))return;ut()}if(!Y()||!et){Et(bt);return}const yt=z();B=tn(bt,G),$=fE(wo(B,yt,!1,[1,1]),o,m,et),X||(W(),X=!0);const xt=gy(bt,{handle:$,connectionMode:l,fromNodeId:r,fromHandleId:u,fromType:d?"target":"source",isValidConnection:N,doc:I,lib:h,flowId:y,nodeLookup:m});H=xt.handleDomNode,tt=xt.connection,A=dE(!!$,xt.isValid);const At=m.get(r),qt=At?el(At,et,mt.Left,!0):rt.from,jt={...rt,from:qt,isValid:A,to:xt.toHandle&&A?Ss({x:xt.toHandle.x,y:xt.toHandle.y},yt):B,toHandle:xt.toHandle,toPosition:A&&xt.toHandle?xt.toHandle.position:y0[et.position],toNode:xt.toHandle?m.get(xt.toHandle.nodeId):null,pointer:B};E(jt),rt=jt}function Et(bt){if(!("touches"in bt&&bt.touches.length>0)){if(M){($||H)&&tt&&A&&T?.(tt);const{inProgress:yt,...xt}=rt,At={...xt,toPosition:rt.toHandle?rt.toPosition:null};C?.(bt,At),f&&j?.(bt,At)}S(),cancelAnimationFrame(ot),X=!1,A=!1,tt=null,H=null,I.removeEventListener("mousemove",ft),I.removeEventListener("mouseup",Et),I.removeEventListener("touchmove",ft),I.removeEventListener("touchend",Et)}}I.addEventListener("mousemove",ft),I.addEventListener("mouseup",Et),I.addEventListener("touchmove",ft),I.addEventListener("touchend",Et)}function gy(n,{handle:l,connectionMode:o,fromNodeId:u,fromHandleId:r,fromType:f,doc:d,lib:g,flowId:m,isValidConnection:h=hy,nodeLookup:v}){const y=f==="target",x=l?d.querySelector(`.${g}-flow__handle[data-id="${m}-${l?.nodeId}-${l?.id}-${l?.type}"]`):null,{x:S,y:_}=tn(n),T=d.elementFromPoint(S,_),C=T?.classList.contains(`${g}-flow__handle`)?T:x,N={handleDomNode:C,isValid:!1,connection:null,toHandle:null};if(C){const j=dy(void 0,C),E=C.getAttribute("data-nodeid"),z=C.getAttribute("data-handleid"),Y=C.classList.contains("connectable"),q=C.classList.contains("connectableend");if(!E||!j)return N;const L={source:y?E:u,sourceHandle:y?z:r,target:y?u:E,targetHandle:y?r:z};N.connection=L;const I=Y&&q&&(o===Wl.Strict?y&&j==="source"||!y&&j==="target":E!==u||z!==r);N.isValid=I&&h(L),N.toHandle=fy(E,j,z,v,o,!0)}return N}const Df={onPointerDown:hE,isValid:gy};function gE({domNode:n,panZoom:l,getTransform:o,getViewScale:u}){const r=je(n);function f({translateExtent:g,width:m,height:h,zoomStep:v=1,pannable:y=!0,zoomable:x=!0,inversePan:S=!1}){const _=E=>{if(E.sourceEvent.type!=="wheel"||!l)return;const z=o(),Y=E.sourceEvent.ctrlKey&&po()?10:1,q=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*v,L=z[2]*Math.pow(2,q*Y);l.scaleTo(L)};let T=[0,0];const C=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(T=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},N=E=>{const z=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],q=[Y[0]-T[0],Y[1]-T[1]];T=Y;const L=u()*Math.max(z[2],Math.log(z[2]))*(S?-1:1),k={x:z[0]-q[0]*L,y:z[1]-q[1]*L},I=[[0,0],[m,h]];l.setViewportConstrained({x:k.x,y:k.y,zoom:z[2]},I,g)},j=Gp().on("start",C).on("zoom",y?N:null).on("zoom.wheel",x?_:null);r.call(j,{})}function d(){r.on("zoom",null)}return{update:f,destroy:d,pointer:Fe}}const zs=n=>({x:n.x,y:n.y,zoom:n.k}),ff=({x:n,y:l,zoom:o})=>Ms.translate(n,l).scale(o),$l=(n,l)=>n.target.closest(`.${l}`),my=(n,l)=>l===2&&Array.isArray(n)&&n.includes(2),mE=n=>((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2,df=(n,l=0,o=mE,u=()=>{})=>{const r=typeof l=="number"&&l>0;return r||u(),r?n.transition().duration(l).ease(o).on("end",u):n},py=n=>{const l=n.ctrlKey&&po()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*l};function pE({zoomPanValues:n,noWheelClassName:l,d3Selection:o,d3Zoom:u,panOnScrollMode:r,panOnScrollSpeed:f,zoomOnPinch:d,onPanZoomStart:g,onPanZoom:m,onPanZoomEnd:h}){return v=>{if($l(v,l))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const y=o.property("__zoom").k||1;if(v.ctrlKey&&d){const C=Fe(v),N=py(v),j=y*Math.pow(2,N);u.scaleTo(o,j,C,v);return}const x=v.deltaMode===1?20:1;let S=r===Fa.Vertical?0:v.deltaX*x,_=r===Fa.Horizontal?0:v.deltaY*x;!po()&&v.shiftKey&&r!==Fa.Vertical&&(S=v.deltaY*x,_=0),u.translateBy(o,-(S/y)*f,-(_/y)*f,{internal:!0});const T=zs(o.property("__zoom"));clearTimeout(n.panScrollTimeout),n.isPanScrolling?(m?.(v,T),n.panScrollTimeout=setTimeout(()=>{h?.(v,T),n.isPanScrolling=!1},150)):(n.isPanScrolling=!0,g?.(v,T))}}function yE({noWheelClassName:n,preventScrolling:l,d3ZoomHandler:o}){return function(u,r){const f=u.type==="wheel",d=!l&&f&&!u.ctrlKey,g=$l(u,n);if(u.ctrlKey&&f&&g&&u.preventDefault(),d||g)return null;u.preventDefault(),o.call(this,u,r)}}function vE({zoomPanValues:n,onDraggingChange:l,onPanZoomStart:o}){return u=>{if(u.sourceEvent?.internal)return;const r=zs(u.transform);n.mouseButton=u.sourceEvent?.button||0,n.isZoomingOrPanning=!0,n.prevViewport=r,u.sourceEvent?.type==="mousedown"&&l(!0),o&&o?.(u.sourceEvent,r)}}function xE({zoomPanValues:n,panOnDrag:l,onPaneContextMenu:o,onTransformChange:u,onPanZoom:r}){return f=>{n.usedRightMouseButton=!!(o&&my(l,n.mouseButton??0)),f.sourceEvent?.sync||u([f.transform.x,f.transform.y,f.transform.k]),r&&!f.sourceEvent?.internal&&r?.(f.sourceEvent,zs(f.transform))}}function SE({zoomPanValues:n,panOnDrag:l,panOnScroll:o,onDraggingChange:u,onPanZoomEnd:r,onPaneContextMenu:f}){return d=>{if(!d.sourceEvent?.internal&&(n.isZoomingOrPanning=!1,f&&my(l,n.mouseButton??0)&&!n.usedRightMouseButton&&d.sourceEvent&&f(d.sourceEvent),n.usedRightMouseButton=!1,u(!1),r)){const g=zs(d.transform);n.prevViewport=g,clearTimeout(n.timerId),n.timerId=setTimeout(()=>{r?.(d.sourceEvent,g)},o?150:0)}}}function bE({zoomActivationKeyPressed:n,zoomOnScroll:l,zoomOnPinch:o,panOnDrag:u,panOnScroll:r,zoomOnDoubleClick:f,userSelectionActive:d,noWheelClassName:g,noPanClassName:m,lib:h,connectionInProgress:v}){return y=>{const x=n||l,S=o&&y.ctrlKey,_=y.type==="wheel";if(y.button===1&&y.type==="mousedown"&&($l(y,`${h}-flow__node`)||$l(y,`${h}-flow__edge`)))return!0;if(!u&&!x&&!r&&!f&&!o||d||v&&!_||$l(y,g)&&_||$l(y,m)&&(!_||r&&_&&!n)||!o&&y.ctrlKey&&_)return!1;if(!o&&y.type==="touchstart"&&y.touches?.length>1)return y.preventDefault(),!1;if(!x&&!r&&!S&&_||!u&&(y.type==="mousedown"||y.type==="touchstart")||Array.isArray(u)&&!u.includes(y.button)&&y.type==="mousedown")return!1;const T=Array.isArray(u)&&u.includes(y.button)||!y.button||y.button<=1;return(!y.ctrlKey||_)&&T}}function _E({domNode:n,minZoom:l,maxZoom:o,translateExtent:u,viewport:r,onPanZoom:f,onPanZoomStart:d,onPanZoomEnd:g,onDraggingChange:m}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=n.getBoundingClientRect(),y=Gp().scaleExtent([l,o]).translateExtent(u),x=je(n).call(y);j({x:r.x,y:r.y,zoom:Pl(r.zoom,l,o)},[[0,0],[v.width,v.height]],u);const S=x.on("wheel.zoom"),_=x.on("dblclick.zoom");y.wheelDelta(py);function T($,P){return x?new Promise(it=>{y?.interpolate(P?.interpolate==="linear"?oo:os).transform(df(x,P?.duration,P?.ease,()=>it(!0)),$)}):Promise.resolve(!1)}function C({noWheelClassName:$,noPanClassName:P,onPaneContextMenu:it,userSelectionActive:D,panOnScroll:G,panOnDrag:M,panOnScrollMode:R,panOnScrollSpeed:B,preventScrolling:X,zoomOnPinch:tt,zoomOnScroll:A,zoomOnDoubleClick:H,zoomActivationKeyPressed:W,lib:et,onTransformChange:st,connectionInProgress:ct,paneClickDistance:rt,selectionOnDrag:ut}){D&&!h.isZoomingOrPanning&&N();const ft=G&&!W&&!D;y.clickDistance(ut?1/0:!Pe(rt)||rt<0?0:rt);const Et=ft?pE({zoomPanValues:h,noWheelClassName:$,d3Selection:x,d3Zoom:y,panOnScrollMode:R,panOnScrollSpeed:B,zoomOnPinch:tt,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:g}):yE({noWheelClassName:$,preventScrolling:X,d3ZoomHandler:S});if(x.on("wheel.zoom",Et,{passive:!1}),!D){const yt=vE({zoomPanValues:h,onDraggingChange:m,onPanZoomStart:d});y.on("start",yt);const xt=xE({zoomPanValues:h,panOnDrag:M,onPaneContextMenu:!!it,onPanZoom:f,onTransformChange:st});y.on("zoom",xt);const At=SE({zoomPanValues:h,panOnDrag:M,panOnScroll:G,onPaneContextMenu:it,onPanZoomEnd:g,onDraggingChange:m});y.on("end",At)}const bt=bE({zoomActivationKeyPressed:W,panOnDrag:M,zoomOnScroll:A,panOnScroll:G,zoomOnDoubleClick:H,zoomOnPinch:tt,userSelectionActive:D,noPanClassName:P,noWheelClassName:$,lib:et,connectionInProgress:ct});y.filter(bt),H?x.on("dblclick.zoom",_):x.on("dblclick.zoom",null)}function N(){y.on("zoom",null)}async function j($,P,it){const D=ff($),G=y?.constrain()(D,P,it);return G&&await T(G),new Promise(M=>M(G))}async function E($,P){const it=ff($);return await T(it,P),new Promise(D=>D(it))}function z($){if(x){const P=ff($),it=x.property("__zoom");(it.k!==$.zoom||it.x!==$.x||it.y!==$.y)&&y?.transform(x,P,null,{sync:!0})}}function Y(){const $=x?Vp(x.node()):{x:0,y:0,k:1};return{x:$.x,y:$.y,zoom:$.k}}function q($,P){return x?new Promise(it=>{y?.interpolate(P?.interpolate==="linear"?oo:os).scaleTo(df(x,P?.duration,P?.ease,()=>it(!0)),$)}):Promise.resolve(!1)}function L($,P){return x?new Promise(it=>{y?.interpolate(P?.interpolate==="linear"?oo:os).scaleBy(df(x,P?.duration,P?.ease,()=>it(!0)),$)}):Promise.resolve(!1)}function k($){y?.scaleExtent($)}function I($){y?.translateExtent($)}function ot($){const P=!Pe($)||$<0?0:$;y?.clickDistance(P)}return{update:C,destroy:N,setViewport:E,setViewportConstrained:j,getViewport:Y,scaleTo:q,scaleBy:L,setScaleExtent:k,setTranslateExtent:I,syncViewport:z,setClickDistance:ot}}var ni;(function(n){n.Line="line",n.Handle="handle"})(ni||(ni={}));function EE({width:n,prevWidth:l,height:o,prevHeight:u,affectsX:r,affectsY:f}){const d=n-l,g=o-u,m=[d>0?1:d<0?-1:0,g>0?1:g<0?-1:0];return d&&r&&(m[0]=m[0]*-1),g&&f&&(m[1]=m[1]*-1),m}function C0(n){const l=n.includes("right")||n.includes("left"),o=n.includes("bottom")||n.includes("top"),u=n.includes("left"),r=n.includes("top");return{isHorizontal:l,isVertical:o,affectsX:u,affectsY:r}}function va(n,l){return Math.max(0,l-n)}function xa(n,l){return Math.max(0,n-l)}function ts(n,l,o){return Math.max(0,l-n,n-o)}function D0(n,l){return n?!l:l}function wE(n,l,o,u,r,f,d,g){let{affectsX:m,affectsY:h}=l;const{isHorizontal:v,isVertical:y}=l,x=v&&y,{xSnapped:S,ySnapped:_}=o,{minWidth:T,maxWidth:C,minHeight:N,maxHeight:j}=u,{x:E,y:z,width:Y,height:q,aspectRatio:L}=n;let k=Math.floor(v?S-n.pointerX:0),I=Math.floor(y?_-n.pointerY:0);const ot=Y+(m?-k:k),$=q+(h?-I:I),P=-f[0]*Y,it=-f[1]*q;let D=ts(ot,T,C),G=ts($,N,j);if(d){let B=0,X=0;m&&k<0?B=va(E+k+P,d[0][0]):!m&&k>0&&(B=xa(E+ot+P,d[1][0])),h&&I<0?X=va(z+I+it,d[0][1]):!h&&I>0&&(X=xa(z+$+it,d[1][1])),D=Math.max(D,B),G=Math.max(G,X)}if(g){let B=0,X=0;m&&k>0?B=xa(E+k,g[0][0]):!m&&k<0&&(B=va(E+ot,g[1][0])),h&&I>0?X=xa(z+I,g[0][1]):!h&&I<0&&(X=va(z+$,g[1][1])),D=Math.max(D,B),G=Math.max(G,X)}if(r){if(v){const B=ts(ot/L,N,j)*L;if(D=Math.max(D,B),d){let X=0;!m&&!h||m&&!h&&x?X=xa(z+it+ot/L,d[1][1])*L:X=va(z+it+(m?k:-k)/L,d[0][1])*L,D=Math.max(D,X)}if(g){let X=0;!m&&!h||m&&!h&&x?X=va(z+ot/L,g[1][1])*L:X=xa(z+(m?k:-k)/L,g[0][1])*L,D=Math.max(D,X)}}if(y){const B=ts($*L,T,C)/L;if(G=Math.max(G,B),d){let X=0;!m&&!h||h&&!m&&x?X=xa(E+$*L+P,d[1][0])/L:X=va(E+(h?I:-I)*L+P,d[0][0])/L,G=Math.max(G,X)}if(g){let X=0;!m&&!h||h&&!m&&x?X=va(E+$*L,g[1][0])/L:X=xa(E+(h?I:-I)*L,g[0][0])/L,G=Math.max(G,X)}}}I=I+(I<0?G:-G),k=k+(k<0?D:-D),r&&(x?ot>$*L?I=(D0(m,h)?-k:k)/L:k=(D0(m,h)?-I:I)*L:v?(I=k/L,h=m):(k=I*L,m=h));const M=m?E+k:E,R=h?z+I:z;return{width:Y+(m?-k:k),height:q+(h?-I:I),x:f[0]*k*(m?-1:1)+M,y:f[1]*I*(h?-1:1)+R}}const yy={width:0,height:0,x:0,y:0},NE={...yy,pointerX:0,pointerY:0,aspectRatio:1};function ME(n){return[[0,0],[n.measured.width,n.measured.height]]}function AE(n,l,o){const u=l.position.x+n.position.x,r=l.position.y+n.position.y,f=n.measured.width??0,d=n.measured.height??0,g=o[0]*f,m=o[1]*d;return[[u-g,r-m],[u+f-g,r+d-m]]}function TE({domNode:n,nodeId:l,getStoreItems:o,onChange:u,onEnd:r}){const f=je(n);let d={controlDirection:C0("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function g({controlPosition:h,boundaries:v,keepAspectRatio:y,resizeDirection:x,onResizeStart:S,onResize:_,onResizeEnd:T,shouldResize:C}){let N={...yy},j={...NE};d={boundaries:v,resizeDirection:x,keepAspectRatio:y,controlDirection:C0(h)};let E,z=null,Y=[],q,L,k,I=!1;const ot=Ap().on("start",$=>{const{nodeLookup:P,transform:it,snapGrid:D,snapToGrid:G,nodeOrigin:M,paneDomNode:R}=o();if(E=P.get(l),!E)return;z=R?.getBoundingClientRect()??null;const{xSnapped:B,ySnapped:X}=uo($.sourceEvent,{transform:it,snapGrid:D,snapToGrid:G,containerBounds:z});N={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},j={...N,pointerX:B,pointerY:X,aspectRatio:N.width/N.height},q=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(q=P.get(E.parentId),L=q&&E.extent==="parent"?ME(q):void 0),Y=[],k=void 0;for(const[tt,A]of P)if(A.parentId===l&&(Y.push({id:tt,position:{...A.position},extent:A.extent}),A.extent==="parent"||A.expandParent)){const H=AE(A,E,A.origin??M);k?k=[[Math.min(H[0][0],k[0][0]),Math.min(H[0][1],k[0][1])],[Math.max(H[1][0],k[1][0]),Math.max(H[1][1],k[1][1])]]:k=H}S?.($,{...N})}).on("drag",$=>{const{transform:P,snapGrid:it,snapToGrid:D,nodeOrigin:G}=o(),M=uo($.sourceEvent,{transform:P,snapGrid:it,snapToGrid:D,containerBounds:z}),R=[];if(!E)return;const{x:B,y:X,width:tt,height:A}=N,H={},W=E.origin??G,{width:et,height:st,x:ct,y:rt}=wE(j,d.controlDirection,M,d.boundaries,d.keepAspectRatio,W,L,k),ut=et!==tt,ft=st!==A,Et=ct!==B&&ut,bt=rt!==X&&ft;if(!Et&&!bt&&!ut&&!ft)return;if((Et||bt||W[0]===1||W[1]===1)&&(H.x=Et?ct:N.x,H.y=bt?rt:N.y,N.x=H.x,N.y=H.y,Y.length>0)){const qt=ct-B,jt=rt-X;for(const oe of Y)oe.position={x:oe.position.x-qt+W[0]*(et-tt),y:oe.position.y-jt+W[1]*(st-A)},R.push(oe)}if((ut||ft)&&(H.width=ut&&(!d.resizeDirection||d.resizeDirection==="horizontal")?et:N.width,H.height=ft&&(!d.resizeDirection||d.resizeDirection==="vertical")?st:N.height,N.width=H.width,N.height=H.height),q&&E.expandParent){const qt=W[0]*(H.width??0);H.x&&H.x<qt&&(N.x=qt,j.x=j.x-(H.x-qt));const jt=W[1]*(H.height??0);H.y&&H.y<jt&&(N.y=jt,j.y=j.y-(H.y-jt))}const yt=EE({width:N.width,prevWidth:tt,height:N.height,prevHeight:A,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),xt={...N,direction:yt};C?.($,xt)!==!1&&(I=!0,_?.($,xt),u(H,R))}).on("end",$=>{I&&(T?.($,{...N}),r?.({...N}),I=!1)});f.call(ot)}function m(){f.on(".drag",null)}return{update:g,destroy:m}}var hf={exports:{}},gf={},mf={exports:{}},pf={};var O0;function zE(){if(O0)return pf;O0=1;var n=vo();function l(y,x){return y===x&&(y!==0||1/y===1/x)||y!==y&&x!==x}var o=typeof Object.is=="function"?Object.is:l,u=n.useState,r=n.useEffect,f=n.useLayoutEffect,d=n.useDebugValue;function g(y,x){var S=x(),_=u({inst:{value:S,getSnapshot:x}}),T=_[0].inst,C=_[1];return f(function(){T.value=S,T.getSnapshot=x,m(T)&&C({inst:T})},[y,S,x]),r(function(){return m(T)&&C({inst:T}),y(function(){m(T)&&C({inst:T})})},[y]),d(S),S}function m(y){var x=y.getSnapshot;y=y.value;try{var S=x();return!o(y,S)}catch{return!0}}function h(y,x){return x()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:g;return pf.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:v,pf}var R0;function CE(){return R0||(R0=1,mf.exports=zE()),mf.exports}var H0;function DE(){if(H0)return gf;H0=1;var n=vo(),l=CE();function o(h,v){return h===v&&(h!==0||1/h===1/v)||h!==h&&v!==v}var u=typeof Object.is=="function"?Object.is:o,r=l.useSyncExternalStore,f=n.useRef,d=n.useEffect,g=n.useMemo,m=n.useDebugValue;return gf.useSyncExternalStoreWithSelector=function(h,v,y,x,S){var _=f(null);if(_.current===null){var T={hasValue:!1,value:null};_.current=T}else T=_.current;_=g(function(){function N(q){if(!j){if(j=!0,E=q,q=x(q),S!==void 0&&T.hasValue){var L=T.value;if(S(L,q))return z=L}return z=q}if(L=z,u(E,q))return L;var k=x(q);return S!==void 0&&S(L,k)?(E=q,L):(E=q,z=k)}var j=!1,E,z,Y=y===void 0?null:y;return[function(){return N(v())},Y===null?void 0:function(){return N(Y())}]},[v,y,x,S]);var C=r(h,_[0],_[1]);return d(function(){T.hasValue=!0,T.value=C},[C]),m(C),C},gf}var j0;function OE(){return j0||(j0=1,hf.exports=DE()),hf.exports}var RE=OE();const HE=op(RE),jE={},U0=n=>{let l;const o=new Set,u=(v,y)=>{const x=typeof v=="function"?v(l):v;if(!Object.is(x,l)){const S=l;l=y??(typeof x!="object"||x===null)?x:Object.assign({},l,x),o.forEach(_=>_(l,S))}},r=()=>l,m={setState:u,getState:r,getInitialState:()=>h,subscribe:v=>(o.add(v),()=>o.delete(v)),destroy:()=>{(jE?"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(u,r,m);return m},UE=n=>n?U0(n):U0,{useDebugValue:BE}=ao,{useSyncExternalStoreWithSelector:qE}=HE,LE=n=>n;function vy(n,l=LE,o){const u=qE(n.subscribe,n.getState,n.getServerState||n.getInitialState,l,o);return BE(u),u}const B0=(n,l)=>{const o=UE(n),u=(r,f=l)=>vy(o,r,f);return Object.assign(u,o),u},YE=(n,l)=>n?B0(n,l):B0;function $t(n,l){if(Object.is(n,l))return!0;if(typeof n!="object"||n===null||typeof l!="object"||l===null)return!1;if(n instanceof Map&&l instanceof Map){if(n.size!==l.size)return!1;for(const[u,r]of n)if(!Object.is(r,l.get(u)))return!1;return!0}if(n instanceof Set&&l instanceof Set){if(n.size!==l.size)return!1;for(const u of n)if(!l.has(u))return!1;return!0}const o=Object.keys(n);if(o.length!==Object.keys(l).length)return!1;for(const u of o)if(!Object.prototype.hasOwnProperty.call(l,u)||!Object.is(n[u],l[u]))return!1;return!0}up();const Cs=J.createContext(null),VE=Cs.Provider,xy=hn.error001();function Dt(n,l){const o=J.useContext(Cs);if(o===null)throw new Error(xy);return vy(o,n,l)}function kt(){const n=J.useContext(Cs);if(n===null)throw new Error(xy);return J.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe}),[n])}const q0={display:"none"},GE={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},Sy="react-flow__node-desc",by="react-flow__edge-desc",XE="react-flow__aria-live",ZE=n=>n.ariaLiveMessage,QE=n=>n.ariaLabelConfig;function $E({rfId:n}){const l=Dt(ZE);return w.jsx("div",{id:`${XE}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:GE,children:l})}function kE({rfId:n,disableKeyboardA11y:l}){const o=Dt(QE);return w.jsxs(w.Fragment,{children:[w.jsx("div",{id:`${Sy}-${n}`,style:q0,children:l?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),w.jsx("div",{id:`${by}-${n}`,style:q0,children:o["edge.a11yDescription.default"]}),!l&&w.jsx($E,{rfId:n})]})}const Ds=J.forwardRef(({position:n="top-left",children:l,className:o,style:u,...r},f)=>{const d=`${n}`.split("-");return w.jsx("div",{className:ae(["react-flow__panel",o,...d]),style:u,ref:f,...r,children:l})});Ds.displayName="Panel";function KE({proOptions:n,position:l="bottom-right"}){return n?.hideAttribution?null:w.jsx(Ds,{position:l,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:w.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const IE=n=>{const l=[],o=[];for(const[,u]of n.nodeLookup)u.selected&&l.push(u.internals.userNode);for(const[,u]of n.edgeLookup)u.selected&&o.push(u);return{selectedNodes:l,selectedEdges:o}},es=n=>n.id;function JE(n,l){return $t(n.selectedNodes.map(es),l.selectedNodes.map(es))&&$t(n.selectedEdges.map(es),l.selectedEdges.map(es))}function FE({onSelectionChange:n}){const l=kt(),{selectedNodes:o,selectedEdges:u}=Dt(IE,JE);return J.useEffect(()=>{const r={nodes:o,edges:u};n?.(r),l.getState().onSelectionChangeHandlers.forEach(f=>f(r))},[o,u,n]),null}const WE=n=>!!n.onSelectionChangeHandlers;function PE({onSelectionChange:n}){const l=Dt(WE);return n||l?w.jsx(FE,{onSelectionChange:n}):null}const Of=typeof window<"u"?J.useLayoutEffect:J.useEffect,_y=[0,0],tw={x:0,y:0,zoom:1},ew=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],L0=[...ew,"rfId"],nw=n=>({setNodes:n.setNodes,setEdges:n.setEdges,setMinZoom:n.setMinZoom,setMaxZoom:n.setMaxZoom,setTranslateExtent:n.setTranslateExtent,setNodeExtent:n.setNodeExtent,reset:n.reset,setDefaultNodesAndEdges:n.setDefaultNodesAndEdges}),Y0={translateExtent:ho,nodeOrigin:_y,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function aw(n){const{setNodes:l,setEdges:o,setMinZoom:u,setMaxZoom:r,setTranslateExtent:f,setNodeExtent:d,reset:g,setDefaultNodesAndEdges:m}=Dt(nw,$t),h=kt();Of(()=>(m(n.defaultNodes,n.defaultEdges),()=>{v.current=Y0,g()}),[]);const v=J.useRef(Y0);return Of(()=>{for(const y of L0){const x=n[y],S=v.current[y];x!==S&&(typeof n[y]>"u"||(y==="nodes"?l(x):y==="edges"?o(x):y==="minZoom"?u(x):y==="maxZoom"?r(x):y==="translateExtent"?f(x):y==="nodeExtent"?d(x):y==="ariaLabelConfig"?h.setState({ariaLabelConfig:Y_(x)}):y==="fitView"?h.setState({fitViewQueued:x}):y==="fitViewOptions"?h.setState({fitViewOptions:x}):h.setState({[y]:x})))}v.current=n},L0.map(y=>n[y])),null}function V0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function lw(n){const[l,o]=J.useState(n==="system"?null:n);return J.useEffect(()=>{if(n!=="system"){o(n);return}const u=V0(),r=()=>o(u?.matches?"dark":"light");return r(),u?.addEventListener("change",r),()=>{u?.removeEventListener("change",r)}},[n]),l!==null?l:V0()?.matches?"dark":"light"}const G0=typeof document<"u"?document:null;function yo(n=null,l={target:G0,actInsideInputWithModifier:!0}){const[o,u]=J.useState(!1),r=J.useRef(!1),f=J.useRef(new Set([])),[d,g]=J.useMemo(()=>{if(n!==null){const h=(Array.isArray(n)?n:[n]).filter(y=>typeof y=="string").map(y=>y.replace("+",`
10
- `).replace(`
11
-
12
- `,`
13
- +`).split(`
14
- `)),v=h.reduce((y,x)=>y.concat(...x),[]);return[h,v]}return[[],[]]},[n]);return J.useEffect(()=>{const m=l?.target??G0,h=l?.actInsideInputWithModifier??!0;if(n!==null){const v=S=>{if(r.current=S.ctrlKey||S.metaKey||S.shiftKey||S.altKey,(!r.current||r.current&&!h)&&ey(S))return!1;const T=Z0(S.code,g);if(f.current.add(S[T]),X0(d,f.current,!1)){const C=S.composedPath?.()?.[0]||S.target,N=C?.nodeName==="BUTTON"||C?.nodeName==="A";l.preventDefault!==!1&&(r.current||!N)&&S.preventDefault(),u(!0)}},y=S=>{const _=Z0(S.code,g);X0(d,f.current,!0)?(u(!1),f.current.clear()):f.current.delete(S[_]),S.key==="Meta"&&f.current.clear(),r.current=!1},x=()=>{f.current.clear(),u(!1)};return m?.addEventListener("keydown",v),m?.addEventListener("keyup",y),window.addEventListener("blur",x),window.addEventListener("contextmenu",x),()=>{m?.removeEventListener("keydown",v),m?.removeEventListener("keyup",y),window.removeEventListener("blur",x),window.removeEventListener("contextmenu",x)}}},[n,u]),o}function X0(n,l,o){return n.filter(u=>o||u.length===l.size).some(u=>u.every(r=>l.has(r)))}function Z0(n,l){return l.includes(n)?"code":"key"}const iw=()=>{const n=kt();return J.useMemo(()=>({zoomIn:l=>{const{panZoom:o}=n.getState();return o?o.scaleBy(1.2,l):Promise.resolve(!1)},zoomOut:l=>{const{panZoom:o}=n.getState();return o?o.scaleBy(1/1.2,l):Promise.resolve(!1)},zoomTo:(l,o)=>{const{panZoom:u}=n.getState();return u?u.scaleTo(l,o):Promise.resolve(!1)},getZoom:()=>n.getState().transform[2],setViewport:async(l,o)=>{const{transform:[u,r,f],panZoom:d}=n.getState();return d?(await d.setViewport({x:l.x??u,y:l.y??r,zoom:l.zoom??f},o),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[l,o,u]=n.getState().transform;return{x:l,y:o,zoom:u}},setCenter:async(l,o,u)=>n.getState().setCenter(l,o,u),fitBounds:async(l,o)=>{const{width:u,height:r,minZoom:f,maxZoom:d,panZoom:g}=n.getState(),m=Xf(l,u,r,f,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:u,snapGrid:r,snapToGrid:f,domNode:d}=n.getState();if(!d)return l;const{x:g,y:m}=d.getBoundingClientRect(),h={x:l.x-g,y:l.y-m},v=o.snapGrid??r,y=o.snapToGrid??f;return wo(h,u,y,v)},flowToScreenPosition:l=>{const{transform:o,domNode:u}=n.getState();if(!u)return l;const{x:r,y:f}=u.getBoundingClientRect(),d=Ss(l,o);return{x:d.x+r,y:d.y+f}}}),[])};function Ey(n,l){const o=[],u=new Map,r=[];for(const f of n)if(f.type==="add"){r.push(f);continue}else if(f.type==="remove"||f.type==="replace")u.set(f.id,[f]);else{const d=u.get(f.id);d?d.push(f):u.set(f.id,[f])}for(const f of l){const d=u.get(f.id);if(!d){o.push(f);continue}if(d[0].type==="remove")continue;if(d[0].type==="replace"){o.push({...d[0].item});continue}const g={...f};for(const m of d)ow(m,g);o.push(g)}return r.length&&r.forEach(f=>{f.index!==void 0?o.splice(f.index,0,{...f.item}):o.push({...f.item})}),o}function ow(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 uw(n,l){return Ey(n,l)}function sw(n,l){return Ey(n,l)}function Ka(n,l){return{id:n,type:"select",selected:l}}function kl(n,l=new Set,o=!1){const u=[];for(const[r,f]of n){const d=l.has(r);!(f.selected===void 0&&!d)&&f.selected!==d&&(o&&(f.selected=d),u.push(Ka(f.id,d)))}return u}function Q0({items:n=[],lookup:l}){const o=[],u=new Map(n.map(r=>[r.id,r]));for(const[r,f]of n.entries()){const d=l.get(f.id),g=d?.internals?.userNode??d;g!==void 0&&g!==f&&o.push({id:f.id,item:f,type:"replace"}),g===void 0&&o.push({item:f,type:"add",index:r})}for(const[r]of l)u.get(r)===void 0&&o.push({id:r,type:"remove"});return o}function $0(n){return{id:n.id,type:"remove"}}const k0=n=>C_(n),rw=n=>kp(n);function wy(n){return J.forwardRef(n)}function K0(n){const[l,o]=J.useState(BigInt(0)),[u]=J.useState(()=>cw(()=>o(r=>r+BigInt(1))));return Of(()=>{const r=u.get();r.length&&(n(r),u.reset())},[l]),u}function cw(n){let l=[];return{get:()=>l,reset:()=>{l=[]},push:o=>{l.push(o),n()}}}const Ny=J.createContext(null);function fw({children:n}){const l=kt(),o=J.useCallback(g=>{const{nodes:m=[],setNodes:h,hasDefaultNodes:v,onNodesChange:y,nodeLookup:x,fitViewQueued:S,onNodesChangeMiddlewareMap:_}=l.getState();let T=m;for(const N of g)T=typeof N=="function"?N(T):N;let C=Q0({items:T,lookup:x});for(const N of _.values())C=N(C);v&&h(T),C.length>0?y?.(C):S&&window.requestAnimationFrame(()=>{const{fitViewQueued:N,nodes:j,setNodes:E}=l.getState();N&&E(j)})},[]),u=K0(o),r=J.useCallback(g=>{const{edges:m=[],setEdges:h,hasDefaultEdges:v,onEdgesChange:y,edgeLookup:x}=l.getState();let S=m;for(const _ of g)S=typeof _=="function"?_(S):_;v?h(S):y&&y(Q0({items:S,lookup:x}))},[]),f=K0(r),d=J.useMemo(()=>({nodeQueue:u,edgeQueue:f}),[]);return w.jsx(Ny.Provider,{value:d,children:n})}function dw(){const n=J.useContext(Ny);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}const hw=n=>!!n.panZoom;function Jf(){const n=iw(),l=kt(),o=dw(),u=Dt(hw),r=J.useMemo(()=>{const f=y=>l.getState().nodeLookup.get(y),d=y=>{o.nodeQueue.push(y)},g=y=>{o.edgeQueue.push(y)},m=y=>{const{nodeLookup:x,nodeOrigin:S}=l.getState(),_=k0(y)?y:x.get(y.id),T=_.parentId?Pp(_.position,_.measured,_.parentId,x,S):_.position,C={..._,position:T,width:_.measured?.width??_.width,height:_.measured?.height??_.height};return ti(C)},h=(y,x,S={replace:!1})=>{d(_=>_.map(T=>{if(T.id===y){const C=typeof x=="function"?x(T):x;return S.replace&&k0(C)?C:{...T,...C}}return T}))},v=(y,x,S={replace:!1})=>{g(_=>_.map(T=>{if(T.id===y){const C=typeof x=="function"?x(T):x;return S.replace&&rw(C)?C:{...T,...C}}return T}))};return{getNodes:()=>l.getState().nodes.map(y=>({...y})),getNode:y=>f(y)?.internals.userNode,getInternalNode:f,getEdges:()=>{const{edges:y=[]}=l.getState();return y.map(x=>({...x}))},getEdge:y=>l.getState().edgeLookup.get(y),setNodes:d,setEdges:g,addNodes:y=>{const x=Array.isArray(y)?y:[y];o.nodeQueue.push(S=>[...S,...x])},addEdges:y=>{const x=Array.isArray(y)?y:[y];o.edgeQueue.push(S=>[...S,...x])},toObject:()=>{const{nodes:y=[],edges:x=[],transform:S}=l.getState(),[_,T,C]=S;return{nodes:y.map(N=>({...N})),edges:x.map(N=>({...N})),viewport:{x:_,y:T,zoom:C}}},deleteElements:async({nodes:y=[],edges:x=[]})=>{const{nodes:S,edges:_,onNodesDelete:T,onEdgesDelete:C,triggerNodeChanges:N,triggerEdgeChanges:j,onDelete:E,onBeforeDelete:z}=l.getState(),{nodes:Y,edges:q}=await j_({nodesToRemove:y,edgesToRemove:x,nodes:S,edges:_,onBeforeDelete:z}),L=q.length>0,k=Y.length>0;if(L){const I=q.map($0);C?.(q),j(I)}if(k){const I=Y.map($0);T?.(Y),N(I)}return(k||L)&&E?.({nodes:Y,edges:q}),{deletedNodes:Y,deletedEdges:q}},getIntersectingNodes:(y,x=!0,S)=>{const _=x0(y),T=_?y:m(y),C=S!==void 0;return T?(S||l.getState().nodes).filter(N=>{const j=l.getState().nodeLookup.get(N.id);if(j&&!_&&(N.id===y.id||!j.internals.positionAbsolute))return!1;const E=ti(C?N:j),z=mo(E,T);return x&&z>0||z>=E.width*E.height||z>=T.width*T.height}):[]},isNodeIntersecting:(y,x,S=!0)=>{const T=x0(y)?y:m(y);if(!T)return!1;const C=mo(T,x);return S&&C>0||C>=x.width*x.height||C>=T.width*T.height},updateNode:h,updateNodeData:(y,x,S={replace:!1})=>{h(y,_=>{const T=typeof x=="function"?x(_):x;return S.replace?{..._,data:T}:{..._,data:{..._.data,...T}}},S)},updateEdge:v,updateEdgeData:(y,x,S={replace:!1})=>{v(y,_=>{const T=typeof x=="function"?x(_):x;return S.replace?{..._,data:T}:{..._,data:{..._.data,...T}}},S)},getNodesBounds:y=>{const{nodeLookup:x,nodeOrigin:S}=l.getState();return D_(y,{nodeLookup:x,nodeOrigin:S})},getHandleConnections:({type:y,id:x,nodeId:S})=>Array.from(l.getState().connectionLookup.get(`${S}-${y}${x?`-${x}`:""}`)?.values()??[]),getNodeConnections:({type:y,handleId:x,nodeId:S})=>Array.from(l.getState().connectionLookup.get(`${S}${y?x?`-${y}-${x}`:`-${y}`:""}`)?.values()??[]),fitView:async y=>{const x=l.getState().fitViewResolver??L_();return l.setState({fitViewQueued:!0,fitViewOptions:y,fitViewResolver:x}),o.nodeQueue.push(S=>[...S]),x.promise}}},[]);return J.useMemo(()=>({...r,...n,viewportInitialized:u}),[u])}const I0=n=>n.selected,gw=typeof window<"u"?window:void 0;function mw({deleteKeyCode:n,multiSelectionKeyCode:l}){const o=kt(),{deleteElements:u}=Jf(),r=yo(n,{actInsideInputWithModifier:!1}),f=yo(l,{target:gw});J.useEffect(()=>{if(r){const{edges:d,nodes:g}=o.getState();u({nodes:g.filter(I0),edges:d.filter(I0)}),o.setState({nodesSelectionActive:!1})}},[r]),J.useEffect(()=>{o.setState({multiSelectionActive:f})},[f])}function pw(n){const l=kt();J.useEffect(()=>{const o=()=>{if(!n.current||!(n.current.checkVisibility?.()??!0))return!1;const u=Zf(n.current);(u.height===0||u.width===0)&&l.getState().onError?.("004",hn.error004()),l.setState({width:u.width||500,height:u.height||500})};if(n.current){o(),window.addEventListener("resize",o);const u=new ResizeObserver(()=>o());return u.observe(n.current),()=>{window.removeEventListener("resize",o),u&&n.current&&u.unobserve(n.current)}}},[])}const Os={position:"absolute",width:"100%",height:"100%",top:0,left:0},yw=n=>({userSelectionActive:n.userSelectionActive,lib:n.lib,connectionInProgress:n.connection.inProgress});function vw({onPaneContextMenu:n,zoomOnScroll:l=!0,zoomOnPinch:o=!0,panOnScroll:u=!1,panOnScrollSpeed:r=.5,panOnScrollMode:f=Fa.Free,zoomOnDoubleClick:d=!0,panOnDrag:g=!0,defaultViewport:m,translateExtent:h,minZoom:v,maxZoom:y,zoomActivationKeyCode:x,preventScrolling:S=!0,children:_,noWheelClassName:T,noPanClassName:C,onViewportChange:N,isControlledViewport:j,paneClickDistance:E,selectionOnDrag:z}){const Y=kt(),q=J.useRef(null),{userSelectionActive:L,lib:k,connectionInProgress:I}=Dt(yw,$t),ot=yo(x),$=J.useRef();pw(q);const P=J.useCallback(it=>{N?.({x:it[0],y:it[1],zoom:it[2]}),j||Y.setState({transform:it})},[N,j]);return J.useEffect(()=>{if(q.current){$.current=_E({domNode:q.current,minZoom:v,maxZoom:y,translateExtent:h,viewport:m,onDraggingChange:M=>Y.setState(R=>R.paneDragging===M?R:{paneDragging:M}),onPanZoomStart:(M,R)=>{const{onViewportChangeStart:B,onMoveStart:X}=Y.getState();X?.(M,R),B?.(R)},onPanZoom:(M,R)=>{const{onViewportChange:B,onMove:X}=Y.getState();X?.(M,R),B?.(R)},onPanZoomEnd:(M,R)=>{const{onViewportChangeEnd:B,onMoveEnd:X}=Y.getState();X?.(M,R),B?.(R)}});const{x:it,y:D,zoom:G}=$.current.getViewport();return Y.setState({panZoom:$.current,transform:[it,D,G],domNode:q.current.closest(".react-flow")}),()=>{$.current?.destroy()}}},[]),J.useEffect(()=>{$.current?.update({onPaneContextMenu:n,zoomOnScroll:l,zoomOnPinch:o,panOnScroll:u,panOnScrollSpeed:r,panOnScrollMode:f,zoomOnDoubleClick:d,panOnDrag:g,zoomActivationKeyPressed:ot,preventScrolling:S,noPanClassName:C,userSelectionActive:L,noWheelClassName:T,lib:k,onTransformChange:P,connectionInProgress:I,selectionOnDrag:z,paneClickDistance:E})},[n,l,o,u,r,f,d,g,ot,S,C,L,T,k,P,I,z,E]),w.jsx("div",{className:"react-flow__renderer",ref:q,style:Os,children:_})}const xw=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function Sw(){const{userSelectionActive:n,userSelectionRect:l}=Dt(xw,$t);return n&&l?w.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:l.width,height:l.height,transform:`translate(${l.x}px, ${l.y}px)`}}):null}const yf=(n,l)=>o=>{o.target===l.current&&n?.(o)},bw=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,connectionInProgress:n.connection.inProgress,dragging:n.paneDragging});function _w({isSelecting:n,selectionKeyPressed:l,selectionMode:o=go.Full,panOnDrag:u,paneClickDistance:r,selectionOnDrag:f,onSelectionStart:d,onSelectionEnd:g,onPaneClick:m,onPaneContextMenu:h,onPaneScroll:v,onPaneMouseEnter:y,onPaneMouseMove:x,onPaneMouseLeave:S,children:_}){const T=kt(),{userSelectionActive:C,elementsSelectable:N,dragging:j,connectionInProgress:E}=Dt(bw,$t),z=N&&(n||C),Y=J.useRef(null),q=J.useRef(),L=J.useRef(new Set),k=J.useRef(new Set),I=J.useRef(!1),ot=B=>{if(I.current||E){I.current=!1;return}m?.(B),T.getState().resetSelectedElements(),T.setState({nodesSelectionActive:!1})},$=B=>{if(Array.isArray(u)&&u?.includes(2)){B.preventDefault();return}h?.(B)},P=v?B=>v(B):void 0,it=B=>{I.current&&(B.stopPropagation(),I.current=!1)},D=B=>{const{domNode:X}=T.getState();if(q.current=X?.getBoundingClientRect(),!q.current)return;const tt=B.target===Y.current;if(!tt&&!!B.target.closest(".nokey")||!n||!(f&&tt||l)||B.button!==0||!B.isPrimary)return;B.target?.setPointerCapture?.(B.pointerId),I.current=!1;const{x:W,y:et}=tn(B.nativeEvent,q.current);T.setState({userSelectionRect:{width:0,height:0,startX:W,startY:et,x:W,y:et}}),tt||(B.stopPropagation(),B.preventDefault())},G=B=>{const{userSelectionRect:X,transform:tt,nodeLookup:A,edgeLookup:H,connectionLookup:W,triggerNodeChanges:et,triggerEdgeChanges:st,defaultEdgeOptions:ct,resetSelectedElements:rt}=T.getState();if(!q.current||!X)return;const{x:ut,y:ft}=tn(B.nativeEvent,q.current),{startX:Et,startY:bt}=X;if(!I.current){const jt=l?0:r;if(Math.hypot(ut-Et,ft-bt)<=jt)return;rt(),d?.(B)}I.current=!0;const yt={startX:Et,startY:bt,x:ut<Et?ut:Et,y:ft<bt?ft:bt,width:Math.abs(ut-Et),height:Math.abs(ft-bt)},xt=L.current,At=k.current;L.current=new Set(Gf(A,yt,tt,o===go.Partial,!0).map(jt=>jt.id)),k.current=new Set;const qt=ct?.selectable??!0;for(const jt of L.current){const oe=W.get(jt);if(oe)for(const{edgeId:Qe}of oe.values()){const Ae=H.get(Qe);Ae&&(Ae.selectable??qt)&&k.current.add(Qe)}}if(!S0(xt,L.current)){const jt=kl(A,L.current,!0);et(jt)}if(!S0(At,k.current)){const jt=kl(H,k.current);st(jt)}T.setState({userSelectionRect:yt,userSelectionActive:!0,nodesSelectionActive:!1})},M=B=>{B.button===0&&(B.target?.releasePointerCapture?.(B.pointerId),!C&&B.target===Y.current&&T.getState().userSelectionRect&&ot?.(B),T.setState({userSelectionActive:!1,userSelectionRect:null}),I.current&&(g?.(B),T.setState({nodesSelectionActive:L.current.size>0})))},R=u===!0||Array.isArray(u)&&u.includes(0);return w.jsxs("div",{className:ae(["react-flow__pane",{draggable:R,dragging:j,selection:n}]),onClick:z?void 0:yf(ot,Y),onContextMenu:yf($,Y),onWheel:yf(P,Y),onPointerEnter:z?void 0:y,onPointerMove:z?G:x,onPointerUp:z?M:void 0,onPointerDownCapture:z?D:void 0,onClickCapture:z?it:void 0,onPointerLeave:S,ref:Y,style:Os,children:[_,w.jsx(Sw,{})]})}function Rf({id:n,store:l,unselect:o=!1,nodeRef:u}){const{addSelectedNodes:r,unselectNodesAndEdges:f,multiSelectionActive:d,nodeLookup:g,onError:m}=l.getState(),h=g.get(n);if(!h){m?.("012",hn.error012(n));return}l.setState({nodesSelectionActive:!1}),h.selected?(o||h.selected&&d)&&(f({nodes:[h],edges:[]}),requestAnimationFrame(()=>u?.current?.blur())):r([n])}function My({nodeRef:n,disabled:l=!1,noDragClassName:o,handleSelector:u,nodeId:r,isSelectable:f,nodeClickDistance:d}){const g=kt(),[m,h]=J.useState(!1),v=J.useRef();return J.useEffect(()=>{v.current=sE({getStoreItems:()=>g.getState(),onNodeMouseDown:y=>{Rf({id:y,store:g,nodeRef:n})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),J.useEffect(()=>{if(!(l||!n.current||!v.current))return v.current.update({noDragClassName:o,handleSelector:u,domNode:n.current,isSelectable:f,nodeId:r,nodeClickDistance:d}),()=>{v.current?.destroy()}},[o,u,l,f,n,r,d]),m}const Ew=n=>l=>l.selected&&(l.draggable||n&&typeof l.draggable>"u");function Ay(){const n=kt();return J.useCallback(o=>{const{nodeExtent:u,snapToGrid:r,snapGrid:f,nodesDraggable:d,onError:g,updateNodePositions:m,nodeLookup:h,nodeOrigin:v}=n.getState(),y=new Map,x=Ew(d),S=r?f[0]:5,_=r?f[1]:5,T=o.direction.x*S*o.factor,C=o.direction.y*_*o.factor;for(const[,N]of h){if(!x(N))continue;let j={x:N.internals.positionAbsolute.x+T,y:N.internals.positionAbsolute.y+C};r&&(j=Eo(j,f));const{position:E,positionAbsolute:z}=Kp({nodeId:N.id,nextPosition:j,nodeLookup:h,nodeExtent:u,nodeOrigin:v,onError:g});N.position=E,N.internals.positionAbsolute=z,y.set(N.id,N)}m(y)},[])}const Ff=J.createContext(null),ww=Ff.Provider;Ff.Consumer;const Ty=()=>J.useContext(Ff),Nw=n=>({connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}),Mw=(n,l,o)=>u=>{const{connectionClickStartHandle:r,connectionMode:f,connection:d}=u,{fromHandle:g,toHandle:m,isValid:h}=d,v=m?.nodeId===n&&m?.id===l&&m?.type===o;return{connectingFrom:g?.nodeId===n&&g?.id===l&&g?.type===o,connectingTo:v,clickConnecting:r?.nodeId===n&&r?.id===l&&r?.type===o,isPossibleEndHandle:f===Wl.Strict?g?.type!==o:n!==g?.nodeId||l!==g?.id,connectionInProcess:!!g,clickConnectionInProcess:!!r,valid:v&&h}};function Aw({type:n="source",position:l=mt.Top,isValidConnection:o,isConnectable:u=!0,isConnectableStart:r=!0,isConnectableEnd:f=!0,id:d,onConnect:g,children:m,className:h,onMouseDown:v,onTouchStart:y,...x},S){const _=d||null,T=n==="target",C=kt(),N=Ty(),{connectOnClick:j,noPanClassName:E,rfId:z}=Dt(Nw,$t),{connectingFrom:Y,connectingTo:q,clickConnecting:L,isPossibleEndHandle:k,connectionInProcess:I,clickConnectionInProcess:ot,valid:$}=Dt(Mw(N,_,n),$t);N||C.getState().onError?.("010",hn.error010());const P=G=>{const{defaultEdgeOptions:M,onConnect:R,hasDefaultEdges:B}=C.getState(),X={...M,...G};if(B){const{edges:tt,setEdges:A}=C.getState();A($_(X,tt))}R?.(X),g?.(X)},it=G=>{if(!N)return;const M=ny(G.nativeEvent);if(r&&(M&&G.button===0||!M)){const R=C.getState();Df.onPointerDown(G.nativeEvent,{handleDomNode:G.currentTarget,autoPanOnConnect:R.autoPanOnConnect,connectionMode:R.connectionMode,connectionRadius:R.connectionRadius,domNode:R.domNode,nodeLookup:R.nodeLookup,lib:R.lib,isTarget:T,handleId:_,nodeId:N,flowId:R.rfId,panBy:R.panBy,cancelConnection:R.cancelConnection,onConnectStart:R.onConnectStart,onConnectEnd:(...B)=>C.getState().onConnectEnd?.(...B),updateConnection:R.updateConnection,onConnect:P,isValidConnection:o||((...B)=>C.getState().isValidConnection?.(...B)??!0),getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,autoPanSpeed:R.autoPanSpeed,dragThreshold:R.connectionDragThreshold})}M?v?.(G):y?.(G)},D=G=>{const{onClickConnectStart:M,onClickConnectEnd:R,connectionClickStartHandle:B,connectionMode:X,isValidConnection:tt,lib:A,rfId:H,nodeLookup:W,connection:et}=C.getState();if(!N||!B&&!r)return;if(!B){M?.(G.nativeEvent,{nodeId:N,handleId:_,handleType:n}),C.setState({connectionClickStartHandle:{nodeId:N,type:n,id:_}});return}const st=ty(G.target),ct=o||tt,{connection:rt,isValid:ut}=Df.isValid(G.nativeEvent,{handle:{nodeId:N,id:_,type:n},connectionMode:X,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:ct,flowId:H,doc:st,lib:A,nodeLookup:W});ut&&rt&&P(rt);const ft=structuredClone(et);delete ft.inProgress,ft.toPosition=ft.toHandle?ft.toHandle.position:null,R?.(G,ft),C.setState({connectionClickStartHandle:null})};return w.jsx("div",{"data-handleid":_,"data-nodeid":N,"data-handlepos":l,"data-id":`${z}-${N}-${_}-${n}`,className:ae(["react-flow__handle",`react-flow__handle-${l}`,"nodrag",E,h,{source:!T,target:T,connectable:u,connectablestart:r,connectableend:f,clickconnecting:L,connectingfrom:Y,connectingto:q,valid:$,connectionindicator:u&&(!I||k)&&(I||ot?f:r)}]),onMouseDown:it,onTouchStart:it,onClick:j?D:void 0,ref:S,...x,children:m})}const ai=J.memo(wy(Aw));function Tw({data:n,isConnectable:l,sourcePosition:o=mt.Bottom}){return w.jsxs(w.Fragment,{children:[n?.label,w.jsx(ai,{type:"source",position:o,isConnectable:l})]})}function zw({data:n,isConnectable:l,targetPosition:o=mt.Top,sourcePosition:u=mt.Bottom}){return w.jsxs(w.Fragment,{children:[w.jsx(ai,{type:"target",position:o,isConnectable:l}),n?.label,w.jsx(ai,{type:"source",position:u,isConnectable:l})]})}function Cw(){return null}function Dw({data:n,isConnectable:l,targetPosition:o=mt.Top}){return w.jsxs(w.Fragment,{children:[w.jsx(ai,{type:"target",position:o,isConnectable:l}),n?.label]})}const bs={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},J0={input:Tw,default:zw,output:Dw,group:Cw};function Ow(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 Rw=n=>{const{width:l,height:o,x:u,y:r}=_o(n.nodeLookup,{filter:f=>!!f.selected});return{width:Pe(l)?l:null,height:Pe(o)?o:null,userSelectionActive:n.userSelectionActive,transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]}) translate(${u}px,${r}px)`}};function Hw({onSelectionContextMenu:n,noPanClassName:l,disableKeyboardA11y:o}){const u=kt(),{width:r,height:f,transformString:d,userSelectionActive:g}=Dt(Rw,$t),m=Ay(),h=J.useRef(null);J.useEffect(()=>{o||h.current?.focus({preventScroll:!0})},[o]);const v=!g&&r!==null&&f!==null;if(My({nodeRef:h,disabled:!v}),!v)return null;const y=n?S=>{const _=u.getState().nodes.filter(T=>T.selected);n(S,_)}:void 0,x=S=>{Object.prototype.hasOwnProperty.call(bs,S.key)&&(S.preventDefault(),m({direction:bs[S.key],factor:S.shiftKey?4:1}))};return w.jsx("div",{className:ae(["react-flow__nodesselection","react-flow__container",l]),style:{transform:d},children:w.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:y,tabIndex:o?void 0:-1,onKeyDown:o?void 0:x,style:{width:r,height:f}})})}const F0=typeof window<"u"?window:void 0,jw=n=>({nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive});function zy({children:n,onPaneClick:l,onPaneMouseEnter:o,onPaneMouseMove:u,onPaneMouseLeave:r,onPaneContextMenu:f,onPaneScroll:d,paneClickDistance:g,deleteKeyCode:m,selectionKeyCode:h,selectionOnDrag:v,selectionMode:y,onSelectionStart:x,onSelectionEnd:S,multiSelectionKeyCode:_,panActivationKeyCode:T,zoomActivationKeyCode:C,elementsSelectable:N,zoomOnScroll:j,zoomOnPinch:E,panOnScroll:z,panOnScrollSpeed:Y,panOnScrollMode:q,zoomOnDoubleClick:L,panOnDrag:k,defaultViewport:I,translateExtent:ot,minZoom:$,maxZoom:P,preventScrolling:it,onSelectionContextMenu:D,noWheelClassName:G,noPanClassName:M,disableKeyboardA11y:R,onViewportChange:B,isControlledViewport:X}){const{nodesSelectionActive:tt,userSelectionActive:A}=Dt(jw,$t),H=yo(h,{target:F0}),W=yo(T,{target:F0}),et=W||k,st=W||z,ct=v&&et!==!0,rt=H||A||ct;return mw({deleteKeyCode:m,multiSelectionKeyCode:_}),w.jsx(vw,{onPaneContextMenu:f,elementsSelectable:N,zoomOnScroll:j,zoomOnPinch:E,panOnScroll:st,panOnScrollSpeed:Y,panOnScrollMode:q,zoomOnDoubleClick:L,panOnDrag:!H&&et,defaultViewport:I,translateExtent:ot,minZoom:$,maxZoom:P,zoomActivationKeyCode:C,preventScrolling:it,noWheelClassName:G,noPanClassName:M,onViewportChange:B,isControlledViewport:X,paneClickDistance:g,selectionOnDrag:ct,children:w.jsxs(_w,{onSelectionStart:x,onSelectionEnd:S,onPaneClick:l,onPaneMouseEnter:o,onPaneMouseMove:u,onPaneMouseLeave:r,onPaneContextMenu:f,onPaneScroll:d,panOnDrag:et,isSelecting:!!rt,selectionMode:y,selectionKeyPressed:H,paneClickDistance:g,selectionOnDrag:ct,children:[n,tt&&w.jsx(Hw,{onSelectionContextMenu:D,noPanClassName:M,disableKeyboardA11y:R})]})})}zy.displayName="FlowRenderer";const Uw=J.memo(zy),Bw=n=>l=>n?Gf(l.nodeLookup,{x:0,y:0,width:l.width,height:l.height},l.transform,!0).map(o=>o.id):Array.from(l.nodeLookup.keys());function qw(n){return Dt(J.useCallback(Bw(n),[n]),$t)}const Lw=n=>n.updateNodeInternals;function Yw(){const n=Dt(Lw),[l]=J.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(o=>{const u=new Map;o.forEach(r=>{const f=r.target.getAttribute("data-id");u.set(f,{id:f,nodeElement:r.target,force:!0})}),n(u)}));return J.useEffect(()=>()=>{l?.disconnect()},[l]),l}function Vw({node:n,nodeType:l,hasDimensions:o,resizeObserver:u}){const r=kt(),f=J.useRef(null),d=J.useRef(null),g=J.useRef(n.sourcePosition),m=J.useRef(n.targetPosition),h=J.useRef(l),v=o&&!!n.internals.handleBounds;return J.useEffect(()=>{f.current&&!n.hidden&&(!v||d.current!==f.current)&&(d.current&&u?.unobserve(d.current),u?.observe(f.current),d.current=f.current)},[v,n.hidden]),J.useEffect(()=>()=>{d.current&&(u?.unobserve(d.current),d.current=null)},[]),J.useEffect(()=>{if(f.current){const y=h.current!==l,x=g.current!==n.sourcePosition,S=m.current!==n.targetPosition;(y||x||S)&&(h.current=l,g.current=n.sourcePosition,m.current=n.targetPosition,r.getState().updateNodeInternals(new Map([[n.id,{id:n.id,nodeElement:f.current,force:!0}]])))}},[n.id,l,n.sourcePosition,n.targetPosition]),f}function Gw({id:n,onClick:l,onMouseEnter:o,onMouseMove:u,onMouseLeave:r,onContextMenu:f,onDoubleClick:d,nodesDraggable:g,elementsSelectable:m,nodesConnectable:h,nodesFocusable:v,resizeObserver:y,noDragClassName:x,noPanClassName:S,disableKeyboardA11y:_,rfId:T,nodeTypes:C,nodeClickDistance:N,onError:j}){const{node:E,internals:z,isParent:Y}=Dt(ut=>{const ft=ut.nodeLookup.get(n),Et=ut.parentLookup.has(n);return{node:ft,internals:ft.internals,isParent:Et}},$t);let q=E.type||"default",L=C?.[q]||J0[q];L===void 0&&(j?.("003",hn.error003(q)),q="default",L=C?.default||J0.default);const k=!!(E.draggable||g&&typeof E.draggable>"u"),I=!!(E.selectable||m&&typeof E.selectable>"u"),ot=!!(E.connectable||h&&typeof E.connectable>"u"),$=!!(E.focusable||v&&typeof E.focusable>"u"),P=kt(),it=Wp(E),D=Vw({node:E,nodeType:q,hasDimensions:it,resizeObserver:y}),G=My({nodeRef:D,disabled:E.hidden||!k,noDragClassName:x,handleSelector:E.dragHandle,nodeId:n,isSelectable:I,nodeClickDistance:N}),M=Ay();if(E.hidden)return null;const R=Gn(E),B=Ow(E),X=I||k||l||o||u||r,tt=o?ut=>o(ut,{...z.userNode}):void 0,A=u?ut=>u(ut,{...z.userNode}):void 0,H=r?ut=>r(ut,{...z.userNode}):void 0,W=f?ut=>f(ut,{...z.userNode}):void 0,et=d?ut=>d(ut,{...z.userNode}):void 0,st=ut=>{const{selectNodesOnDrag:ft,nodeDragThreshold:Et}=P.getState();I&&(!ft||!k||Et>0)&&Rf({id:n,store:P,nodeRef:D}),l&&l(ut,{...z.userNode})},ct=ut=>{if(!(ey(ut.nativeEvent)||_)){if(Xp.includes(ut.key)&&I){const ft=ut.key==="Escape";Rf({id:n,store:P,unselect:ft,nodeRef:D})}else if(k&&E.selected&&Object.prototype.hasOwnProperty.call(bs,ut.key)){ut.preventDefault();const{ariaLabelConfig:ft}=P.getState();P.setState({ariaLiveMessage:ft["node.a11yDescription.ariaLiveMessage"]({direction:ut.key.replace("Arrow","").toLowerCase(),x:~~z.positionAbsolute.x,y:~~z.positionAbsolute.y})}),M({direction:bs[ut.key],factor:ut.shiftKey?4:1})}}},rt=()=>{if(_||!D.current?.matches(":focus-visible"))return;const{transform:ut,width:ft,height:Et,autoPanOnNodeFocus:bt,setCenter:yt}=P.getState();if(!bt)return;Gf(new Map([[n,E]]),{x:0,y:0,width:ft,height:Et},ut,!0).length>0||yt(E.position.x+R.width/2,E.position.y+R.height/2,{zoom:ut[2]})};return w.jsx("div",{className:ae(["react-flow__node",`react-flow__node-${q}`,{[S]:k},E.className,{selected:E.selected,selectable:I,parent:Y,draggable:k,dragging:G}]),ref:D,style:{zIndex:z.z,transform:`translate(${z.positionAbsolute.x}px,${z.positionAbsolute.y}px)`,pointerEvents:X?"all":"none",visibility:it?"visible":"hidden",...E.style,...B},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:tt,onMouseMove:A,onMouseLeave:H,onContextMenu:W,onClick:st,onDoubleClick:et,onKeyDown:$?ct:void 0,tabIndex:$?0:void 0,onFocus:$?rt:void 0,role:E.ariaRole??($?"group":void 0),"aria-roledescription":"node","aria-describedby":_?void 0:`${Sy}-${T}`,"aria-label":E.ariaLabel,...E.domAttributes,children:w.jsx(ww,{value:n,children:w.jsx(L,{id:n,data:E.data,type:q,positionAbsoluteX:z.positionAbsolute.x,positionAbsoluteY:z.positionAbsolute.y,selected:E.selected??!1,selectable:I,draggable:k,deletable:E.deletable??!0,isConnectable:ot,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:G,dragHandle:E.dragHandle,zIndex:z.z,parentId:E.parentId,...R})})})}var Xw=J.memo(Gw);const Zw=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError});function Cy(n){const{nodesDraggable:l,nodesConnectable:o,nodesFocusable:u,elementsSelectable:r,onError:f}=Dt(Zw,$t),d=qw(n.onlyRenderVisibleElements),g=Yw();return w.jsx("div",{className:"react-flow__nodes",style:Os,children:d.map(m=>w.jsx(Xw,{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:u,elementsSelectable:r,nodeClickDistance:n.nodeClickDistance,onError:f},m))})}Cy.displayName="NodeRenderer";const Qw=J.memo(Cy);function $w(n){return Dt(J.useCallback(o=>{if(!n)return o.edges.map(r=>r.id);const u=[];if(o.width&&o.height)for(const r of o.edges){const f=o.nodeLookup.get(r.source),d=o.nodeLookup.get(r.target);f&&d&&X_({sourceNode:f,targetNode:d,width:o.width,height:o.height,transform:o.transform})&&u.push(r.id)}return u},[n]),$t)}const kw=({color:n="none",strokeWidth:l=1})=>{const o={strokeWidth:l,...n&&{stroke:n}};return w.jsx("polyline",{className:"arrow",style:o,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},Kw=({color:n="none",strokeWidth:l=1})=>{const o={strokeWidth:l,...n&&{stroke:n,fill:n}};return w.jsx("polyline",{className:"arrowclosed",style:o,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},W0={[vs.Arrow]:kw,[vs.ArrowClosed]:Kw};function Iw(n){const l=kt();return J.useMemo(()=>Object.prototype.hasOwnProperty.call(W0,n)?W0[n]:(l.getState().onError?.("009",hn.error009(n)),null),[n])}const Jw=({id:n,type:l,color:o,width:u=12.5,height:r=12.5,markerUnits:f="strokeWidth",strokeWidth:d,orient:g="auto-start-reverse"})=>{const m=Iw(l);return m?w.jsx("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${u}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:f,orient:g,refX:"0",refY:"0",children:w.jsx(m,{color:o,strokeWidth:d})}):null},Dy=({defaultColor:n,rfId:l})=>{const o=Dt(f=>f.edges),u=Dt(f=>f.defaultEdgeOptions),r=J.useMemo(()=>F_(o,{id:l,defaultColor:n,defaultMarkerStart:u?.markerStart,defaultMarkerEnd:u?.markerEnd}),[o,u,l,n]);return r.length?w.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:w.jsx("defs",{children:r.map(f=>w.jsx(Jw,{id:f.id,type:f.type,color:f.color,width:f.width,height:f.height,markerUnits:f.markerUnits,strokeWidth:f.strokeWidth,orient:f.orient},f.id))})}):null};Dy.displayName="MarkerDefinitions";var Fw=J.memo(Dy);function Oy({x:n,y:l,label:o,labelStyle:u,labelShowBg:r=!0,labelBgStyle:f,labelBgPadding:d=[2,4],labelBgBorderRadius:g=2,children:m,className:h,...v}){const[y,x]=J.useState({x:1,y:0,width:0,height:0}),S=ae(["react-flow__edge-textwrapper",h]),_=J.useRef(null);return J.useEffect(()=>{if(_.current){const T=_.current.getBBox();x({x:T.x,y:T.y,width:T.width,height:T.height})}},[o]),o?w.jsxs("g",{transform:`translate(${n-y.width/2} ${l-y.height/2})`,className:S,visibility:y.width?"visible":"hidden",...v,children:[r&&w.jsx("rect",{width:y.width+2*d[0],x:-d[0],y:-d[1],height:y.height+2*d[1],className:"react-flow__edge-textbg",style:f,rx:g,ry:g}),w.jsx("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:_,style:u,children:o}),m]}):null}Oy.displayName="EdgeText";const Ww=J.memo(Oy);function Rs({path:n,labelX:l,labelY:o,label:u,labelStyle:r,labelShowBg:f,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,interactionWidth:h=20,...v}){return w.jsxs(w.Fragment,{children:[w.jsx("path",{...v,d:n,fill:"none",className:ae(["react-flow__edge-path",v.className])}),h?w.jsx("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,u&&Pe(l)&&Pe(o)?w.jsx(Ww,{x:l,y:o,label:u,labelStyle:r,labelShowBg:f,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m}):null]})}function P0({pos:n,x1:l,y1:o,x2:u,y2:r}){return n===mt.Left||n===mt.Right?[.5*(l+u),o]:[l,.5*(o+r)]}function Ry({sourceX:n,sourceY:l,sourcePosition:o=mt.Bottom,targetX:u,targetY:r,targetPosition:f=mt.Top}){const[d,g]=P0({pos:o,x1:n,y1:l,x2:u,y2:r}),[m,h]=P0({pos:f,x1:u,y1:r,x2:n,y2:l}),[v,y,x,S]=ay({sourceX:n,sourceY:l,targetX:u,targetY:r,sourceControlX:d,sourceControlY:g,targetControlX:m,targetControlY:h});return[`M${n},${l} C${d},${g} ${m},${h} ${u},${r}`,v,y,x,S]}function Hy(n){return J.memo(({id:l,sourceX:o,sourceY:u,targetX:r,targetY:f,sourcePosition:d,targetPosition:g,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:S,style:_,markerEnd:T,markerStart:C,interactionWidth:N})=>{const[j,E,z]=Ry({sourceX:o,sourceY:u,sourcePosition:d,targetX:r,targetY:f,targetPosition:g}),Y=n.isInternal?void 0:l;return w.jsx(Rs,{id:Y,path:j,labelX:E,labelY:z,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:S,style:_,markerEnd:T,markerStart:C,interactionWidth:N})})}const Pw=Hy({isInternal:!1}),jy=Hy({isInternal:!0});Pw.displayName="SimpleBezierEdge";jy.displayName="SimpleBezierEdgeInternal";function Uy(n){return J.memo(({id:l,sourceX:o,sourceY:u,targetX:r,targetY:f,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:x,sourcePosition:S=mt.Bottom,targetPosition:_=mt.Top,markerEnd:T,markerStart:C,pathOptions:N,interactionWidth:j})=>{const[E,z,Y]=Tf({sourceX:o,sourceY:u,sourcePosition:S,targetX:r,targetY:f,targetPosition:_,borderRadius:N?.borderRadius,offset:N?.offset,stepPosition:N?.stepPosition}),q=n.isInternal?void 0:l;return w.jsx(Rs,{id:q,path:E,labelX:z,labelY:Y,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:T,markerStart:C,interactionWidth:j})})}const By=Uy({isInternal:!1}),qy=Uy({isInternal:!0});By.displayName="SmoothStepEdge";qy.displayName="SmoothStepEdgeInternal";function Ly(n){return J.memo(({id:l,...o})=>{const u=n.isInternal?void 0:l;return w.jsx(By,{...o,id:u,pathOptions:J.useMemo(()=>({borderRadius:0,offset:o.pathOptions?.offset}),[o.pathOptions?.offset])})})}const tN=Ly({isInternal:!1}),Yy=Ly({isInternal:!0});tN.displayName="StepEdge";Yy.displayName="StepEdgeInternal";function Vy(n){return J.memo(({id:l,sourceX:o,sourceY:u,targetX:r,targetY:f,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:S,markerStart:_,interactionWidth:T})=>{const[C,N,j]=oy({sourceX:o,sourceY:u,targetX:r,targetY:f}),E=n.isInternal?void 0:l;return w.jsx(Rs,{id:E,path:C,labelX:N,labelY:j,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:x,markerEnd:S,markerStart:_,interactionWidth:T})})}const eN=Vy({isInternal:!1}),Gy=Vy({isInternal:!0});eN.displayName="StraightEdge";Gy.displayName="StraightEdgeInternal";function Xy(n){return J.memo(({id:l,sourceX:o,sourceY:u,targetX:r,targetY:f,sourcePosition:d=mt.Bottom,targetPosition:g=mt.Top,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:S,style:_,markerEnd:T,markerStart:C,pathOptions:N,interactionWidth:j})=>{const[E,z,Y]=ly({sourceX:o,sourceY:u,sourcePosition:d,targetX:r,targetY:f,targetPosition:g,curvature:N?.curvature}),q=n.isInternal?void 0:l;return w.jsx(Rs,{id:q,path:E,labelX:z,labelY:Y,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:x,labelBgBorderRadius:S,style:_,markerEnd:T,markerStart:C,interactionWidth:j})})}const nN=Xy({isInternal:!1}),Zy=Xy({isInternal:!0});nN.displayName="BezierEdge";Zy.displayName="BezierEdgeInternal";const tp={default:Zy,straight:Gy,step:Yy,smoothstep:qy,simplebezier:jy},ep={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},aN=(n,l,o)=>o===mt.Left?n-l:o===mt.Right?n+l:n,lN=(n,l,o)=>o===mt.Top?n-l:o===mt.Bottom?n+l:n,np="react-flow__edgeupdater";function ap({position:n,centerX:l,centerY:o,radius:u=10,onMouseDown:r,onMouseEnter:f,onMouseOut:d,type:g}){return w.jsx("circle",{onMouseDown:r,onMouseEnter:f,onMouseOut:d,className:ae([np,`${np}-${g}`]),cx:aN(l,u,n),cy:lN(o,u,n),r:u,stroke:"transparent",fill:"transparent"})}function iN({isReconnectable:n,reconnectRadius:l,edge:o,sourceX:u,sourceY:r,targetX:f,targetY:d,sourcePosition:g,targetPosition:m,onReconnect:h,onReconnectStart:v,onReconnectEnd:y,setReconnecting:x,setUpdateHover:S}){const _=kt(),T=(z,Y)=>{if(z.button!==0)return;const{autoPanOnConnect:q,domNode:L,connectionMode:k,connectionRadius:I,lib:ot,onConnectStart:$,cancelConnection:P,nodeLookup:it,rfId:D,panBy:G,updateConnection:M}=_.getState(),R=Y.type==="target",B=(A,H)=>{x(!1),y?.(A,o,Y.type,H)},X=A=>h?.(o,A),tt=(A,H)=>{x(!0),v?.(z,o,Y.type),$?.(A,H)};Df.onPointerDown(z.nativeEvent,{autoPanOnConnect:q,connectionMode:k,connectionRadius:I,domNode:L,handleId:Y.id,nodeId:Y.nodeId,nodeLookup:it,isTarget:R,edgeUpdaterType:Y.type,lib:ot,flowId:D,cancelConnection:P,panBy:G,isValidConnection:(...A)=>_.getState().isValidConnection?.(...A)??!0,onConnect:X,onConnectStart:tt,onConnectEnd:(...A)=>_.getState().onConnectEnd?.(...A),onReconnectEnd:B,updateConnection:M,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,dragThreshold:_.getState().connectionDragThreshold,handleDomNode:z.currentTarget})},C=z=>T(z,{nodeId:o.target,id:o.targetHandle??null,type:"target"}),N=z=>T(z,{nodeId:o.source,id:o.sourceHandle??null,type:"source"}),j=()=>S(!0),E=()=>S(!1);return w.jsxs(w.Fragment,{children:[(n===!0||n==="source")&&w.jsx(ap,{position:g,centerX:u,centerY:r,radius:l,onMouseDown:C,onMouseEnter:j,onMouseOut:E,type:"source"}),(n===!0||n==="target")&&w.jsx(ap,{position:m,centerX:f,centerY:d,radius:l,onMouseDown:N,onMouseEnter:j,onMouseOut:E,type:"target"})]})}function oN({id:n,edgesFocusable:l,edgesReconnectable:o,elementsSelectable:u,onClick:r,onDoubleClick:f,onContextMenu:d,onMouseEnter:g,onMouseMove:m,onMouseLeave:h,reconnectRadius:v,onReconnect:y,onReconnectStart:x,onReconnectEnd:S,rfId:_,edgeTypes:T,noPanClassName:C,onError:N,disableKeyboardA11y:j}){let E=Dt(yt=>yt.edgeLookup.get(n));const z=Dt(yt=>yt.defaultEdgeOptions);E=z?{...z,...E}:E;let Y=E.type||"default",q=T?.[Y]||tp[Y];q===void 0&&(N?.("011",hn.error011(Y)),Y="default",q=T?.default||tp.default);const L=!!(E.focusable||l&&typeof E.focusable>"u"),k=typeof y<"u"&&(E.reconnectable||o&&typeof E.reconnectable>"u"),I=!!(E.selectable||u&&typeof E.selectable>"u"),ot=J.useRef(null),[$,P]=J.useState(!1),[it,D]=J.useState(!1),G=kt(),{zIndex:M,sourceX:R,sourceY:B,targetX:X,targetY:tt,sourcePosition:A,targetPosition:H}=Dt(J.useCallback(yt=>{const xt=yt.nodeLookup.get(E.source),At=yt.nodeLookup.get(E.target);if(!xt||!At)return{zIndex:E.zIndex,...ep};const qt=J_({id:n,sourceNode:xt,targetNode:At,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:yt.connectionMode,onError:N});return{zIndex:G_({selected:E.selected,zIndex:E.zIndex,sourceNode:xt,targetNode:At,elevateOnSelect:yt.elevateEdgesOnSelect,zIndexMode:yt.zIndexMode}),...qt||ep}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),$t),W=J.useMemo(()=>E.markerStart?`url('#${zf(E.markerStart,_)}')`:void 0,[E.markerStart,_]),et=J.useMemo(()=>E.markerEnd?`url('#${zf(E.markerEnd,_)}')`:void 0,[E.markerEnd,_]);if(E.hidden||R===null||B===null||X===null||tt===null)return null;const st=yt=>{const{addSelectedEdges:xt,unselectNodesAndEdges:At,multiSelectionActive:qt}=G.getState();I&&(G.setState({nodesSelectionActive:!1}),E.selected&&qt?(At({nodes:[],edges:[E]}),ot.current?.blur()):xt([n])),r&&r(yt,E)},ct=f?yt=>{f(yt,{...E})}:void 0,rt=d?yt=>{d(yt,{...E})}:void 0,ut=g?yt=>{g(yt,{...E})}:void 0,ft=m?yt=>{m(yt,{...E})}:void 0,Et=h?yt=>{h(yt,{...E})}:void 0,bt=yt=>{if(!j&&Xp.includes(yt.key)&&I){const{unselectNodesAndEdges:xt,addSelectedEdges:At}=G.getState();yt.key==="Escape"?(ot.current?.blur(),xt({edges:[E]})):At([n])}};return w.jsx("svg",{style:{zIndex:M},children:w.jsxs("g",{className:ae(["react-flow__edge",`react-flow__edge-${Y}`,E.className,C,{selected:E.selected,animated:E.animated,inactive:!I&&!r,updating:$,selectable:I}]),onClick:st,onDoubleClick:ct,onContextMenu:rt,onMouseEnter:ut,onMouseMove:ft,onMouseLeave:Et,onKeyDown:L?bt: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?`${by}-${_}`:void 0,ref:ot,...E.domAttributes,children:[!it&&w.jsx(q,{id:n,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:I,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:R,sourceY:B,targetX:X,targetY:tt,sourcePosition:A,targetPosition:H,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:W,markerEnd:et,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),k&&w.jsx(iN,{edge:E,isReconnectable:k,reconnectRadius:v,onReconnect:y,onReconnectStart:x,onReconnectEnd:S,sourceX:R,sourceY:B,targetX:X,targetY:tt,sourcePosition:A,targetPosition:H,setUpdateHover:P,setReconnecting:D})]})})}var uN=J.memo(oN);const sN=n=>({edgesFocusable:n.edgesFocusable,edgesReconnectable:n.edgesReconnectable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError});function Qy({defaultMarkerColor:n,onlyRenderVisibleElements:l,rfId:o,edgeTypes:u,noPanClassName:r,onReconnect:f,onEdgeContextMenu:d,onEdgeMouseEnter:g,onEdgeMouseMove:m,onEdgeMouseLeave:h,onEdgeClick:v,reconnectRadius:y,onEdgeDoubleClick:x,onReconnectStart:S,onReconnectEnd:_,disableKeyboardA11y:T}){const{edgesFocusable:C,edgesReconnectable:N,elementsSelectable:j,onError:E}=Dt(sN,$t),z=$w(l);return w.jsxs("div",{className:"react-flow__edges",children:[w.jsx(Fw,{defaultColor:n,rfId:o}),z.map(Y=>w.jsx(uN,{id:Y,edgesFocusable:C,edgesReconnectable:N,elementsSelectable:j,noPanClassName:r,onReconnect:f,onContextMenu:d,onMouseEnter:g,onMouseMove:m,onMouseLeave:h,onClick:v,reconnectRadius:y,onDoubleClick:x,onReconnectStart:S,onReconnectEnd:_,rfId:o,onError:E,edgeTypes:u,disableKeyboardA11y:T},Y))]})}Qy.displayName="EdgeRenderer";const rN=J.memo(Qy),cN=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function fN({children:n}){const l=Dt(cN);return w.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:l},children:n})}function dN(n){const l=Jf(),o=J.useRef(!1);J.useEffect(()=>{!o.current&&l.viewportInitialized&&n&&(setTimeout(()=>n(l),1),o.current=!0)},[n,l.viewportInitialized])}const hN=n=>n.panZoom?.syncViewport;function gN(n){const l=Dt(hN),o=kt();return J.useEffect(()=>{n&&(l?.(n),o.setState({transform:[n.x,n.y,n.zoom]}))},[n,l]),null}function mN(n){return n.connection.inProgress?{...n.connection,to:wo(n.connection.to,n.transform)}:{...n.connection}}function pN(n){return mN}function yN(n){const l=pN();return Dt(l,$t)}const vN=n=>({nodesConnectable:n.nodesConnectable,isValid:n.connection.isValid,inProgress:n.connection.inProgress,width:n.width,height:n.height});function xN({containerStyle:n,style:l,type:o,component:u}){const{nodesConnectable:r,width:f,height:d,isValid:g,inProgress:m}=Dt(vN,$t);return!(f&&r&&m)?null:w.jsx("svg",{style:n,width:f,height:d,className:"react-flow__connectionline react-flow__container",children:w.jsx("g",{className:ae(["react-flow__connection",$p(g)]),children:w.jsx($y,{style:l,type:o,CustomComponent:u,isValid:g})})})}const $y=({style:n,type:l=Sa.Bezier,CustomComponent:o,isValid:u})=>{const{inProgress:r,from:f,fromNode:d,fromHandle:g,fromPosition:m,to:h,toNode:v,toHandle:y,toPosition:x,pointer:S}=yN();if(!r)return;if(o)return w.jsx(o,{connectionLineType:l,connectionLineStyle:n,fromNode:d,fromHandle:g,fromX:f.x,fromY:f.y,toX:h.x,toY:h.y,fromPosition:m,toPosition:x,connectionStatus:$p(u),toNode:v,toHandle:y,pointer:S});let _="";const T={sourceX:f.x,sourceY:f.y,sourcePosition:m,targetX:h.x,targetY:h.y,targetPosition:x};switch(l){case Sa.Bezier:[_]=ly(T);break;case Sa.SimpleBezier:[_]=Ry(T);break;case Sa.Step:[_]=Tf({...T,borderRadius:0});break;case Sa.SmoothStep:[_]=Tf(T);break;default:[_]=oy(T)}return w.jsx("path",{d:_,fill:"none",className:"react-flow__connection-path",style:n})};$y.displayName="ConnectionLine";const SN={};function lp(n=SN){J.useRef(n),kt(),J.useEffect(()=>{},[n])}function bN(){kt(),J.useRef(!1),J.useEffect(()=>{},[])}function ky({nodeTypes:n,edgeTypes:l,onInit:o,onNodeClick:u,onEdgeClick:r,onNodeDoubleClick:f,onEdgeDoubleClick:d,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:h,onNodeContextMenu:v,onSelectionContextMenu:y,onSelectionStart:x,onSelectionEnd:S,connectionLineType:_,connectionLineStyle:T,connectionLineComponent:C,connectionLineContainerStyle:N,selectionKeyCode:j,selectionOnDrag:E,selectionMode:z,multiSelectionKeyCode:Y,panActivationKeyCode:q,zoomActivationKeyCode:L,deleteKeyCode:k,onlyRenderVisibleElements:I,elementsSelectable:ot,defaultViewport:$,translateExtent:P,minZoom:it,maxZoom:D,preventScrolling:G,defaultMarkerColor:M,zoomOnScroll:R,zoomOnPinch:B,panOnScroll:X,panOnScrollSpeed:tt,panOnScrollMode:A,zoomOnDoubleClick:H,panOnDrag:W,onPaneClick:et,onPaneMouseEnter:st,onPaneMouseMove:ct,onPaneMouseLeave:rt,onPaneScroll:ut,onPaneContextMenu:ft,paneClickDistance:Et,nodeClickDistance:bt,onEdgeContextMenu:yt,onEdgeMouseEnter:xt,onEdgeMouseMove:At,onEdgeMouseLeave:qt,reconnectRadius:jt,onReconnect:oe,onReconnectStart:Qe,onReconnectEnd:Ae,noDragClassName:$e,noWheelClassName:mn,noPanClassName:_a,disableKeyboardA11y:Ea,nodeExtent:se,rfId:nl,viewport:pn,onViewportChange:Xn}){return lp(n),lp(l),bN(),dN(o),gN(pn),w.jsx(Uw,{onPaneClick:et,onPaneMouseEnter:st,onPaneMouseMove:ct,onPaneMouseLeave:rt,onPaneContextMenu:ft,onPaneScroll:ut,paneClickDistance:Et,deleteKeyCode:k,selectionKeyCode:j,selectionOnDrag:E,selectionMode:z,onSelectionStart:x,onSelectionEnd:S,multiSelectionKeyCode:Y,panActivationKeyCode:q,zoomActivationKeyCode:L,elementsSelectable:ot,zoomOnScroll:R,zoomOnPinch:B,zoomOnDoubleClick:H,panOnScroll:X,panOnScrollSpeed:tt,panOnScrollMode:A,panOnDrag:W,defaultViewport:$,translateExtent:P,minZoom:it,maxZoom:D,onSelectionContextMenu:y,preventScrolling:G,noDragClassName:$e,noWheelClassName:mn,noPanClassName:_a,disableKeyboardA11y:Ea,onViewportChange:Xn,isControlledViewport:!!pn,children:w.jsxs(fN,{children:[w.jsx(rN,{edgeTypes:l,onEdgeClick:r,onEdgeDoubleClick:d,onReconnect:oe,onReconnectStart:Qe,onReconnectEnd:Ae,onlyRenderVisibleElements:I,onEdgeContextMenu:yt,onEdgeMouseEnter:xt,onEdgeMouseMove:At,onEdgeMouseLeave:qt,reconnectRadius:jt,defaultMarkerColor:M,noPanClassName:_a,disableKeyboardA11y:Ea,rfId:nl}),w.jsx(xN,{style:T,type:_,component:C,containerStyle:N}),w.jsx("div",{className:"react-flow__edgelabel-renderer"}),w.jsx(Qw,{nodeTypes:n,onNodeClick:u,onNodeDoubleClick:f,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:h,onNodeContextMenu:v,nodeClickDistance:bt,onlyRenderVisibleElements:I,noPanClassName:_a,noDragClassName:$e,disableKeyboardA11y:Ea,nodeExtent:se,rfId:nl}),w.jsx("div",{className:"react-flow__viewport-portal"})]})})}ky.displayName="GraphView";const _N=J.memo(ky),ip=({nodes:n,edges:l,defaultNodes:o,defaultEdges:u,width:r,height:f,fitView:d,fitViewOptions:g,minZoom:m=.5,maxZoom:h=2,nodeOrigin:v,nodeExtent:y,zIndexMode:x="basic"}={})=>{const S=new Map,_=new Map,T=new Map,C=new Map,N=u??l??[],j=o??n??[],E=v??[0,0],z=y??ho;ry(T,C,N);const{nodesInitialized:Y}=Cf(j,S,_,{nodeOrigin:E,nodeExtent:z,zIndexMode:x});let q=[0,0,1];if(d&&r&&f){const L=_o(S,{filter:$=>!!(($.width||$.initialWidth)&&($.height||$.initialHeight))}),{x:k,y:I,zoom:ot}=Xf(L,r,f,m,h,g?.padding??.1);q=[k,I,ot]}return{rfId:"1",width:r??0,height:f??0,transform:q,nodes:j,nodesInitialized:Y,nodeLookup:S,parentLookup:_,edges:N,edgeLookup:C,connectionLookup:T,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:o!==void 0,hasDefaultEdges:u!==void 0,panZoom:null,minZoom:m,maxZoom:h,translateExtent:ho,nodeExtent:z,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Wl.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:{...Qp},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:U_,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Zp,zIndexMode:x,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},EN=({nodes:n,edges:l,defaultNodes:o,defaultEdges:u,width:r,height:f,fitView:d,fitViewOptions:g,minZoom:m,maxZoom:h,nodeOrigin:v,nodeExtent:y,zIndexMode:x})=>YE((S,_)=>{async function T(){const{nodeLookup:C,panZoom:N,fitViewOptions:j,fitViewResolver:E,width:z,height:Y,minZoom:q,maxZoom:L}=_();N&&(await H_({nodes:C,width:z,height:Y,panZoom:N,minZoom:q,maxZoom:L},j),E?.resolve(!0),S({fitViewResolver:null}))}return{...ip({nodes:n,edges:l,width:r,height:f,fitView:d,fitViewOptions:g,minZoom:m,maxZoom:h,nodeOrigin:v,nodeExtent:y,defaultNodes:o,defaultEdges:u,zIndexMode:x}),setNodes:C=>{const{nodeLookup:N,parentLookup:j,nodeOrigin:E,elevateNodesOnSelect:z,fitViewQueued:Y,zIndexMode:q,nodesSelectionActive:L}=_(),{nodesInitialized:k,hasSelectedNodes:I}=Cf(C,N,j,{nodeOrigin:E,nodeExtent:y,elevateNodesOnSelect:z,checkEquality:!0,zIndexMode:q}),ot=L&&I;Y&&k?(T(),S({nodes:C,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:ot})):S({nodes:C,nodesInitialized:k,nodesSelectionActive:ot})},setEdges:C=>{const{connectionLookup:N,edgeLookup:j}=_();ry(N,j,C),S({edges:C})},setDefaultNodesAndEdges:(C,N)=>{if(C){const{setNodes:j}=_();j(C),S({hasDefaultNodes:!0})}if(N){const{setEdges:j}=_();j(N),S({hasDefaultEdges:!0})}},updateNodeInternals:C=>{const{triggerNodeChanges:N,nodeLookup:j,parentLookup:E,domNode:z,nodeOrigin:Y,nodeExtent:q,debug:L,fitViewQueued:k,zIndexMode:I}=_(),{changes:ot,updatedInternals:$}=lE(C,j,E,z,Y,q,I);$&&(tE(j,E,{nodeOrigin:Y,nodeExtent:q,zIndexMode:I}),k?(T(),S({fitViewQueued:!1,fitViewOptions:void 0})):S({}),ot?.length>0&&(L&&console.log("React Flow: trigger node changes",ot),N?.(ot)))},updateNodePositions:(C,N=!1)=>{const j=[];let E=[];const{nodeLookup:z,triggerNodeChanges:Y,connection:q,updateConnection:L,onNodesChangeMiddlewareMap:k}=_();for(const[I,ot]of C){const $=z.get(I),P=!!($?.expandParent&&$?.parentId&&ot?.position),it={id:I,type:"position",position:P?{x:Math.max(0,ot.position.x),y:Math.max(0,ot.position.y)}:ot.position,dragging:N};if($&&q.inProgress&&q.fromNode.id===$.id){const D=el($,q.fromHandle,mt.Left,!0);L({...q,from:D})}P&&$.parentId&&j.push({id:I,parentId:$.parentId,rect:{...ot.internals.positionAbsolute,width:ot.measured.width??0,height:ot.measured.height??0}}),E.push(it)}if(j.length>0){const{parentLookup:I,nodeOrigin:ot}=_(),$=If(j,z,I,ot);E.push(...$)}for(const I of k.values())E=I(E);Y(E)},triggerNodeChanges:C=>{const{onNodesChange:N,setNodes:j,nodes:E,hasDefaultNodes:z,debug:Y}=_();if(C?.length){if(z){const q=uw(C,E);j(q)}Y&&console.log("React Flow: trigger node changes",C),N?.(C)}},triggerEdgeChanges:C=>{const{onEdgesChange:N,setEdges:j,edges:E,hasDefaultEdges:z,debug:Y}=_();if(C?.length){if(z){const q=sw(C,E);j(q)}Y&&console.log("React Flow: trigger edge changes",C),N?.(C)}},addSelectedNodes:C=>{const{multiSelectionActive:N,edgeLookup:j,nodeLookup:E,triggerNodeChanges:z,triggerEdgeChanges:Y}=_();if(N){const q=C.map(L=>Ka(L,!0));z(q);return}z(kl(E,new Set([...C]),!0)),Y(kl(j))},addSelectedEdges:C=>{const{multiSelectionActive:N,edgeLookup:j,nodeLookup:E,triggerNodeChanges:z,triggerEdgeChanges:Y}=_();if(N){const q=C.map(L=>Ka(L,!0));Y(q);return}Y(kl(j,new Set([...C]))),z(kl(E,new Set,!0))},unselectNodesAndEdges:({nodes:C,edges:N}={})=>{const{edges:j,nodes:E,nodeLookup:z,triggerNodeChanges:Y,triggerEdgeChanges:q}=_(),L=C||E,k=N||j,I=[];for(const $ of L){if(!$.selected)continue;const P=z.get($.id);P&&(P.selected=!1),I.push(Ka($.id,!1))}const ot=[];for(const $ of k)$.selected&&ot.push(Ka($.id,!1));Y(I),q(ot)},setMinZoom:C=>{const{panZoom:N,maxZoom:j}=_();N?.setScaleExtent([C,j]),S({minZoom:C})},setMaxZoom:C=>{const{panZoom:N,minZoom:j}=_();N?.setScaleExtent([j,C]),S({maxZoom:C})},setTranslateExtent:C=>{_().panZoom?.setTranslateExtent(C),S({translateExtent:C})},resetSelectedElements:()=>{const{edges:C,nodes:N,triggerNodeChanges:j,triggerEdgeChanges:E,elementsSelectable:z}=_();if(!z)return;const Y=N.reduce((L,k)=>k.selected?[...L,Ka(k.id,!1)]:L,[]),q=C.reduce((L,k)=>k.selected?[...L,Ka(k.id,!1)]:L,[]);j(Y),E(q)},setNodeExtent:C=>{const{nodes:N,nodeLookup:j,parentLookup:E,nodeOrigin:z,elevateNodesOnSelect:Y,nodeExtent:q,zIndexMode:L}=_();C[0][0]===q[0][0]&&C[0][1]===q[0][1]&&C[1][0]===q[1][0]&&C[1][1]===q[1][1]||(Cf(N,j,E,{nodeOrigin:z,nodeExtent:C,elevateNodesOnSelect:Y,checkEquality:!1,zIndexMode:L}),S({nodeExtent:C}))},panBy:C=>{const{transform:N,width:j,height:E,panZoom:z,translateExtent:Y}=_();return iE({delta:C,panZoom:z,transform:N,translateExtent:Y,width:j,height:E})},setCenter:async(C,N,j)=>{const{width:E,height:z,maxZoom:Y,panZoom:q}=_();if(!q)return Promise.resolve(!1);const L=typeof j?.zoom<"u"?j.zoom:Y;return await q.setViewport({x:E/2-C*L,y:z/2-N*L,zoom:L},{duration:j?.duration,ease:j?.ease,interpolate:j?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{S({connection:{...Qp}})},updateConnection:C=>{S({connection:C})},reset:()=>S({...ip()})}},Object.is);function wN({initialNodes:n,initialEdges:l,defaultNodes:o,defaultEdges:u,initialWidth:r,initialHeight:f,initialMinZoom:d,initialMaxZoom:g,initialFitViewOptions:m,fitView:h,nodeOrigin:v,nodeExtent:y,zIndexMode:x,children:S}){const[_]=J.useState(()=>EN({nodes:n,edges:l,defaultNodes:o,defaultEdges:u,width:r,height:f,fitView:h,minZoom:d,maxZoom:g,fitViewOptions:m,nodeOrigin:v,nodeExtent:y,zIndexMode:x}));return w.jsx(VE,{value:_,children:w.jsx(fw,{children:S})})}function NN({children:n,nodes:l,edges:o,defaultNodes:u,defaultEdges:r,width:f,height:d,fitView:g,fitViewOptions:m,minZoom:h,maxZoom:v,nodeOrigin:y,nodeExtent:x,zIndexMode:S}){return J.useContext(Cs)?w.jsx(w.Fragment,{children:n}):w.jsx(wN,{initialNodes:l,initialEdges:o,defaultNodes:u,defaultEdges:r,initialWidth:f,initialHeight:d,fitView:g,initialFitViewOptions:m,initialMinZoom:h,initialMaxZoom:v,nodeOrigin:y,nodeExtent:x,zIndexMode:S,children:n})}const MN={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function AN({nodes:n,edges:l,defaultNodes:o,defaultEdges:u,className:r,nodeTypes:f,edgeTypes:d,onNodeClick:g,onEdgeClick:m,onInit:h,onMove:v,onMoveStart:y,onMoveEnd:x,onConnect:S,onConnectStart:_,onConnectEnd:T,onClickConnectStart:C,onClickConnectEnd:N,onNodeMouseEnter:j,onNodeMouseMove:E,onNodeMouseLeave:z,onNodeContextMenu:Y,onNodeDoubleClick:q,onNodeDragStart:L,onNodeDrag:k,onNodeDragStop:I,onNodesDelete:ot,onEdgesDelete:$,onDelete:P,onSelectionChange:it,onSelectionDragStart:D,onSelectionDrag:G,onSelectionDragStop:M,onSelectionContextMenu:R,onSelectionStart:B,onSelectionEnd:X,onBeforeDelete:tt,connectionMode:A,connectionLineType:H=Sa.Bezier,connectionLineStyle:W,connectionLineComponent:et,connectionLineContainerStyle:st,deleteKeyCode:ct="Backspace",selectionKeyCode:rt="Shift",selectionOnDrag:ut=!1,selectionMode:ft=go.Full,panActivationKeyCode:Et="Space",multiSelectionKeyCode:bt=po()?"Meta":"Control",zoomActivationKeyCode:yt=po()?"Meta":"Control",snapToGrid:xt,snapGrid:At,onlyRenderVisibleElements:qt=!1,selectNodesOnDrag:jt,nodesDraggable:oe,autoPanOnNodeFocus:Qe,nodesConnectable:Ae,nodesFocusable:$e,nodeOrigin:mn=_y,edgesFocusable:_a,edgesReconnectable:Ea,elementsSelectable:se=!0,defaultViewport:nl=tw,minZoom:pn=.5,maxZoom:Xn=2,translateExtent:wa=ho,preventScrolling:Hs=!0,nodeExtent:al,defaultMarkerColor:js="#b1b1b7",zoomOnScroll:Us=!0,zoomOnPinch:Na=!0,panOnScroll:me=!1,panOnScrollSpeed:an=.5,panOnScrollMode:pe=Fa.Free,zoomOnDoubleClick:Bs=!0,panOnDrag:qs=!0,onPaneClick:Ls,onPaneMouseEnter:ll,onPaneMouseMove:il,onPaneMouseLeave:ol,onPaneScroll:yn,onPaneContextMenu:ul,paneClickDistance:Ma=1,nodeClickDistance:Ys=0,children:No,onReconnect:li,onReconnectStart:Aa,onReconnectEnd:Vs,onEdgeContextMenu:Mo,onEdgeDoubleClick:Ao,onEdgeMouseEnter:To,onEdgeMouseMove:ii,onEdgeMouseLeave:oi,reconnectRadius:zo=10,onNodesChange:Co,onEdgesChange:ln,noDragClassName:le="nodrag",noWheelClassName:he="nowheel",noPanClassName:vn="nopan",fitView:sl,fitViewOptions:Do,connectOnClick:Gs,attributionPosition:Oo,proOptions:Ta,defaultEdgeOptions:ui,elevateNodesOnSelect:Zn=!0,elevateEdgesOnSelect:Qn=!1,disableKeyboardA11y:$n=!1,autoPanOnConnect:kn,autoPanOnNodeDrag:Wt,autoPanSpeed:Ro,connectionRadius:Ho,isValidConnection:xn,onError:Kn,style:Xs,id:si,nodeDragThreshold:jo,connectionDragThreshold:Zs,viewport:rl,onViewportChange:cl,width:ke,height:ve,colorMode:Uo="light",debug:Qs,onScroll:fl,ariaLabelConfig:Bo,zIndexMode:za="basic",...$s},xe){const Ca=si||"1",qo=lw(Uo),ri=J.useCallback(Sn=>{Sn.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),fl?.(Sn)},[fl]);return w.jsx("div",{"data-testid":"rf__wrapper",...$s,onScroll:ri,style:{...Xs,...MN},ref:xe,className:ae(["react-flow",r,qo]),id:si,role:"application",children:w.jsxs(NN,{nodes:n,edges:l,width:ke,height:ve,fitView:sl,fitViewOptions:Do,minZoom:pn,maxZoom:Xn,nodeOrigin:mn,nodeExtent:al,zIndexMode:za,children:[w.jsx(aw,{nodes:n,edges:l,defaultNodes:o,defaultEdges:u,onConnect:S,onConnectStart:_,onConnectEnd:T,onClickConnectStart:C,onClickConnectEnd:N,nodesDraggable:oe,autoPanOnNodeFocus:Qe,nodesConnectable:Ae,nodesFocusable:$e,edgesFocusable:_a,edgesReconnectable:Ea,elementsSelectable:se,elevateNodesOnSelect:Zn,elevateEdgesOnSelect:Qn,minZoom:pn,maxZoom:Xn,nodeExtent:al,onNodesChange:Co,onEdgesChange:ln,snapToGrid:xt,snapGrid:At,connectionMode:A,translateExtent:wa,connectOnClick:Gs,defaultEdgeOptions:ui,fitView:sl,fitViewOptions:Do,onNodesDelete:ot,onEdgesDelete:$,onDelete:P,onNodeDragStart:L,onNodeDrag:k,onNodeDragStop:I,onSelectionDrag:G,onSelectionDragStart:D,onSelectionDragStop:M,onMove:v,onMoveStart:y,onMoveEnd:x,noPanClassName:vn,nodeOrigin:mn,rfId:Ca,autoPanOnConnect:kn,autoPanOnNodeDrag:Wt,autoPanSpeed:Ro,onError:Kn,connectionRadius:Ho,isValidConnection:xn,selectNodesOnDrag:jt,nodeDragThreshold:jo,connectionDragThreshold:Zs,onBeforeDelete:tt,debug:Qs,ariaLabelConfig:Bo,zIndexMode:za}),w.jsx(_N,{onInit:h,onNodeClick:g,onEdgeClick:m,onNodeMouseEnter:j,onNodeMouseMove:E,onNodeMouseLeave:z,onNodeContextMenu:Y,onNodeDoubleClick:q,nodeTypes:f,edgeTypes:d,connectionLineType:H,connectionLineStyle:W,connectionLineComponent:et,connectionLineContainerStyle:st,selectionKeyCode:rt,selectionOnDrag:ut,selectionMode:ft,deleteKeyCode:ct,multiSelectionKeyCode:bt,panActivationKeyCode:Et,zoomActivationKeyCode:yt,onlyRenderVisibleElements:qt,defaultViewport:nl,translateExtent:wa,minZoom:pn,maxZoom:Xn,preventScrolling:Hs,zoomOnScroll:Us,zoomOnPinch:Na,zoomOnDoubleClick:Bs,panOnScroll:me,panOnScrollSpeed:an,panOnScrollMode:pe,panOnDrag:qs,onPaneClick:Ls,onPaneMouseEnter:ll,onPaneMouseMove:il,onPaneMouseLeave:ol,onPaneScroll:yn,onPaneContextMenu:ul,paneClickDistance:Ma,nodeClickDistance:Ys,onSelectionContextMenu:R,onSelectionStart:B,onSelectionEnd:X,onReconnect:li,onReconnectStart:Aa,onReconnectEnd:Vs,onEdgeContextMenu:Mo,onEdgeDoubleClick:Ao,onEdgeMouseEnter:To,onEdgeMouseMove:ii,onEdgeMouseLeave:oi,reconnectRadius:zo,defaultMarkerColor:js,noDragClassName:le,noWheelClassName:he,noPanClassName:vn,rfId:Ca,disableKeyboardA11y:$n,nodeExtent:al,viewport:rl,onViewportChange:cl}),w.jsx(PE,{onSelectionChange:it}),No,w.jsx(KE,{proOptions:Ta,position:Oo}),w.jsx(kE,{rfId:Ca,disableKeyboardA11y:$n})]})})}wy(AN);function TN({dimensions:n,lineWidth:l,variant:o,className:u}){return w.jsx("path",{strokeWidth:l,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`,className:ae(["react-flow__background-pattern",o,u])})}function zN({radius:n,className:l}){return w.jsx("circle",{cx:n,cy:n,r:n,className:ae(["react-flow__background-pattern","dots",l])})}var ba;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(ba||(ba={}));const CN={[ba.Dots]:1,[ba.Lines]:1,[ba.Cross]:6},DN=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function Ky({id:n,variant:l=ba.Dots,gap:o=20,size:u,lineWidth:r=1,offset:f=0,color:d,bgColor:g,style:m,className:h,patternClassName:v}){const y=J.useRef(null),{transform:x,patternId:S}=Dt(DN,$t),_=u||CN[l],T=l===ba.Dots,C=l===ba.Cross,N=Array.isArray(o)?o:[o,o],j=[N[0]*x[2]||1,N[1]*x[2]||1],E=_*x[2],z=Array.isArray(f)?f:[f,f],Y=C?[E,E]:j,q=[z[0]*x[2]||1+Y[0]/2,z[1]*x[2]||1+Y[1]/2],L=`${S}${n||""}`;return w.jsxs("svg",{className:ae(["react-flow__background",h]),style:{...m,...Os,"--xy-background-color-props":g,"--xy-background-pattern-color-props":d},ref:y,"data-testid":"rf__background",children:[w.jsx("pattern",{id:L,x:x[0]%j[0],y:x[1]%j[1],width:j[0],height:j[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${q[0]},-${q[1]})`,children:T?w.jsx(zN,{radius:E/2,className:v}):w.jsx(TN,{dimensions:Y,lineWidth:r,variant:l,className:v})}),w.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${L})`})]})}Ky.displayName="Background";J.memo(Ky);function ON(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:w.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function RN(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:w.jsx("path",{d:"M0 0h32v4.2H0z"})})}function HN(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:w.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 jN(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 UN(){return w.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:w.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 ns({children:n,className:l,...o}){return w.jsx("button",{type:"button",className:ae(["react-flow__controls-button",l]),...o,children:n})}const BN=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom,ariaLabelConfig:n.ariaLabelConfig});function Iy({style:n,showZoom:l=!0,showFitView:o=!0,showInteractive:u=!0,fitViewOptions:r,onZoomIn:f,onZoomOut:d,onFitView:g,onInteractiveChange:m,className:h,children:v,position:y="bottom-left",orientation:x="vertical","aria-label":S}){const _=kt(),{isInteractive:T,minZoomReached:C,maxZoomReached:N,ariaLabelConfig:j}=Dt(BN,$t),{zoomIn:E,zoomOut:z,fitView:Y}=Jf(),q=()=>{E(),f?.()},L=()=>{z(),d?.()},k=()=>{Y(r),g?.()},I=()=>{_.setState({nodesDraggable:!T,nodesConnectable:!T,elementsSelectable:!T}),m?.(!T)},ot=x==="horizontal"?"horizontal":"vertical";return w.jsxs(Ds,{className:ae(["react-flow__controls",ot,h]),position:y,style:n,"data-testid":"rf__controls","aria-label":S??j["controls.ariaLabel"],children:[l&&w.jsxs(w.Fragment,{children:[w.jsx(ns,{onClick:q,className:"react-flow__controls-zoomin",title:j["controls.zoomIn.ariaLabel"],"aria-label":j["controls.zoomIn.ariaLabel"],disabled:N,children:w.jsx(ON,{})}),w.jsx(ns,{onClick:L,className:"react-flow__controls-zoomout",title:j["controls.zoomOut.ariaLabel"],"aria-label":j["controls.zoomOut.ariaLabel"],disabled:C,children:w.jsx(RN,{})})]}),o&&w.jsx(ns,{className:"react-flow__controls-fitview",onClick:k,title:j["controls.fitView.ariaLabel"],"aria-label":j["controls.fitView.ariaLabel"],children:w.jsx(HN,{})}),u&&w.jsx(ns,{className:"react-flow__controls-interactive",onClick:I,title:j["controls.interactive.ariaLabel"],"aria-label":j["controls.interactive.ariaLabel"],children:T?w.jsx(UN,{}):w.jsx(jN,{})}),v]})}Iy.displayName="Controls";J.memo(Iy);function qN({id:n,x:l,y:o,width:u,height:r,style:f,color:d,strokeColor:g,strokeWidth:m,className:h,borderRadius:v,shapeRendering:y,selected:x,onClick:S}){const{background:_,backgroundColor:T}=f||{},C=d||_||T;return w.jsx("rect",{className:ae(["react-flow__minimap-node",{selected:x},h]),x:l,y:o,rx:v,ry:v,width:u,height:r,style:{fill:C,stroke:g,strokeWidth:m},shapeRendering:y,onClick:S?N=>S(N,n):void 0})}const LN=J.memo(qN),YN=n=>n.nodes.map(l=>l.id),vf=n=>n instanceof Function?n:()=>n;function VN({nodeStrokeColor:n,nodeColor:l,nodeClassName:o="",nodeBorderRadius:u=5,nodeStrokeWidth:r,nodeComponent:f=LN,onClick:d}){const g=Dt(YN,$t),m=vf(l),h=vf(n),v=vf(o),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return w.jsx(w.Fragment,{children:g.map(x=>w.jsx(XN,{id:x,nodeColorFunc:m,nodeStrokeColorFunc:h,nodeClassNameFunc:v,nodeBorderRadius:u,nodeStrokeWidth:r,NodeComponent:f,onClick:d,shapeRendering:y},x))})}function GN({id:n,nodeColorFunc:l,nodeStrokeColorFunc:o,nodeClassNameFunc:u,nodeBorderRadius:r,nodeStrokeWidth:f,shapeRendering:d,NodeComponent:g,onClick:m}){const{node:h,x:v,y,width:x,height:S}=Dt(_=>{const T=_.nodeLookup.get(n);if(!T)return{node:void 0,x:0,y:0,width:0,height:0};const C=T.internals.userNode,{x:N,y:j}=T.internals.positionAbsolute,{width:E,height:z}=Gn(C);return{node:C,x:N,y:j,width:E,height:z}},$t);return!h||h.hidden||!Wp(h)?null:w.jsx(g,{x:v,y,width:x,height:S,style:h.style,selected:!!h.selected,className:u(h),color:l(h),borderRadius:r,strokeColor:o(h),strokeWidth:f,shapeRendering:d,onClick:m,id:h.id})}const XN=J.memo(GN);var ZN=J.memo(VN);const QN=200,$N=150,kN=n=>!n.hidden,KN=n=>{const l={x:-n.transform[0]/n.transform[2],y:-n.transform[1]/n.transform[2],width:n.width/n.transform[2],height:n.height/n.transform[2]};return{viewBB:l,boundingRect:n.nodeLookup.size>0?Fp(_o(n.nodeLookup,{filter:kN}),l):l,rfId:n.rfId,panZoom:n.panZoom,translateExtent:n.translateExtent,flowWidth:n.width,flowHeight:n.height,ariaLabelConfig:n.ariaLabelConfig}},IN="react-flow__minimap-desc";function Jy({style:n,className:l,nodeStrokeColor:o,nodeColor:u,nodeClassName:r="",nodeBorderRadius:f=5,nodeStrokeWidth:d,nodeComponent:g,bgColor:m,maskColor:h,maskStrokeColor:v,maskStrokeWidth:y,position:x="bottom-right",onClick:S,onNodeClick:_,pannable:T=!1,zoomable:C=!1,ariaLabel:N,inversePan:j,zoomStep:E=1,offsetScale:z=5}){const Y=kt(),q=J.useRef(null),{boundingRect:L,viewBB:k,rfId:I,panZoom:ot,translateExtent:$,flowWidth:P,flowHeight:it,ariaLabelConfig:D}=Dt(KN,$t),G=n?.width??QN,M=n?.height??$N,R=L.width/G,B=L.height/M,X=Math.max(R,B),tt=X*G,A=X*M,H=z*X,W=L.x-(tt-L.width)/2-H,et=L.y-(A-L.height)/2-H,st=tt+H*2,ct=A+H*2,rt=`${IN}-${I}`,ut=J.useRef(0),ft=J.useRef();ut.current=X,J.useEffect(()=>{if(q.current&&ot)return ft.current=gE({domNode:q.current,panZoom:ot,getTransform:()=>Y.getState().transform,getViewScale:()=>ut.current}),()=>{ft.current?.destroy()}},[ot]),J.useEffect(()=>{ft.current?.update({translateExtent:$,width:P,height:it,inversePan:j,pannable:T,zoomStep:E,zoomable:C})},[T,C,j,E,$,P,it]);const Et=S?xt=>{const[At,qt]=ft.current?.pointer(xt)||[0,0];S(xt,{x:At,y:qt})}:void 0,bt=_?J.useCallback((xt,At)=>{const qt=Y.getState().nodeLookup.get(At).internals.userNode;_(xt,qt)},[]):void 0,yt=N??D["minimap.ariaLabel"];return w.jsx(Ds,{position:x,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 v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof y=="number"?y*X:void 0,"--xy-minimap-node-background-color-props":typeof u=="string"?u:void 0,"--xy-minimap-node-stroke-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-width-props":typeof d=="number"?d:void 0},className:ae(["react-flow__minimap",l]),"data-testid":"rf__minimap",children:w.jsxs("svg",{width:G,height:M,viewBox:`${W} ${et} ${st} ${ct}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":rt,ref:q,onClick:Et,children:[yt&&w.jsx("title",{id:rt,children:yt}),w.jsx(ZN,{onClick:bt,nodeColor:u,nodeStrokeColor:o,nodeBorderRadius:f,nodeClassName:r,nodeStrokeWidth:d,nodeComponent:g}),w.jsx("path",{className:"react-flow__minimap-mask",d:`M${W-H},${et-H}h${st+H*2}v${ct+H*2}h${-st-H*2}z
15
- M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Jy.displayName="MiniMap";J.memo(Jy);const JN=n=>l=>n?`${Math.max(1/l.transform[2],1)}`:void 0,FN={[ni.Line]:"right",[ni.Handle]:"bottom-right"};function WN({nodeId:n,position:l,variant:o=ni.Handle,className:u,style:r=void 0,children:f,color:d,minWidth:g=10,minHeight:m=10,maxWidth:h=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:y=!1,resizeDirection:x,autoScale:S=!0,shouldResize:_,onResizeStart:T,onResize:C,onResizeEnd:N}){const j=Ty(),E=typeof n=="string"?n:j,z=kt(),Y=J.useRef(null),q=o===ni.Handle,L=Dt(J.useCallback(JN(q&&S),[q,S]),$t),k=J.useRef(null),I=l??FN[o];J.useEffect(()=>{if(!(!Y.current||!E))return k.current||(k.current=TE({domNode:Y.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:$,transform:P,snapGrid:it,snapToGrid:D,nodeOrigin:G,domNode:M}=z.getState();return{nodeLookup:$,transform:P,snapGrid:it,snapToGrid:D,nodeOrigin:G,paneDomNode:M}},onChange:($,P)=>{const{triggerNodeChanges:it,nodeLookup:D,parentLookup:G,nodeOrigin:M}=z.getState(),R=[],B={x:$.x,y:$.y},X=D.get(E);if(X&&X.expandParent&&X.parentId){const tt=X.origin??M,A=$.width??X.measured.width??0,H=$.height??X.measured.height??0,W={id:X.id,parentId:X.parentId,rect:{width:A,height:H,...Pp({x:$.x??X.position.x,y:$.y??X.position.y},{width:A,height:H},X.parentId,D,tt)}},et=If([W],D,G,M);R.push(...et),B.x=$.x?Math.max(tt[0]*A,$.x):void 0,B.y=$.y?Math.max(tt[1]*H,$.y):void 0}if(B.x!==void 0&&B.y!==void 0){const tt={id:E,type:"position",position:{...B}};R.push(tt)}if($.width!==void 0&&$.height!==void 0){const A={id:E,type:"dimensions",resizing:!0,setAttributes:x?x==="horizontal"?"width":"height":!0,dimensions:{width:$.width,height:$.height}};R.push(A)}for(const tt of P){const A={...tt,type:"position"};R.push(A)}it(R)},onEnd:({width:$,height:P})=>{const it={id:E,type:"dimensions",resizing:!1,dimensions:{width:$,height:P}};z.getState().triggerNodeChanges([it])}})),k.current.update({controlPosition:I,boundaries:{minWidth:g,minHeight:m,maxWidth:h,maxHeight:v},keepAspectRatio:y,resizeDirection:x,onResizeStart:T,onResize:C,onResizeEnd:N,shouldResize:_}),()=>{k.current?.destroy()}},[I,g,m,h,v,y,T,C,N,_]);const ot=I.split("-");return w.jsx("div",{className:ae(["react-flow__resize-control","nodrag",...ot,o,u]),ref:Y,style:{...r,scale:L,...d&&{[q?"backgroundColor":"borderColor"]:d}},children:f})}J.memo(WN);function PN({id:n,data:l,selected:o}){const u=l,r=ht(_=>_.updateNodePrompt),f=ht(_=>_.generateNode),d=ht(_=>_.addChildNode),g=ht(_=>_.deleteNode),m=J.useCallback(_=>r(n,_.target.value),[n,r]),h=J.useCallback(()=>{f(n)},[n,f]),v=J.useCallback(()=>{u.status==="ready"&&d(n)},[n,u.status,d]),y=J.useCallback(()=>g(n),[n,g]),x=u.status==="pending"||u.status==="reconciling",S={empty:"empty",pending:"generating…",reconciling:`reconciling…${u.pendingPhase?` · ${u.pendingPhase}`:""}`,ready:`ready · ${u.elapsed??"?"}s${u.webSearchCalls?` · ws×${u.webSearchCalls}`:""}`,stale:`stale${u.error?`: ${u.error}`:""}`,"asset-missing":`asset missing${u.error?`: ${u.error}`:""}`,error:`error: ${u.error??"unknown"}`}[u.status];return w.jsxs("div",{className:`image-node image-node--${u.status}${o?" image-node--selected":""}`,children:[u.parentServerNodeId?w.jsx(ai,{type:"target",position:mt.Left,className:"image-node__handle"}):null,w.jsx("div",{className:"image-node__preview",children:u.imageUrl&&u.status!=="asset-missing"?w.jsx("img",{src:u.imageUrl,alt:"node"}):x?w.jsx("div",{className:"image-node__skeleton",children:"⏳"}):u.status==="asset-missing"?w.jsx("div",{className:"image-node__placeholder",children:"missing asset"}):u.status==="stale"?w.jsx("div",{className:"image-node__placeholder",children:"stale"}):w.jsx("div",{className:"image-node__placeholder",children:"no image"})}),w.jsx("textarea",{className:"image-node__prompt nodrag",value:u.prompt,onChange:m,onKeyDown:_=>_.stopPropagation(),placeholder:u.parentServerNodeId?"Edit prompt…":"Prompt…",rows:2,disabled:x}),w.jsxs("div",{className:"image-node__footer",children:[w.jsx("span",{className:"image-node__status",children:S}),w.jsxs("div",{className:"image-node__actions nodrag",children:[w.jsx("button",{type:"button",onClick:h,disabled:x,children:u.status==="ready"?"Regenerate":"Generate"}),u.status==="ready"?w.jsx("button",{type:"button",onClick:v,children:"+ Child"}):null,w.jsx("button",{type:"button",onClick:y,className:"image-node__del",title:"Delete",children:"✕"})]})]}),w.jsx(ai,{type:"source",position:mt.Right,className:"image-node__handle image-node__handle--source"})]})}J.memo(PN);function t3(){const{data:n,error:l}=dp();let o="checking...",u="var(--text-dim)";if(l||!n)l&&(o="offline",u="var(--red)");else if(n.credits){const r=n.credits.total_granted??0,f=n.credits.total_used??0,d=r-f;o=`$${d.toFixed(2)} remaining`,u=d>5?"var(--green)":d>1?"var(--amber)":"var(--red)"}else n.costs?.data?.length?(o=`$${(n.costs.data.reduce((f,d)=>f+d.results.reduce((g,m)=>g+(m.amount?.value??0),0),0)/100).toFixed(2)} this month`,u="var(--accent)"):n.oauth?(o="OAuth · free via codex",u="var(--green)"):n.apiKeyValid?(o="API key disabled (OAuth only)",u="var(--text-dim)"):(o="OAuth mode",u="var(--text-dim)");return w.jsxs("div",{className:"billing-bar",children:[w.jsx("div",{className:"label",children:"API Status"}),w.jsx("div",{className:"value",style:{color:u},children:o})]})}function Ln({title:n,items:l,value:o,onChange:u}){return w.jsxs("div",{className:"option-group",children:[n?w.jsx("div",{className:"section-title",children:n}):null,w.jsx("div",{className:"option-row",children:l.map(r=>w.jsxs("button",{className:`option-btn${r.value===o?" active":""}`,style:r.color?{color:r.color}:void 0,onClick:()=>u(r.value),type:"button",children:[r.label,r.sub?w.jsxs(w.Fragment,{children:[w.jsx("br",{}),w.jsx("span",{className:"option-sub",children:r.sub})]}):null]},r.value))})]})}function no(n){return n.map(l=>({value:l.value,label:l.label,sub:l.sub}))}function e3(){const n=ht(d=>d.sizePreset),l=ht(d=>d.setSizePreset),o=ht(d=>d.customW),u=ht(d=>d.customH),r=ht(d=>d.setCustomSize),f=n==="custom";return w.jsxs("div",{className:"option-group",children:[w.jsx("div",{className:"section-title",children:"Size"}),w.jsx(Ln,{title:"",items:no(Nx),value:n,onChange:l}),w.jsx(Ln,{title:"",items:no(Mx),value:n,onChange:l}),w.jsx(Ln,{title:"",items:no(Ax),value:n,onChange:l}),w.jsx(Ln,{title:"",items:no(Tx),value:n,onChange:l}),w.jsx(Ln,{title:"",items:no(zx),value:n,onChange:l}),f?w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"option-row",children:[w.jsx("input",{type:"number",className:"custom-size-input",min:1024,max:3824,step:16,value:o,onChange:d=>r(parseInt(d.target.value)||1024,u),placeholder:"W"}),w.jsx("span",{style:{color:"var(--text-dim)",alignSelf:"center",fontFamily:"var(--mono)",fontSize:12},children:"x"}),w.jsx("input",{type:"number",className:"custom-size-input",min:1024,max:3824,step:16,value:u,onChange:d=>r(o,parseInt(d.target.value)||1024),placeholder:"H"})]}),w.jsx("div",{className:"size-hint",children:"Min 1024 per side, max 3824, multiples of 16, ratio ≤ 3:1"})]}):null]})}const n3={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 a3(n,l){return n3[n]?.[l]??0}function l3(){const n=ht(m=>m.provider),l=ht(m=>m.quality),u=ht(m=>m.getResolvedSize)(),r=n==="oauth",f=a3(l,u),d=r?"free":`~$${f.toFixed(3)}`,g=r?"var(--green)":void 0;return w.jsxs("div",{className:"cost-estimate",children:[w.jsx("span",{children:"Est. cost"}),w.jsx("span",{className:"price",style:g?{color:g}:void 0,children:d})]})}const i3=[{value:"low",label:"Low",sub:"fast"},{value:"medium",label:"Medium",sub:"balanced"},{value:"high",label:"High",sub:"best"}],o3=[{value:"png",label:"PNG"},{value:"jpeg",label:"JPEG"},{value:"webp",label:"WebP"}],u3=[{value:"low",label:"Low",sub:"less restrictive",color:"var(--amber)"},{value:"auto",label:"Auto",sub:"standard"}],s3=[{value:"1",label:"1"},{value:"2",label:"2"},{value:"4",label:"4"}];function r3(){const n=ht(S=>S.rightPanelOpen),l=ht(S=>S.toggleRightPanel),[o,u]=J.useState(typeof window<"u"?window.matchMedia("(max-width: 800px)").matches:!1);J.useEffect(()=>{if(typeof window>"u")return;const S=window.matchMedia("(max-width: 800px)"),_=()=>u(S.matches);return S.addEventListener("change",_),()=>S.removeEventListener("change",_)},[]);const r=o?n:!0,f=ht(S=>S.quality),d=ht(S=>S.setQuality),g=ht(S=>S.format),m=ht(S=>S.setFormat),h=ht(S=>S.moderation),v=ht(S=>S.setModeration),y=ht(S=>S.count),x=ht(S=>S.setCount);return w.jsxs(w.Fragment,{children:[o&&n?w.jsx("div",{className:"right-panel-backdrop",role:"button","aria-label":"Close settings",onClick:l}):null,w.jsxs("aside",{className:`right-panel${n?"":" collapsed"}${o&&r?" drawer-open":""}`,"aria-label":"Detail settings",children:[w.jsx("button",{type:"button",className:"right-panel-toggle","aria-expanded":n,"aria-controls":"right-panel-body",onClick:l,title:n?"Hide details":"Show details",children:o?n?"✕":"☰":n?"▶":"◀"}),w.jsxs("div",{id:"right-panel-body",className:"right-panel-body",hidden:!n,children:[w.jsx(t3,{}),w.jsx("div",{className:"section-title",children:"Details"}),w.jsx(Ln,{title:"Quality",items:i3,value:f,onChange:d}),w.jsx(e3,{}),w.jsx(Ln,{title:"Format",items:o3,value:g,onChange:m}),w.jsx(Ln,{title:"Moderation",items:u3,value:h,onChange:v}),w.jsx(Ln,{title:"Count",items:s3,value:String(y),onChange:S=>x(Number(S))}),w.jsx(l3,{})]})]})]})}function c3(){const n=ht(r=>r.toast),[l,o]=J.useState(!1);if(J.useEffect(()=>{if(!n)return;o(!0);const r=setTimeout(()=>o(!1),3e3);return()=>clearTimeout(r)},[n]),!n)return null;const u=["toast",l?"visible":"",n.error?"error":""].filter(Boolean).join(" ");return w.jsx("div",{className:u,children:n.message})}function f3(n){if(!n)return"Older";const l=new Date(n);if(Number.isNaN(l.getTime()))return"Older";const u=Math.floor((new Date().getTime()-l.getTime())/864e5);return u===0?"Today":u===1?"Yesterday":u<7?"This week":l.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}function d3(){const n=ht(h=>h.galleryOpen),l=ht(h=>h.closeGallery),o=ht(h=>h.history),u=ht(h=>h.selectHistory),r=ht(h=>h.currentImage),[f,d]=J.useState("");J.useEffect(()=>{if(!n)return;const h=v=>{v.key==="Escape"&&l()};return window.addEventListener("keydown",h),()=>window.removeEventListener("keydown",h)},[n,l]),J.useEffect(()=>{n||d("")},[n]);const g=J.useMemo(()=>{const h=f.trim().toLowerCase().normalize("NFC");return h?o.filter(v=>(v.prompt??"").toLowerCase().normalize("NFC").includes(h)||(v.filename??"").toLowerCase().normalize("NFC").includes(h)):o},[o,f]),m=J.useMemo(()=>{const h=new Map;for(const v of g){const y=f3(v.createdAt);h.has(y)||h.set(y,[]),h.get(y).push(v)}return Array.from(h.entries())},[g]);return n?w.jsx("div",{className:"gallery-backdrop",onClick:l,role:"presentation",children:w.jsxs("div",{className:"gallery",role:"dialog","aria-modal":"true","aria-label":"Image gallery",onClick:h=>h.stopPropagation(),children:[w.jsxs("div",{className:"gallery__header",children:[w.jsxs("div",{className:"gallery__title-row",children:[w.jsx("div",{className:"gallery__title",children:"Gallery"}),w.jsxs("div",{className:"gallery__meta",children:[g.length,f?` / ${o.length}`:""," images"]})]}),w.jsx("input",{type:"text",className:"gallery__search",placeholder:"Search prompt or filename…",value:f,onChange:h=>d(h.target.value),autoFocus:!0}),w.jsx("button",{type:"button",className:"gallery__close",onClick:l,"aria-label":"Close gallery",title:"Close (Esc)",children:"✕"})]}),w.jsx("div",{className:"gallery__scroll",children:g.length===0?w.jsx("div",{className:"gallery__empty",children:o.length===0?"No images yet. Generate something!":"No matches for that query."}):m.map(([h,v])=>w.jsxs("section",{className:"gallery__group",children:[w.jsxs("header",{className:"gallery__group-header",children:[w.jsx("span",{className:"gallery__group-label",children:h}),w.jsx("span",{className:"gallery__group-count",children:v.length})]}),w.jsx("div",{className:"gallery__grid",children:v.map((y,x)=>{const S=r?.image===y.image;return w.jsxs("button",{type:"button",className:`gallery__tile${S?" gallery__tile--active":""}`,onClick:()=>{u(y),l()},title:y.prompt??"",children:[w.jsx("img",{src:y.thumb||y.image,alt:y.prompt??"",loading:"lazy",decoding:"async"}),y.prompt&&w.jsx("div",{className:"gallery__caption",children:w.jsx("span",{className:"gallery__caption-text",children:y.prompt})})]},`${h}-${x}-${y.filename??x}`)})})]},h))})]})}):null}function h3(){const n=ht(f=>f.hydrateHistory),l=ht(f=>f.loadSessions),o=ht(f=>f.startInFlightPolling),u=ht(f=>f.reconcileInflight),r=ht(f=>f.syncFromStorage);return ht(f=>f.uiMode),J.useEffect(()=>{n(),l(),u(),o()},[n,l,u,o]),J.useEffect(()=>{const f=d=>{d.key&&(d.key==="ima2.inFlight"||d.key==="ima2.selectedFilename")&&r()};return window.addEventListener("storage",f),()=>window.removeEventListener("storage",f)},[r]),J.useEffect(()=>{const f=()=>{Ux(ht.getState)};return window.addEventListener("beforeunload",f),document.addEventListener("visibilitychange",f),()=>{window.removeEventListener("beforeunload",f),document.removeEventListener("visibilitychange",f)}},[]),w.jsxs(w.Fragment,{children:[w.jsxs("div",{className:"app",children:[w.jsx(Kx,{}),w.jsx(Jx,{}),w.jsx(r3,{})]}),w.jsx(c3,{}),w.jsx(d3,{})]})}cx.createRoot(document.getElementById("root")).render(w.jsx(J.StrictMode,{children:w.jsx(h3,{})}));
16
- //# sourceMappingURL=index-C7SQ3J8h.js.map