emviz 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,166 @@
1
+ (function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))a(r);new MutationObserver(r=>{for(const u of r)if(u.type==="childList")for(const c of u.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function s(r){const u={};return r.integrity&&(u.integrity=r.integrity),r.referrerPolicy&&(u.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?u.credentials="include":r.crossOrigin==="anonymous"?u.credentials="omit":u.credentials="same-origin",u}function a(r){if(r.ep)return;r.ep=!0;const u=s(r);fetch(r.href,u)}})();function cv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var _d={exports:{}},Ka={};var Ry;function Pw(){if(Ry)return Ka;Ry=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function s(a,r,u){var c=null;if(u!==void 0&&(c=""+u),r.key!==void 0&&(c=""+r.key),"key"in r){u={};for(var m in r)m!=="key"&&(u[m]=r[m])}else u=r;return r=u.ref,{$$typeof:t,type:a,key:c,ref:r!==void 0?r:null,props:u}}return Ka.Fragment=i,Ka.jsx=s,Ka.jsxs=s,Ka}var By;function ex(){return By||(By=1,_d.exports=Pw()),_d.exports}var D=ex(),Nd={exports:{}},we={};var ky;function tx(){if(ky)return we;ky=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),p=Symbol.for("react.activity"),y=Symbol.iterator;function w(C){return C===null||typeof C!="object"?null:(C=y&&C[y]||C["@@iterator"],typeof C=="function"?C:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,_={};function E(C,$,P){this.props=C,this.context=$,this.refs=_,this.updater=P||x}E.prototype.isReactComponent={},E.prototype.setState=function(C,$){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,$,"setState")},E.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function O(){}O.prototype=E.prototype;function N(C,$,P){this.props=C,this.context=$,this.refs=_,this.updater=P||x}var M=N.prototype=new O;M.constructor=N,S(M,E.prototype),M.isPureReactComponent=!0;var k=Array.isArray;function L(){}var H={H:null,A:null,T:null,S:null},j=Object.prototype.hasOwnProperty;function Y(C,$,P){var ie=P.ref;return{$$typeof:t,type:C,key:$,ref:ie!==void 0?ie:null,props:P}}function oe(C,$){return Y(C.type,$,C.props)}function K(C){return typeof C=="object"&&C!==null&&C.$$typeof===t}function I(C){var $={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(P){return $[P]})}var ae=/\/+/g;function R(C,$){return typeof C=="object"&&C!==null&&C.key!=null?I(""+C.key):$.toString(36)}function G(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(L,L):(C.status="pending",C.then(function($){C.status==="pending"&&(C.status="fulfilled",C.value=$)},function($){C.status==="pending"&&(C.status="rejected",C.reason=$)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function T(C,$,P,ie,re){var de=typeof C;(de==="undefined"||de==="boolean")&&(C=null);var ue=!1;if(C===null)ue=!0;else switch(de){case"bigint":case"string":case"number":ue=!0;break;case"object":switch(C.$$typeof){case t:case i:ue=!0;break;case v:return ue=C._init,T(ue(C._payload),$,P,ie,re)}}if(ue)return re=re(C),ue=ie===""?"."+R(C,0):ie,k(re)?(P="",ue!=null&&(P=ue.replace(ae,"$&/")+"/"),T(re,$,P,"",function(Se){return Se})):re!=null&&(K(re)&&(re=oe(re,P+(re.key==null||C&&C.key===re.key?"":(""+re.key).replace(ae,"$&/")+"/")+ue)),$.push(re)),1;ue=0;var ee=ie===""?".":ie+":";if(k(C))for(var ce=0;ce<C.length;ce++)ie=C[ce],de=ee+R(ie,ce),ue+=T(ie,$,P,de,re);else if(ce=w(C),typeof ce=="function")for(C=ce.call(C),ce=0;!(ie=C.next()).done;)ie=ie.value,de=ee+R(ie,ce++),ue+=T(ie,$,P,de,re);else if(de==="object"){if(typeof C.then=="function")return T(G(C),$,P,ie,re);throw $=String(C),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return ue}function z(C,$,P){if(C==null)return C;var ie=[],re=0;return T(C,ie,"","",function(de){return $.call(P,de,re++)}),ie}function q(C){if(C._status===-1){var $=C._result;$=$(),$.then(function(P){(C._status===0||C._status===-1)&&(C._status=1,C._result=P)},function(P){(C._status===0||C._status===-1)&&(C._status=2,C._result=P)}),C._status===-1&&(C._status=0,C._result=$)}if(C._status===1)return C._result.default;throw C._result}var X=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},te={map:z,forEach:function(C,$,P){z(C,function(){$.apply(this,arguments)},P)},count:function(C){var $=0;return z(C,function(){$++}),$},toArray:function(C){return z(C,function($){return $})||[]},only:function(C){if(!K(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return we.Activity=p,we.Children=te,we.Component=E,we.Fragment=s,we.Profiler=r,we.PureComponent=N,we.StrictMode=a,we.Suspense=h,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=H,we.__COMPILER_RUNTIME={__proto__:null,c:function(C){return H.H.useMemoCache(C)}},we.cache=function(C){return function(){return C.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(C,$,P){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var ie=S({},C.props),re=C.key;if($!=null)for(de in $.key!==void 0&&(re=""+$.key),$)!j.call($,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&$.ref===void 0||(ie[de]=$[de]);var de=arguments.length-2;if(de===1)ie.children=P;else if(1<de){for(var ue=Array(de),ee=0;ee<de;ee++)ue[ee]=arguments[ee+2];ie.children=ue}return Y(C.type,re,ie)},we.createContext=function(C){return C={$$typeof:c,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:u,_context:C},C},we.createElement=function(C,$,P){var ie,re={},de=null;if($!=null)for(ie in $.key!==void 0&&(de=""+$.key),$)j.call($,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(re[ie]=$[ie]);var ue=arguments.length-2;if(ue===1)re.children=P;else if(1<ue){for(var ee=Array(ue),ce=0;ce<ue;ce++)ee[ce]=arguments[ce+2];re.children=ee}if(C&&C.defaultProps)for(ie in ue=C.defaultProps,ue)re[ie]===void 0&&(re[ie]=ue[ie]);return Y(C,de,re)},we.createRef=function(){return{current:null}},we.forwardRef=function(C){return{$$typeof:m,render:C}},we.isValidElement=K,we.lazy=function(C){return{$$typeof:v,_payload:{_status:-1,_result:C},_init:q}},we.memo=function(C,$){return{$$typeof:g,type:C,compare:$===void 0?null:$}},we.startTransition=function(C){var $=H.T,P={};H.T=P;try{var ie=C(),re=H.S;re!==null&&re(P,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(L,X)}catch(de){X(de)}finally{$!==null&&P.types!==null&&($.types=P.types),H.T=$}},we.unstable_useCacheRefresh=function(){return H.H.useCacheRefresh()},we.use=function(C){return H.H.use(C)},we.useActionState=function(C,$,P){return H.H.useActionState(C,$,P)},we.useCallback=function(C,$){return H.H.useCallback(C,$)},we.useContext=function(C){return H.H.useContext(C)},we.useDebugValue=function(){},we.useDeferredValue=function(C,$){return H.H.useDeferredValue(C,$)},we.useEffect=function(C,$){return H.H.useEffect(C,$)},we.useEffectEvent=function(C){return H.H.useEffectEvent(C)},we.useId=function(){return H.H.useId()},we.useImperativeHandle=function(C,$,P){return H.H.useImperativeHandle(C,$,P)},we.useInsertionEffect=function(C,$){return H.H.useInsertionEffect(C,$)},we.useLayoutEffect=function(C,$){return H.H.useLayoutEffect(C,$)},we.useMemo=function(C,$){return H.H.useMemo(C,$)},we.useOptimistic=function(C,$){return H.H.useOptimistic(C,$)},we.useReducer=function(C,$,P){return H.H.useReducer(C,$,P)},we.useRef=function(C){return H.H.useRef(C)},we.useState=function(C){return H.H.useState(C)},we.useSyncExternalStore=function(C,$,P){return H.H.useSyncExternalStore(C,$,P)},we.useTransition=function(){return H.H.useTransition()},we.version="19.2.7",we}var Hy;function vo(){return Hy||(Hy=1,Nd.exports=tx()),Nd.exports}var F=vo();const fv=cv(F);var Ad={exports:{}},Za={},Td={exports:{}},Md={};var jy;function nx(){return jy||(jy=1,(function(t){function i(T,z){var q=T.length;T.push(z);e:for(;0<q;){var X=q-1>>>1,te=T[X];if(0<r(te,z))T[X]=z,T[q]=te,q=X;else break e}}function s(T){return T.length===0?null:T[0]}function a(T){if(T.length===0)return null;var z=T[0],q=T.pop();if(q!==z){T[0]=q;e:for(var X=0,te=T.length,C=te>>>1;X<C;){var $=2*(X+1)-1,P=T[$],ie=$+1,re=T[ie];if(0>r(P,q))ie<te&&0>r(re,P)?(T[X]=re,T[ie]=q,X=ie):(T[X]=P,T[$]=q,X=$);else if(ie<te&&0>r(re,q))T[X]=re,T[ie]=q,X=ie;else break e}}return z}function r(T,z){var q=T.sortIndex-z.sortIndex;return q!==0?q:T.id-z.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;t.unstable_now=function(){return u.now()}}else{var c=Date,m=c.now();t.unstable_now=function(){return c.now()-m}}var h=[],g=[],v=1,p=null,y=3,w=!1,x=!1,S=!1,_=!1,E=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function M(T){for(var z=s(g);z!==null;){if(z.callback===null)a(g);else if(z.startTime<=T)a(g),z.sortIndex=z.expirationTime,i(h,z);else break;z=s(g)}}function k(T){if(S=!1,M(T),!x)if(s(h)!==null)x=!0,L||(L=!0,I());else{var z=s(g);z!==null&&G(k,z.startTime-T)}}var L=!1,H=-1,j=5,Y=-1;function oe(){return _?!0:!(t.unstable_now()-Y<j)}function K(){if(_=!1,L){var T=t.unstable_now();Y=T;var z=!0;try{e:{x=!1,S&&(S=!1,O(H),H=-1),w=!0;var q=y;try{t:{for(M(T),p=s(h);p!==null&&!(p.expirationTime>T&&oe());){var X=p.callback;if(typeof X=="function"){p.callback=null,y=p.priorityLevel;var te=X(p.expirationTime<=T);if(T=t.unstable_now(),typeof te=="function"){p.callback=te,M(T),z=!0;break t}p===s(h)&&a(h),M(T)}else a(h);p=s(h)}if(p!==null)z=!0;else{var C=s(g);C!==null&&G(k,C.startTime-T),z=!1}}break e}finally{p=null,y=q,w=!1}z=void 0}}finally{z?I():L=!1}}}var I;if(typeof N=="function")I=function(){N(K)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,R=ae.port2;ae.port1.onmessage=K,I=function(){R.postMessage(null)}}else I=function(){E(K,0)};function G(T,z){H=E(function(){T(t.unstable_now())},z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(T){T.callback=null},t.unstable_forceFrameRate=function(T){0>T||125<T?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):j=0<T?Math.floor(1e3/T):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(T){switch(y){case 1:case 2:case 3:var z=3;break;default:z=y}var q=y;y=z;try{return T()}finally{y=q}},t.unstable_requestPaint=function(){_=!0},t.unstable_runWithPriority=function(T,z){switch(T){case 1:case 2:case 3:case 4:case 5:break;default:T=3}var q=y;y=T;try{return z()}finally{y=q}},t.unstable_scheduleCallback=function(T,z,q){var X=t.unstable_now();switch(typeof q=="object"&&q!==null?(q=q.delay,q=typeof q=="number"&&0<q?X+q:X):q=X,T){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=q+te,T={id:v++,callback:z,priorityLevel:T,startTime:q,expirationTime:te,sortIndex:-1},q>X?(T.sortIndex=q,i(g,T),s(h)===null&&T===s(g)&&(S?(O(H),H=-1):S=!0,G(k,q-X))):(T.sortIndex=te,i(h,T),x||w||(x=!0,L||(L=!0,I()))),T},t.unstable_shouldYield=oe,t.unstable_wrapCallback=function(T){var z=y;return function(){var q=y;y=z;try{return T.apply(this,arguments)}finally{y=q}}}})(Md)),Md}var $y;function ix(){return $y||($y=1,Td.exports=nx()),Td.exports}var Cd={exports:{}},bt={};var Uy;function sx(){if(Uy)return bt;Uy=1;var t=vo();function i(h){var g="https://react.dev/errors/"+h;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)g+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+h+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(){}var a={d:{f:s,r:function(){throw Error(i(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},r=Symbol.for("react.portal");function u(h,g,v){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:p==null?null:""+p,children:h,containerInfo:g,implementation:v}}var c=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(h,g){if(h==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return bt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,bt.createPortal=function(h,g){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(i(299));return u(h,g,null,v)},bt.flushSync=function(h){var g=c.T,v=a.p;try{if(c.T=null,a.p=2,h)return h()}finally{c.T=g,a.p=v,a.d.f()}},bt.preconnect=function(h,g){typeof h=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,a.d.C(h,g))},bt.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},bt.preinit=function(h,g){if(typeof h=="string"&&g&&typeof g.as=="string"){var v=g.as,p=m(v,g.crossOrigin),y=typeof g.integrity=="string"?g.integrity:void 0,w=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;v==="style"?a.d.S(h,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:p,integrity:y,fetchPriority:w}):v==="script"&&a.d.X(h,{crossOrigin:p,integrity:y,fetchPriority:w,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},bt.preinitModule=function(h,g){if(typeof h=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var v=m(g.as,g.crossOrigin);a.d.M(h,{crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&a.d.M(h)},bt.preload=function(h,g){if(typeof h=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var v=g.as,p=m(v,g.crossOrigin);a.d.L(h,v,{crossOrigin:p,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},bt.preloadModule=function(h,g){if(typeof h=="string")if(g){var v=m(g.as,g.crossOrigin);a.d.m(h,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:v,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else a.d.m(h)},bt.requestFormReset=function(h){a.d.r(h)},bt.unstable_batchedUpdates=function(h,g){return h(g)},bt.useFormState=function(h,g,v){return c.H.useFormState(h,g,v)},bt.useFormStatus=function(){return c.H.useHostTransitionStatus()},bt.version="19.2.7",bt}var qy;function dv(){if(qy)return Cd.exports;qy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(i){console.error(i)}}return t(),Cd.exports=sx(),Cd.exports}var Vy;function lx(){if(Vy)return Za;Vy=1;var t=ix(),i=vo(),s=dv();function a(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+n+" 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 u(e){var n=e,l=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(l=n.return),e=n.return;while(e)}return n.tag===3?l:null}function c(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function m(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function h(e){if(u(e)!==e)throw Error(a(188))}function g(e){var n=e.alternate;if(!n){if(n=u(e),n===null)throw Error(a(188));return n!==e?null:e}for(var l=e,o=n;;){var f=l.return;if(f===null)break;var d=f.alternate;if(d===null){if(o=f.return,o!==null){l=o;continue}break}if(f.child===d.child){for(d=f.child;d;){if(d===l)return h(f),e;if(d===o)return h(f),n;d=d.sibling}throw Error(a(188))}if(l.return!==o.return)l=f,o=d;else{for(var b=!1,A=f.child;A;){if(A===l){b=!0,l=f,o=d;break}if(A===o){b=!0,o=f,l=d;break}A=A.sibling}if(!b){for(A=d.child;A;){if(A===l){b=!0,l=d,o=f;break}if(A===o){b=!0,o=d,l=f;break}A=A.sibling}if(!b)throw Error(a(189))}}if(l.alternate!==o)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?e:n}function v(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=v(e),n!==null)return n;e=e.sibling}return null}var p=Object.assign,y=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),S=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),O=Symbol.for("react.consumer"),N=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),L=Symbol.for("react.suspense_list"),H=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),Y=Symbol.for("react.activity"),oe=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function I(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var ae=Symbol.for("react.client.reference");function R(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case S:return"Fragment";case E:return"Profiler";case _:return"StrictMode";case k:return"Suspense";case L:return"SuspenseList";case Y:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case x:return"Portal";case N:return e.displayName||"Context";case O:return(e._context.displayName||"Context")+".Consumer";case M:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case H:return n=e.displayName||null,n!==null?n:R(e.type)||"Memo";case j:n=e._payload,e=e._init;try{return R(e(n))}catch{}}return null}var G=Array.isArray,T=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,q={pending:!1,data:null,method:null,action:null},X=[],te=-1;function C(e){return{current:e}}function $(e){0>te||(e.current=X[te],X[te]=null,te--)}function P(e,n){te++,X[te]=e.current,e.current=n}var ie=C(null),re=C(null),de=C(null),ue=C(null);function ee(e,n){switch(P(de,n),P(re,e),P(ie,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?iy(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=iy(n),e=sy(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(ie),P(ie,e)}function ce(){$(ie),$(re),$(de)}function Se(e){e.memoizedState!==null&&P(ue,e);var n=ie.current,l=sy(n,e.type);n!==l&&(P(re,e),P(ie,l))}function be(e){re.current===e&&($(ie),$(re)),ue.current===e&&($(ue),Va._currentValue=q)}var ge,ye;function Ee(e){if(ge===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);ge=n&&n[1]||"",ye=-1<l.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+ge+e+ye}var De=!1;function Ge(e,n){if(!e||De)return"";De=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var o={DetermineComponentFrameRoot:function(){try{if(n){var le=function(){throw Error()};if(Object.defineProperty(le.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(le,[])}catch(W){var J=W}Reflect.construct(e,[],le)}else{try{le.call()}catch(W){J=W}e.call(le.prototype)}}else{try{throw Error()}catch(W){J=W}(le=e())&&typeof le.catch=="function"&&le.catch(function(){})}}catch(W){if(W&&J&&typeof W.stack=="string")return[W.stack,J.stack]}return[null,null]}};o.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(o.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(o.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=o.DetermineComponentFrameRoot(),b=d[0],A=d[1];if(b&&A){var B=b.split(`
4
+ `),Q=A.split(`
5
+ `);for(f=o=0;o<B.length&&!B[o].includes("DetermineComponentFrameRoot");)o++;for(;f<Q.length&&!Q[f].includes("DetermineComponentFrameRoot");)f++;if(o===B.length||f===Q.length)for(o=B.length-1,f=Q.length-1;1<=o&&0<=f&&B[o]!==Q[f];)f--;for(;1<=o&&0<=f;o--,f--)if(B[o]!==Q[f]){if(o!==1||f!==1)do if(o--,f--,0>f||B[o]!==Q[f]){var ne=`
6
+ `+B[o].replace(" at new "," at ");return e.displayName&&ne.includes("<anonymous>")&&(ne=ne.replace("<anonymous>",e.displayName)),ne}while(1<=o&&0<=f);break}}}finally{De=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Ee(l):""}function yt(e,n){switch(e.tag){case 26:case 27:case 5:return Ee(e.type);case 16:return Ee("Lazy");case 13:return e.child!==n&&n!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Ge(e.type,!1);case 11:return Ge(e.type.render,!1);case 1:return Ge(e.type,!0);case 31:return Ee("Activity");default:return""}}function It(e){try{var n="",l=null;do n+=yt(e,l),l=e,e=e.return;while(e);return n}catch(o){return`
7
+ Error generating stack: `+o.message+`
8
+ `+o.stack}}var Nt=Object.prototype.hasOwnProperty,At=t.unstable_scheduleCallback,Ht=t.unstable_cancelCallback,Yi=t.unstable_shouldYield,Rn=t.unstable_requestPaint,tt=t.unstable_now,jt=t.unstable_getCurrentPriorityLevel,Jt=t.unstable_ImmediatePriority,Ft=t.unstable_UserBlockingPriority,Wt=t.unstable_NormalPriority,oc=t.unstable_LowPriority,Ms=t.unstable_IdlePriority,rc=t.log,uc=t.unstable_setDisableYieldValue,Gi=null,wt=null;function En(e){if(typeof rc=="function"&&uc(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(Gi,e)}catch{}}var xt=Math.clz32?Math.clz32:dc,cc=Math.log,fc=Math.LN2;function dc(e){return e>>>=0,e===0?32:31-(cc(e)/fc|0)|0}var Cs=256,Os=262144,zs=4194304;function Bn(e){var n=e&42;if(n!==0)return n;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 Ds(e,n,l){var o=e.pendingLanes;if(o===0)return 0;var f=0,d=e.suspendedLanes,b=e.pingedLanes;e=e.warmLanes;var A=o&134217727;return A!==0?(o=A&~d,o!==0?f=Bn(o):(b&=A,b!==0?f=Bn(b):l||(l=A&~e,l!==0&&(f=Bn(l))))):(A=o&~d,A!==0?f=Bn(A):b!==0?f=Bn(b):l||(l=o&~e,l!==0&&(f=Bn(l)))),f===0?0:n!==0&&n!==f&&(n&d)===0&&(d=f&-f,l=n&-n,d>=l||d===32&&(l&4194048)!==0)?n:f}function Xi(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function hc(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Mo(){var e=zs;return zs<<=1,(zs&62914560)===0&&(zs=4194304),e}function Il(e){for(var n=[],l=0;31>l;l++)n.push(e);return n}function Ki(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function mc(e,n,l,o,f,d){var b=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var A=e.entanglements,B=e.expirationTimes,Q=e.hiddenUpdates;for(l=b&~l;0<l;){var ne=31-xt(l),le=1<<ne;A[ne]=0,B[ne]=-1;var J=Q[ne];if(J!==null)for(Q[ne]=null,ne=0;ne<J.length;ne++){var W=J[ne];W!==null&&(W.lane&=-536870913)}l&=~le}o!==0&&Co(e,o,0),d!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=d&~(b&~n))}function Co(e,n,l){e.pendingLanes|=n,e.suspendedLanes&=~n;var o=31-xt(n);e.entangledLanes|=n,e.entanglements[o]=e.entanglements[o]|1073741824|l&261930}function Oo(e,n){var l=e.entangledLanes|=n;for(e=e.entanglements;l;){var o=31-xt(l),f=1<<o;f&n|e[o]&n&&(e[o]|=n),l&=~f}}function zo(e,n){var l=n&-n;return l=(l&42)!==0?1:Jl(l),(l&(e.suspendedLanes|n))!==0?0:l}function Jl(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 Fl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Do(){var e=z.p;return e!==0?e:(e=window.event,e===void 0?32:Ty(e.type))}function Lo(e,n){var l=z.p;try{return z.p=e,n()}finally{z.p=l}}var _n=Math.random().toString(36).slice(2),ct="__reactFiber$"+_n,vt="__reactProps$"+_n,kn="__reactContainer$"+_n,Ls="__reactEvents$"+_n,Ro="__reactListeners$"+_n,gc="__reactHandles$"+_n,Bo="__reactResources$"+_n,Zi="__reactMarker$"+_n;function Wl(e){delete e[ct],delete e[vt],delete e[Ls],delete e[Ro],delete e[gc]}function oi(e){var n=e[ct];if(n)return n;for(var l=e.parentNode;l;){if(n=l[kn]||l[ct]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(e=fy(e);e!==null;){if(l=e[ct])return l;e=fy(e)}return n}e=l,l=e.parentNode}return null}function ri(e){if(e=e[ct]||e[kn]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function ui(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function ci(e){var n=e[Bo];return n||(n=e[Bo]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function st(e){e[Zi]=!0}var ko=new Set,Ho={};function Hn(e,n){fi(e,n),fi(e+"Capture",n)}function fi(e,n){for(Ho[e]=n,e=0;e<n.length;e++)ko.add(n[e])}var pc=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]*$"),jo={},Pl={};function yc(e){return Nt.call(Pl,e)?!0:Nt.call(jo,e)?!1:pc.test(e)?Pl[e]=!0:(jo[e]=!0,!1)}function Rs(e,n,l){if(yc(n))if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var o=n.toLowerCase().slice(0,5);if(o!=="data-"&&o!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+l)}}function Bs(e,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+l)}}function fn(e,n,l,o){if(o===null)e.removeAttribute(l);else{switch(typeof o){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(n,l,""+o)}}function Tt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $o(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function vc(e,n,l){var o=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var f=o.get,d=o.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return f.call(this)},set:function(b){l=""+b,d.call(this,b)}}),Object.defineProperty(e,n,{enumerable:o.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function ea(e){if(!e._valueTracker){var n=$o(e)?"checked":"value";e._valueTracker=vc(e,n,""+e[n])}}function ta(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),o="";return e&&(o=$o(e)?e.checked?"true":"false":e.value),e=o,e!==l?(n.setValue(e),!0):!1}function ks(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 Uo=/[\n"\\]/g;function Mt(e){return e.replace(Uo,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function na(e,n,l,o,f,d,b,A){e.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.type=b:e.removeAttribute("type"),n!=null?b==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Tt(n)):e.value!==""+Tt(n)&&(e.value=""+Tt(n)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),n!=null?ia(e,b,Tt(n)):l!=null?ia(e,b,Tt(l)):o!=null&&e.removeAttribute("value"),f==null&&d!=null&&(e.defaultChecked=!!d),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?e.name=""+Tt(A):e.removeAttribute("name")}function Hs(e,n,l,o,f,d,b,A){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),n!=null||l!=null){if(!(d!=="submit"&&d!=="reset"||n!=null)){ea(e);return}l=l!=null?""+Tt(l):"",n=n!=null?""+Tt(n):l,A||n===e.value||(e.value=n),e.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=A?e.checked:!!o,e.defaultChecked=!!o,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.name=b),ea(e)}function ia(e,n,l){n==="number"&&ks(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function di(e,n,l,o){if(e=e.options,n){n={};for(var f=0;f<l.length;f++)n["$"+l[f]]=!0;for(l=0;l<e.length;l++)f=n.hasOwnProperty("$"+e[l].value),e[l].selected!==f&&(e[l].selected=f),f&&o&&(e[l].defaultSelected=!0)}else{for(l=""+Tt(l),n=null,f=0;f<e.length;f++){if(e[f].value===l){e[f].selected=!0,o&&(e[f].defaultSelected=!0);return}n!==null||e[f].disabled||(n=e[f])}n!==null&&(n.selected=!0)}}function sa(e,n,l){if(n!=null&&(n=""+Tt(n),n!==e.value&&(e.value=n),l==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=l!=null?""+Tt(l):""}function Ph(e,n,l,o){if(n==null){if(o!=null){if(l!=null)throw Error(a(92));if(G(o)){if(1<o.length)throw Error(a(93));o=o[0]}l=o}l==null&&(l=""),n=l}l=Tt(n),e.defaultValue=l,o=e.textContent,o===l&&o!==""&&o!==null&&(e.value=o),ea(e)}function js(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var Qb=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 em(e,n,l){var o=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?o?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":o?e.setProperty(n,l):typeof l!="number"||l===0||Qb.has(n)?n==="float"?e.cssFloat=l:e[n]=(""+l).trim():e[n]=l+"px"}function tm(e,n,l){if(n!=null&&typeof n!="object")throw Error(a(62));if(e=e.style,l!=null){for(var o in l)!l.hasOwnProperty(o)||n!=null&&n.hasOwnProperty(o)||(o.indexOf("--")===0?e.setProperty(o,""):o==="float"?e.cssFloat="":e[o]="");for(var f in n)o=n[f],n.hasOwnProperty(f)&&l[f]!==o&&em(e,f,o)}else for(var d in n)n.hasOwnProperty(d)&&em(e,d,n[d])}function bc(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 Ib=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"]]),Jb=/^[\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 qo(e){return Jb.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function jn(){}var Sc=null;function wc(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $s=null,Us=null;function nm(e){var n=ri(e);if(n&&(e=n.stateNode)){var l=e[vt]||null;e:switch(e=n.stateNode,n.type){case"input":if(na(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Mt(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var o=l[n];if(o!==e&&o.form===e.form){var f=o[vt]||null;if(!f)throw Error(a(90));na(o,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(n=0;n<l.length;n++)o=l[n],o.form===e.form&&ta(o)}break e;case"textarea":sa(e,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&di(e,!!l.multiple,n,!1)}}}var xc=!1;function im(e,n,l){if(xc)return e(n,l);xc=!0;try{var o=e(n);return o}finally{if(xc=!1,($s!==null||Us!==null)&&(Mr(),$s&&(n=$s,e=Us,Us=$s=null,nm(n),e)))for(n=0;n<e.length;n++)nm(e[n])}}function la(e,n){var l=e.stateNode;if(l===null)return null;var o=l[vt]||null;if(o===null)return null;l=o[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(o=!o.disabled)||(e=e.type,o=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!o;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(a(231,n,typeof l));return l}var $n=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ec=!1;if($n)try{var aa={};Object.defineProperty(aa,"passive",{get:function(){Ec=!0}}),window.addEventListener("test",aa,aa),window.removeEventListener("test",aa,aa)}catch{Ec=!1}var hi=null,_c=null,Vo=null;function sm(){if(Vo)return Vo;var e,n=_c,l=n.length,o,f="value"in hi?hi.value:hi.textContent,d=f.length;for(e=0;e<l&&n[e]===f[e];e++);var b=l-e;for(o=1;o<=b&&n[l-o]===f[d-o];o++);return Vo=f.slice(e,1<o?1-o:void 0)}function Yo(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function Go(){return!0}function lm(){return!1}function Ct(e){function n(l,o,f,d,b){this._reactName=l,this._targetInst=f,this.type=o,this.nativeEvent=d,this.target=b,this.currentTarget=null;for(var A in e)e.hasOwnProperty(A)&&(l=e[A],this[A]=l?l(d):d[A]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Go:lm,this.isPropagationStopped=lm,this}return p(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Go)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Go)},persist:function(){},isPersistent:Go}),n}var Qi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Xo=Ct(Qi),oa=p({},Qi,{view:0,detail:0}),Fb=Ct(oa),Nc,Ac,ra,Ko=p({},oa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Mc,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!==ra&&(ra&&e.type==="mousemove"?(Nc=e.screenX-ra.screenX,Ac=e.screenY-ra.screenY):Ac=Nc=0,ra=e),Nc)},movementY:function(e){return"movementY"in e?e.movementY:Ac}}),am=Ct(Ko),Wb=p({},Ko,{dataTransfer:0}),Pb=Ct(Wb),eS=p({},oa,{relatedTarget:0}),Tc=Ct(eS),tS=p({},Qi,{animationName:0,elapsedTime:0,pseudoElement:0}),nS=Ct(tS),iS=p({},Qi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),sS=Ct(iS),lS=p({},Qi,{data:0}),om=Ct(lS),aS={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},oS={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"},rS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function uS(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=rS[e])?!!n[e]:!1}function Mc(){return uS}var cS=p({},oa,{key:function(e){if(e.key){var n=aS[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Yo(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?oS[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Mc,charCode:function(e){return e.type==="keypress"?Yo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Yo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),fS=Ct(cS),dS=p({},Ko,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),rm=Ct(dS),hS=p({},oa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Mc}),mS=Ct(hS),gS=p({},Qi,{propertyName:0,elapsedTime:0,pseudoElement:0}),pS=Ct(gS),yS=p({},Ko,{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}),vS=Ct(yS),bS=p({},Qi,{newState:0,oldState:0}),SS=Ct(bS),wS=[9,13,27,32],Cc=$n&&"CompositionEvent"in window,ua=null;$n&&"documentMode"in document&&(ua=document.documentMode);var xS=$n&&"TextEvent"in window&&!ua,um=$n&&(!Cc||ua&&8<ua&&11>=ua),cm=" ",fm=!1;function dm(e,n){switch(e){case"keyup":return wS.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hm(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var qs=!1;function ES(e,n){switch(e){case"compositionend":return hm(n);case"keypress":return n.which!==32?null:(fm=!0,cm);case"textInput":return e=n.data,e===cm&&fm?null:e;default:return null}}function _S(e,n){if(qs)return e==="compositionend"||!Cc&&dm(e,n)?(e=sm(),Vo=_c=hi=null,qs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return um&&n.locale!=="ko"?null:n.data;default:return null}}var NS={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 mm(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!NS[e.type]:n==="textarea"}function gm(e,n,l,o){$s?Us?Us.push(o):Us=[o]:$s=o,n=Br(n,"onChange"),0<n.length&&(l=new Xo("onChange","change",null,l,o),e.push({event:l,listeners:n}))}var ca=null,fa=null;function AS(e){Fp(e,0)}function Zo(e){var n=ui(e);if(ta(n))return e}function pm(e,n){if(e==="change")return n}var ym=!1;if($n){var Oc;if($n){var zc="oninput"in document;if(!zc){var vm=document.createElement("div");vm.setAttribute("oninput","return;"),zc=typeof vm.oninput=="function"}Oc=zc}else Oc=!1;ym=Oc&&(!document.documentMode||9<document.documentMode)}function bm(){ca&&(ca.detachEvent("onpropertychange",Sm),fa=ca=null)}function Sm(e){if(e.propertyName==="value"&&Zo(fa)){var n=[];gm(n,fa,e,wc(e)),im(AS,n)}}function TS(e,n,l){e==="focusin"?(bm(),ca=n,fa=l,ca.attachEvent("onpropertychange",Sm)):e==="focusout"&&bm()}function MS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Zo(fa)}function CS(e,n){if(e==="click")return Zo(n)}function OS(e,n){if(e==="input"||e==="change")return Zo(n)}function zS(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var $t=typeof Object.is=="function"?Object.is:zS;function da(e,n){if($t(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var l=Object.keys(e),o=Object.keys(n);if(l.length!==o.length)return!1;for(o=0;o<l.length;o++){var f=l[o];if(!Nt.call(n,f)||!$t(e[f],n[f]))return!1}return!0}function wm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function xm(e,n){var l=wm(e);e=0;for(var o;l;){if(l.nodeType===3){if(o=e+l.textContent.length,e<=n&&o>=n)return{node:l,offset:n-e};e=o}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=wm(l)}}function Em(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Em(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function _m(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=ks(e.document);n instanceof e.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)e=n.contentWindow;else break;n=ks(e.document)}return n}function Dc(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var DS=$n&&"documentMode"in document&&11>=document.documentMode,Vs=null,Lc=null,ha=null,Rc=!1;function Nm(e,n,l){var o=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Rc||Vs==null||Vs!==ks(o)||(o=Vs,"selectionStart"in o&&Dc(o)?o={start:o.selectionStart,end:o.selectionEnd}:(o=(o.ownerDocument&&o.ownerDocument.defaultView||window).getSelection(),o={anchorNode:o.anchorNode,anchorOffset:o.anchorOffset,focusNode:o.focusNode,focusOffset:o.focusOffset}),ha&&da(ha,o)||(ha=o,o=Br(Lc,"onSelect"),0<o.length&&(n=new Xo("onSelect","select",null,n,l),e.push({event:n,listeners:o}),n.target=Vs)))}function Ii(e,n){var l={};return l[e.toLowerCase()]=n.toLowerCase(),l["Webkit"+e]="webkit"+n,l["Moz"+e]="moz"+n,l}var Ys={animationend:Ii("Animation","AnimationEnd"),animationiteration:Ii("Animation","AnimationIteration"),animationstart:Ii("Animation","AnimationStart"),transitionrun:Ii("Transition","TransitionRun"),transitionstart:Ii("Transition","TransitionStart"),transitioncancel:Ii("Transition","TransitionCancel"),transitionend:Ii("Transition","TransitionEnd")},Bc={},Am={};$n&&(Am=document.createElement("div").style,"AnimationEvent"in window||(delete Ys.animationend.animation,delete Ys.animationiteration.animation,delete Ys.animationstart.animation),"TransitionEvent"in window||delete Ys.transitionend.transition);function Ji(e){if(Bc[e])return Bc[e];if(!Ys[e])return e;var n=Ys[e],l;for(l in n)if(n.hasOwnProperty(l)&&l in Am)return Bc[e]=n[l];return e}var Tm=Ji("animationend"),Mm=Ji("animationiteration"),Cm=Ji("animationstart"),LS=Ji("transitionrun"),RS=Ji("transitionstart"),BS=Ji("transitioncancel"),Om=Ji("transitionend"),zm=new Map,kc="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(" ");kc.push("scrollEnd");function dn(e,n){zm.set(e,n),Hn(n,[e])}var Qo=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=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(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Pt=[],Gs=0,Hc=0;function Io(){for(var e=Gs,n=Hc=Gs=0;n<e;){var l=Pt[n];Pt[n++]=null;var o=Pt[n];Pt[n++]=null;var f=Pt[n];Pt[n++]=null;var d=Pt[n];if(Pt[n++]=null,o!==null&&f!==null){var b=o.pending;b===null?f.next=f:(f.next=b.next,b.next=f),o.pending=f}d!==0&&Dm(l,f,d)}}function Jo(e,n,l,o){Pt[Gs++]=e,Pt[Gs++]=n,Pt[Gs++]=l,Pt[Gs++]=o,Hc|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function jc(e,n,l,o){return Jo(e,n,l,o),Fo(e)}function Fi(e,n){return Jo(e,null,null,n),Fo(e)}function Dm(e,n,l){e.lanes|=l;var o=e.alternate;o!==null&&(o.lanes|=l);for(var f=!1,d=e.return;d!==null;)d.childLanes|=l,o=d.alternate,o!==null&&(o.childLanes|=l),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(f=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,f&&n!==null&&(f=31-xt(l),e=d.hiddenUpdates,o=e[f],o===null?e[f]=[n]:o.push(n),n.lane=l|536870912),d):null}function Fo(e){if(50<Ba)throw Ba=0,Qf=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Xs={};function kS(e,n,l,o){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=o,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ut(e,n,l,o){return new kS(e,n,l,o)}function $c(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Un(e,n){var l=e.alternate;return l===null?(l=Ut(e.tag,n,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=n,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,n=e.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Lm(e,n){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,n=l.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function Wo(e,n,l,o,f,d){var b=0;if(o=e,typeof e=="function")$c(e)&&(b=1);else if(typeof e=="string")b=qw(e,l,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Y:return e=Ut(31,l,n,f),e.elementType=Y,e.lanes=d,e;case S:return Wi(l.children,f,d,n);case _:b=8,f|=24;break;case E:return e=Ut(12,l,n,f|2),e.elementType=E,e.lanes=d,e;case k:return e=Ut(13,l,n,f),e.elementType=k,e.lanes=d,e;case L:return e=Ut(19,l,n,f),e.elementType=L,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case N:b=10;break e;case O:b=9;break e;case M:b=11;break e;case H:b=14;break e;case j:b=16,o=null;break e}b=29,l=Error(a(130,e===null?"null":typeof e,"")),o=null}return n=Ut(b,l,n,f),n.elementType=e,n.type=o,n.lanes=d,n}function Wi(e,n,l,o){return e=Ut(7,e,o,n),e.lanes=l,e}function Uc(e,n,l){return e=Ut(6,e,null,n),e.lanes=l,e}function Rm(e){var n=Ut(18,null,null,0);return n.stateNode=e,n}function qc(e,n,l){return n=Ut(4,e.children!==null?e.children:[],e.key,n),n.lanes=l,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Bm=new WeakMap;function en(e,n){if(typeof e=="object"&&e!==null){var l=Bm.get(e);return l!==void 0?l:(n={value:e,source:n,stack:It(n)},Bm.set(e,n),n)}return{value:e,source:n,stack:It(n)}}var Ks=[],Zs=0,Po=null,ma=0,tn=[],nn=0,mi=null,Nn=1,An="";function qn(e,n){Ks[Zs++]=ma,Ks[Zs++]=Po,Po=e,ma=n}function km(e,n,l){tn[nn++]=Nn,tn[nn++]=An,tn[nn++]=mi,mi=e;var o=Nn;e=An;var f=32-xt(o)-1;o&=~(1<<f),l+=1;var d=32-xt(n)+f;if(30<d){var b=f-f%5;d=(o&(1<<b)-1).toString(32),o>>=b,f-=b,Nn=1<<32-xt(n)+f|l<<f|o,An=d+e}else Nn=1<<d|l<<f|o,An=e}function Vc(e){e.return!==null&&(qn(e,1),km(e,1,0))}function Yc(e){for(;e===Po;)Po=Ks[--Zs],Ks[Zs]=null,ma=Ks[--Zs],Ks[Zs]=null;for(;e===mi;)mi=tn[--nn],tn[nn]=null,An=tn[--nn],tn[nn]=null,Nn=tn[--nn],tn[nn]=null}function Hm(e,n){tn[nn++]=Nn,tn[nn++]=An,tn[nn++]=mi,Nn=n.id,An=n.overflow,mi=e}var ht=null,Xe=null,Oe=!1,gi=null,sn=!1,Gc=Error(a(519));function pi(e){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ga(en(n,e)),Gc}function jm(e){var n=e.stateNode,l=e.type,o=e.memoizedProps;switch(n[ct]=e,n[vt]=o,l){case"dialog":Te("cancel",n),Te("close",n);break;case"iframe":case"object":case"embed":Te("load",n);break;case"video":case"audio":for(l=0;l<Ha.length;l++)Te(Ha[l],n);break;case"source":Te("error",n);break;case"img":case"image":case"link":Te("error",n),Te("load",n);break;case"details":Te("toggle",n);break;case"input":Te("invalid",n),Hs(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Te("invalid",n);break;case"textarea":Te("invalid",n),Ph(n,o.value,o.defaultValue,o.children)}l=o.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||o.suppressHydrationWarning===!0||ty(n.textContent,l)?(o.popover!=null&&(Te("beforetoggle",n),Te("toggle",n)),o.onScroll!=null&&Te("scroll",n),o.onScrollEnd!=null&&Te("scrollend",n),o.onClick!=null&&(n.onclick=jn),n=!0):n=!1,n||pi(e,!0)}function $m(e){for(ht=e.return;ht;)switch(ht.tag){case 5:case 31:case 13:sn=!1;return;case 27:case 3:sn=!0;return;default:ht=ht.return}}function Qs(e){if(e!==ht)return!1;if(!Oe)return $m(e),Oe=!0,!1;var n=e.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||ud(e.type,e.memoizedProps)),l=!l),l&&Xe&&pi(e),$m(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Xe=cy(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Xe=cy(e)}else n===27?(n=Xe,Oi(e.type)?(e=md,md=null,Xe=e):Xe=n):Xe=ht?an(e.stateNode.nextSibling):null;return!0}function Pi(){Xe=ht=null,Oe=!1}function Xc(){var e=gi;return e!==null&&(Lt===null?Lt=e:Lt.push.apply(Lt,e),gi=null),e}function ga(e){gi===null?gi=[e]:gi.push(e)}var Kc=C(null),es=null,Vn=null;function yi(e,n,l){P(Kc,n._currentValue),n._currentValue=l}function Yn(e){e._currentValue=Kc.current,$(Kc)}function Zc(e,n,l){for(;e!==null;){var o=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,o!==null&&(o.childLanes|=n)):o!==null&&(o.childLanes&n)!==n&&(o.childLanes|=n),e===l)break;e=e.return}}function Qc(e,n,l,o){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var d=f.dependencies;if(d!==null){var b=f.child;d=d.firstContext;e:for(;d!==null;){var A=d;d=f;for(var B=0;B<n.length;B++)if(A.context===n[B]){d.lanes|=l,A=d.alternate,A!==null&&(A.lanes|=l),Zc(d.return,l,e),o||(b=null);break e}d=A.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(a(341));b.lanes|=l,d=b.alternate,d!==null&&(d.lanes|=l),Zc(b,l,e),b=null}else b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===e){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function Is(e,n,l,o){e=null;for(var f=n,d=!1;f!==null;){if(!d){if((f.flags&524288)!==0)d=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var b=f.alternate;if(b===null)throw Error(a(387));if(b=b.memoizedProps,b!==null){var A=f.type;$t(f.pendingProps.value,b.value)||(e!==null?e.push(A):e=[A])}}else if(f===ue.current){if(b=f.alternate,b===null)throw Error(a(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Va):e=[Va])}f=f.return}e!==null&&Qc(n,e,l,o),n.flags|=262144}function er(e){for(e=e.firstContext;e!==null;){if(!$t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ts(e){es=e,Vn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function mt(e){return Um(es,e)}function tr(e,n){return es===null&&ts(e),Um(e,n)}function Um(e,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Vn===null){if(e===null)throw Error(a(308));Vn=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Vn=Vn.next=n;return l}var HS=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(l,o){e.push(o)}};this.abort=function(){n.aborted=!0,e.forEach(function(l){return l()})}},jS=t.unstable_scheduleCallback,$S=t.unstable_NormalPriority,lt={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ic(){return{controller:new HS,data:new Map,refCount:0}}function pa(e){e.refCount--,e.refCount===0&&jS($S,function(){e.controller.abort()})}var ya=null,Jc=0,Js=0,Fs=null;function US(e,n){if(ya===null){var l=ya=[];Jc=0,Js=ed(),Fs={status:"pending",value:void 0,then:function(o){l.push(o)}}}return Jc++,n.then(qm,qm),n}function qm(){if(--Jc===0&&ya!==null){Fs!==null&&(Fs.status="fulfilled");var e=ya;ya=null,Js=0,Fs=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function qS(e,n){var l=[],o={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return e.then(function(){o.status="fulfilled",o.value=n;for(var f=0;f<l.length;f++)(0,l[f])(n)},function(f){for(o.status="rejected",o.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),o}var Vm=T.S;T.S=function(e,n){Np=tt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&US(e,n),Vm!==null&&Vm(e,n)};var ns=C(null);function Fc(){var e=ns.current;return e!==null?e:Ve.pooledCache}function nr(e,n){n===null?P(ns,ns.current):P(ns,n.pool)}function Ym(){var e=Fc();return e===null?null:{parent:lt._currentValue,pool:e}}var Ws=Error(a(460)),Wc=Error(a(474)),ir=Error(a(542)),sr={then:function(){}};function Gm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Xm(e,n,l){switch(l=e[l],l===void 0?e.push(n):l!==n&&(n.then(jn,jn),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Zm(e),e;default:if(typeof n.status=="string")n.then(jn,jn);else{if(e=Ve,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=n,e.status="pending",e.then(function(o){if(n.status==="pending"){var f=n;f.status="fulfilled",f.value=o}},function(o){if(n.status==="pending"){var f=n;f.status="rejected",f.reason=o}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,Zm(e),e}throw ss=n,Ws}}function is(e){try{var n=e._init;return n(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ss=l,Ws):l}}var ss=null;function Km(){if(ss===null)throw Error(a(459));var e=ss;return ss=null,e}function Zm(e){if(e===Ws||e===ir)throw Error(a(483))}var Ps=null,va=0;function lr(e){var n=va;return va+=1,Ps===null&&(Ps=[]),Xm(Ps,e,n)}function ba(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function ar(e,n){throw n.$$typeof===y?Error(a(525)):(e=Object.prototype.toString.call(n),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function Qm(e){function n(V,U){if(e){var Z=V.deletions;Z===null?(V.deletions=[U],V.flags|=16):Z.push(U)}}function l(V,U){if(!e)return null;for(;U!==null;)n(V,U),U=U.sibling;return null}function o(V){for(var U=new Map;V!==null;)V.key!==null?U.set(V.key,V):U.set(V.index,V),V=V.sibling;return U}function f(V,U){return V=Un(V,U),V.index=0,V.sibling=null,V}function d(V,U,Z){return V.index=Z,e?(Z=V.alternate,Z!==null?(Z=Z.index,Z<U?(V.flags|=67108866,U):Z):(V.flags|=67108866,U)):(V.flags|=1048576,U)}function b(V){return e&&V.alternate===null&&(V.flags|=67108866),V}function A(V,U,Z,se){return U===null||U.tag!==6?(U=Uc(Z,V.mode,se),U.return=V,U):(U=f(U,Z),U.return=V,U)}function B(V,U,Z,se){var pe=Z.type;return pe===S?ne(V,U,Z.props.children,se,Z.key):U!==null&&(U.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===j&&is(pe)===U.type)?(U=f(U,Z.props),ba(U,Z),U.return=V,U):(U=Wo(Z.type,Z.key,Z.props,null,V.mode,se),ba(U,Z),U.return=V,U)}function Q(V,U,Z,se){return U===null||U.tag!==4||U.stateNode.containerInfo!==Z.containerInfo||U.stateNode.implementation!==Z.implementation?(U=qc(Z,V.mode,se),U.return=V,U):(U=f(U,Z.children||[]),U.return=V,U)}function ne(V,U,Z,se,pe){return U===null||U.tag!==7?(U=Wi(Z,V.mode,se,pe),U.return=V,U):(U=f(U,Z),U.return=V,U)}function le(V,U,Z){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Uc(""+U,V.mode,Z),U.return=V,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case w:return Z=Wo(U.type,U.key,U.props,null,V.mode,Z),ba(Z,U),Z.return=V,Z;case x:return U=qc(U,V.mode,Z),U.return=V,U;case j:return U=is(U),le(V,U,Z)}if(G(U)||I(U))return U=Wi(U,V.mode,Z,null),U.return=V,U;if(typeof U.then=="function")return le(V,lr(U),Z);if(U.$$typeof===N)return le(V,tr(V,U),Z);ar(V,U)}return null}function J(V,U,Z,se){var pe=U!==null?U.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return pe!==null?null:A(V,U,""+Z,se);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case w:return Z.key===pe?B(V,U,Z,se):null;case x:return Z.key===pe?Q(V,U,Z,se):null;case j:return Z=is(Z),J(V,U,Z,se)}if(G(Z)||I(Z))return pe!==null?null:ne(V,U,Z,se,null);if(typeof Z.then=="function")return J(V,U,lr(Z),se);if(Z.$$typeof===N)return J(V,U,tr(V,Z),se);ar(V,Z)}return null}function W(V,U,Z,se,pe){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return V=V.get(Z)||null,A(U,V,""+se,pe);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case w:return V=V.get(se.key===null?Z:se.key)||null,B(U,V,se,pe);case x:return V=V.get(se.key===null?Z:se.key)||null,Q(U,V,se,pe);case j:return se=is(se),W(V,U,Z,se,pe)}if(G(se)||I(se))return V=V.get(Z)||null,ne(U,V,se,pe,null);if(typeof se.then=="function")return W(V,U,Z,lr(se),pe);if(se.$$typeof===N)return W(V,U,Z,tr(U,se),pe);ar(U,se)}return null}function he(V,U,Z,se){for(var pe=null,Le=null,me=U,Ne=U=0,Ce=null;me!==null&&Ne<Z.length;Ne++){me.index>Ne?(Ce=me,me=null):Ce=me.sibling;var Re=J(V,me,Z[Ne],se);if(Re===null){me===null&&(me=Ce);break}e&&me&&Re.alternate===null&&n(V,me),U=d(Re,U,Ne),Le===null?pe=Re:Le.sibling=Re,Le=Re,me=Ce}if(Ne===Z.length)return l(V,me),Oe&&qn(V,Ne),pe;if(me===null){for(;Ne<Z.length;Ne++)me=le(V,Z[Ne],se),me!==null&&(U=d(me,U,Ne),Le===null?pe=me:Le.sibling=me,Le=me);return Oe&&qn(V,Ne),pe}for(me=o(me);Ne<Z.length;Ne++)Ce=W(me,V,Ne,Z[Ne],se),Ce!==null&&(e&&Ce.alternate!==null&&me.delete(Ce.key===null?Ne:Ce.key),U=d(Ce,U,Ne),Le===null?pe=Ce:Le.sibling=Ce,Le=Ce);return e&&me.forEach(function(Bi){return n(V,Bi)}),Oe&&qn(V,Ne),pe}function ve(V,U,Z,se){if(Z==null)throw Error(a(151));for(var pe=null,Le=null,me=U,Ne=U=0,Ce=null,Re=Z.next();me!==null&&!Re.done;Ne++,Re=Z.next()){me.index>Ne?(Ce=me,me=null):Ce=me.sibling;var Bi=J(V,me,Re.value,se);if(Bi===null){me===null&&(me=Ce);break}e&&me&&Bi.alternate===null&&n(V,me),U=d(Bi,U,Ne),Le===null?pe=Bi:Le.sibling=Bi,Le=Bi,me=Ce}if(Re.done)return l(V,me),Oe&&qn(V,Ne),pe;if(me===null){for(;!Re.done;Ne++,Re=Z.next())Re=le(V,Re.value,se),Re!==null&&(U=d(Re,U,Ne),Le===null?pe=Re:Le.sibling=Re,Le=Re);return Oe&&qn(V,Ne),pe}for(me=o(me);!Re.done;Ne++,Re=Z.next())Re=W(me,V,Ne,Re.value,se),Re!==null&&(e&&Re.alternate!==null&&me.delete(Re.key===null?Ne:Re.key),U=d(Re,U,Ne),Le===null?pe=Re:Le.sibling=Re,Le=Re);return e&&me.forEach(function(Ww){return n(V,Ww)}),Oe&&qn(V,Ne),pe}function qe(V,U,Z,se){if(typeof Z=="object"&&Z!==null&&Z.type===S&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case w:e:{for(var pe=Z.key;U!==null;){if(U.key===pe){if(pe=Z.type,pe===S){if(U.tag===7){l(V,U.sibling),se=f(U,Z.props.children),se.return=V,V=se;break e}}else if(U.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===j&&is(pe)===U.type){l(V,U.sibling),se=f(U,Z.props),ba(se,Z),se.return=V,V=se;break e}l(V,U);break}else n(V,U);U=U.sibling}Z.type===S?(se=Wi(Z.props.children,V.mode,se,Z.key),se.return=V,V=se):(se=Wo(Z.type,Z.key,Z.props,null,V.mode,se),ba(se,Z),se.return=V,V=se)}return b(V);case x:e:{for(pe=Z.key;U!==null;){if(U.key===pe)if(U.tag===4&&U.stateNode.containerInfo===Z.containerInfo&&U.stateNode.implementation===Z.implementation){l(V,U.sibling),se=f(U,Z.children||[]),se.return=V,V=se;break e}else{l(V,U);break}else n(V,U);U=U.sibling}se=qc(Z,V.mode,se),se.return=V,V=se}return b(V);case j:return Z=is(Z),qe(V,U,Z,se)}if(G(Z))return he(V,U,Z,se);if(I(Z)){if(pe=I(Z),typeof pe!="function")throw Error(a(150));return Z=pe.call(Z),ve(V,U,Z,se)}if(typeof Z.then=="function")return qe(V,U,lr(Z),se);if(Z.$$typeof===N)return qe(V,U,tr(V,Z),se);ar(V,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,U!==null&&U.tag===6?(l(V,U.sibling),se=f(U,Z),se.return=V,V=se):(l(V,U),se=Uc(Z,V.mode,se),se.return=V,V=se),b(V)):l(V,U)}return function(V,U,Z,se){try{va=0;var pe=qe(V,U,Z,se);return Ps=null,pe}catch(me){if(me===Ws||me===ir)throw me;var Le=Ut(29,me,null,V.mode);return Le.lanes=se,Le.return=V,Le}}}var ls=Qm(!0),Im=Qm(!1),vi=!1;function Pc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function ef(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function bi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Si(e,n,l){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(Be&2)!==0){var f=o.pending;return f===null?n.next=n:(n.next=f.next,f.next=n),o.pending=n,n=Fo(e),Dm(e,null,l),n}return Jo(e,o,n,l),Fo(e)}function Sa(e,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var o=n.lanes;o&=e.pendingLanes,l|=o,n.lanes=l,Oo(e,l)}}function tf(e,n){var l=e.updateQueue,o=e.alternate;if(o!==null&&(o=o.updateQueue,l===o)){var f=null,d=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};d===null?f=d=b:d=d.next=b,l=l.next}while(l!==null);d===null?f=d=n:d=d.next=n}else f=d=n;l={baseState:o.baseState,firstBaseUpdate:f,lastBaseUpdate:d,shared:o.shared,callbacks:o.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=n:e.next=n,l.lastBaseUpdate=n}var nf=!1;function wa(){if(nf){var e=Fs;if(e!==null)throw e}}function xa(e,n,l,o){nf=!1;var f=e.updateQueue;vi=!1;var d=f.firstBaseUpdate,b=f.lastBaseUpdate,A=f.shared.pending;if(A!==null){f.shared.pending=null;var B=A,Q=B.next;B.next=null,b===null?d=Q:b.next=Q,b=B;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,A=ne.lastBaseUpdate,A!==b&&(A===null?ne.firstBaseUpdate=Q:A.next=Q,ne.lastBaseUpdate=B))}if(d!==null){var le=f.baseState;b=0,ne=Q=B=null,A=d;do{var J=A.lane&-536870913,W=J!==A.lane;if(W?(Me&J)===J:(o&J)===J){J!==0&&J===Js&&(nf=!0),ne!==null&&(ne=ne.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var he=e,ve=A;J=n;var qe=l;switch(ve.tag){case 1:if(he=ve.payload,typeof he=="function"){le=he.call(qe,le,J);break e}le=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=ve.payload,J=typeof he=="function"?he.call(qe,le,J):he,J==null)break e;le=p({},le,J);break e;case 2:vi=!0}}J=A.callback,J!==null&&(e.flags|=64,W&&(e.flags|=8192),W=f.callbacks,W===null?f.callbacks=[J]:W.push(J))}else W={lane:J,tag:A.tag,payload:A.payload,callback:A.callback,next:null},ne===null?(Q=ne=W,B=le):ne=ne.next=W,b|=J;if(A=A.next,A===null){if(A=f.shared.pending,A===null)break;W=A,A=W.next,W.next=null,f.lastBaseUpdate=W,f.shared.pending=null}}while(!0);ne===null&&(B=le),f.baseState=B,f.firstBaseUpdate=Q,f.lastBaseUpdate=ne,d===null&&(f.shared.lanes=0),Ni|=b,e.lanes=b,e.memoizedState=le}}function Jm(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function Fm(e,n){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Jm(l[e],n)}var el=C(null),or=C(0);function Wm(e,n){e=Wn,P(or,e),P(el,n),Wn=e|n.baseLanes}function sf(){P(or,Wn),P(el,el.current)}function lf(){Wn=or.current,$(el),$(or)}var qt=C(null),ln=null;function wi(e){var n=e.alternate;P(nt,nt.current&1),P(qt,e),ln===null&&(n===null||el.current!==null||n.memoizedState!==null)&&(ln=e)}function af(e){P(nt,nt.current),P(qt,e),ln===null&&(ln=e)}function Pm(e){e.tag===22?(P(nt,nt.current),P(qt,e),ln===null&&(ln=e)):xi()}function xi(){P(nt,nt.current),P(qt,qt.current)}function Vt(e){$(qt),ln===e&&(ln=null),$(nt)}var nt=C(0);function rr(e){for(var n=e;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||dd(l)||hd(l)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var Gn=0,_e=null,$e=null,at=null,ur=!1,tl=!1,as=!1,cr=0,Ea=0,nl=null,VS=0;function Pe(){throw Error(a(321))}function of(e,n){if(n===null)return!1;for(var l=0;l<n.length&&l<e.length;l++)if(!$t(e[l],n[l]))return!1;return!0}function rf(e,n,l,o,f,d){return Gn=d,_e=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,T.H=e===null||e.memoizedState===null?kg:Ef,as=!1,d=l(o,f),as=!1,tl&&(d=tg(n,l,o,f)),eg(e),d}function eg(e){T.H=Aa;var n=$e!==null&&$e.next!==null;if(Gn=0,at=$e=_e=null,ur=!1,Ea=0,nl=null,n)throw Error(a(300));e===null||ot||(e=e.dependencies,e!==null&&er(e)&&(ot=!0))}function tg(e,n,l,o){_e=e;var f=0;do{if(tl&&(nl=null),Ea=0,tl=!1,25<=f)throw Error(a(301));if(f+=1,at=$e=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}T.H=Hg,d=n(l,o)}while(tl);return d}function YS(){var e=T.H,n=e.useState()[0];return n=typeof n.then=="function"?_a(n):n,e=e.useState()[0],($e!==null?$e.memoizedState:null)!==e&&(_e.flags|=1024),n}function uf(){var e=cr!==0;return cr=0,e}function cf(e,n,l){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l}function ff(e){if(ur){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}ur=!1}Gn=0,at=$e=_e=null,tl=!1,Ea=cr=0,nl=null}function Et(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return at===null?_e.memoizedState=at=e:at=at.next=e,at}function it(){if($e===null){var e=_e.alternate;e=e!==null?e.memoizedState:null}else e=$e.next;var n=at===null?_e.memoizedState:at.next;if(n!==null)at=n,$e=e;else{if(e===null)throw _e.alternate===null?Error(a(467)):Error(a(310));$e=e,e={memoizedState:$e.memoizedState,baseState:$e.baseState,baseQueue:$e.baseQueue,queue:$e.queue,next:null},at===null?_e.memoizedState=at=e:at=at.next=e}return at}function fr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function _a(e){var n=Ea;return Ea+=1,nl===null&&(nl=[]),e=Xm(nl,e,n),n=_e,(at===null?n.memoizedState:at.next)===null&&(n=n.alternate,T.H=n===null||n.memoizedState===null?kg:Ef),e}function dr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return _a(e);if(e.$$typeof===N)return mt(e)}throw Error(a(438,String(e)))}function df(e){var n=null,l=_e.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var o=_e.alternate;o!==null&&(o=o.updateQueue,o!==null&&(o=o.memoCache,o!=null&&(n={data:o.data.map(function(f){return f.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=fr(),_e.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(e),o=0;o<e;o++)l[o]=oe;return n.index++,l}function Xn(e,n){return typeof n=="function"?n(e):n}function hr(e){var n=it();return hf(n,$e,e)}function hf(e,n,l){var o=e.queue;if(o===null)throw Error(a(311));o.lastRenderedReducer=l;var f=e.baseQueue,d=o.pending;if(d!==null){if(f!==null){var b=f.next;f.next=d.next,d.next=b}n.baseQueue=f=d,o.pending=null}if(d=e.baseState,f===null)e.memoizedState=d;else{n=f.next;var A=b=null,B=null,Q=n,ne=!1;do{var le=Q.lane&-536870913;if(le!==Q.lane?(Me&le)===le:(Gn&le)===le){var J=Q.revertLane;if(J===0)B!==null&&(B=B.next={lane:0,revertLane:0,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),le===Js&&(ne=!0);else if((Gn&J)===J){Q=Q.next,J===Js&&(ne=!0);continue}else le={lane:0,revertLane:Q.revertLane,gesture:null,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},B===null?(A=B=le,b=d):B=B.next=le,_e.lanes|=J,Ni|=J;le=Q.action,as&&l(d,le),d=Q.hasEagerState?Q.eagerState:l(d,le)}else J={lane:le,revertLane:Q.revertLane,gesture:Q.gesture,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},B===null?(A=B=J,b=d):B=B.next=J,_e.lanes|=le,Ni|=le;Q=Q.next}while(Q!==null&&Q!==n);if(B===null?b=d:B.next=A,!$t(d,e.memoizedState)&&(ot=!0,ne&&(l=Fs,l!==null)))throw l;e.memoizedState=d,e.baseState=b,e.baseQueue=B,o.lastRenderedState=d}return f===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function mf(e){var n=it(),l=n.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=e;var o=l.dispatch,f=l.pending,d=n.memoizedState;if(f!==null){l.pending=null;var b=f=f.next;do d=e(d,b.action),b=b.next;while(b!==f);$t(d,n.memoizedState)||(ot=!0),n.memoizedState=d,n.baseQueue===null&&(n.baseState=d),l.lastRenderedState=d}return[d,o]}function ng(e,n,l){var o=_e,f=it(),d=Oe;if(d){if(l===void 0)throw Error(a(407));l=l()}else l=n();var b=!$t(($e||f).memoizedState,l);if(b&&(f.memoizedState=l,ot=!0),f=f.queue,yf(lg.bind(null,o,f,e),[e]),f.getSnapshot!==n||b||at!==null&&at.memoizedState.tag&1){if(o.flags|=2048,il(9,{destroy:void 0},sg.bind(null,o,f,l,n),null),Ve===null)throw Error(a(349));d||(Gn&127)!==0||ig(o,n,l)}return l}function ig(e,n,l){e.flags|=16384,e={getSnapshot:n,value:l},n=_e.updateQueue,n===null?(n=fr(),_e.updateQueue=n,n.stores=[e]):(l=n.stores,l===null?n.stores=[e]:l.push(e))}function sg(e,n,l,o){n.value=l,n.getSnapshot=o,ag(n)&&og(e)}function lg(e,n,l){return l(function(){ag(n)&&og(e)})}function ag(e){var n=e.getSnapshot;e=e.value;try{var l=n();return!$t(e,l)}catch{return!0}}function og(e){var n=Fi(e,2);n!==null&&Rt(n,e,2)}function gf(e){var n=Et();if(typeof e=="function"){var l=e;if(e=l(),as){En(!0);try{l()}finally{En(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xn,lastRenderedState:e},n}function rg(e,n,l,o){return e.baseState=l,hf(e,$e,typeof o=="function"?o:Xn)}function GS(e,n,l,o,f){if(pr(e))throw Error(a(485));if(e=n.action,e!==null){var d={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){d.listeners.push(b)}};T.T!==null?l(!0):d.isTransition=!1,o(d),l=n.pending,l===null?(d.next=n.pending=d,ug(n,d)):(d.next=l.next,n.pending=l.next=d)}}function ug(e,n){var l=n.action,o=n.payload,f=e.state;if(n.isTransition){var d=T.T,b={};T.T=b;try{var A=l(f,o),B=T.S;B!==null&&B(b,A),cg(e,n,A)}catch(Q){pf(e,n,Q)}finally{d!==null&&b.types!==null&&(d.types=b.types),T.T=d}}else try{d=l(f,o),cg(e,n,d)}catch(Q){pf(e,n,Q)}}function cg(e,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(o){fg(e,n,o)},function(o){return pf(e,n,o)}):fg(e,n,l)}function fg(e,n,l){n.status="fulfilled",n.value=l,dg(n),e.state=l,n=e.pending,n!==null&&(l=n.next,l===n?e.pending=null:(l=l.next,n.next=l,ug(e,l)))}function pf(e,n,l){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=l,dg(n),n=n.next;while(n!==o)}e.action=null}function dg(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function hg(e,n){return n}function mg(e,n){if(Oe){var l=Ve.formState;if(l!==null){e:{var o=_e;if(Oe){if(Xe){t:{for(var f=Xe,d=sn;f.nodeType!==8;){if(!d){f=null;break t}if(f=an(f.nextSibling),f===null){f=null;break t}}d=f.data,f=d==="F!"||d==="F"?f:null}if(f){Xe=an(f.nextSibling),o=f.data==="F!";break e}}pi(o)}o=!1}o&&(n=l[0])}}return l=Et(),l.memoizedState=l.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:hg,lastRenderedState:n},l.queue=o,l=Lg.bind(null,_e,o),o.dispatch=l,o=gf(!1),d=xf.bind(null,_e,!1,o.queue),o=Et(),f={state:n,dispatch:null,action:e,pending:null},o.queue=f,l=GS.bind(null,_e,f,d,l),f.dispatch=l,o.memoizedState=e,[n,l,!1]}function gg(e){var n=it();return pg(n,$e,e)}function pg(e,n,l){if(n=hf(e,n,hg)[0],e=hr(Xn)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=_a(n)}catch(b){throw b===Ws?ir:b}else o=n;n=it();var f=n.queue,d=f.dispatch;return l!==n.memoizedState&&(_e.flags|=2048,il(9,{destroy:void 0},XS.bind(null,f,l),null)),[o,d,e]}function XS(e,n){e.action=n}function yg(e){var n=it(),l=$e;if(l!==null)return pg(n,l,e);it(),n=n.memoizedState,l=it();var o=l.queue.dispatch;return l.memoizedState=e,[n,o,!1]}function il(e,n,l,o){return e={tag:e,create:l,deps:o,inst:n,next:null},n=_e.updateQueue,n===null&&(n=fr(),_e.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=e.next=e:(o=l.next,l.next=e,e.next=o,n.lastEffect=e),e}function vg(){return it().memoizedState}function mr(e,n,l,o){var f=Et();_e.flags|=e,f.memoizedState=il(1|n,{destroy:void 0},l,o===void 0?null:o)}function gr(e,n,l,o){var f=it();o=o===void 0?null:o;var d=f.memoizedState.inst;$e!==null&&o!==null&&of(o,$e.memoizedState.deps)?f.memoizedState=il(n,d,l,o):(_e.flags|=e,f.memoizedState=il(1|n,d,l,o))}function bg(e,n){mr(8390656,8,e,n)}function yf(e,n){gr(2048,8,e,n)}function KS(e){_e.flags|=4;var n=_e.updateQueue;if(n===null)n=fr(),_e.updateQueue=n,n.events=[e];else{var l=n.events;l===null?n.events=[e]:l.push(e)}}function Sg(e){var n=it().memoizedState;return KS({ref:n,nextImpl:e}),function(){if((Be&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}function wg(e,n){return gr(4,2,e,n)}function xg(e,n){return gr(4,4,e,n)}function Eg(e,n){if(typeof n=="function"){e=e();var l=n(e);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function _g(e,n,l){l=l!=null?l.concat([e]):null,gr(4,4,Eg.bind(null,n,e),l)}function vf(){}function Ng(e,n){var l=it();n=n===void 0?null:n;var o=l.memoizedState;return n!==null&&of(n,o[1])?o[0]:(l.memoizedState=[e,n],e)}function Ag(e,n){var l=it();n=n===void 0?null:n;var o=l.memoizedState;if(n!==null&&of(n,o[1]))return o[0];if(o=e(),as){En(!0);try{e()}finally{En(!1)}}return l.memoizedState=[o,n],o}function bf(e,n,l){return l===void 0||(Gn&1073741824)!==0&&(Me&261930)===0?e.memoizedState=n:(e.memoizedState=l,e=Tp(),_e.lanes|=e,Ni|=e,l)}function Tg(e,n,l,o){return $t(l,n)?l:el.current!==null?(e=bf(e,l,o),$t(e,n)||(ot=!0),e):(Gn&42)===0||(Gn&1073741824)!==0&&(Me&261930)===0?(ot=!0,e.memoizedState=l):(e=Tp(),_e.lanes|=e,Ni|=e,n)}function Mg(e,n,l,o,f){var d=z.p;z.p=d!==0&&8>d?d:8;var b=T.T,A={};T.T=A,xf(e,!1,n,l);try{var B=f(),Q=T.S;if(Q!==null&&Q(A,B),B!==null&&typeof B=="object"&&typeof B.then=="function"){var ne=qS(B,o);Na(e,n,ne,Xt(e))}else Na(e,n,o,Xt(e))}catch(le){Na(e,n,{then:function(){},status:"rejected",reason:le},Xt())}finally{z.p=d,b!==null&&A.types!==null&&(b.types=A.types),T.T=b}}function ZS(){}function Sf(e,n,l,o){if(e.tag!==5)throw Error(a(476));var f=Cg(e).queue;Mg(e,f,n,q,l===null?ZS:function(){return Og(e),l(o)})}function Cg(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:q,baseState:q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xn,lastRenderedState:q},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Xn,lastRenderedState:l},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Og(e){var n=Cg(e);n.next===null&&(n=e.alternate.memoizedState),Na(e,n.next.queue,{},Xt())}function wf(){return mt(Va)}function zg(){return it().memoizedState}function Dg(){return it().memoizedState}function QS(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var l=Xt();e=bi(l);var o=Si(n,e,l);o!==null&&(Rt(o,n,l),Sa(o,n,l)),n={cache:Ic()},e.payload=n;return}n=n.return}}function IS(e,n,l){var o=Xt();l={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},pr(e)?Rg(n,l):(l=jc(e,n,l,o),l!==null&&(Rt(l,e,o),Bg(l,n,o)))}function Lg(e,n,l){var o=Xt();Na(e,n,l,o)}function Na(e,n,l,o){var f={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(pr(e))Rg(n,f);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=n.lastRenderedReducer,d!==null))try{var b=n.lastRenderedState,A=d(b,l);if(f.hasEagerState=!0,f.eagerState=A,$t(A,b))return Jo(e,n,f,0),Ve===null&&Io(),!1}catch{}if(l=jc(e,n,f,o),l!==null)return Rt(l,e,o),Bg(l,n,o),!0}return!1}function xf(e,n,l,o){if(o={lane:2,revertLane:ed(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},pr(e)){if(n)throw Error(a(479))}else n=jc(e,l,o,2),n!==null&&Rt(n,e,2)}function pr(e){var n=e.alternate;return e===_e||n!==null&&n===_e}function Rg(e,n){tl=ur=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function Bg(e,n,l){if((l&4194048)!==0){var o=n.lanes;o&=e.pendingLanes,l|=o,n.lanes=l,Oo(e,l)}}var Aa={readContext:mt,use:dr,useCallback:Pe,useContext:Pe,useEffect:Pe,useImperativeHandle:Pe,useLayoutEffect:Pe,useInsertionEffect:Pe,useMemo:Pe,useReducer:Pe,useRef:Pe,useState:Pe,useDebugValue:Pe,useDeferredValue:Pe,useTransition:Pe,useSyncExternalStore:Pe,useId:Pe,useHostTransitionStatus:Pe,useFormState:Pe,useActionState:Pe,useOptimistic:Pe,useMemoCache:Pe,useCacheRefresh:Pe};Aa.useEffectEvent=Pe;var kg={readContext:mt,use:dr,useCallback:function(e,n){return Et().memoizedState=[e,n===void 0?null:n],e},useContext:mt,useEffect:bg,useImperativeHandle:function(e,n,l){l=l!=null?l.concat([e]):null,mr(4194308,4,Eg.bind(null,n,e),l)},useLayoutEffect:function(e,n){return mr(4194308,4,e,n)},useInsertionEffect:function(e,n){mr(4,2,e,n)},useMemo:function(e,n){var l=Et();n=n===void 0?null:n;var o=e();if(as){En(!0);try{e()}finally{En(!1)}}return l.memoizedState=[o,n],o},useReducer:function(e,n,l){var o=Et();if(l!==void 0){var f=l(n);if(as){En(!0);try{l(n)}finally{En(!1)}}}else f=n;return o.memoizedState=o.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},o.queue=e,e=e.dispatch=IS.bind(null,_e,e),[o.memoizedState,e]},useRef:function(e){var n=Et();return e={current:e},n.memoizedState=e},useState:function(e){e=gf(e);var n=e.queue,l=Lg.bind(null,_e,n);return n.dispatch=l,[e.memoizedState,l]},useDebugValue:vf,useDeferredValue:function(e,n){var l=Et();return bf(l,e,n)},useTransition:function(){var e=gf(!1);return e=Mg.bind(null,_e,e.queue,!0,!1),Et().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,l){var o=_e,f=Et();if(Oe){if(l===void 0)throw Error(a(407));l=l()}else{if(l=n(),Ve===null)throw Error(a(349));(Me&127)!==0||ig(o,n,l)}f.memoizedState=l;var d={value:l,getSnapshot:n};return f.queue=d,bg(lg.bind(null,o,d,e),[e]),o.flags|=2048,il(9,{destroy:void 0},sg.bind(null,o,d,l,n),null),l},useId:function(){var e=Et(),n=Ve.identifierPrefix;if(Oe){var l=An,o=Nn;l=(o&~(1<<32-xt(o)-1)).toString(32)+l,n="_"+n+"R_"+l,l=cr++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=VS++,n="_"+n+"r_"+l.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:wf,useFormState:mg,useActionState:mg,useOptimistic:function(e){var n=Et();n.memoizedState=n.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=xf.bind(null,_e,!0,l),l.dispatch=n,[e,n]},useMemoCache:df,useCacheRefresh:function(){return Et().memoizedState=QS.bind(null,_e)},useEffectEvent:function(e){var n=Et(),l={impl:e};return n.memoizedState=l,function(){if((Be&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Ef={readContext:mt,use:dr,useCallback:Ng,useContext:mt,useEffect:yf,useImperativeHandle:_g,useInsertionEffect:wg,useLayoutEffect:xg,useMemo:Ag,useReducer:hr,useRef:vg,useState:function(){return hr(Xn)},useDebugValue:vf,useDeferredValue:function(e,n){var l=it();return Tg(l,$e.memoizedState,e,n)},useTransition:function(){var e=hr(Xn)[0],n=it().memoizedState;return[typeof e=="boolean"?e:_a(e),n]},useSyncExternalStore:ng,useId:zg,useHostTransitionStatus:wf,useFormState:gg,useActionState:gg,useOptimistic:function(e,n){var l=it();return rg(l,$e,e,n)},useMemoCache:df,useCacheRefresh:Dg};Ef.useEffectEvent=Sg;var Hg={readContext:mt,use:dr,useCallback:Ng,useContext:mt,useEffect:yf,useImperativeHandle:_g,useInsertionEffect:wg,useLayoutEffect:xg,useMemo:Ag,useReducer:mf,useRef:vg,useState:function(){return mf(Xn)},useDebugValue:vf,useDeferredValue:function(e,n){var l=it();return $e===null?bf(l,e,n):Tg(l,$e.memoizedState,e,n)},useTransition:function(){var e=mf(Xn)[0],n=it().memoizedState;return[typeof e=="boolean"?e:_a(e),n]},useSyncExternalStore:ng,useId:zg,useHostTransitionStatus:wf,useFormState:yg,useActionState:yg,useOptimistic:function(e,n){var l=it();return $e!==null?rg(l,$e,e,n):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:df,useCacheRefresh:Dg};Hg.useEffectEvent=Sg;function _f(e,n,l,o){n=e.memoizedState,l=l(o,n),l=l==null?n:p({},n,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Nf={enqueueSetState:function(e,n,l){e=e._reactInternals;var o=Xt(),f=bi(o);f.payload=n,l!=null&&(f.callback=l),n=Si(e,f,o),n!==null&&(Rt(n,e,o),Sa(n,e,o))},enqueueReplaceState:function(e,n,l){e=e._reactInternals;var o=Xt(),f=bi(o);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=Si(e,f,o),n!==null&&(Rt(n,e,o),Sa(n,e,o))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var l=Xt(),o=bi(l);o.tag=2,n!=null&&(o.callback=n),n=Si(e,o,l),n!==null&&(Rt(n,e,l),Sa(n,e,l))}};function jg(e,n,l,o,f,d,b){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(o,d,b):n.prototype&&n.prototype.isPureReactComponent?!da(l,o)||!da(f,d):!0}function $g(e,n,l,o){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,o),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,o),n.state!==e&&Nf.enqueueReplaceState(n,n.state,null)}function os(e,n){var l=n;if("ref"in n){l={};for(var o in n)o!=="ref"&&(l[o]=n[o])}if(e=e.defaultProps){l===n&&(l=p({},l));for(var f in e)l[f]===void 0&&(l[f]=e[f])}return l}function Ug(e){Qo(e)}function qg(e){console.error(e)}function Vg(e){Qo(e)}function yr(e,n){try{var l=e.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Yg(e,n,l){try{var o=e.onCaughtError;o(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Af(e,n,l){return l=bi(l),l.tag=3,l.payload={element:null},l.callback=function(){yr(e,n)},l}function Gg(e){return e=bi(e),e.tag=3,e}function Xg(e,n,l,o){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var d=o.value;e.payload=function(){return f(d)},e.callback=function(){Yg(n,l,o)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Yg(n,l,o),typeof f!="function"&&(Ai===null?Ai=new Set([this]):Ai.add(this));var A=o.stack;this.componentDidCatch(o.value,{componentStack:A!==null?A:""})})}function JS(e,n,l,o,f){if(l.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=l.alternate,n!==null&&Is(n,l,f,!0),l=qt.current,l!==null){switch(l.tag){case 31:case 13:return ln===null?Cr():l.alternate===null&&et===0&&(et=3),l.flags&=-257,l.flags|=65536,l.lanes=f,o===sr?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([o]):n.add(o),Ff(e,o,f)),!1;case 22:return l.flags|=65536,o===sr?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([o])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([o]):l.add(o)),Ff(e,o,f)),!1}throw Error(a(435,l.tag))}return Ff(e,o,f),Cr(),!1}if(Oe)return n=qt.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==Gc&&(e=Error(a(422),{cause:o}),ga(en(e,l)))):(o!==Gc&&(n=Error(a(423),{cause:o}),ga(en(n,l))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,o=en(o,l),f=Af(e.stateNode,o,f),tf(e,f),et!==4&&(et=2)),!1;var d=Error(a(520),{cause:o});if(d=en(d,l),Ra===null?Ra=[d]:Ra.push(d),et!==4&&(et=2),n===null)return!0;o=en(o,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,e=f&-f,l.lanes|=e,e=Af(l.stateNode,o,e),tf(l,e),!1;case 1:if(n=l.type,d=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Ai===null||!Ai.has(d))))return l.flags|=65536,f&=-f,l.lanes|=f,f=Gg(f),Xg(f,e,l,o),tf(l,f),!1}l=l.return}while(l!==null);return!1}var Tf=Error(a(461)),ot=!1;function gt(e,n,l,o){n.child=e===null?Im(n,null,l,o):ls(n,e.child,l,o)}function Kg(e,n,l,o,f){l=l.render;var d=n.ref;if("ref"in o){var b={};for(var A in o)A!=="ref"&&(b[A]=o[A])}else b=o;return ts(n),o=rf(e,n,l,b,d,f),A=uf(),e!==null&&!ot?(cf(e,n,f),Kn(e,n,f)):(Oe&&A&&Vc(n),n.flags|=1,gt(e,n,o,f),n.child)}function Zg(e,n,l,o,f){if(e===null){var d=l.type;return typeof d=="function"&&!$c(d)&&d.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=d,Qg(e,n,d,o,f)):(e=Wo(l.type,null,o,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(d=e.child,!Bf(e,f)){var b=d.memoizedProps;if(l=l.compare,l=l!==null?l:da,l(b,o)&&e.ref===n.ref)return Kn(e,n,f)}return n.flags|=1,e=Un(d,o),e.ref=n.ref,e.return=n,n.child=e}function Qg(e,n,l,o,f){if(e!==null){var d=e.memoizedProps;if(da(d,o)&&e.ref===n.ref)if(ot=!1,n.pendingProps=o=d,Bf(e,f))(e.flags&131072)!==0&&(ot=!0);else return n.lanes=e.lanes,Kn(e,n,f)}return Mf(e,n,l,o,f)}function Ig(e,n,l,o){var f=o.children,d=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.mode==="hidden"){if((n.flags&128)!==0){if(d=d!==null?d.baseLanes|l:l,e!==null){for(o=n.child=e.child,f=0;o!==null;)f=f|o.lanes|o.childLanes,o=o.sibling;o=f&~d}else o=0,n.child=null;return Jg(e,n,d,l,o)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&nr(n,d!==null?d.cachePool:null),d!==null?Wm(n,d):sf(),Pm(n);else return o=n.lanes=536870912,Jg(e,n,d!==null?d.baseLanes|l:l,l,o)}else d!==null?(nr(n,d.cachePool),Wm(n,d),xi(),n.memoizedState=null):(e!==null&&nr(n,null),sf(),xi());return gt(e,n,f,l),n.child}function Ta(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function Jg(e,n,l,o,f){var d=Fc();return d=d===null?null:{parent:lt._currentValue,pool:d},n.memoizedState={baseLanes:l,cachePool:d},e!==null&&nr(n,null),sf(),Pm(n),e!==null&&Is(e,n,o,!0),n.childLanes=f,null}function vr(e,n){return n=Sr({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function Fg(e,n,l){return ls(n,e.child,null,l),e=vr(n,n.pendingProps),e.flags|=2,Vt(n),n.memoizedState=null,e}function FS(e,n,l){var o=n.pendingProps,f=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(Oe){if(o.mode==="hidden")return e=vr(n,o),n.lanes=536870912,Ta(null,e);if(af(n),(e=Xe)?(e=uy(e,sn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:mi!==null?{id:Nn,overflow:An}:null,retryLane:536870912,hydrationErrors:null},l=Rm(e),l.return=n,n.child=l,ht=n,Xe=null)):e=null,e===null)throw pi(n);return n.lanes=536870912,null}return vr(n,o)}var d=e.memoizedState;if(d!==null){var b=d.dehydrated;if(af(n),f)if(n.flags&256)n.flags&=-257,n=Fg(e,n,l);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(a(558));else if(ot||Is(e,n,l,!1),f=(l&e.childLanes)!==0,ot||f){if(o=Ve,o!==null&&(b=zo(o,l),b!==0&&b!==d.retryLane))throw d.retryLane=b,Fi(e,b),Rt(o,e,b),Tf;Cr(),n=Fg(e,n,l)}else e=d.treeContext,Xe=an(b.nextSibling),ht=n,Oe=!0,gi=null,sn=!1,e!==null&&Hm(n,e),n=vr(n,o),n.flags|=4096;return n}return e=Un(e.child,{mode:o.mode,children:o.children}),e.ref=n.ref,n.child=e,e.return=n,e}function br(e,n){var l=n.ref;if(l===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(e===null||e.ref!==l)&&(n.flags|=4194816)}}function Mf(e,n,l,o,f){return ts(n),l=rf(e,n,l,o,void 0,f),o=uf(),e!==null&&!ot?(cf(e,n,f),Kn(e,n,f)):(Oe&&o&&Vc(n),n.flags|=1,gt(e,n,l,f),n.child)}function Wg(e,n,l,o,f,d){return ts(n),n.updateQueue=null,l=tg(n,o,l,f),eg(e),o=uf(),e!==null&&!ot?(cf(e,n,d),Kn(e,n,d)):(Oe&&o&&Vc(n),n.flags|=1,gt(e,n,l,d),n.child)}function Pg(e,n,l,o,f){if(ts(n),n.stateNode===null){var d=Xs,b=l.contextType;typeof b=="object"&&b!==null&&(d=mt(b)),d=new l(o,d),n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Nf,n.stateNode=d,d._reactInternals=n,d=n.stateNode,d.props=o,d.state=n.memoizedState,d.refs={},Pc(n),b=l.contextType,d.context=typeof b=="object"&&b!==null?mt(b):Xs,d.state=n.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(_f(n,l,b,o),d.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(b=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),b!==d.state&&Nf.enqueueReplaceState(d,d.state,null),xa(n,o,d,f),wa(),d.state=n.memoizedState),typeof d.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(e===null){d=n.stateNode;var A=n.memoizedProps,B=os(l,A);d.props=B;var Q=d.context,ne=l.contextType;b=Xs,typeof ne=="object"&&ne!==null&&(b=mt(ne));var le=l.getDerivedStateFromProps;ne=typeof le=="function"||typeof d.getSnapshotBeforeUpdate=="function",A=n.pendingProps!==A,ne||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(A||Q!==b)&&$g(n,d,o,b),vi=!1;var J=n.memoizedState;d.state=J,xa(n,o,d,f),wa(),Q=n.memoizedState,A||J!==Q||vi?(typeof le=="function"&&(_f(n,l,le,o),Q=n.memoizedState),(B=vi||jg(n,l,B,o,J,Q,b))?(ne||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(n.flags|=4194308)):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=o,n.memoizedState=Q),d.props=o,d.state=Q,d.context=b,o=B):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{d=n.stateNode,ef(e,n),b=n.memoizedProps,ne=os(l,b),d.props=ne,le=n.pendingProps,J=d.context,Q=l.contextType,B=Xs,typeof Q=="object"&&Q!==null&&(B=mt(Q)),A=l.getDerivedStateFromProps,(Q=typeof A=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==le||J!==B)&&$g(n,d,o,B),vi=!1,J=n.memoizedState,d.state=J,xa(n,o,d,f),wa();var W=n.memoizedState;b!==le||J!==W||vi||e!==null&&e.dependencies!==null&&er(e.dependencies)?(typeof A=="function"&&(_f(n,l,A,o),W=n.memoizedState),(ne=vi||jg(n,l,ne,o,J,W,B)||e!==null&&e.dependencies!==null&&er(e.dependencies))?(Q||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(o,W,B),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(o,W,B)),typeof d.componentDidUpdate=="function"&&(n.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=W),d.props=o,d.state=W,d.context=B,o=ne):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&J===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&J===e.memoizedState||(n.flags|=1024),o=!1)}return d=o,br(e,n),o=(n.flags&128)!==0,d||o?(d=n.stateNode,l=o&&typeof l.getDerivedStateFromError!="function"?null:d.render(),n.flags|=1,e!==null&&o?(n.child=ls(n,e.child,null,f),n.child=ls(n,null,l,f)):gt(e,n,l,f),n.memoizedState=d.state,e=n.child):e=Kn(e,n,f),e}function ep(e,n,l,o){return Pi(),n.flags|=256,gt(e,n,l,o),n.child}var Cf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Of(e){return{baseLanes:e,cachePool:Ym()}}function zf(e,n,l){return e=e!==null?e.childLanes&~l:0,n&&(e|=Gt),e}function tp(e,n,l){var o=n.pendingProps,f=!1,d=(n.flags&128)!==0,b;if((b=d)||(b=e!==null&&e.memoizedState===null?!1:(nt.current&2)!==0),b&&(f=!0,n.flags&=-129),b=(n.flags&32)!==0,n.flags&=-33,e===null){if(Oe){if(f?wi(n):xi(),(e=Xe)?(e=uy(e,sn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:mi!==null?{id:Nn,overflow:An}:null,retryLane:536870912,hydrationErrors:null},l=Rm(e),l.return=n,n.child=l,ht=n,Xe=null)):e=null,e===null)throw pi(n);return hd(e)?n.lanes=32:n.lanes=536870912,null}var A=o.children;return o=o.fallback,f?(xi(),f=n.mode,A=Sr({mode:"hidden",children:A},f),o=Wi(o,f,l,null),A.return=n,o.return=n,A.sibling=o,n.child=A,o=n.child,o.memoizedState=Of(l),o.childLanes=zf(e,b,l),n.memoizedState=Cf,Ta(null,o)):(wi(n),Df(n,A))}var B=e.memoizedState;if(B!==null&&(A=B.dehydrated,A!==null)){if(d)n.flags&256?(wi(n),n.flags&=-257,n=Lf(e,n,l)):n.memoizedState!==null?(xi(),n.child=e.child,n.flags|=128,n=null):(xi(),A=o.fallback,f=n.mode,o=Sr({mode:"visible",children:o.children},f),A=Wi(A,f,l,null),A.flags|=2,o.return=n,A.return=n,o.sibling=A,n.child=o,ls(n,e.child,null,l),o=n.child,o.memoizedState=Of(l),o.childLanes=zf(e,b,l),n.memoizedState=Cf,n=Ta(null,o));else if(wi(n),hd(A)){if(b=A.nextSibling&&A.nextSibling.dataset,b)var Q=b.dgst;b=Q,o=Error(a(419)),o.stack="",o.digest=b,ga({value:o,source:null,stack:null}),n=Lf(e,n,l)}else if(ot||Is(e,n,l,!1),b=(l&e.childLanes)!==0,ot||b){if(b=Ve,b!==null&&(o=zo(b,l),o!==0&&o!==B.retryLane))throw B.retryLane=o,Fi(e,o),Rt(b,e,o),Tf;dd(A)||Cr(),n=Lf(e,n,l)}else dd(A)?(n.flags|=192,n.child=e.child,n=null):(e=B.treeContext,Xe=an(A.nextSibling),ht=n,Oe=!0,gi=null,sn=!1,e!==null&&Hm(n,e),n=Df(n,o.children),n.flags|=4096);return n}return f?(xi(),A=o.fallback,f=n.mode,B=e.child,Q=B.sibling,o=Un(B,{mode:"hidden",children:o.children}),o.subtreeFlags=B.subtreeFlags&65011712,Q!==null?A=Un(Q,A):(A=Wi(A,f,l,null),A.flags|=2),A.return=n,o.return=n,o.sibling=A,n.child=o,Ta(null,o),o=n.child,A=e.child.memoizedState,A===null?A=Of(l):(f=A.cachePool,f!==null?(B=lt._currentValue,f=f.parent!==B?{parent:B,pool:B}:f):f=Ym(),A={baseLanes:A.baseLanes|l,cachePool:f}),o.memoizedState=A,o.childLanes=zf(e,b,l),n.memoizedState=Cf,Ta(e.child,o)):(wi(n),l=e.child,e=l.sibling,l=Un(l,{mode:"visible",children:o.children}),l.return=n,l.sibling=null,e!==null&&(b=n.deletions,b===null?(n.deletions=[e],n.flags|=16):b.push(e)),n.child=l,n.memoizedState=null,l)}function Df(e,n){return n=Sr({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Sr(e,n){return e=Ut(22,e,null,n),e.lanes=0,e}function Lf(e,n,l){return ls(n,e.child,null,l),e=Df(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function np(e,n,l){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n),Zc(e.return,n,l)}function Rf(e,n,l,o,f,d){var b=e.memoizedState;b===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:o,tail:l,tailMode:f,treeForkCount:d}:(b.isBackwards=n,b.rendering=null,b.renderingStartTime=0,b.last=o,b.tail=l,b.tailMode=f,b.treeForkCount=d)}function ip(e,n,l){var o=n.pendingProps,f=o.revealOrder,d=o.tail;o=o.children;var b=nt.current,A=(b&2)!==0;if(A?(b=b&1|2,n.flags|=128):b&=1,P(nt,b),gt(e,n,o,l),o=Oe?ma:0,!A&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&np(e,l,n);else if(e.tag===19)np(e,l,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(l=n.child,f=null;l!==null;)e=l.alternate,e!==null&&rr(e)===null&&(f=l),l=l.sibling;l=f,l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),Rf(n,!1,f,l,d,o);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=n.child,n.child=null;f!==null;){if(e=f.alternate,e!==null&&rr(e)===null){n.child=f;break}e=f.sibling,f.sibling=l,l=f,f=e}Rf(n,!0,l,null,d,o);break;case"together":Rf(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function Kn(e,n,l){if(e!==null&&(n.dependencies=e.dependencies),Ni|=n.lanes,(l&n.childLanes)===0)if(e!==null){if(Is(e,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(a(153));if(n.child!==null){for(e=n.child,l=Un(e,e.pendingProps),n.child=l,l.return=n;e.sibling!==null;)e=e.sibling,l=l.sibling=Un(e,e.pendingProps),l.return=n;l.sibling=null}return n.child}function Bf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&er(e)))}function WS(e,n,l){switch(n.tag){case 3:ee(n,n.stateNode.containerInfo),yi(n,lt,e.memoizedState.cache),Pi();break;case 27:case 5:Se(n);break;case 4:ee(n,n.stateNode.containerInfo);break;case 10:yi(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,af(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(wi(n),n.flags|=128,null):(l&n.child.childLanes)!==0?tp(e,n,l):(wi(n),e=Kn(e,n,l),e!==null?e.sibling:null);wi(n);break;case 19:var f=(e.flags&128)!==0;if(o=(l&n.childLanes)!==0,o||(Is(e,n,l,!1),o=(l&n.childLanes)!==0),f){if(o)return ip(e,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),P(nt,nt.current),o)break;return null;case 22:return n.lanes=0,Ig(e,n,l,n.pendingProps);case 24:yi(n,lt,e.memoizedState.cache)}return Kn(e,n,l)}function sp(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps)ot=!0;else{if(!Bf(e,l)&&(n.flags&128)===0)return ot=!1,WS(e,n,l);ot=(e.flags&131072)!==0}else ot=!1,Oe&&(n.flags&1048576)!==0&&km(n,ma,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(e=is(n.elementType),n.type=e,typeof e=="function")$c(e)?(o=os(e,o),n.tag=1,n=Pg(null,n,e,o,l)):(n.tag=0,n=Mf(null,n,e,o,l));else{if(e!=null){var f=e.$$typeof;if(f===M){n.tag=11,n=Kg(null,n,e,o,l);break e}else if(f===H){n.tag=14,n=Zg(null,n,e,o,l);break e}}throw n=R(e)||e,Error(a(306,n,""))}}return n;case 0:return Mf(e,n,n.type,n.pendingProps,l);case 1:return o=n.type,f=os(o,n.pendingProps),Pg(e,n,o,f,l);case 3:e:{if(ee(n,n.stateNode.containerInfo),e===null)throw Error(a(387));o=n.pendingProps;var d=n.memoizedState;f=d.element,ef(e,n),xa(n,o,null,l);var b=n.memoizedState;if(o=b.cache,yi(n,lt,o),o!==d.cache&&Qc(n,[lt],l,!0),wa(),o=b.element,d.isDehydrated)if(d={element:o,isDehydrated:!1,cache:b.cache},n.updateQueue.baseState=d,n.memoizedState=d,n.flags&256){n=ep(e,n,o,l);break e}else if(o!==f){f=en(Error(a(424)),n),ga(f),n=ep(e,n,o,l);break e}else for(e=n.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Xe=an(e.firstChild),ht=n,Oe=!0,gi=null,sn=!0,l=Im(n,null,o,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Pi(),o===f){n=Kn(e,n,l);break e}gt(e,n,o,l)}n=n.child}return n;case 26:return br(e,n),e===null?(l=gy(n.type,null,n.pendingProps,null))?n.memoizedState=l:Oe||(l=n.type,e=n.pendingProps,o=kr(de.current).createElement(l),o[ct]=n,o[vt]=e,pt(o,l,e),st(o),n.stateNode=o):n.memoizedState=gy(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Se(n),e===null&&Oe&&(o=n.stateNode=dy(n.type,n.pendingProps,de.current),ht=n,sn=!0,f=Xe,Oi(n.type)?(md=f,Xe=an(o.firstChild)):Xe=f),gt(e,n,n.pendingProps.children,l),br(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Oe&&((f=o=Xe)&&(o=Mw(o,n.type,n.pendingProps,sn),o!==null?(n.stateNode=o,ht=n,Xe=an(o.firstChild),sn=!1,f=!0):f=!1),f||pi(n)),Se(n),f=n.type,d=n.pendingProps,b=e!==null?e.memoizedProps:null,o=d.children,ud(f,d)?o=null:b!==null&&ud(f,b)&&(n.flags|=32),n.memoizedState!==null&&(f=rf(e,n,YS,null,null,l),Va._currentValue=f),br(e,n),gt(e,n,o,l),n.child;case 6:return e===null&&Oe&&((e=l=Xe)&&(l=Cw(l,n.pendingProps,sn),l!==null?(n.stateNode=l,ht=n,Xe=null,e=!0):e=!1),e||pi(n)),null;case 13:return tp(e,n,l);case 4:return ee(n,n.stateNode.containerInfo),o=n.pendingProps,e===null?n.child=ls(n,null,o,l):gt(e,n,o,l),n.child;case 11:return Kg(e,n,n.type,n.pendingProps,l);case 7:return gt(e,n,n.pendingProps,l),n.child;case 8:return gt(e,n,n.pendingProps.children,l),n.child;case 12:return gt(e,n,n.pendingProps.children,l),n.child;case 10:return o=n.pendingProps,yi(n,n.type,o.value),gt(e,n,o.children,l),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,ts(n),f=mt(f),o=o(f),n.flags|=1,gt(e,n,o,l),n.child;case 14:return Zg(e,n,n.type,n.pendingProps,l);case 15:return Qg(e,n,n.type,n.pendingProps,l);case 19:return ip(e,n,l);case 31:return FS(e,n,l);case 22:return Ig(e,n,l,n.pendingProps);case 24:return ts(n),o=mt(lt),e===null?(f=Fc(),f===null&&(f=Ve,d=Ic(),f.pooledCache=d,d.refCount++,d!==null&&(f.pooledCacheLanes|=l),f=d),n.memoizedState={parent:o,cache:f},Pc(n),yi(n,lt,f)):((e.lanes&l)!==0&&(ef(e,n),xa(n,null,null,l),wa()),f=e.memoizedState,d=n.memoizedState,f.parent!==o?(f={parent:o,cache:o},n.memoizedState=f,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=f),yi(n,lt,o)):(o=d.cache,yi(n,lt,o),o!==f.cache&&Qc(n,[lt],l,!0))),gt(e,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function Zn(e){e.flags|=4}function kf(e,n,l,o,f){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(zp())e.flags|=8192;else throw ss=sr,Wc}else e.flags&=-16777217}function lp(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Sy(n))if(zp())e.flags|=8192;else throw ss=sr,Wc}function wr(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Mo():536870912,e.lanes|=n,ol|=n)}function Ma(e,n){if(!Oe)switch(e.tailMode){case"hidden":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var o=null;l!==null;)l.alternate!==null&&(o=l),l=l.sibling;o===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:o.sibling=null}}function Ke(e){var n=e.alternate!==null&&e.alternate.child===e.child,l=0,o=0;if(n)for(var f=e.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags&65011712,o|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)l|=f.lanes|f.childLanes,o|=f.subtreeFlags,o|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=o,e.childLanes=l,n}function PS(e,n,l){var o=n.pendingProps;switch(Yc(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ke(n),null;case 1:return Ke(n),null;case 3:return l=n.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),Yn(lt),ce(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Qs(n)?Zn(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Xc())),Ke(n),null;case 26:var f=n.type,d=n.memoizedState;return e===null?(Zn(n),d!==null?(Ke(n),lp(n,d)):(Ke(n),kf(n,f,null,o,l))):d?d!==e.memoizedState?(Zn(n),Ke(n),lp(n,d)):(Ke(n),n.flags&=-16777217):(e=e.memoizedProps,e!==o&&Zn(n),Ke(n),kf(n,f,e,o,l)),null;case 27:if(be(n),l=de.current,f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&Zn(n);else{if(!o){if(n.stateNode===null)throw Error(a(166));return Ke(n),null}e=ie.current,Qs(n)?jm(n):(e=dy(f,o,l),n.stateNode=e,Zn(n))}return Ke(n),null;case 5:if(be(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&Zn(n);else{if(!o){if(n.stateNode===null)throw Error(a(166));return Ke(n),null}if(d=ie.current,Qs(n))jm(n);else{var b=kr(de.current);switch(d){case 1:d=b.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:d=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":d=b.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":d=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":d=b.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof o.is=="string"?b.createElement("select",{is:o.is}):b.createElement("select"),o.multiple?d.multiple=!0:o.size&&(d.size=o.size);break;default:d=typeof o.is=="string"?b.createElement(f,{is:o.is}):b.createElement(f)}}d[ct]=n,d[vt]=o;e:for(b=n.child;b!==null;){if(b.tag===5||b.tag===6)d.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===n)break e;for(;b.sibling===null;){if(b.return===null||b.return===n)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}n.stateNode=d;e:switch(pt(d,f,o),f){case"button":case"input":case"select":case"textarea":o=!!o.autoFocus;break e;case"img":o=!0;break e;default:o=!1}o&&Zn(n)}}return Ke(n),kf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,l),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==o&&Zn(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(a(166));if(e=de.current,Qs(n)){if(e=n.stateNode,l=n.memoizedProps,o=null,f=ht,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}e[ct]=n,e=!!(e.nodeValue===l||o!==null&&o.suppressHydrationWarning===!0||ty(e.nodeValue,l)),e||pi(n,!0)}else e=kr(e).createTextNode(o),e[ct]=n,n.stateNode=e}return Ke(n),null;case 31:if(l=n.memoizedState,e===null||e.memoizedState!==null){if(o=Qs(n),l!==null){if(e===null){if(!o)throw Error(a(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[ct]=n}else Pi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ke(n),e=!1}else l=Xc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return n.flags&256?(Vt(n),n):(Vt(n),null);if((n.flags&128)!==0)throw Error(a(558))}return Ke(n),null;case 13:if(o=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=Qs(n),o!==null&&o.dehydrated!==null){if(e===null){if(!f)throw Error(a(318));if(f=n.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));f[ct]=n}else Pi(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ke(n),f=!1}else f=Xc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Vt(n),n):(Vt(n),null)}return Vt(n),(n.flags&128)!==0?(n.lanes=l,n):(l=o!==null,e=e!==null&&e.memoizedState!==null,l&&(o=n.child,f=null,o.alternate!==null&&o.alternate.memoizedState!==null&&o.alternate.memoizedState.cachePool!==null&&(f=o.alternate.memoizedState.cachePool.pool),d=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(d=o.memoizedState.cachePool.pool),d!==f&&(o.flags|=2048)),l!==e&&l&&(n.child.flags|=8192),wr(n,n.updateQueue),Ke(n),null);case 4:return ce(),e===null&&sd(n.stateNode.containerInfo),Ke(n),null;case 10:return Yn(n.type),Ke(n),null;case 19:if($(nt),o=n.memoizedState,o===null)return Ke(n),null;if(f=(n.flags&128)!==0,d=o.rendering,d===null)if(f)Ma(o,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(d=rr(e),d!==null){for(n.flags|=128,Ma(o,!1),e=d.updateQueue,n.updateQueue=e,wr(n,e),n.subtreeFlags=0,e=l,l=n.child;l!==null;)Lm(l,e),l=l.sibling;return P(nt,nt.current&1|2),Oe&&qn(n,o.treeForkCount),n.child}e=e.sibling}o.tail!==null&&tt()>Ar&&(n.flags|=128,f=!0,Ma(o,!1),n.lanes=4194304)}else{if(!f)if(e=rr(d),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,wr(n,e),Ma(o,!0),o.tail===null&&o.tailMode==="hidden"&&!d.alternate&&!Oe)return Ke(n),null}else 2*tt()-o.renderingStartTime>Ar&&l!==536870912&&(n.flags|=128,f=!0,Ma(o,!1),n.lanes=4194304);o.isBackwards?(d.sibling=n.child,n.child=d):(e=o.last,e!==null?e.sibling=d:n.child=d,o.last=d)}return o.tail!==null?(e=o.tail,o.rendering=e,o.tail=e.sibling,o.renderingStartTime=tt(),e.sibling=null,l=nt.current,P(nt,f?l&1|2:l&1),Oe&&qn(n,o.treeForkCount),e):(Ke(n),null);case 22:case 23:return Vt(n),lf(),o=n.memoizedState!==null,e!==null?e.memoizedState!==null!==o&&(n.flags|=8192):o&&(n.flags|=8192),o?(l&536870912)!==0&&(n.flags&128)===0&&(Ke(n),n.subtreeFlags&6&&(n.flags|=8192)):Ke(n),l=n.updateQueue,l!==null&&wr(n,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==l&&(n.flags|=2048),e!==null&&$(ns),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Yn(lt),Ke(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function ew(e,n){switch(Yc(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Yn(lt),ce(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return be(n),null;case 31:if(n.memoizedState!==null){if(Vt(n),n.alternate===null)throw Error(a(340));Pi()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Vt(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(a(340));Pi()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return $(nt),null;case 4:return ce(),null;case 10:return Yn(n.type),null;case 22:case 23:return Vt(n),lf(),e!==null&&$(ns),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Yn(lt),null;case 25:return null;default:return null}}function ap(e,n){switch(Yc(n),n.tag){case 3:Yn(lt),ce();break;case 26:case 27:case 5:be(n);break;case 4:ce();break;case 31:n.memoizedState!==null&&Vt(n);break;case 13:Vt(n);break;case 19:$(nt);break;case 10:Yn(n.type);break;case 22:case 23:Vt(n),lf(),e!==null&&$(ns);break;case 24:Yn(lt)}}function Ca(e,n){try{var l=n.updateQueue,o=l!==null?l.lastEffect:null;if(o!==null){var f=o.next;l=f;do{if((l.tag&e)===e){o=void 0;var d=l.create,b=l.inst;o=d(),b.destroy=o}l=l.next}while(l!==f)}}catch(A){He(n,n.return,A)}}function Ei(e,n,l){try{var o=n.updateQueue,f=o!==null?o.lastEffect:null;if(f!==null){var d=f.next;o=d;do{if((o.tag&e)===e){var b=o.inst,A=b.destroy;if(A!==void 0){b.destroy=void 0,f=n;var B=l,Q=A;try{Q()}catch(ne){He(f,B,ne)}}}o=o.next}while(o!==d)}}catch(ne){He(n,n.return,ne)}}function op(e){var n=e.updateQueue;if(n!==null){var l=e.stateNode;try{Fm(n,l)}catch(o){He(e,e.return,o)}}}function rp(e,n,l){l.props=os(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(o){He(e,n,o)}}function Oa(e,n){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var o=e.stateNode;break;case 30:o=e.stateNode;break;default:o=e.stateNode}typeof l=="function"?e.refCleanup=l(o):l.current=o}}catch(f){He(e,n,f)}}function Tn(e,n){var l=e.ref,o=e.refCleanup;if(l!==null)if(typeof o=="function")try{o()}catch(f){He(e,n,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){He(e,n,f)}else l.current=null}function up(e){var n=e.type,l=e.memoizedProps,o=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&o.focus();break e;case"img":l.src?o.src=l.src:l.srcSet&&(o.srcset=l.srcSet)}}catch(f){He(e,e.return,f)}}function Hf(e,n,l){try{var o=e.stateNode;xw(o,e.type,l,n),o[vt]=n}catch(f){He(e,e.return,f)}}function cp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Oi(e.type)||e.tag===4}function jf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||cp(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&&Oi(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 $f(e,n,l){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(e),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=jn));else if(o!==4&&(o===27&&Oi(e.type)&&(l=e.stateNode,n=null),e=e.child,e!==null))for($f(e,n,l),e=e.sibling;e!==null;)$f(e,n,l),e=e.sibling}function xr(e,n,l){var o=e.tag;if(o===5||o===6)e=e.stateNode,n?l.insertBefore(e,n):l.appendChild(e);else if(o!==4&&(o===27&&Oi(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(xr(e,n,l),e=e.sibling;e!==null;)xr(e,n,l),e=e.sibling}function fp(e){var n=e.stateNode,l=e.memoizedProps;try{for(var o=e.type,f=n.attributes;f.length;)n.removeAttributeNode(f[0]);pt(n,o,l),n[ct]=e,n[vt]=l}catch(d){He(e,e.return,d)}}var Qn=!1,rt=!1,Uf=!1,dp=typeof WeakSet=="function"?WeakSet:Set,dt=null;function tw(e,n){if(e=e.containerInfo,od=Yr,e=_m(e),Dc(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var o=l.getSelection&&l.getSelection();if(o&&o.rangeCount!==0){l=o.anchorNode;var f=o.anchorOffset,d=o.focusNode;o=o.focusOffset;try{l.nodeType,d.nodeType}catch{l=null;break e}var b=0,A=-1,B=-1,Q=0,ne=0,le=e,J=null;t:for(;;){for(var W;le!==l||f!==0&&le.nodeType!==3||(A=b+f),le!==d||o!==0&&le.nodeType!==3||(B=b+o),le.nodeType===3&&(b+=le.nodeValue.length),(W=le.firstChild)!==null;)J=le,le=W;for(;;){if(le===e)break t;if(J===l&&++Q===f&&(A=b),J===d&&++ne===o&&(B=b),(W=le.nextSibling)!==null)break;le=J,J=le.parentNode}le=W}l=A===-1||B===-1?null:{start:A,end:B}}else l=null}l=l||{start:0,end:0}}else l=null;for(rd={focusedElem:e,selectionRange:l},Yr=!1,dt=n;dt!==null;)if(n=dt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,dt=e;else for(;dt!==null;){switch(n=dt,d=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)f=e[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,l=n,f=d.memoizedProps,d=d.memoizedState,o=l.stateNode;try{var he=os(l.type,f);e=o.getSnapshotBeforeUpdate(he,d),o.__reactInternalSnapshotBeforeUpdate=e}catch(ve){He(l,l.return,ve)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,l=e.nodeType,l===9)fd(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":fd(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(a(163))}if(e=n.sibling,e!==null){e.return=n.return,dt=e;break}dt=n.return}}function hp(e,n,l){var o=l.flags;switch(l.tag){case 0:case 11:case 15:Jn(e,l),o&4&&Ca(5,l);break;case 1:if(Jn(e,l),o&4)if(e=l.stateNode,n===null)try{e.componentDidMount()}catch(b){He(l,l.return,b)}else{var f=os(l.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(b){He(l,l.return,b)}}o&64&&op(l),o&512&&Oa(l,l.return);break;case 3:if(Jn(e,l),o&64&&(e=l.updateQueue,e!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{Fm(e,n)}catch(b){He(l,l.return,b)}}break;case 27:n===null&&o&4&&fp(l);case 26:case 5:Jn(e,l),n===null&&o&4&&up(l),o&512&&Oa(l,l.return);break;case 12:Jn(e,l);break;case 31:Jn(e,l),o&4&&pp(e,l);break;case 13:Jn(e,l),o&4&&yp(e,l),o&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=cw.bind(null,l),Ow(e,l))));break;case 22:if(o=l.memoizedState!==null||Qn,!o){n=n!==null&&n.memoizedState!==null||rt,f=Qn;var d=rt;Qn=o,(rt=n)&&!d?Fn(e,l,(l.subtreeFlags&8772)!==0):Jn(e,l),Qn=f,rt=d}break;case 30:break;default:Jn(e,l)}}function mp(e){var n=e.alternate;n!==null&&(e.alternate=null,mp(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Wl(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Ze=null,Ot=!1;function In(e,n,l){for(l=l.child;l!==null;)gp(e,n,l),l=l.sibling}function gp(e,n,l){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(Gi,l)}catch{}switch(l.tag){case 26:rt||Tn(l,n),In(e,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:rt||Tn(l,n);var o=Ze,f=Ot;Oi(l.type)&&(Ze=l.stateNode,Ot=!1),In(e,n,l),$a(l.stateNode),Ze=o,Ot=f;break;case 5:rt||Tn(l,n);case 6:if(o=Ze,f=Ot,Ze=null,In(e,n,l),Ze=o,Ot=f,Ze!==null)if(Ot)try{(Ze.nodeType===9?Ze.body:Ze.nodeName==="HTML"?Ze.ownerDocument.body:Ze).removeChild(l.stateNode)}catch(d){He(l,n,d)}else try{Ze.removeChild(l.stateNode)}catch(d){He(l,n,d)}break;case 18:Ze!==null&&(Ot?(e=Ze,oy(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),gl(e)):oy(Ze,l.stateNode));break;case 4:o=Ze,f=Ot,Ze=l.stateNode.containerInfo,Ot=!0,In(e,n,l),Ze=o,Ot=f;break;case 0:case 11:case 14:case 15:Ei(2,l,n),rt||Ei(4,l,n),In(e,n,l);break;case 1:rt||(Tn(l,n),o=l.stateNode,typeof o.componentWillUnmount=="function"&&rp(l,n,o)),In(e,n,l);break;case 21:In(e,n,l);break;case 22:rt=(o=rt)||l.memoizedState!==null,In(e,n,l),rt=o;break;default:In(e,n,l)}}function pp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{gl(e)}catch(l){He(n,n.return,l)}}}function yp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{gl(e)}catch(l){He(n,n.return,l)}}function nw(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new dp),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new dp),n;default:throw Error(a(435,e.tag))}}function Er(e,n){var l=nw(e);n.forEach(function(o){if(!l.has(o)){l.add(o);var f=fw.bind(null,e,o);o.then(f,f)}})}function zt(e,n){var l=n.deletions;if(l!==null)for(var o=0;o<l.length;o++){var f=l[o],d=e,b=n,A=b;e:for(;A!==null;){switch(A.tag){case 27:if(Oi(A.type)){Ze=A.stateNode,Ot=!1;break e}break;case 5:Ze=A.stateNode,Ot=!1;break e;case 3:case 4:Ze=A.stateNode.containerInfo,Ot=!0;break e}A=A.return}if(Ze===null)throw Error(a(160));gp(d,b,f),Ze=null,Ot=!1,d=f.alternate,d!==null&&(d.return=null),f.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)vp(n,e),n=n.sibling}var hn=null;function vp(e,n){var l=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:zt(n,e),Dt(e),o&4&&(Ei(3,e,e.return),Ca(3,e),Ei(5,e,e.return));break;case 1:zt(n,e),Dt(e),o&512&&(rt||l===null||Tn(l,l.return)),o&64&&Qn&&(e=e.updateQueue,e!==null&&(o=e.callbacks,o!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?o:l.concat(o))));break;case 26:var f=hn;if(zt(n,e),Dt(e),o&512&&(rt||l===null||Tn(l,l.return)),o&4){var d=l!==null?l.memoizedState:null;if(o=e.memoizedState,l===null)if(o===null)if(e.stateNode===null){e:{o=e.type,l=e.memoizedProps,f=f.ownerDocument||f;t:switch(o){case"title":d=f.getElementsByTagName("title")[0],(!d||d[Zi]||d[ct]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=f.createElement(o),f.head.insertBefore(d,f.querySelector("head > title"))),pt(d,o,l),d[ct]=e,st(d),o=d;break e;case"link":var b=vy("link","href",f).get(o+(l.href||""));if(b){for(var A=0;A<b.length;A++)if(d=b[A],d.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&d.getAttribute("rel")===(l.rel==null?null:l.rel)&&d.getAttribute("title")===(l.title==null?null:l.title)&&d.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){b.splice(A,1);break t}}d=f.createElement(o),pt(d,o,l),f.head.appendChild(d);break;case"meta":if(b=vy("meta","content",f).get(o+(l.content||""))){for(A=0;A<b.length;A++)if(d=b[A],d.getAttribute("content")===(l.content==null?null:""+l.content)&&d.getAttribute("name")===(l.name==null?null:l.name)&&d.getAttribute("property")===(l.property==null?null:l.property)&&d.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&d.getAttribute("charset")===(l.charSet==null?null:l.charSet)){b.splice(A,1);break t}}d=f.createElement(o),pt(d,o,l),f.head.appendChild(d);break;default:throw Error(a(468,o))}d[ct]=e,st(d),o=d}e.stateNode=o}else by(f,e.type,e.stateNode);else e.stateNode=yy(f,o,e.memoizedProps);else d!==o?(d===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):d.count--,o===null?by(f,e.type,e.stateNode):yy(f,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Hf(e,e.memoizedProps,l.memoizedProps)}break;case 27:zt(n,e),Dt(e),o&512&&(rt||l===null||Tn(l,l.return)),l!==null&&o&4&&Hf(e,e.memoizedProps,l.memoizedProps);break;case 5:if(zt(n,e),Dt(e),o&512&&(rt||l===null||Tn(l,l.return)),e.flags&32){f=e.stateNode;try{js(f,"")}catch(he){He(e,e.return,he)}}o&4&&e.stateNode!=null&&(f=e.memoizedProps,Hf(e,f,l!==null?l.memoizedProps:f)),o&1024&&(Uf=!0);break;case 6:if(zt(n,e),Dt(e),o&4){if(e.stateNode===null)throw Error(a(162));o=e.memoizedProps,l=e.stateNode;try{l.nodeValue=o}catch(he){He(e,e.return,he)}}break;case 3:if($r=null,f=hn,hn=Hr(n.containerInfo),zt(n,e),hn=f,Dt(e),o&4&&l!==null&&l.memoizedState.isDehydrated)try{gl(n.containerInfo)}catch(he){He(e,e.return,he)}Uf&&(Uf=!1,bp(e));break;case 4:o=hn,hn=Hr(e.stateNode.containerInfo),zt(n,e),Dt(e),hn=o;break;case 12:zt(n,e),Dt(e);break;case 31:zt(n,e),Dt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Er(e,o)));break;case 13:zt(n,e),Dt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Nr=tt()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Er(e,o)));break;case 22:f=e.memoizedState!==null;var B=l!==null&&l.memoizedState!==null,Q=Qn,ne=rt;if(Qn=Q||f,rt=ne||B,zt(n,e),rt=ne,Qn=Q,Dt(e),o&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(l===null||B||Qn||rt||rs(e)),l=null,n=e;;){if(n.tag===5||n.tag===26){if(l===null){B=l=n;try{if(d=B.stateNode,f)b=d.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{A=B.stateNode;var le=B.memoizedProps.style,J=le!=null&&le.hasOwnProperty("display")?le.display:null;A.style.display=J==null||typeof J=="boolean"?"":(""+J).trim()}}catch(he){He(B,B.return,he)}}}else if(n.tag===6){if(l===null){B=n;try{B.stateNode.nodeValue=f?"":B.memoizedProps}catch(he){He(B,B.return,he)}}}else if(n.tag===18){if(l===null){B=n;try{var W=B.stateNode;f?ry(W,!0):ry(B.stateNode,!1)}catch(he){He(B,B.return,he)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;l===n&&(l=null),n=n.return}l===n&&(l=null),n.sibling.return=n.return,n=n.sibling}o&4&&(o=e.updateQueue,o!==null&&(l=o.retryQueue,l!==null&&(o.retryQueue=null,Er(e,l))));break;case 19:zt(n,e),Dt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Er(e,o)));break;case 30:break;case 21:break;default:zt(n,e),Dt(e)}}function Dt(e){var n=e.flags;if(n&2){try{for(var l,o=e.return;o!==null;){if(cp(o)){l=o;break}o=o.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var f=l.stateNode,d=jf(e);xr(e,d,f);break;case 5:var b=l.stateNode;l.flags&32&&(js(b,""),l.flags&=-33);var A=jf(e);xr(e,A,b);break;case 3:case 4:var B=l.stateNode.containerInfo,Q=jf(e);$f(e,Q,B);break;default:throw Error(a(161))}}catch(ne){He(e,e.return,ne)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function bp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;bp(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Jn(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)hp(e,n.alternate,n),n=n.sibling}function rs(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Ei(4,n,n.return),rs(n);break;case 1:Tn(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&rp(n,n.return,l),rs(n);break;case 27:$a(n.stateNode);case 26:case 5:Tn(n,n.return),rs(n);break;case 22:n.memoizedState===null&&rs(n);break;case 30:rs(n);break;default:rs(n)}e=e.sibling}}function Fn(e,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var o=n.alternate,f=e,d=n,b=d.flags;switch(d.tag){case 0:case 11:case 15:Fn(f,d,l),Ca(4,d);break;case 1:if(Fn(f,d,l),o=d,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(Q){He(o,o.return,Q)}if(o=d,f=o.updateQueue,f!==null){var A=o.stateNode;try{var B=f.shared.hiddenCallbacks;if(B!==null)for(f.shared.hiddenCallbacks=null,f=0;f<B.length;f++)Jm(B[f],A)}catch(Q){He(o,o.return,Q)}}l&&b&64&&op(d),Oa(d,d.return);break;case 27:fp(d);case 26:case 5:Fn(f,d,l),l&&o===null&&b&4&&up(d),Oa(d,d.return);break;case 12:Fn(f,d,l);break;case 31:Fn(f,d,l),l&&b&4&&pp(f,d);break;case 13:Fn(f,d,l),l&&b&4&&yp(f,d);break;case 22:d.memoizedState===null&&Fn(f,d,l),Oa(d,d.return);break;case 30:break;default:Fn(f,d,l)}n=n.sibling}}function qf(e,n){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&pa(l))}function Vf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&pa(e))}function mn(e,n,l,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Sp(e,n,l,o),n=n.sibling}function Sp(e,n,l,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:mn(e,n,l,o),f&2048&&Ca(9,n);break;case 1:mn(e,n,l,o);break;case 3:mn(e,n,l,o),f&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&pa(e)));break;case 12:if(f&2048){mn(e,n,l,o),e=n.stateNode;try{var d=n.memoizedProps,b=d.id,A=d.onPostCommit;typeof A=="function"&&A(b,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(B){He(n,n.return,B)}}else mn(e,n,l,o);break;case 31:mn(e,n,l,o);break;case 13:mn(e,n,l,o);break;case 23:break;case 22:d=n.stateNode,b=n.alternate,n.memoizedState!==null?d._visibility&2?mn(e,n,l,o):za(e,n):d._visibility&2?mn(e,n,l,o):(d._visibility|=2,sl(e,n,l,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&qf(b,n);break;case 24:mn(e,n,l,o),f&2048&&Vf(n.alternate,n);break;default:mn(e,n,l,o)}}function sl(e,n,l,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var d=e,b=n,A=l,B=o,Q=b.flags;switch(b.tag){case 0:case 11:case 15:sl(d,b,A,B,f),Ca(8,b);break;case 23:break;case 22:var ne=b.stateNode;b.memoizedState!==null?ne._visibility&2?sl(d,b,A,B,f):za(d,b):(ne._visibility|=2,sl(d,b,A,B,f)),f&&Q&2048&&qf(b.alternate,b);break;case 24:sl(d,b,A,B,f),f&&Q&2048&&Vf(b.alternate,b);break;default:sl(d,b,A,B,f)}n=n.sibling}}function za(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=e,o=n,f=o.flags;switch(o.tag){case 22:za(l,o),f&2048&&qf(o.alternate,o);break;case 24:za(l,o),f&2048&&Vf(o.alternate,o);break;default:za(l,o)}n=n.sibling}}var Da=8192;function ll(e,n,l){if(e.subtreeFlags&Da)for(e=e.child;e!==null;)wp(e,n,l),e=e.sibling}function wp(e,n,l){switch(e.tag){case 26:ll(e,n,l),e.flags&Da&&e.memoizedState!==null&&Vw(l,hn,e.memoizedState,e.memoizedProps);break;case 5:ll(e,n,l);break;case 3:case 4:var o=hn;hn=Hr(e.stateNode.containerInfo),ll(e,n,l),hn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=Da,Da=16777216,ll(e,n,l),Da=o):ll(e,n,l));break;default:ll(e,n,l)}}function xp(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function La(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];dt=o,_p(o,e)}xp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ep(e),e=e.sibling}function Ep(e){switch(e.tag){case 0:case 11:case 15:La(e),e.flags&2048&&Ei(9,e,e.return);break;case 3:La(e);break;case 12:La(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,_r(e)):La(e);break;default:La(e)}}function _r(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var o=n[l];dt=o,_p(o,e)}xp(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Ei(8,n,n.return),_r(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,_r(n));break;default:_r(n)}e=e.sibling}}function _p(e,n){for(;dt!==null;){var l=dt;switch(l.tag){case 0:case 11:case 15:Ei(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var o=l.memoizedState.cachePool.pool;o!=null&&o.refCount++}break;case 24:pa(l.memoizedState.cache)}if(o=l.child,o!==null)o.return=l,dt=o;else e:for(l=e;dt!==null;){o=dt;var f=o.sibling,d=o.return;if(mp(o),o===l){dt=null;break e}if(f!==null){f.return=d,dt=f;break e}dt=d}}}var iw={getCacheForType:function(e){var n=mt(lt),l=n.data.get(e);return l===void 0&&(l=e(),n.data.set(e,l)),l},cacheSignal:function(){return mt(lt).controller.signal}},sw=typeof WeakMap=="function"?WeakMap:Map,Be=0,Ve=null,Ae=null,Me=0,ke=0,Yt=null,_i=!1,al=!1,Yf=!1,Wn=0,et=0,Ni=0,us=0,Gf=0,Gt=0,ol=0,Ra=null,Lt=null,Xf=!1,Nr=0,Np=0,Ar=1/0,Tr=null,Ai=null,ft=0,Ti=null,rl=null,Pn=0,Kf=0,Zf=null,Ap=null,Ba=0,Qf=null;function Xt(){return(Be&2)!==0&&Me!==0?Me&-Me:T.T!==null?ed():Do()}function Tp(){if(Gt===0)if((Me&536870912)===0||Oe){var e=Os;Os<<=1,(Os&3932160)===0&&(Os=262144),Gt=e}else Gt=536870912;return e=qt.current,e!==null&&(e.flags|=32),Gt}function Rt(e,n,l){(e===Ve&&(ke===2||ke===9)||e.cancelPendingCommit!==null)&&(ul(e,0),Mi(e,Me,Gt,!1)),Ki(e,l),((Be&2)===0||e!==Ve)&&(e===Ve&&((Be&2)===0&&(us|=l),et===4&&Mi(e,Me,Gt,!1)),Mn(e))}function Mp(e,n,l){if((Be&6)!==0)throw Error(a(327));var o=!l&&(n&127)===0&&(n&e.expiredLanes)===0||Xi(e,n),f=o?ow(e,n):Jf(e,n,!0),d=o;do{if(f===0){al&&!o&&Mi(e,n,0,!1);break}else{if(l=e.current.alternate,d&&!lw(l)){f=Jf(e,n,!1),d=!1;continue}if(f===2){if(d=n,e.errorRecoveryDisabledLanes&d)var b=0;else b=e.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){n=b;e:{var A=e;f=Ra;var B=A.current.memoizedState.isDehydrated;if(B&&(ul(A,b).flags|=256),b=Jf(A,b,!1),b!==2){if(Yf&&!B){A.errorRecoveryDisabledLanes|=d,us|=d,f=4;break e}d=Lt,Lt=f,d!==null&&(Lt===null?Lt=d:Lt.push.apply(Lt,d))}f=b}if(d=!1,f!==2)continue}}if(f===1){ul(e,0),Mi(e,n,0,!0);break}e:{switch(o=e,d=f,d){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n)break;case 6:Mi(o,n,Gt,!_i);break e;case 2:Lt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(f=Nr+300-tt(),10<f)){if(Mi(o,n,Gt,!_i),Ds(o,0,!0)!==0)break e;Pn=n,o.timeoutHandle=ly(Cp.bind(null,o,l,Lt,Tr,Xf,n,Gt,us,ol,_i,d,"Throttled",-0,0),f);break e}Cp(o,l,Lt,Tr,Xf,n,Gt,us,ol,_i,d,null,-0,0)}}break}while(!0);Mn(e)}function Cp(e,n,l,o,f,d,b,A,B,Q,ne,le,J,W){if(e.timeoutHandle=-1,le=n.subtreeFlags,le&8192||(le&16785408)===16785408){le={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:jn},wp(n,d,le);var he=(d&62914560)===d?Nr-tt():(d&4194048)===d?Np-tt():0;if(he=Yw(le,he),he!==null){Pn=d,e.cancelPendingCommit=he(Hp.bind(null,e,n,d,l,o,f,b,A,B,ne,le,null,J,W)),Mi(e,d,b,!Q);return}}Hp(e,n,d,l,o,f,b,A,B)}function lw(e){for(var n=e;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var o=0;o<l.length;o++){var f=l[o],d=f.getSnapshot;f=f.value;try{if(!$t(d(),f))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function Mi(e,n,l,o){n&=~Gf,n&=~us,e.suspendedLanes|=n,e.pingedLanes&=~n,o&&(e.warmLanes|=n),o=e.expirationTimes;for(var f=n;0<f;){var d=31-xt(f),b=1<<d;o[d]=-1,f&=~b}l!==0&&Co(e,l,n)}function Mr(){return(Be&6)===0?(ka(0),!1):!0}function If(){if(Ae!==null){if(ke===0)var e=Ae.return;else e=Ae,Vn=es=null,ff(e),Ps=null,va=0,e=Ae;for(;e!==null;)ap(e.alternate,e),e=e.return;Ae=null}}function ul(e,n){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Nw(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Pn=0,If(),Ve=e,Ae=l=Un(e.current,null),Me=n,ke=0,Yt=null,_i=!1,al=Xi(e,n),Yf=!1,ol=Gt=Gf=us=Ni=et=0,Lt=Ra=null,Xf=!1,(n&8)!==0&&(n|=n&32);var o=e.entangledLanes;if(o!==0)for(e=e.entanglements,o&=n;0<o;){var f=31-xt(o),d=1<<f;n|=e[f],o&=~d}return Wn=n,Io(),l}function Op(e,n){_e=null,T.H=Aa,n===Ws||n===ir?(n=Km(),ke=3):n===Wc?(n=Km(),ke=4):ke=n===Tf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Yt=n,Ae===null&&(et=1,yr(e,en(n,e.current)))}function zp(){var e=qt.current;return e===null?!0:(Me&4194048)===Me?ln===null:(Me&62914560)===Me||(Me&536870912)!==0?e===ln:!1}function Dp(){var e=T.H;return T.H=Aa,e===null?Aa:e}function Lp(){var e=T.A;return T.A=iw,e}function Cr(){et=4,_i||(Me&4194048)!==Me&&qt.current!==null||(al=!0),(Ni&134217727)===0&&(us&134217727)===0||Ve===null||Mi(Ve,Me,Gt,!1)}function Jf(e,n,l){var o=Be;Be|=2;var f=Dp(),d=Lp();(Ve!==e||Me!==n)&&(Tr=null,ul(e,n)),n=!1;var b=et;e:do try{if(ke!==0&&Ae!==null){var A=Ae,B=Yt;switch(ke){case 8:If(),b=6;break e;case 3:case 2:case 9:case 6:qt.current===null&&(n=!0);var Q=ke;if(ke=0,Yt=null,cl(e,A,B,Q),l&&al){b=0;break e}break;default:Q=ke,ke=0,Yt=null,cl(e,A,B,Q)}}aw(),b=et;break}catch(ne){Op(e,ne)}while(!0);return n&&e.shellSuspendCounter++,Vn=es=null,Be=o,T.H=f,T.A=d,Ae===null&&(Ve=null,Me=0,Io()),b}function aw(){for(;Ae!==null;)Rp(Ae)}function ow(e,n){var l=Be;Be|=2;var o=Dp(),f=Lp();Ve!==e||Me!==n?(Tr=null,Ar=tt()+500,ul(e,n)):al=Xi(e,n);e:do try{if(ke!==0&&Ae!==null){n=Ae;var d=Yt;t:switch(ke){case 1:ke=0,Yt=null,cl(e,n,d,1);break;case 2:case 9:if(Gm(d)){ke=0,Yt=null,Bp(n);break}n=function(){ke!==2&&ke!==9||Ve!==e||(ke=7),Mn(e)},d.then(n,n);break e;case 3:ke=7;break e;case 4:ke=5;break e;case 7:Gm(d)?(ke=0,Yt=null,Bp(n)):(ke=0,Yt=null,cl(e,n,d,7));break;case 5:var b=null;switch(Ae.tag){case 26:b=Ae.memoizedState;case 5:case 27:var A=Ae;if(b?Sy(b):A.stateNode.complete){ke=0,Yt=null;var B=A.sibling;if(B!==null)Ae=B;else{var Q=A.return;Q!==null?(Ae=Q,Or(Q)):Ae=null}break t}}ke=0,Yt=null,cl(e,n,d,5);break;case 6:ke=0,Yt=null,cl(e,n,d,6);break;case 8:If(),et=6;break e;default:throw Error(a(462))}}rw();break}catch(ne){Op(e,ne)}while(!0);return Vn=es=null,T.H=o,T.A=f,Be=l,Ae!==null?0:(Ve=null,Me=0,Io(),et)}function rw(){for(;Ae!==null&&!Yi();)Rp(Ae)}function Rp(e){var n=sp(e.alternate,e,Wn);e.memoizedProps=e.pendingProps,n===null?Or(e):Ae=n}function Bp(e){var n=e,l=n.alternate;switch(n.tag){case 15:case 0:n=Wg(l,n,n.pendingProps,n.type,void 0,Me);break;case 11:n=Wg(l,n,n.pendingProps,n.type.render,n.ref,Me);break;case 5:ff(n);default:ap(l,n),n=Ae=Lm(n,Wn),n=sp(l,n,Wn)}e.memoizedProps=e.pendingProps,n===null?Or(e):Ae=n}function cl(e,n,l,o){Vn=es=null,ff(n),Ps=null,va=0;var f=n.return;try{if(JS(e,f,n,l,Me)){et=1,yr(e,en(l,e.current)),Ae=null;return}}catch(d){if(f!==null)throw Ae=f,d;et=1,yr(e,en(l,e.current)),Ae=null;return}n.flags&32768?(Oe||o===1?e=!0:al||(Me&536870912)!==0?e=!1:(_i=e=!0,(o===2||o===9||o===3||o===6)&&(o=qt.current,o!==null&&o.tag===13&&(o.flags|=16384))),kp(n,e)):Or(n)}function Or(e){var n=e;do{if((n.flags&32768)!==0){kp(n,_i);return}e=n.return;var l=PS(n.alternate,n,Wn);if(l!==null){Ae=l;return}if(n=n.sibling,n!==null){Ae=n;return}Ae=n=e}while(n!==null);et===0&&(et=5)}function kp(e,n){do{var l=ew(e.alternate,e);if(l!==null){l.flags&=32767,Ae=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(e=e.sibling,e!==null)){Ae=e;return}Ae=e=l}while(e!==null);et=6,Ae=null}function Hp(e,n,l,o,f,d,b,A,B){e.cancelPendingCommit=null;do zr();while(ft!==0);if((Be&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));if(d=n.lanes|n.childLanes,d|=Hc,mc(e,l,d,b,A,B),e===Ve&&(Ae=Ve=null,Me=0),rl=n,Ti=e,Pn=l,Kf=d,Zf=f,Ap=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,dw(Wt,function(){return Vp(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=T.T,T.T=null,f=z.p,z.p=2,b=Be,Be|=4;try{tw(e,n,l)}finally{Be=b,z.p=f,T.T=o}}ft=1,jp(),$p(),Up()}}function jp(){if(ft===1){ft=0;var e=Ti,n=rl,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=T.T,T.T=null;var o=z.p;z.p=2;var f=Be;Be|=4;try{vp(n,e);var d=rd,b=_m(e.containerInfo),A=d.focusedElem,B=d.selectionRange;if(b!==A&&A&&A.ownerDocument&&Em(A.ownerDocument.documentElement,A)){if(B!==null&&Dc(A)){var Q=B.start,ne=B.end;if(ne===void 0&&(ne=Q),"selectionStart"in A)A.selectionStart=Q,A.selectionEnd=Math.min(ne,A.value.length);else{var le=A.ownerDocument||document,J=le&&le.defaultView||window;if(J.getSelection){var W=J.getSelection(),he=A.textContent.length,ve=Math.min(B.start,he),qe=B.end===void 0?ve:Math.min(B.end,he);!W.extend&&ve>qe&&(b=qe,qe=ve,ve=b);var V=xm(A,ve),U=xm(A,qe);if(V&&U&&(W.rangeCount!==1||W.anchorNode!==V.node||W.anchorOffset!==V.offset||W.focusNode!==U.node||W.focusOffset!==U.offset)){var Z=le.createRange();Z.setStart(V.node,V.offset),W.removeAllRanges(),ve>qe?(W.addRange(Z),W.extend(U.node,U.offset)):(Z.setEnd(U.node,U.offset),W.addRange(Z))}}}}for(le=[],W=A;W=W.parentNode;)W.nodeType===1&&le.push({element:W,left:W.scrollLeft,top:W.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<le.length;A++){var se=le[A];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Yr=!!od,rd=od=null}finally{Be=f,z.p=o,T.T=l}}e.current=n,ft=2}}function $p(){if(ft===2){ft=0;var e=Ti,n=rl,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=T.T,T.T=null;var o=z.p;z.p=2;var f=Be;Be|=4;try{hp(e,n.alternate,n)}finally{Be=f,z.p=o,T.T=l}}ft=3}}function Up(){if(ft===4||ft===3){ft=0,Rn();var e=Ti,n=rl,l=Pn,o=Ap;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?ft=5:(ft=0,rl=Ti=null,qp(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(Ai=null),Fl(l),n=n.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(Gi,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=T.T,f=z.p,z.p=2,T.T=null;try{for(var d=e.onRecoverableError,b=0;b<o.length;b++){var A=o[b];d(A.value,{componentStack:A.stack})}}finally{T.T=n,z.p=f}}(Pn&3)!==0&&zr(),Mn(e),f=e.pendingLanes,(l&261930)!==0&&(f&42)!==0?e===Qf?Ba++:(Ba=0,Qf=e):Ba=0,ka(0)}}function qp(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,pa(n)))}function zr(){return jp(),$p(),Up(),Vp()}function Vp(){if(ft!==5)return!1;var e=Ti,n=Kf;Kf=0;var l=Fl(Pn),o=T.T,f=z.p;try{z.p=32>l?32:l,T.T=null,l=Zf,Zf=null;var d=Ti,b=Pn;if(ft=0,rl=Ti=null,Pn=0,(Be&6)!==0)throw Error(a(331));var A=Be;if(Be|=4,Ep(d.current),Sp(d,d.current,b,l),Be=A,ka(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(Gi,d)}catch{}return!0}finally{z.p=f,T.T=o,qp(e,n)}}function Yp(e,n,l){n=en(l,n),n=Af(e.stateNode,n,2),e=Si(e,n,2),e!==null&&(Ki(e,2),Mn(e))}function He(e,n,l){if(e.tag===3)Yp(e,e,l);else for(;n!==null;){if(n.tag===3){Yp(n,e,l);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Ai===null||!Ai.has(o))){e=en(l,e),l=Gg(2),o=Si(n,l,2),o!==null&&(Xg(l,o,n,e),Ki(o,2),Mn(o));break}}n=n.return}}function Ff(e,n,l){var o=e.pingCache;if(o===null){o=e.pingCache=new sw;var f=new Set;o.set(n,f)}else f=o.get(n),f===void 0&&(f=new Set,o.set(n,f));f.has(l)||(Yf=!0,f.add(l),e=uw.bind(null,e,n,l),n.then(e,e))}function uw(e,n,l){var o=e.pingCache;o!==null&&o.delete(n),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ve===e&&(Me&l)===l&&(et===4||et===3&&(Me&62914560)===Me&&300>tt()-Nr?(Be&2)===0&&ul(e,0):Gf|=l,ol===Me&&(ol=0)),Mn(e)}function Gp(e,n){n===0&&(n=Mo()),e=Fi(e,n),e!==null&&(Ki(e,n),Mn(e))}function cw(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),Gp(e,l)}function fw(e,n){var l=0;switch(e.tag){case 31:case 13:var o=e.stateNode,f=e.memoizedState;f!==null&&(l=f.retryLane);break;case 19:o=e.stateNode;break;case 22:o=e.stateNode._retryCache;break;default:throw Error(a(314))}o!==null&&o.delete(n),Gp(e,l)}function dw(e,n){return At(e,n)}var Dr=null,fl=null,Wf=!1,Lr=!1,Pf=!1,Ci=0;function Mn(e){e!==fl&&e.next===null&&(fl===null?Dr=fl=e:fl=fl.next=e),Lr=!0,Wf||(Wf=!0,mw())}function ka(e,n){if(!Pf&&Lr){Pf=!0;do for(var l=!1,o=Dr;o!==null;){if(e!==0){var f=o.pendingLanes;if(f===0)var d=0;else{var b=o.suspendedLanes,A=o.pingedLanes;d=(1<<31-xt(42|e)+1)-1,d&=f&~(b&~A),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(l=!0,Qp(o,d))}else d=Me,d=Ds(o,o===Ve?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(d&3)===0||Xi(o,d)||(l=!0,Qp(o,d));o=o.next}while(l);Pf=!1}}function hw(){Xp()}function Xp(){Lr=Wf=!1;var e=0;Ci!==0&&_w()&&(e=Ci);for(var n=tt(),l=null,o=Dr;o!==null;){var f=o.next,d=Kp(o,n);d===0?(o.next=null,l===null?Dr=f:l.next=f,f===null&&(fl=l)):(l=o,(e!==0||(d&3)!==0)&&(Lr=!0)),o=f}ft!==0&&ft!==5||ka(e),Ci!==0&&(Ci=0)}function Kp(e,n){for(var l=e.suspendedLanes,o=e.pingedLanes,f=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var b=31-xt(d),A=1<<b,B=f[b];B===-1?((A&l)===0||(A&o)!==0)&&(f[b]=hc(A,n)):B<=n&&(e.expiredLanes|=A),d&=~A}if(n=Ve,l=Me,l=Ds(e,e===n?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,l===0||e===n&&(ke===2||ke===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Ht(o),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Xi(e,l)){if(n=l&-l,n===e.callbackPriority)return n;switch(o!==null&&Ht(o),Fl(l)){case 2:case 8:l=Ft;break;case 32:l=Wt;break;case 268435456:l=Ms;break;default:l=Wt}return o=Zp.bind(null,e),l=At(l,o),e.callbackPriority=n,e.callbackNode=l,n}return o!==null&&o!==null&&Ht(o),e.callbackPriority=2,e.callbackNode=null,2}function Zp(e,n){if(ft!==0&&ft!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(zr()&&e.callbackNode!==l)return null;var o=Me;return o=Ds(e,e===Ve?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Mp(e,o,n),Kp(e,tt()),e.callbackNode!=null&&e.callbackNode===l?Zp.bind(null,e):null)}function Qp(e,n){if(zr())return null;Mp(e,n,!0)}function mw(){Aw(function(){(Be&6)!==0?At(Jt,hw):Xp()})}function ed(){if(Ci===0){var e=Js;e===0&&(e=Cs,Cs<<=1,(Cs&261888)===0&&(Cs=256)),Ci=e}return Ci}function Ip(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:qo(""+e)}function Jp(e,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,e.id&&l.setAttribute("form",e.id),n.parentNode.insertBefore(l,n),e=new FormData(e),l.parentNode.removeChild(l),e}function gw(e,n,l,o,f){if(n==="submit"&&l&&l.stateNode===f){var d=Ip((f[vt]||null).action),b=o.submitter;b&&(n=(n=b[vt]||null)?Ip(n.formAction):b.getAttribute("formAction"),n!==null&&(d=n,b=null));var A=new Xo("action","action",null,o,f);e.push({event:A,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Ci!==0){var B=b?Jp(f,b):new FormData(f);Sf(l,{pending:!0,data:B,method:f.method,action:d},null,B)}}else typeof d=="function"&&(A.preventDefault(),B=b?Jp(f,b):new FormData(f),Sf(l,{pending:!0,data:B,method:f.method,action:d},d,B))},currentTarget:f}]})}}for(var td=0;td<kc.length;td++){var nd=kc[td],pw=nd.toLowerCase(),yw=nd[0].toUpperCase()+nd.slice(1);dn(pw,"on"+yw)}dn(Tm,"onAnimationEnd"),dn(Mm,"onAnimationIteration"),dn(Cm,"onAnimationStart"),dn("dblclick","onDoubleClick"),dn("focusin","onFocus"),dn("focusout","onBlur"),dn(LS,"onTransitionRun"),dn(RS,"onTransitionStart"),dn(BS,"onTransitionCancel"),dn(Om,"onTransitionEnd"),fi("onMouseEnter",["mouseout","mouseover"]),fi("onMouseLeave",["mouseout","mouseover"]),fi("onPointerEnter",["pointerout","pointerover"]),fi("onPointerLeave",["pointerout","pointerover"]),Hn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Hn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Hn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Hn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Hn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Hn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ha="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(" "),vw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ha));function Fp(e,n){n=(n&4)!==0;for(var l=0;l<e.length;l++){var o=e[l],f=o.event;o=o.listeners;e:{var d=void 0;if(n)for(var b=o.length-1;0<=b;b--){var A=o[b],B=A.instance,Q=A.currentTarget;if(A=A.listener,B!==d&&f.isPropagationStopped())break e;d=A,f.currentTarget=Q;try{d(f)}catch(ne){Qo(ne)}f.currentTarget=null,d=B}else for(b=0;b<o.length;b++){if(A=o[b],B=A.instance,Q=A.currentTarget,A=A.listener,B!==d&&f.isPropagationStopped())break e;d=A,f.currentTarget=Q;try{d(f)}catch(ne){Qo(ne)}f.currentTarget=null,d=B}}}}function Te(e,n){var l=n[Ls];l===void 0&&(l=n[Ls]=new Set);var o=e+"__bubble";l.has(o)||(Wp(n,e,2,!1),l.add(o))}function id(e,n,l){var o=0;n&&(o|=4),Wp(l,e,o,n)}var Rr="_reactListening"+Math.random().toString(36).slice(2);function sd(e){if(!e[Rr]){e[Rr]=!0,ko.forEach(function(l){l!=="selectionchange"&&(vw.has(l)||id(l,!1,e),id(l,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Rr]||(n[Rr]=!0,id("selectionchange",!1,n))}}function Wp(e,n,l,o){switch(Ty(n)){case 2:var f=Kw;break;case 8:f=Zw;break;default:f=bd}l=f.bind(null,n,l,e),f=void 0,!Ec||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(f=!0),o?f!==void 0?e.addEventListener(n,l,{capture:!0,passive:f}):e.addEventListener(n,l,!0):f!==void 0?e.addEventListener(n,l,{passive:f}):e.addEventListener(n,l,!1)}function ld(e,n,l,o,f){var d=o;if((n&1)===0&&(n&2)===0&&o!==null)e:for(;;){if(o===null)return;var b=o.tag;if(b===3||b===4){var A=o.stateNode.containerInfo;if(A===f)break;if(b===4)for(b=o.return;b!==null;){var B=b.tag;if((B===3||B===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;A!==null;){if(b=oi(A),b===null)return;if(B=b.tag,B===5||B===6||B===26||B===27){o=d=b;continue e}A=A.parentNode}}o=o.return}im(function(){var Q=d,ne=wc(l),le=[];e:{var J=zm.get(e);if(J!==void 0){var W=Xo,he=e;switch(e){case"keypress":if(Yo(l)===0)break e;case"keydown":case"keyup":W=fS;break;case"focusin":he="focus",W=Tc;break;case"focusout":he="blur",W=Tc;break;case"beforeblur":case"afterblur":W=Tc;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":W=am;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":W=Pb;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":W=mS;break;case Tm:case Mm:case Cm:W=nS;break;case Om:W=pS;break;case"scroll":case"scrollend":W=Fb;break;case"wheel":W=vS;break;case"copy":case"cut":case"paste":W=sS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":W=rm;break;case"toggle":case"beforetoggle":W=SS}var ve=(n&4)!==0,qe=!ve&&(e==="scroll"||e==="scrollend"),V=ve?J!==null?J+"Capture":null:J;ve=[];for(var U=Q,Z;U!==null;){var se=U;if(Z=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||Z===null||V===null||(se=la(U,V),se!=null&&ve.push(ja(U,se,Z))),qe)break;U=U.return}0<ve.length&&(J=new W(J,he,null,l,ne),le.push({event:J,listeners:ve}))}}if((n&7)===0){e:{if(J=e==="mouseover"||e==="pointerover",W=e==="mouseout"||e==="pointerout",J&&l!==Sc&&(he=l.relatedTarget||l.fromElement)&&(oi(he)||he[kn]))break e;if((W||J)&&(J=ne.window===ne?ne:(J=ne.ownerDocument)?J.defaultView||J.parentWindow:window,W?(he=l.relatedTarget||l.toElement,W=Q,he=he?oi(he):null,he!==null&&(qe=u(he),ve=he.tag,he!==qe||ve!==5&&ve!==27&&ve!==6)&&(he=null)):(W=null,he=Q),W!==he)){if(ve=am,se="onMouseLeave",V="onMouseEnter",U="mouse",(e==="pointerout"||e==="pointerover")&&(ve=rm,se="onPointerLeave",V="onPointerEnter",U="pointer"),qe=W==null?J:ui(W),Z=he==null?J:ui(he),J=new ve(se,U+"leave",W,l,ne),J.target=qe,J.relatedTarget=Z,se=null,oi(ne)===Q&&(ve=new ve(V,U+"enter",he,l,ne),ve.target=Z,ve.relatedTarget=qe,se=ve),qe=se,W&&he)t:{for(ve=bw,V=W,U=he,Z=0,se=V;se;se=ve(se))Z++;se=0;for(var pe=U;pe;pe=ve(pe))se++;for(;0<Z-se;)V=ve(V),Z--;for(;0<se-Z;)U=ve(U),se--;for(;Z--;){if(V===U||U!==null&&V===U.alternate){ve=V;break t}V=ve(V),U=ve(U)}ve=null}else ve=null;W!==null&&Pp(le,J,W,ve,!1),he!==null&&qe!==null&&Pp(le,qe,he,ve,!0)}}e:{if(J=Q?ui(Q):window,W=J.nodeName&&J.nodeName.toLowerCase(),W==="select"||W==="input"&&J.type==="file")var Le=pm;else if(mm(J))if(ym)Le=OS;else{Le=MS;var me=TS}else W=J.nodeName,!W||W.toLowerCase()!=="input"||J.type!=="checkbox"&&J.type!=="radio"?Q&&bc(Q.elementType)&&(Le=pm):Le=CS;if(Le&&(Le=Le(e,Q))){gm(le,Le,l,ne);break e}me&&me(e,J,Q),e==="focusout"&&Q&&J.type==="number"&&Q.memoizedProps.value!=null&&ia(J,"number",J.value)}switch(me=Q?ui(Q):window,e){case"focusin":(mm(me)||me.contentEditable==="true")&&(Vs=me,Lc=Q,ha=null);break;case"focusout":ha=Lc=Vs=null;break;case"mousedown":Rc=!0;break;case"contextmenu":case"mouseup":case"dragend":Rc=!1,Nm(le,l,ne);break;case"selectionchange":if(DS)break;case"keydown":case"keyup":Nm(le,l,ne)}var Ne;if(Cc)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 qs?dm(e,l)&&(Ce="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ce="onCompositionStart");Ce&&(um&&l.locale!=="ko"&&(qs||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&qs&&(Ne=sm()):(hi=ne,_c="value"in hi?hi.value:hi.textContent,qs=!0)),me=Br(Q,Ce),0<me.length&&(Ce=new om(Ce,e,null,l,ne),le.push({event:Ce,listeners:me}),Ne?Ce.data=Ne:(Ne=hm(l),Ne!==null&&(Ce.data=Ne)))),(Ne=xS?ES(e,l):_S(e,l))&&(Ce=Br(Q,"onBeforeInput"),0<Ce.length&&(me=new om("onBeforeInput","beforeinput",null,l,ne),le.push({event:me,listeners:Ce}),me.data=Ne)),gw(le,e,Q,l,ne)}Fp(le,n)})}function ja(e,n,l){return{instance:e,listener:n,currentTarget:l}}function Br(e,n){for(var l=n+"Capture",o=[];e!==null;){var f=e,d=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||d===null||(f=la(e,l),f!=null&&o.unshift(ja(e,f,d)),f=la(e,n),f!=null&&o.push(ja(e,f,d))),e.tag===3)return o;e=e.return}return[]}function bw(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Pp(e,n,l,o,f){for(var d=n._reactName,b=[];l!==null&&l!==o;){var A=l,B=A.alternate,Q=A.stateNode;if(A=A.tag,B!==null&&B===o)break;A!==5&&A!==26&&A!==27||Q===null||(B=Q,f?(Q=la(l,d),Q!=null&&b.unshift(ja(l,Q,B))):f||(Q=la(l,d),Q!=null&&b.push(ja(l,Q,B)))),l=l.return}b.length!==0&&e.push({event:n,listeners:b})}var Sw=/\r\n?/g,ww=/\u0000|\uFFFD/g;function ey(e){return(typeof e=="string"?e:""+e).replace(Sw,`
9
+ `).replace(ww,"")}function ty(e,n){return n=ey(n),ey(e)===n}function Ue(e,n,l,o,f,d){switch(l){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||js(e,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&js(e,""+o);break;case"className":Bs(e,"class",o);break;case"tabIndex":Bs(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Bs(e,l,o);break;case"style":tm(e,o,d);break;case"data":if(n!=="object"){Bs(e,"data",o);break}case"src":case"href":if(o===""&&(n!=="a"||l!=="href")){e.removeAttribute(l);break}if(o==null||typeof o=="function"||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(l);break}o=qo(""+o),e.setAttribute(l,o);break;case"action":case"formAction":if(typeof o=="function"){e.setAttribute(l,"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 d=="function"&&(l==="formAction"?(n!=="input"&&Ue(e,n,"name",f.name,f,null),Ue(e,n,"formEncType",f.formEncType,f,null),Ue(e,n,"formMethod",f.formMethod,f,null),Ue(e,n,"formTarget",f.formTarget,f,null)):(Ue(e,n,"encType",f.encType,f,null),Ue(e,n,"method",f.method,f,null),Ue(e,n,"target",f.target,f,null)));if(o==null||typeof o=="symbol"||typeof o=="boolean"){e.removeAttribute(l);break}o=qo(""+o),e.setAttribute(l,o);break;case"onClick":o!=null&&(e.onclick=jn);break;case"onScroll":o!=null&&Te("scroll",e);break;case"onScrollEnd":o!=null&&Te("scrollend",e);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(a(60));e.innerHTML=l}}break;case"multiple":e.multiple=o&&typeof o!="function"&&typeof o!="symbol";break;case"muted":e.muted=o&&typeof o!="function"&&typeof o!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(o==null||typeof o=="function"||typeof o=="boolean"||typeof o=="symbol"){e.removeAttribute("xlink:href");break}l=qo(""+o),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(l,""+o):e.removeAttribute(l);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":o&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":o===!0?e.setAttribute(l,""):o!==!1&&o!=null&&typeof o!="function"&&typeof o!="symbol"?e.setAttribute(l,o):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":o!=null&&typeof o!="function"&&typeof o!="symbol"&&!isNaN(o)&&1<=o?e.setAttribute(l,o):e.removeAttribute(l);break;case"rowSpan":case"start":o==null||typeof o=="function"||typeof o=="symbol"||isNaN(o)?e.removeAttribute(l):e.setAttribute(l,o);break;case"popover":Te("beforetoggle",e),Te("toggle",e),Rs(e,"popover",o);break;case"xlinkActuate":fn(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":fn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":fn(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":fn(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":fn(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":fn(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":fn(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":fn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":fn(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Rs(e,"is",o);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Ib.get(l)||l,Rs(e,l,o))}}function ad(e,n,l,o,f,d){switch(l){case"style":tm(e,o,d);break;case"dangerouslySetInnerHTML":if(o!=null){if(typeof o!="object"||!("__html"in o))throw Error(a(61));if(l=o.__html,l!=null){if(f.children!=null)throw Error(a(60));e.innerHTML=l}}break;case"children":typeof o=="string"?js(e,o):(typeof o=="number"||typeof o=="bigint")&&js(e,""+o);break;case"onScroll":o!=null&&Te("scroll",e);break;case"onScrollEnd":o!=null&&Te("scrollend",e);break;case"onClick":o!=null&&(e.onclick=jn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ho.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),n=l.slice(2,f?l.length-7:void 0),d=e[vt]||null,d=d!=null?d[l]:null,typeof d=="function"&&e.removeEventListener(n,d,f),typeof o=="function")){typeof d!="function"&&d!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(n,o,f);break e}l in e?e[l]=o:o===!0?e.setAttribute(l,""):Rs(e,l,o)}}}function pt(e,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Te("error",e),Te("load",e);var o=!1,f=!1,d;for(d in l)if(l.hasOwnProperty(d)){var b=l[d];if(b!=null)switch(d){case"src":o=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Ue(e,n,d,b,l,null)}}f&&Ue(e,n,"srcSet",l.srcSet,l,null),o&&Ue(e,n,"src",l.src,l,null);return;case"input":Te("invalid",e);var A=d=b=f=null,B=null,Q=null;for(o in l)if(l.hasOwnProperty(o)){var ne=l[o];if(ne!=null)switch(o){case"name":f=ne;break;case"type":b=ne;break;case"checked":B=ne;break;case"defaultChecked":Q=ne;break;case"value":d=ne;break;case"defaultValue":A=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,n));break;default:Ue(e,n,o,ne,l,null)}}Hs(e,d,A,B,Q,b,f,!1);return;case"select":Te("invalid",e),o=b=d=null;for(f in l)if(l.hasOwnProperty(f)&&(A=l[f],A!=null))switch(f){case"value":d=A;break;case"defaultValue":b=A;break;case"multiple":o=A;default:Ue(e,n,f,A,l,null)}n=d,l=b,e.multiple=!!o,n!=null?di(e,!!o,n,!1):l!=null&&di(e,!!o,l,!0);return;case"textarea":Te("invalid",e),d=f=o=null;for(b in l)if(l.hasOwnProperty(b)&&(A=l[b],A!=null))switch(b){case"value":o=A;break;case"defaultValue":f=A;break;case"children":d=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(a(91));break;default:Ue(e,n,b,A,l,null)}Ph(e,o,f,d);return;case"option":for(B in l)l.hasOwnProperty(B)&&(o=l[B],o!=null)&&(B==="selected"?e.selected=o&&typeof o!="function"&&typeof o!="symbol":Ue(e,n,B,o,l,null));return;case"dialog":Te("beforetoggle",e),Te("toggle",e),Te("cancel",e),Te("close",e);break;case"iframe":case"object":Te("load",e);break;case"video":case"audio":for(o=0;o<Ha.length;o++)Te(Ha[o],e);break;case"image":Te("error",e),Te("load",e);break;case"details":Te("toggle",e);break;case"embed":case"source":case"link":Te("error",e),Te("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Q in l)if(l.hasOwnProperty(Q)&&(o=l[Q],o!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Ue(e,n,Q,o,l,null)}return;default:if(bc(n)){for(ne in l)l.hasOwnProperty(ne)&&(o=l[ne],o!==void 0&&ad(e,n,ne,o,l,void 0));return}}for(A in l)l.hasOwnProperty(A)&&(o=l[A],o!=null&&Ue(e,n,A,o,l,null))}function xw(e,n,l,o){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,d=null,b=null,A=null,B=null,Q=null,ne=null;for(W in l){var le=l[W];if(l.hasOwnProperty(W)&&le!=null)switch(W){case"checked":break;case"value":break;case"defaultValue":B=le;default:o.hasOwnProperty(W)||Ue(e,n,W,null,o,le)}}for(var J in o){var W=o[J];if(le=l[J],o.hasOwnProperty(J)&&(W!=null||le!=null))switch(J){case"type":d=W;break;case"name":f=W;break;case"checked":Q=W;break;case"defaultChecked":ne=W;break;case"value":b=W;break;case"defaultValue":A=W;break;case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,n));break;default:W!==le&&Ue(e,n,J,W,o,le)}}na(e,b,A,B,Q,ne,d,f);return;case"select":W=b=A=J=null;for(d in l)if(B=l[d],l.hasOwnProperty(d)&&B!=null)switch(d){case"value":break;case"multiple":W=B;default:o.hasOwnProperty(d)||Ue(e,n,d,null,o,B)}for(f in o)if(d=o[f],B=l[f],o.hasOwnProperty(f)&&(d!=null||B!=null))switch(f){case"value":J=d;break;case"defaultValue":A=d;break;case"multiple":b=d;default:d!==B&&Ue(e,n,f,d,o,B)}n=A,l=b,o=W,J!=null?di(e,!!l,J,!1):!!o!=!!l&&(n!=null?di(e,!!l,n,!0):di(e,!!l,l?[]:"",!1));return;case"textarea":W=J=null;for(A in l)if(f=l[A],l.hasOwnProperty(A)&&f!=null&&!o.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:Ue(e,n,A,null,o,f)}for(b in o)if(f=o[b],d=l[b],o.hasOwnProperty(b)&&(f!=null||d!=null))switch(b){case"value":J=f;break;case"defaultValue":W=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==d&&Ue(e,n,b,f,o,d)}sa(e,J,W);return;case"option":for(var he in l)J=l[he],l.hasOwnProperty(he)&&J!=null&&!o.hasOwnProperty(he)&&(he==="selected"?e.selected=!1:Ue(e,n,he,null,o,J));for(B in o)J=o[B],W=l[B],o.hasOwnProperty(B)&&J!==W&&(J!=null||W!=null)&&(B==="selected"?e.selected=J&&typeof J!="function"&&typeof J!="symbol":Ue(e,n,B,J,o,W));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ve in l)J=l[ve],l.hasOwnProperty(ve)&&J!=null&&!o.hasOwnProperty(ve)&&Ue(e,n,ve,null,o,J);for(Q in o)if(J=o[Q],W=l[Q],o.hasOwnProperty(Q)&&J!==W&&(J!=null||W!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(a(137,n));break;default:Ue(e,n,Q,J,o,W)}return;default:if(bc(n)){for(var qe in l)J=l[qe],l.hasOwnProperty(qe)&&J!==void 0&&!o.hasOwnProperty(qe)&&ad(e,n,qe,void 0,o,J);for(ne in o)J=o[ne],W=l[ne],!o.hasOwnProperty(ne)||J===W||J===void 0&&W===void 0||ad(e,n,ne,J,o,W);return}}for(var V in l)J=l[V],l.hasOwnProperty(V)&&J!=null&&!o.hasOwnProperty(V)&&Ue(e,n,V,null,o,J);for(le in o)J=o[le],W=l[le],!o.hasOwnProperty(le)||J===W||J==null&&W==null||Ue(e,n,le,J,o,W)}function ny(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ew(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,l=performance.getEntriesByType("resource"),o=0;o<l.length;o++){var f=l[o],d=f.transferSize,b=f.initiatorType,A=f.duration;if(d&&A&&ny(b)){for(b=0,A=f.responseEnd,o+=1;o<l.length;o++){var B=l[o],Q=B.startTime;if(Q>A)break;var ne=B.transferSize,le=B.initiatorType;ne&&ny(le)&&(B=B.responseEnd,b+=ne*(B<A?1:(A-Q)/(B-Q)))}if(--o,n+=8*(d+b)/(f.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var od=null,rd=null;function kr(e){return e.nodeType===9?e:e.ownerDocument}function iy(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 sy(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function ud(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var cd=null;function _w(){var e=window.event;return e&&e.type==="popstate"?e===cd?!1:(cd=e,!0):(cd=null,!1)}var ly=typeof setTimeout=="function"?setTimeout:void 0,Nw=typeof clearTimeout=="function"?clearTimeout:void 0,ay=typeof Promise=="function"?Promise:void 0,Aw=typeof queueMicrotask=="function"?queueMicrotask:typeof ay<"u"?function(e){return ay.resolve(null).then(e).catch(Tw)}:ly;function Tw(e){setTimeout(function(){throw e})}function Oi(e){return e==="head"}function oy(e,n){var l=n,o=0;do{var f=l.nextSibling;if(e.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(o===0){e.removeChild(f),gl(n);return}o--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")o++;else if(l==="html")$a(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,$a(l);for(var d=l.firstChild;d;){var b=d.nextSibling,A=d.nodeName;d[Zi]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&d.rel.toLowerCase()==="stylesheet"||l.removeChild(d),d=b}}else l==="body"&&$a(e.ownerDocument.body);l=f}while(l);gl(n)}function ry(e,n){var l=e;e=0;do{var o=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),o&&o.nodeType===8)if(l=o.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=o}while(l)}function fd(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":fd(l),Wl(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Mw(e,n,l,o){for(;e.nodeType===1;){var f=l;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!o&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(o){if(!e[Zi])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var d=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=an(e.nextSibling),e===null)break}return null}function Cw(e,n,l){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=an(e.nextSibling),e===null))return null;return e}function uy(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=an(e.nextSibling),e===null))return null;return e}function dd(e){return e.data==="$?"||e.data==="$~"}function hd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Ow(e,n){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||l.readyState!=="loading")n();else{var o=function(){n(),l.removeEventListener("DOMContentLoaded",o)};l.addEventListener("DOMContentLoaded",o),e._reactRetry=o}}function an(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var md=null;function cy(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(n===0)return an(e.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}e=e.nextSibling}return null}function fy(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return e;n--}else l!=="/$"&&l!=="/&"||n++}e=e.previousSibling}return null}function dy(e,n,l){switch(n=kr(l),e){case"html":if(e=n.documentElement,!e)throw Error(a(452));return e;case"head":if(e=n.head,!e)throw Error(a(453));return e;case"body":if(e=n.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function $a(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Wl(e)}var on=new Map,hy=new Set;function Hr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ei=z.d;z.d={f:zw,r:Dw,D:Lw,C:Rw,L:Bw,m:kw,X:jw,S:Hw,M:$w};function zw(){var e=ei.f(),n=Mr();return e||n}function Dw(e){var n=ri(e);n!==null&&n.tag===5&&n.type==="form"?Og(n):ei.r(e)}var dl=typeof document>"u"?null:document;function my(e,n,l){var o=dl;if(o&&typeof n=="string"&&n){var f=Mt(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),hy.has(f)||(hy.add(f),e={rel:e,crossOrigin:l,href:n},o.querySelector(f)===null&&(n=o.createElement("link"),pt(n,"link",e),st(n),o.head.appendChild(n)))}}function Lw(e){ei.D(e),my("dns-prefetch",e,null)}function Rw(e,n){ei.C(e,n),my("preconnect",e,n)}function Bw(e,n,l){ei.L(e,n,l);var o=dl;if(o&&e&&n){var f='link[rel="preload"][as="'+Mt(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Mt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Mt(l.imageSizes)+'"]')):f+='[href="'+Mt(e)+'"]';var d=f;switch(n){case"style":d=hl(e);break;case"script":d=ml(e)}on.has(d)||(e=p({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:e,as:n},l),on.set(d,e),o.querySelector(f)!==null||n==="style"&&o.querySelector(Ua(d))||n==="script"&&o.querySelector(qa(d))||(n=o.createElement("link"),pt(n,"link",e),st(n),o.head.appendChild(n)))}}function kw(e,n){ei.m(e,n);var l=dl;if(l&&e){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+Mt(o)+'"][href="'+Mt(e)+'"]',d=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=ml(e)}if(!on.has(d)&&(e=p({rel:"modulepreload",href:e},n),on.set(d,e),l.querySelector(f)===null)){switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(qa(d)))return}o=l.createElement("link"),pt(o,"link",e),st(o),l.head.appendChild(o)}}}function Hw(e,n,l){ei.S(e,n,l);var o=dl;if(o&&e){var f=ci(o).hoistableStyles,d=hl(e);n=n||"default";var b=f.get(d);if(!b){var A={loading:0,preload:null};if(b=o.querySelector(Ua(d)))A.loading=5;else{e=p({rel:"stylesheet",href:e,"data-precedence":n},l),(l=on.get(d))&&gd(e,l);var B=b=o.createElement("link");st(B),pt(B,"link",e),B._p=new Promise(function(Q,ne){B.onload=Q,B.onerror=ne}),B.addEventListener("load",function(){A.loading|=1}),B.addEventListener("error",function(){A.loading|=2}),A.loading|=4,jr(b,n,o)}b={type:"stylesheet",instance:b,count:1,state:A},f.set(d,b)}}}function jw(e,n){ei.X(e,n);var l=dl;if(l&&e){var o=ci(l).hoistableScripts,f=ml(e),d=o.get(f);d||(d=l.querySelector(qa(f)),d||(e=p({src:e,async:!0},n),(n=on.get(f))&&pd(e,n),d=l.createElement("script"),st(d),pt(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(f,d))}}function $w(e,n){ei.M(e,n);var l=dl;if(l&&e){var o=ci(l).hoistableScripts,f=ml(e),d=o.get(f);d||(d=l.querySelector(qa(f)),d||(e=p({src:e,async:!0,type:"module"},n),(n=on.get(f))&&pd(e,n),d=l.createElement("script"),st(d),pt(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(f,d))}}function gy(e,n,l,o){var f=(f=de.current)?Hr(f):null;if(!f)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(n=hl(l.href),l=ci(f).hoistableStyles,o=l.get(n),o||(o={type:"style",instance:null,count:0,state:null},l.set(n,o)),o):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=hl(l.href);var d=ci(f).hoistableStyles,b=d.get(e);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,b),(d=f.querySelector(Ua(e)))&&!d._p&&(b.instance=d,b.state.loading=5),on.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},on.set(e,l),d||Uw(f,e,l,b.state))),n&&o===null)throw Error(a(528,""));return b}if(n&&o!==null)throw Error(a(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=ml(l),l=ci(f).hoistableScripts,o=l.get(n),o||(o={type:"script",instance:null,count:0,state:null},l.set(n,o)),o):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function hl(e){return'href="'+Mt(e)+'"'}function Ua(e){return'link[rel="stylesheet"]['+e+"]"}function py(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function Uw(e,n,l,o){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?o.loading=1:(n=e.createElement("link"),o.preload=n,n.addEventListener("load",function(){return o.loading|=1}),n.addEventListener("error",function(){return o.loading|=2}),pt(n,"link",l),st(n),e.head.appendChild(n))}function ml(e){return'[src="'+Mt(e)+'"]'}function qa(e){return"script[async]"+e}function yy(e,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var o=e.querySelector('style[data-href~="'+Mt(l.href)+'"]');if(o)return n.instance=o,st(o),o;var f=p({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return o=(e.ownerDocument||e).createElement("style"),st(o),pt(o,"style",f),jr(o,l.precedence,e),n.instance=o;case"stylesheet":f=hl(l.href);var d=e.querySelector(Ua(f));if(d)return n.state.loading|=4,n.instance=d,st(d),d;o=py(l),(f=on.get(f))&&gd(o,f),d=(e.ownerDocument||e).createElement("link"),st(d);var b=d;return b._p=new Promise(function(A,B){b.onload=A,b.onerror=B}),pt(d,"link",o),n.state.loading|=4,jr(d,l.precedence,e),n.instance=d;case"script":return d=ml(l.src),(f=e.querySelector(qa(d)))?(n.instance=f,st(f),f):(o=l,(f=on.get(d))&&(o=p({},l),pd(o,f)),e=e.ownerDocument||e,f=e.createElement("script"),st(f),pt(f,"link",o),e.head.appendChild(f),n.instance=f);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(o=n.instance,n.state.loading|=4,jr(o,l.precedence,e));return n.instance}function jr(e,n,l){for(var o=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=o.length?o[o.length-1]:null,d=f,b=0;b<o.length;b++){var A=o[b];if(A.dataset.precedence===n)d=A;else if(d!==f)break}d?d.parentNode.insertBefore(e,d.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(e,n.firstChild))}function gd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function pd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var $r=null;function vy(e,n,l){if($r===null){var o=new Map,f=$r=new Map;f.set(l,o)}else f=$r,o=f.get(l),o||(o=new Map,f.set(l,o));if(o.has(e))return o;for(o.set(e,null),l=l.getElementsByTagName(e),f=0;f<l.length;f++){var d=l[f];if(!(d[Zi]||d[ct]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var b=d.getAttribute(n)||"";b=e+b;var A=o.get(b);A?A.push(d):o.set(b,[d])}}return o}function by(e,n,l){e=e.ownerDocument||e,e.head.insertBefore(l,n==="title"?e.querySelector("head > title"):null)}function qw(e,n,l){if(l===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;return n.rel==="stylesheet"?(e=n.disabled,typeof n.precedence=="string"&&e==null):!0;case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Sy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Vw(e,n,l,o){if(l.type==="stylesheet"&&(typeof o.media!="string"||matchMedia(o.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=hl(o.href),d=n.querySelector(Ua(f));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Ur.bind(e),n.then(e,e)),l.state.loading|=4,l.instance=d,st(d);return}d=n.ownerDocument||n,o=py(o),(f=on.get(f))&&gd(o,f),d=d.createElement("link"),st(d);var b=d;b._p=new Promise(function(A,B){b.onload=A,b.onerror=B}),pt(d,"link",o),l.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Ur.bind(e),n.addEventListener("load",l),n.addEventListener("error",l))}}var yd=0;function Yw(e,n){return e.stylesheets&&e.count===0&&Vr(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var o=setTimeout(function(){if(e.stylesheets&&Vr(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+n);0<e.imgBytes&&yd===0&&(yd=62500*Ew());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Vr(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>yd?50:800)+n);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function Ur(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Vr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var qr=null;function Vr(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,qr=new Map,n.forEach(Gw,e),qr=null,Ur.call(e))}function Gw(e,n){if(!(n.state.loading&4)){var l=qr.get(e);if(l)var o=l.get(null);else{l=new Map,qr.set(e,l);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<f.length;d++){var b=f[d];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(l.set(b.dataset.precedence,b),o=b)}o&&l.set(null,o)}f=n.instance,b=f.getAttribute("data-precedence"),d=l.get(b)||o,d===o&&l.set(null,f),l.set(b,f),this.count++,o=Ur.bind(this),f.addEventListener("load",o),f.addEventListener("error",o),d?d.parentNode.insertBefore(f,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),n.state.loading|=4}}var Va={$$typeof:N,Provider:null,Consumer:null,_currentValue:q,_currentValue2:q,_threadCount:0};function Xw(e,n,l,o,f,d,b,A,B){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=Il(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Il(0),this.hiddenUpdates=Il(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=d,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=B,this.incompleteTransitions=new Map}function wy(e,n,l,o,f,d,b,A,B,Q,ne,le){return e=new Xw(e,n,l,b,B,Q,ne,le,A),n=1,d===!0&&(n|=24),d=Ut(3,null,null,n),e.current=d,d.stateNode=e,n=Ic(),n.refCount++,e.pooledCache=n,n.refCount++,d.memoizedState={element:o,isDehydrated:l,cache:n},Pc(d),e}function xy(e){return e?(e=Xs,e):Xs}function Ey(e,n,l,o,f,d){f=xy(f),o.context===null?o.context=f:o.pendingContext=f,o=bi(n),o.payload={element:l},d=d===void 0?null:d,d!==null&&(o.callback=d),l=Si(e,o,n),l!==null&&(Rt(l,e,n),Sa(l,e,n))}function _y(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<n?l:n}}function vd(e,n){_y(e,n),(e=e.alternate)&&_y(e,n)}function Ny(e){if(e.tag===13||e.tag===31){var n=Fi(e,67108864);n!==null&&Rt(n,e,67108864),vd(e,67108864)}}function Ay(e){if(e.tag===13||e.tag===31){var n=Xt();n=Jl(n);var l=Fi(e,n);l!==null&&Rt(l,e,n),vd(e,n)}}var Yr=!0;function Kw(e,n,l,o){var f=T.T;T.T=null;var d=z.p;try{z.p=2,bd(e,n,l,o)}finally{z.p=d,T.T=f}}function Zw(e,n,l,o){var f=T.T;T.T=null;var d=z.p;try{z.p=8,bd(e,n,l,o)}finally{z.p=d,T.T=f}}function bd(e,n,l,o){if(Yr){var f=Sd(o);if(f===null)ld(e,n,o,Gr,l),My(e,o);else if(Iw(f,e,n,l,o))o.stopPropagation();else if(My(e,o),n&4&&-1<Qw.indexOf(e)){for(;f!==null;){var d=ri(f);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var b=Bn(d.pendingLanes);if(b!==0){var A=d;for(A.pendingLanes|=2,A.entangledLanes|=2;b;){var B=1<<31-xt(b);A.entanglements[1]|=B,b&=~B}Mn(d),(Be&6)===0&&(Ar=tt()+500,ka(0))}}break;case 31:case 13:A=Fi(d,2),A!==null&&Rt(A,d,2),Mr(),vd(d,2)}if(d=Sd(o),d===null&&ld(e,n,o,Gr,l),d===f)break;f=d}f!==null&&o.stopPropagation()}else ld(e,n,o,null,l)}}function Sd(e){return e=wc(e),wd(e)}var Gr=null;function wd(e){if(Gr=null,e=oi(e),e!==null){var n=u(e);if(n===null)e=null;else{var l=n.tag;if(l===13){if(e=c(n),e!==null)return e;e=null}else if(l===31){if(e=m(n),e!==null)return e;e=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return Gr=e,null}function Ty(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(jt()){case Jt:return 2;case Ft:return 8;case Wt:case oc:return 32;case Ms:return 268435456;default:return 32}default:return 32}}var xd=!1,zi=null,Di=null,Li=null,Ya=new Map,Ga=new Map,Ri=[],Qw="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 My(e,n){switch(e){case"focusin":case"focusout":zi=null;break;case"dragenter":case"dragleave":Di=null;break;case"mouseover":case"mouseout":Li=null;break;case"pointerover":case"pointerout":Ya.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ga.delete(n.pointerId)}}function Xa(e,n,l,o,f,d){return e===null||e.nativeEvent!==d?(e={blockedOn:n,domEventName:l,eventSystemFlags:o,nativeEvent:d,targetContainers:[f]},n!==null&&(n=ri(n),n!==null&&Ny(n)),e):(e.eventSystemFlags|=o,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function Iw(e,n,l,o,f){switch(n){case"focusin":return zi=Xa(zi,e,n,l,o,f),!0;case"dragenter":return Di=Xa(Di,e,n,l,o,f),!0;case"mouseover":return Li=Xa(Li,e,n,l,o,f),!0;case"pointerover":var d=f.pointerId;return Ya.set(d,Xa(Ya.get(d)||null,e,n,l,o,f)),!0;case"gotpointercapture":return d=f.pointerId,Ga.set(d,Xa(Ga.get(d)||null,e,n,l,o,f)),!0}return!1}function Cy(e){var n=oi(e.target);if(n!==null){var l=u(n);if(l!==null){if(n=l.tag,n===13){if(n=c(l),n!==null){e.blockedOn=n,Lo(e.priority,function(){Ay(l)});return}}else if(n===31){if(n=m(l),n!==null){e.blockedOn=n,Lo(e.priority,function(){Ay(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Xr(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var l=Sd(e.nativeEvent);if(l===null){l=e.nativeEvent;var o=new l.constructor(l.type,l);Sc=o,l.target.dispatchEvent(o),Sc=null}else return n=ri(l),n!==null&&Ny(n),e.blockedOn=l,!1;n.shift()}return!0}function Oy(e,n,l){Xr(e)&&l.delete(n)}function Jw(){xd=!1,zi!==null&&Xr(zi)&&(zi=null),Di!==null&&Xr(Di)&&(Di=null),Li!==null&&Xr(Li)&&(Li=null),Ya.forEach(Oy),Ga.forEach(Oy)}function Kr(e,n){e.blockedOn===n&&(e.blockedOn=null,xd||(xd=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Jw)))}var Zr=null;function zy(e){Zr!==e&&(Zr=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Zr===e&&(Zr=null);for(var n=0;n<e.length;n+=3){var l=e[n],o=e[n+1],f=e[n+2];if(typeof o!="function"){if(wd(o||l)===null)continue;break}var d=ri(l);d!==null&&(e.splice(n,3),n-=3,Sf(d,{pending:!0,data:f,method:l.method,action:o},o,f))}}))}function gl(e){function n(B){return Kr(B,e)}zi!==null&&Kr(zi,e),Di!==null&&Kr(Di,e),Li!==null&&Kr(Li,e),Ya.forEach(n),Ga.forEach(n);for(var l=0;l<Ri.length;l++){var o=Ri[l];o.blockedOn===e&&(o.blockedOn=null)}for(;0<Ri.length&&(l=Ri[0],l.blockedOn===null);)Cy(l),l.blockedOn===null&&Ri.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(o=0;o<l.length;o+=3){var f=l[o],d=l[o+1],b=f[vt]||null;if(typeof d=="function")b||zy(l);else if(b){var A=null;if(d&&d.hasAttribute("formAction")){if(f=d,b=d[vt]||null)A=b.formAction;else if(wd(f)!==null)continue}else A=b.action;typeof A=="function"?l[o+1]=A:(l.splice(o,3),o-=3),zy(l)}}}function Dy(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(b){return f=b})},focusReset:"manual",scroll:"manual"})}function n(){f!==null&&(f(),f=null),o||setTimeout(l,20)}function l(){if(!o&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var o=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){o=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),f!==null&&(f(),f=null)}}}function Ed(e){this._internalRoot=e}Qr.prototype.render=Ed.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var l=n.current,o=Xt();Ey(l,o,e,n,null,null)},Qr.prototype.unmount=Ed.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Ey(e.current,2,null,e,null,null),Mr(),n[kn]=null}};function Qr(e){this._internalRoot=e}Qr.prototype.unstable_scheduleHydration=function(e){if(e){var n=Do();e={blockedOn:null,target:e,priority:n};for(var l=0;l<Ri.length&&n!==0&&n<Ri[l].priority;l++);Ri.splice(l,0,e),l===0&&Cy(e)}};var Ly=i.version;if(Ly!=="19.2.7")throw Error(a(527,Ly,"19.2.7"));z.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=g(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var Fw={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:T,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ir=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ir.isDisabled&&Ir.supportsFiber)try{Gi=Ir.inject(Fw),wt=Ir}catch{}}return Za.createRoot=function(e,n){if(!r(e))throw Error(a(299));var l=!1,o="",f=Ug,d=qg,b=Vg;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(o=n.identifierPrefix),n.onUncaughtError!==void 0&&(f=n.onUncaughtError),n.onCaughtError!==void 0&&(d=n.onCaughtError),n.onRecoverableError!==void 0&&(b=n.onRecoverableError)),n=wy(e,1,!1,null,null,l,o,null,f,d,b,Dy),e[kn]=n.current,sd(e),new Ed(n)},Za.hydrateRoot=function(e,n,l){if(!r(e))throw Error(a(299));var o=!1,f="",d=Ug,b=qg,A=Vg,B=null;return l!=null&&(l.unstable_strictMode===!0&&(o=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(d=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(A=l.onRecoverableError),l.formState!==void 0&&(B=l.formState)),n=wy(e,1,!0,n,l??null,o,f,B,d,b,A,Dy),n.context=xy(null),l=n.current,o=Xt(),o=Jl(o),f=bi(o),f.callback=null,Si(l,f,o),l=o,n.current.lanes=l,Ki(n,l),Mn(n),e[kn]=n.current,sd(e),new Qr(n)},Za.version="19.2.7",Za}var Yy;function ax(){if(Yy)return Ad.exports;Yy=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(i){console.error(i)}}return t(),Ad.exports=lx(),Ad.exports}var ox=ax();function ut(t){if(typeof t=="string"||typeof t=="number")return""+t;let i="";if(Array.isArray(t))for(let s=0,a;s<t.length;s++)(a=ut(t[s]))!==""&&(i+=(i&&" ")+a);else for(let s in t)t[s]&&(i+=(i&&" ")+s);return i}var rx={value:()=>{}};function Ru(){for(var t=0,i=arguments.length,s={},a;t<i;++t){if(!(a=arguments[t]+"")||a in s||/[\s.]/.test(a))throw new Error("illegal type: "+a);s[a]=[]}return new fu(s)}function fu(t){this._=t}function ux(t,i){return t.trim().split(/^|\s+/).map(function(s){var a="",r=s.indexOf(".");if(r>=0&&(a=s.slice(r+1),s=s.slice(0,r)),s&&!i.hasOwnProperty(s))throw new Error("unknown type: "+s);return{type:s,name:a}})}fu.prototype=Ru.prototype={constructor:fu,on:function(t,i){var s=this._,a=ux(t+"",s),r,u=-1,c=a.length;if(arguments.length<2){for(;++u<c;)if((r=(t=a[u]).type)&&(r=cx(s[r],t.name)))return r;return}if(i!=null&&typeof i!="function")throw new Error("invalid callback: "+i);for(;++u<c;)if(r=(t=a[u]).type)s[r]=Gy(s[r],t.name,i);else if(i==null)for(r in s)s[r]=Gy(s[r],t.name,null);return this},copy:function(){var t={},i=this._;for(var s in i)t[s]=i[s].slice();return new fu(t)},call:function(t,i){if((r=arguments.length-2)>0)for(var s=new Array(r),a=0,r,u;a<r;++a)s[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(u=this._[t],a=0,r=u.length;a<r;++a)u[a].value.apply(i,s)},apply:function(t,i,s){if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(var a=this._[t],r=0,u=a.length;r<u;++r)a[r].value.apply(i,s)}};function cx(t,i){for(var s=0,a=t.length,r;s<a;++s)if((r=t[s]).name===i)return r.value}function Gy(t,i,s){for(var a=0,r=t.length;a<r;++a)if(t[a].name===i){t[a]=rx,t=t.slice(0,a).concat(t.slice(a+1));break}return s!=null&&t.push({name:i,value:s}),t}var Pd="http://www.w3.org/1999/xhtml";const Xy={svg:"http://www.w3.org/2000/svg",xhtml:Pd,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Bu(t){var i=t+="",s=i.indexOf(":");return s>=0&&(i=t.slice(0,s))!=="xmlns"&&(t=t.slice(s+1)),Xy.hasOwnProperty(i)?{space:Xy[i],local:t}:t}function fx(t){return function(){var i=this.ownerDocument,s=this.namespaceURI;return s===Pd&&i.documentElement.namespaceURI===Pd?i.createElement(t):i.createElementNS(s,t)}}function dx(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function hv(t){var i=Bu(t);return(i.local?dx:fx)(i)}function hx(){}function Sh(t){return t==null?hx:function(){return this.querySelector(t)}}function mx(t){typeof t!="function"&&(t=Sh(t));for(var i=this._groups,s=i.length,a=new Array(s),r=0;r<s;++r)for(var u=i[r],c=u.length,m=a[r]=new Array(c),h,g,v=0;v<c;++v)(h=u[v])&&(g=t.call(h,h.__data__,v,u))&&("__data__"in h&&(g.__data__=h.__data__),m[v]=g);return new Qt(a,this._parents)}function gx(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function px(){return[]}function mv(t){return t==null?px:function(){return this.querySelectorAll(t)}}function yx(t){return function(){return gx(t.apply(this,arguments))}}function vx(t){typeof t=="function"?t=yx(t):t=mv(t);for(var i=this._groups,s=i.length,a=[],r=[],u=0;u<s;++u)for(var c=i[u],m=c.length,h,g=0;g<m;++g)(h=c[g])&&(a.push(t.call(h,h.__data__,g,c)),r.push(h));return new Qt(a,r)}function gv(t){return function(){return this.matches(t)}}function pv(t){return function(i){return i.matches(t)}}var bx=Array.prototype.find;function Sx(t){return function(){return bx.call(this.children,t)}}function wx(){return this.firstElementChild}function xx(t){return this.select(t==null?wx:Sx(typeof t=="function"?t:pv(t)))}var Ex=Array.prototype.filter;function _x(){return Array.from(this.children)}function Nx(t){return function(){return Ex.call(this.children,t)}}function Ax(t){return this.selectAll(t==null?_x:Nx(typeof t=="function"?t:pv(t)))}function Tx(t){typeof t!="function"&&(t=gv(t));for(var i=this._groups,s=i.length,a=new Array(s),r=0;r<s;++r)for(var u=i[r],c=u.length,m=a[r]=[],h,g=0;g<c;++g)(h=u[g])&&t.call(h,h.__data__,g,u)&&m.push(h);return new Qt(a,this._parents)}function yv(t){return new Array(t.length)}function Mx(){return new Qt(this._enter||this._groups.map(yv),this._parents)}function Su(t,i){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=i}Su.prototype={constructor:Su,appendChild:function(t){return this._parent.insertBefore(t,this._next)},insertBefore:function(t,i){return this._parent.insertBefore(t,i)},querySelector:function(t){return this._parent.querySelector(t)},querySelectorAll:function(t){return this._parent.querySelectorAll(t)}};function Cx(t){return function(){return t}}function Ox(t,i,s,a,r,u){for(var c=0,m,h=i.length,g=u.length;c<g;++c)(m=i[c])?(m.__data__=u[c],a[c]=m):s[c]=new Su(t,u[c]);for(;c<h;++c)(m=i[c])&&(r[c]=m)}function zx(t,i,s,a,r,u,c){var m,h,g=new Map,v=i.length,p=u.length,y=new Array(v),w;for(m=0;m<v;++m)(h=i[m])&&(y[m]=w=c.call(h,h.__data__,m,i)+"",g.has(w)?r[m]=h:g.set(w,h));for(m=0;m<p;++m)w=c.call(t,u[m],m,u)+"",(h=g.get(w))?(a[m]=h,h.__data__=u[m],g.delete(w)):s[m]=new Su(t,u[m]);for(m=0;m<v;++m)(h=i[m])&&g.get(y[m])===h&&(r[m]=h)}function Dx(t){return t.__data__}function Lx(t,i){if(!arguments.length)return Array.from(this,Dx);var s=i?zx:Ox,a=this._parents,r=this._groups;typeof t!="function"&&(t=Cx(t));for(var u=r.length,c=new Array(u),m=new Array(u),h=new Array(u),g=0;g<u;++g){var v=a[g],p=r[g],y=p.length,w=Rx(t.call(v,v&&v.__data__,g,a)),x=w.length,S=m[g]=new Array(x),_=c[g]=new Array(x),E=h[g]=new Array(y);s(v,p,S,_,E,w,i);for(var O=0,N=0,M,k;O<x;++O)if(M=S[O]){for(O>=N&&(N=O+1);!(k=_[N])&&++N<x;);M._next=k||null}}return c=new Qt(c,a),c._enter=m,c._exit=h,c}function Rx(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function Bx(){return new Qt(this._exit||this._groups.map(yv),this._parents)}function kx(t,i,s){var a=this.enter(),r=this,u=this.exit();return typeof t=="function"?(a=t(a),a&&(a=a.selection())):a=a.append(t+""),i!=null&&(r=i(r),r&&(r=r.selection())),s==null?u.remove():s(u),a&&r?a.merge(r).order():r}function Hx(t){for(var i=t.selection?t.selection():t,s=this._groups,a=i._groups,r=s.length,u=a.length,c=Math.min(r,u),m=new Array(r),h=0;h<c;++h)for(var g=s[h],v=a[h],p=g.length,y=m[h]=new Array(p),w,x=0;x<p;++x)(w=g[x]||v[x])&&(y[x]=w);for(;h<r;++h)m[h]=s[h];return new Qt(m,this._parents)}function jx(){for(var t=this._groups,i=-1,s=t.length;++i<s;)for(var a=t[i],r=a.length-1,u=a[r],c;--r>=0;)(c=a[r])&&(u&&c.compareDocumentPosition(u)^4&&u.parentNode.insertBefore(c,u),u=c);return this}function $x(t){t||(t=Ux);function i(p,y){return p&&y?t(p.__data__,y.__data__):!p-!y}for(var s=this._groups,a=s.length,r=new Array(a),u=0;u<a;++u){for(var c=s[u],m=c.length,h=r[u]=new Array(m),g,v=0;v<m;++v)(g=c[v])&&(h[v]=g);h.sort(i)}return new Qt(r,this._parents).order()}function Ux(t,i){return t<i?-1:t>i?1:t>=i?0:NaN}function qx(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function Vx(){return Array.from(this)}function Yx(){for(var t=this._groups,i=0,s=t.length;i<s;++i)for(var a=t[i],r=0,u=a.length;r<u;++r){var c=a[r];if(c)return c}return null}function Gx(){let t=0;for(const i of this)++t;return t}function Xx(){return!this.node()}function Kx(t){for(var i=this._groups,s=0,a=i.length;s<a;++s)for(var r=i[s],u=0,c=r.length,m;u<c;++u)(m=r[u])&&t.call(m,m.__data__,u,r);return this}function Zx(t){return function(){this.removeAttribute(t)}}function Qx(t){return function(){this.removeAttributeNS(t.space,t.local)}}function Ix(t,i){return function(){this.setAttribute(t,i)}}function Jx(t,i){return function(){this.setAttributeNS(t.space,t.local,i)}}function Fx(t,i){return function(){var s=i.apply(this,arguments);s==null?this.removeAttribute(t):this.setAttribute(t,s)}}function Wx(t,i){return function(){var s=i.apply(this,arguments);s==null?this.removeAttributeNS(t.space,t.local):this.setAttributeNS(t.space,t.local,s)}}function Px(t,i){var s=Bu(t);if(arguments.length<2){var a=this.node();return s.local?a.getAttributeNS(s.space,s.local):a.getAttribute(s)}return this.each((i==null?s.local?Qx:Zx:typeof i=="function"?s.local?Wx:Fx:s.local?Jx:Ix)(s,i))}function vv(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function e2(t){return function(){this.style.removeProperty(t)}}function t2(t,i,s){return function(){this.style.setProperty(t,i,s)}}function n2(t,i,s){return function(){var a=i.apply(this,arguments);a==null?this.style.removeProperty(t):this.style.setProperty(t,a,s)}}function i2(t,i,s){return arguments.length>1?this.each((i==null?e2:typeof i=="function"?n2:t2)(t,i,s??"")):Dl(this.node(),t)}function Dl(t,i){return t.style.getPropertyValue(i)||vv(t).getComputedStyle(t,null).getPropertyValue(i)}function s2(t){return function(){delete this[t]}}function l2(t,i){return function(){this[t]=i}}function a2(t,i){return function(){var s=i.apply(this,arguments);s==null?delete this[t]:this[t]=s}}function o2(t,i){return arguments.length>1?this.each((i==null?s2:typeof i=="function"?a2:l2)(t,i)):this.node()[t]}function bv(t){return t.trim().split(/^|\s+/)}function wh(t){return t.classList||new Sv(t)}function Sv(t){this._node=t,this._names=bv(t.getAttribute("class")||"")}Sv.prototype={add:function(t){var i=this._names.indexOf(t);i<0&&(this._names.push(t),this._node.setAttribute("class",this._names.join(" ")))},remove:function(t){var i=this._names.indexOf(t);i>=0&&(this._names.splice(i,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(t){return this._names.indexOf(t)>=0}};function wv(t,i){for(var s=wh(t),a=-1,r=i.length;++a<r;)s.add(i[a])}function xv(t,i){for(var s=wh(t),a=-1,r=i.length;++a<r;)s.remove(i[a])}function r2(t){return function(){wv(this,t)}}function u2(t){return function(){xv(this,t)}}function c2(t,i){return function(){(i.apply(this,arguments)?wv:xv)(this,t)}}function f2(t,i){var s=bv(t+"");if(arguments.length<2){for(var a=wh(this.node()),r=-1,u=s.length;++r<u;)if(!a.contains(s[r]))return!1;return!0}return this.each((typeof i=="function"?c2:i?r2:u2)(s,i))}function d2(){this.textContent=""}function h2(t){return function(){this.textContent=t}}function m2(t){return function(){var i=t.apply(this,arguments);this.textContent=i??""}}function g2(t){return arguments.length?this.each(t==null?d2:(typeof t=="function"?m2:h2)(t)):this.node().textContent}function p2(){this.innerHTML=""}function y2(t){return function(){this.innerHTML=t}}function v2(t){return function(){var i=t.apply(this,arguments);this.innerHTML=i??""}}function b2(t){return arguments.length?this.each(t==null?p2:(typeof t=="function"?v2:y2)(t)):this.node().innerHTML}function S2(){this.nextSibling&&this.parentNode.appendChild(this)}function w2(){return this.each(S2)}function x2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function E2(){return this.each(x2)}function _2(t){var i=typeof t=="function"?t:hv(t);return this.select(function(){return this.appendChild(i.apply(this,arguments))})}function N2(){return null}function A2(t,i){var s=typeof t=="function"?t:hv(t),a=i==null?N2:typeof i=="function"?i:Sh(i);return this.select(function(){return this.insertBefore(s.apply(this,arguments),a.apply(this,arguments)||null)})}function T2(){var t=this.parentNode;t&&t.removeChild(this)}function M2(){return this.each(T2)}function C2(){var t=this.cloneNode(!1),i=this.parentNode;return i?i.insertBefore(t,this.nextSibling):t}function O2(){var t=this.cloneNode(!0),i=this.parentNode;return i?i.insertBefore(t,this.nextSibling):t}function z2(t){return this.select(t?O2:C2)}function D2(t){return arguments.length?this.property("__data__",t):this.node().__data__}function L2(t){return function(i){t.call(this,i,this.__data__)}}function R2(t){return t.trim().split(/^|\s+/).map(function(i){var s="",a=i.indexOf(".");return a>=0&&(s=i.slice(a+1),i=i.slice(0,a)),{type:i,name:s}})}function B2(t){return function(){var i=this.__on;if(i){for(var s=0,a=-1,r=i.length,u;s<r;++s)u=i[s],(!t.type||u.type===t.type)&&u.name===t.name?this.removeEventListener(u.type,u.listener,u.options):i[++a]=u;++a?i.length=a:delete this.__on}}}function k2(t,i,s){return function(){var a=this.__on,r,u=L2(i);if(a){for(var c=0,m=a.length;c<m;++c)if((r=a[c]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=u,r.options=s),r.value=i;return}}this.addEventListener(t.type,u,s),r={type:t.type,name:t.name,value:i,listener:u,options:s},a?a.push(r):this.__on=[r]}}function H2(t,i,s){var a=R2(t+""),r,u=a.length,c;if(arguments.length<2){var m=this.node().__on;if(m){for(var h=0,g=m.length,v;h<g;++h)for(r=0,v=m[h];r<u;++r)if((c=a[r]).type===v.type&&c.name===v.name)return v.value}return}for(m=i?k2:B2,r=0;r<u;++r)this.each(m(a[r],i,s));return this}function Ev(t,i,s){var a=vv(t),r=a.CustomEvent;typeof r=="function"?r=new r(i,s):(r=a.document.createEvent("Event"),s?(r.initEvent(i,s.bubbles,s.cancelable),r.detail=s.detail):r.initEvent(i,!1,!1)),t.dispatchEvent(r)}function j2(t,i){return function(){return Ev(this,t,i)}}function $2(t,i){return function(){return Ev(this,t,i.apply(this,arguments))}}function U2(t,i){return this.each((typeof i=="function"?$2:j2)(t,i))}function*q2(){for(var t=this._groups,i=0,s=t.length;i<s;++i)for(var a=t[i],r=0,u=a.length,c;r<u;++r)(c=a[r])&&(yield c)}var _v=[null];function Qt(t,i){this._groups=t,this._parents=i}function bo(){return new Qt([[document.documentElement]],_v)}function V2(){return this}Qt.prototype=bo.prototype={constructor:Qt,select:mx,selectAll:vx,selectChild:xx,selectChildren:Ax,filter:Tx,data:Lx,enter:Mx,exit:Bx,join:kx,merge:Hx,selection:V2,order:jx,sort:$x,call:qx,nodes:Vx,node:Yx,size:Gx,empty:Xx,each:Kx,attr:Px,style:i2,property:o2,classed:f2,text:g2,html:b2,raise:w2,lower:E2,append:_2,insert:A2,remove:M2,clone:z2,datum:D2,on:H2,dispatch:U2,[Symbol.iterator]:q2};function Kt(t){return typeof t=="string"?new Qt([[document.querySelector(t)]],[document.documentElement]):new Qt([[t]],_v)}function Y2(t){let i;for(;i=t.sourceEvent;)t=i;return t}function pn(t,i){if(t=Y2(t),i===void 0&&(i=t.currentTarget),i){var s=i.ownerSVGElement||i;if(s.createSVGPoint){var a=s.createSVGPoint();return a.x=t.clientX,a.y=t.clientY,a=a.matrixTransform(i.getScreenCTM().inverse()),[a.x,a.y]}if(i.getBoundingClientRect){var r=i.getBoundingClientRect();return[t.clientX-r.left-i.clientLeft,t.clientY-r.top-i.clientTop]}}return[t.pageX,t.pageY]}const G2={passive:!1},so={capture:!0,passive:!1};function Od(t){t.stopImmediatePropagation()}function Tl(t){t.preventDefault(),t.stopImmediatePropagation()}function Nv(t){var i=t.document.documentElement,s=Kt(t).on("dragstart.drag",Tl,so);"onselectstart"in i?s.on("selectstart.drag",Tl,so):(i.__noselect=i.style.MozUserSelect,i.style.MozUserSelect="none")}function Av(t,i){var s=t.document.documentElement,a=Kt(t).on("dragstart.drag",null);i&&(a.on("click.drag",Tl,so),setTimeout(function(){a.on("click.drag",null)},0)),"onselectstart"in s?a.on("selectstart.drag",null):(s.style.MozUserSelect=s.__noselect,delete s.__noselect)}const Jr=t=>()=>t;function eh(t,{sourceEvent:i,subject:s,target:a,identifier:r,active:u,x:c,y:m,dx:h,dy:g,dispatch:v}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:i,enumerable:!0,configurable:!0},subject:{value:s,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:r,enumerable:!0,configurable:!0},active:{value:u,enumerable:!0,configurable:!0},x:{value:c,enumerable:!0,configurable:!0},y:{value:m,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:g,enumerable:!0,configurable:!0},_:{value:v}})}eh.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function X2(t){return!t.ctrlKey&&!t.button}function K2(){return this.parentNode}function Z2(t,i){return i??{x:t.x,y:t.y}}function Q2(){return navigator.maxTouchPoints||"ontouchstart"in this}function Tv(){var t=X2,i=K2,s=Z2,a=Q2,r={},u=Ru("start","drag","end"),c=0,m,h,g,v,p=0;function y(M){M.on("mousedown.drag",w).filter(a).on("touchstart.drag",_).on("touchmove.drag",E,G2).on("touchend.drag touchcancel.drag",O).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(M,k){if(!(v||!t.call(this,M,k))){var L=N(this,i.call(this,M,k),M,k,"mouse");L&&(Kt(M.view).on("mousemove.drag",x,so).on("mouseup.drag",S,so),Nv(M.view),Od(M),g=!1,m=M.clientX,h=M.clientY,L("start",M))}}function x(M){if(Tl(M),!g){var k=M.clientX-m,L=M.clientY-h;g=k*k+L*L>p}r.mouse("drag",M)}function S(M){Kt(M.view).on("mousemove.drag mouseup.drag",null),Av(M.view,g),Tl(M),r.mouse("end",M)}function _(M,k){if(t.call(this,M,k)){var L=M.changedTouches,H=i.call(this,M,k),j=L.length,Y,oe;for(Y=0;Y<j;++Y)(oe=N(this,H,M,k,L[Y].identifier,L[Y]))&&(Od(M),oe("start",M,L[Y]))}}function E(M){var k=M.changedTouches,L=k.length,H,j;for(H=0;H<L;++H)(j=r[k[H].identifier])&&(Tl(M),j("drag",M,k[H]))}function O(M){var k=M.changedTouches,L=k.length,H,j;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),H=0;H<L;++H)(j=r[k[H].identifier])&&(Od(M),j("end",M,k[H]))}function N(M,k,L,H,j,Y){var oe=u.copy(),K=pn(Y||L,k),I,ae,R;if((R=s.call(M,new eh("beforestart",{sourceEvent:L,target:y,identifier:j,active:c,x:K[0],y:K[1],dx:0,dy:0,dispatch:oe}),H))!=null)return I=R.x-K[0]||0,ae=R.y-K[1]||0,function G(T,z,q){var X=K,te;switch(T){case"start":r[j]=G,te=c++;break;case"end":delete r[j],--c;case"drag":K=pn(q||z,k),te=c;break}oe.call(T,M,new eh(T,{sourceEvent:z,subject:R,target:y,identifier:j,active:te,x:K[0]+I,y:K[1]+ae,dx:K[0]-X[0],dy:K[1]-X[1],dispatch:oe}),H)}}return y.filter=function(M){return arguments.length?(t=typeof M=="function"?M:Jr(!!M),y):t},y.container=function(M){return arguments.length?(i=typeof M=="function"?M:Jr(M),y):i},y.subject=function(M){return arguments.length?(s=typeof M=="function"?M:Jr(M),y):s},y.touchable=function(M){return arguments.length?(a=typeof M=="function"?M:Jr(!!M),y):a},y.on=function(){var M=u.on.apply(u,arguments);return M===u?y:M},y.clickDistance=function(M){return arguments.length?(p=(M=+M)*M,y):Math.sqrt(p)},y}function xh(t,i,s){t.prototype=i.prototype=s,s.constructor=t}function Mv(t,i){var s=Object.create(t.prototype);for(var a in i)s[a]=i[a];return s}function So(){}var lo=.7,wu=1/lo,Ml="\\s*([+-]?\\d+)\\s*",ao="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",On="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",I2=/^#([0-9a-f]{3,8})$/,J2=new RegExp(`^rgb\\(${Ml},${Ml},${Ml}\\)$`),F2=new RegExp(`^rgb\\(${On},${On},${On}\\)$`),W2=new RegExp(`^rgba\\(${Ml},${Ml},${Ml},${ao}\\)$`),P2=new RegExp(`^rgba\\(${On},${On},${On},${ao}\\)$`),eE=new RegExp(`^hsl\\(${ao},${On},${On}\\)$`),tE=new RegExp(`^hsla\\(${ao},${On},${On},${ao}\\)$`),Ky={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};xh(So,bs,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:Zy,formatHex:Zy,formatHex8:nE,formatHsl:iE,formatRgb:Qy,toString:Qy});function Zy(){return this.rgb().formatHex()}function nE(){return this.rgb().formatHex8()}function iE(){return Cv(this).formatHsl()}function Qy(){return this.rgb().formatRgb()}function bs(t){var i,s;return t=(t+"").trim().toLowerCase(),(i=I2.exec(t))?(s=i[1].length,i=parseInt(i[1],16),s===6?Iy(i):s===3?new kt(i>>8&15|i>>4&240,i>>4&15|i&240,(i&15)<<4|i&15,1):s===8?Fr(i>>24&255,i>>16&255,i>>8&255,(i&255)/255):s===4?Fr(i>>12&15|i>>8&240,i>>8&15|i>>4&240,i>>4&15|i&240,((i&15)<<4|i&15)/255):null):(i=J2.exec(t))?new kt(i[1],i[2],i[3],1):(i=F2.exec(t))?new kt(i[1]*255/100,i[2]*255/100,i[3]*255/100,1):(i=W2.exec(t))?Fr(i[1],i[2],i[3],i[4]):(i=P2.exec(t))?Fr(i[1]*255/100,i[2]*255/100,i[3]*255/100,i[4]):(i=eE.exec(t))?Wy(i[1],i[2]/100,i[3]/100,1):(i=tE.exec(t))?Wy(i[1],i[2]/100,i[3]/100,i[4]):Ky.hasOwnProperty(t)?Iy(Ky[t]):t==="transparent"?new kt(NaN,NaN,NaN,0):null}function Iy(t){return new kt(t>>16&255,t>>8&255,t&255,1)}function Fr(t,i,s,a){return a<=0&&(t=i=s=NaN),new kt(t,i,s,a)}function sE(t){return t instanceof So||(t=bs(t)),t?(t=t.rgb(),new kt(t.r,t.g,t.b,t.opacity)):new kt}function th(t,i,s,a){return arguments.length===1?sE(t):new kt(t,i,s,a??1)}function kt(t,i,s,a){this.r=+t,this.g=+i,this.b=+s,this.opacity=+a}xh(kt,th,Mv(So,{brighter(t){return t=t==null?wu:Math.pow(wu,t),new kt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?lo:Math.pow(lo,t),new kt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new kt(ys(this.r),ys(this.g),ys(this.b),xu(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:Jy,formatHex:Jy,formatHex8:lE,formatRgb:Fy,toString:Fy}));function Jy(){return`#${hs(this.r)}${hs(this.g)}${hs(this.b)}`}function lE(){return`#${hs(this.r)}${hs(this.g)}${hs(this.b)}${hs((isNaN(this.opacity)?1:this.opacity)*255)}`}function Fy(){const t=xu(this.opacity);return`${t===1?"rgb(":"rgba("}${ys(this.r)}, ${ys(this.g)}, ${ys(this.b)}${t===1?")":`, ${t})`}`}function xu(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ys(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function hs(t){return t=ys(t),(t<16?"0":"")+t.toString(16)}function Wy(t,i,s,a){return a<=0?t=i=s=NaN:s<=0||s>=1?t=i=NaN:i<=0&&(t=NaN),new yn(t,i,s,a)}function Cv(t){if(t instanceof yn)return new yn(t.h,t.s,t.l,t.opacity);if(t instanceof So||(t=bs(t)),!t)return new yn;if(t instanceof yn)return t;t=t.rgb();var i=t.r/255,s=t.g/255,a=t.b/255,r=Math.min(i,s,a),u=Math.max(i,s,a),c=NaN,m=u-r,h=(u+r)/2;return m?(i===u?c=(s-a)/m+(s<a)*6:s===u?c=(a-i)/m+2:c=(i-s)/m+4,m/=h<.5?u+r:2-u-r,c*=60):m=h>0&&h<1?0:c,new yn(c,m,h,t.opacity)}function aE(t,i,s,a){return arguments.length===1?Cv(t):new yn(t,i,s,a??1)}function yn(t,i,s,a){this.h=+t,this.s=+i,this.l=+s,this.opacity=+a}xh(yn,aE,Mv(So,{brighter(t){return t=t==null?wu:Math.pow(wu,t),new yn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?lo:Math.pow(lo,t),new yn(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,i=isNaN(t)||isNaN(this.s)?0:this.s,s=this.l,a=s+(s<.5?s:1-s)*i,r=2*s-a;return new kt(zd(t>=240?t-240:t+120,r,a),zd(t,r,a),zd(t<120?t+240:t-120,r,a),this.opacity)},clamp(){return new yn(Py(this.h),Wr(this.s),Wr(this.l),xu(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 t=xu(this.opacity);return`${t===1?"hsl(":"hsla("}${Py(this.h)}, ${Wr(this.s)*100}%, ${Wr(this.l)*100}%${t===1?")":`, ${t})`}`}}));function Py(t){return t=(t||0)%360,t<0?t+360:t}function Wr(t){return Math.max(0,Math.min(1,t||0))}function zd(t,i,s){return(t<60?i+(s-i)*t/60:t<180?s:t<240?i+(s-i)*(240-t)/60:i)*255}const Eh=t=>()=>t;function oE(t,i){return function(s){return t+s*i}}function rE(t,i,s){return t=Math.pow(t,s),i=Math.pow(i,s)-t,s=1/s,function(a){return Math.pow(t+a*i,s)}}function uE(t){return(t=+t)==1?Ov:function(i,s){return s-i?rE(i,s,t):Eh(isNaN(i)?s:i)}}function Ov(t,i){var s=i-t;return s?oE(t,s):Eh(isNaN(t)?i:t)}const Eu=(function t(i){var s=uE(i);function a(r,u){var c=s((r=th(r)).r,(u=th(u)).r),m=s(r.g,u.g),h=s(r.b,u.b),g=Ov(r.opacity,u.opacity);return function(v){return r.r=c(v),r.g=m(v),r.b=h(v),r.opacity=g(v),r+""}}return a.gamma=t,a})(1);function cE(t,i){i||(i=[]);var s=t?Math.min(i.length,t.length):0,a=i.slice(),r;return function(u){for(r=0;r<s;++r)a[r]=t[r]*(1-u)+i[r]*u;return a}}function fE(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function dE(t,i){var s=i?i.length:0,a=t?Math.min(s,t.length):0,r=new Array(a),u=new Array(s),c;for(c=0;c<a;++c)r[c]=eo(t[c],i[c]);for(;c<s;++c)u[c]=i[c];return function(m){for(c=0;c<a;++c)u[c]=r[c](m);return u}}function hE(t,i){var s=new Date;return t=+t,i=+i,function(a){return s.setTime(t*(1-a)+i*a),s}}function Cn(t,i){return t=+t,i=+i,function(s){return t*(1-s)+i*s}}function mE(t,i){var s={},a={},r;(t===null||typeof t!="object")&&(t={}),(i===null||typeof i!="object")&&(i={});for(r in i)r in t?s[r]=eo(t[r],i[r]):a[r]=i[r];return function(u){for(r in s)a[r]=s[r](u);return a}}var nh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Dd=new RegExp(nh.source,"g");function gE(t){return function(){return t}}function pE(t){return function(i){return t(i)+""}}function zv(t,i){var s=nh.lastIndex=Dd.lastIndex=0,a,r,u,c=-1,m=[],h=[];for(t=t+"",i=i+"";(a=nh.exec(t))&&(r=Dd.exec(i));)(u=r.index)>s&&(u=i.slice(s,u),m[c]?m[c]+=u:m[++c]=u),(a=a[0])===(r=r[0])?m[c]?m[c]+=r:m[++c]=r:(m[++c]=null,h.push({i:c,x:Cn(a,r)})),s=Dd.lastIndex;return s<i.length&&(u=i.slice(s),m[c]?m[c]+=u:m[++c]=u),m.length<2?h[0]?pE(h[0].x):gE(i):(i=h.length,function(g){for(var v=0,p;v<i;++v)m[(p=h[v]).i]=p.x(g);return m.join("")})}function eo(t,i){var s=typeof i,a;return i==null||s==="boolean"?Eh(i):(s==="number"?Cn:s==="string"?(a=bs(i))?(i=a,Eu):zv:i instanceof bs?Eu:i instanceof Date?hE:fE(i)?cE:Array.isArray(i)?dE:typeof i.valueOf!="function"&&typeof i.toString!="function"||isNaN(i)?mE:Cn)(t,i)}var e0=180/Math.PI,ih={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Dv(t,i,s,a,r,u){var c,m,h;return(c=Math.sqrt(t*t+i*i))&&(t/=c,i/=c),(h=t*s+i*a)&&(s-=t*h,a-=i*h),(m=Math.sqrt(s*s+a*a))&&(s/=m,a/=m,h/=m),t*a<i*s&&(t=-t,i=-i,h=-h,c=-c),{translateX:r,translateY:u,rotate:Math.atan2(i,t)*e0,skewX:Math.atan(h)*e0,scaleX:c,scaleY:m}}var Pr;function yE(t){const i=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return i.isIdentity?ih:Dv(i.a,i.b,i.c,i.d,i.e,i.f)}function vE(t){return t==null||(Pr||(Pr=document.createElementNS("http://www.w3.org/2000/svg","g")),Pr.setAttribute("transform",t),!(t=Pr.transform.baseVal.consolidate()))?ih:(t=t.matrix,Dv(t.a,t.b,t.c,t.d,t.e,t.f))}function Lv(t,i,s,a){function r(g){return g.length?g.pop()+" ":""}function u(g,v,p,y,w,x){if(g!==p||v!==y){var S=w.push("translate(",null,i,null,s);x.push({i:S-4,x:Cn(g,p)},{i:S-2,x:Cn(v,y)})}else(p||y)&&w.push("translate("+p+i+y+s)}function c(g,v,p,y){g!==v?(g-v>180?v+=360:v-g>180&&(g+=360),y.push({i:p.push(r(p)+"rotate(",null,a)-2,x:Cn(g,v)})):v&&p.push(r(p)+"rotate("+v+a)}function m(g,v,p,y){g!==v?y.push({i:p.push(r(p)+"skewX(",null,a)-2,x:Cn(g,v)}):v&&p.push(r(p)+"skewX("+v+a)}function h(g,v,p,y,w,x){if(g!==p||v!==y){var S=w.push(r(w)+"scale(",null,",",null,")");x.push({i:S-4,x:Cn(g,p)},{i:S-2,x:Cn(v,y)})}else(p!==1||y!==1)&&w.push(r(w)+"scale("+p+","+y+")")}return function(g,v){var p=[],y=[];return g=t(g),v=t(v),u(g.translateX,g.translateY,v.translateX,v.translateY,p,y),c(g.rotate,v.rotate,p,y),m(g.skewX,v.skewX,p,y),h(g.scaleX,g.scaleY,v.scaleX,v.scaleY,p,y),g=v=null,function(w){for(var x=-1,S=y.length,_;++x<S;)p[(_=y[x]).i]=_.x(w);return p.join("")}}}var bE=Lv(yE,"px, ","px)","deg)"),SE=Lv(vE,", ",")",")"),wE=1e-12;function t0(t){return((t=Math.exp(t))+1/t)/2}function xE(t){return((t=Math.exp(t))-1/t)/2}function EE(t){return((t=Math.exp(2*t))-1)/(t+1)}const du=(function t(i,s,a){function r(u,c){var m=u[0],h=u[1],g=u[2],v=c[0],p=c[1],y=c[2],w=v-m,x=p-h,S=w*w+x*x,_,E;if(S<wE)E=Math.log(y/g)/i,_=function(H){return[m+H*w,h+H*x,g*Math.exp(i*H*E)]};else{var O=Math.sqrt(S),N=(y*y-g*g+a*S)/(2*g*s*O),M=(y*y-g*g-a*S)/(2*y*s*O),k=Math.log(Math.sqrt(N*N+1)-N),L=Math.log(Math.sqrt(M*M+1)-M);E=(L-k)/i,_=function(H){var j=H*E,Y=t0(k),oe=g/(s*O)*(Y*EE(i*j+k)-xE(k));return[m+oe*w,h+oe*x,g*Y/t0(i*j+k)]}}return _.duration=E*1e3*i/Math.SQRT2,_}return r.rho=function(u){var c=Math.max(.001,+u),m=c*c,h=m*m;return t(c,m,h)},r})(Math.SQRT2,2,4);var Ll=0,Fa=0,Qa=0,Rv=1e3,_u,Wa,Nu=0,Ss=0,ku=0,oo=typeof performance=="object"&&performance.now?performance:Date,Bv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function _h(){return Ss||(Bv(_E),Ss=oo.now()+ku)}function _E(){Ss=0}function Au(){this._call=this._time=this._next=null}Au.prototype=kv.prototype={constructor:Au,restart:function(t,i,s){if(typeof t!="function")throw new TypeError("callback is not a function");s=(s==null?_h():+s)+(i==null?0:+i),!this._next&&Wa!==this&&(Wa?Wa._next=this:_u=this,Wa=this),this._call=t,this._time=s,sh()},stop:function(){this._call&&(this._call=null,this._time=1/0,sh())}};function kv(t,i,s){var a=new Au;return a.restart(t,i,s),a}function NE(){_h(),++Ll;for(var t=_u,i;t;)(i=Ss-t._time)>=0&&t._call.call(void 0,i),t=t._next;--Ll}function n0(){Ss=(Nu=oo.now())+ku,Ll=Fa=0;try{NE()}finally{Ll=0,TE(),Ss=0}}function AE(){var t=oo.now(),i=t-Nu;i>Rv&&(ku-=i,Nu=t)}function TE(){for(var t,i=_u,s,a=1/0;i;)i._call?(a>i._time&&(a=i._time),t=i,i=i._next):(s=i._next,i._next=null,i=t?t._next=s:_u=s);Wa=t,sh(a)}function sh(t){if(!Ll){Fa&&(Fa=clearTimeout(Fa));var i=t-Ss;i>24?(t<1/0&&(Fa=setTimeout(n0,t-oo.now()-ku)),Qa&&(Qa=clearInterval(Qa))):(Qa||(Nu=oo.now(),Qa=setInterval(AE,Rv)),Ll=1,Bv(n0))}}function i0(t,i,s){var a=new Au;return i=i==null?0:+i,a.restart(r=>{a.stop(),t(r+i)},i,s),a}var ME=Ru("start","end","cancel","interrupt"),CE=[],Hv=0,s0=1,lh=2,hu=3,l0=4,ah=5,mu=6;function Hu(t,i,s,a,r,u){var c=t.__transition;if(!c)t.__transition={};else if(s in c)return;OE(t,s,{name:i,index:a,group:r,on:ME,tween:CE,time:u.time,delay:u.delay,duration:u.duration,ease:u.ease,timer:null,state:Hv})}function Nh(t,i){var s=wn(t,i);if(s.state>Hv)throw new Error("too late; already scheduled");return s}function Ln(t,i){var s=wn(t,i);if(s.state>hu)throw new Error("too late; already running");return s}function wn(t,i){var s=t.__transition;if(!s||!(s=s[i]))throw new Error("transition not found");return s}function OE(t,i,s){var a=t.__transition,r;a[i]=s,s.timer=kv(u,0,s.time);function u(g){s.state=s0,s.timer.restart(c,s.delay,s.time),s.delay<=g&&c(g-s.delay)}function c(g){var v,p,y,w;if(s.state!==s0)return h();for(v in a)if(w=a[v],w.name===s.name){if(w.state===hu)return i0(c);w.state===l0?(w.state=mu,w.timer.stop(),w.on.call("interrupt",t,t.__data__,w.index,w.group),delete a[v]):+v<i&&(w.state=mu,w.timer.stop(),w.on.call("cancel",t,t.__data__,w.index,w.group),delete a[v])}if(i0(function(){s.state===hu&&(s.state=l0,s.timer.restart(m,s.delay,s.time),m(g))}),s.state=lh,s.on.call("start",t,t.__data__,s.index,s.group),s.state===lh){for(s.state=hu,r=new Array(y=s.tween.length),v=0,p=-1;v<y;++v)(w=s.tween[v].value.call(t,t.__data__,s.index,s.group))&&(r[++p]=w);r.length=p+1}}function m(g){for(var v=g<s.duration?s.ease.call(null,g/s.duration):(s.timer.restart(h),s.state=ah,1),p=-1,y=r.length;++p<y;)r[p].call(t,v);s.state===ah&&(s.on.call("end",t,t.__data__,s.index,s.group),h())}function h(){s.state=mu,s.timer.stop(),delete a[i];for(var g in a)return;delete t.__transition}}function gu(t,i){var s=t.__transition,a,r,u=!0,c;if(s){i=i==null?null:i+"";for(c in s){if((a=s[c]).name!==i){u=!1;continue}r=a.state>lh&&a.state<ah,a.state=mu,a.timer.stop(),a.on.call(r?"interrupt":"cancel",t,t.__data__,a.index,a.group),delete s[c]}u&&delete t.__transition}}function zE(t){return this.each(function(){gu(this,t)})}function DE(t,i){var s,a;return function(){var r=Ln(this,t),u=r.tween;if(u!==s){a=s=u;for(var c=0,m=a.length;c<m;++c)if(a[c].name===i){a=a.slice(),a.splice(c,1);break}}r.tween=a}}function LE(t,i,s){var a,r;if(typeof s!="function")throw new Error;return function(){var u=Ln(this,t),c=u.tween;if(c!==a){r=(a=c).slice();for(var m={name:i,value:s},h=0,g=r.length;h<g;++h)if(r[h].name===i){r[h]=m;break}h===g&&r.push(m)}u.tween=r}}function RE(t,i){var s=this._id;if(t+="",arguments.length<2){for(var a=wn(this.node(),s).tween,r=0,u=a.length,c;r<u;++r)if((c=a[r]).name===t)return c.value;return null}return this.each((i==null?DE:LE)(s,t,i))}function Ah(t,i,s){var a=t._id;return t.each(function(){var r=Ln(this,a);(r.value||(r.value={}))[i]=s.apply(this,arguments)}),function(r){return wn(r,a).value[i]}}function jv(t,i){var s;return(typeof i=="number"?Cn:i instanceof bs?Eu:(s=bs(i))?(i=s,Eu):zv)(t,i)}function BE(t){return function(){this.removeAttribute(t)}}function kE(t){return function(){this.removeAttributeNS(t.space,t.local)}}function HE(t,i,s){var a,r=s+"",u;return function(){var c=this.getAttribute(t);return c===r?null:c===a?u:u=i(a=c,s)}}function jE(t,i,s){var a,r=s+"",u;return function(){var c=this.getAttributeNS(t.space,t.local);return c===r?null:c===a?u:u=i(a=c,s)}}function $E(t,i,s){var a,r,u;return function(){var c,m=s(this),h;return m==null?void this.removeAttribute(t):(c=this.getAttribute(t),h=m+"",c===h?null:c===a&&h===r?u:(r=h,u=i(a=c,m)))}}function UE(t,i,s){var a,r,u;return function(){var c,m=s(this),h;return m==null?void this.removeAttributeNS(t.space,t.local):(c=this.getAttributeNS(t.space,t.local),h=m+"",c===h?null:c===a&&h===r?u:(r=h,u=i(a=c,m)))}}function qE(t,i){var s=Bu(t),a=s==="transform"?SE:jv;return this.attrTween(t,typeof i=="function"?(s.local?UE:$E)(s,a,Ah(this,"attr."+t,i)):i==null?(s.local?kE:BE)(s):(s.local?jE:HE)(s,a,i))}function VE(t,i){return function(s){this.setAttribute(t,i.call(this,s))}}function YE(t,i){return function(s){this.setAttributeNS(t.space,t.local,i.call(this,s))}}function GE(t,i){var s,a;function r(){var u=i.apply(this,arguments);return u!==a&&(s=(a=u)&&YE(t,u)),s}return r._value=i,r}function XE(t,i){var s,a;function r(){var u=i.apply(this,arguments);return u!==a&&(s=(a=u)&&VE(t,u)),s}return r._value=i,r}function KE(t,i){var s="attr."+t;if(arguments.length<2)return(s=this.tween(s))&&s._value;if(i==null)return this.tween(s,null);if(typeof i!="function")throw new Error;var a=Bu(t);return this.tween(s,(a.local?GE:XE)(a,i))}function ZE(t,i){return function(){Nh(this,t).delay=+i.apply(this,arguments)}}function QE(t,i){return i=+i,function(){Nh(this,t).delay=i}}function IE(t){var i=this._id;return arguments.length?this.each((typeof t=="function"?ZE:QE)(i,t)):wn(this.node(),i).delay}function JE(t,i){return function(){Ln(this,t).duration=+i.apply(this,arguments)}}function FE(t,i){return i=+i,function(){Ln(this,t).duration=i}}function WE(t){var i=this._id;return arguments.length?this.each((typeof t=="function"?JE:FE)(i,t)):wn(this.node(),i).duration}function PE(t,i){if(typeof i!="function")throw new Error;return function(){Ln(this,t).ease=i}}function e_(t){var i=this._id;return arguments.length?this.each(PE(i,t)):wn(this.node(),i).ease}function t_(t,i){return function(){var s=i.apply(this,arguments);if(typeof s!="function")throw new Error;Ln(this,t).ease=s}}function n_(t){if(typeof t!="function")throw new Error;return this.each(t_(this._id,t))}function i_(t){typeof t!="function"&&(t=gv(t));for(var i=this._groups,s=i.length,a=new Array(s),r=0;r<s;++r)for(var u=i[r],c=u.length,m=a[r]=[],h,g=0;g<c;++g)(h=u[g])&&t.call(h,h.__data__,g,u)&&m.push(h);return new li(a,this._parents,this._name,this._id)}function s_(t){if(t._id!==this._id)throw new Error;for(var i=this._groups,s=t._groups,a=i.length,r=s.length,u=Math.min(a,r),c=new Array(a),m=0;m<u;++m)for(var h=i[m],g=s[m],v=h.length,p=c[m]=new Array(v),y,w=0;w<v;++w)(y=h[w]||g[w])&&(p[w]=y);for(;m<a;++m)c[m]=i[m];return new li(c,this._parents,this._name,this._id)}function l_(t){return(t+"").trim().split(/^|\s+/).every(function(i){var s=i.indexOf(".");return s>=0&&(i=i.slice(0,s)),!i||i==="start"})}function a_(t,i,s){var a,r,u=l_(i)?Nh:Ln;return function(){var c=u(this,t),m=c.on;m!==a&&(r=(a=m).copy()).on(i,s),c.on=r}}function o_(t,i){var s=this._id;return arguments.length<2?wn(this.node(),s).on.on(t):this.each(a_(s,t,i))}function r_(t){return function(){var i=this.parentNode;for(var s in this.__transition)if(+s!==t)return;i&&i.removeChild(this)}}function u_(){return this.on("end.remove",r_(this._id))}function c_(t){var i=this._name,s=this._id;typeof t!="function"&&(t=Sh(t));for(var a=this._groups,r=a.length,u=new Array(r),c=0;c<r;++c)for(var m=a[c],h=m.length,g=u[c]=new Array(h),v,p,y=0;y<h;++y)(v=m[y])&&(p=t.call(v,v.__data__,y,m))&&("__data__"in v&&(p.__data__=v.__data__),g[y]=p,Hu(g[y],i,s,y,g,wn(v,s)));return new li(u,this._parents,i,s)}function f_(t){var i=this._name,s=this._id;typeof t!="function"&&(t=mv(t));for(var a=this._groups,r=a.length,u=[],c=[],m=0;m<r;++m)for(var h=a[m],g=h.length,v,p=0;p<g;++p)if(v=h[p]){for(var y=t.call(v,v.__data__,p,h),w,x=wn(v,s),S=0,_=y.length;S<_;++S)(w=y[S])&&Hu(w,i,s,S,y,x);u.push(y),c.push(v)}return new li(u,c,i,s)}var d_=bo.prototype.constructor;function h_(){return new d_(this._groups,this._parents)}function m_(t,i){var s,a,r;return function(){var u=Dl(this,t),c=(this.style.removeProperty(t),Dl(this,t));return u===c?null:u===s&&c===a?r:r=i(s=u,a=c)}}function $v(t){return function(){this.style.removeProperty(t)}}function g_(t,i,s){var a,r=s+"",u;return function(){var c=Dl(this,t);return c===r?null:c===a?u:u=i(a=c,s)}}function p_(t,i,s){var a,r,u;return function(){var c=Dl(this,t),m=s(this),h=m+"";return m==null&&(h=m=(this.style.removeProperty(t),Dl(this,t))),c===h?null:c===a&&h===r?u:(r=h,u=i(a=c,m))}}function y_(t,i){var s,a,r,u="style."+i,c="end."+u,m;return function(){var h=Ln(this,t),g=h.on,v=h.value[u]==null?m||(m=$v(i)):void 0;(g!==s||r!==v)&&(a=(s=g).copy()).on(c,r=v),h.on=a}}function v_(t,i,s){var a=(t+="")=="transform"?bE:jv;return i==null?this.styleTween(t,m_(t,a)).on("end.style."+t,$v(t)):typeof i=="function"?this.styleTween(t,p_(t,a,Ah(this,"style."+t,i))).each(y_(this._id,t)):this.styleTween(t,g_(t,a,i),s).on("end.style."+t,null)}function b_(t,i,s){return function(a){this.style.setProperty(t,i.call(this,a),s)}}function S_(t,i,s){var a,r;function u(){var c=i.apply(this,arguments);return c!==r&&(a=(r=c)&&b_(t,c,s)),a}return u._value=i,u}function w_(t,i,s){var a="style."+(t+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(i==null)return this.tween(a,null);if(typeof i!="function")throw new Error;return this.tween(a,S_(t,i,s??""))}function x_(t){return function(){this.textContent=t}}function E_(t){return function(){var i=t(this);this.textContent=i??""}}function __(t){return this.tween("text",typeof t=="function"?E_(Ah(this,"text",t)):x_(t==null?"":t+""))}function N_(t){return function(i){this.textContent=t.call(this,i)}}function A_(t){var i,s;function a(){var r=t.apply(this,arguments);return r!==s&&(i=(s=r)&&N_(r)),i}return a._value=t,a}function T_(t){var i="text";if(arguments.length<1)return(i=this.tween(i))&&i._value;if(t==null)return this.tween(i,null);if(typeof t!="function")throw new Error;return this.tween(i,A_(t))}function M_(){for(var t=this._name,i=this._id,s=Uv(),a=this._groups,r=a.length,u=0;u<r;++u)for(var c=a[u],m=c.length,h,g=0;g<m;++g)if(h=c[g]){var v=wn(h,i);Hu(h,t,s,g,c,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new li(a,this._parents,t,s)}function C_(){var t,i,s=this,a=s._id,r=s.size();return new Promise(function(u,c){var m={value:c},h={value:function(){--r===0&&u()}};s.each(function(){var g=Ln(this,a),v=g.on;v!==t&&(i=(t=v).copy(),i._.cancel.push(m),i._.interrupt.push(m),i._.end.push(h)),g.on=i}),r===0&&u()})}var O_=0;function li(t,i,s,a){this._groups=t,this._parents=i,this._name=s,this._id=a}function Uv(){return++O_}var ti=bo.prototype;li.prototype={constructor:li,select:c_,selectAll:f_,selectChild:ti.selectChild,selectChildren:ti.selectChildren,filter:i_,merge:s_,selection:h_,transition:M_,call:ti.call,nodes:ti.nodes,node:ti.node,size:ti.size,empty:ti.empty,each:ti.each,on:o_,attr:qE,attrTween:KE,style:v_,styleTween:w_,text:__,textTween:T_,remove:u_,tween:RE,delay:IE,duration:WE,ease:e_,easeVarying:n_,end:C_,[Symbol.iterator]:ti[Symbol.iterator]};function z_(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var D_={time:null,delay:0,duration:250,ease:z_};function L_(t,i){for(var s;!(s=t.__transition)||!(s=s[i]);)if(!(t=t.parentNode))throw new Error(`transition ${i} not found`);return s}function R_(t){var i,s;t instanceof li?(i=t._id,t=t._name):(i=Uv(),(s=D_).time=_h(),t=t==null?null:t+"");for(var a=this._groups,r=a.length,u=0;u<r;++u)for(var c=a[u],m=c.length,h,g=0;g<m;++g)(h=c[g])&&Hu(h,t,i,g,c,s||L_(h,i));return new li(a,this._parents,t,i)}bo.prototype.interrupt=zE;bo.prototype.transition=R_;const eu=t=>()=>t;function B_(t,{sourceEvent:i,target:s,transform:a,dispatch:r}){Object.defineProperties(this,{type:{value:t,enumerable:!0,configurable:!0},sourceEvent:{value:i,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:r}})}function ni(t,i,s){this.k=t,this.x=i,this.y=s}ni.prototype={constructor:ni,scale:function(t){return t===1?this:new ni(this.k*t,this.x,this.y)},translate:function(t,i){return t===0&i===0?this:new ni(this.k,this.x+this.k*t,this.y+this.k*i)},apply:function(t){return[t[0]*this.k+this.x,t[1]*this.k+this.y]},applyX:function(t){return t*this.k+this.x},applyY:function(t){return t*this.k+this.y},invert:function(t){return[(t[0]-this.x)/this.k,(t[1]-this.y)/this.k]},invertX:function(t){return(t-this.x)/this.k},invertY:function(t){return(t-this.y)/this.k},rescaleX:function(t){return t.copy().domain(t.range().map(this.invertX,this).map(t.invert,t))},rescaleY:function(t){return t.copy().domain(t.range().map(this.invertY,this).map(t.invert,t))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var ju=new ni(1,0,0);qv.prototype=ni.prototype;function qv(t){for(;!t.__zoom;)if(!(t=t.parentNode))return ju;return t.__zoom}function Ld(t){t.stopImmediatePropagation()}function Ia(t){t.preventDefault(),t.stopImmediatePropagation()}function k_(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function H_(){var t=this;return t instanceof SVGElement?(t=t.ownerSVGElement||t,t.hasAttribute("viewBox")?(t=t.viewBox.baseVal,[[t.x,t.y],[t.x+t.width,t.y+t.height]]):[[0,0],[t.width.baseVal.value,t.height.baseVal.value]]):[[0,0],[t.clientWidth,t.clientHeight]]}function a0(){return this.__zoom||ju}function j_(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function $_(){return navigator.maxTouchPoints||"ontouchstart"in this}function U_(t,i,s){var a=t.invertX(i[0][0])-s[0][0],r=t.invertX(i[1][0])-s[1][0],u=t.invertY(i[0][1])-s[0][1],c=t.invertY(i[1][1])-s[1][1];return t.translate(r>a?(a+r)/2:Math.min(0,a)||Math.max(0,r),c>u?(u+c)/2:Math.min(0,u)||Math.max(0,c))}function Vv(){var t=k_,i=H_,s=U_,a=j_,r=$_,u=[0,1/0],c=[[-1/0,-1/0],[1/0,1/0]],m=250,h=du,g=Ru("start","zoom","end"),v,p,y,w=500,x=150,S=0,_=10;function E(R){R.property("__zoom",a0).on("wheel.zoom",j,{passive:!1}).on("mousedown.zoom",Y).on("dblclick.zoom",oe).filter(r).on("touchstart.zoom",K).on("touchmove.zoom",I).on("touchend.zoom touchcancel.zoom",ae).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(R,G,T,z){var q=R.selection?R.selection():R;q.property("__zoom",a0),R!==q?k(R,G,T,z):q.interrupt().each(function(){L(this,arguments).event(z).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},E.scaleBy=function(R,G,T,z){E.scaleTo(R,function(){var q=this.__zoom.k,X=typeof G=="function"?G.apply(this,arguments):G;return q*X},T,z)},E.scaleTo=function(R,G,T,z){E.transform(R,function(){var q=i.apply(this,arguments),X=this.__zoom,te=T==null?M(q):typeof T=="function"?T.apply(this,arguments):T,C=X.invert(te),$=typeof G=="function"?G.apply(this,arguments):G;return s(N(O(X,$),te,C),q,c)},T,z)},E.translateBy=function(R,G,T,z){E.transform(R,function(){return s(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof T=="function"?T.apply(this,arguments):T),i.apply(this,arguments),c)},null,z)},E.translateTo=function(R,G,T,z,q){E.transform(R,function(){var X=i.apply(this,arguments),te=this.__zoom,C=z==null?M(X):typeof z=="function"?z.apply(this,arguments):z;return s(ju.translate(C[0],C[1]).scale(te.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof T=="function"?-T.apply(this,arguments):-T),X,c)},z,q)};function O(R,G){return G=Math.max(u[0],Math.min(u[1],G)),G===R.k?R:new ni(G,R.x,R.y)}function N(R,G,T){var z=G[0]-T[0]*R.k,q=G[1]-T[1]*R.k;return z===R.x&&q===R.y?R:new ni(R.k,z,q)}function M(R){return[(+R[0][0]+ +R[1][0])/2,(+R[0][1]+ +R[1][1])/2]}function k(R,G,T,z){R.on("start.zoom",function(){L(this,arguments).event(z).start()}).on("interrupt.zoom end.zoom",function(){L(this,arguments).event(z).end()}).tween("zoom",function(){var q=this,X=arguments,te=L(q,X).event(z),C=i.apply(q,X),$=T==null?M(C):typeof T=="function"?T.apply(q,X):T,P=Math.max(C[1][0]-C[0][0],C[1][1]-C[0][1]),ie=q.__zoom,re=typeof G=="function"?G.apply(q,X):G,de=h(ie.invert($).concat(P/ie.k),re.invert($).concat(P/re.k));return function(ue){if(ue===1)ue=re;else{var ee=de(ue),ce=P/ee[2];ue=new ni(ce,$[0]-ee[0]*ce,$[1]-ee[1]*ce)}te.zoom(null,ue)}})}function L(R,G,T){return!T&&R.__zooming||new H(R,G)}function H(R,G){this.that=R,this.args=G,this.active=0,this.sourceEvent=null,this.extent=i.apply(R,G),this.taps=0}H.prototype={event:function(R){return R&&(this.sourceEvent=R),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(R,G){return this.mouse&&R!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&R!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&R!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(R){var G=Kt(this.that).datum();g.call(R,this.that,new B_(R,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:g}),G)}};function j(R,...G){if(!t.apply(this,arguments))return;var T=L(this,G).event(R),z=this.__zoom,q=Math.max(u[0],Math.min(u[1],z.k*Math.pow(2,a.apply(this,arguments)))),X=pn(R);if(T.wheel)(T.mouse[0][0]!==X[0]||T.mouse[0][1]!==X[1])&&(T.mouse[1]=z.invert(T.mouse[0]=X)),clearTimeout(T.wheel);else{if(z.k===q)return;T.mouse=[X,z.invert(X)],gu(this),T.start()}Ia(R),T.wheel=setTimeout(te,x),T.zoom("mouse",s(N(O(z,q),T.mouse[0],T.mouse[1]),T.extent,c));function te(){T.wheel=null,T.end()}}function Y(R,...G){if(y||!t.apply(this,arguments))return;var T=R.currentTarget,z=L(this,G,!0).event(R),q=Kt(R.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",P,!0),X=pn(R,T),te=R.clientX,C=R.clientY;Nv(R.view),Ld(R),z.mouse=[X,this.__zoom.invert(X)],gu(this),z.start();function $(ie){if(Ia(ie),!z.moved){var re=ie.clientX-te,de=ie.clientY-C;z.moved=re*re+de*de>S}z.event(ie).zoom("mouse",s(N(z.that.__zoom,z.mouse[0]=pn(ie,T),z.mouse[1]),z.extent,c))}function P(ie){q.on("mousemove.zoom mouseup.zoom",null),Av(ie.view,z.moved),Ia(ie),z.event(ie).end()}}function oe(R,...G){if(t.apply(this,arguments)){var T=this.__zoom,z=pn(R.changedTouches?R.changedTouches[0]:R,this),q=T.invert(z),X=T.k*(R.shiftKey?.5:2),te=s(N(O(T,X),z,q),i.apply(this,G),c);Ia(R),m>0?Kt(this).transition().duration(m).call(k,te,z,R):Kt(this).call(E.transform,te,z,R)}}function K(R,...G){if(t.apply(this,arguments)){var T=R.touches,z=T.length,q=L(this,G,R.changedTouches.length===z).event(R),X,te,C,$;for(Ld(R),te=0;te<z;++te)C=T[te],$=pn(C,this),$=[$,this.__zoom.invert($),C.identifier],q.touch0?!q.touch1&&q.touch0[2]!==$[2]&&(q.touch1=$,q.taps=0):(q.touch0=$,X=!0,q.taps=1+!!v);v&&(v=clearTimeout(v)),X&&(q.taps<2&&(p=$[0],v=setTimeout(function(){v=null},w)),gu(this),q.start())}}function I(R,...G){if(this.__zooming){var T=L(this,G).event(R),z=R.changedTouches,q=z.length,X,te,C,$;for(Ia(R),X=0;X<q;++X)te=z[X],C=pn(te,this),T.touch0&&T.touch0[2]===te.identifier?T.touch0[0]=C:T.touch1&&T.touch1[2]===te.identifier&&(T.touch1[0]=C);if(te=T.that.__zoom,T.touch1){var P=T.touch0[0],ie=T.touch0[1],re=T.touch1[0],de=T.touch1[1],ue=(ue=re[0]-P[0])*ue+(ue=re[1]-P[1])*ue,ee=(ee=de[0]-ie[0])*ee+(ee=de[1]-ie[1])*ee;te=O(te,Math.sqrt(ue/ee)),C=[(P[0]+re[0])/2,(P[1]+re[1])/2],$=[(ie[0]+de[0])/2,(ie[1]+de[1])/2]}else if(T.touch0)C=T.touch0[0],$=T.touch0[1];else return;T.zoom("touch",s(N(te,C,$),T.extent,c))}}function ae(R,...G){if(this.__zooming){var T=L(this,G).event(R),z=R.changedTouches,q=z.length,X,te;for(Ld(R),y&&clearTimeout(y),y=setTimeout(function(){y=null},w),X=0;X<q;++X)te=z[X],T.touch0&&T.touch0[2]===te.identifier?delete T.touch0:T.touch1&&T.touch1[2]===te.identifier&&delete T.touch1;if(T.touch1&&!T.touch0&&(T.touch0=T.touch1,delete T.touch1),T.touch0)T.touch0[1]=this.__zoom.invert(T.touch0[0]);else if(T.end(),T.taps===2&&(te=pn(te,this),Math.hypot(p[0]-te[0],p[1]-te[1])<_)){var C=Kt(this).on("dblclick.zoom");C&&C.apply(this,arguments)}}}return E.wheelDelta=function(R){return arguments.length?(a=typeof R=="function"?R:eu(+R),E):a},E.filter=function(R){return arguments.length?(t=typeof R=="function"?R:eu(!!R),E):t},E.touchable=function(R){return arguments.length?(r=typeof R=="function"?R:eu(!!R),E):r},E.extent=function(R){return arguments.length?(i=typeof R=="function"?R:eu([[+R[0][0],+R[0][1]],[+R[1][0],+R[1][1]]]),E):i},E.scaleExtent=function(R){return arguments.length?(u[0]=+R[0],u[1]=+R[1],E):[u[0],u[1]]},E.translateExtent=function(R){return arguments.length?(c[0][0]=+R[0][0],c[1][0]=+R[1][0],c[0][1]=+R[0][1],c[1][1]=+R[1][1],E):[[c[0][0],c[0][1]],[c[1][0],c[1][1]]]},E.constrain=function(R){return arguments.length?(s=R,E):s},E.duration=function(R){return arguments.length?(m=+R,E):m},E.interpolate=function(R){return arguments.length?(h=R,E):h},E.on=function(){var R=g.on.apply(g,arguments);return R===g?E:R},E.clickDistance=function(R){return arguments.length?(S=(R=+R)*R,E):Math.sqrt(S)},E.tapDistance=function(R){return arguments.length?(_=+R,E):_},E}const Sn={error001:(t="react")=>`Seems like you have not used zustand provider as an ancestor. Help: https://${t}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:t=>`Node type "${t}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:t=>`The old edge with id=${t} does not exist.`,error009:t=>`Marker type "${t}" doesn't exist.`,error008:(t,{id:i,sourceHandle:s,targetHandle:a})=>`Couldn't create edge for ${t} handle id: "${t==="source"?s:a}", edge id: ${i}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:t=>`Edge type "${t}" not found. Using fallback type "default".`,error012:t=>`Node with id "${t}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(t="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${t}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:t=>`Edge with id "${t}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},ro=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Yv=["Enter"," ","Escape"],Gv={"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:t,x:i,y:s})=>`Moved selected node ${t}. New position, x: ${i}, y: ${s}`,"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 Rl;(function(t){t.Strict="strict",t.Loose="loose"})(Rl||(Rl={}));var vs;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(vs||(vs={}));var uo;(function(t){t.Partial="partial",t.Full="full"})(uo||(uo={}));const Xv={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var $i;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})($i||($i={}));var co;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(co||(co={}));var fe;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(fe||(fe={}));const o0={[fe.Left]:fe.Right,[fe.Right]:fe.Left,[fe.Top]:fe.Bottom,[fe.Bottom]:fe.Top};function Kv(t){return t===null?null:t?"valid":"invalid"}const Zv=t=>"id"in t&&"source"in t&&"target"in t,q_=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Th=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),wo=(t,i=[0,0])=>{const{width:s,height:a}=ai(t),r=t.origin??i,u=s*r[0],c=a*r[1];return{x:t.position.x-u,y:t.position.y-c}},V_=(t,i={nodeOrigin:[0,0]})=>{if(t.length===0)return{x:0,y:0,width:0,height:0};const s=t.reduce((a,r)=>{const u=typeof r=="string";let c=!i.nodeLookup&&!u?r:void 0;i.nodeLookup&&(c=u?i.nodeLookup.get(r):Th(r)?r:i.nodeLookup.get(r.id));const m=c?Tu(c,i.nodeOrigin):{x:0,y:0,x2:0,y2:0};return $u(a,m)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Uu(s)},xo=(t,i={})=>{let s={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return t.forEach(r=>{(i.filter===void 0||i.filter(r))&&(s=$u(s,Tu(r)),a=!0)}),a?Uu(s):{x:0,y:0,width:0,height:0}},Mh=(t,i,[s,a,r]=[0,0,1],u=!1,c=!1)=>{const m={...ql(i,[s,a,r]),width:i.width/r,height:i.height/r},h=[];for(const g of t.values()){const{measured:v,selectable:p=!0,hidden:y=!1}=g;if(c&&!p||y)continue;const w=v.width??g.width??g.initialWidth??null,x=v.height??g.height??g.initialHeight??null,S=fo(m,kl(g)),_=(w??0)*(x??0),E=u&&S>0;(!g.internals.handleBounds||E||S>=_||g.dragging)&&h.push(g)}return h},Y_=(t,i)=>{const s=new Set;return t.forEach(a=>{s.add(a.id)}),i.filter(a=>s.has(a.source)||s.has(a.target))};function G_(t,i){const s=new Map,a=i?.nodes?new Set(i.nodes.map(r=>r.id)):null;return t.forEach(r=>{r.measured.width&&r.measured.height&&(i?.includeHiddenNodes||!r.hidden)&&(!a||a.has(r.id))&&s.set(r.id,r)}),s}async function X_({nodes:t,width:i,height:s,panZoom:a,minZoom:r,maxZoom:u},c){if(t.size===0)return!0;const m=G_(t,c),h=xo(m),g=Oh(h,i,s,c?.minZoom??r,c?.maxZoom??u,c?.padding??.1);return await a.setViewport(g,{duration:c?.duration,ease:c?.ease,interpolate:c?.interpolate}),!0}function Qv({nodeId:t,nextPosition:i,nodeLookup:s,nodeOrigin:a=[0,0],nodeExtent:r,onError:u}){const c=s.get(t),m=c.parentId?s.get(c.parentId):void 0,{x:h,y:g}=m?m.internals.positionAbsolute:{x:0,y:0},v=c.origin??a;let p=c.extent||r;if(c.extent==="parent"&&!c.expandParent)if(!m)u?.("005",Sn.error005());else{const w=m.measured.width,x=m.measured.height;w&&x&&(p=[[h,g],[h+w,g+x]])}else m&&xs(c.extent)&&(p=[[c.extent[0][0]+h,c.extent[0][1]+g],[c.extent[1][0]+h,c.extent[1][1]+g]]);const y=xs(p)?ws(i,p,c.measured):i;return(c.measured.width===void 0||c.measured.height===void 0)&&u?.("015",Sn.error015()),{position:{x:y.x-h+(c.measured.width??0)*v[0],y:y.y-g+(c.measured.height??0)*v[1]},positionAbsolute:y}}async function K_({nodesToRemove:t=[],edgesToRemove:i=[],nodes:s,edges:a,onBeforeDelete:r}){const u=new Set(t.map(y=>y.id)),c=[];for(const y of s){if(y.deletable===!1)continue;const w=u.has(y.id),x=!w&&y.parentId&&c.find(S=>S.id===y.parentId);(w||x)&&c.push(y)}const m=new Set(i.map(y=>y.id)),h=a.filter(y=>y.deletable!==!1),v=Y_(c,h);for(const y of h)m.has(y.id)&&!v.find(x=>x.id===y.id)&&v.push(y);if(!r)return{edges:v,nodes:c};const p=await r({nodes:c,edges:v});return typeof p=="boolean"?p?{edges:v,nodes:c}:{edges:[],nodes:[]}:p}const Bl=(t,i=0,s=1)=>Math.min(Math.max(t,i),s),ws=(t={x:0,y:0},i,s)=>({x:Bl(t.x,i[0][0],i[1][0]-(s?.width??0)),y:Bl(t.y,i[0][1],i[1][1]-(s?.height??0))});function Iv(t,i,s){const{width:a,height:r}=ai(s),{x:u,y:c}=s.internals.positionAbsolute;return ws(t,[[u,c],[u+a,c+r]],i)}const r0=(t,i,s)=>t<i?Bl(Math.abs(t-i),1,i)/i:t>s?-Bl(Math.abs(t-s),1,i)/i:0,Ch=(t,i,s=15,a=40)=>{const r=r0(t.x,a,i.width-a)*s,u=r0(t.y,a,i.height-a)*s;return[r,u]},$u=(t,i)=>({x:Math.min(t.x,i.x),y:Math.min(t.y,i.y),x2:Math.max(t.x2,i.x2),y2:Math.max(t.y2,i.y2)}),oh=({x:t,y:i,width:s,height:a})=>({x:t,y:i,x2:t+s,y2:i+a}),Uu=({x:t,y:i,x2:s,y2:a})=>({x:t,y:i,width:s-t,height:a-i}),kl=(t,i=[0,0])=>{const{x:s,y:a}=Th(t)?t.internals.positionAbsolute:wo(t,i);return{x:s,y:a,width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}},Tu=(t,i=[0,0])=>{const{x:s,y:a}=Th(t)?t.internals.positionAbsolute:wo(t,i);return{x:s,y:a,x2:s+(t.measured?.width??t.width??t.initialWidth??0),y2:a+(t.measured?.height??t.height??t.initialHeight??0)}},Jv=(t,i)=>Uu($u(oh(t),oh(i))),fo=(t,i)=>{const s=Math.max(0,Math.min(t.x+t.width,i.x+i.width)-Math.max(t.x,i.x)),a=Math.max(0,Math.min(t.y+t.height,i.y+i.height)-Math.max(t.y,i.y));return Math.ceil(s*a)},u0=t=>vn(t.width)&&vn(t.height)&&vn(t.x)&&vn(t.y),vn=t=>!isNaN(t)&&isFinite(t),Fv=(t,i)=>(s,a)=>{},Eo=(t,i=[1,1])=>({x:i[0]*Math.round(t.x/i[0]),y:i[1]*Math.round(t.y/i[1])}),ql=({x:t,y:i},[s,a,r],u=!1,c=[1,1])=>{const m={x:(t-s)/r,y:(i-a)/r};return u?Eo(m,c):m},Hl=({x:t,y:i},[s,a,r])=>({x:t*r+s,y:i*r+a});function pl(t,i){if(typeof t=="number")return Math.floor((i-i/(1+t))*.5);if(typeof t=="string"&&t.endsWith("px")){const s=parseFloat(t);if(!Number.isNaN(s))return Math.floor(s)}if(typeof t=="string"&&t.endsWith("%")){const s=parseFloat(t);if(!Number.isNaN(s))return Math.floor(i*s*.01)}return console.error(`The padding value "${t}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function Z_(t,i,s){if(typeof t=="string"||typeof t=="number"){const a=pl(t,s),r=pl(t,i);return{top:a,right:r,bottom:a,left:r,x:r*2,y:a*2}}if(typeof t=="object"){const a=pl(t.top??t.y??0,s),r=pl(t.bottom??t.y??0,s),u=pl(t.left??t.x??0,i),c=pl(t.right??t.x??0,i);return{top:a,right:c,bottom:r,left:u,x:u+c,y:a+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function Q_(t,i,s,a,r,u){const{x:c,y:m}=Hl(t,[i,s,a]),{x:h,y:g}=Hl({x:t.x+t.width,y:t.y+t.height},[i,s,a]),v=r-h,p=u-g;return{left:Math.floor(c),top:Math.floor(m),right:Math.floor(v),bottom:Math.floor(p)}}const Oh=(t,i,s,a,r,u)=>{const c=Z_(u,i,s),m=(i-c.x)/t.width,h=(s-c.y)/t.height,g=Math.min(m,h),v=Bl(g,a,r),p=t.x+t.width/2,y=t.y+t.height/2,w=i/2-p*v,x=s/2-y*v,S=Q_(t,w,x,v,i,s),_={left:Math.min(S.left-c.left,0),top:Math.min(S.top-c.top,0),right:Math.min(S.right-c.right,0),bottom:Math.min(S.bottom-c.bottom,0)};return{x:w-_.left+_.right,y:x-_.top+_.bottom,zoom:v}},ho=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function xs(t){return t!=null&&t!=="parent"}function ai(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function Wv(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function Pv(t,i={width:0,height:0},s,a,r){const u={...t},c=a.get(s);if(c){const m=c.origin||r;u.x+=c.internals.positionAbsolute.x-(i.width??0)*m[0],u.y+=c.internals.positionAbsolute.y-(i.height??0)*m[1]}return u}function c0(t,i){if(t.size!==i.size)return!1;for(const s of t)if(!i.has(s))return!1;return!0}function I_(){let t,i;return{promise:new Promise((a,r)=>{t=a,i=r}),resolve:t,reject:i}}function J_(t){return{...Gv,...t||{}}}function to(t,{snapGrid:i=[0,0],snapToGrid:s=!1,transform:a,containerBounds:r}){const{x:u,y:c}=bn(t),m=ql({x:u-(r?.left??0),y:c-(r?.top??0)},a),{x:h,y:g}=s?Eo(m,i):m;return{xSnapped:h,ySnapped:g,...m}}const zh=t=>({width:t.offsetWidth,height:t.offsetHeight}),e1=t=>t?.getRootNode?.()||window?.document,F_=["INPUT","SELECT","TEXTAREA"];function t1(t){const i=t.composedPath?.()?.[0]||t.target;return i?.nodeType!==1?!1:F_.includes(i.nodeName)||i.hasAttribute("contenteditable")||!!i.closest(".nokey")}const n1=t=>"clientX"in t,bn=(t,i)=>{const s=n1(t),a=s?t.clientX:t.touches?.[0].clientX,r=s?t.clientY:t.touches?.[0].clientY;return{x:a-(i?.left??0),y:r-(i?.top??0)}},f0=(t,i,s,a,r)=>{const u=i.querySelectorAll(`.${t}`);return!u||!u.length?null:Array.from(u).map(c=>{const m=c.getBoundingClientRect();return{id:c.getAttribute("data-handleid"),type:t,nodeId:r,position:c.getAttribute("data-handlepos"),x:(m.left-s.left)/a,y:(m.top-s.top)/a,...zh(c)}})};function i1({sourceX:t,sourceY:i,targetX:s,targetY:a,sourceControlX:r,sourceControlY:u,targetControlX:c,targetControlY:m}){const h=t*.125+r*.375+c*.375+s*.125,g=i*.125+u*.375+m*.375+a*.125,v=Math.abs(h-t),p=Math.abs(g-i);return[h,g,v,p]}function tu(t,i){return t>=0?.5*t:i*25*Math.sqrt(-t)}function d0({pos:t,x1:i,y1:s,x2:a,y2:r,c:u}){switch(t){case fe.Left:return[i-tu(i-a,u),s];case fe.Right:return[i+tu(a-i,u),s];case fe.Top:return[i,s-tu(s-r,u)];case fe.Bottom:return[i,s+tu(r-s,u)]}}function s1({sourceX:t,sourceY:i,sourcePosition:s=fe.Bottom,targetX:a,targetY:r,targetPosition:u=fe.Top,curvature:c=.25}){const[m,h]=d0({pos:s,x1:t,y1:i,x2:a,y2:r,c}),[g,v]=d0({pos:u,x1:a,y1:r,x2:t,y2:i,c}),[p,y,w,x]=i1({sourceX:t,sourceY:i,targetX:a,targetY:r,sourceControlX:m,sourceControlY:h,targetControlX:g,targetControlY:v});return[`M${t},${i} C${m},${h} ${g},${v} ${a},${r}`,p,y,w,x]}function l1({sourceX:t,sourceY:i,targetX:s,targetY:a}){const r=Math.abs(s-t)/2,u=s<t?s+r:s-r,c=Math.abs(a-i)/2,m=a<i?a+c:a-c;return[u,m,r,c]}function W_({sourceNode:t,targetNode:i,selected:s=!1,zIndex:a=0,elevateOnSelect:r=!1,zIndexMode:u="basic"}){if(u==="manual")return a;const c=r&&s?a+1e3:a,m=Math.max(t.parentId||r&&t.selected?t.internals.z:0,i.parentId||r&&i.selected?i.internals.z:0);return c+m}function P_({sourceNode:t,targetNode:i,width:s,height:a,transform:r}){const u=$u(Tu(t),Tu(i));u.x===u.x2&&(u.x2+=1),u.y===u.y2&&(u.y2+=1);const c={x:-r[0]/r[2],y:-r[1]/r[2],width:s/r[2],height:a/r[2]};return fo(c,Uu(u))>0}const eN=({source:t,sourceHandle:i,target:s,targetHandle:a})=>`xy-edge__${t}${i||""}-${s}${a||""}`,tN=(t,i)=>i.some(s=>s.source===t.source&&s.target===t.target&&(s.sourceHandle===t.sourceHandle||!s.sourceHandle&&!t.sourceHandle)&&(s.targetHandle===t.targetHandle||!s.targetHandle&&!t.targetHandle)),nN=(t,i,s={})=>{if(!t.source||!t.target)return s.onError?.("006",Sn.error006()),i;const a=s.getEdgeId||eN;let r;return Zv(t)?r={...t}:r={...t,id:a(t)},tN(r,i)?i:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,i.concat(r))};function a1({sourceX:t,sourceY:i,targetX:s,targetY:a}){const[r,u,c,m]=l1({sourceX:t,sourceY:i,targetX:s,targetY:a});return[`M ${t},${i}L ${s},${a}`,r,u,c,m]}const h0={[fe.Left]:{x:-1,y:0},[fe.Right]:{x:1,y:0},[fe.Top]:{x:0,y:-1},[fe.Bottom]:{x:0,y:1}},iN=({source:t,sourcePosition:i=fe.Bottom,target:s})=>i===fe.Left||i===fe.Right?t.x<s.x?{x:1,y:0}:{x:-1,y:0}:t.y<s.y?{x:0,y:1}:{x:0,y:-1},m0=(t,i)=>Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2));function sN({source:t,sourcePosition:i=fe.Bottom,target:s,targetPosition:a=fe.Top,center:r,offset:u,stepPosition:c}){const m=h0[i],h=h0[a],g={x:t.x+m.x*u,y:t.y+m.y*u},v={x:s.x+h.x*u,y:s.y+h.y*u},p=iN({source:g,sourcePosition:i,target:v}),y=p.x!==0?"x":"y",w=p[y];let x=[],S,_;const E={x:0,y:0},O={x:0,y:0},[,,N,M]=l1({sourceX:t.x,sourceY:t.y,targetX:s.x,targetY:s.y});if(m[y]*h[y]===-1){y==="x"?(S=r.x??g.x+(v.x-g.x)*c,_=r.y??(g.y+v.y)/2):(S=r.x??(g.x+v.x)/2,_=r.y??g.y+(v.y-g.y)*c);const j=[{x:S,y:g.y},{x:S,y:v.y}],Y=[{x:g.x,y:_},{x:v.x,y:_}];m[y]===w?x=y==="x"?j:Y:x=y==="x"?Y:j}else{const j=[{x:g.x,y:v.y}],Y=[{x:v.x,y:g.y}];if(y==="x"?x=m.x===w?Y:j:x=m.y===w?j:Y,i===a){const R=Math.abs(t[y]-s[y]);if(R<=u){const G=Math.min(u-1,u-R);m[y]===w?E[y]=(g[y]>t[y]?-1:1)*G:O[y]=(v[y]>s[y]?-1:1)*G}}if(i!==a){const R=y==="x"?"y":"x",G=m[y]===h[R],T=g[R]>v[R],z=g[R]<v[R];(m[y]===1&&(!G&&T||G&&z)||m[y]!==1&&(!G&&z||G&&T))&&(x=y==="x"?j:Y)}const oe={x:g.x+E.x,y:g.y+E.y},K={x:v.x+O.x,y:v.y+O.y},I=Math.max(Math.abs(oe.x-x[0].x),Math.abs(K.x-x[0].x)),ae=Math.max(Math.abs(oe.y-x[0].y),Math.abs(K.y-x[0].y));I>=ae?(S=(oe.x+K.x)/2,_=x[0].y):(S=x[0].x,_=(oe.y+K.y)/2)}const k={x:g.x+E.x,y:g.y+E.y},L={x:v.x+O.x,y:v.y+O.y};return[[t,...k.x!==x[0].x||k.y!==x[0].y?[k]:[],...x,...L.x!==x[x.length-1].x||L.y!==x[x.length-1].y?[L]:[],s],S,_,N,M]}function lN(t,i,s,a){const r=Math.min(m0(t,i)/2,m0(i,s)/2,a),{x:u,y:c}=i;if(t.x===u&&u===s.x||t.y===c&&c===s.y)return`L${u} ${c}`;if(t.y===c){const g=t.x<s.x?-1:1,v=t.y<s.y?1:-1;return`L ${u+r*g},${c}Q ${u},${c} ${u},${c+r*v}`}const m=t.x<s.x?1:-1,h=t.y<s.y?-1:1;return`L ${u},${c+r*h}Q ${u},${c} ${u+r*m},${c}`}function rh({sourceX:t,sourceY:i,sourcePosition:s=fe.Bottom,targetX:a,targetY:r,targetPosition:u=fe.Top,borderRadius:c=5,centerX:m,centerY:h,offset:g=20,stepPosition:v=.5}){const[p,y,w,x,S]=sN({source:{x:t,y:i},sourcePosition:s,target:{x:a,y:r},targetPosition:u,center:{x:m,y:h},offset:g,stepPosition:v});let _=`M${p[0].x} ${p[0].y}`;for(let E=1;E<p.length-1;E++)_+=lN(p[E-1],p[E],p[E+1],c);return _+=`L${p[p.length-1].x} ${p[p.length-1].y}`,[_,y,w,x,S]}function g0(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function aN(t){const{sourceNode:i,targetNode:s}=t;if(!g0(i)||!g0(s))return null;const a=i.internals.handleBounds||p0(i.handles),r=s.internals.handleBounds||p0(s.handles),u=y0(a?.source??[],t.sourceHandle),c=y0(t.connectionMode===Rl.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),t.targetHandle);if(!u||!c)return t.onError?.("008",Sn.error008(u?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const m=u?.position||fe.Bottom,h=c?.position||fe.Top,g=Es(i,u,m),v=Es(s,c,h);return{sourceX:g.x,sourceY:g.y,targetX:v.x,targetY:v.y,sourcePosition:m,targetPosition:h}}function p0(t){if(!t)return null;const i=[],s=[];for(const a of t)a.width=a.width??1,a.height=a.height??1,a.type==="source"?i.push(a):a.type==="target"&&s.push(a);return{source:i,target:s}}function Es(t,i,s=fe.Left,a=!1){const r=(i?.x??0)+t.internals.positionAbsolute.x,u=(i?.y??0)+t.internals.positionAbsolute.y,{width:c,height:m}=i??ai(t);if(a)return{x:r+c/2,y:u+m/2};switch(i?.position??s){case fe.Top:return{x:r+c/2,y:u};case fe.Right:return{x:r+c,y:u+m/2};case fe.Bottom:return{x:r+c/2,y:u+m};case fe.Left:return{x:r,y:u+m/2}}}function y0(t,i){return t&&(i?t.find(s=>s.id===i):t[0])||null}function uh(t,i){return t?typeof t=="string"?t:`${i?`${i}__`:""}${Object.keys(t).sort().map(a=>`${a}=${t[a]}`).join("&")}`:""}function oN(t,{id:i,defaultColor:s,defaultMarkerStart:a,defaultMarkerEnd:r}){const u=new Set;return t.reduce((c,m)=>([m.markerStart||a,m.markerEnd||r].forEach(h=>{if(h&&typeof h=="object"){const g=uh(h,i);u.has(g)||(c.push({id:g,color:h.color||s,...h}),u.add(g))}}),c),[]).sort((c,m)=>c.id.localeCompare(m.id))}const o1=1e3,rN=10,Dh={nodeOrigin:[0,0],nodeExtent:ro,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},uN={...Dh,checkEquality:!0};function Lh(t,i){const s={...t};for(const a in i)i[a]!==void 0&&(s[a]=i[a]);return s}function cN(t,i,s){const a=Lh(Dh,s);for(const r of t.values())if(r.parentId)Bh(r,t,i,a);else{const u=wo(r,a.nodeOrigin),c=xs(r.extent)?r.extent:a.nodeExtent,m=ws(u,c,ai(r));r.internals.positionAbsolute=m}}function fN(t,i){if(!t.handles)return t.measured?i?.internals.handleBounds:void 0;const s=[],a=[];for(const r of t.handles){const u={id:r.id,width:r.width??1,height:r.height??1,nodeId:t.id,x:r.x,y:r.y,position:r.position,type:r.type};r.type==="source"?s.push(u):r.type==="target"&&a.push(u)}return{source:s,target:a}}function Rh(t){return t==="manual"}function ch(t,i,s,a={}){const r=Lh(uN,a),u={i:0},c=new Map(i),m=r?.elevateNodesOnSelect&&!Rh(r.zIndexMode)?o1:0;let h=t.length>0,g=!1;i.clear(),s.clear();for(const v of t){let p=c.get(v.id);if(r.checkEquality&&v===p?.internals.userNode)i.set(v.id,p);else{const y=wo(v,r.nodeOrigin),w=xs(v.extent)?v.extent:r.nodeExtent,x=ws(y,w,ai(v));p={...r.defaults,...v,measured:{width:v.measured?.width,height:v.measured?.height},internals:{positionAbsolute:x,handleBounds:fN(v,p),z:r1(v,m,r.zIndexMode),userNode:v}},i.set(v.id,p)}(p.measured===void 0||p.measured.width===void 0||p.measured.height===void 0)&&!p.hidden&&(h=!1),v.parentId&&Bh(p,i,s,a,u),g||=v.selected??!1}return{nodesInitialized:h,hasSelectedNodes:g}}function dN(t,i){if(!t.parentId)return;const s=i.get(t.parentId);s?s.set(t.id,t):i.set(t.parentId,new Map([[t.id,t]]))}function Bh(t,i,s,a,r){const{elevateNodesOnSelect:u,nodeOrigin:c,nodeExtent:m,zIndexMode:h}=Lh(Dh,a),g=t.parentId,v=i.get(g);if(!v){console.warn(`Parent node ${g} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}dN(t,s),r&&!v.parentId&&v.internals.rootParentIndex===void 0&&h==="auto"&&(v.internals.rootParentIndex=++r.i,v.internals.z=v.internals.z+r.i*rN),r&&v.internals.rootParentIndex!==void 0&&(r.i=v.internals.rootParentIndex);const p=u&&!Rh(h)?o1:0,{x:y,y:w,z:x}=hN(t,v,c,m,p,h),{positionAbsolute:S}=t.internals,_=y!==S.x||w!==S.y;(_||x!==t.internals.z)&&i.set(t.id,{...t,internals:{...t.internals,positionAbsolute:_?{x:y,y:w}:S,z:x}})}function r1(t,i,s){const a=vn(t.zIndex)?t.zIndex:0;return Rh(s)?a:a+(t.selected?i:0)}function hN(t,i,s,a,r,u){const{x:c,y:m}=i.internals.positionAbsolute,h=ai(t),g=wo(t,s),v=xs(t.extent)?ws(g,t.extent,h):g;let p=ws({x:c+v.x,y:m+v.y},a,h);t.extent==="parent"&&(p=Iv(p,h,i));const y=r1(t,r,u),w=i.internals.z??0;return{x:p.x,y:p.y,z:w>=y?w+1:y}}function kh(t,i,s,a=[0,0]){const r=[],u=new Map;for(const c of t){const m=i.get(c.parentId);if(!m)continue;const h=u.get(c.parentId)?.expandedRect??kl(m),g=Jv(h,c.rect);u.set(c.parentId,{expandedRect:g,parent:m})}return u.size>0&&u.forEach(({expandedRect:c,parent:m},h)=>{const g=m.internals.positionAbsolute,v=ai(m),p=m.origin??a,y=c.x<g.x?Math.round(Math.abs(g.x-c.x)):0,w=c.y<g.y?Math.round(Math.abs(g.y-c.y)):0,x=Math.max(v.width,Math.round(c.width)),S=Math.max(v.height,Math.round(c.height)),_=(x-v.width)*p[0],E=(S-v.height)*p[1];(y>0||w>0||_||E)&&(r.push({id:h,type:"position",position:{x:m.position.x-y+_,y:m.position.y-w+E}}),s.get(h)?.forEach(O=>{t.some(N=>N.id===O.id)||r.push({id:O.id,type:"position",position:{x:O.position.x+y,y:O.position.y+w}})})),(v.width<c.width||v.height<c.height||y||w)&&r.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:x+(y?p[0]*y-_:0),height:S+(w?p[1]*w-E:0)}})}),r}function mN(t,i,s,a,r,u,c){const m=a?.querySelector(".xyflow__viewport");let h=!1;if(!m)return{changes:[],updatedInternals:h};const g=[],v=window.getComputedStyle(m),{m22:p}=new window.DOMMatrixReadOnly(v.transform),y=[];for(const w of t.values()){const x=i.get(w.id);if(!x)continue;if(x.hidden){i.set(x.id,{...x,internals:{...x.internals,handleBounds:void 0}}),h=!0;continue}const S=zh(w.nodeElement),_=x.measured.width!==S.width||x.measured.height!==S.height;if(!!(S.width&&S.height&&(_||!x.internals.handleBounds||w.force))){const O=w.nodeElement.getBoundingClientRect(),N=xs(x.extent)?x.extent:u;let{positionAbsolute:M}=x.internals;x.parentId&&x.extent==="parent"?M=Iv(M,S,i.get(x.parentId)):N&&(M=ws(M,N,S));const k={...x,measured:S,internals:{...x.internals,positionAbsolute:M,handleBounds:{source:f0("source",w.nodeElement,O,p,x.id),target:f0("target",w.nodeElement,O,p,x.id)}}};i.set(x.id,k),x.parentId&&Bh(k,i,s,{nodeOrigin:r,zIndexMode:c}),h=!0,_&&(g.push({id:x.id,type:"dimensions",dimensions:S}),x.expandParent&&x.parentId&&y.push({id:x.id,parentId:x.parentId,rect:kl(k,r)}))}}if(y.length>0){const w=kh(y,i,s,r);g.push(...w)}return{changes:g,updatedInternals:h}}async function gN({delta:t,panZoom:i,transform:s,translateExtent:a,width:r,height:u}){if(!i||!t.x&&!t.y)return!1;const c=await i.setViewportConstrained({x:s[0]+t.x,y:s[1]+t.y,zoom:s[2]},[[0,0],[r,u]],a);return!!c&&(c.x!==s[0]||c.y!==s[1]||c.k!==s[2])}function v0(t,i,s,a,r,u){let c=r;const m=a.get(c)||new Map;a.set(c,m.set(s,i)),c=`${r}-${t}`;const h=a.get(c)||new Map;if(a.set(c,h.set(s,i)),u){c=`${r}-${t}-${u}`;const g=a.get(c)||new Map;a.set(c,g.set(s,i))}}function u1(t,i,s){t.clear(),i.clear();for(const a of s){const{source:r,target:u,sourceHandle:c=null,targetHandle:m=null}=a,h={edgeId:a.id,source:r,target:u,sourceHandle:c,targetHandle:m},g=`${r}-${c}--${u}-${m}`,v=`${u}-${m}--${r}-${c}`;v0("source",h,v,t,r,c),v0("target",h,g,t,u,m),i.set(a.id,a)}}function c1(t,i){if(!t.parentId)return!1;const s=i.get(t.parentId);return s?s.selected?!0:c1(s,i):!1}function b0(t,i,s){let a=t;do{if(a?.matches?.(i))return!0;if(a===s)return!1;a=a?.parentElement}while(a);return!1}function pN(t,i,s,a){const r=new Map;for(const[u,c]of t)if((c.selected||c.id===a)&&(!c.parentId||!c1(c,t))&&(c.draggable||i&&typeof c.draggable>"u")){const m=t.get(u);m&&r.set(u,{id:u,position:m.position||{x:0,y:0},distance:{x:s.x-m.internals.positionAbsolute.x,y:s.y-m.internals.positionAbsolute.y},extent:m.extent,parentId:m.parentId,origin:m.origin,expandParent:m.expandParent,internals:{positionAbsolute:m.internals.positionAbsolute||{x:0,y:0}},measured:{width:m.measured.width??0,height:m.measured.height??0}})}return r}function Rd({nodeId:t,dragItems:i,nodeLookup:s,dragging:a=!0}){const r=[];for(const[c,m]of i){const h=s.get(c)?.internals.userNode;h&&r.push({...h,position:m.position,dragging:a})}if(!t)return[r[0],r];const u=s.get(t)?.internals.userNode;return[u?{...u,position:i.get(t)?.position||u.position,dragging:a}:r[0],r]}function yN({dragItems:t,snapGrid:i,x:s,y:a}){const r=t.values().next().value;if(!r)return null;const u={x:s-r.distance.x,y:a-r.distance.y},c=Eo(u,i);return{x:c.x-u.x,y:c.y-u.y}}function vN({onNodeMouseDown:t,getStoreItems:i,onDragStart:s,onDrag:a,onDragStop:r}){let u={x:null,y:null},c=0,m=new Map,h=!1,g={x:0,y:0},v=null,p=!1,y=null,w=!1,x=!1,S=null;function _({noDragClassName:O,handleSelector:N,domNode:M,isSelectable:k,nodeId:L,nodeClickDistance:H=0}){y=Kt(M);function j({x:I,y:ae}){const{nodeLookup:R,nodeExtent:G,snapGrid:T,snapToGrid:z,nodeOrigin:q,onNodeDrag:X,onSelectionDrag:te,onError:C,updateNodePositions:$}=i();u={x:I,y:ae};let P=!1;const ie=m.size>1,re=ie&&G?oh(xo(m)):null,de=ie&&z?yN({dragItems:m,snapGrid:T,x:I,y:ae}):null;for(const[ue,ee]of m){if(!R.has(ue))continue;let ce={x:I-ee.distance.x,y:ae-ee.distance.y};z&&(ce=de?{x:Math.round(ce.x+de.x),y:Math.round(ce.y+de.y)}:Eo(ce,T));let Se=null;if(ie&&G&&!ee.extent&&re){const{positionAbsolute:ye}=ee.internals,Ee=ye.x-re.x+G[0][0],De=ye.x+ee.measured.width-re.x2+G[1][0],Ge=ye.y-re.y+G[0][1],yt=ye.y+ee.measured.height-re.y2+G[1][1];Se=[[Ee,Ge],[De,yt]]}const{position:be,positionAbsolute:ge}=Qv({nodeId:ue,nextPosition:ce,nodeLookup:R,nodeExtent:Se||G,nodeOrigin:q,onError:C});P=P||ee.position.x!==be.x||ee.position.y!==be.y,ee.position=be,ee.internals.positionAbsolute=ge}if(x=x||P,!!P&&($(m,!0),S&&(a||X||!L&&te))){const[ue,ee]=Rd({nodeId:L,dragItems:m,nodeLookup:R});a?.(S,m,ue,ee),X?.(S,ue,ee),L||te?.(S,ee)}}async function Y(){if(!v)return;const{transform:I,panBy:ae,autoPanSpeed:R,autoPanOnNodeDrag:G}=i();if(!G){h=!1,cancelAnimationFrame(c);return}const[T,z]=Ch(g,v,R);(T!==0||z!==0)&&(u.x=(u.x??0)-T/I[2],u.y=(u.y??0)-z/I[2],await ae({x:T,y:z})&&j(u)),c=requestAnimationFrame(Y)}function oe(I){const{nodeLookup:ae,multiSelectionActive:R,nodesDraggable:G,transform:T,snapGrid:z,snapToGrid:q,selectNodesOnDrag:X,onNodeDragStart:te,onSelectionDragStart:C,unselectNodesAndEdges:$}=i();p=!0,(!X||!k)&&!R&&L&&(ae.get(L)?.selected||$()),k&&X&&L&&t?.(L);const P=to(I.sourceEvent,{transform:T,snapGrid:z,snapToGrid:q,containerBounds:v});if(u=P,m=pN(ae,G,P,L),m.size>0&&(s||te||!L&&C)){const[ie,re]=Rd({nodeId:L,dragItems:m,nodeLookup:ae});s?.(I.sourceEvent,m,ie,re),te?.(I.sourceEvent,ie,re),L||C?.(I.sourceEvent,re)}}const K=Tv().clickDistance(H).on("start",I=>{const{domNode:ae,nodeDragThreshold:R,transform:G,snapGrid:T,snapToGrid:z}=i();v=ae?.getBoundingClientRect()||null,w=!1,x=!1,S=I.sourceEvent,R===0&&oe(I),u=to(I.sourceEvent,{transform:G,snapGrid:T,snapToGrid:z,containerBounds:v}),g=bn(I.sourceEvent,v)}).on("drag",I=>{const{autoPanOnNodeDrag:ae,transform:R,snapGrid:G,snapToGrid:T,nodeDragThreshold:z,nodeLookup:q}=i(),X=to(I.sourceEvent,{transform:R,snapGrid:G,snapToGrid:T,containerBounds:v});if(S=I.sourceEvent,(I.sourceEvent.type==="touchmove"&&I.sourceEvent.touches.length>1||L&&!q.has(L))&&(w=!0),!w){if(!h&&ae&&p&&(h=!0,Y()),!p){const te=bn(I.sourceEvent,v),C=te.x-g.x,$=te.y-g.y;Math.sqrt(C*C+$*$)>z&&oe(I)}(u.x!==X.xSnapped||u.y!==X.ySnapped)&&m&&p&&(g=bn(I.sourceEvent,v),j(X))}}).on("end",I=>{if(!p||w){w&&m.size>0&&i().updateNodePositions(m,!1);return}if(h=!1,p=!1,cancelAnimationFrame(c),m.size>0){const{nodeLookup:ae,updateNodePositions:R,onNodeDragStop:G,onSelectionDragStop:T}=i();if(x&&(R(m,!1),x=!1),r||G||!L&&T){const[z,q]=Rd({nodeId:L,dragItems:m,nodeLookup:ae,dragging:!1});r?.(I.sourceEvent,m,z,q),G?.(I.sourceEvent,z,q),L||T?.(I.sourceEvent,q)}}}).filter(I=>{const ae=I.target;return!I.button&&(!O||!b0(ae,`.${O}`,M))&&(!N||b0(ae,N,M))});y.call(K)}function E(){y?.on(".drag",null)}return{update:_,destroy:E}}function bN(t,i,s){const a=[],r={x:t.x-s,y:t.y-s,width:s*2,height:s*2};for(const u of i.values())fo(r,kl(u))>0&&a.push(u);return a}const SN=250;function wN(t,i,s,a){let r=[],u=1/0;const c=bN(t,s,i+SN);for(const m of c){const h=[...m.internals.handleBounds?.source??[],...m.internals.handleBounds?.target??[]];for(const g of h){if(a.nodeId===g.nodeId&&a.type===g.type&&a.id===g.id)continue;const{x:v,y:p}=Es(m,g,g.position,!0),y=Math.sqrt(Math.pow(v-t.x,2)+Math.pow(p-t.y,2));y>i||(y<u?(r=[{...g,x:v,y:p}],u=y):y===u&&r.push({...g,x:v,y:p}))}}if(!r.length)return null;if(r.length>1){const m=a.type==="source"?"target":"source";return r.find(h=>h.type===m)??r[0]}return r[0]}function f1(t,i,s,a,r,u=!1){const c=a.get(t);if(!c)return null;const m=r==="strict"?c.internals.handleBounds?.[i]:[...c.internals.handleBounds?.source??[],...c.internals.handleBounds?.target??[]],h=(s?m?.find(g=>g.id===s):m?.[0])??null;return h&&u?{...h,...Es(c,h,h.position,!0)}:h}function d1(t,i){return t||(i?.classList.contains("target")?"target":i?.classList.contains("source")?"source":null)}function xN(t,i){let s=null;return i?s=!0:t&&!i&&(s=!1),s}const h1=()=>!0;function EN(t,{connectionMode:i,connectionRadius:s,handleId:a,nodeId:r,edgeUpdaterType:u,isTarget:c,domNode:m,nodeLookup:h,lib:g,autoPanOnConnect:v,flowId:p,panBy:y,cancelConnection:w,onConnectStart:x,onConnect:S,onConnectEnd:_,isValidConnection:E=h1,onReconnectEnd:O,updateConnection:N,getTransform:M,getFromHandle:k,autoPanSpeed:L,dragThreshold:H=1,handleDomNode:j}){const Y=e1(t.target);let oe=0,K;const{x:I,y:ae}=bn(t),R=d1(u,j),G=m?.getBoundingClientRect();let T=!1;if(!G||!R)return;const z=f1(r,R,a,h,i);if(!z)return;let q=bn(t,G),X=!1,te=null,C=!1,$=null;function P(){if(!v||!G)return;const[be,ge]=Ch(q,G,L);y({x:be,y:ge}),oe=requestAnimationFrame(P)}const ie={...z,nodeId:r,type:R,position:z.position},re=h.get(r);let ue={inProgress:!0,isValid:null,from:Es(re,ie,fe.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:re,to:q,toHandle:null,toPosition:o0[ie.position],toNode:null,pointer:q};function ee(){T=!0,N(ue),x?.(t,{nodeId:r,handleId:a,handleType:R})}H===0&&ee();function ce(be){if(!T){const{x:yt,y:It}=bn(be),Nt=yt-I,At=It-ae;if(!(Nt*Nt+At*At>H*H))return;ee()}if(!k()||!ie){Se(be);return}const ge=M();q=bn(be,G),K=wN(ql(q,ge,!1,[1,1]),s,h,ie),X||(P(),X=!0);const ye=m1(be,{handle:K,connectionMode:i,fromNodeId:r,fromHandleId:a,fromType:c?"target":"source",isValidConnection:E,doc:Y,lib:g,flowId:p,nodeLookup:h});$=ye.handleDomNode,te=ye.connection,C=xN(!!K,ye.isValid);const Ee=h.get(r),De=Ee?Es(Ee,ie,fe.Left,!0):ue.from,Ge={...ue,from:De,isValid:C,to:ye.toHandle&&C?Hl({x:ye.toHandle.x,y:ye.toHandle.y},ge):q,toHandle:ye.toHandle,toPosition:C&&ye.toHandle?ye.toHandle.position:o0[ie.position],toNode:ye.toHandle?h.get(ye.toHandle.nodeId):null,pointer:q};N(Ge),ue=Ge}function Se(be){if(!("touches"in be&&be.touches.length>0)){if(T){(K||$)&&te&&C&&S?.(te);const{inProgress:ge,...ye}=ue,Ee={...ye,toPosition:ue.toHandle?ue.toPosition:null};_?.(be,Ee),u&&O?.(be,Ee)}w(),cancelAnimationFrame(oe),X=!1,C=!1,te=null,$=null,Y.removeEventListener("mousemove",ce),Y.removeEventListener("mouseup",Se),Y.removeEventListener("touchmove",ce),Y.removeEventListener("touchend",Se)}}Y.addEventListener("mousemove",ce),Y.addEventListener("mouseup",Se),Y.addEventListener("touchmove",ce),Y.addEventListener("touchend",Se)}function m1(t,{handle:i,connectionMode:s,fromNodeId:a,fromHandleId:r,fromType:u,doc:c,lib:m,flowId:h,isValidConnection:g=h1,nodeLookup:v}){const p=u==="target",y=i?c.querySelector(`.${m}-flow__handle[data-id="${h}-${i?.nodeId}-${i?.id}-${i?.type}"]`):null,{x:w,y:x}=bn(t),S=c.elementFromPoint(w,x),_=S?.classList.contains(`${m}-flow__handle`)?S:y,E={handleDomNode:_,isValid:!1,connection:null,toHandle:null};if(_){const O=d1(void 0,_),N=_.getAttribute("data-nodeid"),M=_.getAttribute("data-handleid"),k=_.classList.contains("connectable"),L=_.classList.contains("connectableend");if(!N||!O)return E;const H={source:p?N:a,sourceHandle:p?M:r,target:p?a:N,targetHandle:p?r:M};E.connection=H;const Y=k&&L&&(s===Rl.Strict?p&&O==="source"||!p&&O==="target":N!==a||M!==r);E.isValid=Y&&g(H),E.toHandle=f1(N,O,M,v,s,!0)}return E}const fh={onPointerDown:EN,isValid:m1};function _N({domNode:t,panZoom:i,getTransform:s,getViewScale:a}){const r=Kt(t);function u({translateExtent:m,width:h,height:g,zoomStep:v=1,pannable:p=!0,zoomable:y=!0,inversePan:w=!1}){const x=N=>{if(N.sourceEvent.type!=="wheel"||!i)return;const M=s(),k=N.sourceEvent.ctrlKey&&ho()?10:1,L=-N.sourceEvent.deltaY*(N.sourceEvent.deltaMode===1?.05:N.sourceEvent.deltaMode?1:.002)*v,H=M[2]*Math.pow(2,L*k);i.scaleTo(H)};let S=[0,0];const _=N=>{(N.sourceEvent.type==="mousedown"||N.sourceEvent.type==="touchstart")&&(S=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY])},E=N=>{const M=s();if(N.sourceEvent.type!=="mousemove"&&N.sourceEvent.type!=="touchmove"||!i)return;const k=[N.sourceEvent.clientX??N.sourceEvent.touches[0].clientX,N.sourceEvent.clientY??N.sourceEvent.touches[0].clientY],L=[k[0]-S[0],k[1]-S[1]];S=k;const H=a()*Math.max(M[2],Math.log(M[2]))*(w?-1:1),j={x:M[0]-L[0]*H,y:M[1]-L[1]*H},Y=[[0,0],[h,g]];i.setViewportConstrained({x:j.x,y:j.y,zoom:M[2]},Y,m)},O=Vv().on("start",_).on("zoom",p?E:null).on("zoom.wheel",y?x:null);r.call(O,{})}function c(){r.on("zoom",null)}return{update:u,destroy:c,pointer:pn}}const qu=t=>({x:t.x,y:t.y,zoom:t.k}),Bd=({x:t,y:i,zoom:s})=>ju.translate(t,i).scale(s),wl=(t,i)=>t.target.closest(`.${i}`),g1=(t,i)=>i===2&&Array.isArray(t)&&t.includes(2),NN=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,kd=(t,i=0,s=NN,a=()=>{})=>{const r=typeof i=="number"&&i>0;return r||a(),r?t.transition().duration(i).ease(s).on("end",a):t},p1=t=>{const i=t.ctrlKey&&ho()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*i};function AN({zoomPanValues:t,noWheelClassName:i,d3Selection:s,d3Zoom:a,panOnScrollMode:r,panOnScrollSpeed:u,zoomOnPinch:c,onPanZoomStart:m,onPanZoom:h,onPanZoomEnd:g}){return v=>{if(wl(v,i))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const p=s.property("__zoom").k||1;if(v.ctrlKey&&c){const _=pn(v),E=p1(v),O=p*Math.pow(2,E);a.scaleTo(s,O,_,v);return}const y=v.deltaMode===1?20:1;let w=r===vs.Vertical?0:v.deltaX*y,x=r===vs.Horizontal?0:v.deltaY*y;!ho()&&v.shiftKey&&r!==vs.Vertical&&(w=v.deltaY*y,x=0),a.translateBy(s,-(w/p)*u,-(x/p)*u,{internal:!0});const S=qu(s.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(h?.(v,S),t.panScrollTimeout=setTimeout(()=>{g?.(v,S),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,m?.(v,S))}}function TN({noWheelClassName:t,preventScrolling:i,d3ZoomHandler:s}){return function(a,r){const u=a.type==="wheel",c=!i&&u&&!a.ctrlKey,m=wl(a,t);if(a.ctrlKey&&u&&m&&a.preventDefault(),c||m)return null;a.preventDefault(),s.call(this,a,r)}}function MN({zoomPanValues:t,onDraggingChange:i,onPanZoomStart:s}){return a=>{if(a.sourceEvent?.internal)return;const r=qu(a.transform);t.mouseButton=a.sourceEvent?.button||0,t.isZoomingOrPanning=!0,t.prevViewport=r,a.sourceEvent?.type==="mousedown"&&i(!0),s&&s?.(a.sourceEvent,r)}}function CN({zoomPanValues:t,panOnDrag:i,onPaneContextMenu:s,onTransformChange:a,onPanZoom:r}){return u=>{t.usedRightMouseButton=!!(s&&g1(i,t.mouseButton??0)),u.sourceEvent?.sync||a([u.transform.x,u.transform.y,u.transform.k]),r&&!u.sourceEvent?.internal&&r?.(u.sourceEvent,qu(u.transform))}}function ON({zoomPanValues:t,panOnDrag:i,panOnScroll:s,onDraggingChange:a,onPanZoomEnd:r,onPaneContextMenu:u}){return c=>{if(!c.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,u&&g1(i,t.mouseButton??0)&&!t.usedRightMouseButton&&c.sourceEvent&&u(c.sourceEvent),t.usedRightMouseButton=!1,a(!1),r)){const m=qu(c.transform);t.prevViewport=m,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{r?.(c.sourceEvent,m)},s?150:0)}}}function zN({zoomActivationKeyPressed:t,zoomOnScroll:i,zoomOnPinch:s,panOnDrag:a,panOnScroll:r,zoomOnDoubleClick:u,userSelectionActive:c,noWheelClassName:m,noPanClassName:h,lib:g,connectionInProgress:v}){return p=>{const y=t||i,w=s&&p.ctrlKey,x=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(wl(p,`${g}-flow__node`)||wl(p,`${g}-flow__edge`)))return!0;if(!a&&!y&&!r&&!u&&!s||c||v&&!x||wl(p,m)&&x||wl(p,h)&&(!x||r&&x&&!t)||!s&&p.ctrlKey&&x)return!1;if(!s&&p.type==="touchstart"&&p.touches?.length>1)return p.preventDefault(),!1;if(!y&&!r&&!w&&x||!a&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(a)&&!a.includes(p.button)&&p.type==="mousedown")return!1;const S=Array.isArray(a)&&a.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||x)&&S}}function DN({domNode:t,minZoom:i,maxZoom:s,translateExtent:a,viewport:r,onPanZoom:u,onPanZoomStart:c,onPanZoomEnd:m,onDraggingChange:h}){const g={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=t.getBoundingClientRect(),p=Vv().scaleExtent([i,s]).translateExtent(a),y=Kt(t).call(p);O({x:r.x,y:r.y,zoom:Bl(r.zoom,i,s)},[[0,0],[v.width,v.height]],a);const w=y.on("wheel.zoom"),x=y.on("dblclick.zoom");p.wheelDelta(p1);async function S(K,I){return y?new Promise(ae=>{p?.interpolate(I?.interpolate==="linear"?eo:du).transform(kd(y,I?.duration,I?.ease,()=>ae(!0)),K)}):!1}function _({noWheelClassName:K,noPanClassName:I,onPaneContextMenu:ae,userSelectionActive:R,panOnScroll:G,panOnDrag:T,panOnScrollMode:z,panOnScrollSpeed:q,preventScrolling:X,zoomOnPinch:te,zoomOnScroll:C,zoomOnDoubleClick:$,zoomActivationKeyPressed:P,lib:ie,onTransformChange:re,connectionInProgress:de,paneClickDistance:ue,selectionOnDrag:ee}){R&&!g.isZoomingOrPanning&&E();const ce=G&&!P&&!R;p.clickDistance(ee?1/0:!vn(ue)||ue<0?0:ue);const Se=ce?AN({zoomPanValues:g,noWheelClassName:K,d3Selection:y,d3Zoom:p,panOnScrollMode:z,panOnScrollSpeed:q,zoomOnPinch:te,onPanZoomStart:c,onPanZoom:u,onPanZoomEnd:m}):TN({noWheelClassName:K,preventScrolling:X,d3ZoomHandler:w});y.on("wheel.zoom",Se,{passive:!1});const be=MN({zoomPanValues:g,onDraggingChange:h,onPanZoomStart:c});p.on("start",be);const ge=CN({zoomPanValues:g,panOnDrag:T,onPaneContextMenu:!!ae,onPanZoom:u,onTransformChange:re});p.on("zoom",ge);const ye=ON({zoomPanValues:g,panOnDrag:T,panOnScroll:G,onPaneContextMenu:ae,onPanZoomEnd:m,onDraggingChange:h});p.on("end",ye);const Ee=zN({zoomActivationKeyPressed:P,panOnDrag:T,zoomOnScroll:C,panOnScroll:G,zoomOnDoubleClick:$,zoomOnPinch:te,userSelectionActive:R,noPanClassName:I,noWheelClassName:K,lib:ie,connectionInProgress:de});p.filter(Ee),$?y.on("dblclick.zoom",x):y.on("dblclick.zoom",null)}function E(){p.on("zoom",null)}async function O(K,I,ae){const R=Bd(K),G=p?.constrain()(R,I,ae);return G&&await S(G),G}async function N(K,I){const ae=Bd(K);return await S(ae,I),ae}function M(K){if(y){const I=Bd(K),ae=y.property("__zoom");(ae.k!==K.zoom||ae.x!==K.x||ae.y!==K.y)&&p?.transform(y,I,null,{sync:!0})}}function k(){const K=y?qv(y.node()):{x:0,y:0,k:1};return{x:K.x,y:K.y,zoom:K.k}}async function L(K,I){return y?new Promise(ae=>{p?.interpolate(I?.interpolate==="linear"?eo:du).scaleTo(kd(y,I?.duration,I?.ease,()=>ae(!0)),K)}):!1}async function H(K,I){return y?new Promise(ae=>{p?.interpolate(I?.interpolate==="linear"?eo:du).scaleBy(kd(y,I?.duration,I?.ease,()=>ae(!0)),K)}):!1}function j(K){p?.scaleExtent(K)}function Y(K){p?.translateExtent(K)}function oe(K){const I=!vn(K)||K<0?0:K;p?.clickDistance(I)}return{update:_,destroy:E,setViewport:N,setViewportConstrained:O,getViewport:k,scaleTo:L,scaleBy:H,setScaleExtent:j,setTranslateExtent:Y,syncViewport:M,setClickDistance:oe}}var jl;(function(t){t.Line="line",t.Handle="handle"})(jl||(jl={}));function LN({width:t,prevWidth:i,height:s,prevHeight:a,affectsX:r,affectsY:u}){const c=t-i,m=s-a,h=[c>0?1:c<0?-1:0,m>0?1:m<0?-1:0];return c&&r&&(h[0]=h[0]*-1),m&&u&&(h[1]=h[1]*-1),h}function S0(t){const i=t.includes("right")||t.includes("left"),s=t.includes("bottom")||t.includes("top"),a=t.includes("left"),r=t.includes("top");return{isHorizontal:i,isVertical:s,affectsX:a,affectsY:r}}function ki(t,i){return Math.max(0,i-t)}function Hi(t,i){return Math.max(0,t-i)}function nu(t,i,s){return Math.max(0,i-t,t-s)}function w0(t,i){return t?!i:i}function RN(t,i,s,a,r,u,c,m){let{affectsX:h,affectsY:g}=i;const{isHorizontal:v,isVertical:p}=i,y=v&&p,{xSnapped:w,ySnapped:x}=s,{minWidth:S,maxWidth:_,minHeight:E,maxHeight:O}=a,{x:N,y:M,width:k,height:L,aspectRatio:H}=t;let j=Math.floor(v?w-t.pointerX:0),Y=Math.floor(p?x-t.pointerY:0);const oe=k+(h?-j:j),K=L+(g?-Y:Y),I=-u[0]*k,ae=-u[1]*L;let R=nu(oe,S,_),G=nu(K,E,O);if(c){let q=0,X=0;h&&j<0?q=ki(N+j+I,c[0][0]):!h&&j>0&&(q=Hi(N+oe+I,c[1][0])),g&&Y<0?X=ki(M+Y+ae,c[0][1]):!g&&Y>0&&(X=Hi(M+K+ae,c[1][1])),R=Math.max(R,q),G=Math.max(G,X)}if(m){let q=0,X=0;h&&j>0?q=Hi(N+j,m[0][0]):!h&&j<0&&(q=ki(N+oe,m[1][0])),g&&Y>0?X=Hi(M+Y,m[0][1]):!g&&Y<0&&(X=ki(M+K,m[1][1])),R=Math.max(R,q),G=Math.max(G,X)}if(r){if(v){const q=nu(oe/H,E,O)*H;if(R=Math.max(R,q),c){let X=0;!h&&!g||h&&!g&&y?X=Hi(M+ae+oe/H,c[1][1])*H:X=ki(M+ae+(h?j:-j)/H,c[0][1])*H,R=Math.max(R,X)}if(m){let X=0;!h&&!g||h&&!g&&y?X=ki(M+oe/H,m[1][1])*H:X=Hi(M+(h?j:-j)/H,m[0][1])*H,R=Math.max(R,X)}}if(p){const q=nu(K*H,S,_)/H;if(G=Math.max(G,q),c){let X=0;!h&&!g||g&&!h&&y?X=Hi(N+K*H+I,c[1][0])/H:X=ki(N+(g?Y:-Y)*H+I,c[0][0])/H,G=Math.max(G,X)}if(m){let X=0;!h&&!g||g&&!h&&y?X=ki(N+K*H,m[1][0])/H:X=Hi(N+(g?Y:-Y)*H,m[0][0])/H,G=Math.max(G,X)}}}Y=Y+(Y<0?G:-G),j=j+(j<0?R:-R),r&&(y?oe>K*H?Y=(w0(h,g)?-j:j)/H:j=(w0(h,g)?-Y:Y)*H:v?(Y=j/H,g=h):(j=Y*H,h=g));const T=h?N+j:N,z=g?M+Y:M;return{width:k+(h?-j:j),height:L+(g?-Y:Y),x:u[0]*j*(h?-1:1)+T,y:u[1]*Y*(g?-1:1)+z}}const y1={width:0,height:0,x:0,y:0},BN={...y1,pointerX:0,pointerY:0,aspectRatio:1};function kN(t,i,s){const a=i.position.x+t.position.x,r=i.position.y+t.position.y,u=t.measured.width??0,c=t.measured.height??0,m=s[0]*u,h=s[1]*c;return[[a-m,r-h],[a+u-m,r+c-h]]}function HN({domNode:t,nodeId:i,getStoreItems:s,onChange:a,onEnd:r}){const u=Kt(t);let c={controlDirection:S0("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function m({controlPosition:g,boundaries:v,keepAspectRatio:p,resizeDirection:y,onResizeStart:w,onResize:x,onResizeEnd:S,shouldResize:_}){let E={...y1},O={...BN};c={boundaries:v,resizeDirection:y,keepAspectRatio:p,controlDirection:S0(g)};let N,M=null,k=[],L,H,j,Y=!1;const oe=Tv().on("start",K=>{const{nodeLookup:I,transform:ae,snapGrid:R,snapToGrid:G,nodeOrigin:T,paneDomNode:z}=s();if(N=I.get(i),!N)return;M=z?.getBoundingClientRect()??null;const{xSnapped:q,ySnapped:X}=to(K.sourceEvent,{transform:ae,snapGrid:R,snapToGrid:G,containerBounds:M});E={width:N.measured.width??0,height:N.measured.height??0,x:N.position.x??0,y:N.position.y??0},O={...E,pointerX:q,pointerY:X,aspectRatio:E.width/E.height},L=void 0,H=xs(N.extent)?N.extent:void 0,N.parentId&&(N.extent==="parent"||N.expandParent)&&(L=I.get(N.parentId)),L&&N.extent==="parent"&&(H=[[0,0],[L.measured.width,L.measured.height]]),k=[],j=void 0;for(const[te,C]of I)if(C.parentId===i&&(k.push({id:te,position:{...C.position},extent:C.extent}),C.extent==="parent"||C.expandParent)){const $=kN(C,N,C.origin??T);j?j=[[Math.min($[0][0],j[0][0]),Math.min($[0][1],j[0][1])],[Math.max($[1][0],j[1][0]),Math.max($[1][1],j[1][1])]]:j=$}w?.(K,{...E})}).on("drag",K=>{const{transform:I,snapGrid:ae,snapToGrid:R,nodeOrigin:G}=s(),T=to(K.sourceEvent,{transform:I,snapGrid:ae,snapToGrid:R,containerBounds:M}),z=[];if(!N)return;const{x:q,y:X,width:te,height:C}=E,$={},P=N.origin??G,{width:ie,height:re,x:de,y:ue}=RN(O,c.controlDirection,T,c.boundaries,c.keepAspectRatio,P,H,j),ee=ie!==te,ce=re!==C,Se=de!==q&&ee,be=ue!==X&&ce;if(!Se&&!be&&!ee&&!ce)return;if((Se||be||P[0]===1||P[1]===1)&&($.x=Se?de:E.x,$.y=be?ue:E.y,E.x=$.x,E.y=$.y,k.length>0)){const De=de-q,Ge=ue-X;for(const yt of k)yt.position={x:yt.position.x-De+P[0]*(ie-te),y:yt.position.y-Ge+P[1]*(re-C)},z.push(yt)}if((ee||ce)&&($.width=ee&&(!c.resizeDirection||c.resizeDirection==="horizontal")?ie:E.width,$.height=ce&&(!c.resizeDirection||c.resizeDirection==="vertical")?re:E.height,E.width=$.width,E.height=$.height),L&&N.expandParent){const De=P[0]*($.width??0);$.x&&$.x<De&&(E.x=De,O.x=O.x-($.x-De));const Ge=P[1]*($.height??0);$.y&&$.y<Ge&&(E.y=Ge,O.y=O.y-($.y-Ge))}const ge=LN({width:E.width,prevWidth:te,height:E.height,prevHeight:C,affectsX:c.controlDirection.affectsX,affectsY:c.controlDirection.affectsY}),ye={...E,direction:ge};_?.(K,ye)!==!1&&(Y=!0,x?.(K,ye),a($,z))}).on("end",K=>{Y&&(S?.(K,{...E}),r?.({...E}),Y=!1)});u.call(oe)}function h(){u.on(".drag",null)}return{update:m,destroy:h}}var Hd={exports:{}},jd={},$d={exports:{}},Ud={};var x0;function jN(){if(x0)return Ud;x0=1;var t=vo();function i(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var s=typeof Object.is=="function"?Object.is:i,a=t.useState,r=t.useEffect,u=t.useLayoutEffect,c=t.useDebugValue;function m(p,y){var w=y(),x=a({inst:{value:w,getSnapshot:y}}),S=x[0].inst,_=x[1];return u(function(){S.value=w,S.getSnapshot=y,h(S)&&_({inst:S})},[p,w,y]),r(function(){return h(S)&&_({inst:S}),p(function(){h(S)&&_({inst:S})})},[p]),c(w),w}function h(p){var y=p.getSnapshot;p=p.value;try{var w=y();return!s(p,w)}catch{return!0}}function g(p,y){return y()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?g:m;return Ud.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:v,Ud}var E0;function $N(){return E0||(E0=1,$d.exports=jN()),$d.exports}var _0;function UN(){if(_0)return jd;_0=1;var t=vo(),i=$N();function s(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var a=typeof Object.is=="function"?Object.is:s,r=i.useSyncExternalStore,u=t.useRef,c=t.useEffect,m=t.useMemo,h=t.useDebugValue;return jd.useSyncExternalStoreWithSelector=function(g,v,p,y,w){var x=u(null);if(x.current===null){var S={hasValue:!1,value:null};x.current=S}else S=x.current;x=m(function(){function E(L){if(!O){if(O=!0,N=L,L=y(L),w!==void 0&&S.hasValue){var H=S.value;if(w(H,L))return M=H}return M=L}if(H=M,a(N,L))return H;var j=y(L);return w!==void 0&&w(H,j)?(N=L,H):(N=L,M=j)}var O=!1,N,M,k=p===void 0?null:p;return[function(){return E(v())},k===null?void 0:function(){return E(k())}]},[v,p,y,w]);var _=r(g,x[0],x[1]);return c(function(){S.hasValue=!0,S.value=_},[_]),h(_),_},jd}var N0;function qN(){return N0||(N0=1,Hd.exports=UN()),Hd.exports}var VN=qN();const YN=cv(VN),GN={},A0=t=>{let i;const s=new Set,a=(v,p)=>{const y=typeof v=="function"?v(i):v;if(!Object.is(y,i)){const w=i;i=p??(typeof y!="object"||y===null)?y:Object.assign({},i,y),s.forEach(x=>x(i,w))}},r=()=>i,h={setState:a,getState:r,getInitialState:()=>g,subscribe:v=>(s.add(v),()=>s.delete(v)),destroy:()=>{(GN?"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."),s.clear()}},g=i=t(a,r,h);return h},XN=t=>t?A0(t):A0,{useDebugValue:KN}=fv,{useSyncExternalStoreWithSelector:ZN}=YN,QN=t=>t;function v1(t,i=QN,s){const a=ZN(t.subscribe,t.getState,t.getServerState||t.getInitialState,i,s);return KN(a),a}const T0=(t,i)=>{const s=XN(t),a=(r,u=i)=>v1(s,r,u);return Object.assign(a,s),a},IN=(t,i)=>t?T0(t,i):T0;function Qe(t,i){if(Object.is(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;if(t instanceof Map&&i instanceof Map){if(t.size!==i.size)return!1;for(const[a,r]of t)if(!Object.is(r,i.get(a)))return!1;return!0}if(t instanceof Set&&i instanceof Set){if(t.size!==i.size)return!1;for(const a of t)if(!i.has(a))return!1;return!0}const s=Object.keys(t);if(s.length!==Object.keys(i).length)return!1;for(const a of s)if(!Object.prototype.hasOwnProperty.call(i,a)||!Object.is(t[a],i[a]))return!1;return!0}dv();const Vu=F.createContext(null),JN=Vu.Provider,b1=Sn.error001("react");function ze(t,i){const s=F.useContext(Vu);if(s===null)throw new Error(b1);return v1(s,t,i)}function Je(){const t=F.useContext(Vu);if(t===null)throw new Error(b1);return F.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const M0={display:"none"},FN={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},S1="react-flow__node-desc",w1="react-flow__edge-desc",WN="react-flow__aria-live",PN=t=>t.ariaLiveMessage,eA=t=>t.ariaLabelConfig;function tA({rfId:t}){const i=ze(PN);return D.jsx("div",{id:`${WN}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:FN,children:i})}function nA({rfId:t,disableKeyboardA11y:i}){const s=ze(eA);return D.jsxs(D.Fragment,{children:[D.jsx("div",{id:`${S1}-${t}`,style:M0,children:i?s["node.a11yDescription.default"]:s["node.a11yDescription.keyboardDisabled"]}),D.jsx("div",{id:`${w1}-${t}`,style:M0,children:s["edge.a11yDescription.default"]}),!i&&D.jsx(tA,{rfId:t})]})}const Yu=F.forwardRef(({position:t="top-left",children:i,className:s,style:a,...r},u)=>{const c=`${t}`.split("-");return D.jsx("div",{className:ut(["react-flow__panel",s,...c]),style:a,ref:u,...r,children:i})});Yu.displayName="Panel";function iA({proOptions:t,position:i="bottom-right"}){return t?.hideAttribution?null:D.jsx(Yu,{position:i,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:D.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const sA=t=>{const i=[],s=[];for(const[,a]of t.nodeLookup)a.selected&&i.push(a.internals.userNode);for(const[,a]of t.edgeLookup)a.selected&&s.push(a);return{selectedNodes:i,selectedEdges:s}},iu=t=>t.id;function lA(t,i){return Qe(t.selectedNodes.map(iu),i.selectedNodes.map(iu))&&Qe(t.selectedEdges.map(iu),i.selectedEdges.map(iu))}function aA({onSelectionChange:t}){const i=Je(),{selectedNodes:s,selectedEdges:a}=ze(sA,lA);return F.useEffect(()=>{const r={nodes:s,edges:a};t?.(r),i.getState().onSelectionChangeHandlers.forEach(u=>u(r))},[s,a,t]),null}const oA=t=>!!t.onSelectionChangeHandlers;function rA({onSelectionChange:t}){const i=ze(oA);return t||i?D.jsx(aA,{onSelectionChange:t}):null}const x1=[0,0],uA={x:0,y:0,zoom:1},cA=["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"],C0=[...cA,"rfId"],fA=t=>({setNodes:t.setNodes,setEdges:t.setEdges,setMinZoom:t.setMinZoom,setMaxZoom:t.setMaxZoom,setTranslateExtent:t.setTranslateExtent,setNodeExtent:t.setNodeExtent,reset:t.reset,setDefaultNodesAndEdges:t.setDefaultNodesAndEdges}),O0={translateExtent:ro,nodeOrigin:x1,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function dA(t){const{setNodes:i,setEdges:s,setMinZoom:a,setMaxZoom:r,setTranslateExtent:u,setNodeExtent:c,reset:m,setDefaultNodesAndEdges:h}=ze(fA,Qe),g=Je();F.useEffect(()=>(h(t.defaultNodes,t.defaultEdges),()=>{v.current=O0,m()}),[]);const v=F.useRef(O0);return F.useEffect(()=>{for(const p of C0){const y=t[p],w=v.current[p];y!==w&&(typeof t[p]>"u"||(p==="nodes"?i(y):p==="edges"?s(y):p==="minZoom"?a(y):p==="maxZoom"?r(y):p==="translateExtent"?u(y):p==="nodeExtent"?c(y):p==="ariaLabelConfig"?g.setState({ariaLabelConfig:J_(y)}):p==="fitView"?g.setState({fitViewQueued:y}):p==="fitViewOptions"?g.setState({fitViewOptions:y}):g.setState({[p]:y})))}v.current=t},C0.map(p=>t[p])),null}function z0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function hA(t){const[i,s]=F.useState(t==="system"?null:t);return F.useEffect(()=>{if(t!=="system"){s(t);return}const a=z0(),r=()=>s(a?.matches?"dark":"light");return r(),a?.addEventListener("change",r),()=>{a?.removeEventListener("change",r)}},[t]),i!==null?i:z0()?.matches?"dark":"light"}const D0=typeof document<"u"?document:null;function mo(t=null,i={target:D0,actInsideInputWithModifier:!0}){const[s,a]=F.useState(!1),r=F.useRef(!1),u=F.useRef(new Set([])),[c,m]=F.useMemo(()=>{if(t!==null){const g=(Array.isArray(t)?t:[t]).filter(p=>typeof p=="string").map(p=>p.replace("+",`
10
+ `).replace(`
11
+
12
+ `,`
13
+ +`).split(`
14
+ `)),v=g.reduce((p,y)=>p.concat(...y),[]);return[g,v]}return[[],[]]},[t]);return F.useEffect(()=>{const h=i?.target??D0,g=i?.actInsideInputWithModifier??!0;if(t!==null){const v=w=>{if(r.current=w.ctrlKey||w.metaKey||w.shiftKey||w.altKey,(!r.current||r.current&&!g)&&t1(w))return!1;const S=R0(w.code,m);if(u.current.add(w[S]),L0(c,u.current,!1)){const _=w.composedPath?.()?.[0]||w.target,E=_?.nodeName==="BUTTON"||_?.nodeName==="A";i.preventDefault!==!1&&(r.current||!E)&&w.preventDefault(),a(!0)}},p=w=>{const x=R0(w.code,m);L0(c,u.current,!0)?(a(!1),u.current.clear()):u.current.delete(w[x]),w.key==="Meta"&&u.current.clear(),r.current=!1},y=()=>{u.current.clear(),a(!1)};return h?.addEventListener("keydown",v),h?.addEventListener("keyup",p),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{h?.removeEventListener("keydown",v),h?.removeEventListener("keyup",p),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[t,a]),s}function L0(t,i,s){return t.filter(a=>s||a.length===i.size).some(a=>a.every(r=>i.has(r)))}function R0(t,i){return i.includes(t)?"code":"key"}const mA=()=>{const t=Je();return F.useMemo(()=>({zoomIn:async i=>{const{panZoom:s}=t.getState();return s?s.scaleBy(1.2,i):!1},zoomOut:async i=>{const{panZoom:s}=t.getState();return s?s.scaleBy(1/1.2,i):!1},zoomTo:async(i,s)=>{const{panZoom:a}=t.getState();return a?a.scaleTo(i,s):!1},getZoom:()=>t.getState().transform[2],setViewport:async(i,s)=>{const{transform:[a,r,u],panZoom:c}=t.getState();return c?(await c.setViewport({x:i.x??a,y:i.y??r,zoom:i.zoom??u},s),!0):!1},getViewport:()=>{const[i,s,a]=t.getState().transform;return{x:i,y:s,zoom:a}},setCenter:async(i,s,a)=>t.getState().setCenter(i,s,a),fitBounds:async(i,s)=>{const{width:a,height:r,minZoom:u,maxZoom:c,panZoom:m}=t.getState(),h=Oh(i,a,r,u,c,s?.padding??.1);return m?(await m.setViewport(h,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0):!1},screenToFlowPosition:(i,s={})=>{const{transform:a,snapGrid:r,snapToGrid:u,domNode:c}=t.getState();if(!c)return i;const{x:m,y:h}=c.getBoundingClientRect(),g={x:i.x-m,y:i.y-h},v=s.snapGrid??r,p=s.snapToGrid??u;return ql(g,a,p,v)},flowToScreenPosition:i=>{const{transform:s,domNode:a}=t.getState();if(!a)return i;const{x:r,y:u}=a.getBoundingClientRect(),c=Hl(i,s);return{x:c.x+r,y:c.y+u}}}),[])};function E1(t,i){const s=[],a=new Map,r=[];for(const u of t)if(u.type==="add"){r.push(u);continue}else if(u.type==="remove"||u.type==="replace")a.set(u.id,[u]);else{const c=a.get(u.id);c?c.push(u):a.set(u.id,[u])}for(const u of i){const c=a.get(u.id);if(!c){s.push(u);continue}if(c[0].type==="remove")continue;if(c[0].type==="replace"){s.push({...c[0].item});continue}const m={...u};for(const h of c)gA(h,m);s.push(m)}return r.length&&r.forEach(u=>{u.index!==void 0?s.splice(u.index,0,{...u.item}):s.push({...u.item})}),s}function gA(t,i){switch(t.type){case"select":{i.selected=t.selected;break}case"position":{typeof t.position<"u"&&(i.position=t.position),typeof t.dragging<"u"&&(i.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(i.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(i.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(i.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(i.resizing=t.resizing);break}}}function pA(t,i){return E1(t,i)}function yA(t,i){return E1(t,i)}function ds(t,i){return{id:t,type:"select",selected:i}}function xl(t,i=new Set,s=!1){const a=[];for(const[r,u]of t){const c=i.has(r);!(u.selected===void 0&&!c)&&u.selected!==c&&(s&&(u.selected=c),a.push(ds(u.id,c)))}return a}function B0({items:t=[],lookup:i}){const s=[],a=new Map(t.map(r=>[r.id,r]));for(const[r,u]of t.entries()){const c=i.get(u.id),m=c?.internals?.userNode??c;m!==void 0&&m!==u&&s.push({id:u.id,item:u,type:"replace"}),m===void 0&&s.push({item:u,type:"add",index:r})}for(const[r]of i)a.get(r)===void 0&&s.push({id:r,type:"remove"});return s}function k0(t){return{id:t.id,type:"remove"}}const vA=Fv();function bA(t,i,s={}){return nN(t,i,{...s,onError:s.onError??vA})}const H0=t=>q_(t),SA=t=>Zv(t);function _1(t){return F.forwardRef(t)}const wA=typeof window<"u"?F.useLayoutEffect:F.useEffect;function j0(t){const[i,s]=F.useState(BigInt(0)),[a]=F.useState(()=>xA(()=>s(r=>r+BigInt(1))));return wA(()=>{const r=a.get();r.length&&(t(r),a.reset())},[i]),a}function xA(t){let i=[];return{get:()=>i,reset:()=>{i=[]},push:s=>{i.push(s),t()}}}const N1=F.createContext(null);function EA({children:t}){const i=Je(),s=F.useCallback(m=>{const{nodes:h=[],setNodes:g,hasDefaultNodes:v,onNodesChange:p,nodeLookup:y,fitViewQueued:w,onNodesChangeMiddlewareMap:x}=i.getState();let S=h;for(const E of m)S=typeof E=="function"?E(S):E;let _=B0({items:S,lookup:y});for(const E of x.values())_=E(_);v&&g(S),_.length>0?p?.(_):w&&window.requestAnimationFrame(()=>{const{fitViewQueued:E,nodes:O,setNodes:N}=i.getState();E&&N(O)})},[]),a=j0(s),r=F.useCallback(m=>{const{edges:h=[],setEdges:g,hasDefaultEdges:v,onEdgesChange:p,edgeLookup:y}=i.getState();let w=h;for(const x of m)w=typeof x=="function"?x(w):x;v?g(w):p&&p(B0({items:w,lookup:y}))},[]),u=j0(r),c=F.useMemo(()=>({nodeQueue:a,edgeQueue:u}),[]);return D.jsx(N1.Provider,{value:c,children:t})}function _A(){const t=F.useContext(N1);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const NA=t=>!!t.panZoom;function Gu(){const t=mA(),i=Je(),s=_A(),a=ze(NA),r=F.useMemo(()=>{const u=p=>i.getState().nodeLookup.get(p),c=p=>{s.nodeQueue.push(p)},m=p=>{s.edgeQueue.push(p)},h=p=>{const{nodeLookup:y,nodeOrigin:w}=i.getState(),x=H0(p)?p:y.get(p.id),S=x.parentId?Pv(x.position,x.measured,x.parentId,y,w):x.position,_={...x,position:S,width:x.measured?.width??x.width,height:x.measured?.height??x.height};return kl(_)},g=(p,y,w={replace:!1})=>{c(x=>x.map(S=>{if(S.id===p){const _=typeof y=="function"?y(S):y;return w.replace&&H0(_)?_:{...S,..._}}return S}))},v=(p,y,w={replace:!1})=>{m(x=>x.map(S=>{if(S.id===p){const _=typeof y=="function"?y(S):y;return w.replace&&SA(_)?_:{...S,..._}}return S}))};return{getNodes:()=>i.getState().nodes.map(p=>({...p})),getNode:p=>u(p)?.internals.userNode,getInternalNode:u,getEdges:()=>{const{edges:p=[]}=i.getState();return p.map(y=>({...y}))},getEdge:p=>i.getState().edgeLookup.get(p),setNodes:c,setEdges:m,addNodes:p=>{const y=Array.isArray(p)?p:[p];s.nodeQueue.push(w=>[...w,...y])},addEdges:p=>{const y=Array.isArray(p)?p:[p];s.edgeQueue.push(w=>[...w,...y])},toObject:()=>{const{nodes:p=[],edges:y=[],transform:w}=i.getState(),[x,S,_]=w;return{nodes:p.map(E=>({...E})),edges:y.map(E=>({...E})),viewport:{x,y:S,zoom:_}}},deleteElements:async({nodes:p=[],edges:y=[]})=>{const{nodes:w,edges:x,onNodesDelete:S,onEdgesDelete:_,triggerNodeChanges:E,triggerEdgeChanges:O,onDelete:N,onBeforeDelete:M}=i.getState(),{nodes:k,edges:L}=await K_({nodesToRemove:p,edgesToRemove:y,nodes:w,edges:x,onBeforeDelete:M}),H=L.length>0,j=k.length>0;if(H){const Y=L.map(k0);_?.(L),O(Y)}if(j){const Y=k.map(k0);S?.(k),E(Y)}return(j||H)&&N?.({nodes:k,edges:L}),{deletedNodes:k,deletedEdges:L}},getIntersectingNodes:(p,y=!0,w)=>{const x=u0(p),S=x?p:h(p),_=w!==void 0;return S?(w||i.getState().nodes).filter(E=>{const O=i.getState().nodeLookup.get(E.id);if(O&&!x&&(E.id===p.id||!O.internals.positionAbsolute))return!1;const N=kl(_?E:O),M=fo(N,S);return y&&M>0||M>=N.width*N.height||M>=S.width*S.height}):[]},isNodeIntersecting:(p,y,w=!0)=>{const S=u0(p)?p:h(p);if(!S)return!1;const _=fo(S,y);return w&&_>0||_>=y.width*y.height||_>=S.width*S.height},updateNode:g,updateNodeData:(p,y,w={replace:!1})=>{g(p,x=>{const S=typeof y=="function"?y(x):y;return w.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},w)},updateEdge:v,updateEdgeData:(p,y,w={replace:!1})=>{v(p,x=>{const S=typeof y=="function"?y(x):y;return w.replace?{...x,data:S}:{...x,data:{...x.data,...S}}},w)},getNodesBounds:p=>{const{nodeLookup:y,nodeOrigin:w}=i.getState();return V_(p,{nodeLookup:y,nodeOrigin:w})},getHandleConnections:({type:p,id:y,nodeId:w})=>Array.from(i.getState().connectionLookup.get(`${w}-${p}${y?`-${y}`:""}`)?.values()??[]),getNodeConnections:({type:p,handleId:y,nodeId:w})=>Array.from(i.getState().connectionLookup.get(`${w}${p?y?`-${p}-${y}`:`-${p}`:""}`)?.values()??[]),fitView:async p=>{const y=i.getState().fitViewResolver??I_();return i.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:y}),s.nodeQueue.push(w=>[...w]),y.promise}}},[]);return F.useMemo(()=>({...r,...t,viewportInitialized:a}),[a])}const $0=t=>t.selected,AA=typeof window<"u"?window:void 0;function TA({deleteKeyCode:t,multiSelectionKeyCode:i}){const s=Je(),{deleteElements:a}=Gu(),r=mo(t,{actInsideInputWithModifier:!1}),u=mo(i,{target:AA});F.useEffect(()=>{if(r){const{edges:c,nodes:m}=s.getState();a({nodes:m.filter($0),edges:c.filter($0)}),s.setState({nodesSelectionActive:!1})}},[r]),F.useEffect(()=>{s.setState({multiSelectionActive:u})},[u])}function MA(t){const i=Je();F.useEffect(()=>{const s=()=>{if(!t.current||!(t.current.checkVisibility?.()??!0))return!1;const a=zh(t.current);(a.height===0||a.width===0)&&i.getState().onError?.("004",Sn.error004()),i.setState({width:a.width||500,height:a.height||500})};if(t.current){s(),window.addEventListener("resize",s);const a=new ResizeObserver(()=>s());return a.observe(t.current),()=>{window.removeEventListener("resize",s),a&&t.current&&a.unobserve(t.current)}}},[])}const Xu={position:"absolute",width:"100%",height:"100%",top:0,left:0},CA=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function OA({onPaneContextMenu:t,zoomOnScroll:i=!0,zoomOnPinch:s=!0,panOnScroll:a=!1,panOnScrollSpeed:r=.5,panOnScrollMode:u=vs.Free,zoomOnDoubleClick:c=!0,panOnDrag:m=!0,defaultViewport:h,translateExtent:g,minZoom:v,maxZoom:p,zoomActivationKeyCode:y,preventScrolling:w=!0,children:x,noWheelClassName:S,noPanClassName:_,onViewportChange:E,isControlledViewport:O,paneClickDistance:N,selectionOnDrag:M}){const k=Je(),L=F.useRef(null),{userSelectionActive:H,lib:j,connectionInProgress:Y}=ze(CA,Qe),oe=mo(y),K=F.useRef();MA(L);const I=F.useCallback(ae=>{E?.({x:ae[0],y:ae[1],zoom:ae[2]}),O||k.setState({transform:ae})},[E,O]);return F.useEffect(()=>{if(L.current){K.current=DN({domNode:L.current,minZoom:v,maxZoom:p,translateExtent:g,viewport:h,onDraggingChange:T=>k.setState(z=>z.paneDragging===T?z:{paneDragging:T}),onPanZoomStart:(T,z)=>{const{onViewportChangeStart:q,onMoveStart:X}=k.getState();X?.(T,z),q?.(z)},onPanZoom:(T,z)=>{const{onViewportChange:q,onMove:X}=k.getState();X?.(T,z),q?.(z)},onPanZoomEnd:(T,z)=>{const{onViewportChangeEnd:q,onMoveEnd:X}=k.getState();X?.(T,z),q?.(z)}});const{x:ae,y:R,zoom:G}=K.current.getViewport();return k.setState({panZoom:K.current,transform:[ae,R,G],domNode:L.current.closest(".react-flow")}),()=>{K.current?.destroy()}}},[]),F.useEffect(()=>{K.current?.update({onPaneContextMenu:t,zoomOnScroll:i,zoomOnPinch:s,panOnScroll:a,panOnScrollSpeed:r,panOnScrollMode:u,zoomOnDoubleClick:c,panOnDrag:m,zoomActivationKeyPressed:oe,preventScrolling:w,noPanClassName:_,userSelectionActive:H,noWheelClassName:S,lib:j,onTransformChange:I,connectionInProgress:Y,selectionOnDrag:M,paneClickDistance:N})},[t,i,s,a,r,u,c,m,oe,w,_,H,S,j,I,Y,M,N]),D.jsx("div",{className:"react-flow__renderer",ref:L,style:Xu,children:x})}const zA=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function DA(){const{userSelectionActive:t,userSelectionRect:i}=ze(zA,Qe);return t&&i?D.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:i.width,height:i.height,transform:`translate(${i.x}px, ${i.y}px)`}}):null}const qd=(t,i)=>s=>{s.target===i.current&&t?.(s)},LA=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging,panBy:t.panBy,autoPanSpeed:t.autoPanSpeed});function RA({isSelecting:t,selectionKeyPressed:i,selectionMode:s=uo.Full,panOnDrag:a,autoPanOnSelection:r,paneClickDistance:u,selectionOnDrag:c,onSelectionStart:m,onSelectionEnd:h,onPaneClick:g,onPaneContextMenu:v,onPaneScroll:p,onPaneMouseEnter:y,onPaneMouseMove:w,onPaneMouseLeave:x,children:S}){const _=F.useRef(0),E=Je(),{userSelectionActive:O,elementsSelectable:N,dragging:M,connectionInProgress:k,panBy:L,autoPanSpeed:H}=ze(LA,Qe),j=N&&(t||O),Y=F.useRef(null),oe=F.useRef(),K=F.useRef(new Set),I=F.useRef(new Set),ae=F.useRef(!1),R=F.useRef({x:0,y:0}),G=F.useRef(!1),T=ee=>{if(ae.current||k){ae.current=!1;return}g?.(ee),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},z=ee=>{if(Array.isArray(a)&&a?.includes(2)){ee.preventDefault();return}v?.(ee)},q=p?ee=>p(ee):void 0,X=ee=>{ae.current&&(ee.stopPropagation(),ae.current=!1)},te=ee=>{const{domNode:ce,transform:Se}=E.getState();if(oe.current=ce?.getBoundingClientRect(),!oe.current)return;const be=ee.target===Y.current;if(!be&&!!ee.target.closest(".nokey")||!t||!(c&&be||i)||ee.button!==0||!ee.isPrimary)return;ee.target?.setPointerCapture?.(ee.pointerId),ae.current=!1;const{x:Ee,y:De}=bn(ee.nativeEvent,oe.current),Ge=ql({x:Ee,y:De},Se);E.setState({userSelectionRect:{width:0,height:0,startX:Ge.x,startY:Ge.y,x:Ee,y:De}}),be||(ee.stopPropagation(),ee.preventDefault())};function C(ee,ce){const{userSelectionRect:Se}=E.getState();if(!Se)return;const{transform:be,nodeLookup:ge,edgeLookup:ye,connectionLookup:Ee,triggerNodeChanges:De,triggerEdgeChanges:Ge,defaultEdgeOptions:yt}=E.getState(),It={x:Se.startX,y:Se.startY},{x:Nt,y:At}=Hl(It,be),Ht={startX:It.x,startY:It.y,x:ee<Nt?ee:Nt,y:ce<At?ce:At,width:Math.abs(ee-Nt),height:Math.abs(ce-At)},Yi=K.current,Rn=I.current;K.current=new Set(Mh(ge,Ht,be,s===uo.Partial,!0).map(jt=>jt.id)),I.current=new Set;const tt=yt?.selectable??!0;for(const jt of K.current){const Jt=Ee.get(jt);if(Jt)for(const{edgeId:Ft}of Jt.values()){const Wt=ye.get(Ft);Wt&&(Wt.selectable??tt)&&I.current.add(Ft)}}if(!c0(Yi,K.current)){const jt=xl(ge,K.current,!0);De(jt)}if(!c0(Rn,I.current)){const jt=xl(ye,I.current);Ge(jt)}E.setState({userSelectionRect:Ht,userSelectionActive:!0,nodesSelectionActive:!1})}function $(){if(!r||!oe.current)return;const[ee,ce]=Ch(R.current,oe.current,H);L({x:ee,y:ce}).then(Se=>{if(!ae.current||!Se){_.current=requestAnimationFrame($);return}const{x:be,y:ge}=R.current;C(be,ge),_.current=requestAnimationFrame($)})}const P=()=>{cancelAnimationFrame(_.current),_.current=0,G.current=!1};F.useEffect(()=>()=>P(),[]);const ie=ee=>{const{userSelectionRect:ce,transform:Se,resetSelectedElements:be}=E.getState();if(!oe.current||!ce)return;const{x:ge,y:ye}=bn(ee.nativeEvent,oe.current);R.current={x:ge,y:ye};const Ee=Hl({x:ce.startX,y:ce.startY},Se);if(!ae.current){const De=i?0:u;if(Math.hypot(ge-Ee.x,ye-Ee.y)<=De)return;be(),m?.(ee)}ae.current=!0,G.current||($(),G.current=!0),C(ge,ye)},re=ee=>{ee.button===0&&(ee.target?.releasePointerCapture?.(ee.pointerId),!O&&ee.target===Y.current&&E.getState().userSelectionRect&&T?.(ee),E.setState({userSelectionActive:!1,userSelectionRect:null}),ae.current&&(h?.(ee),E.setState({nodesSelectionActive:K.current.size>0})),P())},de=ee=>{ee.target?.releasePointerCapture?.(ee.pointerId),P()},ue=a===!0||Array.isArray(a)&&a.includes(0);return D.jsxs("div",{className:ut(["react-flow__pane",{draggable:ue,dragging:M,selection:t}]),onClick:j?void 0:qd(T,Y),onContextMenu:qd(z,Y),onWheel:qd(q,Y),onPointerEnter:j?void 0:y,onPointerMove:j?ie:w,onPointerUp:j?re:void 0,onPointerCancel:j?de:void 0,onPointerDownCapture:j?te:void 0,onClickCapture:j?X:void 0,onPointerLeave:x,ref:Y,style:Xu,children:[S,D.jsx(DA,{})]})}function dh({id:t,store:i,unselect:s=!1,nodeRef:a}){const{addSelectedNodes:r,unselectNodesAndEdges:u,multiSelectionActive:c,nodeLookup:m,onError:h}=i.getState(),g=m.get(t);if(!g){h?.("012",Sn.error012(t));return}i.setState({nodesSelectionActive:!1}),g.selected?(s||g.selected&&c)&&(u({nodes:[g],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):r([t])}function A1({nodeRef:t,disabled:i=!1,noDragClassName:s,handleSelector:a,nodeId:r,isSelectable:u,nodeClickDistance:c}){const m=Je(),[h,g]=F.useState(!1),v=F.useRef();return F.useEffect(()=>{v.current=vN({getStoreItems:()=>m.getState(),onNodeMouseDown:p=>{dh({id:p,store:m,nodeRef:t})},onDragStart:()=>{g(!0)},onDragStop:()=>{g(!1)}})},[]),F.useEffect(()=>{if(!(i||!t.current||!v.current))return v.current.update({noDragClassName:s,handleSelector:a,domNode:t.current,isSelectable:u,nodeId:r,nodeClickDistance:c}),()=>{v.current?.destroy()}},[s,a,i,u,t,r,c]),h}const BA=t=>i=>i.selected&&(i.draggable||t&&typeof i.draggable>"u");function T1(){const t=Je();return F.useCallback(s=>{const{nodeExtent:a,snapToGrid:r,snapGrid:u,nodesDraggable:c,onError:m,updateNodePositions:h,nodeLookup:g,nodeOrigin:v}=t.getState(),p=new Map,y=BA(c),w=r?u[0]:5,x=r?u[1]:5,S=s.direction.x*w*s.factor,_=s.direction.y*x*s.factor;for(const[,E]of g){if(!y(E))continue;let O={x:E.internals.positionAbsolute.x+S,y:E.internals.positionAbsolute.y+_};r&&(O=Eo(O,u));const{position:N,positionAbsolute:M}=Qv({nodeId:E.id,nextPosition:O,nodeLookup:g,nodeExtent:a,nodeOrigin:v,onError:m});E.position=N,E.internals.positionAbsolute=M,p.set(E.id,E)}h(p)},[])}const Hh=F.createContext(null),kA=Hh.Provider;Hh.Consumer;const M1=()=>F.useContext(Hh),HA=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),jA=(t,i,s)=>a=>{const{connectionClickStartHandle:r,connectionMode:u,connection:c}=a,{fromHandle:m,toHandle:h,isValid:g}=c,v=h?.nodeId===t&&h?.id===i&&h?.type===s;return{connectingFrom:m?.nodeId===t&&m?.id===i&&m?.type===s,connectingTo:v,clickConnecting:r?.nodeId===t&&r?.id===i&&r?.type===s,isPossibleEndHandle:u===Rl.Strict?m?.type!==s:t!==m?.nodeId||i!==m?.id,connectionInProcess:!!m,clickConnectionInProcess:!!r,valid:v&&g}};function $A({type:t="source",position:i=fe.Top,isValidConnection:s,isConnectable:a=!0,isConnectableStart:r=!0,isConnectableEnd:u=!0,id:c,onConnect:m,children:h,className:g,onMouseDown:v,onTouchStart:p,...y},w){const x=c||null,S=t==="target",_=Je(),E=M1(),{connectOnClick:O,noPanClassName:N,rfId:M}=ze(HA,Qe),{connectingFrom:k,connectingTo:L,clickConnecting:H,isPossibleEndHandle:j,connectionInProcess:Y,clickConnectionInProcess:oe,valid:K}=ze(jA(E,x,t),Qe);E||_.getState().onError?.("010",Sn.error010());const I=G=>{const{defaultEdgeOptions:T,onConnect:z,hasDefaultEdges:q}=_.getState(),X={...T,...G};if(q){const{edges:te,setEdges:C,onError:$}=_.getState();C(bA(X,te,{onError:$}))}z?.(X),m?.(X)},ae=G=>{if(!E)return;const T=n1(G.nativeEvent);if(r&&(T&&G.button===0||!T)){const z=_.getState();fh.onPointerDown(G.nativeEvent,{handleDomNode:G.currentTarget,autoPanOnConnect:z.autoPanOnConnect,connectionMode:z.connectionMode,connectionRadius:z.connectionRadius,domNode:z.domNode,nodeLookup:z.nodeLookup,lib:z.lib,isTarget:S,handleId:x,nodeId:E,flowId:z.rfId,panBy:z.panBy,cancelConnection:z.cancelConnection,onConnectStart:z.onConnectStart,onConnectEnd:(...q)=>_.getState().onConnectEnd?.(...q),updateConnection:z.updateConnection,onConnect:I,isValidConnection:s||((...q)=>_.getState().isValidConnection?.(...q)??!0),getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,autoPanSpeed:z.autoPanSpeed,dragThreshold:z.connectionDragThreshold})}T?v?.(G):p?.(G)},R=G=>{const{onClickConnectStart:T,onClickConnectEnd:z,connectionClickStartHandle:q,connectionMode:X,isValidConnection:te,lib:C,rfId:$,nodeLookup:P,connection:ie}=_.getState();if(!E||!q&&!r)return;if(!q){T?.(G.nativeEvent,{nodeId:E,handleId:x,handleType:t}),_.setState({connectionClickStartHandle:{nodeId:E,type:t,id:x}});return}const re=e1(G.target),de=s||te,{connection:ue,isValid:ee}=fh.isValid(G.nativeEvent,{handle:{nodeId:E,id:x,type:t},connectionMode:X,fromNodeId:q.nodeId,fromHandleId:q.id||null,fromType:q.type,isValidConnection:de,flowId:$,doc:re,lib:C,nodeLookup:P});ee&&ue&&I(ue);const ce=structuredClone(ie);delete ce.inProgress,ce.toPosition=ce.toHandle?ce.toHandle.position:null,z?.(G,ce),_.setState({connectionClickStartHandle:null})};return D.jsx("div",{"data-handleid":x,"data-nodeid":E,"data-handlepos":i,"data-id":`${M}-${E}-${x}-${t}`,className:ut(["react-flow__handle",`react-flow__handle-${i}`,"nodrag",N,g,{source:!S,target:S,connectable:a,connectablestart:r,connectableend:u,clickconnecting:H,connectingfrom:k,connectingto:L,valid:K,connectionindicator:a&&(!Y||j)&&(Y||oe?u:r)}]),onMouseDown:ae,onTouchStart:ae,onClick:O?R:void 0,ref:w,...y,children:h})}const rn=F.memo(_1($A));function UA({data:t,isConnectable:i,sourcePosition:s=fe.Bottom}){return D.jsxs(D.Fragment,{children:[t?.label,D.jsx(rn,{type:"source",position:s,isConnectable:i})]})}function qA({data:t,isConnectable:i,targetPosition:s=fe.Top,sourcePosition:a=fe.Bottom}){return D.jsxs(D.Fragment,{children:[D.jsx(rn,{type:"target",position:s,isConnectable:i}),t?.label,D.jsx(rn,{type:"source",position:a,isConnectable:i})]})}function VA(){return null}function YA({data:t,isConnectable:i,targetPosition:s=fe.Top}){return D.jsxs(D.Fragment,{children:[D.jsx(rn,{type:"target",position:s,isConnectable:i}),t?.label]})}const Mu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},U0={input:UA,default:qA,output:YA,group:VA};function GA(t){return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??t.style?.width,height:t.height??t.initialHeight??t.style?.height}:{width:t.width??t.style?.width,height:t.height??t.style?.height}}const XA=t=>{const{width:i,height:s,x:a,y:r}=xo(t.nodeLookup,{filter:u=>!!u.selected});return{width:vn(i)?i:null,height:vn(s)?s:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${a}px,${r}px)`}};function KA({onSelectionContextMenu:t,noPanClassName:i,disableKeyboardA11y:s}){const a=Je(),{width:r,height:u,transformString:c,userSelectionActive:m}=ze(XA,Qe),h=T1(),g=F.useRef(null);F.useEffect(()=>{s||g.current?.focus({preventScroll:!0})},[s]);const v=!m&&r!==null&&u!==null;if(A1({nodeRef:g,disabled:!v}),!v)return null;const p=t?w=>{const x=a.getState().nodes.filter(S=>S.selected);t(w,x)}:void 0,y=w=>{Object.prototype.hasOwnProperty.call(Mu,w.key)&&(w.preventDefault(),h({direction:Mu[w.key],factor:w.shiftKey?4:1}))};return D.jsx("div",{className:ut(["react-flow__nodesselection","react-flow__container",i]),style:{transform:c},children:D.jsx("div",{ref:g,className:"react-flow__nodesselection-rect",onContextMenu:p,tabIndex:s?void 0:-1,onKeyDown:s?void 0:y,style:{width:r,height:u}})})}const q0=typeof window<"u"?window:void 0,ZA=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function C1({children:t,onPaneClick:i,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:r,onPaneContextMenu:u,onPaneScroll:c,paneClickDistance:m,deleteKeyCode:h,selectionKeyCode:g,selectionOnDrag:v,selectionMode:p,onSelectionStart:y,onSelectionEnd:w,multiSelectionKeyCode:x,panActivationKeyCode:S,zoomActivationKeyCode:_,elementsSelectable:E,zoomOnScroll:O,zoomOnPinch:N,panOnScroll:M,panOnScrollSpeed:k,panOnScrollMode:L,zoomOnDoubleClick:H,panOnDrag:j,autoPanOnSelection:Y,defaultViewport:oe,translateExtent:K,minZoom:I,maxZoom:ae,preventScrolling:R,onSelectionContextMenu:G,noWheelClassName:T,noPanClassName:z,disableKeyboardA11y:q,onViewportChange:X,isControlledViewport:te}){const{nodesSelectionActive:C,userSelectionActive:$}=ze(ZA,Qe),P=mo(g,{target:q0}),ie=mo(S,{target:q0}),re=ie||j,de=ie||M,ue=v&&re!==!0,ee=P||$||ue;return TA({deleteKeyCode:h,multiSelectionKeyCode:x}),D.jsx(OA,{onPaneContextMenu:u,elementsSelectable:E,zoomOnScroll:O,zoomOnPinch:N,panOnScroll:de,panOnScrollSpeed:k,panOnScrollMode:L,zoomOnDoubleClick:H,panOnDrag:!P&&re,defaultViewport:oe,translateExtent:K,minZoom:I,maxZoom:ae,zoomActivationKeyCode:_,preventScrolling:R,noWheelClassName:T,noPanClassName:z,onViewportChange:X,isControlledViewport:te,paneClickDistance:m,selectionOnDrag:ue,children:D.jsxs(RA,{onSelectionStart:y,onSelectionEnd:w,onPaneClick:i,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:r,onPaneContextMenu:u,onPaneScroll:c,panOnDrag:re,autoPanOnSelection:Y,isSelecting:!!ee,selectionMode:p,selectionKeyPressed:P,paneClickDistance:m,selectionOnDrag:ue,children:[t,C&&D.jsx(KA,{onSelectionContextMenu:G,noPanClassName:z,disableKeyboardA11y:q})]})})}C1.displayName="FlowRenderer";const QA=F.memo(C1),IA=t=>i=>t?Mh(i.nodeLookup,{x:0,y:0,width:i.width,height:i.height},i.transform,!0).map(s=>s.id):Array.from(i.nodeLookup.keys());function JA(t){return ze(F.useCallback(IA(t),[t]),Qe)}const FA=t=>t.updateNodeInternals;function WA(){const t=ze(FA),[i]=F.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const a=new Map;s.forEach(r=>{const u=r.target.getAttribute("data-id");a.set(u,{id:u,nodeElement:r.target,force:!0})}),t(a)}));return F.useEffect(()=>()=>{i?.disconnect()},[i]),i}function PA({node:t,nodeType:i,hasDimensions:s,resizeObserver:a}){const r=Je(),u=F.useRef(null),c=F.useRef(null),m=F.useRef(t.sourcePosition),h=F.useRef(t.targetPosition),g=F.useRef(i),v=s&&!!t.internals.handleBounds;return F.useEffect(()=>{u.current&&!t.hidden&&(!v||c.current!==u.current)&&(c.current&&a?.unobserve(c.current),a?.observe(u.current),c.current=u.current)},[v,t.hidden]),F.useEffect(()=>()=>{c.current&&(a?.unobserve(c.current),c.current=null)},[]),F.useEffect(()=>{if(u.current){const p=g.current!==i,y=m.current!==t.sourcePosition,w=h.current!==t.targetPosition;(p||y||w)&&(g.current=i,m.current=t.sourcePosition,h.current=t.targetPosition,r.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:u.current,force:!0}]])))}},[t.id,i,t.sourcePosition,t.targetPosition]),u}function eT({id:t,onClick:i,onMouseEnter:s,onMouseMove:a,onMouseLeave:r,onContextMenu:u,onDoubleClick:c,nodesDraggable:m,elementsSelectable:h,nodesConnectable:g,nodesFocusable:v,resizeObserver:p,noDragClassName:y,noPanClassName:w,disableKeyboardA11y:x,rfId:S,nodeTypes:_,nodeClickDistance:E,onError:O}){const{node:N,internals:M,isParent:k}=ze(ee=>{const ce=ee.nodeLookup.get(t),Se=ee.parentLookup.has(t);return{node:ce,internals:ce.internals,isParent:Se}},Qe);let L=N.type||"default",H=_?.[L]||U0[L];H===void 0&&(O?.("003",Sn.error003(L)),L="default",H=_?.default||U0.default);const j=!!(N.draggable||m&&typeof N.draggable>"u"),Y=!!(N.selectable||h&&typeof N.selectable>"u"),oe=!!(N.connectable||g&&typeof N.connectable>"u"),K=!!(N.focusable||v&&typeof N.focusable>"u"),I=Je(),ae=Wv(N),R=PA({node:N,nodeType:L,hasDimensions:ae,resizeObserver:p}),G=A1({nodeRef:R,disabled:N.hidden||!j,noDragClassName:y,handleSelector:N.dragHandle,nodeId:t,isSelectable:Y,nodeClickDistance:E}),T=T1();if(N.hidden)return null;const z=ai(N),q=GA(N),X=Y||j||i||s||a||r,te=s?ee=>s(ee,{...M.userNode}):void 0,C=a?ee=>a(ee,{...M.userNode}):void 0,$=r?ee=>r(ee,{...M.userNode}):void 0,P=u?ee=>u(ee,{...M.userNode}):void 0,ie=c?ee=>c(ee,{...M.userNode}):void 0,re=ee=>{const{selectNodesOnDrag:ce,nodeDragThreshold:Se}=I.getState();Y&&(!ce||!j||Se>0)&&dh({id:t,store:I,nodeRef:R}),i&&i(ee,{...M.userNode})},de=ee=>{if(!(t1(ee.nativeEvent)||x)){if(Yv.includes(ee.key)&&Y){const ce=ee.key==="Escape";dh({id:t,store:I,unselect:ce,nodeRef:R})}else if(j&&N.selected&&Object.prototype.hasOwnProperty.call(Mu,ee.key)){ee.preventDefault();const{ariaLabelConfig:ce}=I.getState();I.setState({ariaLiveMessage:ce["node.a11yDescription.ariaLiveMessage"]({direction:ee.key.replace("Arrow","").toLowerCase(),x:~~M.positionAbsolute.x,y:~~M.positionAbsolute.y})}),T({direction:Mu[ee.key],factor:ee.shiftKey?4:1})}}},ue=()=>{if(x||!R.current?.matches(":focus-visible"))return;const{transform:ee,width:ce,height:Se,autoPanOnNodeFocus:be,setCenter:ge}=I.getState();if(!be)return;Mh(new Map([[t,N]]),{x:0,y:0,width:ce,height:Se},ee,!0).length>0||ge(N.position.x+z.width/2,N.position.y+z.height/2,{zoom:ee[2]})};return D.jsx("div",{className:ut(["react-flow__node",`react-flow__node-${L}`,{[w]:j},N.className,{selected:N.selected,selectable:Y,parent:k,draggable:j,dragging:G}]),ref:R,style:{zIndex:M.z,transform:`translate(${M.positionAbsolute.x}px,${M.positionAbsolute.y}px)`,pointerEvents:X?"all":"none",visibility:ae?"visible":"hidden",...N.style,...q},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:te,onMouseMove:C,onMouseLeave:$,onContextMenu:P,onClick:re,onDoubleClick:ie,onKeyDown:K?de:void 0,tabIndex:K?0:void 0,onFocus:K?ue:void 0,role:N.ariaRole??(K?"group":void 0),"aria-roledescription":"node","aria-describedby":x?void 0:`${S1}-${S}`,"aria-label":N.ariaLabel,...N.domAttributes,children:D.jsx(kA,{value:t,children:D.jsx(H,{id:t,data:N.data,type:L,positionAbsoluteX:M.positionAbsolute.x,positionAbsoluteY:M.positionAbsolute.y,selected:N.selected??!1,selectable:Y,draggable:j,deletable:N.deletable??!0,isConnectable:oe,sourcePosition:N.sourcePosition,targetPosition:N.targetPosition,dragging:G,dragHandle:N.dragHandle,zIndex:M.z,parentId:N.parentId,...z})})})}var tT=F.memo(eT);const nT=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function O1(t){const{nodesDraggable:i,nodesConnectable:s,nodesFocusable:a,elementsSelectable:r,onError:u}=ze(nT,Qe),c=JA(t.onlyRenderVisibleElements),m=WA();return D.jsx("div",{className:"react-flow__nodes",style:Xu,children:c.map(h=>D.jsx(tT,{id:h,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:m,nodesDraggable:i,nodesConnectable:s,nodesFocusable:a,elementsSelectable:r,nodeClickDistance:t.nodeClickDistance,onError:u},h))})}O1.displayName="NodeRenderer";const iT=F.memo(O1);function sT(t){return ze(F.useCallback(s=>{if(!t)return s.edges.map(r=>r.id);const a=[];if(s.width&&s.height)for(const r of s.edges){const u=s.nodeLookup.get(r.source),c=s.nodeLookup.get(r.target);u&&c&&P_({sourceNode:u,targetNode:c,width:s.width,height:s.height,transform:s.transform})&&a.push(r.id)}return a},[t]),Qe)}const lT=({color:t="none",strokeWidth:i=1})=>{const s={strokeWidth:i,...t&&{stroke:t}};return D.jsx("polyline",{className:"arrow",style:s,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},aT=({color:t="none",strokeWidth:i=1})=>{const s={strokeWidth:i,...t&&{stroke:t,fill:t}};return D.jsx("polyline",{className:"arrowclosed",style:s,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},V0={[co.Arrow]:lT,[co.ArrowClosed]:aT};function oT(t){const i=Je();return F.useMemo(()=>Object.prototype.hasOwnProperty.call(V0,t)?V0[t]:(i.getState().onError?.("009",Sn.error009(t)),null),[t])}const rT=({id:t,type:i,color:s,width:a=12.5,height:r=12.5,markerUnits:u="strokeWidth",strokeWidth:c,orient:m="auto-start-reverse"})=>{const h=oT(i);return h?D.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${a}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:u,orient:m,refX:"0",refY:"0",children:D.jsx(h,{color:s,strokeWidth:c})}):null},z1=({defaultColor:t,rfId:i})=>{const s=ze(u=>u.edges),a=ze(u=>u.defaultEdgeOptions),r=F.useMemo(()=>oN(s,{id:i,defaultColor:t,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[s,a,i,t]);return r.length?D.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:D.jsx("defs",{children:r.map(u=>D.jsx(rT,{id:u.id,type:u.type,color:u.color,width:u.width,height:u.height,markerUnits:u.markerUnits,strokeWidth:u.strokeWidth,orient:u.orient},u.id))})}):null};z1.displayName="MarkerDefinitions";var uT=F.memo(z1);function D1({x:t,y:i,label:s,labelStyle:a,labelShowBg:r=!0,labelBgStyle:u,labelBgPadding:c=[2,4],labelBgBorderRadius:m=2,children:h,className:g,...v}){const[p,y]=F.useState({x:1,y:0,width:0,height:0}),w=ut(["react-flow__edge-textwrapper",g]),x=F.useRef(null);return F.useEffect(()=>{if(x.current){const S=x.current.getBBox();y({x:S.x,y:S.y,width:S.width,height:S.height})}},[s]),s?D.jsxs("g",{transform:`translate(${t-p.width/2} ${i-p.height/2})`,className:w,visibility:p.width?"visible":"hidden",...v,children:[r&&D.jsx("rect",{width:p.width+2*c[0],x:-c[0],y:-c[1],height:p.height+2*c[1],className:"react-flow__edge-textbg",style:u,rx:m,ry:m}),D.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:x,style:a,children:s}),h]}):null}D1.displayName="EdgeText";const cT=F.memo(D1);function _o({path:t,labelX:i,labelY:s,label:a,labelStyle:r,labelShowBg:u,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:h,interactionWidth:g=20,...v}){return D.jsxs(D.Fragment,{children:[D.jsx("path",{...v,d:t,fill:"none",className:ut(["react-flow__edge-path",v.className])}),g?D.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}):null,a&&vn(i)&&vn(s)?D.jsx(cT,{x:i,y:s,label:a,labelStyle:r,labelShowBg:u,labelBgStyle:c,labelBgPadding:m,labelBgBorderRadius:h}):null]})}function Y0({pos:t,x1:i,y1:s,x2:a,y2:r}){return t===fe.Left||t===fe.Right?[.5*(i+a),s]:[i,.5*(s+r)]}function L1({sourceX:t,sourceY:i,sourcePosition:s=fe.Bottom,targetX:a,targetY:r,targetPosition:u=fe.Top}){const[c,m]=Y0({pos:s,x1:t,y1:i,x2:a,y2:r}),[h,g]=Y0({pos:u,x1:a,y1:r,x2:t,y2:i}),[v,p,y,w]=i1({sourceX:t,sourceY:i,targetX:a,targetY:r,sourceControlX:c,sourceControlY:m,targetControlX:h,targetControlY:g});return[`M${t},${i} C${c},${m} ${h},${g} ${a},${r}`,v,p,y,w]}function R1(t){return F.memo(({id:i,sourceX:s,sourceY:a,targetX:r,targetY:u,sourcePosition:c,targetPosition:m,label:h,labelStyle:g,labelShowBg:v,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:w,style:x,markerEnd:S,markerStart:_,interactionWidth:E})=>{const[O,N,M]=L1({sourceX:s,sourceY:a,sourcePosition:c,targetX:r,targetY:u,targetPosition:m}),k=t.isInternal?void 0:i;return D.jsx(_o,{id:k,path:O,labelX:N,labelY:M,label:h,labelStyle:g,labelShowBg:v,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:w,style:x,markerEnd:S,markerStart:_,interactionWidth:E})})}const fT=R1({isInternal:!1}),B1=R1({isInternal:!0});fT.displayName="SimpleBezierEdge";B1.displayName="SimpleBezierEdgeInternal";function k1(t){return F.memo(({id:i,sourceX:s,sourceY:a,targetX:r,targetY:u,label:c,labelStyle:m,labelShowBg:h,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:p,style:y,sourcePosition:w=fe.Bottom,targetPosition:x=fe.Top,markerEnd:S,markerStart:_,pathOptions:E,interactionWidth:O})=>{const[N,M,k]=rh({sourceX:s,sourceY:a,sourcePosition:w,targetX:r,targetY:u,targetPosition:x,borderRadius:E?.borderRadius,offset:E?.offset,stepPosition:E?.stepPosition}),L=t.isInternal?void 0:i;return D.jsx(_o,{id:L,path:N,labelX:M,labelY:k,label:c,labelStyle:m,labelShowBg:h,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:p,style:y,markerEnd:S,markerStart:_,interactionWidth:O})})}const H1=k1({isInternal:!1}),j1=k1({isInternal:!0});H1.displayName="SmoothStepEdge";j1.displayName="SmoothStepEdgeInternal";function $1(t){return F.memo(({id:i,...s})=>{const a=t.isInternal?void 0:i;return D.jsx(H1,{...s,id:a,pathOptions:F.useMemo(()=>({borderRadius:0,offset:s.pathOptions?.offset}),[s.pathOptions?.offset])})})}const dT=$1({isInternal:!1}),U1=$1({isInternal:!0});dT.displayName="StepEdge";U1.displayName="StepEdgeInternal";function q1(t){return F.memo(({id:i,sourceX:s,sourceY:a,targetX:r,targetY:u,label:c,labelStyle:m,labelShowBg:h,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:p,style:y,markerEnd:w,markerStart:x,interactionWidth:S})=>{const[_,E,O]=a1({sourceX:s,sourceY:a,targetX:r,targetY:u}),N=t.isInternal?void 0:i;return D.jsx(_o,{id:N,path:_,labelX:E,labelY:O,label:c,labelStyle:m,labelShowBg:h,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:p,style:y,markerEnd:w,markerStart:x,interactionWidth:S})})}const hT=q1({isInternal:!1}),V1=q1({isInternal:!0});hT.displayName="StraightEdge";V1.displayName="StraightEdgeInternal";function Y1(t){return F.memo(({id:i,sourceX:s,sourceY:a,targetX:r,targetY:u,sourcePosition:c=fe.Bottom,targetPosition:m=fe.Top,label:h,labelStyle:g,labelShowBg:v,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:w,style:x,markerEnd:S,markerStart:_,pathOptions:E,interactionWidth:O})=>{const[N,M,k]=s1({sourceX:s,sourceY:a,sourcePosition:c,targetX:r,targetY:u,targetPosition:m,curvature:E?.curvature}),L=t.isInternal?void 0:i;return D.jsx(_o,{id:L,path:N,labelX:M,labelY:k,label:h,labelStyle:g,labelShowBg:v,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:w,style:x,markerEnd:S,markerStart:_,interactionWidth:O})})}const mT=Y1({isInternal:!1}),G1=Y1({isInternal:!0});mT.displayName="BezierEdge";G1.displayName="BezierEdgeInternal";const G0={default:G1,straight:V1,step:U1,smoothstep:j1,simplebezier:B1},X0={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},gT=(t,i,s)=>s===fe.Left?t-i:s===fe.Right?t+i:t,pT=(t,i,s)=>s===fe.Top?t-i:s===fe.Bottom?t+i:t,K0="react-flow__edgeupdater";function Z0({position:t,centerX:i,centerY:s,radius:a=10,onMouseDown:r,onMouseEnter:u,onMouseOut:c,type:m}){return D.jsx("circle",{onMouseDown:r,onMouseEnter:u,onMouseOut:c,className:ut([K0,`${K0}-${m}`]),cx:gT(i,a,t),cy:pT(s,a,t),r:a,stroke:"transparent",fill:"transparent"})}function yT({isReconnectable:t,reconnectRadius:i,edge:s,sourceX:a,sourceY:r,targetX:u,targetY:c,sourcePosition:m,targetPosition:h,onReconnect:g,onReconnectStart:v,onReconnectEnd:p,setReconnecting:y,setUpdateHover:w}){const x=Je(),S=(M,k)=>{if(M.button!==0)return;const{autoPanOnConnect:L,domNode:H,connectionMode:j,connectionRadius:Y,lib:oe,onConnectStart:K,cancelConnection:I,nodeLookup:ae,rfId:R,panBy:G,updateConnection:T}=x.getState(),z=k.type==="target",q=(C,$)=>{y(!1),p?.(C,s,k.type,$)},X=C=>g?.(s,C),te=(C,$)=>{y(!0),v?.(M,s,k.type),K?.(C,$)};fh.onPointerDown(M.nativeEvent,{autoPanOnConnect:L,connectionMode:j,connectionRadius:Y,domNode:H,handleId:k.id,nodeId:k.nodeId,nodeLookup:ae,isTarget:z,edgeUpdaterType:k.type,lib:oe,flowId:R,cancelConnection:I,panBy:G,isValidConnection:(...C)=>x.getState().isValidConnection?.(...C)??!0,onConnect:X,onConnectStart:te,onConnectEnd:(...C)=>x.getState().onConnectEnd?.(...C),onReconnectEnd:q,updateConnection:T,getTransform:()=>x.getState().transform,getFromHandle:()=>x.getState().connection.fromHandle,dragThreshold:x.getState().connectionDragThreshold,handleDomNode:M.currentTarget})},_=M=>S(M,{nodeId:s.target,id:s.targetHandle??null,type:"target"}),E=M=>S(M,{nodeId:s.source,id:s.sourceHandle??null,type:"source"}),O=()=>w(!0),N=()=>w(!1);return D.jsxs(D.Fragment,{children:[(t===!0||t==="source")&&D.jsx(Z0,{position:m,centerX:a,centerY:r,radius:i,onMouseDown:_,onMouseEnter:O,onMouseOut:N,type:"source"}),(t===!0||t==="target")&&D.jsx(Z0,{position:h,centerX:u,centerY:c,radius:i,onMouseDown:E,onMouseEnter:O,onMouseOut:N,type:"target"})]})}function vT({id:t,edgesFocusable:i,edgesReconnectable:s,elementsSelectable:a,onClick:r,onDoubleClick:u,onContextMenu:c,onMouseEnter:m,onMouseMove:h,onMouseLeave:g,reconnectRadius:v,onReconnect:p,onReconnectStart:y,onReconnectEnd:w,rfId:x,edgeTypes:S,noPanClassName:_,onError:E,disableKeyboardA11y:O}){let N=ze(ge=>ge.edgeLookup.get(t));const M=ze(ge=>ge.defaultEdgeOptions);N=M?{...M,...N}:N;let k=N.type||"default",L=S?.[k]||G0[k];L===void 0&&(E?.("011",Sn.error011(k)),k="default",L=S?.default||G0.default);const H=!!(N.focusable||i&&typeof N.focusable>"u"),j=typeof p<"u"&&(N.reconnectable||s&&typeof N.reconnectable>"u"),Y=!!(N.selectable||a&&typeof N.selectable>"u"),oe=F.useRef(null),[K,I]=F.useState(!1),[ae,R]=F.useState(!1),G=Je(),{zIndex:T,sourceX:z,sourceY:q,targetX:X,targetY:te,sourcePosition:C,targetPosition:$}=ze(F.useCallback(ge=>{const ye=ge.nodeLookup.get(N.source),Ee=ge.nodeLookup.get(N.target);if(!ye||!Ee)return{zIndex:N.zIndex,...X0};const De=aN({id:t,sourceNode:ye,targetNode:Ee,sourceHandle:N.sourceHandle||null,targetHandle:N.targetHandle||null,connectionMode:ge.connectionMode,onError:E});return{zIndex:W_({selected:N.selected,zIndex:N.zIndex,sourceNode:ye,targetNode:Ee,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...De||X0}},[N.source,N.target,N.sourceHandle,N.targetHandle,N.selected,N.zIndex]),Qe),P=F.useMemo(()=>N.markerStart?`url('#${uh(N.markerStart,x)}')`:void 0,[N.markerStart,x]),ie=F.useMemo(()=>N.markerEnd?`url('#${uh(N.markerEnd,x)}')`:void 0,[N.markerEnd,x]);if(N.hidden||z===null||q===null||X===null||te===null)return null;const re=ge=>{const{addSelectedEdges:ye,unselectNodesAndEdges:Ee,multiSelectionActive:De}=G.getState();Y&&(G.setState({nodesSelectionActive:!1}),N.selected&&De?(Ee({nodes:[],edges:[N]}),oe.current?.blur()):ye([t])),r&&r(ge,N)},de=u?ge=>{u(ge,{...N})}:void 0,ue=c?ge=>{c(ge,{...N})}:void 0,ee=m?ge=>{m(ge,{...N})}:void 0,ce=h?ge=>{h(ge,{...N})}:void 0,Se=g?ge=>{g(ge,{...N})}:void 0,be=ge=>{if(!O&&Yv.includes(ge.key)&&Y){const{unselectNodesAndEdges:ye,addSelectedEdges:Ee}=G.getState();ge.key==="Escape"?(oe.current?.blur(),ye({edges:[N]})):Ee([t])}};return D.jsx("svg",{style:{zIndex:T},children:D.jsxs("g",{className:ut(["react-flow__edge",`react-flow__edge-${k}`,N.className,_,{selected:N.selected,animated:N.animated,inactive:!Y&&!r,updating:K,selectable:Y}]),onClick:re,onDoubleClick:de,onContextMenu:ue,onMouseEnter:ee,onMouseMove:ce,onMouseLeave:Se,onKeyDown:H?be:void 0,tabIndex:H?0:void 0,role:N.ariaRole??(H?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":N.ariaLabel===null?void 0:N.ariaLabel||`Edge from ${N.source} to ${N.target}`,"aria-describedby":H?`${w1}-${x}`:void 0,ref:oe,...N.domAttributes,children:[!ae&&D.jsx(L,{id:t,source:N.source,target:N.target,type:N.type,selected:N.selected,animated:N.animated,selectable:Y,deletable:N.deletable??!0,label:N.label,labelStyle:N.labelStyle,labelShowBg:N.labelShowBg,labelBgStyle:N.labelBgStyle,labelBgPadding:N.labelBgPadding,labelBgBorderRadius:N.labelBgBorderRadius,sourceX:z,sourceY:q,targetX:X,targetY:te,sourcePosition:C,targetPosition:$,data:N.data,style:N.style,sourceHandleId:N.sourceHandle,targetHandleId:N.targetHandle,markerStart:P,markerEnd:ie,pathOptions:"pathOptions"in N?N.pathOptions:void 0,interactionWidth:N.interactionWidth}),j&&D.jsx(yT,{edge:N,isReconnectable:j,reconnectRadius:v,onReconnect:p,onReconnectStart:y,onReconnectEnd:w,sourceX:z,sourceY:q,targetX:X,targetY:te,sourcePosition:C,targetPosition:$,setUpdateHover:I,setReconnecting:R})]})})}var bT=F.memo(vT);const ST=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function X1({defaultMarkerColor:t,onlyRenderVisibleElements:i,rfId:s,edgeTypes:a,noPanClassName:r,onReconnect:u,onEdgeContextMenu:c,onEdgeMouseEnter:m,onEdgeMouseMove:h,onEdgeMouseLeave:g,onEdgeClick:v,reconnectRadius:p,onEdgeDoubleClick:y,onReconnectStart:w,onReconnectEnd:x,disableKeyboardA11y:S}){const{edgesFocusable:_,edgesReconnectable:E,elementsSelectable:O,onError:N}=ze(ST,Qe),M=sT(i);return D.jsxs("div",{className:"react-flow__edges",children:[D.jsx(uT,{defaultColor:t,rfId:s}),M.map(k=>D.jsx(bT,{id:k,edgesFocusable:_,edgesReconnectable:E,elementsSelectable:O,noPanClassName:r,onReconnect:u,onContextMenu:c,onMouseEnter:m,onMouseMove:h,onMouseLeave:g,onClick:v,reconnectRadius:p,onDoubleClick:y,onReconnectStart:w,onReconnectEnd:x,rfId:s,onError:N,edgeTypes:a,disableKeyboardA11y:S},k))]})}X1.displayName="EdgeRenderer";const wT=F.memo(X1),xT=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function ET({children:t}){const i=ze(xT);return D.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:i},children:t})}function _T(t){const i=Gu(),s=F.useRef(!1);F.useEffect(()=>{!s.current&&i.viewportInitialized&&t&&(setTimeout(()=>t(i),1),s.current=!0)},[t,i.viewportInitialized])}const NT=t=>t.panZoom?.syncViewport;function AT(t){const i=ze(NT),s=Je();return F.useEffect(()=>{t&&(i?.(t),s.setState({transform:[t.x,t.y,t.zoom]}))},[t,i]),null}function TT(t){return t.connection.inProgress?{...t.connection,to:ql(t.connection.to,t.transform)}:{...t.connection}}function MT(t){return TT}function CT(t){const i=MT();return ze(i,Qe)}const OT=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function zT({containerStyle:t,style:i,type:s,component:a}){const{nodesConnectable:r,width:u,height:c,isValid:m,inProgress:h}=ze(OT,Qe);return!(u&&r&&h)?null:D.jsx("svg",{style:t,width:u,height:c,className:"react-flow__connectionline react-flow__container",children:D.jsx("g",{className:ut(["react-flow__connection",Kv(m)]),children:D.jsx(K1,{style:i,type:s,CustomComponent:a,isValid:m})})})}const K1=({style:t,type:i=$i.Bezier,CustomComponent:s,isValid:a})=>{const{inProgress:r,from:u,fromNode:c,fromHandle:m,fromPosition:h,to:g,toNode:v,toHandle:p,toPosition:y,pointer:w}=CT();if(!r)return;if(s)return D.jsx(s,{connectionLineType:i,connectionLineStyle:t,fromNode:c,fromHandle:m,fromX:u.x,fromY:u.y,toX:g.x,toY:g.y,fromPosition:h,toPosition:y,connectionStatus:Kv(a),toNode:v,toHandle:p,pointer:w});let x="";const S={sourceX:u.x,sourceY:u.y,sourcePosition:h,targetX:g.x,targetY:g.y,targetPosition:y};switch(i){case $i.Bezier:[x]=s1(S);break;case $i.SimpleBezier:[x]=L1(S);break;case $i.Step:[x]=rh({...S,borderRadius:0});break;case $i.SmoothStep:[x]=rh(S);break;default:[x]=a1(S)}return D.jsx("path",{d:x,fill:"none",className:"react-flow__connection-path",style:t})};K1.displayName="ConnectionLine";const DT={};function Q0(t=DT){F.useRef(t),Je(),F.useEffect(()=>{},[t])}function LT(){Je(),F.useRef(!1),F.useEffect(()=>{},[])}function Z1({nodeTypes:t,edgeTypes:i,onInit:s,onNodeClick:a,onEdgeClick:r,onNodeDoubleClick:u,onEdgeDoubleClick:c,onNodeMouseEnter:m,onNodeMouseMove:h,onNodeMouseLeave:g,onNodeContextMenu:v,onSelectionContextMenu:p,onSelectionStart:y,onSelectionEnd:w,connectionLineType:x,connectionLineStyle:S,connectionLineComponent:_,connectionLineContainerStyle:E,selectionKeyCode:O,selectionOnDrag:N,selectionMode:M,multiSelectionKeyCode:k,panActivationKeyCode:L,zoomActivationKeyCode:H,deleteKeyCode:j,onlyRenderVisibleElements:Y,elementsSelectable:oe,defaultViewport:K,translateExtent:I,minZoom:ae,maxZoom:R,preventScrolling:G,defaultMarkerColor:T,zoomOnScroll:z,zoomOnPinch:q,panOnScroll:X,panOnScrollSpeed:te,panOnScrollMode:C,zoomOnDoubleClick:$,panOnDrag:P,autoPanOnSelection:ie,onPaneClick:re,onPaneMouseEnter:de,onPaneMouseMove:ue,onPaneMouseLeave:ee,onPaneScroll:ce,onPaneContextMenu:Se,paneClickDistance:be,nodeClickDistance:ge,onEdgeContextMenu:ye,onEdgeMouseEnter:Ee,onEdgeMouseMove:De,onEdgeMouseLeave:Ge,reconnectRadius:yt,onReconnect:It,onReconnectStart:Nt,onReconnectEnd:At,noDragClassName:Ht,noWheelClassName:Yi,noPanClassName:Rn,disableKeyboardA11y:tt,nodeExtent:jt,rfId:Jt,viewport:Ft,onViewportChange:Wt}){return Q0(t),Q0(i),LT(),_T(s),AT(Ft),D.jsx(QA,{onPaneClick:re,onPaneMouseEnter:de,onPaneMouseMove:ue,onPaneMouseLeave:ee,onPaneContextMenu:Se,onPaneScroll:ce,paneClickDistance:be,deleteKeyCode:j,selectionKeyCode:O,selectionOnDrag:N,selectionMode:M,onSelectionStart:y,onSelectionEnd:w,multiSelectionKeyCode:k,panActivationKeyCode:L,zoomActivationKeyCode:H,elementsSelectable:oe,zoomOnScroll:z,zoomOnPinch:q,zoomOnDoubleClick:$,panOnScroll:X,panOnScrollSpeed:te,panOnScrollMode:C,panOnDrag:P,autoPanOnSelection:ie,defaultViewport:K,translateExtent:I,minZoom:ae,maxZoom:R,onSelectionContextMenu:p,preventScrolling:G,noDragClassName:Ht,noWheelClassName:Yi,noPanClassName:Rn,disableKeyboardA11y:tt,onViewportChange:Wt,isControlledViewport:!!Ft,children:D.jsxs(ET,{children:[D.jsx(wT,{edgeTypes:i,onEdgeClick:r,onEdgeDoubleClick:c,onReconnect:It,onReconnectStart:Nt,onReconnectEnd:At,onlyRenderVisibleElements:Y,onEdgeContextMenu:ye,onEdgeMouseEnter:Ee,onEdgeMouseMove:De,onEdgeMouseLeave:Ge,reconnectRadius:yt,defaultMarkerColor:T,noPanClassName:Rn,disableKeyboardA11y:tt,rfId:Jt}),D.jsx(zT,{style:S,type:x,component:_,containerStyle:E}),D.jsx("div",{className:"react-flow__edgelabel-renderer"}),D.jsx(iT,{nodeTypes:t,onNodeClick:a,onNodeDoubleClick:u,onNodeMouseEnter:m,onNodeMouseMove:h,onNodeMouseLeave:g,onNodeContextMenu:v,nodeClickDistance:ge,onlyRenderVisibleElements:Y,noPanClassName:Rn,noDragClassName:Ht,disableKeyboardA11y:tt,nodeExtent:jt,rfId:Jt}),D.jsx("div",{className:"react-flow__viewport-portal"})]})})}Z1.displayName="GraphView";const RT=F.memo(Z1),BT=Fv(),I0=({nodes:t,edges:i,defaultNodes:s,defaultEdges:a,width:r,height:u,fitView:c,fitViewOptions:m,minZoom:h=.5,maxZoom:g=2,nodeOrigin:v,nodeExtent:p,zIndexMode:y="basic"}={})=>{const w=new Map,x=new Map,S=new Map,_=new Map,E=a??i??[],O=s??t??[],N=v??[0,0],M=p??ro;u1(S,_,E);const{nodesInitialized:k}=ch(O,w,x,{nodeOrigin:N,nodeExtent:M,zIndexMode:y});let L=[0,0,1];if(c&&r&&u){const H=xo(w,{filter:K=>!!((K.width||K.initialWidth)&&(K.height||K.initialHeight))}),{x:j,y:Y,zoom:oe}=Oh(H,r,u,h,g,m?.padding??.1);L=[j,Y,oe]}return{rfId:"1",width:r??0,height:u??0,transform:L,nodes:O,nodesInitialized:k,nodeLookup:w,parentLookup:x,edges:E,edgeLookup:_,connectionLookup:S,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:s!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:g,translateExtent:ro,nodeExtent:M,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Rl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:N,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:c??!1,fitViewOptions:m,fitViewResolver:null,connection:{...Xv},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:BT,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Gv,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},kT=({nodes:t,edges:i,defaultNodes:s,defaultEdges:a,width:r,height:u,fitView:c,fitViewOptions:m,minZoom:h,maxZoom:g,nodeOrigin:v,nodeExtent:p,zIndexMode:y})=>IN((w,x)=>{async function S(){const{nodeLookup:_,panZoom:E,fitViewOptions:O,fitViewResolver:N,width:M,height:k,minZoom:L,maxZoom:H}=x();E&&(await X_({nodes:_,width:M,height:k,panZoom:E,minZoom:L,maxZoom:H},O),N?.resolve(!0),w({fitViewResolver:null}))}return{...I0({nodes:t,edges:i,width:r,height:u,fitView:c,fitViewOptions:m,minZoom:h,maxZoom:g,nodeOrigin:v,nodeExtent:p,defaultNodes:s,defaultEdges:a,zIndexMode:y}),setNodes:_=>{const{nodeLookup:E,parentLookup:O,nodeOrigin:N,elevateNodesOnSelect:M,fitViewQueued:k,zIndexMode:L,nodesSelectionActive:H}=x(),{nodesInitialized:j,hasSelectedNodes:Y}=ch(_,E,O,{nodeOrigin:N,nodeExtent:p,elevateNodesOnSelect:M,checkEquality:!0,zIndexMode:L}),oe=H&&Y;k&&j?(S(),w({nodes:_,nodesInitialized:j,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:oe})):w({nodes:_,nodesInitialized:j,nodesSelectionActive:oe})},setEdges:_=>{const{connectionLookup:E,edgeLookup:O}=x();u1(E,O,_),w({edges:_})},setDefaultNodesAndEdges:(_,E)=>{if(_){const{setNodes:O}=x();O(_),w({hasDefaultNodes:!0})}if(E){const{setEdges:O}=x();O(E),w({hasDefaultEdges:!0})}},updateNodeInternals:_=>{const{triggerNodeChanges:E,nodeLookup:O,parentLookup:N,domNode:M,nodeOrigin:k,nodeExtent:L,debug:H,fitViewQueued:j,zIndexMode:Y}=x(),{changes:oe,updatedInternals:K}=mN(_,O,N,M,k,L,Y);K&&(cN(O,N,{nodeOrigin:k,nodeExtent:L,zIndexMode:Y}),j?(S(),w({fitViewQueued:!1,fitViewOptions:void 0})):w({}),oe?.length>0&&(H&&console.log("React Flow: trigger node changes",oe),E?.(oe)))},updateNodePositions:(_,E=!1)=>{const O=[];let N=[];const{nodeLookup:M,triggerNodeChanges:k,connection:L,updateConnection:H,onNodesChangeMiddlewareMap:j}=x();for(const[Y,oe]of _){const K=M.get(Y),I=!!(K?.expandParent&&K?.parentId&&oe?.position),ae={id:Y,type:"position",position:I?{x:Math.max(0,oe.position.x),y:Math.max(0,oe.position.y)}:oe.position,dragging:E};if(K&&L.inProgress&&L.fromNode.id===K.id){const R=Es(K,L.fromHandle,fe.Left,!0);H({...L,from:R})}I&&K.parentId&&O.push({id:Y,parentId:K.parentId,rect:{...oe.internals.positionAbsolute,width:oe.measured.width??0,height:oe.measured.height??0}}),N.push(ae)}if(O.length>0){const{parentLookup:Y,nodeOrigin:oe}=x(),K=kh(O,M,Y,oe);N.push(...K)}for(const Y of j.values())N=Y(N);k(N)},triggerNodeChanges:_=>{const{onNodesChange:E,setNodes:O,nodes:N,hasDefaultNodes:M,debug:k}=x();if(_?.length){if(M){const L=pA(_,N);O(L)}k&&console.log("React Flow: trigger node changes",_),E?.(_)}},triggerEdgeChanges:_=>{const{onEdgesChange:E,setEdges:O,edges:N,hasDefaultEdges:M,debug:k}=x();if(_?.length){if(M){const L=yA(_,N);O(L)}k&&console.log("React Flow: trigger edge changes",_),E?.(_)}},addSelectedNodes:_=>{const{multiSelectionActive:E,edgeLookup:O,nodeLookup:N,triggerNodeChanges:M,triggerEdgeChanges:k}=x();if(E){const L=_.map(H=>ds(H,!0));M(L);return}M(xl(N,new Set([..._]),!0)),k(xl(O))},addSelectedEdges:_=>{const{multiSelectionActive:E,edgeLookup:O,nodeLookup:N,triggerNodeChanges:M,triggerEdgeChanges:k}=x();if(E){const L=_.map(H=>ds(H,!0));k(L);return}k(xl(O,new Set([..._]))),M(xl(N,new Set,!0))},unselectNodesAndEdges:({nodes:_,edges:E}={})=>{const{edges:O,nodes:N,nodeLookup:M,triggerNodeChanges:k,triggerEdgeChanges:L}=x(),H=_||N,j=E||O,Y=[];for(const K of H){if(!K.selected)continue;const I=M.get(K.id);I&&(I.selected=!1),Y.push(ds(K.id,!1))}const oe=[];for(const K of j)K.selected&&oe.push(ds(K.id,!1));k(Y),L(oe)},setMinZoom:_=>{const{panZoom:E,maxZoom:O}=x();E?.setScaleExtent([_,O]),w({minZoom:_})},setMaxZoom:_=>{const{panZoom:E,minZoom:O}=x();E?.setScaleExtent([O,_]),w({maxZoom:_})},setTranslateExtent:_=>{x().panZoom?.setTranslateExtent(_),w({translateExtent:_})},resetSelectedElements:()=>{const{edges:_,nodes:E,triggerNodeChanges:O,triggerEdgeChanges:N,elementsSelectable:M}=x();if(!M)return;const k=E.reduce((H,j)=>j.selected?[...H,ds(j.id,!1)]:H,[]),L=_.reduce((H,j)=>j.selected?[...H,ds(j.id,!1)]:H,[]);O(k),N(L)},setNodeExtent:_=>{const{nodes:E,nodeLookup:O,parentLookup:N,nodeOrigin:M,elevateNodesOnSelect:k,nodeExtent:L,zIndexMode:H}=x();_[0][0]===L[0][0]&&_[0][1]===L[0][1]&&_[1][0]===L[1][0]&&_[1][1]===L[1][1]||(ch(E,O,N,{nodeOrigin:M,nodeExtent:_,elevateNodesOnSelect:k,checkEquality:!1,zIndexMode:H}),w({nodeExtent:_}))},panBy:_=>{const{transform:E,width:O,height:N,panZoom:M,translateExtent:k}=x();return gN({delta:_,panZoom:M,transform:E,translateExtent:k,width:O,height:N})},setCenter:async(_,E,O)=>{const{width:N,height:M,maxZoom:k,panZoom:L}=x();if(!L)return!1;const H=typeof O?.zoom<"u"?O.zoom:k;return await L.setViewport({x:N/2-_*H,y:M/2-E*H,zoom:H},{duration:O?.duration,ease:O?.ease,interpolate:O?.interpolate}),!0},cancelConnection:()=>{w({connection:{...Xv}})},updateConnection:_=>{w({connection:_})},reset:()=>w({...I0()})}},Object.is);function Q1({initialNodes:t,initialEdges:i,defaultNodes:s,defaultEdges:a,initialWidth:r,initialHeight:u,initialMinZoom:c,initialMaxZoom:m,initialFitViewOptions:h,fitView:g,nodeOrigin:v,nodeExtent:p,zIndexMode:y,children:w}){const[x]=F.useState(()=>kT({nodes:t,edges:i,defaultNodes:s,defaultEdges:a,width:r,height:u,fitView:g,minZoom:c,maxZoom:m,fitViewOptions:h,nodeOrigin:v,nodeExtent:p,zIndexMode:y}));return D.jsx(JN,{value:x,children:D.jsx(EA,{children:w})})}function HT({children:t,nodes:i,edges:s,defaultNodes:a,defaultEdges:r,width:u,height:c,fitView:m,fitViewOptions:h,minZoom:g,maxZoom:v,nodeOrigin:p,nodeExtent:y,zIndexMode:w}){return F.useContext(Vu)?D.jsx(D.Fragment,{children:t}):D.jsx(Q1,{initialNodes:i,initialEdges:s,defaultNodes:a,defaultEdges:r,initialWidth:u,initialHeight:c,fitView:m,initialFitViewOptions:h,initialMinZoom:g,initialMaxZoom:v,nodeOrigin:p,nodeExtent:y,zIndexMode:w,children:t})}const jT={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function $T({nodes:t,edges:i,defaultNodes:s,defaultEdges:a,className:r,nodeTypes:u,edgeTypes:c,onNodeClick:m,onEdgeClick:h,onInit:g,onMove:v,onMoveStart:p,onMoveEnd:y,onConnect:w,onConnectStart:x,onConnectEnd:S,onClickConnectStart:_,onClickConnectEnd:E,onNodeMouseEnter:O,onNodeMouseMove:N,onNodeMouseLeave:M,onNodeContextMenu:k,onNodeDoubleClick:L,onNodeDragStart:H,onNodeDrag:j,onNodeDragStop:Y,onNodesDelete:oe,onEdgesDelete:K,onDelete:I,onSelectionChange:ae,onSelectionDragStart:R,onSelectionDrag:G,onSelectionDragStop:T,onSelectionContextMenu:z,onSelectionStart:q,onSelectionEnd:X,onBeforeDelete:te,connectionMode:C,connectionLineType:$=$i.Bezier,connectionLineStyle:P,connectionLineComponent:ie,connectionLineContainerStyle:re,deleteKeyCode:de="Backspace",selectionKeyCode:ue="Shift",selectionOnDrag:ee=!1,selectionMode:ce=uo.Full,panActivationKeyCode:Se="Space",multiSelectionKeyCode:be=ho()?"Meta":"Control",zoomActivationKeyCode:ge=ho()?"Meta":"Control",snapToGrid:ye,snapGrid:Ee,onlyRenderVisibleElements:De=!1,selectNodesOnDrag:Ge,nodesDraggable:yt,autoPanOnNodeFocus:It,nodesConnectable:Nt,nodesFocusable:At,nodeOrigin:Ht=x1,edgesFocusable:Yi,edgesReconnectable:Rn,elementsSelectable:tt=!0,defaultViewport:jt=uA,minZoom:Jt=.5,maxZoom:Ft=2,translateExtent:Wt=ro,preventScrolling:oc=!0,nodeExtent:Ms,defaultMarkerColor:rc="#b1b1b7",zoomOnScroll:uc=!0,zoomOnPinch:Gi=!0,panOnScroll:wt=!1,panOnScrollSpeed:En=.5,panOnScrollMode:xt=vs.Free,zoomOnDoubleClick:cc=!0,panOnDrag:fc=!0,onPaneClick:dc,onPaneMouseEnter:Cs,onPaneMouseMove:Os,onPaneMouseLeave:zs,onPaneScroll:Bn,onPaneContextMenu:Ds,paneClickDistance:Xi=1,nodeClickDistance:hc=0,children:Mo,onReconnect:Il,onReconnectStart:Ki,onReconnectEnd:mc,onEdgeContextMenu:Co,onEdgeDoubleClick:Oo,onEdgeMouseEnter:zo,onEdgeMouseMove:Jl,onEdgeMouseLeave:Fl,reconnectRadius:Do=10,onNodesChange:Lo,onEdgesChange:_n,noDragClassName:ct="nodrag",noWheelClassName:vt="nowheel",noPanClassName:kn="nopan",fitView:Ls,fitViewOptions:Ro,connectOnClick:gc,attributionPosition:Bo,proOptions:Zi,defaultEdgeOptions:Wl,elevateNodesOnSelect:oi=!0,elevateEdgesOnSelect:ri=!1,disableKeyboardA11y:ui=!1,autoPanOnConnect:ci,autoPanOnNodeDrag:st,autoPanOnSelection:ko=!0,autoPanSpeed:Ho,connectionRadius:Hn,isValidConnection:fi,onError:pc,style:jo,id:Pl,nodeDragThreshold:yc,connectionDragThreshold:Rs,viewport:Bs,onViewportChange:fn,width:Tt,height:$o,colorMode:vc="light",debug:ea,onScroll:ta,ariaLabelConfig:ks,zIndexMode:Uo="basic",...Mt},na){const Hs=Pl||"1",ia=hA(vc),di=F.useCallback(sa=>{sa.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ta?.(sa)},[ta]);return D.jsx("div",{"data-testid":"rf__wrapper",...Mt,onScroll:di,style:{...jo,...jT},ref:na,className:ut(["react-flow",r,ia]),id:Pl,role:"application",children:D.jsxs(HT,{nodes:t,edges:i,width:Tt,height:$o,fitView:Ls,fitViewOptions:Ro,minZoom:Jt,maxZoom:Ft,nodeOrigin:Ht,nodeExtent:Ms,zIndexMode:Uo,children:[D.jsx(dA,{nodes:t,edges:i,defaultNodes:s,defaultEdges:a,onConnect:w,onConnectStart:x,onConnectEnd:S,onClickConnectStart:_,onClickConnectEnd:E,nodesDraggable:yt,autoPanOnNodeFocus:It,nodesConnectable:Nt,nodesFocusable:At,edgesFocusable:Yi,edgesReconnectable:Rn,elementsSelectable:tt,elevateNodesOnSelect:oi,elevateEdgesOnSelect:ri,minZoom:Jt,maxZoom:Ft,nodeExtent:Ms,onNodesChange:Lo,onEdgesChange:_n,snapToGrid:ye,snapGrid:Ee,connectionMode:C,translateExtent:Wt,connectOnClick:gc,defaultEdgeOptions:Wl,fitView:Ls,fitViewOptions:Ro,onNodesDelete:oe,onEdgesDelete:K,onDelete:I,onNodeDragStart:H,onNodeDrag:j,onNodeDragStop:Y,onSelectionDrag:G,onSelectionDragStart:R,onSelectionDragStop:T,onMove:v,onMoveStart:p,onMoveEnd:y,noPanClassName:kn,nodeOrigin:Ht,rfId:Hs,autoPanOnConnect:ci,autoPanOnNodeDrag:st,autoPanSpeed:Ho,onError:pc,connectionRadius:Hn,isValidConnection:fi,selectNodesOnDrag:Ge,nodeDragThreshold:yc,connectionDragThreshold:Rs,onBeforeDelete:te,debug:ea,ariaLabelConfig:ks,zIndexMode:Uo}),D.jsx(RT,{onInit:g,onNodeClick:m,onEdgeClick:h,onNodeMouseEnter:O,onNodeMouseMove:N,onNodeMouseLeave:M,onNodeContextMenu:k,onNodeDoubleClick:L,nodeTypes:u,edgeTypes:c,connectionLineType:$,connectionLineStyle:P,connectionLineComponent:ie,connectionLineContainerStyle:re,selectionKeyCode:ue,selectionOnDrag:ee,selectionMode:ce,deleteKeyCode:de,multiSelectionKeyCode:be,panActivationKeyCode:Se,zoomActivationKeyCode:ge,onlyRenderVisibleElements:De,defaultViewport:jt,translateExtent:Wt,minZoom:Jt,maxZoom:Ft,preventScrolling:oc,zoomOnScroll:uc,zoomOnPinch:Gi,zoomOnDoubleClick:cc,panOnScroll:wt,panOnScrollSpeed:En,panOnScrollMode:xt,panOnDrag:fc,autoPanOnSelection:ko,onPaneClick:dc,onPaneMouseEnter:Cs,onPaneMouseMove:Os,onPaneMouseLeave:zs,onPaneScroll:Bn,onPaneContextMenu:Ds,paneClickDistance:Xi,nodeClickDistance:hc,onSelectionContextMenu:z,onSelectionStart:q,onSelectionEnd:X,onReconnect:Il,onReconnectStart:Ki,onReconnectEnd:mc,onEdgeContextMenu:Co,onEdgeDoubleClick:Oo,onEdgeMouseEnter:zo,onEdgeMouseMove:Jl,onEdgeMouseLeave:Fl,reconnectRadius:Do,defaultMarkerColor:rc,noDragClassName:ct,noWheelClassName:vt,noPanClassName:kn,rfId:Hs,disableKeyboardA11y:ui,nodeExtent:Ms,viewport:Bs,onViewportChange:fn}),D.jsx(rA,{onSelectionChange:ae}),Mo,D.jsx(iA,{proOptions:Zi,position:Bo}),D.jsx(nA,{rfId:Hs,disableKeyboardA11y:ui})]})})}var UT=_1($T);function qT({dimensions:t,lineWidth:i,variant:s,className:a}){return D.jsx("path",{strokeWidth:i,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:ut(["react-flow__background-pattern",s,a])})}function VT({radius:t,className:i}){return D.jsx("circle",{cx:t,cy:t,r:t,className:ut(["react-flow__background-pattern","dots",i])})}var Ui;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Ui||(Ui={}));const YT={[Ui.Dots]:1,[Ui.Lines]:1,[Ui.Cross]:6},GT=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function I1({id:t,variant:i=Ui.Dots,gap:s=20,size:a,lineWidth:r=1,offset:u=0,color:c,bgColor:m,style:h,className:g,patternClassName:v}){const p=F.useRef(null),{transform:y,patternId:w}=ze(GT,Qe),x=a||YT[i],S=i===Ui.Dots,_=i===Ui.Cross,E=Array.isArray(s)?s:[s,s],O=[E[0]*y[2]||1,E[1]*y[2]||1],N=x*y[2],M=Array.isArray(u)?u:[u,u],k=_?[N,N]:O,L=[M[0]*y[2]||1+k[0]/2,M[1]*y[2]||1+k[1]/2],H=`${w}${t||""}`;return D.jsxs("svg",{className:ut(["react-flow__background",g]),style:{...h,...Xu,"--xy-background-color-props":m,"--xy-background-pattern-color-props":c},ref:p,"data-testid":"rf__background",children:[D.jsx("pattern",{id:H,x:y[0]%O[0],y:y[1]%O[1],width:O[0],height:O[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${L[0]},-${L[1]})`,children:S?D.jsx(VT,{radius:N/2,className:v}):D.jsx(qT,{dimensions:k,lineWidth:r,variant:i,className:v})}),D.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${H})`})]})}I1.displayName="Background";const XT=F.memo(I1);function KT(){return D.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:D.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function ZT(){return D.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:D.jsx("path",{d:"M0 0h32v4.2H0z"})})}function QT(){return D.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:D.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 IT(){return D.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:D.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 JT(){return D.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:D.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 su({children:t,className:i,...s}){return D.jsx("button",{type:"button",className:ut(["react-flow__controls-button",i]),...s,children:t})}const FT=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function J1({style:t,showZoom:i=!0,showFitView:s=!0,showInteractive:a=!0,fitViewOptions:r,onZoomIn:u,onZoomOut:c,onFitView:m,onInteractiveChange:h,className:g,children:v,position:p="bottom-left",orientation:y="vertical","aria-label":w}){const x=Je(),{isInteractive:S,minZoomReached:_,maxZoomReached:E,ariaLabelConfig:O}=ze(FT,Qe),{zoomIn:N,zoomOut:M,fitView:k}=Gu(),L=()=>{N(),u?.()},H=()=>{M(),c?.()},j=()=>{k(r),m?.()},Y=()=>{x.setState({nodesDraggable:!S,nodesConnectable:!S,elementsSelectable:!S}),h?.(!S)},oe=y==="horizontal"?"horizontal":"vertical";return D.jsxs(Yu,{className:ut(["react-flow__controls",oe,g]),position:p,style:t,"data-testid":"rf__controls","aria-label":w??O["controls.ariaLabel"],children:[i&&D.jsxs(D.Fragment,{children:[D.jsx(su,{onClick:L,className:"react-flow__controls-zoomin",title:O["controls.zoomIn.ariaLabel"],"aria-label":O["controls.zoomIn.ariaLabel"],disabled:E,children:D.jsx(KT,{})}),D.jsx(su,{onClick:H,className:"react-flow__controls-zoomout",title:O["controls.zoomOut.ariaLabel"],"aria-label":O["controls.zoomOut.ariaLabel"],disabled:_,children:D.jsx(ZT,{})})]}),s&&D.jsx(su,{className:"react-flow__controls-fitview",onClick:j,title:O["controls.fitView.ariaLabel"],"aria-label":O["controls.fitView.ariaLabel"],children:D.jsx(QT,{})}),a&&D.jsx(su,{className:"react-flow__controls-interactive",onClick:Y,title:O["controls.interactive.ariaLabel"],"aria-label":O["controls.interactive.ariaLabel"],children:S?D.jsx(JT,{}):D.jsx(IT,{})}),v]})}J1.displayName="Controls";const WT=F.memo(J1);function PT({id:t,x:i,y:s,width:a,height:r,style:u,color:c,strokeColor:m,strokeWidth:h,className:g,borderRadius:v,shapeRendering:p,selected:y,onClick:w}){const{background:x,backgroundColor:S}=u||{},_=c||x||S;return D.jsx("rect",{className:ut(["react-flow__minimap-node",{selected:y},g]),x:i,y:s,rx:v,ry:v,width:a,height:r,style:{fill:_,stroke:m,strokeWidth:h},shapeRendering:p,onClick:w?E=>w(E,t):void 0})}const eM=F.memo(PT),tM=t=>t.nodes.map(i=>i.id),Vd=t=>t instanceof Function?t:()=>t;function nM({nodeStrokeColor:t,nodeColor:i,nodeClassName:s="",nodeBorderRadius:a=5,nodeStrokeWidth:r,nodeComponent:u=eM,onClick:c}){const m=ze(tM,Qe),h=Vd(i),g=Vd(t),v=Vd(s),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return D.jsx(D.Fragment,{children:m.map(y=>D.jsx(sM,{id:y,nodeColorFunc:h,nodeStrokeColorFunc:g,nodeClassNameFunc:v,nodeBorderRadius:a,nodeStrokeWidth:r,NodeComponent:u,onClick:c,shapeRendering:p},y))})}function iM({id:t,nodeColorFunc:i,nodeStrokeColorFunc:s,nodeClassNameFunc:a,nodeBorderRadius:r,nodeStrokeWidth:u,shapeRendering:c,NodeComponent:m,onClick:h}){const{node:g,x:v,y:p,width:y,height:w}=ze(x=>{const S=x.nodeLookup.get(t);if(!S)return{node:void 0,x:0,y:0,width:0,height:0};const _=S.internals.userNode,{x:E,y:O}=S.internals.positionAbsolute,{width:N,height:M}=ai(_);return{node:_,x:E,y:O,width:N,height:M}},Qe);return!g||g.hidden||!Wv(g)?null:D.jsx(m,{x:v,y:p,width:y,height:w,style:g.style,selected:!!g.selected,className:a(g),color:i(g),borderRadius:r,strokeColor:s(g),strokeWidth:u,shapeRendering:c,onClick:h,id:g.id})}const sM=F.memo(iM);var lM=F.memo(nM);const aM=200,oM=150,rM=t=>!t.hidden,uM=t=>{const i={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:i,boundingRect:t.nodeLookup.size>0?Jv(xo(t.nodeLookup,{filter:rM}),i):i,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},cM="react-flow__minimap-desc";function F1({style:t,className:i,nodeStrokeColor:s,nodeColor:a,nodeClassName:r="",nodeBorderRadius:u=5,nodeStrokeWidth:c,nodeComponent:m,bgColor:h,maskColor:g,maskStrokeColor:v,maskStrokeWidth:p,position:y="bottom-right",onClick:w,onNodeClick:x,pannable:S=!1,zoomable:_=!1,ariaLabel:E,inversePan:O,zoomStep:N=1,offsetScale:M=5}){const k=Je(),L=F.useRef(null),{boundingRect:H,viewBB:j,rfId:Y,panZoom:oe,translateExtent:K,flowWidth:I,flowHeight:ae,ariaLabelConfig:R}=ze(uM,Qe),G=t?.width??aM,T=t?.height??oM,z=H.width/G,q=H.height/T,X=Math.max(z,q),te=X*G,C=X*T,$=M*X,P=H.x-(te-H.width)/2-$,ie=H.y-(C-H.height)/2-$,re=te+$*2,de=C+$*2,ue=`${cM}-${Y}`,ee=F.useRef(0),ce=F.useRef();ee.current=X,F.useEffect(()=>{if(L.current&&oe)return ce.current=_N({domNode:L.current,panZoom:oe,getTransform:()=>k.getState().transform,getViewScale:()=>ee.current}),()=>{ce.current?.destroy()}},[oe]),F.useEffect(()=>{ce.current?.update({translateExtent:K,width:I,height:ae,inversePan:O,pannable:S,zoomStep:N,zoomable:_})},[S,_,O,N,K,I,ae]);const Se=w?ye=>{const[Ee,De]=ce.current?.pointer(ye)||[0,0];w(ye,{x:Ee,y:De})}:void 0,be=x?F.useCallback((ye,Ee)=>{const De=k.getState().nodeLookup.get(Ee).internals.userNode;x(ye,De)},[]):void 0,ge=E??R["minimap.ariaLabel"];return D.jsx(Yu,{position:y,style:{...t,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof p=="number"?p*X:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-width-props":typeof c=="number"?c:void 0},className:ut(["react-flow__minimap",i]),"data-testid":"rf__minimap",children:D.jsxs("svg",{width:G,height:T,viewBox:`${P} ${ie} ${re} ${de}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ue,ref:L,onClick:Se,children:[ge&&D.jsx("title",{id:ue,children:ge}),D.jsx(lM,{onClick:be,nodeColor:a,nodeStrokeColor:s,nodeBorderRadius:u,nodeClassName:r,nodeStrokeWidth:c,nodeComponent:m}),D.jsx("path",{className:"react-flow__minimap-mask",d:`M${P-$},${ie-$}h${re+$*2}v${de+$*2}h${-re-$*2}z
15
+ M${j.x},${j.y}h${j.width}v${j.height}h${-j.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}F1.displayName="MiniMap";F.memo(F1);const fM=t=>i=>t?`${Math.max(1/i.transform[2],1)}`:void 0,dM={[jl.Line]:"right",[jl.Handle]:"bottom-right"};function hM({nodeId:t,position:i,variant:s=jl.Handle,className:a,style:r=void 0,children:u,color:c,minWidth:m=10,minHeight:h=10,maxWidth:g=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:y,autoScale:w=!0,shouldResize:x,onResizeStart:S,onResize:_,onResizeEnd:E}){const O=M1(),N=typeof t=="string"?t:O,M=Je(),k=F.useRef(null),L=s===jl.Handle,H=ze(F.useCallback(fM(L&&w),[L,w]),Qe),j=F.useRef(null),Y=i??dM[s];F.useEffect(()=>{if(!(!k.current||!N))return j.current||(j.current=HN({domNode:k.current,nodeId:N,getStoreItems:()=>{const{nodeLookup:K,transform:I,snapGrid:ae,snapToGrid:R,nodeOrigin:G,domNode:T}=M.getState();return{nodeLookup:K,transform:I,snapGrid:ae,snapToGrid:R,nodeOrigin:G,paneDomNode:T}},onChange:(K,I)=>{const{triggerNodeChanges:ae,nodeLookup:R,parentLookup:G,nodeOrigin:T}=M.getState(),z=[],q={x:K.x,y:K.y},X=R.get(N);if(X&&X.expandParent&&X.parentId){const te=X.origin??T,C=K.width??X.measured.width??0,$=K.height??X.measured.height??0,P={id:X.id,parentId:X.parentId,rect:{width:C,height:$,...Pv({x:K.x??X.position.x,y:K.y??X.position.y},{width:C,height:$},X.parentId,R,te)}},ie=kh([P],R,G,T);z.push(...ie),q.x=K.x?Math.max(te[0]*C,K.x):void 0,q.y=K.y?Math.max(te[1]*$,K.y):void 0}if(q.x!==void 0&&q.y!==void 0){const te={id:N,type:"position",position:{...q}};z.push(te)}if(K.width!==void 0&&K.height!==void 0){const C={id:N,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:K.width,height:K.height}};z.push(C)}for(const te of I){const C={...te,type:"position"};z.push(C)}ae(z)},onEnd:({width:K,height:I})=>{const ae={id:N,type:"dimensions",resizing:!1,dimensions:{width:K,height:I}};M.getState().triggerNodeChanges([ae])}})),j.current.update({controlPosition:Y,boundaries:{minWidth:m,minHeight:h,maxWidth:g,maxHeight:v},keepAspectRatio:p,resizeDirection:y,onResizeStart:S,onResize:_,onResizeEnd:E,shouldResize:x}),()=>{j.current?.destroy()}},[Y,m,h,g,v,p,S,_,E,x]);const oe=Y.split("-");return D.jsx("div",{className:ut(["react-flow__resize-control","nodrag",...oe,s,a]),ref:k,style:{...r,scale:H,...c&&{[L?"backgroundColor":"borderColor"]:c}},children:u})}F.memo(hM);const cs=180,fs=80,J0=540,Yd=430,mM=390,F0=130,W0=178,gM=92;function pM(t){return t==="slice-screen"||t==="story-slice"?"#cbd5e1":"#64748b"}function yM(t){return t.type==="event"?{sourcePosition:fe.Right,targetPosition:fe.Left}:{sourcePosition:fe.Bottom,targetPosition:fe.Top}}function vM(t){return new Map(t.stories.map((i,s)=>[i.name,s]))}function bM(t){const i=new Map(t.slices.map(a=>[a.path,a.title])),s=new Map;for(const a of t.stories)a.slices.forEach((r,u)=>{const c=i.get(r);c&&s.set(c,u)});return s}function SM(t){return t==="essential"?new Set(["command-event","event-query"]):t==="normal"?new Set(["query-screen","screen-command","command-event","event-query"]):new Set(["story-slice","slice-screen","query-screen","screen-command","command-event","event-query"])}function wM(t,i,s="all"){if(!i||s==="all")return new Set(t.stories.map(c=>c.name));if(s==="story")return new Set([i]);const a=new Set([i]),r=new Set(t.nodes.filter(c=>c.storyName===i).map(c=>c.id)),u=new Set(t.edges.filter(c=>r.has(c.source)||r.has(c.target)).flatMap(c=>[c.source,c.target]).filter(c=>t.nodes.find(m=>m.id===c)?.type==="event"));for(const c of t.edges){if(!u.has(c.source)&&!u.has(c.target))continue;const m=t.nodes.find(g=>g.id===c.source),h=t.nodes.find(g=>g.id===c.target);m?.storyName&&a.add(m.storyName),h?.storyName&&a.add(h.storyName)}return a}function xM(t){return t==="event-query"?{sourceSide:"top",targetSide:"bottom"}:t==="query-screen"?{sourceSide:"top",targetSide:"bottom"}:t==="screen-command"?{sourceSide:"bottom",targetSide:"top"}:t==="command-event"?{sourceSide:"bottom",targetSide:"top"}:t==="slice-screen"?{sourceSide:"bottom",targetSide:"top"}:{sourceSide:"right",targetSide:"left"}}function EM(t,i,s,a,r){const u=xM(t),c=i?.sliceTitle&&i.sliceTitle===s?.sliceTitle;if(t==="event-query"&&c)return{...u,route:"same-slice-read"};if(t==="event-query"&&i?.sliceTitle!==s?.sliceTitle&&i?.storyName&&i.storyName===s?.storyName)return{sourceSide:"bottom",targetSide:"top",route:"cross-story-read"};if(!(t==="event-query"&&s?.storyName&&i?.storyName!==s.storyName&&a&&r)||!a||!r)return{...u,route:"semantic"};const g=a.y+a.height/2;return r.y+r.height/2>g?{sourceSide:"bottom",targetSide:"top",route:"cross-story-read"}:{sourceSide:"top",targetSide:"bottom",route:"cross-story-read"}}function _M(t,i,s={}){const a=vM(t),r=bM(t),u=new Map(t.nodes.map(S=>[S.id,S])),c=new Map,m=new Map,h=new Map,g=new Set,v=wM(t,s.focusedStory,s.scope??"all"),p=SM(s.edgeDetail??"normal");if(i){g.add(i);for(const S of t.edges)S.source===i&&g.add(S.target),S.target===i&&g.add(S.source)}for(const S of t.slices){const _=fs+(a.get(S.storyName??"")??0)*J0,E=cs+(r.get(S.title)??0)*(Yd+F0),O=_+92;h.set(S.title,{x:E,y:O})}for(const S of t.nodes){if(S.type==="story"&&c.set(S.id,{x:cs-20,y:fs+(a.get(S.label)??0)*J0}),S.type==="slice"){const _=h.get(S.label)??{x:cs,y:fs};c.set(S.id,_)}if(S.type==="screen"||S.type==="processor"){const _=h.get(S.sliceTitle??"")??{x:cs,y:fs};c.set(S.id,{x:_.x+126,y:_.y+42})}if(S.type==="query"){const _=h.get(S.sliceTitle??"")??{x:cs,y:fs};c.set(S.id,{x:_.x+30,y:_.y+154})}if(S.type==="command"){const _=h.get(S.sliceTitle??"")??{x:cs,y:fs};c.set(S.id,{x:_.x+222,y:_.y+154})}}for(const S of t.nodes.filter(_=>_.type==="event")){const _=t.edges.find(N=>N.kind==="command-event"&&N.target===S.id),E=_?u.get(_.source):void 0,O=h.get(E?.sliceTitle??"")??{x:cs,y:fs};c.set(S.id,{x:O.x+222,y:O.y+278}),S.storyName=E?.storyName}const y=t.nodes.map(S=>{const _=c.get(S.id)??{x:0,y:0},E=S.type==="story"||S.type==="slice",O=S.type==="story"?Math.max(t.stories.find(L=>L.name===S.label)?.slices.length??1,1)*(Yd+F0):Yd,N=S.type==="story"?470:mM,M=E?O:W0,k=E?N:gM;return m.set(S.id,{x:_.x,y:_.y,width:M,height:k}),{id:S.id,type:E?"groupNode":"eventModelNode",position:_,selectable:!0,draggable:!1,data:{projectNode:S,selected:S.id===i,connected:g.has(S.id)},hidden:!!(S.storyName&&!v.has(S.storyName)),style:E?{width:O,height:N,zIndex:S.type==="story"?-20:-10,opacity:S.storyName&&!v.has(S.storyName)?.18:1}:{width:W0,opacity:S.storyName&&!v.has(S.storyName)?.18:1},...yM(S)}}),x=t.edges.filter(S=>p.has(S.kind)).filter(S=>{const _=u.get(S.source),E=u.get(S.target),O=!_?.storyName||v.has(_.storyName),N=!E?.storyName||v.has(E.storyName);return O&&N}).map(S=>{const _=u.get(S.source),E=u.get(S.target),O=!!s.focusedEdgeIds?.has(S.id),{sourceSide:N,targetSide:M,route:k}=EM(S.kind,_,E,m.get(S.source),m.get(S.target));return{id:S.id,source:S.source,target:S.target,type:"eventModelEdge",sourceHandle:`${N}-source`,targetHandle:`${M}-target`,data:{kind:S.kind,route:k,active:O},markerEnd:{type:co.ArrowClosed,color:O?"#111827":pM(S.kind)},label:s.edgeDetail==="verbose"?S.label:void 0,className:O?"edge edge-active":"edge",animated:O}});return{nodes:y,edges:x}}const jh=Symbol.for("yaml.alias"),hh=Symbol.for("yaml.document"),qi=Symbol.for("yaml.map"),W1=Symbol.for("yaml.pair"),Dn=Symbol.for("yaml.scalar"),Vl=Symbol.for("yaml.seq"),cn=Symbol.for("yaml.node.type"),Ns=t=>!!t&&typeof t=="object"&&t[cn]===jh,As=t=>!!t&&typeof t=="object"&&t[cn]===hh,Yl=t=>!!t&&typeof t=="object"&&t[cn]===qi,Ie=t=>!!t&&typeof t=="object"&&t[cn]===W1,Ye=t=>!!t&&typeof t=="object"&&t[cn]===Dn,Gl=t=>!!t&&typeof t=="object"&&t[cn]===Vl;function Fe(t){if(t&&typeof t=="object")switch(t[cn]){case qi:case Vl:return!0}return!1}function We(t){if(t&&typeof t=="object")switch(t[cn]){case jh:case qi:case Dn:case Vl:return!0}return!1}const P1=t=>(Ye(t)||Fe(t))&&!!t.anchor,Bt=Symbol("break visit"),eb=Symbol("skip children"),zn=Symbol("remove node");function Ts(t,i){const s=tb(i);As(t)?El(null,t.contents,s,Object.freeze([t]))===zn&&(t.contents=null):El(null,t,s,Object.freeze([]))}Ts.BREAK=Bt;Ts.SKIP=eb;Ts.REMOVE=zn;function El(t,i,s,a){const r=nb(t,i,s,a);if(We(r)||Ie(r))return ib(t,a,r),El(t,r,s,a);if(typeof r!="symbol"){if(Fe(i)){a=Object.freeze(a.concat(i));for(let u=0;u<i.items.length;++u){const c=El(u,i.items[u],s,a);if(typeof c=="number")u=c-1;else{if(c===Bt)return Bt;c===zn&&(i.items.splice(u,1),u-=1)}}}else if(Ie(i)){a=Object.freeze(a.concat(i));const u=El("key",i.key,s,a);if(u===Bt)return Bt;u===zn&&(i.key=null);const c=El("value",i.value,s,a);if(c===Bt)return Bt;c===zn&&(i.value=null)}}return r}async function Ku(t,i){const s=tb(i);As(t)?await _l(null,t.contents,s,Object.freeze([t]))===zn&&(t.contents=null):await _l(null,t,s,Object.freeze([]))}Ku.BREAK=Bt;Ku.SKIP=eb;Ku.REMOVE=zn;async function _l(t,i,s,a){const r=await nb(t,i,s,a);if(We(r)||Ie(r))return ib(t,a,r),_l(t,r,s,a);if(typeof r!="symbol"){if(Fe(i)){a=Object.freeze(a.concat(i));for(let u=0;u<i.items.length;++u){const c=await _l(u,i.items[u],s,a);if(typeof c=="number")u=c-1;else{if(c===Bt)return Bt;c===zn&&(i.items.splice(u,1),u-=1)}}}else if(Ie(i)){a=Object.freeze(a.concat(i));const u=await _l("key",i.key,s,a);if(u===Bt)return Bt;u===zn&&(i.key=null);const c=await _l("value",i.value,s,a);if(c===Bt)return Bt;c===zn&&(i.value=null)}}return r}function tb(t){return typeof t=="object"&&(t.Collection||t.Node||t.Value)?Object.assign({Alias:t.Node,Map:t.Node,Scalar:t.Node,Seq:t.Node},t.Value&&{Map:t.Value,Scalar:t.Value,Seq:t.Value},t.Collection&&{Map:t.Collection,Seq:t.Collection},t):t}function nb(t,i,s,a){if(typeof s=="function")return s(t,i,a);if(Yl(i))return s.Map?.(t,i,a);if(Gl(i))return s.Seq?.(t,i,a);if(Ie(i))return s.Pair?.(t,i,a);if(Ye(i))return s.Scalar?.(t,i,a);if(Ns(i))return s.Alias?.(t,i,a)}function ib(t,i,s){const a=i[i.length-1];if(Fe(a))a.items[t]=s;else if(Ie(a))t==="key"?a.key=s:a.value=s;else if(As(a))a.contents=s;else{const r=Ns(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const NM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},AM=t=>t.replace(/[!,[\]{}]/g,i=>NM[i]);class _t{constructor(i,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},_t.defaultYaml,i),this.tags=Object.assign({},_t.defaultTags,s)}clone(){const i=new _t(this.yaml,this.tags);return i.docStart=this.docStart,i}atDocument(){const i=new _t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:_t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},_t.defaultTags);break}return i}add(i,s){this.atNextDocument&&(this.yaml={explicit:_t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},_t.defaultTags),this.atNextDocument=!1);const a=i.trim().split(/[ \t]+/),r=a.shift();switch(r){case"%TAG":{if(a.length!==2&&(s(0,"%TAG directive should contain exactly two parts"),a.length<2))return!1;const[u,c]=a;return this.tags[u]=c,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[u]=a;if(u==="1.1"||u==="1.2")return this.yaml.version=u,!0;{const c=/^\d+\.\d+$/.test(u);return s(6,`Unsupported YAML version ${u}`,c),!1}}default:return s(0,`Unknown directive ${r}`,!0),!1}}tagName(i,s){if(i==="!")return"!";if(i[0]!=="!")return s(`Not a valid tag: ${i}`),null;if(i[1]==="<"){const c=i.slice(2,-1);return c==="!"||c==="!!"?(s(`Verbatim tags aren't resolved, so ${i} is invalid.`),null):(i[i.length-1]!==">"&&s("Verbatim tags must end with a >"),c)}const[,a,r]=i.match(/^(.*!)([^!]*)$/s);r||s(`The ${i} tag has no suffix`);const u=this.tags[a];if(u)try{return u+decodeURIComponent(r)}catch(c){return s(String(c)),null}return a==="!"?i:(s(`Could not resolve tag: ${i}`),null)}tagString(i){for(const[s,a]of Object.entries(this.tags))if(i.startsWith(a))return s+AM(i.substring(a.length));return i[0]==="!"?i:`!<${i}>`}toString(i){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let r;if(i&&a.length>0&&We(i.contents)){const u={};Ts(i.contents,(c,m)=>{We(m)&&m.tag&&(u[m.tag]=!0)}),r=Object.keys(u)}else r=[];for(const[u,c]of a)u==="!!"&&c==="tag:yaml.org,2002:"||(!i||r.some(m=>m.startsWith(c)))&&s.push(`%TAG ${u} ${c}`);return s.join(`
16
+ `)}}_t.defaultYaml={explicit:!1,version:"1.2"};_t.defaultTags={"!!":"tag:yaml.org,2002:"};function sb(t){if(/[\x00-\x19\s,[\]{}]/.test(t)){const s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(t)}`;throw new Error(s)}return!0}function lb(t){const i=new Set;return Ts(t,{Value(s,a){a.anchor&&i.add(a.anchor)}}),i}function ab(t,i){for(let s=1;;++s){const a=`${t}${s}`;if(!i.has(a))return a}}function TM(t,i){const s=[],a=new Map;let r=null;return{onAnchor:u=>{s.push(u),r??(r=lb(t));const c=ab(i,r);return r.add(c),c},setAnchors:()=>{for(const u of s){const c=a.get(u);if(typeof c=="object"&&c.anchor&&(Ye(c.node)||Fe(c.node)))c.node.anchor=c.anchor;else{const m=new Error("Failed to resolve repeated object (this should not happen)");throw m.source=u,m}}},sourceObjects:a}}function Nl(t,i,s,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let r=0,u=a.length;r<u;++r){const c=a[r],m=Nl(t,a,String(r),c);m===void 0?delete a[r]:m!==c&&(a[r]=m)}else if(a instanceof Map)for(const r of Array.from(a.keys())){const u=a.get(r),c=Nl(t,a,r,u);c===void 0?a.delete(r):c!==u&&a.set(r,c)}else if(a instanceof Set)for(const r of Array.from(a)){const u=Nl(t,a,r,r);u===void 0?a.delete(r):u!==r&&(a.delete(r),a.add(u))}else for(const[r,u]of Object.entries(a)){const c=Nl(t,a,r,u);c===void 0?delete a[r]:c!==u&&(a[r]=c)}return t.call(i,s,a)}function un(t,i,s){if(Array.isArray(t))return t.map((a,r)=>un(a,String(r),s));if(t&&typeof t.toJSON=="function"){if(!s||!P1(t))return t.toJSON(i,s);const a={aliasCount:0,count:1,res:void 0};s.anchors.set(t,a),s.onCreate=u=>{a.res=u,delete s.onCreate};const r=t.toJSON(i,s);return s.onCreate&&s.onCreate(r),r}return typeof t=="bigint"&&!s?.keep?Number(t):t}class $h{constructor(i){Object.defineProperty(this,cn,{value:i})}clone(){const i=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(i.range=this.range.slice()),i}toJS(i,{mapAsMap:s,maxAliasCount:a,onAnchor:r,reviver:u}={}){if(!As(i))throw new TypeError("A document argument is required");const c={anchors:new Map,doc:i,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},m=un(this,"",c);if(typeof r=="function")for(const{count:h,res:g}of c.anchors.values())r(g,h);return typeof u=="function"?Nl(u,{"":m},"",m):m}}class Zu extends $h{constructor(i){super(jh),this.source=i,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(i,s){if(s?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let a;s?.aliasResolveCache?a=s.aliasResolveCache:(a=[],Ts(i,{Node:(u,c)=>{(Ns(c)||P1(c))&&a.push(c)}}),s&&(s.aliasResolveCache=a));let r;for(const u of a){if(u===this)break;u.anchor===this.source&&(r=u)}return r}toJSON(i,s){if(!s)return{source:this.source};const{anchors:a,doc:r,maxAliasCount:u}=s,c=this.resolve(r,s);if(!c){const h=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(h)}let m=a.get(c);if(m||(un(c,null,s),m=a.get(c)),m?.res===void 0){const h="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(h)}if(u>=0&&(m.count+=1,m.aliasCount===0&&(m.aliasCount=pu(r,c,a)),m.count*m.aliasCount>u)){const h="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(h)}return m.res}toString(i,s,a){const r=`*${this.source}`;if(i){if(sb(this.source),i.options.verifyAliasOrder&&!i.anchors.has(this.source)){const u=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(u)}if(i.implicitKey)return`${r} `}return r}}function pu(t,i,s){if(Ns(i)){const a=i.resolve(t),r=s&&a&&s.get(a);return r?r.count*r.aliasCount:0}else if(Fe(i)){let a=0;for(const r of i.items){const u=pu(t,r,s);u>a&&(a=u)}return a}else if(Ie(i)){const a=pu(t,i.key,s),r=pu(t,i.value,s);return Math.max(a,r)}return 1}const ob=t=>!t||typeof t!="function"&&typeof t!="object";class xe extends $h{constructor(i){super(Dn),this.value=i}toJSON(i,s){return s?.keep?this.value:un(this.value,i,s)}toString(){return String(this.value)}}xe.BLOCK_FOLDED="BLOCK_FOLDED";xe.BLOCK_LITERAL="BLOCK_LITERAL";xe.PLAIN="PLAIN";xe.QUOTE_DOUBLE="QUOTE_DOUBLE";xe.QUOTE_SINGLE="QUOTE_SINGLE";const MM="tag:yaml.org,2002:";function CM(t,i,s){if(i){const a=s.filter(u=>u.tag===i),r=a.find(u=>!u.format)??a[0];if(!r)throw new Error(`Tag ${i} not found`);return r}return s.find(a=>a.identify?.(t)&&!a.format)}function go(t,i,s){if(As(t)&&(t=t.contents),We(t))return t;if(Ie(t)){const p=s.schema[qi].createNode?.(s.schema,null,s);return p.items.push(t),p}(t instanceof String||t instanceof Number||t instanceof Boolean||typeof BigInt<"u"&&t instanceof BigInt)&&(t=t.valueOf());const{aliasDuplicateObjects:a,onAnchor:r,onTagObj:u,schema:c,sourceObjects:m}=s;let h;if(a&&t&&typeof t=="object"){if(h=m.get(t),h)return h.anchor??(h.anchor=r(t)),new Zu(h.anchor);h={anchor:null,node:null},m.set(t,h)}i?.startsWith("!!")&&(i=MM+i.slice(2));let g=CM(t,i,c.tags);if(!g){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const p=new xe(t);return h&&(h.node=p),p}g=t instanceof Map?c[qi]:Symbol.iterator in Object(t)?c[Vl]:c[qi]}u&&(u(g),delete s.onTagObj);const v=g?.createNode?g.createNode(s.schema,t,s):typeof g?.nodeClass?.from=="function"?g.nodeClass.from(s.schema,t,s):new xe(t);return i?v.tag=i:g.default||(v.tag=g.tag),h&&(h.node=v),v}function Cu(t,i,s){let a=s;for(let r=i.length-1;r>=0;--r){const u=i[r];if(typeof u=="number"&&Number.isInteger(u)&&u>=0){const c=[];c[u]=a,a=c}else a=new Map([[u,a]])}return go(a,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:t,sourceObjects:new Map})}const Pa=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class rb extends $h{constructor(i,s){super(i),Object.defineProperty(this,"schema",{value:s,configurable:!0,enumerable:!1,writable:!0})}clone(i){const s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return i&&(s.schema=i),s.items=s.items.map(a=>We(a)||Ie(a)?a.clone(i):a),this.range&&(s.range=this.range.slice()),s}addIn(i,s){if(Pa(i))this.add(s);else{const[a,...r]=i,u=this.get(a,!0);if(Fe(u))u.addIn(r,s);else if(u===void 0&&this.schema)this.set(a,Cu(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}deleteIn(i){const[s,...a]=i;if(a.length===0)return this.delete(s);const r=this.get(s,!0);if(Fe(r))return r.deleteIn(a);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${a}`)}getIn(i,s){const[a,...r]=i,u=this.get(a,!0);return r.length===0?!s&&Ye(u)?u.value:u:Fe(u)?u.getIn(r,s):void 0}hasAllNullValues(i){return this.items.every(s=>{if(!Ie(s))return!1;const a=s.value;return a==null||i&&Ye(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(i){const[s,...a]=i;if(a.length===0)return this.has(s);const r=this.get(s,!0);return Fe(r)?r.hasIn(a):!1}setIn(i,s){const[a,...r]=i;if(r.length===0)this.set(a,s);else{const u=this.get(a,!0);if(Fe(u))u.setIn(r,s);else if(u===void 0&&this.schema)this.set(a,Cu(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}}const OM=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function ii(t,i){return/^\n+$/.test(t)?t.substring(1):i?t.replace(/^(?! *$)/gm,i):t}const ms=(t,i,s)=>t.endsWith(`
17
+ `)?ii(s,i):s.includes(`
18
+ `)?`
19
+ `+ii(s,i):(t.endsWith(" ")?"":" ")+s,ub="flow",mh="block",yu="quoted";function Qu(t,i,s="flow",{indentAtStart:a,lineWidth:r=80,minContentWidth:u=20,onFold:c,onOverflow:m}={}){if(!r||r<0)return t;r<u&&(u=0);const h=Math.max(1+u,1+r-i.length);if(t.length<=h)return t;const g=[],v={};let p=r-i.length;typeof a=="number"&&(a>r-Math.max(2,u)?g.push(0):p=r-a);let y,w,x=!1,S=-1,_=-1,E=-1;s===mh&&(S=P0(t,S,i.length),S!==-1&&(p=S+h));for(let N;N=t[S+=1];){if(s===yu&&N==="\\"){switch(_=S,t[S+1]){case"x":S+=3;break;case"u":S+=5;break;case"U":S+=9;break;default:S+=1}E=S}if(N===`
20
+ `)s===mh&&(S=P0(t,S,i.length)),p=S+i.length+h,y=void 0;else{if(N===" "&&w&&w!==" "&&w!==`
21
+ `&&w!==" "){const M=t[S+1];M&&M!==" "&&M!==`
22
+ `&&M!==" "&&(y=S)}if(S>=p)if(y)g.push(y),p=y+h,y=void 0;else if(s===yu){for(;w===" "||w===" ";)w=N,N=t[S+=1],x=!0;const M=S>E+1?S-2:_-1;if(v[M])return t;g.push(M),v[M]=!0,p=M+h,y=void 0}else x=!0}w=N}if(x&&m&&m(),g.length===0)return t;c&&c();let O=t.slice(0,g[0]);for(let N=0;N<g.length;++N){const M=g[N],k=g[N+1]||t.length;M===0?O=`
23
+ ${i}${t.slice(0,k)}`:(s===yu&&v[M]&&(O+=`${t[M]}\\`),O+=`
24
+ ${i}${t.slice(M+1,k)}`)}return O}function P0(t,i,s){let a=i,r=i+1,u=t[r];for(;u===" "||u===" ";)if(i<r+s)u=t[++i];else{do u=t[++i];while(u&&u!==`
25
+ `);a=i,r=i+1,u=t[r]}return a}const Iu=(t,i)=>({indentAtStart:i?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),Ju=t=>/^(%|---|\.\.\.)/m.test(t);function zM(t,i,s){if(!i||i<0)return!1;const a=i-s,r=t.length;if(r<=a)return!1;for(let u=0,c=0;u<r;++u)if(t[u]===`
26
+ `){if(u-c>a)return!0;if(c=u+1,r-c<=a)return!1}return!0}function no(t,i){const s=JSON.stringify(t);if(i.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=i,r=i.options.doubleQuotedMinMultiLineLength,u=i.indent||(Ju(t)?" ":"");let c="",m=0;for(let h=0,g=s[h];g;g=s[++h])if(g===" "&&s[h+1]==="\\"&&s[h+2]==="n"&&(c+=s.slice(m,h)+"\\ ",h+=1,m=h,g="\\"),g==="\\")switch(s[h+1]){case"u":{c+=s.slice(m,h);const v=s.substr(h+2,4);switch(v){case"0000":c+="\\0";break;case"0007":c+="\\a";break;case"000b":c+="\\v";break;case"001b":c+="\\e";break;case"0085":c+="\\N";break;case"00a0":c+="\\_";break;case"2028":c+="\\L";break;case"2029":c+="\\P";break;default:v.substr(0,2)==="00"?c+="\\x"+v.substr(2):c+=s.substr(h,6)}h+=5,m=h+1}break;case"n":if(a||s[h+2]==='"'||s.length<r)h+=1;else{for(c+=s.slice(m,h)+`
27
+
28
+ `;s[h+2]==="\\"&&s[h+3]==="n"&&s[h+4]!=='"';)c+=`
29
+ `,h+=2;c+=u,s[h+2]===" "&&(c+="\\"),h+=1,m=h+1}break;default:h+=1}return c=m?c+s.slice(m):s,a?c:Qu(c,u,yu,Iu(i,!1))}function gh(t,i){if(i.options.singleQuote===!1||i.implicitKey&&t.includes(`
30
+ `)||/[ \t]\n|\n[ \t]/.test(t))return no(t,i);const s=i.indent||(Ju(t)?" ":""),a="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
31
+ ${s}`)+"'";return i.implicitKey?a:Qu(a,s,ub,Iu(i,!1))}function Al(t,i){const{singleQuote:s}=i.options;let a;if(s===!1)a=no;else{const r=t.includes('"'),u=t.includes("'");r&&!u?a=gh:u&&!r?a=no:a=s?gh:no}return a(t,i)}let ph;try{ph=new RegExp(`(^|(?<!
32
+ ))
33
+ +(?!
34
+ |$)`,"g")}catch{ph=/\n+(?!\n|$)/g}function vu({comment:t,type:i,value:s},a,r,u){const{blockQuote:c,commentString:m,lineWidth:h}=a.options;if(!c||/\n[\t ]+$/.test(s))return Al(s,a);const g=a.indent||(a.forceBlockIndent||Ju(s)?" ":""),v=c==="literal"?!0:c==="folded"||i===xe.BLOCK_FOLDED?!1:i===xe.BLOCK_LITERAL?!0:!zM(s,h,g.length);if(!s)return v?`|
35
+ `:`>
36
+ `;let p,y;for(y=s.length;y>0;--y){const k=s[y-1];if(k!==`
37
+ `&&k!==" "&&k!==" ")break}let w=s.substring(y);const x=w.indexOf(`
38
+ `);x===-1?p="-":s===w||x!==w.length-1?(p="+",u&&u()):p="",w&&(s=s.slice(0,-w.length),w[w.length-1]===`
39
+ `&&(w=w.slice(0,-1)),w=w.replace(ph,`$&${g}`));let S=!1,_,E=-1;for(_=0;_<s.length;++_){const k=s[_];if(k===" ")S=!0;else if(k===`
40
+ `)E=_;else break}let O=s.substring(0,E<_?E+1:_);O&&(s=s.substring(O.length),O=O.replace(/\n+/g,`$&${g}`));let M=(S?g?"2":"1":"")+p;if(t&&(M+=" "+m(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!v){const k=s.replace(/\n+/g,`
41
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${g}`);let L=!1;const H=Iu(a,!0);c!=="folded"&&i!==xe.BLOCK_FOLDED&&(H.onOverflow=()=>{L=!0});const j=Qu(`${O}${k}${w}`,g,mh,H);if(!L)return`>${M}
42
+ ${g}${j}`}return s=s.replace(/\n+/g,`$&${g}`),`|${M}
43
+ ${g}${O}${s}${w}`}function DM(t,i,s,a){const{type:r,value:u}=t,{actualString:c,implicitKey:m,indent:h,indentStep:g,inFlow:v}=i;if(m&&u.includes(`
44
+ `)||v&&/[[\]{},]/.test(u))return Al(u,i);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(u))return m||v||!u.includes(`
45
+ `)?Al(u,i):vu(t,i,s,a);if(!m&&!v&&r!==xe.PLAIN&&u.includes(`
46
+ `))return vu(t,i,s,a);if(Ju(u)){if(h==="")return i.forceBlockIndent=!0,vu(t,i,s,a);if(m&&h===g)return Al(u,i)}const p=u.replace(/\n+/g,`$&
47
+ ${h}`);if(c){const y=S=>S.default&&S.tag!=="tag:yaml.org,2002:str"&&S.test?.test(p),{compat:w,tags:x}=i.doc.schema;if(x.some(y)||w?.some(y))return Al(u,i)}return m?p:Qu(p,h,ub,Iu(i,!1))}function No(t,i,s,a){const{implicitKey:r,inFlow:u}=i,c=typeof t.value=="string"?t:Object.assign({},t,{value:String(t.value)});let{type:m}=t;m!==xe.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(c.value)&&(m=xe.QUOTE_DOUBLE);const h=v=>{switch(v){case xe.BLOCK_FOLDED:case xe.BLOCK_LITERAL:return r||u?Al(c.value,i):vu(c,i,s,a);case xe.QUOTE_DOUBLE:return no(c.value,i);case xe.QUOTE_SINGLE:return gh(c.value,i);case xe.PLAIN:return DM(c,i,s,a);default:return null}};let g=h(m);if(g===null){const{defaultKeyType:v,defaultStringType:p}=i.options,y=r&&v||p;if(g=h(y),g===null)throw new Error(`Unsupported default string type ${y}`)}return g}function cb(t,i){const s=Object.assign({blockQuote:!0,commentString:OM,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},t.schema.toStringOptions,i);let a;switch(s.collectionStyle){case"block":a=!1;break;case"flow":a=!0;break;default:a=null}return{anchors:new Set,doc:t,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:a,options:s}}function LM(t,i){if(i.tag){const r=t.filter(u=>u.tag===i.tag);if(r.length>0)return r.find(u=>u.format===i.format)??r[0]}let s,a;if(Ye(i)){a=i.value;let r=t.filter(u=>u.identify?.(a));if(r.length>1){const u=r.filter(c=>c.test);u.length>0&&(r=u)}s=r.find(u=>u.format===i.format)??r.find(u=>!u.format)}else a=i,s=t.find(r=>r.nodeClass&&a instanceof r.nodeClass);if(!s){const r=a?.constructor?.name??(a===null?"null":typeof a);throw new Error(`Tag not resolved for ${r} value`)}return s}function RM(t,i,{anchors:s,doc:a}){if(!a.directives)return"";const r=[],u=(Ye(t)||Fe(t))&&t.anchor;u&&sb(u)&&(s.add(u),r.push(`&${u}`));const c=t.tag??(i.default?null:i.tag);return c&&r.push(a.directives.tagString(c)),r.join(" ")}function $l(t,i,s,a){if(Ie(t))return t.toString(i,s,a);if(Ns(t)){if(i.doc.directives)return t.toString(i);if(i.resolvedAliases?.has(t))throw new TypeError("Cannot stringify circular structure without alias nodes");i.resolvedAliases?i.resolvedAliases.add(t):i.resolvedAliases=new Set([t]),t=t.resolve(i.doc)}let r;const u=We(t)?t:i.doc.createNode(t,{onTagObj:h=>r=h});r??(r=LM(i.doc.schema.tags,u));const c=RM(u,r,i);c.length>0&&(i.indentAtStart=(i.indentAtStart??0)+c.length+1);const m=typeof r.stringify=="function"?r.stringify(u,i,s,a):Ye(u)?No(u,i,s,a):u.toString(i,s,a);return c?Ye(u)||m[0]==="{"||m[0]==="["?`${c} ${m}`:`${c}
48
+ ${i.indent}${m}`:m}function BM({key:t,value:i},s,a,r){const{allNullValues:u,doc:c,indent:m,indentStep:h,options:{commentString:g,indentSeq:v,simpleKeys:p}}=s;let y=We(t)&&t.comment||null;if(p){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(Fe(t)||!We(t)&&typeof t=="object"){const H="With simple keys, collection cannot be used as a key value";throw new Error(H)}}let w=!p&&(!t||y&&i==null&&!s.inFlow||Fe(t)||(Ye(t)?t.type===xe.BLOCK_FOLDED||t.type===xe.BLOCK_LITERAL:typeof t=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!w&&(p||!u),indent:m+h});let x=!1,S=!1,_=$l(t,s,()=>x=!0,()=>S=!0);if(!w&&!s.inFlow&&_.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");w=!0}if(s.inFlow){if(u||i==null)return x&&a&&a(),_===""?"?":w?`? ${_}`:_}else if(u&&!p||i==null&&w)return _=`? ${_}`,y&&!x?_+=ms(_,s.indent,g(y)):S&&r&&r(),_;x&&(y=null),w?(y&&(_+=ms(_,s.indent,g(y))),_=`? ${_}
49
+ ${m}:`):(_=`${_}:`,y&&(_+=ms(_,s.indent,g(y))));let E,O,N;We(i)?(E=!!i.spaceBefore,O=i.commentBefore,N=i.comment):(E=!1,O=null,N=null,i&&typeof i=="object"&&(i=c.createNode(i))),s.implicitKey=!1,!w&&!y&&Ye(i)&&(s.indentAtStart=_.length+1),S=!1,!v&&h.length>=2&&!s.inFlow&&!w&&Gl(i)&&!i.flow&&!i.tag&&!i.anchor&&(s.indent=s.indent.substring(2));let M=!1;const k=$l(i,s,()=>M=!0,()=>S=!0);let L=" ";if(y||E||O){if(L=E?`
50
+ `:"",O){const H=g(O);L+=`
51
+ ${ii(H,s.indent)}`}k===""&&!s.inFlow?L===`
52
+ `&&N&&(L=`
53
+
54
+ `):L+=`
55
+ ${s.indent}`}else if(!w&&Fe(i)){const H=k[0],j=k.indexOf(`
56
+ `),Y=j!==-1,oe=s.inFlow??i.flow??i.items.length===0;if(Y||!oe){let K=!1;if(Y&&(H==="&"||H==="!")){let I=k.indexOf(" ");H==="&"&&I!==-1&&I<j&&k[I+1]==="!"&&(I=k.indexOf(" ",I+1)),(I===-1||j<I)&&(K=!0)}K||(L=`
57
+ ${s.indent}`)}}else(k===""||k[0]===`
58
+ `)&&(L="");return _+=L+k,s.inFlow?M&&a&&a():N&&!M?_+=ms(_,s.indent,g(N)):S&&r&&r(),_}function fb(t,i){(t==="debug"||t==="warn")&&console.warn(i)}const lu="<<",si={identify:t=>t===lu||typeof t=="symbol"&&t.description===lu,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new xe(Symbol(lu)),{addToJSMap:db}),stringify:()=>lu},kM=(t,i)=>(si.identify(i)||Ye(i)&&(!i.type||i.type===xe.PLAIN)&&si.identify(i.value))&&t?.doc.schema.tags.some(s=>s.tag===si.tag&&s.default);function db(t,i,s){const a=hb(t,s);if(Gl(a))for(const r of a.items)Gd(t,i,r);else if(Array.isArray(a))for(const r of a)Gd(t,i,r);else Gd(t,i,a)}function Gd(t,i,s){const a=hb(t,s);if(!Yl(a))throw new Error("Merge sources must be maps or map aliases");const r=a.toJSON(null,t,Map);for(const[u,c]of r)i instanceof Map?i.has(u)||i.set(u,c):i instanceof Set?i.add(u):Object.prototype.hasOwnProperty.call(i,u)||Object.defineProperty(i,u,{value:c,writable:!0,enumerable:!0,configurable:!0});return i}function hb(t,i){return t&&Ns(i)?i.resolve(t.doc,t):i}function mb(t,i,{key:s,value:a}){if(We(s)&&s.addToJSMap)s.addToJSMap(t,i,a);else if(kM(t,s))db(t,i,a);else{const r=un(s,"",t);if(i instanceof Map)i.set(r,un(a,r,t));else if(i instanceof Set)i.add(r);else{const u=HM(s,r,t),c=un(a,u,t);u in i?Object.defineProperty(i,u,{value:c,writable:!0,enumerable:!0,configurable:!0}):i[u]=c}}return i}function HM(t,i,s){if(i===null)return"";if(typeof i!="object")return String(i);if(We(t)&&s?.doc){const a=cb(s.doc,{});a.anchors=new Set;for(const u of s.anchors.keys())a.anchors.add(u.anchor);a.inFlow=!0,a.inStringifyKey=!0;const r=t.toString(a);if(!s.mapKeyWarned){let u=JSON.stringify(r);u.length>40&&(u=u.substring(0,36)+'..."'),fb(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${u}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return r}return JSON.stringify(i)}function Uh(t,i,s){const a=go(t,void 0,s),r=go(i,void 0,s);return new St(a,r)}class St{constructor(i,s=null){Object.defineProperty(this,cn,{value:W1}),this.key=i,this.value=s}clone(i){let{key:s,value:a}=this;return We(s)&&(s=s.clone(i)),We(a)&&(a=a.clone(i)),new St(s,a)}toJSON(i,s){const a=s?.mapAsMap?new Map:{};return mb(s,a,this)}toString(i,s,a){return i?.doc?BM(this,i,s,a):JSON.stringify(this)}}function gb(t,i,s){return(i.inFlow??t.flow?$M:jM)(t,i,s)}function jM({comment:t,items:i},s,{blockItemPrefix:a,flowChars:r,itemIndent:u,onChompKeep:c,onComment:m}){const{indent:h,options:{commentString:g}}=s,v=Object.assign({},s,{indent:u,type:null});let p=!1;const y=[];for(let x=0;x<i.length;++x){const S=i[x];let _=null;if(We(S))!p&&S.spaceBefore&&y.push(""),Ou(s,y,S.commentBefore,p),S.comment&&(_=S.comment);else if(Ie(S)){const O=We(S.key)?S.key:null;O&&(!p&&O.spaceBefore&&y.push(""),Ou(s,y,O.commentBefore,p))}p=!1;let E=$l(S,v,()=>_=null,()=>p=!0);_&&(E+=ms(E,u,g(_))),p&&_&&(p=!1),y.push(a+E)}let w;if(y.length===0)w=r.start+r.end;else{w=y[0];for(let x=1;x<y.length;++x){const S=y[x];w+=S?`
59
+ ${h}${S}`:`
60
+ `}}return t?(w+=`
61
+ `+ii(g(t),h),m&&m()):p&&c&&c(),w}function $M({items:t},i,{flowChars:s,itemIndent:a}){const{indent:r,indentStep:u,flowCollectionPadding:c,options:{commentString:m}}=i;a+=u;const h=Object.assign({},i,{indent:a,inFlow:!0,type:null});let g=!1,v=0;const p=[];for(let x=0;x<t.length;++x){const S=t[x];let _=null;if(We(S))S.spaceBefore&&p.push(""),Ou(i,p,S.commentBefore,!1),S.comment&&(_=S.comment);else if(Ie(S)){const O=We(S.key)?S.key:null;O&&(O.spaceBefore&&p.push(""),Ou(i,p,O.commentBefore,!1),O.comment&&(g=!0));const N=We(S.value)?S.value:null;N?(N.comment&&(_=N.comment),N.commentBefore&&(g=!0)):S.value==null&&O?.comment&&(_=O.comment)}_&&(g=!0);let E=$l(S,h,()=>_=null);g||(g=p.length>v||E.includes(`
62
+ `)),x<t.length-1?E+=",":i.options.trailingComma&&(i.options.lineWidth>0&&(g||(g=p.reduce((O,N)=>O+N.length+2,2)+(E.length+2)>i.options.lineWidth)),g&&(E+=",")),_&&(E+=ms(E,a,m(_))),p.push(E),v=p.length}const{start:y,end:w}=s;if(p.length===0)return y+w;if(!g){const x=p.reduce((S,_)=>S+_.length+2,2);g=i.options.lineWidth>0&&x>i.options.lineWidth}if(g){let x=y;for(const S of p)x+=S?`
63
+ ${u}${r}${S}`:`
64
+ `;return`${x}
65
+ ${r}${w}`}else return`${y}${c}${p.join(" ")}${c}${w}`}function Ou({indent:t,options:{commentString:i}},s,a,r){if(a&&r&&(a=a.replace(/^\n+/,"")),a){const u=ii(i(a),t);s.push(u.trimStart())}}function gs(t,i){const s=Ye(i)?i.value:i;for(const a of t)if(Ie(a)&&(a.key===i||a.key===s||Ye(a.key)&&a.key.value===s))return a}class Zt extends rb{static get tagName(){return"tag:yaml.org,2002:map"}constructor(i){super(qi,i),this.items=[]}static from(i,s,a){const{keepUndefined:r,replacer:u}=a,c=new this(i),m=(h,g)=>{if(typeof u=="function")g=u.call(s,h,g);else if(Array.isArray(u)&&!u.includes(h))return;(g!==void 0||r)&&c.items.push(Uh(h,g,a))};if(s instanceof Map)for(const[h,g]of s)m(h,g);else if(s&&typeof s=="object")for(const h of Object.keys(s))m(h,s[h]);return typeof i.sortMapEntries=="function"&&c.items.sort(i.sortMapEntries),c}add(i,s){let a;Ie(i)?a=i:!i||typeof i!="object"||!("key"in i)?a=new St(i,i?.value):a=new St(i.key,i.value);const r=gs(this.items,a.key),u=this.schema?.sortMapEntries;if(r){if(!s)throw new Error(`Key ${a.key} already set`);Ye(r.value)&&ob(a.value)?r.value.value=a.value:r.value=a.value}else if(u){const c=this.items.findIndex(m=>u(a,m)<0);c===-1?this.items.push(a):this.items.splice(c,0,a)}else this.items.push(a)}delete(i){const s=gs(this.items,i);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(i,s){const r=gs(this.items,i)?.value;return(!s&&Ye(r)?r.value:r)??void 0}has(i){return!!gs(this.items,i)}set(i,s){this.add(new St(i,s),!0)}toJSON(i,s,a){const r=a?new a:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(r);for(const u of this.items)mb(s,r,u);return r}toString(i,s,a){if(!i)return JSON.stringify(this);for(const r of this.items)if(!Ie(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!i.allNullValues&&this.hasAllNullValues(!1)&&(i=Object.assign({},i,{allNullValues:!0})),gb(this,i,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:i.indent||"",onChompKeep:a,onComment:s})}}const Xl={collection:"map",default:!0,nodeClass:Zt,tag:"tag:yaml.org,2002:map",resolve(t,i){return Yl(t)||i("Expected a mapping for this tag"),t},createNode:(t,i,s)=>Zt.from(t,i,s)};class Vi extends rb{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(i){super(Vl,i),this.items=[]}add(i){this.items.push(i)}delete(i){const s=au(i);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(i,s){const a=au(i);if(typeof a!="number")return;const r=this.items[a];return!s&&Ye(r)?r.value:r}has(i){const s=au(i);return typeof s=="number"&&s<this.items.length}set(i,s){const a=au(i);if(typeof a!="number")throw new Error(`Expected a valid index, not ${i}.`);const r=this.items[a];Ye(r)&&ob(s)?r.value=s:this.items[a]=s}toJSON(i,s){const a=[];s?.onCreate&&s.onCreate(a);let r=0;for(const u of this.items)a.push(un(u,String(r++),s));return a}toString(i,s,a){return i?gb(this,i,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(i.indent||"")+" ",onChompKeep:a,onComment:s}):JSON.stringify(this)}static from(i,s,a){const{replacer:r}=a,u=new this(i);if(s&&Symbol.iterator in Object(s)){let c=0;for(let m of s){if(typeof r=="function"){const h=s instanceof Set?m:String(c++);m=r.call(s,h,m)}u.items.push(go(m,void 0,a))}}return u}}function au(t){let i=Ye(t)?t.value:t;return i&&typeof i=="string"&&(i=Number(i)),typeof i=="number"&&Number.isInteger(i)&&i>=0?i:null}const Kl={collection:"seq",default:!0,nodeClass:Vi,tag:"tag:yaml.org,2002:seq",resolve(t,i){return Gl(t)||i("Expected a sequence for this tag"),t},createNode:(t,i,s)=>Vi.from(t,i,s)},Fu={identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify(t,i,s,a){return i=Object.assign({actualString:!0},i),No(t,i,s,a)}},Wu={identify:t=>t==null,createNode:()=>new xe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new xe(null),stringify:({source:t},i)=>typeof t=="string"&&Wu.test.test(t)?t:i.options.nullStr},qh={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new xe(t[0]==="t"||t[0]==="T"),stringify({source:t,value:i},s){if(t&&qh.test.test(t)){const a=t[0]==="t"||t[0]==="T";if(i===a)return t}return i?s.options.trueStr:s.options.falseStr}};function xn({format:t,minFractionDigits:i,tag:s,value:a}){if(typeof a=="bigint")return String(a);const r=typeof a=="number"?a:Number(a);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let u=Object.is(a,-0)?"-0":JSON.stringify(a);if(!t&&i&&(!s||s==="tag:yaml.org,2002:float")&&/^-?\d/.test(u)&&!u.includes("e")){let c=u.indexOf(".");c<0&&(c=u.length,u+=".");let m=i-(u.length-c-1);for(;m-- >0;)u+="0"}return u}const pb={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:xn},yb={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t),stringify(t){const i=Number(t.value);return isFinite(i)?i.toExponential():xn(t)}},vb={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(t){const i=new xe(parseFloat(t)),s=t.indexOf(".");return s!==-1&&t[t.length-1]==="0"&&(i.minFractionDigits=t.length-s-1),i},stringify:xn},Pu=t=>typeof t=="bigint"||Number.isInteger(t),Vh=(t,i,s,{intAsBigInt:a})=>a?BigInt(t):parseInt(t.substring(i),s);function bb(t,i,s){const{value:a}=t;return Pu(a)&&a>=0?s+a.toString(i):xn(t)}const Sb={identify:t=>Pu(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,i,s)=>Vh(t,2,8,s),stringify:t=>bb(t,8,"0o")},wb={identify:Pu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,i,s)=>Vh(t,0,10,s),stringify:xn},xb={identify:t=>Pu(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,i,s)=>Vh(t,2,16,s),stringify:t=>bb(t,16,"0x")},UM=[Xl,Kl,Fu,Wu,qh,Sb,wb,xb,pb,yb,vb];function ev(t){return typeof t=="bigint"||Number.isInteger(t)}const ou=({value:t})=>JSON.stringify(t),qM=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:ou},{identify:t=>t==null,createNode:()=>new xe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ou},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:ou},{identify:ev,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(t,i,{intAsBigInt:s})=>s?BigInt(t):parseInt(t,10),stringify:({value:t})=>ev(t)?t.toString():JSON.stringify(t)},{identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:t=>parseFloat(t),stringify:ou}],VM={default:!0,tag:"",test:/^/,resolve(t,i){return i(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},YM=[Xl,Kl].concat(qM,VM),Yh={identify:t=>t instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(t,i){if(typeof atob=="function"){const s=atob(t.replace(/[\n\r]/g,"")),a=new Uint8Array(s.length);for(let r=0;r<s.length;++r)a[r]=s.charCodeAt(r);return a}else return i("This environment does not support reading binary tags; either Buffer or atob is required"),t},stringify({comment:t,type:i,value:s},a,r,u){if(!s)return"";const c=s;let m;if(typeof btoa=="function"){let h="";for(let g=0;g<c.length;++g)h+=String.fromCharCode(c[g]);m=btoa(h)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(i??(i=xe.BLOCK_LITERAL),i!==xe.QUOTE_DOUBLE){const h=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),g=Math.ceil(m.length/h),v=new Array(g);for(let p=0,y=0;p<g;++p,y+=h)v[p]=m.substr(y,h);m=v.join(i===xe.BLOCK_LITERAL?`
66
+ `:" ")}return No({comment:t,type:i,value:m},a,r,u)}};function Eb(t,i){if(Gl(t))for(let s=0;s<t.items.length;++s){let a=t.items[s];if(!Ie(a)){if(Yl(a)){a.items.length>1&&i("Each pair must have its own sequence indicator");const r=a.items[0]||new St(new xe(null));if(a.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${a.commentBefore}
67
+ ${r.key.commentBefore}`:a.commentBefore),a.comment){const u=r.value??r.key;u.comment=u.comment?`${a.comment}
68
+ ${u.comment}`:a.comment}a=r}t.items[s]=Ie(a)?a:new St(a)}}else i("Expected a sequence for this tag");return t}function _b(t,i,s){const{replacer:a}=s,r=new Vi(t);r.tag="tag:yaml.org,2002:pairs";let u=0;if(i&&Symbol.iterator in Object(i))for(let c of i){typeof a=="function"&&(c=a.call(i,String(u++),c));let m,h;if(Array.isArray(c))if(c.length===2)m=c[0],h=c[1];else throw new TypeError(`Expected [key, value] tuple: ${c}`);else if(c&&c instanceof Object){const g=Object.keys(c);if(g.length===1)m=g[0],h=c[m];else throw new TypeError(`Expected tuple with one key, not ${g.length} keys`)}else m=c;r.items.push(Uh(m,h,s))}return r}const Gh={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Eb,createNode:_b};class Cl extends Vi{constructor(){super(),this.add=Zt.prototype.add.bind(this),this.delete=Zt.prototype.delete.bind(this),this.get=Zt.prototype.get.bind(this),this.has=Zt.prototype.has.bind(this),this.set=Zt.prototype.set.bind(this),this.tag=Cl.tag}toJSON(i,s){if(!s)return super.toJSON(i);const a=new Map;s?.onCreate&&s.onCreate(a);for(const r of this.items){let u,c;if(Ie(r)?(u=un(r.key,"",s),c=un(r.value,u,s)):u=un(r,"",s),a.has(u))throw new Error("Ordered maps must not include duplicate keys");a.set(u,c)}return a}static from(i,s,a){const r=_b(i,s,a),u=new this;return u.items=r.items,u}}Cl.tag="tag:yaml.org,2002:omap";const Xh={collection:"seq",identify:t=>t instanceof Map,nodeClass:Cl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,i){const s=Eb(t,i),a=[];for(const{key:r}of s.items)Ye(r)&&(a.includes(r.value)?i(`Ordered maps must not include duplicate keys: ${r.value}`):a.push(r.value));return Object.assign(new Cl,s)},createNode:(t,i,s)=>Cl.from(t,i,s)};function Nb({value:t,source:i},s){return i&&(t?Ab:Tb).test.test(i)?i:t?s.options.trueStr:s.options.falseStr}const Ab={identify:t=>t===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new xe(!0),stringify:Nb},Tb={identify:t=>t===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new xe(!1),stringify:Nb},GM={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:t=>t.slice(-3).toLowerCase()==="nan"?NaN:t[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:xn},XM={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:t=>parseFloat(t.replace(/_/g,"")),stringify(t){const i=Number(t.value);return isFinite(i)?i.toExponential():xn(t)}},KM={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(t){const i=new xe(parseFloat(t.replace(/_/g,""))),s=t.indexOf(".");if(s!==-1){const a=t.substring(s+1).replace(/_/g,"");a[a.length-1]==="0"&&(i.minFractionDigits=a.length)}return i},stringify:xn},Ao=t=>typeof t=="bigint"||Number.isInteger(t);function ec(t,i,s,{intAsBigInt:a}){const r=t[0];if((r==="-"||r==="+")&&(i+=1),t=t.substring(i).replace(/_/g,""),a){switch(s){case 2:t=`0b${t}`;break;case 8:t=`0o${t}`;break;case 16:t=`0x${t}`;break}const c=BigInt(t);return r==="-"?BigInt(-1)*c:c}const u=parseInt(t,s);return r==="-"?-1*u:u}function Kh(t,i,s){const{value:a}=t;if(Ao(a)){const r=a.toString(i);return a<0?"-"+s+r.substr(1):s+r}return xn(t)}const ZM={identify:Ao,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,i,s)=>ec(t,2,2,s),stringify:t=>Kh(t,2,"0b")},QM={identify:Ao,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,i,s)=>ec(t,1,8,s),stringify:t=>Kh(t,8,"0")},IM={identify:Ao,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,i,s)=>ec(t,0,10,s),stringify:xn},JM={identify:Ao,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,i,s)=>ec(t,2,16,s),stringify:t=>Kh(t,16,"0x")};class Ol extends Zt{constructor(i){super(i),this.tag=Ol.tag}add(i){let s;Ie(i)?s=i:i&&typeof i=="object"&&"key"in i&&"value"in i&&i.value===null?s=new St(i.key,null):s=new St(i,null),gs(this.items,s.key)||this.items.push(s)}get(i,s){const a=gs(this.items,i);return!s&&Ie(a)?Ye(a.key)?a.key.value:a.key:a}set(i,s){if(typeof s!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof s}`);const a=gs(this.items,i);a&&!s?this.items.splice(this.items.indexOf(a),1):!a&&s&&this.items.push(new St(i))}toJSON(i,s){return super.toJSON(i,s,Set)}toString(i,s,a){if(!i)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},i,{allNullValues:!0}),s,a);throw new Error("Set items must all have null values")}static from(i,s,a){const{replacer:r}=a,u=new this(i);if(s&&Symbol.iterator in Object(s))for(let c of s)typeof r=="function"&&(c=r.call(s,c,c)),u.items.push(Uh(c,null,a));return u}}Ol.tag="tag:yaml.org,2002:set";const Zh={collection:"map",identify:t=>t instanceof Set,nodeClass:Ol,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,i,s)=>Ol.from(t,i,s),resolve(t,i){if(Yl(t)){if(t.hasAllNullValues(!0))return Object.assign(new Ol,t);i("Set items must all have null values")}else i("Expected a mapping for this tag");return t}};function Qh(t,i){const s=t[0],a=s==="-"||s==="+"?t.substring(1):t,r=c=>i?BigInt(c):Number(c),u=a.replace(/_/g,"").split(":").reduce((c,m)=>c*r(60)+r(m),r(0));return s==="-"?r(-1)*u:u}function Mb(t){let{value:i}=t,s=c=>c;if(typeof i=="bigint")s=c=>BigInt(c);else if(isNaN(i)||!isFinite(i))return xn(t);let a="";i<0&&(a="-",i*=s(-1));const r=s(60),u=[i%r];return i<60?u.unshift(0):(i=(i-u[0])/r,u.unshift(i%r),i>=60&&(i=(i-u[0])/r,u.unshift(i))),a+u.map(c=>String(c).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Cb={identify:t=>typeof t=="bigint"||Number.isInteger(t),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(t,i,{intAsBigInt:s})=>Qh(t,s),stringify:Mb},Ob={identify:t=>typeof t=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:t=>Qh(t,!1),stringify:Mb},tc={identify:t=>t instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(t){const i=t.match(tc.test);if(!i)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,r,u,c,m]=i.map(Number),h=i[7]?Number((i[7]+"00").substr(1,3)):0;let g=Date.UTC(s,a-1,r,u||0,c||0,m||0,h);const v=i[8];if(v&&v!=="Z"){let p=Qh(v,!1);Math.abs(p)<30&&(p*=60),g-=6e4*p}return new Date(g)},stringify:({value:t})=>t?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},tv=[Xl,Kl,Fu,Wu,Ab,Tb,ZM,QM,IM,JM,GM,XM,KM,Yh,si,Xh,Gh,Zh,Cb,Ob,tc],nv=new Map([["core",UM],["failsafe",[Xl,Kl,Fu]],["json",YM],["yaml11",tv],["yaml-1.1",tv]]),iv={binary:Yh,bool:qh,float:vb,floatExp:yb,floatNaN:pb,floatTime:Ob,int:wb,intHex:xb,intOct:Sb,intTime:Cb,map:Xl,merge:si,null:Wu,omap:Xh,pairs:Gh,seq:Kl,set:Zh,timestamp:tc},FM={"tag:yaml.org,2002:binary":Yh,"tag:yaml.org,2002:merge":si,"tag:yaml.org,2002:omap":Xh,"tag:yaml.org,2002:pairs":Gh,"tag:yaml.org,2002:set":Zh,"tag:yaml.org,2002:timestamp":tc};function Xd(t,i,s){const a=nv.get(i);if(a&&!t)return s&&!a.includes(si)?a.concat(si):a.slice();let r=a;if(!r)if(Array.isArray(t))r=[];else{const u=Array.from(nv.keys()).filter(c=>c!=="yaml11").map(c=>JSON.stringify(c)).join(", ");throw new Error(`Unknown schema "${i}"; use one of ${u} or define customTags array`)}if(Array.isArray(t))for(const u of t)r=r.concat(u);else typeof t=="function"&&(r=t(r.slice()));return s&&(r=r.concat(si)),r.reduce((u,c)=>{const m=typeof c=="string"?iv[c]:c;if(!m){const h=JSON.stringify(c),g=Object.keys(iv).map(v=>JSON.stringify(v)).join(", ");throw new Error(`Unknown custom tag ${h}; use one of ${g}`)}return u.includes(m)||u.push(m),u},[])}const WM=(t,i)=>t.key<i.key?-1:t.key>i.key?1:0;class nc{constructor({compat:i,customTags:s,merge:a,resolveKnownTags:r,schema:u,sortMapEntries:c,toStringDefaults:m}){this.compat=Array.isArray(i)?Xd(i,"compat"):i?Xd(null,i):null,this.name=typeof u=="string"&&u||"core",this.knownTags=r?FM:{},this.tags=Xd(s,this.name,a),this.toStringOptions=m??null,Object.defineProperty(this,qi,{value:Xl}),Object.defineProperty(this,Dn,{value:Fu}),Object.defineProperty(this,Vl,{value:Kl}),this.sortMapEntries=typeof c=="function"?c:c===!0?WM:null}clone(){const i=Object.create(nc.prototype,Object.getOwnPropertyDescriptors(this));return i.tags=this.tags.slice(),i}}function PM(t,i){const s=[];let a=i.directives===!0;if(i.directives!==!1&&t.directives){const h=t.directives.toString(t);h?(s.push(h),a=!0):t.directives.docStart&&(a=!0)}a&&s.push("---");const r=cb(t,i),{commentString:u}=r.options;if(t.commentBefore){s.length!==1&&s.unshift("");const h=u(t.commentBefore);s.unshift(ii(h,""))}let c=!1,m=null;if(t.contents){if(We(t.contents)){if(t.contents.spaceBefore&&a&&s.push(""),t.contents.commentBefore){const v=u(t.contents.commentBefore);s.push(ii(v,""))}r.forceBlockIndent=!!t.comment,m=t.contents.comment}const h=m?void 0:()=>c=!0;let g=$l(t.contents,r,()=>m=null,h);m&&(g+=ms(g,"",u(m))),(g[0]==="|"||g[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${g}`:s.push(g)}else s.push($l(t.contents,r));if(t.directives?.docEnd)if(t.comment){const h=u(t.comment);h.includes(`
69
+ `)?(s.push("..."),s.push(ii(h,""))):s.push(`... ${h}`)}else s.push("...");else{let h=t.comment;h&&c&&(h=h.replace(/^\n+/,"")),h&&((!c||m)&&s[s.length-1]!==""&&s.push(""),s.push(ii(u(h),"")))}return s.join(`
70
+ `)+`
71
+ `}class Zl{constructor(i,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,cn,{value:hh});let r=null;typeof s=="function"||Array.isArray(s)?r=s:a===void 0&&s&&(a=s,s=void 0);const u=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},a);this.options=u;let{version:c}=u;a?._directives?(this.directives=a._directives.atDocument(),this.directives.yaml.explicit&&(c=this.directives.yaml.version)):this.directives=new _t({version:c}),this.setSchema(c,a),this.contents=i===void 0?null:this.createNode(i,r,a)}clone(){const i=Object.create(Zl.prototype,{[cn]:{value:hh}});return i.commentBefore=this.commentBefore,i.comment=this.comment,i.errors=this.errors.slice(),i.warnings=this.warnings.slice(),i.options=Object.assign({},this.options),this.directives&&(i.directives=this.directives.clone()),i.schema=this.schema.clone(),i.contents=We(this.contents)?this.contents.clone(i.schema):this.contents,this.range&&(i.range=this.range.slice()),i}add(i){yl(this.contents)&&this.contents.add(i)}addIn(i,s){yl(this.contents)&&this.contents.addIn(i,s)}createAlias(i,s){if(!i.anchor){const a=lb(this);i.anchor=!s||a.has(s)?ab(s||"a",a):s}return new Zu(i.anchor)}createNode(i,s,a){let r;if(typeof s=="function")i=s.call({"":i},"",i),r=s;else if(Array.isArray(s)){const _=O=>typeof O=="number"||O instanceof String||O instanceof Number,E=s.filter(_).map(String);E.length>0&&(s=s.concat(E)),r=s}else a===void 0&&s&&(a=s,s=void 0);const{aliasDuplicateObjects:u,anchorPrefix:c,flow:m,keepUndefined:h,onTagObj:g,tag:v}=a??{},{onAnchor:p,setAnchors:y,sourceObjects:w}=TM(this,c||"a"),x={aliasDuplicateObjects:u??!0,keepUndefined:h??!1,onAnchor:p,onTagObj:g,replacer:r,schema:this.schema,sourceObjects:w},S=go(i,v,x);return m&&Fe(S)&&(S.flow=!0),y(),S}createPair(i,s,a={}){const r=this.createNode(i,null,a),u=this.createNode(s,null,a);return new St(r,u)}delete(i){return yl(this.contents)?this.contents.delete(i):!1}deleteIn(i){return Pa(i)?this.contents==null?!1:(this.contents=null,!0):yl(this.contents)?this.contents.deleteIn(i):!1}get(i,s){return Fe(this.contents)?this.contents.get(i,s):void 0}getIn(i,s){return Pa(i)?!s&&Ye(this.contents)?this.contents.value:this.contents:Fe(this.contents)?this.contents.getIn(i,s):void 0}has(i){return Fe(this.contents)?this.contents.has(i):!1}hasIn(i){return Pa(i)?this.contents!==void 0:Fe(this.contents)?this.contents.hasIn(i):!1}set(i,s){this.contents==null?this.contents=Cu(this.schema,[i],s):yl(this.contents)&&this.contents.set(i,s)}setIn(i,s){Pa(i)?this.contents=s:this.contents==null?this.contents=Cu(this.schema,Array.from(i),s):yl(this.contents)&&this.contents.setIn(i,s)}setSchema(i,s={}){typeof i=="number"&&(i=String(i));let a;switch(i){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new _t({version:"1.1"}),a={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=i:this.directives=new _t({version:i}),a={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,a=null;break;default:{const r=JSON.stringify(i);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(a)this.schema=new nc(Object.assign(a,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:i,jsonArg:s,mapAsMap:a,maxAliasCount:r,onAnchor:u,reviver:c}={}){const m={anchors:new Map,doc:this,keep:!i,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},h=un(this.contents,s??"",m);if(typeof u=="function")for(const{count:g,res:v}of m.anchors.values())u(v,g);return typeof c=="function"?Nl(c,{"":h},"",h):h}toJSON(i,s){return this.toJS({json:!0,jsonArg:i,mapAsMap:!1,onAnchor:s})}toString(i={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in i&&(!Number.isInteger(i.indent)||Number(i.indent)<=0)){const s=JSON.stringify(i.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return PM(this,i)}}function yl(t){if(Fe(t))return!0;throw new Error("Expected a YAML collection as document contents")}class Ih extends Error{constructor(i,s,a,r){super(),this.name=i,this.code=a,this.message=r,this.pos=s}}class ps extends Ih{constructor(i,s,a){super("YAMLParseError",i,s,a)}}class zb extends Ih{constructor(i,s,a){super("YAMLWarning",i,s,a)}}const zu=(t,i)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(m=>i.linePos(m));const{line:a,col:r}=s.linePos[0];s.message+=` at line ${a}, column ${r}`;let u=r-1,c=t.substring(i.lineStarts[a-1],i.lineStarts[a]).replace(/[\n\r]+$/,"");if(u>=60&&c.length>80){const m=Math.min(u-39,c.length-79);c="…"+c.substring(m),u-=m-1}if(c.length>80&&(c=c.substring(0,79)+"…"),a>1&&/^ *$/.test(c.substring(0,u))){let m=t.substring(i.lineStarts[a-2],i.lineStarts[a-1]);m.length>80&&(m=m.substring(0,79)+`…
72
+ `),c=m+c}if(/[^ ]/.test(c)){let m=1;const h=s.linePos[1];h?.line===a&&h.col>r&&(m=Math.max(1,Math.min(h.col-r,80-u)));const g=" ".repeat(u)+"^".repeat(m);s.message+=`:
73
+
74
+ ${c}
75
+ ${g}
76
+ `}};function Ul(t,{flow:i,indicator:s,next:a,offset:r,onError:u,parentIndent:c,startOnNewline:m}){let h=!1,g=m,v=m,p="",y="",w=!1,x=!1,S=null,_=null,E=null,O=null,N=null,M=null,k=null;for(const j of t)switch(x&&(j.type!=="space"&&j.type!=="newline"&&j.type!=="comma"&&u(j.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),x=!1),S&&(g&&j.type!=="comment"&&j.type!=="newline"&&u(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),S=null),j.type){case"space":!i&&(s!=="doc-start"||a?.type!=="flow-collection")&&j.source.includes(" ")&&(S=j),v=!0;break;case"comment":{v||u(j,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const Y=j.source.substring(1)||" ";p?p+=y+Y:p=Y,y="",g=!1;break}case"newline":g?p?p+=j.source:(!M||s!=="seq-item-ind")&&(h=!0):y+=j.source,g=!0,w=!0,(_||E)&&(O=j),v=!0;break;case"anchor":_&&u(j,"MULTIPLE_ANCHORS","A node can have at most one anchor"),j.source.endsWith(":")&&u(j.offset+j.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),_=j,k??(k=j.offset),g=!1,v=!1,x=!0;break;case"tag":{E&&u(j,"MULTIPLE_TAGS","A node can have at most one tag"),E=j,k??(k=j.offset),g=!1,v=!1,x=!0;break}case s:(_||E)&&u(j,"BAD_PROP_ORDER",`Anchors and tags must be after the ${j.source} indicator`),M&&u(j,"UNEXPECTED_TOKEN",`Unexpected ${j.source} in ${i??"collection"}`),M=j,g=s==="seq-item-ind"||s==="explicit-key-ind",v=!1;break;case"comma":if(i){N&&u(j,"UNEXPECTED_TOKEN",`Unexpected , in ${i}`),N=j,g=!1,v=!1;break}default:u(j,"UNEXPECTED_TOKEN",`Unexpected ${j.type} token`),g=!1,v=!1}const L=t[t.length-1],H=L?L.offset+L.source.length:r;return x&&a&&a.type!=="space"&&a.type!=="newline"&&a.type!=="comma"&&(a.type!=="scalar"||a.source!=="")&&u(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),S&&(g&&S.indent<=c||a?.type==="block-map"||a?.type==="block-seq")&&u(S,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:N,found:M,spaceBefore:h,comment:p,hasNewline:w,anchor:_,tag:E,newlineAfterProp:O,end:H,start:k??H}}function po(t){if(!t)return null;switch(t.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(t.source.includes(`
77
+ `))return!0;if(t.end){for(const i of t.end)if(i.type==="newline")return!0}return!1;case"flow-collection":for(const i of t.items){for(const s of i.start)if(s.type==="newline")return!0;if(i.sep){for(const s of i.sep)if(s.type==="newline")return!0}if(po(i.key)||po(i.value))return!0}return!1;default:return!0}}function yh(t,i,s){if(i?.type==="flow-collection"){const a=i.end[0];a.indent===t&&(a.source==="]"||a.source==="}")&&po(i)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Db(t,i,s){const{uniqueKeys:a}=t.options;if(a===!1)return!1;const r=typeof a=="function"?a:(u,c)=>u===c||Ye(u)&&Ye(c)&&u.value===c.value;return i.some(u=>r(u.key,s))}const sv="All mapping items must start at the same column";function eC({composeNode:t,composeEmptyNode:i},s,a,r,u){const c=u?.nodeClass??Zt,m=new c(s.schema);s.atRoot&&(s.atRoot=!1);let h=a.offset,g=null;for(const v of a.items){const{start:p,key:y,sep:w,value:x}=v,S=Ul(p,{indicator:"explicit-key-ind",next:y??w?.[0],offset:h,onError:r,parentIndent:a.indent,startOnNewline:!0}),_=!S.found;if(_){if(y&&(y.type==="block-seq"?r(h,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==a.indent&&r(h,"BAD_INDENT",sv)),!S.anchor&&!S.tag&&!w){g=S.end,S.comment&&(m.comment?m.comment+=`
78
+ `+S.comment:m.comment=S.comment);continue}(S.newlineAfterProp||po(y))&&r(y??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else S.found?.indent!==a.indent&&r(h,"BAD_INDENT",sv);s.atKey=!0;const E=S.end,O=y?t(s,y,S,r):i(s,E,p,null,S,r);s.schema.compat&&yh(a.indent,y,r),s.atKey=!1,Db(s,m.items,O)&&r(E,"DUPLICATE_KEY","Map keys must be unique");const N=Ul(w??[],{indicator:"map-value-ind",next:x,offset:O.range[2],onError:r,parentIndent:a.indent,startOnNewline:!y||y.type==="block-scalar"});if(h=N.end,N.found){_&&(x?.type==="block-map"&&!N.hasNewline&&r(h,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&S.start<N.found.offset-1024&&r(O.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const M=x?t(s,x,N,r):i(s,h,w,null,N,r);s.schema.compat&&yh(a.indent,x,r),h=M.range[2];const k=new St(O,M);s.options.keepSourceTokens&&(k.srcToken=v),m.items.push(k)}else{_&&r(O.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),N.comment&&(O.comment?O.comment+=`
79
+ `+N.comment:O.comment=N.comment);const M=new St(O);s.options.keepSourceTokens&&(M.srcToken=v),m.items.push(M)}}return g&&g<h&&r(g,"IMPOSSIBLE","Map comment with trailing content"),m.range=[a.offset,h,g??h],m}function tC({composeNode:t,composeEmptyNode:i},s,a,r,u){const c=u?.nodeClass??Vi,m=new c(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let h=a.offset,g=null;for(const{start:v,value:p}of a.items){const y=Ul(v,{indicator:"seq-item-ind",next:p,offset:h,onError:r,parentIndent:a.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||p)p?.type==="block-seq"?r(y.end,"BAD_INDENT","All sequence items must start at the same column"):r(h,"MISSING_CHAR","Sequence item without - indicator");else{g=y.end,y.comment&&(m.comment=y.comment);continue}const w=p?t(s,p,y,r):i(s,y.end,v,null,y,r);s.schema.compat&&yh(a.indent,p,r),h=w.range[2],m.items.push(w)}return m.range=[a.offset,h,g??h],m}function To(t,i,s,a){let r="";if(t){let u=!1,c="";for(const m of t){const{source:h,type:g}=m;switch(g){case"space":u=!0;break;case"comment":{s&&!u&&a(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const v=h.substring(1)||" ";r?r+=c+v:r=v,c="";break}case"newline":r&&(c+=h),u=!0;break;default:a(m,"UNEXPECTED_TOKEN",`Unexpected ${g} at node end`)}i+=h.length}}return{comment:r,offset:i}}const Kd="Block collections are not allowed within flow collections",Zd=t=>t&&(t.type==="block-map"||t.type==="block-seq");function nC({composeNode:t,composeEmptyNode:i},s,a,r,u){const c=a.start.source==="{",m=c?"flow map":"flow sequence",h=u?.nodeClass??(c?Zt:Vi),g=new h(s.schema);g.flow=!0;const v=s.atRoot;v&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let p=a.offset+a.start.source.length;for(let _=0;_<a.items.length;++_){const E=a.items[_],{start:O,key:N,sep:M,value:k}=E,L=Ul(O,{flow:m,indicator:"explicit-key-ind",next:N??M?.[0],offset:p,onError:r,parentIndent:a.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!M&&!k){_===0&&L.comma?r(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`):_<a.items.length-1&&r(L.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${m}`),L.comment&&(g.comment?g.comment+=`
80
+ `+L.comment:g.comment=L.comment),p=L.end;continue}!c&&s.options.strict&&po(N)&&r(N,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(_===0)L.comma&&r(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`);else if(L.comma||r(L.start,"MISSING_CHAR",`Missing , between ${m} items`),L.comment){let H="";e:for(const j of O)switch(j.type){case"comma":case"space":break;case"comment":H=j.source.substring(1);break e;default:break e}if(H){let j=g.items[g.items.length-1];Ie(j)&&(j=j.value??j.key),j.comment?j.comment+=`
81
+ `+H:j.comment=H,L.comment=L.comment.substring(H.length+1)}}if(!c&&!M&&!L.found){const H=k?t(s,k,L,r):i(s,L.end,M,null,L,r);g.items.push(H),p=H.range[2],Zd(k)&&r(H.range,"BLOCK_IN_FLOW",Kd)}else{s.atKey=!0;const H=L.end,j=N?t(s,N,L,r):i(s,H,O,null,L,r);Zd(N)&&r(j.range,"BLOCK_IN_FLOW",Kd),s.atKey=!1;const Y=Ul(M??[],{flow:m,indicator:"map-value-ind",next:k,offset:j.range[2],onError:r,parentIndent:a.indent,startOnNewline:!1});if(Y.found){if(!c&&!L.found&&s.options.strict){if(M)for(const I of M){if(I===Y.found)break;if(I.type==="newline"){r(I,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.start<Y.found.offset-1024&&r(Y.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else k&&("source"in k&&k.source?.[0]===":"?r(k,"MISSING_CHAR",`Missing space after : in ${m}`):r(Y.start,"MISSING_CHAR",`Missing , or : between ${m} items`));const oe=k?t(s,k,Y,r):Y.found?i(s,Y.end,M,null,Y,r):null;oe?Zd(k)&&r(oe.range,"BLOCK_IN_FLOW",Kd):Y.comment&&(j.comment?j.comment+=`
82
+ `+Y.comment:j.comment=Y.comment);const K=new St(j,oe);if(s.options.keepSourceTokens&&(K.srcToken=E),c){const I=g;Db(s,I.items,j)&&r(H,"DUPLICATE_KEY","Map keys must be unique"),I.items.push(K)}else{const I=new Zt(s.schema);I.flow=!0,I.items.push(K);const ae=(oe??j).range;I.range=[j.range[0],ae[1],ae[2]],g.items.push(I)}p=oe?oe.range[2]:Y.end}}const y=c?"}":"]",[w,...x]=a.end;let S=p;if(w?.source===y)S=w.offset+w.source.length;else{const _=m[0].toUpperCase()+m.substring(1),E=v?`${_} must end with a ${y}`:`${_} in block collection must be sufficiently indented and end with a ${y}`;r(p,v?"MISSING_CHAR":"BAD_INDENT",E),w&&w.source.length!==1&&x.unshift(w)}if(x.length>0){const _=To(x,S,s.options.strict,r);_.comment&&(g.comment?g.comment+=`
83
+ `+_.comment:g.comment=_.comment),g.range=[a.offset,S,_.offset]}else g.range=[a.offset,S,S];return g}function Qd(t,i,s,a,r,u){const c=s.type==="block-map"?eC(t,i,s,a,u):s.type==="block-seq"?tC(t,i,s,a,u):nC(t,i,s,a,u),m=c.constructor;return r==="!"||r===m.tagName?(c.tag=m.tagName,c):(r&&(c.tag=r),c)}function iC(t,i,s,a,r){const u=a.tag,c=u?i.directives.tagName(u.source,y=>r(u,"TAG_RESOLVE_FAILED",y)):null;if(s.type==="block-seq"){const{anchor:y,newlineAfterProp:w}=a,x=y&&u?y.offset>u.offset?y:u:y??u;x&&(!w||w.offset<x.offset)&&r(x,"MISSING_CHAR","Missing newline after block sequence props")}const m=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!u||!c||c==="!"||c===Zt.tagName&&m==="map"||c===Vi.tagName&&m==="seq")return Qd(t,i,s,r,c);let h=i.schema.tags.find(y=>y.tag===c&&y.collection===m);if(!h){const y=i.schema.knownTags[c];if(y?.collection===m)i.schema.tags.push(Object.assign({},y,{default:!1})),h=y;else return y?r(u,"BAD_COLLECTION_TYPE",`${y.tag} used for ${m} collection, but expects ${y.collection??"scalar"}`,!0):r(u,"TAG_RESOLVE_FAILED",`Unresolved tag: ${c}`,!0),Qd(t,i,s,r,c)}const g=Qd(t,i,s,r,c,h),v=h.resolve?.(g,y=>r(u,"TAG_RESOLVE_FAILED",y),i.options)??g,p=We(v)?v:new xe(v);return p.range=g.range,p.tag=c,h?.format&&(p.format=h.format),p}function Lb(t,i,s){const a=i.offset,r=sC(i,t.options.strict,s);if(!r)return{value:"",type:null,comment:"",range:[a,a,a]};const u=r.mode===">"?xe.BLOCK_FOLDED:xe.BLOCK_LITERAL,c=i.source?lC(i.source):[];let m=c.length;for(let S=c.length-1;S>=0;--S){const _=c[S][1];if(_===""||_==="\r")m=S;else break}if(m===0){const S=r.chomp==="+"&&c.length>0?`
84
+ `.repeat(Math.max(1,c.length-1)):"";let _=a+r.length;return i.source&&(_+=i.source.length),{value:S,type:u,comment:r.comment,range:[a,_,_]}}let h=i.indent+r.indent,g=i.offset+r.length,v=0;for(let S=0;S<m;++S){const[_,E]=c[S];if(E===""||E==="\r")r.indent===0&&_.length>h&&(h=_.length);else{_.length<h&&s(g+_.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(h=_.length),v=S,h===0&&!t.atRoot&&s(g,"BAD_INDENT","Block scalar values in collections must be indented");break}g+=_.length+E.length+1}for(let S=c.length-1;S>=m;--S)c[S][0].length>h&&(m=S+1);let p="",y="",w=!1;for(let S=0;S<v;++S)p+=c[S][0].slice(h)+`
85
+ `;for(let S=v;S<m;++S){let[_,E]=c[S];g+=_.length+E.length+1;const O=E[E.length-1]==="\r";if(O&&(E=E.slice(0,-1)),E&&_.length<h){const M=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;s(g-E.length-(O?2:1),"BAD_INDENT",M),_=""}u===xe.BLOCK_LITERAL?(p+=y+_.slice(h)+E,y=`
86
+ `):_.length>h||E[0]===" "?(y===" "?y=`
87
+ `:!w&&y===`
88
+ `&&(y=`
89
+
90
+ `),p+=y+_.slice(h)+E,y=`
91
+ `,w=!0):E===""?y===`
92
+ `?p+=`
93
+ `:y=`
94
+ `:(p+=y+E,y=" ",w=!1)}switch(r.chomp){case"-":break;case"+":for(let S=m;S<c.length;++S)p+=`
95
+ `+c[S][0].slice(h);p[p.length-1]!==`
96
+ `&&(p+=`
97
+ `);break;default:p+=`
98
+ `}const x=a+r.length+i.source.length;return{value:p,type:u,comment:r.comment,range:[a,x,x]}}function sC({offset:t,props:i},s,a){if(i[0].type!=="block-scalar-header")return a(i[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=i[0],u=r[0];let c=0,m="",h=-1;for(let y=1;y<r.length;++y){const w=r[y];if(!m&&(w==="-"||w==="+"))m=w;else{const x=Number(w);!c&&x?c=x:h===-1&&(h=t+y)}}h!==-1&&a(h,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let g=!1,v="",p=r.length;for(let y=1;y<i.length;++y){const w=i[y];switch(w.type){case"space":g=!0;case"newline":p+=w.source.length;break;case"comment":s&&!g&&a(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=w.source.length,v=w.source.substring(1);break;case"error":a(w,"UNEXPECTED_TOKEN",w.message),p+=w.source.length;break;default:{const x=`Unexpected token in block scalar header: ${w.type}`;a(w,"UNEXPECTED_TOKEN",x);const S=w.source;S&&typeof S=="string"&&(p+=S.length)}}}return{mode:u,indent:c,chomp:m,comment:v,length:p}}function lC(t){const i=t.split(/\n( *)/),s=i[0],a=s.match(/^( *)/),u=[a?.[1]?[a[1],s.slice(a[1].length)]:["",s]];for(let c=1;c<i.length;c+=2)u.push([i[c],i[c+1]]);return u}function Rb(t,i,s){const{offset:a,type:r,source:u,end:c}=t;let m,h;const g=(y,w,x)=>s(a+y,w,x);switch(r){case"scalar":m=xe.PLAIN,h=aC(u,g);break;case"single-quoted-scalar":m=xe.QUOTE_SINGLE,h=oC(u,g);break;case"double-quoted-scalar":m=xe.QUOTE_DOUBLE,h=rC(u,g);break;default:return s(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[a,a+u.length,a+u.length]}}const v=a+u.length,p=To(c,v,i,s);return{value:h,type:m,comment:p.comment,range:[a,v,p.offset]}}function aC(t,i){let s="";switch(t[0]){case" ":s="a tab character";break;case",":s="flow indicator character ,";break;case"%":s="directive indicator character %";break;case"|":case">":{s=`block scalar indicator ${t[0]}`;break}case"@":case"`":{s=`reserved character ${t[0]}`;break}}return s&&i(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),Bb(t)}function oC(t,i){return(t[t.length-1]!=="'"||t.length===1)&&i(t.length,"MISSING_CHAR","Missing closing 'quote"),Bb(t.slice(1,-1)).replace(/''/g,"'")}function Bb(t){let i,s;try{i=new RegExp(`(.*?)(?<![ ])[ ]*\r?
99
+ `,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
100
+ `,"sy")}catch{i=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let a=i.exec(t);if(!a)return t;let r=a[1],u=" ",c=i.lastIndex;for(s.lastIndex=c;a=s.exec(t);)a[1]===""?u===`
101
+ `?r+=u:u=`
102
+ `:(r+=u+a[1],u=" "),c=s.lastIndex;const m=/[ \t]*(.*)/sy;return m.lastIndex=c,a=m.exec(t),r+u+(a?.[1]??"")}function rC(t,i){let s="";for(let a=1;a<t.length-1;++a){const r=t[a];if(!(r==="\r"&&t[a+1]===`
103
+ `))if(r===`
104
+ `){const{fold:u,offset:c}=uC(t,a);s+=u,a=c}else if(r==="\\"){let u=t[++a];const c=cC[u];if(c)s+=c;else if(u===`
105
+ `)for(u=t[a+1];u===" "||u===" ";)u=t[++a+1];else if(u==="\r"&&t[a+1]===`
106
+ `)for(u=t[++a+1];u===" "||u===" ";)u=t[++a+1];else if(u==="x"||u==="u"||u==="U"){const m=u==="x"?2:u==="u"?4:8;s+=fC(t,a+1,m,i),a+=m}else{const m=t.substr(a-1,2);i(a-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${m}`),s+=m}}else if(r===" "||r===" "){const u=a;let c=t[a+1];for(;c===" "||c===" ";)c=t[++a+1];c!==`
107
+ `&&!(c==="\r"&&t[a+2]===`
108
+ `)&&(s+=a>u?t.slice(u,a+1):r)}else s+=r}return(t[t.length-1]!=='"'||t.length===1)&&i(t.length,"MISSING_CHAR",'Missing closing "quote'),s}function uC(t,i){let s="",a=t[i+1];for(;(a===" "||a===" "||a===`
109
+ `||a==="\r")&&!(a==="\r"&&t[i+2]!==`
110
+ `);)a===`
111
+ `&&(s+=`
112
+ `),i+=1,a=t[i+1];return s||(s=" "),{fold:s,offset:i}}const cC={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
113
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function fC(t,i,s,a){const r=t.substr(i,s),c=r.length===s&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(c)}catch{const m=t.substr(i-2,s+2);return a(i-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${m}`),m}}function kb(t,i,s,a){const{value:r,type:u,comment:c,range:m}=i.type==="block-scalar"?Lb(t,i,a):Rb(i,t.options.strict,a),h=s?t.directives.tagName(s.source,p=>a(s,"TAG_RESOLVE_FAILED",p)):null;let g;t.options.stringKeys&&t.atKey?g=t.schema[Dn]:h?g=dC(t.schema,r,h,s,a):i.type==="scalar"?g=hC(t,r,i,a):g=t.schema[Dn];let v;try{const p=g.resolve(r,y=>a(s??i,"TAG_RESOLVE_FAILED",y),t.options);v=Ye(p)?p:new xe(p)}catch(p){const y=p instanceof Error?p.message:String(p);a(s??i,"TAG_RESOLVE_FAILED",y),v=new xe(r)}return v.range=m,v.source=r,u&&(v.type=u),h&&(v.tag=h),g.format&&(v.format=g.format),c&&(v.comment=c),v}function dC(t,i,s,a,r){if(s==="!")return t[Dn];const u=[];for(const m of t.tags)if(!m.collection&&m.tag===s)if(m.default&&m.test)u.push(m);else return m;for(const m of u)if(m.test?.test(i))return m;const c=t.knownTags[s];return c&&!c.collection?(t.tags.push(Object.assign({},c,{default:!1,test:void 0})),c):(r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),t[Dn])}function hC({atKey:t,directives:i,schema:s},a,r,u){const c=s.tags.find(m=>(m.default===!0||t&&m.default==="key")&&m.test?.test(a))||s[Dn];if(s.compat){const m=s.compat.find(h=>h.default&&h.test?.test(a))??s[Dn];if(c.tag!==m.tag){const h=i.tagString(c.tag),g=i.tagString(m.tag),v=`Value may be parsed as either ${h} or ${g}`;u(r,"TAG_RESOLVE_FAILED",v,!0)}}return c}function mC(t,i,s){if(i){s??(s=i.length);for(let a=s-1;a>=0;--a){let r=i[a];switch(r.type){case"space":case"comment":case"newline":t-=r.source.length;continue}for(r=i[++a];r?.type==="space";)t+=r.source.length,r=i[++a];break}}return t}const gC={composeNode:Hb,composeEmptyNode:Jh};function Hb(t,i,s,a){const r=t.atKey,{spaceBefore:u,comment:c,anchor:m,tag:h}=s;let g,v=!0;switch(i.type){case"alias":g=pC(t,i,a),(m||h)&&a(i,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":g=kb(t,i,h,a),m&&(g.anchor=m.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{g=iC(gC,t,i,s,a),m&&(g.anchor=m.source.substring(1))}catch(p){const y=p instanceof Error?p.message:String(p);a(i,"RESOURCE_EXHAUSTION",y)}break;default:{const p=i.type==="error"?i.message:`Unsupported token (type: ${i.type})`;a(i,"UNEXPECTED_TOKEN",p),v=!1}}return g??(g=Jh(t,i.offset,void 0,null,s,a)),m&&g.anchor===""&&a(m,"BAD_ALIAS","Anchor cannot be an empty string"),r&&t.options.stringKeys&&(!Ye(g)||typeof g.value!="string"||g.tag&&g.tag!=="tag:yaml.org,2002:str")&&a(h??i,"NON_STRING_KEY","With stringKeys, all keys must be strings"),u&&(g.spaceBefore=!0),c&&(i.type==="scalar"&&i.source===""?g.comment=c:g.commentBefore=c),t.options.keepSourceTokens&&v&&(g.srcToken=i),g}function Jh(t,i,s,a,{spaceBefore:r,comment:u,anchor:c,tag:m,end:h},g){const v={type:"scalar",offset:mC(i,s,a),indent:-1,source:""},p=kb(t,v,m,g);return c&&(p.anchor=c.source.substring(1),p.anchor===""&&g(c,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(p.spaceBefore=!0),u&&(p.comment=u,p.range[2]=h),p}function pC({options:t},{offset:i,source:s,end:a},r){const u=new Zu(s.substring(1));u.source===""&&r(i,"BAD_ALIAS","Alias cannot be an empty string"),u.source.endsWith(":")&&r(i+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const c=i+s.length,m=To(a,c,t.strict,r);return u.range=[i,c,m.offset],m.comment&&(u.comment=m.comment),u}function yC(t,i,{offset:s,start:a,value:r,end:u},c){const m=Object.assign({_directives:i},t),h=new Zl(void 0,m),g={atKey:!1,atRoot:!0,directives:h.directives,options:h.options,schema:h.schema},v=Ul(a,{indicator:"doc-start",next:r??u?.[0],offset:s,onError:c,parentIndent:0,startOnNewline:!0});v.found&&(h.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!v.hasNewline&&c(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),h.contents=r?Hb(g,r,v,c):Jh(g,v.end,a,null,v,c);const p=h.contents.range[2],y=To(u,p,!1,c);return y.comment&&(h.comment=y.comment),h.range=[s,p,y.offset],h}function Ja(t){if(typeof t=="number")return[t,t+1];if(Array.isArray(t))return t.length===2?t:[t[0],t[1]];const{offset:i,source:s}=t;return[i,i+(typeof s=="string"?s.length:1)]}function lv(t){let i="",s=!1,a=!1;for(let r=0;r<t.length;++r){const u=t[r];switch(u[0]){case"#":i+=(i===""?"":a?`
114
+
115
+ `:`
116
+ `)+(u.substring(1)||" "),s=!0,a=!1;break;case"%":t[r+1]?.[0]!=="#"&&(r+=1),s=!1;break;default:s||(a=!0),s=!1}}return{comment:i,afterEmptyLine:a}}class Fh{constructor(i={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,r,u)=>{const c=Ja(s);u?this.warnings.push(new zb(c,a,r)):this.errors.push(new ps(c,a,r))},this.directives=new _t({version:i.version||"1.2"}),this.options=i}decorate(i,s){const{comment:a,afterEmptyLine:r}=lv(this.prelude);if(a){const u=i.contents;if(s)i.comment=i.comment?`${i.comment}
117
+ ${a}`:a;else if(r||i.directives.docStart||!u)i.commentBefore=a;else if(Fe(u)&&!u.flow&&u.items.length>0){let c=u.items[0];Ie(c)&&(c=c.key);const m=c.commentBefore;c.commentBefore=m?`${a}
118
+ ${m}`:a}else{const c=u.commentBefore;u.commentBefore=c?`${a}
119
+ ${c}`:a}}if(s){for(let u=0;u<this.errors.length;++u)i.errors.push(this.errors[u]);for(let u=0;u<this.warnings.length;++u)i.warnings.push(this.warnings[u])}else i.errors=this.errors,i.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:lv(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(i,s=!1,a=-1){for(const r of i)yield*this.next(r);yield*this.end(s,a)}*next(i){switch(i.type){case"directive":this.directives.add(i.source,(s,a,r)=>{const u=Ja(i);u[0]+=s,this.onError(u,"BAD_DIRECTIVE",a,r)}),this.prelude.push(i.source),this.atDirectives=!0;break;case"document":{const s=yC(this.options,this.directives,i,this.onError);this.atDirectives&&!s.directives.docStart&&this.onError(i,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(s,!1),this.doc&&(yield this.doc),this.doc=s,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(i.source);break;case"error":{const s=i.source?`${i.message}: ${JSON.stringify(i.source)}`:i.message,a=new ps(Ja(i),"UNEXPECTED_TOKEN",s);this.atDirectives||!this.doc?this.errors.push(a):this.doc.errors.push(a);break}case"doc-end":{if(!this.doc){const a="Unexpected doc-end without preceding document";this.errors.push(new ps(Ja(i),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=To(i.end,i.offset+i.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),s.comment){const a=this.doc.comment;this.doc.comment=a?`${a}
120
+ ${s.comment}`:s.comment}this.doc.range[2]=s.offset;break}default:this.errors.push(new ps(Ja(i),"UNEXPECTED_TOKEN",`Unsupported token ${i.type}`))}}*end(i=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(i){const a=Object.assign({_directives:this.directives},this.options),r=new Zl(void 0,a);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,s,s],this.decorate(r,!1),yield r}}}function vC(t,i=!0,s){if(t){const a=(r,u,c)=>{const m=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(s)s(m,u,c);else throw new ps([m,m+1],u,c)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Rb(t,i,a);case"block-scalar":return Lb({options:{strict:i}},t,a)}}return null}function bC(t,i){const{implicitKey:s=!1,indent:a,inFlow:r=!1,offset:u=-1,type:c="PLAIN"}=i,m=No({type:c,value:t},{implicitKey:s,indent:a>0?" ".repeat(a):"",inFlow:r,options:{blockQuote:!0,lineWidth:-1}}),h=i.end??[{type:"newline",offset:-1,indent:a,source:`
121
+ `}];switch(m[0]){case"|":case">":{const g=m.indexOf(`
122
+ `),v=m.substring(0,g),p=m.substring(g+1)+`
123
+ `,y=[{type:"block-scalar-header",offset:u,indent:a,source:v}];return jb(y,h)||y.push({type:"newline",offset:-1,indent:a,source:`
124
+ `}),{type:"block-scalar",offset:u,indent:a,props:y,source:p}}case'"':return{type:"double-quoted-scalar",offset:u,indent:a,source:m,end:h};case"'":return{type:"single-quoted-scalar",offset:u,indent:a,source:m,end:h};default:return{type:"scalar",offset:u,indent:a,source:m,end:h}}}function SC(t,i,s={}){let{afterKey:a=!1,implicitKey:r=!1,inFlow:u=!1,type:c}=s,m="indent"in t?t.indent:null;if(a&&typeof m=="number"&&(m+=2),!c)switch(t.type){case"single-quoted-scalar":c="QUOTE_SINGLE";break;case"double-quoted-scalar":c="QUOTE_DOUBLE";break;case"block-scalar":{const g=t.props[0];if(g.type!=="block-scalar-header")throw new Error("Invalid block scalar header");c=g.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:c="PLAIN"}const h=No({type:c,value:i},{implicitKey:r||m===null,indent:m!==null&&m>0?" ".repeat(m):"",inFlow:u,options:{blockQuote:!0,lineWidth:-1}});switch(h[0]){case"|":case">":wC(t,h);break;case'"':Id(t,h,"double-quoted-scalar");break;case"'":Id(t,h,"single-quoted-scalar");break;default:Id(t,h,"scalar")}}function wC(t,i){const s=i.indexOf(`
125
+ `),a=i.substring(0,s),r=i.substring(s+1)+`
126
+ `;if(t.type==="block-scalar"){const u=t.props[0];if(u.type!=="block-scalar-header")throw new Error("Invalid block scalar header");u.source=a,t.source=r}else{const{offset:u}=t,c="indent"in t?t.indent:-1,m=[{type:"block-scalar-header",offset:u,indent:c,source:a}];jb(m,"end"in t?t.end:void 0)||m.push({type:"newline",offset:-1,indent:c,source:`
127
+ `});for(const h of Object.keys(t))h!=="type"&&h!=="offset"&&delete t[h];Object.assign(t,{type:"block-scalar",indent:c,props:m,source:r})}}function jb(t,i){if(i)for(const s of i)switch(s.type){case"space":case"comment":t.push(s);break;case"newline":return t.push(s),!0}return!1}function Id(t,i,s){switch(t.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":t.type=s,t.source=i;break;case"block-scalar":{const a=t.props.slice(1);let r=i.length;t.props[0].type==="block-scalar-header"&&(r-=t.props[0].source.length);for(const u of a)u.offset+=r;delete t.props,Object.assign(t,{type:s,source:i,end:a});break}case"block-map":case"block-seq":{const r={type:"newline",offset:t.offset+i.length,indent:t.indent,source:`
128
+ `};delete t.items,Object.assign(t,{type:s,source:i,end:[r]});break}default:{const a="indent"in t?t.indent:-1,r="end"in t&&Array.isArray(t.end)?t.end.filter(u=>u.type==="space"||u.type==="comment"||u.type==="newline"):[];for(const u of Object.keys(t))u!=="type"&&u!=="offset"&&delete t[u];Object.assign(t,{type:s,indent:a,source:i,end:r})}}}const xC=t=>"type"in t?Du(t):bu(t);function Du(t){switch(t.type){case"block-scalar":{let i="";for(const s of t.props)i+=Du(s);return i+t.source}case"block-map":case"block-seq":{let i="";for(const s of t.items)i+=bu(s);return i}case"flow-collection":{let i=t.start.source;for(const s of t.items)i+=bu(s);for(const s of t.end)i+=s.source;return i}case"document":{let i=bu(t);if(t.end)for(const s of t.end)i+=s.source;return i}default:{let i=t.source;if("end"in t&&t.end)for(const s of t.end)i+=s.source;return i}}}function bu({start:t,key:i,sep:s,value:a}){let r="";for(const u of t)r+=u.source;if(i&&(r+=Du(i)),s)for(const u of s)r+=u.source;return a&&(r+=Du(a)),r}const vh=Symbol("break visit"),EC=Symbol("skip children"),$b=Symbol("remove item");function _s(t,i){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),Ub(Object.freeze([]),t,i)}_s.BREAK=vh;_s.SKIP=EC;_s.REMOVE=$b;_s.itemAtPath=(t,i)=>{let s=t;for(const[a,r]of i){const u=s?.[a];if(u&&"items"in u)s=u.items[r];else return}return s};_s.parentCollection=(t,i)=>{const s=_s.itemAtPath(t,i.slice(0,-1)),a=i[i.length-1][0],r=s?.[a];if(r&&"items"in r)return r;throw new Error("Parent collection not found")};function Ub(t,i,s){let a=s(i,t);if(typeof a=="symbol")return a;for(const r of["key","value"]){const u=i[r];if(u&&"items"in u){for(let c=0;c<u.items.length;++c){const m=Ub(Object.freeze(t.concat([[r,c]])),u.items[c],s);if(typeof m=="number")c=m-1;else{if(m===vh)return vh;m===$b&&(u.items.splice(c,1),c-=1)}}typeof a=="function"&&r==="key"&&(a=a(i,t))}}return typeof a=="function"?a(i,t):a}const ic="\uFEFF",sc="",lc="",yo="",_C=t=>!!t&&"items"in t,NC=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function AC(t){switch(t){case ic:return"<BOM>";case sc:return"<DOC>";case lc:return"<FLOW_END>";case yo:return"<SCALAR>";default:return JSON.stringify(t)}}function qb(t){switch(t){case ic:return"byte-order-mark";case sc:return"doc-mode";case lc:return"flow-error-end";case yo:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
129
+ `:case`\r
130
+ `:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(t[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const TC=Object.freeze(Object.defineProperty({__proto__:null,BOM:ic,DOCUMENT:sc,FLOW_END:lc,SCALAR:yo,createScalarToken:bC,isCollection:_C,isScalar:NC,prettyToken:AC,resolveAsScalar:vC,setScalarValue:SC,stringify:xC,tokenType:qb,visit:_s},Symbol.toStringTag,{value:"Module"}));function gn(t){switch(t){case void 0:case" ":case`
131
+ `:case"\r":case" ":return!0;default:return!1}}const av=new Set("0123456789ABCDEFabcdef"),MC=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ru=new Set(",[]{}"),CC=new Set(` ,[]{}
132
+ \r `),Jd=t=>!t||CC.has(t);class Vb{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(i,s=!1){if(i){if(typeof i!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+i:i,this.lineEndPos=null}this.atEnd=!s;let a=this.next??"stream";for(;a&&(s||this.hasChars(1));)a=yield*this.parseNext(a)}atLineEnd(){let i=this.pos,s=this.buffer[i];for(;s===" "||s===" ";)s=this.buffer[++i];return!s||s==="#"||s===`
133
+ `?!0:s==="\r"?this.buffer[i+1]===`
134
+ `:!1}charAt(i){return this.buffer[this.pos+i]}continueScalar(i){let s=this.buffer[i];if(this.indentNext>0){let a=0;for(;s===" ";)s=this.buffer[++a+i];if(s==="\r"){const r=this.buffer[a+i+1];if(r===`
135
+ `||!r&&!this.atEnd)return i+a+1}return s===`
136
+ `||a>=this.indentNext||!s&&!this.atEnd?i+a:-1}if(s==="-"||s==="."){const a=this.buffer.substr(i,3);if((a==="---"||a==="...")&&gn(this.buffer[i+3]))return-1}return i}getLine(){let i=this.lineEndPos;return(typeof i!="number"||i!==-1&&i<this.pos)&&(i=this.buffer.indexOf(`
137
+ `,this.pos),this.lineEndPos=i),i===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[i-1]==="\r"&&(i-=1),this.buffer.substring(this.pos,i))}hasChars(i){return this.pos+i<=this.buffer.length}setNext(i){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=i,null}peek(i){return this.buffer.substr(this.pos,i)}*parseNext(i){switch(i){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let i=this.getLine();if(i===null)return this.setNext("stream");if(i[0]===ic&&(yield*this.pushCount(1),i=i.substring(1)),i[0]==="%"){let s=i.length,a=i.indexOf("#");for(;a!==-1;){const u=i[a-1];if(u===" "||u===" "){s=a-1;break}else a=i.indexOf("#",a+1)}for(;;){const u=i[s-1];if(u===" "||u===" ")s-=1;else break}const r=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(i.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const s=yield*this.pushSpaces(!0);return yield*this.pushCount(i.length-s),yield*this.pushNewline(),"stream"}return yield sc,yield*this.parseLineStart()}*parseLineStart(){const i=this.charAt(0);if(!i&&!this.atEnd)return this.setNext("line-start");if(i==="-"||i==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const s=this.peek(3);if((s==="---"||s==="...")&&gn(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,s==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!gn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[i,s]=this.peek(2);if(!s&&!this.atEnd)return this.setNext("block-start");if((i==="-"||i==="?"||i===":")&&gn(s)){const a=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=a,"block-start"}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const i=this.getLine();if(i===null)return this.setNext("doc");let s=yield*this.pushIndicators();switch(i[s]){case"#":yield*this.pushCount(i.length-s);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Jd),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return s+=yield*this.parseBlockScalarHeader(),s+=yield*this.pushSpaces(!0),yield*this.pushCount(i.length-s),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let i,s,a=-1;do i=yield*this.pushNewline(),i>0?(s=yield*this.pushSpaces(!1),this.indentValue=a=s):s=0,s+=yield*this.pushSpaces(!0);while(i+s>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((a!==-1&&a<this.indentNext&&r[0]!=="#"||a===0&&(r.startsWith("---")||r.startsWith("..."))&&gn(r[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield lc,yield*this.parseLineStart();let u=0;for(;r[u]===",";)u+=yield*this.pushCount(1),u+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(u+=yield*this.pushIndicators(),r[u]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-u),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Jd),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const c=this.charAt(1);if(this.flowKey||gn(c)||c===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const i=this.charAt(0);let s=this.buffer.indexOf(i,this.pos+1);if(i==="'")for(;s!==-1&&this.buffer[s+1]==="'";)s=this.buffer.indexOf("'",s+2);else for(;s!==-1;){let u=0;for(;this.buffer[s-1-u]==="\\";)u+=1;if(u%2===0)break;s=this.buffer.indexOf('"',s+1)}const a=this.buffer.substring(0,s);let r=a.indexOf(`
138
+ `,this.pos);if(r!==-1){for(;r!==-1;){const u=this.continueScalar(r+1);if(u===-1)break;r=a.indexOf(`
139
+ `,u)}r!==-1&&(s=r-(a[r-1]==="\r"?2:1))}if(s===-1){if(!this.atEnd)return this.setNext("quoted-scalar");s=this.buffer.length}return yield*this.pushToIndex(s+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let i=this.pos;for(;;){const s=this.buffer[++i];if(s==="+")this.blockScalarKeep=!0;else if(s>"0"&&s<="9")this.blockScalarIndent=Number(s)-1;else if(s!=="-")break}return yield*this.pushUntil(s=>gn(s)||s==="#")}*parseBlockScalar(){let i=this.pos-1,s=0,a;e:for(let u=this.pos;a=this.buffer[u];++u)switch(a){case" ":s+=1;break;case`
140
+ `:i=u,s=0;break;case"\r":{const c=this.buffer[u+1];if(!c&&!this.atEnd)return this.setNext("block-scalar");if(c===`
141
+ `)break}default:break e}if(!a&&!this.atEnd)return this.setNext("block-scalar");if(s>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=s:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const u=this.continueScalar(i+1);if(u===-1)break;i=this.buffer.indexOf(`
142
+ `,u)}while(i!==-1);if(i===-1){if(!this.atEnd)return this.setNext("block-scalar");i=this.buffer.length}}let r=i+1;for(a=this.buffer[r];a===" ";)a=this.buffer[++r];if(a===" "){for(;a===" "||a===" "||a==="\r"||a===`
143
+ `;)a=this.buffer[++r];i=r-1}else if(!this.blockScalarKeep)do{let u=i-1,c=this.buffer[u];c==="\r"&&(c=this.buffer[--u]);const m=u;for(;c===" ";)c=this.buffer[--u];if(c===`
144
+ `&&u>=this.pos&&u+1+s>m)i=u;else break}while(!0);return yield yo,yield*this.pushToIndex(i+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const i=this.flowLevel>0;let s=this.pos-1,a=this.pos-1,r;for(;r=this.buffer[++a];)if(r===":"){const u=this.buffer[a+1];if(gn(u)||i&&ru.has(u))break;s=a}else if(gn(r)){let u=this.buffer[a+1];if(r==="\r"&&(u===`
145
+ `?(a+=1,r=`
146
+ `,u=this.buffer[a+1]):s=a),u==="#"||i&&ru.has(u))break;if(r===`
147
+ `){const c=this.continueScalar(a+1);if(c===-1)break;a=Math.max(a,c-2)}}else{if(i&&ru.has(r))break;s=a}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield yo,yield*this.pushToIndex(s+1,!0),i?"flow":"doc")}*pushCount(i){return i>0?(yield this.buffer.substr(this.pos,i),this.pos+=i,i):0}*pushToIndex(i,s){const a=this.buffer.slice(this.pos,i);return a?(yield a,this.pos+=a.length,a.length):(s&&(yield""),0)}*pushIndicators(){let i=0;e:for(;;){switch(this.charAt(0)){case"!":i+=yield*this.pushTag(),i+=yield*this.pushSpaces(!0);continue e;case"&":i+=yield*this.pushUntil(Jd),i+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const s=this.flowLevel>0,a=this.charAt(1);if(gn(a)||s&&ru.has(a)){s?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,i+=yield*this.pushCount(1),i+=yield*this.pushSpaces(!0);continue e}}}break e}return i}*pushTag(){if(this.charAt(1)==="<"){let i=this.pos+2,s=this.buffer[i];for(;!gn(s)&&s!==">";)s=this.buffer[++i];return yield*this.pushToIndex(s===">"?i+1:i,!1)}else{let i=this.pos+1,s=this.buffer[i];for(;s;)if(MC.has(s))s=this.buffer[++i];else if(s==="%"&&av.has(this.buffer[i+1])&&av.has(this.buffer[i+2]))s=this.buffer[i+=3];else break;return yield*this.pushToIndex(i,!1)}}*pushNewline(){const i=this.buffer[this.pos];return i===`
148
+ `?yield*this.pushCount(1):i==="\r"&&this.charAt(1)===`
149
+ `?yield*this.pushCount(2):0}*pushSpaces(i){let s=this.pos-1,a;do a=this.buffer[++s];while(a===" "||i&&a===" ");const r=s-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=s),r}*pushUntil(i){let s=this.pos,a=this.buffer[s];for(;!i(a);)a=this.buffer[++s];return yield*this.pushToIndex(s,!1)}}class Yb{constructor(){this.lineStarts=[],this.addNewLine=i=>this.lineStarts.push(i),this.linePos=i=>{let s=0,a=this.lineStarts.length;for(;s<a;){const u=s+a>>1;this.lineStarts[u]<i?s=u+1:a=u}if(this.lineStarts[s]===i)return{line:s+1,col:1};if(s===0)return{line:0,col:i};const r=this.lineStarts[s-1];return{line:s,col:i-r+1}}}}function ji(t,i){for(let s=0;s<t.length;++s)if(t[s].type===i)return!0;return!1}function ov(t){for(let i=0;i<t.length;++i)switch(t[i].type){case"space":case"comment":case"newline":break;default:return i}return-1}function Gb(t){switch(t?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function uu(t){switch(t.type){case"document":return t.start;case"block-map":{const i=t.items[t.items.length-1];return i.sep??i.start}case"block-seq":return t.items[t.items.length-1].start;default:return[]}}function vl(t){if(t.length===0)return[];let i=t.length;e:for(;--i>=0;)switch(t[i].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;t[++i]?.type==="space";);return t.splice(i,t.length)}function Lu(t,i){if(i.length<1e5)Array.prototype.push.apply(t,i);else for(let s=0;s<i.length;++s)t.push(i[s])}function rv(t){if(t.start.type==="flow-seq-start")for(const i of t.items)i.sep&&!i.value&&!ji(i.start,"explicit-key-ind")&&!ji(i.sep,"map-value-ind")&&(i.key&&(i.value=i.key),delete i.key,Gb(i.value)?i.value.end?Lu(i.value.end,i.sep):i.value.end=i.sep:Lu(i.start,i.sep),delete i.sep)}class Wh{constructor(i){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Vb,this.onNewLine=i}*parse(i,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const a of this.lexer.lex(i,s))yield*this.next(a);s||(yield*this.end())}*next(i){if(this.source=i,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=i.length;return}const s=qb(i);if(s)if(s==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=s,yield*this.step(),s){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+i.length);break;case"space":this.atNewLine&&i[0]===" "&&(this.indent+=i.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=i.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=i.length}else{const a=`Not a YAML token: ${i}`;yield*this.pop({type:"error",offset:this.offset,message:a,source:i}),this.offset+=i.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const i=this.peek(1);if(this.type==="doc-end"&&i?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!i)return yield*this.stream();switch(i.type){case"document":return yield*this.document(i);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(i);case"block-scalar":return yield*this.blockScalar(i);case"block-map":return yield*this.blockMap(i);case"block-seq":return yield*this.blockSequence(i);case"flow-collection":return yield*this.flowCollection(i);case"doc-end":return yield*this.documentEnd(i)}yield*this.pop()}peek(i){return this.stack[this.stack.length-i]}*pop(i){const s=i??this.stack.pop();if(!s)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield s;else{const a=this.peek(1);switch(s.type==="block-scalar"?s.indent="indent"in a?a.indent:0:s.type==="flow-collection"&&a.type==="document"&&(s.indent=0),s.type==="flow-collection"&&rv(s),a.type){case"document":a.value=s;break;case"block-scalar":a.props.push(s);break;case"block-map":{const r=a.items[a.items.length-1];if(r.value){a.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=s;else{Object.assign(r,{key:s,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=a.items[a.items.length-1];r.value?a.items.push({start:[],value:s}):r.value=s;break}case"flow-collection":{const r=a.items[a.items.length-1];!r||r.value?a.items.push({start:[],key:s,sep:[]}):r.sep?r.value=s:Object.assign(r,{key:s,sep:[]});return}default:yield*this.pop(),yield*this.pop(s)}if((a.type==="document"||a.type==="block-map"||a.type==="block-seq")&&(s.type==="block-map"||s.type==="block-seq")){const r=s.items[s.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&ov(r.start)===-1&&(s.indent===0||r.start.every(u=>u.type!=="comment"||u.indent<s.indent))&&(a.type==="document"?a.end=r.start:a.items.push({start:r.start}),s.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const i={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&i.start.push(this.sourceToken),this.stack.push(i);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(i){if(i.value)return yield*this.lineEnd(i);switch(this.type){case"doc-start":{ov(i.start)!==-1?(yield*this.pop(),yield*this.step()):i.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":i.start.push(this.sourceToken);return}const s=this.startBlockValue(i);s?this.stack.push(s):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(i){if(this.type==="map-value-ind"){const s=uu(this.peek(2)),a=vl(s);let r;i.end?(r=i.end,r.push(this.sourceToken),delete i.end):r=[this.sourceToken];const u={type:"block-map",offset:i.offset,indent:i.indent,items:[{start:a,key:i,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=u}else yield*this.lineEnd(i)}*blockScalar(i){switch(this.type){case"space":case"comment":case"newline":i.props.push(this.sourceToken);return;case"scalar":if(i.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let s=this.source.indexOf(`
150
+ `)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
151
+ `,s)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(i){const s=i.items[i.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):i.items.push({start:[this.sourceToken]})}else s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)i.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,i.indent)){const r=i.items[i.items.length-2]?.value?.end;if(Array.isArray(r)){Lu(r,s.start),r.push(this.sourceToken),i.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=i.indent){const a=!this.onKeyLine&&this.indent===i.indent,r=a&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let u=[];if(r&&s.sep&&!s.value){const c=[];for(let m=0;m<s.sep.length;++m){const h=s.sep[m];switch(h.type){case"newline":c.push(m);break;case"space":break;case"comment":h.indent>i.indent&&(c.length=0);break;default:c.length=0}}c.length>=2&&(u=s.sep.splice(c[1]))}switch(this.type){case"anchor":case"tag":r||s.value?(u.push(this.sourceToken),i.items.push({start:u}),this.onKeyLine=!0):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"explicit-key-ind":!s.sep&&!s.explicitKey?(s.start.push(this.sourceToken),s.explicitKey=!0):r||s.value?(u.push(this.sourceToken),i.items.push({start:u,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(s.explicitKey)if(s.sep)if(s.value)i.items.push({start:[],key:null,sep:[this.sourceToken]});else if(ji(s.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]});else if(Gb(s.key)&&!ji(s.sep,"newline")){const c=vl(s.start),m=s.key,h=s.sep;h.push(this.sourceToken),delete s.key,delete s.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:m,sep:h}]})}else u.length>0?s.sep=s.sep.concat(u,this.sourceToken):s.sep.push(this.sourceToken);else if(ji(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const c=vl(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||r?i.items.push({start:u,key:null,sep:[this.sourceToken]}):ji(s.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const c=this.flowScalar(this.type);r||s.value?(i.items.push({start:u,key:c,sep:[]}),this.onKeyLine=!0):s.sep?this.stack.push(c):(Object.assign(s,{key:c,sep:[]}),this.onKeyLine=!0);return}default:{const c=this.startBlockValue(i);if(c){if(c.type==="block-seq"){if(!s.explicitKey&&s.sep&&!ji(s.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else a&&i.items.push({start:u});this.stack.push(c);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(i){const s=i.items[i.items.length-1];switch(this.type){case"newline":if(s.value){const a="end"in s.value?s.value.end:void 0;(Array.isArray(a)?a[a.length-1]:void 0)?.type==="comment"?a?.push(this.sourceToken):i.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)i.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,i.indent)){const r=i.items[i.items.length-2]?.value?.end;if(Array.isArray(r)){Lu(r,s.start),r.push(this.sourceToken),i.items.pop();return}}s.start.push(this.sourceToken)}return;case"anchor":case"tag":if(s.value||this.indent<=i.indent)break;s.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==i.indent)break;s.value||ji(s.start,"seq-item-ind")?i.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>i.indent){const a=this.startBlockValue(i);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(i){const s=i.items[i.items.length-1];if(this.type==="flow-error-end"){let a;do yield*this.pop(),a=this.peek(1);while(a?.type==="flow-collection")}else if(i.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?i.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?i.items.push({start:[],key:null,sep:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):Object.assign(s,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!s||s.value?i.items.push({start:[this.sourceToken]}):s.sep?s.sep.push(this.sourceToken):s.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!s||s.value?i.items.push({start:[],key:r,sep:[]}):s.sep?this.stack.push(r):Object.assign(s,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":i.end.push(this.sourceToken);return}const a=this.startBlockValue(i);a?this.stack.push(a):(yield*this.pop(),yield*this.step())}else{const a=this.peek(2);if(a.type==="block-map"&&(this.type==="map-value-ind"&&a.indent===i.indent||this.type==="newline"&&!a.items[a.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&a.type!=="flow-collection"){const r=uu(a),u=vl(r);rv(i);const c=i.end.splice(1,i.end.length);c.push(this.sourceToken);const m={type:"block-map",offset:i.offset,indent:i.indent,items:[{start:u,key:i,sep:c}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=m}else yield*this.lineEnd(i)}}flowScalar(i){if(this.onNewLine){let s=this.source.indexOf(`
152
+ `)+1;for(;s!==0;)this.onNewLine(this.offset+s),s=this.source.indexOf(`
153
+ `,s)+1}return{type:i,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(i){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const s=uu(i),a=vl(s);return a.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const s=uu(i),a=vl(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(i,s){return this.type!=="comment"||this.indent<=s?!1:i.every(a=>a.type==="newline"||a.type==="space")}*documentEnd(i){this.type!=="doc-mode"&&(i.end?i.end.push(this.sourceToken):i.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(i){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:i.end?i.end.push(this.sourceToken):i.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Xb(t){const i=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||i&&new Yb||null,prettyErrors:i}}function OC(t,i={}){const{lineCounter:s,prettyErrors:a}=Xb(i),r=new Wh(s?.addNewLine),u=new Fh(i),c=Array.from(u.compose(r.parse(t)));if(a&&s)for(const m of c)m.errors.forEach(zu(t,s)),m.warnings.forEach(zu(t,s));return c.length>0?c:Object.assign([],{empty:!0},u.streamInfo())}function Kb(t,i={}){const{lineCounter:s,prettyErrors:a}=Xb(i),r=new Wh(s?.addNewLine),u=new Fh(i);let c=null;for(const m of u.compose(r.parse(t),!0,t.length))if(!c)c=m;else if(c.options.logLevel!=="silent"){c.errors.push(new ps(m.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return a&&s&&(c.errors.forEach(zu(t,s)),c.warnings.forEach(zu(t,s))),c}function zC(t,i,s){let a;typeof i=="function"?a=i:s===void 0&&i&&typeof i=="object"&&(s=i);const r=Kb(t,s);if(!r)return null;if(r.warnings.forEach(u=>fb(r.options.logLevel,u)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:a},s))}function DC(t,i,s){let a=null;if(typeof i=="function"||Array.isArray(i)?a=i:s===void 0&&i&&(s=i),typeof s=="string"&&(s=s.length),typeof s=="number"){const r=Math.round(s);s=r<1?void 0:r>8?{indent:8}:{indent:r}}if(t===void 0){const{keepUndefined:r}=s??i??{};if(!r)return}return As(t)&&!a?t.toString(s):new Zl(t,a,s).toString(s)}const ac=Object.freeze(Object.defineProperty({__proto__:null,Alias:Zu,CST:TC,Composer:Fh,Document:Zl,Lexer:Vb,LineCounter:Yb,Pair:St,Parser:Wh,Scalar:xe,Schema:nc,YAMLError:Ih,YAMLMap:Zt,YAMLParseError:ps,YAMLSeq:Vi,YAMLWarning:zb,isAlias:Ns,isCollection:Fe,isDocument:As,isMap:Yl,isNode:We,isPair:Ie,isScalar:Ye,isSeq:Gl,parse:zC,parseAllDocuments:OC,parseDocument:Kb,stringify:DC,visit:Ts,visitAsync:Ku},Symbol.toStringTag,{value:"Module"}));function Ql(t){return t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[^a-zA-Z0-9]+/g,"-").replace(/^-+|-+$/g,"").toLowerCase()||"unnamed"}function Fd(t){return`story_${Ql(t)}`}function LC(t){return`slc_${Ql(t).replaceAll("-","_")}`}function RC(t,i){return`scr_${Ql(i||t).replaceAll("-","_")}`}function BC(t){return`cmd_${Ql(t).replaceAll("-","_")}`}function kC(t){return`qry_${Ql(t).replaceAll("-","_")}`}function Wd(t){return`evt_${Ql(t).replaceAll("-","_")}`}function bl(t,i,s){return`${t}:${i}->${s}`}function io(t){return t.replaceAll("\\","/").replace(/^\/+/,"")}function Zb(t,i=""){const s=io(t).split("/").at(-1)??t;return i&&s.endsWith(i)?s.slice(0,-i.length):s}function zl(t){return Array.isArray(t)?t.filter(i=>typeof i=="string"):[]}function HC(t,i){const s=ac.parse(i),a=s?.events&&typeof s.events=="object"?s.events:s??{};return Object.entries(a).map(([r,u])=>({name:r,fields:typeof u?.fields=="string"?u.fields:void 0,description:typeof u?.description=="string"?u.description:void 0,sourcePath:t}))}function jC(t,i){const s=ac.parse(i);return{name:typeof s?.name=="string"?s.name:Zb(t,".yaml"),description:typeof s?.description=="string"?s.description:"",path:t,slices:zl(s?.slices).map(io)}}function $C(t){return Array.isArray(t)?t.filter(i=>!!i&&typeof i=="object").map(i=>({name:typeof i.name=="string"?i.name:"",fields:typeof i.fields=="string"?i.fields:void 0,notes:typeof i.notes=="string"?i.notes:void 0,produces:zl(i.produces)})):[]}function UC(t){return Array.isArray(t)?t.filter(i=>!!i&&typeof i=="object").map(i=>({name:typeof i.name=="string"?i.name:"",fields:typeof i.fields=="string"?i.fields:void 0,notes:typeof i.notes=="string"?i.notes:void 0,fromEvents:zl(i.from_events)})):[]}function qC(t){return Array.isArray(t)?t.filter(i=>!!i&&typeof i=="object").map(i=>({name:typeof i.name=="string"?i.name:void 0,description:typeof i.description=="string"?i.description:void 0,given:Array.isArray(i.given)?i.given:[],when:Array.isArray(i.when)?i.when:[],then:Array.isArray(i.then)?i.then:[]})):[]}function VC(t){return{type:t?.type==="system"?"system":"user",name:typeof t?.name=="string"?t.name:void 0,actors:zl(t?.actors),reads:zl(t?.reads),executes:zl(t?.executes)}}function YC(t,i,s){const a=ac.parse(i);return{title:typeof a?.slice=="string"?a.slice:Zb(t),path:t,storyName:s.get(t),screen:VC(a?.screen),commands:$C(a?.commands),queries:UC(a?.queries),gwt:qC(a?.gwt),raw:i}}function GC(t){const i=[],s=[],a=new Map;for(const r of t.stories)i.push({id:Fd(r.name),type:"story",label:r.name,sourcePath:r.path,description:r.description});for(const r of t.events){const u=Wd(r.name);a.set(r.name,u),i.push({id:u,type:"event",label:r.name,sourceName:r.name,sourcePath:r.sourcePath,fields:r.fields,description:r.description})}for(const r of t.slices){const u=LC(r.title),c=RC(r.title,r.screen.name),m=r.screen.type==="system"?"processor":"screen";i.push({id:u,type:"slice",label:r.title,storyName:r.storyName,sliceTitle:r.title,sourcePath:r.path,raw:r.raw}),r.storyName&&s.push({id:bl("story-slice",Fd(r.storyName),u),kind:"story-slice",source:Fd(r.storyName),target:u}),i.push({id:c,type:m,label:r.screen.name??(r.screen.type==="system"?"Processor":"Screen"),storyName:r.storyName,sliceTitle:r.title,sourcePath:r.path,actors:r.screen.actors,screenType:r.screen.type,raw:r.raw}),s.push({id:bl("slice-screen",u,c),kind:"slice-screen",source:u,target:c});for(const h of r.queries){const g=kC(h.name);i.push({id:g,type:"query",label:h.name,storyName:r.storyName,sliceTitle:r.title,sourceName:h.name,sourcePath:r.path,fields:h.fields,raw:r.raw}),r.screen.reads.includes(h.name)&&s.push({id:bl("query-screen",g,c),kind:"query-screen",source:g,target:c});for(const v of h.fromEvents){const p=a.get(v)??Wd(v);s.push({id:bl("event-query",p,g),kind:"event-query",source:p,target:g,label:v})}}for(const h of r.commands){const g=BC(h.name);i.push({id:g,type:"command",label:h.name,storyName:r.storyName,sliceTitle:r.title,sourceName:h.name,sourcePath:r.path,fields:h.fields,raw:r.raw}),r.screen.executes.includes(h.name)&&s.push({id:bl("screen-command",c,g),kind:"screen-command",source:c,target:g});for(const v of h.produces){const p=a.get(v)??Wd(v);s.push({id:bl("command-event",g,p),kind:"command-event",source:g,target:p,label:v})}}}return{nodes:i,edges:s}}function XC(t,i={}){const s=new Map(t.map(M=>[io(M.path),M.content])),a=s.get(".event-modeling/config.yaml"),r=a?ac.parse(a):null,u=r?.paths?.event_model_dir??"event-model",c=r?.paths?.features_dir??"event-model/features",m=r?.paths?.slice_extension??".slice.yaml",h=r?.paths?.events_file??`${u}/events.yaml`,g=r?.paths?.stories_dir??`${u}/stories`,v=s.get(h);if(!v)throw new Error(`Missing events file: ${h}`);const p=HC(h,v),y=[...s.entries()].filter(([M])=>M.startsWith(`${g}/`)&&M.endsWith(".yaml")).sort(([M],[k])=>M.localeCompare(k)).map(([M,k])=>jC(M,k)),w=new Map;for(const M of y)for(const k of M.slices)w.set(io(k),M.name);const x=y.flatMap(M=>M.slices.map(io)),S=[...s.keys()].filter(M=>M.startsWith(`${c}/`)&&M.endsWith(m)),E=[...new Set([...x,...S])].sort().filter(M=>s.has(M)).map(M=>YC(M,s.get(M)??"",w)),O={root:i.root??"browser-import",config:{language:r?.language,paths:{eventModelDir:u,featuresDir:c,sliceExtension:m,eventsFile:h,storiesDir:g}},events:p,stories:y,slices:E},N=GC(O);return{...O,...N}}function je(t,i,s,a,r){return{id:`${i}:${a??"project"}:${s}`,severity:t,check:i,message:s,path:a,nodeId:r}}function Sl(t){const i=new Set,s=new Set;for(const a of t){const r=a.trim().toLowerCase();r&&(i.has(r)&&s.add(a),i.add(r))}return[...s]}function KC(t){return/(ed|en|d|sent|built|made|booked|paid)$/i.test(t)}function uv(t){return/(Requested|Triggered|Scheduled|Enqueued|Dispatched|Required)$/.test(t)}function ZC(t){return["Selected","Shown","Viewed","Clicked","Opened","Closed","Ticked","Incremented","Reached","Displayed","Navigated"].find(i=>t.includes(i))}function QC(t){const i=new Set(t.nodes.map(u=>u.id)),s=new Map;for(const u of i)s.set(u,new Set);for(const u of t.edges)!i.has(u.source)||!i.has(u.target)||(s.get(u.source)?.add(u.target),s.get(u.target)?.add(u.source));let a=0;const r=new Set;for(const u of i){if(r.has(u))continue;a+=1;const c=[u];for(r.add(u);c.length>0;){const m=c.shift();if(m)for(const h of s.get(m)??[])r.has(h)||(r.add(h),c.push(h))}}return a}function IC(t){const i=[],s=new Set(t.events.map(h=>h.name)),a=new Set(t.slices.map(h=>h.path)),r=new Map,u=new Map;for(const h of t.stories){h.slices.length>15&&i.push(je("warning","S4",`Story "${h.name}" has ${h.slices.length} slices; consider splitting it.`,h.path));for(const g of h.slices)a.has(g)||i.push(je("error","S2",`Story "${h.name}" lists missing slice "${g}".`,h.path))}for(const h of t.events){h.fields?.trim()||i.push(je("error","C4",`Event "${h.name}" has no fields block.`,h.sourcePath)),!KC(h.name)&&!uv(h.name)&&i.push(je("warning","C3",`Event "${h.name}" does not obviously read as a past-tense domain event.`,h.sourcePath));const g=ZC(h.name);g&&i.push(je("warning","D1",`Event "${h.name}" contains red-flag verb "${g}"; confirm this is persisted domain state.`,h.sourcePath))}for(const h of t.slices){const g=h.commands.map(p=>p.name),v=h.queries.map(p=>p.name);for(const p of Sl(g))i.push(je("error","L9",`Command "${p}" is duplicated within slice "${h.title}".`,h.path));for(const p of Sl(v))i.push(je("error","L9",`Query "${p}" is duplicated within slice "${h.title}".`,h.path));for(const p of Sl(h.screen.reads))i.push(je("error","L9",`screen.reads lists "${p}" more than once.`,h.path));for(const p of Sl(h.screen.executes))i.push(je("error","L9",`screen.executes lists "${p}" more than once.`,h.path));for(const p of h.screen.reads)v.includes(p)||i.push(je("error","W2",`screen.reads references missing local query "${p}".`,h.path));for(const p of h.screen.executes)g.includes(p)||i.push(je("error","W1",`screen.executes references missing local command "${p}".`,h.path));h.screen.type==="system"&&h.screen.actors.length>0&&i.push(je("error","L5",`System slice "${h.title}" must not declare screen.actors.`,h.path)),h.storyName||i.push(je("warning","M2",`Slice "${h.title}" is not listed by any story.`,h.path)),h.commands.length>0&&h.gwt.length===0&&i.push(je("warning","M1",`Command slice "${h.title}" has no GWT scenarios.`,h.path));for(const p of h.commands){p.fields?.trim()||i.push(je("warning","L6",`Command "${p.name}" has no fields block.`,h.path));for(const y of p.produces)s.has(y)||i.push(je("error","G1",`Command "${p.name}" produces unregistered event "${y}".`,h.path)),r.set(y,[...r.get(y)??[],`${h.title}.${p.name}`])}for(const p of h.queries){p.fields?.trim()||i.push(je("warning","L7",`Query "${p.name}" has no fields block.`,h.path)),p.name.includes("For")||i.push(je("warning","N1",`Query "${p.name}" should use a descriptive <Thing>For<UseCaseOrScreen> name.`,h.path));for(const y of p.fromEvents)s.has(y)||i.push(je("error","G2",`Query "${p.name}" reads unregistered event "${y}".`,h.path)),u.set(y,[...u.get(y)??[],`${h.title}.${p.name}`])}for(const p of h.gwt)for(const y of[...p.given,...p.when,...p.then])(!y.type||!["event","command","query","error"].includes(y.type))&&i.push(je("error","L8",`GWT scenario "${p.name??"Unnamed"}" has invalid item type "${y.type??""}".`,h.path)),y.name||i.push(je("error","L8",`GWT scenario "${p.name??"Unnamed"}" has an item without a name.`,h.path))}for(const h of s){const g=r.get(h)??[],v=u.get(h)??[];g.length===0&&i.push(je("error","G3",`Event "${h}" is registered but no command produces it.`)),g.length>1&&i.push(je("warning","G8",`Event "${h}" has multiple producers: ${g.join(", ")}.`)),g.length>0&&v.length===0&&i.push(je("warning",uv(h)?"G4b":"G4a",`Event "${h}" is produced but no query consumes it.`))}for(const[h,g]of u.entries())(r.get(h)??[]).length===0&&i.push(je("error","G3",`Event "${h}" is read by ${g.join(", ")} but no command produces it.`));for(const h of Sl(t.slices.flatMap(g=>g.commands.map(v=>v.name))))i.push(je("warning","M5",`Command name "${h}" is used in multiple slices; command names should be globally unique.`));for(const h of Sl(t.slices.flatMap(g=>g.queries.map(v=>v.name))))i.push(je("warning","G7",`Query name "${h}" is used in multiple slices; query names should be globally unique.`));const c=t.slices.filter(h=>h.commands.length>0).length;c>0&&t.events.length/c>2&&i.push(je("warning","M4",`The model has ${(t.events.length/c).toFixed(1)} events per command slice; check for UI/runtime events leaking into the model.`));const m=QC(t);return m>1&&i.push(je("info","I3",`The graph has ${m} disconnected islands.`)),{errors:i.filter(h=>h.severity==="error").length,warnings:i.filter(h=>h.severity==="warning").length,findings:i}}function JC(){return D.jsxs(D.Fragment,{children:[D.jsx(rn,{id:"top-target",type:"target",position:fe.Top,style:{left:"46%"}}),D.jsx(rn,{id:"top-source",type:"source",position:fe.Top,style:{left:"54%"}}),D.jsx(rn,{id:"bottom-target",type:"target",position:fe.Bottom,style:{left:"46%"}}),D.jsx(rn,{id:"bottom-source",type:"source",position:fe.Bottom,style:{left:"54%"}}),D.jsx(rn,{id:"left-target",type:"target",position:fe.Left,style:{top:"46%"}}),D.jsx(rn,{id:"left-source",type:"source",position:fe.Left,style:{top:"54%"}}),D.jsx(rn,{id:"right-target",type:"target",position:fe.Right,style:{top:"46%"}}),D.jsx(rn,{id:"right-source",type:"source",position:fe.Right,style:{top:"54%"}})]})}function FC({data:t}){const i=t,s=i.projectNode;return D.jsxs("div",{className:`em-node em-node-${s.type} ${i.selected?"selected":""} ${i.connected?"connected":""}`,children:[D.jsx(JC,{}),D.jsx("div",{className:"node-type",children:s.type}),D.jsx("div",{className:"node-label",children:s.label}),s.actors&&s.actors.length>0?D.jsx("div",{className:"chips",children:s.actors.map(a=>D.jsx("span",{children:a},a))}):null]})}function WC({data:t}){const i=t,s=i.projectNode;return D.jsxs("div",{className:`group-node group-${s.type} ${i.selected?"selected":""}`,children:[D.jsx("div",{className:"group-title",children:s.label}),s.description?D.jsx("div",{className:"group-description",children:s.description}):null]})}const PC={eventModelNode:FC,groupNode:WC};function eO({sourceX:t,sourceY:i,targetX:s,targetY:a,sourcePosition:r,targetPosition:u,data:c}){const m=c,h=s-t,g=a-i,v=Math.max(56,Math.min(180,Math.abs(g)*.42)),p=Math.max(70,Math.min(180,Math.abs(h)*.38));if(m?.route==="same-slice-read"){const x=r===fe.Top?-1:1,S=u===fe.Bottom?1:-1,_=Math.max(72,Math.min(150,Math.abs(g)*.65));return`M ${t},${i} C ${t},${i+x*_} ${s},${a+S*_} ${s},${a}`}if(m?.route==="cross-story-read"){const x=r===fe.Top?-1:1,S=u===fe.Top?-1:1;return`M ${t},${i} C ${t},${i+x*v} ${s},${a+S*v} ${s},${a}`}if(r===fe.Bottom||r===fe.Top){const x=r===fe.Top?-1:1,S=u===fe.Top?-1:1;return`M ${t},${i} C ${t},${i+x*v} ${s},${a+S*v} ${s},${a}`}const y=r===fe.Left?-1:1,w=u===fe.Left?-1:1;return`M ${t},${i} C ${t+y*p},${i} ${s+w*p},${a} ${s},${a}`}function tO(t){const i=t.data,s=i?.active?"#111827":"#64748b";return D.jsx(_o,{path:eO(t),markerEnd:t.markerEnd,style:{...t.style,stroke:s},className:i?.active?"edge-path-active":"edge-path"})}const nO={eventModelEdge:tO};function cu({label:t,description:i,value:s,copiedKey:a,onCopy:r}){return D.jsx("button",{type:"button",className:"copy-action",onClick:()=>r(a,s),children:D.jsxs("span",{children:[D.jsx("strong",{children:t}),D.jsx("small",{children:i})]})})}function bh(t){return t==="query-screen"||t==="screen-command"||t==="command-event"||t==="event-query"}async function iO(t){return await Promise.all(Array.from(t).filter(s=>/\.(ya?ml|json)$/i.test(s.name)).map(async s=>({path:s.webkitRelativePath||s.name,content:await s.text()})))}function sO(t){const i=t.find(s=>s.path===".event-modeling/graph.json"||s.path.endsWith("/.event-modeling/graph.json"));if(i)try{return JSON.parse(i.content)}catch{return}}function lO(t){return t.type==="story"?{name:t.label}:t.type==="slice"?{slice:t.label}:t.type==="screen"||t.type==="processor"?{slice:t.sliceTitle??t.label}:t.type==="command"||t.type==="query"?{slice:t.sliceTitle??"",name:t.sourceName??t.label}:{name:t.sourceName??t.label}}function aO(t){const i=t.graphSidecar?.nodes;return i?Object.entries(i).flatMap(([s,a])=>{const r=a,u=t.nodes.filter(c=>{if(r.type==="screen"&&c.type!=="screen"&&c.type!=="processor"||r.type!=="screen"&&r.type!==c.type)return!1;const m=lO(c);return Object.entries(r.selector??{}).every(([h,g])=>m[h]===g)});return u.length===0?[{id:`V1:.event-modeling/graph.json:${s}`,severity:"warning",check:"V1",message:`graph.json node "${s}" selector does not resolve.`,path:".event-modeling/graph.json",nodeId:s}]:u.length>1?[{id:`V2:.event-modeling/graph.json:${s}`,severity:"warning",check:"V2",message:`graph.json node "${s}" selector resolves to ${u.length} nodes.`,path:".event-modeling/graph.json",nodeId:s}]:[]}):[]}function oO({onImport:t,error:i}){return D.jsx("div",{className:"import-panel",children:D.jsxs("div",{className:"import-card",children:[D.jsx("h1",{children:"emviz"}),D.jsx("p",{children:"Import an Event Modeling project folder or select YAML/JSON files to visualize the model."}),D.jsxs("div",{className:"import-actions",children:[D.jsxs("label",{children:["Import folder",D.jsx("input",{type:"file",multiple:!0,webkitdirectory:"",directory:"",onChange:s=>s.currentTarget.files&&t(s.currentTarget.files)})]}),D.jsxs("label",{children:["Import files",D.jsx("input",{type:"file",multiple:!0,accept:".yaml,.yml,.json",onChange:s=>s.currentTarget.files&&t(s.currentTarget.files)})]})]}),i?D.jsx("p",{className:"import-error",children:i}):null]})})}function rO({project:t,selectedNode:i,findings:s,onSelect:a,onPreviewConnection:r,onClearPreview:u}){const[c,m]=F.useState(),h=F.useCallback((E,O)=>{navigator.clipboard?.writeText(O).then(()=>{m(E),window.setTimeout(()=>m(N=>N===E?void 0:N),1400)})},[]);if(!i)return D.jsxs("aside",{className:"panel panel-right",children:[D.jsx("h2",{children:"Selection"}),D.jsx("p",{className:"muted",children:"Select a node to inspect source and connections."})]});const g=t.edges.filter(E=>E.target===i.id&&bh(E.kind)),v=t.edges.filter(E=>E.source===i.id&&bh(E.kind)),p=new Map(t.nodes.map(E=>[E.id,E])),w=`em://${t.graphSidecar?.model?.id??"event_model"}/${i.id}`,x=i.raw??i.fields??i.description??i.label,S=[`Reference: ${w}`,`Node: ${i.label} (${i.type})`,`Source: ${i.sourcePath??"unknown"}`,"","Incoming:",...g.length===0?["- none"]:g.map(E=>`- ${p.get(E.source)?.label??E.source} -> ${i.label}`),"","Outgoing:",...v.length===0?["- none"]:v.map(E=>`- ${i.label} -> ${p.get(E.target)?.label??E.target}`),"","Source excerpt:",x].join(`
154
+ `),_=`Please update this event model node.
155
+
156
+ Reference:
157
+ ${w}
158
+
159
+ Source path:
160
+ ${i.sourcePath??"unknown"}
161
+
162
+ Current context:
163
+ ${x}
164
+
165
+ Goal:
166
+ `;return D.jsxs("aside",{className:"panel panel-right",children:[D.jsx("h2",{children:i.label}),D.jsxs("div",{className:"meta-row",children:[D.jsx("span",{children:"Type"}),D.jsx("strong",{children:i.type})]}),D.jsxs("div",{className:"meta-row",children:[D.jsx("span",{children:"Reference"}),D.jsx("code",{children:w})]}),i.sourcePath?D.jsxs("div",{className:"meta-row",children:[D.jsx("span",{children:"Source"}),D.jsx("code",{children:i.sourcePath})]}):null,D.jsxs("details",{className:"copy-section",children:[D.jsxs("summary",{children:[D.jsx("span",{children:"Copy for LLM"}),c?D.jsxs("strong",{className:"copy-feedback","aria-live":"polite",children:["Copied ",c]}):null]}),D.jsxs("div",{className:"copy-actions",children:[D.jsx(cu,{label:"Reference",description:"Stable em:// node handle",value:w,copiedKey:"reference",onCopy:h}),D.jsx(cu,{label:"YAML",description:"Source excerpt for this node",value:x,copiedKey:"YAML",onCopy:h}),D.jsx(cu,{label:"Context",description:"Reference plus incoming/outgoing links",value:S,copiedKey:"context",onCopy:h}),D.jsx(cu,{label:"Edit prompt",description:"Prompt scaffold for asking an LLM to edit",value:_,copiedKey:"prompt",onCopy:h})]})]}),D.jsx("h3",{children:"Connections"}),D.jsxs("div",{className:"connection-list",children:[D.jsx("strong",{children:"Incoming"}),g.length===0?D.jsx("p",{className:"muted",children:"None"}):g.map(E=>D.jsx("button",{type:"button",className:"connection-button",onClick:()=>a(E.source),onMouseEnter:()=>r(E.id),onMouseLeave:u,onFocus:()=>r(E.id),onBlur:u,children:p.get(E.source)?.label??E.source},E.id)),D.jsx("strong",{children:"Outgoing"}),v.length===0?D.jsx("p",{className:"muted",children:"None"}):v.map(E=>D.jsx("button",{type:"button",className:"connection-button",onClick:()=>a(E.target),onMouseEnter:()=>r(E.id),onMouseLeave:u,onFocus:()=>r(E.id),onBlur:u,children:p.get(E.target)?.label??E.target},E.id))]}),D.jsx("h3",{children:"Findings"}),s.length===0?D.jsx("p",{className:"muted",children:"No findings for this node."}):s.map(E=>D.jsxs("div",{className:`finding finding-${E.severity}`,children:[D.jsx("strong",{children:E.check}),D.jsx("span",{children:E.message})]},E.id)),D.jsx("h3",{children:"Source"}),D.jsx("pre",{children:x})]})}function uO({report:t,onSelect:i}){return D.jsxs("aside",{className:"panel panel-left",children:[D.jsx("h2",{children:"Validation"}),t?D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"status-row",children:[D.jsxs("span",{className:"status error",children:[t.errors," errors"]}),D.jsxs("span",{className:"status warning",children:[t.warnings," warnings"]})]}),D.jsx("div",{className:"findings-list",children:t.findings.length===0?D.jsx("p",{className:"muted",children:"No validation findings."}):t.findings.map(s=>D.jsxs("button",{type:"button",className:`finding finding-${s.severity}`,onClick:()=>s.nodeId&&i(s.nodeId),children:[D.jsx("strong",{children:s.check}),D.jsx("span",{children:s.message}),s.path?D.jsx("code",{children:s.path}):null]},s.id))})]}):D.jsx("p",{className:"muted",children:"Loading validation..."})]})}function cO(){const[t,i]=F.useState(),[s,a]=F.useState(),[r,u]=F.useState("loading"),[c,m]=F.useState(),[h,g]=F.useState(),[v,p]=F.useState([]),[y,w]=F.useState([]),[x,S]=F.useState(""),[_,E]=F.useState(),{setCenter:O,fitView:N}=Gu();F.useEffect(()=>{Promise.all([fetch("/api/model").then(T=>T.json()),fetch("/api/validation").then(T=>T.json())]).then(([T,z])=>{i(T),a(z),u("ready"),window.setTimeout(()=>{N({padding:.18,duration:300})},50)}).catch(()=>{u("import")})},[N]);const M=F.useMemo(()=>t?.nodes.find(T=>T.id===h),[t,h]),k=F.useMemo(()=>s?.findings.filter(T=>T.nodeId===h)??[],[s,h]),L=F.useMemo(()=>{if(_)return new Set([_]);if(!(!t||!h))return new Set(t.edges.filter(T=>bh(T.kind)&&(T.source===h||T.target===h)).map(T=>T.id))},[_,t,h]),H=F.useMemo(()=>t?_M(t,h,{focusedEdgeIds:L}):{nodes:[],edges:[]},[L,t,h]),j=F.useMemo(()=>{if(!t||x.trim().length<2)return[];const T=x.trim().toLowerCase();return t.nodes.filter(z=>`${z.label} ${z.type} ${z.sourcePath??""}`.toLowerCase().includes(T)).slice(0,8)},[t,x]),Y=F.useCallback((T,z=!0)=>{const q=H.nodes.find(X=>X.id===T);E(void 0),z&&h&&h!==T&&(p(X=>[...X,h]),w([])),g(T),q&&O(q.position.x+80,q.position.y+60,{zoom:1.2,duration:350})},[H.nodes,h,O]),oe=F.useCallback(()=>{g(void 0),E(void 0)},[]),K=F.useCallback(T=>{const z=t?.edges.find(X=>X.id===T);if(!z)return;E(T);const q=H.nodes.filter(X=>X.id===z.source||X.id===z.target);q.length>0&&N({nodes:q,padding:.36,duration:260,maxZoom:1.25})},[N,H.nodes,t?.edges]),I=F.useCallback(()=>{E(void 0)},[]);F.useEffect(()=>{const T=z=>{z.key==="Escape"&&oe()};return window.addEventListener("keydown",T),()=>window.removeEventListener("keydown",T)},[oe]);const ae=F.useCallback(()=>{const T=v.at(-1);T&&(p(z=>z.slice(0,-1)),h&&w(z=>[...z,h]),Y(T,!1))},[v,Y,h]),R=F.useCallback(()=>{const T=y.at(-1);T&&(w(z=>z.slice(0,-1)),h&&p(z=>[...z,h]),Y(T,!1))},[Y,y,h]),G=F.useCallback(T=>{iO(T).then(z=>{const q=XC(z),X=q;X.graphSidecar=sO(z)??{model:{id:"browser_import",name:"Browser Import"}},i(X);const te=IC(q),C=aO(X);a({errors:te.errors,warnings:te.warnings+C.filter($=>$.severity==="warning").length,findings:[...te.findings,...C]}),g(void 0),E(void 0),p([]),w([]),u("ready"),m(void 0),window.setTimeout(()=>{N({padding:.18,duration:300})},50)}).catch(z=>{m(z instanceof Error?z.message:String(z)),u("import")})},[N]);return r==="import"?D.jsx(oO,{onImport:G,error:c}):t?D.jsxs("div",{className:"app-shell",children:[D.jsxs("header",{className:"toolbar",children:[D.jsxs("div",{className:"model-summary",children:[D.jsx("strong",{children:"emviz"}),D.jsxs("span",{children:[t.stories.length," stories"]}),D.jsxs("span",{children:[t.slices.length," slices"]}),D.jsxs("span",{children:[t.nodes.filter(T=>T.type==="event").length," events"]})]}),D.jsxs("div",{className:"segmented toolbar-history","aria-label":"Selection history",children:[D.jsx("button",{type:"button",disabled:v.length===0,onClick:ae,children:"Back"}),D.jsx("button",{type:"button",disabled:y.length===0,onClick:R,children:"Forward"})]}),D.jsxs("div",{className:"search-box",children:[D.jsx("input",{"aria-label":"Search event model",value:x,onChange:T=>S(T.target.value),placeholder:"Search nodes by name or type..."}),j.length>0?D.jsx("div",{className:"search-results",children:j.map(T=>D.jsxs("button",{type:"button",onClick:()=>Y(T.id),children:[D.jsx("span",{children:T.label}),D.jsx("small",{children:T.type})]},T.id))}):null]})]}),D.jsx(uO,{report:s,onSelect:Y}),D.jsx(rO,{project:t,selectedNode:M,findings:k,onSelect:Y,onPreviewConnection:K,onClearPreview:I}),D.jsx("main",{className:"canvas",children:D.jsxs(UT,{nodes:H.nodes,edges:H.edges,nodeTypes:PC,edgeTypes:nO,onNodeClick:(T,z)=>Y(z.id),fitView:!0,minZoom:.2,maxZoom:1.8,nodesDraggable:!1,colorMode:"light",children:[D.jsx(XT,{gap:18,size:1}),D.jsx(WT,{})]})})]}):D.jsx("div",{className:"loading",children:"Loading event model..."})}function fO(){return D.jsx(Q1,{children:D.jsx(cO,{})})}ox.createRoot(document.getElementById("root")).render(D.jsx(fv.StrictMode,{children:D.jsx(fO,{})}));