ima2-gen 1.0.6 → 1.0.7

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"]'))s(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"&&s(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 s(r){if(r.ep)return;r.ep=!0;const f=o(r);fetch(r.href,f)}})();function c0(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Pc={exports:{}},to={};var Bm;function cb(){if(Bm)return to;Bm=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.fragment");function o(s,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:s,key:d,ref:r!==void 0?r:null,props:f}}return to.Fragment=l,to.jsx=o,to.jsxs=o,to}var Um;function fb(){return Um||(Um=1,Pc.exports=cb()),Pc.exports}var _=fb(),ef={exports:{}},Se={};var qm;function db(){if(qm)return Se;qm=1;var n=Symbol.for("react.transitional.element"),l=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),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"),b=Symbol.iterator;function x(T){return T===null||typeof T!="object"?null:(T=b&&T[b]||T["@@iterator"],typeof T=="function"?T:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,N={};function M(T,j,ee){this.props=T,this.context=j,this.refs=N,this.updater=ee||w}M.prototype.isReactComponent={},M.prototype.setState=function(T,j){if(typeof T!="object"&&typeof T!="function"&&T!=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,T,j,"setState")},M.prototype.forceUpdate=function(T){this.updater.enqueueForceUpdate(this,T,"forceUpdate")};function D(){}D.prototype=M.prototype;function E(T,j,ee){this.props=T,this.context=j,this.refs=N,this.updater=ee||w}var z=E.prototype=new D;z.constructor=E,C(z,M.prototype),z.isPureReactComponent=!0;var G=Array.isArray;function q(){}var U={H:null,A:null,T:null,S:null},$=Object.prototype.hasOwnProperty;function F(T,j,ee){var ne=ee.ref;return{$$typeof:n,type:T,key:j,ref:ne!==void 0?ne:null,props:ee}}function Z(T,j){return F(T.type,j,T.props)}function Y(T){return typeof T=="object"&&T!==null&&T.$$typeof===n}function W(T){var j={"=":"=0",":":"=2"};return"$"+T.replace(/[=:]/g,function(ee){return j[ee]})}var le=/\/+/g;function O(T,j){return typeof T=="object"&&T!==null&&T.key!=null?W(""+T.key):j.toString(36)}function X(T){switch(T.status){case"fulfilled":return T.value;case"rejected":throw T.reason;default:switch(typeof T.status=="string"?T.then(q,q):(T.status="pending",T.then(function(j){T.status==="pending"&&(T.status="fulfilled",T.value=j)},function(j){T.status==="pending"&&(T.status="rejected",T.reason=j)})),T.status){case"fulfilled":return T.value;case"rejected":throw T.reason}}throw T}function A(T,j,ee,ne,re){var ce=typeof T;(ce==="undefined"||ce==="boolean")&&(T=null);var ue=!1;if(T===null)ue=!0;else switch(ce){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(T.$$typeof){case n:case l:ue=!0;break;case v:return ue=T._init,A(ue(T._payload),j,ee,ne,re)}}if(ue)return re=re(T),ue=ne===""?"."+O(T,0):ne,G(re)?(ee="",ue!=null&&(ee=ue.replace(le,"$&/")+"/"),A(re,j,ee,"",function(Ee){return Ee})):re!=null&&(Y(re)&&(re=Z(re,ee+(re.key==null||T&&T.key===re.key?"":(""+re.key).replace(le,"$&/")+"/")+ue)),j.push(re)),1;ue=0;var se=ne===""?".":ne+":";if(G(T))for(var fe=0;fe<T.length;fe++)ne=T[fe],ce=se+O(ne,fe),ue+=A(ne,j,ee,ce,re);else if(fe=x(T),typeof fe=="function")for(T=fe.call(T),fe=0;!(ne=T.next()).done;)ne=ne.value,ce=se+O(ne,fe++),ue+=A(ne,j,ee,ce,re);else if(ce==="object"){if(typeof T.then=="function")return A(X(T),j,ee,ne,re);throw j=String(T),Error("Objects are not valid as a React child (found: "+(j==="[object Object]"?"object with keys {"+Object.keys(T).join(", ")+"}":j)+"). If you meant to render a collection of children, use an array instead.")}return ue}function H(T,j,ee){if(T==null)return T;var ne=[],re=0;return A(T,ne,"","",function(ce){return j.call(ee,ce,re++)}),ne}function B(T){if(T._status===-1){var j=T._result;j=j(),j.then(function(ee){(T._status===0||T._status===-1)&&(T._status=1,T._result=ee)},function(ee){(T._status===0||T._status===-1)&&(T._status=2,T._result=ee)}),T._status===-1&&(T._status=0,T._result=j)}if(T._status===1)return T._result.default;throw T._result}var I=typeof reportError=="function"?reportError:function(T){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var j=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(j))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",T);return}console.error(T)},te={map:H,forEach:function(T,j,ee){H(T,function(){j.apply(this,arguments)},ee)},count:function(T){var j=0;return H(T,function(){j++}),j},toArray:function(T){return H(T,function(j){return j})||[]},only:function(T){if(!Y(T))throw Error("React.Children.only expected to receive a single React element child.");return T}};return Se.Activity=y,Se.Children=te,Se.Component=M,Se.Fragment=o,Se.Profiler=r,Se.PureComponent=E,Se.StrictMode=s,Se.Suspense=m,Se.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=U,Se.__COMPILER_RUNTIME={__proto__:null,c:function(T){return U.H.useMemoCache(T)}},Se.cache=function(T){return function(){return T.apply(null,arguments)}},Se.cacheSignal=function(){return null},Se.cloneElement=function(T,j,ee){if(T==null)throw Error("The argument must be a React element, but you passed "+T+".");var ne=C({},T.props),re=T.key;if(j!=null)for(ce in j.key!==void 0&&(re=""+j.key),j)!$.call(j,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&j.ref===void 0||(ne[ce]=j[ce]);var ce=arguments.length-2;if(ce===1)ne.children=ee;else if(1<ce){for(var ue=Array(ce),se=0;se<ce;se++)ue[se]=arguments[se+2];ne.children=ue}return F(T.type,re,ne)},Se.createContext=function(T){return T={$$typeof:d,_currentValue:T,_currentValue2:T,_threadCount:0,Provider:null,Consumer:null},T.Provider=T,T.Consumer={$$typeof:f,_context:T},T},Se.createElement=function(T,j,ee){var ne,re={},ce=null;if(j!=null)for(ne in j.key!==void 0&&(ce=""+j.key),j)$.call(j,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(re[ne]=j[ne]);var ue=arguments.length-2;if(ue===1)re.children=ee;else if(1<ue){for(var se=Array(ue),fe=0;fe<ue;fe++)se[fe]=arguments[fe+2];re.children=se}if(T&&T.defaultProps)for(ne in ue=T.defaultProps,ue)re[ne]===void 0&&(re[ne]=ue[ne]);return F(T,ce,re)},Se.createRef=function(){return{current:null}},Se.forwardRef=function(T){return{$$typeof:g,render:T}},Se.isValidElement=Y,Se.lazy=function(T){return{$$typeof:v,_payload:{_status:-1,_result:T},_init:B}},Se.memo=function(T,j){return{$$typeof:h,type:T,compare:j===void 0?null:j}},Se.startTransition=function(T){var j=U.T,ee={};U.T=ee;try{var ne=T(),re=U.S;re!==null&&re(ee,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(q,I)}catch(ce){I(ce)}finally{j!==null&&ee.types!==null&&(j.types=ee.types),U.T=j}},Se.unstable_useCacheRefresh=function(){return U.H.useCacheRefresh()},Se.use=function(T){return U.H.use(T)},Se.useActionState=function(T,j,ee){return U.H.useActionState(T,j,ee)},Se.useCallback=function(T,j){return U.H.useCallback(T,j)},Se.useContext=function(T){return U.H.useContext(T)},Se.useDebugValue=function(){},Se.useDeferredValue=function(T,j){return U.H.useDeferredValue(T,j)},Se.useEffect=function(T,j){return U.H.useEffect(T,j)},Se.useEffectEvent=function(T){return U.H.useEffectEvent(T)},Se.useId=function(){return U.H.useId()},Se.useImperativeHandle=function(T,j,ee){return U.H.useImperativeHandle(T,j,ee)},Se.useInsertionEffect=function(T,j){return U.H.useInsertionEffect(T,j)},Se.useLayoutEffect=function(T,j){return U.H.useLayoutEffect(T,j)},Se.useMemo=function(T,j){return U.H.useMemo(T,j)},Se.useOptimistic=function(T,j){return U.H.useOptimistic(T,j)},Se.useReducer=function(T,j,ee){return U.H.useReducer(T,j,ee)},Se.useRef=function(T){return U.H.useRef(T)},Se.useState=function(T){return U.H.useState(T)},Se.useSyncExternalStore=function(T,j,ee){return U.H.useSyncExternalStore(T,j,ee)},Se.useTransition=function(){return U.H.useTransition()},Se.version="19.2.5",Se}var Gm;function _o(){return Gm||(Gm=1,ef.exports=db()),ef.exports}var J=_o();const oo=c0(J);var tf={exports:{}},no={},nf={exports:{}},af={};var Ym;function hb(){return Ym||(Ym=1,(function(n){function l(A,H){var B=A.length;A.push(H);e:for(;0<B;){var I=B-1>>>1,te=A[I];if(0<r(te,H))A[I]=H,A[B]=te,B=I;else break e}}function o(A){return A.length===0?null:A[0]}function s(A){if(A.length===0)return null;var H=A[0],B=A.pop();if(B!==H){A[0]=B;e:for(var I=0,te=A.length,T=te>>>1;I<T;){var j=2*(I+1)-1,ee=A[j],ne=j+1,re=A[ne];if(0>r(ee,B))ne<te&&0>r(re,ee)?(A[I]=re,A[ne]=B,I=ne):(A[I]=ee,A[j]=B,I=j);else if(ne<te&&0>r(re,B))A[I]=re,A[ne]=B,I=ne;else break e}}return H}function r(A,H){var B=A.sortIndex-H.sortIndex;return B!==0?B:A.id-H.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;n.unstable_now=function(){return f.now()}}else{var d=Date,g=d.now();n.unstable_now=function(){return d.now()-g}}var m=[],h=[],v=1,y=null,b=3,x=!1,w=!1,C=!1,N=!1,M=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;function z(A){for(var H=o(h);H!==null;){if(H.callback===null)s(h);else if(H.startTime<=A)s(h),H.sortIndex=H.expirationTime,l(m,H);else break;H=o(h)}}function G(A){if(C=!1,z(A),!w)if(o(m)!==null)w=!0,q||(q=!0,W());else{var H=o(h);H!==null&&X(G,H.startTime-A)}}var q=!1,U=-1,$=5,F=-1;function Z(){return N?!0:!(n.unstable_now()-F<$)}function Y(){if(N=!1,q){var A=n.unstable_now();F=A;var H=!0;try{e:{w=!1,C&&(C=!1,D(U),U=-1),x=!0;var B=b;try{t:{for(z(A),y=o(m);y!==null&&!(y.expirationTime>A&&Z());){var I=y.callback;if(typeof I=="function"){y.callback=null,b=y.priorityLevel;var te=I(y.expirationTime<=A);if(A=n.unstable_now(),typeof te=="function"){y.callback=te,z(A),H=!0;break t}y===o(m)&&s(m),z(A)}else s(m);y=o(m)}if(y!==null)H=!0;else{var T=o(h);T!==null&&X(G,T.startTime-A),H=!1}}break e}finally{y=null,b=B,x=!1}H=void 0}}finally{H?W():q=!1}}}var W;if(typeof E=="function")W=function(){E(Y)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,O=le.port2;le.port1.onmessage=Y,W=function(){O.postMessage(null)}}else W=function(){M(Y,0)};function X(A,H){U=M(function(){A(n.unstable_now())},H)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(A){A.callback=null},n.unstable_forceFrameRate=function(A){0>A||125<A?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):$=0<A?Math.floor(1e3/A):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(A){switch(b){case 1:case 2:case 3:var H=3;break;default:H=b}var B=b;b=H;try{return A()}finally{b=B}},n.unstable_requestPaint=function(){N=!0},n.unstable_runWithPriority=function(A,H){switch(A){case 1:case 2:case 3:case 4:case 5:break;default:A=3}var B=b;b=A;try{return H()}finally{b=B}},n.unstable_scheduleCallback=function(A,H,B){var I=n.unstable_now();switch(typeof B=="object"&&B!==null?(B=B.delay,B=typeof B=="number"&&0<B?I+B:I):B=I,A){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=B+te,A={id:v++,callback:H,priorityLevel:A,startTime:B,expirationTime:te,sortIndex:-1},B>I?(A.sortIndex=B,l(h,A),o(m)===null&&A===o(h)&&(C?(D(U),U=-1):C=!0,X(G,B-I))):(A.sortIndex=te,l(m,A),w||x||(w=!0,q||(q=!0,W()))),A},n.unstable_shouldYield=Z,n.unstable_wrapCallback=function(A){var H=b;return function(){var B=b;b=H;try{return A.apply(this,arguments)}finally{b=B}}}})(af)),af}var Vm;function gb(){return Vm||(Vm=1,nf.exports=hb()),nf.exports}var lf={exports:{}},pt={};var Xm;function mb(){if(Xm)return pt;Xm=1;var n=_o();function l(m){var h="https://react.dev/errors/"+m;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var 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 s={d:{f:o,r:function(){throw Error(l(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},r=Symbol.for("react.portal");function 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 pt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,pt.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)},pt.flushSync=function(m){var h=d.T,v=s.p;try{if(d.T=null,s.p=2,m)return m()}finally{d.T=h,s.p=v,s.d.f()}},pt.preconnect=function(m,h){typeof m=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,s.d.C(m,h))},pt.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},pt.preinit=function(m,h){if(typeof m=="string"&&h&&typeof h.as=="string"){var v=h.as,y=g(v,h.crossOrigin),b=typeof h.integrity=="string"?h.integrity:void 0,x=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;v==="style"?s.d.S(m,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:y,integrity:b,fetchPriority:x}):v==="script"&&s.d.X(m,{crossOrigin:y,integrity:b,fetchPriority:x,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},pt.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);s.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&&s.d.M(m)},pt.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);s.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})}},pt.preloadModule=function(m,h){if(typeof m=="string")if(h){var v=g(h.as,h.crossOrigin);s.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 s.d.m(m)},pt.requestFormReset=function(m){s.d.r(m)},pt.unstable_batchedUpdates=function(m,h){return m(h)},pt.useFormState=function(m,h,v){return d.H.useFormState(m,h,v)},pt.useFormStatus=function(){return d.H.useHostTransitionStatus()},pt.version="19.2.5",pt}var Zm;function f0(){if(Zm)return lf.exports;Zm=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(),lf.exports=mb(),lf.exports}var Im;function pb(){if(Im)return no;Im=1;var n=gb(),l=_o(),o=f0();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function d(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function m(e){if(f(e)!==e)throw Error(s(188))}function h(e){var t=e.alternate;if(!t){if(t=f(e),t===null)throw Error(s(188));return t!==e?null:e}for(var a=e,i=t;;){var u=a.return;if(u===null)break;var c=u.alternate;if(c===null){if(i=u.return,i!==null){a=i;continue}break}if(u.child===c.child){for(c=u.child;c;){if(c===a)return m(u),e;if(c===i)return m(u),t;c=c.sibling}throw Error(s(188))}if(a.return!==i.return)a=u,i=c;else{for(var p=!1,S=u.child;S;){if(S===a){p=!0,a=u,i=c;break}if(S===i){p=!0,i=u,a=c;break}S=S.sibling}if(!p){for(S=c.child;S;){if(S===a){p=!0,a=c,i=u;break}if(S===i){p=!0,i=c,a=u;break}S=S.sibling}if(!p)throw Error(s(189))}}if(a.alternate!==i)throw Error(s(190))}if(a.tag!==3)throw Error(s(188));return a.stateNode.current===a?e:t}function v(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=v(e),t!==null)return t;e=e.sibling}return null}var y=Object.assign,b=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),E=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),U=Symbol.for("react.memo"),$=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),Z=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function W(e){return e===null||typeof e!="object"?null:(e=Y&&e[Y]||e["@@iterator"],typeof e=="function"?e:null)}var le=Symbol.for("react.client.reference");function O(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===le?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case C:return"Fragment";case M:return"Profiler";case N:return"StrictMode";case G:return"Suspense";case q:return"SuspenseList";case F:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case E:return e.displayName||"Context";case D:return(e._context.displayName||"Context")+".Consumer";case z:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case U:return t=e.displayName||null,t!==null?t:O(e.type)||"Memo";case $:t=e._payload,e=e._init;try{return O(e(t))}catch{}}return null}var X=Array.isArray,A=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B={pending:!1,data:null,method:null,action:null},I=[],te=-1;function T(e){return{current:e}}function j(e){0>te||(e.current=I[te],I[te]=null,te--)}function ee(e,t){te++,I[te]=e.current,e.current=t}var ne=T(null),re=T(null),ce=T(null),ue=T(null);function se(e,t){switch(ee(ce,t),ee(re,e),ee(ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?om(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=om(t),e=sm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}j(ne),ee(ne,e)}function fe(){j(ne),j(re),j(ce)}function Ee(e){e.memoizedState!==null&&ee(ue,e);var t=ne.current,a=sm(t,e.type);t!==a&&(ee(re,e),ee(ne,a))}function xe(e){re.current===e&&(j(ne),j(re)),ue.current===e&&(j(ue),Fi._currentValue=B)}var ye,be;function Te(e){if(ye===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);ye=t&&t[1]||"",be=-1<a.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+ye+e+be}var Ue=!1;function je(e,t){if(!e||Ue)return"";Ue=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var i={DetermineComponentFrameRoot:function(){try{if(t){var oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(P){var K=P}Reflect.construct(e,[],oe)}else{try{oe.call()}catch(P){K=P}e.call(oe.prototype)}}else{try{throw Error()}catch(P){K=P}(oe=e())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(P){if(P&&K&&typeof P.stack=="string")return[P.stack,K.stack]}return[null,null]}};i.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(i.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(i.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=i.DetermineComponentFrameRoot(),p=c[0],S=c[1];if(p&&S){var R=p.split(`
4
- `),k=S.split(`
5
- `);for(u=i=0;i<R.length&&!R[i].includes("DetermineComponentFrameRoot");)i++;for(;u<k.length&&!k[u].includes("DetermineComponentFrameRoot");)u++;if(i===R.length||u===k.length)for(i=R.length-1,u=k.length-1;1<=i&&0<=u&&R[i]!==k[u];)u--;for(;1<=i&&0<=u;i--,u--)if(R[i]!==k[u]){if(i!==1||u!==1)do if(i--,u--,0>u||R[i]!==k[u]){var ae=`
6
- `+R[i].replace(" at new "," at ");return e.displayName&&ae.includes("<anonymous>")&&(ae=ae.replace("<anonymous>",e.displayName)),ae}while(1<=i&&0<=u);break}}}finally{Ue=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?Te(a):""}function st(e,t){switch(e.tag){case 26:case 27:case 5:return Te(e.type);case 16:return Te("Lazy");case 13:return e.child!==t&&t!==null?Te("Suspense Fallback"):Te("Suspense");case 19:return Te("SuspenseList");case 0:case 15:return je(e.type,!1);case 11:return je(e.type.render,!1);case 1:return je(e.type,!0);case 31:return Te("Activity");default:return""}}function $t(e){try{var t="",a=null;do t+=st(e,a),a=e,e=e.return;while(e);return t}catch(i){return`
7
- Error generating stack: `+i.message+`
8
- `+i.stack}}var zt=Object.prototype.hasOwnProperty,Kt=n.unstable_scheduleCallback,yn=n.unstable_cancelCallback,wa=n.unstable_shouldYield,Na=n.unstable_requestPaint,ct=n.unstable_now,ll=n.unstable_getCurrentPriorityLevel,vn=n.unstable_ImmediatePriority,In=n.unstable_UserBlockingPriority,Aa=n.unstable_NormalPriority,Lr=n.unstable_LowPriority,il=n.unstable_IdlePriority,Br=n.log,Ur=n.unstable_setDisableYieldValue,Ta=null,yt=null;function on(e){if(typeof Br=="function"&&Ur(e),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(Ta,e)}catch{}}var vt=Math.clz32?Math.clz32:Yr,qr=Math.log,Gr=Math.LN2;function Yr(e){return e>>>=0,e===0?32:31-(qr(e)/Gr|0)|0}var ol=256,sl=262144,rl=4194304;function bn(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ul(e,t,a){var i=e.pendingLanes;if(i===0)return 0;var u=0,c=e.suspendedLanes,p=e.pingedLanes;e=e.warmLanes;var S=i&134217727;return S!==0?(i=S&~c,i!==0?u=bn(i):(p&=S,p!==0?u=bn(p):a||(a=S&~e,a!==0&&(u=bn(a))))):(S=i&~c,S!==0?u=bn(S):p!==0?u=bn(p):a||(a=i&~e,a!==0&&(u=bn(a)))),u===0?0:t!==0&&t!==u&&(t&c)===0&&(c=u&-u,a=t&-t,c>=a||c===32&&(a&4194048)!==0)?t:u}function Ma(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Vr(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Co(){var e=rl;return rl<<=1,(rl&62914560)===0&&(rl=4194304),e}function ri(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ca(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Xr(e,t,a,i,u,c){var p=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var S=e.entanglements,R=e.expirationTimes,k=e.hiddenUpdates;for(a=p&~a;0<a;){var ae=31-vt(a),oe=1<<ae;S[ae]=0,R[ae]=-1;var K=k[ae];if(K!==null)for(k[ae]=null,ae=0;ae<K.length;ae++){var P=K[ae];P!==null&&(P.lane&=-536870913)}a&=~oe}i!==0&&zo(e,i,0),c!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=c&~(p&~t))}function zo(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var i=31-vt(t);e.entangledLanes|=t,e.entanglements[i]=e.entanglements[i]|1073741824|a&261930}function Do(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var i=31-vt(a),u=1<<i;u&t|e[i]&t&&(e[i]|=t),a&=~u}}function Oo(e,t){var a=t&-t;return a=(a&42)!==0?1:ui(a),(a&(e.suspendedLanes|t))!==0?0:a}function ui(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function ci(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ro(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:zm(e.type))}function Ho(e,t){var a=H.p;try{return H.p=e,t()}finally{H.p=a}}var sn=Math.random().toString(36).slice(2),it="__reactFiber$"+sn,mt="__reactProps$"+sn,Sn="__reactContainer$"+sn,cl="__reactEvents$"+sn,jo="__reactListeners$"+sn,Zr="__reactHandles$"+sn,Lo="__reactResources$"+sn,za="__reactMarker$"+sn;function fi(e){delete e[it],delete e[mt],delete e[cl],delete e[jo],delete e[Zr]}function Qn(e){var t=e[it];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Sn]||a[it]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=gm(e);e!==null;){if(a=e[it])return a;e=gm(e)}return t}e=a,a=e.parentNode}return null}function kn(e){if(e=e[it]||e[Sn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function $n(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Kn(e){var t=e[Lo];return t||(t=e[Lo]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Pe(e){e[za]=!0}var Bo=new Set,Uo={};function xn(e,t){Jn(e,t),Jn(e+"Capture",t)}function Jn(e,t){for(Uo[e]=t,e=0;e<t.length;e++)Bo.add(t[e])}var Ir=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]*$"),di={},qo={};function Qr(e){return zt.call(qo,e)?!0:zt.call(di,e)?!1:Ir.test(e)?qo[e]=!0:(di[e]=!0,!1)}function fl(e,t,a){if(Qr(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var i=t.toLowerCase().slice(0,5);if(i!=="data-"&&i!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function dl(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function Jt(e,t,a,i){if(i===null)e.removeAttribute(a);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+i)}}function St(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Go(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function kr(e,t,a){var i=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var u=i.get,c=i.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(p){a=""+p,c.call(this,p)}}),Object.defineProperty(e,t,{enumerable:i.enumerable}),{getValue:function(){return a},setValue:function(p){a=""+p},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function hl(e){if(!e._valueTracker){var t=Go(e)?"checked":"value";e._valueTracker=kr(e,t,""+e[t])}}function Yo(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),i="";return e&&(i=Go(e)?e.checked?"true":"false":e.value),e=i,e!==a?(t.setValue(e),!0):!1}function Da(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var $r=/[\n"\\]/g;function xt(e){return e.replace($r,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Oa(e,t,a,i,u,c,p,S){e.name="",p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.type=p:e.removeAttribute("type"),t!=null?p==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+St(t)):e.value!==""+St(t)&&(e.value=""+St(t)):p!=="submit"&&p!=="reset"||e.removeAttribute("value"),t!=null?hi(e,p,St(t)):a!=null?hi(e,p,St(a)):i!=null&&e.removeAttribute("value"),u==null&&c!=null&&(e.defaultChecked=!!c),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+St(S):e.removeAttribute("name")}function Vo(e,t,a,i,u,c,p,S){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||a!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){hl(e);return}a=a!=null?""+St(a):"",t=t!=null?""+St(t):a,S||t===e.value||(e.value=t),e.defaultValue=t}i=i??u,i=typeof i!="function"&&typeof i!="symbol"&&!!i,e.checked=S?e.checked:!!i,e.defaultChecked=!!i,p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"&&(e.name=p),hl(e)}function hi(e,t,a){t==="number"&&Da(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function _n(e,t,a,i){if(e=e.options,t){t={};for(var u=0;u<a.length;u++)t["$"+a[u]]=!0;for(a=0;a<e.length;a++)u=t.hasOwnProperty("$"+e[a].value),e[a].selected!==u&&(e[a].selected=u),u&&i&&(e[a].defaultSelected=!0)}else{for(a=""+St(a),t=null,u=0;u<e.length;u++){if(e[u].value===a){e[u].selected=!0,i&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function td(e,t,a){if(t!=null&&(t=""+St(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+St(a):""}function nd(e,t,a,i){if(t==null){if(i!=null){if(a!=null)throw Error(s(92));if(X(i)){if(1<i.length)throw Error(s(93));i=i[0]}a=i}a==null&&(a=""),t=a}a=St(t),e.defaultValue=a,i=e.textContent,i===a&&i!==""&&i!==null&&(e.value=i),hl(e)}function gl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var iv=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 ad(e,t,a){var i=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?i?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":i?e.setProperty(t,a):typeof a!="number"||a===0||iv.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function ld(e,t,a){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,a!=null){for(var i in a)!a.hasOwnProperty(i)||t!=null&&t.hasOwnProperty(i)||(i.indexOf("--")===0?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="");for(var u in t)i=t[u],t.hasOwnProperty(u)&&a[u]!==i&&ad(e,u,i)}else for(var c in t)t.hasOwnProperty(c)&&ad(e,c,t[c])}function Kr(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ov=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"]]),sv=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Xo(e){return sv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function En(){}var Jr=null;function Fr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ml=null,pl=null;function id(e){var t=kn(e);if(t&&(e=t.stateNode)){var a=e[mt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Oa(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+xt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var i=a[t];if(i!==e&&i.form===e.form){var u=i[mt]||null;if(!u)throw Error(s(90));Oa(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<a.length;t++)i=a[t],i.form===e.form&&Yo(i)}break e;case"textarea":td(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&_n(e,!!a.multiple,t,!1)}}}var Wr=!1;function od(e,t,a){if(Wr)return e(t,a);Wr=!0;try{var i=e(t);return i}finally{if(Wr=!1,(ml!==null||pl!==null)&&(zs(),ml&&(t=ml,e=pl,pl=ml=null,id(t),e)))for(t=0;t<e.length;t++)id(e[t])}}function gi(e,t){var a=e.stateNode;if(a===null)return null;var i=a[mt]||null;if(i===null)return null;a=i[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(i=!i.disabled)||(e=e.type,i=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!i;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(s(231,t,typeof a));return a}var wn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Pr=!1;if(wn)try{var mi={};Object.defineProperty(mi,"passive",{get:function(){Pr=!0}}),window.addEventListener("test",mi,mi),window.removeEventListener("test",mi,mi)}catch{Pr=!1}var Fn=null,eu=null,Zo=null;function sd(){if(Zo)return Zo;var e,t=eu,a=t.length,i,u="value"in Fn?Fn.value:Fn.textContent,c=u.length;for(e=0;e<a&&t[e]===u[e];e++);var p=a-e;for(i=1;i<=p&&t[a-i]===u[c-i];i++);return Zo=u.slice(e,1<i?1-i:void 0)}function Io(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Qo(){return!0}function rd(){return!1}function _t(e){function t(a,i,u,c,p){this._reactName=a,this._targetInst=u,this.type=i,this.nativeEvent=c,this.target=p,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(a=e[S],this[S]=a?a(c):c[S]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Qo:rd,this.isPropagationStopped=rd,this}return y(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Qo)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Qo)},persist:function(){},isPersistent:Qo}),t}var Ra={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ko=_t(Ra),pi=y({},Ra,{view:0,detail:0}),rv=_t(pi),tu,nu,yi,$o=y({},pi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:lu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==yi&&(yi&&e.type==="mousemove"?(tu=e.screenX-yi.screenX,nu=e.screenY-yi.screenY):nu=tu=0,yi=e),tu)},movementY:function(e){return"movementY"in e?e.movementY:nu}}),ud=_t($o),uv=y({},$o,{dataTransfer:0}),cv=_t(uv),fv=y({},pi,{relatedTarget:0}),au=_t(fv),dv=y({},Ra,{animationName:0,elapsedTime:0,pseudoElement:0}),hv=_t(dv),gv=y({},Ra,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),mv=_t(gv),pv=y({},Ra,{data:0}),cd=_t(pv),yv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},vv={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"},bv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Sv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=bv[e])?!!t[e]:!1}function lu(){return Sv}var xv=y({},pi,{key:function(e){if(e.key){var t=yv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Io(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?vv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:lu,charCode:function(e){return e.type==="keypress"?Io(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Io(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),_v=_t(xv),Ev=y({},$o,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),fd=_t(Ev),wv=y({},pi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:lu}),Nv=_t(wv),Av=y({},Ra,{propertyName:0,elapsedTime:0,pseudoElement:0}),Tv=_t(Av),Mv=y({},$o,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Cv=_t(Mv),zv=y({},Ra,{newState:0,oldState:0}),Dv=_t(zv),Ov=[9,13,27,32],iu=wn&&"CompositionEvent"in window,vi=null;wn&&"documentMode"in document&&(vi=document.documentMode);var Rv=wn&&"TextEvent"in window&&!vi,dd=wn&&(!iu||vi&&8<vi&&11>=vi),hd=" ",gd=!1;function md(e,t){switch(e){case"keyup":return Ov.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function pd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yl=!1;function Hv(e,t){switch(e){case"compositionend":return pd(t);case"keypress":return t.which!==32?null:(gd=!0,hd);case"textInput":return e=t.data,e===hd&&gd?null:e;default:return null}}function jv(e,t){if(yl)return e==="compositionend"||!iu&&md(e,t)?(e=sd(),Zo=eu=Fn=null,yl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return dd&&t.locale!=="ko"?null:t.data;default:return null}}var Lv={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 yd(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Lv[e.type]:t==="textarea"}function vd(e,t,a,i){ml?pl?pl.push(i):pl=[i]:ml=i,t=Bs(t,"onChange"),0<t.length&&(a=new ko("onChange","change",null,a,i),e.push({event:a,listeners:t}))}var bi=null,Si=null;function Bv(e){em(e,0)}function Ko(e){var t=$n(e);if(Yo(t))return e}function bd(e,t){if(e==="change")return t}var Sd=!1;if(wn){var ou;if(wn){var su="oninput"in document;if(!su){var xd=document.createElement("div");xd.setAttribute("oninput","return;"),su=typeof xd.oninput=="function"}ou=su}else ou=!1;Sd=ou&&(!document.documentMode||9<document.documentMode)}function _d(){bi&&(bi.detachEvent("onpropertychange",Ed),Si=bi=null)}function Ed(e){if(e.propertyName==="value"&&Ko(Si)){var t=[];vd(t,Si,e,Fr(e)),od(Bv,t)}}function Uv(e,t,a){e==="focusin"?(_d(),bi=t,Si=a,bi.attachEvent("onpropertychange",Ed)):e==="focusout"&&_d()}function qv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ko(Si)}function Gv(e,t){if(e==="click")return Ko(t)}function Yv(e,t){if(e==="input"||e==="change")return Ko(t)}function Vv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Dt=typeof Object.is=="function"?Object.is:Vv;function xi(e,t){if(Dt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;for(i=0;i<a.length;i++){var u=a[i];if(!zt.call(t,u)||!Dt(e[u],t[u]))return!1}return!0}function wd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Nd(e,t){var a=wd(e);e=0;for(var i;a;){if(a.nodeType===3){if(i=e+a.textContent.length,e<=t&&i>=t)return{node:a,offset:t-e};e=i}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=wd(a)}}function Ad(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ad(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Td(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Da(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Da(e.document)}return t}function ru(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Xv=wn&&"documentMode"in document&&11>=document.documentMode,vl=null,uu=null,_i=null,cu=!1;function Md(e,t,a){var i=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;cu||vl==null||vl!==Da(i)||(i=vl,"selectionStart"in i&&ru(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}),_i&&xi(_i,i)||(_i=i,i=Bs(uu,"onSelect"),0<i.length&&(t=new ko("onSelect","select",null,t,a),e.push({event:t,listeners:i}),t.target=vl)))}function Ha(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var bl={animationend:Ha("Animation","AnimationEnd"),animationiteration:Ha("Animation","AnimationIteration"),animationstart:Ha("Animation","AnimationStart"),transitionrun:Ha("Transition","TransitionRun"),transitionstart:Ha("Transition","TransitionStart"),transitioncancel:Ha("Transition","TransitionCancel"),transitionend:Ha("Transition","TransitionEnd")},fu={},Cd={};wn&&(Cd=document.createElement("div").style,"AnimationEvent"in window||(delete bl.animationend.animation,delete bl.animationiteration.animation,delete bl.animationstart.animation),"TransitionEvent"in window||delete bl.transitionend.transition);function ja(e){if(fu[e])return fu[e];if(!bl[e])return e;var t=bl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Cd)return fu[e]=t[a];return e}var zd=ja("animationend"),Dd=ja("animationiteration"),Od=ja("animationstart"),Zv=ja("transitionrun"),Iv=ja("transitionstart"),Qv=ja("transitioncancel"),Rd=ja("transitionend"),Hd=new Map,du="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(" ");du.push("scrollEnd");function Ft(e,t){Hd.set(e,t),xn(t,[e])}var Jo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Gt=[],Sl=0,hu=0;function Fo(){for(var e=Sl,t=hu=Sl=0;t<e;){var a=Gt[t];Gt[t++]=null;var i=Gt[t];Gt[t++]=null;var u=Gt[t];Gt[t++]=null;var c=Gt[t];if(Gt[t++]=null,i!==null&&u!==null){var p=i.pending;p===null?u.next=u:(u.next=p.next,p.next=u),i.pending=u}c!==0&&jd(a,u,c)}}function Wo(e,t,a,i){Gt[Sl++]=e,Gt[Sl++]=t,Gt[Sl++]=a,Gt[Sl++]=i,hu|=i,e.lanes|=i,e=e.alternate,e!==null&&(e.lanes|=i)}function gu(e,t,a,i){return Wo(e,t,a,i),Po(e)}function La(e,t){return Wo(e,null,null,t),Po(e)}function jd(e,t,a){e.lanes|=a;var i=e.alternate;i!==null&&(i.lanes|=a);for(var u=!1,c=e.return;c!==null;)c.childLanes|=a,i=c.alternate,i!==null&&(i.childLanes|=a),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(u=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,u&&t!==null&&(u=31-vt(a),e=c.hiddenUpdates,i=e[u],i===null?e[u]=[t]:i.push(t),t.lane=a|536870912),c):null}function Po(e){if(50<Zi)throw Zi=0,Ec=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var xl={};function kv(e,t,a,i){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=i,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ot(e,t,a,i){return new kv(e,t,a,i)}function mu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Nn(e,t){var a=e.alternate;return a===null?(a=Ot(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function Ld(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function es(e,t,a,i,u,c){var p=0;if(i=e,typeof e=="function")mu(e)&&(p=1);else if(typeof e=="string")p=W1(e,a,ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case F:return e=Ot(31,a,t,u),e.elementType=F,e.lanes=c,e;case C:return Ba(a.children,u,c,t);case N:p=8,u|=24;break;case M:return e=Ot(12,a,t,u|2),e.elementType=M,e.lanes=c,e;case G:return e=Ot(13,a,t,u),e.elementType=G,e.lanes=c,e;case q:return e=Ot(19,a,t,u),e.elementType=q,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case E:p=10;break e;case D:p=9;break e;case z:p=11;break e;case U:p=14;break e;case $:p=16,i=null;break e}p=29,a=Error(s(130,e===null?"null":typeof e,"")),i=null}return t=Ot(p,a,t,u),t.elementType=e,t.type=i,t.lanes=c,t}function Ba(e,t,a,i){return e=Ot(7,e,i,t),e.lanes=a,e}function pu(e,t,a){return e=Ot(6,e,null,t),e.lanes=a,e}function Bd(e){var t=Ot(18,null,null,0);return t.stateNode=e,t}function yu(e,t,a){return t=Ot(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ud=new WeakMap;function Yt(e,t){if(typeof e=="object"&&e!==null){var a=Ud.get(e);return a!==void 0?a:(t={value:e,source:t,stack:$t(t)},Ud.set(e,t),t)}return{value:e,source:t,stack:$t(t)}}var _l=[],El=0,ts=null,Ei=0,Vt=[],Xt=0,Wn=null,rn=1,un="";function An(e,t){_l[El++]=Ei,_l[El++]=ts,ts=e,Ei=t}function qd(e,t,a){Vt[Xt++]=rn,Vt[Xt++]=un,Vt[Xt++]=Wn,Wn=e;var i=rn;e=un;var u=32-vt(i)-1;i&=~(1<<u),a+=1;var c=32-vt(t)+u;if(30<c){var p=u-u%5;c=(i&(1<<p)-1).toString(32),i>>=p,u-=p,rn=1<<32-vt(t)+u|a<<u|i,un=c+e}else rn=1<<c|a<<u|i,un=e}function vu(e){e.return!==null&&(An(e,1),qd(e,1,0))}function bu(e){for(;e===ts;)ts=_l[--El],_l[El]=null,Ei=_l[--El],_l[El]=null;for(;e===Wn;)Wn=Vt[--Xt],Vt[Xt]=null,un=Vt[--Xt],Vt[Xt]=null,rn=Vt[--Xt],Vt[Xt]=null}function Gd(e,t){Vt[Xt++]=rn,Vt[Xt++]=un,Vt[Xt++]=Wn,rn=t.id,un=t.overflow,Wn=e}var ft=null,Xe=null,ze=!1,Pn=null,Zt=!1,Su=Error(s(519));function ea(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw wi(Yt(t,e)),Su}function Yd(e){var t=e.stateNode,a=e.type,i=e.memoizedProps;switch(t[it]=e,t[mt]=i,a){case"dialog":Ae("cancel",t),Ae("close",t);break;case"iframe":case"object":case"embed":Ae("load",t);break;case"video":case"audio":for(a=0;a<Qi.length;a++)Ae(Qi[a],t);break;case"source":Ae("error",t);break;case"img":case"image":case"link":Ae("error",t),Ae("load",t);break;case"details":Ae("toggle",t);break;case"input":Ae("invalid",t),Vo(t,i.value,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name,!0);break;case"select":Ae("invalid",t);break;case"textarea":Ae("invalid",t),nd(t,i.value,i.defaultValue,i.children)}a=i.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||i.suppressHydrationWarning===!0||lm(t.textContent,a)?(i.popover!=null&&(Ae("beforetoggle",t),Ae("toggle",t)),i.onScroll!=null&&Ae("scroll",t),i.onScrollEnd!=null&&Ae("scrollend",t),i.onClick!=null&&(t.onclick=En),t=!0):t=!1,t||ea(e,!0)}function Vd(e){for(ft=e.return;ft;)switch(ft.tag){case 5:case 31:case 13:Zt=!1;return;case 27:case 3:Zt=!0;return;default:ft=ft.return}}function wl(e){if(e!==ft)return!1;if(!ze)return Vd(e),ze=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Uc(e.type,e.memoizedProps)),a=!a),a&&Xe&&ea(e),Vd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Xe=hm(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));Xe=hm(e)}else t===27?(t=Xe,ga(e.type)?(e=Xc,Xc=null,Xe=e):Xe=t):Xe=ft?Qt(e.stateNode.nextSibling):null;return!0}function Ua(){Xe=ft=null,ze=!1}function xu(){var e=Pn;return e!==null&&(At===null?At=e:At.push.apply(At,e),Pn=null),e}function wi(e){Pn===null?Pn=[e]:Pn.push(e)}var _u=T(null),qa=null,Tn=null;function ta(e,t,a){ee(_u,t._currentValue),t._currentValue=a}function Mn(e){e._currentValue=_u.current,j(_u)}function Eu(e,t,a){for(;e!==null;){var i=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,i!==null&&(i.childLanes|=t)):i!==null&&(i.childLanes&t)!==t&&(i.childLanes|=t),e===a)break;e=e.return}}function wu(e,t,a,i){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var c=u.dependencies;if(c!==null){var p=u.child;c=c.firstContext;e:for(;c!==null;){var S=c;c=u;for(var R=0;R<t.length;R++)if(S.context===t[R]){c.lanes|=a,S=c.alternate,S!==null&&(S.lanes|=a),Eu(c.return,a,e),i||(p=null);break e}c=S.next}}else if(u.tag===18){if(p=u.return,p===null)throw Error(s(341));p.lanes|=a,c=p.alternate,c!==null&&(c.lanes|=a),Eu(p,a,e),p=null}else p=u.child;if(p!==null)p.return=u;else for(p=u;p!==null;){if(p===e){p=null;break}if(u=p.sibling,u!==null){u.return=p.return,p=u;break}p=p.return}u=p}}function Nl(e,t,a,i){e=null;for(var u=t,c=!1;u!==null;){if(!c){if((u.flags&524288)!==0)c=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var p=u.alternate;if(p===null)throw Error(s(387));if(p=p.memoizedProps,p!==null){var S=u.type;Dt(u.pendingProps.value,p.value)||(e!==null?e.push(S):e=[S])}}else if(u===ue.current){if(p=u.alternate,p===null)throw Error(s(387));p.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(Fi):e=[Fi])}u=u.return}e!==null&&wu(t,e,a,i),t.flags|=262144}function ns(e){for(e=e.firstContext;e!==null;){if(!Dt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ga(e){qa=e,Tn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function dt(e){return Xd(qa,e)}function as(e,t){return qa===null&&Ga(e),Xd(e,t)}function Xd(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Tn===null){if(e===null)throw Error(s(308));Tn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Tn=Tn.next=t;return a}var $v=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,i){e.push(i)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Kv=n.unstable_scheduleCallback,Jv=n.unstable_NormalPriority,et={$$typeof:E,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Nu(){return{controller:new $v,data:new Map,refCount:0}}function Ni(e){e.refCount--,e.refCount===0&&Kv(Jv,function(){e.controller.abort()})}var Ai=null,Au=0,Al=0,Tl=null;function Fv(e,t){if(Ai===null){var a=Ai=[];Au=0,Al=Cc(),Tl={status:"pending",value:void 0,then:function(i){a.push(i)}}}return Au++,t.then(Zd,Zd),t}function Zd(){if(--Au===0&&Ai!==null){Tl!==null&&(Tl.status="fulfilled");var e=Ai;Ai=null,Al=0,Tl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wv(e,t){var a=[],i={status:"pending",value:null,reason:null,then:function(u){a.push(u)}};return e.then(function(){i.status="fulfilled",i.value=t;for(var u=0;u<a.length;u++)(0,a[u])(t)},function(u){for(i.status="rejected",i.reason=u,u=0;u<a.length;u++)(0,a[u])(void 0)}),i}var Id=A.S;A.S=function(e,t){Mg=ct(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Fv(e,t),Id!==null&&Id(e,t)};var Ya=T(null);function Tu(){var e=Ya.current;return e!==null?e:Ve.pooledCache}function ls(e,t){t===null?ee(Ya,Ya.current):ee(Ya,t.pool)}function Qd(){var e=Tu();return e===null?null:{parent:et._currentValue,pool:e}}var Ml=Error(s(460)),Mu=Error(s(474)),is=Error(s(542)),os={then:function(){}};function kd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function $d(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(En,En),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Jd(e),e;default:if(typeof t.status=="string")t.then(En,En);else{if(e=Ve,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(i){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=i}},function(i){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=i}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Jd(e),e}throw Xa=t,Ml}}function Va(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Xa=a,Ml):a}}var Xa=null;function Kd(){if(Xa===null)throw Error(s(459));var e=Xa;return Xa=null,e}function Jd(e){if(e===Ml||e===is)throw Error(s(483))}var Cl=null,Ti=0;function ss(e){var t=Ti;return Ti+=1,Cl===null&&(Cl=[]),$d(Cl,e,t)}function Mi(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function rs(e,t){throw t.$$typeof===b?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Fd(e){function t(V,L){if(e){var Q=V.deletions;Q===null?(V.deletions=[L],V.flags|=16):Q.push(L)}}function a(V,L){if(!e)return null;for(;L!==null;)t(V,L),L=L.sibling;return null}function i(V){for(var L=new Map;V!==null;)V.key!==null?L.set(V.key,V):L.set(V.index,V),V=V.sibling;return L}function u(V,L){return V=Nn(V,L),V.index=0,V.sibling=null,V}function c(V,L,Q){return V.index=Q,e?(Q=V.alternate,Q!==null?(Q=Q.index,Q<L?(V.flags|=67108866,L):Q):(V.flags|=67108866,L)):(V.flags|=1048576,L)}function p(V){return e&&V.alternate===null&&(V.flags|=67108866),V}function S(V,L,Q,ie){return L===null||L.tag!==6?(L=pu(Q,V.mode,ie),L.return=V,L):(L=u(L,Q),L.return=V,L)}function R(V,L,Q,ie){var pe=Q.type;return pe===C?ae(V,L,Q.props.children,ie,Q.key):L!==null&&(L.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===$&&Va(pe)===L.type)?(L=u(L,Q.props),Mi(L,Q),L.return=V,L):(L=es(Q.type,Q.key,Q.props,null,V.mode,ie),Mi(L,Q),L.return=V,L)}function k(V,L,Q,ie){return L===null||L.tag!==4||L.stateNode.containerInfo!==Q.containerInfo||L.stateNode.implementation!==Q.implementation?(L=yu(Q,V.mode,ie),L.return=V,L):(L=u(L,Q.children||[]),L.return=V,L)}function ae(V,L,Q,ie,pe){return L===null||L.tag!==7?(L=Ba(Q,V.mode,ie,pe),L.return=V,L):(L=u(L,Q),L.return=V,L)}function oe(V,L,Q){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=pu(""+L,V.mode,Q),L.return=V,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case x:return Q=es(L.type,L.key,L.props,null,V.mode,Q),Mi(Q,L),Q.return=V,Q;case w:return L=yu(L,V.mode,Q),L.return=V,L;case $:return L=Va(L),oe(V,L,Q)}if(X(L)||W(L))return L=Ba(L,V.mode,Q,null),L.return=V,L;if(typeof L.then=="function")return oe(V,ss(L),Q);if(L.$$typeof===E)return oe(V,as(V,L),Q);rs(V,L)}return null}function K(V,L,Q,ie){var pe=L!==null?L.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return pe!==null?null:S(V,L,""+Q,ie);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case x:return Q.key===pe?R(V,L,Q,ie):null;case w:return Q.key===pe?k(V,L,Q,ie):null;case $:return Q=Va(Q),K(V,L,Q,ie)}if(X(Q)||W(Q))return pe!==null?null:ae(V,L,Q,ie,null);if(typeof Q.then=="function")return K(V,L,ss(Q),ie);if(Q.$$typeof===E)return K(V,L,as(V,Q),ie);rs(V,Q)}return null}function P(V,L,Q,ie,pe){if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return V=V.get(Q)||null,S(L,V,""+ie,pe);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case x:return V=V.get(ie.key===null?Q:ie.key)||null,R(L,V,ie,pe);case w:return V=V.get(ie.key===null?Q:ie.key)||null,k(L,V,ie,pe);case $:return ie=Va(ie),P(V,L,Q,ie,pe)}if(X(ie)||W(ie))return V=V.get(Q)||null,ae(L,V,ie,pe,null);if(typeof ie.then=="function")return P(V,L,Q,ss(ie),pe);if(ie.$$typeof===E)return P(V,L,Q,as(L,ie),pe);rs(L,ie)}return null}function he(V,L,Q,ie){for(var pe=null,Oe=null,ge=L,we=L=0,Ce=null;ge!==null&&we<Q.length;we++){ge.index>we?(Ce=ge,ge=null):Ce=ge.sibling;var Re=K(V,ge,Q[we],ie);if(Re===null){ge===null&&(ge=Ce);break}e&&ge&&Re.alternate===null&&t(V,ge),L=c(Re,L,we),Oe===null?pe=Re:Oe.sibling=Re,Oe=Re,ge=Ce}if(we===Q.length)return a(V,ge),ze&&An(V,we),pe;if(ge===null){for(;we<Q.length;we++)ge=oe(V,Q[we],ie),ge!==null&&(L=c(ge,L,we),Oe===null?pe=ge:Oe.sibling=ge,Oe=ge);return ze&&An(V,we),pe}for(ge=i(ge);we<Q.length;we++)Ce=P(ge,V,we,Q[we],ie),Ce!==null&&(e&&Ce.alternate!==null&&ge.delete(Ce.key===null?we:Ce.key),L=c(Ce,L,we),Oe===null?pe=Ce:Oe.sibling=Ce,Oe=Ce);return e&&ge.forEach(function(ba){return t(V,ba)}),ze&&An(V,we),pe}function ve(V,L,Q,ie){if(Q==null)throw Error(s(151));for(var pe=null,Oe=null,ge=L,we=L=0,Ce=null,Re=Q.next();ge!==null&&!Re.done;we++,Re=Q.next()){ge.index>we?(Ce=ge,ge=null):Ce=ge.sibling;var ba=K(V,ge,Re.value,ie);if(ba===null){ge===null&&(ge=Ce);break}e&&ge&&ba.alternate===null&&t(V,ge),L=c(ba,L,we),Oe===null?pe=ba:Oe.sibling=ba,Oe=ba,ge=Ce}if(Re.done)return a(V,ge),ze&&An(V,we),pe;if(ge===null){for(;!Re.done;we++,Re=Q.next())Re=oe(V,Re.value,ie),Re!==null&&(L=c(Re,L,we),Oe===null?pe=Re:Oe.sibling=Re,Oe=Re);return ze&&An(V,we),pe}for(ge=i(ge);!Re.done;we++,Re=Q.next())Re=P(ge,V,we,Re.value,ie),Re!==null&&(e&&Re.alternate!==null&&ge.delete(Re.key===null?we:Re.key),L=c(Re,L,we),Oe===null?pe=Re:Oe.sibling=Re,Oe=Re);return e&&ge.forEach(function(ub){return t(V,ub)}),ze&&An(V,we),pe}function Ye(V,L,Q,ie){if(typeof Q=="object"&&Q!==null&&Q.type===C&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case x:e:{for(var pe=Q.key;L!==null;){if(L.key===pe){if(pe=Q.type,pe===C){if(L.tag===7){a(V,L.sibling),ie=u(L,Q.props.children),ie.return=V,V=ie;break e}}else if(L.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===$&&Va(pe)===L.type){a(V,L.sibling),ie=u(L,Q.props),Mi(ie,Q),ie.return=V,V=ie;break e}a(V,L);break}else t(V,L);L=L.sibling}Q.type===C?(ie=Ba(Q.props.children,V.mode,ie,Q.key),ie.return=V,V=ie):(ie=es(Q.type,Q.key,Q.props,null,V.mode,ie),Mi(ie,Q),ie.return=V,V=ie)}return p(V);case w:e:{for(pe=Q.key;L!==null;){if(L.key===pe)if(L.tag===4&&L.stateNode.containerInfo===Q.containerInfo&&L.stateNode.implementation===Q.implementation){a(V,L.sibling),ie=u(L,Q.children||[]),ie.return=V,V=ie;break e}else{a(V,L);break}else t(V,L);L=L.sibling}ie=yu(Q,V.mode,ie),ie.return=V,V=ie}return p(V);case $:return Q=Va(Q),Ye(V,L,Q,ie)}if(X(Q))return he(V,L,Q,ie);if(W(Q)){if(pe=W(Q),typeof pe!="function")throw Error(s(150));return Q=pe.call(Q),ve(V,L,Q,ie)}if(typeof Q.then=="function")return Ye(V,L,ss(Q),ie);if(Q.$$typeof===E)return Ye(V,L,as(V,Q),ie);rs(V,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,L!==null&&L.tag===6?(a(V,L.sibling),ie=u(L,Q),ie.return=V,V=ie):(a(V,L),ie=pu(Q,V.mode,ie),ie.return=V,V=ie),p(V)):a(V,L)}return function(V,L,Q,ie){try{Ti=0;var pe=Ye(V,L,Q,ie);return Cl=null,pe}catch(ge){if(ge===Ml||ge===is)throw ge;var Oe=Ot(29,ge,null,V.mode);return Oe.lanes=ie,Oe.return=V,Oe}}}var Za=Fd(!0),Wd=Fd(!1),na=!1;function Cu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function aa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function la(e,t,a){var i=e.updateQueue;if(i===null)return null;if(i=i.shared,(He&2)!==0){var u=i.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),i.pending=t,t=Po(e),jd(e,null,a),t}return Wo(e,i,t,a),Po(e)}function Ci(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,Do(e,a)}}function Du(e,t){var a=e.updateQueue,i=e.alternate;if(i!==null&&(i=i.updateQueue,a===i)){var u=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?u=c=p:c=c.next=p,a=a.next}while(a!==null);c===null?u=c=t:c=c.next=t}else u=c=t;a={baseState:i.baseState,firstBaseUpdate:u,lastBaseUpdate:c,shared:i.shared,callbacks:i.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Ou=!1;function zi(){if(Ou){var e=Tl;if(e!==null)throw e}}function Di(e,t,a,i){Ou=!1;var u=e.updateQueue;na=!1;var c=u.firstBaseUpdate,p=u.lastBaseUpdate,S=u.shared.pending;if(S!==null){u.shared.pending=null;var R=S,k=R.next;R.next=null,p===null?c=k:p.next=k,p=R;var ae=e.alternate;ae!==null&&(ae=ae.updateQueue,S=ae.lastBaseUpdate,S!==p&&(S===null?ae.firstBaseUpdate=k:S.next=k,ae.lastBaseUpdate=R))}if(c!==null){var oe=u.baseState;p=0,ae=k=R=null,S=c;do{var K=S.lane&-536870913,P=K!==S.lane;if(P?(Me&K)===K:(i&K)===K){K!==0&&K===Al&&(Ou=!0),ae!==null&&(ae=ae.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var he=e,ve=S;K=t;var Ye=a;switch(ve.tag){case 1:if(he=ve.payload,typeof he=="function"){oe=he.call(Ye,oe,K);break e}oe=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=ve.payload,K=typeof he=="function"?he.call(Ye,oe,K):he,K==null)break e;oe=y({},oe,K);break e;case 2:na=!0}}K=S.callback,K!==null&&(e.flags|=64,P&&(e.flags|=8192),P=u.callbacks,P===null?u.callbacks=[K]:P.push(K))}else P={lane:K,tag:S.tag,payload:S.payload,callback:S.callback,next:null},ae===null?(k=ae=P,R=oe):ae=ae.next=P,p|=K;if(S=S.next,S===null){if(S=u.shared.pending,S===null)break;P=S,S=P.next,P.next=null,u.lastBaseUpdate=P,u.shared.pending=null}}while(!0);ae===null&&(R=oe),u.baseState=R,u.firstBaseUpdate=k,u.lastBaseUpdate=ae,c===null&&(u.shared.lanes=0),ua|=p,e.lanes=p,e.memoizedState=oe}}function Pd(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function eh(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)Pd(a[e],t)}var zl=T(null),us=T(0);function th(e,t){e=Bn,ee(us,e),ee(zl,t),Bn=e|t.baseLanes}function Ru(){ee(us,Bn),ee(zl,zl.current)}function Hu(){Bn=us.current,j(zl),j(us)}var Rt=T(null),It=null;function ia(e){var t=e.alternate;ee(Fe,Fe.current&1),ee(Rt,e),It===null&&(t===null||zl.current!==null||t.memoizedState!==null)&&(It=e)}function ju(e){ee(Fe,Fe.current),ee(Rt,e),It===null&&(It=e)}function nh(e){e.tag===22?(ee(Fe,Fe.current),ee(Rt,e),It===null&&(It=e)):oa()}function oa(){ee(Fe,Fe.current),ee(Rt,Rt.current)}function Ht(e){j(Rt),It===e&&(It=null),j(Fe)}var Fe=T(0);function cs(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Yc(a)||Vc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Cn=0,_e=null,qe=null,tt=null,fs=!1,Dl=!1,Ia=!1,ds=0,Oi=0,Ol=null,Pv=0;function Ke(){throw Error(s(321))}function Lu(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Dt(e[a],t[a]))return!1;return!0}function Bu(e,t,a,i,u,c){return Cn=c,_e=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,A.H=e===null||e.memoizedState===null?qh:Wu,Ia=!1,c=a(i,u),Ia=!1,Dl&&(c=lh(t,a,i,u)),ah(e),c}function ah(e){A.H=ji;var t=qe!==null&&qe.next!==null;if(Cn=0,tt=qe=_e=null,fs=!1,Oi=0,Ol=null,t)throw Error(s(300));e===null||nt||(e=e.dependencies,e!==null&&ns(e)&&(nt=!0))}function lh(e,t,a,i){_e=e;var u=0;do{if(Dl&&(Ol=null),Oi=0,Dl=!1,25<=u)throw Error(s(301));if(u+=1,tt=qe=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}A.H=Gh,c=t(a,i)}while(Dl);return c}function e1(){var e=A.H,t=e.useState()[0];return t=typeof t.then=="function"?Ri(t):t,e=e.useState()[0],(qe!==null?qe.memoizedState:null)!==e&&(_e.flags|=1024),t}function Uu(){var e=ds!==0;return ds=0,e}function qu(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function Gu(e){if(fs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}fs=!1}Cn=0,tt=qe=_e=null,Dl=!1,Oi=ds=0,Ol=null}function bt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?_e.memoizedState=tt=e:tt=tt.next=e,tt}function We(){if(qe===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=qe.next;var t=tt===null?_e.memoizedState:tt.next;if(t!==null)tt=t,qe=e;else{if(e===null)throw _e.alternate===null?Error(s(467)):Error(s(310));qe=e,e={memoizedState:qe.memoizedState,baseState:qe.baseState,baseQueue:qe.baseQueue,queue:qe.queue,next:null},tt===null?_e.memoizedState=tt=e:tt=tt.next=e}return tt}function hs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ri(e){var t=Oi;return Oi+=1,Ol===null&&(Ol=[]),e=$d(Ol,e,t),t=_e,(tt===null?t.memoizedState:tt.next)===null&&(t=t.alternate,A.H=t===null||t.memoizedState===null?qh:Wu),e}function gs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ri(e);if(e.$$typeof===E)return dt(e)}throw Error(s(438,String(e)))}function Yu(e){var t=null,a=_e.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var i=_e.alternate;i!==null&&(i=i.updateQueue,i!==null&&(i=i.memoCache,i!=null&&(t={data:i.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=hs(),_e.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),i=0;i<e;i++)a[i]=Z;return t.index++,a}function zn(e,t){return typeof t=="function"?t(e):t}function ms(e){var t=We();return Vu(t,qe,e)}function Vu(e,t,a){var i=e.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=a;var u=e.baseQueue,c=i.pending;if(c!==null){if(u!==null){var p=u.next;u.next=c.next,c.next=p}t.baseQueue=u=c,i.pending=null}if(c=e.baseState,u===null)e.memoizedState=c;else{t=u.next;var S=p=null,R=null,k=t,ae=!1;do{var oe=k.lane&-536870913;if(oe!==k.lane?(Me&oe)===oe:(Cn&oe)===oe){var K=k.revertLane;if(K===0)R!==null&&(R=R.next={lane:0,revertLane:0,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null}),oe===Al&&(ae=!0);else if((Cn&K)===K){k=k.next,K===Al&&(ae=!0);continue}else oe={lane:0,revertLane:k.revertLane,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},R===null?(S=R=oe,p=c):R=R.next=oe,_e.lanes|=K,ua|=K;oe=k.action,Ia&&a(c,oe),c=k.hasEagerState?k.eagerState:a(c,oe)}else K={lane:oe,revertLane:k.revertLane,gesture:k.gesture,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},R===null?(S=R=K,p=c):R=R.next=K,_e.lanes|=oe,ua|=oe;k=k.next}while(k!==null&&k!==t);if(R===null?p=c:R.next=S,!Dt(c,e.memoizedState)&&(nt=!0,ae&&(a=Tl,a!==null)))throw a;e.memoizedState=c,e.baseState=p,e.baseQueue=R,i.lastRenderedState=c}return u===null&&(i.lanes=0),[e.memoizedState,i.dispatch]}function Xu(e){var t=We(),a=t.queue;if(a===null)throw Error(s(311));a.lastRenderedReducer=e;var i=a.dispatch,u=a.pending,c=t.memoizedState;if(u!==null){a.pending=null;var p=u=u.next;do c=e(c,p.action),p=p.next;while(p!==u);Dt(c,t.memoizedState)||(nt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),a.lastRenderedState=c}return[c,i]}function ih(e,t,a){var i=_e,u=We(),c=ze;if(c){if(a===void 0)throw Error(s(407));a=a()}else a=t();var p=!Dt((qe||u).memoizedState,a);if(p&&(u.memoizedState=a,nt=!0),u=u.queue,Qu(rh.bind(null,i,u,e),[e]),u.getSnapshot!==t||p||tt!==null&&tt.memoizedState.tag&1){if(i.flags|=2048,Rl(9,{destroy:void 0},sh.bind(null,i,u,a,t),null),Ve===null)throw Error(s(349));c||(Cn&127)!==0||oh(i,t,a)}return a}function oh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=_e.updateQueue,t===null?(t=hs(),_e.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function sh(e,t,a,i){t.value=a,t.getSnapshot=i,uh(t)&&ch(e)}function rh(e,t,a){return a(function(){uh(t)&&ch(e)})}function uh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Dt(e,a)}catch{return!0}}function ch(e){var t=La(e,2);t!==null&&Tt(t,e,2)}function Zu(e){var t=bt();if(typeof e=="function"){var a=e;if(e=a(),Ia){on(!0);try{a()}finally{on(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:e},t}function fh(e,t,a,i){return e.baseState=a,Vu(e,qe,typeof i=="function"?i:zn)}function t1(e,t,a,i,u){if(vs(e))throw Error(s(485));if(e=t.action,e!==null){var c={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(p){c.listeners.push(p)}};A.T!==null?a(!0):c.isTransition=!1,i(c),a=t.pending,a===null?(c.next=t.pending=c,dh(t,c)):(c.next=a.next,t.pending=a.next=c)}}function dh(e,t){var a=t.action,i=t.payload,u=e.state;if(t.isTransition){var c=A.T,p={};A.T=p;try{var S=a(u,i),R=A.S;R!==null&&R(p,S),hh(e,t,S)}catch(k){Iu(e,t,k)}finally{c!==null&&p.types!==null&&(c.types=p.types),A.T=c}}else try{c=a(u,i),hh(e,t,c)}catch(k){Iu(e,t,k)}}function hh(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(i){gh(e,t,i)},function(i){return Iu(e,t,i)}):gh(e,t,a)}function gh(e,t,a){t.status="fulfilled",t.value=a,mh(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,dh(e,a)))}function Iu(e,t,a){var i=e.pending;if(e.pending=null,i!==null){i=i.next;do t.status="rejected",t.reason=a,mh(t),t=t.next;while(t!==i)}e.action=null}function mh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ph(e,t){return t}function yh(e,t){if(ze){var a=Ve.formState;if(a!==null){e:{var i=_e;if(ze){if(Xe){t:{for(var u=Xe,c=Zt;u.nodeType!==8;){if(!c){u=null;break t}if(u=Qt(u.nextSibling),u===null){u=null;break t}}c=u.data,u=c==="F!"||c==="F"?u:null}if(u){Xe=Qt(u.nextSibling),i=u.data==="F!";break e}}ea(i)}i=!1}i&&(t=a[0])}}return a=bt(),a.memoizedState=a.baseState=t,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ph,lastRenderedState:t},a.queue=i,a=Lh.bind(null,_e,i),i.dispatch=a,i=Zu(!1),c=Fu.bind(null,_e,!1,i.queue),i=bt(),u={state:t,dispatch:null,action:e,pending:null},i.queue=u,a=t1.bind(null,_e,u,c,a),u.dispatch=a,i.memoizedState=e,[t,a,!1]}function vh(e){var t=We();return bh(t,qe,e)}function bh(e,t,a){if(t=Vu(e,t,ph)[0],e=ms(zn)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var i=Ri(t)}catch(p){throw p===Ml?is:p}else i=t;t=We();var u=t.queue,c=u.dispatch;return a!==t.memoizedState&&(_e.flags|=2048,Rl(9,{destroy:void 0},n1.bind(null,u,a),null)),[i,c,e]}function n1(e,t){e.action=t}function Sh(e){var t=We(),a=qe;if(a!==null)return bh(t,a,e);We(),t=t.memoizedState,a=We();var i=a.queue.dispatch;return a.memoizedState=e,[t,i,!1]}function Rl(e,t,a,i){return e={tag:e,create:a,deps:i,inst:t,next:null},t=_e.updateQueue,t===null&&(t=hs(),_e.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(i=a.next,a.next=e,e.next=i,t.lastEffect=e),e}function xh(){return We().memoizedState}function ps(e,t,a,i){var u=bt();_e.flags|=e,u.memoizedState=Rl(1|t,{destroy:void 0},a,i===void 0?null:i)}function ys(e,t,a,i){var u=We();i=i===void 0?null:i;var c=u.memoizedState.inst;qe!==null&&i!==null&&Lu(i,qe.memoizedState.deps)?u.memoizedState=Rl(t,c,a,i):(_e.flags|=e,u.memoizedState=Rl(1|t,c,a,i))}function _h(e,t){ps(8390656,8,e,t)}function Qu(e,t){ys(2048,8,e,t)}function a1(e){_e.flags|=4;var t=_e.updateQueue;if(t===null)t=hs(),_e.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Eh(e){var t=We().memoizedState;return a1({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function wh(e,t){return ys(4,2,e,t)}function Nh(e,t){return ys(4,4,e,t)}function Ah(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Th(e,t,a){a=a!=null?a.concat([e]):null,ys(4,4,Ah.bind(null,t,e),a)}function ku(){}function Mh(e,t){var a=We();t=t===void 0?null:t;var i=a.memoizedState;return t!==null&&Lu(t,i[1])?i[0]:(a.memoizedState=[e,t],e)}function Ch(e,t){var a=We();t=t===void 0?null:t;var i=a.memoizedState;if(t!==null&&Lu(t,i[1]))return i[0];if(i=e(),Ia){on(!0);try{e()}finally{on(!1)}}return a.memoizedState=[i,t],i}function $u(e,t,a){return a===void 0||(Cn&1073741824)!==0&&(Me&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=zg(),_e.lanes|=e,ua|=e,a)}function zh(e,t,a,i){return Dt(a,t)?a:zl.current!==null?(e=$u(e,a,i),Dt(e,t)||(nt=!0),e):(Cn&42)===0||(Cn&1073741824)!==0&&(Me&261930)===0?(nt=!0,e.memoizedState=a):(e=zg(),_e.lanes|=e,ua|=e,t)}function Dh(e,t,a,i,u){var c=H.p;H.p=c!==0&&8>c?c:8;var p=A.T,S={};A.T=S,Fu(e,!1,t,a);try{var R=u(),k=A.S;if(k!==null&&k(S,R),R!==null&&typeof R=="object"&&typeof R.then=="function"){var ae=Wv(R,i);Hi(e,t,ae,Bt(e))}else Hi(e,t,i,Bt(e))}catch(oe){Hi(e,t,{then:function(){},status:"rejected",reason:oe},Bt())}finally{H.p=c,p!==null&&S.types!==null&&(p.types=S.types),A.T=p}}function l1(){}function Ku(e,t,a,i){if(e.tag!==5)throw Error(s(476));var u=Oh(e).queue;Dh(e,u,t,B,a===null?l1:function(){return Rh(e),a(i)})}function Oh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:B,baseState:B,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:B},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zn,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Rh(e){var t=Oh(e);t.next===null&&(t=e.alternate.memoizedState),Hi(e,t.next.queue,{},Bt())}function Ju(){return dt(Fi)}function Hh(){return We().memoizedState}function jh(){return We().memoizedState}function i1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Bt();e=aa(a);var i=la(t,e,a);i!==null&&(Tt(i,t,a),Ci(i,t,a)),t={cache:Nu()},e.payload=t;return}t=t.return}}function o1(e,t,a){var i=Bt();a={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},vs(e)?Bh(t,a):(a=gu(e,t,a,i),a!==null&&(Tt(a,e,i),Uh(a,t,i)))}function Lh(e,t,a){var i=Bt();Hi(e,t,a,i)}function Hi(e,t,a,i){var u={lane:i,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(vs(e))Bh(t,u);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var p=t.lastRenderedState,S=c(p,a);if(u.hasEagerState=!0,u.eagerState=S,Dt(S,p))return Wo(e,t,u,0),Ve===null&&Fo(),!1}catch{}if(a=gu(e,t,u,i),a!==null)return Tt(a,e,i),Uh(a,t,i),!0}return!1}function Fu(e,t,a,i){if(i={lane:2,revertLane:Cc(),gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},vs(e)){if(t)throw Error(s(479))}else t=gu(e,a,i,2),t!==null&&Tt(t,e,2)}function vs(e){var t=e.alternate;return e===_e||t!==null&&t===_e}function Bh(e,t){Dl=fs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Uh(e,t,a){if((a&4194048)!==0){var i=t.lanes;i&=e.pendingLanes,a|=i,t.lanes=a,Do(e,a)}}var ji={readContext:dt,use:gs,useCallback:Ke,useContext:Ke,useEffect:Ke,useImperativeHandle:Ke,useLayoutEffect:Ke,useInsertionEffect:Ke,useMemo:Ke,useReducer:Ke,useRef:Ke,useState:Ke,useDebugValue:Ke,useDeferredValue:Ke,useTransition:Ke,useSyncExternalStore:Ke,useId:Ke,useHostTransitionStatus:Ke,useFormState:Ke,useActionState:Ke,useOptimistic:Ke,useMemoCache:Ke,useCacheRefresh:Ke};ji.useEffectEvent=Ke;var qh={readContext:dt,use:gs,useCallback:function(e,t){return bt().memoizedState=[e,t===void 0?null:t],e},useContext:dt,useEffect:_h,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,ps(4194308,4,Ah.bind(null,t,e),a)},useLayoutEffect:function(e,t){return ps(4194308,4,e,t)},useInsertionEffect:function(e,t){ps(4,2,e,t)},useMemo:function(e,t){var a=bt();t=t===void 0?null:t;var i=e();if(Ia){on(!0);try{e()}finally{on(!1)}}return a.memoizedState=[i,t],i},useReducer:function(e,t,a){var i=bt();if(a!==void 0){var u=a(t);if(Ia){on(!0);try{a(t)}finally{on(!1)}}}else u=t;return i.memoizedState=i.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},i.queue=e,e=e.dispatch=o1.bind(null,_e,e),[i.memoizedState,e]},useRef:function(e){var t=bt();return e={current:e},t.memoizedState=e},useState:function(e){e=Zu(e);var t=e.queue,a=Lh.bind(null,_e,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:ku,useDeferredValue:function(e,t){var a=bt();return $u(a,e,t)},useTransition:function(){var e=Zu(!1);return e=Dh.bind(null,_e,e.queue,!0,!1),bt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var i=_e,u=bt();if(ze){if(a===void 0)throw Error(s(407));a=a()}else{if(a=t(),Ve===null)throw Error(s(349));(Me&127)!==0||oh(i,t,a)}u.memoizedState=a;var c={value:a,getSnapshot:t};return u.queue=c,_h(rh.bind(null,i,c,e),[e]),i.flags|=2048,Rl(9,{destroy:void 0},sh.bind(null,i,c,a,t),null),a},useId:function(){var e=bt(),t=Ve.identifierPrefix;if(ze){var a=un,i=rn;a=(i&~(1<<32-vt(i)-1)).toString(32)+a,t="_"+t+"R_"+a,a=ds++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Pv++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Ju,useFormState:yh,useActionState:yh,useOptimistic:function(e){var t=bt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Fu.bind(null,_e,!0,a),a.dispatch=t,[e,t]},useMemoCache:Yu,useCacheRefresh:function(){return bt().memoizedState=i1.bind(null,_e)},useEffectEvent:function(e){var t=bt(),a={impl:e};return t.memoizedState=a,function(){if((He&2)!==0)throw Error(s(440));return a.impl.apply(void 0,arguments)}}},Wu={readContext:dt,use:gs,useCallback:Mh,useContext:dt,useEffect:Qu,useImperativeHandle:Th,useInsertionEffect:wh,useLayoutEffect:Nh,useMemo:Ch,useReducer:ms,useRef:xh,useState:function(){return ms(zn)},useDebugValue:ku,useDeferredValue:function(e,t){var a=We();return zh(a,qe.memoizedState,e,t)},useTransition:function(){var e=ms(zn)[0],t=We().memoizedState;return[typeof e=="boolean"?e:Ri(e),t]},useSyncExternalStore:ih,useId:Hh,useHostTransitionStatus:Ju,useFormState:vh,useActionState:vh,useOptimistic:function(e,t){var a=We();return fh(a,qe,e,t)},useMemoCache:Yu,useCacheRefresh:jh};Wu.useEffectEvent=Eh;var Gh={readContext:dt,use:gs,useCallback:Mh,useContext:dt,useEffect:Qu,useImperativeHandle:Th,useInsertionEffect:wh,useLayoutEffect:Nh,useMemo:Ch,useReducer:Xu,useRef:xh,useState:function(){return Xu(zn)},useDebugValue:ku,useDeferredValue:function(e,t){var a=We();return qe===null?$u(a,e,t):zh(a,qe.memoizedState,e,t)},useTransition:function(){var e=Xu(zn)[0],t=We().memoizedState;return[typeof e=="boolean"?e:Ri(e),t]},useSyncExternalStore:ih,useId:Hh,useHostTransitionStatus:Ju,useFormState:Sh,useActionState:Sh,useOptimistic:function(e,t){var a=We();return qe!==null?fh(a,qe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Yu,useCacheRefresh:jh};Gh.useEffectEvent=Eh;function Pu(e,t,a,i){t=e.memoizedState,a=a(i,t),a=a==null?t:y({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var ec={enqueueSetState:function(e,t,a){e=e._reactInternals;var i=Bt(),u=aa(i);u.payload=t,a!=null&&(u.callback=a),t=la(e,u,i),t!==null&&(Tt(t,e,i),Ci(t,e,i))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var i=Bt(),u=aa(i);u.tag=1,u.payload=t,a!=null&&(u.callback=a),t=la(e,u,i),t!==null&&(Tt(t,e,i),Ci(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Bt(),i=aa(a);i.tag=2,t!=null&&(i.callback=t),t=la(e,i,a),t!==null&&(Tt(t,e,a),Ci(t,e,a))}};function Yh(e,t,a,i,u,c,p){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(i,c,p):t.prototype&&t.prototype.isPureReactComponent?!xi(a,i)||!xi(u,c):!0}function Vh(e,t,a,i){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,i),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,i),t.state!==e&&ec.enqueueReplaceState(t,t.state,null)}function Qa(e,t){var a=t;if("ref"in t){a={};for(var i in t)i!=="ref"&&(a[i]=t[i])}if(e=e.defaultProps){a===t&&(a=y({},a));for(var u in e)a[u]===void 0&&(a[u]=e[u])}return a}function Xh(e){Jo(e)}function Zh(e){console.error(e)}function Ih(e){Jo(e)}function bs(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(i){setTimeout(function(){throw i})}}function Qh(e,t,a){try{var i=e.onCaughtError;i(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function tc(e,t,a){return a=aa(a),a.tag=3,a.payload={element:null},a.callback=function(){bs(e,t)},a}function kh(e){return e=aa(e),e.tag=3,e}function $h(e,t,a,i){var u=a.type.getDerivedStateFromError;if(typeof u=="function"){var c=i.value;e.payload=function(){return u(c)},e.callback=function(){Qh(t,a,i)}}var p=a.stateNode;p!==null&&typeof p.componentDidCatch=="function"&&(e.callback=function(){Qh(t,a,i),typeof u!="function"&&(ca===null?ca=new Set([this]):ca.add(this));var S=i.stack;this.componentDidCatch(i.value,{componentStack:S!==null?S:""})})}function s1(e,t,a,i,u){if(a.flags|=32768,i!==null&&typeof i=="object"&&typeof i.then=="function"){if(t=a.alternate,t!==null&&Nl(t,a,u,!0),a=Rt.current,a!==null){switch(a.tag){case 31:case 13:return It===null?Ds():a.alternate===null&&Je===0&&(Je=3),a.flags&=-257,a.flags|=65536,a.lanes=u,i===os?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([i]):t.add(i),Ac(e,i,u)),!1;case 22:return a.flags|=65536,i===os?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([i])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([i]):a.add(i)),Ac(e,i,u)),!1}throw Error(s(435,a.tag))}return Ac(e,i,u),Ds(),!1}if(ze)return t=Rt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,i!==Su&&(e=Error(s(422),{cause:i}),wi(Yt(e,a)))):(i!==Su&&(t=Error(s(423),{cause:i}),wi(Yt(t,a))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,i=Yt(i,a),u=tc(e.stateNode,i,u),Du(e,u),Je!==4&&(Je=2)),!1;var c=Error(s(520),{cause:i});if(c=Yt(c,a),Xi===null?Xi=[c]:Xi.push(c),Je!==4&&(Je=2),t===null)return!0;i=Yt(i,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=u&-u,a.lanes|=e,e=tc(a.stateNode,i,e),Du(a,e),!1;case 1:if(t=a.type,c=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(ca===null||!ca.has(c))))return a.flags|=65536,u&=-u,a.lanes|=u,u=kh(u),$h(u,e,a,i),Du(a,u),!1}a=a.return}while(a!==null);return!1}var nc=Error(s(461)),nt=!1;function ht(e,t,a,i){t.child=e===null?Wd(t,null,a,i):Za(t,e.child,a,i)}function Kh(e,t,a,i,u){a=a.render;var c=t.ref;if("ref"in i){var p={};for(var S in i)S!=="ref"&&(p[S]=i[S])}else p=i;return Ga(t),i=Bu(e,t,a,p,c,u),S=Uu(),e!==null&&!nt?(qu(e,t,u),Dn(e,t,u)):(ze&&S&&vu(t),t.flags|=1,ht(e,t,i,u),t.child)}function Jh(e,t,a,i,u){if(e===null){var c=a.type;return typeof c=="function"&&!mu(c)&&c.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=c,Fh(e,t,c,i,u)):(e=es(a.type,null,i,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!cc(e,u)){var p=c.memoizedProps;if(a=a.compare,a=a!==null?a:xi,a(p,i)&&e.ref===t.ref)return Dn(e,t,u)}return t.flags|=1,e=Nn(c,i),e.ref=t.ref,e.return=t,t.child=e}function Fh(e,t,a,i,u){if(e!==null){var c=e.memoizedProps;if(xi(c,i)&&e.ref===t.ref)if(nt=!1,t.pendingProps=i=c,cc(e,u))(e.flags&131072)!==0&&(nt=!0);else return t.lanes=e.lanes,Dn(e,t,u)}return ac(e,t,a,i,u)}function Wh(e,t,a,i){var u=i.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|a:a,e!==null){for(i=t.child=e.child,u=0;i!==null;)u=u|i.lanes|i.childLanes,i=i.sibling;i=u&~c}else i=0,t.child=null;return Ph(e,t,c,a,i)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ls(t,c!==null?c.cachePool:null),c!==null?th(t,c):Ru(),nh(t);else return i=t.lanes=536870912,Ph(e,t,c!==null?c.baseLanes|a:a,a,i)}else c!==null?(ls(t,c.cachePool),th(t,c),oa(),t.memoizedState=null):(e!==null&&ls(t,null),Ru(),oa());return ht(e,t,u,a),t.child}function Li(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ph(e,t,a,i,u){var c=Tu();return c=c===null?null:{parent:et._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&ls(t,null),Ru(),nh(t),e!==null&&Nl(e,t,i,!0),t.childLanes=u,null}function Ss(e,t){return t=_s({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function eg(e,t,a){return Za(t,e.child,null,a),e=Ss(t,t.pendingProps),e.flags|=2,Ht(t),t.memoizedState=null,e}function r1(e,t,a){var i=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(ze){if(i.mode==="hidden")return e=Ss(t,i),t.lanes=536870912,Li(null,e);if(ju(t),(e=Xe)?(e=dm(e,Zt),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wn!==null?{id:rn,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=Bd(e),a.return=t,t.child=a,ft=t,Xe=null)):e=null,e===null)throw ea(t);return t.lanes=536870912,null}return Ss(t,i)}var c=e.memoizedState;if(c!==null){var p=c.dehydrated;if(ju(t),u)if(t.flags&256)t.flags&=-257,t=eg(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(nt||Nl(e,t,a,!1),u=(a&e.childLanes)!==0,nt||u){if(i=Ve,i!==null&&(p=Oo(i,a),p!==0&&p!==c.retryLane))throw c.retryLane=p,La(e,p),Tt(i,e,p),nc;Ds(),t=eg(e,t,a)}else e=c.treeContext,Xe=Qt(p.nextSibling),ft=t,ze=!0,Pn=null,Zt=!1,e!==null&&Gd(t,e),t=Ss(t,i),t.flags|=4096;return t}return e=Nn(e.child,{mode:i.mode,children:i.children}),e.ref=t.ref,t.child=e,e.return=t,e}function xs(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(s(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function ac(e,t,a,i,u){return Ga(t),a=Bu(e,t,a,i,void 0,u),i=Uu(),e!==null&&!nt?(qu(e,t,u),Dn(e,t,u)):(ze&&i&&vu(t),t.flags|=1,ht(e,t,a,u),t.child)}function tg(e,t,a,i,u,c){return Ga(t),t.updateQueue=null,a=lh(t,i,a,u),ah(e),i=Uu(),e!==null&&!nt?(qu(e,t,c),Dn(e,t,c)):(ze&&i&&vu(t),t.flags|=1,ht(e,t,a,c),t.child)}function ng(e,t,a,i,u){if(Ga(t),t.stateNode===null){var c=xl,p=a.contextType;typeof p=="object"&&p!==null&&(c=dt(p)),c=new a(i,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=ec,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=i,c.state=t.memoizedState,c.refs={},Cu(t),p=a.contextType,c.context=typeof p=="object"&&p!==null?dt(p):xl,c.state=t.memoizedState,p=a.getDerivedStateFromProps,typeof p=="function"&&(Pu(t,a,p,i),c.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(p=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),p!==c.state&&ec.enqueueReplaceState(c,c.state,null),Di(t,i,c,u),zi(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),i=!0}else if(e===null){c=t.stateNode;var S=t.memoizedProps,R=Qa(a,S);c.props=R;var k=c.context,ae=a.contextType;p=xl,typeof ae=="object"&&ae!==null&&(p=dt(ae));var oe=a.getDerivedStateFromProps;ae=typeof oe=="function"||typeof c.getSnapshotBeforeUpdate=="function",S=t.pendingProps!==S,ae||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(S||k!==p)&&Vh(t,c,i,p),na=!1;var K=t.memoizedState;c.state=K,Di(t,i,c,u),zi(),k=t.memoizedState,S||K!==k||na?(typeof oe=="function"&&(Pu(t,a,oe,i),k=t.memoizedState),(R=na||Yh(t,a,R,i,K,k,p))?(ae||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=i,t.memoizedState=k),c.props=i,c.state=k,c.context=p,i=R):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),i=!1)}else{c=t.stateNode,zu(e,t),p=t.memoizedProps,ae=Qa(a,p),c.props=ae,oe=t.pendingProps,K=c.context,k=a.contextType,R=xl,typeof k=="object"&&k!==null&&(R=dt(k)),S=a.getDerivedStateFromProps,(k=typeof S=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(p!==oe||K!==R)&&Vh(t,c,i,R),na=!1,K=t.memoizedState,c.state=K,Di(t,i,c,u),zi();var P=t.memoizedState;p!==oe||K!==P||na||e!==null&&e.dependencies!==null&&ns(e.dependencies)?(typeof S=="function"&&(Pu(t,a,S,i),P=t.memoizedState),(ae=na||Yh(t,a,ae,i,K,P,R)||e!==null&&e.dependencies!==null&&ns(e.dependencies))?(k||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(i,P,R),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(i,P,R)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||p===e.memoizedProps&&K===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&K===e.memoizedState||(t.flags|=1024),t.memoizedProps=i,t.memoizedState=P),c.props=i,c.state=P,c.context=R,i=ae):(typeof c.componentDidUpdate!="function"||p===e.memoizedProps&&K===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||p===e.memoizedProps&&K===e.memoizedState||(t.flags|=1024),i=!1)}return c=i,xs(e,t),i=(t.flags&128)!==0,c||i?(c=t.stateNode,a=i&&typeof a.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&i?(t.child=Za(t,e.child,null,u),t.child=Za(t,null,a,u)):ht(e,t,a,u),t.memoizedState=c.state,e=t.child):e=Dn(e,t,u),e}function ag(e,t,a,i){return Ua(),t.flags|=256,ht(e,t,a,i),t.child}var lc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ic(e){return{baseLanes:e,cachePool:Qd()}}function oc(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Lt),e}function lg(e,t,a){var i=t.pendingProps,u=!1,c=(t.flags&128)!==0,p;if((p=c)||(p=e!==null&&e.memoizedState===null?!1:(Fe.current&2)!==0),p&&(u=!0,t.flags&=-129),p=(t.flags&32)!==0,t.flags&=-33,e===null){if(ze){if(u?ia(t):oa(),(e=Xe)?(e=dm(e,Zt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Wn!==null?{id:rn,overflow:un}:null,retryLane:536870912,hydrationErrors:null},a=Bd(e),a.return=t,t.child=a,ft=t,Xe=null)):e=null,e===null)throw ea(t);return Vc(e)?t.lanes=32:t.lanes=536870912,null}var S=i.children;return i=i.fallback,u?(oa(),u=t.mode,S=_s({mode:"hidden",children:S},u),i=Ba(i,u,a,null),S.return=t,i.return=t,S.sibling=i,t.child=S,i=t.child,i.memoizedState=ic(a),i.childLanes=oc(e,p,a),t.memoizedState=lc,Li(null,i)):(ia(t),sc(t,S))}var R=e.memoizedState;if(R!==null&&(S=R.dehydrated,S!==null)){if(c)t.flags&256?(ia(t),t.flags&=-257,t=rc(e,t,a)):t.memoizedState!==null?(oa(),t.child=e.child,t.flags|=128,t=null):(oa(),S=i.fallback,u=t.mode,i=_s({mode:"visible",children:i.children},u),S=Ba(S,u,a,null),S.flags|=2,i.return=t,S.return=t,i.sibling=S,t.child=i,Za(t,e.child,null,a),i=t.child,i.memoizedState=ic(a),i.childLanes=oc(e,p,a),t.memoizedState=lc,t=Li(null,i));else if(ia(t),Vc(S)){if(p=S.nextSibling&&S.nextSibling.dataset,p)var k=p.dgst;p=k,i=Error(s(419)),i.stack="",i.digest=p,wi({value:i,source:null,stack:null}),t=rc(e,t,a)}else if(nt||Nl(e,t,a,!1),p=(a&e.childLanes)!==0,nt||p){if(p=Ve,p!==null&&(i=Oo(p,a),i!==0&&i!==R.retryLane))throw R.retryLane=i,La(e,i),Tt(p,e,i),nc;Yc(S)||Ds(),t=rc(e,t,a)}else Yc(S)?(t.flags|=192,t.child=e.child,t=null):(e=R.treeContext,Xe=Qt(S.nextSibling),ft=t,ze=!0,Pn=null,Zt=!1,e!==null&&Gd(t,e),t=sc(t,i.children),t.flags|=4096);return t}return u?(oa(),S=i.fallback,u=t.mode,R=e.child,k=R.sibling,i=Nn(R,{mode:"hidden",children:i.children}),i.subtreeFlags=R.subtreeFlags&65011712,k!==null?S=Nn(k,S):(S=Ba(S,u,a,null),S.flags|=2),S.return=t,i.return=t,i.sibling=S,t.child=i,Li(null,i),i=t.child,S=e.child.memoizedState,S===null?S=ic(a):(u=S.cachePool,u!==null?(R=et._currentValue,u=u.parent!==R?{parent:R,pool:R}:u):u=Qd(),S={baseLanes:S.baseLanes|a,cachePool:u}),i.memoizedState=S,i.childLanes=oc(e,p,a),t.memoizedState=lc,Li(e.child,i)):(ia(t),a=e.child,e=a.sibling,a=Nn(a,{mode:"visible",children:i.children}),a.return=t,a.sibling=null,e!==null&&(p=t.deletions,p===null?(t.deletions=[e],t.flags|=16):p.push(e)),t.child=a,t.memoizedState=null,a)}function sc(e,t){return t=_s({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function _s(e,t){return e=Ot(22,e,null,t),e.lanes=0,e}function rc(e,t,a){return Za(t,e.child,null,a),e=sc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function ig(e,t,a){e.lanes|=t;var i=e.alternate;i!==null&&(i.lanes|=t),Eu(e.return,t,a)}function uc(e,t,a,i,u,c){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:i,tail:a,tailMode:u,treeForkCount:c}:(p.isBackwards=t,p.rendering=null,p.renderingStartTime=0,p.last=i,p.tail=a,p.tailMode=u,p.treeForkCount=c)}function og(e,t,a){var i=t.pendingProps,u=i.revealOrder,c=i.tail;i=i.children;var p=Fe.current,S=(p&2)!==0;if(S?(p=p&1|2,t.flags|=128):p&=1,ee(Fe,p),ht(e,t,i,a),i=ze?Ei:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&ig(e,a,t);else if(e.tag===19)ig(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(u){case"forwards":for(a=t.child,u=null;a!==null;)e=a.alternate,e!==null&&cs(e)===null&&(u=a),a=a.sibling;a=u,a===null?(u=t.child,t.child=null):(u=a.sibling,a.sibling=null),uc(t,!1,u,a,c,i);break;case"backwards":case"unstable_legacy-backwards":for(a=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&cs(e)===null){t.child=u;break}e=u.sibling,u.sibling=a,a=u,u=e}uc(t,!0,a,null,c,i);break;case"together":uc(t,!1,null,null,void 0,i);break;default:t.memoizedState=null}return t.child}function Dn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),ua|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Nl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,a=Nn(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Nn(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function cc(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ns(e)))}function u1(e,t,a){switch(t.tag){case 3:se(t,t.stateNode.containerInfo),ta(t,et,e.memoizedState.cache),Ua();break;case 27:case 5:Ee(t);break;case 4:se(t,t.stateNode.containerInfo);break;case 10:ta(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,ju(t),null;break;case 13:var i=t.memoizedState;if(i!==null)return i.dehydrated!==null?(ia(t),t.flags|=128,null):(a&t.child.childLanes)!==0?lg(e,t,a):(ia(t),e=Dn(e,t,a),e!==null?e.sibling:null);ia(t);break;case 19:var u=(e.flags&128)!==0;if(i=(a&t.childLanes)!==0,i||(Nl(e,t,a,!1),i=(a&t.childLanes)!==0),u){if(i)return og(e,t,a);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),ee(Fe,Fe.current),i)break;return null;case 22:return t.lanes=0,Wh(e,t,a,t.pendingProps);case 24:ta(t,et,e.memoizedState.cache)}return Dn(e,t,a)}function sg(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)nt=!0;else{if(!cc(e,a)&&(t.flags&128)===0)return nt=!1,u1(e,t,a);nt=(e.flags&131072)!==0}else nt=!1,ze&&(t.flags&1048576)!==0&&qd(t,Ei,t.index);switch(t.lanes=0,t.tag){case 16:e:{var i=t.pendingProps;if(e=Va(t.elementType),t.type=e,typeof e=="function")mu(e)?(i=Qa(e,i),t.tag=1,t=ng(null,t,e,i,a)):(t.tag=0,t=ac(null,t,e,i,a));else{if(e!=null){var u=e.$$typeof;if(u===z){t.tag=11,t=Kh(null,t,e,i,a);break e}else if(u===U){t.tag=14,t=Jh(null,t,e,i,a);break e}}throw t=O(e)||e,Error(s(306,t,""))}}return t;case 0:return ac(e,t,t.type,t.pendingProps,a);case 1:return i=t.type,u=Qa(i,t.pendingProps),ng(e,t,i,u,a);case 3:e:{if(se(t,t.stateNode.containerInfo),e===null)throw Error(s(387));i=t.pendingProps;var c=t.memoizedState;u=c.element,zu(e,t),Di(t,i,null,a);var p=t.memoizedState;if(i=p.cache,ta(t,et,i),i!==c.cache&&wu(t,[et],a,!0),zi(),i=p.element,c.isDehydrated)if(c={element:i,isDehydrated:!1,cache:p.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=ag(e,t,i,a);break e}else if(i!==u){u=Yt(Error(s(424)),t),wi(u),t=ag(e,t,i,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Xe=Qt(e.firstChild),ft=t,ze=!0,Pn=null,Zt=!0,a=Wd(t,null,i,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Ua(),i===u){t=Dn(e,t,a);break e}ht(e,t,i,a)}t=t.child}return t;case 26:return xs(e,t),e===null?(a=vm(t.type,null,t.pendingProps,null))?t.memoizedState=a:ze||(a=t.type,e=t.pendingProps,i=Us(ce.current).createElement(a),i[it]=t,i[mt]=e,gt(i,a,e),Pe(i),t.stateNode=i):t.memoizedState=vm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ee(t),e===null&&ze&&(i=t.stateNode=mm(t.type,t.pendingProps,ce.current),ft=t,Zt=!0,u=Xe,ga(t.type)?(Xc=u,Xe=Qt(i.firstChild)):Xe=u),ht(e,t,t.pendingProps.children,a),xs(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&ze&&((u=i=Xe)&&(i=q1(i,t.type,t.pendingProps,Zt),i!==null?(t.stateNode=i,ft=t,Xe=Qt(i.firstChild),Zt=!1,u=!0):u=!1),u||ea(t)),Ee(t),u=t.type,c=t.pendingProps,p=e!==null?e.memoizedProps:null,i=c.children,Uc(u,c)?i=null:p!==null&&Uc(u,p)&&(t.flags|=32),t.memoizedState!==null&&(u=Bu(e,t,e1,null,null,a),Fi._currentValue=u),xs(e,t),ht(e,t,i,a),t.child;case 6:return e===null&&ze&&((e=a=Xe)&&(a=G1(a,t.pendingProps,Zt),a!==null?(t.stateNode=a,ft=t,Xe=null,e=!0):e=!1),e||ea(t)),null;case 13:return lg(e,t,a);case 4:return se(t,t.stateNode.containerInfo),i=t.pendingProps,e===null?t.child=Za(t,null,i,a):ht(e,t,i,a),t.child;case 11:return Kh(e,t,t.type,t.pendingProps,a);case 7:return ht(e,t,t.pendingProps,a),t.child;case 8:return ht(e,t,t.pendingProps.children,a),t.child;case 12:return ht(e,t,t.pendingProps.children,a),t.child;case 10:return i=t.pendingProps,ta(t,t.type,i.value),ht(e,t,i.children,a),t.child;case 9:return u=t.type._context,i=t.pendingProps.children,Ga(t),u=dt(u),i=i(u),t.flags|=1,ht(e,t,i,a),t.child;case 14:return Jh(e,t,t.type,t.pendingProps,a);case 15:return Fh(e,t,t.type,t.pendingProps,a);case 19:return og(e,t,a);case 31:return r1(e,t,a);case 22:return Wh(e,t,a,t.pendingProps);case 24:return Ga(t),i=dt(et),e===null?(u=Tu(),u===null&&(u=Ve,c=Nu(),u.pooledCache=c,c.refCount++,c!==null&&(u.pooledCacheLanes|=a),u=c),t.memoizedState={parent:i,cache:u},Cu(t),ta(t,et,u)):((e.lanes&a)!==0&&(zu(e,t),Di(t,null,null,a),zi()),u=e.memoizedState,c=t.memoizedState,u.parent!==i?(u={parent:i,cache:i},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),ta(t,et,i)):(i=c.cache,ta(t,et,i),i!==u.cache&&wu(t,[et],a,!0))),ht(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function On(e){e.flags|=4}function fc(e,t,a,i,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(Hg())e.flags|=8192;else throw Xa=os,Mu}else e.flags&=-16777217}function rg(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Em(t))if(Hg())e.flags|=8192;else throw Xa=os,Mu}function Es(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Co():536870912,e.lanes|=t,Bl|=t)}function Bi(e,t){if(!ze)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var i=null;a!==null;)a.alternate!==null&&(i=a),a=a.sibling;i===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:i.sibling=null}}function Ze(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,i=0;if(t)for(var u=e.child;u!==null;)a|=u.lanes|u.childLanes,i|=u.subtreeFlags&65011712,i|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)a|=u.lanes|u.childLanes,i|=u.subtreeFlags,i|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=i,e.childLanes=a,t}function c1(e,t,a){var i=t.pendingProps;switch(bu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ze(t),null;case 1:return Ze(t),null;case 3:return a=t.stateNode,i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),Mn(et),fe(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(wl(t)?On(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,xu())),Ze(t),null;case 26:var u=t.type,c=t.memoizedState;return e===null?(On(t),c!==null?(Ze(t),rg(t,c)):(Ze(t),fc(t,u,null,i,a))):c?c!==e.memoizedState?(On(t),Ze(t),rg(t,c)):(Ze(t),t.flags&=-16777217):(e=e.memoizedProps,e!==i&&On(t),Ze(t),fc(t,u,e,i,a)),null;case 27:if(xe(t),a=ce.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&On(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return Ze(t),null}e=ne.current,wl(t)?Yd(t):(e=mm(u,i,a),t.stateNode=e,On(t))}return Ze(t),null;case 5:if(xe(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==i&&On(t);else{if(!i){if(t.stateNode===null)throw Error(s(166));return Ze(t),null}if(c=ne.current,wl(t))Yd(t);else{var p=Us(ce.current);switch(c){case 1:c=p.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:c=p.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":c=p.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":c=p.createElementNS("http://www.w3.org/1998/Math/MathML",u);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(u,{is:i.is}):p.createElement(u)}}c[it]=t,c[mt]=i;e:for(p=t.child;p!==null;){if(p.tag===5||p.tag===6)c.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===t)break e;for(;p.sibling===null;){if(p.return===null||p.return===t)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}t.stateNode=c;e:switch(gt(c,u,i),u){case"button":case"input":case"select":case"textarea":i=!!i.autoFocus;break e;case"img":i=!0;break e;default:i=!1}i&&On(t)}}return Ze(t),fc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==i&&On(t);else{if(typeof i!="string"&&t.stateNode===null)throw Error(s(166));if(e=ce.current,wl(t)){if(e=t.stateNode,a=t.memoizedProps,i=null,u=ft,u!==null)switch(u.tag){case 27:case 5:i=u.memoizedProps}e[it]=t,e=!!(e.nodeValue===a||i!==null&&i.suppressHydrationWarning===!0||lm(e.nodeValue,a)),e||ea(t,!0)}else e=Us(e).createTextNode(i),e[it]=t,t.stateNode=e}return Ze(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(i=wl(t),a!==null){if(e===null){if(!i)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[it]=t}else Ua(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),e=!1}else a=xu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Ht(t),t):(Ht(t),null);if((t.flags&128)!==0)throw Error(s(558))}return Ze(t),null;case 13:if(i=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=wl(t),i!==null&&i.dehydrated!==null){if(e===null){if(!u)throw Error(s(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));u[it]=t}else Ua(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ze(t),u=!1}else u=xu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(Ht(t),t):(Ht(t),null)}return Ht(t),(t.flags&128)!==0?(t.lanes=a,t):(a=i!==null,e=e!==null&&e.memoizedState!==null,a&&(i=t.child,u=null,i.alternate!==null&&i.alternate.memoizedState!==null&&i.alternate.memoizedState.cachePool!==null&&(u=i.alternate.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==u&&(i.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),Es(t,t.updateQueue),Ze(t),null);case 4:return fe(),e===null&&Rc(t.stateNode.containerInfo),Ze(t),null;case 10:return Mn(t.type),Ze(t),null;case 19:if(j(Fe),i=t.memoizedState,i===null)return Ze(t),null;if(u=(t.flags&128)!==0,c=i.rendering,c===null)if(u)Bi(i,!1);else{if(Je!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=cs(e),c!==null){for(t.flags|=128,Bi(i,!1),e=c.updateQueue,t.updateQueue=e,Es(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Ld(a,e),a=a.sibling;return ee(Fe,Fe.current&1|2),ze&&An(t,i.treeForkCount),t.child}e=e.sibling}i.tail!==null&&ct()>Ms&&(t.flags|=128,u=!0,Bi(i,!1),t.lanes=4194304)}else{if(!u)if(e=cs(c),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Es(t,e),Bi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!c.alternate&&!ze)return Ze(t),null}else 2*ct()-i.renderingStartTime>Ms&&a!==536870912&&(t.flags|=128,u=!0,Bi(i,!1),t.lanes=4194304);i.isBackwards?(c.sibling=t.child,t.child=c):(e=i.last,e!==null?e.sibling=c:t.child=c,i.last=c)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=ct(),e.sibling=null,a=Fe.current,ee(Fe,u?a&1|2:a&1),ze&&An(t,i.treeForkCount),e):(Ze(t),null);case 22:case 23:return Ht(t),Hu(),i=t.memoizedState!==null,e!==null?e.memoizedState!==null!==i&&(t.flags|=8192):i&&(t.flags|=8192),i?(a&536870912)!==0&&(t.flags&128)===0&&(Ze(t),t.subtreeFlags&6&&(t.flags|=8192)):Ze(t),a=t.updateQueue,a!==null&&Es(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),i=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(i=t.memoizedState.cachePool.pool),i!==a&&(t.flags|=2048),e!==null&&j(Ya),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Mn(et),Ze(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function f1(e,t){switch(bu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Mn(et),fe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return xe(t),null;case 31:if(t.memoizedState!==null){if(Ht(t),t.alternate===null)throw Error(s(340));Ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Ht(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));Ua()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return j(Fe),null;case 4:return fe(),null;case 10:return Mn(t.type),null;case 22:case 23:return Ht(t),Hu(),e!==null&&j(Ya),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Mn(et),null;case 25:return null;default:return null}}function ug(e,t){switch(bu(t),t.tag){case 3:Mn(et),fe();break;case 26:case 27:case 5:xe(t);break;case 4:fe();break;case 31:t.memoizedState!==null&&Ht(t);break;case 13:Ht(t);break;case 19:j(Fe);break;case 10:Mn(t.type);break;case 22:case 23:Ht(t),Hu(),e!==null&&j(Ya);break;case 24:Mn(et)}}function Ui(e,t){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var u=i.next;a=u;do{if((a.tag&e)===e){i=void 0;var c=a.create,p=a.inst;i=c(),p.destroy=i}a=a.next}while(a!==u)}}catch(S){Be(t,t.return,S)}}function sa(e,t,a){try{var i=t.updateQueue,u=i!==null?i.lastEffect:null;if(u!==null){var c=u.next;i=c;do{if((i.tag&e)===e){var p=i.inst,S=p.destroy;if(S!==void 0){p.destroy=void 0,u=t;var R=a,k=S;try{k()}catch(ae){Be(u,R,ae)}}}i=i.next}while(i!==c)}}catch(ae){Be(t,t.return,ae)}}function cg(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{eh(t,a)}catch(i){Be(e,e.return,i)}}}function fg(e,t,a){a.props=Qa(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(i){Be(e,t,i)}}function qi(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var i=e.stateNode;break;case 30:i=e.stateNode;break;default:i=e.stateNode}typeof a=="function"?e.refCleanup=a(i):a.current=i}}catch(u){Be(e,t,u)}}function cn(e,t){var a=e.ref,i=e.refCleanup;if(a!==null)if(typeof i=="function")try{i()}catch(u){Be(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(u){Be(e,t,u)}else a.current=null}function dg(e){var t=e.type,a=e.memoizedProps,i=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&i.focus();break e;case"img":a.src?i.src=a.src:a.srcSet&&(i.srcset=a.srcSet)}}catch(u){Be(e,e.return,u)}}function dc(e,t,a){try{var i=e.stateNode;R1(i,e.type,a,t),i[mt]=t}catch(u){Be(e,e.return,u)}}function hg(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ga(e.type)||e.tag===4}function hc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||hg(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&ga(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function gc(e,t,a){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=En));else if(i!==4&&(i===27&&ga(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(gc(e,t,a),e=e.sibling;e!==null;)gc(e,t,a),e=e.sibling}function ws(e,t,a){var i=e.tag;if(i===5||i===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(i!==4&&(i===27&&ga(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(ws(e,t,a),e=e.sibling;e!==null;)ws(e,t,a),e=e.sibling}function gg(e){var t=e.stateNode,a=e.memoizedProps;try{for(var i=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);gt(t,i,a),t[it]=e,t[mt]=a}catch(c){Be(e,e.return,c)}}var Rn=!1,at=!1,mc=!1,mg=typeof WeakSet=="function"?WeakSet:Set,rt=null;function d1(e,t){if(e=e.containerInfo,Lc=Is,e=Td(e),ru(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var i=a.getSelection&&a.getSelection();if(i&&i.rangeCount!==0){a=i.anchorNode;var u=i.anchorOffset,c=i.focusNode;i=i.focusOffset;try{a.nodeType,c.nodeType}catch{a=null;break e}var p=0,S=-1,R=-1,k=0,ae=0,oe=e,K=null;t:for(;;){for(var P;oe!==a||u!==0&&oe.nodeType!==3||(S=p+u),oe!==c||i!==0&&oe.nodeType!==3||(R=p+i),oe.nodeType===3&&(p+=oe.nodeValue.length),(P=oe.firstChild)!==null;)K=oe,oe=P;for(;;){if(oe===e)break t;if(K===a&&++k===u&&(S=p),K===c&&++ae===i&&(R=p),(P=oe.nextSibling)!==null)break;oe=K,K=oe.parentNode}oe=P}a=S===-1||R===-1?null:{start:S,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(Bc={focusedElem:e,selectionRange:a},Is=!1,rt=t;rt!==null;)if(t=rt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,rt=e;else for(;rt!==null;){switch(t=rt,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)u=e[a],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,a=t,u=c.memoizedProps,c=c.memoizedState,i=a.stateNode;try{var he=Qa(a.type,u);e=i.getSnapshotBeforeUpdate(he,c),i.__reactInternalSnapshotBeforeUpdate=e}catch(ve){Be(a,a.return,ve)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Gc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Gc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(s(163))}if(e=t.sibling,e!==null){e.return=t.return,rt=e;break}rt=t.return}}function pg(e,t,a){var i=a.flags;switch(a.tag){case 0:case 11:case 15:jn(e,a),i&4&&Ui(5,a);break;case 1:if(jn(e,a),i&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(p){Be(a,a.return,p)}else{var u=Qa(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(p){Be(a,a.return,p)}}i&64&&cg(a),i&512&&qi(a,a.return);break;case 3:if(jn(e,a),i&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{eh(e,t)}catch(p){Be(a,a.return,p)}}break;case 27:t===null&&i&4&&gg(a);case 26:case 5:jn(e,a),t===null&&i&4&&dg(a),i&512&&qi(a,a.return);break;case 12:jn(e,a);break;case 31:jn(e,a),i&4&&bg(e,a);break;case 13:jn(e,a),i&4&&Sg(e,a),i&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=x1.bind(null,a),Y1(e,a))));break;case 22:if(i=a.memoizedState!==null||Rn,!i){t=t!==null&&t.memoizedState!==null||at,u=Rn;var c=at;Rn=i,(at=t)&&!c?Ln(e,a,(a.subtreeFlags&8772)!==0):jn(e,a),Rn=u,at=c}break;case 30:break;default:jn(e,a)}}function yg(e){var t=e.alternate;t!==null&&(e.alternate=null,yg(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&fi(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Qe=null,Et=!1;function Hn(e,t,a){for(a=a.child;a!==null;)vg(e,t,a),a=a.sibling}function vg(e,t,a){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(Ta,a)}catch{}switch(a.tag){case 26:at||cn(a,t),Hn(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:at||cn(a,t);var i=Qe,u=Et;ga(a.type)&&(Qe=a.stateNode,Et=!1),Hn(e,t,a),$i(a.stateNode),Qe=i,Et=u;break;case 5:at||cn(a,t);case 6:if(i=Qe,u=Et,Qe=null,Hn(e,t,a),Qe=i,Et=u,Qe!==null)if(Et)try{(Qe.nodeType===9?Qe.body:Qe.nodeName==="HTML"?Qe.ownerDocument.body:Qe).removeChild(a.stateNode)}catch(c){Be(a,t,c)}else try{Qe.removeChild(a.stateNode)}catch(c){Be(a,t,c)}break;case 18:Qe!==null&&(Et?(e=Qe,cm(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Il(e)):cm(Qe,a.stateNode));break;case 4:i=Qe,u=Et,Qe=a.stateNode.containerInfo,Et=!0,Hn(e,t,a),Qe=i,Et=u;break;case 0:case 11:case 14:case 15:sa(2,a,t),at||sa(4,a,t),Hn(e,t,a);break;case 1:at||(cn(a,t),i=a.stateNode,typeof i.componentWillUnmount=="function"&&fg(a,t,i)),Hn(e,t,a);break;case 21:Hn(e,t,a);break;case 22:at=(i=at)||a.memoizedState!==null,Hn(e,t,a),at=i;break;default:Hn(e,t,a)}}function bg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Il(e)}catch(a){Be(t,t.return,a)}}}function Sg(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Il(e)}catch(a){Be(t,t.return,a)}}function h1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new mg),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new mg),t;default:throw Error(s(435,e.tag))}}function Ns(e,t){var a=h1(e);t.forEach(function(i){if(!a.has(i)){a.add(i);var u=_1.bind(null,e,i);i.then(u,u)}})}function wt(e,t){var a=t.deletions;if(a!==null)for(var i=0;i<a.length;i++){var u=a[i],c=e,p=t,S=p;e:for(;S!==null;){switch(S.tag){case 27:if(ga(S.type)){Qe=S.stateNode,Et=!1;break e}break;case 5:Qe=S.stateNode,Et=!1;break e;case 3:case 4:Qe=S.stateNode.containerInfo,Et=!0;break e}S=S.return}if(Qe===null)throw Error(s(160));vg(c,p,u),Qe=null,Et=!1,c=u.alternate,c!==null&&(c.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)xg(t,e),t=t.sibling}var Wt=null;function xg(e,t){var a=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:wt(t,e),Nt(e),i&4&&(sa(3,e,e.return),Ui(3,e),sa(5,e,e.return));break;case 1:wt(t,e),Nt(e),i&512&&(at||a===null||cn(a,a.return)),i&64&&Rn&&(e=e.updateQueue,e!==null&&(i=e.callbacks,i!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?i:a.concat(i))));break;case 26:var u=Wt;if(wt(t,e),Nt(e),i&512&&(at||a===null||cn(a,a.return)),i&4){var c=a!==null?a.memoizedState:null;if(i=e.memoizedState,a===null)if(i===null)if(e.stateNode===null){e:{i=e.type,a=e.memoizedProps,u=u.ownerDocument||u;t:switch(i){case"title":c=u.getElementsByTagName("title")[0],(!c||c[za]||c[it]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=u.createElement(i),u.head.insertBefore(c,u.querySelector("head > title"))),gt(c,i,a),c[it]=e,Pe(c),i=c;break e;case"link":var p=xm("link","href",u).get(i+(a.href||""));if(p){for(var S=0;S<p.length;S++)if(c=p[S],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(S,1);break t}}c=u.createElement(i),gt(c,i,a),u.head.appendChild(c);break;case"meta":if(p=xm("meta","content",u).get(i+(a.content||""))){for(S=0;S<p.length;S++)if(c=p[S],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(S,1);break t}}c=u.createElement(i),gt(c,i,a),u.head.appendChild(c);break;default:throw Error(s(468,i))}c[it]=e,Pe(c),i=c}e.stateNode=i}else _m(u,e.type,e.stateNode);else e.stateNode=Sm(u,i,e.memoizedProps);else c!==i?(c===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):c.count--,i===null?_m(u,e.type,e.stateNode):Sm(u,i,e.memoizedProps)):i===null&&e.stateNode!==null&&dc(e,e.memoizedProps,a.memoizedProps)}break;case 27:wt(t,e),Nt(e),i&512&&(at||a===null||cn(a,a.return)),a!==null&&i&4&&dc(e,e.memoizedProps,a.memoizedProps);break;case 5:if(wt(t,e),Nt(e),i&512&&(at||a===null||cn(a,a.return)),e.flags&32){u=e.stateNode;try{gl(u,"")}catch(he){Be(e,e.return,he)}}i&4&&e.stateNode!=null&&(u=e.memoizedProps,dc(e,u,a!==null?a.memoizedProps:u)),i&1024&&(mc=!0);break;case 6:if(wt(t,e),Nt(e),i&4){if(e.stateNode===null)throw Error(s(162));i=e.memoizedProps,a=e.stateNode;try{a.nodeValue=i}catch(he){Be(e,e.return,he)}}break;case 3:if(Ys=null,u=Wt,Wt=qs(t.containerInfo),wt(t,e),Wt=u,Nt(e),i&4&&a!==null&&a.memoizedState.isDehydrated)try{Il(t.containerInfo)}catch(he){Be(e,e.return,he)}mc&&(mc=!1,_g(e));break;case 4:i=Wt,Wt=qs(e.stateNode.containerInfo),wt(t,e),Nt(e),Wt=i;break;case 12:wt(t,e),Nt(e);break;case 31:wt(t,e),Nt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Ns(e,i)));break;case 13:wt(t,e),Nt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Ts=ct()),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Ns(e,i)));break;case 22:u=e.memoizedState!==null;var R=a!==null&&a.memoizedState!==null,k=Rn,ae=at;if(Rn=k||u,at=ae||R,wt(t,e),at=ae,Rn=k,Nt(e),i&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(a===null||R||Rn||at||ka(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){R=a=t;try{if(c=R.stateNode,u)p=c.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none";else{S=R.stateNode;var oe=R.memoizedProps.style,K=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;S.style.display=K==null||typeof K=="boolean"?"":(""+K).trim()}}catch(he){Be(R,R.return,he)}}}else if(t.tag===6){if(a===null){R=t;try{R.stateNode.nodeValue=u?"":R.memoizedProps}catch(he){Be(R,R.return,he)}}}else if(t.tag===18){if(a===null){R=t;try{var P=R.stateNode;u?fm(P,!0):fm(R.stateNode,!1)}catch(he){Be(R,R.return,he)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}i&4&&(i=e.updateQueue,i!==null&&(a=i.retryQueue,a!==null&&(i.retryQueue=null,Ns(e,a))));break;case 19:wt(t,e),Nt(e),i&4&&(i=e.updateQueue,i!==null&&(e.updateQueue=null,Ns(e,i)));break;case 30:break;case 21:break;default:wt(t,e),Nt(e)}}function Nt(e){var t=e.flags;if(t&2){try{for(var a,i=e.return;i!==null;){if(hg(i)){a=i;break}i=i.return}if(a==null)throw Error(s(160));switch(a.tag){case 27:var u=a.stateNode,c=hc(e);ws(e,c,u);break;case 5:var p=a.stateNode;a.flags&32&&(gl(p,""),a.flags&=-33);var S=hc(e);ws(e,S,p);break;case 3:case 4:var R=a.stateNode.containerInfo,k=hc(e);gc(e,k,R);break;default:throw Error(s(161))}}catch(ae){Be(e,e.return,ae)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function _g(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;_g(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function jn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)pg(e,t.alternate,t),t=t.sibling}function ka(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:sa(4,t,t.return),ka(t);break;case 1:cn(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&fg(t,t.return,a),ka(t);break;case 27:$i(t.stateNode);case 26:case 5:cn(t,t.return),ka(t);break;case 22:t.memoizedState===null&&ka(t);break;case 30:ka(t);break;default:ka(t)}e=e.sibling}}function Ln(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var i=t.alternate,u=e,c=t,p=c.flags;switch(c.tag){case 0:case 11:case 15:Ln(u,c,a),Ui(4,c);break;case 1:if(Ln(u,c,a),i=c,u=i.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(k){Be(i,i.return,k)}if(i=c,u=i.updateQueue,u!==null){var S=i.stateNode;try{var R=u.shared.hiddenCallbacks;if(R!==null)for(u.shared.hiddenCallbacks=null,u=0;u<R.length;u++)Pd(R[u],S)}catch(k){Be(i,i.return,k)}}a&&p&64&&cg(c),qi(c,c.return);break;case 27:gg(c);case 26:case 5:Ln(u,c,a),a&&i===null&&p&4&&dg(c),qi(c,c.return);break;case 12:Ln(u,c,a);break;case 31:Ln(u,c,a),a&&p&4&&bg(u,c);break;case 13:Ln(u,c,a),a&&p&4&&Sg(u,c);break;case 22:c.memoizedState===null&&Ln(u,c,a),qi(c,c.return);break;case 30:break;default:Ln(u,c,a)}t=t.sibling}}function pc(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Ni(a))}function yc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ni(e))}function Pt(e,t,a,i){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Eg(e,t,a,i),t=t.sibling}function Eg(e,t,a,i){var u=t.flags;switch(t.tag){case 0:case 11:case 15:Pt(e,t,a,i),u&2048&&Ui(9,t);break;case 1:Pt(e,t,a,i);break;case 3:Pt(e,t,a,i),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ni(e)));break;case 12:if(u&2048){Pt(e,t,a,i),e=t.stateNode;try{var c=t.memoizedProps,p=c.id,S=c.onPostCommit;typeof S=="function"&&S(p,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(R){Be(t,t.return,R)}}else Pt(e,t,a,i);break;case 31:Pt(e,t,a,i);break;case 13:Pt(e,t,a,i);break;case 23:break;case 22:c=t.stateNode,p=t.alternate,t.memoizedState!==null?c._visibility&2?Pt(e,t,a,i):Gi(e,t):c._visibility&2?Pt(e,t,a,i):(c._visibility|=2,Hl(e,t,a,i,(t.subtreeFlags&10256)!==0||!1)),u&2048&&pc(p,t);break;case 24:Pt(e,t,a,i),u&2048&&yc(t.alternate,t);break;default:Pt(e,t,a,i)}}function Hl(e,t,a,i,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,p=t,S=a,R=i,k=p.flags;switch(p.tag){case 0:case 11:case 15:Hl(c,p,S,R,u),Ui(8,p);break;case 23:break;case 22:var ae=p.stateNode;p.memoizedState!==null?ae._visibility&2?Hl(c,p,S,R,u):Gi(c,p):(ae._visibility|=2,Hl(c,p,S,R,u)),u&&k&2048&&pc(p.alternate,p);break;case 24:Hl(c,p,S,R,u),u&&k&2048&&yc(p.alternate,p);break;default:Hl(c,p,S,R,u)}t=t.sibling}}function Gi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,i=t,u=i.flags;switch(i.tag){case 22:Gi(a,i),u&2048&&pc(i.alternate,i);break;case 24:Gi(a,i),u&2048&&yc(i.alternate,i);break;default:Gi(a,i)}t=t.sibling}}var Yi=8192;function jl(e,t,a){if(e.subtreeFlags&Yi)for(e=e.child;e!==null;)wg(e,t,a),e=e.sibling}function wg(e,t,a){switch(e.tag){case 26:jl(e,t,a),e.flags&Yi&&e.memoizedState!==null&&P1(a,Wt,e.memoizedState,e.memoizedProps);break;case 5:jl(e,t,a);break;case 3:case 4:var i=Wt;Wt=qs(e.stateNode.containerInfo),jl(e,t,a),Wt=i;break;case 22:e.memoizedState===null&&(i=e.alternate,i!==null&&i.memoizedState!==null?(i=Yi,Yi=16777216,jl(e,t,a),Yi=i):jl(e,t,a));break;default:jl(e,t,a)}}function Ng(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Vi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var i=t[a];rt=i,Tg(i,e)}Ng(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ag(e),e=e.sibling}function Ag(e){switch(e.tag){case 0:case 11:case 15:Vi(e),e.flags&2048&&sa(9,e,e.return);break;case 3:Vi(e);break;case 12:Vi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,As(e)):Vi(e);break;default:Vi(e)}}function As(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var i=t[a];rt=i,Tg(i,e)}Ng(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:sa(8,t,t.return),As(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,As(t));break;default:As(t)}e=e.sibling}}function Tg(e,t){for(;rt!==null;){var a=rt;switch(a.tag){case 0:case 11:case 15:sa(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var i=a.memoizedState.cachePool.pool;i!=null&&i.refCount++}break;case 24:Ni(a.memoizedState.cache)}if(i=a.child,i!==null)i.return=a,rt=i;else e:for(a=e;rt!==null;){i=rt;var u=i.sibling,c=i.return;if(yg(i),i===a){rt=null;break e}if(u!==null){u.return=c,rt=u;break e}rt=c}}}var g1={getCacheForType:function(e){var t=dt(et),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return dt(et).controller.signal}},m1=typeof WeakMap=="function"?WeakMap:Map,He=0,Ve=null,Ne=null,Me=0,Le=0,jt=null,ra=!1,Ll=!1,vc=!1,Bn=0,Je=0,ua=0,$a=0,bc=0,Lt=0,Bl=0,Xi=null,At=null,Sc=!1,Ts=0,Mg=0,Ms=1/0,Cs=null,ca=null,ot=0,fa=null,Ul=null,Un=0,xc=0,_c=null,Cg=null,Zi=0,Ec=null;function Bt(){return(He&2)!==0&&Me!==0?Me&-Me:A.T!==null?Cc():Ro()}function zg(){if(Lt===0)if((Me&536870912)===0||ze){var e=sl;sl<<=1,(sl&3932160)===0&&(sl=262144),Lt=e}else Lt=536870912;return e=Rt.current,e!==null&&(e.flags|=32),Lt}function Tt(e,t,a){(e===Ve&&(Le===2||Le===9)||e.cancelPendingCommit!==null)&&(ql(e,0),da(e,Me,Lt,!1)),Ca(e,a),((He&2)===0||e!==Ve)&&(e===Ve&&((He&2)===0&&($a|=a),Je===4&&da(e,Me,Lt,!1)),fn(e))}function Dg(e,t,a){if((He&6)!==0)throw Error(s(327));var i=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Ma(e,t),u=i?v1(e,t):Nc(e,t,!0),c=i;do{if(u===0){Ll&&!i&&da(e,t,0,!1);break}else{if(a=e.current.alternate,c&&!p1(a)){u=Nc(e,t,!1),c=!1;continue}if(u===2){if(c=t,e.errorRecoveryDisabledLanes&c)var p=0;else p=e.pendingLanes&-536870913,p=p!==0?p:p&536870912?536870912:0;if(p!==0){t=p;e:{var S=e;u=Xi;var R=S.current.memoizedState.isDehydrated;if(R&&(ql(S,p).flags|=256),p=Nc(S,p,!1),p!==2){if(vc&&!R){S.errorRecoveryDisabledLanes|=c,$a|=c,u=4;break e}c=At,At=u,c!==null&&(At===null?At=c:At.push.apply(At,c))}u=p}if(c=!1,u!==2)continue}}if(u===1){ql(e,0),da(e,t,0,!0);break}e:{switch(i=e,c=u,c){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:da(i,t,Lt,!ra);break e;case 2:At=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(u=Ts+300-ct(),10<u)){if(da(i,t,Lt,!ra),ul(i,0,!0)!==0)break e;Un=t,i.timeoutHandle=rm(Og.bind(null,i,a,At,Cs,Sc,t,Lt,$a,Bl,ra,c,"Throttled",-0,0),u);break e}Og(i,a,At,Cs,Sc,t,Lt,$a,Bl,ra,c,null,-0,0)}}break}while(!0);fn(e)}function Og(e,t,a,i,u,c,p,S,R,k,ae,oe,K,P){if(e.timeoutHandle=-1,oe=t.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:En},wg(t,c,oe);var he=(c&62914560)===c?Ts-ct():(c&4194048)===c?Mg-ct():0;if(he=eb(oe,he),he!==null){Un=c,e.cancelPendingCommit=he(Gg.bind(null,e,t,c,a,i,u,p,S,R,ae,oe,null,K,P)),da(e,c,p,!k);return}}Gg(e,t,c,a,i,u,p,S,R)}function p1(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var i=0;i<a.length;i++){var u=a[i],c=u.getSnapshot;u=u.value;try{if(!Dt(c(),u))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function da(e,t,a,i){t&=~bc,t&=~$a,e.suspendedLanes|=t,e.pingedLanes&=~t,i&&(e.warmLanes|=t),i=e.expirationTimes;for(var u=t;0<u;){var c=31-vt(u),p=1<<c;i[c]=-1,u&=~p}a!==0&&zo(e,a,t)}function zs(){return(He&6)===0?(Ii(0),!1):!0}function wc(){if(Ne!==null){if(Le===0)var e=Ne.return;else e=Ne,Tn=qa=null,Gu(e),Cl=null,Ti=0,e=Ne;for(;e!==null;)ug(e.alternate,e),e=e.return;Ne=null}}function ql(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,L1(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Un=0,wc(),Ve=e,Ne=a=Nn(e.current,null),Me=t,Le=0,jt=null,ra=!1,Ll=Ma(e,t),vc=!1,Bl=Lt=bc=$a=ua=Je=0,At=Xi=null,Sc=!1,(t&8)!==0&&(t|=t&32);var i=e.entangledLanes;if(i!==0)for(e=e.entanglements,i&=t;0<i;){var u=31-vt(i),c=1<<u;t|=e[u],i&=~c}return Bn=t,Fo(),a}function Rg(e,t){_e=null,A.H=ji,t===Ml||t===is?(t=Kd(),Le=3):t===Mu?(t=Kd(),Le=4):Le=t===nc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,jt=t,Ne===null&&(Je=1,bs(e,Yt(t,e.current)))}function Hg(){var e=Rt.current;return e===null?!0:(Me&4194048)===Me?It===null:(Me&62914560)===Me||(Me&536870912)!==0?e===It:!1}function jg(){var e=A.H;return A.H=ji,e===null?ji:e}function Lg(){var e=A.A;return A.A=g1,e}function Ds(){Je=4,ra||(Me&4194048)!==Me&&Rt.current!==null||(Ll=!0),(ua&134217727)===0&&($a&134217727)===0||Ve===null||da(Ve,Me,Lt,!1)}function Nc(e,t,a){var i=He;He|=2;var u=jg(),c=Lg();(Ve!==e||Me!==t)&&(Cs=null,ql(e,t)),t=!1;var p=Je;e:do try{if(Le!==0&&Ne!==null){var S=Ne,R=jt;switch(Le){case 8:wc(),p=6;break e;case 3:case 2:case 9:case 6:Rt.current===null&&(t=!0);var k=Le;if(Le=0,jt=null,Gl(e,S,R,k),a&&Ll){p=0;break e}break;default:k=Le,Le=0,jt=null,Gl(e,S,R,k)}}y1(),p=Je;break}catch(ae){Rg(e,ae)}while(!0);return t&&e.shellSuspendCounter++,Tn=qa=null,He=i,A.H=u,A.A=c,Ne===null&&(Ve=null,Me=0,Fo()),p}function y1(){for(;Ne!==null;)Bg(Ne)}function v1(e,t){var a=He;He|=2;var i=jg(),u=Lg();Ve!==e||Me!==t?(Cs=null,Ms=ct()+500,ql(e,t)):Ll=Ma(e,t);e:do try{if(Le!==0&&Ne!==null){t=Ne;var c=jt;t:switch(Le){case 1:Le=0,jt=null,Gl(e,t,c,1);break;case 2:case 9:if(kd(c)){Le=0,jt=null,Ug(t);break}t=function(){Le!==2&&Le!==9||Ve!==e||(Le=7),fn(e)},c.then(t,t);break e;case 3:Le=7;break e;case 4:Le=5;break e;case 7:kd(c)?(Le=0,jt=null,Ug(t)):(Le=0,jt=null,Gl(e,t,c,7));break;case 5:var p=null;switch(Ne.tag){case 26:p=Ne.memoizedState;case 5:case 27:var S=Ne;if(p?Em(p):S.stateNode.complete){Le=0,jt=null;var R=S.sibling;if(R!==null)Ne=R;else{var k=S.return;k!==null?(Ne=k,Os(k)):Ne=null}break t}}Le=0,jt=null,Gl(e,t,c,5);break;case 6:Le=0,jt=null,Gl(e,t,c,6);break;case 8:wc(),Je=6;break e;default:throw Error(s(462))}}b1();break}catch(ae){Rg(e,ae)}while(!0);return Tn=qa=null,A.H=i,A.A=u,He=a,Ne!==null?0:(Ve=null,Me=0,Fo(),Je)}function b1(){for(;Ne!==null&&!wa();)Bg(Ne)}function Bg(e){var t=sg(e.alternate,e,Bn);e.memoizedProps=e.pendingProps,t===null?Os(e):Ne=t}function Ug(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=tg(a,t,t.pendingProps,t.type,void 0,Me);break;case 11:t=tg(a,t,t.pendingProps,t.type.render,t.ref,Me);break;case 5:Gu(t);default:ug(a,t),t=Ne=Ld(t,Bn),t=sg(a,t,Bn)}e.memoizedProps=e.pendingProps,t===null?Os(e):Ne=t}function Gl(e,t,a,i){Tn=qa=null,Gu(t),Cl=null,Ti=0;var u=t.return;try{if(s1(e,u,t,a,Me)){Je=1,bs(e,Yt(a,e.current)),Ne=null;return}}catch(c){if(u!==null)throw Ne=u,c;Je=1,bs(e,Yt(a,e.current)),Ne=null;return}t.flags&32768?(ze||i===1?e=!0:Ll||(Me&536870912)!==0?e=!1:(ra=e=!0,(i===2||i===9||i===3||i===6)&&(i=Rt.current,i!==null&&i.tag===13&&(i.flags|=16384))),qg(t,e)):Os(t)}function Os(e){var t=e;do{if((t.flags&32768)!==0){qg(t,ra);return}e=t.return;var a=c1(t.alternate,t,Bn);if(a!==null){Ne=a;return}if(t=t.sibling,t!==null){Ne=t;return}Ne=t=e}while(t!==null);Je===0&&(Je=5)}function qg(e,t){do{var a=f1(e.alternate,e);if(a!==null){a.flags&=32767,Ne=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ne=e;return}Ne=e=a}while(e!==null);Je=6,Ne=null}function Gg(e,t,a,i,u,c,p,S,R){e.cancelPendingCommit=null;do Rs();while(ot!==0);if((He&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(c=t.lanes|t.childLanes,c|=hu,Xr(e,a,c,p,S,R),e===Ve&&(Ne=Ve=null,Me=0),Ul=t,fa=e,Un=a,xc=c,_c=u,Cg=i,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,E1(Aa,function(){return Ig(),null})):(e.callbackNode=null,e.callbackPriority=0),i=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||i){i=A.T,A.T=null,u=H.p,H.p=2,p=He,He|=4;try{d1(e,t,a)}finally{He=p,H.p=u,A.T=i}}ot=1,Yg(),Vg(),Xg()}}function Yg(){if(ot===1){ot=0;var e=fa,t=Ul,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=A.T,A.T=null;var i=H.p;H.p=2;var u=He;He|=4;try{xg(t,e);var c=Bc,p=Td(e.containerInfo),S=c.focusedElem,R=c.selectionRange;if(p!==S&&S&&S.ownerDocument&&Ad(S.ownerDocument.documentElement,S)){if(R!==null&&ru(S)){var k=R.start,ae=R.end;if(ae===void 0&&(ae=k),"selectionStart"in S)S.selectionStart=k,S.selectionEnd=Math.min(ae,S.value.length);else{var oe=S.ownerDocument||document,K=oe&&oe.defaultView||window;if(K.getSelection){var P=K.getSelection(),he=S.textContent.length,ve=Math.min(R.start,he),Ye=R.end===void 0?ve:Math.min(R.end,he);!P.extend&&ve>Ye&&(p=Ye,Ye=ve,ve=p);var V=Nd(S,ve),L=Nd(S,Ye);if(V&&L&&(P.rangeCount!==1||P.anchorNode!==V.node||P.anchorOffset!==V.offset||P.focusNode!==L.node||P.focusOffset!==L.offset)){var Q=oe.createRange();Q.setStart(V.node,V.offset),P.removeAllRanges(),ve>Ye?(P.addRange(Q),P.extend(L.node,L.offset)):(Q.setEnd(L.node,L.offset),P.addRange(Q))}}}}for(oe=[],P=S;P=P.parentNode;)P.nodeType===1&&oe.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<oe.length;S++){var ie=oe[S];ie.element.scrollLeft=ie.left,ie.element.scrollTop=ie.top}}Is=!!Lc,Bc=Lc=null}finally{He=u,H.p=i,A.T=a}}e.current=t,ot=2}}function Vg(){if(ot===2){ot=0;var e=fa,t=Ul,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=A.T,A.T=null;var i=H.p;H.p=2;var u=He;He|=4;try{pg(e,t.alternate,t)}finally{He=u,H.p=i,A.T=a}}ot=3}}function Xg(){if(ot===4||ot===3){ot=0,Na();var e=fa,t=Ul,a=Un,i=Cg;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?ot=5:(ot=0,Ul=fa=null,Zg(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(ca=null),ci(a),t=t.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(Ta,t,void 0,(t.current.flags&128)===128)}catch{}if(i!==null){t=A.T,u=H.p,H.p=2,A.T=null;try{for(var c=e.onRecoverableError,p=0;p<i.length;p++){var S=i[p];c(S.value,{componentStack:S.stack})}}finally{A.T=t,H.p=u}}(Un&3)!==0&&Rs(),fn(e),u=e.pendingLanes,(a&261930)!==0&&(u&42)!==0?e===Ec?Zi++:(Zi=0,Ec=e):Zi=0,Ii(0)}}function Zg(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ni(t)))}function Rs(){return Yg(),Vg(),Xg(),Ig()}function Ig(){if(ot!==5)return!1;var e=fa,t=xc;xc=0;var a=ci(Un),i=A.T,u=H.p;try{H.p=32>a?32:a,A.T=null,a=_c,_c=null;var c=fa,p=Un;if(ot=0,Ul=fa=null,Un=0,(He&6)!==0)throw Error(s(331));var S=He;if(He|=4,Ag(c.current),Eg(c,c.current,p,a),He=S,Ii(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(Ta,c)}catch{}return!0}finally{H.p=u,A.T=i,Zg(e,t)}}function Qg(e,t,a){t=Yt(a,t),t=tc(e.stateNode,t,2),e=la(e,t,2),e!==null&&(Ca(e,2),fn(e))}function Be(e,t,a){if(e.tag===3)Qg(e,e,a);else for(;t!==null;){if(t.tag===3){Qg(t,e,a);break}else if(t.tag===1){var i=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof i.componentDidCatch=="function"&&(ca===null||!ca.has(i))){e=Yt(a,e),a=kh(2),i=la(t,a,2),i!==null&&($h(a,i,t,e),Ca(i,2),fn(i));break}}t=t.return}}function Ac(e,t,a){var i=e.pingCache;if(i===null){i=e.pingCache=new m1;var u=new Set;i.set(t,u)}else u=i.get(t),u===void 0&&(u=new Set,i.set(t,u));u.has(a)||(vc=!0,u.add(a),e=S1.bind(null,e,t,a),t.then(e,e))}function S1(e,t,a){var i=e.pingCache;i!==null&&i.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Ve===e&&(Me&a)===a&&(Je===4||Je===3&&(Me&62914560)===Me&&300>ct()-Ts?(He&2)===0&&ql(e,0):bc|=a,Bl===Me&&(Bl=0)),fn(e)}function kg(e,t){t===0&&(t=Co()),e=La(e,t),e!==null&&(Ca(e,t),fn(e))}function x1(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),kg(e,a)}function _1(e,t){var a=0;switch(e.tag){case 31:case 13:var i=e.stateNode,u=e.memoizedState;u!==null&&(a=u.retryLane);break;case 19:i=e.stateNode;break;case 22:i=e.stateNode._retryCache;break;default:throw Error(s(314))}i!==null&&i.delete(t),kg(e,a)}function E1(e,t){return Kt(e,t)}var Hs=null,Yl=null,Tc=!1,js=!1,Mc=!1,ha=0;function fn(e){e!==Yl&&e.next===null&&(Yl===null?Hs=Yl=e:Yl=Yl.next=e),js=!0,Tc||(Tc=!0,N1())}function Ii(e,t){if(!Mc&&js){Mc=!0;do for(var a=!1,i=Hs;i!==null;){if(e!==0){var u=i.pendingLanes;if(u===0)var c=0;else{var p=i.suspendedLanes,S=i.pingedLanes;c=(1<<31-vt(42|e)+1)-1,c&=u&~(p&~S),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(a=!0,Fg(i,c))}else c=Me,c=ul(i,i===Ve?c:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),(c&3)===0||Ma(i,c)||(a=!0,Fg(i,c));i=i.next}while(a);Mc=!1}}function w1(){$g()}function $g(){js=Tc=!1;var e=0;ha!==0&&j1()&&(e=ha);for(var t=ct(),a=null,i=Hs;i!==null;){var u=i.next,c=Kg(i,t);c===0?(i.next=null,a===null?Hs=u:a.next=u,u===null&&(Yl=a)):(a=i,(e!==0||(c&3)!==0)&&(js=!0)),i=u}ot!==0&&ot!==5||Ii(e),ha!==0&&(ha=0)}function Kg(e,t){for(var a=e.suspendedLanes,i=e.pingedLanes,u=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var p=31-vt(c),S=1<<p,R=u[p];R===-1?((S&a)===0||(S&i)!==0)&&(u[p]=Vr(S,t)):R<=t&&(e.expiredLanes|=S),c&=~S}if(t=Ve,a=Me,a=ul(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i=e.callbackNode,a===0||e===t&&(Le===2||Le===9)||e.cancelPendingCommit!==null)return i!==null&&i!==null&&yn(i),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Ma(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(i!==null&&yn(i),ci(a)){case 2:case 8:a=In;break;case 32:a=Aa;break;case 268435456:a=il;break;default:a=Aa}return i=Jg.bind(null,e),a=Kt(a,i),e.callbackPriority=t,e.callbackNode=a,t}return i!==null&&i!==null&&yn(i),e.callbackPriority=2,e.callbackNode=null,2}function Jg(e,t){if(ot!==0&&ot!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Rs()&&e.callbackNode!==a)return null;var i=Me;return i=ul(e,e===Ve?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),i===0?null:(Dg(e,i,t),Kg(e,ct()),e.callbackNode!=null&&e.callbackNode===a?Jg.bind(null,e):null)}function Fg(e,t){if(Rs())return null;Dg(e,t,!0)}function N1(){B1(function(){(He&6)!==0?Kt(vn,w1):$g()})}function Cc(){if(ha===0){var e=Al;e===0&&(e=ol,ol<<=1,(ol&261888)===0&&(ol=256)),ha=e}return ha}function Wg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Xo(""+e)}function Pg(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function A1(e,t,a,i,u){if(t==="submit"&&a&&a.stateNode===u){var c=Wg((u[mt]||null).action),p=i.submitter;p&&(t=(t=p[mt]||null)?Wg(t.formAction):p.getAttribute("formAction"),t!==null&&(c=t,p=null));var S=new ko("action","action",null,i,u);e.push({event:S,listeners:[{instance:null,listener:function(){if(i.defaultPrevented){if(ha!==0){var R=p?Pg(u,p):new FormData(u);Ku(a,{pending:!0,data:R,method:u.method,action:c},null,R)}}else typeof c=="function"&&(S.preventDefault(),R=p?Pg(u,p):new FormData(u),Ku(a,{pending:!0,data:R,method:u.method,action:c},c,R))},currentTarget:u}]})}}for(var zc=0;zc<du.length;zc++){var Dc=du[zc],T1=Dc.toLowerCase(),M1=Dc[0].toUpperCase()+Dc.slice(1);Ft(T1,"on"+M1)}Ft(zd,"onAnimationEnd"),Ft(Dd,"onAnimationIteration"),Ft(Od,"onAnimationStart"),Ft("dblclick","onDoubleClick"),Ft("focusin","onFocus"),Ft("focusout","onBlur"),Ft(Zv,"onTransitionRun"),Ft(Iv,"onTransitionStart"),Ft(Qv,"onTransitionCancel"),Ft(Rd,"onTransitionEnd"),Jn("onMouseEnter",["mouseout","mouseover"]),Jn("onMouseLeave",["mouseout","mouseover"]),Jn("onPointerEnter",["pointerout","pointerover"]),Jn("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 Qi="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(" "),C1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qi));function em(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var i=e[a],u=i.event;i=i.listeners;e:{var c=void 0;if(t)for(var p=i.length-1;0<=p;p--){var S=i[p],R=S.instance,k=S.currentTarget;if(S=S.listener,R!==c&&u.isPropagationStopped())break e;c=S,u.currentTarget=k;try{c(u)}catch(ae){Jo(ae)}u.currentTarget=null,c=R}else for(p=0;p<i.length;p++){if(S=i[p],R=S.instance,k=S.currentTarget,S=S.listener,R!==c&&u.isPropagationStopped())break e;c=S,u.currentTarget=k;try{c(u)}catch(ae){Jo(ae)}u.currentTarget=null,c=R}}}}function Ae(e,t){var a=t[cl];a===void 0&&(a=t[cl]=new Set);var i=e+"__bubble";a.has(i)||(tm(t,e,2,!1),a.add(i))}function Oc(e,t,a){var i=0;t&&(i|=4),tm(a,e,i,t)}var Ls="_reactListening"+Math.random().toString(36).slice(2);function Rc(e){if(!e[Ls]){e[Ls]=!0,Bo.forEach(function(a){a!=="selectionchange"&&(C1.has(a)||Oc(a,!1,e),Oc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ls]||(t[Ls]=!0,Oc("selectionchange",!1,t))}}function tm(e,t,a,i){switch(zm(t)){case 2:var u=ab;break;case 8:u=lb;break;default:u=$c}a=u.bind(null,t,a,e),u=void 0,!Pr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),i?u!==void 0?e.addEventListener(t,a,{capture:!0,passive:u}):e.addEventListener(t,a,!0):u!==void 0?e.addEventListener(t,a,{passive:u}):e.addEventListener(t,a,!1)}function Hc(e,t,a,i,u){var c=i;if((t&1)===0&&(t&2)===0&&i!==null)e:for(;;){if(i===null)return;var p=i.tag;if(p===3||p===4){var S=i.stateNode.containerInfo;if(S===u)break;if(p===4)for(p=i.return;p!==null;){var R=p.tag;if((R===3||R===4)&&p.stateNode.containerInfo===u)return;p=p.return}for(;S!==null;){if(p=Qn(S),p===null)return;if(R=p.tag,R===5||R===6||R===26||R===27){i=c=p;continue e}S=S.parentNode}}i=i.return}od(function(){var k=c,ae=Fr(a),oe=[];e:{var K=Hd.get(e);if(K!==void 0){var P=ko,he=e;switch(e){case"keypress":if(Io(a)===0)break e;case"keydown":case"keyup":P=_v;break;case"focusin":he="focus",P=au;break;case"focusout":he="blur",P=au;break;case"beforeblur":case"afterblur":P=au;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":P=ud;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":P=cv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":P=Nv;break;case zd:case Dd:case Od:P=hv;break;case Rd:P=Tv;break;case"scroll":case"scrollend":P=rv;break;case"wheel":P=Cv;break;case"copy":case"cut":case"paste":P=mv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":P=fd;break;case"toggle":case"beforetoggle":P=Dv}var ve=(t&4)!==0,Ye=!ve&&(e==="scroll"||e==="scrollend"),V=ve?K!==null?K+"Capture":null:K;ve=[];for(var L=k,Q;L!==null;){var ie=L;if(Q=ie.stateNode,ie=ie.tag,ie!==5&&ie!==26&&ie!==27||Q===null||V===null||(ie=gi(L,V),ie!=null&&ve.push(ki(L,ie,Q))),Ye)break;L=L.return}0<ve.length&&(K=new P(K,he,null,a,ae),oe.push({event:K,listeners:ve}))}}if((t&7)===0){e:{if(K=e==="mouseover"||e==="pointerover",P=e==="mouseout"||e==="pointerout",K&&a!==Jr&&(he=a.relatedTarget||a.fromElement)&&(Qn(he)||he[Sn]))break e;if((P||K)&&(K=ae.window===ae?ae:(K=ae.ownerDocument)?K.defaultView||K.parentWindow:window,P?(he=a.relatedTarget||a.toElement,P=k,he=he?Qn(he):null,he!==null&&(Ye=f(he),ve=he.tag,he!==Ye||ve!==5&&ve!==27&&ve!==6)&&(he=null)):(P=null,he=k),P!==he)){if(ve=ud,ie="onMouseLeave",V="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(ve=fd,ie="onPointerLeave",V="onPointerEnter",L="pointer"),Ye=P==null?K:$n(P),Q=he==null?K:$n(he),K=new ve(ie,L+"leave",P,a,ae),K.target=Ye,K.relatedTarget=Q,ie=null,Qn(ae)===k&&(ve=new ve(V,L+"enter",he,a,ae),ve.target=Q,ve.relatedTarget=Ye,ie=ve),Ye=ie,P&&he)t:{for(ve=z1,V=P,L=he,Q=0,ie=V;ie;ie=ve(ie))Q++;ie=0;for(var pe=L;pe;pe=ve(pe))ie++;for(;0<Q-ie;)V=ve(V),Q--;for(;0<ie-Q;)L=ve(L),ie--;for(;Q--;){if(V===L||L!==null&&V===L.alternate){ve=V;break t}V=ve(V),L=ve(L)}ve=null}else ve=null;P!==null&&nm(oe,K,P,ve,!1),he!==null&&Ye!==null&&nm(oe,Ye,he,ve,!0)}}e:{if(K=k?$n(k):window,P=K.nodeName&&K.nodeName.toLowerCase(),P==="select"||P==="input"&&K.type==="file")var Oe=bd;else if(yd(K))if(Sd)Oe=Yv;else{Oe=qv;var ge=Uv}else P=K.nodeName,!P||P.toLowerCase()!=="input"||K.type!=="checkbox"&&K.type!=="radio"?k&&Kr(k.elementType)&&(Oe=bd):Oe=Gv;if(Oe&&(Oe=Oe(e,k))){vd(oe,Oe,a,ae);break e}ge&&ge(e,K,k),e==="focusout"&&k&&K.type==="number"&&k.memoizedProps.value!=null&&hi(K,"number",K.value)}switch(ge=k?$n(k):window,e){case"focusin":(yd(ge)||ge.contentEditable==="true")&&(vl=ge,uu=k,_i=null);break;case"focusout":_i=uu=vl=null;break;case"mousedown":cu=!0;break;case"contextmenu":case"mouseup":case"dragend":cu=!1,Md(oe,a,ae);break;case"selectionchange":if(Xv)break;case"keydown":case"keyup":Md(oe,a,ae)}var we;if(iu)e:{switch(e){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else yl?md(e,a)&&(Ce="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ce="onCompositionStart");Ce&&(dd&&a.locale!=="ko"&&(yl||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&yl&&(we=sd()):(Fn=ae,eu="value"in Fn?Fn.value:Fn.textContent,yl=!0)),ge=Bs(k,Ce),0<ge.length&&(Ce=new cd(Ce,e,null,a,ae),oe.push({event:Ce,listeners:ge}),we?Ce.data=we:(we=pd(a),we!==null&&(Ce.data=we)))),(we=Rv?Hv(e,a):jv(e,a))&&(Ce=Bs(k,"onBeforeInput"),0<Ce.length&&(ge=new cd("onBeforeInput","beforeinput",null,a,ae),oe.push({event:ge,listeners:Ce}),ge.data=we)),A1(oe,e,k,a,ae)}em(oe,t)})}function ki(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Bs(e,t){for(var a=t+"Capture",i=[];e!==null;){var u=e,c=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||c===null||(u=gi(e,a),u!=null&&i.unshift(ki(e,u,c)),u=gi(e,t),u!=null&&i.push(ki(e,u,c))),e.tag===3)return i;e=e.return}return[]}function z1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function nm(e,t,a,i,u){for(var c=t._reactName,p=[];a!==null&&a!==i;){var S=a,R=S.alternate,k=S.stateNode;if(S=S.tag,R!==null&&R===i)break;S!==5&&S!==26&&S!==27||k===null||(R=k,u?(k=gi(a,c),k!=null&&p.unshift(ki(a,k,R))):u||(k=gi(a,c),k!=null&&p.push(ki(a,k,R)))),a=a.return}p.length!==0&&e.push({event:t,listeners:p})}var D1=/\r\n?/g,O1=/\u0000|\uFFFD/g;function am(e){return(typeof e=="string"?e:""+e).replace(D1,`
9
- `).replace(O1,"")}function lm(e,t){return t=am(t),am(e)===t}function Ge(e,t,a,i,u,c){switch(a){case"children":typeof i=="string"?t==="body"||t==="textarea"&&i===""||gl(e,i):(typeof i=="number"||typeof i=="bigint")&&t!=="body"&&gl(e,""+i);break;case"className":dl(e,"class",i);break;case"tabIndex":dl(e,"tabindex",i);break;case"dir":case"role":case"viewBox":case"width":case"height":dl(e,a,i);break;case"style":ld(e,i,c);break;case"data":if(t!=="object"){dl(e,"data",i);break}case"src":case"href":if(i===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(i==null||typeof i=="function"||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(a);break}i=Xo(""+i),e.setAttribute(a,i);break;case"action":case"formAction":if(typeof i=="function"){e.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(a==="formAction"?(t!=="input"&&Ge(e,t,"name",u.name,u,null),Ge(e,t,"formEncType",u.formEncType,u,null),Ge(e,t,"formMethod",u.formMethod,u,null),Ge(e,t,"formTarget",u.formTarget,u,null)):(Ge(e,t,"encType",u.encType,u,null),Ge(e,t,"method",u.method,u,null),Ge(e,t,"target",u.target,u,null)));if(i==null||typeof i=="symbol"||typeof i=="boolean"){e.removeAttribute(a);break}i=Xo(""+i),e.setAttribute(a,i);break;case"onClick":i!=null&&(e.onclick=En);break;case"onScroll":i!=null&&Ae("scroll",e);break;case"onScrollEnd":i!=null&&Ae("scrollend",e);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(a=i.__html,a!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"multiple":e.multiple=i&&typeof i!="function"&&typeof i!="symbol";break;case"muted":e.muted=i&&typeof i!="function"&&typeof i!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(i==null||typeof i=="function"||typeof i=="boolean"||typeof i=="symbol"){e.removeAttribute("xlink:href");break}a=Xo(""+i),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,""+i):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":i&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":i===!0?e.setAttribute(a,""):i!==!1&&i!=null&&typeof i!="function"&&typeof i!="symbol"?e.setAttribute(a,i):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":i!=null&&typeof i!="function"&&typeof i!="symbol"&&!isNaN(i)&&1<=i?e.setAttribute(a,i):e.removeAttribute(a);break;case"rowSpan":case"start":i==null||typeof i=="function"||typeof i=="symbol"||isNaN(i)?e.removeAttribute(a):e.setAttribute(a,i);break;case"popover":Ae("beforetoggle",e),Ae("toggle",e),fl(e,"popover",i);break;case"xlinkActuate":Jt(e,"http://www.w3.org/1999/xlink","xlink:actuate",i);break;case"xlinkArcrole":Jt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",i);break;case"xlinkRole":Jt(e,"http://www.w3.org/1999/xlink","xlink:role",i);break;case"xlinkShow":Jt(e,"http://www.w3.org/1999/xlink","xlink:show",i);break;case"xlinkTitle":Jt(e,"http://www.w3.org/1999/xlink","xlink:title",i);break;case"xlinkType":Jt(e,"http://www.w3.org/1999/xlink","xlink:type",i);break;case"xmlBase":Jt(e,"http://www.w3.org/XML/1998/namespace","xml:base",i);break;case"xmlLang":Jt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",i);break;case"xmlSpace":Jt(e,"http://www.w3.org/XML/1998/namespace","xml:space",i);break;case"is":fl(e,"is",i);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=ov.get(a)||a,fl(e,a,i))}}function jc(e,t,a,i,u,c){switch(a){case"style":ld(e,i,c);break;case"dangerouslySetInnerHTML":if(i!=null){if(typeof i!="object"||!("__html"in i))throw Error(s(61));if(a=i.__html,a!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=a}}break;case"children":typeof i=="string"?gl(e,i):(typeof i=="number"||typeof i=="bigint")&&gl(e,""+i);break;case"onScroll":i!=null&&Ae("scroll",e);break;case"onScrollEnd":i!=null&&Ae("scrollend",e);break;case"onClick":i!=null&&(e.onclick=En);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Uo.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(u=a.endsWith("Capture"),t=a.slice(2,u?a.length-7:void 0),c=e[mt]||null,c=c!=null?c[a]:null,typeof c=="function"&&e.removeEventListener(t,c,u),typeof i=="function")){typeof c!="function"&&c!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,i,u);break e}a in e?e[a]=i:i===!0?e.setAttribute(a,""):fl(e,a,i)}}}function gt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ae("error",e),Ae("load",e);var i=!1,u=!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":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Ge(e,t,c,p,a,null)}}u&&Ge(e,t,"srcSet",a.srcSet,a,null),i&&Ge(e,t,"src",a.src,a,null);return;case"input":Ae("invalid",e);var S=c=p=u=null,R=null,k=null;for(i in a)if(a.hasOwnProperty(i)){var ae=a[i];if(ae!=null)switch(i){case"name":u=ae;break;case"type":p=ae;break;case"checked":R=ae;break;case"defaultChecked":k=ae;break;case"value":c=ae;break;case"defaultValue":S=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(s(137,t));break;default:Ge(e,t,i,ae,a,null)}}Vo(e,c,S,R,k,p,u,!1);return;case"select":Ae("invalid",e),i=p=c=null;for(u in a)if(a.hasOwnProperty(u)&&(S=a[u],S!=null))switch(u){case"value":c=S;break;case"defaultValue":p=S;break;case"multiple":i=S;default:Ge(e,t,u,S,a,null)}t=c,a=p,e.multiple=!!i,t!=null?_n(e,!!i,t,!1):a!=null&&_n(e,!!i,a,!0);return;case"textarea":Ae("invalid",e),c=u=i=null;for(p in a)if(a.hasOwnProperty(p)&&(S=a[p],S!=null))switch(p){case"value":i=S;break;case"defaultValue":u=S;break;case"children":c=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(s(91));break;default:Ge(e,t,p,S,a,null)}nd(e,i,u,c);return;case"option":for(R in a)a.hasOwnProperty(R)&&(i=a[R],i!=null)&&(R==="selected"?e.selected=i&&typeof i!="function"&&typeof i!="symbol":Ge(e,t,R,i,a,null));return;case"dialog":Ae("beforetoggle",e),Ae("toggle",e),Ae("cancel",e),Ae("close",e);break;case"iframe":case"object":Ae("load",e);break;case"video":case"audio":for(i=0;i<Qi.length;i++)Ae(Qi[i],e);break;case"image":Ae("error",e),Ae("load",e);break;case"details":Ae("toggle",e);break;case"embed":case"source":case"link":Ae("error",e),Ae("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(k in a)if(a.hasOwnProperty(k)&&(i=a[k],i!=null))switch(k){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Ge(e,t,k,i,a,null)}return;default:if(Kr(t)){for(ae in a)a.hasOwnProperty(ae)&&(i=a[ae],i!==void 0&&jc(e,t,ae,i,a,void 0));return}}for(S in a)a.hasOwnProperty(S)&&(i=a[S],i!=null&&Ge(e,t,S,i,a,null))}function R1(e,t,a,i){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,c=null,p=null,S=null,R=null,k=null,ae=null;for(P in a){var oe=a[P];if(a.hasOwnProperty(P)&&oe!=null)switch(P){case"checked":break;case"value":break;case"defaultValue":R=oe;default:i.hasOwnProperty(P)||Ge(e,t,P,null,i,oe)}}for(var K in i){var P=i[K];if(oe=a[K],i.hasOwnProperty(K)&&(P!=null||oe!=null))switch(K){case"type":c=P;break;case"name":u=P;break;case"checked":k=P;break;case"defaultChecked":ae=P;break;case"value":p=P;break;case"defaultValue":S=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(s(137,t));break;default:P!==oe&&Ge(e,t,K,P,i,oe)}}Oa(e,p,S,R,k,ae,c,u);return;case"select":P=p=S=K=null;for(c in a)if(R=a[c],a.hasOwnProperty(c)&&R!=null)switch(c){case"value":break;case"multiple":P=R;default:i.hasOwnProperty(c)||Ge(e,t,c,null,i,R)}for(u in i)if(c=i[u],R=a[u],i.hasOwnProperty(u)&&(c!=null||R!=null))switch(u){case"value":K=c;break;case"defaultValue":S=c;break;case"multiple":p=c;default:c!==R&&Ge(e,t,u,c,i,R)}t=S,a=p,i=P,K!=null?_n(e,!!a,K,!1):!!i!=!!a&&(t!=null?_n(e,!!a,t,!0):_n(e,!!a,a?[]:"",!1));return;case"textarea":P=K=null;for(S in a)if(u=a[S],a.hasOwnProperty(S)&&u!=null&&!i.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Ge(e,t,S,null,i,u)}for(p in i)if(u=i[p],c=a[p],i.hasOwnProperty(p)&&(u!=null||c!=null))switch(p){case"value":K=u;break;case"defaultValue":P=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(s(91));break;default:u!==c&&Ge(e,t,p,u,i,c)}td(e,K,P);return;case"option":for(var he in a)K=a[he],a.hasOwnProperty(he)&&K!=null&&!i.hasOwnProperty(he)&&(he==="selected"?e.selected=!1:Ge(e,t,he,null,i,K));for(R in i)K=i[R],P=a[R],i.hasOwnProperty(R)&&K!==P&&(K!=null||P!=null)&&(R==="selected"?e.selected=K&&typeof K!="function"&&typeof K!="symbol":Ge(e,t,R,K,i,P));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ve in a)K=a[ve],a.hasOwnProperty(ve)&&K!=null&&!i.hasOwnProperty(ve)&&Ge(e,t,ve,null,i,K);for(k in i)if(K=i[k],P=a[k],i.hasOwnProperty(k)&&K!==P&&(K!=null||P!=null))switch(k){case"children":case"dangerouslySetInnerHTML":if(K!=null)throw Error(s(137,t));break;default:Ge(e,t,k,K,i,P)}return;default:if(Kr(t)){for(var Ye in a)K=a[Ye],a.hasOwnProperty(Ye)&&K!==void 0&&!i.hasOwnProperty(Ye)&&jc(e,t,Ye,void 0,i,K);for(ae in i)K=i[ae],P=a[ae],!i.hasOwnProperty(ae)||K===P||K===void 0&&P===void 0||jc(e,t,ae,K,i,P);return}}for(var V in a)K=a[V],a.hasOwnProperty(V)&&K!=null&&!i.hasOwnProperty(V)&&Ge(e,t,V,null,i,K);for(oe in i)K=i[oe],P=a[oe],!i.hasOwnProperty(oe)||K===P||K==null&&P==null||Ge(e,t,oe,K,i,P)}function im(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function H1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),i=0;i<a.length;i++){var u=a[i],c=u.transferSize,p=u.initiatorType,S=u.duration;if(c&&S&&im(p)){for(p=0,S=u.responseEnd,i+=1;i<a.length;i++){var R=a[i],k=R.startTime;if(k>S)break;var ae=R.transferSize,oe=R.initiatorType;ae&&im(oe)&&(R=R.responseEnd,p+=ae*(R<S?1:(S-k)/(R-k)))}if(--i,t+=8*(c+p)/(u.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Lc=null,Bc=null;function Us(e){return e.nodeType===9?e:e.ownerDocument}function om(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function sm(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Uc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qc=null;function j1(){var e=window.event;return e&&e.type==="popstate"?e===qc?!1:(qc=e,!0):(qc=null,!1)}var rm=typeof setTimeout=="function"?setTimeout:void 0,L1=typeof clearTimeout=="function"?clearTimeout:void 0,um=typeof Promise=="function"?Promise:void 0,B1=typeof queueMicrotask=="function"?queueMicrotask:typeof um<"u"?function(e){return um.resolve(null).then(e).catch(U1)}:rm;function U1(e){setTimeout(function(){throw e})}function ga(e){return e==="head"}function cm(e,t){var a=t,i=0;do{var u=a.nextSibling;if(e.removeChild(a),u&&u.nodeType===8)if(a=u.data,a==="/$"||a==="/&"){if(i===0){e.removeChild(u),Il(t);return}i--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")i++;else if(a==="html")$i(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,$i(a);for(var c=a.firstChild;c;){var p=c.nextSibling,S=c.nodeName;c[za]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&c.rel.toLowerCase()==="stylesheet"||a.removeChild(c),c=p}}else a==="body"&&$i(e.ownerDocument.body);a=u}while(a);Il(t)}function fm(e,t){var a=e;e=0;do{var i=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),i&&i.nodeType===8)if(a=i.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=i}while(a)}function Gc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Gc(a),fi(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function q1(e,t,a,i){for(;e.nodeType===1;){var u=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!i&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(i){if(!e[za])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=Qt(e.nextSibling),e===null)break}return null}function G1(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Qt(e.nextSibling),e===null))return null;return e}function dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Qt(e.nextSibling),e===null))return null;return e}function Yc(e){return e.data==="$?"||e.data==="$~"}function Vc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Y1(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var i=function(){t(),a.removeEventListener("DOMContentLoaded",i)};a.addEventListener("DOMContentLoaded",i),e._reactRetry=i}}function Qt(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Xc=null;function hm(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Qt(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function gm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function mm(e,t,a){switch(t=Us(a),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function $i(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);fi(e)}var kt=new Map,pm=new Set;function qs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var qn=H.d;H.d={f:V1,r:X1,D:Z1,C:I1,L:Q1,m:k1,X:K1,S:$1,M:J1};function V1(){var e=qn.f(),t=zs();return e||t}function X1(e){var t=kn(e);t!==null&&t.tag===5&&t.type==="form"?Rh(t):qn.r(e)}var Vl=typeof document>"u"?null:document;function ym(e,t,a){var i=Vl;if(i&&typeof t=="string"&&t){var u=xt(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof a=="string"&&(u+='[crossorigin="'+a+'"]'),pm.has(u)||(pm.add(u),e={rel:e,crossOrigin:a,href:t},i.querySelector(u)===null&&(t=i.createElement("link"),gt(t,"link",e),Pe(t),i.head.appendChild(t)))}}function Z1(e){qn.D(e),ym("dns-prefetch",e,null)}function I1(e,t){qn.C(e,t),ym("preconnect",e,t)}function Q1(e,t,a){qn.L(e,t,a);var i=Vl;if(i&&e&&t){var u='link[rel="preload"][as="'+xt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(u+='[imagesrcset="'+xt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(u+='[imagesizes="'+xt(a.imageSizes)+'"]')):u+='[href="'+xt(e)+'"]';var c=u;switch(t){case"style":c=Xl(e);break;case"script":c=Zl(e)}kt.has(c)||(e=y({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),kt.set(c,e),i.querySelector(u)!==null||t==="style"&&i.querySelector(Ki(c))||t==="script"&&i.querySelector(Ji(c))||(t=i.createElement("link"),gt(t,"link",e),Pe(t),i.head.appendChild(t)))}}function k1(e,t){qn.m(e,t);var a=Vl;if(a&&e){var i=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+xt(i)+'"][href="'+xt(e)+'"]',c=u;switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=Zl(e)}if(!kt.has(c)&&(e=y({rel:"modulepreload",href:e},t),kt.set(c,e),a.querySelector(u)===null)){switch(i){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Ji(c)))return}i=a.createElement("link"),gt(i,"link",e),Pe(i),a.head.appendChild(i)}}}function $1(e,t,a){qn.S(e,t,a);var i=Vl;if(i&&e){var u=Kn(i).hoistableStyles,c=Xl(e);t=t||"default";var p=u.get(c);if(!p){var S={loading:0,preload:null};if(p=i.querySelector(Ki(c)))S.loading=5;else{e=y({rel:"stylesheet",href:e,"data-precedence":t},a),(a=kt.get(c))&&Zc(e,a);var R=p=i.createElement("link");Pe(R),gt(R,"link",e),R._p=new Promise(function(k,ae){R.onload=k,R.onerror=ae}),R.addEventListener("load",function(){S.loading|=1}),R.addEventListener("error",function(){S.loading|=2}),S.loading|=4,Gs(p,t,i)}p={type:"stylesheet",instance:p,count:1,state:S},u.set(c,p)}}}function K1(e,t){qn.X(e,t);var a=Vl;if(a&&e){var i=Kn(a).hoistableScripts,u=Zl(e),c=i.get(u);c||(c=a.querySelector(Ji(u)),c||(e=y({src:e,async:!0},t),(t=kt.get(u))&&Ic(e,t),c=a.createElement("script"),Pe(c),gt(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(u,c))}}function J1(e,t){qn.M(e,t);var a=Vl;if(a&&e){var i=Kn(a).hoistableScripts,u=Zl(e),c=i.get(u);c||(c=a.querySelector(Ji(u)),c||(e=y({src:e,async:!0,type:"module"},t),(t=kt.get(u))&&Ic(e,t),c=a.createElement("script"),Pe(c),gt(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},i.set(u,c))}}function vm(e,t,a,i){var u=(u=ce.current)?qs(u):null;if(!u)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=Xl(a.href),a=Kn(u).hoistableStyles,i=a.get(t),i||(i={type:"style",instance:null,count:0,state:null},a.set(t,i)),i):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=Xl(a.href);var c=Kn(u).hoistableStyles,p=c.get(e);if(p||(u=u.ownerDocument||u,p={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,p),(c=u.querySelector(Ki(e)))&&!c._p&&(p.instance=c,p.state.loading=5),kt.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},kt.set(e,a),c||F1(u,e,a,p.state))),t&&i===null)throw Error(s(528,""));return p}if(t&&i!==null)throw Error(s(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Zl(a),a=Kn(u).hoistableScripts,i=a.get(t),i||(i={type:"script",instance:null,count:0,state:null},a.set(t,i)),i):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function Xl(e){return'href="'+xt(e)+'"'}function Ki(e){return'link[rel="stylesheet"]['+e+"]"}function bm(e){return y({},e,{"data-precedence":e.precedence,precedence:null})}function F1(e,t,a,i){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?i.loading=1:(t=e.createElement("link"),i.preload=t,t.addEventListener("load",function(){return i.loading|=1}),t.addEventListener("error",function(){return i.loading|=2}),gt(t,"link",a),Pe(t),e.head.appendChild(t))}function Zl(e){return'[src="'+xt(e)+'"]'}function Ji(e){return"script[async]"+e}function Sm(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var i=e.querySelector('style[data-href~="'+xt(a.href)+'"]');if(i)return t.instance=i,Pe(i),i;var u=y({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return i=(e.ownerDocument||e).createElement("style"),Pe(i),gt(i,"style",u),Gs(i,a.precedence,e),t.instance=i;case"stylesheet":u=Xl(a.href);var c=e.querySelector(Ki(u));if(c)return t.state.loading|=4,t.instance=c,Pe(c),c;i=bm(a),(u=kt.get(u))&&Zc(i,u),c=(e.ownerDocument||e).createElement("link"),Pe(c);var p=c;return p._p=new Promise(function(S,R){p.onload=S,p.onerror=R}),gt(c,"link",i),t.state.loading|=4,Gs(c,a.precedence,e),t.instance=c;case"script":return c=Zl(a.src),(u=e.querySelector(Ji(c)))?(t.instance=u,Pe(u),u):(i=a,(u=kt.get(c))&&(i=y({},a),Ic(i,u)),e=e.ownerDocument||e,u=e.createElement("script"),Pe(u),gt(u,"link",i),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(i=t.instance,t.state.loading|=4,Gs(i,a.precedence,e));return t.instance}function Gs(e,t,a){for(var i=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=i.length?i[i.length-1]:null,c=u,p=0;p<i.length;p++){var S=i[p];if(S.dataset.precedence===t)c=S;else if(c!==u)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Zc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Ic(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ys=null;function xm(e,t,a){if(Ys===null){var i=new Map,u=Ys=new Map;u.set(a,i)}else u=Ys,i=u.get(a),i||(i=new Map,u.set(a,i));if(i.has(e))return i;for(i.set(e,null),a=a.getElementsByTagName(e),u=0;u<a.length;u++){var c=a[u];if(!(c[za]||c[it]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var p=c.getAttribute(t)||"";p=e+p;var S=i.get(p);S?S.push(c):i.set(p,[c])}}return i}function _m(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function W1(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Em(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function P1(e,t,a,i){if(a.type==="stylesheet"&&(typeof i.media!="string"||matchMedia(i.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var u=Xl(i.href),c=t.querySelector(Ki(u));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Vs.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=c,Pe(c);return}c=t.ownerDocument||t,i=bm(i),(u=kt.get(u))&&Zc(i,u),c=c.createElement("link"),Pe(c);var p=c;p._p=new Promise(function(S,R){p.onload=S,p.onerror=R}),gt(c,"link",i),a.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Vs.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Qc=0;function eb(e,t){return e.stylesheets&&e.count===0&&Zs(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var i=setTimeout(function(){if(e.stylesheets&&Zs(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Qc===0&&(Qc=62500*H1());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Zs(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Qc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(i),clearTimeout(u)}}:null}function Vs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xs=null;function Zs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xs=new Map,t.forEach(tb,e),Xs=null,Vs.call(e))}function tb(e,t){if(!(t.state.loading&4)){var a=Xs.get(e);if(a)var i=a.get(null);else{a=new Map,Xs.set(e,a);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<u.length;c++){var p=u[c];(p.nodeName==="LINK"||p.getAttribute("media")!=="not all")&&(a.set(p.dataset.precedence,p),i=p)}i&&a.set(null,i)}u=t.instance,p=u.getAttribute("data-precedence"),c=a.get(p)||i,c===i&&a.set(null,u),a.set(p,u),this.count++,i=Vs.bind(this),u.addEventListener("load",i),u.addEventListener("error",i),c?c.parentNode.insertBefore(u,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var Fi={$$typeof:E,Provider:null,Consumer:null,_currentValue:B,_currentValue2:B,_threadCount:0};function nb(e,t,a,i,u,c,p,S,R){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=ri(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ri(0),this.hiddenUpdates=ri(null),this.identifierPrefix=i,this.onUncaughtError=u,this.onCaughtError=c,this.onRecoverableError=p,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=R,this.incompleteTransitions=new Map}function wm(e,t,a,i,u,c,p,S,R,k,ae,oe){return e=new nb(e,t,a,p,R,k,ae,oe,S),t=1,c===!0&&(t|=24),c=Ot(3,null,null,t),e.current=c,c.stateNode=e,t=Nu(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:i,isDehydrated:a,cache:t},Cu(c),e}function Nm(e){return e?(e=xl,e):xl}function Am(e,t,a,i,u,c){u=Nm(u),i.context===null?i.context=u:i.pendingContext=u,i=aa(t),i.payload={element:a},c=c===void 0?null:c,c!==null&&(i.callback=c),a=la(e,i,t),a!==null&&(Tt(a,e,t),Ci(a,e,t))}function Tm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function kc(e,t){Tm(e,t),(e=e.alternate)&&Tm(e,t)}function Mm(e){if(e.tag===13||e.tag===31){var t=La(e,67108864);t!==null&&Tt(t,e,67108864),kc(e,67108864)}}function Cm(e){if(e.tag===13||e.tag===31){var t=Bt();t=ui(t);var a=La(e,t);a!==null&&Tt(a,e,t),kc(e,t)}}var Is=!0;function ab(e,t,a,i){var u=A.T;A.T=null;var c=H.p;try{H.p=2,$c(e,t,a,i)}finally{H.p=c,A.T=u}}function lb(e,t,a,i){var u=A.T;A.T=null;var c=H.p;try{H.p=8,$c(e,t,a,i)}finally{H.p=c,A.T=u}}function $c(e,t,a,i){if(Is){var u=Kc(i);if(u===null)Hc(e,t,i,Qs,a),Dm(e,i);else if(ob(u,e,t,a,i))i.stopPropagation();else if(Dm(e,i),t&4&&-1<ib.indexOf(e)){for(;u!==null;){var c=kn(u);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var p=bn(c.pendingLanes);if(p!==0){var S=c;for(S.pendingLanes|=2,S.entangledLanes|=2;p;){var R=1<<31-vt(p);S.entanglements[1]|=R,p&=~R}fn(c),(He&6)===0&&(Ms=ct()+500,Ii(0))}}break;case 31:case 13:S=La(c,2),S!==null&&Tt(S,c,2),zs(),kc(c,2)}if(c=Kc(i),c===null&&Hc(e,t,i,Qs,a),c===u)break;u=c}u!==null&&i.stopPropagation()}else Hc(e,t,i,null,a)}}function Kc(e){return e=Fr(e),Jc(e)}var Qs=null;function Jc(e){if(Qs=null,e=Qn(e),e!==null){var t=f(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=d(t),e!==null)return e;e=null}else if(a===31){if(e=g(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Qs=e,null}function zm(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(ll()){case vn:return 2;case In:return 8;case Aa:case Lr:return 32;case il:return 268435456;default:return 32}default:return 32}}var Fc=!1,ma=null,pa=null,ya=null,Wi=new Map,Pi=new Map,va=[],ib="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 Dm(e,t){switch(e){case"focusin":case"focusout":ma=null;break;case"dragenter":case"dragleave":pa=null;break;case"mouseover":case"mouseout":ya=null;break;case"pointerover":case"pointerout":Wi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pi.delete(t.pointerId)}}function eo(e,t,a,i,u,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:a,eventSystemFlags:i,nativeEvent:c,targetContainers:[u]},t!==null&&(t=kn(t),t!==null&&Mm(t)),e):(e.eventSystemFlags|=i,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function ob(e,t,a,i,u){switch(t){case"focusin":return ma=eo(ma,e,t,a,i,u),!0;case"dragenter":return pa=eo(pa,e,t,a,i,u),!0;case"mouseover":return ya=eo(ya,e,t,a,i,u),!0;case"pointerover":var c=u.pointerId;return Wi.set(c,eo(Wi.get(c)||null,e,t,a,i,u)),!0;case"gotpointercapture":return c=u.pointerId,Pi.set(c,eo(Pi.get(c)||null,e,t,a,i,u)),!0}return!1}function Om(e){var t=Qn(e.target);if(t!==null){var a=f(t);if(a!==null){if(t=a.tag,t===13){if(t=d(a),t!==null){e.blockedOn=t,Ho(e.priority,function(){Cm(a)});return}}else if(t===31){if(t=g(a),t!==null){e.blockedOn=t,Ho(e.priority,function(){Cm(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function ks(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Kc(e.nativeEvent);if(a===null){a=e.nativeEvent;var i=new a.constructor(a.type,a);Jr=i,a.target.dispatchEvent(i),Jr=null}else return t=kn(a),t!==null&&Mm(t),e.blockedOn=a,!1;t.shift()}return!0}function Rm(e,t,a){ks(e)&&a.delete(t)}function sb(){Fc=!1,ma!==null&&ks(ma)&&(ma=null),pa!==null&&ks(pa)&&(pa=null),ya!==null&&ks(ya)&&(ya=null),Wi.forEach(Rm),Pi.forEach(Rm)}function $s(e,t){e.blockedOn===t&&(e.blockedOn=null,Fc||(Fc=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,sb)))}var Ks=null;function Hm(e){Ks!==e&&(Ks=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ks===e&&(Ks=null);for(var t=0;t<e.length;t+=3){var a=e[t],i=e[t+1],u=e[t+2];if(typeof i!="function"){if(Jc(i||a)===null)continue;break}var c=kn(a);c!==null&&(e.splice(t,3),t-=3,Ku(c,{pending:!0,data:u,method:a.method,action:i},i,u))}}))}function Il(e){function t(R){return $s(R,e)}ma!==null&&$s(ma,e),pa!==null&&$s(pa,e),ya!==null&&$s(ya,e),Wi.forEach(t),Pi.forEach(t);for(var a=0;a<va.length;a++){var i=va[a];i.blockedOn===e&&(i.blockedOn=null)}for(;0<va.length&&(a=va[0],a.blockedOn===null);)Om(a),a.blockedOn===null&&va.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(i=0;i<a.length;i+=3){var u=a[i],c=a[i+1],p=u[mt]||null;if(typeof c=="function")p||Hm(a);else if(p){var S=null;if(c&&c.hasAttribute("formAction")){if(u=c,p=c[mt]||null)S=p.formAction;else if(Jc(u)!==null)continue}else S=p.action;typeof S=="function"?a[i+1]=S:(a.splice(i,3),i-=3),Hm(a)}}}function jm(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(p){return u=p})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=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,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){i=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function Wc(e){this._internalRoot=e}Js.prototype.render=Wc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var a=t.current,i=Bt();Am(a,i,e,t,null,null)},Js.prototype.unmount=Wc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Am(e.current,2,null,e,null,null),zs(),t[Sn]=null}};function Js(e){this._internalRoot=e}Js.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ro();e={blockedOn:null,target:e,priority:t};for(var a=0;a<va.length&&t!==0&&t<va[a].priority;a++);va.splice(a,0,e),a===0&&Om(e)}};var Lm=l.version;if(Lm!=="19.2.5")throw Error(s(527,Lm,"19.2.5"));H.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=h(t),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var rb={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:A,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Fs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fs.isDisabled&&Fs.supportsFiber)try{Ta=Fs.inject(rb),yt=Fs}catch{}}return no.createRoot=function(e,t){if(!r(e))throw Error(s(299));var a=!1,i="",u=Xh,c=Zh,p=Ih;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(i=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(p=t.onRecoverableError)),t=wm(e,1,!1,null,null,a,i,null,u,c,p,jm),e[Sn]=t.current,Rc(e),new Wc(t)},no.hydrateRoot=function(e,t,a){if(!r(e))throw Error(s(299));var i=!1,u="",c=Xh,p=Zh,S=Ih,R=null;return a!=null&&(a.unstable_strictMode===!0&&(i=!0),a.identifierPrefix!==void 0&&(u=a.identifierPrefix),a.onUncaughtError!==void 0&&(c=a.onUncaughtError),a.onCaughtError!==void 0&&(p=a.onCaughtError),a.onRecoverableError!==void 0&&(S=a.onRecoverableError),a.formState!==void 0&&(R=a.formState)),t=wm(e,1,!0,t,a??null,i,u,R,c,p,S,jm),t.context=Nm(null),a=t.current,i=Bt(),i=ui(i),u=aa(i),u.callback=null,la(a,u,i),a=i,t.current.lanes=a,Ca(t,a),fn(t),e[Sn]=t.current,Rc(e),new Js(t)},no.version="19.2.5",no}var Qm;function yb(){if(Qm)return tf.exports;Qm=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(),tf.exports=pb(),tf.exports}var vb=yb();const km=n=>{let l;const o=new Set,s=(h,v)=>{const y=typeof h=="function"?h(l):h;if(!Object.is(y,l)){const b=l;l=v??(typeof y!="object"||y===null)?y:Object.assign({},l,y),o.forEach(x=>x(l,b))}},r=()=>l,g={setState:s,getState:r,getInitialState:()=>m,subscribe:h=>(o.add(h),()=>o.delete(h))},m=l=n(s,r,g);return g},bb=(n=>n?km(n):km),Sb=n=>n;function xb(n,l=Sb){const o=oo.useSyncExternalStore(n.subscribe,oo.useCallback(()=>l(n.getState()),[n,l]),oo.useCallback(()=>l(n.getInitialState()),[n,l]));return oo.useDebugValue(o),o}const $m=n=>{const l=bb(n),o=s=>xb(l,s);return Object.assign(o,l),o},_b=(n=>n?$m(n):$m);function Km(n){return Array.isArray(n.images)}async function Ct(n,l){const o=await fetch(n,l),s=await o.json().catch(()=>({}));if(!o.ok){const r=s.error,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 s.currentVersion=="number"&&(d.currentVersion=s.currentVersion),d}return s}function of(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 Ct(`/api/inflight${o}`)}async function Jm(n){await fetch(`/api/inflight/${encodeURIComponent(n)}`,{method:"DELETE"}).catch(()=>{})}function Eb(){return Ct("/api/oauth/status")}function wb(){return Ct("/api/billing")}function Nb(n){return Ct("/api/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})}function xf(n={}){const l=new URLSearchParams;return l.set("limit",String(n.limit??50)),n.since!=null&&l.set("since",String(n.since)),n.cursor&&(l.set("before",String(n.cursor.before)),l.set("beforeFilename",n.cursor.beforeFilename)),n.sessionId&&l.set("sessionId",n.sessionId),Ct(`/api/history?${l.toString()}`)}function Ab(n={}){const l=new URLSearchParams;return l.set("groupBy","session"),l.set("limit",String(n.limit??200)),n.cursor&&(l.set("before",String(n.cursor.before)),l.set("beforeFilename",n.cursor.beforeFilename)),Ct(`/api/history?${l.toString()}`)}function Tb(n){return Ct(`/api/history/${encodeURIComponent(n)}`,{method:"DELETE"})}function Mb(n,l){return Ct(`/api/history/${encodeURIComponent(n)}/restore`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({trashId:l})})}async function Cb(n){const l=await fetch("/api/node/generate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)}),o=await l.json().catch(()=>({}));if(!l.ok){const s=o,r=s?.error?.message??`Request failed: ${l.status}`,f=new Error(r);throw f.code=s?.error?.code,f}return o}function zb(){return Ct("/api/sessions")}function Db(n){return Ct("/api/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:n})})}function d0(n){return Ct(`/api/sessions/${encodeURIComponent(n)}`)}function Ob(n,l){return Ct(`/api/sessions/${encodeURIComponent(n)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:l})})}function Rb(n){return Ct(`/api/sessions/${encodeURIComponent(n)}`,{method:"DELETE"})}function Hb(n,l,o,s){return Ct(`/api/sessions/${encodeURIComponent(n)}/graph`,{method:"PUT",headers:{"Content-Type":"application/json","If-Match":String(l)},body:JSON.stringify({nodes:o,edges:s})})}function jb(n,l=256){return new Promise(o=>{const s=new Image;s.onload=()=>{const r=Math.min(1,l/Math.max(s.width,s.height)),f=document.createElement("canvas");f.width=s.width*r,f.height=s.height*r;const d=f.getContext("2d");if(!d)return o(n);d.drawImage(s,0,0,f.width,f.height),o(f.toDataURL("image/jpeg",.6))},s.onerror=()=>o(n),s.src=n})}const Lb={ok:"확인",cancel:"취소",delete:"삭제",close:"닫기"},Bb={localStorageFull:"로컬 저장소가 가득 차서 최근 상태가 저장되지 않을 수 있습니다.",refLimitExceeded:"참조 이미지는 최대 5장까지 추가할 수 있습니다. 초과한 이미지는 제외되었습니다.",noCurrentImageForRef:"참조로 사용할 현재 이미지가 없습니다.",refSlotFull:"참조 이미지 슬롯이 가득 찼습니다. 최대 5장까지 가능합니다.",currentImageLoadFailed:"현재 이미지를 불러오지 못했습니다.",addedCurrentAsRef:"현재 이미지를 참조에 추가했습니다.",sessionLoadFailed:"세션을 불러오지 못했습니다.",sessionCreateFailed:"세션을 만들지 못했습니다.",sessionRenameFailed:"세션 이름을 바꾸지 못했습니다.",sessionDeleteFailed:"세션을 삭제하지 못했습니다.",promptRequired:"프롬프트를 입력하세요.",nodeCreated:"노드 {id} 생성 완료 ({elapsed}초)",nodeCreateFailed:"노드 생성에 실패했습니다.",generatedBatch:"{count}장을 {elapsed}초 만에 생성했습니다.",generatedSingle:"{elapsed}초 만에 생성했습니다.",generateFailed:"생성에 실패했습니다.",sessionReloadedElsewhere:"다른 탭에서 세션이 변경되어 최신 그래프를 다시 불러왔습니다.",promptCopied:"프롬프트를 복사했습니다",imageCopied:"클립보드에 복사했습니다",copyFailed:"복사에 실패했습니다",noPromptToFork:"가져올 프롬프트가 없습니다",forkStarted:"이 이미지의 프롬프트를 가져왔습니다. 수정 후 다시 생성하세요"},Ub={queued:"대기 중",streaming:"생성 중",decoding:"마무리 중"},qb={title:"크기",width:"가로",height:"세로",hint:"한 변 최소 1024, 최대 3824, 16의 배수, 비율은 최대 3:1",autoLabel:"자동",autoSub:"모델 추천",customLabel:"직접 입력",customSub:"자유 설정"},Gb={title:"품질",lowLabel:"낮음",lowSub:"빠름",mediumLabel:"중간",mediumSub:"균형",highLabel:"높음",highSub:"최상"},Yb={title:"모더레이션",autoLabel:"자동",autoSub:"표준 필터",lowLabel:"낮음",lowSub:"완화 필터",explain:"자동은 표준 안전 필터를 사용합니다. 낮음은 제한을 조금 완화해 경계선 프롬프트가 더 통과할 수 있습니다."},Vb={title:"포맷"},Xb={title:"개수"},Zb={button:"생성",buttonLoading:"생성 중 ({n})"},Ib={label:"API 상태",checking:"확인 중...",offline:"오프라인",remaining:"${remaining} 남음",thisMonth:"이번 달 ${amount}",oauthFree:"OAuth 무료 사용 가능",apiDisabled:"API 키 비활성화됨 (OAuth 전용)",oauthMode:"OAuth 모드"},Qb={openGalleryAria:"갤러리 열기",openGalleryTitle:"전체 갤러리 열기"},kb={closeSettings:"설정 닫기",detailSettings:"세부 설정",toggleShow:"세부 설정 보기",toggleHide:"세부 설정 숨기기",open:"열기",close:"닫기"},$b={label:"프롬프트",refCount:"참조 {count}/{max}",refChipTitle:"참조 이미지 {n}",refChipAlt:"참조 이미지 {n}",refRemoveAria:"참조 이미지 {n} 제거",placeholder:"원하는 이미지를 설명하고, 드래그 앤 드롭이나 붙여넣기로 참조 이미지를 추가할 수 있어요...",placeholderWithRefs:"첨부한 이미지로 무엇을 만들지 설명해 주세요...",attach:"첨부",attachTitle:"참조 이미지 첨부",useCurrent:"현재 결과 사용",useCurrentTitle:"현재 결과를 참조로 사용",hint:"Ctrl + Enter로 생성",dropHere:"놓아서 참조 이미지로 추가 ({max}장까지)"},Kb={resultAlt:"생성 결과",tokens:"{n} 토큰"},Jb={today:"오늘",yesterday:"어제",thisWeek:"이번 주",earlier:"이전",imageAltFallback:"생성 이미지",deleteTitle:"삭제 (10초 내 복구 가능)",deleteAria:"이미지 삭제",ariaLabel:"이미지 갤러리",title:"갤러리",total:"총 {n}장",totalFiltered:" / 전체 {n}장",sortByAria:"정렬 기준",sortByDate:"날짜",sortBySession:"세션",searchPlaceholder:"프롬프트나 파일명을 검색",searchDisabledPlaceholder:"세션 보기에서는 검색이 비활성화됩니다",closeAria:"갤러리 닫기",closeTitle:"닫기 (Esc)",sessionLabel:"세션 {name}",standalone:"독립 이미지",emptySessions:"아직 저장된 세션이 없습니다.",emptyAll:"아직 생성된 이미지가 없습니다. 먼저 하나 만들어보세요.",noResults:"검색 결과가 없습니다.",deleted:"삭제됨: {filename}",undo:"되돌리기",secondsSuffix:"{n}초"},Fb={empty:"비어 있음",pending:"생성 중",reconciling:"동기화 중",reconcilingPhase:"동기화 중 · {phase}",ready:"완료 · {elapsed}s",readyWithSearch:"완료 · {elapsed}s · 검색 {searches}",stale:"오래된 상태",staleWithError:"오래된 상태: {error}",assetMissing:"에셋 누락",assetMissingWithError:"에셋 누락: {error}",error:"오류: {error}",errorUnknown:"알 수 없음",nodeImageAlt:"노드 이미지",noAsset:"에셋 없음",stateStale:"상태 오래됨",noImage:"이미지 없음",editPromptPlaceholder:"수정 프롬프트...",promptPlaceholder:"프롬프트...",regenerate:"다시 생성",generate:"생성",addChild:"자식 추가",duplicateBranch:"브랜치 복제",duplicateBranchTitle:"새 브랜치 루트로 복제",deleteTitle:"삭제"},Wb={authTitle:"인증 방식",apiLabel:"API 키",oauthNotReady:"OAuth 프록시가 아직 준비되지 않았습니다.",codexLoginRequired:"Codex 로그인이 필요합니다.",codexLoginHint:"터미널에서 `codex login`을 실행한 뒤 이 페이지를 새로고침하세요.",oauthStarting:"OAuth 프록시가 시작 중입니다. 몇 초 후 다시 시도하세요.",serverUnreachable:"서버에 연결할 수 없습니다. 백엔드가 실행 중인지 확인하세요.",apiInvalid:"API 키가 없거나 유효하지 않습니다. 서버의 .env 파일에서 OPENAI_API_KEY를 확인하세요.",availableTitle:"{name} 사용 가능",availableAria:"{name}: 사용 가능",unavailableAria:"{name}: 사용 불가",availableSr:"(사용 가능)",unavailableSr:"(사용 불가)"},Pb={free:"무료",approx:"약 ${amount}",label:"예상 비용"},eS={download:"다운로드",copyImage:"이미지 복사",copyPrompt:"프롬프트 복사",continueHere:"여기서 이어서",continueHereTitle:"이 이미지의 프롬프트를 가져와 이어서 작업"},tS={switchTitle:"세션 전환",loading:"불러오는 중...",newSession:"새 세션",newSessionTitle:"새 세션",renameTitle:"이름 변경",renamePrompt:"세션 이름",deleteTitle:"삭제",deleteConfirm:'"{title}" 세션을 삭제할까요? 이 작업은 되돌릴 수 없습니다.',empty:"아직 세션이 없습니다",firstGraph:"첫 번째 그래프",untitled:"제목 없는 세션",assetAbortedError:"생성이 정상적으로 끝나지 않았습니다. 이 노드에서 다시 시도하세요."},nS={ariaLabel:"UI 모드",classic:"기본",node:"노드"},aS={appName:"이미지 생성기",nodeModeHint:"노드 모드에서는 노드를 눌러 프롬프트를 수정한 뒤 생성하세요. 오른쪽 패널의 설정 (품질/크기)은 새로 만드는 모든 결과에 적용됩니다."},lS={loading:"세션 불러오는 중...",addFirst:"+ 첫 노드 추가",addRootTitle:"루트 노드 추가",hint:"핸들을 빈 공간으로 드래그하면 새 브랜치가 생깁니다. Delete 또는 Backspace로 삭제할 수 있습니다."},iS={title:"{provider} 사용 불가",ariaLabel:"{provider} 사용 불가"},oS={label:"언어",ko:"한국어",en:"English"},sS={common:Lb,toast:Bb,inflight:Ub,size:qb,quality:Gb,moderation:Yb,format:Vb,count:Xb,generate:Zb,billing:Ib,history:Qb,panel:kb,prompt:$b,canvas:Kb,gallery:Jb,node:Fb,provider:Wb,cost:Pb,result:eS,session:tS,uiMode:nS,sidebar:aS,nodeCanvas:lS,apiDisabled:iS,language:oS},rS={ok:"OK",cancel:"Cancel",delete:"Delete",close:"Close"},uS={localStorageFull:"Local storage is full — recent state may not persist.",refLimitExceeded:"References are capped at 5. Extra images were dropped.",noCurrentImageForRef:"No current image to use as reference.",refSlotFull:"Reference slots are full (max 5).",currentImageLoadFailed:"Failed to load current image.",addedCurrentAsRef:"Added current image as a reference.",sessionLoadFailed:"Failed to load session.",sessionCreateFailed:"Failed to create session.",sessionRenameFailed:"Failed to rename session.",sessionDeleteFailed:"Failed to delete session.",promptRequired:"Enter a prompt.",nodeCreated:"Node {id} created ({elapsed}s)",nodeCreateFailed:"Node generation failed.",generatedBatch:"Generated {count} images in {elapsed}s.",generatedSingle:"Generated in {elapsed}s.",generateFailed:"Generation failed.",sessionReloadedElsewhere:"Session was changed in another tab — reloaded the latest graph.",promptCopied:"Prompt copied",imageCopied:"Copied to clipboard",copyFailed:"Copy failed",noPromptToFork:"No prompt to fork",forkStarted:"Prompt imported. Edit and generate again."},cS={queued:"Queued",streaming:"Generating",decoding:"Finalizing"},fS={title:"Size",width:"Width",height:"Height",hint:"Each side 1024–3824, multiple of 16, ratio up to 3:1",autoLabel:"Auto",autoSub:"Model pick",customLabel:"Custom",customSub:"Free form"},dS={title:"Quality",lowLabel:"Low",lowSub:"Fast",mediumLabel:"Medium",mediumSub:"Balanced",highLabel:"High",highSub:"Best"},hS={title:"Moderation",autoLabel:"Auto",autoSub:"Standard filter",lowLabel:"Low",lowSub:"Relaxed filter",explain:"Auto uses the standard safety filter. Low relaxes limits so borderline prompts may pass through."},gS={title:"Format"},mS={title:"Count"},pS={button:"Generate",buttonLoading:"Generating ({n})"},yS={label:"API Status",checking:"Checking...",offline:"Offline",remaining:"${remaining} remaining",thisMonth:"${amount} this month",oauthFree:"OAuth · free via codex",apiDisabled:"API key disabled (OAuth only)",oauthMode:"OAuth mode"},vS={openGalleryAria:"Open gallery",openGalleryTitle:"Open full gallery"},bS={closeSettings:"Close settings",detailSettings:"Settings",toggleShow:"Show settings",toggleHide:"Hide settings",open:"Open",close:"Close"},SS={label:"Prompt",refCount:"Refs {count}/{max}",refChipTitle:"Reference {n}",refChipAlt:"Reference {n}",refRemoveAria:"Remove reference {n}",placeholder:"Describe the image you want. Drag & drop or paste to attach reference images...",placeholderWithRefs:"Describe what to do with the attached images...",attach:"Attach",attachTitle:"Attach reference images",useCurrent:"Use current",useCurrentTitle:"Use current result as a reference",hint:"Ctrl + Enter to generate",dropHere:"Drop to attach as reference (up to {max})"},xS={resultAlt:"result",tokens:"{n} tokens"},_S={today:"Today",yesterday:"Yesterday",thisWeek:"This week",earlier:"Earlier",imageAltFallback:"Generated image",deleteTitle:"Delete (10s undo)",deleteAria:"Delete image",ariaLabel:"Image gallery",title:"Gallery",total:"{n} total",totalFiltered:" / {n} total",sortByAria:"Sort by",sortByDate:"Date",sortBySession:"Session",searchPlaceholder:"Search prompts or filenames",searchDisabledPlaceholder:"Search is disabled in session view",closeAria:"Close gallery",closeTitle:"Close (Esc)",sessionLabel:"Session {name}",standalone:"Standalone images",emptySessions:"No sessions saved yet.",emptyAll:"No images yet. Create one first.",noResults:"No results.",deleted:"Deleted: {filename}",undo:"Undo",secondsSuffix:"{n}s"},ES={empty:"Empty",pending:"Generating",reconciling:"Syncing",reconcilingPhase:"Syncing · {phase}",ready:"Done · {elapsed}s",readyWithSearch:"Done · {elapsed}s · searched {searches}",stale:"Stale",staleWithError:"Stale: {error}",assetMissing:"Asset missing",assetMissingWithError:"Asset missing: {error}",error:"Error: {error}",errorUnknown:"unknown",nodeImageAlt:"Node image",noAsset:"No asset",stateStale:"State stale",noImage:"No image",editPromptPlaceholder:"Edit prompt...",promptPlaceholder:"Prompt...",regenerate:"Regenerate",generate:"Generate",addChild:"Add child",duplicateBranch:"Duplicate branch",duplicateBranchTitle:"Duplicate as a new branch root",deleteTitle:"Delete"},wS={authTitle:"Authentication",apiLabel:"API Key",oauthNotReady:"OAuth proxy is not ready yet.",codexLoginRequired:"Codex login required.",codexLoginHint:"Run `codex login` in your terminal, then refresh this page.",oauthStarting:"OAuth proxy is starting. Try again in a few seconds.",serverUnreachable:"Cannot reach the server. Make sure the backend is running.",apiInvalid:"API key is missing or invalid. Check OPENAI_API_KEY in the server's .env.",availableTitle:"{name} available",availableAria:"{name}: available",unavailableAria:"{name}: unavailable",availableSr:"(available)",unavailableSr:"(unavailable)"},NS={free:"free",approx:"~${amount}",label:"Est. cost"},AS={download:"Download",copyImage:"Copy image",copyPrompt:"Copy prompt",continueHere:"Continue here",continueHereTitle:"Import this image's prompt and keep working"},TS={switchTitle:"Switch session",loading:"Loading...",newSession:"New session",newSessionTitle:"New session",renameTitle:"Rename",renamePrompt:"Session name",deleteTitle:"Delete",deleteConfirm:'Delete session "{title}"? This cannot be undone.',empty:"No sessions yet",firstGraph:"My first graph",untitled:"Untitled session",assetAbortedError:"Generation did not finish cleanly. Retry from this node."},MS={ariaLabel:"UI mode",classic:"Classic",node:"Node"},CS={appName:"Image Generator",nodeModeHint:"In node mode, click a node to edit its prompt and generate. Settings on the right panel (quality/size) apply to every new result."},zS={loading:"Loading session...",addFirst:"+ Add first node",addRootTitle:"Add root node",hint:"Drag a handle into empty space to branch. Press Delete or Backspace to remove."},DS={title:"{provider} unavailable",ariaLabel:"{provider} unavailable"},OS={label:"Language",ko:"한국어",en:"English"},RS={common:rS,toast:uS,inflight:cS,size:fS,quality:dS,moderation:hS,format:gS,count:mS,generate:pS,billing:yS,history:vS,panel:bS,prompt:SS,canvas:xS,gallery:_S,node:ES,provider:wS,cost:NS,result:AS,session:TS,uiMode:MS,sidebar:CS,nodeCanvas:zS,apiDisabled:DS,language:OS},Fm={ko:sS,en:RS};function Wm(n,l){return l.split(".").reduce((o,s)=>{if(o!=null)return o[s]},n)}function HS(n,l){return n.replace(/\{(\w+)\}/g,(o,s)=>s in l?String(l[s]):`{${s}}`)}function Ie(n,l){const o=de.getState().locale;return h0(o,n,l)}function h0(n,l,o){const s=Wm(Fm[n],l),r=typeof s=="string"?s:Wm(Fm.en,l),f=typeof r=="string"?r:l;return o?HS(f,o):f}function ut(){const n=de(l=>l.locale);return{locale:n,t:(l,o)=>h0(n,l,o)}}const jS=["ko","en"];function LS(){try{const n=localStorage.getItem("ima2.locale");if(n==="ko"||n==="en")return n}catch{}return typeof navigator<"u"&&(navigator.language||"").toLowerCase().startsWith("ko")?"ko":"en"}function BS(n){try{localStorage.setItem("ima2.locale",n)}catch{}}function Pm(n){return Math.round(n/16)*16}const US=[{value:"1024x1024",label:"1024×1024",sub:"1:1"},{value:"1536x1024",label:"1536×1024",sub:"3:2"},{value:"1024x1536",label:"1024×1536",sub:"2:3"}],qS=[{value:"1360x1024",label:"1360×1024",sub:"4:3"},{value:"1024x1360",label:"1024×1360",sub:"3:4"},{value:"1824x1024",label:"1824×1024",sub:"16:9"}],GS=[{value:"1024x1824",label:"1024×1824",sub:"9:16"},{value:"2048x2048",label:"2048×2048",sub:"2K 1:1"},{value:"2048x1152",label:"2048×1152",sub:"2K 16:9"}],YS=[{value:"1152x2048",label:"1152×2048",sub:"2K 9:16"},{value:"3824x2160",label:"3824×2160",sub:"4K 16:9"},{value:"2160x3824",label:"2160×3824",sub:"4K 9:16"}];function VS(){return[{value:"auto",label:Ie("size.autoLabel"),sub:Ie("size.autoSub")},{value:"custom",label:Ie("size.customLabel"),sub:Ie("size.customSub")}]}const Ql=()=>"nc_"+Math.random().toString(36).slice(2,10);function ep(n,l){return{x:n*360,y:l*320}}function XS(){try{const n=localStorage.getItem("ima2.rightPanelOpen");return n===null?!0:JSON.parse(n)===!0}catch{return!0}}function ZS(){try{const n=localStorage.getItem("ima2.uiMode");if(n==="node"||n==="classic")return n}catch{}return"classic"}const g0=18e4;function sf(){try{const n=localStorage.getItem("ima2.inFlight");if(!n)return[];const l=JSON.parse(n);if(!Array.isArray(l))return[];const o=Date.now();return l.filter(s=>s&&typeof s.id=="string"&&typeof s.prompt=="string"&&typeof s.startedAt=="number"&&o-s.startedAt<g0).map(s=>({id:s.id,prompt:s.prompt,startedAt:s.startedAt,phase:typeof s.phase=="string"?s.phase:void 0,sessionId:typeof s.sessionId=="string"?s.sessionId:null,clientNodeId:typeof s.clientNodeId=="string"?s.clientNodeId:null,kind:s.kind==="classic"||s.kind==="node"?s.kind:void 0}))}catch{return[]}}function Ka(n){try{localStorage.setItem("ima2.inFlight",JSON.stringify(n))}catch(l){const o=window;if(!o.__ima2QuotaWarned){o.__ima2QuotaWarned=!0,console.warn("[ima2] localStorage write failed:",l);try{de.getState().showToast(Ie("toast.localStorageFull"),!0)}catch{}}}}function tp(){try{const n=localStorage.getItem("ima2.selectedFilename");return typeof n=="string"&&n.length>0?n:null}catch{return null}}function so(n){try{n?localStorage.setItem("ima2.selectedFilename",n):localStorage.removeItem("ima2.selectedFilename")}catch{}}const Kl=500;function np(n){return n==="classic"||n==="edit"||n==="generate"?n:null}function m0(n){const l=n.nodes.map(s=>{const r=s.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:s.id,serverNodeId:r.serverNodeId??null,parentServerNodeId:r.parentServerNodeId??null,prompt:typeof r.prompt=="string"?r.prompt:"",imageUrl:g,status:r.status??(g?"ready":"empty"),pendingRequestId:r.pendingRequestId??null,pendingPhase:r.pendingPhase??null,pendingStartedAt:typeof r.pendingStartedAt=="number"?r.pendingStartedAt:null,error:r.error,elapsed:r.elapsed,webSearchCalls:r.webSearchCalls};return{id:s.id,type:"imageNode",position:{x:s.x,y:s.y},data:m}}),o=n.edges.map(s=>({id:s.id,source:s.source,target:s.target}));return{graphNodes:l,graphEdges:o,graphVersion:n.graphVersion}}const de=_b((n,l)=>({provider:"oauth",quality:"low",sizePreset:"1024x1024",customW:1920,customH:1088,format:"png",moderation:"low",count:1,prompt:"",referenceImages:[],addReferences:async o=>{const s=5-l().referenceImages.length,r=o.slice(0,Math.max(0,s)),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>s&&l().showToast(Ie("toast.refLimitExceeded"),!0)},addReferenceDataUrl:o=>{n(s=>s.referenceImages.length>=5?s:{referenceImages:[...s.referenceImages,o]})},removeReference:o=>{n(s=>({referenceImages:s.referenceImages.filter((r,f)=>f!==o)}))},clearReferences:()=>n({referenceImages:[]}),useCurrentAsReference:async()=>{const o=l().currentImage;if(!o){l().showToast(Ie("toast.noCurrentImageForRef"),!0);return}if(l().referenceImages.length>=5){l().showToast(Ie("toast.refSlotFull"),!0);return}let s=o.image;if(!s.startsWith("data:"))try{const f=await(await fetch(s)).blob();s=await new Promise((d,g)=>{const m=new FileReader;m.onload=()=>typeof m.result=="string"?d(m.result):g(new Error("read failed")),m.onerror=()=>g(m.error??new Error("read failed")),m.readAsDataURL(f)})}catch{l().showToast(Ie("toast.currentImageLoadFailed"),!0);return}n(r=>({referenceImages:[...r.referenceImages,s]})),l().showToast(Ie("toast.addedCurrentAsRef"))},activeGenerations:sf().length,inFlight:sf(),startInFlightPolling:()=>{if(typeof window>"u")return;const o=window;if(o.__ima2InflightTimer)return;const s=async()=>{if(l().inFlight.length===0){o.__ima2InflightTimer&&(clearInterval(o.__ima2InflightTimer),o.__ima2InflightTimer=void 0);return}try{const f=l().uiMode==="node"?"node":"classic",d=f==="node"?l().activeSessionId??void 0:void 0,{jobs:g}=await of({kind:f,sessionId:d}),m=new Map(g.map(x=>[x.requestId,x.phase]));let h=!1;const v=Date.now(),y=5e3,b=[];for(const x of l().inFlight){if(!((x.kind??"classic")===f&&(f!=="node"||(x.sessionId??null)===(d??null)))){b.push(x);continue}if(!m.has(x.id)&&v-x.startedAt>y){h=!0;continue}const N=m.get(x.id);N&&N!==x.phase?(h=!0,b.push({...x,phase:N})):b.push(x)}h&&(Ka(b),n({inFlight:b,activeGenerations:b.length}))}catch{}try{const f=l().history.reduce((b,x)=>x.createdAt&&x.createdAt>b?x.createdAt:b,0),{items:d}=await xf({limit:Kl,since:f}),g=d.map(b=>({image:b.url,url:b.url,filename:b.filename,thumb:b.url,prompt:b.prompt??void 0,size:b.size??void 0,quality:b.quality??void 0,format:b.format,createdAt:b.createdAt,sessionId:b.sessionId??null,nodeId:b.nodeId??null,clientNodeId:b.clientNodeId??null,kind:np(b.kind)})),m=l().history,h=g.filter(b=>!m.some(x=>x.filename===b.filename));h.length>0&&n(b=>{const x=b.currentImage??h[0];return!b.currentImage&&h[0]?.filename&&so(h[0].filename),{history:[...h,...b.history].slice(0,Kl),currentImage:x}});const v=Date.now(),y=l().inFlight.filter(b=>v-b.startedAt<g0);y.length!==l().inFlight.length&&(Ka(y),n({inFlight:y,activeGenerations:y.length}))}catch{}};o.__ima2InflightTimer=window.setInterval(s,1500)},reconcileInflight:async()=>{try{const o=l().uiMode==="node"?"node":"classic",s=o==="node"?l().activeSessionId??void 0:void 0,{jobs:r}=await of({kind:o,sessionId:s}),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=sf(),s=tp();n(r=>({inFlight:o,activeGenerations:o.length,currentImage:s&&r.currentImage?.filename!==s?r.history.find(f=>f.filename===s)??r.currentImage:r.currentImage})),o.length>0&&l().startInFlightPolling()},currentImage:null,history:[],toast:null,rightPanelOpen:XS(),toggleRightPanel:()=>n(o=>{const s=!o.rightPanelOpen;try{localStorage.setItem("ima2.rightPanelOpen",JSON.stringify(s))}catch{}return{rightPanelOpen:s}}),galleryOpen:!1,openGallery:()=>n({galleryOpen:!0}),closeGallery:()=>n({galleryOpen:!1}),uiMode:ZS(),setUIMode:o=>{try{localStorage.setItem("ima2.uiMode",o)}catch{}n({uiMode:o})},locale:LS(),setLocale:o=>{BS(o),n({locale:o})},graphNodes:[],graphEdges:[],setGraphNodes:o=>{n({graphNodes:o}),l().scheduleGraphSave()},setGraphEdges:o=>{n({graphEdges:o}),l().scheduleGraphSave()},sessions:[],activeSessionId:null,activeSessionGraphVersion:null,sessionLoading:!1,async loadSessions(){try{const{sessions:o}=await zb();n({sessions:o});const s=l().activeSessionId;!s&&o.length>0?await l().switchSession(o[0].id):!s&&o.length===0&&await l().createAndSwitchSession(Ie("session.firstGraph"))}catch(o){console.warn("[sessions] load failed:",o)}},async switchSession(o){n({sessionLoading:!0}),await l().flushGraphSave();try{const{session:s}=await d0(o),{graphNodes:r,graphEdges:f,graphVersion:d}=m0(s);n({activeSessionId:o,activeSessionGraphVersion:d,graphNodes:r,graphEdges:f,sessionLoading:!1}),await l().reconcileGraphPending().catch(()=>{})}catch(s){console.warn("[sessions] switch failed:",s),n({sessionLoading:!1}),l().showToast(Ie("toast.sessionLoadFailed"),!0)}},async reconcileGraphPending(){const o=l().activeSessionId;if(!o)return;if(l().graphNodes.filter(r=>r.data?.pendingRequestId&&(r.data.status==="pending"||r.data.status==="reconciling")).length>0){let r=[];try{r=(await of({kind:"node",sessionId:o})).jobs}catch{r=[]}const f=new Map(r.map(h=>[h.requestId,h.phase])),d=Date.now(),g=1e4,m=l().graphNodes.map(h=>{const v=h.data?.pendingRequestId;if(!v||h.data.status!=="pending"&&h.data.status!=="reconciling")return h;if(f.has(v)){const x=f.get(v)??null;return{...h,data:{...h.data,status:"reconciling",pendingPhase:x}}}const y=h.data.pendingStartedAt??0;if(y&&d-y<g)return{...h,data:{...h.data,status:"reconciling"}};const b=!!h.data.imageUrl||!!h.data.serverNodeId;return{...h,data:{...h.data,pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,status:b?"ready":"stale",error:b?void 0:Ie("session.assetAbortedError")}}});n({graphNodes:m})}await y0(l,n).catch(()=>{})},async createAndSwitchSession(o){o==null&&(o=Ie("session.untitled"));try{const{session:s}=await Db(o);n({sessions:[s,...l().sessions],activeSessionId:s.id,activeSessionGraphVersion:s.graphVersion,graphNodes:[],graphEdges:[]})}catch(s){console.warn("[sessions] create failed:",s),l().showToast(Ie("toast.sessionCreateFailed"),!0)}},async renameCurrentSession(o){const s=l().activeSessionId;if(s)try{await Ob(s,o),n({sessions:l().sessions.map(r=>r.id===s?{...r,title:o,updatedAt:Date.now()}:r)})}catch{l().showToast(Ie("toast.sessionRenameFailed"),!0)}},async deleteSessionById(o){try{await Rb(o);const s=l().sessions.filter(r=>r.id!==o);n({sessions:s}),l().activeSessionId===o&&(n({activeSessionId:null,activeSessionGraphVersion:null,graphNodes:[],graphEdges:[]}),s.length>0?await l().switchSession(s[0].id):await l().createAndSwitchSession(Ie("session.firstGraph")))}catch{l().showToast(Ie("toast.sessionDeleteFailed"),!0)}},scheduleGraphSave(){b0(l,n)},async flushGraphSave(){await kS(l,n)},addRootNode:()=>{const o=Ql(),s=0,r=l().graphNodes.filter(d=>!d.data.parentServerNodeId).length,f={id:o,type:"imageNode",position:ep(s,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 s=l().graphNodes.find(m=>m.id===o);if(!s)return o;const r=Ql(),f=l().graphEdges.filter(m=>m.source===o).length,d={id:r,type:"imageNode",position:{x:s.position.x+360,y:s.position.y+f*320},data:{clientId:r,serverNodeId:null,parentServerNodeId:s.data.serverNodeId,prompt:"",imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}},g={id:`${o}->${r}`,source:o,target:r};return n({graphNodes:[...l().graphNodes,d],graphEdges:[...l().graphEdges,g]}),l().scheduleGraphSave(),r},addSiblingNode:o=>{const s=l().graphNodes.find(y=>y.id===o);if(!s)return o;const r=l().graphEdges.find(y=>y.target===o);if(!r){const y=Ql(),b=0,x=l().graphNodes.filter(C=>!C.data.parentServerNodeId).length,w={id:y,type:"imageNode",position:ep(b,x),data:{clientId:y,serverNodeId:null,parentServerNodeId:null,prompt:s.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return n({graphNodes:[...l().graphNodes,w]}),l().scheduleGraphSave(),y}const f=r.source,d=l().graphNodes.find(y=>y.id===f);if(!d)return o;const g=Ql(),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:s.data.parentServerNodeId,prompt:s.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,s)=>{n({graphNodes:l().graphNodes.map(r=>r.id===o?{...r,data:{...r.data,prompt:s}}:r)}),l().scheduleGraphSave()},duplicateBranchRoot:o=>{const s=l().graphNodes.find(d=>d.id===o);if(!s)return o;const r=Ql();l().graphNodes.filter(d=>!d.data.parentServerNodeId).length;const f={id:r,type:"imageNode",position:{x:s.position.x+420,y:s.position.y+40},data:{clientId:r,serverNodeId:null,parentServerNodeId:null,prompt:s.data.prompt,imageUrl:null,status:"empty",pendingRequestId:null,pendingPhase:null}};return n({graphNodes:[...l().graphNodes,f]}),l().scheduleGraphSave(),r},async generateNode(o){const r=l().graphNodes.find(N=>N.id===o)?.data.status==="ready"?l().addSiblingNode(o):o,f=l().graphNodes.find(N=>N.id===r);if(!f)return;const{prompt:d,parentServerNodeId:g}=f.data;if(!d.trim()){l().showToast(Ie("toast.promptRequired"),!0);return}const m=l(),h=m.getResolvedSize(),v=m.activeSessionId,y=Date.now(),b=Math.random().toString(36).slice(2,6),x=`fn_${r}_${y}_${b}`,w=[...m.inFlight,{id:x,prompt:d,startedAt:y,kind:"node",sessionId:v,clientNodeId:r}];Ka(w),n({graphNodes:l().graphNodes.map(N=>N.id===r?{...N,data:{...N.data,status:"pending",pendingRequestId:x,pendingPhase:"queued",pendingStartedAt:y,error:void 0}}:N),activeGenerations:m.activeGenerations+1,inFlight:w}),l().startInFlightPolling();let C=!0;try{const N=await Cb({parentNodeId:g,prompt:d,quality:m.quality,size:h,format:m.format,moderation:m.moderation,requestId:x,sessionId:v,clientNodeId:r,...m.referenceImages.length&&!g?{references:m.referenceImages.map(M=>M.replace(/^data:[^;]+;base64,/,""))}:{}});l().activeSessionId===v&&(n({graphNodes:l().graphNodes.map(M=>M.id===r?{...M,data:{...M.data,serverNodeId:N.nodeId,imageUrl:N.url,status:"ready",pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,elapsed:N.elapsed,webSearchCalls:N.webSearchCalls}}:M)}),C=!0,l().showToast(Ie("toast.nodeCreated",{id:N.nodeId.slice(0,8),elapsed:N.elapsed})))}catch(N){const M=N instanceof Error?N.message:Ie("toast.nodeCreateFailed");l().activeSessionId===v&&(n({graphNodes:l().graphNodes.map(D=>D.id===r?{...D,data:{...D.data,status:"error",pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,error:M}}:D)}),C=!0,l().showToast(M,!0))}finally{const N=l().inFlight.filter(M=>M.id!==x);Ka(N),n({activeGenerations:Math.max(0,l().activeGenerations-1),inFlight:N}),l().activeSessionId===v&&C&&l().scheduleGraphSave()}},deleteNode:o=>{const r=l().graphNodes.find(f=>f.id===o)?.data?.pendingRequestId;r&&Jm(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 s=new Set(o);for(const r of l().graphNodes)s.has(r.id)&&r.data?.pendingRequestId&&Jm(r.data.pendingRequestId);n({graphNodes:l().graphNodes.filter(r=>!s.has(r.id)),graphEdges:l().graphEdges.filter(r=>!s.has(r.source)&&!s.has(r.target))}),l().scheduleGraphSave()},addChildNodeAt:(o,s)=>{const r=l().graphNodes.find(m=>m.id===o);if(!r)return o;const f=Ql(),d={id:f,type:"imageNode",position:s,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,s)=>{if(o===s||l().graphEdges.find(d=>d.source===o&&d.target===s))return;const f=l().graphNodes.find(d=>d.id===o);f&&(n({graphNodes:l().graphNodes.map(d=>d.id===s?{...d,data:{...d.data,parentServerNodeId:f.data.serverNodeId}}:d),graphEdges:[...l().graphEdges,{id:`${o}->${s}`,source:o,target:s}]}),l().scheduleGraphSave())},setProvider:o=>n({provider:o}),setQuality:o=>n({quality:o}),setSizePreset:o=>n({sizePreset:o}),setCustomSize:(o,s)=>n({customW:Pm(o),customH:Pm(s)}),setFormat:o=>n({format:o}),setModeration:o=>n({moderation:o}),setCount:o=>n({count:o}),setPrompt:o=>n({prompt:o}),selectHistory:o=>{so(o.filename??null),n({currentImage:o})},removeFromHistory:o=>{const s=l(),r=s.history.filter(d=>d.filename!==o),f=s.currentImage&&s.currentImage.filename===o?null:s.currentImage;n({history:r,currentImage:f}),f===null&&so(null)},addHistoryItem:o=>{const s=l();if(s.history.some(d=>o.filename&&d.filename===o.filename))return;const f={...o,createdAt:o.createdAt||Date.now()};n({history:[f,...s.history].slice(0,Kl)})},getResolvedSize:()=>{const{sizePreset:o,customW:s,customH:r}=l();return o==="custom"?`${s}x${r}`:o},async generate(){const o=l(),s=o.prompt.trim();if(!s)return;const r=o.getResolvedSize(),f=`f_${Date.now()}_${Math.random().toString(36).slice(2,7)}`,d=Date.now(),g=[...o.inFlight,{id:f,prompt:s,startedAt:d}];Ka(g),n({activeGenerations:o.activeGenerations+1,inFlight:g}),l().startInFlightPolling();try{const m={prompt:s,quality:o.quality,size:r,format:o.format,moderation:o.moderation,provider:o.provider,n:o.count,requestId:f,...o.referenceImages.length?{references:o.referenceImages.map(v=>v.replace(/^data:[^;]+;base64,/,""))}:{}},h=await Nb(m);if(Km(h)&&h.images.length>1){for(const v of h.images){const y={image:v.image,filename:v.filename,prompt:s,elapsed:h.elapsed,provider:h.provider,usage:h.usage,quality:h.quality??o.quality,size:h.size??r};await ap(y,n,l)}l().showToast(Ie("toast.generatedBatch",{count:h.images.length,elapsed:h.elapsed}))}else{let v;if(Km(h)){const y=h.images[0];v={image:y.image,filename:y.filename,prompt:s,elapsed:h.elapsed,provider:h.provider,usage:h.usage,quality:h.quality??o.quality,size:h.size??r}}else v={image:h.image,filename:h.filename,prompt:s,elapsed:h.elapsed,provider:h.provider,usage:h.usage,quality:h.quality??o.quality,size:h.size??r};await ap(v,n,l),l().showToast(Ie("toast.generatedSingle",{elapsed:h.elapsed}))}}catch(m){const h=m instanceof Error?m.message:Ie("toast.generateFailed");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 s=(await xf({limit:Kl})).items.map(r=>({image:r.url,url:r.url,filename:r.filename,prompt:r.prompt||void 0,provider:r.provider,quality:r.quality||void 0,size:r.size||void 0,usage:r.usage??void 0,thumb:r.url,createdAt:r.createdAt,sessionId:r.sessionId??null,nodeId:r.nodeId??null,clientNodeId:r.clientNodeId??null,kind:np(r.kind)}));if(s.length>0){const r=tp(),f=r?s.find(d=>d.filename===r):null;n({history:s,currentImage:f??s[0]}),f||so(s[0]?.filename??null)}}catch(o){console.warn("[history] load failed:",o)}})()},showToast(o,s=!1){n({toast:{message:o,error:s,id:Date.now()+Math.random()}})}})),IS=800;let hn=null,dr=null;function p0(n){return n.status==="pending"||n.status==="reconciling"?{...n,status:"empty",pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,error:void 0}:n}async function y0(n,l){const o=n().activeSessionId;if(!o||n().graphNodes.filter(g=>!g.data.imageUrl&&!g.data.serverNodeId).length===0)return;let r=[];try{r=(await xf({sessionId:o,limit:Kl})).items}catch{return}let f=!1;const d=n().graphNodes.map(g=>{if(g.data.imageUrl||g.data.serverNodeId)return g;const m=g.data.pendingStartedAt??0,h=r.find(v=>(v.sessionId??null)===o&&(v.clientNodeId??null)===g.id&&(!m||(v.createdAt??0)>=m));return h?(f=!0,{...g,data:{...g.data,status:"ready",imageUrl:h.url,serverNodeId:h.nodeId??g.data.serverNodeId,pendingRequestId:null,pendingPhase:null,pendingStartedAt:null,error:void 0}}):g});f&&(l({graphNodes:d}),b0(n,l))}async function QS(n,l){const o=n().activeSessionId;if(!o)return;const{session:s}=await d0(o),{graphNodes:r,graphEdges:f,graphVersion:d}=m0(s);l({graphNodes:r,graphEdges:f,activeSessionGraphVersion:d}),n().showToast(Ie("toast.sessionReloadedElsewhere"),!0),await y0(n,l).catch(()=>{})}function v0(n,l){const o=n().activeSessionId,s=n().activeSessionGraphVersion;if(!o||s==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:p0(m.data)})),g=f.map(m=>({id:m.id,source:m.source,target:m.target,data:{}}));return Hb(o,s,d,g).then(m=>{l({activeSessionGraphVersion:m.graphVersion})}).catch(async m=>{if(m.status===409){await QS(n,l);return}console.warn("[sessions] save failed:",m)})}function b0(n,l){const o=n();o.activeSessionId&&(o.sessionLoading||(hn&&clearTimeout(hn),hn=setTimeout(()=>{hn=null,dr=v0(n,l).finally(()=>{dr=null})},IS)))}async function kS(n,l){hn?(clearTimeout(hn),hn=null,await v0(n,l)):dr&&await dr}function $S(n){const l=n();if(!l.activeSessionId||l.activeSessionGraphVersion==null)return;hn&&(clearTimeout(hn),hn=null);const o=l.graphNodes.map(d=>({id:d.id,x:d.position.x,y:d.position.y,data:p0(d.data)})),s=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:s});try{fetch(r,{method:"PUT",headers:{"Content-Type":"application/json","If-Match":String(l.activeSessionGraphVersion)},body:f,keepalive:!0})}catch{}}async function ap(n,l,o){const s=await jb(n.image).catch(()=>n.image),r=n.filename?`/generated/${n.filename}`:n.image,f={...n,thumb:s,url:r,createdAt:n.createdAt||Date.now()},d=[f,...o().history].slice(0,Kl);so(f.filename??null),l({history:d,currentImage:f})}function KS(){const[n,l]=J.useState(null);return J.useEffect(()=>{let o=!1,s=null;const r=async()=>{try{const f=await Eb();if(o)return;l(f),f.status==="starting"&&(s=setTimeout(r,3e3))}catch{o||l(null)}};return r(),()=>{o=!0,s&&clearTimeout(s)}},[]),n}function S0(){const[n,l]=J.useState(null),[o,s]=J.useState(!1);return J.useEffect(()=>{let r=!1;return wb().then(f=>{r||l(f)}).catch(()=>{r||s(!0)}),()=>{r=!0}},[]),{data:n,error:o}}function JS({open:n,providerLabel:l,reason:o,hint:s,onClose:r}){const{t:f}=ut();if(J.useEffect(()=>{if(!n)return;const g=m=>{m.key==="Escape"&&r()};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[n,r]),!n)return null;const d=f("apiDisabled.title",{provider:l});return _.jsx("div",{className:"modal-backdrop",onClick:r,role:"presentation",children:_.jsxs("div",{className:"modal",role:"dialog","aria-modal":"true","aria-label":d,onClick:g=>g.stopPropagation(),children:[_.jsx("div",{className:"modal__title",children:d}),_.jsxs("div",{className:"modal__body",children:[_.jsx("p",{children:o}),s?_.jsx("p",{className:"modal__hint",children:s}):null]}),_.jsx("div",{className:"modal__actions",children:_.jsx("button",{type:"button",className:"modal__btn",onClick:r,children:f("common.ok")})})]})})}function FS(){const{t:n}=ut(),l=KS(),{data:o}=S0(),s=l?.status==="ready";let r=n("provider.oauthNotReady"),f;l?.status==="auth_required"?(r=n("provider.codexLoginRequired"),f=n("provider.codexLoginHint")):l?.status==="starting"?r=n("provider.oauthStarting"):l||(r=n("provider.serverUnreachable"));const d=o?.apiKeyValid===!0;return{oauth:{ok:s,reason:r,hint:f},api:{ok:d,reason:d?"":n("provider.apiInvalid")}}}function WS(){const{t:n}=ut(),l=de(h=>h.provider),o=de(h=>h.setProvider),s=FS(),[r,f]=J.useState(null),d=[{value:"oauth",label:"OAuth"},{value:"api",label:n("provider.apiLabel")}],g=h=>{s[h].ok?o(h):f(h)},m=r?{label:d.find(h=>h.value===r).label,...s[r]}:null;return _.jsxs(_.Fragment,{children:[_.jsx("div",{className:"section-title",children:n("provider.authTitle")}),_.jsx("div",{className:"provider-row",children:d.map(h=>{const v=l===h.value,y=s[h.value].ok;return _.jsxs("button",{type:"button",className:`provider-pill${v?" selected":""}`,onClick:()=>g(h.value),title:y?n("provider.availableTitle",{name:h.label}):s[h.value].reason,"aria-label":y?n("provider.availableAria",{name:h.label}):n("provider.unavailableAria",{name:h.label}),"aria-pressed":v,children:[_.jsx("span",{className:`status-dot ${y?"status-dot--ok":"status-dot--bad"}`,"aria-hidden":"true"}),_.jsx("span",{children:h.label}),_.jsx("span",{className:"sr-only",children:n(y?"provider.availableSr":"provider.unavailableSr")})]},h.value)})}),_.jsx(JS,{open:!!m,providerLabel:m?.label??"",reason:m?.reason??"",hint:m?.hint,onClose:()=>f(null)})]})}function PS(){return ut(),de(n=>n.uiMode),de(n=>n.setUIMode),null}const kl=5;function ex(){const n=de(D=>D.prompt),l=de(D=>D.setPrompt),o=de(D=>D.generate),{t:s}=ut(),r=de(D=>D.referenceImages),f=de(D=>D.addReferences),d=de(D=>D.removeReference),g=de(D=>D.useCurrentAsReference),m=de(D=>D.currentImage),h=J.useRef(null),[v,y]=J.useState(!1),b=r.length<kl,x=D=>{D.preventDefault(),y(!1);const E=Array.from(D.dataTransfer.files).filter(z=>z.type.startsWith("image/"));E.length>0&&f(E)},w=D=>{D.preventDefault(),v||y(!0)},C=D=>{D.currentTarget.contains(D.relatedTarget)||y(!1)},N=D=>{if(!D)return[];const E=[];for(const z of Array.from(D)){if(z.kind!=="file"||!z.type.startsWith("image/"))continue;const G=z.getAsFile();G&&E.push(G)}return E},M=D=>{if(!b)return;const E=N(D.clipboardData?.items??null);if(E.length===0)return;D.preventDefault();const z=kl-r.length;f(E.slice(0,z))};return J.useEffect(()=>{const D=E=>{const z=E.target,G=z?.tagName;if(G==="INPUT"||G==="TEXTAREA"||z?.isContentEditable)return;const q=N(E.clipboardData?.items??null);if(q.length===0||r.length>=kl)return;E.preventDefault();const U=kl-r.length;f(q.slice(0,U))};return window.addEventListener("paste",D),()=>window.removeEventListener("paste",D)},[r.length,f]),_.jsxs("div",{className:`composer${v?" composer--drag":""}`,onDrop:x,onDragOver:w,onDragLeave:C,onPaste:M,children:[_.jsxs("div",{className:"composer__header",children:[_.jsx("span",{className:"section-title composer__label",children:s("prompt.label")}),r.length>0&&_.jsx("span",{className:"composer__count",children:s("prompt.refCount",{count:r.length,max:kl})})]}),r.length>0&&_.jsx("div",{className:"composer__chips",children:r.map((D,E)=>_.jsxs("div",{className:"composer__chip",title:s("prompt.refChipTitle",{n:E+1}),children:[_.jsx("img",{src:D,alt:s("prompt.refChipAlt",{n:E+1})}),_.jsx("button",{type:"button",className:"composer__chip-remove",onClick:()=>d(E),"aria-label":s("prompt.refRemoveAria",{n:E+1}),children:"×"})]},E))}),_.jsx("textarea",{className:"prompt-area composer__textarea",value:n,placeholder:r.length>0?s("prompt.placeholderWithRefs"):s("prompt.placeholder"),onChange:D=>l(D.target.value),onKeyDown:D=>{D.key==="Enter"&&(D.metaKey||D.ctrlKey)&&(D.preventDefault(),o())}}),_.jsxs("div",{className:"composer__toolbar",children:[_.jsxs("button",{type:"button",className:"composer__tool",onClick:()=>b&&h.current?.click(),disabled:!b,title:s("prompt.attachTitle"),"aria-label":s("prompt.attachTitle"),children:[_.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:_.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"})}),_.jsx("span",{children:s("prompt.attach")})]}),_.jsxs("button",{type:"button",className:"composer__tool",onClick:()=>{g()},disabled:!m||!b,title:s("prompt.useCurrentTitle"),children:[_.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:[_.jsx("polyline",{points:"23 4 23 10 17 10"}),_.jsx("path",{d:"M20.49 15a9 9 0 1 1-2.12-9.36L23 10"})]}),_.jsx("span",{children:s("prompt.useCurrent")})]}),_.jsx("span",{className:"composer__hint",children:s("prompt.hint")})]}),v&&_.jsx("div",{className:"composer__dropzone","aria-hidden":"true",children:s("prompt.dropHere",{max:kl})}),_.jsx("input",{ref:h,type:"file",accept:"image/*",multiple:!0,hidden:!0,onChange:D=>{const E=Array.from(D.target.files??[]);E.length>0&&f(E),D.target.value=""}})]})}function tx(){const n=de(f=>f.activeGenerations),l=de(f=>f.generate),{t:o}=ut(),s=n>0,r=s?o("generate.buttonLoading",{n}):o("generate.button");return _.jsx("button",{type:"button",className:`generate-btn${s?" loading":""}`,onClick:()=>{l()},children:r})}function nx(n,l=28){const o=n.trim().replace(/\s+/g," ");return o.length>l?`${o.slice(0,l)}...`:o}function ax(){const n=de(s=>s.inFlight),{t:l}=ut(),o={queued:l("inflight.queued"),streaming:l("inflight.streaming"),decoding:l("inflight.decoding")};return n.length===0?null:_.jsx("ul",{className:"in-flight-list",children:n.map(s=>{const r=s.phase?o[s.phase]??s.phase:l("inflight.queued");return _.jsxs("li",{className:"in-flight-item","data-phase":s.phase??"queued",children:[_.jsx("span",{className:"in-flight-prompt",children:nx(s.prompt)}),_.jsx("span",{className:"in-flight-phase",children:r}),_.jsx("span",{className:"in-flight-spinner","aria-hidden":"true"})]},s.id)})})}function lx(){const n=de(f=>f.history),l=de(f=>f.currentImage),o=de(f=>f.selectHistory),s=de(f=>f.openGallery),{t:r}=ut();return _.jsxs("div",{className:"history-strip",children:[_.jsx("button",{type:"button",className:"history-thumb history-thumb--add",onClick:s,"aria-label":r("history.openGalleryAria"),title:r("history.openGalleryTitle"),children:_.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[_.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),_.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),_.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),_.jsx("rect",{x:"14",y:"14",width:"7",height:"7",rx:"1"})]})}),n.map((f,d)=>{const g=f.filename?l?.filename===f.filename:l?.image===f.image;return _.jsx("img",{src:f.thumb||f.url||f.image,alt:"",className:`history-thumb${g?" active":""}`,onClick:()=>o(f)},f.filename??`${d}-${f.image}`)})]})}const ix={ko:"KO",en:"EN"};function ox(){const{t:n,locale:l}=ut(),o=de(s=>s.setLocale);return _.jsx("div",{className:"lang-toggle",role:"group","aria-label":n("language.label"),children:jS.map(s=>_.jsx("button",{type:"button",className:`lang-toggle__btn ${l===s?"is-active":""}`,onClick:()=>o(s),"aria-pressed":l===s,title:n(`language.${s}`),children:_.jsx("span",{className:"lang-toggle__label",children:ix[s]})},s))})}function sx(){return ut(),de(n=>n.uiMode),_.jsxs("aside",{className:"sidebar",children:[_.jsxs("div",{className:"sidebar__scroll",children:[_.jsxs("div",{className:"logo",children:[_.jsx("div",{className:"logo-mark","aria-hidden":"true"}),_.jsxs("div",{className:"logo-copy",children:[_.jsx("div",{className:"logo-title",children:"ima2-gen"}),_.jsx("div",{className:"logo-subtitle",children:"gpt-image-2 studio"})]}),_.jsx(ox,{})]}),_.jsx(PS,{}),_.jsxs(_.Fragment,{children:[_.jsx(WS,{}),_.jsx(ex,{}),_.jsx(tx,{}),_.jsx(ax,{})]})]}),_.jsx(lx,{})]})}function rx(){const{t:n}=ut(),l=de(m=>m.currentImage),o=de(m=>m.showToast),s=de(m=>m.setPrompt);if(!l)return null;const r=()=>{const m=document.createElement("a");m.href=l.image,m.download=l.filename||"generated.png",m.click()},f=async()=>{try{const h=await(await fetch(l.image)).blob();await navigator.clipboard.write([new ClipboardItem({[h.type]:h})]),o(n("toast.imageCopied"))}catch{o(n("toast.copyFailed"),!0)}},d=()=>{l.prompt&&(navigator.clipboard.writeText(l.prompt),o(n("toast.promptCopied")))},g=()=>{if(!l.prompt){o(n("toast.noPromptToFork"),!0);return}s(l.prompt);const m=document.querySelector('textarea[name="prompt"], textarea#prompt, .sidebar textarea');m&&(m.focus(),m.setSelectionRange(m.value.length,m.value.length)),o(n("toast.forkStarted"))};return _.jsxs("div",{className:"result-actions",children:[_.jsx("button",{type:"button",className:"action-btn",onClick:r,children:n("result.download")}),_.jsx("button",{type:"button",className:"action-btn",onClick:f,children:n("result.copyImage")}),_.jsx("button",{type:"button",className:"action-btn",onClick:d,children:n("result.copyPrompt")}),_.jsx("button",{type:"button",className:"action-btn action-btn--primary",onClick:g,title:n("result.continueHereTitle"),children:n("result.continueHere")})]})}function ux(){const n=de(h=>h.currentImage),l=de(h=>h.activeGenerations),o=de(h=>h.quality),s=de(h=>h.getResolvedSize),r=de(h=>h.showToast),{t:f}=ut(),d=()=>{n?.prompt&&(navigator.clipboard.writeText(n.prompt),r(f("toast.promptCopied")))},g=n?.quality??o,m=n?.size??s();return _.jsxs("main",{className:"canvas",children:[_.jsx("div",{className:`progress-bar${l>0?" active":""}`}),n?_.jsxs("div",{className:"result-container visible",children:[_.jsx("img",{className:"result-img",src:n.url??n.image,alt:f("canvas.resultAlt")},n.filename??n.url??n.image),n.prompt?_.jsx("div",{className:"result-prompt",onClick:d,children:n.prompt}):null,_.jsx("div",{className:"result-meta",children:[n.elapsed!=null?`${n.elapsed}s`:null,n.usage?f("canvas.tokens",{n:n.usage.total_tokens??"?"}):null,g,m,n.provider??null].filter(h=>!!h).join(" · ")}),_.jsx(rx,{})]}):null]})}function lt(n){if(typeof n=="string"||typeof n=="number")return""+n;let l="";if(Array.isArray(n))for(let o=0,s;o<n.length;o++)(s=lt(n[o]))!==""&&(l+=(l&&" ")+s);else for(let o in n)n[o]&&(l+=(l&&" ")+o);return l}var cx={value:()=>{}};function wr(){for(var n=0,l=arguments.length,o={},s;n<l;++n){if(!(s=arguments[n]+"")||s in o||/[\s.]/.test(s))throw new Error("illegal type: "+s);o[s]=[]}return new sr(o)}function sr(n){this._=n}function fx(n,l){return n.trim().split(/^|\s+/).map(function(o){var s="",r=o.indexOf(".");if(r>=0&&(s=o.slice(r+1),o=o.slice(0,r)),o&&!l.hasOwnProperty(o))throw new Error("unknown type: "+o);return{type:o,name:s}})}sr.prototype=wr.prototype={constructor:sr,on:function(n,l){var o=this._,s=fx(n+"",o),r,f=-1,d=s.length;if(arguments.length<2){for(;++f<d;)if((r=(n=s[f]).type)&&(r=dx(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=s[f]).type)o[r]=lp(o[r],n.name,l);else if(l==null)for(r in o)o[r]=lp(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 sr(n)},call:function(n,l){if((r=arguments.length-2)>0)for(var o=new Array(r),s=0,r,f;s<r;++s)o[s]=arguments[s+2];if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(f=this._[n],s=0,r=f.length;s<r;++s)f[s].value.apply(l,o)},apply:function(n,l,o){if(!this._.hasOwnProperty(n))throw new Error("unknown type: "+n);for(var s=this._[n],r=0,f=s.length;r<f;++r)s[r].value.apply(l,o)}};function dx(n,l){for(var o=0,s=n.length,r;o<s;++o)if((r=n[o]).name===l)return r.value}function lp(n,l,o){for(var s=0,r=n.length;s<r;++s)if(n[s].name===l){n[s]=cx,n=n.slice(0,s).concat(n.slice(s+1));break}return o!=null&&n.push({name:l,value:o}),n}var _f="http://www.w3.org/1999/xhtml";const ip={svg:"http://www.w3.org/2000/svg",xhtml:_f,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Nr(n){var l=n+="",o=l.indexOf(":");return o>=0&&(l=n.slice(0,o))!=="xmlns"&&(n=n.slice(o+1)),ip.hasOwnProperty(l)?{space:ip[l],local:n}:n}function hx(n){return function(){var l=this.ownerDocument,o=this.namespaceURI;return o===_f&&l.documentElement.namespaceURI===_f?l.createElement(n):l.createElementNS(o,n)}}function gx(n){return function(){return this.ownerDocument.createElementNS(n.space,n.local)}}function x0(n){var l=Nr(n);return(l.local?gx:hx)(l)}function mx(){}function Bf(n){return n==null?mx:function(){return this.querySelector(n)}}function px(n){typeof n!="function"&&(n=Bf(n));for(var l=this._groups,o=l.length,s=new Array(o),r=0;r<o;++r)for(var f=l[r],d=f.length,g=s[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 qt(s,this._parents)}function yx(n){return n==null?[]:Array.isArray(n)?n:Array.from(n)}function vx(){return[]}function _0(n){return n==null?vx:function(){return this.querySelectorAll(n)}}function bx(n){return function(){return yx(n.apply(this,arguments))}}function Sx(n){typeof n=="function"?n=bx(n):n=_0(n);for(var l=this._groups,o=l.length,s=[],r=[],f=0;f<o;++f)for(var d=l[f],g=d.length,m,h=0;h<g;++h)(m=d[h])&&(s.push(n.call(m,m.__data__,h,d)),r.push(m));return new qt(s,r)}function E0(n){return function(){return this.matches(n)}}function w0(n){return function(l){return l.matches(n)}}var xx=Array.prototype.find;function _x(n){return function(){return xx.call(this.children,n)}}function Ex(){return this.firstElementChild}function wx(n){return this.select(n==null?Ex:_x(typeof n=="function"?n:w0(n)))}var Nx=Array.prototype.filter;function Ax(){return Array.from(this.children)}function Tx(n){return function(){return Nx.call(this.children,n)}}function Mx(n){return this.selectAll(n==null?Ax:Tx(typeof n=="function"?n:w0(n)))}function Cx(n){typeof n!="function"&&(n=E0(n));for(var l=this._groups,o=l.length,s=new Array(o),r=0;r<o;++r)for(var f=l[r],d=f.length,g=s[r]=[],m,h=0;h<d;++h)(m=f[h])&&n.call(m,m.__data__,h,f)&&g.push(m);return new qt(s,this._parents)}function N0(n){return new Array(n.length)}function zx(){return new qt(this._enter||this._groups.map(N0),this._parents)}function hr(n,l){this.ownerDocument=n.ownerDocument,this.namespaceURI=n.namespaceURI,this._next=null,this._parent=n,this.__data__=l}hr.prototype={constructor:hr,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 Dx(n){return function(){return n}}function Ox(n,l,o,s,r,f){for(var d=0,g,m=l.length,h=f.length;d<h;++d)(g=l[d])?(g.__data__=f[d],s[d]=g):o[d]=new hr(n,f[d]);for(;d<m;++d)(g=l[d])&&(r[d]=g)}function Rx(n,l,o,s,r,f,d){var g,m,h=new Map,v=l.length,y=f.length,b=new Array(v),x;for(g=0;g<v;++g)(m=l[g])&&(b[g]=x=d.call(m,m.__data__,g,l)+"",h.has(x)?r[g]=m:h.set(x,m));for(g=0;g<y;++g)x=d.call(n,f[g],g,f)+"",(m=h.get(x))?(s[g]=m,m.__data__=f[g],h.delete(x)):o[g]=new hr(n,f[g]);for(g=0;g<v;++g)(m=l[g])&&h.get(b[g])===m&&(r[g]=m)}function Hx(n){return n.__data__}function jx(n,l){if(!arguments.length)return Array.from(this,Hx);var o=l?Rx:Ox,s=this._parents,r=this._groups;typeof n!="function"&&(n=Dx(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=s[h],y=r[h],b=y.length,x=Lx(n.call(v,v&&v.__data__,h,s)),w=x.length,C=g[h]=new Array(w),N=d[h]=new Array(w),M=m[h]=new Array(b);o(v,y,C,N,M,x,l);for(var D=0,E=0,z,G;D<w;++D)if(z=C[D]){for(D>=E&&(E=D+1);!(G=N[E])&&++E<w;);z._next=G||null}}return d=new qt(d,s),d._enter=g,d._exit=m,d}function Lx(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function Bx(){return new qt(this._exit||this._groups.map(N0),this._parents)}function Ux(n,l,o){var s=this.enter(),r=this,f=this.exit();return typeof n=="function"?(s=n(s),s&&(s=s.selection())):s=s.append(n+""),l!=null&&(r=l(r),r&&(r=r.selection())),o==null?f.remove():o(f),s&&r?s.merge(r).order():r}function qx(n){for(var l=n.selection?n.selection():n,o=this._groups,s=l._groups,r=o.length,f=s.length,d=Math.min(r,f),g=new Array(r),m=0;m<d;++m)for(var h=o[m],v=s[m],y=h.length,b=g[m]=new Array(y),x,w=0;w<y;++w)(x=h[w]||v[w])&&(b[w]=x);for(;m<r;++m)g[m]=o[m];return new qt(g,this._parents)}function Gx(){for(var n=this._groups,l=-1,o=n.length;++l<o;)for(var s=n[l],r=s.length-1,f=s[r],d;--r>=0;)(d=s[r])&&(f&&d.compareDocumentPosition(f)^4&&f.parentNode.insertBefore(d,f),f=d);return this}function Yx(n){n||(n=Vx);function l(y,b){return y&&b?n(y.__data__,b.__data__):!y-!b}for(var o=this._groups,s=o.length,r=new Array(s),f=0;f<s;++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 qt(r,this._parents).order()}function Vx(n,l){return n<l?-1:n>l?1:n>=l?0:NaN}function Xx(){var n=arguments[0];return arguments[0]=this,n.apply(null,arguments),this}function Zx(){return Array.from(this)}function Ix(){for(var n=this._groups,l=0,o=n.length;l<o;++l)for(var s=n[l],r=0,f=s.length;r<f;++r){var d=s[r];if(d)return d}return null}function Qx(){let n=0;for(const l of this)++n;return n}function kx(){return!this.node()}function $x(n){for(var l=this._groups,o=0,s=l.length;o<s;++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 Kx(n){return function(){this.removeAttribute(n)}}function Jx(n){return function(){this.removeAttributeNS(n.space,n.local)}}function Fx(n,l){return function(){this.setAttribute(n,l)}}function Wx(n,l){return function(){this.setAttributeNS(n.space,n.local,l)}}function Px(n,l){return function(){var o=l.apply(this,arguments);o==null?this.removeAttribute(n):this.setAttribute(n,o)}}function e2(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 t2(n,l){var o=Nr(n);if(arguments.length<2){var s=this.node();return o.local?s.getAttributeNS(o.space,o.local):s.getAttribute(o)}return this.each((l==null?o.local?Jx:Kx:typeof l=="function"?o.local?e2:Px:o.local?Wx:Fx)(o,l))}function A0(n){return n.ownerDocument&&n.ownerDocument.defaultView||n.document&&n||n.defaultView}function n2(n){return function(){this.style.removeProperty(n)}}function a2(n,l,o){return function(){this.style.setProperty(n,l,o)}}function l2(n,l,o){return function(){var s=l.apply(this,arguments);s==null?this.style.removeProperty(n):this.style.setProperty(n,s,o)}}function i2(n,l,o){return arguments.length>1?this.each((l==null?n2:typeof l=="function"?l2:a2)(n,l,o??"")):ei(this.node(),n)}function ei(n,l){return n.style.getPropertyValue(l)||A0(n).getComputedStyle(n,null).getPropertyValue(l)}function o2(n){return function(){delete this[n]}}function s2(n,l){return function(){this[n]=l}}function r2(n,l){return function(){var o=l.apply(this,arguments);o==null?delete this[n]:this[n]=o}}function u2(n,l){return arguments.length>1?this.each((l==null?o2:typeof l=="function"?r2:s2)(n,l)):this.node()[n]}function T0(n){return n.trim().split(/^|\s+/)}function Uf(n){return n.classList||new M0(n)}function M0(n){this._node=n,this._names=T0(n.getAttribute("class")||"")}M0.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 C0(n,l){for(var o=Uf(n),s=-1,r=l.length;++s<r;)o.add(l[s])}function z0(n,l){for(var o=Uf(n),s=-1,r=l.length;++s<r;)o.remove(l[s])}function c2(n){return function(){C0(this,n)}}function f2(n){return function(){z0(this,n)}}function d2(n,l){return function(){(l.apply(this,arguments)?C0:z0)(this,n)}}function h2(n,l){var o=T0(n+"");if(arguments.length<2){for(var s=Uf(this.node()),r=-1,f=o.length;++r<f;)if(!s.contains(o[r]))return!1;return!0}return this.each((typeof l=="function"?d2:l?c2:f2)(o,l))}function g2(){this.textContent=""}function m2(n){return function(){this.textContent=n}}function p2(n){return function(){var l=n.apply(this,arguments);this.textContent=l??""}}function y2(n){return arguments.length?this.each(n==null?g2:(typeof n=="function"?p2:m2)(n)):this.node().textContent}function v2(){this.innerHTML=""}function b2(n){return function(){this.innerHTML=n}}function S2(n){return function(){var l=n.apply(this,arguments);this.innerHTML=l??""}}function x2(n){return arguments.length?this.each(n==null?v2:(typeof n=="function"?S2:b2)(n)):this.node().innerHTML}function _2(){this.nextSibling&&this.parentNode.appendChild(this)}function E2(){return this.each(_2)}function w2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function N2(){return this.each(w2)}function A2(n){var l=typeof n=="function"?n:x0(n);return this.select(function(){return this.appendChild(l.apply(this,arguments))})}function T2(){return null}function M2(n,l){var o=typeof n=="function"?n:x0(n),s=l==null?T2:typeof l=="function"?l:Bf(l);return this.select(function(){return this.insertBefore(o.apply(this,arguments),s.apply(this,arguments)||null)})}function C2(){var n=this.parentNode;n&&n.removeChild(this)}function z2(){return this.each(C2)}function D2(){var n=this.cloneNode(!1),l=this.parentNode;return l?l.insertBefore(n,this.nextSibling):n}function O2(){var n=this.cloneNode(!0),l=this.parentNode;return l?l.insertBefore(n,this.nextSibling):n}function R2(n){return this.select(n?O2:D2)}function H2(n){return arguments.length?this.property("__data__",n):this.node().__data__}function j2(n){return function(l){n.call(this,l,this.__data__)}}function L2(n){return n.trim().split(/^|\s+/).map(function(l){var o="",s=l.indexOf(".");return s>=0&&(o=l.slice(s+1),l=l.slice(0,s)),{type:l,name:o}})}function B2(n){return function(){var l=this.__on;if(l){for(var o=0,s=-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[++s]=f;++s?l.length=s:delete this.__on}}}function U2(n,l,o){return function(){var s=this.__on,r,f=j2(l);if(s){for(var d=0,g=s.length;d<g;++d)if((r=s[d]).type===n.type&&r.name===n.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=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},s?s.push(r):this.__on=[r]}}function q2(n,l,o){var s=L2(n+""),r,f=s.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=s[r]).type===v.type&&d.name===v.name)return v.value}return}for(g=l?U2:B2,r=0;r<f;++r)this.each(g(s[r],l,o));return this}function D0(n,l,o){var s=A0(n),r=s.CustomEvent;typeof r=="function"?r=new r(l,o):(r=s.document.createEvent("Event"),o?(r.initEvent(l,o.bubbles,o.cancelable),r.detail=o.detail):r.initEvent(l,!1,!1)),n.dispatchEvent(r)}function G2(n,l){return function(){return D0(this,n,l)}}function Y2(n,l){return function(){return D0(this,n,l.apply(this,arguments))}}function V2(n,l){return this.each((typeof l=="function"?Y2:G2)(n,l))}function*X2(){for(var n=this._groups,l=0,o=n.length;l<o;++l)for(var s=n[l],r=0,f=s.length,d;r<f;++r)(d=s[r])&&(yield d)}var O0=[null];function qt(n,l){this._groups=n,this._parents=l}function Eo(){return new qt([[document.documentElement]],O0)}function Z2(){return this}qt.prototype=Eo.prototype={constructor:qt,select:px,selectAll:Sx,selectChild:wx,selectChildren:Mx,filter:Cx,data:jx,enter:zx,exit:Bx,join:Ux,merge:qx,selection:Z2,order:Gx,sort:Yx,call:Xx,nodes:Zx,node:Ix,size:Qx,empty:kx,each:$x,attr:t2,style:i2,property:u2,classed:h2,text:y2,html:x2,raise:E2,lower:N2,append:A2,insert:M2,remove:z2,clone:R2,datum:H2,on:q2,dispatch:V2,[Symbol.iterator]:X2};function Ut(n){return typeof n=="string"?new qt([[document.querySelector(n)]],[document.documentElement]):new qt([[n]],O0)}function I2(n){let l;for(;l=n.sourceEvent;)n=l;return n}function en(n,l){if(n=I2(n),l===void 0&&(l=n.currentTarget),l){var o=l.ownerSVGElement||l;if(o.createSVGPoint){var s=o.createSVGPoint();return s.x=n.clientX,s.y=n.clientY,s=s.matrixTransform(l.getScreenCTM().inverse()),[s.x,s.y]}if(l.getBoundingClientRect){var r=l.getBoundingClientRect();return[n.clientX-r.left-l.clientLeft,n.clientY-r.top-l.clientTop]}}return[n.pageX,n.pageY]}const Q2={passive:!1},ho={capture:!0,passive:!1};function rf(n){n.stopImmediatePropagation()}function Wl(n){n.preventDefault(),n.stopImmediatePropagation()}function R0(n){var l=n.document.documentElement,o=Ut(n).on("dragstart.drag",Wl,ho);"onselectstart"in l?o.on("selectstart.drag",Wl,ho):(l.__noselect=l.style.MozUserSelect,l.style.MozUserSelect="none")}function H0(n,l){var o=n.document.documentElement,s=Ut(n).on("dragstart.drag",null);l&&(s.on("click.drag",Wl,ho),setTimeout(function(){s.on("click.drag",null)},0)),"onselectstart"in o?s.on("selectstart.drag",null):(o.style.MozUserSelect=o.__noselect,delete o.__noselect)}const Ws=n=>()=>n;function Ef(n,{sourceEvent:l,subject:o,target:s,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:s,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}})}Ef.prototype.on=function(){var n=this._.on.apply(this._,arguments);return n===this._?this:n};function k2(n){return!n.ctrlKey&&!n.button}function $2(){return this.parentNode}function K2(n,l){return l??{x:n.x,y:n.y}}function J2(){return navigator.maxTouchPoints||"ontouchstart"in this}function j0(){var n=k2,l=$2,o=K2,s=J2,r={},f=wr("start","drag","end"),d=0,g,m,h,v,y=0;function b(z){z.on("mousedown.drag",x).filter(s).on("touchstart.drag",N).on("touchmove.drag",M,Q2).on("touchend.drag touchcancel.drag",D).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(z,G){if(!(v||!n.call(this,z,G))){var q=E(this,l.call(this,z,G),z,G,"mouse");q&&(Ut(z.view).on("mousemove.drag",w,ho).on("mouseup.drag",C,ho),R0(z.view),rf(z),h=!1,g=z.clientX,m=z.clientY,q("start",z))}}function w(z){if(Wl(z),!h){var G=z.clientX-g,q=z.clientY-m;h=G*G+q*q>y}r.mouse("drag",z)}function C(z){Ut(z.view).on("mousemove.drag mouseup.drag",null),H0(z.view,h),Wl(z),r.mouse("end",z)}function N(z,G){if(n.call(this,z,G)){var q=z.changedTouches,U=l.call(this,z,G),$=q.length,F,Z;for(F=0;F<$;++F)(Z=E(this,U,z,G,q[F].identifier,q[F]))&&(rf(z),Z("start",z,q[F]))}}function M(z){var G=z.changedTouches,q=G.length,U,$;for(U=0;U<q;++U)($=r[G[U].identifier])&&(Wl(z),$("drag",z,G[U]))}function D(z){var G=z.changedTouches,q=G.length,U,$;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),U=0;U<q;++U)($=r[G[U].identifier])&&(rf(z),$("end",z,G[U]))}function E(z,G,q,U,$,F){var Z=f.copy(),Y=en(F||q,G),W,le,O;if((O=o.call(z,new Ef("beforestart",{sourceEvent:q,target:b,identifier:$,active:d,x:Y[0],y:Y[1],dx:0,dy:0,dispatch:Z}),U))!=null)return W=O.x-Y[0]||0,le=O.y-Y[1]||0,function X(A,H,B){var I=Y,te;switch(A){case"start":r[$]=X,te=d++;break;case"end":delete r[$],--d;case"drag":Y=en(B||H,G),te=d;break}Z.call(A,z,new Ef(A,{sourceEvent:H,subject:O,target:b,identifier:$,active:te,x:Y[0]+W,y:Y[1]+le,dx:Y[0]-I[0],dy:Y[1]-I[1],dispatch:Z}),U)}}return b.filter=function(z){return arguments.length?(n=typeof z=="function"?z:Ws(!!z),b):n},b.container=function(z){return arguments.length?(l=typeof z=="function"?z:Ws(z),b):l},b.subject=function(z){return arguments.length?(o=typeof z=="function"?z:Ws(z),b):o},b.touchable=function(z){return arguments.length?(s=typeof z=="function"?z:Ws(!!z),b):s},b.on=function(){var z=f.on.apply(f,arguments);return z===f?b:z},b.clickDistance=function(z){return arguments.length?(y=(z=+z)*z,b):Math.sqrt(y)},b}function qf(n,l,o){n.prototype=l.prototype=o,o.constructor=n}function L0(n,l){var o=Object.create(n.prototype);for(var s in l)o[s]=l[s];return o}function wo(){}var go=.7,gr=1/go,Pl="\\s*([+-]?\\d+)\\s*",mo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",gn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",F2=/^#([0-9a-f]{3,8})$/,W2=new RegExp(`^rgb\\(${Pl},${Pl},${Pl}\\)$`),P2=new RegExp(`^rgb\\(${gn},${gn},${gn}\\)$`),e_=new RegExp(`^rgba\\(${Pl},${Pl},${Pl},${mo}\\)$`),t_=new RegExp(`^rgba\\(${gn},${gn},${gn},${mo}\\)$`),n_=new RegExp(`^hsl\\(${mo},${gn},${gn}\\)$`),a_=new RegExp(`^hsla\\(${mo},${gn},${gn},${mo}\\)$`),op={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};qf(wo,el,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:sp,formatHex:sp,formatHex8:l_,formatHsl:i_,formatRgb:rp,toString:rp});function sp(){return this.rgb().formatHex()}function l_(){return this.rgb().formatHex8()}function i_(){return B0(this).formatHsl()}function rp(){return this.rgb().formatRgb()}function el(n){var l,o;return n=(n+"").trim().toLowerCase(),(l=F2.exec(n))?(o=l[1].length,l=parseInt(l[1],16),o===6?up(l):o===3?new Mt(l>>8&15|l>>4&240,l>>4&15|l&240,(l&15)<<4|l&15,1):o===8?Ps(l>>24&255,l>>16&255,l>>8&255,(l&255)/255):o===4?Ps(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=W2.exec(n))?new Mt(l[1],l[2],l[3],1):(l=P2.exec(n))?new Mt(l[1]*255/100,l[2]*255/100,l[3]*255/100,1):(l=e_.exec(n))?Ps(l[1],l[2],l[3],l[4]):(l=t_.exec(n))?Ps(l[1]*255/100,l[2]*255/100,l[3]*255/100,l[4]):(l=n_.exec(n))?dp(l[1],l[2]/100,l[3]/100,1):(l=a_.exec(n))?dp(l[1],l[2]/100,l[3]/100,l[4]):op.hasOwnProperty(n)?up(op[n]):n==="transparent"?new Mt(NaN,NaN,NaN,0):null}function up(n){return new Mt(n>>16&255,n>>8&255,n&255,1)}function Ps(n,l,o,s){return s<=0&&(n=l=o=NaN),new Mt(n,l,o,s)}function o_(n){return n instanceof wo||(n=el(n)),n?(n=n.rgb(),new Mt(n.r,n.g,n.b,n.opacity)):new Mt}function wf(n,l,o,s){return arguments.length===1?o_(n):new Mt(n,l,o,s??1)}function Mt(n,l,o,s){this.r=+n,this.g=+l,this.b=+o,this.opacity=+s}qf(Mt,wf,L0(wo,{brighter(n){return n=n==null?gr:Math.pow(gr,n),new Mt(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?go:Math.pow(go,n),new Mt(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new Mt(Wa(this.r),Wa(this.g),Wa(this.b),mr(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:cp,formatHex:cp,formatHex8:s_,formatRgb:fp,toString:fp}));function cp(){return`#${Fa(this.r)}${Fa(this.g)}${Fa(this.b)}`}function s_(){return`#${Fa(this.r)}${Fa(this.g)}${Fa(this.b)}${Fa((isNaN(this.opacity)?1:this.opacity)*255)}`}function fp(){const n=mr(this.opacity);return`${n===1?"rgb(":"rgba("}${Wa(this.r)}, ${Wa(this.g)}, ${Wa(this.b)}${n===1?")":`, ${n})`}`}function mr(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function Wa(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function Fa(n){return n=Wa(n),(n<16?"0":"")+n.toString(16)}function dp(n,l,o,s){return s<=0?n=l=o=NaN:o<=0||o>=1?n=l=NaN:l<=0&&(n=NaN),new tn(n,l,o,s)}function B0(n){if(n instanceof tn)return new tn(n.h,n.s,n.l,n.opacity);if(n instanceof wo||(n=el(n)),!n)return new tn;if(n instanceof tn)return n;n=n.rgb();var l=n.r/255,o=n.g/255,s=n.b/255,r=Math.min(l,o,s),f=Math.max(l,o,s),d=NaN,g=f-r,m=(f+r)/2;return g?(l===f?d=(o-s)/g+(o<s)*6:o===f?d=(s-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 tn(d,g,m,n.opacity)}function r_(n,l,o,s){return arguments.length===1?B0(n):new tn(n,l,o,s??1)}function tn(n,l,o,s){this.h=+n,this.s=+l,this.l=+o,this.opacity=+s}qf(tn,r_,L0(wo,{brighter(n){return n=n==null?gr:Math.pow(gr,n),new tn(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?go:Math.pow(go,n),new tn(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,l=isNaN(n)||isNaN(this.s)?0:this.s,o=this.l,s=o+(o<.5?o:1-o)*l,r=2*o-s;return new Mt(uf(n>=240?n-240:n+120,r,s),uf(n,r,s),uf(n<120?n+240:n-120,r,s),this.opacity)},clamp(){return new tn(hp(this.h),er(this.s),er(this.l),mr(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=mr(this.opacity);return`${n===1?"hsl(":"hsla("}${hp(this.h)}, ${er(this.s)*100}%, ${er(this.l)*100}%${n===1?")":`, ${n})`}`}}));function hp(n){return n=(n||0)%360,n<0?n+360:n}function er(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 Gf=n=>()=>n;function u_(n,l){return function(o){return n+o*l}}function c_(n,l,o){return n=Math.pow(n,o),l=Math.pow(l,o)-n,o=1/o,function(s){return Math.pow(n+s*l,o)}}function f_(n){return(n=+n)==1?U0:function(l,o){return o-l?c_(l,o,n):Gf(isNaN(l)?o:l)}}function U0(n,l){var o=l-n;return o?u_(n,o):Gf(isNaN(n)?l:n)}const pr=(function n(l){var o=f_(l);function s(r,f){var d=o((r=wf(r)).r,(f=wf(f)).r),g=o(r.g,f.g),m=o(r.b,f.b),h=U0(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 s.gamma=n,s})(1);function d_(n,l){l||(l=[]);var o=n?Math.min(l.length,n.length):0,s=l.slice(),r;return function(f){for(r=0;r<o;++r)s[r]=n[r]*(1-f)+l[r]*f;return s}}function h_(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function g_(n,l){var o=l?l.length:0,s=n?Math.min(o,n.length):0,r=new Array(s),f=new Array(o),d;for(d=0;d<s;++d)r[d]=co(n[d],l[d]);for(;d<o;++d)f[d]=l[d];return function(g){for(d=0;d<s;++d)f[d]=r[d](g);return f}}function m_(n,l){var o=new Date;return n=+n,l=+l,function(s){return o.setTime(n*(1-s)+l*s),o}}function dn(n,l){return n=+n,l=+l,function(o){return n*(1-o)+l*o}}function p_(n,l){var o={},s={},r;(n===null||typeof n!="object")&&(n={}),(l===null||typeof l!="object")&&(l={});for(r in l)r in n?o[r]=co(n[r],l[r]):s[r]=l[r];return function(f){for(r in o)s[r]=o[r](f);return s}}var Nf=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,cf=new RegExp(Nf.source,"g");function y_(n){return function(){return n}}function v_(n){return function(l){return n(l)+""}}function q0(n,l){var o=Nf.lastIndex=cf.lastIndex=0,s,r,f,d=-1,g=[],m=[];for(n=n+"",l=l+"";(s=Nf.exec(n))&&(r=cf.exec(l));)(f=r.index)>o&&(f=l.slice(o,f),g[d]?g[d]+=f:g[++d]=f),(s=s[0])===(r=r[0])?g[d]?g[d]+=r:g[++d]=r:(g[++d]=null,m.push({i:d,x:dn(s,r)})),o=cf.lastIndex;return o<l.length&&(f=l.slice(o),g[d]?g[d]+=f:g[++d]=f),g.length<2?m[0]?v_(m[0].x):y_(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 co(n,l){var o=typeof l,s;return l==null||o==="boolean"?Gf(l):(o==="number"?dn:o==="string"?(s=el(l))?(l=s,pr):q0:l instanceof el?pr:l instanceof Date?m_:h_(l)?d_:Array.isArray(l)?g_:typeof l.valueOf!="function"&&typeof l.toString!="function"||isNaN(l)?p_:dn)(n,l)}var gp=180/Math.PI,Af={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function G0(n,l,o,s,r,f){var d,g,m;return(d=Math.sqrt(n*n+l*l))&&(n/=d,l/=d),(m=n*o+l*s)&&(o-=n*m,s-=l*m),(g=Math.sqrt(o*o+s*s))&&(o/=g,s/=g,m/=g),n*s<l*o&&(n=-n,l=-l,m=-m,d=-d),{translateX:r,translateY:f,rotate:Math.atan2(l,n)*gp,skewX:Math.atan(m)*gp,scaleX:d,scaleY:g}}var tr;function b_(n){const l=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(n+"");return l.isIdentity?Af:G0(l.a,l.b,l.c,l.d,l.e,l.f)}function S_(n){return n==null||(tr||(tr=document.createElementNS("http://www.w3.org/2000/svg","g")),tr.setAttribute("transform",n),!(n=tr.transform.baseVal.consolidate()))?Af:(n=n.matrix,G0(n.a,n.b,n.c,n.d,n.e,n.f))}function Y0(n,l,o,s){function r(h){return h.length?h.pop()+" ":""}function f(h,v,y,b,x,w){if(h!==y||v!==b){var C=x.push("translate(",null,l,null,o);w.push({i:C-4,x:dn(h,y)},{i:C-2,x:dn(v,b)})}else(y||b)&&x.push("translate("+y+l+b+o)}function d(h,v,y,b){h!==v?(h-v>180?v+=360:v-h>180&&(h+=360),b.push({i:y.push(r(y)+"rotate(",null,s)-2,x:dn(h,v)})):v&&y.push(r(y)+"rotate("+v+s)}function g(h,v,y,b){h!==v?b.push({i:y.push(r(y)+"skewX(",null,s)-2,x:dn(h,v)}):v&&y.push(r(y)+"skewX("+v+s)}function m(h,v,y,b,x,w){if(h!==y||v!==b){var C=x.push(r(x)+"scale(",null,",",null,")");w.push({i:C-4,x:dn(h,y)},{i:C-2,x:dn(v,b)})}else(y!==1||b!==1)&&x.push(r(x)+"scale("+y+","+b+")")}return function(h,v){var y=[],b=[];return h=n(h),v=n(v),f(h.translateX,h.translateY,v.translateX,v.translateY,y,b),d(h.rotate,v.rotate,y,b),g(h.skewX,v.skewX,y,b),m(h.scaleX,h.scaleY,v.scaleX,v.scaleY,y,b),h=v=null,function(x){for(var w=-1,C=b.length,N;++w<C;)y[(N=b[w]).i]=N.x(x);return y.join("")}}}var x_=Y0(b_,"px, ","px)","deg)"),__=Y0(S_,", ",")",")"),E_=1e-12;function mp(n){return((n=Math.exp(n))+1/n)/2}function w_(n){return((n=Math.exp(n))-1/n)/2}function N_(n){return((n=Math.exp(2*n))-1)/(n+1)}const rr=(function n(l,o,s){function r(f,d){var g=f[0],m=f[1],h=f[2],v=d[0],y=d[1],b=d[2],x=v-g,w=y-m,C=x*x+w*w,N,M;if(C<E_)M=Math.log(b/h)/l,N=function(U){return[g+U*x,m+U*w,h*Math.exp(l*U*M)]};else{var D=Math.sqrt(C),E=(b*b-h*h+s*C)/(2*h*o*D),z=(b*b-h*h-s*C)/(2*b*o*D),G=Math.log(Math.sqrt(E*E+1)-E),q=Math.log(Math.sqrt(z*z+1)-z);M=(q-G)/l,N=function(U){var $=U*M,F=mp(G),Z=h/(o*D)*(F*N_(l*$+G)-w_(G));return[g+Z*x,m+Z*w,h*F/mp(l*$+G)]}}return N.duration=M*1e3*l/Math.SQRT2,N}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 ti=0,ro=0,ao=0,V0=1e3,yr,uo,vr=0,tl=0,Ar=0,po=typeof performance=="object"&&performance.now?performance:Date,X0=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(n){setTimeout(n,17)};function Yf(){return tl||(X0(A_),tl=po.now()+Ar)}function A_(){tl=0}function br(){this._call=this._time=this._next=null}br.prototype=Z0.prototype={constructor:br,restart:function(n,l,o){if(typeof n!="function")throw new TypeError("callback is not a function");o=(o==null?Yf():+o)+(l==null?0:+l),!this._next&&uo!==this&&(uo?uo._next=this:yr=this,uo=this),this._call=n,this._time=o,Tf()},stop:function(){this._call&&(this._call=null,this._time=1/0,Tf())}};function Z0(n,l,o){var s=new br;return s.restart(n,l,o),s}function T_(){Yf(),++ti;for(var n=yr,l;n;)(l=tl-n._time)>=0&&n._call.call(void 0,l),n=n._next;--ti}function pp(){tl=(vr=po.now())+Ar,ti=ro=0;try{T_()}finally{ti=0,C_(),tl=0}}function M_(){var n=po.now(),l=n-vr;l>V0&&(Ar-=l,vr=n)}function C_(){for(var n,l=yr,o,s=1/0;l;)l._call?(s>l._time&&(s=l._time),n=l,l=l._next):(o=l._next,l._next=null,l=n?n._next=o:yr=o);uo=n,Tf(s)}function Tf(n){if(!ti){ro&&(ro=clearTimeout(ro));var l=n-tl;l>24?(n<1/0&&(ro=setTimeout(pp,n-po.now()-Ar)),ao&&(ao=clearInterval(ao))):(ao||(vr=po.now(),ao=setInterval(M_,V0)),ti=1,X0(pp))}}function yp(n,l,o){var s=new br;return l=l==null?0:+l,s.restart(r=>{s.stop(),n(r+l)},l,o),s}var z_=wr("start","end","cancel","interrupt"),D_=[],I0=0,vp=1,Mf=2,ur=3,bp=4,Cf=5,cr=6;function Tr(n,l,o,s,r,f){var d=n.__transition;if(!d)n.__transition={};else if(o in d)return;O_(n,o,{name:l,index:s,group:r,on:z_,tween:D_,time:f.time,delay:f.delay,duration:f.duration,ease:f.ease,timer:null,state:I0})}function Vf(n,l){var o=ln(n,l);if(o.state>I0)throw new Error("too late; already scheduled");return o}function pn(n,l){var o=ln(n,l);if(o.state>ur)throw new Error("too late; already running");return o}function ln(n,l){var o=n.__transition;if(!o||!(o=o[l]))throw new Error("transition not found");return o}function O_(n,l,o){var s=n.__transition,r;s[l]=o,o.timer=Z0(f,0,o.time);function f(h){o.state=vp,o.timer.restart(d,o.delay,o.time),o.delay<=h&&d(h-o.delay)}function d(h){var v,y,b,x;if(o.state!==vp)return m();for(v in s)if(x=s[v],x.name===o.name){if(x.state===ur)return yp(d);x.state===bp?(x.state=cr,x.timer.stop(),x.on.call("interrupt",n,n.__data__,x.index,x.group),delete s[v]):+v<l&&(x.state=cr,x.timer.stop(),x.on.call("cancel",n,n.__data__,x.index,x.group),delete s[v])}if(yp(function(){o.state===ur&&(o.state=bp,o.timer.restart(g,o.delay,o.time),g(h))}),o.state=Mf,o.on.call("start",n,n.__data__,o.index,o.group),o.state===Mf){for(o.state=ur,r=new Array(b=o.tween.length),v=0,y=-1;v<b;++v)(x=o.tween[v].value.call(n,n.__data__,o.index,o.group))&&(r[++y]=x);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=Cf,1),y=-1,b=r.length;++y<b;)r[y].call(n,v);o.state===Cf&&(o.on.call("end",n,n.__data__,o.index,o.group),m())}function m(){o.state=cr,o.timer.stop(),delete s[l];for(var h in s)return;delete n.__transition}}function fr(n,l){var o=n.__transition,s,r,f=!0,d;if(o){l=l==null?null:l+"";for(d in o){if((s=o[d]).name!==l){f=!1;continue}r=s.state>Mf&&s.state<Cf,s.state=cr,s.timer.stop(),s.on.call(r?"interrupt":"cancel",n,n.__data__,s.index,s.group),delete o[d]}f&&delete n.__transition}}function R_(n){return this.each(function(){fr(this,n)})}function H_(n,l){var o,s;return function(){var r=pn(this,n),f=r.tween;if(f!==o){s=o=f;for(var d=0,g=s.length;d<g;++d)if(s[d].name===l){s=s.slice(),s.splice(d,1);break}}r.tween=s}}function j_(n,l,o){var s,r;if(typeof o!="function")throw new Error;return function(){var f=pn(this,n),d=f.tween;if(d!==s){r=(s=d).slice();for(var g={name:l,value:o},m=0,h=r.length;m<h;++m)if(r[m].name===l){r[m]=g;break}m===h&&r.push(g)}f.tween=r}}function L_(n,l){var o=this._id;if(n+="",arguments.length<2){for(var s=ln(this.node(),o).tween,r=0,f=s.length,d;r<f;++r)if((d=s[r]).name===n)return d.value;return null}return this.each((l==null?H_:j_)(o,n,l))}function Xf(n,l,o){var s=n._id;return n.each(function(){var r=pn(this,s);(r.value||(r.value={}))[l]=o.apply(this,arguments)}),function(r){return ln(r,s).value[l]}}function Q0(n,l){var o;return(typeof l=="number"?dn:l instanceof el?pr:(o=el(l))?(l=o,pr):q0)(n,l)}function B_(n){return function(){this.removeAttribute(n)}}function U_(n){return function(){this.removeAttributeNS(n.space,n.local)}}function q_(n,l,o){var s,r=o+"",f;return function(){var d=this.getAttribute(n);return d===r?null:d===s?f:f=l(s=d,o)}}function G_(n,l,o){var s,r=o+"",f;return function(){var d=this.getAttributeNS(n.space,n.local);return d===r?null:d===s?f:f=l(s=d,o)}}function Y_(n,l,o){var s,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===s&&m===r?f:(r=m,f=l(s=d,g)))}}function V_(n,l,o){var s,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===s&&m===r?f:(r=m,f=l(s=d,g)))}}function X_(n,l){var o=Nr(n),s=o==="transform"?__:Q0;return this.attrTween(n,typeof l=="function"?(o.local?V_:Y_)(o,s,Xf(this,"attr."+n,l)):l==null?(o.local?U_:B_)(o):(o.local?G_:q_)(o,s,l))}function Z_(n,l){return function(o){this.setAttribute(n,l.call(this,o))}}function I_(n,l){return function(o){this.setAttributeNS(n.space,n.local,l.call(this,o))}}function Q_(n,l){var o,s;function r(){var f=l.apply(this,arguments);return f!==s&&(o=(s=f)&&I_(n,f)),o}return r._value=l,r}function k_(n,l){var o,s;function r(){var f=l.apply(this,arguments);return f!==s&&(o=(s=f)&&Z_(n,f)),o}return r._value=l,r}function $_(n,l){var o="attr."+n;if(arguments.length<2)return(o=this.tween(o))&&o._value;if(l==null)return this.tween(o,null);if(typeof l!="function")throw new Error;var s=Nr(n);return this.tween(o,(s.local?Q_:k_)(s,l))}function K_(n,l){return function(){Vf(this,n).delay=+l.apply(this,arguments)}}function J_(n,l){return l=+l,function(){Vf(this,n).delay=l}}function F_(n){var l=this._id;return arguments.length?this.each((typeof n=="function"?K_:J_)(l,n)):ln(this.node(),l).delay}function W_(n,l){return function(){pn(this,n).duration=+l.apply(this,arguments)}}function P_(n,l){return l=+l,function(){pn(this,n).duration=l}}function eE(n){var l=this._id;return arguments.length?this.each((typeof n=="function"?W_:P_)(l,n)):ln(this.node(),l).duration}function tE(n,l){if(typeof l!="function")throw new Error;return function(){pn(this,n).ease=l}}function nE(n){var l=this._id;return arguments.length?this.each(tE(l,n)):ln(this.node(),l).ease}function aE(n,l){return function(){var o=l.apply(this,arguments);if(typeof o!="function")throw new Error;pn(this,n).ease=o}}function lE(n){if(typeof n!="function")throw new Error;return this.each(aE(this._id,n))}function iE(n){typeof n!="function"&&(n=E0(n));for(var l=this._groups,o=l.length,s=new Array(o),r=0;r<o;++r)for(var f=l[r],d=f.length,g=s[r]=[],m,h=0;h<d;++h)(m=f[h])&&n.call(m,m.__data__,h,f)&&g.push(m);return new Xn(s,this._parents,this._name,this._id)}function oE(n){if(n._id!==this._id)throw new Error;for(var l=this._groups,o=n._groups,s=l.length,r=o.length,f=Math.min(s,r),d=new Array(s),g=0;g<f;++g)for(var m=l[g],h=o[g],v=m.length,y=d[g]=new Array(v),b,x=0;x<v;++x)(b=m[x]||h[x])&&(y[x]=b);for(;g<s;++g)d[g]=l[g];return new Xn(d,this._parents,this._name,this._id)}function sE(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 rE(n,l,o){var s,r,f=sE(l)?Vf:pn;return function(){var d=f(this,n),g=d.on;g!==s&&(r=(s=g).copy()).on(l,o),d.on=r}}function uE(n,l){var o=this._id;return arguments.length<2?ln(this.node(),o).on.on(n):this.each(rE(o,n,l))}function cE(n){return function(){var l=this.parentNode;for(var o in this.__transition)if(+o!==n)return;l&&l.removeChild(this)}}function fE(){return this.on("end.remove",cE(this._id))}function dE(n){var l=this._name,o=this._id;typeof n!="function"&&(n=Bf(n));for(var s=this._groups,r=s.length,f=new Array(r),d=0;d<r;++d)for(var g=s[d],m=g.length,h=f[d]=new Array(m),v,y,b=0;b<m;++b)(v=g[b])&&(y=n.call(v,v.__data__,b,g))&&("__data__"in v&&(y.__data__=v.__data__),h[b]=y,Tr(h[b],l,o,b,h,ln(v,o)));return new Xn(f,this._parents,l,o)}function hE(n){var l=this._name,o=this._id;typeof n!="function"&&(n=_0(n));for(var s=this._groups,r=s.length,f=[],d=[],g=0;g<r;++g)for(var m=s[g],h=m.length,v,y=0;y<h;++y)if(v=m[y]){for(var b=n.call(v,v.__data__,y,m),x,w=ln(v,o),C=0,N=b.length;C<N;++C)(x=b[C])&&Tr(x,l,o,C,b,w);f.push(b),d.push(v)}return new Xn(f,d,l,o)}var gE=Eo.prototype.constructor;function mE(){return new gE(this._groups,this._parents)}function pE(n,l){var o,s,r;return function(){var f=ei(this,n),d=(this.style.removeProperty(n),ei(this,n));return f===d?null:f===o&&d===s?r:r=l(o=f,s=d)}}function k0(n){return function(){this.style.removeProperty(n)}}function yE(n,l,o){var s,r=o+"",f;return function(){var d=ei(this,n);return d===r?null:d===s?f:f=l(s=d,o)}}function vE(n,l,o){var s,r,f;return function(){var d=ei(this,n),g=o(this),m=g+"";return g==null&&(m=g=(this.style.removeProperty(n),ei(this,n))),d===m?null:d===s&&m===r?f:(r=m,f=l(s=d,g))}}function bE(n,l){var o,s,r,f="style."+l,d="end."+f,g;return function(){var m=pn(this,n),h=m.on,v=m.value[f]==null?g||(g=k0(l)):void 0;(h!==o||r!==v)&&(s=(o=h).copy()).on(d,r=v),m.on=s}}function SE(n,l,o){var s=(n+="")=="transform"?x_:Q0;return l==null?this.styleTween(n,pE(n,s)).on("end.style."+n,k0(n)):typeof l=="function"?this.styleTween(n,vE(n,s,Xf(this,"style."+n,l))).each(bE(this._id,n)):this.styleTween(n,yE(n,s,l),o).on("end.style."+n,null)}function xE(n,l,o){return function(s){this.style.setProperty(n,l.call(this,s),o)}}function _E(n,l,o){var s,r;function f(){var d=l.apply(this,arguments);return d!==r&&(s=(r=d)&&xE(n,d,o)),s}return f._value=l,f}function EE(n,l,o){var s="style."+(n+="");if(arguments.length<2)return(s=this.tween(s))&&s._value;if(l==null)return this.tween(s,null);if(typeof l!="function")throw new Error;return this.tween(s,_E(n,l,o??""))}function wE(n){return function(){this.textContent=n}}function NE(n){return function(){var l=n(this);this.textContent=l??""}}function AE(n){return this.tween("text",typeof n=="function"?NE(Xf(this,"text",n)):wE(n==null?"":n+""))}function TE(n){return function(l){this.textContent=n.call(this,l)}}function ME(n){var l,o;function s(){var r=n.apply(this,arguments);return r!==o&&(l=(o=r)&&TE(r)),l}return s._value=n,s}function CE(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,ME(n))}function zE(){for(var n=this._name,l=this._id,o=$0(),s=this._groups,r=s.length,f=0;f<r;++f)for(var d=s[f],g=d.length,m,h=0;h<g;++h)if(m=d[h]){var v=ln(m,l);Tr(m,n,o,h,d,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new Xn(s,this._parents,n,o)}function DE(){var n,l,o=this,s=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=pn(this,s),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 OE=0;function Xn(n,l,o,s){this._groups=n,this._parents=l,this._name=o,this._id=s}function $0(){return++OE}var Gn=Eo.prototype;Xn.prototype={constructor:Xn,select:dE,selectAll:hE,selectChild:Gn.selectChild,selectChildren:Gn.selectChildren,filter:iE,merge:oE,selection:mE,transition:zE,call:Gn.call,nodes:Gn.nodes,node:Gn.node,size:Gn.size,empty:Gn.empty,each:Gn.each,on:uE,attr:X_,attrTween:$_,style:SE,styleTween:EE,text:AE,textTween:CE,remove:fE,tween:L_,delay:F_,duration:eE,ease:nE,easeVarying:lE,end:DE,[Symbol.iterator]:Gn[Symbol.iterator]};function RE(n){return((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2}var HE={time:null,delay:0,duration:250,ease:RE};function jE(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 LE(n){var l,o;n instanceof Xn?(l=n._id,n=n._name):(l=$0(),(o=HE).time=Yf(),n=n==null?null:n+"");for(var s=this._groups,r=s.length,f=0;f<r;++f)for(var d=s[f],g=d.length,m,h=0;h<g;++h)(m=d[h])&&Tr(m,n,l,h,d,o||jE(m,l));return new Xn(s,this._parents,n,l)}Eo.prototype.interrupt=R_;Eo.prototype.transition=LE;const nr=n=>()=>n;function BE(n,{sourceEvent:l,target:o,transform:s,dispatch:r}){Object.defineProperties(this,{type:{value:n,enumerable:!0,configurable:!0},sourceEvent:{value:l,enumerable:!0,configurable:!0},target:{value:o,enumerable:!0,configurable:!0},transform:{value:s,enumerable:!0,configurable:!0},_:{value:r}})}function Vn(n,l,o){this.k=n,this.x=l,this.y=o}Vn.prototype={constructor:Vn,scale:function(n){return n===1?this:new Vn(this.k*n,this.x,this.y)},translate:function(n,l){return n===0&l===0?this:new Vn(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 Mr=new Vn(1,0,0);K0.prototype=Vn.prototype;function K0(n){for(;!n.__zoom;)if(!(n=n.parentNode))return Mr;return n.__zoom}function ff(n){n.stopImmediatePropagation()}function lo(n){n.preventDefault(),n.stopImmediatePropagation()}function UE(n){return(!n.ctrlKey||n.type==="wheel")&&!n.button}function qE(){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 Sp(){return this.__zoom||Mr}function GE(n){return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*(n.ctrlKey?10:1)}function YE(){return navigator.maxTouchPoints||"ontouchstart"in this}function VE(n,l,o){var s=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>s?(s+r)/2:Math.min(0,s)||Math.max(0,r),d>f?(f+d)/2:Math.min(0,f)||Math.max(0,d))}function J0(){var n=UE,l=qE,o=VE,s=GE,r=YE,f=[0,1/0],d=[[-1/0,-1/0],[1/0,1/0]],g=250,m=rr,h=wr("start","zoom","end"),v,y,b,x=500,w=150,C=0,N=10;function M(O){O.property("__zoom",Sp).on("wheel.zoom",$,{passive:!1}).on("mousedown.zoom",F).on("dblclick.zoom",Z).filter(r).on("touchstart.zoom",Y).on("touchmove.zoom",W).on("touchend.zoom touchcancel.zoom",le).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}M.transform=function(O,X,A,H){var B=O.selection?O.selection():O;B.property("__zoom",Sp),O!==B?G(O,X,A,H):B.interrupt().each(function(){q(this,arguments).event(H).start().zoom(null,typeof X=="function"?X.apply(this,arguments):X).end()})},M.scaleBy=function(O,X,A,H){M.scaleTo(O,function(){var B=this.__zoom.k,I=typeof X=="function"?X.apply(this,arguments):X;return B*I},A,H)},M.scaleTo=function(O,X,A,H){M.transform(O,function(){var B=l.apply(this,arguments),I=this.__zoom,te=A==null?z(B):typeof A=="function"?A.apply(this,arguments):A,T=I.invert(te),j=typeof X=="function"?X.apply(this,arguments):X;return o(E(D(I,j),te,T),B,d)},A,H)},M.translateBy=function(O,X,A,H){M.transform(O,function(){return o(this.__zoom.translate(typeof X=="function"?X.apply(this,arguments):X,typeof A=="function"?A.apply(this,arguments):A),l.apply(this,arguments),d)},null,H)},M.translateTo=function(O,X,A,H,B){M.transform(O,function(){var I=l.apply(this,arguments),te=this.__zoom,T=H==null?z(I):typeof H=="function"?H.apply(this,arguments):H;return o(Mr.translate(T[0],T[1]).scale(te.k).translate(typeof X=="function"?-X.apply(this,arguments):-X,typeof A=="function"?-A.apply(this,arguments):-A),I,d)},H,B)};function D(O,X){return X=Math.max(f[0],Math.min(f[1],X)),X===O.k?O:new Vn(X,O.x,O.y)}function E(O,X,A){var H=X[0]-A[0]*O.k,B=X[1]-A[1]*O.k;return H===O.x&&B===O.y?O:new Vn(O.k,H,B)}function z(O){return[(+O[0][0]+ +O[1][0])/2,(+O[0][1]+ +O[1][1])/2]}function G(O,X,A,H){O.on("start.zoom",function(){q(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){q(this,arguments).event(H).end()}).tween("zoom",function(){var B=this,I=arguments,te=q(B,I).event(H),T=l.apply(B,I),j=A==null?z(T):typeof A=="function"?A.apply(B,I):A,ee=Math.max(T[1][0]-T[0][0],T[1][1]-T[0][1]),ne=B.__zoom,re=typeof X=="function"?X.apply(B,I):X,ce=m(ne.invert(j).concat(ee/ne.k),re.invert(j).concat(ee/re.k));return function(ue){if(ue===1)ue=re;else{var se=ce(ue),fe=ee/se[2];ue=new Vn(fe,j[0]-se[0]*fe,j[1]-se[1]*fe)}te.zoom(null,ue)}})}function q(O,X,A){return!A&&O.__zooming||new U(O,X)}function U(O,X){this.that=O,this.args=X,this.active=0,this.sourceEvent=null,this.extent=l.apply(O,X),this.taps=0}U.prototype={event:function(O){return O&&(this.sourceEvent=O),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(O,X){return this.mouse&&O!=="mouse"&&(this.mouse[1]=X.invert(this.mouse[0])),this.touch0&&O!=="touch"&&(this.touch0[1]=X.invert(this.touch0[0])),this.touch1&&O!=="touch"&&(this.touch1[1]=X.invert(this.touch1[0])),this.that.__zoom=X,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(O){var X=Ut(this.that).datum();h.call(O,this.that,new BE(O,{sourceEvent:this.sourceEvent,target:M,transform:this.that.__zoom,dispatch:h}),X)}};function $(O,...X){if(!n.apply(this,arguments))return;var A=q(this,X).event(O),H=this.__zoom,B=Math.max(f[0],Math.min(f[1],H.k*Math.pow(2,s.apply(this,arguments)))),I=en(O);if(A.wheel)(A.mouse[0][0]!==I[0]||A.mouse[0][1]!==I[1])&&(A.mouse[1]=H.invert(A.mouse[0]=I)),clearTimeout(A.wheel);else{if(H.k===B)return;A.mouse=[I,H.invert(I)],fr(this),A.start()}lo(O),A.wheel=setTimeout(te,w),A.zoom("mouse",o(E(D(H,B),A.mouse[0],A.mouse[1]),A.extent,d));function te(){A.wheel=null,A.end()}}function F(O,...X){if(b||!n.apply(this,arguments))return;var A=O.currentTarget,H=q(this,X,!0).event(O),B=Ut(O.view).on("mousemove.zoom",j,!0).on("mouseup.zoom",ee,!0),I=en(O,A),te=O.clientX,T=O.clientY;R0(O.view),ff(O),H.mouse=[I,this.__zoom.invert(I)],fr(this),H.start();function j(ne){if(lo(ne),!H.moved){var re=ne.clientX-te,ce=ne.clientY-T;H.moved=re*re+ce*ce>C}H.event(ne).zoom("mouse",o(E(H.that.__zoom,H.mouse[0]=en(ne,A),H.mouse[1]),H.extent,d))}function ee(ne){B.on("mousemove.zoom mouseup.zoom",null),H0(ne.view,H.moved),lo(ne),H.event(ne).end()}}function Z(O,...X){if(n.apply(this,arguments)){var A=this.__zoom,H=en(O.changedTouches?O.changedTouches[0]:O,this),B=A.invert(H),I=A.k*(O.shiftKey?.5:2),te=o(E(D(A,I),H,B),l.apply(this,X),d);lo(O),g>0?Ut(this).transition().duration(g).call(G,te,H,O):Ut(this).call(M.transform,te,H,O)}}function Y(O,...X){if(n.apply(this,arguments)){var A=O.touches,H=A.length,B=q(this,X,O.changedTouches.length===H).event(O),I,te,T,j;for(ff(O),te=0;te<H;++te)T=A[te],j=en(T,this),j=[j,this.__zoom.invert(j),T.identifier],B.touch0?!B.touch1&&B.touch0[2]!==j[2]&&(B.touch1=j,B.taps=0):(B.touch0=j,I=!0,B.taps=1+!!v);v&&(v=clearTimeout(v)),I&&(B.taps<2&&(y=j[0],v=setTimeout(function(){v=null},x)),fr(this),B.start())}}function W(O,...X){if(this.__zooming){var A=q(this,X).event(O),H=O.changedTouches,B=H.length,I,te,T,j;for(lo(O),I=0;I<B;++I)te=H[I],T=en(te,this),A.touch0&&A.touch0[2]===te.identifier?A.touch0[0]=T:A.touch1&&A.touch1[2]===te.identifier&&(A.touch1[0]=T);if(te=A.that.__zoom,A.touch1){var ee=A.touch0[0],ne=A.touch0[1],re=A.touch1[0],ce=A.touch1[1],ue=(ue=re[0]-ee[0])*ue+(ue=re[1]-ee[1])*ue,se=(se=ce[0]-ne[0])*se+(se=ce[1]-ne[1])*se;te=D(te,Math.sqrt(ue/se)),T=[(ee[0]+re[0])/2,(ee[1]+re[1])/2],j=[(ne[0]+ce[0])/2,(ne[1]+ce[1])/2]}else if(A.touch0)T=A.touch0[0],j=A.touch0[1];else return;A.zoom("touch",o(E(te,T,j),A.extent,d))}}function le(O,...X){if(this.__zooming){var A=q(this,X).event(O),H=O.changedTouches,B=H.length,I,te;for(ff(O),b&&clearTimeout(b),b=setTimeout(function(){b=null},x),I=0;I<B;++I)te=H[I],A.touch0&&A.touch0[2]===te.identifier?delete A.touch0:A.touch1&&A.touch1[2]===te.identifier&&delete A.touch1;if(A.touch1&&!A.touch0&&(A.touch0=A.touch1,delete A.touch1),A.touch0)A.touch0[1]=this.__zoom.invert(A.touch0[0]);else if(A.end(),A.taps===2&&(te=en(te,this),Math.hypot(y[0]-te[0],y[1]-te[1])<N)){var T=Ut(this).on("dblclick.zoom");T&&T.apply(this,arguments)}}}return M.wheelDelta=function(O){return arguments.length?(s=typeof O=="function"?O:nr(+O),M):s},M.filter=function(O){return arguments.length?(n=typeof O=="function"?O:nr(!!O),M):n},M.touchable=function(O){return arguments.length?(r=typeof O=="function"?O:nr(!!O),M):r},M.extent=function(O){return arguments.length?(l=typeof O=="function"?O:nr([[+O[0][0],+O[0][1]],[+O[1][0],+O[1][1]]]),M):l},M.scaleExtent=function(O){return arguments.length?(f[0]=+O[0],f[1]=+O[1],M):[f[0],f[1]]},M.translateExtent=function(O){return arguments.length?(d[0][0]=+O[0][0],d[1][0]=+O[1][0],d[0][1]=+O[0][1],d[1][1]=+O[1][1],M):[[d[0][0],d[0][1]],[d[1][0],d[1][1]]]},M.constrain=function(O){return arguments.length?(o=O,M):o},M.duration=function(O){return arguments.length?(g=+O,M):g},M.interpolate=function(O){return arguments.length?(m=O,M):m},M.on=function(){var O=h.on.apply(h,arguments);return O===h?M:O},M.clickDistance=function(O){return arguments.length?(C=(O=+O)*O,M):Math.sqrt(C)},M.tapDistance=function(O){return arguments.length?(N=+O,M):N},M}const mn={error001:()=>"[React Flow]: Seems like you have not used zustand provider as an ancestor. Help: https://reactflow.dev/error#001",error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:n=>`Node type "${n}" not found. Using fallback type "default".`,error004:()=>"The React Flow parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:n=>`The old edge with id=${n} does not exist.`,error009:n=>`Marker type "${n}" doesn't exist.`,error008:(n,{id:l,sourceHandle:o,targetHandle:s})=>`Couldn't create edge for ${n} handle id: "${n==="source"?o:s}", edge id: ${l}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:n=>`Edge type "${n}" not found. Using fallback type "default".`,error012:n=>`Node with id "${n}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(n="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${n}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs."},yo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],F0=["Enter"," ","Escape"],W0={"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 ni;(function(n){n.Strict="strict",n.Loose="loose"})(ni||(ni={}));var Pa;(function(n){n.Free="free",n.Vertical="vertical",n.Horizontal="horizontal"})(Pa||(Pa={}));var vo;(function(n){n.Partial="partial",n.Full="full"})(vo||(vo={}));const P0={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var _a;(function(n){n.Bezier="default",n.Straight="straight",n.Step="step",n.SmoothStep="smoothstep",n.SimpleBezier="simplebezier"})(_a||(_a={}));var Sr;(function(n){n.Arrow="arrow",n.ArrowClosed="arrowclosed"})(Sr||(Sr={}));var me;(function(n){n.Left="left",n.Top="top",n.Right="right",n.Bottom="bottom"})(me||(me={}));const xp={[me.Left]:me.Right,[me.Right]:me.Left,[me.Top]:me.Bottom,[me.Bottom]:me.Top};function ey(n){return n===null?null:n?"valid":"invalid"}const ty=n=>"id"in n&&"source"in n&&"target"in n,XE=n=>"id"in n&&"position"in n&&!("source"in n)&&!("target"in n),Zf=n=>"id"in n&&"internals"in n&&!("source"in n)&&!("target"in n),No=(n,l=[0,0])=>{const{width:o,height:s}=Zn(n),r=n.origin??l,f=o*r[0],d=s*r[1];return{x:n.position.x-f,y:n.position.y-d}},ZE=(n,l={nodeOrigin:[0,0]})=>{if(n.length===0)return{x:0,y:0,width:0,height:0};const o=n.reduce((s,r)=>{const f=typeof r=="string";let d=!l.nodeLookup&&!f?r:void 0;l.nodeLookup&&(d=f?l.nodeLookup.get(r):Zf(r)?r:l.nodeLookup.get(r.id));const g=d?xr(d,l.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Cr(s,g)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return zr(o)},Ao=(n,l={})=>{let o={x:1/0,y:1/0,x2:-1/0,y2:-1/0},s=!1;return n.forEach(r=>{(l.filter===void 0||l.filter(r))&&(o=Cr(o,xr(r)),s=!0)}),s?zr(o):{x:0,y:0,width:0,height:0}},If=(n,l,[o,s,r]=[0,0,1],f=!1,d=!1)=>{const g={...Mo(l,[o,s,r]),width:l.width/r,height:l.height/r},m=[];for(const h of n.values()){const{measured:v,selectable:y=!0,hidden:b=!1}=h;if(d&&!y||b)continue;const x=v.width??h.width??h.initialWidth??null,w=v.height??h.height??h.initialHeight??null,C=bo(g,li(h)),N=(x??0)*(w??0),M=f&&C>0;(!h.internals.handleBounds||M||C>=N||h.dragging)&&m.push(h)}return m},IE=(n,l)=>{const o=new Set;return n.forEach(s=>{o.add(s.id)}),l.filter(s=>o.has(s.source)||o.has(s.target))};function QE(n,l){const o=new Map,s=l?.nodes?new Set(l.nodes.map(r=>r.id)):null;return n.forEach(r=>{r.measured.width&&r.measured.height&&(l?.includeHiddenNodes||!r.hidden)&&(!s||s.has(r.id))&&o.set(r.id,r)}),o}async function kE({nodes:n,width:l,height:o,panZoom:s,minZoom:r,maxZoom:f},d){if(n.size===0)return Promise.resolve(!0);const g=QE(n,d),m=Ao(g),h=Qf(m,l,o,d?.minZoom??r,d?.maxZoom??f,d?.padding??.1);return await s.setViewport(h,{duration:d?.duration,ease:d?.ease,interpolate:d?.interpolate}),Promise.resolve(!0)}function ny({nodeId:n,nextPosition:l,nodeLookup:o,nodeOrigin:s=[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??s;let y=d.extent||r;if(d.extent==="parent"&&!d.expandParent)if(!g)f?.("005",mn.error005());else{const x=g.measured.width,w=g.measured.height;x&&w&&(y=[[m,h],[m+x,h+w]])}else g&&ii(d.extent)&&(y=[[d.extent[0][0]+m,d.extent[0][1]+h],[d.extent[1][0]+m,d.extent[1][1]+h]]);const b=ii(y)?nl(l,y,d.measured):l;return(d.measured.width===void 0||d.measured.height===void 0)&&f?.("015",mn.error015()),{position:{x:b.x-m+(d.measured.width??0)*v[0],y:b.y-h+(d.measured.height??0)*v[1]},positionAbsolute:b}}async function $E({nodesToRemove:n=[],edgesToRemove:l=[],nodes:o,edges:s,onBeforeDelete:r}){const f=new Set(n.map(b=>b.id)),d=[];for(const b of o){if(b.deletable===!1)continue;const x=f.has(b.id),w=!x&&b.parentId&&d.find(C=>C.id===b.parentId);(x||w)&&d.push(b)}const g=new Set(l.map(b=>b.id)),m=s.filter(b=>b.deletable!==!1),v=IE(d,m);for(const b of m)g.has(b.id)&&!v.find(w=>w.id===b.id)&&v.push(b);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 ai=(n,l=0,o=1)=>Math.min(Math.max(n,l),o),nl=(n={x:0,y:0},l,o)=>({x:ai(n.x,l[0][0],l[1][0]-(o?.width??0)),y:ai(n.y,l[0][1],l[1][1]-(o?.height??0))});function ay(n,l,o){const{width:s,height:r}=Zn(o),{x:f,y:d}=o.internals.positionAbsolute;return nl(n,[[f,d],[f+s,d+r]],l)}const _p=(n,l,o)=>n<l?ai(Math.abs(n-l),1,l)/l:n>o?-ai(Math.abs(n-o),1,l)/l:0,ly=(n,l,o=15,s=40)=>{const r=_p(n.x,s,l.width-s)*o,f=_p(n.y,s,l.height-s)*o;return[r,f]},Cr=(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)}),zf=({x:n,y:l,width:o,height:s})=>({x:n,y:l,x2:n+o,y2:l+s}),zr=({x:n,y:l,x2:o,y2:s})=>({x:n,y:l,width:o-n,height:s-l}),li=(n,l=[0,0])=>{const{x:o,y:s}=Zf(n)?n.internals.positionAbsolute:No(n,l);return{x:o,y:s,width:n.measured?.width??n.width??n.initialWidth??0,height:n.measured?.height??n.height??n.initialHeight??0}},xr=(n,l=[0,0])=>{const{x:o,y:s}=Zf(n)?n.internals.positionAbsolute:No(n,l);return{x:o,y:s,x2:o+(n.measured?.width??n.width??n.initialWidth??0),y2:s+(n.measured?.height??n.height??n.initialHeight??0)}},iy=(n,l)=>zr(Cr(zf(n),zf(l))),bo=(n,l)=>{const o=Math.max(0,Math.min(n.x+n.width,l.x+l.width)-Math.max(n.x,l.x)),s=Math.max(0,Math.min(n.y+n.height,l.y+l.height)-Math.max(n.y,l.y));return Math.ceil(o*s)},Ep=n=>nn(n.width)&&nn(n.height)&&nn(n.x)&&nn(n.y),nn=n=>!isNaN(n)&&isFinite(n),KE=(n,l)=>{},To=(n,l=[1,1])=>({x:l[0]*Math.round(n.x/l[0]),y:l[1]*Math.round(n.y/l[1])}),Mo=({x:n,y:l},[o,s,r],f=!1,d=[1,1])=>{const g={x:(n-o)/r,y:(l-s)/r};return f?To(g,d):g},_r=({x:n,y:l},[o,s,r])=>({x:n*r+o,y:l*r+s});function $l(n,l){if(typeof n=="number")return Math.floor((l-l/(1+n))*.5);if(typeof n=="string"&&n.endsWith("px")){const o=parseFloat(n);if(!Number.isNaN(o))return Math.floor(o)}if(typeof n=="string"&&n.endsWith("%")){const o=parseFloat(n);if(!Number.isNaN(o))return Math.floor(l*o*.01)}return console.error(`[React Flow] The padding value "${n}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function JE(n,l,o){if(typeof n=="string"||typeof n=="number"){const s=$l(n,o),r=$l(n,l);return{top:s,right:r,bottom:s,left:r,x:r*2,y:s*2}}if(typeof n=="object"){const s=$l(n.top??n.y??0,o),r=$l(n.bottom??n.y??0,o),f=$l(n.left??n.x??0,l),d=$l(n.right??n.x??0,l);return{top:s,right:d,bottom:r,left:f,x:f+d,y:s+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function FE(n,l,o,s,r,f){const{x:d,y:g}=_r(n,[l,o,s]),{x:m,y:h}=_r({x:n.x+n.width,y:n.y+n.height},[l,o,s]),v=r-m,y=f-h;return{left:Math.floor(d),top:Math.floor(g),right:Math.floor(v),bottom:Math.floor(y)}}const Qf=(n,l,o,s,r,f)=>{const d=JE(f,l,o),g=(l-d.x)/n.width,m=(o-d.y)/n.height,h=Math.min(g,m),v=ai(h,s,r),y=n.x+n.width/2,b=n.y+n.height/2,x=l/2-y*v,w=o/2-b*v,C=FE(n,x,w,v,l,o),N={left:Math.min(C.left-d.left,0),top:Math.min(C.top-d.top,0),right:Math.min(C.right-d.right,0),bottom:Math.min(C.bottom-d.bottom,0)};return{x:x-N.left+N.right,y:w-N.top+N.bottom,zoom:v}},So=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function ii(n){return n!=null&&n!=="parent"}function Zn(n){return{width:n.measured?.width??n.width??n.initialWidth??0,height:n.measured?.height??n.height??n.initialHeight??0}}function oy(n){return(n.measured?.width??n.width??n.initialWidth)!==void 0&&(n.measured?.height??n.height??n.initialHeight)!==void 0}function sy(n,l={width:0,height:0},o,s,r){const f={...n},d=s.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 wp(n,l){if(n.size!==l.size)return!1;for(const o of n)if(!l.has(o))return!1;return!0}function WE(){let n,l;return{promise:new Promise((s,r)=>{n=s,l=r}),resolve:n,reject:l}}function PE(n){return{...W0,...n||{}}}function fo(n,{snapGrid:l=[0,0],snapToGrid:o=!1,transform:s,containerBounds:r}){const{x:f,y:d}=an(n),g=Mo({x:f-(r?.left??0),y:d-(r?.top??0)},s),{x:m,y:h}=o?To(g,l):g;return{xSnapped:m,ySnapped:h,...g}}const kf=n=>({width:n.offsetWidth,height:n.offsetHeight}),ry=n=>n?.getRootNode?.()||window?.document,ew=["INPUT","SELECT","TEXTAREA"];function uy(n){const l=n.composedPath?.()?.[0]||n.target;return l?.nodeType!==1?!1:ew.includes(l.nodeName)||l.hasAttribute("contenteditable")||!!l.closest(".nokey")}const cy=n=>"clientX"in n,an=(n,l)=>{const o=cy(n),s=o?n.clientX:n.touches?.[0].clientX,r=o?n.clientY:n.touches?.[0].clientY;return{x:s-(l?.left??0),y:r-(l?.top??0)}},Np=(n,l,o,s,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)/s,y:(g.top-o.top)/s,...kf(d)}})};function fy({sourceX:n,sourceY:l,targetX:o,targetY:s,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+s*.125,v=Math.abs(m-n),y=Math.abs(h-l);return[m,h,v,y]}function ar(n,l){return n>=0?.5*n:l*25*Math.sqrt(-n)}function Ap({pos:n,x1:l,y1:o,x2:s,y2:r,c:f}){switch(n){case me.Left:return[l-ar(l-s,f),o];case me.Right:return[l+ar(s-l,f),o];case me.Top:return[l,o-ar(o-r,f)];case me.Bottom:return[l,o+ar(r-o,f)]}}function dy({sourceX:n,sourceY:l,sourcePosition:o=me.Bottom,targetX:s,targetY:r,targetPosition:f=me.Top,curvature:d=.25}){const[g,m]=Ap({pos:o,x1:n,y1:l,x2:s,y2:r,c:d}),[h,v]=Ap({pos:f,x1:s,y1:r,x2:n,y2:l,c:d}),[y,b,x,w]=fy({sourceX:n,sourceY:l,targetX:s,targetY:r,sourceControlX:g,sourceControlY:m,targetControlX:h,targetControlY:v});return[`M${n},${l} C${g},${m} ${h},${v} ${s},${r}`,y,b,x,w]}function hy({sourceX:n,sourceY:l,targetX:o,targetY:s}){const r=Math.abs(o-n)/2,f=o<n?o+r:o-r,d=Math.abs(s-l)/2,g=s<l?s+d:s-d;return[f,g,r,d]}function tw({sourceNode:n,targetNode:l,selected:o=!1,zIndex:s=0,elevateOnSelect:r=!1,zIndexMode:f="basic"}){if(f==="manual")return s;const d=r&&o?s+1e3:s,g=Math.max(n.parentId||r&&n.selected?n.internals.z:0,l.parentId||r&&l.selected?l.internals.z:0);return d+g}function nw({sourceNode:n,targetNode:l,width:o,height:s,transform:r}){const f=Cr(xr(n),xr(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:s/r[2]};return bo(d,zr(f))>0}const aw=({source:n,sourceHandle:l,target:o,targetHandle:s})=>`xy-edge__${n}${l||""}-${o}${s||""}`,lw=(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)),iw=(n,l,o={})=>{if(!n.source||!n.target)return l;const s=o.getEdgeId||aw;let r;return ty(n)?r={...n}:r={...n,id:s(n)},lw(r,l)?l:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,l.concat(r))};function gy({sourceX:n,sourceY:l,targetX:o,targetY:s}){const[r,f,d,g]=hy({sourceX:n,sourceY:l,targetX:o,targetY:s});return[`M ${n},${l}L ${o},${s}`,r,f,d,g]}const Tp={[me.Left]:{x:-1,y:0},[me.Right]:{x:1,y:0},[me.Top]:{x:0,y:-1},[me.Bottom]:{x:0,y:1}},ow=({source:n,sourcePosition:l=me.Bottom,target:o})=>l===me.Left||l===me.Right?n.x<o.x?{x:1,y:0}:{x:-1,y:0}:n.y<o.y?{x:0,y:1}:{x:0,y:-1},Mp=(n,l)=>Math.sqrt(Math.pow(l.x-n.x,2)+Math.pow(l.y-n.y,2));function sw({source:n,sourcePosition:l=me.Bottom,target:o,targetPosition:s=me.Top,center:r,offset:f,stepPosition:d}){const g=Tp[l],m=Tp[s],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=ow({source:h,sourcePosition:l,target:v}),b=y.x!==0?"x":"y",x=y[b];let w=[],C,N;const M={x:0,y:0},D={x:0,y:0},[,,E,z]=hy({sourceX:n.x,sourceY:n.y,targetX:o.x,targetY:o.y});if(g[b]*m[b]===-1){b==="x"?(C=r.x??h.x+(v.x-h.x)*d,N=r.y??(h.y+v.y)/2):(C=r.x??(h.x+v.x)/2,N=r.y??h.y+(v.y-h.y)*d);const $=[{x:C,y:h.y},{x:C,y:v.y}],F=[{x:h.x,y:N},{x:v.x,y:N}];g[b]===x?w=b==="x"?$:F:w=b==="x"?F:$}else{const $=[{x:h.x,y:v.y}],F=[{x:v.x,y:h.y}];if(b==="x"?w=g.x===x?F:$:w=g.y===x?$:F,l===s){const O=Math.abs(n[b]-o[b]);if(O<=f){const X=Math.min(f-1,f-O);g[b]===x?M[b]=(h[b]>n[b]?-1:1)*X:D[b]=(v[b]>o[b]?-1:1)*X}}if(l!==s){const O=b==="x"?"y":"x",X=g[b]===m[O],A=h[O]>v[O],H=h[O]<v[O];(g[b]===1&&(!X&&A||X&&H)||g[b]!==1&&(!X&&H||X&&A))&&(w=b==="x"?$:F)}const Z={x:h.x+M.x,y:h.y+M.y},Y={x:v.x+D.x,y:v.y+D.y},W=Math.max(Math.abs(Z.x-w[0].x),Math.abs(Y.x-w[0].x)),le=Math.max(Math.abs(Z.y-w[0].y),Math.abs(Y.y-w[0].y));W>=le?(C=(Z.x+Y.x)/2,N=w[0].y):(C=w[0].x,N=(Z.y+Y.y)/2)}const G={x:h.x+M.x,y:h.y+M.y},q={x:v.x+D.x,y:v.y+D.y};return[[n,...G.x!==w[0].x||G.y!==w[0].y?[G]:[],...w,...q.x!==w[w.length-1].x||q.y!==w[w.length-1].y?[q]:[],o],C,N,E,z]}function rw(n,l,o,s){const r=Math.min(Mp(n,l)/2,Mp(l,o)/2,s),{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 Df({sourceX:n,sourceY:l,sourcePosition:o=me.Bottom,targetX:s,targetY:r,targetPosition:f=me.Top,borderRadius:d=5,centerX:g,centerY:m,offset:h=20,stepPosition:v=.5}){const[y,b,x,w,C]=sw({source:{x:n,y:l},sourcePosition:o,target:{x:s,y:r},targetPosition:f,center:{x:g,y:m},offset:h,stepPosition:v});let N=`M${y[0].x} ${y[0].y}`;for(let M=1;M<y.length-1;M++)N+=rw(y[M-1],y[M],y[M+1],d);return N+=`L${y[y.length-1].x} ${y[y.length-1].y}`,[N,b,x,w,C]}function Cp(n){return n&&!!(n.internals.handleBounds||n.handles?.length)&&!!(n.measured.width||n.width||n.initialWidth)}function uw(n){const{sourceNode:l,targetNode:o}=n;if(!Cp(l)||!Cp(o))return null;const s=l.internals.handleBounds||zp(l.handles),r=o.internals.handleBounds||zp(o.handles),f=Dp(s?.source??[],n.sourceHandle),d=Dp(n.connectionMode===ni.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),n.targetHandle);if(!f||!d)return n.onError?.("008",mn.error008(f?"target":"source",{id:n.id,sourceHandle:n.sourceHandle,targetHandle:n.targetHandle})),null;const g=f?.position||me.Bottom,m=d?.position||me.Top,h=al(l,f,g),v=al(o,d,m);return{sourceX:h.x,sourceY:h.y,targetX:v.x,targetY:v.y,sourcePosition:g,targetPosition:m}}function zp(n){if(!n)return null;const l=[],o=[];for(const s of n)s.width=s.width??1,s.height=s.height??1,s.type==="source"?l.push(s):s.type==="target"&&o.push(s);return{source:l,target:o}}function al(n,l,o=me.Left,s=!1){const r=(l?.x??0)+n.internals.positionAbsolute.x,f=(l?.y??0)+n.internals.positionAbsolute.y,{width:d,height:g}=l??Zn(n);if(s)return{x:r+d/2,y:f+g/2};switch(l?.position??o){case me.Top:return{x:r+d/2,y:f};case me.Right:return{x:r+d,y:f+g/2};case me.Bottom:return{x:r+d/2,y:f+g};case me.Left:return{x:r,y:f+g/2}}}function Dp(n,l){return n&&(l?n.find(o=>o.id===l):n[0])||null}function Of(n,l){return n?typeof n=="string"?n:`${l?`${l}__`:""}${Object.keys(n).sort().map(s=>`${s}=${n[s]}`).join("&")}`:""}function cw(n,{id:l,defaultColor:o,defaultMarkerStart:s,defaultMarkerEnd:r}){const f=new Set;return n.reduce((d,g)=>([g.markerStart||s,g.markerEnd||r].forEach(m=>{if(m&&typeof m=="object"){const h=Of(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 my=1e3,fw=10,$f={nodeOrigin:[0,0],nodeExtent:yo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},dw={...$f,checkEquality:!0};function Kf(n,l){const o={...n};for(const s in l)l[s]!==void 0&&(o[s]=l[s]);return o}function hw(n,l,o){const s=Kf($f,o);for(const r of n.values())if(r.parentId)Ff(r,n,l,s);else{const f=No(r,s.nodeOrigin),d=ii(r.extent)?r.extent:s.nodeExtent,g=nl(f,d,Zn(r));r.internals.positionAbsolute=g}}function gw(n,l){if(!n.handles)return n.measured?l?.internals.handleBounds:void 0;const o=[],s=[];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"&&s.push(f)}return{source:o,target:s}}function Jf(n){return n==="manual"}function Rf(n,l,o,s={}){const r=Kf(dw,s),f={i:0},d=new Map(l),g=r?.elevateNodesOnSelect&&!Jf(r.zIndexMode)?my: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 b=No(v,r.nodeOrigin),x=ii(v.extent)?v.extent:r.nodeExtent,w=nl(b,x,Zn(v));y={...r.defaults,...v,measured:{width:v.measured?.width,height:v.measured?.height},internals:{positionAbsolute:w,handleBounds:gw(v,y),z:py(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&&Ff(y,l,o,s,f),h||=v.selected??!1}return{nodesInitialized:m,hasSelectedNodes:h}}function mw(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 Ff(n,l,o,s,r){const{elevateNodesOnSelect:f,nodeOrigin:d,nodeExtent:g,zIndexMode:m}=Kf($f,s),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}mw(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*fw),r&&v.internals.rootParentIndex!==void 0&&(r.i=v.internals.rootParentIndex);const y=f&&!Jf(m)?my:0,{x:b,y:x,z:w}=pw(n,v,d,g,y,m),{positionAbsolute:C}=n.internals,N=b!==C.x||x!==C.y;(N||w!==n.internals.z)&&l.set(n.id,{...n,internals:{...n.internals,positionAbsolute:N?{x:b,y:x}:C,z:w}})}function py(n,l,o){const s=nn(n.zIndex)?n.zIndex:0;return Jf(o)?s:s+(n.selected?l:0)}function pw(n,l,o,s,r,f){const{x:d,y:g}=l.internals.positionAbsolute,m=Zn(n),h=No(n,o),v=ii(n.extent)?nl(h,n.extent,m):h;let y=nl({x:d+v.x,y:g+v.y},s,m);n.extent==="parent"&&(y=ay(y,m,l));const b=py(n,r,f),x=l.internals.z??0;return{x:y.x,y:y.y,z:x>=b?x+1:b}}function Wf(n,l,o,s=[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??li(g),h=iy(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=Zn(g),y=g.origin??s,b=d.x<h.x?Math.round(Math.abs(h.x-d.x)):0,x=d.y<h.y?Math.round(Math.abs(h.y-d.y)):0,w=Math.max(v.width,Math.round(d.width)),C=Math.max(v.height,Math.round(d.height)),N=(w-v.width)*y[0],M=(C-v.height)*y[1];(b>0||x>0||N||M)&&(r.push({id:m,type:"position",position:{x:g.position.x-b+N,y:g.position.y-x+M}}),o.get(m)?.forEach(D=>{n.some(E=>E.id===D.id)||r.push({id:D.id,type:"position",position:{x:D.position.x+b,y:D.position.y+x}})})),(v.width<d.width||v.height<d.height||b||x)&&r.push({id:m,type:"dimensions",setAttributes:!0,dimensions:{width:w+(b?y[0]*b-N:0),height:C+(x?y[1]*x-M:0)}})}),r}function yw(n,l,o,s,r,f,d){const g=s?.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),b=[];for(const x of n.values()){const w=l.get(x.id);if(!w)continue;if(w.hidden){l.set(w.id,{...w,internals:{...w.internals,handleBounds:void 0}}),m=!0;continue}const C=kf(x.nodeElement),N=w.measured.width!==C.width||w.measured.height!==C.height;if(!!(C.width&&C.height&&(N||!w.internals.handleBounds||x.force))){const D=x.nodeElement.getBoundingClientRect(),E=ii(w.extent)?w.extent:f;let{positionAbsolute:z}=w.internals;w.parentId&&w.extent==="parent"?z=ay(z,C,l.get(w.parentId)):E&&(z=nl(z,E,C));const G={...w,measured:C,internals:{...w.internals,positionAbsolute:z,handleBounds:{source:Np("source",x.nodeElement,D,y,w.id),target:Np("target",x.nodeElement,D,y,w.id)}}};l.set(w.id,G),w.parentId&&Ff(G,l,o,{nodeOrigin:r,zIndexMode:d}),m=!0,N&&(h.push({id:w.id,type:"dimensions",dimensions:C}),w.expandParent&&w.parentId&&b.push({id:w.id,parentId:w.parentId,rect:li(G,r)}))}}if(b.length>0){const x=Wf(b,l,o,r);h.push(...x)}return{changes:h,updatedInternals:m}}async function vw({delta:n,panZoom:l,transform:o,translateExtent:s,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]],s),g=!!d&&(d.x!==o[0]||d.y!==o[1]||d.k!==o[2]);return Promise.resolve(g)}function Op(n,l,o,s,r,f){let d=r;const g=s.get(d)||new Map;s.set(d,g.set(o,l)),d=`${r}-${n}`;const m=s.get(d)||new Map;if(s.set(d,m.set(o,l)),f){d=`${r}-${n}-${f}`;const h=s.get(d)||new Map;s.set(d,h.set(o,l))}}function yy(n,l,o){n.clear(),l.clear();for(const s of o){const{source:r,target:f,sourceHandle:d=null,targetHandle:g=null}=s,m={edgeId:s.id,source:r,target:f,sourceHandle:d,targetHandle:g},h=`${r}-${d}--${f}-${g}`,v=`${f}-${g}--${r}-${d}`;Op("source",m,v,n,r,d),Op("target",m,h,n,f,g),l.set(s.id,s)}}function vy(n,l){if(!n.parentId)return!1;const o=l.get(n.parentId);return o?o.selected?!0:vy(o,l):!1}function Rp(n,l,o){let s=n;do{if(s?.matches?.(l))return!0;if(s===o)return!1;s=s?.parentElement}while(s);return!1}function bw(n,l,o,s){const r=new Map;for(const[f,d]of n)if((d.selected||d.id===s)&&(!d.parentId||!vy(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 df({nodeId:n,dragItems:l,nodeLookup:o,dragging:s=!0}){const r=[];for(const[d,g]of l){const m=o.get(d)?.internals.userNode;m&&r.push({...m,position:g.position,dragging:s})}if(!n)return[r[0],r];const f=o.get(n)?.internals.userNode;return[f?{...f,position:l.get(n)?.position||f.position,dragging:s}:r[0],r]}function Sw({dragItems:n,snapGrid:l,x:o,y:s}){const r=n.values().next().value;if(!r)return null;const f={x:o-r.distance.x,y:s-r.distance.y},d=To(f,l);return{x:d.x-f.x,y:d.y-f.y}}function xw({onNodeMouseDown:n,getStoreItems:l,onDragStart:o,onDrag:s,onDragStop:r}){let f={x:null,y:null},d=0,g=new Map,m=!1,h={x:0,y:0},v=null,y=!1,b=null,x=!1,w=!1,C=null;function N({noDragClassName:D,handleSelector:E,domNode:z,isSelectable:G,nodeId:q,nodeClickDistance:U=0}){b=Ut(z);function $({x:W,y:le}){const{nodeLookup:O,nodeExtent:X,snapGrid:A,snapToGrid:H,nodeOrigin:B,onNodeDrag:I,onSelectionDrag:te,onError:T,updateNodePositions:j}=l();f={x:W,y:le};let ee=!1;const ne=g.size>1,re=ne&&X?zf(Ao(g)):null,ce=ne&&H?Sw({dragItems:g,snapGrid:A,x:W,y:le}):null;for(const[ue,se]of g){if(!O.has(ue))continue;let fe={x:W-se.distance.x,y:le-se.distance.y};H&&(fe=ce?{x:Math.round(fe.x+ce.x),y:Math.round(fe.y+ce.y)}:To(fe,A));let Ee=null;if(ne&&X&&!se.extent&&re){const{positionAbsolute:be}=se.internals,Te=be.x-re.x+X[0][0],Ue=be.x+se.measured.width-re.x2+X[1][0],je=be.y-re.y+X[0][1],st=be.y+se.measured.height-re.y2+X[1][1];Ee=[[Te,je],[Ue,st]]}const{position:xe,positionAbsolute:ye}=ny({nodeId:ue,nextPosition:fe,nodeLookup:O,nodeExtent:Ee||X,nodeOrigin:B,onError:T});ee=ee||se.position.x!==xe.x||se.position.y!==xe.y,se.position=xe,se.internals.positionAbsolute=ye}if(w=w||ee,!!ee&&(j(g,!0),C&&(s||I||!q&&te))){const[ue,se]=df({nodeId:q,dragItems:g,nodeLookup:O});s?.(C,g,ue,se),I?.(C,ue,se),q||te?.(C,se)}}async function F(){if(!v)return;const{transform:W,panBy:le,autoPanSpeed:O,autoPanOnNodeDrag:X}=l();if(!X){m=!1,cancelAnimationFrame(d);return}const[A,H]=ly(h,v,O);(A!==0||H!==0)&&(f.x=(f.x??0)-A/W[2],f.y=(f.y??0)-H/W[2],await le({x:A,y:H})&&$(f)),d=requestAnimationFrame(F)}function Z(W){const{nodeLookup:le,multiSelectionActive:O,nodesDraggable:X,transform:A,snapGrid:H,snapToGrid:B,selectNodesOnDrag:I,onNodeDragStart:te,onSelectionDragStart:T,unselectNodesAndEdges:j}=l();y=!0,(!I||!G)&&!O&&q&&(le.get(q)?.selected||j()),G&&I&&q&&n?.(q);const ee=fo(W.sourceEvent,{transform:A,snapGrid:H,snapToGrid:B,containerBounds:v});if(f=ee,g=bw(le,X,ee,q),g.size>0&&(o||te||!q&&T)){const[ne,re]=df({nodeId:q,dragItems:g,nodeLookup:le});o?.(W.sourceEvent,g,ne,re),te?.(W.sourceEvent,ne,re),q||T?.(W.sourceEvent,re)}}const Y=j0().clickDistance(U).on("start",W=>{const{domNode:le,nodeDragThreshold:O,transform:X,snapGrid:A,snapToGrid:H}=l();v=le?.getBoundingClientRect()||null,x=!1,w=!1,C=W.sourceEvent,O===0&&Z(W),f=fo(W.sourceEvent,{transform:X,snapGrid:A,snapToGrid:H,containerBounds:v}),h=an(W.sourceEvent,v)}).on("drag",W=>{const{autoPanOnNodeDrag:le,transform:O,snapGrid:X,snapToGrid:A,nodeDragThreshold:H,nodeLookup:B}=l(),I=fo(W.sourceEvent,{transform:O,snapGrid:X,snapToGrid:A,containerBounds:v});if(C=W.sourceEvent,(W.sourceEvent.type==="touchmove"&&W.sourceEvent.touches.length>1||q&&!B.has(q))&&(x=!0),!x){if(!m&&le&&y&&(m=!0,F()),!y){const te=an(W.sourceEvent,v),T=te.x-h.x,j=te.y-h.y;Math.sqrt(T*T+j*j)>H&&Z(W)}(f.x!==I.xSnapped||f.y!==I.ySnapped)&&g&&y&&(h=an(W.sourceEvent,v),$(I))}}).on("end",W=>{if(!(!y||x)&&(m=!1,y=!1,cancelAnimationFrame(d),g.size>0)){const{nodeLookup:le,updateNodePositions:O,onNodeDragStop:X,onSelectionDragStop:A}=l();if(w&&(O(g,!1),w=!1),r||X||!q&&A){const[H,B]=df({nodeId:q,dragItems:g,nodeLookup:le,dragging:!1});r?.(W.sourceEvent,g,H,B),X?.(W.sourceEvent,H,B),q||A?.(W.sourceEvent,B)}}}).filter(W=>{const le=W.target;return!W.button&&(!D||!Rp(le,`.${D}`,z))&&(!E||Rp(le,E,z))});b.call(Y)}function M(){b?.on(".drag",null)}return{update:N,destroy:M}}function _w(n,l,o){const s=[],r={x:n.x-o,y:n.y-o,width:o*2,height:o*2};for(const f of l.values())bo(r,li(f))>0&&s.push(f);return s}const Ew=250;function ww(n,l,o,s){let r=[],f=1/0;const d=_w(n,o,l+Ew);for(const g of d){const m=[...g.internals.handleBounds?.source??[],...g.internals.handleBounds?.target??[]];for(const h of m){if(s.nodeId===h.nodeId&&s.type===h.type&&s.id===h.id)continue;const{x:v,y}=al(g,h,h.position,!0),b=Math.sqrt(Math.pow(v-n.x,2)+Math.pow(y-n.y,2));b>l||(b<f?(r=[{...h,x:v,y}],f=b):b===f&&r.push({...h,x:v,y}))}}if(!r.length)return null;if(r.length>1){const g=s.type==="source"?"target":"source";return r.find(m=>m.type===g)??r[0]}return r[0]}function by(n,l,o,s,r,f=!1){const d=s.get(n);if(!d)return null;const g=r==="strict"?d.internals.handleBounds?.[l]:[...d.internals.handleBounds?.source??[],...d.internals.handleBounds?.target??[]],m=(o?g?.find(h=>h.id===o):g?.[0])??null;return m&&f?{...m,...al(d,m,m.position,!0)}:m}function Sy(n,l){return n||(l?.classList.contains("target")?"target":l?.classList.contains("source")?"source":null)}function Nw(n,l){let o=null;return l?o=!0:n&&!l&&(o=!1),o}const xy=()=>!0;function Aw(n,{connectionMode:l,connectionRadius:o,handleId:s,nodeId:r,edgeUpdaterType:f,isTarget:d,domNode:g,nodeLookup:m,lib:h,autoPanOnConnect:v,flowId:y,panBy:b,cancelConnection:x,onConnectStart:w,onConnect:C,onConnectEnd:N,isValidConnection:M=xy,onReconnectEnd:D,updateConnection:E,getTransform:z,getFromHandle:G,autoPanSpeed:q,dragThreshold:U=1,handleDomNode:$}){const F=ry(n.target);let Z=0,Y;const{x:W,y:le}=an(n),O=Sy(f,$),X=g?.getBoundingClientRect();let A=!1;if(!X||!O)return;const H=by(r,O,s,m,l);if(!H)return;let B=an(n,X),I=!1,te=null,T=!1,j=null;function ee(){if(!v||!X)return;const[xe,ye]=ly(B,X,q);b({x:xe,y:ye}),Z=requestAnimationFrame(ee)}const ne={...H,nodeId:r,type:O,position:H.position},re=m.get(r);let ue={inProgress:!0,isValid:null,from:al(re,ne,me.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:re,to:B,toHandle:null,toPosition:xp[ne.position],toNode:null,pointer:B};function se(){A=!0,E(ue),w?.(n,{nodeId:r,handleId:s,handleType:O})}U===0&&se();function fe(xe){if(!A){const{x:st,y:$t}=an(xe),zt=st-W,Kt=$t-le;if(!(zt*zt+Kt*Kt>U*U))return;se()}if(!G()||!ne){Ee(xe);return}const ye=z();B=an(xe,X),Y=ww(Mo(B,ye,!1,[1,1]),o,m,ne),I||(ee(),I=!0);const be=_y(xe,{handle:Y,connectionMode:l,fromNodeId:r,fromHandleId:s,fromType:d?"target":"source",isValidConnection:M,doc:F,lib:h,flowId:y,nodeLookup:m});j=be.handleDomNode,te=be.connection,T=Nw(!!Y,be.isValid);const Te=m.get(r),Ue=Te?al(Te,ne,me.Left,!0):ue.from,je={...ue,from:Ue,isValid:T,to:be.toHandle&&T?_r({x:be.toHandle.x,y:be.toHandle.y},ye):B,toHandle:be.toHandle,toPosition:T&&be.toHandle?be.toHandle.position:xp[ne.position],toNode:be.toHandle?m.get(be.toHandle.nodeId):null,pointer:B};E(je),ue=je}function Ee(xe){if(!("touches"in xe&&xe.touches.length>0)){if(A){(Y||j)&&te&&T&&C?.(te);const{inProgress:ye,...be}=ue,Te={...be,toPosition:ue.toHandle?ue.toPosition:null};N?.(xe,Te),f&&D?.(xe,Te)}x(),cancelAnimationFrame(Z),I=!1,T=!1,te=null,j=null,F.removeEventListener("mousemove",fe),F.removeEventListener("mouseup",Ee),F.removeEventListener("touchmove",fe),F.removeEventListener("touchend",Ee)}}F.addEventListener("mousemove",fe),F.addEventListener("mouseup",Ee),F.addEventListener("touchmove",fe),F.addEventListener("touchend",Ee)}function _y(n,{handle:l,connectionMode:o,fromNodeId:s,fromHandleId:r,fromType:f,doc:d,lib:g,flowId:m,isValidConnection:h=xy,nodeLookup:v}){const y=f==="target",b=l?d.querySelector(`.${g}-flow__handle[data-id="${m}-${l?.nodeId}-${l?.id}-${l?.type}"]`):null,{x,y:w}=an(n),C=d.elementFromPoint(x,w),N=C?.classList.contains(`${g}-flow__handle`)?C:b,M={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const D=Sy(void 0,N),E=N.getAttribute("data-nodeid"),z=N.getAttribute("data-handleid"),G=N.classList.contains("connectable"),q=N.classList.contains("connectableend");if(!E||!D)return M;const U={source:y?E:s,sourceHandle:y?z:r,target:y?s:E,targetHandle:y?r:z};M.connection=U;const F=G&&q&&(o===ni.Strict?y&&D==="source"||!y&&D==="target":E!==s||z!==r);M.isValid=F&&h(U),M.toHandle=by(E,D,z,v,o,!0)}return M}const Hf={onPointerDown:Aw,isValid:_y};function Tw({domNode:n,panZoom:l,getTransform:o,getViewScale:s}){const r=Ut(n);function f({translateExtent:g,width:m,height:h,zoomStep:v=1,pannable:y=!0,zoomable:b=!0,inversePan:x=!1}){const w=E=>{if(E.sourceEvent.type!=="wheel"||!l)return;const z=o(),G=E.sourceEvent.ctrlKey&&So()?10:1,q=-E.sourceEvent.deltaY*(E.sourceEvent.deltaMode===1?.05:E.sourceEvent.deltaMode?1:.002)*v,U=z[2]*Math.pow(2,q*G);l.scaleTo(U)};let C=[0,0];const N=E=>{(E.sourceEvent.type==="mousedown"||E.sourceEvent.type==="touchstart")&&(C=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY])},M=E=>{const z=o();if(E.sourceEvent.type!=="mousemove"&&E.sourceEvent.type!=="touchmove"||!l)return;const G=[E.sourceEvent.clientX??E.sourceEvent.touches[0].clientX,E.sourceEvent.clientY??E.sourceEvent.touches[0].clientY],q=[G[0]-C[0],G[1]-C[1]];C=G;const U=s()*Math.max(z[2],Math.log(z[2]))*(x?-1:1),$={x:z[0]-q[0]*U,y:z[1]-q[1]*U},F=[[0,0],[m,h]];l.setViewportConstrained({x:$.x,y:$.y,zoom:z[2]},F,g)},D=J0().on("start",N).on("zoom",y?M:null).on("zoom.wheel",b?w:null);r.call(D,{})}function d(){r.on("zoom",null)}return{update:f,destroy:d,pointer:en}}const Dr=n=>({x:n.x,y:n.y,zoom:n.k}),hf=({x:n,y:l,zoom:o})=>Mr.translate(n,l).scale(o),Jl=(n,l)=>n.target.closest(`.${l}`),Ey=(n,l)=>l===2&&Array.isArray(n)&&n.includes(2),Mw=n=>((n*=2)<=1?n*n*n:(n-=2)*n*n+2)/2,gf=(n,l=0,o=Mw,s=()=>{})=>{const r=typeof l=="number"&&l>0;return r||s(),r?n.transition().duration(l).ease(o).on("end",s):n},wy=n=>{const l=n.ctrlKey&&So()?10:1;return-n.deltaY*(n.deltaMode===1?.05:n.deltaMode?1:.002)*l};function Cw({zoomPanValues:n,noWheelClassName:l,d3Selection:o,d3Zoom:s,panOnScrollMode:r,panOnScrollSpeed:f,zoomOnPinch:d,onPanZoomStart:g,onPanZoom:m,onPanZoomEnd:h}){return v=>{if(Jl(v,l))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const y=o.property("__zoom").k||1;if(v.ctrlKey&&d){const N=en(v),M=wy(v),D=y*Math.pow(2,M);s.scaleTo(o,D,N,v);return}const b=v.deltaMode===1?20:1;let x=r===Pa.Vertical?0:v.deltaX*b,w=r===Pa.Horizontal?0:v.deltaY*b;!So()&&v.shiftKey&&r!==Pa.Vertical&&(x=v.deltaY*b,w=0),s.translateBy(o,-(x/y)*f,-(w/y)*f,{internal:!0});const C=Dr(o.property("__zoom"));clearTimeout(n.panScrollTimeout),n.isPanScrolling?(m?.(v,C),n.panScrollTimeout=setTimeout(()=>{h?.(v,C),n.isPanScrolling=!1},150)):(n.isPanScrolling=!0,g?.(v,C))}}function zw({noWheelClassName:n,preventScrolling:l,d3ZoomHandler:o}){return function(s,r){const f=s.type==="wheel",d=!l&&f&&!s.ctrlKey,g=Jl(s,n);if(s.ctrlKey&&f&&g&&s.preventDefault(),d||g)return null;s.preventDefault(),o.call(this,s,r)}}function Dw({zoomPanValues:n,onDraggingChange:l,onPanZoomStart:o}){return s=>{if(s.sourceEvent?.internal)return;const r=Dr(s.transform);n.mouseButton=s.sourceEvent?.button||0,n.isZoomingOrPanning=!0,n.prevViewport=r,s.sourceEvent?.type==="mousedown"&&l(!0),o&&o?.(s.sourceEvent,r)}}function Ow({zoomPanValues:n,panOnDrag:l,onPaneContextMenu:o,onTransformChange:s,onPanZoom:r}){return f=>{n.usedRightMouseButton=!!(o&&Ey(l,n.mouseButton??0)),f.sourceEvent?.sync||s([f.transform.x,f.transform.y,f.transform.k]),r&&!f.sourceEvent?.internal&&r?.(f.sourceEvent,Dr(f.transform))}}function Rw({zoomPanValues:n,panOnDrag:l,panOnScroll:o,onDraggingChange:s,onPanZoomEnd:r,onPaneContextMenu:f}){return d=>{if(!d.sourceEvent?.internal&&(n.isZoomingOrPanning=!1,f&&Ey(l,n.mouseButton??0)&&!n.usedRightMouseButton&&d.sourceEvent&&f(d.sourceEvent),n.usedRightMouseButton=!1,s(!1),r)){const g=Dr(d.transform);n.prevViewport=g,clearTimeout(n.timerId),n.timerId=setTimeout(()=>{r?.(d.sourceEvent,g)},o?150:0)}}}function Hw({zoomActivationKeyPressed:n,zoomOnScroll:l,zoomOnPinch:o,panOnDrag:s,panOnScroll:r,zoomOnDoubleClick:f,userSelectionActive:d,noWheelClassName:g,noPanClassName:m,lib:h,connectionInProgress:v}){return y=>{const b=n||l,x=o&&y.ctrlKey,w=y.type==="wheel";if(y.button===1&&y.type==="mousedown"&&(Jl(y,`${h}-flow__node`)||Jl(y,`${h}-flow__edge`)))return!0;if(!s&&!b&&!r&&!f&&!o||d||v&&!w||Jl(y,g)&&w||Jl(y,m)&&(!w||r&&w&&!n)||!o&&y.ctrlKey&&w)return!1;if(!o&&y.type==="touchstart"&&y.touches?.length>1)return y.preventDefault(),!1;if(!b&&!r&&!x&&w||!s&&(y.type==="mousedown"||y.type==="touchstart")||Array.isArray(s)&&!s.includes(y.button)&&y.type==="mousedown")return!1;const C=Array.isArray(s)&&s.includes(y.button)||!y.button||y.button<=1;return(!y.ctrlKey||w)&&C}}function jw({domNode:n,minZoom:l,maxZoom:o,translateExtent:s,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=J0().scaleExtent([l,o]).translateExtent(s),b=Ut(n).call(y);D({x:r.x,y:r.y,zoom:ai(r.zoom,l,o)},[[0,0],[v.width,v.height]],s);const x=b.on("wheel.zoom"),w=b.on("dblclick.zoom");y.wheelDelta(wy);function C(Y,W){return b?new Promise(le=>{y?.interpolate(W?.interpolate==="linear"?co:rr).transform(gf(b,W?.duration,W?.ease,()=>le(!0)),Y)}):Promise.resolve(!1)}function N({noWheelClassName:Y,noPanClassName:W,onPaneContextMenu:le,userSelectionActive:O,panOnScroll:X,panOnDrag:A,panOnScrollMode:H,panOnScrollSpeed:B,preventScrolling:I,zoomOnPinch:te,zoomOnScroll:T,zoomOnDoubleClick:j,zoomActivationKeyPressed:ee,lib:ne,onTransformChange:re,connectionInProgress:ce,paneClickDistance:ue,selectionOnDrag:se}){O&&!h.isZoomingOrPanning&&M();const fe=X&&!ee&&!O;y.clickDistance(se?1/0:!nn(ue)||ue<0?0:ue);const Ee=fe?Cw({zoomPanValues:h,noWheelClassName:Y,d3Selection:b,d3Zoom:y,panOnScrollMode:H,panOnScrollSpeed:B,zoomOnPinch:te,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:g}):zw({noWheelClassName:Y,preventScrolling:I,d3ZoomHandler:x});if(b.on("wheel.zoom",Ee,{passive:!1}),!O){const ye=Dw({zoomPanValues:h,onDraggingChange:m,onPanZoomStart:d});y.on("start",ye);const be=Ow({zoomPanValues:h,panOnDrag:A,onPaneContextMenu:!!le,onPanZoom:f,onTransformChange:re});y.on("zoom",be);const Te=Rw({zoomPanValues:h,panOnDrag:A,panOnScroll:X,onPaneContextMenu:le,onPanZoomEnd:g,onDraggingChange:m});y.on("end",Te)}const xe=Hw({zoomActivationKeyPressed:ee,panOnDrag:A,zoomOnScroll:T,panOnScroll:X,zoomOnDoubleClick:j,zoomOnPinch:te,userSelectionActive:O,noPanClassName:W,noWheelClassName:Y,lib:ne,connectionInProgress:ce});y.filter(xe),j?b.on("dblclick.zoom",w):b.on("dblclick.zoom",null)}function M(){y.on("zoom",null)}async function D(Y,W,le){const O=hf(Y),X=y?.constrain()(O,W,le);return X&&await C(X),new Promise(A=>A(X))}async function E(Y,W){const le=hf(Y);return await C(le,W),new Promise(O=>O(le))}function z(Y){if(b){const W=hf(Y),le=b.property("__zoom");(le.k!==Y.zoom||le.x!==Y.x||le.y!==Y.y)&&y?.transform(b,W,null,{sync:!0})}}function G(){const Y=b?K0(b.node()):{x:0,y:0,k:1};return{x:Y.x,y:Y.y,zoom:Y.k}}function q(Y,W){return b?new Promise(le=>{y?.interpolate(W?.interpolate==="linear"?co:rr).scaleTo(gf(b,W?.duration,W?.ease,()=>le(!0)),Y)}):Promise.resolve(!1)}function U(Y,W){return b?new Promise(le=>{y?.interpolate(W?.interpolate==="linear"?co:rr).scaleBy(gf(b,W?.duration,W?.ease,()=>le(!0)),Y)}):Promise.resolve(!1)}function $(Y){y?.scaleExtent(Y)}function F(Y){y?.translateExtent(Y)}function Z(Y){const W=!nn(Y)||Y<0?0:Y;y?.clickDistance(W)}return{update:N,destroy:M,setViewport:E,setViewportConstrained:D,getViewport:G,scaleTo:q,scaleBy:U,setScaleExtent:$,setTranslateExtent:F,syncViewport:z,setClickDistance:Z}}var oi;(function(n){n.Line="line",n.Handle="handle"})(oi||(oi={}));function Lw({width:n,prevWidth:l,height:o,prevHeight:s,affectsX:r,affectsY:f}){const d=n-l,g=o-s,m=[d>0?1:d<0?-1:0,g>0?1:g<0?-1:0];return d&&r&&(m[0]=m[0]*-1),g&&f&&(m[1]=m[1]*-1),m}function Hp(n){const l=n.includes("right")||n.includes("left"),o=n.includes("bottom")||n.includes("top"),s=n.includes("left"),r=n.includes("top");return{isHorizontal:l,isVertical:o,affectsX:s,affectsY:r}}function Sa(n,l){return Math.max(0,l-n)}function xa(n,l){return Math.max(0,n-l)}function lr(n,l,o){return Math.max(0,l-n,n-o)}function jp(n,l){return n?!l:l}function Bw(n,l,o,s,r,f,d,g){let{affectsX:m,affectsY:h}=l;const{isHorizontal:v,isVertical:y}=l,b=v&&y,{xSnapped:x,ySnapped:w}=o,{minWidth:C,maxWidth:N,minHeight:M,maxHeight:D}=s,{x:E,y:z,width:G,height:q,aspectRatio:U}=n;let $=Math.floor(v?x-n.pointerX:0),F=Math.floor(y?w-n.pointerY:0);const Z=G+(m?-$:$),Y=q+(h?-F:F),W=-f[0]*G,le=-f[1]*q;let O=lr(Z,C,N),X=lr(Y,M,D);if(d){let B=0,I=0;m&&$<0?B=Sa(E+$+W,d[0][0]):!m&&$>0&&(B=xa(E+Z+W,d[1][0])),h&&F<0?I=Sa(z+F+le,d[0][1]):!h&&F>0&&(I=xa(z+Y+le,d[1][1])),O=Math.max(O,B),X=Math.max(X,I)}if(g){let B=0,I=0;m&&$>0?B=xa(E+$,g[0][0]):!m&&$<0&&(B=Sa(E+Z,g[1][0])),h&&F>0?I=xa(z+F,g[0][1]):!h&&F<0&&(I=Sa(z+Y,g[1][1])),O=Math.max(O,B),X=Math.max(X,I)}if(r){if(v){const B=lr(Z/U,M,D)*U;if(O=Math.max(O,B),d){let I=0;!m&&!h||m&&!h&&b?I=xa(z+le+Z/U,d[1][1])*U:I=Sa(z+le+(m?$:-$)/U,d[0][1])*U,O=Math.max(O,I)}if(g){let I=0;!m&&!h||m&&!h&&b?I=Sa(z+Z/U,g[1][1])*U:I=xa(z+(m?$:-$)/U,g[0][1])*U,O=Math.max(O,I)}}if(y){const B=lr(Y*U,C,N)/U;if(X=Math.max(X,B),d){let I=0;!m&&!h||h&&!m&&b?I=xa(E+Y*U+W,d[1][0])/U:I=Sa(E+(h?F:-F)*U+W,d[0][0])/U,X=Math.max(X,I)}if(g){let I=0;!m&&!h||h&&!m&&b?I=Sa(E+Y*U,g[1][0])/U:I=xa(E+(h?F:-F)*U,g[0][0])/U,X=Math.max(X,I)}}}F=F+(F<0?X:-X),$=$+($<0?O:-O),r&&(b?Z>Y*U?F=(jp(m,h)?-$:$)/U:$=(jp(m,h)?-F:F)*U:v?(F=$/U,h=m):($=F*U,m=h));const A=m?E+$:E,H=h?z+F:z;return{width:G+(m?-$:$),height:q+(h?-F:F),x:f[0]*$*(m?-1:1)+A,y:f[1]*F*(h?-1:1)+H}}const Ny={width:0,height:0,x:0,y:0},Uw={...Ny,pointerX:0,pointerY:0,aspectRatio:1};function qw(n){return[[0,0],[n.measured.width,n.measured.height]]}function Gw(n,l,o){const s=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[[s-g,r-m],[s+f-g,r+d-m]]}function Yw({domNode:n,nodeId:l,getStoreItems:o,onChange:s,onEnd:r}){const f=Ut(n);let d={controlDirection:Hp("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:b,onResizeStart:x,onResize:w,onResizeEnd:C,shouldResize:N}){let M={...Ny},D={...Uw};d={boundaries:v,resizeDirection:b,keepAspectRatio:y,controlDirection:Hp(h)};let E,z=null,G=[],q,U,$,F=!1;const Z=j0().on("start",Y=>{const{nodeLookup:W,transform:le,snapGrid:O,snapToGrid:X,nodeOrigin:A,paneDomNode:H}=o();if(E=W.get(l),!E)return;z=H?.getBoundingClientRect()??null;const{xSnapped:B,ySnapped:I}=fo(Y.sourceEvent,{transform:le,snapGrid:O,snapToGrid:X,containerBounds:z});M={width:E.measured.width??0,height:E.measured.height??0,x:E.position.x??0,y:E.position.y??0},D={...M,pointerX:B,pointerY:I,aspectRatio:M.width/M.height},q=void 0,E.parentId&&(E.extent==="parent"||E.expandParent)&&(q=W.get(E.parentId),U=q&&E.extent==="parent"?qw(q):void 0),G=[],$=void 0;for(const[te,T]of W)if(T.parentId===l&&(G.push({id:te,position:{...T.position},extent:T.extent}),T.extent==="parent"||T.expandParent)){const j=Gw(T,E,T.origin??A);$?$=[[Math.min(j[0][0],$[0][0]),Math.min(j[0][1],$[0][1])],[Math.max(j[1][0],$[1][0]),Math.max(j[1][1],$[1][1])]]:$=j}x?.(Y,{...M})}).on("drag",Y=>{const{transform:W,snapGrid:le,snapToGrid:O,nodeOrigin:X}=o(),A=fo(Y.sourceEvent,{transform:W,snapGrid:le,snapToGrid:O,containerBounds:z}),H=[];if(!E)return;const{x:B,y:I,width:te,height:T}=M,j={},ee=E.origin??X,{width:ne,height:re,x:ce,y:ue}=Bw(D,d.controlDirection,A,d.boundaries,d.keepAspectRatio,ee,U,$),se=ne!==te,fe=re!==T,Ee=ce!==B&&se,xe=ue!==I&&fe;if(!Ee&&!xe&&!se&&!fe)return;if((Ee||xe||ee[0]===1||ee[1]===1)&&(j.x=Ee?ce:M.x,j.y=xe?ue:M.y,M.x=j.x,M.y=j.y,G.length>0)){const Ue=ce-B,je=ue-I;for(const st of G)st.position={x:st.position.x-Ue+ee[0]*(ne-te),y:st.position.y-je+ee[1]*(re-T)},H.push(st)}if((se||fe)&&(j.width=se&&(!d.resizeDirection||d.resizeDirection==="horizontal")?ne:M.width,j.height=fe&&(!d.resizeDirection||d.resizeDirection==="vertical")?re:M.height,M.width=j.width,M.height=j.height),q&&E.expandParent){const Ue=ee[0]*(j.width??0);j.x&&j.x<Ue&&(M.x=Ue,D.x=D.x-(j.x-Ue));const je=ee[1]*(j.height??0);j.y&&j.y<je&&(M.y=je,D.y=D.y-(j.y-je))}const ye=Lw({width:M.width,prevWidth:te,height:M.height,prevHeight:T,affectsX:d.controlDirection.affectsX,affectsY:d.controlDirection.affectsY}),be={...M,direction:ye};N?.(Y,be)!==!1&&(F=!0,w?.(Y,be),s(j,H))}).on("end",Y=>{F&&(C?.(Y,{...M}),r?.({...M}),F=!1)});f.call(Z)}function m(){f.on(".drag",null)}return{update:g,destroy:m}}var mf={exports:{}},pf={},yf={exports:{}},vf={};var Lp;function Vw(){if(Lp)return vf;Lp=1;var n=_o();function l(y,b){return y===b&&(y!==0||1/y===1/b)||y!==y&&b!==b}var o=typeof Object.is=="function"?Object.is:l,s=n.useState,r=n.useEffect,f=n.useLayoutEffect,d=n.useDebugValue;function g(y,b){var x=b(),w=s({inst:{value:x,getSnapshot:b}}),C=w[0].inst,N=w[1];return f(function(){C.value=x,C.getSnapshot=b,m(C)&&N({inst:C})},[y,x,b]),r(function(){return m(C)&&N({inst:C}),y(function(){m(C)&&N({inst:C})})},[y]),d(x),x}function m(y){var b=y.getSnapshot;y=y.value;try{var x=b();return!o(y,x)}catch{return!0}}function h(y,b){return b()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:g;return vf.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:v,vf}var Bp;function Xw(){return Bp||(Bp=1,yf.exports=Vw()),yf.exports}var Up;function Zw(){if(Up)return pf;Up=1;var n=_o(),l=Xw();function o(h,v){return h===v&&(h!==0||1/h===1/v)||h!==h&&v!==v}var s=typeof Object.is=="function"?Object.is:o,r=l.useSyncExternalStore,f=n.useRef,d=n.useEffect,g=n.useMemo,m=n.useDebugValue;return pf.useSyncExternalStoreWithSelector=function(h,v,y,b,x){var w=f(null);if(w.current===null){var C={hasValue:!1,value:null};w.current=C}else C=w.current;w=g(function(){function M(q){if(!D){if(D=!0,E=q,q=b(q),x!==void 0&&C.hasValue){var U=C.value;if(x(U,q))return z=U}return z=q}if(U=z,s(E,q))return U;var $=b(q);return x!==void 0&&x(U,$)?(E=q,U):(E=q,z=$)}var D=!1,E,z,G=y===void 0?null:y;return[function(){return M(v())},G===null?void 0:function(){return M(G())}]},[v,y,b,x]);var N=r(h,w[0],w[1]);return d(function(){C.hasValue=!0,C.value=N},[N]),m(N),N},pf}var qp;function Iw(){return qp||(qp=1,mf.exports=Zw()),mf.exports}var Qw=Iw();const kw=c0(Qw),$w={},Gp=n=>{let l;const o=new Set,s=(v,y)=>{const b=typeof v=="function"?v(l):v;if(!Object.is(b,l)){const x=l;l=y??(typeof b!="object"||b===null)?b:Object.assign({},l,b),o.forEach(w=>w(l,x))}},r=()=>l,m={setState:s,getState:r,getInitialState:()=>h,subscribe:v=>(o.add(v),()=>o.delete(v)),destroy:()=>{($w?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),o.clear()}},h=l=n(s,r,m);return m},Kw=n=>n?Gp(n):Gp,{useDebugValue:Jw}=oo,{useSyncExternalStoreWithSelector:Fw}=kw,Ww=n=>n;function Ay(n,l=Ww,o){const s=Fw(n.subscribe,n.getState,n.getServerState||n.getInitialState,l,o);return Jw(s),s}const Yp=(n,l)=>{const o=Kw(n),s=(r,f=l)=>Ay(o,r,f);return Object.assign(s,o),s},Pw=(n,l)=>n?Yp(n,l):Yp;function ke(n,l){if(Object.is(n,l))return!0;if(typeof n!="object"||n===null||typeof l!="object"||l===null)return!1;if(n instanceof Map&&l instanceof Map){if(n.size!==l.size)return!1;for(const[s,r]of n)if(!Object.is(r,l.get(s)))return!1;return!0}if(n instanceof Set&&l instanceof Set){if(n.size!==l.size)return!1;for(const s of n)if(!l.has(s))return!1;return!0}const o=Object.keys(n);if(o.length!==Object.keys(l).length)return!1;for(const s of o)if(!Object.prototype.hasOwnProperty.call(l,s)||!Object.is(n[s],l[s]))return!1;return!0}f0();const Or=J.createContext(null),eN=Or.Provider,Ty=mn.error001();function De(n,l){const o=J.useContext(Or);if(o===null)throw new Error(Ty);return Ay(o,n,l)}function $e(){const n=J.useContext(Or);if(n===null)throw new Error(Ty);return J.useMemo(()=>({getState:n.getState,setState:n.setState,subscribe:n.subscribe}),[n])}const Vp={display:"none"},tN={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},My="react-flow__node-desc",Cy="react-flow__edge-desc",nN="react-flow__aria-live",aN=n=>n.ariaLiveMessage,lN=n=>n.ariaLabelConfig;function iN({rfId:n}){const l=De(aN);return _.jsx("div",{id:`${nN}-${n}`,"aria-live":"assertive","aria-atomic":"true",style:tN,children:l})}function oN({rfId:n,disableKeyboardA11y:l}){const o=De(lN);return _.jsxs(_.Fragment,{children:[_.jsx("div",{id:`${My}-${n}`,style:Vp,children:l?o["node.a11yDescription.default"]:o["node.a11yDescription.keyboardDisabled"]}),_.jsx("div",{id:`${Cy}-${n}`,style:Vp,children:o["edge.a11yDescription.default"]}),!l&&_.jsx(iN,{rfId:n})]})}const Rr=J.forwardRef(({position:n="top-left",children:l,className:o,style:s,...r},f)=>{const d=`${n}`.split("-");return _.jsx("div",{className:lt(["react-flow__panel",o,...d]),style:s,ref:f,...r,children:l})});Rr.displayName="Panel";function sN({proOptions:n,position:l="bottom-right"}){return n?.hideAttribution?null:_.jsx(Rr,{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:_.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const rN=n=>{const l=[],o=[];for(const[,s]of n.nodeLookup)s.selected&&l.push(s.internals.userNode);for(const[,s]of n.edgeLookup)s.selected&&o.push(s);return{selectedNodes:l,selectedEdges:o}},ir=n=>n.id;function uN(n,l){return ke(n.selectedNodes.map(ir),l.selectedNodes.map(ir))&&ke(n.selectedEdges.map(ir),l.selectedEdges.map(ir))}function cN({onSelectionChange:n}){const l=$e(),{selectedNodes:o,selectedEdges:s}=De(rN,uN);return J.useEffect(()=>{const r={nodes:o,edges:s};n?.(r),l.getState().onSelectionChangeHandlers.forEach(f=>f(r))},[o,s,n]),null}const fN=n=>!!n.onSelectionChangeHandlers;function dN({onSelectionChange:n}){const l=De(fN);return n||l?_.jsx(cN,{onSelectionChange:n}):null}const jf=typeof window<"u"?J.useLayoutEffect:J.useEffect,zy=[0,0],hN={x:0,y:0,zoom:1},gN=["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"],Xp=[...gN,"rfId"],mN=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}),Zp={translateExtent:yo,nodeOrigin:zy,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function pN(n){const{setNodes:l,setEdges:o,setMinZoom:s,setMaxZoom:r,setTranslateExtent:f,setNodeExtent:d,reset:g,setDefaultNodesAndEdges:m}=De(mN,ke),h=$e();jf(()=>(m(n.defaultNodes,n.defaultEdges),()=>{v.current=Zp,g()}),[]);const v=J.useRef(Zp);return jf(()=>{for(const y of Xp){const b=n[y],x=v.current[y];b!==x&&(typeof n[y]>"u"||(y==="nodes"?l(b):y==="edges"?o(b):y==="minZoom"?s(b):y==="maxZoom"?r(b):y==="translateExtent"?f(b):y==="nodeExtent"?d(b):y==="ariaLabelConfig"?h.setState({ariaLabelConfig:PE(b)}):y==="fitView"?h.setState({fitViewQueued:b}):y==="fitViewOptions"?h.setState({fitViewOptions:b}):h.setState({[y]:b})))}v.current=n},Xp.map(y=>n[y])),null}function Ip(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function yN(n){const[l,o]=J.useState(n==="system"?null:n);return J.useEffect(()=>{if(n!=="system"){o(n);return}const s=Ip(),r=()=>o(s?.matches?"dark":"light");return r(),s?.addEventListener("change",r),()=>{s?.removeEventListener("change",r)}},[n]),l!==null?l:Ip()?.matches?"dark":"light"}const Qp=typeof document<"u"?document:null;function xo(n=null,l={target:Qp,actInsideInputWithModifier:!0}){const[o,s]=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,b)=>y.concat(...b),[]);return[h,v]}return[[],[]]},[n]);return J.useEffect(()=>{const m=l?.target??Qp,h=l?.actInsideInputWithModifier??!0;if(n!==null){const v=x=>{if(r.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!r.current||r.current&&!h)&&uy(x))return!1;const C=$p(x.code,g);if(f.current.add(x[C]),kp(d,f.current,!1)){const N=x.composedPath?.()?.[0]||x.target,M=N?.nodeName==="BUTTON"||N?.nodeName==="A";l.preventDefault!==!1&&(r.current||!M)&&x.preventDefault(),s(!0)}},y=x=>{const w=$p(x.code,g);kp(d,f.current,!0)?(s(!1),f.current.clear()):f.current.delete(x[w]),x.key==="Meta"&&f.current.clear(),r.current=!1},b=()=>{f.current.clear(),s(!1)};return m?.addEventListener("keydown",v),m?.addEventListener("keyup",y),window.addEventListener("blur",b),window.addEventListener("contextmenu",b),()=>{m?.removeEventListener("keydown",v),m?.removeEventListener("keyup",y),window.removeEventListener("blur",b),window.removeEventListener("contextmenu",b)}}},[n,s]),o}function kp(n,l,o){return n.filter(s=>o||s.length===l.size).some(s=>s.every(r=>l.has(r)))}function $p(n,l){return l.includes(n)?"code":"key"}const vN=()=>{const n=$e();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:s}=n.getState();return s?s.scaleTo(l,o):Promise.resolve(!1)},getZoom:()=>n.getState().transform[2],setViewport:async(l,o)=>{const{transform:[s,r,f],panZoom:d}=n.getState();return d?(await d.setViewport({x:l.x??s,y:l.y??r,zoom:l.zoom??f},o),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[l,o,s]=n.getState().transform;return{x:l,y:o,zoom:s}},setCenter:async(l,o,s)=>n.getState().setCenter(l,o,s),fitBounds:async(l,o)=>{const{width:s,height:r,minZoom:f,maxZoom:d,panZoom:g}=n.getState(),m=Qf(l,s,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:s,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 Mo(h,s,y,v)},flowToScreenPosition:l=>{const{transform:o,domNode:s}=n.getState();if(!s)return l;const{x:r,y:f}=s.getBoundingClientRect(),d=_r(l,o);return{x:d.x+r,y:d.y+f}}}),[])};function Dy(n,l){const o=[],s=new Map,r=[];for(const f of n)if(f.type==="add"){r.push(f);continue}else if(f.type==="remove"||f.type==="replace")s.set(f.id,[f]);else{const d=s.get(f.id);d?d.push(f):s.set(f.id,[f])}for(const f of l){const d=s.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)bN(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 bN(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 SN(n,l){return Dy(n,l)}function xN(n,l){return Dy(n,l)}function Ja(n,l){return{id:n,type:"select",selected:l}}function Fl(n,l=new Set,o=!1){const s=[];for(const[r,f]of n){const d=l.has(r);!(f.selected===void 0&&!d)&&f.selected!==d&&(o&&(f.selected=d),s.push(Ja(f.id,d)))}return s}function Kp({items:n=[],lookup:l}){const o=[],s=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)s.get(r)===void 0&&o.push({id:r,type:"remove"});return o}function Jp(n){return{id:n.id,type:"remove"}}const Fp=n=>XE(n),_N=n=>ty(n);function Oy(n){return J.forwardRef(n)}function Wp(n){const[l,o]=J.useState(BigInt(0)),[s]=J.useState(()=>EN(()=>o(r=>r+BigInt(1))));return jf(()=>{const r=s.get();r.length&&(n(r),s.reset())},[l]),s}function EN(n){let l=[];return{get:()=>l,reset:()=>{l=[]},push:o=>{l.push(o),n()}}}const Ry=J.createContext(null);function wN({children:n}){const l=$e(),o=J.useCallback(g=>{const{nodes:m=[],setNodes:h,hasDefaultNodes:v,onNodesChange:y,nodeLookup:b,fitViewQueued:x,onNodesChangeMiddlewareMap:w}=l.getState();let C=m;for(const M of g)C=typeof M=="function"?M(C):M;let N=Kp({items:C,lookup:b});for(const M of w.values())N=M(N);v&&h(C),N.length>0?y?.(N):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:M,nodes:D,setNodes:E}=l.getState();M&&E(D)})},[]),s=Wp(o),r=J.useCallback(g=>{const{edges:m=[],setEdges:h,hasDefaultEdges:v,onEdgesChange:y,edgeLookup:b}=l.getState();let x=m;for(const w of g)x=typeof w=="function"?w(x):w;v?h(x):y&&y(Kp({items:x,lookup:b}))},[]),f=Wp(r),d=J.useMemo(()=>({nodeQueue:s,edgeQueue:f}),[]);return _.jsx(Ry.Provider,{value:d,children:n})}function NN(){const n=J.useContext(Ry);if(!n)throw new Error("useBatchContext must be used within a BatchProvider");return n}const AN=n=>!!n.panZoom;function Pf(){const n=vN(),l=$e(),o=NN(),s=De(AN),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:b,nodeOrigin:x}=l.getState(),w=Fp(y)?y:b.get(y.id),C=w.parentId?sy(w.position,w.measured,w.parentId,b,x):w.position,N={...w,position:C,width:w.measured?.width??w.width,height:w.measured?.height??w.height};return li(N)},h=(y,b,x={replace:!1})=>{d(w=>w.map(C=>{if(C.id===y){const N=typeof b=="function"?b(C):b;return x.replace&&Fp(N)?N:{...C,...N}}return C}))},v=(y,b,x={replace:!1})=>{g(w=>w.map(C=>{if(C.id===y){const N=typeof b=="function"?b(C):b;return x.replace&&_N(N)?N:{...C,...N}}return C}))};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(b=>({...b}))},getEdge:y=>l.getState().edgeLookup.get(y),setNodes:d,setEdges:g,addNodes:y=>{const b=Array.isArray(y)?y:[y];o.nodeQueue.push(x=>[...x,...b])},addEdges:y=>{const b=Array.isArray(y)?y:[y];o.edgeQueue.push(x=>[...x,...b])},toObject:()=>{const{nodes:y=[],edges:b=[],transform:x}=l.getState(),[w,C,N]=x;return{nodes:y.map(M=>({...M})),edges:b.map(M=>({...M})),viewport:{x:w,y:C,zoom:N}}},deleteElements:async({nodes:y=[],edges:b=[]})=>{const{nodes:x,edges:w,onNodesDelete:C,onEdgesDelete:N,triggerNodeChanges:M,triggerEdgeChanges:D,onDelete:E,onBeforeDelete:z}=l.getState(),{nodes:G,edges:q}=await $E({nodesToRemove:y,edgesToRemove:b,nodes:x,edges:w,onBeforeDelete:z}),U=q.length>0,$=G.length>0;if(U){const F=q.map(Jp);N?.(q),D(F)}if($){const F=G.map(Jp);C?.(G),M(F)}return($||U)&&E?.({nodes:G,edges:q}),{deletedNodes:G,deletedEdges:q}},getIntersectingNodes:(y,b=!0,x)=>{const w=Ep(y),C=w?y:m(y),N=x!==void 0;return C?(x||l.getState().nodes).filter(M=>{const D=l.getState().nodeLookup.get(M.id);if(D&&!w&&(M.id===y.id||!D.internals.positionAbsolute))return!1;const E=li(N?M:D),z=bo(E,C);return b&&z>0||z>=E.width*E.height||z>=C.width*C.height}):[]},isNodeIntersecting:(y,b,x=!0)=>{const C=Ep(y)?y:m(y);if(!C)return!1;const N=bo(C,b);return x&&N>0||N>=b.width*b.height||N>=C.width*C.height},updateNode:h,updateNodeData:(y,b,x={replace:!1})=>{h(y,w=>{const C=typeof b=="function"?b(w):b;return x.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},x)},updateEdge:v,updateEdgeData:(y,b,x={replace:!1})=>{v(y,w=>{const C=typeof b=="function"?b(w):b;return x.replace?{...w,data:C}:{...w,data:{...w.data,...C}}},x)},getNodesBounds:y=>{const{nodeLookup:b,nodeOrigin:x}=l.getState();return ZE(y,{nodeLookup:b,nodeOrigin:x})},getHandleConnections:({type:y,id:b,nodeId:x})=>Array.from(l.getState().connectionLookup.get(`${x}-${y}${b?`-${b}`:""}`)?.values()??[]),getNodeConnections:({type:y,handleId:b,nodeId:x})=>Array.from(l.getState().connectionLookup.get(`${x}${y?b?`-${y}-${b}`:`-${y}`:""}`)?.values()??[]),fitView:async y=>{const b=l.getState().fitViewResolver??WE();return l.setState({fitViewQueued:!0,fitViewOptions:y,fitViewResolver:b}),o.nodeQueue.push(x=>[...x]),b.promise}}},[]);return J.useMemo(()=>({...r,...n,viewportInitialized:s}),[s])}const Pp=n=>n.selected,TN=typeof window<"u"?window:void 0;function MN({deleteKeyCode:n,multiSelectionKeyCode:l}){const o=$e(),{deleteElements:s}=Pf(),r=xo(n,{actInsideInputWithModifier:!1}),f=xo(l,{target:TN});J.useEffect(()=>{if(r){const{edges:d,nodes:g}=o.getState();s({nodes:g.filter(Pp),edges:d.filter(Pp)}),o.setState({nodesSelectionActive:!1})}},[r]),J.useEffect(()=>{o.setState({multiSelectionActive:f})},[f])}function CN(n){const l=$e();J.useEffect(()=>{const o=()=>{if(!n.current||!(n.current.checkVisibility?.()??!0))return!1;const s=kf(n.current);(s.height===0||s.width===0)&&l.getState().onError?.("004",mn.error004()),l.setState({width:s.width||500,height:s.height||500})};if(n.current){o(),window.addEventListener("resize",o);const s=new ResizeObserver(()=>o());return s.observe(n.current),()=>{window.removeEventListener("resize",o),s&&n.current&&s.unobserve(n.current)}}},[])}const Hr={position:"absolute",width:"100%",height:"100%",top:0,left:0},zN=n=>({userSelectionActive:n.userSelectionActive,lib:n.lib,connectionInProgress:n.connection.inProgress});function DN({onPaneContextMenu:n,zoomOnScroll:l=!0,zoomOnPinch:o=!0,panOnScroll:s=!1,panOnScrollSpeed:r=.5,panOnScrollMode:f=Pa.Free,zoomOnDoubleClick:d=!0,panOnDrag:g=!0,defaultViewport:m,translateExtent:h,minZoom:v,maxZoom:y,zoomActivationKeyCode:b,preventScrolling:x=!0,children:w,noWheelClassName:C,noPanClassName:N,onViewportChange:M,isControlledViewport:D,paneClickDistance:E,selectionOnDrag:z}){const G=$e(),q=J.useRef(null),{userSelectionActive:U,lib:$,connectionInProgress:F}=De(zN,ke),Z=xo(b),Y=J.useRef();CN(q);const W=J.useCallback(le=>{M?.({x:le[0],y:le[1],zoom:le[2]}),D||G.setState({transform:le})},[M,D]);return J.useEffect(()=>{if(q.current){Y.current=jw({domNode:q.current,minZoom:v,maxZoom:y,translateExtent:h,viewport:m,onDraggingChange:A=>G.setState(H=>H.paneDragging===A?H:{paneDragging:A}),onPanZoomStart:(A,H)=>{const{onViewportChangeStart:B,onMoveStart:I}=G.getState();I?.(A,H),B?.(H)},onPanZoom:(A,H)=>{const{onViewportChange:B,onMove:I}=G.getState();I?.(A,H),B?.(H)},onPanZoomEnd:(A,H)=>{const{onViewportChangeEnd:B,onMoveEnd:I}=G.getState();I?.(A,H),B?.(H)}});const{x:le,y:O,zoom:X}=Y.current.getViewport();return G.setState({panZoom:Y.current,transform:[le,O,X],domNode:q.current.closest(".react-flow")}),()=>{Y.current?.destroy()}}},[]),J.useEffect(()=>{Y.current?.update({onPaneContextMenu:n,zoomOnScroll:l,zoomOnPinch:o,panOnScroll:s,panOnScrollSpeed:r,panOnScrollMode:f,zoomOnDoubleClick:d,panOnDrag:g,zoomActivationKeyPressed:Z,preventScrolling:x,noPanClassName:N,userSelectionActive:U,noWheelClassName:C,lib:$,onTransformChange:W,connectionInProgress:F,selectionOnDrag:z,paneClickDistance:E})},[n,l,o,s,r,f,d,g,Z,x,N,U,C,$,W,F,z,E]),_.jsx("div",{className:"react-flow__renderer",ref:q,style:Hr,children:w})}const ON=n=>({userSelectionActive:n.userSelectionActive,userSelectionRect:n.userSelectionRect});function RN(){const{userSelectionActive:n,userSelectionRect:l}=De(ON,ke);return n&&l?_.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 bf=(n,l)=>o=>{o.target===l.current&&n?.(o)},HN=n=>({userSelectionActive:n.userSelectionActive,elementsSelectable:n.elementsSelectable,connectionInProgress:n.connection.inProgress,dragging:n.paneDragging});function jN({isSelecting:n,selectionKeyPressed:l,selectionMode:o=vo.Full,panOnDrag:s,paneClickDistance:r,selectionOnDrag:f,onSelectionStart:d,onSelectionEnd:g,onPaneClick:m,onPaneContextMenu:h,onPaneScroll:v,onPaneMouseEnter:y,onPaneMouseMove:b,onPaneMouseLeave:x,children:w}){const C=$e(),{userSelectionActive:N,elementsSelectable:M,dragging:D,connectionInProgress:E}=De(HN,ke),z=M&&(n||N),G=J.useRef(null),q=J.useRef(),U=J.useRef(new Set),$=J.useRef(new Set),F=J.useRef(!1),Z=B=>{if(F.current||E){F.current=!1;return}m?.(B),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},Y=B=>{if(Array.isArray(s)&&s?.includes(2)){B.preventDefault();return}h?.(B)},W=v?B=>v(B):void 0,le=B=>{F.current&&(B.stopPropagation(),F.current=!1)},O=B=>{const{domNode:I}=C.getState();if(q.current=I?.getBoundingClientRect(),!q.current)return;const te=B.target===G.current;if(!te&&!!B.target.closest(".nokey")||!n||!(f&&te||l)||B.button!==0||!B.isPrimary)return;B.target?.setPointerCapture?.(B.pointerId),F.current=!1;const{x:ee,y:ne}=an(B.nativeEvent,q.current);C.setState({userSelectionRect:{width:0,height:0,startX:ee,startY:ne,x:ee,y:ne}}),te||(B.stopPropagation(),B.preventDefault())},X=B=>{const{userSelectionRect:I,transform:te,nodeLookup:T,edgeLookup:j,connectionLookup:ee,triggerNodeChanges:ne,triggerEdgeChanges:re,defaultEdgeOptions:ce,resetSelectedElements:ue}=C.getState();if(!q.current||!I)return;const{x:se,y:fe}=an(B.nativeEvent,q.current),{startX:Ee,startY:xe}=I;if(!F.current){const je=l?0:r;if(Math.hypot(se-Ee,fe-xe)<=je)return;ue(),d?.(B)}F.current=!0;const ye={startX:Ee,startY:xe,x:se<Ee?se:Ee,y:fe<xe?fe:xe,width:Math.abs(se-Ee),height:Math.abs(fe-xe)},be=U.current,Te=$.current;U.current=new Set(If(T,ye,te,o===vo.Partial,!0).map(je=>je.id)),$.current=new Set;const Ue=ce?.selectable??!0;for(const je of U.current){const st=ee.get(je);if(st)for(const{edgeId:$t}of st.values()){const zt=j.get($t);zt&&(zt.selectable??Ue)&&$.current.add($t)}}if(!wp(be,U.current)){const je=Fl(T,U.current,!0);ne(je)}if(!wp(Te,$.current)){const je=Fl(j,$.current);re(je)}C.setState({userSelectionRect:ye,userSelectionActive:!0,nodesSelectionActive:!1})},A=B=>{B.button===0&&(B.target?.releasePointerCapture?.(B.pointerId),!N&&B.target===G.current&&C.getState().userSelectionRect&&Z?.(B),C.setState({userSelectionActive:!1,userSelectionRect:null}),F.current&&(g?.(B),C.setState({nodesSelectionActive:U.current.size>0})))},H=s===!0||Array.isArray(s)&&s.includes(0);return _.jsxs("div",{className:lt(["react-flow__pane",{draggable:H,dragging:D,selection:n}]),onClick:z?void 0:bf(Z,G),onContextMenu:bf(Y,G),onWheel:bf(W,G),onPointerEnter:z?void 0:y,onPointerMove:z?X:b,onPointerUp:z?A:void 0,onPointerDownCapture:z?O:void 0,onClickCapture:z?le:void 0,onPointerLeave:x,ref:G,style:Hr,children:[w,_.jsx(RN,{})]})}function Lf({id:n,store:l,unselect:o=!1,nodeRef:s}){const{addSelectedNodes:r,unselectNodesAndEdges:f,multiSelectionActive:d,nodeLookup:g,onError:m}=l.getState(),h=g.get(n);if(!h){m?.("012",mn.error012(n));return}l.setState({nodesSelectionActive:!1}),h.selected?(o||h.selected&&d)&&(f({nodes:[h],edges:[]}),requestAnimationFrame(()=>s?.current?.blur())):r([n])}function Hy({nodeRef:n,disabled:l=!1,noDragClassName:o,handleSelector:s,nodeId:r,isSelectable:f,nodeClickDistance:d}){const g=$e(),[m,h]=J.useState(!1),v=J.useRef();return J.useEffect(()=>{v.current=xw({getStoreItems:()=>g.getState(),onNodeMouseDown:y=>{Lf({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:s,domNode:n.current,isSelectable:f,nodeId:r,nodeClickDistance:d}),()=>{v.current?.destroy()}},[o,s,l,f,n,r,d]),m}const LN=n=>l=>l.selected&&(l.draggable||n&&typeof l.draggable>"u");function jy(){const n=$e();return J.useCallback(o=>{const{nodeExtent:s,snapToGrid:r,snapGrid:f,nodesDraggable:d,onError:g,updateNodePositions:m,nodeLookup:h,nodeOrigin:v}=n.getState(),y=new Map,b=LN(d),x=r?f[0]:5,w=r?f[1]:5,C=o.direction.x*x*o.factor,N=o.direction.y*w*o.factor;for(const[,M]of h){if(!b(M))continue;let D={x:M.internals.positionAbsolute.x+C,y:M.internals.positionAbsolute.y+N};r&&(D=To(D,f));const{position:E,positionAbsolute:z}=ny({nodeId:M.id,nextPosition:D,nodeLookup:h,nodeExtent:s,nodeOrigin:v,onError:g});M.position=E,M.internals.positionAbsolute=z,y.set(M.id,M)}m(y)},[])}const ed=J.createContext(null),BN=ed.Provider;ed.Consumer;const Ly=()=>J.useContext(ed),UN=n=>({connectOnClick:n.connectOnClick,noPanClassName:n.noPanClassName,rfId:n.rfId}),qN=(n,l,o)=>s=>{const{connectionClickStartHandle:r,connectionMode:f,connection:d}=s,{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===ni.Strict?g?.type!==o:n!==g?.nodeId||l!==g?.id,connectionInProcess:!!g,clickConnectionInProcess:!!r,valid:v&&h}};function GN({type:n="source",position:l=me.Top,isValidConnection:o,isConnectable:s=!0,isConnectableStart:r=!0,isConnectableEnd:f=!0,id:d,onConnect:g,children:m,className:h,onMouseDown:v,onTouchStart:y,...b},x){const w=d||null,C=n==="target",N=$e(),M=Ly(),{connectOnClick:D,noPanClassName:E,rfId:z}=De(UN,ke),{connectingFrom:G,connectingTo:q,clickConnecting:U,isPossibleEndHandle:$,connectionInProcess:F,clickConnectionInProcess:Z,valid:Y}=De(qN(M,w,n),ke);M||N.getState().onError?.("010",mn.error010());const W=X=>{const{defaultEdgeOptions:A,onConnect:H,hasDefaultEdges:B}=N.getState(),I={...A,...X};if(B){const{edges:te,setEdges:T}=N.getState();T(iw(I,te))}H?.(I),g?.(I)},le=X=>{if(!M)return;const A=cy(X.nativeEvent);if(r&&(A&&X.button===0||!A)){const H=N.getState();Hf.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:H.autoPanOnConnect,connectionMode:H.connectionMode,connectionRadius:H.connectionRadius,domNode:H.domNode,nodeLookup:H.nodeLookup,lib:H.lib,isTarget:C,handleId:w,nodeId:M,flowId:H.rfId,panBy:H.panBy,cancelConnection:H.cancelConnection,onConnectStart:H.onConnectStart,onConnectEnd:(...B)=>N.getState().onConnectEnd?.(...B),updateConnection:H.updateConnection,onConnect:W,isValidConnection:o||((...B)=>N.getState().isValidConnection?.(...B)??!0),getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:H.autoPanSpeed,dragThreshold:H.connectionDragThreshold})}A?v?.(X):y?.(X)},O=X=>{const{onClickConnectStart:A,onClickConnectEnd:H,connectionClickStartHandle:B,connectionMode:I,isValidConnection:te,lib:T,rfId:j,nodeLookup:ee,connection:ne}=N.getState();if(!M||!B&&!r)return;if(!B){A?.(X.nativeEvent,{nodeId:M,handleId:w,handleType:n}),N.setState({connectionClickStartHandle:{nodeId:M,type:n,id:w}});return}const re=ry(X.target),ce=o||te,{connection:ue,isValid:se}=Hf.isValid(X.nativeEvent,{handle:{nodeId:M,id:w,type:n},connectionMode:I,fromNodeId:B.nodeId,fromHandleId:B.id||null,fromType:B.type,isValidConnection:ce,flowId:j,doc:re,lib:T,nodeLookup:ee});se&&ue&&W(ue);const fe=structuredClone(ne);delete fe.inProgress,fe.toPosition=fe.toHandle?fe.toHandle.position:null,H?.(X,fe),N.setState({connectionClickStartHandle:null})};return _.jsx("div",{"data-handleid":w,"data-nodeid":M,"data-handlepos":l,"data-id":`${z}-${M}-${w}-${n}`,className:lt(["react-flow__handle",`react-flow__handle-${l}`,"nodrag",E,h,{source:!C,target:C,connectable:s,connectablestart:r,connectableend:f,clickconnecting:U,connectingfrom:G,connectingto:q,valid:Y,connectionindicator:s&&(!F||$)&&(F||Z?f:r)}]),onMouseDown:le,onTouchStart:le,onClick:D?O:void 0,ref:x,...b,children:m})}const si=J.memo(Oy(GN));function YN({data:n,isConnectable:l,sourcePosition:o=me.Bottom}){return _.jsxs(_.Fragment,{children:[n?.label,_.jsx(si,{type:"source",position:o,isConnectable:l})]})}function VN({data:n,isConnectable:l,targetPosition:o=me.Top,sourcePosition:s=me.Bottom}){return _.jsxs(_.Fragment,{children:[_.jsx(si,{type:"target",position:o,isConnectable:l}),n?.label,_.jsx(si,{type:"source",position:s,isConnectable:l})]})}function XN(){return null}function ZN({data:n,isConnectable:l,targetPosition:o=me.Top}){return _.jsxs(_.Fragment,{children:[_.jsx(si,{type:"target",position:o,isConnectable:l}),n?.label]})}const Er={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},e0={input:YN,default:VN,output:ZN,group:XN};function IN(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 QN=n=>{const{width:l,height:o,x:s,y:r}=Ao(n.nodeLookup,{filter:f=>!!f.selected});return{width:nn(l)?l:null,height:nn(o)?o:null,userSelectionActive:n.userSelectionActive,transformString:`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]}) translate(${s}px,${r}px)`}};function kN({onSelectionContextMenu:n,noPanClassName:l,disableKeyboardA11y:o}){const s=$e(),{width:r,height:f,transformString:d,userSelectionActive:g}=De(QN,ke),m=jy(),h=J.useRef(null);J.useEffect(()=>{o||h.current?.focus({preventScroll:!0})},[o]);const v=!g&&r!==null&&f!==null;if(Hy({nodeRef:h,disabled:!v}),!v)return null;const y=n?x=>{const w=s.getState().nodes.filter(C=>C.selected);n(x,w)}:void 0,b=x=>{Object.prototype.hasOwnProperty.call(Er,x.key)&&(x.preventDefault(),m({direction:Er[x.key],factor:x.shiftKey?4:1}))};return _.jsx("div",{className:lt(["react-flow__nodesselection","react-flow__container",l]),style:{transform:d},children:_.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:y,tabIndex:o?void 0:-1,onKeyDown:o?void 0:b,style:{width:r,height:f}})})}const t0=typeof window<"u"?window:void 0,$N=n=>({nodesSelectionActive:n.nodesSelectionActive,userSelectionActive:n.userSelectionActive});function By({children:n,onPaneClick:l,onPaneMouseEnter:o,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:f,onPaneScroll:d,paneClickDistance:g,deleteKeyCode:m,selectionKeyCode:h,selectionOnDrag:v,selectionMode:y,onSelectionStart:b,onSelectionEnd:x,multiSelectionKeyCode:w,panActivationKeyCode:C,zoomActivationKeyCode:N,elementsSelectable:M,zoomOnScroll:D,zoomOnPinch:E,panOnScroll:z,panOnScrollSpeed:G,panOnScrollMode:q,zoomOnDoubleClick:U,panOnDrag:$,defaultViewport:F,translateExtent:Z,minZoom:Y,maxZoom:W,preventScrolling:le,onSelectionContextMenu:O,noWheelClassName:X,noPanClassName:A,disableKeyboardA11y:H,onViewportChange:B,isControlledViewport:I}){const{nodesSelectionActive:te,userSelectionActive:T}=De($N,ke),j=xo(h,{target:t0}),ee=xo(C,{target:t0}),ne=ee||$,re=ee||z,ce=v&&ne!==!0,ue=j||T||ce;return MN({deleteKeyCode:m,multiSelectionKeyCode:w}),_.jsx(DN,{onPaneContextMenu:f,elementsSelectable:M,zoomOnScroll:D,zoomOnPinch:E,panOnScroll:re,panOnScrollSpeed:G,panOnScrollMode:q,zoomOnDoubleClick:U,panOnDrag:!j&&ne,defaultViewport:F,translateExtent:Z,minZoom:Y,maxZoom:W,zoomActivationKeyCode:N,preventScrolling:le,noWheelClassName:X,noPanClassName:A,onViewportChange:B,isControlledViewport:I,paneClickDistance:g,selectionOnDrag:ce,children:_.jsxs(jN,{onSelectionStart:b,onSelectionEnd:x,onPaneClick:l,onPaneMouseEnter:o,onPaneMouseMove:s,onPaneMouseLeave:r,onPaneContextMenu:f,onPaneScroll:d,panOnDrag:ne,isSelecting:!!ue,selectionMode:y,selectionKeyPressed:j,paneClickDistance:g,selectionOnDrag:ce,children:[n,te&&_.jsx(kN,{onSelectionContextMenu:O,noPanClassName:A,disableKeyboardA11y:H})]})})}By.displayName="FlowRenderer";const KN=J.memo(By),JN=n=>l=>n?If(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 FN(n){return De(J.useCallback(JN(n),[n]),ke)}const WN=n=>n.updateNodeInternals;function PN(){const n=De(WN),[l]=J.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(o=>{const s=new Map;o.forEach(r=>{const f=r.target.getAttribute("data-id");s.set(f,{id:f,nodeElement:r.target,force:!0})}),n(s)}));return J.useEffect(()=>()=>{l?.disconnect()},[l]),l}function e3({node:n,nodeType:l,hasDimensions:o,resizeObserver:s}){const r=$e(),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&&s?.unobserve(d.current),s?.observe(f.current),d.current=f.current)},[v,n.hidden]),J.useEffect(()=>()=>{d.current&&(s?.unobserve(d.current),d.current=null)},[]),J.useEffect(()=>{if(f.current){const y=h.current!==l,b=g.current!==n.sourcePosition,x=m.current!==n.targetPosition;(y||b||x)&&(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 t3({id:n,onClick:l,onMouseEnter:o,onMouseMove:s,onMouseLeave:r,onContextMenu:f,onDoubleClick:d,nodesDraggable:g,elementsSelectable:m,nodesConnectable:h,nodesFocusable:v,resizeObserver:y,noDragClassName:b,noPanClassName:x,disableKeyboardA11y:w,rfId:C,nodeTypes:N,nodeClickDistance:M,onError:D}){const{node:E,internals:z,isParent:G}=De(se=>{const fe=se.nodeLookup.get(n),Ee=se.parentLookup.has(n);return{node:fe,internals:fe.internals,isParent:Ee}},ke);let q=E.type||"default",U=N?.[q]||e0[q];U===void 0&&(D?.("003",mn.error003(q)),q="default",U=N?.default||e0.default);const $=!!(E.draggable||g&&typeof E.draggable>"u"),F=!!(E.selectable||m&&typeof E.selectable>"u"),Z=!!(E.connectable||h&&typeof E.connectable>"u"),Y=!!(E.focusable||v&&typeof E.focusable>"u"),W=$e(),le=oy(E),O=e3({node:E,nodeType:q,hasDimensions:le,resizeObserver:y}),X=Hy({nodeRef:O,disabled:E.hidden||!$,noDragClassName:b,handleSelector:E.dragHandle,nodeId:n,isSelectable:F,nodeClickDistance:M}),A=jy();if(E.hidden)return null;const H=Zn(E),B=IN(E),I=F||$||l||o||s||r,te=o?se=>o(se,{...z.userNode}):void 0,T=s?se=>s(se,{...z.userNode}):void 0,j=r?se=>r(se,{...z.userNode}):void 0,ee=f?se=>f(se,{...z.userNode}):void 0,ne=d?se=>d(se,{...z.userNode}):void 0,re=se=>{const{selectNodesOnDrag:fe,nodeDragThreshold:Ee}=W.getState();F&&(!fe||!$||Ee>0)&&Lf({id:n,store:W,nodeRef:O}),l&&l(se,{...z.userNode})},ce=se=>{if(!(uy(se.nativeEvent)||w)){if(F0.includes(se.key)&&F){const fe=se.key==="Escape";Lf({id:n,store:W,unselect:fe,nodeRef:O})}else if($&&E.selected&&Object.prototype.hasOwnProperty.call(Er,se.key)){se.preventDefault();const{ariaLabelConfig:fe}=W.getState();W.setState({ariaLiveMessage:fe["node.a11yDescription.ariaLiveMessage"]({direction:se.key.replace("Arrow","").toLowerCase(),x:~~z.positionAbsolute.x,y:~~z.positionAbsolute.y})}),A({direction:Er[se.key],factor:se.shiftKey?4:1})}}},ue=()=>{if(w||!O.current?.matches(":focus-visible"))return;const{transform:se,width:fe,height:Ee,autoPanOnNodeFocus:xe,setCenter:ye}=W.getState();if(!xe)return;If(new Map([[n,E]]),{x:0,y:0,width:fe,height:Ee},se,!0).length>0||ye(E.position.x+H.width/2,E.position.y+H.height/2,{zoom:se[2]})};return _.jsx("div",{className:lt(["react-flow__node",`react-flow__node-${q}`,{[x]:$},E.className,{selected:E.selected,selectable:F,parent:G,draggable:$,dragging:X}]),ref:O,style:{zIndex:z.z,transform:`translate(${z.positionAbsolute.x}px,${z.positionAbsolute.y}px)`,pointerEvents:I?"all":"none",visibility:le?"visible":"hidden",...E.style,...B},"data-id":n,"data-testid":`rf__node-${n}`,onMouseEnter:te,onMouseMove:T,onMouseLeave:j,onContextMenu:ee,onClick:re,onDoubleClick:ne,onKeyDown:Y?ce:void 0,tabIndex:Y?0:void 0,onFocus:Y?ue:void 0,role:E.ariaRole??(Y?"group":void 0),"aria-roledescription":"node","aria-describedby":w?void 0:`${My}-${C}`,"aria-label":E.ariaLabel,...E.domAttributes,children:_.jsx(BN,{value:n,children:_.jsx(U,{id:n,data:E.data,type:q,positionAbsoluteX:z.positionAbsolute.x,positionAbsoluteY:z.positionAbsolute.y,selected:E.selected??!1,selectable:F,draggable:$,deletable:E.deletable??!0,isConnectable:Z,sourcePosition:E.sourcePosition,targetPosition:E.targetPosition,dragging:X,dragHandle:E.dragHandle,zIndex:z.z,parentId:E.parentId,...H})})})}var n3=J.memo(t3);const a3=n=>({nodesDraggable:n.nodesDraggable,nodesConnectable:n.nodesConnectable,nodesFocusable:n.nodesFocusable,elementsSelectable:n.elementsSelectable,onError:n.onError});function Uy(n){const{nodesDraggable:l,nodesConnectable:o,nodesFocusable:s,elementsSelectable:r,onError:f}=De(a3,ke),d=FN(n.onlyRenderVisibleElements),g=PN();return _.jsx("div",{className:"react-flow__nodes",style:Hr,children:d.map(m=>_.jsx(n3,{id:m,nodeTypes:n.nodeTypes,nodeExtent:n.nodeExtent,onClick:n.onNodeClick,onMouseEnter:n.onNodeMouseEnter,onMouseMove:n.onNodeMouseMove,onMouseLeave:n.onNodeMouseLeave,onContextMenu:n.onNodeContextMenu,onDoubleClick:n.onNodeDoubleClick,noDragClassName:n.noDragClassName,noPanClassName:n.noPanClassName,rfId:n.rfId,disableKeyboardA11y:n.disableKeyboardA11y,resizeObserver:g,nodesDraggable:l,nodesConnectable:o,nodesFocusable:s,elementsSelectable:r,nodeClickDistance:n.nodeClickDistance,onError:f},m))})}Uy.displayName="NodeRenderer";const l3=J.memo(Uy);function i3(n){return De(J.useCallback(o=>{if(!n)return o.edges.map(r=>r.id);const s=[];if(o.width&&o.height)for(const r of o.edges){const f=o.nodeLookup.get(r.source),d=o.nodeLookup.get(r.target);f&&d&&nw({sourceNode:f,targetNode:d,width:o.width,height:o.height,transform:o.transform})&&s.push(r.id)}return s},[n]),ke)}const o3=({color:n="none",strokeWidth:l=1})=>{const o={strokeWidth:l,...n&&{stroke:n}};return _.jsx("polyline",{className:"arrow",style:o,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},s3=({color:n="none",strokeWidth:l=1})=>{const o={strokeWidth:l,...n&&{stroke:n,fill:n}};return _.jsx("polyline",{className:"arrowclosed",style:o,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},n0={[Sr.Arrow]:o3,[Sr.ArrowClosed]:s3};function r3(n){const l=$e();return J.useMemo(()=>Object.prototype.hasOwnProperty.call(n0,n)?n0[n]:(l.getState().onError?.("009",mn.error009(n)),null),[n])}const u3=({id:n,type:l,color:o,width:s=12.5,height:r=12.5,markerUnits:f="strokeWidth",strokeWidth:d,orient:g="auto-start-reverse"})=>{const m=r3(l);return m?_.jsx("marker",{className:"react-flow__arrowhead",id:n,markerWidth:`${s}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:f,orient:g,refX:"0",refY:"0",children:_.jsx(m,{color:o,strokeWidth:d})}):null},qy=({defaultColor:n,rfId:l})=>{const o=De(f=>f.edges),s=De(f=>f.defaultEdgeOptions),r=J.useMemo(()=>cw(o,{id:l,defaultColor:n,defaultMarkerStart:s?.markerStart,defaultMarkerEnd:s?.markerEnd}),[o,s,l,n]);return r.length?_.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:_.jsx("defs",{children:r.map(f=>_.jsx(u3,{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};qy.displayName="MarkerDefinitions";var c3=J.memo(qy);function Gy({x:n,y:l,label:o,labelStyle:s,labelShowBg:r=!0,labelBgStyle:f,labelBgPadding:d=[2,4],labelBgBorderRadius:g=2,children:m,className:h,...v}){const[y,b]=J.useState({x:1,y:0,width:0,height:0}),x=lt(["react-flow__edge-textwrapper",h]),w=J.useRef(null);return J.useEffect(()=>{if(w.current){const C=w.current.getBBox();b({x:C.x,y:C.y,width:C.width,height:C.height})}},[o]),o?_.jsxs("g",{transform:`translate(${n-y.width/2} ${l-y.height/2})`,className:x,visibility:y.width?"visible":"hidden",...v,children:[r&&_.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}),_.jsx("text",{className:"react-flow__edge-text",y:y.height/2,dy:"0.3em",ref:w,style:s,children:o}),m]}):null}Gy.displayName="EdgeText";const f3=J.memo(Gy);function jr({path:n,labelX:l,labelY:o,label:s,labelStyle:r,labelShowBg:f,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m,interactionWidth:h=20,...v}){return _.jsxs(_.Fragment,{children:[_.jsx("path",{...v,d:n,fill:"none",className:lt(["react-flow__edge-path",v.className])}),h?_.jsx("path",{d:n,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,s&&nn(l)&&nn(o)?_.jsx(f3,{x:l,y:o,label:s,labelStyle:r,labelShowBg:f,labelBgStyle:d,labelBgPadding:g,labelBgBorderRadius:m}):null]})}function a0({pos:n,x1:l,y1:o,x2:s,y2:r}){return n===me.Left||n===me.Right?[.5*(l+s),o]:[l,.5*(o+r)]}function Yy({sourceX:n,sourceY:l,sourcePosition:o=me.Bottom,targetX:s,targetY:r,targetPosition:f=me.Top}){const[d,g]=a0({pos:o,x1:n,y1:l,x2:s,y2:r}),[m,h]=a0({pos:f,x1:s,y1:r,x2:n,y2:l}),[v,y,b,x]=fy({sourceX:n,sourceY:l,targetX:s,targetY:r,sourceControlX:d,sourceControlY:g,targetControlX:m,targetControlY:h});return[`M${n},${l} C${d},${g} ${m},${h} ${s},${r}`,v,y,b,x]}function Vy(n){return J.memo(({id:l,sourceX:o,sourceY:s,targetX:r,targetY:f,sourcePosition:d,targetPosition:g,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:b,labelBgBorderRadius:x,style:w,markerEnd:C,markerStart:N,interactionWidth:M})=>{const[D,E,z]=Yy({sourceX:o,sourceY:s,sourcePosition:d,targetX:r,targetY:f,targetPosition:g}),G=n.isInternal?void 0:l;return _.jsx(jr,{id:G,path:D,labelX:E,labelY:z,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:b,labelBgBorderRadius:x,style:w,markerEnd:C,markerStart:N,interactionWidth:M})})}const d3=Vy({isInternal:!1}),Xy=Vy({isInternal:!0});d3.displayName="SimpleBezierEdge";Xy.displayName="SimpleBezierEdgeInternal";function Zy(n){return J.memo(({id:l,sourceX:o,sourceY:s,targetX:r,targetY:f,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:b,sourcePosition:x=me.Bottom,targetPosition:w=me.Top,markerEnd:C,markerStart:N,pathOptions:M,interactionWidth:D})=>{const[E,z,G]=Df({sourceX:o,sourceY:s,sourcePosition:x,targetX:r,targetY:f,targetPosition:w,borderRadius:M?.borderRadius,offset:M?.offset,stepPosition:M?.stepPosition}),q=n.isInternal?void 0:l;return _.jsx(jr,{id:q,path:E,labelX:z,labelY:G,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:b,markerEnd:C,markerStart:N,interactionWidth:D})})}const Iy=Zy({isInternal:!1}),Qy=Zy({isInternal:!0});Iy.displayName="SmoothStepEdge";Qy.displayName="SmoothStepEdgeInternal";function ky(n){return J.memo(({id:l,...o})=>{const s=n.isInternal?void 0:l;return _.jsx(Iy,{...o,id:s,pathOptions:J.useMemo(()=>({borderRadius:0,offset:o.pathOptions?.offset}),[o.pathOptions?.offset])})})}const h3=ky({isInternal:!1}),$y=ky({isInternal:!0});h3.displayName="StepEdge";$y.displayName="StepEdgeInternal";function Ky(n){return J.memo(({id:l,sourceX:o,sourceY:s,targetX:r,targetY:f,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:b,markerEnd:x,markerStart:w,interactionWidth:C})=>{const[N,M,D]=gy({sourceX:o,sourceY:s,targetX:r,targetY:f}),E=n.isInternal?void 0:l;return _.jsx(jr,{id:E,path:N,labelX:M,labelY:D,label:d,labelStyle:g,labelShowBg:m,labelBgStyle:h,labelBgPadding:v,labelBgBorderRadius:y,style:b,markerEnd:x,markerStart:w,interactionWidth:C})})}const g3=Ky({isInternal:!1}),Jy=Ky({isInternal:!0});g3.displayName="StraightEdge";Jy.displayName="StraightEdgeInternal";function Fy(n){return J.memo(({id:l,sourceX:o,sourceY:s,targetX:r,targetY:f,sourcePosition:d=me.Bottom,targetPosition:g=me.Top,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:b,labelBgBorderRadius:x,style:w,markerEnd:C,markerStart:N,pathOptions:M,interactionWidth:D})=>{const[E,z,G]=dy({sourceX:o,sourceY:s,sourcePosition:d,targetX:r,targetY:f,targetPosition:g,curvature:M?.curvature}),q=n.isInternal?void 0:l;return _.jsx(jr,{id:q,path:E,labelX:z,labelY:G,label:m,labelStyle:h,labelShowBg:v,labelBgStyle:y,labelBgPadding:b,labelBgBorderRadius:x,style:w,markerEnd:C,markerStart:N,interactionWidth:D})})}const m3=Fy({isInternal:!1}),Wy=Fy({isInternal:!0});m3.displayName="BezierEdge";Wy.displayName="BezierEdgeInternal";const l0={default:Wy,straight:Jy,step:$y,smoothstep:Qy,simplebezier:Xy},i0={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},p3=(n,l,o)=>o===me.Left?n-l:o===me.Right?n+l:n,y3=(n,l,o)=>o===me.Top?n-l:o===me.Bottom?n+l:n,o0="react-flow__edgeupdater";function s0({position:n,centerX:l,centerY:o,radius:s=10,onMouseDown:r,onMouseEnter:f,onMouseOut:d,type:g}){return _.jsx("circle",{onMouseDown:r,onMouseEnter:f,onMouseOut:d,className:lt([o0,`${o0}-${g}`]),cx:p3(l,s,n),cy:y3(o,s,n),r:s,stroke:"transparent",fill:"transparent"})}function v3({isReconnectable:n,reconnectRadius:l,edge:o,sourceX:s,sourceY:r,targetX:f,targetY:d,sourcePosition:g,targetPosition:m,onReconnect:h,onReconnectStart:v,onReconnectEnd:y,setReconnecting:b,setUpdateHover:x}){const w=$e(),C=(z,G)=>{if(z.button!==0)return;const{autoPanOnConnect:q,domNode:U,connectionMode:$,connectionRadius:F,lib:Z,onConnectStart:Y,cancelConnection:W,nodeLookup:le,rfId:O,panBy:X,updateConnection:A}=w.getState(),H=G.type==="target",B=(T,j)=>{b(!1),y?.(T,o,G.type,j)},I=T=>h?.(o,T),te=(T,j)=>{b(!0),v?.(z,o,G.type),Y?.(T,j)};Hf.onPointerDown(z.nativeEvent,{autoPanOnConnect:q,connectionMode:$,connectionRadius:F,domNode:U,handleId:G.id,nodeId:G.nodeId,nodeLookup:le,isTarget:H,edgeUpdaterType:G.type,lib:Z,flowId:O,cancelConnection:W,panBy:X,isValidConnection:(...T)=>w.getState().isValidConnection?.(...T)??!0,onConnect:I,onConnectStart:te,onConnectEnd:(...T)=>w.getState().onConnectEnd?.(...T),onReconnectEnd:B,updateConnection:A,getTransform:()=>w.getState().transform,getFromHandle:()=>w.getState().connection.fromHandle,dragThreshold:w.getState().connectionDragThreshold,handleDomNode:z.currentTarget})},N=z=>C(z,{nodeId:o.target,id:o.targetHandle??null,type:"target"}),M=z=>C(z,{nodeId:o.source,id:o.sourceHandle??null,type:"source"}),D=()=>x(!0),E=()=>x(!1);return _.jsxs(_.Fragment,{children:[(n===!0||n==="source")&&_.jsx(s0,{position:g,centerX:s,centerY:r,radius:l,onMouseDown:N,onMouseEnter:D,onMouseOut:E,type:"source"}),(n===!0||n==="target")&&_.jsx(s0,{position:m,centerX:f,centerY:d,radius:l,onMouseDown:M,onMouseEnter:D,onMouseOut:E,type:"target"})]})}function b3({id:n,edgesFocusable:l,edgesReconnectable:o,elementsSelectable:s,onClick:r,onDoubleClick:f,onContextMenu:d,onMouseEnter:g,onMouseMove:m,onMouseLeave:h,reconnectRadius:v,onReconnect:y,onReconnectStart:b,onReconnectEnd:x,rfId:w,edgeTypes:C,noPanClassName:N,onError:M,disableKeyboardA11y:D}){let E=De(ye=>ye.edgeLookup.get(n));const z=De(ye=>ye.defaultEdgeOptions);E=z?{...z,...E}:E;let G=E.type||"default",q=C?.[G]||l0[G];q===void 0&&(M?.("011",mn.error011(G)),G="default",q=C?.default||l0.default);const U=!!(E.focusable||l&&typeof E.focusable>"u"),$=typeof y<"u"&&(E.reconnectable||o&&typeof E.reconnectable>"u"),F=!!(E.selectable||s&&typeof E.selectable>"u"),Z=J.useRef(null),[Y,W]=J.useState(!1),[le,O]=J.useState(!1),X=$e(),{zIndex:A,sourceX:H,sourceY:B,targetX:I,targetY:te,sourcePosition:T,targetPosition:j}=De(J.useCallback(ye=>{const be=ye.nodeLookup.get(E.source),Te=ye.nodeLookup.get(E.target);if(!be||!Te)return{zIndex:E.zIndex,...i0};const Ue=uw({id:n,sourceNode:be,targetNode:Te,sourceHandle:E.sourceHandle||null,targetHandle:E.targetHandle||null,connectionMode:ye.connectionMode,onError:M});return{zIndex:tw({selected:E.selected,zIndex:E.zIndex,sourceNode:be,targetNode:Te,elevateOnSelect:ye.elevateEdgesOnSelect,zIndexMode:ye.zIndexMode}),...Ue||i0}},[E.source,E.target,E.sourceHandle,E.targetHandle,E.selected,E.zIndex]),ke),ee=J.useMemo(()=>E.markerStart?`url('#${Of(E.markerStart,w)}')`:void 0,[E.markerStart,w]),ne=J.useMemo(()=>E.markerEnd?`url('#${Of(E.markerEnd,w)}')`:void 0,[E.markerEnd,w]);if(E.hidden||H===null||B===null||I===null||te===null)return null;const re=ye=>{const{addSelectedEdges:be,unselectNodesAndEdges:Te,multiSelectionActive:Ue}=X.getState();F&&(X.setState({nodesSelectionActive:!1}),E.selected&&Ue?(Te({nodes:[],edges:[E]}),Z.current?.blur()):be([n])),r&&r(ye,E)},ce=f?ye=>{f(ye,{...E})}:void 0,ue=d?ye=>{d(ye,{...E})}:void 0,se=g?ye=>{g(ye,{...E})}:void 0,fe=m?ye=>{m(ye,{...E})}:void 0,Ee=h?ye=>{h(ye,{...E})}:void 0,xe=ye=>{if(!D&&F0.includes(ye.key)&&F){const{unselectNodesAndEdges:be,addSelectedEdges:Te}=X.getState();ye.key==="Escape"?(Z.current?.blur(),be({edges:[E]})):Te([n])}};return _.jsx("svg",{style:{zIndex:A},children:_.jsxs("g",{className:lt(["react-flow__edge",`react-flow__edge-${G}`,E.className,N,{selected:E.selected,animated:E.animated,inactive:!F&&!r,updating:Y,selectable:F}]),onClick:re,onDoubleClick:ce,onContextMenu:ue,onMouseEnter:se,onMouseMove:fe,onMouseLeave:Ee,onKeyDown:U?xe:void 0,tabIndex:U?0:void 0,role:E.ariaRole??(U?"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":U?`${Cy}-${w}`:void 0,ref:Z,...E.domAttributes,children:[!le&&_.jsx(q,{id:n,source:E.source,target:E.target,type:E.type,selected:E.selected,animated:E.animated,selectable:F,deletable:E.deletable??!0,label:E.label,labelStyle:E.labelStyle,labelShowBg:E.labelShowBg,labelBgStyle:E.labelBgStyle,labelBgPadding:E.labelBgPadding,labelBgBorderRadius:E.labelBgBorderRadius,sourceX:H,sourceY:B,targetX:I,targetY:te,sourcePosition:T,targetPosition:j,data:E.data,style:E.style,sourceHandleId:E.sourceHandle,targetHandleId:E.targetHandle,markerStart:ee,markerEnd:ne,pathOptions:"pathOptions"in E?E.pathOptions:void 0,interactionWidth:E.interactionWidth}),$&&_.jsx(v3,{edge:E,isReconnectable:$,reconnectRadius:v,onReconnect:y,onReconnectStart:b,onReconnectEnd:x,sourceX:H,sourceY:B,targetX:I,targetY:te,sourcePosition:T,targetPosition:j,setUpdateHover:W,setReconnecting:O})]})})}var S3=J.memo(b3);const x3=n=>({edgesFocusable:n.edgesFocusable,edgesReconnectable:n.edgesReconnectable,elementsSelectable:n.elementsSelectable,connectionMode:n.connectionMode,onError:n.onError});function Py({defaultMarkerColor:n,onlyRenderVisibleElements:l,rfId:o,edgeTypes:s,noPanClassName:r,onReconnect:f,onEdgeContextMenu:d,onEdgeMouseEnter:g,onEdgeMouseMove:m,onEdgeMouseLeave:h,onEdgeClick:v,reconnectRadius:y,onEdgeDoubleClick:b,onReconnectStart:x,onReconnectEnd:w,disableKeyboardA11y:C}){const{edgesFocusable:N,edgesReconnectable:M,elementsSelectable:D,onError:E}=De(x3,ke),z=i3(l);return _.jsxs("div",{className:"react-flow__edges",children:[_.jsx(c3,{defaultColor:n,rfId:o}),z.map(G=>_.jsx(S3,{id:G,edgesFocusable:N,edgesReconnectable:M,elementsSelectable:D,noPanClassName:r,onReconnect:f,onContextMenu:d,onMouseEnter:g,onMouseMove:m,onMouseLeave:h,onClick:v,reconnectRadius:y,onDoubleClick:b,onReconnectStart:x,onReconnectEnd:w,rfId:o,onError:E,edgeTypes:s,disableKeyboardA11y:C},G))]})}Py.displayName="EdgeRenderer";const _3=J.memo(Py),E3=n=>`translate(${n.transform[0]}px,${n.transform[1]}px) scale(${n.transform[2]})`;function w3({children:n}){const l=De(E3);return _.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:l},children:n})}function N3(n){const l=Pf(),o=J.useRef(!1);J.useEffect(()=>{!o.current&&l.viewportInitialized&&n&&(setTimeout(()=>n(l),1),o.current=!0)},[n,l.viewportInitialized])}const A3=n=>n.panZoom?.syncViewport;function T3(n){const l=De(A3),o=$e();return J.useEffect(()=>{n&&(l?.(n),o.setState({transform:[n.x,n.y,n.zoom]}))},[n,l]),null}function M3(n){return n.connection.inProgress?{...n.connection,to:Mo(n.connection.to,n.transform)}:{...n.connection}}function C3(n){return M3}function z3(n){const l=C3();return De(l,ke)}const D3=n=>({nodesConnectable:n.nodesConnectable,isValid:n.connection.isValid,inProgress:n.connection.inProgress,width:n.width,height:n.height});function O3({containerStyle:n,style:l,type:o,component:s}){const{nodesConnectable:r,width:f,height:d,isValid:g,inProgress:m}=De(D3,ke);return!(f&&r&&m)?null:_.jsx("svg",{style:n,width:f,height:d,className:"react-flow__connectionline react-flow__container",children:_.jsx("g",{className:lt(["react-flow__connection",ey(g)]),children:_.jsx(ev,{style:l,type:o,CustomComponent:s,isValid:g})})})}const ev=({style:n,type:l=_a.Bezier,CustomComponent:o,isValid:s})=>{const{inProgress:r,from:f,fromNode:d,fromHandle:g,fromPosition:m,to:h,toNode:v,toHandle:y,toPosition:b,pointer:x}=z3();if(!r)return;if(o)return _.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:b,connectionStatus:ey(s),toNode:v,toHandle:y,pointer:x});let w="";const C={sourceX:f.x,sourceY:f.y,sourcePosition:m,targetX:h.x,targetY:h.y,targetPosition:b};switch(l){case _a.Bezier:[w]=dy(C);break;case _a.SimpleBezier:[w]=Yy(C);break;case _a.Step:[w]=Df({...C,borderRadius:0});break;case _a.SmoothStep:[w]=Df(C);break;default:[w]=gy(C)}return _.jsx("path",{d:w,fill:"none",className:"react-flow__connection-path",style:n})};ev.displayName="ConnectionLine";const R3={};function r0(n=R3){J.useRef(n),$e(),J.useEffect(()=>{},[n])}function H3(){$e(),J.useRef(!1),J.useEffect(()=>{},[])}function tv({nodeTypes:n,edgeTypes:l,onInit:o,onNodeClick:s,onEdgeClick:r,onNodeDoubleClick:f,onEdgeDoubleClick:d,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:h,onNodeContextMenu:v,onSelectionContextMenu:y,onSelectionStart:b,onSelectionEnd:x,connectionLineType:w,connectionLineStyle:C,connectionLineComponent:N,connectionLineContainerStyle:M,selectionKeyCode:D,selectionOnDrag:E,selectionMode:z,multiSelectionKeyCode:G,panActivationKeyCode:q,zoomActivationKeyCode:U,deleteKeyCode:$,onlyRenderVisibleElements:F,elementsSelectable:Z,defaultViewport:Y,translateExtent:W,minZoom:le,maxZoom:O,preventScrolling:X,defaultMarkerColor:A,zoomOnScroll:H,zoomOnPinch:B,panOnScroll:I,panOnScrollSpeed:te,panOnScrollMode:T,zoomOnDoubleClick:j,panOnDrag:ee,onPaneClick:ne,onPaneMouseEnter:re,onPaneMouseMove:ce,onPaneMouseLeave:ue,onPaneScroll:se,onPaneContextMenu:fe,paneClickDistance:Ee,nodeClickDistance:xe,onEdgeContextMenu:ye,onEdgeMouseEnter:be,onEdgeMouseMove:Te,onEdgeMouseLeave:Ue,reconnectRadius:je,onReconnect:st,onReconnectStart:$t,onReconnectEnd:zt,noDragClassName:Kt,noWheelClassName:yn,noPanClassName:wa,disableKeyboardA11y:Na,nodeExtent:ct,rfId:ll,viewport:vn,onViewportChange:In}){return r0(n),r0(l),H3(),N3(o),T3(vn),_.jsx(KN,{onPaneClick:ne,onPaneMouseEnter:re,onPaneMouseMove:ce,onPaneMouseLeave:ue,onPaneContextMenu:fe,onPaneScroll:se,paneClickDistance:Ee,deleteKeyCode:$,selectionKeyCode:D,selectionOnDrag:E,selectionMode:z,onSelectionStart:b,onSelectionEnd:x,multiSelectionKeyCode:G,panActivationKeyCode:q,zoomActivationKeyCode:U,elementsSelectable:Z,zoomOnScroll:H,zoomOnPinch:B,zoomOnDoubleClick:j,panOnScroll:I,panOnScrollSpeed:te,panOnScrollMode:T,panOnDrag:ee,defaultViewport:Y,translateExtent:W,minZoom:le,maxZoom:O,onSelectionContextMenu:y,preventScrolling:X,noDragClassName:Kt,noWheelClassName:yn,noPanClassName:wa,disableKeyboardA11y:Na,onViewportChange:In,isControlledViewport:!!vn,children:_.jsxs(w3,{children:[_.jsx(_3,{edgeTypes:l,onEdgeClick:r,onEdgeDoubleClick:d,onReconnect:st,onReconnectStart:$t,onReconnectEnd:zt,onlyRenderVisibleElements:F,onEdgeContextMenu:ye,onEdgeMouseEnter:be,onEdgeMouseMove:Te,onEdgeMouseLeave:Ue,reconnectRadius:je,defaultMarkerColor:A,noPanClassName:wa,disableKeyboardA11y:Na,rfId:ll}),_.jsx(O3,{style:C,type:w,component:N,containerStyle:M}),_.jsx("div",{className:"react-flow__edgelabel-renderer"}),_.jsx(l3,{nodeTypes:n,onNodeClick:s,onNodeDoubleClick:f,onNodeMouseEnter:g,onNodeMouseMove:m,onNodeMouseLeave:h,onNodeContextMenu:v,nodeClickDistance:xe,onlyRenderVisibleElements:F,noPanClassName:wa,noDragClassName:Kt,disableKeyboardA11y:Na,nodeExtent:ct,rfId:ll}),_.jsx("div",{className:"react-flow__viewport-portal"})]})})}tv.displayName="GraphView";const j3=J.memo(tv),u0=({nodes:n,edges:l,defaultNodes:o,defaultEdges:s,width:r,height:f,fitView:d,fitViewOptions:g,minZoom:m=.5,maxZoom:h=2,nodeOrigin:v,nodeExtent:y,zIndexMode:b="basic"}={})=>{const x=new Map,w=new Map,C=new Map,N=new Map,M=s??l??[],D=o??n??[],E=v??[0,0],z=y??yo;yy(C,N,M);const{nodesInitialized:G}=Rf(D,x,w,{nodeOrigin:E,nodeExtent:z,zIndexMode:b});let q=[0,0,1];if(d&&r&&f){const U=Ao(x,{filter:Y=>!!((Y.width||Y.initialWidth)&&(Y.height||Y.initialHeight))}),{x:$,y:F,zoom:Z}=Qf(U,r,f,m,h,g?.padding??.1);q=[$,F,Z]}return{rfId:"1",width:r??0,height:f??0,transform:q,nodes:D,nodesInitialized:G,nodeLookup:x,parentLookup:w,edges:M,edgeLookup:N,connectionLookup:C,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:o!==void 0,hasDefaultEdges:s!==void 0,panZoom:null,minZoom:m,maxZoom:h,translateExtent:yo,nodeExtent:z,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:ni.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:{...P0},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:KE,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:W0,zIndexMode:b,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},L3=({nodes:n,edges:l,defaultNodes:o,defaultEdges:s,width:r,height:f,fitView:d,fitViewOptions:g,minZoom:m,maxZoom:h,nodeOrigin:v,nodeExtent:y,zIndexMode:b})=>Pw((x,w)=>{async function C(){const{nodeLookup:N,panZoom:M,fitViewOptions:D,fitViewResolver:E,width:z,height:G,minZoom:q,maxZoom:U}=w();M&&(await kE({nodes:N,width:z,height:G,panZoom:M,minZoom:q,maxZoom:U},D),E?.resolve(!0),x({fitViewResolver:null}))}return{...u0({nodes:n,edges:l,width:r,height:f,fitView:d,fitViewOptions:g,minZoom:m,maxZoom:h,nodeOrigin:v,nodeExtent:y,defaultNodes:o,defaultEdges:s,zIndexMode:b}),setNodes:N=>{const{nodeLookup:M,parentLookup:D,nodeOrigin:E,elevateNodesOnSelect:z,fitViewQueued:G,zIndexMode:q,nodesSelectionActive:U}=w(),{nodesInitialized:$,hasSelectedNodes:F}=Rf(N,M,D,{nodeOrigin:E,nodeExtent:y,elevateNodesOnSelect:z,checkEquality:!0,zIndexMode:q}),Z=U&&F;G&&$?(C(),x({nodes:N,nodesInitialized:$,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:Z})):x({nodes:N,nodesInitialized:$,nodesSelectionActive:Z})},setEdges:N=>{const{connectionLookup:M,edgeLookup:D}=w();yy(M,D,N),x({edges:N})},setDefaultNodesAndEdges:(N,M)=>{if(N){const{setNodes:D}=w();D(N),x({hasDefaultNodes:!0})}if(M){const{setEdges:D}=w();D(M),x({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:M,nodeLookup:D,parentLookup:E,domNode:z,nodeOrigin:G,nodeExtent:q,debug:U,fitViewQueued:$,zIndexMode:F}=w(),{changes:Z,updatedInternals:Y}=yw(N,D,E,z,G,q,F);Y&&(hw(D,E,{nodeOrigin:G,nodeExtent:q,zIndexMode:F}),$?(C(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),Z?.length>0&&(U&&console.log("React Flow: trigger node changes",Z),M?.(Z)))},updateNodePositions:(N,M=!1)=>{const D=[];let E=[];const{nodeLookup:z,triggerNodeChanges:G,connection:q,updateConnection:U,onNodesChangeMiddlewareMap:$}=w();for(const[F,Z]of N){const Y=z.get(F),W=!!(Y?.expandParent&&Y?.parentId&&Z?.position),le={id:F,type:"position",position:W?{x:Math.max(0,Z.position.x),y:Math.max(0,Z.position.y)}:Z.position,dragging:M};if(Y&&q.inProgress&&q.fromNode.id===Y.id){const O=al(Y,q.fromHandle,me.Left,!0);U({...q,from:O})}W&&Y.parentId&&D.push({id:F,parentId:Y.parentId,rect:{...Z.internals.positionAbsolute,width:Z.measured.width??0,height:Z.measured.height??0}}),E.push(le)}if(D.length>0){const{parentLookup:F,nodeOrigin:Z}=w(),Y=Wf(D,z,F,Z);E.push(...Y)}for(const F of $.values())E=F(E);G(E)},triggerNodeChanges:N=>{const{onNodesChange:M,setNodes:D,nodes:E,hasDefaultNodes:z,debug:G}=w();if(N?.length){if(z){const q=SN(N,E);D(q)}G&&console.log("React Flow: trigger node changes",N),M?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:M,setEdges:D,edges:E,hasDefaultEdges:z,debug:G}=w();if(N?.length){if(z){const q=xN(N,E);D(q)}G&&console.log("React Flow: trigger edge changes",N),M?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:M,edgeLookup:D,nodeLookup:E,triggerNodeChanges:z,triggerEdgeChanges:G}=w();if(M){const q=N.map(U=>Ja(U,!0));z(q);return}z(Fl(E,new Set([...N]),!0)),G(Fl(D))},addSelectedEdges:N=>{const{multiSelectionActive:M,edgeLookup:D,nodeLookup:E,triggerNodeChanges:z,triggerEdgeChanges:G}=w();if(M){const q=N.map(U=>Ja(U,!0));G(q);return}G(Fl(D,new Set([...N]))),z(Fl(E,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:M}={})=>{const{edges:D,nodes:E,nodeLookup:z,triggerNodeChanges:G,triggerEdgeChanges:q}=w(),U=N||E,$=M||D,F=[];for(const Y of U){if(!Y.selected)continue;const W=z.get(Y.id);W&&(W.selected=!1),F.push(Ja(Y.id,!1))}const Z=[];for(const Y of $)Y.selected&&Z.push(Ja(Y.id,!1));G(F),q(Z)},setMinZoom:N=>{const{panZoom:M,maxZoom:D}=w();M?.setScaleExtent([N,D]),x({minZoom:N})},setMaxZoom:N=>{const{panZoom:M,minZoom:D}=w();M?.setScaleExtent([D,N]),x({maxZoom:N})},setTranslateExtent:N=>{w().panZoom?.setTranslateExtent(N),x({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:M,triggerNodeChanges:D,triggerEdgeChanges:E,elementsSelectable:z}=w();if(!z)return;const G=M.reduce((U,$)=>$.selected?[...U,Ja($.id,!1)]:U,[]),q=N.reduce((U,$)=>$.selected?[...U,Ja($.id,!1)]:U,[]);D(G),E(q)},setNodeExtent:N=>{const{nodes:M,nodeLookup:D,parentLookup:E,nodeOrigin:z,elevateNodesOnSelect:G,nodeExtent:q,zIndexMode:U}=w();N[0][0]===q[0][0]&&N[0][1]===q[0][1]&&N[1][0]===q[1][0]&&N[1][1]===q[1][1]||(Rf(M,D,E,{nodeOrigin:z,nodeExtent:N,elevateNodesOnSelect:G,checkEquality:!1,zIndexMode:U}),x({nodeExtent:N}))},panBy:N=>{const{transform:M,width:D,height:E,panZoom:z,translateExtent:G}=w();return vw({delta:N,panZoom:z,transform:M,translateExtent:G,width:D,height:E})},setCenter:async(N,M,D)=>{const{width:E,height:z,maxZoom:G,panZoom:q}=w();if(!q)return Promise.resolve(!1);const U=typeof D?.zoom<"u"?D.zoom:G;return await q.setViewport({x:E/2-N*U,y:z/2-M*U,zoom:U},{duration:D?.duration,ease:D?.ease,interpolate:D?.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{x({connection:{...P0}})},updateConnection:N=>{x({connection:N})},reset:()=>x({...u0()})}},Object.is);function B3({initialNodes:n,initialEdges:l,defaultNodes:o,defaultEdges:s,initialWidth:r,initialHeight:f,initialMinZoom:d,initialMaxZoom:g,initialFitViewOptions:m,fitView:h,nodeOrigin:v,nodeExtent:y,zIndexMode:b,children:x}){const[w]=J.useState(()=>L3({nodes:n,edges:l,defaultNodes:o,defaultEdges:s,width:r,height:f,fitView:h,minZoom:d,maxZoom:g,fitViewOptions:m,nodeOrigin:v,nodeExtent:y,zIndexMode:b}));return _.jsx(eN,{value:w,children:_.jsx(wN,{children:x})})}function U3({children:n,nodes:l,edges:o,defaultNodes:s,defaultEdges:r,width:f,height:d,fitView:g,fitViewOptions:m,minZoom:h,maxZoom:v,nodeOrigin:y,nodeExtent:b,zIndexMode:x}){return J.useContext(Or)?_.jsx(_.Fragment,{children:n}):_.jsx(B3,{initialNodes:l,initialEdges:o,defaultNodes:s,defaultEdges:r,initialWidth:f,initialHeight:d,fitView:g,initialFitViewOptions:m,initialMinZoom:h,initialMaxZoom:v,nodeOrigin:y,nodeExtent:b,zIndexMode:x,children:n})}const q3={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function G3({nodes:n,edges:l,defaultNodes:o,defaultEdges:s,className:r,nodeTypes:f,edgeTypes:d,onNodeClick:g,onEdgeClick:m,onInit:h,onMove:v,onMoveStart:y,onMoveEnd:b,onConnect:x,onConnectStart:w,onConnectEnd:C,onClickConnectStart:N,onClickConnectEnd:M,onNodeMouseEnter:D,onNodeMouseMove:E,onNodeMouseLeave:z,onNodeContextMenu:G,onNodeDoubleClick:q,onNodeDragStart:U,onNodeDrag:$,onNodeDragStop:F,onNodesDelete:Z,onEdgesDelete:Y,onDelete:W,onSelectionChange:le,onSelectionDragStart:O,onSelectionDrag:X,onSelectionDragStop:A,onSelectionContextMenu:H,onSelectionStart:B,onSelectionEnd:I,onBeforeDelete:te,connectionMode:T,connectionLineType:j=_a.Bezier,connectionLineStyle:ee,connectionLineComponent:ne,connectionLineContainerStyle:re,deleteKeyCode:ce="Backspace",selectionKeyCode:ue="Shift",selectionOnDrag:se=!1,selectionMode:fe=vo.Full,panActivationKeyCode:Ee="Space",multiSelectionKeyCode:xe=So()?"Meta":"Control",zoomActivationKeyCode:ye=So()?"Meta":"Control",snapToGrid:be,snapGrid:Te,onlyRenderVisibleElements:Ue=!1,selectNodesOnDrag:je,nodesDraggable:st,autoPanOnNodeFocus:$t,nodesConnectable:zt,nodesFocusable:Kt,nodeOrigin:yn=zy,edgesFocusable:wa,edgesReconnectable:Na,elementsSelectable:ct=!0,defaultViewport:ll=hN,minZoom:vn=.5,maxZoom:In=2,translateExtent:Aa=yo,preventScrolling:Lr=!0,nodeExtent:il,defaultMarkerColor:Br="#b1b1b7",zoomOnScroll:Ur=!0,zoomOnPinch:Ta=!0,panOnScroll:yt=!1,panOnScrollSpeed:on=.5,panOnScrollMode:vt=Pa.Free,zoomOnDoubleClick:qr=!0,panOnDrag:Gr=!0,onPaneClick:Yr,onPaneMouseEnter:ol,onPaneMouseMove:sl,onPaneMouseLeave:rl,onPaneScroll:bn,onPaneContextMenu:ul,paneClickDistance:Ma=1,nodeClickDistance:Vr=0,children:Co,onReconnect:ri,onReconnectStart:Ca,onReconnectEnd:Xr,onEdgeContextMenu:zo,onEdgeDoubleClick:Do,onEdgeMouseEnter:Oo,onEdgeMouseMove:ui,onEdgeMouseLeave:ci,reconnectRadius:Ro=10,onNodesChange:Ho,onEdgesChange:sn,noDragClassName:it="nodrag",noWheelClassName:mt="nowheel",noPanClassName:Sn="nopan",fitView:cl,fitViewOptions:jo,connectOnClick:Zr,attributionPosition:Lo,proOptions:za,defaultEdgeOptions:fi,elevateNodesOnSelect:Qn=!0,elevateEdgesOnSelect:kn=!1,disableKeyboardA11y:$n=!1,autoPanOnConnect:Kn,autoPanOnNodeDrag:Pe,autoPanSpeed:Bo,connectionRadius:Uo,isValidConnection:xn,onError:Jn,style:Ir,id:di,nodeDragThreshold:qo,connectionDragThreshold:Qr,viewport:fl,onViewportChange:dl,width:Jt,height:St,colorMode:Go="light",debug:kr,onScroll:hl,ariaLabelConfig:Yo,zIndexMode:Da="basic",...$r},xt){const Oa=di||"1",Vo=yN(Go),hi=J.useCallback(_n=>{_n.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),hl?.(_n)},[hl]);return _.jsx("div",{"data-testid":"rf__wrapper",...$r,onScroll:hi,style:{...Ir,...q3},ref:xt,className:lt(["react-flow",r,Vo]),id:di,role:"application",children:_.jsxs(U3,{nodes:n,edges:l,width:Jt,height:St,fitView:cl,fitViewOptions:jo,minZoom:vn,maxZoom:In,nodeOrigin:yn,nodeExtent:il,zIndexMode:Da,children:[_.jsx(pN,{nodes:n,edges:l,defaultNodes:o,defaultEdges:s,onConnect:x,onConnectStart:w,onConnectEnd:C,onClickConnectStart:N,onClickConnectEnd:M,nodesDraggable:st,autoPanOnNodeFocus:$t,nodesConnectable:zt,nodesFocusable:Kt,edgesFocusable:wa,edgesReconnectable:Na,elementsSelectable:ct,elevateNodesOnSelect:Qn,elevateEdgesOnSelect:kn,minZoom:vn,maxZoom:In,nodeExtent:il,onNodesChange:Ho,onEdgesChange:sn,snapToGrid:be,snapGrid:Te,connectionMode:T,translateExtent:Aa,connectOnClick:Zr,defaultEdgeOptions:fi,fitView:cl,fitViewOptions:jo,onNodesDelete:Z,onEdgesDelete:Y,onDelete:W,onNodeDragStart:U,onNodeDrag:$,onNodeDragStop:F,onSelectionDrag:X,onSelectionDragStart:O,onSelectionDragStop:A,onMove:v,onMoveStart:y,onMoveEnd:b,noPanClassName:Sn,nodeOrigin:yn,rfId:Oa,autoPanOnConnect:Kn,autoPanOnNodeDrag:Pe,autoPanSpeed:Bo,onError:Jn,connectionRadius:Uo,isValidConnection:xn,selectNodesOnDrag:je,nodeDragThreshold:qo,connectionDragThreshold:Qr,onBeforeDelete:te,debug:kr,ariaLabelConfig:Yo,zIndexMode:Da}),_.jsx(j3,{onInit:h,onNodeClick:g,onEdgeClick:m,onNodeMouseEnter:D,onNodeMouseMove:E,onNodeMouseLeave:z,onNodeContextMenu:G,onNodeDoubleClick:q,nodeTypes:f,edgeTypes:d,connectionLineType:j,connectionLineStyle:ee,connectionLineComponent:ne,connectionLineContainerStyle:re,selectionKeyCode:ue,selectionOnDrag:se,selectionMode:fe,deleteKeyCode:ce,multiSelectionKeyCode:xe,panActivationKeyCode:Ee,zoomActivationKeyCode:ye,onlyRenderVisibleElements:Ue,defaultViewport:ll,translateExtent:Aa,minZoom:vn,maxZoom:In,preventScrolling:Lr,zoomOnScroll:Ur,zoomOnPinch:Ta,zoomOnDoubleClick:qr,panOnScroll:yt,panOnScrollSpeed:on,panOnScrollMode:vt,panOnDrag:Gr,onPaneClick:Yr,onPaneMouseEnter:ol,onPaneMouseMove:sl,onPaneMouseLeave:rl,onPaneScroll:bn,onPaneContextMenu:ul,paneClickDistance:Ma,nodeClickDistance:Vr,onSelectionContextMenu:H,onSelectionStart:B,onSelectionEnd:I,onReconnect:ri,onReconnectStart:Ca,onReconnectEnd:Xr,onEdgeContextMenu:zo,onEdgeDoubleClick:Do,onEdgeMouseEnter:Oo,onEdgeMouseMove:ui,onEdgeMouseLeave:ci,reconnectRadius:Ro,defaultMarkerColor:Br,noDragClassName:it,noWheelClassName:mt,noPanClassName:Sn,rfId:Oa,disableKeyboardA11y:$n,nodeExtent:il,viewport:fl,onViewportChange:dl}),_.jsx(dN,{onSelectionChange:le}),Co,_.jsx(sN,{proOptions:za,position:Lo}),_.jsx(oN,{rfId:Oa,disableKeyboardA11y:$n})]})})}Oy(G3);function Y3({dimensions:n,lineWidth:l,variant:o,className:s}){return _.jsx("path",{strokeWidth:l,d:`M${n[0]/2} 0 V${n[1]} M0 ${n[1]/2} H${n[0]}`,className:lt(["react-flow__background-pattern",o,s])})}function V3({radius:n,className:l}){return _.jsx("circle",{cx:n,cy:n,r:n,className:lt(["react-flow__background-pattern","dots",l])})}var Ea;(function(n){n.Lines="lines",n.Dots="dots",n.Cross="cross"})(Ea||(Ea={}));const X3={[Ea.Dots]:1,[Ea.Lines]:1,[Ea.Cross]:6},Z3=n=>({transform:n.transform,patternId:`pattern-${n.rfId}`});function nv({id:n,variant:l=Ea.Dots,gap:o=20,size:s,lineWidth:r=1,offset:f=0,color:d,bgColor:g,style:m,className:h,patternClassName:v}){const y=J.useRef(null),{transform:b,patternId:x}=De(Z3,ke),w=s||X3[l],C=l===Ea.Dots,N=l===Ea.Cross,M=Array.isArray(o)?o:[o,o],D=[M[0]*b[2]||1,M[1]*b[2]||1],E=w*b[2],z=Array.isArray(f)?f:[f,f],G=N?[E,E]:D,q=[z[0]*b[2]||1+G[0]/2,z[1]*b[2]||1+G[1]/2],U=`${x}${n||""}`;return _.jsxs("svg",{className:lt(["react-flow__background",h]),style:{...m,...Hr,"--xy-background-color-props":g,"--xy-background-pattern-color-props":d},ref:y,"data-testid":"rf__background",children:[_.jsx("pattern",{id:U,x:b[0]%D[0],y:b[1]%D[1],width:D[0],height:D[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${q[0]},-${q[1]})`,children:C?_.jsx(V3,{radius:E/2,className:v}):_.jsx(Y3,{dimensions:G,lineWidth:r,variant:l,className:v})}),_.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${U})`})]})}nv.displayName="Background";J.memo(nv);function I3(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:_.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function Q3(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:_.jsx("path",{d:"M0 0h32v4.2H0z"})})}function k3(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:_.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 $3(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:_.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 K3(){return _.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:_.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 or({children:n,className:l,...o}){return _.jsx("button",{type:"button",className:lt(["react-flow__controls-button",l]),...o,children:n})}const J3=n=>({isInteractive:n.nodesDraggable||n.nodesConnectable||n.elementsSelectable,minZoomReached:n.transform[2]<=n.minZoom,maxZoomReached:n.transform[2]>=n.maxZoom,ariaLabelConfig:n.ariaLabelConfig});function av({style:n,showZoom:l=!0,showFitView:o=!0,showInteractive:s=!0,fitViewOptions:r,onZoomIn:f,onZoomOut:d,onFitView:g,onInteractiveChange:m,className:h,children:v,position:y="bottom-left",orientation:b="vertical","aria-label":x}){const w=$e(),{isInteractive:C,minZoomReached:N,maxZoomReached:M,ariaLabelConfig:D}=De(J3,ke),{zoomIn:E,zoomOut:z,fitView:G}=Pf(),q=()=>{E(),f?.()},U=()=>{z(),d?.()},$=()=>{G(r),g?.()},F=()=>{w.setState({nodesDraggable:!C,nodesConnectable:!C,elementsSelectable:!C}),m?.(!C)},Z=b==="horizontal"?"horizontal":"vertical";return _.jsxs(Rr,{className:lt(["react-flow__controls",Z,h]),position:y,style:n,"data-testid":"rf__controls","aria-label":x??D["controls.ariaLabel"],children:[l&&_.jsxs(_.Fragment,{children:[_.jsx(or,{onClick:q,className:"react-flow__controls-zoomin",title:D["controls.zoomIn.ariaLabel"],"aria-label":D["controls.zoomIn.ariaLabel"],disabled:M,children:_.jsx(I3,{})}),_.jsx(or,{onClick:U,className:"react-flow__controls-zoomout",title:D["controls.zoomOut.ariaLabel"],"aria-label":D["controls.zoomOut.ariaLabel"],disabled:N,children:_.jsx(Q3,{})})]}),o&&_.jsx(or,{className:"react-flow__controls-fitview",onClick:$,title:D["controls.fitView.ariaLabel"],"aria-label":D["controls.fitView.ariaLabel"],children:_.jsx(k3,{})}),s&&_.jsx(or,{className:"react-flow__controls-interactive",onClick:F,title:D["controls.interactive.ariaLabel"],"aria-label":D["controls.interactive.ariaLabel"],children:C?_.jsx(K3,{}):_.jsx($3,{})}),v]})}av.displayName="Controls";J.memo(av);function F3({id:n,x:l,y:o,width:s,height:r,style:f,color:d,strokeColor:g,strokeWidth:m,className:h,borderRadius:v,shapeRendering:y,selected:b,onClick:x}){const{background:w,backgroundColor:C}=f||{},N=d||w||C;return _.jsx("rect",{className:lt(["react-flow__minimap-node",{selected:b},h]),x:l,y:o,rx:v,ry:v,width:s,height:r,style:{fill:N,stroke:g,strokeWidth:m},shapeRendering:y,onClick:x?M=>x(M,n):void 0})}const W3=J.memo(F3),P3=n=>n.nodes.map(l=>l.id),Sf=n=>n instanceof Function?n:()=>n;function eA({nodeStrokeColor:n,nodeColor:l,nodeClassName:o="",nodeBorderRadius:s=5,nodeStrokeWidth:r,nodeComponent:f=W3,onClick:d}){const g=De(P3,ke),m=Sf(l),h=Sf(n),v=Sf(o),y=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return _.jsx(_.Fragment,{children:g.map(b=>_.jsx(nA,{id:b,nodeColorFunc:m,nodeStrokeColorFunc:h,nodeClassNameFunc:v,nodeBorderRadius:s,nodeStrokeWidth:r,NodeComponent:f,onClick:d,shapeRendering:y},b))})}function tA({id:n,nodeColorFunc:l,nodeStrokeColorFunc:o,nodeClassNameFunc:s,nodeBorderRadius:r,nodeStrokeWidth:f,shapeRendering:d,NodeComponent:g,onClick:m}){const{node:h,x:v,y,width:b,height:x}=De(w=>{const C=w.nodeLookup.get(n);if(!C)return{node:void 0,x:0,y:0,width:0,height:0};const N=C.internals.userNode,{x:M,y:D}=C.internals.positionAbsolute,{width:E,height:z}=Zn(N);return{node:N,x:M,y:D,width:E,height:z}},ke);return!h||h.hidden||!oy(h)?null:_.jsx(g,{x:v,y,width:b,height:x,style:h.style,selected:!!h.selected,className:s(h),color:l(h),borderRadius:r,strokeColor:o(h),strokeWidth:f,shapeRendering:d,onClick:m,id:h.id})}const nA=J.memo(tA);var aA=J.memo(eA);const lA=200,iA=150,oA=n=>!n.hidden,sA=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?iy(Ao(n.nodeLookup,{filter:oA}),l):l,rfId:n.rfId,panZoom:n.panZoom,translateExtent:n.translateExtent,flowWidth:n.width,flowHeight:n.height,ariaLabelConfig:n.ariaLabelConfig}},rA="react-flow__minimap-desc";function lv({style:n,className:l,nodeStrokeColor:o,nodeColor:s,nodeClassName:r="",nodeBorderRadius:f=5,nodeStrokeWidth:d,nodeComponent:g,bgColor:m,maskColor:h,maskStrokeColor:v,maskStrokeWidth:y,position:b="bottom-right",onClick:x,onNodeClick:w,pannable:C=!1,zoomable:N=!1,ariaLabel:M,inversePan:D,zoomStep:E=1,offsetScale:z=5}){const G=$e(),q=J.useRef(null),{boundingRect:U,viewBB:$,rfId:F,panZoom:Z,translateExtent:Y,flowWidth:W,flowHeight:le,ariaLabelConfig:O}=De(sA,ke),X=n?.width??lA,A=n?.height??iA,H=U.width/X,B=U.height/A,I=Math.max(H,B),te=I*X,T=I*A,j=z*I,ee=U.x-(te-U.width)/2-j,ne=U.y-(T-U.height)/2-j,re=te+j*2,ce=T+j*2,ue=`${rA}-${F}`,se=J.useRef(0),fe=J.useRef();se.current=I,J.useEffect(()=>{if(q.current&&Z)return fe.current=Tw({domNode:q.current,panZoom:Z,getTransform:()=>G.getState().transform,getViewScale:()=>se.current}),()=>{fe.current?.destroy()}},[Z]),J.useEffect(()=>{fe.current?.update({translateExtent:Y,width:W,height:le,inversePan:D,pannable:C,zoomStep:E,zoomable:N})},[C,N,D,E,Y,W,le]);const Ee=x?be=>{const[Te,Ue]=fe.current?.pointer(be)||[0,0];x(be,{x:Te,y:Ue})}:void 0,xe=w?J.useCallback((be,Te)=>{const Ue=G.getState().nodeLookup.get(Te).internals.userNode;w(be,Ue)},[]):void 0,ye=M??O["minimap.ariaLabel"];return _.jsx(Rr,{position:b,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*I:void 0,"--xy-minimap-node-background-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-color-props":typeof o=="string"?o:void 0,"--xy-minimap-node-stroke-width-props":typeof d=="number"?d:void 0},className:lt(["react-flow__minimap",l]),"data-testid":"rf__minimap",children:_.jsxs("svg",{width:X,height:A,viewBox:`${ee} ${ne} ${re} ${ce}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ue,ref:q,onClick:Ee,children:[ye&&_.jsx("title",{id:ue,children:ye}),_.jsx(aA,{onClick:xe,nodeColor:s,nodeStrokeColor:o,nodeBorderRadius:f,nodeClassName:r,nodeStrokeWidth:d,nodeComponent:g}),_.jsx("path",{className:"react-flow__minimap-mask",d:`M${ee-j},${ne-j}h${re+j*2}v${ce+j*2}h${-re-j*2}z
15
- M${$.x},${$.y}h${$.width}v${$.height}h${-$.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}lv.displayName="MiniMap";J.memo(lv);const uA=n=>l=>n?`${Math.max(1/l.transform[2],1)}`:void 0,cA={[oi.Line]:"right",[oi.Handle]:"bottom-right"};function fA({nodeId:n,position:l,variant:o=oi.Handle,className:s,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:b,autoScale:x=!0,shouldResize:w,onResizeStart:C,onResize:N,onResizeEnd:M}){const D=Ly(),E=typeof n=="string"?n:D,z=$e(),G=J.useRef(null),q=o===oi.Handle,U=De(J.useCallback(uA(q&&x),[q,x]),ke),$=J.useRef(null),F=l??cA[o];J.useEffect(()=>{if(!(!G.current||!E))return $.current||($.current=Yw({domNode:G.current,nodeId:E,getStoreItems:()=>{const{nodeLookup:Y,transform:W,snapGrid:le,snapToGrid:O,nodeOrigin:X,domNode:A}=z.getState();return{nodeLookup:Y,transform:W,snapGrid:le,snapToGrid:O,nodeOrigin:X,paneDomNode:A}},onChange:(Y,W)=>{const{triggerNodeChanges:le,nodeLookup:O,parentLookup:X,nodeOrigin:A}=z.getState(),H=[],B={x:Y.x,y:Y.y},I=O.get(E);if(I&&I.expandParent&&I.parentId){const te=I.origin??A,T=Y.width??I.measured.width??0,j=Y.height??I.measured.height??0,ee={id:I.id,parentId:I.parentId,rect:{width:T,height:j,...sy({x:Y.x??I.position.x,y:Y.y??I.position.y},{width:T,height:j},I.parentId,O,te)}},ne=Wf([ee],O,X,A);H.push(...ne),B.x=Y.x?Math.max(te[0]*T,Y.x):void 0,B.y=Y.y?Math.max(te[1]*j,Y.y):void 0}if(B.x!==void 0&&B.y!==void 0){const te={id:E,type:"position",position:{...B}};H.push(te)}if(Y.width!==void 0&&Y.height!==void 0){const T={id:E,type:"dimensions",resizing:!0,setAttributes:b?b==="horizontal"?"width":"height":!0,dimensions:{width:Y.width,height:Y.height}};H.push(T)}for(const te of W){const T={...te,type:"position"};H.push(T)}le(H)},onEnd:({width:Y,height:W})=>{const le={id:E,type:"dimensions",resizing:!1,dimensions:{width:Y,height:W}};z.getState().triggerNodeChanges([le])}})),$.current.update({controlPosition:F,boundaries:{minWidth:g,minHeight:m,maxWidth:h,maxHeight:v},keepAspectRatio:y,resizeDirection:b,onResizeStart:C,onResize:N,onResizeEnd:M,shouldResize:w}),()=>{$.current?.destroy()}},[F,g,m,h,v,y,C,N,M,w]);const Z=F.split("-");return _.jsx("div",{className:lt(["react-flow__resize-control","nodrag",...Z,o,s]),ref:G,style:{...r,scale:U,...d&&{[q?"backgroundColor":"borderColor"]:d}},children:f})}J.memo(fA);function dA({id:n,data:l,selected:o}){const{t:s}=ut(),r=l,f=de(D=>D.updateNodePrompt),d=de(D=>D.generateNode),g=de(D=>D.addChildNode),m=de(D=>D.duplicateBranchRoot),h=de(D=>D.deleteNode),v=J.useCallback(D=>f(n,D.target.value),[n,f]),y=J.useCallback(()=>{d(n)},[n,d]),b=J.useCallback(()=>{r.status==="ready"&&g(n)},[n,r.status,g]),x=J.useCallback(()=>{m(n)},[n,m]),w=J.useCallback(()=>h(n),[n,h]),C=r.status==="pending"||r.status==="reconciling",M=(()=>{switch(r.status){case"empty":return s("node.empty");case"pending":return s("node.pending");case"reconciling":return r.pendingPhase?s("node.reconcilingPhase",{phase:r.pendingPhase}):s("node.reconciling");case"ready":return r.webSearchCalls?s("node.readyWithSearch",{elapsed:r.elapsed??"?",searches:r.webSearchCalls}):s("node.ready",{elapsed:r.elapsed??"?"});case"stale":return r.error?s("node.staleWithError",{error:r.error}):s("node.stale");case"asset-missing":return r.error?s("node.assetMissingWithError",{error:r.error}):s("node.assetMissing");case"error":return s("node.error",{error:r.error??s("node.errorUnknown")});default:return""}})();return _.jsxs("div",{className:`image-node image-node--${r.status}${o?" image-node--selected":""}`,children:[r.parentServerNodeId?_.jsx(si,{type:"target",position:me.Left,className:"image-node__handle"}):null,_.jsx("div",{className:"image-node__preview",children:r.imageUrl&&r.status!=="asset-missing"?_.jsx("img",{src:r.imageUrl,alt:s("node.nodeImageAlt")}):C?_.jsx("div",{className:"image-node__skeleton"}):r.status==="asset-missing"?_.jsx("div",{className:"image-node__placeholder",children:s("node.noAsset")}):r.status==="stale"?_.jsx("div",{className:"image-node__placeholder",children:s("node.stateStale")}):_.jsx("div",{className:"image-node__placeholder",children:s("node.noImage")})}),_.jsx("textarea",{className:"image-node__prompt nodrag",value:r.prompt,onChange:v,onKeyDown:D=>D.stopPropagation(),placeholder:r.parentServerNodeId?s("node.editPromptPlaceholder"):s("node.promptPlaceholder"),rows:2,disabled:C}),_.jsxs("div",{className:"image-node__footer",children:[_.jsx("span",{className:"image-node__status",children:M}),_.jsxs("div",{className:"image-node__actions nodrag",children:[_.jsx("button",{type:"button",onClick:y,disabled:C,children:r.status==="ready"?s("node.regenerate"):s("node.generate")}),r.status==="ready"?_.jsxs(_.Fragment,{children:[_.jsx("button",{type:"button",onClick:b,children:s("node.addChild")}),_.jsx("button",{type:"button",onClick:x,title:s("node.duplicateBranchTitle"),children:s("node.duplicateBranch")})]}):null,_.jsx("button",{type:"button",onClick:w,className:"image-node__del",title:s("node.deleteTitle"),children:"×"})]})]}),_.jsx(si,{type:"source",position:me.Right,className:"image-node__handle image-node__handle--source"})]})}J.memo(dA);function hA(){const{data:n,error:l}=S0(),{t:o}=ut();let s=o("billing.checking"),r="var(--text-dim)";if(l||!n)l&&(s=o("billing.offline"),r="var(--red)");else if(n.credits){const f=n.credits.total_granted??0,d=n.credits.total_used??0,g=f-d;s=o("billing.remaining",{remaining:g.toFixed(2)}),r=g>5?"var(--green)":g>1?"var(--amber)":"var(--red)"}else if(n.costs?.data?.length){const f=n.costs.data.reduce((d,g)=>d+g.results.reduce((m,h)=>m+(h.amount?.value??0),0),0);s=o("billing.thisMonth",{amount:(f/100).toFixed(2)}),r="var(--accent)"}else n.oauth?(s=o("billing.oauthFree"),r="var(--green)"):n.apiKeyValid?(s=o("billing.apiDisabled"),r="var(--text-dim)"):(s=o("billing.oauthMode"),r="var(--text-dim)");return _.jsxs("div",{className:"billing-bar",children:[_.jsx("div",{className:"label",children:o("billing.label")}),_.jsx("div",{className:"value",style:{color:r},children:s})]})}function Yn({title:n,items:l,value:o,onChange:s}){return _.jsxs("div",{className:"option-group",children:[n?_.jsx("div",{className:"section-title",children:n}):null,_.jsx("div",{className:"option-row",children:l.map(r=>_.jsxs("button",{className:`option-btn${r.value===o?" active":""}`,style:r.color?{color:r.color}:void 0,onClick:()=>s(r.value),type:"button",children:[r.label,r.sub?_.jsxs(_.Fragment,{children:[_.jsx("br",{}),_.jsx("span",{className:"option-sub",children:r.sub})]}):null]},r.value))})]})}function io(n){return n.map(l=>({value:l.value,label:l.label,sub:l.sub}))}function gA(){const n=de(g=>g.sizePreset),l=de(g=>g.setSizePreset),o=de(g=>g.customW),s=de(g=>g.customH),r=de(g=>g.setCustomSize),{t:f}=ut(),d=n==="custom";return _.jsxs("div",{className:"option-group",children:[_.jsx("div",{className:"section-title",children:f("size.title")}),_.jsx(Yn,{title:"",items:io(US),value:n,onChange:l}),_.jsx(Yn,{title:"",items:io(qS),value:n,onChange:l}),_.jsx(Yn,{title:"",items:io(GS),value:n,onChange:l}),_.jsx(Yn,{title:"",items:io(YS),value:n,onChange:l}),_.jsx(Yn,{title:"",items:io(VS()),value:n,onChange:l}),d?_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"option-row",children:[_.jsx("input",{type:"number",className:"custom-size-input",min:1024,max:3824,step:16,value:o,onChange:g=>r(parseInt(g.target.value)||1024,s),placeholder:f("size.width")}),_.jsx("span",{style:{color:"var(--text-dim)",alignSelf:"center",fontFamily:"var(--mono)",fontSize:12},children:"x"}),_.jsx("input",{type:"number",className:"custom-size-input",min:1024,max:3824,step:16,value:s,onChange:g=>r(o,parseInt(g.target.value)||1024),placeholder:f("size.height")})]}),_.jsx("div",{className:"size-hint",children:f("size.hint")})]}):null]})}const mA={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 pA(n,l){return mA[n]?.[l]??0}function yA(){const{t:n}=ut(),l=de(h=>h.provider),o=de(h=>h.quality),r=de(h=>h.getResolvedSize)(),f=l==="oauth",d=pA(o,r),g=f?n("cost.free"):n("cost.approx",{amount:d.toFixed(3)}),m=f?"var(--green)":void 0;return _.jsxs("div",{className:"cost-estimate",children:[_.jsx("span",{children:n("cost.label")}),_.jsx("span",{className:"price",style:m?{color:m}:void 0,children:g})]})}const vA=[{value:"png",label:"PNG"},{value:"jpeg",label:"JPEG"},{value:"webp",label:"WebP"}],bA=[{value:"1",label:"1"},{value:"2",label:"2"},{value:"4",label:"4"}];function SA(){const n=de(N=>N.rightPanelOpen),l=de(N=>N.toggleRightPanel),{t:o}=ut(),[s,r]=J.useState(typeof window<"u"?window.matchMedia("(max-width: 800px)").matches:!1);J.useEffect(()=>{if(typeof window>"u")return;const N=window.matchMedia("(max-width: 800px)"),M=()=>r(N.matches);return N.addEventListener("change",M),()=>N.removeEventListener("change",M)},[]);const f=s?n:!0,d=de(N=>N.quality),g=de(N=>N.setQuality),m=de(N=>N.format),h=de(N=>N.setFormat),v=de(N=>N.moderation),y=de(N=>N.setModeration),b=de(N=>N.count),x=de(N=>N.setCount),w=[{value:"low",label:o("quality.lowLabel"),sub:o("quality.lowSub")},{value:"medium",label:o("quality.mediumLabel"),sub:o("quality.mediumSub")},{value:"high",label:o("quality.highLabel"),sub:o("quality.highSub")}],C=[{value:"auto",label:o("moderation.autoLabel"),sub:o("moderation.autoSub")},{value:"low",label:o("moderation.lowLabel"),sub:o("moderation.lowSub"),color:"var(--amber)"}];return _.jsxs(_.Fragment,{children:[s&&n?_.jsx("div",{className:"right-panel-backdrop",role:"button","aria-label":o("panel.closeSettings"),onClick:l}):null,_.jsxs("aside",{className:`right-panel${n?"":" collapsed"}${s&&f?" drawer-open":""}`,"aria-label":o("panel.detailSettings"),children:[_.jsx("button",{type:"button",className:"right-panel-toggle","aria-expanded":n,"aria-controls":"right-panel-body",onClick:l,title:o(n?"panel.toggleHide":"panel.toggleShow"),children:s?o(n?"panel.close":"panel.open"):n?">":"<"}),_.jsxs("div",{id:"right-panel-body",className:"right-panel-body",hidden:!n,children:[_.jsx(hA,{}),_.jsx("div",{className:"section-title",children:o("panel.detailSettings")}),_.jsx(Yn,{title:o("quality.title"),items:w,value:d,onChange:g}),_.jsx(gA,{}),_.jsx(Yn,{title:o("format.title"),items:vA,value:m,onChange:h}),_.jsx(Yn,{title:o("moderation.title"),items:C,value:v,onChange:y}),_.jsx("p",{className:"option-help",children:o("moderation.explain")}),_.jsx(Yn,{title:o("count.title"),items:bA,value:String(b),onChange:N=>x(Number(N))}),_.jsx(yA,{})]})]})]})}function xA(){const n=de(r=>r.toast),[l,o]=J.useState(!1);if(J.useEffect(()=>{if(!n)return;o(!0);const r=setTimeout(()=>o(!1),3e3);return()=>clearTimeout(r)},[n]),!n)return null;const s=["toast",l?"visible":"",n.error?"error":""].filter(Boolean).join(" ");return _.jsx("div",{className:s,children:n.message})}function _A(n){if(!n)return"earlier";const l=new Date(n);if(Number.isNaN(l.getTime()))return"earlier";const s=Math.floor((new Date().getTime()-l.getTime())/864e5);return s===0?"today":s===1?"yesterday":s<7?"thisWeek":l.toLocaleDateString("ko-KR",{year:"numeric",month:"short",day:"numeric"})}function EA(){const{t:n}=ut(),l=de(Z=>Z.galleryOpen),o=de(Z=>Z.closeGallery),s=de(Z=>Z.history),r=de(Z=>Z.selectHistory),f=de(Z=>Z.currentImage),d=de(Z=>Z.removeFromHistory),g=de(Z=>Z.addHistoryItem),[m,h]=J.useState(""),[v,y]=J.useState("date"),[b,x]=J.useState([]),[w,C]=J.useState([]),[N,M]=J.useState(null);J.useEffect(()=>{if(!l)return;const Z=Y=>{Y.key==="Escape"&&o()};return window.addEventListener("keydown",Z),()=>window.removeEventListener("keydown",Z)},[l,o]),J.useEffect(()=>{l||(h(""),M(null))},[l]),J.useEffect(()=>{if(!l||v!=="session")return;let Z=!1;return(async()=>{try{const Y=await Ab({limit:500});if(Z)return;const W=le=>{const O=le.kind,X=O==="classic"||O==="edit"||O==="generate"?O:null;return{image:le.url,url:le.url,filename:le.filename,prompt:le.prompt??void 0,size:le.size??void 0,quality:le.quality??void 0,provider:le.provider,createdAt:le.createdAt,sessionId:le.sessionId??null,nodeId:le.nodeId??null,clientNodeId:le.clientNodeId??null,kind:X}};x(Y.sessions.map(le=>({sessionId:le.sessionId,label:le.sessionId.slice(0,8),items:le.items.map(W)}))),C(Y.loose.map(W))}catch{}})(),()=>{Z=!0}},[l,v]);const D=J.useMemo(()=>{const Z=m.trim().toLowerCase().normalize("NFC");return Z?s.filter(Y=>(Y.prompt??"").toLowerCase().normalize("NFC").includes(Z)||(Y.filename??"").toLowerCase().normalize("NFC").includes(Z)):s},[s,m]),E=J.useMemo(()=>{const Z=new Map;for(const Y of D){const W=_A(Y.createdAt);Z.has(W)||Z.set(W,[]),Z.get(W).push(Y)}return Array.from(Z.entries())},[D]);J.useEffect(()=>{if(!N)return;const Z=setInterval(()=>{M(Y=>!Y||Date.now()>=Y.expiresAt?null:{...Y})},500);return()=>clearInterval(Z)},[N]);async function z(Z,Y){if(Y.stopPropagation(),!!Z.filename)try{const W=await Tb(Z.filename);d(Z.filename),M({filename:Z.filename,trashId:W.trashId,item:Z,expiresAt:Date.now()+9500})}catch(W){console.error("[gallery] delete failed",W)}}async function G(){if(N)try{await Mb(N.filename,N.trashId),g(N.item)}catch(Z){console.error("[gallery] restore failed",Z)}finally{M(null)}}if(!l)return null;const q=Z=>Z==="earlier"||Z==="today"||Z==="yesterday"||Z==="thisWeek"?n(`gallery.${Z}`):Z,U=(Z,Y,W)=>{const le=f?.image===Z.image;return _.jsxs("div",{className:`gallery__tile-wrap${le?" gallery__tile-wrap--active":""}`,children:[_.jsxs("button",{type:"button",className:`gallery__tile${le?" gallery__tile--active":""}`,onClick:()=>{r(Z),o()},title:Z.prompt??"",children:[_.jsx("img",{src:Z.thumb||Z.image,alt:Z.prompt??n("gallery.imageAltFallback"),loading:"lazy",decoding:"async"}),Z.prompt&&_.jsx("div",{className:"gallery__caption",children:_.jsx("span",{className:"gallery__caption-text",children:Z.prompt})})]}),Z.filename&&_.jsx("button",{type:"button",className:"gallery__delete",onClick:O=>z(Z,O),title:n("gallery.deleteTitle"),"aria-label":n("gallery.deleteAria"),children:"×"})]},`${Y}-${W}-${Z.filename??W}`)},$=v==="session",F=$?b.reduce((Z,Y)=>Z+Y.items.length,0)+w.length:D.length;return _.jsx("div",{className:"gallery-backdrop",onClick:o,role:"presentation",children:_.jsxs("div",{className:"gallery",role:"dialog","aria-modal":"true","aria-label":n("gallery.ariaLabel"),onClick:Z=>Z.stopPropagation(),children:[_.jsxs("div",{className:"gallery__header",children:[_.jsxs("div",{className:"gallery__title-row",children:[_.jsx("div",{className:"gallery__title",children:n("gallery.title")}),_.jsxs("div",{className:"gallery__meta",children:[n("gallery.total",{n:F}),m?n("gallery.totalFiltered",{n:s.length}):""]}),_.jsxs("div",{className:"gallery__group-toggle",role:"tablist","aria-label":n("gallery.sortByAria"),children:[_.jsx("button",{type:"button",role:"tab","aria-selected":v==="date",className:v==="date"?"active":"",onClick:()=>y("date"),children:n("gallery.sortByDate")}),_.jsx("button",{type:"button",role:"tab","aria-selected":v==="session",className:v==="session"?"active":"",onClick:()=>y("session"),children:n("gallery.sortBySession")})]})]}),_.jsx("input",{type:"text",className:"gallery__search",placeholder:n($?"gallery.searchDisabledPlaceholder":"gallery.searchPlaceholder"),value:m,onChange:Z=>h(Z.target.value),autoFocus:!0,disabled:$}),_.jsx("button",{type:"button",className:"gallery__close",onClick:o,"aria-label":n("gallery.closeAria"),title:n("gallery.closeTitle"),children:"×"})]}),_.jsx("div",{className:"gallery__scroll",children:$?_.jsxs(_.Fragment,{children:[b.map(Z=>_.jsxs("section",{className:"gallery__group",children:[_.jsxs("header",{className:"gallery__group-header",children:[_.jsx("span",{className:"gallery__group-label",children:n("gallery.sessionLabel",{name:Z.label})}),_.jsx("span",{className:"gallery__group-count",children:Z.items.length})]}),_.jsx("div",{className:"gallery__grid",children:Z.items.map((Y,W)=>U(Y,Z.sessionId,W))})]},Z.sessionId)),w.length>0&&_.jsxs("section",{className:"gallery__group",children:[_.jsxs("header",{className:"gallery__group-header",children:[_.jsx("span",{className:"gallery__group-label",children:n("gallery.standalone")}),_.jsx("span",{className:"gallery__group-count",children:w.length})]}),_.jsx("div",{className:"gallery__grid",children:w.map((Z,Y)=>U(Z,"loose",Y))})]}),b.length===0&&w.length===0&&_.jsx("div",{className:"gallery__empty",children:n("gallery.emptySessions")})]}):D.length===0?_.jsx("div",{className:"gallery__empty",children:s.length===0?n("gallery.emptyAll"):n("gallery.noResults")}):E.map(([Z,Y])=>_.jsxs("section",{className:"gallery__group",children:[_.jsxs("header",{className:"gallery__group-header",children:[_.jsx("span",{className:"gallery__group-label",children:q(Z)}),_.jsx("span",{className:"gallery__group-count",children:Y.length})]}),_.jsx("div",{className:"gallery__grid",children:Y.map((W,le)=>U(W,Z,le))})]},Z))}),N&&_.jsxs("div",{className:"gallery__undo",children:[_.jsx("span",{children:n("gallery.deleted",{filename:N.filename})}),_.jsx("button",{type:"button",onClick:G,children:n("gallery.undo")}),_.jsx("span",{className:"gallery__undo-timer",children:n("gallery.secondsSuffix",{n:Math.max(0,Math.ceil((N.expiresAt-Date.now())/1e3))})})]})]})})}function wA(){const n=de(f=>f.hydrateHistory),l=de(f=>f.loadSessions),o=de(f=>f.startInFlightPolling),s=de(f=>f.reconcileInflight),r=de(f=>f.syncFromStorage);return de(f=>f.uiMode),J.useEffect(()=>{n(),l(),s(),o()},[n,l,s,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=()=>{$S(de.getState)};return window.addEventListener("beforeunload",f),document.addEventListener("visibilitychange",f),()=>{window.removeEventListener("beforeunload",f),document.removeEventListener("visibilitychange",f)}},[]),_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"app",children:[_.jsx(sx,{}),_.jsx(ux,{}),_.jsx(SA,{})]}),_.jsx(xA,{}),_.jsx(EA,{})]})}vb.createRoot(document.getElementById("root")).render(_.jsx(J.StrictMode,{children:_.jsx(wA,{})}));
16
- //# sourceMappingURL=index-BIwLnT0j.js.map