emviz 0.1.4 → 0.1.6
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 c of r)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&a(u)}).observe(document,{childList:!0,subtree:!0});function s(r){const c={};return r.integrity&&(c.integrity=r.integrity),r.referrerPolicy&&(c.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?c.credentials="include":r.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(r){if(r.ep)return;r.ep=!0;const c=s(r);fetch(r.href,c)}})();function Tv(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Od={exports:{}},Ja={};var Gy;function xx(){if(Gy)return Ja;Gy=1;var t=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function s(a,r,c){var u=null;if(c!==void 0&&(u=""+c),r.key!==void 0&&(u=""+r.key),"key"in r){c={};for(var m in r)m!=="key"&&(c[m]=r[m])}else c=r;return r=c.ref,{$$typeof:t,type:a,key:u,ref:r!==void 0?r:null,props:c}}return Ja.Fragment=i,Ja.jsx=s,Ja.jsxs=s,Ja}var Xy;function Ex(){return Xy||(Xy=1,Od.exports=xx()),Od.exports}var z=Ex(),zd={exports:{}},we={};var Ky;function _x(){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"),c=Symbol.for("react.consumer"),u=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 S(M){return M===null||typeof M!="object"?null:(M=y&&M[y]||M["@@iterator"],typeof M=="function"?M:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,N={};function w(M,$,ee){this.props=M,this.context=$,this.refs=N,this.updater=ee||E}w.prototype.isReactComponent={},w.prototype.setState=function(M,$){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,$,"setState")},w.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function D(){}D.prototype=w.prototype;function x(M,$,ee){this.props=M,this.context=$,this.refs=N,this.updater=ee||E}var T=x.prototype=new D;T.constructor=x,_(T,w.prototype),T.isPureReactComponent=!0;var L=Array.isArray;function O(){}var j={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function V(M,$,ee){var ie=ee.ref;return{$$typeof:t,type:M,key:$,ref:ie!==void 0?ie:null,props:ee}}function le(M,$){return V(M.type,$,M.props)}function K(M){return typeof M=="object"&&M!==null&&M.$$typeof===t}function Z(M){var $={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(ee){return $[ee]})}var oe=/\/+/g;function B(M,$){return typeof M=="object"&&M!==null&&M.key!=null?Z(""+M.key):$.toString(36)}function X(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(O,O):(M.status="pending",M.then(function($){M.status==="pending"&&(M.status="fulfilled",M.value=$)},function($){M.status==="pending"&&(M.status="rejected",M.reason=$)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function C(M,$,ee,ie,re){var de=typeof M;(de==="undefined"||de==="boolean")&&(M=null);var ce=!1;if(M===null)ce=!0;else switch(de){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(M.$$typeof){case t:case i:ce=!0;break;case v:return ce=M._init,C(ce(M._payload),$,ee,ie,re)}}if(ce)return re=re(M),ce=ie===""?"."+B(M,0):ie,L(re)?(ee="",ce!=null&&(ee=ce.replace(oe,"$&/")+"/"),C(re,$,ee,"",function(Se){return Se})):re!=null&&(K(re)&&(re=le(re,ee+(re.key==null||M&&M.key===re.key?"":(""+re.key).replace(oe,"$&/")+"/")+ce)),$.push(re)),1;ce=0;var te=ie===""?".":ie+":";if(L(M))for(var ue=0;ue<M.length;ue++)ie=M[ue],de=te+B(ie,ue),ce+=C(ie,$,ee,de,re);else if(ue=S(M),typeof ue=="function")for(M=ue.call(M),ue=0;!(ie=M.next()).done;)ie=ie.value,de=te+B(ie,ue++),ce+=C(ie,$,ee,de,re);else if(de==="object"){if(typeof M.then=="function")return C(X(M),$,ee,ie,re);throw $=String(M),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return ce}function H(M,$,ee){if(M==null)return M;var ie=[],re=0;return C(M,ie,"","",function(de){return $.call(ee,de,re++)}),ie}function G(M){if(M._status===-1){var $=M._result;$=$(),$.then(function(ee){(M._status===0||M._status===-1)&&(M._status=1,M._result=ee)},function(ee){(M._status===0||M._status===-1)&&(M._status=2,M._result=ee)}),M._status===-1&&(M._status=0,M._result=$)}if(M._status===1)return M._result.default;throw M._result}var U=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},J={map:H,forEach:function(M,$,ee){H(M,function(){$.apply(this,arguments)},ee)},count:function(M){var $=0;return H(M,function(){$++}),$},toArray:function(M){return H(M,function($){return $})||[]},only:function(M){if(!K(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return we.Activity=p,we.Children=J,we.Component=w,we.Fragment=s,we.Profiler=r,we.PureComponent=x,we.StrictMode=a,we.Suspense=h,we.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,we.__COMPILER_RUNTIME={__proto__:null,c:function(M){return j.H.useMemoCache(M)}},we.cache=function(M){return function(){return M.apply(null,arguments)}},we.cacheSignal=function(){return null},we.cloneElement=function(M,$,ee){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var ie=_({},M.props),re=M.key;if($!=null)for(de in $.key!==void 0&&(re=""+$.key),$)!R.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=ee;else if(1<de){for(var ce=Array(de),te=0;te<de;te++)ce[te]=arguments[te+2];ie.children=ce}return V(M.type,re,ie)},we.createContext=function(M){return M={$$typeof:u,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:c,_context:M},M},we.createElement=function(M,$,ee){var ie,re={},de=null;if($!=null)for(ie in $.key!==void 0&&(de=""+$.key),$)R.call($,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(re[ie]=$[ie]);var ce=arguments.length-2;if(ce===1)re.children=ee;else if(1<ce){for(var te=Array(ce),ue=0;ue<ce;ue++)te[ue]=arguments[ue+2];re.children=te}if(M&&M.defaultProps)for(ie in ce=M.defaultProps,ce)re[ie]===void 0&&(re[ie]=ce[ie]);return V(M,de,re)},we.createRef=function(){return{current:null}},we.forwardRef=function(M){return{$$typeof:m,render:M}},we.isValidElement=K,we.lazy=function(M){return{$$typeof:v,_payload:{_status:-1,_result:M},_init:G}},we.memo=function(M,$){return{$$typeof:g,type:M,compare:$===void 0?null:$}},we.startTransition=function(M){var $=j.T,ee={};j.T=ee;try{var ie=M(),re=j.S;re!==null&&re(ee,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(O,U)}catch(de){U(de)}finally{$!==null&&ee.types!==null&&($.types=ee.types),j.T=$}},we.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},we.use=function(M){return j.H.use(M)},we.useActionState=function(M,$,ee){return j.H.useActionState(M,$,ee)},we.useCallback=function(M,$){return j.H.useCallback(M,$)},we.useContext=function(M){return j.H.useContext(M)},we.useDebugValue=function(){},we.useDeferredValue=function(M,$){return j.H.useDeferredValue(M,$)},we.useEffect=function(M,$){return j.H.useEffect(M,$)},we.useEffectEvent=function(M){return j.H.useEffectEvent(M)},we.useId=function(){return j.H.useId()},we.useImperativeHandle=function(M,$,ee){return j.H.useImperativeHandle(M,$,ee)},we.useInsertionEffect=function(M,$){return j.H.useInsertionEffect(M,$)},we.useLayoutEffect=function(M,$){return j.H.useLayoutEffect(M,$)},we.useMemo=function(M,$){return j.H.useMemo(M,$)},we.useOptimistic=function(M,$){return j.H.useOptimistic(M,$)},we.useReducer=function(M,$,ee){return j.H.useReducer(M,$,ee)},we.useRef=function(M){return j.H.useRef(M)},we.useState=function(M){return j.H.useState(M)},we.useSyncExternalStore=function(M,$,ee){return j.H.useSyncExternalStore(M,$,ee)},we.useTransition=function(){return j.H.useTransition()},we.version="19.2.7",we}var Zy;function xo(){return Zy||(Zy=1,zd.exports=_x()),zd.exports}var W=xo();const Mv=Tv(W);var Dd={exports:{}},Fa={},Ld={exports:{}},Rd={};var Qy;function Nx(){return Qy||(Qy=1,(function(t){function i(C,H){var G=C.length;C.push(H);e:for(;0<G;){var U=G-1>>>1,J=C[U];if(0<r(J,H))C[U]=H,C[G]=J,G=U;else break e}}function s(C){return C.length===0?null:C[0]}function a(C){if(C.length===0)return null;var H=C[0],G=C.pop();if(G!==H){C[0]=G;e:for(var U=0,J=C.length,M=J>>>1;U<M;){var $=2*(U+1)-1,ee=C[$],ie=$+1,re=C[ie];if(0>r(ee,G))ie<J&&0>r(re,ee)?(C[U]=re,C[ie]=G,U=ie):(C[U]=ee,C[$]=G,U=$);else if(ie<J&&0>r(re,G))C[U]=re,C[ie]=G,U=ie;else break e}}return H}function r(C,H){var G=C.sortIndex-H.sortIndex;return G!==0?G:C.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var u=Date,m=u.now();t.unstable_now=function(){return u.now()-m}}var h=[],g=[],v=1,p=null,y=3,S=!1,E=!1,_=!1,N=!1,w=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;function T(C){for(var H=s(g);H!==null;){if(H.callback===null)a(g);else if(H.startTime<=C)a(g),H.sortIndex=H.expirationTime,i(h,H);else break;H=s(g)}}function L(C){if(_=!1,T(C),!E)if(s(h)!==null)E=!0,O||(O=!0,Z());else{var H=s(g);H!==null&&X(L,H.startTime-C)}}var O=!1,j=-1,R=5,V=-1;function le(){return N?!0:!(t.unstable_now()-V<R)}function K(){if(N=!1,O){var C=t.unstable_now();V=C;var H=!0;try{e:{E=!1,_&&(_=!1,D(j),j=-1),S=!0;var G=y;try{t:{for(T(C),p=s(h);p!==null&&!(p.expirationTime>C&&le());){var U=p.callback;if(typeof U=="function"){p.callback=null,y=p.priorityLevel;var J=U(p.expirationTime<=C);if(C=t.unstable_now(),typeof J=="function"){p.callback=J,T(C),H=!0;break t}p===s(h)&&a(h),T(C)}else a(h);p=s(h)}if(p!==null)H=!0;else{var M=s(g);M!==null&&X(L,M.startTime-C),H=!1}}break e}finally{p=null,y=G,S=!1}H=void 0}}finally{H?Z():O=!1}}}var Z;if(typeof x=="function")Z=function(){x(K)};else if(typeof MessageChannel<"u"){var oe=new MessageChannel,B=oe.port2;oe.port1.onmessage=K,Z=function(){B.postMessage(null)}}else Z=function(){w(K,0)};function X(C,H){j=w(function(){C(t.unstable_now())},H)}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(C){C.callback=null},t.unstable_forceFrameRate=function(C){0>C||125<C?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<C?Math.floor(1e3/C):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(C){switch(y){case 1:case 2:case 3:var H=3;break;default:H=y}var G=y;y=H;try{return C()}finally{y=G}},t.unstable_requestPaint=function(){N=!0},t.unstable_runWithPriority=function(C,H){switch(C){case 1:case 2:case 3:case 4:case 5:break;default:C=3}var G=y;y=C;try{return H()}finally{y=G}},t.unstable_scheduleCallback=function(C,H,G){var U=t.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?U+G:U):G=U,C){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=G+J,C={id:v++,callback:H,priorityLevel:C,startTime:G,expirationTime:J,sortIndex:-1},G>U?(C.sortIndex=G,i(g,C),s(h)===null&&C===s(g)&&(_?(D(j),j=-1):_=!0,X(L,G-U))):(C.sortIndex=J,i(h,C),E||S||(E=!0,O||(O=!0,Z()))),C},t.unstable_shouldYield=le,t.unstable_wrapCallback=function(C){var H=y;return function(){var G=y;y=H;try{return C.apply(this,arguments)}finally{y=G}}}})(Rd)),Rd}var Iy;function Ax(){return Iy||(Iy=1,Ld.exports=Nx()),Ld.exports}var Bd={exports:{}},bt={};var Jy;function Tx(){if(Jy)return bt;Jy=1;var t=xo();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 c(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 u=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 c(h,g,null,v)},bt.flushSync=function(h){var g=u.T,v=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.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,S=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:S}):v==="script"&&a.d.X(h,{crossOrigin:p,integrity:y,fetchPriority:S,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 u.H.useFormState(h,g,v)},bt.useFormStatus=function(){return u.H.useHostTransitionStatus()},bt.version="19.2.7",bt}var Fy;function Cv(){if(Fy)return Bd.exports;Fy=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(),Bd.exports=Tx(),Bd.exports}var Wy;function Mx(){if(Wy)return Fa;Wy=1;var t=Ax(),i=xo(),s=Cv();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 c(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 u(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(c(e)!==e)throw Error(a(188))}function g(e){var n=e.alternate;if(!n){if(n=c(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"),S=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),x=Symbol.for("react.context"),T=Symbol.for("react.forward_ref"),L=Symbol.for("react.suspense"),O=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),le=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function Z(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var oe=Symbol.for("react.client.reference");function B(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===oe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case _:return"Fragment";case w:return"Profiler";case N:return"StrictMode";case L:return"Suspense";case O:return"SuspenseList";case V:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case x:return e.displayName||"Context";case D:return(e._context.displayName||"Context")+".Consumer";case T:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case j:return n=e.displayName||null,n!==null?n:B(e.type)||"Memo";case R:n=e._payload,e=e._init;try{return B(e(n))}catch{}}return null}var X=Array.isArray,C=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},U=[],J=-1;function M(e){return{current:e}}function $(e){0>J||(e.current=U[J],U[J]=null,J--)}function ee(e,n){J++,U[J]=e.current,e.current=n}var ie=M(null),re=M(null),de=M(null),ce=M(null);function te(e,n){switch(ee(de,n),ee(re,e),ee(ie,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?hy(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=hy(n),e=my(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$(ie),ee(ie,e)}function ue(){$(ie),$(re),$(de)}function Se(e){e.memoizedState!==null&&ee(ce,e);var n=ie.current,l=my(n,e.type);n!==l&&(ee(re,e),ee(ie,l))}function be(e){re.current===e&&($(ie),$(re)),ce.current===e&&($(ce),Ka._currentValue=G)}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 ae=function(){throw Error()};if(Object.defineProperty(ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ae,[])}catch(P){var F=P}Reflect.construct(e,[],ae)}else{try{ae.call()}catch(P){F=P}e.call(ae.prototype)}}else{try{throw Error()}catch(P){F=P}(ae=e())&&typeof ae.catch=="function"&&ae.catch(function(){})}}catch(P){if(P&&F&&typeof P.stack=="string")return[P.stack,F.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 k=b.split(`
|
|
4
|
+
`),I=A.split(`
|
|
5
|
+
`);for(f=o=0;o<k.length&&!k[o].includes("DetermineComponentFrameRoot");)o++;for(;f<I.length&&!I[f].includes("DetermineComponentFrameRoot");)f++;if(o===k.length||f===I.length)for(o=k.length-1,f=I.length-1;1<=o&&0<=f&&k[o]!==I[f];)f--;for(;1<=o&&0<=f;o--,f--)if(k[o]!==I[f]){if(o!==1||f!==1)do if(o--,f--,0>f||k[o]!==I[f]){var ne=`
|
|
6
|
+
`+k[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,kt=t.unstable_cancelCallback,Qi=t.unstable_shouldYield,Bn=t.unstable_requestPaint,tt=t.unstable_now,Ht=t.unstable_getCurrentPriorityLevel,Jt=t.unstable_ImmediatePriority,Ft=t.unstable_UserBlockingPriority,Wt=t.unstable_NormalPriority,hu=t.unstable_LowPriority,Ds=t.unstable_IdlePriority,mu=t.log,gu=t.unstable_setDisableYieldValue,Ii=null,wt=null;function _n(e){if(typeof mu=="function"&&gu(e),wt&&typeof wt.setStrictMode=="function")try{wt.setStrictMode(Ii,e)}catch{}}var xt=Math.clz32?Math.clz32:vu,pu=Math.log,yu=Math.LN2;function vu(e){return e>>>=0,e===0?32:31-(pu(e)/yu|0)|0}var Ls=256,Rs=262144,Bs=4194304;function jn(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 js(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=jn(o):(b&=A,b!==0?f=jn(b):l||(l=A&~e,l!==0&&(f=jn(l))))):(A=o&~d,A!==0?f=jn(A):b!==0?f=jn(b):l||(l=o&~e,l!==0&&(f=jn(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 Ji(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function bu(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 Do(){var e=Bs;return Bs<<=1,(Bs&62914560)===0&&(Bs=4194304),e}function Pl(e){for(var n=[],l=0;31>l;l++)n.push(e);return n}function Fi(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Su(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,k=e.expirationTimes,I=e.hiddenUpdates;for(l=b&~l;0<l;){var ne=31-xt(l),ae=1<<ne;A[ne]=0,k[ne]=-1;var F=I[ne];if(F!==null)for(I[ne]=null,ne=0;ne<F.length;ne++){var P=F[ne];P!==null&&(P.lane&=-536870913)}l&=~ae}o!==0&&Lo(e,o,0),d!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=d&~(b&~n))}function Lo(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 Ro(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 Bo(e,n){var l=n&-n;return l=(l&42)!==0?1:ea(l),(l&(e.suspendedLanes|n))!==0?0:l}function ea(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 ta(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function jo(){var e=H.p;return e!==0?e:(e=window.event,e===void 0?32:ky(e.type))}function ko(e,n){var l=H.p;try{return H.p=e,n()}finally{H.p=l}}var Nn=Math.random().toString(36).slice(2),ut="__reactFiber$"+Nn,vt="__reactProps$"+Nn,kn="__reactContainer$"+Nn,ks="__reactEvents$"+Nn,Ho="__reactListeners$"+Nn,wu="__reactHandles$"+Nn,$o="__reactResources$"+Nn,Wi="__reactMarker$"+Nn;function na(e){delete e[ut],delete e[vt],delete e[ks],delete e[Ho],delete e[wu]}function ci(e){var n=e[ut];if(n)return n;for(var l=e.parentNode;l;){if(n=l[kn]||l[ut]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(e=wy(e);e!==null;){if(l=e[ut])return l;e=wy(e)}return n}e=l,l=e.parentNode}return null}function ui(e){if(e=e[ut]||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 fi(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function di(e){var n=e[$o];return n||(n=e[$o]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function st(e){e[Wi]=!0}var Uo=new Set,qo={};function Hn(e,n){hi(e,n),hi(e+"Capture",n)}function hi(e,n){for(qo[e]=n,e=0;e<n.length;e++)Uo.add(n[e])}var xu=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]*$"),Vo={},ia={};function Eu(e){return Nt.call(ia,e)?!0:Nt.call(Vo,e)?!1:xu.test(e)?ia[e]=!0:(Vo[e]=!0,!1)}function Hs(e,n,l){if(Eu(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 $s(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 Yo(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function _u(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 sa(e){if(!e._valueTracker){var n=Yo(e)?"checked":"value";e._valueTracker=_u(e,n,""+e[n])}}function la(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),o="";return e&&(o=Yo(e)?e.checked?"true":"false":e.value),e=o,e!==l?(n.setValue(e),!0):!1}function Us(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 Go=/[\n"\\]/g;function Mt(e){return e.replace(Go,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function aa(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?oa(e,b,Tt(n)):l!=null?oa(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 qs(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)){sa(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),sa(e)}function oa(e,n,l){n==="number"&&Us(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function mi(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 ra(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 cm(e,n,l,o){if(n==null){if(o!=null){if(l!=null)throw Error(a(92));if(X(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),sa(e)}function Vs(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var yS=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 um(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||yS.has(n)?n==="float"?e.cssFloat=l:e[n]=(""+l).trim():e[n]=l+"px"}function fm(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&&um(e,f,o)}else for(var d in n)n.hasOwnProperty(d)&&um(e,d,n[d])}function Nu(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 vS=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"]]),bS=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Xo(e){return bS.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function $n(){}var Au=null;function Tu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ys=null,Gs=null;function dm(e){var n=ui(e);if(n&&(e=n.stateNode)){var l=e[vt]||null;e:switch(e=n.stateNode,n.type){case"input":if(aa(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));aa(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&&la(o)}break e;case"textarea":ra(e,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&mi(e,!!l.multiple,n,!1)}}}var Mu=!1;function hm(e,n,l){if(Mu)return e(n,l);Mu=!0;try{var o=e(n);return o}finally{if(Mu=!1,(Ys!==null||Gs!==null)&&(Dr(),Ys&&(n=Ys,e=Gs,Gs=Ys=null,dm(n),e)))for(n=0;n<e.length;n++)dm(e[n])}}function ca(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 Un=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cu=!1;if(Un)try{var ua={};Object.defineProperty(ua,"passive",{get:function(){Cu=!0}}),window.addEventListener("test",ua,ua),window.removeEventListener("test",ua,ua)}catch{Cu=!1}var gi=null,Ou=null,Ko=null;function mm(){if(Ko)return Ko;var e,n=Ou,l=n.length,o,f="value"in gi?gi.value:gi.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 Ko=f.slice(e,1<o?1-o:void 0)}function Zo(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 Qo(){return!0}function gm(){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)?Qo:gm,this.isPropagationStopped=gm,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=Qo)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Qo)},persist:function(){},isPersistent:Qo}),n}var Pi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Io=Ct(Pi),fa=p({},Pi,{view:0,detail:0}),SS=Ct(fa),zu,Du,da,Jo=p({},fa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ru,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!==da&&(da&&e.type==="mousemove"?(zu=e.screenX-da.screenX,Du=e.screenY-da.screenY):Du=zu=0,da=e),zu)},movementY:function(e){return"movementY"in e?e.movementY:Du}}),pm=Ct(Jo),wS=p({},Jo,{dataTransfer:0}),xS=Ct(wS),ES=p({},fa,{relatedTarget:0}),Lu=Ct(ES),_S=p({},Pi,{animationName:0,elapsedTime:0,pseudoElement:0}),NS=Ct(_S),AS=p({},Pi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),TS=Ct(AS),MS=p({},Pi,{data:0}),ym=Ct(MS),CS={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"},zS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function DS(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=zS[e])?!!n[e]:!1}function Ru(){return DS}var LS=p({},fa,{key:function(e){if(e.key){var n=CS[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=Zo(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:Ru,charCode:function(e){return e.type==="keypress"?Zo(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Zo(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),RS=Ct(LS),BS=p({},Jo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vm=Ct(BS),jS=p({},fa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ru}),kS=Ct(jS),HS=p({},Pi,{propertyName:0,elapsedTime:0,pseudoElement:0}),$S=Ct(HS),US=p({},Jo,{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}),qS=Ct(US),VS=p({},Pi,{newState:0,oldState:0}),YS=Ct(VS),GS=[9,13,27,32],Bu=Un&&"CompositionEvent"in window,ha=null;Un&&"documentMode"in document&&(ha=document.documentMode);var XS=Un&&"TextEvent"in window&&!ha,bm=Un&&(!Bu||ha&&8<ha&&11>=ha),Sm=" ",wm=!1;function xm(e,n){switch(e){case"keyup":return GS.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Em(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Xs=!1;function KS(e,n){switch(e){case"compositionend":return Em(n);case"keypress":return n.which!==32?null:(wm=!0,Sm);case"textInput":return e=n.data,e===Sm&&wm?null:e;default:return null}}function ZS(e,n){if(Xs)return e==="compositionend"||!Bu&&xm(e,n)?(e=mm(),Ko=Ou=gi=null,Xs=!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 bm&&n.locale!=="ko"?null:n.data;default:return null}}var QS={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 _m(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!QS[e.type]:n==="textarea"}function Nm(e,n,l,o){Ys?Gs?Gs.push(o):Gs=[o]:Ys=o,n=$r(n,"onChange"),0<n.length&&(l=new Io("onChange","change",null,l,o),e.push({event:l,listeners:n}))}var ma=null,ga=null;function IS(e){oy(e,0)}function Fo(e){var n=fi(e);if(la(n))return e}function Am(e,n){if(e==="change")return n}var Tm=!1;if(Un){var ju;if(Un){var ku="oninput"in document;if(!ku){var Mm=document.createElement("div");Mm.setAttribute("oninput","return;"),ku=typeof Mm.oninput=="function"}ju=ku}else ju=!1;Tm=ju&&(!document.documentMode||9<document.documentMode)}function Cm(){ma&&(ma.detachEvent("onpropertychange",Om),ga=ma=null)}function Om(e){if(e.propertyName==="value"&&Fo(ga)){var n=[];Nm(n,ga,e,Tu(e)),hm(IS,n)}}function JS(e,n,l){e==="focusin"?(Cm(),ma=n,ga=l,ma.attachEvent("onpropertychange",Om)):e==="focusout"&&Cm()}function FS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Fo(ga)}function WS(e,n){if(e==="click")return Fo(n)}function PS(e,n){if(e==="input"||e==="change")return Fo(n)}function ew(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var $t=typeof Object.is=="function"?Object.is:ew;function pa(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 zm(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dm(e,n){var l=zm(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=zm(l)}}function Lm(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Lm(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Rm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=Us(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=Us(e.document)}return n}function Hu(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 tw=Un&&"documentMode"in document&&11>=document.documentMode,Ks=null,$u=null,ya=null,Uu=!1;function Bm(e,n,l){var o=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Uu||Ks==null||Ks!==Us(o)||(o=Ks,"selectionStart"in o&&Hu(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}),ya&&pa(ya,o)||(ya=o,o=$r($u,"onSelect"),0<o.length&&(n=new Io("onSelect","select",null,n,l),e.push({event:n,listeners:o}),n.target=Ks)))}function es(e,n){var l={};return l[e.toLowerCase()]=n.toLowerCase(),l["Webkit"+e]="webkit"+n,l["Moz"+e]="moz"+n,l}var Zs={animationend:es("Animation","AnimationEnd"),animationiteration:es("Animation","AnimationIteration"),animationstart:es("Animation","AnimationStart"),transitionrun:es("Transition","TransitionRun"),transitionstart:es("Transition","TransitionStart"),transitioncancel:es("Transition","TransitionCancel"),transitionend:es("Transition","TransitionEnd")},qu={},jm={};Un&&(jm=document.createElement("div").style,"AnimationEvent"in window||(delete Zs.animationend.animation,delete Zs.animationiteration.animation,delete Zs.animationstart.animation),"TransitionEvent"in window||delete Zs.transitionend.transition);function ts(e){if(qu[e])return qu[e];if(!Zs[e])return e;var n=Zs[e],l;for(l in n)if(n.hasOwnProperty(l)&&l in jm)return qu[e]=n[l];return e}var km=ts("animationend"),Hm=ts("animationiteration"),$m=ts("animationstart"),nw=ts("transitionrun"),iw=ts("transitionstart"),sw=ts("transitioncancel"),Um=ts("transitionend"),qm=new Map,Vu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Vu.push("scrollEnd");function dn(e,n){qm.set(e,n),Hn(n,[e])}var Wo=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=[],Qs=0,Yu=0;function Po(){for(var e=Qs,n=Yu=Qs=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&&Vm(l,f,d)}}function er(e,n,l,o){Pt[Qs++]=e,Pt[Qs++]=n,Pt[Qs++]=l,Pt[Qs++]=o,Yu|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Gu(e,n,l,o){return er(e,n,l,o),tr(e)}function ns(e,n){return er(e,null,null,n),tr(e)}function Vm(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 tr(e){if(50<$a)throw $a=0,ed=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var Is={};function lw(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 lw(e,n,l,o)}function Xu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function qn(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 Ym(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 nr(e,n,l,o,f,d){var b=0;if(o=e,typeof e=="function")Xu(e)&&(b=1);else if(typeof e=="string")b=ux(e,l,ie.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case V:return e=Ut(31,l,n,f),e.elementType=V,e.lanes=d,e;case _:return is(l.children,f,d,n);case N:b=8,f|=24;break;case w:return e=Ut(12,l,n,f|2),e.elementType=w,e.lanes=d,e;case L:return e=Ut(13,l,n,f),e.elementType=L,e.lanes=d,e;case O:return e=Ut(19,l,n,f),e.elementType=O,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case x:b=10;break e;case D:b=9;break e;case T:b=11;break e;case j:b=14;break e;case R: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 is(e,n,l,o){return e=Ut(7,e,o,n),e.lanes=l,e}function Ku(e,n,l){return e=Ut(6,e,null,n),e.lanes=l,e}function Gm(e){var n=Ut(18,null,null,0);return n.stateNode=e,n}function Zu(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 Xm=new WeakMap;function en(e,n){if(typeof e=="object"&&e!==null){var l=Xm.get(e);return l!==void 0?l:(n={value:e,source:n,stack:It(n)},Xm.set(e,n),n)}return{value:e,source:n,stack:It(n)}}var Js=[],Fs=0,ir=null,va=0,tn=[],nn=0,pi=null,An=1,Tn="";function Vn(e,n){Js[Fs++]=va,Js[Fs++]=ir,ir=e,va=n}function Km(e,n,l){tn[nn++]=An,tn[nn++]=Tn,tn[nn++]=pi,pi=e;var o=An;e=Tn;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,An=1<<32-xt(n)+f|l<<f|o,Tn=d+e}else An=1<<d|l<<f|o,Tn=e}function Qu(e){e.return!==null&&(Vn(e,1),Km(e,1,0))}function Iu(e){for(;e===ir;)ir=Js[--Fs],Js[Fs]=null,va=Js[--Fs],Js[Fs]=null;for(;e===pi;)pi=tn[--nn],tn[nn]=null,Tn=tn[--nn],tn[nn]=null,An=tn[--nn],tn[nn]=null}function Zm(e,n){tn[nn++]=An,tn[nn++]=Tn,tn[nn++]=pi,An=n.id,Tn=n.overflow,pi=e}var ht=null,Xe=null,Oe=!1,yi=null,sn=!1,Ju=Error(a(519));function vi(e){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ba(en(n,e)),Ju}function Qm(e){var n=e.stateNode,l=e.type,o=e.memoizedProps;switch(n[ut]=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<qa.length;l++)Te(qa[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),qs(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),cm(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||fy(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=$n),n=!0):n=!1,n||vi(e,!0)}function Im(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 Ws(e){if(e!==ht)return!1;if(!Oe)return Im(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")||gd(e.type,e.memoizedProps)),l=!l),l&&Xe&&vi(e),Im(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Xe=Sy(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Xe=Sy(e)}else n===27?(n=Xe,Di(e.type)?(e=Sd,Sd=null,Xe=e):Xe=n):Xe=ht?an(e.stateNode.nextSibling):null;return!0}function ss(){Xe=ht=null,Oe=!1}function Fu(){var e=yi;return e!==null&&(Lt===null?Lt=e:Lt.push.apply(Lt,e),yi=null),e}function ba(e){yi===null?yi=[e]:yi.push(e)}var Wu=M(null),ls=null,Yn=null;function bi(e,n,l){ee(Wu,n._currentValue),n._currentValue=l}function Gn(e){e._currentValue=Wu.current,$(Wu)}function Pu(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 ef(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 k=0;k<n.length;k++)if(A.context===n[k]){d.lanes|=l,A=d.alternate,A!==null&&(A.lanes|=l),Pu(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),Pu(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 Ps(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===ce.current){if(b=f.alternate,b===null)throw Error(a(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(Ka):e=[Ka])}f=f.return}e!==null&&ef(n,e,l,o),n.flags|=262144}function sr(e){for(e=e.firstContext;e!==null;){if(!$t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function as(e){ls=e,Yn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function mt(e){return Jm(ls,e)}function lr(e,n){return ls===null&&as(e),Jm(e,n)}function Jm(e,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Yn===null){if(e===null)throw Error(a(308));Yn=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Yn=Yn.next=n;return l}var aw=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()})}},ow=t.unstable_scheduleCallback,rw=t.unstable_NormalPriority,lt={$$typeof:x,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function tf(){return{controller:new aw,data:new Map,refCount:0}}function Sa(e){e.refCount--,e.refCount===0&&ow(rw,function(){e.controller.abort()})}var wa=null,nf=0,el=0,tl=null;function cw(e,n){if(wa===null){var l=wa=[];nf=0,el=ad(),tl={status:"pending",value:void 0,then:function(o){l.push(o)}}}return nf++,n.then(Fm,Fm),n}function Fm(){if(--nf===0&&wa!==null){tl!==null&&(tl.status="fulfilled");var e=wa;wa=null,el=0,tl=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function uw(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 Wm=C.S;C.S=function(e,n){Bp=tt(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&cw(e,n),Wm!==null&&Wm(e,n)};var os=M(null);function sf(){var e=os.current;return e!==null?e:Ve.pooledCache}function ar(e,n){n===null?ee(os,os.current):ee(os,n.pool)}function Pm(){var e=sf();return e===null?null:{parent:lt._currentValue,pool:e}}var nl=Error(a(460)),lf=Error(a(474)),or=Error(a(542)),rr={then:function(){}};function eg(e){return e=e.status,e==="fulfilled"||e==="rejected"}function tg(e,n,l){switch(l=e[l],l===void 0?e.push(n):l!==n&&(n.then($n,$n),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,ig(e),e;default:if(typeof n.status=="string")n.then($n,$n);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,ig(e),e}throw cs=n,nl}}function rs(e){try{var n=e._init;return n(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(cs=l,nl):l}}var cs=null;function ng(){if(cs===null)throw Error(a(459));var e=cs;return cs=null,e}function ig(e){if(e===nl||e===or)throw Error(a(483))}var il=null,xa=0;function cr(e){var n=xa;return xa+=1,il===null&&(il=[]),tg(il,e,n)}function Ea(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function ur(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 sg(e){function n(Y,q){if(e){var Q=Y.deletions;Q===null?(Y.deletions=[q],Y.flags|=16):Q.push(q)}}function l(Y,q){if(!e)return null;for(;q!==null;)n(Y,q),q=q.sibling;return null}function o(Y){for(var q=new Map;Y!==null;)Y.key!==null?q.set(Y.key,Y):q.set(Y.index,Y),Y=Y.sibling;return q}function f(Y,q){return Y=qn(Y,q),Y.index=0,Y.sibling=null,Y}function d(Y,q,Q){return Y.index=Q,e?(Q=Y.alternate,Q!==null?(Q=Q.index,Q<q?(Y.flags|=67108866,q):Q):(Y.flags|=67108866,q)):(Y.flags|=1048576,q)}function b(Y){return e&&Y.alternate===null&&(Y.flags|=67108866),Y}function A(Y,q,Q,se){return q===null||q.tag!==6?(q=Ku(Q,Y.mode,se),q.return=Y,q):(q=f(q,Q),q.return=Y,q)}function k(Y,q,Q,se){var pe=Q.type;return pe===_?ne(Y,q,Q.props.children,se,Q.key):q!==null&&(q.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===R&&rs(pe)===q.type)?(q=f(q,Q.props),Ea(q,Q),q.return=Y,q):(q=nr(Q.type,Q.key,Q.props,null,Y.mode,se),Ea(q,Q),q.return=Y,q)}function I(Y,q,Q,se){return q===null||q.tag!==4||q.stateNode.containerInfo!==Q.containerInfo||q.stateNode.implementation!==Q.implementation?(q=Zu(Q,Y.mode,se),q.return=Y,q):(q=f(q,Q.children||[]),q.return=Y,q)}function ne(Y,q,Q,se,pe){return q===null||q.tag!==7?(q=is(Q,Y.mode,se,pe),q.return=Y,q):(q=f(q,Q),q.return=Y,q)}function ae(Y,q,Q){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=Ku(""+q,Y.mode,Q),q.return=Y,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case S:return Q=nr(q.type,q.key,q.props,null,Y.mode,Q),Ea(Q,q),Q.return=Y,Q;case E:return q=Zu(q,Y.mode,Q),q.return=Y,q;case R:return q=rs(q),ae(Y,q,Q)}if(X(q)||Z(q))return q=is(q,Y.mode,Q,null),q.return=Y,q;if(typeof q.then=="function")return ae(Y,cr(q),Q);if(q.$$typeof===x)return ae(Y,lr(Y,q),Q);ur(Y,q)}return null}function F(Y,q,Q,se){var pe=q!==null?q.key:null;if(typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint")return pe!==null?null:A(Y,q,""+Q,se);if(typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:return Q.key===pe?k(Y,q,Q,se):null;case E:return Q.key===pe?I(Y,q,Q,se):null;case R:return Q=rs(Q),F(Y,q,Q,se)}if(X(Q)||Z(Q))return pe!==null?null:ne(Y,q,Q,se,null);if(typeof Q.then=="function")return F(Y,q,cr(Q),se);if(Q.$$typeof===x)return F(Y,q,lr(Y,Q),se);ur(Y,Q)}return null}function P(Y,q,Q,se,pe){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return Y=Y.get(Q)||null,A(q,Y,""+se,pe);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case S:return Y=Y.get(se.key===null?Q:se.key)||null,k(q,Y,se,pe);case E:return Y=Y.get(se.key===null?Q:se.key)||null,I(q,Y,se,pe);case R:return se=rs(se),P(Y,q,Q,se,pe)}if(X(se)||Z(se))return Y=Y.get(Q)||null,ne(q,Y,se,pe,null);if(typeof se.then=="function")return P(Y,q,Q,cr(se),pe);if(se.$$typeof===x)return P(Y,q,Q,lr(q,se),pe);ur(q,se)}return null}function he(Y,q,Q,se){for(var pe=null,Le=null,me=q,Ne=q=0,Ce=null;me!==null&&Ne<Q.length;Ne++){me.index>Ne?(Ce=me,me=null):Ce=me.sibling;var Re=F(Y,me,Q[Ne],se);if(Re===null){me===null&&(me=Ce);break}e&&me&&Re.alternate===null&&n(Y,me),q=d(Re,q,Ne),Le===null?pe=Re:Le.sibling=Re,Le=Re,me=Ce}if(Ne===Q.length)return l(Y,me),Oe&&Vn(Y,Ne),pe;if(me===null){for(;Ne<Q.length;Ne++)me=ae(Y,Q[Ne],se),me!==null&&(q=d(me,q,Ne),Le===null?pe=me:Le.sibling=me,Le=me);return Oe&&Vn(Y,Ne),pe}for(me=o(me);Ne<Q.length;Ne++)Ce=P(me,Y,Ne,Q[Ne],se),Ce!==null&&(e&&Ce.alternate!==null&&me.delete(Ce.key===null?Ne:Ce.key),q=d(Ce,q,Ne),Le===null?pe=Ce:Le.sibling=Ce,Le=Ce);return e&&me.forEach(function(ki){return n(Y,ki)}),Oe&&Vn(Y,Ne),pe}function ve(Y,q,Q,se){if(Q==null)throw Error(a(151));for(var pe=null,Le=null,me=q,Ne=q=0,Ce=null,Re=Q.next();me!==null&&!Re.done;Ne++,Re=Q.next()){me.index>Ne?(Ce=me,me=null):Ce=me.sibling;var ki=F(Y,me,Re.value,se);if(ki===null){me===null&&(me=Ce);break}e&&me&&ki.alternate===null&&n(Y,me),q=d(ki,q,Ne),Le===null?pe=ki:Le.sibling=ki,Le=ki,me=Ce}if(Re.done)return l(Y,me),Oe&&Vn(Y,Ne),pe;if(me===null){for(;!Re.done;Ne++,Re=Q.next())Re=ae(Y,Re.value,se),Re!==null&&(q=d(Re,q,Ne),Le===null?pe=Re:Le.sibling=Re,Le=Re);return Oe&&Vn(Y,Ne),pe}for(me=o(me);!Re.done;Ne++,Re=Q.next())Re=P(me,Y,Ne,Re.value,se),Re!==null&&(e&&Re.alternate!==null&&me.delete(Re.key===null?Ne:Re.key),q=d(Re,q,Ne),Le===null?pe=Re:Le.sibling=Re,Le=Re);return e&&me.forEach(function(wx){return n(Y,wx)}),Oe&&Vn(Y,Ne),pe}function qe(Y,q,Q,se){if(typeof Q=="object"&&Q!==null&&Q.type===_&&Q.key===null&&(Q=Q.props.children),typeof Q=="object"&&Q!==null){switch(Q.$$typeof){case S:e:{for(var pe=Q.key;q!==null;){if(q.key===pe){if(pe=Q.type,pe===_){if(q.tag===7){l(Y,q.sibling),se=f(q,Q.props.children),se.return=Y,Y=se;break e}}else if(q.elementType===pe||typeof pe=="object"&&pe!==null&&pe.$$typeof===R&&rs(pe)===q.type){l(Y,q.sibling),se=f(q,Q.props),Ea(se,Q),se.return=Y,Y=se;break e}l(Y,q);break}else n(Y,q);q=q.sibling}Q.type===_?(se=is(Q.props.children,Y.mode,se,Q.key),se.return=Y,Y=se):(se=nr(Q.type,Q.key,Q.props,null,Y.mode,se),Ea(se,Q),se.return=Y,Y=se)}return b(Y);case E:e:{for(pe=Q.key;q!==null;){if(q.key===pe)if(q.tag===4&&q.stateNode.containerInfo===Q.containerInfo&&q.stateNode.implementation===Q.implementation){l(Y,q.sibling),se=f(q,Q.children||[]),se.return=Y,Y=se;break e}else{l(Y,q);break}else n(Y,q);q=q.sibling}se=Zu(Q,Y.mode,se),se.return=Y,Y=se}return b(Y);case R:return Q=rs(Q),qe(Y,q,Q,se)}if(X(Q))return he(Y,q,Q,se);if(Z(Q)){if(pe=Z(Q),typeof pe!="function")throw Error(a(150));return Q=pe.call(Q),ve(Y,q,Q,se)}if(typeof Q.then=="function")return qe(Y,q,cr(Q),se);if(Q.$$typeof===x)return qe(Y,q,lr(Y,Q),se);ur(Y,Q)}return typeof Q=="string"&&Q!==""||typeof Q=="number"||typeof Q=="bigint"?(Q=""+Q,q!==null&&q.tag===6?(l(Y,q.sibling),se=f(q,Q),se.return=Y,Y=se):(l(Y,q),se=Ku(Q,Y.mode,se),se.return=Y,Y=se),b(Y)):l(Y,q)}return function(Y,q,Q,se){try{xa=0;var pe=qe(Y,q,Q,se);return il=null,pe}catch(me){if(me===nl||me===or)throw me;var Le=Ut(29,me,null,Y.mode);return Le.lanes=se,Le.return=Y,Le}}}var us=sg(!0),lg=sg(!1),Si=!1;function af(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function of(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 wi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xi(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=tr(e),Vm(e,null,l),n}return er(e,o,n,l),tr(e)}function _a(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,Ro(e,l)}}function rf(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 cf=!1;function Na(){if(cf){var e=tl;if(e!==null)throw e}}function Aa(e,n,l,o){cf=!1;var f=e.updateQueue;Si=!1;var d=f.firstBaseUpdate,b=f.lastBaseUpdate,A=f.shared.pending;if(A!==null){f.shared.pending=null;var k=A,I=k.next;k.next=null,b===null?d=I:b.next=I,b=k;var ne=e.alternate;ne!==null&&(ne=ne.updateQueue,A=ne.lastBaseUpdate,A!==b&&(A===null?ne.firstBaseUpdate=I:A.next=I,ne.lastBaseUpdate=k))}if(d!==null){var ae=f.baseState;b=0,ne=I=k=null,A=d;do{var F=A.lane&-536870913,P=F!==A.lane;if(P?(Me&F)===F:(o&F)===F){F!==0&&F===el&&(cf=!0),ne!==null&&(ne=ne.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var he=e,ve=A;F=n;var qe=l;switch(ve.tag){case 1:if(he=ve.payload,typeof he=="function"){ae=he.call(qe,ae,F);break e}ae=he;break e;case 3:he.flags=he.flags&-65537|128;case 0:if(he=ve.payload,F=typeof he=="function"?he.call(qe,ae,F):he,F==null)break e;ae=p({},ae,F);break e;case 2:Si=!0}}F=A.callback,F!==null&&(e.flags|=64,P&&(e.flags|=8192),P=f.callbacks,P===null?f.callbacks=[F]:P.push(F))}else P={lane:F,tag:A.tag,payload:A.payload,callback:A.callback,next:null},ne===null?(I=ne=P,k=ae):ne=ne.next=P,b|=F;if(A=A.next,A===null){if(A=f.shared.pending,A===null)break;P=A,A=P.next,P.next=null,f.lastBaseUpdate=P,f.shared.pending=null}}while(!0);ne===null&&(k=ae),f.baseState=k,f.firstBaseUpdate=I,f.lastBaseUpdate=ne,d===null&&(f.shared.lanes=0),Ti|=b,e.lanes=b,e.memoizedState=ae}}function ag(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function og(e,n){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)ag(l[e],n)}var sl=M(null),fr=M(0);function rg(e,n){e=Pn,ee(fr,e),ee(sl,n),Pn=e|n.baseLanes}function uf(){ee(fr,Pn),ee(sl,sl.current)}function ff(){Pn=fr.current,$(sl),$(fr)}var qt=M(null),ln=null;function Ei(e){var n=e.alternate;ee(nt,nt.current&1),ee(qt,e),ln===null&&(n===null||sl.current!==null||n.memoizedState!==null)&&(ln=e)}function df(e){ee(nt,nt.current),ee(qt,e),ln===null&&(ln=e)}function cg(e){e.tag===22?(ee(nt,nt.current),ee(qt,e),ln===null&&(ln=e)):_i()}function _i(){ee(nt,nt.current),ee(qt,qt.current)}function Vt(e){$(qt),ln===e&&(ln=null),$(nt)}var nt=M(0);function dr(e){for(var n=e;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||vd(l)||bd(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 Xn=0,_e=null,$e=null,at=null,hr=!1,ll=!1,fs=!1,mr=0,Ta=0,al=null,fw=0;function Pe(){throw Error(a(321))}function hf(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 mf(e,n,l,o,f,d){return Xn=d,_e=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,C.H=e===null||e.memoizedState===null?Kg:Cf,fs=!1,d=l(o,f),fs=!1,ll&&(d=fg(n,l,o,f)),ug(e),d}function ug(e){C.H=Oa;var n=$e!==null&&$e.next!==null;if(Xn=0,at=$e=_e=null,hr=!1,Ta=0,al=null,n)throw Error(a(300));e===null||ot||(e=e.dependencies,e!==null&&sr(e)&&(ot=!0))}function fg(e,n,l,o){_e=e;var f=0;do{if(ll&&(al=null),Ta=0,ll=!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)}C.H=Zg,d=n(l,o)}while(ll);return d}function dw(){var e=C.H,n=e.useState()[0];return n=typeof n.then=="function"?Ma(n):n,e=e.useState()[0],($e!==null?$e.memoizedState:null)!==e&&(_e.flags|=1024),n}function gf(){var e=mr!==0;return mr=0,e}function pf(e,n,l){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l}function yf(e){if(hr){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}hr=!1}Xn=0,at=$e=_e=null,ll=!1,Ta=mr=0,al=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 gr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ma(e){var n=Ta;return Ta+=1,al===null&&(al=[]),e=tg(al,e,n),n=_e,(at===null?n.memoizedState:at.next)===null&&(n=n.alternate,C.H=n===null||n.memoizedState===null?Kg:Cf),e}function pr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ma(e);if(e.$$typeof===x)return mt(e)}throw Error(a(438,String(e)))}function vf(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=gr(),_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]=le;return n.index++,l}function Kn(e,n){return typeof n=="function"?n(e):n}function yr(e){var n=it();return bf(n,$e,e)}function bf(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,k=null,I=n,ne=!1;do{var ae=I.lane&-536870913;if(ae!==I.lane?(Me&ae)===ae:(Xn&ae)===ae){var F=I.revertLane;if(F===0)k!==null&&(k=k.next={lane:0,revertLane:0,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null}),ae===el&&(ne=!0);else if((Xn&F)===F){I=I.next,F===el&&(ne=!0);continue}else ae={lane:0,revertLane:I.revertLane,gesture:null,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},k===null?(A=k=ae,b=d):k=k.next=ae,_e.lanes|=F,Ti|=F;ae=I.action,fs&&l(d,ae),d=I.hasEagerState?I.eagerState:l(d,ae)}else F={lane:ae,revertLane:I.revertLane,gesture:I.gesture,action:I.action,hasEagerState:I.hasEagerState,eagerState:I.eagerState,next:null},k===null?(A=k=F,b=d):k=k.next=F,_e.lanes|=ae,Ti|=ae;I=I.next}while(I!==null&&I!==n);if(k===null?b=d:k.next=A,!$t(d,e.memoizedState)&&(ot=!0,ne&&(l=tl,l!==null)))throw l;e.memoizedState=d,e.baseState=b,e.baseQueue=k,o.lastRenderedState=d}return f===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function Sf(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 dg(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,Ef(gg.bind(null,o,f,e),[e]),f.getSnapshot!==n||b||at!==null&&at.memoizedState.tag&1){if(o.flags|=2048,ol(9,{destroy:void 0},mg.bind(null,o,f,l,n),null),Ve===null)throw Error(a(349));d||(Xn&127)!==0||hg(o,n,l)}return l}function hg(e,n,l){e.flags|=16384,e={getSnapshot:n,value:l},n=_e.updateQueue,n===null?(n=gr(),_e.updateQueue=n,n.stores=[e]):(l=n.stores,l===null?n.stores=[e]:l.push(e))}function mg(e,n,l,o){n.value=l,n.getSnapshot=o,pg(n)&&yg(e)}function gg(e,n,l){return l(function(){pg(n)&&yg(e)})}function pg(e){var n=e.getSnapshot;e=e.value;try{var l=n();return!$t(e,l)}catch{return!0}}function yg(e){var n=ns(e,2);n!==null&&Rt(n,e,2)}function wf(e){var n=Et();if(typeof e=="function"){var l=e;if(e=l(),fs){_n(!0);try{l()}finally{_n(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:e},n}function vg(e,n,l,o){return e.baseState=l,bf(e,$e,typeof o=="function"?o:Kn)}function hw(e,n,l,o,f){if(Sr(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)}};C.T!==null?l(!0):d.isTransition=!1,o(d),l=n.pending,l===null?(d.next=n.pending=d,bg(n,d)):(d.next=l.next,n.pending=l.next=d)}}function bg(e,n){var l=n.action,o=n.payload,f=e.state;if(n.isTransition){var d=C.T,b={};C.T=b;try{var A=l(f,o),k=C.S;k!==null&&k(b,A),Sg(e,n,A)}catch(I){xf(e,n,I)}finally{d!==null&&b.types!==null&&(d.types=b.types),C.T=d}}else try{d=l(f,o),Sg(e,n,d)}catch(I){xf(e,n,I)}}function Sg(e,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(o){wg(e,n,o)},function(o){return xf(e,n,o)}):wg(e,n,l)}function wg(e,n,l){n.status="fulfilled",n.value=l,xg(n),e.state=l,n=e.pending,n!==null&&(l=n.next,l===n?e.pending=null:(l=l.next,n.next=l,bg(e,l)))}function xf(e,n,l){var o=e.pending;if(e.pending=null,o!==null){o=o.next;do n.status="rejected",n.reason=l,xg(n),n=n.next;while(n!==o)}e.action=null}function xg(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function Eg(e,n){return n}function _g(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}}vi(o)}o=!1}o&&(n=l[0])}}return l=Et(),l.memoizedState=l.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eg,lastRenderedState:n},l.queue=o,l=Yg.bind(null,_e,o),o.dispatch=l,o=wf(!1),d=Mf.bind(null,_e,!1,o.queue),o=Et(),f={state:n,dispatch:null,action:e,pending:null},o.queue=f,l=hw.bind(null,_e,f,d,l),f.dispatch=l,o.memoizedState=e,[n,l,!1]}function Ng(e){var n=it();return Ag(n,$e,e)}function Ag(e,n,l){if(n=bf(e,n,Eg)[0],e=yr(Kn)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Ma(n)}catch(b){throw b===nl?or:b}else o=n;n=it();var f=n.queue,d=f.dispatch;return l!==n.memoizedState&&(_e.flags|=2048,ol(9,{destroy:void 0},mw.bind(null,f,l),null)),[o,d,e]}function mw(e,n){e.action=n}function Tg(e){var n=it(),l=$e;if(l!==null)return Ag(n,l,e);it(),n=n.memoizedState,l=it();var o=l.queue.dispatch;return l.memoizedState=e,[n,o,!1]}function ol(e,n,l,o){return e={tag:e,create:l,deps:o,inst:n,next:null},n=_e.updateQueue,n===null&&(n=gr(),_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 Mg(){return it().memoizedState}function vr(e,n,l,o){var f=Et();_e.flags|=e,f.memoizedState=ol(1|n,{destroy:void 0},l,o===void 0?null:o)}function br(e,n,l,o){var f=it();o=o===void 0?null:o;var d=f.memoizedState.inst;$e!==null&&o!==null&&hf(o,$e.memoizedState.deps)?f.memoizedState=ol(n,d,l,o):(_e.flags|=e,f.memoizedState=ol(1|n,d,l,o))}function Cg(e,n){vr(8390656,8,e,n)}function Ef(e,n){br(2048,8,e,n)}function gw(e){_e.flags|=4;var n=_e.updateQueue;if(n===null)n=gr(),_e.updateQueue=n,n.events=[e];else{var l=n.events;l===null?n.events=[e]:l.push(e)}}function Og(e){var n=it().memoizedState;return gw({ref:n,nextImpl:e}),function(){if((Be&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}function zg(e,n){return br(4,2,e,n)}function Dg(e,n){return br(4,4,e,n)}function Lg(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 Rg(e,n,l){l=l!=null?l.concat([e]):null,br(4,4,Lg.bind(null,n,e),l)}function _f(){}function Bg(e,n){var l=it();n=n===void 0?null:n;var o=l.memoizedState;return n!==null&&hf(n,o[1])?o[0]:(l.memoizedState=[e,n],e)}function jg(e,n){var l=it();n=n===void 0?null:n;var o=l.memoizedState;if(n!==null&&hf(n,o[1]))return o[0];if(o=e(),fs){_n(!0);try{e()}finally{_n(!1)}}return l.memoizedState=[o,n],o}function Nf(e,n,l){return l===void 0||(Xn&1073741824)!==0&&(Me&261930)===0?e.memoizedState=n:(e.memoizedState=l,e=kp(),_e.lanes|=e,Ti|=e,l)}function kg(e,n,l,o){return $t(l,n)?l:sl.current!==null?(e=Nf(e,l,o),$t(e,n)||(ot=!0),e):(Xn&42)===0||(Xn&1073741824)!==0&&(Me&261930)===0?(ot=!0,e.memoizedState=l):(e=kp(),_e.lanes|=e,Ti|=e,n)}function Hg(e,n,l,o,f){var d=H.p;H.p=d!==0&&8>d?d:8;var b=C.T,A={};C.T=A,Mf(e,!1,n,l);try{var k=f(),I=C.S;if(I!==null&&I(A,k),k!==null&&typeof k=="object"&&typeof k.then=="function"){var ne=uw(k,o);Ca(e,n,ne,Xt(e))}else Ca(e,n,o,Xt(e))}catch(ae){Ca(e,n,{then:function(){},status:"rejected",reason:ae},Xt())}finally{H.p=d,b!==null&&A.types!==null&&(b.types=A.types),C.T=b}}function pw(){}function Af(e,n,l,o){if(e.tag!==5)throw Error(a(476));var f=$g(e).queue;Hg(e,f,n,G,l===null?pw:function(){return Ug(e),l(o)})}function $g(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:G,baseState:G,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:G},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:l},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function Ug(e){var n=$g(e);n.next===null&&(n=e.alternate.memoizedState),Ca(e,n.next.queue,{},Xt())}function Tf(){return mt(Ka)}function qg(){return it().memoizedState}function Vg(){return it().memoizedState}function yw(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var l=Xt();e=wi(l);var o=xi(n,e,l);o!==null&&(Rt(o,n,l),_a(o,n,l)),n={cache:tf()},e.payload=n;return}n=n.return}}function vw(e,n,l){var o=Xt();l={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Sr(e)?Gg(n,l):(l=Gu(e,n,l,o),l!==null&&(Rt(l,e,o),Xg(l,n,o)))}function Yg(e,n,l){var o=Xt();Ca(e,n,l,o)}function Ca(e,n,l,o){var f={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Sr(e))Gg(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 er(e,n,f,0),Ve===null&&Po(),!1}catch{}if(l=Gu(e,n,f,o),l!==null)return Rt(l,e,o),Xg(l,n,o),!0}return!1}function Mf(e,n,l,o){if(o={lane:2,revertLane:ad(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Sr(e)){if(n)throw Error(a(479))}else n=Gu(e,l,o,2),n!==null&&Rt(n,e,2)}function Sr(e){var n=e.alternate;return e===_e||n!==null&&n===_e}function Gg(e,n){ll=hr=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function Xg(e,n,l){if((l&4194048)!==0){var o=n.lanes;o&=e.pendingLanes,l|=o,n.lanes=l,Ro(e,l)}}var Oa={readContext:mt,use:pr,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};Oa.useEffectEvent=Pe;var Kg={readContext:mt,use:pr,useCallback:function(e,n){return Et().memoizedState=[e,n===void 0?null:n],e},useContext:mt,useEffect:Cg,useImperativeHandle:function(e,n,l){l=l!=null?l.concat([e]):null,vr(4194308,4,Lg.bind(null,n,e),l)},useLayoutEffect:function(e,n){return vr(4194308,4,e,n)},useInsertionEffect:function(e,n){vr(4,2,e,n)},useMemo:function(e,n){var l=Et();n=n===void 0?null:n;var o=e();if(fs){_n(!0);try{e()}finally{_n(!1)}}return l.memoizedState=[o,n],o},useReducer:function(e,n,l){var o=Et();if(l!==void 0){var f=l(n);if(fs){_n(!0);try{l(n)}finally{_n(!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=vw.bind(null,_e,e),[o.memoizedState,e]},useRef:function(e){var n=Et();return e={current:e},n.memoizedState=e},useState:function(e){e=wf(e);var n=e.queue,l=Yg.bind(null,_e,n);return n.dispatch=l,[e.memoizedState,l]},useDebugValue:_f,useDeferredValue:function(e,n){var l=Et();return Nf(l,e,n)},useTransition:function(){var e=wf(!1);return e=Hg.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||hg(o,n,l)}f.memoizedState=l;var d={value:l,getSnapshot:n};return f.queue=d,Cg(gg.bind(null,o,d,e),[e]),o.flags|=2048,ol(9,{destroy:void 0},mg.bind(null,o,d,l,n),null),l},useId:function(){var e=Et(),n=Ve.identifierPrefix;if(Oe){var l=Tn,o=An;l=(o&~(1<<32-xt(o)-1)).toString(32)+l,n="_"+n+"R_"+l,l=mr++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=fw++,n="_"+n+"r_"+l.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Tf,useFormState:_g,useActionState:_g,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=Mf.bind(null,_e,!0,l),l.dispatch=n,[e,n]},useMemoCache:vf,useCacheRefresh:function(){return Et().memoizedState=yw.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)}}},Cf={readContext:mt,use:pr,useCallback:Bg,useContext:mt,useEffect:Ef,useImperativeHandle:Rg,useInsertionEffect:zg,useLayoutEffect:Dg,useMemo:jg,useReducer:yr,useRef:Mg,useState:function(){return yr(Kn)},useDebugValue:_f,useDeferredValue:function(e,n){var l=it();return kg(l,$e.memoizedState,e,n)},useTransition:function(){var e=yr(Kn)[0],n=it().memoizedState;return[typeof e=="boolean"?e:Ma(e),n]},useSyncExternalStore:dg,useId:qg,useHostTransitionStatus:Tf,useFormState:Ng,useActionState:Ng,useOptimistic:function(e,n){var l=it();return vg(l,$e,e,n)},useMemoCache:vf,useCacheRefresh:Vg};Cf.useEffectEvent=Og;var Zg={readContext:mt,use:pr,useCallback:Bg,useContext:mt,useEffect:Ef,useImperativeHandle:Rg,useInsertionEffect:zg,useLayoutEffect:Dg,useMemo:jg,useReducer:Sf,useRef:Mg,useState:function(){return Sf(Kn)},useDebugValue:_f,useDeferredValue:function(e,n){var l=it();return $e===null?Nf(l,e,n):kg(l,$e.memoizedState,e,n)},useTransition:function(){var e=Sf(Kn)[0],n=it().memoizedState;return[typeof e=="boolean"?e:Ma(e),n]},useSyncExternalStore:dg,useId:qg,useHostTransitionStatus:Tf,useFormState:Tg,useActionState:Tg,useOptimistic:function(e,n){var l=it();return $e!==null?vg(l,$e,e,n):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:vf,useCacheRefresh:Vg};Zg.useEffectEvent=Og;function Of(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 zf={enqueueSetState:function(e,n,l){e=e._reactInternals;var o=Xt(),f=wi(o);f.payload=n,l!=null&&(f.callback=l),n=xi(e,f,o),n!==null&&(Rt(n,e,o),_a(n,e,o))},enqueueReplaceState:function(e,n,l){e=e._reactInternals;var o=Xt(),f=wi(o);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=xi(e,f,o),n!==null&&(Rt(n,e,o),_a(n,e,o))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var l=Xt(),o=wi(l);o.tag=2,n!=null&&(o.callback=n),n=xi(e,o,l),n!==null&&(Rt(n,e,l),_a(n,e,l))}};function Qg(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?!pa(l,o)||!pa(f,d):!0}function Ig(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&&zf.enqueueReplaceState(n,n.state,null)}function ds(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 Jg(e){Wo(e)}function Fg(e){console.error(e)}function Wg(e){Wo(e)}function wr(e,n){try{var l=e.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(o){setTimeout(function(){throw o})}}function Pg(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 Df(e,n,l){return l=wi(l),l.tag=3,l.payload={element:null},l.callback=function(){wr(e,n)},l}function ep(e){return e=wi(e),e.tag=3,e}function tp(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(){Pg(n,l,o)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(e.callback=function(){Pg(n,l,o),typeof f!="function"&&(Mi===null?Mi=new Set([this]):Mi.add(this));var A=o.stack;this.componentDidCatch(o.value,{componentStack:A!==null?A:""})})}function bw(e,n,l,o,f){if(l.flags|=32768,o!==null&&typeof o=="object"&&typeof o.then=="function"){if(n=l.alternate,n!==null&&Ps(n,l,f,!0),l=qt.current,l!==null){switch(l.tag){case 31:case 13:return ln===null?Lr():l.alternate===null&&et===0&&(et=3),l.flags&=-257,l.flags|=65536,l.lanes=f,o===rr?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([o]):n.add(o),id(e,o,f)),!1;case 22:return l.flags|=65536,o===rr?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)),id(e,o,f)),!1}throw Error(a(435,l.tag))}return id(e,o,f),Lr(),!1}if(Oe)return n=qt.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==Ju&&(e=Error(a(422),{cause:o}),ba(en(e,l)))):(o!==Ju&&(n=Error(a(423),{cause:o}),ba(en(n,l))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,o=en(o,l),f=Df(e.stateNode,o,f),rf(e,f),et!==4&&(et=2)),!1;var d=Error(a(520),{cause:o});if(d=en(d,l),Ha===null?Ha=[d]:Ha.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=Df(l.stateNode,o,e),rf(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"&&(Mi===null||!Mi.has(d))))return l.flags|=65536,f&=-f,l.lanes|=f,f=ep(f),tp(f,e,l,o),rf(l,f),!1}l=l.return}while(l!==null);return!1}var Lf=Error(a(461)),ot=!1;function gt(e,n,l,o){n.child=e===null?lg(n,null,l,o):us(n,e.child,l,o)}function np(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 as(n),o=mf(e,n,l,b,d,f),A=gf(),e!==null&&!ot?(pf(e,n,f),Zn(e,n,f)):(Oe&&A&&Qu(n),n.flags|=1,gt(e,n,o,f),n.child)}function ip(e,n,l,o,f){if(e===null){var d=l.type;return typeof d=="function"&&!Xu(d)&&d.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=d,sp(e,n,d,o,f)):(e=nr(l.type,null,o,n,n.mode,f),e.ref=n.ref,e.return=n,n.child=e)}if(d=e.child,!qf(e,f)){var b=d.memoizedProps;if(l=l.compare,l=l!==null?l:pa,l(b,o)&&e.ref===n.ref)return Zn(e,n,f)}return n.flags|=1,e=qn(d,o),e.ref=n.ref,e.return=n,n.child=e}function sp(e,n,l,o,f){if(e!==null){var d=e.memoizedProps;if(pa(d,o)&&e.ref===n.ref)if(ot=!1,n.pendingProps=o=d,qf(e,f))(e.flags&131072)!==0&&(ot=!0);else return n.lanes=e.lanes,Zn(e,n,f)}return Rf(e,n,l,o,f)}function lp(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 ap(e,n,d,l,o)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&ar(n,d!==null?d.cachePool:null),d!==null?rg(n,d):uf(),cg(n);else return o=n.lanes=536870912,ap(e,n,d!==null?d.baseLanes|l:l,l,o)}else d!==null?(ar(n,d.cachePool),rg(n,d),_i(),n.memoizedState=null):(e!==null&&ar(n,null),uf(),_i());return gt(e,n,f,l),n.child}function za(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function ap(e,n,l,o,f){var d=sf();return d=d===null?null:{parent:lt._currentValue,pool:d},n.memoizedState={baseLanes:l,cachePool:d},e!==null&&ar(n,null),uf(),cg(n),e!==null&&Ps(e,n,o,!0),n.childLanes=f,null}function xr(e,n){return n=_r({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function op(e,n,l){return us(n,e.child,null,l),e=xr(n,n.pendingProps),e.flags|=2,Vt(n),n.memoizedState=null,e}function Sw(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=xr(n,o),n.lanes=536870912,za(null,e);if(df(n),(e=Xe)?(e=by(e,sn),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:pi!==null?{id:An,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},l=Gm(e),l.return=n,n.child=l,ht=n,Xe=null)):e=null,e===null)throw vi(n);return n.lanes=536870912,null}return xr(n,o)}var d=e.memoizedState;if(d!==null){var b=d.dehydrated;if(df(n),f)if(n.flags&256)n.flags&=-257,n=op(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||Ps(e,n,l,!1),f=(l&e.childLanes)!==0,ot||f){if(o=Ve,o!==null&&(b=Bo(o,l),b!==0&&b!==d.retryLane))throw d.retryLane=b,ns(e,b),Rt(o,e,b),Lf;Lr(),n=op(e,n,l)}else e=d.treeContext,Xe=an(b.nextSibling),ht=n,Oe=!0,yi=null,sn=!1,e!==null&&Zm(n,e),n=xr(n,o),n.flags|=4096;return n}return e=qn(e.child,{mode:o.mode,children:o.children}),e.ref=n.ref,n.child=e,e.return=n,e}function Er(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 Rf(e,n,l,o,f){return as(n),l=mf(e,n,l,o,void 0,f),o=gf(),e!==null&&!ot?(pf(e,n,f),Zn(e,n,f)):(Oe&&o&&Qu(n),n.flags|=1,gt(e,n,l,f),n.child)}function rp(e,n,l,o,f,d){return as(n),n.updateQueue=null,l=fg(n,o,l,f),ug(e),o=gf(),e!==null&&!ot?(pf(e,n,d),Zn(e,n,d)):(Oe&&o&&Qu(n),n.flags|=1,gt(e,n,l,d),n.child)}function cp(e,n,l,o,f){if(as(n),n.stateNode===null){var d=Is,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=zf,n.stateNode=d,d._reactInternals=n,d=n.stateNode,d.props=o,d.state=n.memoizedState,d.refs={},af(n),b=l.contextType,d.context=typeof b=="object"&&b!==null?mt(b):Is,d.state=n.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(Of(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&&zf.enqueueReplaceState(d,d.state,null),Aa(n,o,d,f),Na(),d.state=n.memoizedState),typeof d.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(e===null){d=n.stateNode;var A=n.memoizedProps,k=ds(l,A);d.props=k;var I=d.context,ne=l.contextType;b=Is,typeof ne=="object"&&ne!==null&&(b=mt(ne));var ae=l.getDerivedStateFromProps;ne=typeof ae=="function"||typeof d.getSnapshotBeforeUpdate=="function",A=n.pendingProps!==A,ne||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(A||I!==b)&&Ig(n,d,o,b),Si=!1;var F=n.memoizedState;d.state=F,Aa(n,o,d,f),Na(),I=n.memoizedState,A||F!==I||Si?(typeof ae=="function"&&(Of(n,l,ae,o),I=n.memoizedState),(k=Si||Qg(n,l,k,o,F,I,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=I),d.props=o,d.state=I,d.context=b,o=k):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{d=n.stateNode,of(e,n),b=n.memoizedProps,ne=ds(l,b),d.props=ne,ae=n.pendingProps,F=d.context,I=l.contextType,k=Is,typeof I=="object"&&I!==null&&(k=mt(I)),A=l.getDerivedStateFromProps,(I=typeof A=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==ae||F!==k)&&Ig(n,d,o,k),Si=!1,F=n.memoizedState,d.state=F,Aa(n,o,d,f),Na();var P=n.memoizedState;b!==ae||F!==P||Si||e!==null&&e.dependencies!==null&&sr(e.dependencies)?(typeof A=="function"&&(Of(n,l,A,o),P=n.memoizedState),(ne=Si||Qg(n,l,ne,o,F,P,k)||e!==null&&e.dependencies!==null&&sr(e.dependencies))?(I||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(o,P,k),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(o,P,k)),typeof d.componentDidUpdate=="function"&&(n.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=P),d.props=o,d.state=P,d.context=k,o=ne):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&F===e.memoizedState||(n.flags|=1024),o=!1)}return d=o,Er(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=us(n,e.child,null,f),n.child=us(n,null,l,f)):gt(e,n,l,f),n.memoizedState=d.state,e=n.child):e=Zn(e,n,f),e}function up(e,n,l,o){return ss(),n.flags|=256,gt(e,n,l,o),n.child}var Bf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function jf(e){return{baseLanes:e,cachePool:Pm()}}function kf(e,n,l){return e=e!==null?e.childLanes&~l:0,n&&(e|=Gt),e}function fp(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?Ei(n):_i(),(e=Xe)?(e=by(e,sn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:pi!==null?{id:An,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},l=Gm(e),l.return=n,n.child=l,ht=n,Xe=null)):e=null,e===null)throw vi(n);return bd(e)?n.lanes=32:n.lanes=536870912,null}var A=o.children;return o=o.fallback,f?(_i(),f=n.mode,A=_r({mode:"hidden",children:A},f),o=is(o,f,l,null),A.return=n,o.return=n,A.sibling=o,n.child=A,o=n.child,o.memoizedState=jf(l),o.childLanes=kf(e,b,l),n.memoizedState=Bf,za(null,o)):(Ei(n),Hf(n,A))}var k=e.memoizedState;if(k!==null&&(A=k.dehydrated,A!==null)){if(d)n.flags&256?(Ei(n),n.flags&=-257,n=$f(e,n,l)):n.memoizedState!==null?(_i(),n.child=e.child,n.flags|=128,n=null):(_i(),A=o.fallback,f=n.mode,o=_r({mode:"visible",children:o.children},f),A=is(A,f,l,null),A.flags|=2,o.return=n,A.return=n,o.sibling=A,n.child=o,us(n,e.child,null,l),o=n.child,o.memoizedState=jf(l),o.childLanes=kf(e,b,l),n.memoizedState=Bf,n=za(null,o));else if(Ei(n),bd(A)){if(b=A.nextSibling&&A.nextSibling.dataset,b)var I=b.dgst;b=I,o=Error(a(419)),o.stack="",o.digest=b,ba({value:o,source:null,stack:null}),n=$f(e,n,l)}else if(ot||Ps(e,n,l,!1),b=(l&e.childLanes)!==0,ot||b){if(b=Ve,b!==null&&(o=Bo(b,l),o!==0&&o!==k.retryLane))throw k.retryLane=o,ns(e,o),Rt(b,e,o),Lf;vd(A)||Lr(),n=$f(e,n,l)}else vd(A)?(n.flags|=192,n.child=e.child,n=null):(e=k.treeContext,Xe=an(A.nextSibling),ht=n,Oe=!0,yi=null,sn=!1,e!==null&&Zm(n,e),n=Hf(n,o.children),n.flags|=4096);return n}return f?(_i(),A=o.fallback,f=n.mode,k=e.child,I=k.sibling,o=qn(k,{mode:"hidden",children:o.children}),o.subtreeFlags=k.subtreeFlags&65011712,I!==null?A=qn(I,A):(A=is(A,f,l,null),A.flags|=2),A.return=n,o.return=n,o.sibling=A,n.child=o,za(null,o),o=n.child,A=e.child.memoizedState,A===null?A=jf(l):(f=A.cachePool,f!==null?(k=lt._currentValue,f=f.parent!==k?{parent:k,pool:k}:f):f=Pm(),A={baseLanes:A.baseLanes|l,cachePool:f}),o.memoizedState=A,o.childLanes=kf(e,b,l),n.memoizedState=Bf,za(e.child,o)):(Ei(n),l=e.child,e=l.sibling,l=qn(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 Hf(e,n){return n=_r({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function _r(e,n){return e=Ut(22,e,null,n),e.lanes=0,e}function $f(e,n,l){return us(n,e.child,null,l),e=Hf(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function dp(e,n,l){e.lanes|=n;var o=e.alternate;o!==null&&(o.lanes|=n),Pu(e.return,n,l)}function Uf(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 hp(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,ee(nt,b),gt(e,n,o,l),o=Oe?va:0,!A&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&dp(e,l,n);else if(e.tag===19)dp(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&&dr(e)===null&&(f=l),l=l.sibling;l=f,l===null?(f=n.child,n.child=null):(f=l.sibling,l.sibling=null),Uf(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&&dr(e)===null){n.child=f;break}e=f.sibling,f.sibling=l,l=f,f=e}Uf(n,!0,l,null,d,o);break;case"together":Uf(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function Zn(e,n,l){if(e!==null&&(n.dependencies=e.dependencies),Ti|=n.lanes,(l&n.childLanes)===0)if(e!==null){if(Ps(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=qn(e,e.pendingProps),n.child=l,l.return=n;e.sibling!==null;)e=e.sibling,l=l.sibling=qn(e,e.pendingProps),l.return=n;l.sibling=null}return n.child}function qf(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&sr(e)))}function ww(e,n,l){switch(n.tag){case 3:te(n,n.stateNode.containerInfo),bi(n,lt,e.memoizedState.cache),ss();break;case 27:case 5:Se(n);break;case 4:te(n,n.stateNode.containerInfo);break;case 10:bi(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,df(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(Ei(n),n.flags|=128,null):(l&n.child.childLanes)!==0?fp(e,n,l):(Ei(n),e=Zn(e,n,l),e!==null?e.sibling:null);Ei(n);break;case 19:var f=(e.flags&128)!==0;if(o=(l&n.childLanes)!==0,o||(Ps(e,n,l,!1),o=(l&n.childLanes)!==0),f){if(o)return hp(e,n,l);n.flags|=128}if(f=n.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),ee(nt,nt.current),o)break;return null;case 22:return n.lanes=0,lp(e,n,l,n.pendingProps);case 24:bi(n,lt,e.memoizedState.cache)}return Zn(e,n,l)}function mp(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps)ot=!0;else{if(!qf(e,l)&&(n.flags&128)===0)return ot=!1,ww(e,n,l);ot=(e.flags&131072)!==0}else ot=!1,Oe&&(n.flags&1048576)!==0&&Km(n,va,n.index);switch(n.lanes=0,n.tag){case 16:e:{var o=n.pendingProps;if(e=rs(n.elementType),n.type=e,typeof e=="function")Xu(e)?(o=ds(e,o),n.tag=1,n=cp(null,n,e,o,l)):(n.tag=0,n=Rf(null,n,e,o,l));else{if(e!=null){var f=e.$$typeof;if(f===T){n.tag=11,n=np(null,n,e,o,l);break e}else if(f===j){n.tag=14,n=ip(null,n,e,o,l);break e}}throw n=B(e)||e,Error(a(306,n,""))}}return n;case 0:return Rf(e,n,n.type,n.pendingProps,l);case 1:return o=n.type,f=ds(o,n.pendingProps),cp(e,n,o,f,l);case 3:e:{if(te(n,n.stateNode.containerInfo),e===null)throw Error(a(387));o=n.pendingProps;var d=n.memoizedState;f=d.element,of(e,n),Aa(n,o,null,l);var b=n.memoizedState;if(o=b.cache,bi(n,lt,o),o!==d.cache&&ef(n,[lt],l,!0),Na(),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=up(e,n,o,l);break e}else if(o!==f){f=en(Error(a(424)),n),ba(f),n=up(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,yi=null,sn=!0,l=lg(n,null,o,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(ss(),o===f){n=Zn(e,n,l);break e}gt(e,n,o,l)}n=n.child}return n;case 26:return Er(e,n),e===null?(l=Ny(n.type,null,n.pendingProps,null))?n.memoizedState=l:Oe||(l=n.type,e=n.pendingProps,o=Ur(de.current).createElement(l),o[ut]=n,o[vt]=e,pt(o,l,e),st(o),n.stateNode=o):n.memoizedState=Ny(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return Se(n),e===null&&Oe&&(o=n.stateNode=xy(n.type,n.pendingProps,de.current),ht=n,sn=!0,f=Xe,Di(n.type)?(Sd=f,Xe=an(o.firstChild)):Xe=f),gt(e,n,n.pendingProps.children,l),Er(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&Oe&&((f=o=Xe)&&(o=Fw(o,n.type,n.pendingProps,sn),o!==null?(n.stateNode=o,ht=n,Xe=an(o.firstChild),sn=!1,f=!0):f=!1),f||vi(n)),Se(n),f=n.type,d=n.pendingProps,b=e!==null?e.memoizedProps:null,o=d.children,gd(f,d)?o=null:b!==null&&gd(f,b)&&(n.flags|=32),n.memoizedState!==null&&(f=mf(e,n,dw,null,null,l),Ka._currentValue=f),Er(e,n),gt(e,n,o,l),n.child;case 6:return e===null&&Oe&&((e=l=Xe)&&(l=Ww(l,n.pendingProps,sn),l!==null?(n.stateNode=l,ht=n,Xe=null,e=!0):e=!1),e||vi(n)),null;case 13:return fp(e,n,l);case 4:return te(n,n.stateNode.containerInfo),o=n.pendingProps,e===null?n.child=us(n,null,o,l):gt(e,n,o,l),n.child;case 11:return np(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,bi(n,n.type,o.value),gt(e,n,o.children,l),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,as(n),f=mt(f),o=o(f),n.flags|=1,gt(e,n,o,l),n.child;case 14:return ip(e,n,n.type,n.pendingProps,l);case 15:return sp(e,n,n.type,n.pendingProps,l);case 19:return hp(e,n,l);case 31:return Sw(e,n,l);case 22:return lp(e,n,l,n.pendingProps);case 24:return as(n),o=mt(lt),e===null?(f=sf(),f===null&&(f=Ve,d=tf(),f.pooledCache=d,d.refCount++,d!==null&&(f.pooledCacheLanes|=l),f=d),n.memoizedState={parent:o,cache:f},af(n),bi(n,lt,f)):((e.lanes&l)!==0&&(of(e,n),Aa(n,null,null,l),Na()),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),bi(n,lt,o)):(o=d.cache,bi(n,lt,o),o!==f.cache&&ef(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 Qn(e){e.flags|=4}function Vf(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(qp())e.flags|=8192;else throw cs=rr,lf}else e.flags&=-16777217}function gp(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Oy(n))if(qp())e.flags|=8192;else throw cs=rr,lf}function Nr(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Do():536870912,e.lanes|=n,fl|=n)}function Da(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 xw(e,n,l){var o=n.pendingProps;switch(Iu(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),Gn(lt),ue(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ws(n)?Qn(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Fu())),Ke(n),null;case 26:var f=n.type,d=n.memoizedState;return e===null?(Qn(n),d!==null?(Ke(n),gp(n,d)):(Ke(n),Vf(n,f,null,o,l))):d?d!==e.memoizedState?(Qn(n),Ke(n),gp(n,d)):(Ke(n),n.flags&=-16777217):(e=e.memoizedProps,e!==o&&Qn(n),Ke(n),Vf(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&&Qn(n);else{if(!o){if(n.stateNode===null)throw Error(a(166));return Ke(n),null}e=ie.current,Ws(n)?Qm(n):(e=xy(f,o,l),n.stateNode=e,Qn(n))}return Ke(n),null;case 5:if(be(n),f=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==o&&Qn(n);else{if(!o){if(n.stateNode===null)throw Error(a(166));return Ke(n),null}if(d=ie.current,Ws(n))Qm(n);else{var b=Ur(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[ut]=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&&Qn(n)}}return Ke(n),Vf(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,l),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==o&&Qn(n);else{if(typeof o!="string"&&n.stateNode===null)throw Error(a(166));if(e=de.current,Ws(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[ut]=n,e=!!(e.nodeValue===l||o!==null&&o.suppressHydrationWarning===!0||fy(e.nodeValue,l)),e||vi(n,!0)}else e=Ur(e).createTextNode(o),e[ut]=n,n.stateNode=e}return Ke(n),null;case 31:if(l=n.memoizedState,e===null||e.memoizedState!==null){if(o=Ws(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[ut]=n}else ss(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ke(n),e=!1}else l=Fu(),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=Ws(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[ut]=n}else ss(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ke(n),f=!1}else f=Fu(),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),Nr(n,n.updateQueue),Ke(n),null);case 4:return ue(),e===null&&ud(n.stateNode.containerInfo),Ke(n),null;case 10:return Gn(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)Da(o,!1);else{if(et!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(d=dr(e),d!==null){for(n.flags|=128,Da(o,!1),e=d.updateQueue,n.updateQueue=e,Nr(n,e),n.subtreeFlags=0,e=l,l=n.child;l!==null;)Ym(l,e),l=l.sibling;return ee(nt,nt.current&1|2),Oe&&Vn(n,o.treeForkCount),n.child}e=e.sibling}o.tail!==null&&tt()>Or&&(n.flags|=128,f=!0,Da(o,!1),n.lanes=4194304)}else{if(!f)if(e=dr(d),e!==null){if(n.flags|=128,f=!0,e=e.updateQueue,n.updateQueue=e,Nr(n,e),Da(o,!0),o.tail===null&&o.tailMode==="hidden"&&!d.alternate&&!Oe)return Ke(n),null}else 2*tt()-o.renderingStartTime>Or&&l!==536870912&&(n.flags|=128,f=!0,Da(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,ee(nt,f?l&1|2:l&1),Oe&&Vn(n,o.treeForkCount),e):(Ke(n),null);case 22:case 23:return Vt(n),ff(),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&&Nr(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&&$(os),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Gn(lt),Ke(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function Ew(e,n){switch(Iu(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Gn(lt),ue(),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));ss()}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));ss()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return $(nt),null;case 4:return ue(),null;case 10:return Gn(n.type),null;case 22:case 23:return Vt(n),ff(),e!==null&&$(os),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Gn(lt),null;case 25:return null;default:return null}}function pp(e,n){switch(Iu(n),n.tag){case 3:Gn(lt),ue();break;case 26:case 27:case 5:be(n);break;case 4:ue();break;case 31:n.memoizedState!==null&&Vt(n);break;case 13:Vt(n);break;case 19:$(nt);break;case 10:Gn(n.type);break;case 22:case 23:Vt(n),ff(),e!==null&&$(os);break;case 24:Gn(lt)}}function La(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){ke(n,n.return,A)}}function Ni(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 k=l,I=A;try{I()}catch(ne){ke(f,k,ne)}}}o=o.next}while(o!==d)}}catch(ne){ke(n,n.return,ne)}}function yp(e){var n=e.updateQueue;if(n!==null){var l=e.stateNode;try{og(n,l)}catch(o){ke(e,e.return,o)}}}function vp(e,n,l){l.props=ds(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(o){ke(e,n,o)}}function Ra(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){ke(e,n,f)}}function Mn(e,n){var l=e.ref,o=e.refCleanup;if(l!==null)if(typeof o=="function")try{o()}catch(f){ke(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){ke(e,n,f)}else l.current=null}function bp(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){ke(e,e.return,f)}}function Yf(e,n,l){try{var o=e.stateNode;Xw(o,e.type,l,n),o[vt]=n}catch(f){ke(e,e.return,f)}}function Sp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Di(e.type)||e.tag===4}function Gf(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Sp(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&&Di(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 Xf(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=$n));else if(o!==4&&(o===27&&Di(e.type)&&(l=e.stateNode,n=null),e=e.child,e!==null))for(Xf(e,n,l),e=e.sibling;e!==null;)Xf(e,n,l),e=e.sibling}function Ar(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&&Di(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(Ar(e,n,l),e=e.sibling;e!==null;)Ar(e,n,l),e=e.sibling}function wp(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[ut]=e,n[vt]=l}catch(d){ke(e,e.return,d)}}var In=!1,rt=!1,Kf=!1,xp=typeof WeakSet=="function"?WeakSet:Set,dt=null;function _w(e,n){if(e=e.containerInfo,hd=Zr,e=Rm(e),Hu(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,k=-1,I=0,ne=0,ae=e,F=null;t:for(;;){for(var P;ae!==l||f!==0&&ae.nodeType!==3||(A=b+f),ae!==d||o!==0&&ae.nodeType!==3||(k=b+o),ae.nodeType===3&&(b+=ae.nodeValue.length),(P=ae.firstChild)!==null;)F=ae,ae=P;for(;;){if(ae===e)break t;if(F===l&&++I===f&&(A=b),F===d&&++ne===o&&(k=b),(P=ae.nextSibling)!==null)break;ae=F,F=ae.parentNode}ae=P}l=A===-1||k===-1?null:{start:A,end:k}}else l=null}l=l||{start:0,end:0}}else l=null;for(md={focusedElem:e,selectionRange:l},Zr=!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=ds(l.type,f);e=o.getSnapshotBeforeUpdate(he,d),o.__reactInternalSnapshotBeforeUpdate=e}catch(ve){ke(l,l.return,ve)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,l=e.nodeType,l===9)yd(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":yd(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 Ep(e,n,l){var o=l.flags;switch(l.tag){case 0:case 11:case 15:Fn(e,l),o&4&&La(5,l);break;case 1:if(Fn(e,l),o&4)if(e=l.stateNode,n===null)try{e.componentDidMount()}catch(b){ke(l,l.return,b)}else{var f=ds(l.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(b){ke(l,l.return,b)}}o&64&&yp(l),o&512&&Ra(l,l.return);break;case 3:if(Fn(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{og(e,n)}catch(b){ke(l,l.return,b)}}break;case 27:n===null&&o&4&&wp(l);case 26:case 5:Fn(e,l),n===null&&o&4&&bp(l),o&512&&Ra(l,l.return);break;case 12:Fn(e,l);break;case 31:Fn(e,l),o&4&&Ap(e,l);break;case 13:Fn(e,l),o&4&&Tp(e,l),o&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=Lw.bind(null,l),Pw(e,l))));break;case 22:if(o=l.memoizedState!==null||In,!o){n=n!==null&&n.memoizedState!==null||rt,f=In;var d=rt;In=o,(rt=n)&&!d?Wn(e,l,(l.subtreeFlags&8772)!==0):Fn(e,l),In=f,rt=d}break;case 30:break;default:Fn(e,l)}}function _p(e){var n=e.alternate;n!==null&&(e.alternate=null,_p(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&na(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 Jn(e,n,l){for(l=l.child;l!==null;)Np(e,n,l),l=l.sibling}function Np(e,n,l){if(wt&&typeof wt.onCommitFiberUnmount=="function")try{wt.onCommitFiberUnmount(Ii,l)}catch{}switch(l.tag){case 26:rt||Mn(l,n),Jn(e,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:rt||Mn(l,n);var o=Ze,f=Ot;Di(l.type)&&(Ze=l.stateNode,Ot=!1),Jn(e,n,l),Ya(l.stateNode),Ze=o,Ot=f;break;case 5:rt||Mn(l,n);case 6:if(o=Ze,f=Ot,Ze=null,Jn(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){ke(l,n,d)}else try{Ze.removeChild(l.stateNode)}catch(d){ke(l,n,d)}break;case 18:Ze!==null&&(Ot?(e=Ze,yy(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),bl(e)):yy(Ze,l.stateNode));break;case 4:o=Ze,f=Ot,Ze=l.stateNode.containerInfo,Ot=!0,Jn(e,n,l),Ze=o,Ot=f;break;case 0:case 11:case 14:case 15:Ni(2,l,n),rt||Ni(4,l,n),Jn(e,n,l);break;case 1:rt||(Mn(l,n),o=l.stateNode,typeof o.componentWillUnmount=="function"&&vp(l,n,o)),Jn(e,n,l);break;case 21:Jn(e,n,l);break;case 22:rt=(o=rt)||l.memoizedState!==null,Jn(e,n,l),rt=o;break;default:Jn(e,n,l)}}function Ap(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{bl(e)}catch(l){ke(n,n.return,l)}}}function Tp(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{bl(e)}catch(l){ke(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 xp),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new xp),n;default:throw Error(a(435,e.tag))}}function Tr(e,n){var l=Nw(e);n.forEach(function(o){if(!l.has(o)){l.add(o);var f=Rw.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(Di(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));Np(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;)Mp(n,e),n=n.sibling}var hn=null;function Mp(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&&(Ni(3,e,e.return),La(3,e),Ni(5,e,e.return));break;case 1:zt(n,e),Dt(e),o&512&&(rt||l===null||Mn(l,l.return)),o&64&&In&&(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||Mn(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[Wi]||d[ut]||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[ut]=e,st(d),o=d;break e;case"link":var b=My("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=My("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[ut]=e,st(d),o=d}e.stateNode=o}else Cy(f,e.type,e.stateNode);else e.stateNode=Ty(f,o,e.memoizedProps);else d!==o?(d===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):d.count--,o===null?Cy(f,e.type,e.stateNode):Ty(f,o,e.memoizedProps)):o===null&&e.stateNode!==null&&Yf(e,e.memoizedProps,l.memoizedProps)}break;case 27:zt(n,e),Dt(e),o&512&&(rt||l===null||Mn(l,l.return)),l!==null&&o&4&&Yf(e,e.memoizedProps,l.memoizedProps);break;case 5:if(zt(n,e),Dt(e),o&512&&(rt||l===null||Mn(l,l.return)),e.flags&32){f=e.stateNode;try{Vs(f,"")}catch(he){ke(e,e.return,he)}}o&4&&e.stateNode!=null&&(f=e.memoizedProps,Yf(e,f,l!==null?l.memoizedProps:f)),o&1024&&(Kf=!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){ke(e,e.return,he)}}break;case 3:if(Yr=null,f=hn,hn=qr(n.containerInfo),zt(n,e),hn=f,Dt(e),o&4&&l!==null&&l.memoizedState.isDehydrated)try{bl(n.containerInfo)}catch(he){ke(e,e.return,he)}Kf&&(Kf=!1,Cp(e));break;case 4:o=hn,hn=qr(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,Tr(e,o)));break;case 13:zt(n,e),Dt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Cr=tt()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Tr(e,o)));break;case 22:f=e.memoizedState!==null;var k=l!==null&&l.memoizedState!==null,I=In,ne=rt;if(In=I||f,rt=ne||k,zt(n,e),rt=ne,In=I,Dt(e),o&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(l===null||k||In||rt||hs(e)),l=null,n=e;;){if(n.tag===5||n.tag===26){if(l===null){k=l=n;try{if(d=k.stateNode,f)b=d.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{A=k.stateNode;var ae=k.memoizedProps.style,F=ae!=null&&ae.hasOwnProperty("display")?ae.display:null;A.style.display=F==null||typeof F=="boolean"?"":(""+F).trim()}}catch(he){ke(k,k.return,he)}}}else if(n.tag===6){if(l===null){k=n;try{k.stateNode.nodeValue=f?"":k.memoizedProps}catch(he){ke(k,k.return,he)}}}else if(n.tag===18){if(l===null){k=n;try{var P=k.stateNode;f?vy(P,!0):vy(k.stateNode,!1)}catch(he){ke(k,k.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,Tr(e,l))));break;case 19:zt(n,e),Dt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Tr(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(Sp(o)){l=o;break}o=o.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var f=l.stateNode,d=Gf(e);Ar(e,d,f);break;case 5:var b=l.stateNode;l.flags&32&&(Vs(b,""),l.flags&=-33);var A=Gf(e);Ar(e,A,b);break;case 3:case 4:var k=l.stateNode.containerInfo,I=Gf(e);Xf(e,I,k);break;default:throw Error(a(161))}}catch(ne){ke(e,e.return,ne)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Cp(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Cp(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function Fn(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)Ep(e,n.alternate,n),n=n.sibling}function hs(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Ni(4,n,n.return),hs(n);break;case 1:Mn(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&vp(n,n.return,l),hs(n);break;case 27:Ya(n.stateNode);case 26:case 5:Mn(n,n.return),hs(n);break;case 22:n.memoizedState===null&&hs(n);break;case 30:hs(n);break;default:hs(n)}e=e.sibling}}function Wn(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:Wn(f,d,l),La(4,d);break;case 1:if(Wn(f,d,l),o=d,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(I){ke(o,o.return,I)}if(o=d,f=o.updateQueue,f!==null){var A=o.stateNode;try{var k=f.shared.hiddenCallbacks;if(k!==null)for(f.shared.hiddenCallbacks=null,f=0;f<k.length;f++)ag(k[f],A)}catch(I){ke(o,o.return,I)}}l&&b&64&&yp(d),Ra(d,d.return);break;case 27:wp(d);case 26:case 5:Wn(f,d,l),l&&o===null&&b&4&&bp(d),Ra(d,d.return);break;case 12:Wn(f,d,l);break;case 31:Wn(f,d,l),l&&b&4&&Ap(f,d);break;case 13:Wn(f,d,l),l&&b&4&&Tp(f,d);break;case 22:d.memoizedState===null&&Wn(f,d,l),Ra(d,d.return);break;case 30:break;default:Wn(f,d,l)}n=n.sibling}}function Zf(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&&Sa(l))}function Qf(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&Sa(e))}function mn(e,n,l,o){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Op(e,n,l,o),n=n.sibling}function Op(e,n,l,o){var f=n.flags;switch(n.tag){case 0:case 11:case 15:mn(e,n,l,o),f&2048&&La(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&&Sa(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(k){ke(n,n.return,k)}}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):Ba(e,n):d._visibility&2?mn(e,n,l,o):(d._visibility|=2,rl(e,n,l,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&Zf(b,n);break;case 24:mn(e,n,l,o),f&2048&&Qf(n.alternate,n);break;default:mn(e,n,l,o)}}function rl(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,k=o,I=b.flags;switch(b.tag){case 0:case 11:case 15:rl(d,b,A,k,f),La(8,b);break;case 23:break;case 22:var ne=b.stateNode;b.memoizedState!==null?ne._visibility&2?rl(d,b,A,k,f):Ba(d,b):(ne._visibility|=2,rl(d,b,A,k,f)),f&&I&2048&&Zf(b.alternate,b);break;case 24:rl(d,b,A,k,f),f&&I&2048&&Qf(b.alternate,b);break;default:rl(d,b,A,k,f)}n=n.sibling}}function Ba(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:Ba(l,o),f&2048&&Zf(o.alternate,o);break;case 24:Ba(l,o),f&2048&&Qf(o.alternate,o);break;default:Ba(l,o)}n=n.sibling}}var ja=8192;function cl(e,n,l){if(e.subtreeFlags&ja)for(e=e.child;e!==null;)zp(e,n,l),e=e.sibling}function zp(e,n,l){switch(e.tag){case 26:cl(e,n,l),e.flags&ja&&e.memoizedState!==null&&fx(l,hn,e.memoizedState,e.memoizedProps);break;case 5:cl(e,n,l);break;case 3:case 4:var o=hn;hn=qr(e.stateNode.containerInfo),cl(e,n,l),hn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=ja,ja=16777216,cl(e,n,l),ja=o):cl(e,n,l));break;default:cl(e,n,l)}}function Dp(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 ka(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,Rp(o,e)}Dp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Lp(e),e=e.sibling}function Lp(e){switch(e.tag){case 0:case 11:case 15:ka(e),e.flags&2048&&Ni(9,e,e.return);break;case 3:ka(e);break;case 12:ka(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Mr(e)):ka(e);break;default:ka(e)}}function Mr(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,Rp(o,e)}Dp(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Ni(8,n,n.return),Mr(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,Mr(n));break;default:Mr(n)}e=e.sibling}}function Rp(e,n){for(;dt!==null;){var l=dt;switch(l.tag){case 0:case 11:case 15:Ni(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:Sa(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(_p(o),o===l){dt=null;break e}if(f!==null){f.return=d,dt=f;break e}dt=d}}}var Aw={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}},Tw=typeof WeakMap=="function"?WeakMap:Map,Be=0,Ve=null,Ae=null,Me=0,je=0,Yt=null,Ai=!1,ul=!1,If=!1,Pn=0,et=0,Ti=0,ms=0,Jf=0,Gt=0,fl=0,Ha=null,Lt=null,Ff=!1,Cr=0,Bp=0,Or=1/0,zr=null,Mi=null,ft=0,Ci=null,dl=null,ei=0,Wf=0,Pf=null,jp=null,$a=0,ed=null;function Xt(){return(Be&2)!==0&&Me!==0?Me&-Me:C.T!==null?ad():jo()}function kp(){if(Gt===0)if((Me&536870912)===0||Oe){var e=Rs;Rs<<=1,(Rs&3932160)===0&&(Rs=262144),Gt=e}else Gt=536870912;return e=qt.current,e!==null&&(e.flags|=32),Gt}function Rt(e,n,l){(e===Ve&&(je===2||je===9)||e.cancelPendingCommit!==null)&&(hl(e,0),Oi(e,Me,Gt,!1)),Fi(e,l),((Be&2)===0||e!==Ve)&&(e===Ve&&((Be&2)===0&&(ms|=l),et===4&&Oi(e,Me,Gt,!1)),Cn(e))}function Hp(e,n,l){if((Be&6)!==0)throw Error(a(327));var o=!l&&(n&127)===0&&(n&e.expiredLanes)===0||Ji(e,n),f=o?Ow(e,n):nd(e,n,!0),d=o;do{if(f===0){ul&&!o&&Oi(e,n,0,!1);break}else{if(l=e.current.alternate,d&&!Mw(l)){f=nd(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=Ha;var k=A.current.memoizedState.isDehydrated;if(k&&(hl(A,b).flags|=256),b=nd(A,b,!1),b!==2){if(If&&!k){A.errorRecoveryDisabledLanes|=d,ms|=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){hl(e,0),Oi(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:Oi(o,n,Gt,!Ai);break e;case 2:Lt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(f=Cr+300-tt(),10<f)){if(Oi(o,n,Gt,!Ai),js(o,0,!0)!==0)break e;ei=n,o.timeoutHandle=gy($p.bind(null,o,l,Lt,zr,Ff,n,Gt,ms,fl,Ai,d,"Throttled",-0,0),f);break e}$p(o,l,Lt,zr,Ff,n,Gt,ms,fl,Ai,d,null,-0,0)}}break}while(!0);Cn(e)}function $p(e,n,l,o,f,d,b,A,k,I,ne,ae,F,P){if(e.timeoutHandle=-1,ae=n.subtreeFlags,ae&8192||(ae&16785408)===16785408){ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:$n},zp(n,d,ae);var he=(d&62914560)===d?Cr-tt():(d&4194048)===d?Bp-tt():0;if(he=dx(ae,he),he!==null){ei=d,e.cancelPendingCommit=he(Zp.bind(null,e,n,d,l,o,f,b,A,k,ne,ae,null,F,P)),Oi(e,d,b,!I);return}}Zp(e,n,d,l,o,f,b,A,k)}function Mw(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 Oi(e,n,l,o){n&=~Jf,n&=~ms,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&&Lo(e,l,n)}function Dr(){return(Be&6)===0?(Ua(0),!1):!0}function td(){if(Ae!==null){if(je===0)var e=Ae.return;else e=Ae,Yn=ls=null,yf(e),il=null,xa=0,e=Ae;for(;e!==null;)pp(e.alternate,e),e=e.return;Ae=null}}function hl(e,n){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Qw(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),ei=0,td(),Ve=e,Ae=l=qn(e.current,null),Me=n,je=0,Yt=null,Ai=!1,ul=Ji(e,n),If=!1,fl=Gt=Jf=ms=Ti=et=0,Lt=Ha=null,Ff=!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 Pn=n,Po(),l}function Up(e,n){_e=null,C.H=Oa,n===nl||n===or?(n=ng(),je=3):n===lf?(n=ng(),je=4):je=n===Lf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Yt=n,Ae===null&&(et=1,wr(e,en(n,e.current)))}function qp(){var e=qt.current;return e===null?!0:(Me&4194048)===Me?ln===null:(Me&62914560)===Me||(Me&536870912)!==0?e===ln:!1}function Vp(){var e=C.H;return C.H=Oa,e===null?Oa:e}function Yp(){var e=C.A;return C.A=Aw,e}function Lr(){et=4,Ai||(Me&4194048)!==Me&&qt.current!==null||(ul=!0),(Ti&134217727)===0&&(ms&134217727)===0||Ve===null||Oi(Ve,Me,Gt,!1)}function nd(e,n,l){var o=Be;Be|=2;var f=Vp(),d=Yp();(Ve!==e||Me!==n)&&(zr=null,hl(e,n)),n=!1;var b=et;e:do try{if(je!==0&&Ae!==null){var A=Ae,k=Yt;switch(je){case 8:td(),b=6;break e;case 3:case 2:case 9:case 6:qt.current===null&&(n=!0);var I=je;if(je=0,Yt=null,ml(e,A,k,I),l&&ul){b=0;break e}break;default:I=je,je=0,Yt=null,ml(e,A,k,I)}}Cw(),b=et;break}catch(ne){Up(e,ne)}while(!0);return n&&e.shellSuspendCounter++,Yn=ls=null,Be=o,C.H=f,C.A=d,Ae===null&&(Ve=null,Me=0,Po()),b}function Cw(){for(;Ae!==null;)Gp(Ae)}function Ow(e,n){var l=Be;Be|=2;var o=Vp(),f=Yp();Ve!==e||Me!==n?(zr=null,Or=tt()+500,hl(e,n)):ul=Ji(e,n);e:do try{if(je!==0&&Ae!==null){n=Ae;var d=Yt;t:switch(je){case 1:je=0,Yt=null,ml(e,n,d,1);break;case 2:case 9:if(eg(d)){je=0,Yt=null,Xp(n);break}n=function(){je!==2&&je!==9||Ve!==e||(je=7),Cn(e)},d.then(n,n);break e;case 3:je=7;break e;case 4:je=5;break e;case 7:eg(d)?(je=0,Yt=null,Xp(n)):(je=0,Yt=null,ml(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?Oy(b):A.stateNode.complete){je=0,Yt=null;var k=A.sibling;if(k!==null)Ae=k;else{var I=A.return;I!==null?(Ae=I,Rr(I)):Ae=null}break t}}je=0,Yt=null,ml(e,n,d,5);break;case 6:je=0,Yt=null,ml(e,n,d,6);break;case 8:td(),et=6;break e;default:throw Error(a(462))}}zw();break}catch(ne){Up(e,ne)}while(!0);return Yn=ls=null,C.H=o,C.A=f,Be=l,Ae!==null?0:(Ve=null,Me=0,Po(),et)}function zw(){for(;Ae!==null&&!Qi();)Gp(Ae)}function Gp(e){var n=mp(e.alternate,e,Pn);e.memoizedProps=e.pendingProps,n===null?Rr(e):Ae=n}function Xp(e){var n=e,l=n.alternate;switch(n.tag){case 15:case 0:n=rp(l,n,n.pendingProps,n.type,void 0,Me);break;case 11:n=rp(l,n,n.pendingProps,n.type.render,n.ref,Me);break;case 5:yf(n);default:pp(l,n),n=Ae=Ym(n,Pn),n=mp(l,n,Pn)}e.memoizedProps=e.pendingProps,n===null?Rr(e):Ae=n}function ml(e,n,l,o){Yn=ls=null,yf(n),il=null,xa=0;var f=n.return;try{if(bw(e,f,n,l,Me)){et=1,wr(e,en(l,e.current)),Ae=null;return}}catch(d){if(f!==null)throw Ae=f,d;et=1,wr(e,en(l,e.current)),Ae=null;return}n.flags&32768?(Oe||o===1?e=!0:ul||(Me&536870912)!==0?e=!1:(Ai=e=!0,(o===2||o===9||o===3||o===6)&&(o=qt.current,o!==null&&o.tag===13&&(o.flags|=16384))),Kp(n,e)):Rr(n)}function Rr(e){var n=e;do{if((n.flags&32768)!==0){Kp(n,Ai);return}e=n.return;var l=xw(n.alternate,n,Pn);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 Zp(e,n,l,o,f,d,b,A,k){e.cancelPendingCommit=null;do Br();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|=Yu,Su(e,l,d,b,A,k),e===Ve&&(Ae=Ve=null,Me=0),dl=n,Ci=e,ei=l,Wf=d,Pf=f,jp=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Bw(Wt,function(){return Wp(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=C.T,C.T=null,f=H.p,H.p=2,b=Be,Be|=4;try{_w(e,n,l)}finally{Be=b,H.p=f,C.T=o}}ft=1,Qp(),Ip(),Jp()}}function Qp(){if(ft===1){ft=0;var e=Ci,n=dl,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=C.T,C.T=null;var o=H.p;H.p=2;var f=Be;Be|=4;try{Mp(n,e);var d=md,b=Rm(e.containerInfo),A=d.focusedElem,k=d.selectionRange;if(b!==A&&A&&A.ownerDocument&&Lm(A.ownerDocument.documentElement,A)){if(k!==null&&Hu(A)){var I=k.start,ne=k.end;if(ne===void 0&&(ne=I),"selectionStart"in A)A.selectionStart=I,A.selectionEnd=Math.min(ne,A.value.length);else{var ae=A.ownerDocument||document,F=ae&&ae.defaultView||window;if(F.getSelection){var P=F.getSelection(),he=A.textContent.length,ve=Math.min(k.start,he),qe=k.end===void 0?ve:Math.min(k.end,he);!P.extend&&ve>qe&&(b=qe,qe=ve,ve=b);var Y=Dm(A,ve),q=Dm(A,qe);if(Y&&q&&(P.rangeCount!==1||P.anchorNode!==Y.node||P.anchorOffset!==Y.offset||P.focusNode!==q.node||P.focusOffset!==q.offset)){var Q=ae.createRange();Q.setStart(Y.node,Y.offset),P.removeAllRanges(),ve>qe?(P.addRange(Q),P.extend(q.node,q.offset)):(Q.setEnd(q.node,q.offset),P.addRange(Q))}}}}for(ae=[],P=A;P=P.parentNode;)P.nodeType===1&&ae.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<ae.length;A++){var se=ae[A];se.element.scrollLeft=se.left,se.element.scrollTop=se.top}}Zr=!!hd,md=hd=null}finally{Be=f,H.p=o,C.T=l}}e.current=n,ft=2}}function Ip(){if(ft===2){ft=0;var e=Ci,n=dl,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=C.T,C.T=null;var o=H.p;H.p=2;var f=Be;Be|=4;try{Ep(e,n.alternate,n)}finally{Be=f,H.p=o,C.T=l}}ft=3}}function Jp(){if(ft===4||ft===3){ft=0,Bn();var e=Ci,n=dl,l=ei,o=jp;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?ft=5:(ft=0,dl=Ci=null,Fp(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(Mi=null),ta(l),n=n.stateNode,wt&&typeof wt.onCommitFiberRoot=="function")try{wt.onCommitFiberRoot(Ii,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=C.T,f=H.p,H.p=2,C.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{C.T=n,H.p=f}}(ei&3)!==0&&Br(),Cn(e),f=e.pendingLanes,(l&261930)!==0&&(f&42)!==0?e===ed?$a++:($a=0,ed=e):$a=0,Ua(0)}}function Fp(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Sa(n)))}function Br(){return Qp(),Ip(),Jp(),Wp()}function Wp(){if(ft!==5)return!1;var e=Ci,n=Wf;Wf=0;var l=ta(ei),o=C.T,f=H.p;try{H.p=32>l?32:l,C.T=null,l=Pf,Pf=null;var d=Ci,b=ei;if(ft=0,dl=Ci=null,ei=0,(Be&6)!==0)throw Error(a(331));var A=Be;if(Be|=4,Lp(d.current),Op(d,d.current,b,l),Be=A,Ua(0,!1),wt&&typeof wt.onPostCommitFiberRoot=="function")try{wt.onPostCommitFiberRoot(Ii,d)}catch{}return!0}finally{H.p=f,C.T=o,Fp(e,n)}}function Pp(e,n,l){n=en(l,n),n=Df(e.stateNode,n,2),e=xi(e,n,2),e!==null&&(Fi(e,2),Cn(e))}function ke(e,n,l){if(e.tag===3)Pp(e,e,l);else for(;n!==null;){if(n.tag===3){Pp(n,e,l);break}else if(n.tag===1){var o=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof o.componentDidCatch=="function"&&(Mi===null||!Mi.has(o))){e=en(l,e),l=ep(2),o=xi(n,l,2),o!==null&&(tp(l,o,n,e),Fi(o,2),Cn(o));break}}n=n.return}}function id(e,n,l){var o=e.pingCache;if(o===null){o=e.pingCache=new Tw;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)||(If=!0,f.add(l),e=Dw.bind(null,e,n,l),n.then(e,e))}function Dw(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()-Cr?(Be&2)===0&&hl(e,0):Jf|=l,fl===Me&&(fl=0)),Cn(e)}function ey(e,n){n===0&&(n=Do()),e=ns(e,n),e!==null&&(Fi(e,n),Cn(e))}function Lw(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),ey(e,l)}function Rw(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),ey(e,l)}function Bw(e,n){return At(e,n)}var jr=null,gl=null,sd=!1,kr=!1,ld=!1,zi=0;function Cn(e){e!==gl&&e.next===null&&(gl===null?jr=gl=e:gl=gl.next=e),kr=!0,sd||(sd=!0,kw())}function Ua(e,n){if(!ld&&kr){ld=!0;do for(var l=!1,o=jr;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,sy(o,d))}else d=Me,d=js(o,o===Ve?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(d&3)===0||Ji(o,d)||(l=!0,sy(o,d));o=o.next}while(l);ld=!1}}function jw(){ty()}function ty(){kr=sd=!1;var e=0;zi!==0&&Zw()&&(e=zi);for(var n=tt(),l=null,o=jr;o!==null;){var f=o.next,d=ny(o,n);d===0?(o.next=null,l===null?jr=f:l.next=f,f===null&&(gl=l)):(l=o,(e!==0||(d&3)!==0)&&(kr=!0)),o=f}ft!==0&&ft!==5||Ua(e),zi!==0&&(zi=0)}function ny(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,k=f[b];k===-1?((A&l)===0||(A&o)!==0)&&(f[b]=bu(A,n)):k<=n&&(e.expiredLanes|=A),d&=~A}if(n=Ve,l=Me,l=js(e,e===n?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,l===0||e===n&&(je===2||je===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&kt(o),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Ji(e,l)){if(n=l&-l,n===e.callbackPriority)return n;switch(o!==null&&kt(o),ta(l)){case 2:case 8:l=Ft;break;case 32:l=Wt;break;case 268435456:l=Ds;break;default:l=Wt}return o=iy.bind(null,e),l=At(l,o),e.callbackPriority=n,e.callbackNode=l,n}return o!==null&&o!==null&&kt(o),e.callbackPriority=2,e.callbackNode=null,2}function iy(e,n){if(ft!==0&&ft!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Br()&&e.callbackNode!==l)return null;var o=Me;return o=js(e,e===Ve?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Hp(e,o,n),ny(e,tt()),e.callbackNode!=null&&e.callbackNode===l?iy.bind(null,e):null)}function sy(e,n){if(Br())return null;Hp(e,n,!0)}function kw(){Iw(function(){(Be&6)!==0?At(Jt,jw):ty()})}function ad(){if(zi===0){var e=el;e===0&&(e=Ls,Ls<<=1,(Ls&261888)===0&&(Ls=256)),zi=e}return zi}function ly(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Xo(""+e)}function ay(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 Hw(e,n,l,o,f){if(n==="submit"&&l&&l.stateNode===f){var d=ly((f[vt]||null).action),b=o.submitter;b&&(n=(n=b[vt]||null)?ly(n.formAction):b.getAttribute("formAction"),n!==null&&(d=n,b=null));var A=new Io("action","action",null,o,f);e.push({event:A,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(zi!==0){var k=b?ay(f,b):new FormData(f);Af(l,{pending:!0,data:k,method:f.method,action:d},null,k)}}else typeof d=="function"&&(A.preventDefault(),k=b?ay(f,b):new FormData(f),Af(l,{pending:!0,data:k,method:f.method,action:d},d,k))},currentTarget:f}]})}}for(var od=0;od<Vu.length;od++){var rd=Vu[od],$w=rd.toLowerCase(),Uw=rd[0].toUpperCase()+rd.slice(1);dn($w,"on"+Uw)}dn(km,"onAnimationEnd"),dn(Hm,"onAnimationIteration"),dn($m,"onAnimationStart"),dn("dblclick","onDoubleClick"),dn("focusin","onFocus"),dn("focusout","onBlur"),dn(nw,"onTransitionRun"),dn(iw,"onTransitionStart"),dn(sw,"onTransitionCancel"),dn(Um,"onTransitionEnd"),hi("onMouseEnter",["mouseout","mouseover"]),hi("onMouseLeave",["mouseout","mouseover"]),hi("onPointerEnter",["pointerout","pointerover"]),hi("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 qa="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(" "),qw=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qa));function oy(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],k=A.instance,I=A.currentTarget;if(A=A.listener,k!==d&&f.isPropagationStopped())break e;d=A,f.currentTarget=I;try{d(f)}catch(ne){Wo(ne)}f.currentTarget=null,d=k}else for(b=0;b<o.length;b++){if(A=o[b],k=A.instance,I=A.currentTarget,A=A.listener,k!==d&&f.isPropagationStopped())break e;d=A,f.currentTarget=I;try{d(f)}catch(ne){Wo(ne)}f.currentTarget=null,d=k}}}}function Te(e,n){var l=n[ks];l===void 0&&(l=n[ks]=new Set);var o=e+"__bubble";l.has(o)||(ry(n,e,2,!1),l.add(o))}function cd(e,n,l){var o=0;n&&(o|=4),ry(l,e,o,n)}var Hr="_reactListening"+Math.random().toString(36).slice(2);function ud(e){if(!e[Hr]){e[Hr]=!0,Uo.forEach(function(l){l!=="selectionchange"&&(qw.has(l)||cd(l,!1,e),cd(l,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Hr]||(n[Hr]=!0,cd("selectionchange",!1,n))}}function ry(e,n,l,o){switch(ky(n)){case 2:var f=gx;break;case 8:f=px;break;default:f=Nd}l=f.bind(null,n,l,e),f=void 0,!Cu||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 fd(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 k=b.tag;if((k===3||k===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;A!==null;){if(b=ci(A),b===null)return;if(k=b.tag,k===5||k===6||k===26||k===27){o=d=b;continue e}A=A.parentNode}}o=o.return}hm(function(){var I=d,ne=Tu(l),ae=[];e:{var F=qm.get(e);if(F!==void 0){var P=Io,he=e;switch(e){case"keypress":if(Zo(l)===0)break e;case"keydown":case"keyup":P=RS;break;case"focusin":he="focus",P=Lu;break;case"focusout":he="blur",P=Lu;break;case"beforeblur":case"afterblur":P=Lu;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":P=pm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":P=xS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":P=kS;break;case km:case Hm:case $m:P=NS;break;case Um:P=$S;break;case"scroll":case"scrollend":P=SS;break;case"wheel":P=qS;break;case"copy":case"cut":case"paste":P=TS;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":P=vm;break;case"toggle":case"beforetoggle":P=YS}var ve=(n&4)!==0,qe=!ve&&(e==="scroll"||e==="scrollend"),Y=ve?F!==null?F+"Capture":null:F;ve=[];for(var q=I,Q;q!==null;){var se=q;if(Q=se.stateNode,se=se.tag,se!==5&&se!==26&&se!==27||Q===null||Y===null||(se=ca(q,Y),se!=null&&ve.push(Va(q,se,Q))),qe)break;q=q.return}0<ve.length&&(F=new P(F,he,null,l,ne),ae.push({event:F,listeners:ve}))}}if((n&7)===0){e:{if(F=e==="mouseover"||e==="pointerover",P=e==="mouseout"||e==="pointerout",F&&l!==Au&&(he=l.relatedTarget||l.fromElement)&&(ci(he)||he[kn]))break e;if((P||F)&&(F=ne.window===ne?ne:(F=ne.ownerDocument)?F.defaultView||F.parentWindow:window,P?(he=l.relatedTarget||l.toElement,P=I,he=he?ci(he):null,he!==null&&(qe=c(he),ve=he.tag,he!==qe||ve!==5&&ve!==27&&ve!==6)&&(he=null)):(P=null,he=I),P!==he)){if(ve=pm,se="onMouseLeave",Y="onMouseEnter",q="mouse",(e==="pointerout"||e==="pointerover")&&(ve=vm,se="onPointerLeave",Y="onPointerEnter",q="pointer"),qe=P==null?F:fi(P),Q=he==null?F:fi(he),F=new ve(se,q+"leave",P,l,ne),F.target=qe,F.relatedTarget=Q,se=null,ci(ne)===I&&(ve=new ve(Y,q+"enter",he,l,ne),ve.target=Q,ve.relatedTarget=qe,se=ve),qe=se,P&&he)t:{for(ve=Vw,Y=P,q=he,Q=0,se=Y;se;se=ve(se))Q++;se=0;for(var pe=q;pe;pe=ve(pe))se++;for(;0<Q-se;)Y=ve(Y),Q--;for(;0<se-Q;)q=ve(q),se--;for(;Q--;){if(Y===q||q!==null&&Y===q.alternate){ve=Y;break t}Y=ve(Y),q=ve(q)}ve=null}else ve=null;P!==null&&cy(ae,F,P,ve,!1),he!==null&&qe!==null&&cy(ae,qe,he,ve,!0)}}e:{if(F=I?fi(I):window,P=F.nodeName&&F.nodeName.toLowerCase(),P==="select"||P==="input"&&F.type==="file")var Le=Am;else if(_m(F))if(Tm)Le=PS;else{Le=FS;var me=JS}else P=F.nodeName,!P||P.toLowerCase()!=="input"||F.type!=="checkbox"&&F.type!=="radio"?I&&Nu(I.elementType)&&(Le=Am):Le=WS;if(Le&&(Le=Le(e,I))){Nm(ae,Le,l,ne);break e}me&&me(e,F,I),e==="focusout"&&I&&F.type==="number"&&I.memoizedProps.value!=null&&oa(F,"number",F.value)}switch(me=I?fi(I):window,e){case"focusin":(_m(me)||me.contentEditable==="true")&&(Ks=me,$u=I,ya=null);break;case"focusout":ya=$u=Ks=null;break;case"mousedown":Uu=!0;break;case"contextmenu":case"mouseup":case"dragend":Uu=!1,Bm(ae,l,ne);break;case"selectionchange":if(tw)break;case"keydown":case"keyup":Bm(ae,l,ne)}var Ne;if(Bu)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 Xs?xm(e,l)&&(Ce="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Ce="onCompositionStart");Ce&&(bm&&l.locale!=="ko"&&(Xs||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Xs&&(Ne=mm()):(gi=ne,Ou="value"in gi?gi.value:gi.textContent,Xs=!0)),me=$r(I,Ce),0<me.length&&(Ce=new ym(Ce,e,null,l,ne),ae.push({event:Ce,listeners:me}),Ne?Ce.data=Ne:(Ne=Em(l),Ne!==null&&(Ce.data=Ne)))),(Ne=XS?KS(e,l):ZS(e,l))&&(Ce=$r(I,"onBeforeInput"),0<Ce.length&&(me=new ym("onBeforeInput","beforeinput",null,l,ne),ae.push({event:me,listeners:Ce}),me.data=Ne)),Hw(ae,e,I,l,ne)}oy(ae,n)})}function Va(e,n,l){return{instance:e,listener:n,currentTarget:l}}function $r(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=ca(e,l),f!=null&&o.unshift(Va(e,f,d)),f=ca(e,n),f!=null&&o.push(Va(e,f,d))),e.tag===3)return o;e=e.return}return[]}function Vw(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function cy(e,n,l,o,f){for(var d=n._reactName,b=[];l!==null&&l!==o;){var A=l,k=A.alternate,I=A.stateNode;if(A=A.tag,k!==null&&k===o)break;A!==5&&A!==26&&A!==27||I===null||(k=I,f?(I=ca(l,d),I!=null&&b.unshift(Va(l,I,k))):f||(I=ca(l,d),I!=null&&b.push(Va(l,I,k)))),l=l.return}b.length!==0&&e.push({event:n,listeners:b})}var Yw=/\r\n?/g,Gw=/\u0000|\uFFFD/g;function uy(e){return(typeof e=="string"?e:""+e).replace(Yw,`
|
|
9
|
+
`).replace(Gw,"")}function fy(e,n){return n=uy(n),uy(e)===n}function Ue(e,n,l,o,f,d){switch(l){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||Vs(e,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&Vs(e,""+o);break;case"className":$s(e,"class",o);break;case"tabIndex":$s(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":$s(e,l,o);break;case"style":fm(e,o,d);break;case"data":if(n!=="object"){$s(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=Xo(""+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=Xo(""+o),e.setAttribute(l,o);break;case"onClick":o!=null&&(e.onclick=$n);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=Xo(""+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),Hs(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":Hs(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=vS.get(l)||l,Hs(e,l,o))}}function dd(e,n,l,o,f,d){switch(l){case"style":fm(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"?Vs(e,o):(typeof o=="number"||typeof o=="bigint")&&Vs(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=$n);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!qo.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,""):Hs(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,k=null,I=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":k=ne;break;case"defaultChecked":I=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)}}qs(e,d,A,k,I,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?mi(e,!!o,n,!1):l!=null&&mi(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)}cm(e,o,f,d);return;case"option":for(k in l)l.hasOwnProperty(k)&&(o=l[k],o!=null)&&(k==="selected"?e.selected=o&&typeof o!="function"&&typeof o!="symbol":Ue(e,n,k,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<qa.length;o++)Te(qa[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(I in l)if(l.hasOwnProperty(I)&&(o=l[I],o!=null))switch(I){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Ue(e,n,I,o,l,null)}return;default:if(Nu(n)){for(ne in l)l.hasOwnProperty(ne)&&(o=l[ne],o!==void 0&&dd(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,k=null,I=null,ne=null;for(P in l){var ae=l[P];if(l.hasOwnProperty(P)&&ae!=null)switch(P){case"checked":break;case"value":break;case"defaultValue":k=ae;default:o.hasOwnProperty(P)||Ue(e,n,P,null,o,ae)}}for(var F in o){var P=o[F];if(ae=l[F],o.hasOwnProperty(F)&&(P!=null||ae!=null))switch(F){case"type":d=P;break;case"name":f=P;break;case"checked":I=P;break;case"defaultChecked":ne=P;break;case"value":b=P;break;case"defaultValue":A=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(a(137,n));break;default:P!==ae&&Ue(e,n,F,P,o,ae)}}aa(e,b,A,k,I,ne,d,f);return;case"select":P=b=A=F=null;for(d in l)if(k=l[d],l.hasOwnProperty(d)&&k!=null)switch(d){case"value":break;case"multiple":P=k;default:o.hasOwnProperty(d)||Ue(e,n,d,null,o,k)}for(f in o)if(d=o[f],k=l[f],o.hasOwnProperty(f)&&(d!=null||k!=null))switch(f){case"value":F=d;break;case"defaultValue":A=d;break;case"multiple":b=d;default:d!==k&&Ue(e,n,f,d,o,k)}n=A,l=b,o=P,F!=null?mi(e,!!l,F,!1):!!o!=!!l&&(n!=null?mi(e,!!l,n,!0):mi(e,!!l,l?[]:"",!1));return;case"textarea":P=F=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":F=f;break;case"defaultValue":P=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)}ra(e,F,P);return;case"option":for(var he in l)F=l[he],l.hasOwnProperty(he)&&F!=null&&!o.hasOwnProperty(he)&&(he==="selected"?e.selected=!1:Ue(e,n,he,null,o,F));for(k in o)F=o[k],P=l[k],o.hasOwnProperty(k)&&F!==P&&(F!=null||P!=null)&&(k==="selected"?e.selected=F&&typeof F!="function"&&typeof F!="symbol":Ue(e,n,k,F,o,P));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ve in l)F=l[ve],l.hasOwnProperty(ve)&&F!=null&&!o.hasOwnProperty(ve)&&Ue(e,n,ve,null,o,F);for(I in o)if(F=o[I],P=l[I],o.hasOwnProperty(I)&&F!==P&&(F!=null||P!=null))switch(I){case"children":case"dangerouslySetInnerHTML":if(F!=null)throw Error(a(137,n));break;default:Ue(e,n,I,F,o,P)}return;default:if(Nu(n)){for(var qe in l)F=l[qe],l.hasOwnProperty(qe)&&F!==void 0&&!o.hasOwnProperty(qe)&&dd(e,n,qe,void 0,o,F);for(ne in o)F=o[ne],P=l[ne],!o.hasOwnProperty(ne)||F===P||F===void 0&&P===void 0||dd(e,n,ne,F,o,P);return}}for(var Y in l)F=l[Y],l.hasOwnProperty(Y)&&F!=null&&!o.hasOwnProperty(Y)&&Ue(e,n,Y,null,o,F);for(ae in o)F=o[ae],P=l[ae],!o.hasOwnProperty(ae)||F===P||F==null&&P==null||Ue(e,n,ae,F,o,P)}function dy(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Kw(){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&&dy(b)){for(b=0,A=f.responseEnd,o+=1;o<l.length;o++){var k=l[o],I=k.startTime;if(I>A)break;var ne=k.transferSize,ae=k.initiatorType;ne&&dy(ae)&&(k=k.responseEnd,b+=ne*(k<A?1:(A-I)/(k-I)))}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 hd=null,md=null;function Ur(e){return e.nodeType===9?e:e.ownerDocument}function hy(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 my(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 gd(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 pd=null;function Zw(){var e=window.event;return e&&e.type==="popstate"?e===pd?!1:(pd=e,!0):(pd=null,!1)}var gy=typeof setTimeout=="function"?setTimeout:void 0,Qw=typeof clearTimeout=="function"?clearTimeout:void 0,py=typeof Promise=="function"?Promise:void 0,Iw=typeof queueMicrotask=="function"?queueMicrotask:typeof py<"u"?function(e){return py.resolve(null).then(e).catch(Jw)}:gy;function Jw(e){setTimeout(function(){throw e})}function Di(e){return e==="head"}function yy(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),bl(n);return}o--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")o++;else if(l==="html")Ya(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Ya(l);for(var d=l.firstChild;d;){var b=d.nextSibling,A=d.nodeName;d[Wi]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&d.rel.toLowerCase()==="stylesheet"||l.removeChild(d),d=b}}else l==="body"&&Ya(e.ownerDocument.body);l=f}while(l);bl(n)}function vy(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 yd(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":yd(l),na(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Fw(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[Wi])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 Ww(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 by(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 vd(e){return e.data==="$?"||e.data==="$~"}function bd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Pw(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 Sd=null;function Sy(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 wy(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 xy(e,n,l){switch(n=Ur(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 Ya(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);na(e)}var on=new Map,Ey=new Set;function qr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ti=H.d;H.d={f:ex,r:tx,D:nx,C:ix,L:sx,m:lx,X:ox,S:ax,M:rx};function ex(){var e=ti.f(),n=Dr();return e||n}function tx(e){var n=ui(e);n!==null&&n.tag===5&&n.type==="form"?Ug(n):ti.r(e)}var pl=typeof document>"u"?null:document;function _y(e,n,l){var o=pl;if(o&&typeof n=="string"&&n){var f=Mt(n);f='link[rel="'+e+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),Ey.has(f)||(Ey.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 nx(e){ti.D(e),_y("dns-prefetch",e,null)}function ix(e,n){ti.C(e,n),_y("preconnect",e,n)}function sx(e,n,l){ti.L(e,n,l);var o=pl;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=yl(e);break;case"script":d=vl(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(Ga(d))||n==="script"&&o.querySelector(Xa(d))||(n=o.createElement("link"),pt(n,"link",e),st(n),o.head.appendChild(n)))}}function lx(e,n){ti.m(e,n);var l=pl;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=vl(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(Xa(d)))return}o=l.createElement("link"),pt(o,"link",e),st(o),l.head.appendChild(o)}}}function ax(e,n,l){ti.S(e,n,l);var o=pl;if(o&&e){var f=di(o).hoistableStyles,d=yl(e);n=n||"default";var b=f.get(d);if(!b){var A={loading:0,preload:null};if(b=o.querySelector(Ga(d)))A.loading=5;else{e=p({rel:"stylesheet",href:e,"data-precedence":n},l),(l=on.get(d))&&wd(e,l);var k=b=o.createElement("link");st(k),pt(k,"link",e),k._p=new Promise(function(I,ne){k.onload=I,k.onerror=ne}),k.addEventListener("load",function(){A.loading|=1}),k.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Vr(b,n,o)}b={type:"stylesheet",instance:b,count:1,state:A},f.set(d,b)}}}function ox(e,n){ti.X(e,n);var l=pl;if(l&&e){var o=di(l).hoistableScripts,f=vl(e),d=o.get(f);d||(d=l.querySelector(Xa(f)),d||(e=p({src:e,async:!0},n),(n=on.get(f))&&xd(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 rx(e,n){ti.M(e,n);var l=pl;if(l&&e){var o=di(l).hoistableScripts,f=vl(e),d=o.get(f);d||(d=l.querySelector(Xa(f)),d||(e=p({src:e,async:!0,type:"module"},n),(n=on.get(f))&&xd(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 Ny(e,n,l,o){var f=(f=de.current)?qr(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=yl(l.href),l=di(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=yl(l.href);var d=di(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(Ga(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||cx(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=vl(l),l=di(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 yl(e){return'href="'+Mt(e)+'"'}function Ga(e){return'link[rel="stylesheet"]['+e+"]"}function Ay(e){return p({},e,{"data-precedence":e.precedence,precedence:null})}function cx(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 vl(e){return'[src="'+Mt(e)+'"]'}function Xa(e){return"script[async]"+e}function Ty(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),Vr(o,l.precedence,e),n.instance=o;case"stylesheet":f=yl(l.href);var d=e.querySelector(Ga(f));if(d)return n.state.loading|=4,n.instance=d,st(d),d;o=Ay(l),(f=on.get(f))&&wd(o,f),d=(e.ownerDocument||e).createElement("link"),st(d);var b=d;return b._p=new Promise(function(A,k){b.onload=A,b.onerror=k}),pt(d,"link",o),n.state.loading|=4,Vr(d,l.precedence,e),n.instance=d;case"script":return d=vl(l.src),(f=e.querySelector(Xa(d)))?(n.instance=f,st(f),f):(o=l,(f=on.get(d))&&(o=p({},l),xd(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,Vr(o,l.precedence,e));return n.instance}function Vr(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 wd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function xd(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var Yr=null;function My(e,n,l){if(Yr===null){var o=new Map,f=Yr=new Map;f.set(l,o)}else f=Yr,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[Wi]||d[ut]||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 Cy(e,n,l){e=e.ownerDocument||e,e.head.insertBefore(l,n==="title"?e.querySelector("head > title"):null)}function ux(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 Oy(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function fx(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=yl(o.href),d=n.querySelector(Ga(f));if(d){n=d._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=Gr.bind(e),n.then(e,e)),l.state.loading|=4,l.instance=d,st(d);return}d=n.ownerDocument||n,o=Ay(o),(f=on.get(f))&&wd(o,f),d=d.createElement("link"),st(d);var b=d;b._p=new Promise(function(A,k){b.onload=A,b.onerror=k}),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=Gr.bind(e),n.addEventListener("load",l),n.addEventListener("error",l))}}var Ed=0;function dx(e,n){return e.stylesheets&&e.count===0&&Kr(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var o=setTimeout(function(){if(e.stylesheets&&Kr(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+n);0<e.imgBytes&&Ed===0&&(Ed=62500*Kw());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Kr(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>Ed?50:800)+n);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(o),clearTimeout(f)}}:null}function Gr(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Xr=null;function Kr(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xr=new Map,n.forEach(hx,e),Xr=null,Gr.call(e))}function hx(e,n){if(!(n.state.loading&4)){var l=Xr.get(e);if(l)var o=l.get(null);else{l=new Map,Xr.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=Gr.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 Ka={$$typeof:x,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function mx(e,n,l,o,f,d,b,A,k){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=Pl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Pl(0),this.hiddenUpdates=Pl(null),this.identifierPrefix=o,this.onUncaughtError=f,this.onCaughtError=d,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=k,this.incompleteTransitions=new Map}function zy(e,n,l,o,f,d,b,A,k,I,ne,ae){return e=new mx(e,n,l,b,k,I,ne,ae,A),n=1,d===!0&&(n|=24),d=Ut(3,null,null,n),e.current=d,d.stateNode=e,n=tf(),n.refCount++,e.pooledCache=n,n.refCount++,d.memoizedState={element:o,isDehydrated:l,cache:n},af(d),e}function Dy(e){return e?(e=Is,e):Is}function Ly(e,n,l,o,f,d){f=Dy(f),o.context===null?o.context=f:o.pendingContext=f,o=wi(n),o.payload={element:l},d=d===void 0?null:d,d!==null&&(o.callback=d),l=xi(e,o,n),l!==null&&(Rt(l,e,n),_a(l,e,n))}function Ry(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<n?l:n}}function _d(e,n){Ry(e,n),(e=e.alternate)&&Ry(e,n)}function By(e){if(e.tag===13||e.tag===31){var n=ns(e,67108864);n!==null&&Rt(n,e,67108864),_d(e,67108864)}}function jy(e){if(e.tag===13||e.tag===31){var n=Xt();n=ea(n);var l=ns(e,n);l!==null&&Rt(l,e,n),_d(e,n)}}var Zr=!0;function gx(e,n,l,o){var f=C.T;C.T=null;var d=H.p;try{H.p=2,Nd(e,n,l,o)}finally{H.p=d,C.T=f}}function px(e,n,l,o){var f=C.T;C.T=null;var d=H.p;try{H.p=8,Nd(e,n,l,o)}finally{H.p=d,C.T=f}}function Nd(e,n,l,o){if(Zr){var f=Ad(o);if(f===null)fd(e,n,o,Qr,l),Hy(e,o);else if(vx(f,e,n,l,o))o.stopPropagation();else if(Hy(e,o),n&4&&-1<yx.indexOf(e)){for(;f!==null;){var d=ui(f);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var b=jn(d.pendingLanes);if(b!==0){var A=d;for(A.pendingLanes|=2,A.entangledLanes|=2;b;){var k=1<<31-xt(b);A.entanglements[1]|=k,b&=~k}Cn(d),(Be&6)===0&&(Or=tt()+500,Ua(0))}}break;case 31:case 13:A=ns(d,2),A!==null&&Rt(A,d,2),Dr(),_d(d,2)}if(d=Ad(o),d===null&&fd(e,n,o,Qr,l),d===f)break;f=d}f!==null&&o.stopPropagation()}else fd(e,n,o,null,l)}}function Ad(e){return e=Tu(e),Td(e)}var Qr=null;function Td(e){if(Qr=null,e=ci(e),e!==null){var n=c(e);if(n===null)e=null;else{var l=n.tag;if(l===13){if(e=u(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 Qr=e,null}function ky(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(Ht()){case Jt:return 2;case Ft:return 8;case Wt:case hu:return 32;case Ds:return 268435456;default:return 32}default:return 32}}var Md=!1,Li=null,Ri=null,Bi=null,Za=new Map,Qa=new Map,ji=[],yx="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 Hy(e,n){switch(e){case"focusin":case"focusout":Li=null;break;case"dragenter":case"dragleave":Ri=null;break;case"mouseover":case"mouseout":Bi=null;break;case"pointerover":case"pointerout":Za.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qa.delete(n.pointerId)}}function Ia(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=ui(n),n!==null&&By(n)),e):(e.eventSystemFlags|=o,n=e.targetContainers,f!==null&&n.indexOf(f)===-1&&n.push(f),e)}function vx(e,n,l,o,f){switch(n){case"focusin":return Li=Ia(Li,e,n,l,o,f),!0;case"dragenter":return Ri=Ia(Ri,e,n,l,o,f),!0;case"mouseover":return Bi=Ia(Bi,e,n,l,o,f),!0;case"pointerover":var d=f.pointerId;return Za.set(d,Ia(Za.get(d)||null,e,n,l,o,f)),!0;case"gotpointercapture":return d=f.pointerId,Qa.set(d,Ia(Qa.get(d)||null,e,n,l,o,f)),!0}return!1}function $y(e){var n=ci(e.target);if(n!==null){var l=c(n);if(l!==null){if(n=l.tag,n===13){if(n=u(l),n!==null){e.blockedOn=n,ko(e.priority,function(){jy(l)});return}}else if(n===31){if(n=m(l),n!==null){e.blockedOn=n,ko(e.priority,function(){jy(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 Ir(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var l=Ad(e.nativeEvent);if(l===null){l=e.nativeEvent;var o=new l.constructor(l.type,l);Au=o,l.target.dispatchEvent(o),Au=null}else return n=ui(l),n!==null&&By(n),e.blockedOn=l,!1;n.shift()}return!0}function Uy(e,n,l){Ir(e)&&l.delete(n)}function bx(){Md=!1,Li!==null&&Ir(Li)&&(Li=null),Ri!==null&&Ir(Ri)&&(Ri=null),Bi!==null&&Ir(Bi)&&(Bi=null),Za.forEach(Uy),Qa.forEach(Uy)}function Jr(e,n){e.blockedOn===n&&(e.blockedOn=null,Md||(Md=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,bx)))}var Fr=null;function qy(e){Fr!==e&&(Fr=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Fr===e&&(Fr=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(Td(o||l)===null)continue;break}var d=ui(l);d!==null&&(e.splice(n,3),n-=3,Af(d,{pending:!0,data:f,method:l.method,action:o},o,f))}}))}function bl(e){function n(k){return Jr(k,e)}Li!==null&&Jr(Li,e),Ri!==null&&Jr(Ri,e),Bi!==null&&Jr(Bi,e),Za.forEach(n),Qa.forEach(n);for(var l=0;l<ji.length;l++){var o=ji[l];o.blockedOn===e&&(o.blockedOn=null)}for(;0<ji.length&&(l=ji[0],l.blockedOn===null);)$y(l),l.blockedOn===null&&ji.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||qy(l);else if(b){var A=null;if(d&&d.hasAttribute("formAction")){if(f=d,b=d[vt]||null)A=b.formAction;else if(Td(f)!==null)continue}else A=b.action;typeof A=="function"?l[o+1]=A:(l.splice(o,3),o-=3),qy(l)}}}function Vy(){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 Cd(e){this._internalRoot=e}Wr.prototype.render=Cd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var l=n.current,o=Xt();Ly(l,o,e,n,null,null)},Wr.prototype.unmount=Cd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;Ly(e.current,2,null,e,null,null),Dr(),n[kn]=null}};function Wr(e){this._internalRoot=e}Wr.prototype.unstable_scheduleHydration=function(e){if(e){var n=jo();e={blockedOn:null,target:e,priority:n};for(var l=0;l<ji.length&&n!==0&&n<ji[l].priority;l++);ji.splice(l,0,e),l===0&&$y(e)}};var Yy=i.version;if(Yy!=="19.2.7")throw Error(a(527,Yy,"19.2.7"));H.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 Sx={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:C,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pr.isDisabled&&Pr.supportsFiber)try{Ii=Pr.inject(Sx),wt=Pr}catch{}}return Fa.createRoot=function(e,n){if(!r(e))throw Error(a(299));var l=!1,o="",f=Jg,d=Fg,b=Wg;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=zy(e,1,!1,null,null,l,o,null,f,d,b,Vy),e[kn]=n.current,ud(e),new Cd(n)},Fa.hydrateRoot=function(e,n,l){if(!r(e))throw Error(a(299));var o=!1,f="",d=Jg,b=Fg,A=Wg,k=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&&(k=l.formState)),n=zy(e,1,!0,n,l??null,o,f,k,d,b,A,Vy),n.context=Dy(null),l=n.current,o=Xt(),o=ea(o),f=wi(o),f.callback=null,xi(l,f,o),l=o,n.current.lanes=l,Fi(n,l),Cn(n),e[kn]=n.current,ud(e),new Wr(n)},Fa.version="19.2.7",Fa}var Py;function Cx(){if(Py)return Dd.exports;Py=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(),Dd.exports=Mx(),Dd.exports}var Ox=Cx();function ct(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=ct(t[s]))!==""&&(i+=(i&&" ")+a);else for(let s in t)t[s]&&(i+=(i&&" ")+s);return i}var zx={value:()=>{}};function Uc(){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 gc(s)}function gc(t){this._=t}function Dx(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}})}gc.prototype=Uc.prototype={constructor:gc,on:function(t,i){var s=this._,a=Dx(t+"",s),r,c=-1,u=a.length;if(arguments.length<2){for(;++c<u;)if((r=(t=a[c]).type)&&(r=Lx(s[r],t.name)))return r;return}if(i!=null&&typeof i!="function")throw new Error("invalid callback: "+i);for(;++c<u;)if(r=(t=a[c]).type)s[r]=e0(s[r],t.name,i);else if(i==null)for(r in s)s[r]=e0(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 gc(t)},call:function(t,i){if((r=arguments.length-2)>0)for(var s=new Array(r),a=0,r,c;a<r;++a)s[a]=arguments[a+2];if(!this._.hasOwnProperty(t))throw new Error("unknown type: "+t);for(c=this._[t],a=0,r=c.length;a<r;++a)c[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,c=a.length;r<c;++r)a[r].value.apply(i,s)}};function Lx(t,i){for(var s=0,a=t.length,r;s<a;++s)if((r=t[s]).name===i)return r.value}function e0(t,i,s){for(var a=0,r=t.length;a<r;++a)if(t[a].name===i){t[a]=zx,t=t.slice(0,a).concat(t.slice(a+1));break}return s!=null&&t.push({name:i,value:s}),t}var ah="http://www.w3.org/1999/xhtml";const t0={svg:"http://www.w3.org/2000/svg",xhtml:ah,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function qc(t){var i=t+="",s=i.indexOf(":");return s>=0&&(i=t.slice(0,s))!=="xmlns"&&(t=t.slice(s+1)),t0.hasOwnProperty(i)?{space:t0[i],local:t}:t}function Rx(t){return function(){var i=this.ownerDocument,s=this.namespaceURI;return s===ah&&i.documentElement.namespaceURI===ah?i.createElement(t):i.createElementNS(s,t)}}function Bx(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Ov(t){var i=qc(t);return(i.local?Bx:Rx)(i)}function jx(){}function Oh(t){return t==null?jx:function(){return this.querySelector(t)}}function kx(t){typeof t!="function"&&(t=Oh(t));for(var i=this._groups,s=i.length,a=new Array(s),r=0;r<s;++r)for(var c=i[r],u=c.length,m=a[r]=new Array(u),h,g,v=0;v<u;++v)(h=c[v])&&(g=t.call(h,h.__data__,v,c))&&("__data__"in h&&(g.__data__=h.__data__),m[v]=g);return new Qt(a,this._parents)}function Hx(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function $x(){return[]}function zv(t){return t==null?$x:function(){return this.querySelectorAll(t)}}function Ux(t){return function(){return Hx(t.apply(this,arguments))}}function qx(t){typeof t=="function"?t=Ux(t):t=zv(t);for(var i=this._groups,s=i.length,a=[],r=[],c=0;c<s;++c)for(var u=i[c],m=u.length,h,g=0;g<m;++g)(h=u[g])&&(a.push(t.call(h,h.__data__,g,u)),r.push(h));return new Qt(a,r)}function Dv(t){return function(){return this.matches(t)}}function Lv(t){return function(i){return i.matches(t)}}var Vx=Array.prototype.find;function Yx(t){return function(){return Vx.call(this.children,t)}}function Gx(){return this.firstElementChild}function Xx(t){return this.select(t==null?Gx:Yx(typeof t=="function"?t:Lv(t)))}var Kx=Array.prototype.filter;function Zx(){return Array.from(this.children)}function Qx(t){return function(){return Kx.call(this.children,t)}}function Ix(t){return this.selectAll(t==null?Zx:Qx(typeof t=="function"?t:Lv(t)))}function Jx(t){typeof t!="function"&&(t=Dv(t));for(var i=this._groups,s=i.length,a=new Array(s),r=0;r<s;++r)for(var c=i[r],u=c.length,m=a[r]=[],h,g=0;g<u;++g)(h=c[g])&&t.call(h,h.__data__,g,c)&&m.push(h);return new Qt(a,this._parents)}function Rv(t){return new Array(t.length)}function Fx(){return new Qt(this._enter||this._groups.map(Rv),this._parents)}function Nc(t,i){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=i}Nc.prototype={constructor:Nc,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 Wx(t){return function(){return t}}function Px(t,i,s,a,r,c){for(var u=0,m,h=i.length,g=c.length;u<g;++u)(m=i[u])?(m.__data__=c[u],a[u]=m):s[u]=new Nc(t,c[u]);for(;u<h;++u)(m=i[u])&&(r[u]=m)}function eE(t,i,s,a,r,c,u){var m,h,g=new Map,v=i.length,p=c.length,y=new Array(v),S;for(m=0;m<v;++m)(h=i[m])&&(y[m]=S=u.call(h,h.__data__,m,i)+"",g.has(S)?r[m]=h:g.set(S,h));for(m=0;m<p;++m)S=u.call(t,c[m],m,c)+"",(h=g.get(S))?(a[m]=h,h.__data__=c[m],g.delete(S)):s[m]=new Nc(t,c[m]);for(m=0;m<v;++m)(h=i[m])&&g.get(y[m])===h&&(r[m]=h)}function tE(t){return t.__data__}function nE(t,i){if(!arguments.length)return Array.from(this,tE);var s=i?eE:Px,a=this._parents,r=this._groups;typeof t!="function"&&(t=Wx(t));for(var c=r.length,u=new Array(c),m=new Array(c),h=new Array(c),g=0;g<c;++g){var v=a[g],p=r[g],y=p.length,S=iE(t.call(v,v&&v.__data__,g,a)),E=S.length,_=m[g]=new Array(E),N=u[g]=new Array(E),w=h[g]=new Array(y);s(v,p,_,N,w,S,i);for(var D=0,x=0,T,L;D<E;++D)if(T=_[D]){for(D>=x&&(x=D+1);!(L=N[x])&&++x<E;);T._next=L||null}}return u=new Qt(u,a),u._enter=m,u._exit=h,u}function iE(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function sE(){return new Qt(this._exit||this._groups.map(Rv),this._parents)}function lE(t,i,s){var a=this.enter(),r=this,c=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?c.remove():s(c),a&&r?a.merge(r).order():r}function aE(t){for(var i=t.selection?t.selection():t,s=this._groups,a=i._groups,r=s.length,c=a.length,u=Math.min(r,c),m=new Array(r),h=0;h<u;++h)for(var g=s[h],v=a[h],p=g.length,y=m[h]=new Array(p),S,E=0;E<p;++E)(S=g[E]||v[E])&&(y[E]=S);for(;h<r;++h)m[h]=s[h];return new Qt(m,this._parents)}function oE(){for(var t=this._groups,i=-1,s=t.length;++i<s;)for(var a=t[i],r=a.length-1,c=a[r],u;--r>=0;)(u=a[r])&&(c&&u.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(u,c),c=u);return this}function rE(t){t||(t=cE);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),c=0;c<a;++c){for(var u=s[c],m=u.length,h=r[c]=new Array(m),g,v=0;v<m;++v)(g=u[v])&&(h[v]=g);h.sort(i)}return new Qt(r,this._parents).order()}function cE(t,i){return t<i?-1:t>i?1:t>=i?0:NaN}function uE(){var t=arguments[0];return arguments[0]=this,t.apply(null,arguments),this}function fE(){return Array.from(this)}function dE(){for(var t=this._groups,i=0,s=t.length;i<s;++i)for(var a=t[i],r=0,c=a.length;r<c;++r){var u=a[r];if(u)return u}return null}function hE(){let t=0;for(const i of this)++t;return t}function mE(){return!this.node()}function gE(t){for(var i=this._groups,s=0,a=i.length;s<a;++s)for(var r=i[s],c=0,u=r.length,m;c<u;++c)(m=r[c])&&t.call(m,m.__data__,c,r);return this}function pE(t){return function(){this.removeAttribute(t)}}function yE(t){return function(){this.removeAttributeNS(t.space,t.local)}}function vE(t,i){return function(){this.setAttribute(t,i)}}function bE(t,i){return function(){this.setAttributeNS(t.space,t.local,i)}}function SE(t,i){return function(){var s=i.apply(this,arguments);s==null?this.removeAttribute(t):this.setAttribute(t,s)}}function wE(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 xE(t,i){var s=qc(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?yE:pE:typeof i=="function"?s.local?wE:SE:s.local?bE:vE)(s,i))}function Bv(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function EE(t){return function(){this.style.removeProperty(t)}}function _E(t,i,s){return function(){this.style.setProperty(t,i,s)}}function NE(t,i,s){return function(){var a=i.apply(this,arguments);a==null?this.style.removeProperty(t):this.style.setProperty(t,a,s)}}function AE(t,i,s){return arguments.length>1?this.each((i==null?EE:typeof i=="function"?NE:_E)(t,i,s??"")):kl(this.node(),t)}function kl(t,i){return t.style.getPropertyValue(i)||Bv(t).getComputedStyle(t,null).getPropertyValue(i)}function TE(t){return function(){delete this[t]}}function ME(t,i){return function(){this[t]=i}}function CE(t,i){return function(){var s=i.apply(this,arguments);s==null?delete this[t]:this[t]=s}}function OE(t,i){return arguments.length>1?this.each((i==null?TE:typeof i=="function"?CE:ME)(t,i)):this.node()[t]}function jv(t){return t.trim().split(/^|\s+/)}function zh(t){return t.classList||new kv(t)}function kv(t){this._node=t,this._names=jv(t.getAttribute("class")||"")}kv.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 Hv(t,i){for(var s=zh(t),a=-1,r=i.length;++a<r;)s.add(i[a])}function $v(t,i){for(var s=zh(t),a=-1,r=i.length;++a<r;)s.remove(i[a])}function zE(t){return function(){Hv(this,t)}}function DE(t){return function(){$v(this,t)}}function LE(t,i){return function(){(i.apply(this,arguments)?Hv:$v)(this,t)}}function RE(t,i){var s=jv(t+"");if(arguments.length<2){for(var a=zh(this.node()),r=-1,c=s.length;++r<c;)if(!a.contains(s[r]))return!1;return!0}return this.each((typeof i=="function"?LE:i?zE:DE)(s,i))}function BE(){this.textContent=""}function jE(t){return function(){this.textContent=t}}function kE(t){return function(){var i=t.apply(this,arguments);this.textContent=i??""}}function HE(t){return arguments.length?this.each(t==null?BE:(typeof t=="function"?kE:jE)(t)):this.node().textContent}function $E(){this.innerHTML=""}function UE(t){return function(){this.innerHTML=t}}function qE(t){return function(){var i=t.apply(this,arguments);this.innerHTML=i??""}}function VE(t){return arguments.length?this.each(t==null?$E:(typeof t=="function"?qE:UE)(t)):this.node().innerHTML}function YE(){this.nextSibling&&this.parentNode.appendChild(this)}function GE(){return this.each(YE)}function XE(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function KE(){return this.each(XE)}function ZE(t){var i=typeof t=="function"?t:Ov(t);return this.select(function(){return this.appendChild(i.apply(this,arguments))})}function QE(){return null}function IE(t,i){var s=typeof t=="function"?t:Ov(t),a=i==null?QE:typeof i=="function"?i:Oh(i);return this.select(function(){return this.insertBefore(s.apply(this,arguments),a.apply(this,arguments)||null)})}function JE(){var t=this.parentNode;t&&t.removeChild(this)}function FE(){return this.each(JE)}function WE(){var t=this.cloneNode(!1),i=this.parentNode;return i?i.insertBefore(t,this.nextSibling):t}function PE(){var t=this.cloneNode(!0),i=this.parentNode;return i?i.insertBefore(t,this.nextSibling):t}function e2(t){return this.select(t?PE:WE)}function t2(t){return arguments.length?this.property("__data__",t):this.node().__data__}function n2(t){return function(i){t.call(this,i,this.__data__)}}function i2(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 s2(t){return function(){var i=this.__on;if(i){for(var s=0,a=-1,r=i.length,c;s<r;++s)c=i[s],(!t.type||c.type===t.type)&&c.name===t.name?this.removeEventListener(c.type,c.listener,c.options):i[++a]=c;++a?i.length=a:delete this.__on}}}function l2(t,i,s){return function(){var a=this.__on,r,c=n2(i);if(a){for(var u=0,m=a.length;u<m;++u)if((r=a[u]).type===t.type&&r.name===t.name){this.removeEventListener(r.type,r.listener,r.options),this.addEventListener(r.type,r.listener=c,r.options=s),r.value=i;return}}this.addEventListener(t.type,c,s),r={type:t.type,name:t.name,value:i,listener:c,options:s},a?a.push(r):this.__on=[r]}}function a2(t,i,s){var a=i2(t+""),r,c=a.length,u;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<c;++r)if((u=a[r]).type===v.type&&u.name===v.name)return v.value}return}for(m=i?l2:s2,r=0;r<c;++r)this.each(m(a[r],i,s));return this}function Uv(t,i,s){var a=Bv(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 o2(t,i){return function(){return Uv(this,t,i)}}function r2(t,i){return function(){return Uv(this,t,i.apply(this,arguments))}}function c2(t,i){return this.each((typeof i=="function"?r2:o2)(t,i))}function*u2(){for(var t=this._groups,i=0,s=t.length;i<s;++i)for(var a=t[i],r=0,c=a.length,u;r<c;++r)(u=a[r])&&(yield u)}var qv=[null];function Qt(t,i){this._groups=t,this._parents=i}function Eo(){return new Qt([[document.documentElement]],qv)}function f2(){return this}Qt.prototype=Eo.prototype={constructor:Qt,select:kx,selectAll:qx,selectChild:Xx,selectChildren:Ix,filter:Jx,data:nE,enter:Fx,exit:sE,join:lE,merge:aE,selection:f2,order:oE,sort:rE,call:uE,nodes:fE,node:dE,size:hE,empty:mE,each:gE,attr:xE,style:AE,property:OE,classed:RE,text:HE,html:VE,raise:GE,lower:KE,append:ZE,insert:IE,remove:FE,clone:e2,datum:t2,on:a2,dispatch:c2,[Symbol.iterator]:u2};function Kt(t){return typeof t=="string"?new Qt([[document.querySelector(t)]],[document.documentElement]):new Qt([[t]],qv)}function d2(t){let i;for(;i=t.sourceEvent;)t=i;return t}function yn(t,i){if(t=d2(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 h2={passive:!1},ro={capture:!0,passive:!1};function jd(t){t.stopImmediatePropagation()}function zl(t){t.preventDefault(),t.stopImmediatePropagation()}function Vv(t){var i=t.document.documentElement,s=Kt(t).on("dragstart.drag",zl,ro);"onselectstart"in i?s.on("selectstart.drag",zl,ro):(i.__noselect=i.style.MozUserSelect,i.style.MozUserSelect="none")}function Yv(t,i){var s=t.document.documentElement,a=Kt(t).on("dragstart.drag",null);i&&(a.on("click.drag",zl,ro),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 ec=t=>()=>t;function oh(t,{sourceEvent:i,subject:s,target:a,identifier:r,active:c,x:u,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:c,enumerable:!0,configurable:!0},x:{value:u,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}})}oh.prototype.on=function(){var t=this._.on.apply(this._,arguments);return t===this._?this:t};function m2(t){return!t.ctrlKey&&!t.button}function g2(){return this.parentNode}function p2(t,i){return i??{x:t.x,y:t.y}}function y2(){return navigator.maxTouchPoints||"ontouchstart"in this}function Gv(){var t=m2,i=g2,s=p2,a=y2,r={},c=Uc("start","drag","end"),u=0,m,h,g,v,p=0;function y(T){T.on("mousedown.drag",S).filter(a).on("touchstart.drag",N).on("touchmove.drag",w,h2).on("touchend.drag touchcancel.drag",D).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function S(T,L){if(!(v||!t.call(this,T,L))){var O=x(this,i.call(this,T,L),T,L,"mouse");O&&(Kt(T.view).on("mousemove.drag",E,ro).on("mouseup.drag",_,ro),Vv(T.view),jd(T),g=!1,m=T.clientX,h=T.clientY,O("start",T))}}function E(T){if(zl(T),!g){var L=T.clientX-m,O=T.clientY-h;g=L*L+O*O>p}r.mouse("drag",T)}function _(T){Kt(T.view).on("mousemove.drag mouseup.drag",null),Yv(T.view,g),zl(T),r.mouse("end",T)}function N(T,L){if(t.call(this,T,L)){var O=T.changedTouches,j=i.call(this,T,L),R=O.length,V,le;for(V=0;V<R;++V)(le=x(this,j,T,L,O[V].identifier,O[V]))&&(jd(T),le("start",T,O[V]))}}function w(T){var L=T.changedTouches,O=L.length,j,R;for(j=0;j<O;++j)(R=r[L[j].identifier])&&(zl(T),R("drag",T,L[j]))}function D(T){var L=T.changedTouches,O=L.length,j,R;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),j=0;j<O;++j)(R=r[L[j].identifier])&&(jd(T),R("end",T,L[j]))}function x(T,L,O,j,R,V){var le=c.copy(),K=yn(V||O,L),Z,oe,B;if((B=s.call(T,new oh("beforestart",{sourceEvent:O,target:y,identifier:R,active:u,x:K[0],y:K[1],dx:0,dy:0,dispatch:le}),j))!=null)return Z=B.x-K[0]||0,oe=B.y-K[1]||0,function X(C,H,G){var U=K,J;switch(C){case"start":r[R]=X,J=u++;break;case"end":delete r[R],--u;case"drag":K=yn(G||H,L),J=u;break}le.call(C,T,new oh(C,{sourceEvent:H,subject:B,target:y,identifier:R,active:J,x:K[0]+Z,y:K[1]+oe,dx:K[0]-U[0],dy:K[1]-U[1],dispatch:le}),j)}}return y.filter=function(T){return arguments.length?(t=typeof T=="function"?T:ec(!!T),y):t},y.container=function(T){return arguments.length?(i=typeof T=="function"?T:ec(T),y):i},y.subject=function(T){return arguments.length?(s=typeof T=="function"?T:ec(T),y):s},y.touchable=function(T){return arguments.length?(a=typeof T=="function"?T:ec(!!T),y):a},y.on=function(){var T=c.on.apply(c,arguments);return T===c?y:T},y.clickDistance=function(T){return arguments.length?(p=(T=+T)*T,y):Math.sqrt(p)},y}function Dh(t,i,s){t.prototype=i.prototype=s,s.constructor=t}function Xv(t,i){var s=Object.create(t.prototype);for(var a in i)s[a]=i[a];return s}function _o(){}var co=.7,Ac=1/co,Dl="\\s*([+-]?\\d+)\\s*",uo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",zn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",v2=/^#([0-9a-f]{3,8})$/,b2=new RegExp(`^rgb\\(${Dl},${Dl},${Dl}\\)$`),S2=new RegExp(`^rgb\\(${zn},${zn},${zn}\\)$`),w2=new RegExp(`^rgba\\(${Dl},${Dl},${Dl},${uo}\\)$`),x2=new RegExp(`^rgba\\(${zn},${zn},${zn},${uo}\\)$`),E2=new RegExp(`^hsl\\(${uo},${zn},${zn}\\)$`),_2=new RegExp(`^hsla\\(${uo},${zn},${zn},${uo}\\)$`),n0={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Dh(_o,Es,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:i0,formatHex:i0,formatHex8:N2,formatHsl:A2,formatRgb:s0,toString:s0});function i0(){return this.rgb().formatHex()}function N2(){return this.rgb().formatHex8()}function A2(){return Kv(this).formatHsl()}function s0(){return this.rgb().formatRgb()}function Es(t){var i,s;return t=(t+"").trim().toLowerCase(),(i=v2.exec(t))?(s=i[1].length,i=parseInt(i[1],16),s===6?l0(i):s===3?new jt(i>>8&15|i>>4&240,i>>4&15|i&240,(i&15)<<4|i&15,1):s===8?tc(i>>24&255,i>>16&255,i>>8&255,(i&255)/255):s===4?tc(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=b2.exec(t))?new jt(i[1],i[2],i[3],1):(i=S2.exec(t))?new jt(i[1]*255/100,i[2]*255/100,i[3]*255/100,1):(i=w2.exec(t))?tc(i[1],i[2],i[3],i[4]):(i=x2.exec(t))?tc(i[1]*255/100,i[2]*255/100,i[3]*255/100,i[4]):(i=E2.exec(t))?r0(i[1],i[2]/100,i[3]/100,1):(i=_2.exec(t))?r0(i[1],i[2]/100,i[3]/100,i[4]):n0.hasOwnProperty(t)?l0(n0[t]):t==="transparent"?new jt(NaN,NaN,NaN,0):null}function l0(t){return new jt(t>>16&255,t>>8&255,t&255,1)}function tc(t,i,s,a){return a<=0&&(t=i=s=NaN),new jt(t,i,s,a)}function T2(t){return t instanceof _o||(t=Es(t)),t?(t=t.rgb(),new jt(t.r,t.g,t.b,t.opacity)):new jt}function rh(t,i,s,a){return arguments.length===1?T2(t):new jt(t,i,s,a??1)}function jt(t,i,s,a){this.r=+t,this.g=+i,this.b=+s,this.opacity=+a}Dh(jt,rh,Xv(_o,{brighter(t){return t=t==null?Ac:Math.pow(Ac,t),new jt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?co:Math.pow(co,t),new jt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new jt(ws(this.r),ws(this.g),ws(this.b),Tc(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:a0,formatHex:a0,formatHex8:M2,formatRgb:o0,toString:o0}));function a0(){return`#${ps(this.r)}${ps(this.g)}${ps(this.b)}`}function M2(){return`#${ps(this.r)}${ps(this.g)}${ps(this.b)}${ps((isNaN(this.opacity)?1:this.opacity)*255)}`}function o0(){const t=Tc(this.opacity);return`${t===1?"rgb(":"rgba("}${ws(this.r)}, ${ws(this.g)}, ${ws(this.b)}${t===1?")":`, ${t})`}`}function Tc(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function ws(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ps(t){return t=ws(t),(t<16?"0":"")+t.toString(16)}function r0(t,i,s,a){return a<=0?t=i=s=NaN:s<=0||s>=1?t=i=NaN:i<=0&&(t=NaN),new vn(t,i,s,a)}function Kv(t){if(t instanceof vn)return new vn(t.h,t.s,t.l,t.opacity);if(t instanceof _o||(t=Es(t)),!t)return new vn;if(t instanceof vn)return t;t=t.rgb();var i=t.r/255,s=t.g/255,a=t.b/255,r=Math.min(i,s,a),c=Math.max(i,s,a),u=NaN,m=c-r,h=(c+r)/2;return m?(i===c?u=(s-a)/m+(s<a)*6:s===c?u=(a-i)/m+2:u=(i-s)/m+4,m/=h<.5?c+r:2-c-r,u*=60):m=h>0&&h<1?0:u,new vn(u,m,h,t.opacity)}function C2(t,i,s,a){return arguments.length===1?Kv(t):new vn(t,i,s,a??1)}function vn(t,i,s,a){this.h=+t,this.s=+i,this.l=+s,this.opacity=+a}Dh(vn,C2,Xv(_o,{brighter(t){return t=t==null?Ac:Math.pow(Ac,t),new vn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?co:Math.pow(co,t),new vn(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 jt(kd(t>=240?t-240:t+120,r,a),kd(t,r,a),kd(t<120?t+240:t-120,r,a),this.opacity)},clamp(){return new vn(c0(this.h),nc(this.s),nc(this.l),Tc(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=Tc(this.opacity);return`${t===1?"hsl(":"hsla("}${c0(this.h)}, ${nc(this.s)*100}%, ${nc(this.l)*100}%${t===1?")":`, ${t})`}`}}));function c0(t){return t=(t||0)%360,t<0?t+360:t}function nc(t){return Math.max(0,Math.min(1,t||0))}function kd(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 Lh=t=>()=>t;function O2(t,i){return function(s){return t+s*i}}function z2(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 D2(t){return(t=+t)==1?Zv:function(i,s){return s-i?z2(i,s,t):Lh(isNaN(i)?s:i)}}function Zv(t,i){var s=i-t;return s?O2(t,s):Lh(isNaN(t)?i:t)}const Mc=(function t(i){var s=D2(i);function a(r,c){var u=s((r=rh(r)).r,(c=rh(c)).r),m=s(r.g,c.g),h=s(r.b,c.b),g=Zv(r.opacity,c.opacity);return function(v){return r.r=u(v),r.g=m(v),r.b=h(v),r.opacity=g(v),r+""}}return a.gamma=t,a})(1);function L2(t,i){i||(i=[]);var s=t?Math.min(i.length,t.length):0,a=i.slice(),r;return function(c){for(r=0;r<s;++r)a[r]=t[r]*(1-c)+i[r]*c;return a}}function R2(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function B2(t,i){var s=i?i.length:0,a=t?Math.min(s,t.length):0,r=new Array(a),c=new Array(s),u;for(u=0;u<a;++u)r[u]=so(t[u],i[u]);for(;u<s;++u)c[u]=i[u];return function(m){for(u=0;u<a;++u)c[u]=r[u](m);return c}}function j2(t,i){var s=new Date;return t=+t,i=+i,function(a){return s.setTime(t*(1-a)+i*a),s}}function On(t,i){return t=+t,i=+i,function(s){return t*(1-s)+i*s}}function k2(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]=so(t[r],i[r]):a[r]=i[r];return function(c){for(r in s)a[r]=s[r](c);return a}}var ch=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Hd=new RegExp(ch.source,"g");function H2(t){return function(){return t}}function $2(t){return function(i){return t(i)+""}}function Qv(t,i){var s=ch.lastIndex=Hd.lastIndex=0,a,r,c,u=-1,m=[],h=[];for(t=t+"",i=i+"";(a=ch.exec(t))&&(r=Hd.exec(i));)(c=r.index)>s&&(c=i.slice(s,c),m[u]?m[u]+=c:m[++u]=c),(a=a[0])===(r=r[0])?m[u]?m[u]+=r:m[++u]=r:(m[++u]=null,h.push({i:u,x:On(a,r)})),s=Hd.lastIndex;return s<i.length&&(c=i.slice(s),m[u]?m[u]+=c:m[++u]=c),m.length<2?h[0]?$2(h[0].x):H2(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 so(t,i){var s=typeof i,a;return i==null||s==="boolean"?Lh(i):(s==="number"?On:s==="string"?(a=Es(i))?(i=a,Mc):Qv:i instanceof Es?Mc:i instanceof Date?j2:R2(i)?L2:Array.isArray(i)?B2:typeof i.valueOf!="function"&&typeof i.toString!="function"||isNaN(i)?k2:On)(t,i)}var u0=180/Math.PI,uh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Iv(t,i,s,a,r,c){var u,m,h;return(u=Math.sqrt(t*t+i*i))&&(t/=u,i/=u),(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,u=-u),{translateX:r,translateY:c,rotate:Math.atan2(i,t)*u0,skewX:Math.atan(h)*u0,scaleX:u,scaleY:m}}var ic;function U2(t){const i=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(t+"");return i.isIdentity?uh:Iv(i.a,i.b,i.c,i.d,i.e,i.f)}function q2(t){return t==null||(ic||(ic=document.createElementNS("http://www.w3.org/2000/svg","g")),ic.setAttribute("transform",t),!(t=ic.transform.baseVal.consolidate()))?uh:(t=t.matrix,Iv(t.a,t.b,t.c,t.d,t.e,t.f))}function Jv(t,i,s,a){function r(g){return g.length?g.pop()+" ":""}function c(g,v,p,y,S,E){if(g!==p||v!==y){var _=S.push("translate(",null,i,null,s);E.push({i:_-4,x:On(g,p)},{i:_-2,x:On(v,y)})}else(p||y)&&S.push("translate("+p+i+y+s)}function u(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:On(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:On(g,v)}):v&&p.push(r(p)+"skewX("+v+a)}function h(g,v,p,y,S,E){if(g!==p||v!==y){var _=S.push(r(S)+"scale(",null,",",null,")");E.push({i:_-4,x:On(g,p)},{i:_-2,x:On(v,y)})}else(p!==1||y!==1)&&S.push(r(S)+"scale("+p+","+y+")")}return function(g,v){var p=[],y=[];return g=t(g),v=t(v),c(g.translateX,g.translateY,v.translateX,v.translateY,p,y),u(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(S){for(var E=-1,_=y.length,N;++E<_;)p[(N=y[E]).i]=N.x(S);return p.join("")}}}var V2=Jv(U2,"px, ","px)","deg)"),Y2=Jv(q2,", ",")",")"),G2=1e-12;function f0(t){return((t=Math.exp(t))+1/t)/2}function X2(t){return((t=Math.exp(t))-1/t)/2}function K2(t){return((t=Math.exp(2*t))-1)/(t+1)}const pc=(function t(i,s,a){function r(c,u){var m=c[0],h=c[1],g=c[2],v=u[0],p=u[1],y=u[2],S=v-m,E=p-h,_=S*S+E*E,N,w;if(_<G2)w=Math.log(y/g)/i,N=function(j){return[m+j*S,h+j*E,g*Math.exp(i*j*w)]};else{var D=Math.sqrt(_),x=(y*y-g*g+a*_)/(2*g*s*D),T=(y*y-g*g-a*_)/(2*y*s*D),L=Math.log(Math.sqrt(x*x+1)-x),O=Math.log(Math.sqrt(T*T+1)-T);w=(O-L)/i,N=function(j){var R=j*w,V=f0(L),le=g/(s*D)*(V*K2(i*R+L)-X2(L));return[m+le*S,h+le*E,g*V/f0(i*R+L)]}}return N.duration=w*1e3*i/Math.SQRT2,N}return r.rho=function(c){var u=Math.max(.001,+c),m=u*u,h=m*m;return t(u,m,h)},r})(Math.SQRT2,2,4);var Hl=0,to=0,Wa=0,Fv=1e3,Cc,no,Oc=0,_s=0,Vc=0,fo=typeof performance=="object"&&performance.now?performance:Date,Wv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Rh(){return _s||(Wv(Z2),_s=fo.now()+Vc)}function Z2(){_s=0}function zc(){this._call=this._time=this._next=null}zc.prototype=Pv.prototype={constructor:zc,restart:function(t,i,s){if(typeof t!="function")throw new TypeError("callback is not a function");s=(s==null?Rh():+s)+(i==null?0:+i),!this._next&&no!==this&&(no?no._next=this:Cc=this,no=this),this._call=t,this._time=s,fh()},stop:function(){this._call&&(this._call=null,this._time=1/0,fh())}};function Pv(t,i,s){var a=new zc;return a.restart(t,i,s),a}function Q2(){Rh(),++Hl;for(var t=Cc,i;t;)(i=_s-t._time)>=0&&t._call.call(void 0,i),t=t._next;--Hl}function d0(){_s=(Oc=fo.now())+Vc,Hl=to=0;try{Q2()}finally{Hl=0,J2(),_s=0}}function I2(){var t=fo.now(),i=t-Oc;i>Fv&&(Vc-=i,Oc=t)}function J2(){for(var t,i=Cc,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:Cc=s);no=t,fh(a)}function fh(t){if(!Hl){to&&(to=clearTimeout(to));var i=t-_s;i>24?(t<1/0&&(to=setTimeout(d0,t-fo.now()-Vc)),Wa&&(Wa=clearInterval(Wa))):(Wa||(Oc=fo.now(),Wa=setInterval(I2,Fv)),Hl=1,Wv(d0))}}function h0(t,i,s){var a=new zc;return i=i==null?0:+i,a.restart(r=>{a.stop(),t(r+i)},i,s),a}var F2=Uc("start","end","cancel","interrupt"),W2=[],e1=0,m0=1,dh=2,yc=3,g0=4,hh=5,vc=6;function Yc(t,i,s,a,r,c){var u=t.__transition;if(!u)t.__transition={};else if(s in u)return;P2(t,s,{name:i,index:a,group:r,on:F2,tween:W2,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:e1})}function Bh(t,i){var s=xn(t,i);if(s.state>e1)throw new Error("too late; already scheduled");return s}function Rn(t,i){var s=xn(t,i);if(s.state>yc)throw new Error("too late; already running");return s}function xn(t,i){var s=t.__transition;if(!s||!(s=s[i]))throw new Error("transition not found");return s}function P2(t,i,s){var a=t.__transition,r;a[i]=s,s.timer=Pv(c,0,s.time);function c(g){s.state=m0,s.timer.restart(u,s.delay,s.time),s.delay<=g&&u(g-s.delay)}function u(g){var v,p,y,S;if(s.state!==m0)return h();for(v in a)if(S=a[v],S.name===s.name){if(S.state===yc)return h0(u);S.state===g0?(S.state=vc,S.timer.stop(),S.on.call("interrupt",t,t.__data__,S.index,S.group),delete a[v]):+v<i&&(S.state=vc,S.timer.stop(),S.on.call("cancel",t,t.__data__,S.index,S.group),delete a[v])}if(h0(function(){s.state===yc&&(s.state=g0,s.timer.restart(m,s.delay,s.time),m(g))}),s.state=dh,s.on.call("start",t,t.__data__,s.index,s.group),s.state===dh){for(s.state=yc,r=new Array(y=s.tween.length),v=0,p=-1;v<y;++v)(S=s.tween[v].value.call(t,t.__data__,s.index,s.group))&&(r[++p]=S);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=hh,1),p=-1,y=r.length;++p<y;)r[p].call(t,v);s.state===hh&&(s.on.call("end",t,t.__data__,s.index,s.group),h())}function h(){s.state=vc,s.timer.stop(),delete a[i];for(var g in a)return;delete t.__transition}}function bc(t,i){var s=t.__transition,a,r,c=!0,u;if(s){i=i==null?null:i+"";for(u in s){if((a=s[u]).name!==i){c=!1;continue}r=a.state>dh&&a.state<hh,a.state=vc,a.timer.stop(),a.on.call(r?"interrupt":"cancel",t,t.__data__,a.index,a.group),delete s[u]}c&&delete t.__transition}}function e_(t){return this.each(function(){bc(this,t)})}function t_(t,i){var s,a;return function(){var r=Rn(this,t),c=r.tween;if(c!==s){a=s=c;for(var u=0,m=a.length;u<m;++u)if(a[u].name===i){a=a.slice(),a.splice(u,1);break}}r.tween=a}}function n_(t,i,s){var a,r;if(typeof s!="function")throw new Error;return function(){var c=Rn(this,t),u=c.tween;if(u!==a){r=(a=u).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)}c.tween=r}}function i_(t,i){var s=this._id;if(t+="",arguments.length<2){for(var a=xn(this.node(),s).tween,r=0,c=a.length,u;r<c;++r)if((u=a[r]).name===t)return u.value;return null}return this.each((i==null?t_:n_)(s,t,i))}function jh(t,i,s){var a=t._id;return t.each(function(){var r=Rn(this,a);(r.value||(r.value={}))[i]=s.apply(this,arguments)}),function(r){return xn(r,a).value[i]}}function t1(t,i){var s;return(typeof i=="number"?On:i instanceof Es?Mc:(s=Es(i))?(i=s,Mc):Qv)(t,i)}function s_(t){return function(){this.removeAttribute(t)}}function l_(t){return function(){this.removeAttributeNS(t.space,t.local)}}function a_(t,i,s){var a,r=s+"",c;return function(){var u=this.getAttribute(t);return u===r?null:u===a?c:c=i(a=u,s)}}function o_(t,i,s){var a,r=s+"",c;return function(){var u=this.getAttributeNS(t.space,t.local);return u===r?null:u===a?c:c=i(a=u,s)}}function r_(t,i,s){var a,r,c;return function(){var u,m=s(this),h;return m==null?void this.removeAttribute(t):(u=this.getAttribute(t),h=m+"",u===h?null:u===a&&h===r?c:(r=h,c=i(a=u,m)))}}function c_(t,i,s){var a,r,c;return function(){var u,m=s(this),h;return m==null?void this.removeAttributeNS(t.space,t.local):(u=this.getAttributeNS(t.space,t.local),h=m+"",u===h?null:u===a&&h===r?c:(r=h,c=i(a=u,m)))}}function u_(t,i){var s=qc(t),a=s==="transform"?Y2:t1;return this.attrTween(t,typeof i=="function"?(s.local?c_:r_)(s,a,jh(this,"attr."+t,i)):i==null?(s.local?l_:s_)(s):(s.local?o_:a_)(s,a,i))}function f_(t,i){return function(s){this.setAttribute(t,i.call(this,s))}}function d_(t,i){return function(s){this.setAttributeNS(t.space,t.local,i.call(this,s))}}function h_(t,i){var s,a;function r(){var c=i.apply(this,arguments);return c!==a&&(s=(a=c)&&d_(t,c)),s}return r._value=i,r}function m_(t,i){var s,a;function r(){var c=i.apply(this,arguments);return c!==a&&(s=(a=c)&&f_(t,c)),s}return r._value=i,r}function g_(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=qc(t);return this.tween(s,(a.local?h_:m_)(a,i))}function p_(t,i){return function(){Bh(this,t).delay=+i.apply(this,arguments)}}function y_(t,i){return i=+i,function(){Bh(this,t).delay=i}}function v_(t){var i=this._id;return arguments.length?this.each((typeof t=="function"?p_:y_)(i,t)):xn(this.node(),i).delay}function b_(t,i){return function(){Rn(this,t).duration=+i.apply(this,arguments)}}function S_(t,i){return i=+i,function(){Rn(this,t).duration=i}}function w_(t){var i=this._id;return arguments.length?this.each((typeof t=="function"?b_:S_)(i,t)):xn(this.node(),i).duration}function x_(t,i){if(typeof i!="function")throw new Error;return function(){Rn(this,t).ease=i}}function E_(t){var i=this._id;return arguments.length?this.each(x_(i,t)):xn(this.node(),i).ease}function __(t,i){return function(){var s=i.apply(this,arguments);if(typeof s!="function")throw new Error;Rn(this,t).ease=s}}function N_(t){if(typeof t!="function")throw new Error;return this.each(__(this._id,t))}function A_(t){typeof t!="function"&&(t=Dv(t));for(var i=this._groups,s=i.length,a=new Array(s),r=0;r<s;++r)for(var c=i[r],u=c.length,m=a[r]=[],h,g=0;g<u;++g)(h=c[g])&&t.call(h,h.__data__,g,c)&&m.push(h);return new oi(a,this._parents,this._name,this._id)}function T_(t){if(t._id!==this._id)throw new Error;for(var i=this._groups,s=t._groups,a=i.length,r=s.length,c=Math.min(a,r),u=new Array(a),m=0;m<c;++m)for(var h=i[m],g=s[m],v=h.length,p=u[m]=new Array(v),y,S=0;S<v;++S)(y=h[S]||g[S])&&(p[S]=y);for(;m<a;++m)u[m]=i[m];return new oi(u,this._parents,this._name,this._id)}function M_(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 C_(t,i,s){var a,r,c=M_(i)?Bh:Rn;return function(){var u=c(this,t),m=u.on;m!==a&&(r=(a=m).copy()).on(i,s),u.on=r}}function O_(t,i){var s=this._id;return arguments.length<2?xn(this.node(),s).on.on(t):this.each(C_(s,t,i))}function z_(t){return function(){var i=this.parentNode;for(var s in this.__transition)if(+s!==t)return;i&&i.removeChild(this)}}function D_(){return this.on("end.remove",z_(this._id))}function L_(t){var i=this._name,s=this._id;typeof t!="function"&&(t=Oh(t));for(var a=this._groups,r=a.length,c=new Array(r),u=0;u<r;++u)for(var m=a[u],h=m.length,g=c[u]=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,Yc(g[y],i,s,y,g,xn(v,s)));return new oi(c,this._parents,i,s)}function R_(t){var i=this._name,s=this._id;typeof t!="function"&&(t=zv(t));for(var a=this._groups,r=a.length,c=[],u=[],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),S,E=xn(v,s),_=0,N=y.length;_<N;++_)(S=y[_])&&Yc(S,i,s,_,y,E);c.push(y),u.push(v)}return new oi(c,u,i,s)}var B_=Eo.prototype.constructor;function j_(){return new B_(this._groups,this._parents)}function k_(t,i){var s,a,r;return function(){var c=kl(this,t),u=(this.style.removeProperty(t),kl(this,t));return c===u?null:c===s&&u===a?r:r=i(s=c,a=u)}}function n1(t){return function(){this.style.removeProperty(t)}}function H_(t,i,s){var a,r=s+"",c;return function(){var u=kl(this,t);return u===r?null:u===a?c:c=i(a=u,s)}}function $_(t,i,s){var a,r,c;return function(){var u=kl(this,t),m=s(this),h=m+"";return m==null&&(h=m=(this.style.removeProperty(t),kl(this,t))),u===h?null:u===a&&h===r?c:(r=h,c=i(a=u,m))}}function U_(t,i){var s,a,r,c="style."+i,u="end."+c,m;return function(){var h=Rn(this,t),g=h.on,v=h.value[c]==null?m||(m=n1(i)):void 0;(g!==s||r!==v)&&(a=(s=g).copy()).on(u,r=v),h.on=a}}function q_(t,i,s){var a=(t+="")=="transform"?V2:t1;return i==null?this.styleTween(t,k_(t,a)).on("end.style."+t,n1(t)):typeof i=="function"?this.styleTween(t,$_(t,a,jh(this,"style."+t,i))).each(U_(this._id,t)):this.styleTween(t,H_(t,a,i),s).on("end.style."+t,null)}function V_(t,i,s){return function(a){this.style.setProperty(t,i.call(this,a),s)}}function Y_(t,i,s){var a,r;function c(){var u=i.apply(this,arguments);return u!==r&&(a=(r=u)&&V_(t,u,s)),a}return c._value=i,c}function G_(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,Y_(t,i,s??""))}function X_(t){return function(){this.textContent=t}}function K_(t){return function(){var i=t(this);this.textContent=i??""}}function Z_(t){return this.tween("text",typeof t=="function"?K_(jh(this,"text",t)):X_(t==null?"":t+""))}function Q_(t){return function(i){this.textContent=t.call(this,i)}}function I_(t){var i,s;function a(){var r=t.apply(this,arguments);return r!==s&&(i=(s=r)&&Q_(r)),i}return a._value=t,a}function J_(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,I_(t))}function F_(){for(var t=this._name,i=this._id,s=i1(),a=this._groups,r=a.length,c=0;c<r;++c)for(var u=a[c],m=u.length,h,g=0;g<m;++g)if(h=u[g]){var v=xn(h,i);Yc(h,t,s,g,u,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new oi(a,this._parents,t,s)}function W_(){var t,i,s=this,a=s._id,r=s.size();return new Promise(function(c,u){var m={value:u},h={value:function(){--r===0&&c()}};s.each(function(){var g=Rn(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&&c()})}var P_=0;function oi(t,i,s,a){this._groups=t,this._parents=i,this._name=s,this._id=a}function i1(){return++P_}var ni=Eo.prototype;oi.prototype={constructor:oi,select:L_,selectAll:R_,selectChild:ni.selectChild,selectChildren:ni.selectChildren,filter:A_,merge:T_,selection:j_,transition:F_,call:ni.call,nodes:ni.nodes,node:ni.node,size:ni.size,empty:ni.empty,each:ni.each,on:O_,attr:u_,attrTween:g_,style:q_,styleTween:G_,text:Z_,textTween:J_,remove:D_,tween:i_,delay:v_,duration:w_,ease:E_,easeVarying:N_,end:W_,[Symbol.iterator]:ni[Symbol.iterator]};function eN(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var tN={time:null,delay:0,duration:250,ease:eN};function nN(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 iN(t){var i,s;t instanceof oi?(i=t._id,t=t._name):(i=i1(),(s=tN).time=Rh(),t=t==null?null:t+"");for(var a=this._groups,r=a.length,c=0;c<r;++c)for(var u=a[c],m=u.length,h,g=0;g<m;++g)(h=u[g])&&Yc(h,t,i,g,u,s||nN(h,i));return new oi(a,this._parents,t,i)}Eo.prototype.interrupt=e_;Eo.prototype.transition=iN;const sc=t=>()=>t;function sN(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 si(t,i,s){this.k=t,this.x=i,this.y=s}si.prototype={constructor:si,scale:function(t){return t===1?this:new si(this.k*t,this.x,this.y)},translate:function(t,i){return t===0&i===0?this:new si(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 Gc=new si(1,0,0);s1.prototype=si.prototype;function s1(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Gc;return t.__zoom}function $d(t){t.stopImmediatePropagation()}function Pa(t){t.preventDefault(),t.stopImmediatePropagation()}function lN(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function aN(){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 p0(){return this.__zoom||Gc}function oN(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function rN(){return navigator.maxTouchPoints||"ontouchstart"in this}function cN(t,i,s){var a=t.invertX(i[0][0])-s[0][0],r=t.invertX(i[1][0])-s[1][0],c=t.invertY(i[0][1])-s[0][1],u=t.invertY(i[1][1])-s[1][1];return t.translate(r>a?(a+r)/2:Math.min(0,a)||Math.max(0,r),u>c?(c+u)/2:Math.min(0,c)||Math.max(0,u))}function l1(){var t=lN,i=aN,s=cN,a=oN,r=rN,c=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],m=250,h=pc,g=Uc("start","zoom","end"),v,p,y,S=500,E=150,_=0,N=10;function w(B){B.property("__zoom",p0).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",V).on("dblclick.zoom",le).filter(r).on("touchstart.zoom",K).on("touchmove.zoom",Z).on("touchend.zoom touchcancel.zoom",oe).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}w.transform=function(B,X,C,H){var G=B.selection?B.selection():B;G.property("__zoom",p0),B!==G?L(B,X,C,H):G.interrupt().each(function(){O(this,arguments).event(H).start().zoom(null,typeof X=="function"?X.apply(this,arguments):X).end()})},w.scaleBy=function(B,X,C,H){w.scaleTo(B,function(){var G=this.__zoom.k,U=typeof X=="function"?X.apply(this,arguments):X;return G*U},C,H)},w.scaleTo=function(B,X,C,H){w.transform(B,function(){var G=i.apply(this,arguments),U=this.__zoom,J=C==null?T(G):typeof C=="function"?C.apply(this,arguments):C,M=U.invert(J),$=typeof X=="function"?X.apply(this,arguments):X;return s(x(D(U,$),J,M),G,u)},C,H)},w.translateBy=function(B,X,C,H){w.transform(B,function(){return s(this.__zoom.translate(typeof X=="function"?X.apply(this,arguments):X,typeof C=="function"?C.apply(this,arguments):C),i.apply(this,arguments),u)},null,H)},w.translateTo=function(B,X,C,H,G){w.transform(B,function(){var U=i.apply(this,arguments),J=this.__zoom,M=H==null?T(U):typeof H=="function"?H.apply(this,arguments):H;return s(Gc.translate(M[0],M[1]).scale(J.k).translate(typeof X=="function"?-X.apply(this,arguments):-X,typeof C=="function"?-C.apply(this,arguments):-C),U,u)},H,G)};function D(B,X){return X=Math.max(c[0],Math.min(c[1],X)),X===B.k?B:new si(X,B.x,B.y)}function x(B,X,C){var H=X[0]-C[0]*B.k,G=X[1]-C[1]*B.k;return H===B.x&&G===B.y?B:new si(B.k,H,G)}function T(B){return[(+B[0][0]+ +B[1][0])/2,(+B[0][1]+ +B[1][1])/2]}function L(B,X,C,H){B.on("start.zoom",function(){O(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){O(this,arguments).event(H).end()}).tween("zoom",function(){var G=this,U=arguments,J=O(G,U).event(H),M=i.apply(G,U),$=C==null?T(M):typeof C=="function"?C.apply(G,U):C,ee=Math.max(M[1][0]-M[0][0],M[1][1]-M[0][1]),ie=G.__zoom,re=typeof X=="function"?X.apply(G,U):X,de=h(ie.invert($).concat(ee/ie.k),re.invert($).concat(ee/re.k));return function(ce){if(ce===1)ce=re;else{var te=de(ce),ue=ee/te[2];ce=new si(ue,$[0]-te[0]*ue,$[1]-te[1]*ue)}J.zoom(null,ce)}})}function O(B,X,C){return!C&&B.__zooming||new j(B,X)}function j(B,X){this.that=B,this.args=X,this.active=0,this.sourceEvent=null,this.extent=i.apply(B,X),this.taps=0}j.prototype={event:function(B){return B&&(this.sourceEvent=B),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(B,X){return this.mouse&&B!=="mouse"&&(this.mouse[1]=X.invert(this.mouse[0])),this.touch0&&B!=="touch"&&(this.touch0[1]=X.invert(this.touch0[0])),this.touch1&&B!=="touch"&&(this.touch1[1]=X.invert(this.touch1[0])),this.that.__zoom=X,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(B){var X=Kt(this.that).datum();g.call(B,this.that,new sN(B,{sourceEvent:this.sourceEvent,target:w,transform:this.that.__zoom,dispatch:g}),X)}};function R(B,...X){if(!t.apply(this,arguments))return;var C=O(this,X).event(B),H=this.__zoom,G=Math.max(c[0],Math.min(c[1],H.k*Math.pow(2,a.apply(this,arguments)))),U=yn(B);if(C.wheel)(C.mouse[0][0]!==U[0]||C.mouse[0][1]!==U[1])&&(C.mouse[1]=H.invert(C.mouse[0]=U)),clearTimeout(C.wheel);else{if(H.k===G)return;C.mouse=[U,H.invert(U)],bc(this),C.start()}Pa(B),C.wheel=setTimeout(J,E),C.zoom("mouse",s(x(D(H,G),C.mouse[0],C.mouse[1]),C.extent,u));function J(){C.wheel=null,C.end()}}function V(B,...X){if(y||!t.apply(this,arguments))return;var C=B.currentTarget,H=O(this,X,!0).event(B),G=Kt(B.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",ee,!0),U=yn(B,C),J=B.clientX,M=B.clientY;Vv(B.view),$d(B),H.mouse=[U,this.__zoom.invert(U)],bc(this),H.start();function $(ie){if(Pa(ie),!H.moved){var re=ie.clientX-J,de=ie.clientY-M;H.moved=re*re+de*de>_}H.event(ie).zoom("mouse",s(x(H.that.__zoom,H.mouse[0]=yn(ie,C),H.mouse[1]),H.extent,u))}function ee(ie){G.on("mousemove.zoom mouseup.zoom",null),Yv(ie.view,H.moved),Pa(ie),H.event(ie).end()}}function le(B,...X){if(t.apply(this,arguments)){var C=this.__zoom,H=yn(B.changedTouches?B.changedTouches[0]:B,this),G=C.invert(H),U=C.k*(B.shiftKey?.5:2),J=s(x(D(C,U),H,G),i.apply(this,X),u);Pa(B),m>0?Kt(this).transition().duration(m).call(L,J,H,B):Kt(this).call(w.transform,J,H,B)}}function K(B,...X){if(t.apply(this,arguments)){var C=B.touches,H=C.length,G=O(this,X,B.changedTouches.length===H).event(B),U,J,M,$;for($d(B),J=0;J<H;++J)M=C[J],$=yn(M,this),$=[$,this.__zoom.invert($),M.identifier],G.touch0?!G.touch1&&G.touch0[2]!==$[2]&&(G.touch1=$,G.taps=0):(G.touch0=$,U=!0,G.taps=1+!!v);v&&(v=clearTimeout(v)),U&&(G.taps<2&&(p=$[0],v=setTimeout(function(){v=null},S)),bc(this),G.start())}}function Z(B,...X){if(this.__zooming){var C=O(this,X).event(B),H=B.changedTouches,G=H.length,U,J,M,$;for(Pa(B),U=0;U<G;++U)J=H[U],M=yn(J,this),C.touch0&&C.touch0[2]===J.identifier?C.touch0[0]=M:C.touch1&&C.touch1[2]===J.identifier&&(C.touch1[0]=M);if(J=C.that.__zoom,C.touch1){var ee=C.touch0[0],ie=C.touch0[1],re=C.touch1[0],de=C.touch1[1],ce=(ce=re[0]-ee[0])*ce+(ce=re[1]-ee[1])*ce,te=(te=de[0]-ie[0])*te+(te=de[1]-ie[1])*te;J=D(J,Math.sqrt(ce/te)),M=[(ee[0]+re[0])/2,(ee[1]+re[1])/2],$=[(ie[0]+de[0])/2,(ie[1]+de[1])/2]}else if(C.touch0)M=C.touch0[0],$=C.touch0[1];else return;C.zoom("touch",s(x(J,M,$),C.extent,u))}}function oe(B,...X){if(this.__zooming){var C=O(this,X).event(B),H=B.changedTouches,G=H.length,U,J;for($d(B),y&&clearTimeout(y),y=setTimeout(function(){y=null},S),U=0;U<G;++U)J=H[U],C.touch0&&C.touch0[2]===J.identifier?delete C.touch0:C.touch1&&C.touch1[2]===J.identifier&&delete C.touch1;if(C.touch1&&!C.touch0&&(C.touch0=C.touch1,delete C.touch1),C.touch0)C.touch0[1]=this.__zoom.invert(C.touch0[0]);else if(C.end(),C.taps===2&&(J=yn(J,this),Math.hypot(p[0]-J[0],p[1]-J[1])<N)){var M=Kt(this).on("dblclick.zoom");M&&M.apply(this,arguments)}}}return w.wheelDelta=function(B){return arguments.length?(a=typeof B=="function"?B:sc(+B),w):a},w.filter=function(B){return arguments.length?(t=typeof B=="function"?B:sc(!!B),w):t},w.touchable=function(B){return arguments.length?(r=typeof B=="function"?B:sc(!!B),w):r},w.extent=function(B){return arguments.length?(i=typeof B=="function"?B:sc([[+B[0][0],+B[0][1]],[+B[1][0],+B[1][1]]]),w):i},w.scaleExtent=function(B){return arguments.length?(c[0]=+B[0],c[1]=+B[1],w):[c[0],c[1]]},w.translateExtent=function(B){return arguments.length?(u[0][0]=+B[0][0],u[1][0]=+B[1][0],u[0][1]=+B[0][1],u[1][1]=+B[1][1],w):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},w.constrain=function(B){return arguments.length?(s=B,w):s},w.duration=function(B){return arguments.length?(m=+B,w):m},w.interpolate=function(B){return arguments.length?(h=B,w):h},w.on=function(){var B=g.on.apply(g,arguments);return B===g?w:B},w.clickDistance=function(B){return arguments.length?(_=(B=+B)*B,w):Math.sqrt(_)},w.tapDistance=function(B){return arguments.length?(N=+B,w):N},w}const wn={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.`},ho=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],a1=["Enter"," ","Escape"],o1={"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 $l;(function(t){t.Strict="strict",t.Loose="loose"})($l||($l={}));var xs;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(xs||(xs={}));var mo;(function(t){t.Partial="partial",t.Full="full"})(mo||(mo={}));const r1={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Yi;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Yi||(Yi={}));var go;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(go||(go={}));var fe;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(fe||(fe={}));const y0={[fe.Left]:fe.Right,[fe.Right]:fe.Left,[fe.Top]:fe.Bottom,[fe.Bottom]:fe.Top};function c1(t){return t===null?null:t?"valid":"invalid"}const u1=t=>"id"in t&&"source"in t&&"target"in t,uN=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),kh=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),No=(t,i=[0,0])=>{const{width:s,height:a}=ri(t),r=t.origin??i,c=s*r[0],u=a*r[1];return{x:t.position.x-c,y:t.position.y-u}},fN=(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 c=typeof r=="string";let u=!i.nodeLookup&&!c?r:void 0;i.nodeLookup&&(u=c?i.nodeLookup.get(r):kh(r)?r:i.nodeLookup.get(r.id));const m=u?Dc(u,i.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Xc(a,m)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Kc(s)},Ao=(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=Xc(s,Dc(r)),a=!0)}),a?Kc(s):{x:0,y:0,width:0,height:0}},Hh=(t,i,[s,a,r]=[0,0,1],c=!1,u=!1)=>{const m={...Kl(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(u&&!p||y)continue;const S=v.width??g.width??g.initialWidth??null,E=v.height??g.height??g.initialHeight??null,_=po(m,ql(g)),N=(S??0)*(E??0),w=c&&_>0;(!g.internals.handleBounds||w||_>=N||g.dragging)&&h.push(g)}return h},dN=(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 hN(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 mN({nodes:t,width:i,height:s,panZoom:a,minZoom:r,maxZoom:c},u){if(t.size===0)return!0;const m=hN(t,u),h=Ao(m),g=Uh(h,i,s,u?.minZoom??r,u?.maxZoom??c,u?.padding??.1);return await a.setViewport(g,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),!0}function f1({nodeId:t,nextPosition:i,nodeLookup:s,nodeOrigin:a=[0,0],nodeExtent:r,onError:c}){const u=s.get(t),m=u.parentId?s.get(u.parentId):void 0,{x:h,y:g}=m?m.internals.positionAbsolute:{x:0,y:0},v=u.origin??a;let p=u.extent||r;if(u.extent==="parent"&&!u.expandParent)if(!m)c?.("005",wn.error005());else{const S=m.measured.width,E=m.measured.height;S&&E&&(p=[[h,g],[h+S,g+E]])}else m&&As(u.extent)&&(p=[[u.extent[0][0]+h,u.extent[0][1]+g],[u.extent[1][0]+h,u.extent[1][1]+g]]);const y=As(p)?Ns(i,p,u.measured):i;return(u.measured.width===void 0||u.measured.height===void 0)&&c?.("015",wn.error015()),{position:{x:y.x-h+(u.measured.width??0)*v[0],y:y.y-g+(u.measured.height??0)*v[1]},positionAbsolute:y}}async function gN({nodesToRemove:t=[],edgesToRemove:i=[],nodes:s,edges:a,onBeforeDelete:r}){const c=new Set(t.map(y=>y.id)),u=[];for(const y of s){if(y.deletable===!1)continue;const S=c.has(y.id),E=!S&&y.parentId&&u.find(_=>_.id===y.parentId);(S||E)&&u.push(y)}const m=new Set(i.map(y=>y.id)),h=a.filter(y=>y.deletable!==!1),v=dN(u,h);for(const y of h)m.has(y.id)&&!v.find(E=>E.id===y.id)&&v.push(y);if(!r)return{edges:v,nodes:u};const p=await r({nodes:u,edges:v});return typeof p=="boolean"?p?{edges:v,nodes:u}:{edges:[],nodes:[]}:p}const Ul=(t,i=0,s=1)=>Math.min(Math.max(t,i),s),Ns=(t={x:0,y:0},i,s)=>({x:Ul(t.x,i[0][0],i[1][0]-(s?.width??0)),y:Ul(t.y,i[0][1],i[1][1]-(s?.height??0))});function d1(t,i,s){const{width:a,height:r}=ri(s),{x:c,y:u}=s.internals.positionAbsolute;return Ns(t,[[c,u],[c+a,u+r]],i)}const v0=(t,i,s)=>t<i?Ul(Math.abs(t-i),1,i)/i:t>s?-Ul(Math.abs(t-s),1,i)/i:0,$h=(t,i,s=15,a=40)=>{const r=v0(t.x,a,i.width-a)*s,c=v0(t.y,a,i.height-a)*s;return[r,c]},Xc=(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)}),mh=({x:t,y:i,width:s,height:a})=>({x:t,y:i,x2:t+s,y2:i+a}),Kc=({x:t,y:i,x2:s,y2:a})=>({x:t,y:i,width:s-t,height:a-i}),ql=(t,i=[0,0])=>{const{x:s,y:a}=kh(t)?t.internals.positionAbsolute:No(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}},Dc=(t,i=[0,0])=>{const{x:s,y:a}=kh(t)?t.internals.positionAbsolute:No(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)}},h1=(t,i)=>Kc(Xc(mh(t),mh(i))),po=(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)},b0=t=>bn(t.width)&&bn(t.height)&&bn(t.x)&&bn(t.y),bn=t=>!isNaN(t)&&isFinite(t),m1=(t,i)=>(s,a)=>{},To=(t,i=[1,1])=>({x:i[0]*Math.round(t.x/i[0]),y:i[1]*Math.round(t.y/i[1])}),Kl=({x:t,y:i},[s,a,r],c=!1,u=[1,1])=>{const m={x:(t-s)/r,y:(i-a)/r};return c?To(m,u):m},Vl=({x:t,y:i},[s,a,r])=>({x:t*r+s,y:i*r+a});function Sl(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 pN(t,i,s){if(typeof t=="string"||typeof t=="number"){const a=Sl(t,s),r=Sl(t,i);return{top:a,right:r,bottom:a,left:r,x:r*2,y:a*2}}if(typeof t=="object"){const a=Sl(t.top??t.y??0,s),r=Sl(t.bottom??t.y??0,s),c=Sl(t.left??t.x??0,i),u=Sl(t.right??t.x??0,i);return{top:a,right:u,bottom:r,left:c,x:c+u,y:a+r}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function yN(t,i,s,a,r,c){const{x:u,y:m}=Vl(t,[i,s,a]),{x:h,y:g}=Vl({x:t.x+t.width,y:t.y+t.height},[i,s,a]),v=r-h,p=c-g;return{left:Math.floor(u),top:Math.floor(m),right:Math.floor(v),bottom:Math.floor(p)}}const Uh=(t,i,s,a,r,c)=>{const u=pN(c,i,s),m=(i-u.x)/t.width,h=(s-u.y)/t.height,g=Math.min(m,h),v=Ul(g,a,r),p=t.x+t.width/2,y=t.y+t.height/2,S=i/2-p*v,E=s/2-y*v,_=yN(t,S,E,v,i,s),N={left:Math.min(_.left-u.left,0),top:Math.min(_.top-u.top,0),right:Math.min(_.right-u.right,0),bottom:Math.min(_.bottom-u.bottom,0)};return{x:S-N.left+N.right,y:E-N.top+N.bottom,zoom:v}},yo=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function As(t){return t!=null&&t!=="parent"}function ri(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function g1(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function p1(t,i={width:0,height:0},s,a,r){const c={...t},u=a.get(s);if(u){const m=u.origin||r;c.x+=u.internals.positionAbsolute.x-(i.width??0)*m[0],c.y+=u.internals.positionAbsolute.y-(i.height??0)*m[1]}return c}function S0(t,i){if(t.size!==i.size)return!1;for(const s of t)if(!i.has(s))return!1;return!0}function vN(){let t,i;return{promise:new Promise((a,r)=>{t=a,i=r}),resolve:t,reject:i}}function bN(t){return{...o1,...t||{}}}function lo(t,{snapGrid:i=[0,0],snapToGrid:s=!1,transform:a,containerBounds:r}){const{x:c,y:u}=Sn(t),m=Kl({x:c-(r?.left??0),y:u-(r?.top??0)},a),{x:h,y:g}=s?To(m,i):m;return{xSnapped:h,ySnapped:g,...m}}const qh=t=>({width:t.offsetWidth,height:t.offsetHeight}),y1=t=>t?.getRootNode?.()||window?.document,SN=["INPUT","SELECT","TEXTAREA"];function v1(t){const i=t.composedPath?.()?.[0]||t.target;return i?.nodeType!==1?!1:SN.includes(i.nodeName)||i.hasAttribute("contenteditable")||!!i.closest(".nokey")}const b1=t=>"clientX"in t,Sn=(t,i)=>{const s=b1(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)}},w0=(t,i,s,a,r)=>{const c=i.querySelectorAll(`.${t}`);return!c||!c.length?null:Array.from(c).map(u=>{const m=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:t,nodeId:r,position:u.getAttribute("data-handlepos"),x:(m.left-s.left)/a,y:(m.top-s.top)/a,...qh(u)}})};function S1({sourceX:t,sourceY:i,targetX:s,targetY:a,sourceControlX:r,sourceControlY:c,targetControlX:u,targetControlY:m}){const h=t*.125+r*.375+u*.375+s*.125,g=i*.125+c*.375+m*.375+a*.125,v=Math.abs(h-t),p=Math.abs(g-i);return[h,g,v,p]}function lc(t,i){return t>=0?.5*t:i*25*Math.sqrt(-t)}function x0({pos:t,x1:i,y1:s,x2:a,y2:r,c}){switch(t){case fe.Left:return[i-lc(i-a,c),s];case fe.Right:return[i+lc(a-i,c),s];case fe.Top:return[i,s-lc(s-r,c)];case fe.Bottom:return[i,s+lc(r-s,c)]}}function w1({sourceX:t,sourceY:i,sourcePosition:s=fe.Bottom,targetX:a,targetY:r,targetPosition:c=fe.Top,curvature:u=.25}){const[m,h]=x0({pos:s,x1:t,y1:i,x2:a,y2:r,c:u}),[g,v]=x0({pos:c,x1:a,y1:r,x2:t,y2:i,c:u}),[p,y,S,E]=S1({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,S,E]}function x1({sourceX:t,sourceY:i,targetX:s,targetY:a}){const r=Math.abs(s-t)/2,c=s<t?s+r:s-r,u=Math.abs(a-i)/2,m=a<i?a+u:a-u;return[c,m,r,u]}function wN({sourceNode:t,targetNode:i,selected:s=!1,zIndex:a=0,elevateOnSelect:r=!1,zIndexMode:c="basic"}){if(c==="manual")return a;const u=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 u+m}function xN({sourceNode:t,targetNode:i,width:s,height:a,transform:r}){const c=Xc(Dc(t),Dc(i));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u={x:-r[0]/r[2],y:-r[1]/r[2],width:s/r[2],height:a/r[2]};return po(u,Kc(c))>0}const EN=({source:t,sourceHandle:i,target:s,targetHandle:a})=>`xy-edge__${t}${i||""}-${s}${a||""}`,_N=(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",wn.error006()),i;const a=s.getEdgeId||EN;let r;return u1(t)?r={...t}:r={...t,id:a(t)},_N(r,i)?i:(r.sourceHandle===null&&delete r.sourceHandle,r.targetHandle===null&&delete r.targetHandle,i.concat(r))};function E1({sourceX:t,sourceY:i,targetX:s,targetY:a}){const[r,c,u,m]=x1({sourceX:t,sourceY:i,targetX:s,targetY:a});return[`M ${t},${i}L ${s},${a}`,r,c,u,m]}const E0={[fe.Left]:{x:-1,y:0},[fe.Right]:{x:1,y:0},[fe.Top]:{x:0,y:-1},[fe.Bottom]:{x:0,y:1}},AN=({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},_0=(t,i)=>Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2));function TN({source:t,sourcePosition:i=fe.Bottom,target:s,targetPosition:a=fe.Top,center:r,offset:c,stepPosition:u}){const m=E0[i],h=E0[a],g={x:t.x+m.x*c,y:t.y+m.y*c},v={x:s.x+h.x*c,y:s.y+h.y*c},p=AN({source:g,sourcePosition:i,target:v}),y=p.x!==0?"x":"y",S=p[y];let E=[],_,N;const w={x:0,y:0},D={x:0,y:0},[,,x,T]=x1({sourceX:t.x,sourceY:t.y,targetX:s.x,targetY:s.y});if(m[y]*h[y]===-1){y==="x"?(_=r.x??g.x+(v.x-g.x)*u,N=r.y??(g.y+v.y)/2):(_=r.x??(g.x+v.x)/2,N=r.y??g.y+(v.y-g.y)*u);const R=[{x:_,y:g.y},{x:_,y:v.y}],V=[{x:g.x,y:N},{x:v.x,y:N}];m[y]===S?E=y==="x"?R:V:E=y==="x"?V:R}else{const R=[{x:g.x,y:v.y}],V=[{x:v.x,y:g.y}];if(y==="x"?E=m.x===S?V:R:E=m.y===S?R:V,i===a){const B=Math.abs(t[y]-s[y]);if(B<=c){const X=Math.min(c-1,c-B);m[y]===S?w[y]=(g[y]>t[y]?-1:1)*X:D[y]=(v[y]>s[y]?-1:1)*X}}if(i!==a){const B=y==="x"?"y":"x",X=m[y]===h[B],C=g[B]>v[B],H=g[B]<v[B];(m[y]===1&&(!X&&C||X&&H)||m[y]!==1&&(!X&&H||X&&C))&&(E=y==="x"?R:V)}const le={x:g.x+w.x,y:g.y+w.y},K={x:v.x+D.x,y:v.y+D.y},Z=Math.max(Math.abs(le.x-E[0].x),Math.abs(K.x-E[0].x)),oe=Math.max(Math.abs(le.y-E[0].y),Math.abs(K.y-E[0].y));Z>=oe?(_=(le.x+K.x)/2,N=E[0].y):(_=E[0].x,N=(le.y+K.y)/2)}const L={x:g.x+w.x,y:g.y+w.y},O={x:v.x+D.x,y:v.y+D.y};return[[t,...L.x!==E[0].x||L.y!==E[0].y?[L]:[],...E,...O.x!==E[E.length-1].x||O.y!==E[E.length-1].y?[O]:[],s],_,N,x,T]}function MN(t,i,s,a){const r=Math.min(_0(t,i)/2,_0(i,s)/2,a),{x:c,y:u}=i;if(t.x===c&&c===s.x||t.y===u&&u===s.y)return`L${c} ${u}`;if(t.y===u){const g=t.x<s.x?-1:1,v=t.y<s.y?1:-1;return`L ${c+r*g},${u}Q ${c},${u} ${c},${u+r*v}`}const m=t.x<s.x?1:-1,h=t.y<s.y?-1:1;return`L ${c},${u+r*h}Q ${c},${u} ${c+r*m},${u}`}function gh({sourceX:t,sourceY:i,sourcePosition:s=fe.Bottom,targetX:a,targetY:r,targetPosition:c=fe.Top,borderRadius:u=5,centerX:m,centerY:h,offset:g=20,stepPosition:v=.5}){const[p,y,S,E,_]=TN({source:{x:t,y:i},sourcePosition:s,target:{x:a,y:r},targetPosition:c,center:{x:m,y:h},offset:g,stepPosition:v});let N=`M${p[0].x} ${p[0].y}`;for(let w=1;w<p.length-1;w++)N+=MN(p[w-1],p[w],p[w+1],u);return N+=`L${p[p.length-1].x} ${p[p.length-1].y}`,[N,y,S,E,_]}function N0(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function CN(t){const{sourceNode:i,targetNode:s}=t;if(!N0(i)||!N0(s))return null;const a=i.internals.handleBounds||A0(i.handles),r=s.internals.handleBounds||A0(s.handles),c=T0(a?.source??[],t.sourceHandle),u=T0(t.connectionMode===$l.Strict?r?.target??[]:(r?.target??[]).concat(r?.source??[]),t.targetHandle);if(!c||!u)return t.onError?.("008",wn.error008(c?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const m=c?.position||fe.Bottom,h=u?.position||fe.Top,g=Ts(i,c,m),v=Ts(s,u,h);return{sourceX:g.x,sourceY:g.y,targetX:v.x,targetY:v.y,sourcePosition:m,targetPosition:h}}function A0(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 Ts(t,i,s=fe.Left,a=!1){const r=(i?.x??0)+t.internals.positionAbsolute.x,c=(i?.y??0)+t.internals.positionAbsolute.y,{width:u,height:m}=i??ri(t);if(a)return{x:r+u/2,y:c+m/2};switch(i?.position??s){case fe.Top:return{x:r+u/2,y:c};case fe.Right:return{x:r+u,y:c+m/2};case fe.Bottom:return{x:r+u/2,y:c+m};case fe.Left:return{x:r,y:c+m/2}}}function T0(t,i){return t&&(i?t.find(s=>s.id===i):t[0])||null}function ph(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 c=new Set;return t.reduce((u,m)=>([m.markerStart||a,m.markerEnd||r].forEach(h=>{if(h&&typeof h=="object"){const g=ph(h,i);c.has(g)||(u.push({id:g,color:h.color||s,...h}),c.add(g))}}),u),[]).sort((u,m)=>u.id.localeCompare(m.id))}const _1=1e3,zN=10,Vh={nodeOrigin:[0,0],nodeExtent:ho,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},DN={...Vh,checkEquality:!0};function Yh(t,i){const s={...t};for(const a in i)i[a]!==void 0&&(s[a]=i[a]);return s}function LN(t,i,s){const a=Yh(Vh,s);for(const r of t.values())if(r.parentId)Xh(r,t,i,a);else{const c=No(r,a.nodeOrigin),u=As(r.extent)?r.extent:a.nodeExtent,m=Ns(c,u,ri(r));r.internals.positionAbsolute=m}}function RN(t,i){if(!t.handles)return t.measured?i?.internals.handleBounds:void 0;const s=[],a=[];for(const r of t.handles){const c={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(c):r.type==="target"&&a.push(c)}return{source:s,target:a}}function Gh(t){return t==="manual"}function yh(t,i,s,a={}){const r=Yh(DN,a),c={i:0},u=new Map(i),m=r?.elevateNodesOnSelect&&!Gh(r.zIndexMode)?_1:0;let h=t.length>0,g=!1;i.clear(),s.clear();for(const v of t){let p=u.get(v.id);if(r.checkEquality&&v===p?.internals.userNode)i.set(v.id,p);else{const y=No(v,r.nodeOrigin),S=As(v.extent)?v.extent:r.nodeExtent,E=Ns(y,S,ri(v));p={...r.defaults,...v,measured:{width:v.measured?.width,height:v.measured?.height},internals:{positionAbsolute:E,handleBounds:RN(v,p),z:N1(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&&Xh(p,i,s,a,c),g||=v.selected??!1}return{nodesInitialized:h,hasSelectedNodes:g}}function BN(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 Xh(t,i,s,a,r){const{elevateNodesOnSelect:c,nodeOrigin:u,nodeExtent:m,zIndexMode:h}=Yh(Vh,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}BN(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*zN),r&&v.internals.rootParentIndex!==void 0&&(r.i=v.internals.rootParentIndex);const p=c&&!Gh(h)?_1:0,{x:y,y:S,z:E}=jN(t,v,u,m,p,h),{positionAbsolute:_}=t.internals,N=y!==_.x||S!==_.y;(N||E!==t.internals.z)&&i.set(t.id,{...t,internals:{...t.internals,positionAbsolute:N?{x:y,y:S}:_,z:E}})}function N1(t,i,s){const a=bn(t.zIndex)?t.zIndex:0;return Gh(s)?a:a+(t.selected?i:0)}function jN(t,i,s,a,r,c){const{x:u,y:m}=i.internals.positionAbsolute,h=ri(t),g=No(t,s),v=As(t.extent)?Ns(g,t.extent,h):g;let p=Ns({x:u+v.x,y:m+v.y},a,h);t.extent==="parent"&&(p=d1(p,h,i));const y=N1(t,r,c),S=i.internals.z??0;return{x:p.x,y:p.y,z:S>=y?S+1:y}}function Kh(t,i,s,a=[0,0]){const r=[],c=new Map;for(const u of t){const m=i.get(u.parentId);if(!m)continue;const h=c.get(u.parentId)?.expandedRect??ql(m),g=h1(h,u.rect);c.set(u.parentId,{expandedRect:g,parent:m})}return c.size>0&&c.forEach(({expandedRect:u,parent:m},h)=>{const g=m.internals.positionAbsolute,v=ri(m),p=m.origin??a,y=u.x<g.x?Math.round(Math.abs(g.x-u.x)):0,S=u.y<g.y?Math.round(Math.abs(g.y-u.y)):0,E=Math.max(v.width,Math.round(u.width)),_=Math.max(v.height,Math.round(u.height)),N=(E-v.width)*p[0],w=(_-v.height)*p[1];(y>0||S>0||N||w)&&(r.push({id:h,type:"position",position:{x:m.position.x-y+N,y:m.position.y-S+w}}),s.get(h)?.forEach(D=>{t.some(x=>x.id===D.id)||r.push({id:D.id,type:"position",position:{x:D.position.x+y,y:D.position.y+S}})})),(v.width<u.width||v.height<u.height||y||S)&&r.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:E+(y?p[0]*y-N:0),height:_+(S?p[1]*S-w:0)}})}),r}function kN(t,i,s,a,r,c,u){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 S of t.values()){const E=i.get(S.id);if(!E)continue;if(E.hidden){i.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),h=!0;continue}const _=qh(S.nodeElement),N=E.measured.width!==_.width||E.measured.height!==_.height;if(!!(_.width&&_.height&&(N||!E.internals.handleBounds||S.force))){const D=S.nodeElement.getBoundingClientRect(),x=As(E.extent)?E.extent:c;let{positionAbsolute:T}=E.internals;E.parentId&&E.extent==="parent"?T=d1(T,_,i.get(E.parentId)):x&&(T=Ns(T,x,_));const L={...E,measured:_,internals:{...E.internals,positionAbsolute:T,handleBounds:{source:w0("source",S.nodeElement,D,p,E.id),target:w0("target",S.nodeElement,D,p,E.id)}}};i.set(E.id,L),E.parentId&&Xh(L,i,s,{nodeOrigin:r,zIndexMode:u}),h=!0,N&&(g.push({id:E.id,type:"dimensions",dimensions:_}),E.expandParent&&E.parentId&&y.push({id:E.id,parentId:E.parentId,rect:ql(L,r)}))}}if(y.length>0){const S=Kh(y,i,s,r);g.push(...S)}return{changes:g,updatedInternals:h}}async function HN({delta:t,panZoom:i,transform:s,translateExtent:a,width:r,height:c}){if(!i||!t.x&&!t.y)return!1;const u=await i.setViewportConstrained({x:s[0]+t.x,y:s[1]+t.y,zoom:s[2]},[[0,0],[r,c]],a);return!!u&&(u.x!==s[0]||u.y!==s[1]||u.k!==s[2])}function M0(t,i,s,a,r,c){let u=r;const m=a.get(u)||new Map;a.set(u,m.set(s,i)),u=`${r}-${t}`;const h=a.get(u)||new Map;if(a.set(u,h.set(s,i)),c){u=`${r}-${t}-${c}`;const g=a.get(u)||new Map;a.set(u,g.set(s,i))}}function A1(t,i,s){t.clear(),i.clear();for(const a of s){const{source:r,target:c,sourceHandle:u=null,targetHandle:m=null}=a,h={edgeId:a.id,source:r,target:c,sourceHandle:u,targetHandle:m},g=`${r}-${u}--${c}-${m}`,v=`${c}-${m}--${r}-${u}`;M0("source",h,v,t,r,u),M0("target",h,g,t,c,m),i.set(a.id,a)}}function T1(t,i){if(!t.parentId)return!1;const s=i.get(t.parentId);return s?s.selected?!0:T1(s,i):!1}function C0(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 $N(t,i,s,a){const r=new Map;for(const[c,u]of t)if((u.selected||u.id===a)&&(!u.parentId||!T1(u,t))&&(u.draggable||i&&typeof u.draggable>"u")){const m=t.get(c);m&&r.set(c,{id:c,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 Ud({nodeId:t,dragItems:i,nodeLookup:s,dragging:a=!0}){const r=[];for(const[u,m]of i){const h=s.get(u)?.internals.userNode;h&&r.push({...h,position:m.position,dragging:a})}if(!t)return[r[0],r];const c=s.get(t)?.internals.userNode;return[c?{...c,position:i.get(t)?.position||c.position,dragging:a}:r[0],r]}function UN({dragItems:t,snapGrid:i,x:s,y:a}){const r=t.values().next().value;if(!r)return null;const c={x:s-r.distance.x,y:a-r.distance.y},u=To(c,i);return{x:u.x-c.x,y:u.y-c.y}}function qN({onNodeMouseDown:t,getStoreItems:i,onDragStart:s,onDrag:a,onDragStop:r}){let c={x:null,y:null},u=0,m=new Map,h=!1,g={x:0,y:0},v=null,p=!1,y=null,S=!1,E=!1,_=null;function N({noDragClassName:D,handleSelector:x,domNode:T,isSelectable:L,nodeId:O,nodeClickDistance:j=0}){y=Kt(T);function R({x:Z,y:oe}){const{nodeLookup:B,nodeExtent:X,snapGrid:C,snapToGrid:H,nodeOrigin:G,onNodeDrag:U,onSelectionDrag:J,onError:M,updateNodePositions:$}=i();c={x:Z,y:oe};let ee=!1;const ie=m.size>1,re=ie&&X?mh(Ao(m)):null,de=ie&&H?UN({dragItems:m,snapGrid:C,x:Z,y:oe}):null;for(const[ce,te]of m){if(!B.has(ce))continue;let ue={x:Z-te.distance.x,y:oe-te.distance.y};H&&(ue=de?{x:Math.round(ue.x+de.x),y:Math.round(ue.y+de.y)}:To(ue,C));let Se=null;if(ie&&X&&!te.extent&&re){const{positionAbsolute:ye}=te.internals,Ee=ye.x-re.x+X[0][0],De=ye.x+te.measured.width-re.x2+X[1][0],Ge=ye.y-re.y+X[0][1],yt=ye.y+te.measured.height-re.y2+X[1][1];Se=[[Ee,Ge],[De,yt]]}const{position:be,positionAbsolute:ge}=f1({nodeId:ce,nextPosition:ue,nodeLookup:B,nodeExtent:Se||X,nodeOrigin:G,onError:M});ee=ee||te.position.x!==be.x||te.position.y!==be.y,te.position=be,te.internals.positionAbsolute=ge}if(E=E||ee,!!ee&&($(m,!0),_&&(a||U||!O&&J))){const[ce,te]=Ud({nodeId:O,dragItems:m,nodeLookup:B});a?.(_,m,ce,te),U?.(_,ce,te),O||J?.(_,te)}}async function V(){if(!v)return;const{transform:Z,panBy:oe,autoPanSpeed:B,autoPanOnNodeDrag:X}=i();if(!X){h=!1,cancelAnimationFrame(u);return}const[C,H]=$h(g,v,B);(C!==0||H!==0)&&(c.x=(c.x??0)-C/Z[2],c.y=(c.y??0)-H/Z[2],await oe({x:C,y:H})&&R(c)),u=requestAnimationFrame(V)}function le(Z){const{nodeLookup:oe,multiSelectionActive:B,nodesDraggable:X,transform:C,snapGrid:H,snapToGrid:G,selectNodesOnDrag:U,onNodeDragStart:J,onSelectionDragStart:M,unselectNodesAndEdges:$}=i();p=!0,(!U||!L)&&!B&&O&&(oe.get(O)?.selected||$()),L&&U&&O&&t?.(O);const ee=lo(Z.sourceEvent,{transform:C,snapGrid:H,snapToGrid:G,containerBounds:v});if(c=ee,m=$N(oe,X,ee,O),m.size>0&&(s||J||!O&&M)){const[ie,re]=Ud({nodeId:O,dragItems:m,nodeLookup:oe});s?.(Z.sourceEvent,m,ie,re),J?.(Z.sourceEvent,ie,re),O||M?.(Z.sourceEvent,re)}}const K=Gv().clickDistance(j).on("start",Z=>{const{domNode:oe,nodeDragThreshold:B,transform:X,snapGrid:C,snapToGrid:H}=i();v=oe?.getBoundingClientRect()||null,S=!1,E=!1,_=Z.sourceEvent,B===0&&le(Z),c=lo(Z.sourceEvent,{transform:X,snapGrid:C,snapToGrid:H,containerBounds:v}),g=Sn(Z.sourceEvent,v)}).on("drag",Z=>{const{autoPanOnNodeDrag:oe,transform:B,snapGrid:X,snapToGrid:C,nodeDragThreshold:H,nodeLookup:G}=i(),U=lo(Z.sourceEvent,{transform:B,snapGrid:X,snapToGrid:C,containerBounds:v});if(_=Z.sourceEvent,(Z.sourceEvent.type==="touchmove"&&Z.sourceEvent.touches.length>1||O&&!G.has(O))&&(S=!0),!S){if(!h&&oe&&p&&(h=!0,V()),!p){const J=Sn(Z.sourceEvent,v),M=J.x-g.x,$=J.y-g.y;Math.sqrt(M*M+$*$)>H&&le(Z)}(c.x!==U.xSnapped||c.y!==U.ySnapped)&&m&&p&&(g=Sn(Z.sourceEvent,v),R(U))}}).on("end",Z=>{if(!p||S){S&&m.size>0&&i().updateNodePositions(m,!1);return}if(h=!1,p=!1,cancelAnimationFrame(u),m.size>0){const{nodeLookup:oe,updateNodePositions:B,onNodeDragStop:X,onSelectionDragStop:C}=i();if(E&&(B(m,!1),E=!1),r||X||!O&&C){const[H,G]=Ud({nodeId:O,dragItems:m,nodeLookup:oe,dragging:!1});r?.(Z.sourceEvent,m,H,G),X?.(Z.sourceEvent,H,G),O||C?.(Z.sourceEvent,G)}}}).filter(Z=>{const oe=Z.target;return!Z.button&&(!D||!C0(oe,`.${D}`,T))&&(!x||C0(oe,x,T))});y.call(K)}function w(){y?.on(".drag",null)}return{update:N,destroy:w}}function VN(t,i,s){const a=[],r={x:t.x-s,y:t.y-s,width:s*2,height:s*2};for(const c of i.values())po(r,ql(c))>0&&a.push(c);return a}const YN=250;function GN(t,i,s,a){let r=[],c=1/0;const u=VN(t,s,i+YN);for(const m of u){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}=Ts(m,g,g.position,!0),y=Math.sqrt(Math.pow(v-t.x,2)+Math.pow(p-t.y,2));y>i||(y<c?(r=[{...g,x:v,y:p}],c=y):y===c&&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 M1(t,i,s,a,r,c=!1){const u=a.get(t);if(!u)return null;const m=r==="strict"?u.internals.handleBounds?.[i]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],h=(s?m?.find(g=>g.id===s):m?.[0])??null;return h&&c?{...h,...Ts(u,h,h.position,!0)}:h}function C1(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 O1=()=>!0;function KN(t,{connectionMode:i,connectionRadius:s,handleId:a,nodeId:r,edgeUpdaterType:c,isTarget:u,domNode:m,nodeLookup:h,lib:g,autoPanOnConnect:v,flowId:p,panBy:y,cancelConnection:S,onConnectStart:E,onConnect:_,onConnectEnd:N,isValidConnection:w=O1,onReconnectEnd:D,updateConnection:x,getTransform:T,getFromHandle:L,autoPanSpeed:O,dragThreshold:j=1,handleDomNode:R}){const V=y1(t.target);let le=0,K;const{x:Z,y:oe}=Sn(t),B=C1(c,R),X=m?.getBoundingClientRect();let C=!1;if(!X||!B)return;const H=M1(r,B,a,h,i);if(!H)return;let G=Sn(t,X),U=!1,J=null,M=!1,$=null;function ee(){if(!v||!X)return;const[be,ge]=$h(G,X,O);y({x:be,y:ge}),le=requestAnimationFrame(ee)}const ie={...H,nodeId:r,type:B,position:H.position},re=h.get(r);let ce={inProgress:!0,isValid:null,from:Ts(re,ie,fe.Left,!0),fromHandle:ie,fromPosition:ie.position,fromNode:re,to:G,toHandle:null,toPosition:y0[ie.position],toNode:null,pointer:G};function te(){C=!0,x(ce),E?.(t,{nodeId:r,handleId:a,handleType:B})}j===0&&te();function ue(be){if(!C){const{x:yt,y:It}=Sn(be),Nt=yt-Z,At=It-oe;if(!(Nt*Nt+At*At>j*j))return;te()}if(!L()||!ie){Se(be);return}const ge=T();G=Sn(be,X),K=GN(Kl(G,ge,!1,[1,1]),s,h,ie),U||(ee(),U=!0);const ye=z1(be,{handle:K,connectionMode:i,fromNodeId:r,fromHandleId:a,fromType:u?"target":"source",isValidConnection:w,doc:V,lib:g,flowId:p,nodeLookup:h});$=ye.handleDomNode,J=ye.connection,M=XN(!!K,ye.isValid);const Ee=h.get(r),De=Ee?Ts(Ee,ie,fe.Left,!0):ce.from,Ge={...ce,from:De,isValid:M,to:ye.toHandle&&M?Vl({x:ye.toHandle.x,y:ye.toHandle.y},ge):G,toHandle:ye.toHandle,toPosition:M&&ye.toHandle?ye.toHandle.position:y0[ie.position],toNode:ye.toHandle?h.get(ye.toHandle.nodeId):null,pointer:G};x(Ge),ce=Ge}function Se(be){if(!("touches"in be&&be.touches.length>0)){if(C){(K||$)&&J&&M&&_?.(J);const{inProgress:ge,...ye}=ce,Ee={...ye,toPosition:ce.toHandle?ce.toPosition:null};N?.(be,Ee),c&&D?.(be,Ee)}S(),cancelAnimationFrame(le),U=!1,M=!1,J=null,$=null,V.removeEventListener("mousemove",ue),V.removeEventListener("mouseup",Se),V.removeEventListener("touchmove",ue),V.removeEventListener("touchend",Se)}}V.addEventListener("mousemove",ue),V.addEventListener("mouseup",Se),V.addEventListener("touchmove",ue),V.addEventListener("touchend",Se)}function z1(t,{handle:i,connectionMode:s,fromNodeId:a,fromHandleId:r,fromType:c,doc:u,lib:m,flowId:h,isValidConnection:g=O1,nodeLookup:v}){const p=c==="target",y=i?u.querySelector(`.${m}-flow__handle[data-id="${h}-${i?.nodeId}-${i?.id}-${i?.type}"]`):null,{x:S,y:E}=Sn(t),_=u.elementFromPoint(S,E),N=_?.classList.contains(`${m}-flow__handle`)?_:y,w={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const D=C1(void 0,N),x=N.getAttribute("data-nodeid"),T=N.getAttribute("data-handleid"),L=N.classList.contains("connectable"),O=N.classList.contains("connectableend");if(!x||!D)return w;const j={source:p?x:a,sourceHandle:p?T:r,target:p?a:x,targetHandle:p?r:T};w.connection=j;const V=L&&O&&(s===$l.Strict?p&&D==="source"||!p&&D==="target":x!==a||T!==r);w.isValid=V&&g(j),w.toHandle=M1(x,D,T,v,s,!0)}return w}const vh={onPointerDown:KN,isValid:z1};function ZN({domNode:t,panZoom:i,getTransform:s,getViewScale:a}){const r=Kt(t);function c({translateExtent:m,width:h,height:g,zoomStep:v=1,pannable:p=!0,zoomable:y=!0,inversePan:S=!1}){const E=x=>{if(x.sourceEvent.type!=="wheel"||!i)return;const T=s(),L=x.sourceEvent.ctrlKey&&yo()?10:1,O=-x.sourceEvent.deltaY*(x.sourceEvent.deltaMode===1?.05:x.sourceEvent.deltaMode?1:.002)*v,j=T[2]*Math.pow(2,O*L);i.scaleTo(j)};let _=[0,0];const N=x=>{(x.sourceEvent.type==="mousedown"||x.sourceEvent.type==="touchstart")&&(_=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY])},w=x=>{const T=s();if(x.sourceEvent.type!=="mousemove"&&x.sourceEvent.type!=="touchmove"||!i)return;const L=[x.sourceEvent.clientX??x.sourceEvent.touches[0].clientX,x.sourceEvent.clientY??x.sourceEvent.touches[0].clientY],O=[L[0]-_[0],L[1]-_[1]];_=L;const j=a()*Math.max(T[2],Math.log(T[2]))*(S?-1:1),R={x:T[0]-O[0]*j,y:T[1]-O[1]*j},V=[[0,0],[h,g]];i.setViewportConstrained({x:R.x,y:R.y,zoom:T[2]},V,m)},D=l1().on("start",N).on("zoom",p?w:null).on("zoom.wheel",y?E:null);r.call(D,{})}function u(){r.on("zoom",null)}return{update:c,destroy:u,pointer:yn}}const Zc=t=>({x:t.x,y:t.y,zoom:t.k}),qd=({x:t,y:i,zoom:s})=>Gc.translate(t,i).scale(s),Nl=(t,i)=>t.target.closest(`.${i}`),D1=(t,i)=>i===2&&Array.isArray(t)&&t.includes(2),QN=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Vd=(t,i=0,s=QN,a=()=>{})=>{const r=typeof i=="number"&&i>0;return r||a(),r?t.transition().duration(i).ease(s).on("end",a):t},L1=t=>{const i=t.ctrlKey&&yo()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*i};function IN({zoomPanValues:t,noWheelClassName:i,d3Selection:s,d3Zoom:a,panOnScrollMode:r,panOnScrollSpeed:c,zoomOnPinch:u,onPanZoomStart:m,onPanZoom:h,onPanZoomEnd:g}){return v=>{if(Nl(v,i))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const p=s.property("__zoom").k||1;if(v.ctrlKey&&u){const N=yn(v),w=L1(v),D=p*Math.pow(2,w);a.scaleTo(s,D,N,v);return}const y=v.deltaMode===1?20:1;let S=r===xs.Vertical?0:v.deltaX*y,E=r===xs.Horizontal?0:v.deltaY*y;!yo()&&v.shiftKey&&r!==xs.Vertical&&(S=v.deltaY*y,E=0),a.translateBy(s,-(S/p)*c,-(E/p)*c,{internal:!0});const _=Zc(s.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(h?.(v,_),t.panScrollTimeout=setTimeout(()=>{g?.(v,_),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,m?.(v,_))}}function JN({noWheelClassName:t,preventScrolling:i,d3ZoomHandler:s}){return function(a,r){const c=a.type==="wheel",u=!i&&c&&!a.ctrlKey,m=Nl(a,t);if(a.ctrlKey&&c&&m&&a.preventDefault(),u||m)return null;a.preventDefault(),s.call(this,a,r)}}function FN({zoomPanValues:t,onDraggingChange:i,onPanZoomStart:s}){return a=>{if(a.sourceEvent?.internal)return;const r=Zc(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 WN({zoomPanValues:t,panOnDrag:i,onPaneContextMenu:s,onTransformChange:a,onPanZoom:r}){return c=>{t.usedRightMouseButton=!!(s&&D1(i,t.mouseButton??0)),c.sourceEvent?.sync||a([c.transform.x,c.transform.y,c.transform.k]),r&&!c.sourceEvent?.internal&&r?.(c.sourceEvent,Zc(c.transform))}}function PN({zoomPanValues:t,panOnDrag:i,panOnScroll:s,onDraggingChange:a,onPanZoomEnd:r,onPaneContextMenu:c}){return u=>{if(!u.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,c&&D1(i,t.mouseButton??0)&&!t.usedRightMouseButton&&u.sourceEvent&&c(u.sourceEvent),t.usedRightMouseButton=!1,a(!1),r)){const m=Zc(u.transform);t.prevViewport=m,clearTimeout(t.timerId),t.timerId=setTimeout(()=>{r?.(u.sourceEvent,m)},s?150:0)}}}function eA({zoomActivationKeyPressed:t,zoomOnScroll:i,zoomOnPinch:s,panOnDrag:a,panOnScroll:r,zoomOnDoubleClick:c,userSelectionActive:u,noWheelClassName:m,noPanClassName:h,lib:g,connectionInProgress:v}){return p=>{const y=t||i,S=s&&p.ctrlKey,E=p.type==="wheel";if(p.button===1&&p.type==="mousedown"&&(Nl(p,`${g}-flow__node`)||Nl(p,`${g}-flow__edge`)))return!0;if(!a&&!y&&!r&&!c&&!s||u||v&&!E||Nl(p,m)&&E||Nl(p,h)&&(!E||r&&E&&!t)||!s&&p.ctrlKey&&E)return!1;if(!s&&p.type==="touchstart"&&p.touches?.length>1)return p.preventDefault(),!1;if(!y&&!r&&!S&&E||!a&&(p.type==="mousedown"||p.type==="touchstart")||Array.isArray(a)&&!a.includes(p.button)&&p.type==="mousedown")return!1;const _=Array.isArray(a)&&a.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||E)&&_}}function tA({domNode:t,minZoom:i,maxZoom:s,translateExtent:a,viewport:r,onPanZoom:c,onPanZoomStart:u,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=l1().scaleExtent([i,s]).translateExtent(a),y=Kt(t).call(p);D({x:r.x,y:r.y,zoom:Ul(r.zoom,i,s)},[[0,0],[v.width,v.height]],a);const S=y.on("wheel.zoom"),E=y.on("dblclick.zoom");p.wheelDelta(L1);async function _(K,Z){return y?new Promise(oe=>{p?.interpolate(Z?.interpolate==="linear"?so:pc).transform(Vd(y,Z?.duration,Z?.ease,()=>oe(!0)),K)}):!1}function N({noWheelClassName:K,noPanClassName:Z,onPaneContextMenu:oe,userSelectionActive:B,panOnScroll:X,panOnDrag:C,panOnScrollMode:H,panOnScrollSpeed:G,preventScrolling:U,zoomOnPinch:J,zoomOnScroll:M,zoomOnDoubleClick:$,zoomActivationKeyPressed:ee,lib:ie,onTransformChange:re,connectionInProgress:de,paneClickDistance:ce,selectionOnDrag:te}){B&&!g.isZoomingOrPanning&&w();const ue=X&&!ee&&!B;p.clickDistance(te?1/0:!bn(ce)||ce<0?0:ce);const Se=ue?IN({zoomPanValues:g,noWheelClassName:K,d3Selection:y,d3Zoom:p,panOnScrollMode:H,panOnScrollSpeed:G,zoomOnPinch:J,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:m}):JN({noWheelClassName:K,preventScrolling:U,d3ZoomHandler:S});y.on("wheel.zoom",Se,{passive:!1});const be=FN({zoomPanValues:g,onDraggingChange:h,onPanZoomStart:u});p.on("start",be);const ge=WN({zoomPanValues:g,panOnDrag:C,onPaneContextMenu:!!oe,onPanZoom:c,onTransformChange:re});p.on("zoom",ge);const ye=PN({zoomPanValues:g,panOnDrag:C,panOnScroll:X,onPaneContextMenu:oe,onPanZoomEnd:m,onDraggingChange:h});p.on("end",ye);const Ee=eA({zoomActivationKeyPressed:ee,panOnDrag:C,zoomOnScroll:M,panOnScroll:X,zoomOnDoubleClick:$,zoomOnPinch:J,userSelectionActive:B,noPanClassName:Z,noWheelClassName:K,lib:ie,connectionInProgress:de});p.filter(Ee),$?y.on("dblclick.zoom",E):y.on("dblclick.zoom",null)}function w(){p.on("zoom",null)}async function D(K,Z,oe){const B=qd(K),X=p?.constrain()(B,Z,oe);return X&&await _(X),X}async function x(K,Z){const oe=qd(K);return await _(oe,Z),oe}function T(K){if(y){const Z=qd(K),oe=y.property("__zoom");(oe.k!==K.zoom||oe.x!==K.x||oe.y!==K.y)&&p?.transform(y,Z,null,{sync:!0})}}function L(){const K=y?s1(y.node()):{x:0,y:0,k:1};return{x:K.x,y:K.y,zoom:K.k}}async function O(K,Z){return y?new Promise(oe=>{p?.interpolate(Z?.interpolate==="linear"?so:pc).scaleTo(Vd(y,Z?.duration,Z?.ease,()=>oe(!0)),K)}):!1}async function j(K,Z){return y?new Promise(oe=>{p?.interpolate(Z?.interpolate==="linear"?so:pc).scaleBy(Vd(y,Z?.duration,Z?.ease,()=>oe(!0)),K)}):!1}function R(K){p?.scaleExtent(K)}function V(K){p?.translateExtent(K)}function le(K){const Z=!bn(K)||K<0?0:K;p?.clickDistance(Z)}return{update:N,destroy:w,setViewport:x,setViewportConstrained:D,getViewport:L,scaleTo:O,scaleBy:j,setScaleExtent:R,setTranslateExtent:V,syncViewport:T,setClickDistance:le}}var Yl;(function(t){t.Line="line",t.Handle="handle"})(Yl||(Yl={}));function nA({width:t,prevWidth:i,height:s,prevHeight:a,affectsX:r,affectsY:c}){const u=t-i,m=s-a,h=[u>0?1:u<0?-1:0,m>0?1:m<0?-1:0];return u&&r&&(h[0]=h[0]*-1),m&&c&&(h[1]=h[1]*-1),h}function O0(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 Hi(t,i){return Math.max(0,i-t)}function $i(t,i){return Math.max(0,t-i)}function ac(t,i,s){return Math.max(0,i-t,t-s)}function z0(t,i){return t?!i:i}function iA(t,i,s,a,r,c,u,m){let{affectsX:h,affectsY:g}=i;const{isHorizontal:v,isVertical:p}=i,y=v&&p,{xSnapped:S,ySnapped:E}=s,{minWidth:_,maxWidth:N,minHeight:w,maxHeight:D}=a,{x,y:T,width:L,height:O,aspectRatio:j}=t;let R=Math.floor(v?S-t.pointerX:0),V=Math.floor(p?E-t.pointerY:0);const le=L+(h?-R:R),K=O+(g?-V:V),Z=-c[0]*L,oe=-c[1]*O;let B=ac(le,_,N),X=ac(K,w,D);if(u){let G=0,U=0;h&&R<0?G=Hi(x+R+Z,u[0][0]):!h&&R>0&&(G=$i(x+le+Z,u[1][0])),g&&V<0?U=Hi(T+V+oe,u[0][1]):!g&&V>0&&(U=$i(T+K+oe,u[1][1])),B=Math.max(B,G),X=Math.max(X,U)}if(m){let G=0,U=0;h&&R>0?G=$i(x+R,m[0][0]):!h&&R<0&&(G=Hi(x+le,m[1][0])),g&&V>0?U=$i(T+V,m[0][1]):!g&&V<0&&(U=Hi(T+K,m[1][1])),B=Math.max(B,G),X=Math.max(X,U)}if(r){if(v){const G=ac(le/j,w,D)*j;if(B=Math.max(B,G),u){let U=0;!h&&!g||h&&!g&&y?U=$i(T+oe+le/j,u[1][1])*j:U=Hi(T+oe+(h?R:-R)/j,u[0][1])*j,B=Math.max(B,U)}if(m){let U=0;!h&&!g||h&&!g&&y?U=Hi(T+le/j,m[1][1])*j:U=$i(T+(h?R:-R)/j,m[0][1])*j,B=Math.max(B,U)}}if(p){const G=ac(K*j,_,N)/j;if(X=Math.max(X,G),u){let U=0;!h&&!g||g&&!h&&y?U=$i(x+K*j+Z,u[1][0])/j:U=Hi(x+(g?V:-V)*j+Z,u[0][0])/j,X=Math.max(X,U)}if(m){let U=0;!h&&!g||g&&!h&&y?U=Hi(x+K*j,m[1][0])/j:U=$i(x+(g?V:-V)*j,m[0][0])/j,X=Math.max(X,U)}}}V=V+(V<0?X:-X),R=R+(R<0?B:-B),r&&(y?le>K*j?V=(z0(h,g)?-R:R)/j:R=(z0(h,g)?-V:V)*j:v?(V=R/j,g=h):(R=V*j,h=g));const C=h?x+R:x,H=g?T+V:T;return{width:L+(h?-R:R),height:O+(g?-V:V),x:c[0]*R*(h?-1:1)+C,y:c[1]*V*(g?-1:1)+H}}const R1={width:0,height:0,x:0,y:0},sA={...R1,pointerX:0,pointerY:0,aspectRatio:1};function lA(t,i,s){const a=i.position.x+t.position.x,r=i.position.y+t.position.y,c=t.measured.width??0,u=t.measured.height??0,m=s[0]*c,h=s[1]*u;return[[a-m,r-h],[a+c-m,r+u-h]]}function aA({domNode:t,nodeId:i,getStoreItems:s,onChange:a,onEnd:r}){const c=Kt(t);let u={controlDirection:O0("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:S,onResize:E,onResizeEnd:_,shouldResize:N}){let w={...R1},D={...sA};u={boundaries:v,resizeDirection:y,keepAspectRatio:p,controlDirection:O0(g)};let x,T=null,L=[],O,j,R,V=!1;const le=Gv().on("start",K=>{const{nodeLookup:Z,transform:oe,snapGrid:B,snapToGrid:X,nodeOrigin:C,paneDomNode:H}=s();if(x=Z.get(i),!x)return;T=H?.getBoundingClientRect()??null;const{xSnapped:G,ySnapped:U}=lo(K.sourceEvent,{transform:oe,snapGrid:B,snapToGrid:X,containerBounds:T});w={width:x.measured.width??0,height:x.measured.height??0,x:x.position.x??0,y:x.position.y??0},D={...w,pointerX:G,pointerY:U,aspectRatio:w.width/w.height},O=void 0,j=As(x.extent)?x.extent:void 0,x.parentId&&(x.extent==="parent"||x.expandParent)&&(O=Z.get(x.parentId)),O&&x.extent==="parent"&&(j=[[0,0],[O.measured.width,O.measured.height]]),L=[],R=void 0;for(const[J,M]of Z)if(M.parentId===i&&(L.push({id:J,position:{...M.position},extent:M.extent}),M.extent==="parent"||M.expandParent)){const $=lA(M,x,M.origin??C);R?R=[[Math.min($[0][0],R[0][0]),Math.min($[0][1],R[0][1])],[Math.max($[1][0],R[1][0]),Math.max($[1][1],R[1][1])]]:R=$}S?.(K,{...w})}).on("drag",K=>{const{transform:Z,snapGrid:oe,snapToGrid:B,nodeOrigin:X}=s(),C=lo(K.sourceEvent,{transform:Z,snapGrid:oe,snapToGrid:B,containerBounds:T}),H=[];if(!x)return;const{x:G,y:U,width:J,height:M}=w,$={},ee=x.origin??X,{width:ie,height:re,x:de,y:ce}=iA(D,u.controlDirection,C,u.boundaries,u.keepAspectRatio,ee,j,R),te=ie!==J,ue=re!==M,Se=de!==G&&te,be=ce!==U&&ue;if(!Se&&!be&&!te&&!ue)return;if((Se||be||ee[0]===1||ee[1]===1)&&($.x=Se?de:w.x,$.y=be?ce:w.y,w.x=$.x,w.y=$.y,L.length>0)){const De=de-G,Ge=ce-U;for(const yt of L)yt.position={x:yt.position.x-De+ee[0]*(ie-J),y:yt.position.y-Ge+ee[1]*(re-M)},H.push(yt)}if((te||ue)&&($.width=te&&(!u.resizeDirection||u.resizeDirection==="horizontal")?ie:w.width,$.height=ue&&(!u.resizeDirection||u.resizeDirection==="vertical")?re:w.height,w.width=$.width,w.height=$.height),O&&x.expandParent){const De=ee[0]*($.width??0);$.x&&$.x<De&&(w.x=De,D.x=D.x-($.x-De));const Ge=ee[1]*($.height??0);$.y&&$.y<Ge&&(w.y=Ge,D.y=D.y-($.y-Ge))}const ge=nA({width:w.width,prevWidth:J,height:w.height,prevHeight:M,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),ye={...w,direction:ge};N?.(K,ye)!==!1&&(V=!0,E?.(K,ye),a($,H))}).on("end",K=>{V&&(_?.(K,{...w}),r?.({...w}),V=!1)});c.call(le)}function h(){c.on(".drag",null)}return{update:m,destroy:h}}var Yd={exports:{}},Gd={},Xd={exports:{}},Kd={};var D0;function oA(){if(D0)return Kd;D0=1;var t=xo();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,c=t.useLayoutEffect,u=t.useDebugValue;function m(p,y){var S=y(),E=a({inst:{value:S,getSnapshot:y}}),_=E[0].inst,N=E[1];return c(function(){_.value=S,_.getSnapshot=y,h(_)&&N({inst:_})},[p,S,y]),r(function(){return h(_)&&N({inst:_}),p(function(){h(_)&&N({inst:_})})},[p]),u(S),S}function h(p){var y=p.getSnapshot;p=p.value;try{var S=y();return!s(p,S)}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 Kd.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:v,Kd}var L0;function rA(){return L0||(L0=1,Xd.exports=oA()),Xd.exports}var R0;function cA(){if(R0)return Gd;R0=1;var t=xo(),i=rA();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,c=t.useRef,u=t.useEffect,m=t.useMemo,h=t.useDebugValue;return Gd.useSyncExternalStoreWithSelector=function(g,v,p,y,S){var E=c(null);if(E.current===null){var _={hasValue:!1,value:null};E.current=_}else _=E.current;E=m(function(){function w(O){if(!D){if(D=!0,x=O,O=y(O),S!==void 0&&_.hasValue){var j=_.value;if(S(j,O))return T=j}return T=O}if(j=T,a(x,O))return j;var R=y(O);return S!==void 0&&S(j,R)?(x=O,j):(x=O,T=R)}var D=!1,x,T,L=p===void 0?null:p;return[function(){return w(v())},L===null?void 0:function(){return w(L())}]},[v,p,y,S]);var N=r(g,E[0],E[1]);return u(function(){_.hasValue=!0,_.value=N},[N]),h(N),N},Gd}var B0;function uA(){return B0||(B0=1,Yd.exports=cA()),Yd.exports}var fA=uA();const dA=Tv(fA),hA={},j0=t=>{let i;const s=new Set,a=(v,p)=>{const y=typeof v=="function"?v(i):v;if(!Object.is(y,i)){const S=i;i=p??(typeof y!="object"||y===null)?y:Object.assign({},i,y),s.forEach(E=>E(i,S))}},r=()=>i,h={setState:a,getState:r,getInitialState:()=>g,subscribe:v=>(s.add(v),()=>s.delete(v)),destroy:()=>{(hA?"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},mA=t=>t?j0(t):j0,{useDebugValue:gA}=Mv,{useSyncExternalStoreWithSelector:pA}=dA,yA=t=>t;function B1(t,i=yA,s){const a=pA(t.subscribe,t.getState,t.getServerState||t.getInitialState,i,s);return gA(a),a}const k0=(t,i)=>{const s=mA(t),a=(r,c=i)=>B1(s,r,c);return Object.assign(a,s),a},vA=(t,i)=>t?k0(t,i):k0;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}var bA=Cv();const Qc=W.createContext(null),SA=Qc.Provider,j1=wn.error001("react");function ze(t,i){const s=W.useContext(Qc);if(s===null)throw new Error(j1);return B1(s,t,i)}function Je(){const t=W.useContext(Qc);if(t===null)throw new Error(j1);return W.useMemo(()=>({getState:t.getState,setState:t.setState,subscribe:t.subscribe}),[t])}const H0={display:"none"},wA={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},k1="react-flow__node-desc",H1="react-flow__edge-desc",xA="react-flow__aria-live",EA=t=>t.ariaLiveMessage,_A=t=>t.ariaLabelConfig;function NA({rfId:t}){const i=ze(EA);return z.jsx("div",{id:`${xA}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:wA,children:i})}function AA({rfId:t,disableKeyboardA11y:i}){const s=ze(_A);return z.jsxs(z.Fragment,{children:[z.jsx("div",{id:`${k1}-${t}`,style:H0,children:i?s["node.a11yDescription.default"]:s["node.a11yDescription.keyboardDisabled"]}),z.jsx("div",{id:`${H1}-${t}`,style:H0,children:s["edge.a11yDescription.default"]}),!i&&z.jsx(NA,{rfId:t})]})}const Ic=W.forwardRef(({position:t="top-left",children:i,className:s,style:a,...r},c)=>{const u=`${t}`.split("-");return z.jsx("div",{className:ct(["react-flow__panel",s,...u]),style:a,ref:c,...r,children:i})});Ic.displayName="Panel";function TA({proOptions:t,position:i="bottom-right"}){return t?.hideAttribution?null:z.jsx(Ic,{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:z.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const MA=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}},oc=t=>t.id;function CA(t,i){return Qe(t.selectedNodes.map(oc),i.selectedNodes.map(oc))&&Qe(t.selectedEdges.map(oc),i.selectedEdges.map(oc))}function OA({onSelectionChange:t}){const i=Je(),{selectedNodes:s,selectedEdges:a}=ze(MA,CA);return W.useEffect(()=>{const r={nodes:s,edges:a};t?.(r),i.getState().onSelectionChangeHandlers.forEach(c=>c(r))},[s,a,t]),null}const zA=t=>!!t.onSelectionChangeHandlers;function DA({onSelectionChange:t}){const i=ze(zA);return t||i?z.jsx(OA,{onSelectionChange:t}):null}const $1=[0,0],LA={x:0,y:0,zoom:1},RA=["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"],$0=[...RA,"rfId"],BA=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}),U0={translateExtent:ho,nodeOrigin:$1,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function jA(t){const{setNodes:i,setEdges:s,setMinZoom:a,setMaxZoom:r,setTranslateExtent:c,setNodeExtent:u,reset:m,setDefaultNodesAndEdges:h}=ze(BA,Qe),g=Je();W.useEffect(()=>(h(t.defaultNodes,t.defaultEdges),()=>{v.current=U0,m()}),[]);const v=W.useRef(U0);return W.useEffect(()=>{for(const p of $0){const y=t[p],S=v.current[p];y!==S&&(typeof t[p]>"u"||(p==="nodes"?i(y):p==="edges"?s(y):p==="minZoom"?a(y):p==="maxZoom"?r(y):p==="translateExtent"?c(y):p==="nodeExtent"?u(y):p==="ariaLabelConfig"?g.setState({ariaLabelConfig:bN(y)}):p==="fitView"?g.setState({fitViewQueued:y}):p==="fitViewOptions"?g.setState({fitViewOptions:y}):g.setState({[p]:y})))}v.current=t},$0.map(p=>t[p])),null}function q0(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function kA(t){const[i,s]=W.useState(t==="system"?null:t);return W.useEffect(()=>{if(t!=="system"){s(t);return}const a=q0(),r=()=>s(a?.matches?"dark":"light");return r(),a?.addEventListener("change",r),()=>{a?.removeEventListener("change",r)}},[t]),i!==null?i:q0()?.matches?"dark":"light"}const V0=typeof document<"u"?document:null;function vo(t=null,i={target:V0,actInsideInputWithModifier:!0}){const[s,a]=W.useState(!1),r=W.useRef(!1),c=W.useRef(new Set([])),[u,m]=W.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 W.useEffect(()=>{const h=i?.target??V0,g=i?.actInsideInputWithModifier??!0;if(t!==null){const v=S=>{if(r.current=S.ctrlKey||S.metaKey||S.shiftKey||S.altKey,(!r.current||r.current&&!g)&&v1(S))return!1;const _=G0(S.code,m);if(c.current.add(S[_]),Y0(u,c.current,!1)){const N=S.composedPath?.()?.[0]||S.target,w=N?.nodeName==="BUTTON"||N?.nodeName==="A";i.preventDefault!==!1&&(r.current||!w)&&S.preventDefault(),a(!0)}},p=S=>{const E=G0(S.code,m);Y0(u,c.current,!0)?(a(!1),c.current.clear()):c.current.delete(S[E]),S.key==="Meta"&&c.current.clear(),r.current=!1},y=()=>{c.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 Y0(t,i,s){return t.filter(a=>s||a.length===i.size).some(a=>a.every(r=>i.has(r)))}function G0(t,i){return i.includes(t)?"code":"key"}const HA=()=>{const t=Je();return W.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,c],panZoom:u}=t.getState();return u?(await u.setViewport({x:i.x??a,y:i.y??r,zoom:i.zoom??c},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:c,maxZoom:u,panZoom:m}=t.getState(),h=Uh(i,a,r,c,u,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:c,domNode:u}=t.getState();if(!u)return i;const{x:m,y:h}=u.getBoundingClientRect(),g={x:i.x-m,y:i.y-h},v=s.snapGrid??r,p=s.snapToGrid??c;return Kl(g,a,p,v)},flowToScreenPosition:i=>{const{transform:s,domNode:a}=t.getState();if(!a)return i;const{x:r,y:c}=a.getBoundingClientRect(),u=Vl(i,s);return{x:u.x+r,y:u.y+c}}}),[])};function U1(t,i){const s=[],a=new Map,r=[];for(const c of t)if(c.type==="add"){r.push(c);continue}else if(c.type==="remove"||c.type==="replace")a.set(c.id,[c]);else{const u=a.get(c.id);u?u.push(c):a.set(c.id,[c])}for(const c of i){const u=a.get(c.id);if(!u){s.push(c);continue}if(u[0].type==="remove")continue;if(u[0].type==="replace"){s.push({...u[0].item});continue}const m={...c};for(const h of u)$A(h,m);s.push(m)}return r.length&&r.forEach(c=>{c.index!==void 0?s.splice(c.index,0,{...c.item}):s.push({...c.item})}),s}function $A(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 UA(t,i){return U1(t,i)}function qA(t,i){return U1(t,i)}function gs(t,i){return{id:t,type:"select",selected:i}}function Al(t,i=new Set,s=!1){const a=[];for(const[r,c]of t){const u=i.has(r);!(c.selected===void 0&&!u)&&c.selected!==u&&(s&&(c.selected=u),a.push(gs(c.id,u)))}return a}function X0({items:t=[],lookup:i}){const s=[],a=new Map(t.map(r=>[r.id,r]));for(const[r,c]of t.entries()){const u=i.get(c.id),m=u?.internals?.userNode??u;m!==void 0&&m!==c&&s.push({id:c.id,item:c,type:"replace"}),m===void 0&&s.push({item:c,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=m1();function YA(t,i,s={}){return NN(t,i,{...s,onError:s.onError??VA})}const Z0=t=>uN(t),GA=t=>u1(t);function q1(t){return W.forwardRef(t)}const XA=typeof window<"u"?W.useLayoutEffect:W.useEffect;function Q0(t){const[i,s]=W.useState(BigInt(0)),[a]=W.useState(()=>KA(()=>s(r=>r+BigInt(1))));return XA(()=>{const r=a.get();r.length&&(t(r),a.reset())},[i]),a}function KA(t){let i=[];return{get:()=>i,reset:()=>{i=[]},push:s=>{i.push(s),t()}}}const V1=W.createContext(null);function ZA({children:t}){const i=Je(),s=W.useCallback(m=>{const{nodes:h=[],setNodes:g,hasDefaultNodes:v,onNodesChange:p,nodeLookup:y,fitViewQueued:S,onNodesChangeMiddlewareMap:E}=i.getState();let _=h;for(const w of m)_=typeof w=="function"?w(_):w;let N=X0({items:_,lookup:y});for(const w of E.values())N=w(N);v&&g(_),N.length>0?p?.(N):S&&window.requestAnimationFrame(()=>{const{fitViewQueued:w,nodes:D,setNodes:x}=i.getState();w&&x(D)})},[]),a=Q0(s),r=W.useCallback(m=>{const{edges:h=[],setEdges:g,hasDefaultEdges:v,onEdgesChange:p,edgeLookup:y}=i.getState();let S=h;for(const E of m)S=typeof E=="function"?E(S):E;v?g(S):p&&p(X0({items:S,lookup:y}))},[]),c=Q0(r),u=W.useMemo(()=>({nodeQueue:a,edgeQueue:c}),[]);return z.jsx(V1.Provider,{value:u,children:t})}function QA(){const t=W.useContext(V1);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const IA=t=>!!t.panZoom;function Jc(){const t=HA(),i=Je(),s=QA(),a=ze(IA),r=W.useMemo(()=>{const c=p=>i.getState().nodeLookup.get(p),u=p=>{s.nodeQueue.push(p)},m=p=>{s.edgeQueue.push(p)},h=p=>{const{nodeLookup:y,nodeOrigin:S}=i.getState(),E=Z0(p)?p:y.get(p.id),_=E.parentId?p1(E.position,E.measured,E.parentId,y,S):E.position,N={...E,position:_,width:E.measured?.width??E.width,height:E.measured?.height??E.height};return ql(N)},g=(p,y,S={replace:!1})=>{u(E=>E.map(_=>{if(_.id===p){const N=typeof y=="function"?y(_):y;return S.replace&&Z0(N)?N:{..._,...N}}return _}))},v=(p,y,S={replace:!1})=>{m(E=>E.map(_=>{if(_.id===p){const N=typeof y=="function"?y(_):y;return S.replace&&GA(N)?N:{..._,...N}}return _}))};return{getNodes:()=>i.getState().nodes.map(p=>({...p})),getNode:p=>c(p)?.internals.userNode,getInternalNode:c,getEdges:()=>{const{edges:p=[]}=i.getState();return p.map(y=>({...y}))},getEdge:p=>i.getState().edgeLookup.get(p),setNodes:u,setEdges:m,addNodes:p=>{const y=Array.isArray(p)?p:[p];s.nodeQueue.push(S=>[...S,...y])},addEdges:p=>{const y=Array.isArray(p)?p:[p];s.edgeQueue.push(S=>[...S,...y])},toObject:()=>{const{nodes:p=[],edges:y=[],transform:S}=i.getState(),[E,_,N]=S;return{nodes:p.map(w=>({...w})),edges:y.map(w=>({...w})),viewport:{x:E,y:_,zoom:N}}},deleteElements:async({nodes:p=[],edges:y=[]})=>{const{nodes:S,edges:E,onNodesDelete:_,onEdgesDelete:N,triggerNodeChanges:w,triggerEdgeChanges:D,onDelete:x,onBeforeDelete:T}=i.getState(),{nodes:L,edges:O}=await gN({nodesToRemove:p,edgesToRemove:y,nodes:S,edges:E,onBeforeDelete:T}),j=O.length>0,R=L.length>0;if(j){const V=O.map(K0);N?.(O),D(V)}if(R){const V=L.map(K0);_?.(L),w(V)}return(R||j)&&x?.({nodes:L,edges:O}),{deletedNodes:L,deletedEdges:O}},getIntersectingNodes:(p,y=!0,S)=>{const E=b0(p),_=E?p:h(p),N=S!==void 0;return _?(S||i.getState().nodes).filter(w=>{const D=i.getState().nodeLookup.get(w.id);if(D&&!E&&(w.id===p.id||!D.internals.positionAbsolute))return!1;const x=ql(N?w:D),T=po(x,_);return y&&T>0||T>=x.width*x.height||T>=_.width*_.height}):[]},isNodeIntersecting:(p,y,S=!0)=>{const _=b0(p)?p:h(p);if(!_)return!1;const N=po(_,y);return S&&N>0||N>=y.width*y.height||N>=_.width*_.height},updateNode:g,updateNodeData:(p,y,S={replace:!1})=>{g(p,E=>{const _=typeof y=="function"?y(E):y;return S.replace?{...E,data:_}:{...E,data:{...E.data,..._}}},S)},updateEdge:v,updateEdgeData:(p,y,S={replace:!1})=>{v(p,E=>{const _=typeof y=="function"?y(E):y;return S.replace?{...E,data:_}:{...E,data:{...E.data,..._}}},S)},getNodesBounds:p=>{const{nodeLookup:y,nodeOrigin:S}=i.getState();return fN(p,{nodeLookup:y,nodeOrigin:S})},getHandleConnections:({type:p,id:y,nodeId:S})=>Array.from(i.getState().connectionLookup.get(`${S}-${p}${y?`-${y}`:""}`)?.values()??[]),getNodeConnections:({type:p,handleId:y,nodeId:S})=>Array.from(i.getState().connectionLookup.get(`${S}${p?y?`-${p}-${y}`:`-${p}`:""}`)?.values()??[]),fitView:async p=>{const y=i.getState().fitViewResolver??vN();return i.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:y}),s.nodeQueue.push(S=>[...S]),y.promise}}},[]);return W.useMemo(()=>({...r,...t,viewportInitialized:a}),[a])}const I0=t=>t.selected,JA=typeof window<"u"?window:void 0;function FA({deleteKeyCode:t,multiSelectionKeyCode:i}){const s=Je(),{deleteElements:a}=Jc(),r=vo(t,{actInsideInputWithModifier:!1}),c=vo(i,{target:JA});W.useEffect(()=>{if(r){const{edges:u,nodes:m}=s.getState();a({nodes:m.filter(I0),edges:u.filter(I0)}),s.setState({nodesSelectionActive:!1})}},[r]),W.useEffect(()=>{s.setState({multiSelectionActive:c})},[c])}function WA(t){const i=Je();W.useEffect(()=>{const s=()=>{if(!t.current||!(t.current.checkVisibility?.()??!0))return!1;const a=qh(t.current);(a.height===0||a.width===0)&&i.getState().onError?.("004",wn.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 Fc={position:"absolute",width:"100%",height:"100%",top:0,left:0},PA=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function eT({onPaneContextMenu:t,zoomOnScroll:i=!0,zoomOnPinch:s=!0,panOnScroll:a=!1,panOnScrollSpeed:r=.5,panOnScrollMode:c=xs.Free,zoomOnDoubleClick:u=!0,panOnDrag:m=!0,defaultViewport:h,translateExtent:g,minZoom:v,maxZoom:p,zoomActivationKeyCode:y,preventScrolling:S=!0,children:E,noWheelClassName:_,noPanClassName:N,onViewportChange:w,isControlledViewport:D,paneClickDistance:x,selectionOnDrag:T}){const L=Je(),O=W.useRef(null),{userSelectionActive:j,lib:R,connectionInProgress:V}=ze(PA,Qe),le=vo(y),K=W.useRef();WA(O);const Z=W.useCallback(oe=>{w?.({x:oe[0],y:oe[1],zoom:oe[2]}),D||L.setState({transform:oe})},[w,D]);return W.useEffect(()=>{if(O.current){K.current=tA({domNode:O.current,minZoom:v,maxZoom:p,translateExtent:g,viewport:h,onDraggingChange:C=>L.setState(H=>H.paneDragging===C?H:{paneDragging:C}),onPanZoomStart:(C,H)=>{const{onViewportChangeStart:G,onMoveStart:U}=L.getState();U?.(C,H),G?.(H)},onPanZoom:(C,H)=>{const{onViewportChange:G,onMove:U}=L.getState();U?.(C,H),G?.(H)},onPanZoomEnd:(C,H)=>{const{onViewportChangeEnd:G,onMoveEnd:U}=L.getState();U?.(C,H),G?.(H)}});const{x:oe,y:B,zoom:X}=K.current.getViewport();return L.setState({panZoom:K.current,transform:[oe,B,X],domNode:O.current.closest(".react-flow")}),()=>{K.current?.destroy()}}},[]),W.useEffect(()=>{K.current?.update({onPaneContextMenu:t,zoomOnScroll:i,zoomOnPinch:s,panOnScroll:a,panOnScrollSpeed:r,panOnScrollMode:c,zoomOnDoubleClick:u,panOnDrag:m,zoomActivationKeyPressed:le,preventScrolling:S,noPanClassName:N,userSelectionActive:j,noWheelClassName:_,lib:R,onTransformChange:Z,connectionInProgress:V,selectionOnDrag:T,paneClickDistance:x})},[t,i,s,a,r,c,u,m,le,S,N,j,_,R,Z,V,T,x]),z.jsx("div",{className:"react-flow__renderer",ref:O,style:Fc,children:E})}const tT=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function nT(){const{userSelectionActive:t,userSelectionRect:i}=ze(tT,Qe);return t&&i?z.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 Zd=(t,i)=>s=>{s.target===i.current&&t?.(s)},iT=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging,panBy:t.panBy,autoPanSpeed:t.autoPanSpeed});function sT({isSelecting:t,selectionKeyPressed:i,selectionMode:s=mo.Full,panOnDrag:a,autoPanOnSelection:r,paneClickDistance:c,selectionOnDrag:u,onSelectionStart:m,onSelectionEnd:h,onPaneClick:g,onPaneContextMenu:v,onPaneScroll:p,onPaneMouseEnter:y,onPaneMouseMove:S,onPaneMouseLeave:E,children:_}){const N=W.useRef(0),w=Je(),{userSelectionActive:D,elementsSelectable:x,dragging:T,connectionInProgress:L,panBy:O,autoPanSpeed:j}=ze(iT,Qe),R=x&&(t||D),V=W.useRef(null),le=W.useRef(),K=W.useRef(new Set),Z=W.useRef(new Set),oe=W.useRef(!1),B=W.useRef({x:0,y:0}),X=W.useRef(!1),C=te=>{if(oe.current||L){oe.current=!1;return}g?.(te),w.getState().resetSelectedElements(),w.setState({nodesSelectionActive:!1})},H=te=>{if(Array.isArray(a)&&a?.includes(2)){te.preventDefault();return}v?.(te)},G=p?te=>p(te):void 0,U=te=>{oe.current&&(te.stopPropagation(),oe.current=!1)},J=te=>{const{domNode:ue,transform:Se}=w.getState();if(le.current=ue?.getBoundingClientRect(),!le.current)return;const be=te.target===V.current;if(!be&&!!te.target.closest(".nokey")||!t||!(u&&be||i)||te.button!==0||!te.isPrimary)return;te.target?.setPointerCapture?.(te.pointerId),oe.current=!1;const{x:Ee,y:De}=Sn(te.nativeEvent,le.current),Ge=Kl({x:Ee,y:De},Se);w.setState({userSelectionRect:{width:0,height:0,startX:Ge.x,startY:Ge.y,x:Ee,y:De}}),be||(te.stopPropagation(),te.preventDefault())};function M(te,ue){const{userSelectionRect:Se}=w.getState();if(!Se)return;const{transform:be,nodeLookup:ge,edgeLookup:ye,connectionLookup:Ee,triggerNodeChanges:De,triggerEdgeChanges:Ge,defaultEdgeOptions:yt}=w.getState(),It={x:Se.startX,y:Se.startY},{x:Nt,y:At}=Vl(It,be),kt={startX:It.x,startY:It.y,x:te<Nt?te:Nt,y:ue<At?ue:At,width:Math.abs(te-Nt),height:Math.abs(ue-At)},Qi=K.current,Bn=Z.current;K.current=new Set(Hh(ge,kt,be,s===mo.Partial,!0).map(Ht=>Ht.id)),Z.current=new Set;const tt=yt?.selectable??!0;for(const Ht of K.current){const Jt=Ee.get(Ht);if(Jt)for(const{edgeId:Ft}of Jt.values()){const Wt=ye.get(Ft);Wt&&(Wt.selectable??tt)&&Z.current.add(Ft)}}if(!S0(Qi,K.current)){const Ht=Al(ge,K.current,!0);De(Ht)}if(!S0(Bn,Z.current)){const Ht=Al(ye,Z.current);Ge(Ht)}w.setState({userSelectionRect:kt,userSelectionActive:!0,nodesSelectionActive:!1})}function $(){if(!r||!le.current)return;const[te,ue]=$h(B.current,le.current,j);O({x:te,y:ue}).then(Se=>{if(!oe.current||!Se){N.current=requestAnimationFrame($);return}const{x:be,y:ge}=B.current;M(be,ge),N.current=requestAnimationFrame($)})}const ee=()=>{cancelAnimationFrame(N.current),N.current=0,X.current=!1};W.useEffect(()=>()=>ee(),[]);const ie=te=>{const{userSelectionRect:ue,transform:Se,resetSelectedElements:be}=w.getState();if(!le.current||!ue)return;const{x:ge,y:ye}=Sn(te.nativeEvent,le.current);B.current={x:ge,y:ye};const Ee=Vl({x:ue.startX,y:ue.startY},Se);if(!oe.current){const De=i?0:c;if(Math.hypot(ge-Ee.x,ye-Ee.y)<=De)return;be(),m?.(te)}oe.current=!0,X.current||($(),X.current=!0),M(ge,ye)},re=te=>{te.button===0&&(te.target?.releasePointerCapture?.(te.pointerId),!D&&te.target===V.current&&w.getState().userSelectionRect&&C?.(te),w.setState({userSelectionActive:!1,userSelectionRect:null}),oe.current&&(h?.(te),w.setState({nodesSelectionActive:K.current.size>0})),ee())},de=te=>{te.target?.releasePointerCapture?.(te.pointerId),ee()},ce=a===!0||Array.isArray(a)&&a.includes(0);return z.jsxs("div",{className:ct(["react-flow__pane",{draggable:ce,dragging:T,selection:t}]),onClick:R?void 0:Zd(C,V),onContextMenu:Zd(H,V),onWheel:Zd(G,V),onPointerEnter:R?void 0:y,onPointerMove:R?ie:S,onPointerUp:R?re:void 0,onPointerCancel:R?de:void 0,onPointerDownCapture:R?J:void 0,onClickCapture:R?U:void 0,onPointerLeave:E,ref:V,style:Fc,children:[_,z.jsx(nT,{})]})}function bh({id:t,store:i,unselect:s=!1,nodeRef:a}){const{addSelectedNodes:r,unselectNodesAndEdges:c,multiSelectionActive:u,nodeLookup:m,onError:h}=i.getState(),g=m.get(t);if(!g){h?.("012",wn.error012(t));return}i.setState({nodesSelectionActive:!1}),g.selected?(s||g.selected&&u)&&(c({nodes:[g],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):r([t])}function Y1({nodeRef:t,disabled:i=!1,noDragClassName:s,handleSelector:a,nodeId:r,isSelectable:c,nodeClickDistance:u}){const m=Je(),[h,g]=W.useState(!1),v=W.useRef();return W.useEffect(()=>{v.current=qN({getStoreItems:()=>m.getState(),onNodeMouseDown:p=>{bh({id:p,store:m,nodeRef:t})},onDragStart:()=>{g(!0)},onDragStop:()=>{g(!1)}})},[]),W.useEffect(()=>{if(!(i||!t.current||!v.current))return v.current.update({noDragClassName:s,handleSelector:a,domNode:t.current,isSelectable:c,nodeId:r,nodeClickDistance:u}),()=>{v.current?.destroy()}},[s,a,i,c,t,r,u]),h}const lT=t=>i=>i.selected&&(i.draggable||t&&typeof i.draggable>"u");function G1(){const t=Je();return W.useCallback(s=>{const{nodeExtent:a,snapToGrid:r,snapGrid:c,nodesDraggable:u,onError:m,updateNodePositions:h,nodeLookup:g,nodeOrigin:v}=t.getState(),p=new Map,y=lT(u),S=r?c[0]:5,E=r?c[1]:5,_=s.direction.x*S*s.factor,N=s.direction.y*E*s.factor;for(const[,w]of g){if(!y(w))continue;let D={x:w.internals.positionAbsolute.x+_,y:w.internals.positionAbsolute.y+N};r&&(D=To(D,c));const{position:x,positionAbsolute:T}=f1({nodeId:w.id,nextPosition:D,nodeLookup:g,nodeExtent:a,nodeOrigin:v,onError:m});w.position=x,w.internals.positionAbsolute=T,p.set(w.id,w)}h(p)},[])}const Zh=W.createContext(null),aT=Zh.Provider;Zh.Consumer;const X1=()=>W.useContext(Zh),oT=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),rT=(t,i,s)=>a=>{const{connectionClickStartHandle:r,connectionMode:c,connection:u}=a,{fromHandle:m,toHandle:h,isValid:g}=u,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:c===$l.Strict?m?.type!==s:t!==m?.nodeId||i!==m?.id,connectionInProcess:!!m,clickConnectionInProcess:!!r,valid:v&&g}};function cT({type:t="source",position:i=fe.Top,isValidConnection:s,isConnectable:a=!0,isConnectableStart:r=!0,isConnectableEnd:c=!0,id:u,onConnect:m,children:h,className:g,onMouseDown:v,onTouchStart:p,...y},S){const E=u||null,_=t==="target",N=Je(),w=X1(),{connectOnClick:D,noPanClassName:x,rfId:T}=ze(oT,Qe),{connectingFrom:L,connectingTo:O,clickConnecting:j,isPossibleEndHandle:R,connectionInProcess:V,clickConnectionInProcess:le,valid:K}=ze(rT(w,E,t),Qe);w||N.getState().onError?.("010",wn.error010());const Z=X=>{const{defaultEdgeOptions:C,onConnect:H,hasDefaultEdges:G}=N.getState(),U={...C,...X};if(G){const{edges:J,setEdges:M,onError:$}=N.getState();M(YA(U,J,{onError:$}))}H?.(U),m?.(U)},oe=X=>{if(!w)return;const C=b1(X.nativeEvent);if(r&&(C&&X.button===0||!C)){const H=N.getState();vh.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:H.autoPanOnConnect,connectionMode:H.connectionMode,connectionRadius:H.connectionRadius,domNode:H.domNode,nodeLookup:H.nodeLookup,lib:H.lib,isTarget:_,handleId:E,nodeId:w,flowId:H.rfId,panBy:H.panBy,cancelConnection:H.cancelConnection,onConnectStart:H.onConnectStart,onConnectEnd:(...G)=>N.getState().onConnectEnd?.(...G),updateConnection:H.updateConnection,onConnect:Z,isValidConnection:s||((...G)=>N.getState().isValidConnection?.(...G)??!0),getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:H.autoPanSpeed,dragThreshold:H.connectionDragThreshold})}C?v?.(X):p?.(X)},B=X=>{const{onClickConnectStart:C,onClickConnectEnd:H,connectionClickStartHandle:G,connectionMode:U,isValidConnection:J,lib:M,rfId:$,nodeLookup:ee,connection:ie}=N.getState();if(!w||!G&&!r)return;if(!G){C?.(X.nativeEvent,{nodeId:w,handleId:E,handleType:t}),N.setState({connectionClickStartHandle:{nodeId:w,type:t,id:E}});return}const re=y1(X.target),de=s||J,{connection:ce,isValid:te}=vh.isValid(X.nativeEvent,{handle:{nodeId:w,id:E,type:t},connectionMode:U,fromNodeId:G.nodeId,fromHandleId:G.id||null,fromType:G.type,isValidConnection:de,flowId:$,doc:re,lib:M,nodeLookup:ee});te&&ce&&Z(ce);const ue=structuredClone(ie);delete ue.inProgress,ue.toPosition=ue.toHandle?ue.toHandle.position:null,H?.(X,ue),N.setState({connectionClickStartHandle:null})};return z.jsx("div",{"data-handleid":E,"data-nodeid":w,"data-handlepos":i,"data-id":`${T}-${w}-${E}-${t}`,className:ct(["react-flow__handle",`react-flow__handle-${i}`,"nodrag",x,g,{source:!_,target:_,connectable:a,connectablestart:r,connectableend:c,clickconnecting:j,connectingfrom:L,connectingto:O,valid:K,connectionindicator:a&&(!V||R)&&(V||le?c:r)}]),onMouseDown:oe,onTouchStart:oe,onClick:D?B:void 0,ref:S,...y,children:h})}const rn=W.memo(q1(cT));function uT({data:t,isConnectable:i,sourcePosition:s=fe.Bottom}){return z.jsxs(z.Fragment,{children:[t?.label,z.jsx(rn,{type:"source",position:s,isConnectable:i})]})}function fT({data:t,isConnectable:i,targetPosition:s=fe.Top,sourcePosition:a=fe.Bottom}){return z.jsxs(z.Fragment,{children:[z.jsx(rn,{type:"target",position:s,isConnectable:i}),t?.label,z.jsx(rn,{type:"source",position:a,isConnectable:i})]})}function dT(){return null}function hT({data:t,isConnectable:i,targetPosition:s=fe.Top}){return z.jsxs(z.Fragment,{children:[z.jsx(rn,{type:"target",position:s,isConnectable:i}),t?.label]})}const Lc={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},J0={input:uT,default:fT,output:hT,group:dT};function mT(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 gT=t=>{const{width:i,height:s,x:a,y:r}=Ao(t.nodeLookup,{filter:c=>!!c.selected});return{width:bn(i)?i:null,height:bn(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 pT({onSelectionContextMenu:t,noPanClassName:i,disableKeyboardA11y:s}){const a=Je(),{width:r,height:c,transformString:u,userSelectionActive:m}=ze(gT,Qe),h=G1(),g=W.useRef(null);W.useEffect(()=>{s||g.current?.focus({preventScroll:!0})},[s]);const v=!m&&r!==null&&c!==null;if(Y1({nodeRef:g,disabled:!v}),!v)return null;const p=t?S=>{const E=a.getState().nodes.filter(_=>_.selected);t(S,E)}:void 0,y=S=>{Object.prototype.hasOwnProperty.call(Lc,S.key)&&(S.preventDefault(),h({direction:Lc[S.key],factor:S.shiftKey?4:1}))};return z.jsx("div",{className:ct(["react-flow__nodesselection","react-flow__container",i]),style:{transform:u},children:z.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:c}})})}const F0=typeof window<"u"?window:void 0,yT=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function K1({children:t,onPaneClick:i,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:r,onPaneContextMenu:c,onPaneScroll:u,paneClickDistance:m,deleteKeyCode:h,selectionKeyCode:g,selectionOnDrag:v,selectionMode:p,onSelectionStart:y,onSelectionEnd:S,multiSelectionKeyCode:E,panActivationKeyCode:_,zoomActivationKeyCode:N,elementsSelectable:w,zoomOnScroll:D,zoomOnPinch:x,panOnScroll:T,panOnScrollSpeed:L,panOnScrollMode:O,zoomOnDoubleClick:j,panOnDrag:R,autoPanOnSelection:V,defaultViewport:le,translateExtent:K,minZoom:Z,maxZoom:oe,preventScrolling:B,onSelectionContextMenu:X,noWheelClassName:C,noPanClassName:H,disableKeyboardA11y:G,onViewportChange:U,isControlledViewport:J}){const{nodesSelectionActive:M,userSelectionActive:$}=ze(yT,Qe),ee=vo(g,{target:F0}),ie=vo(_,{target:F0}),re=ie||R,de=ie||T,ce=v&&re!==!0,te=ee||$||ce;return FA({deleteKeyCode:h,multiSelectionKeyCode:E}),z.jsx(eT,{onPaneContextMenu:c,elementsSelectable:w,zoomOnScroll:D,zoomOnPinch:x,panOnScroll:de,panOnScrollSpeed:L,panOnScrollMode:O,zoomOnDoubleClick:j,panOnDrag:!ee&&re,defaultViewport:le,translateExtent:K,minZoom:Z,maxZoom:oe,zoomActivationKeyCode:N,preventScrolling:B,noWheelClassName:C,noPanClassName:H,onViewportChange:U,isControlledViewport:J,paneClickDistance:m,selectionOnDrag:ce,children:z.jsxs(sT,{onSelectionStart:y,onSelectionEnd:S,onPaneClick:i,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:r,onPaneContextMenu:c,onPaneScroll:u,panOnDrag:re,autoPanOnSelection:V,isSelecting:!!te,selectionMode:p,selectionKeyPressed:ee,paneClickDistance:m,selectionOnDrag:ce,children:[t,M&&z.jsx(pT,{onSelectionContextMenu:X,noPanClassName:H,disableKeyboardA11y:G})]})})}K1.displayName="FlowRenderer";const vT=W.memo(K1),bT=t=>i=>t?Hh(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 ST(t){return ze(W.useCallback(bT(t),[t]),Qe)}const wT=t=>t.updateNodeInternals;function xT(){const t=ze(wT),[i]=W.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const a=new Map;s.forEach(r=>{const c=r.target.getAttribute("data-id");a.set(c,{id:c,nodeElement:r.target,force:!0})}),t(a)}));return W.useEffect(()=>()=>{i?.disconnect()},[i]),i}function ET({node:t,nodeType:i,hasDimensions:s,resizeObserver:a}){const r=Je(),c=W.useRef(null),u=W.useRef(null),m=W.useRef(t.sourcePosition),h=W.useRef(t.targetPosition),g=W.useRef(i),v=s&&!!t.internals.handleBounds;return W.useEffect(()=>{c.current&&!t.hidden&&(!v||u.current!==c.current)&&(u.current&&a?.unobserve(u.current),a?.observe(c.current),u.current=c.current)},[v,t.hidden]),W.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),W.useEffect(()=>{if(c.current){const p=g.current!==i,y=m.current!==t.sourcePosition,S=h.current!==t.targetPosition;(p||y||S)&&(g.current=i,m.current=t.sourcePosition,h.current=t.targetPosition,r.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:c.current,force:!0}]])))}},[t.id,i,t.sourcePosition,t.targetPosition]),c}function _T({id:t,onClick:i,onMouseEnter:s,onMouseMove:a,onMouseLeave:r,onContextMenu:c,onDoubleClick:u,nodesDraggable:m,elementsSelectable:h,nodesConnectable:g,nodesFocusable:v,resizeObserver:p,noDragClassName:y,noPanClassName:S,disableKeyboardA11y:E,rfId:_,nodeTypes:N,nodeClickDistance:w,onError:D}){const{node:x,internals:T,isParent:L}=ze(te=>{const ue=te.nodeLookup.get(t),Se=te.parentLookup.has(t);return{node:ue,internals:ue.internals,isParent:Se}},Qe);let O=x.type||"default",j=N?.[O]||J0[O];j===void 0&&(D?.("003",wn.error003(O)),O="default",j=N?.default||J0.default);const R=!!(x.draggable||m&&typeof x.draggable>"u"),V=!!(x.selectable||h&&typeof x.selectable>"u"),le=!!(x.connectable||g&&typeof x.connectable>"u"),K=!!(x.focusable||v&&typeof x.focusable>"u"),Z=Je(),oe=g1(x),B=ET({node:x,nodeType:O,hasDimensions:oe,resizeObserver:p}),X=Y1({nodeRef:B,disabled:x.hidden||!R,noDragClassName:y,handleSelector:x.dragHandle,nodeId:t,isSelectable:V,nodeClickDistance:w}),C=G1();if(x.hidden)return null;const H=ri(x),G=mT(x),U=V||R||i||s||a||r,J=s?te=>s(te,{...T.userNode}):void 0,M=a?te=>a(te,{...T.userNode}):void 0,$=r?te=>r(te,{...T.userNode}):void 0,ee=c?te=>c(te,{...T.userNode}):void 0,ie=u?te=>u(te,{...T.userNode}):void 0,re=te=>{const{selectNodesOnDrag:ue,nodeDragThreshold:Se}=Z.getState();V&&(!ue||!R||Se>0)&&bh({id:t,store:Z,nodeRef:B}),i&&i(te,{...T.userNode})},de=te=>{if(!(v1(te.nativeEvent)||E)){if(a1.includes(te.key)&&V){const ue=te.key==="Escape";bh({id:t,store:Z,unselect:ue,nodeRef:B})}else if(R&&x.selected&&Object.prototype.hasOwnProperty.call(Lc,te.key)){te.preventDefault();const{ariaLabelConfig:ue}=Z.getState();Z.setState({ariaLiveMessage:ue["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~T.positionAbsolute.x,y:~~T.positionAbsolute.y})}),C({direction:Lc[te.key],factor:te.shiftKey?4:1})}}},ce=()=>{if(E||!B.current?.matches(":focus-visible"))return;const{transform:te,width:ue,height:Se,autoPanOnNodeFocus:be,setCenter:ge}=Z.getState();if(!be)return;Hh(new Map([[t,x]]),{x:0,y:0,width:ue,height:Se},te,!0).length>0||ge(x.position.x+H.width/2,x.position.y+H.height/2,{zoom:te[2]})};return z.jsx("div",{className:ct(["react-flow__node",`react-flow__node-${O}`,{[S]:R},x.className,{selected:x.selected,selectable:V,parent:L,draggable:R,dragging:X}]),ref:B,style:{zIndex:T.z,transform:`translate(${T.positionAbsolute.x}px,${T.positionAbsolute.y}px)`,pointerEvents:U?"all":"none",visibility:oe?"visible":"hidden",...x.style,...G},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:J,onMouseMove:M,onMouseLeave:$,onContextMenu:ee,onClick:re,onDoubleClick:ie,onKeyDown:K?de:void 0,tabIndex:K?0:void 0,onFocus:K?ce:void 0,role:x.ariaRole??(K?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${k1}-${_}`,"aria-label":x.ariaLabel,...x.domAttributes,children:z.jsx(aT,{value:t,children:z.jsx(j,{id:t,data:x.data,type:O,positionAbsoluteX:T.positionAbsolute.x,positionAbsoluteY:T.positionAbsolute.y,selected:x.selected??!1,selectable:V,draggable:R,deletable:x.deletable??!0,isConnectable:le,sourcePosition:x.sourcePosition,targetPosition:x.targetPosition,dragging:X,dragHandle:x.dragHandle,zIndex:T.z,parentId:x.parentId,...H})})})}var NT=W.memo(_T);const AT=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Z1(t){const{nodesDraggable:i,nodesConnectable:s,nodesFocusable:a,elementsSelectable:r,onError:c}=ze(AT,Qe),u=ST(t.onlyRenderVisibleElements),m=xT();return z.jsx("div",{className:"react-flow__nodes",style:Fc,children:u.map(h=>z.jsx(NT,{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:c},h))})}Z1.displayName="NodeRenderer";const TT=W.memo(Z1);function MT(t){return ze(W.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 c=s.nodeLookup.get(r.source),u=s.nodeLookup.get(r.target);c&&u&&xN({sourceNode:c,targetNode:u,width:s.width,height:s.height,transform:s.transform})&&a.push(r.id)}return a},[t]),Qe)}const CT=({color:t="none",strokeWidth:i=1})=>{const s={strokeWidth:i,...t&&{stroke:t}};return z.jsx("polyline",{className:"arrow",style:s,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},OT=({color:t="none",strokeWidth:i=1})=>{const s={strokeWidth:i,...t&&{stroke:t,fill:t}};return z.jsx("polyline",{className:"arrowclosed",style:s,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},W0={[go.Arrow]:CT,[go.ArrowClosed]:OT};function zT(t){const i=Je();return W.useMemo(()=>Object.prototype.hasOwnProperty.call(W0,t)?W0[t]:(i.getState().onError?.("009",wn.error009(t)),null),[t])}const DT=({id:t,type:i,color:s,width:a=12.5,height:r=12.5,markerUnits:c="strokeWidth",strokeWidth:u,orient:m="auto-start-reverse"})=>{const h=zT(i);return h?z.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${a}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:m,refX:"0",refY:"0",children:z.jsx(h,{color:s,strokeWidth:u})}):null},Q1=({defaultColor:t,rfId:i})=>{const s=ze(c=>c.edges),a=ze(c=>c.defaultEdgeOptions),r=W.useMemo(()=>ON(s,{id:i,defaultColor:t,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[s,a,i,t]);return r.length?z.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:z.jsx("defs",{children:r.map(c=>z.jsx(DT,{id:c.id,type:c.type,color:c.color,width:c.width,height:c.height,markerUnits:c.markerUnits,strokeWidth:c.strokeWidth,orient:c.orient},c.id))})}):null};Q1.displayName="MarkerDefinitions";var LT=W.memo(Q1);function I1({x:t,y:i,label:s,labelStyle:a,labelShowBg:r=!0,labelBgStyle:c,labelBgPadding:u=[2,4],labelBgBorderRadius:m=2,children:h,className:g,...v}){const[p,y]=W.useState({x:1,y:0,width:0,height:0}),S=ct(["react-flow__edge-textwrapper",g]),E=W.useRef(null);return W.useEffect(()=>{if(E.current){const _=E.current.getBBox();y({x:_.x,y:_.y,width:_.width,height:_.height})}},[s]),s?z.jsxs("g",{transform:`translate(${t-p.width/2} ${i-p.height/2})`,className:S,visibility:p.width?"visible":"hidden",...v,children:[r&&z.jsx("rect",{width:p.width+2*u[0],x:-u[0],y:-u[1],height:p.height+2*u[1],className:"react-flow__edge-textbg",style:c,rx:m,ry:m}),z.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:E,style:a,children:s}),h]}):null}I1.displayName="EdgeText";const RT=W.memo(I1);function Mo({path:t,labelX:i,labelY:s,label:a,labelStyle:r,labelShowBg:c,labelBgStyle:u,labelBgPadding:m,labelBgBorderRadius:h,interactionWidth:g=20,...v}){return z.jsxs(z.Fragment,{children:[z.jsx("path",{...v,d:t,fill:"none",className:ct(["react-flow__edge-path",v.className])}),g?z.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}):null,a&&bn(i)&&bn(s)?z.jsx(RT,{x:i,y:s,label:a,labelStyle:r,labelShowBg:c,labelBgStyle:u,labelBgPadding:m,labelBgBorderRadius:h}):null]})}function P0({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 J1({sourceX:t,sourceY:i,sourcePosition:s=fe.Bottom,targetX:a,targetY:r,targetPosition:c=fe.Top}){const[u,m]=P0({pos:s,x1:t,y1:i,x2:a,y2:r}),[h,g]=P0({pos:c,x1:a,y1:r,x2:t,y2:i}),[v,p,y,S]=S1({sourceX:t,sourceY:i,targetX:a,targetY:r,sourceControlX:u,sourceControlY:m,targetControlX:h,targetControlY:g});return[`M${t},${i} C${u},${m} ${h},${g} ${a},${r}`,v,p,y,S]}function F1(t){return W.memo(({id:i,sourceX:s,sourceY:a,targetX:r,targetY:c,sourcePosition:u,targetPosition:m,label:h,labelStyle:g,labelShowBg:v,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:S,style:E,markerEnd:_,markerStart:N,interactionWidth:w})=>{const[D,x,T]=J1({sourceX:s,sourceY:a,sourcePosition:u,targetX:r,targetY:c,targetPosition:m}),L=t.isInternal?void 0:i;return z.jsx(Mo,{id:L,path:D,labelX:x,labelY:T,label:h,labelStyle:g,labelShowBg:v,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:S,style:E,markerEnd:_,markerStart:N,interactionWidth:w})})}const BT=F1({isInternal:!1}),W1=F1({isInternal:!0});BT.displayName="SimpleBezierEdge";W1.displayName="SimpleBezierEdgeInternal";function P1(t){return W.memo(({id:i,sourceX:s,sourceY:a,targetX:r,targetY:c,label:u,labelStyle:m,labelShowBg:h,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:p,style:y,sourcePosition:S=fe.Bottom,targetPosition:E=fe.Top,markerEnd:_,markerStart:N,pathOptions:w,interactionWidth:D})=>{const[x,T,L]=gh({sourceX:s,sourceY:a,sourcePosition:S,targetX:r,targetY:c,targetPosition:E,borderRadius:w?.borderRadius,offset:w?.offset,stepPosition:w?.stepPosition}),O=t.isInternal?void 0:i;return z.jsx(Mo,{id:O,path:x,labelX:T,labelY:L,label:u,labelStyle:m,labelShowBg:h,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:p,style:y,markerEnd:_,markerStart:N,interactionWidth:D})})}const eb=P1({isInternal:!1}),tb=P1({isInternal:!0});eb.displayName="SmoothStepEdge";tb.displayName="SmoothStepEdgeInternal";function nb(t){return W.memo(({id:i,...s})=>{const a=t.isInternal?void 0:i;return z.jsx(eb,{...s,id:a,pathOptions:W.useMemo(()=>({borderRadius:0,offset:s.pathOptions?.offset}),[s.pathOptions?.offset])})})}const jT=nb({isInternal:!1}),ib=nb({isInternal:!0});jT.displayName="StepEdge";ib.displayName="StepEdgeInternal";function sb(t){return W.memo(({id:i,sourceX:s,sourceY:a,targetX:r,targetY:c,label:u,labelStyle:m,labelShowBg:h,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:p,style:y,markerEnd:S,markerStart:E,interactionWidth:_})=>{const[N,w,D]=E1({sourceX:s,sourceY:a,targetX:r,targetY:c}),x=t.isInternal?void 0:i;return z.jsx(Mo,{id:x,path:N,labelX:w,labelY:D,label:u,labelStyle:m,labelShowBg:h,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:p,style:y,markerEnd:S,markerStart:E,interactionWidth:_})})}const kT=sb({isInternal:!1}),lb=sb({isInternal:!0});kT.displayName="StraightEdge";lb.displayName="StraightEdgeInternal";function ab(t){return W.memo(({id:i,sourceX:s,sourceY:a,targetX:r,targetY:c,sourcePosition:u=fe.Bottom,targetPosition:m=fe.Top,label:h,labelStyle:g,labelShowBg:v,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:S,style:E,markerEnd:_,markerStart:N,pathOptions:w,interactionWidth:D})=>{const[x,T,L]=w1({sourceX:s,sourceY:a,sourcePosition:u,targetX:r,targetY:c,targetPosition:m,curvature:w?.curvature}),O=t.isInternal?void 0:i;return z.jsx(Mo,{id:O,path:x,labelX:T,labelY:L,label:h,labelStyle:g,labelShowBg:v,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:S,style:E,markerEnd:_,markerStart:N,interactionWidth:D})})}const HT=ab({isInternal:!1}),ob=ab({isInternal:!0});HT.displayName="BezierEdge";ob.displayName="BezierEdgeInternal";const ev={default:ob,straight:lb,step:ib,smoothstep:tb,simplebezier:W1},tv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},$T=(t,i,s)=>s===fe.Left?t-i:s===fe.Right?t+i:t,UT=(t,i,s)=>s===fe.Top?t-i:s===fe.Bottom?t+i:t,nv="react-flow__edgeupdater";function iv({position:t,centerX:i,centerY:s,radius:a=10,onMouseDown:r,onMouseEnter:c,onMouseOut:u,type:m}){return z.jsx("circle",{onMouseDown:r,onMouseEnter:c,onMouseOut:u,className:ct([nv,`${nv}-${m}`]),cx:$T(i,a,t),cy:UT(s,a,t),r:a,stroke:"transparent",fill:"transparent"})}function qT({isReconnectable:t,reconnectRadius:i,edge:s,sourceX:a,sourceY:r,targetX:c,targetY:u,sourcePosition:m,targetPosition:h,onReconnect:g,onReconnectStart:v,onReconnectEnd:p,setReconnecting:y,setUpdateHover:S}){const E=Je(),_=(T,L)=>{if(T.button!==0)return;const{autoPanOnConnect:O,domNode:j,connectionMode:R,connectionRadius:V,lib:le,onConnectStart:K,cancelConnection:Z,nodeLookup:oe,rfId:B,panBy:X,updateConnection:C}=E.getState(),H=L.type==="target",G=(M,$)=>{y(!1),p?.(M,s,L.type,$)},U=M=>g?.(s,M),J=(M,$)=>{y(!0),v?.(T,s,L.type),K?.(M,$)};vh.onPointerDown(T.nativeEvent,{autoPanOnConnect:O,connectionMode:R,connectionRadius:V,domNode:j,handleId:L.id,nodeId:L.nodeId,nodeLookup:oe,isTarget:H,edgeUpdaterType:L.type,lib:le,flowId:B,cancelConnection:Z,panBy:X,isValidConnection:(...M)=>E.getState().isValidConnection?.(...M)??!0,onConnect:U,onConnectStart:J,onConnectEnd:(...M)=>E.getState().onConnectEnd?.(...M),onReconnectEnd:G,updateConnection:C,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:T.currentTarget})},N=T=>_(T,{nodeId:s.target,id:s.targetHandle??null,type:"target"}),w=T=>_(T,{nodeId:s.source,id:s.sourceHandle??null,type:"source"}),D=()=>S(!0),x=()=>S(!1);return z.jsxs(z.Fragment,{children:[(t===!0||t==="source")&&z.jsx(iv,{position:m,centerX:a,centerY:r,radius:i,onMouseDown:N,onMouseEnter:D,onMouseOut:x,type:"source"}),(t===!0||t==="target")&&z.jsx(iv,{position:h,centerX:c,centerY:u,radius:i,onMouseDown:w,onMouseEnter:D,onMouseOut:x,type:"target"})]})}function VT({id:t,edgesFocusable:i,edgesReconnectable:s,elementsSelectable:a,onClick:r,onDoubleClick:c,onContextMenu:u,onMouseEnter:m,onMouseMove:h,onMouseLeave:g,reconnectRadius:v,onReconnect:p,onReconnectStart:y,onReconnectEnd:S,rfId:E,edgeTypes:_,noPanClassName:N,onError:w,disableKeyboardA11y:D}){let x=ze(ge=>ge.edgeLookup.get(t));const T=ze(ge=>ge.defaultEdgeOptions);x=T?{...T,...x}:x;let L=x.type||"default",O=_?.[L]||ev[L];O===void 0&&(w?.("011",wn.error011(L)),L="default",O=_?.default||ev.default);const j=!!(x.focusable||i&&typeof x.focusable>"u"),R=typeof p<"u"&&(x.reconnectable||s&&typeof x.reconnectable>"u"),V=!!(x.selectable||a&&typeof x.selectable>"u"),le=W.useRef(null),[K,Z]=W.useState(!1),[oe,B]=W.useState(!1),X=Je(),{zIndex:C,sourceX:H,sourceY:G,targetX:U,targetY:J,sourcePosition:M,targetPosition:$}=ze(W.useCallback(ge=>{const ye=ge.nodeLookup.get(x.source),Ee=ge.nodeLookup.get(x.target);if(!ye||!Ee)return{zIndex:x.zIndex,...tv};const De=CN({id:t,sourceNode:ye,targetNode:Ee,sourceHandle:x.sourceHandle||null,targetHandle:x.targetHandle||null,connectionMode:ge.connectionMode,onError:w});return{zIndex:wN({selected:x.selected,zIndex:x.zIndex,sourceNode:ye,targetNode:Ee,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...De||tv}},[x.source,x.target,x.sourceHandle,x.targetHandle,x.selected,x.zIndex]),Qe),ee=W.useMemo(()=>x.markerStart?`url('#${ph(x.markerStart,E)}')`:void 0,[x.markerStart,E]),ie=W.useMemo(()=>x.markerEnd?`url('#${ph(x.markerEnd,E)}')`:void 0,[x.markerEnd,E]);if(x.hidden||H===null||G===null||U===null||J===null)return null;const re=ge=>{const{addSelectedEdges:ye,unselectNodesAndEdges:Ee,multiSelectionActive:De}=X.getState();V&&(X.setState({nodesSelectionActive:!1}),x.selected&&De?(Ee({nodes:[],edges:[x]}),le.current?.blur()):ye([t])),r&&r(ge,x)},de=c?ge=>{c(ge,{...x})}:void 0,ce=u?ge=>{u(ge,{...x})}:void 0,te=m?ge=>{m(ge,{...x})}:void 0,ue=h?ge=>{h(ge,{...x})}:void 0,Se=g?ge=>{g(ge,{...x})}:void 0,be=ge=>{if(!D&&a1.includes(ge.key)&&V){const{unselectNodesAndEdges:ye,addSelectedEdges:Ee}=X.getState();ge.key==="Escape"?(le.current?.blur(),ye({edges:[x]})):Ee([t])}};return z.jsx("svg",{style:{zIndex:C},children:z.jsxs("g",{className:ct(["react-flow__edge",`react-flow__edge-${L}`,x.className,N,{selected:x.selected,animated:x.animated,inactive:!V&&!r,updating:K,selectable:V}]),onClick:re,onDoubleClick:de,onContextMenu:ce,onMouseEnter:te,onMouseMove:ue,onMouseLeave:Se,onKeyDown:j?be:void 0,tabIndex:j?0:void 0,role:x.ariaRole??(j?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":x.ariaLabel===null?void 0:x.ariaLabel||`Edge from ${x.source} to ${x.target}`,"aria-describedby":j?`${H1}-${E}`:void 0,ref:le,...x.domAttributes,children:[!oe&&z.jsx(O,{id:t,source:x.source,target:x.target,type:x.type,selected:x.selected,animated:x.animated,selectable:V,deletable:x.deletable??!0,label:x.label,labelStyle:x.labelStyle,labelShowBg:x.labelShowBg,labelBgStyle:x.labelBgStyle,labelBgPadding:x.labelBgPadding,labelBgBorderRadius:x.labelBgBorderRadius,sourceX:H,sourceY:G,targetX:U,targetY:J,sourcePosition:M,targetPosition:$,data:x.data,style:x.style,sourceHandleId:x.sourceHandle,targetHandleId:x.targetHandle,markerStart:ee,markerEnd:ie,pathOptions:"pathOptions"in x?x.pathOptions:void 0,interactionWidth:x.interactionWidth}),R&&z.jsx(qT,{edge:x,isReconnectable:R,reconnectRadius:v,onReconnect:p,onReconnectStart:y,onReconnectEnd:S,sourceX:H,sourceY:G,targetX:U,targetY:J,sourcePosition:M,targetPosition:$,setUpdateHover:Z,setReconnecting:B})]})})}var YT=W.memo(VT);const GT=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function rb({defaultMarkerColor:t,onlyRenderVisibleElements:i,rfId:s,edgeTypes:a,noPanClassName:r,onReconnect:c,onEdgeContextMenu:u,onEdgeMouseEnter:m,onEdgeMouseMove:h,onEdgeMouseLeave:g,onEdgeClick:v,reconnectRadius:p,onEdgeDoubleClick:y,onReconnectStart:S,onReconnectEnd:E,disableKeyboardA11y:_}){const{edgesFocusable:N,edgesReconnectable:w,elementsSelectable:D,onError:x}=ze(GT,Qe),T=MT(i);return z.jsxs("div",{className:"react-flow__edges",children:[z.jsx(LT,{defaultColor:t,rfId:s}),T.map(L=>z.jsx(YT,{id:L,edgesFocusable:N,edgesReconnectable:w,elementsSelectable:D,noPanClassName:r,onReconnect:c,onContextMenu:u,onMouseEnter:m,onMouseMove:h,onMouseLeave:g,onClick:v,reconnectRadius:p,onDoubleClick:y,onReconnectStart:S,onReconnectEnd:E,rfId:s,onError:x,edgeTypes:a,disableKeyboardA11y:_},L))]})}rb.displayName="EdgeRenderer";const XT=W.memo(rb),KT=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function ZT({children:t}){const i=ze(KT);return z.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:i},children:t})}function QT(t){const i=Jc(),s=W.useRef(!1);W.useEffect(()=>{!s.current&&i.viewportInitialized&&t&&(setTimeout(()=>t(i),1),s.current=!0)},[t,i.viewportInitialized])}const IT=t=>t.panZoom?.syncViewport;function JT(t){const i=ze(IT),s=Je();return W.useEffect(()=>{t&&(i?.(t),s.setState({transform:[t.x,t.y,t.zoom]}))},[t,i]),null}function FT(t){return t.connection.inProgress?{...t.connection,to:Kl(t.connection.to,t.transform)}:{...t.connection}}function WT(t){return FT}function PT(t){const i=WT();return ze(i,Qe)}const eM=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function tM({containerStyle:t,style:i,type:s,component:a}){const{nodesConnectable:r,width:c,height:u,isValid:m,inProgress:h}=ze(eM,Qe);return!(c&&r&&h)?null:z.jsx("svg",{style:t,width:c,height:u,className:"react-flow__connectionline react-flow__container",children:z.jsx("g",{className:ct(["react-flow__connection",c1(m)]),children:z.jsx(cb,{style:i,type:s,CustomComponent:a,isValid:m})})})}const cb=({style:t,type:i=Yi.Bezier,CustomComponent:s,isValid:a})=>{const{inProgress:r,from:c,fromNode:u,fromHandle:m,fromPosition:h,to:g,toNode:v,toHandle:p,toPosition:y,pointer:S}=PT();if(!r)return;if(s)return z.jsx(s,{connectionLineType:i,connectionLineStyle:t,fromNode:u,fromHandle:m,fromX:c.x,fromY:c.y,toX:g.x,toY:g.y,fromPosition:h,toPosition:y,connectionStatus:c1(a),toNode:v,toHandle:p,pointer:S});let E="";const _={sourceX:c.x,sourceY:c.y,sourcePosition:h,targetX:g.x,targetY:g.y,targetPosition:y};switch(i){case Yi.Bezier:[E]=w1(_);break;case Yi.SimpleBezier:[E]=J1(_);break;case Yi.Step:[E]=gh({..._,borderRadius:0});break;case Yi.SmoothStep:[E]=gh(_);break;default:[E]=E1(_)}return z.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:t})};cb.displayName="ConnectionLine";const nM={};function sv(t=nM){W.useRef(t),Je(),W.useEffect(()=>{},[t])}function iM(){Je(),W.useRef(!1),W.useEffect(()=>{},[])}function ub({nodeTypes:t,edgeTypes:i,onInit:s,onNodeClick:a,onEdgeClick:r,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:m,onNodeMouseMove:h,onNodeMouseLeave:g,onNodeContextMenu:v,onSelectionContextMenu:p,onSelectionStart:y,onSelectionEnd:S,connectionLineType:E,connectionLineStyle:_,connectionLineComponent:N,connectionLineContainerStyle:w,selectionKeyCode:D,selectionOnDrag:x,selectionMode:T,multiSelectionKeyCode:L,panActivationKeyCode:O,zoomActivationKeyCode:j,deleteKeyCode:R,onlyRenderVisibleElements:V,elementsSelectable:le,defaultViewport:K,translateExtent:Z,minZoom:oe,maxZoom:B,preventScrolling:X,defaultMarkerColor:C,zoomOnScroll:H,zoomOnPinch:G,panOnScroll:U,panOnScrollSpeed:J,panOnScrollMode:M,zoomOnDoubleClick:$,panOnDrag:ee,autoPanOnSelection:ie,onPaneClick:re,onPaneMouseEnter:de,onPaneMouseMove:ce,onPaneMouseLeave:te,onPaneScroll:ue,onPaneContextMenu:Se,paneClickDistance:be,nodeClickDistance:ge,onEdgeContextMenu:ye,onEdgeMouseEnter:Ee,onEdgeMouseMove:De,onEdgeMouseLeave:Ge,reconnectRadius:yt,onReconnect:It,onReconnectStart:Nt,onReconnectEnd:At,noDragClassName:kt,noWheelClassName:Qi,noPanClassName:Bn,disableKeyboardA11y:tt,nodeExtent:Ht,rfId:Jt,viewport:Ft,onViewportChange:Wt}){return sv(t),sv(i),iM(),QT(s),JT(Ft),z.jsx(vT,{onPaneClick:re,onPaneMouseEnter:de,onPaneMouseMove:ce,onPaneMouseLeave:te,onPaneContextMenu:Se,onPaneScroll:ue,paneClickDistance:be,deleteKeyCode:R,selectionKeyCode:D,selectionOnDrag:x,selectionMode:T,onSelectionStart:y,onSelectionEnd:S,multiSelectionKeyCode:L,panActivationKeyCode:O,zoomActivationKeyCode:j,elementsSelectable:le,zoomOnScroll:H,zoomOnPinch:G,zoomOnDoubleClick:$,panOnScroll:U,panOnScrollSpeed:J,panOnScrollMode:M,panOnDrag:ee,autoPanOnSelection:ie,defaultViewport:K,translateExtent:Z,minZoom:oe,maxZoom:B,onSelectionContextMenu:p,preventScrolling:X,noDragClassName:kt,noWheelClassName:Qi,noPanClassName:Bn,disableKeyboardA11y:tt,onViewportChange:Wt,isControlledViewport:!!Ft,children:z.jsxs(ZT,{children:[z.jsx(XT,{edgeTypes:i,onEdgeClick:r,onEdgeDoubleClick:u,onReconnect:It,onReconnectStart:Nt,onReconnectEnd:At,onlyRenderVisibleElements:V,onEdgeContextMenu:ye,onEdgeMouseEnter:Ee,onEdgeMouseMove:De,onEdgeMouseLeave:Ge,reconnectRadius:yt,defaultMarkerColor:C,noPanClassName:Bn,disableKeyboardA11y:tt,rfId:Jt}),z.jsx(tM,{style:_,type:E,component:N,containerStyle:w}),z.jsx("div",{className:"react-flow__edgelabel-renderer"}),z.jsx(TT,{nodeTypes:t,onNodeClick:a,onNodeDoubleClick:c,onNodeMouseEnter:m,onNodeMouseMove:h,onNodeMouseLeave:g,onNodeContextMenu:v,nodeClickDistance:ge,onlyRenderVisibleElements:V,noPanClassName:Bn,noDragClassName:kt,disableKeyboardA11y:tt,nodeExtent:Ht,rfId:Jt}),z.jsx("div",{className:"react-flow__viewport-portal"})]})})}ub.displayName="GraphView";const sM=W.memo(ub),lM=m1(),lv=({nodes:t,edges:i,defaultNodes:s,defaultEdges:a,width:r,height:c,fitView:u,fitViewOptions:m,minZoom:h=.5,maxZoom:g=2,nodeOrigin:v,nodeExtent:p,zIndexMode:y="basic"}={})=>{const S=new Map,E=new Map,_=new Map,N=new Map,w=a??i??[],D=s??t??[],x=v??[0,0],T=p??ho;A1(_,N,w);const{nodesInitialized:L}=yh(D,S,E,{nodeOrigin:x,nodeExtent:T,zIndexMode:y});let O=[0,0,1];if(u&&r&&c){const j=Ao(S,{filter:K=>!!((K.width||K.initialWidth)&&(K.height||K.initialHeight))}),{x:R,y:V,zoom:le}=Uh(j,r,c,h,g,m?.padding??.1);O=[R,V,le]}return{rfId:"1",width:r??0,height:c??0,transform:O,nodes:D,nodesInitialized:L,nodeLookup:S,parentLookup:E,edges:w,edgeLookup:N,connectionLookup:_,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:s!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:g,translateExtent:ho,nodeExtent:T,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:$l.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:x,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:u??!1,fitViewOptions:m,fitViewResolver:null,connection:{...r1},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:lM,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:o1,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},aM=({nodes:t,edges:i,defaultNodes:s,defaultEdges:a,width:r,height:c,fitView:u,fitViewOptions:m,minZoom:h,maxZoom:g,nodeOrigin:v,nodeExtent:p,zIndexMode:y})=>vA((S,E)=>{async function _(){const{nodeLookup:N,panZoom:w,fitViewOptions:D,fitViewResolver:x,width:T,height:L,minZoom:O,maxZoom:j}=E();w&&(await mN({nodes:N,width:T,height:L,panZoom:w,minZoom:O,maxZoom:j},D),x?.resolve(!0),S({fitViewResolver:null}))}return{...lv({nodes:t,edges:i,width:r,height:c,fitView:u,fitViewOptions:m,minZoom:h,maxZoom:g,nodeOrigin:v,nodeExtent:p,defaultNodes:s,defaultEdges:a,zIndexMode:y}),setNodes:N=>{const{nodeLookup:w,parentLookup:D,nodeOrigin:x,elevateNodesOnSelect:T,fitViewQueued:L,zIndexMode:O,nodesSelectionActive:j}=E(),{nodesInitialized:R,hasSelectedNodes:V}=yh(N,w,D,{nodeOrigin:x,nodeExtent:p,elevateNodesOnSelect:T,checkEquality:!0,zIndexMode:O}),le=j&&V;L&&R?(_(),S({nodes:N,nodesInitialized:R,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:le})):S({nodes:N,nodesInitialized:R,nodesSelectionActive:le})},setEdges:N=>{const{connectionLookup:w,edgeLookup:D}=E();A1(w,D,N),S({edges:N})},setDefaultNodesAndEdges:(N,w)=>{if(N){const{setNodes:D}=E();D(N),S({hasDefaultNodes:!0})}if(w){const{setEdges:D}=E();D(w),S({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:w,nodeLookup:D,parentLookup:x,domNode:T,nodeOrigin:L,nodeExtent:O,debug:j,fitViewQueued:R,zIndexMode:V}=E(),{changes:le,updatedInternals:K}=kN(N,D,x,T,L,O,V);K&&(LN(D,x,{nodeOrigin:L,nodeExtent:O,zIndexMode:V}),R?(_(),S({fitViewQueued:!1,fitViewOptions:void 0})):S({}),le?.length>0&&(j&&console.log("React Flow: trigger node changes",le),w?.(le)))},updateNodePositions:(N,w=!1)=>{const D=[];let x=[];const{nodeLookup:T,triggerNodeChanges:L,connection:O,updateConnection:j,onNodesChangeMiddlewareMap:R}=E();for(const[V,le]of N){const K=T.get(V),Z=!!(K?.expandParent&&K?.parentId&&le?.position),oe={id:V,type:"position",position:Z?{x:Math.max(0,le.position.x),y:Math.max(0,le.position.y)}:le.position,dragging:w};if(K&&O.inProgress&&O.fromNode.id===K.id){const B=Ts(K,O.fromHandle,fe.Left,!0);j({...O,from:B})}Z&&K.parentId&&D.push({id:V,parentId:K.parentId,rect:{...le.internals.positionAbsolute,width:le.measured.width??0,height:le.measured.height??0}}),x.push(oe)}if(D.length>0){const{parentLookup:V,nodeOrigin:le}=E(),K=Kh(D,T,V,le);x.push(...K)}for(const V of R.values())x=V(x);L(x)},triggerNodeChanges:N=>{const{onNodesChange:w,setNodes:D,nodes:x,hasDefaultNodes:T,debug:L}=E();if(N?.length){if(T){const O=UA(N,x);D(O)}L&&console.log("React Flow: trigger node changes",N),w?.(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:w,setEdges:D,edges:x,hasDefaultEdges:T,debug:L}=E();if(N?.length){if(T){const O=qA(N,x);D(O)}L&&console.log("React Flow: trigger edge changes",N),w?.(N)}},addSelectedNodes:N=>{const{multiSelectionActive:w,edgeLookup:D,nodeLookup:x,triggerNodeChanges:T,triggerEdgeChanges:L}=E();if(w){const O=N.map(j=>gs(j,!0));T(O);return}T(Al(x,new Set([...N]),!0)),L(Al(D))},addSelectedEdges:N=>{const{multiSelectionActive:w,edgeLookup:D,nodeLookup:x,triggerNodeChanges:T,triggerEdgeChanges:L}=E();if(w){const O=N.map(j=>gs(j,!0));L(O);return}L(Al(D,new Set([...N]))),T(Al(x,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:w}={})=>{const{edges:D,nodes:x,nodeLookup:T,triggerNodeChanges:L,triggerEdgeChanges:O}=E(),j=N||x,R=w||D,V=[];for(const K of j){if(!K.selected)continue;const Z=T.get(K.id);Z&&(Z.selected=!1),V.push(gs(K.id,!1))}const le=[];for(const K of R)K.selected&&le.push(gs(K.id,!1));L(V),O(le)},setMinZoom:N=>{const{panZoom:w,maxZoom:D}=E();w?.setScaleExtent([N,D]),S({minZoom:N})},setMaxZoom:N=>{const{panZoom:w,minZoom:D}=E();w?.setScaleExtent([D,N]),S({maxZoom:N})},setTranslateExtent:N=>{E().panZoom?.setTranslateExtent(N),S({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:w,triggerNodeChanges:D,triggerEdgeChanges:x,elementsSelectable:T}=E();if(!T)return;const L=w.reduce((j,R)=>R.selected?[...j,gs(R.id,!1)]:j,[]),O=N.reduce((j,R)=>R.selected?[...j,gs(R.id,!1)]:j,[]);D(L),x(O)},setNodeExtent:N=>{const{nodes:w,nodeLookup:D,parentLookup:x,nodeOrigin:T,elevateNodesOnSelect:L,nodeExtent:O,zIndexMode:j}=E();N[0][0]===O[0][0]&&N[0][1]===O[0][1]&&N[1][0]===O[1][0]&&N[1][1]===O[1][1]||(yh(w,D,x,{nodeOrigin:T,nodeExtent:N,elevateNodesOnSelect:L,checkEquality:!1,zIndexMode:j}),S({nodeExtent:N}))},panBy:N=>{const{transform:w,width:D,height:x,panZoom:T,translateExtent:L}=E();return HN({delta:N,panZoom:T,transform:w,translateExtent:L,width:D,height:x})},setCenter:async(N,w,D)=>{const{width:x,height:T,maxZoom:L,panZoom:O}=E();if(!O)return!1;const j=typeof D?.zoom<"u"?D.zoom:L;return await O.setViewport({x:x/2-N*j,y:T/2-w*j,zoom:j},{duration:D?.duration,ease:D?.ease,interpolate:D?.interpolate}),!0},cancelConnection:()=>{S({connection:{...r1}})},updateConnection:N=>{S({connection:N})},reset:()=>S({...lv()})}},Object.is);function fb({initialNodes:t,initialEdges:i,defaultNodes:s,defaultEdges:a,initialWidth:r,initialHeight:c,initialMinZoom:u,initialMaxZoom:m,initialFitViewOptions:h,fitView:g,nodeOrigin:v,nodeExtent:p,zIndexMode:y,children:S}){const[E]=W.useState(()=>aM({nodes:t,edges:i,defaultNodes:s,defaultEdges:a,width:r,height:c,fitView:g,minZoom:u,maxZoom:m,fitViewOptions:h,nodeOrigin:v,nodeExtent:p,zIndexMode:y}));return z.jsx(SA,{value:E,children:z.jsx(ZA,{children:S})})}function oM({children:t,nodes:i,edges:s,defaultNodes:a,defaultEdges:r,width:c,height:u,fitView:m,fitViewOptions:h,minZoom:g,maxZoom:v,nodeOrigin:p,nodeExtent:y,zIndexMode:S}){return W.useContext(Qc)?z.jsx(z.Fragment,{children:t}):z.jsx(fb,{initialNodes:i,initialEdges:s,defaultNodes:a,defaultEdges:r,initialWidth:c,initialHeight:u,fitView:m,initialFitViewOptions:h,initialMinZoom:g,initialMaxZoom:v,nodeOrigin:p,nodeExtent:y,zIndexMode:S,children:t})}const rM={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function cM({nodes:t,edges:i,defaultNodes:s,defaultEdges:a,className:r,nodeTypes:c,edgeTypes:u,onNodeClick:m,onEdgeClick:h,onInit:g,onMove:v,onMoveStart:p,onMoveEnd:y,onConnect:S,onConnectStart:E,onConnectEnd:_,onClickConnectStart:N,onClickConnectEnd:w,onNodeMouseEnter:D,onNodeMouseMove:x,onNodeMouseLeave:T,onNodeContextMenu:L,onNodeDoubleClick:O,onNodeDragStart:j,onNodeDrag:R,onNodeDragStop:V,onNodesDelete:le,onEdgesDelete:K,onDelete:Z,onSelectionChange:oe,onSelectionDragStart:B,onSelectionDrag:X,onSelectionDragStop:C,onSelectionContextMenu:H,onSelectionStart:G,onSelectionEnd:U,onBeforeDelete:J,connectionMode:M,connectionLineType:$=Yi.Bezier,connectionLineStyle:ee,connectionLineComponent:ie,connectionLineContainerStyle:re,deleteKeyCode:de="Backspace",selectionKeyCode:ce="Shift",selectionOnDrag:te=!1,selectionMode:ue=mo.Full,panActivationKeyCode:Se="Space",multiSelectionKeyCode:be=yo()?"Meta":"Control",zoomActivationKeyCode:ge=yo()?"Meta":"Control",snapToGrid:ye,snapGrid:Ee,onlyRenderVisibleElements:De=!1,selectNodesOnDrag:Ge,nodesDraggable:yt,autoPanOnNodeFocus:It,nodesConnectable:Nt,nodesFocusable:At,nodeOrigin:kt=$1,edgesFocusable:Qi,edgesReconnectable:Bn,elementsSelectable:tt=!0,defaultViewport:Ht=LA,minZoom:Jt=.5,maxZoom:Ft=2,translateExtent:Wt=ho,preventScrolling:hu=!0,nodeExtent:Ds,defaultMarkerColor:mu="#b1b1b7",zoomOnScroll:gu=!0,zoomOnPinch:Ii=!0,panOnScroll:wt=!1,panOnScrollSpeed:_n=.5,panOnScrollMode:xt=xs.Free,zoomOnDoubleClick:pu=!0,panOnDrag:yu=!0,onPaneClick:vu,onPaneMouseEnter:Ls,onPaneMouseMove:Rs,onPaneMouseLeave:Bs,onPaneScroll:jn,onPaneContextMenu:js,paneClickDistance:Ji=1,nodeClickDistance:bu=0,children:Do,onReconnect:Pl,onReconnectStart:Fi,onReconnectEnd:Su,onEdgeContextMenu:Lo,onEdgeDoubleClick:Ro,onEdgeMouseEnter:Bo,onEdgeMouseMove:ea,onEdgeMouseLeave:ta,reconnectRadius:jo=10,onNodesChange:ko,onEdgesChange:Nn,noDragClassName:ut="nodrag",noWheelClassName:vt="nowheel",noPanClassName:kn="nopan",fitView:ks,fitViewOptions:Ho,connectOnClick:wu,attributionPosition:$o,proOptions:Wi,defaultEdgeOptions:na,elevateNodesOnSelect:ci=!0,elevateEdgesOnSelect:ui=!1,disableKeyboardA11y:fi=!1,autoPanOnConnect:di,autoPanOnNodeDrag:st,autoPanOnSelection:Uo=!0,autoPanSpeed:qo,connectionRadius:Hn,isValidConnection:hi,onError:xu,style:Vo,id:ia,nodeDragThreshold:Eu,connectionDragThreshold:Hs,viewport:$s,onViewportChange:fn,width:Tt,height:Yo,colorMode:_u="light",debug:sa,onScroll:la,ariaLabelConfig:Us,zIndexMode:Go="basic",...Mt},aa){const qs=ia||"1",oa=kA(_u),mi=W.useCallback(ra=>{ra.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),la?.(ra)},[la]);return z.jsx("div",{"data-testid":"rf__wrapper",...Mt,onScroll:mi,style:{...Vo,...rM},ref:aa,className:ct(["react-flow",r,oa]),id:ia,role:"application",children:z.jsxs(oM,{nodes:t,edges:i,width:Tt,height:Yo,fitView:ks,fitViewOptions:Ho,minZoom:Jt,maxZoom:Ft,nodeOrigin:kt,nodeExtent:Ds,zIndexMode:Go,children:[z.jsx(jA,{nodes:t,edges:i,defaultNodes:s,defaultEdges:a,onConnect:S,onConnectStart:E,onConnectEnd:_,onClickConnectStart:N,onClickConnectEnd:w,nodesDraggable:yt,autoPanOnNodeFocus:It,nodesConnectable:Nt,nodesFocusable:At,edgesFocusable:Qi,edgesReconnectable:Bn,elementsSelectable:tt,elevateNodesOnSelect:ci,elevateEdgesOnSelect:ui,minZoom:Jt,maxZoom:Ft,nodeExtent:Ds,onNodesChange:ko,onEdgesChange:Nn,snapToGrid:ye,snapGrid:Ee,connectionMode:M,translateExtent:Wt,connectOnClick:wu,defaultEdgeOptions:na,fitView:ks,fitViewOptions:Ho,onNodesDelete:le,onEdgesDelete:K,onDelete:Z,onNodeDragStart:j,onNodeDrag:R,onNodeDragStop:V,onSelectionDrag:X,onSelectionDragStart:B,onSelectionDragStop:C,onMove:v,onMoveStart:p,onMoveEnd:y,noPanClassName:kn,nodeOrigin:kt,rfId:qs,autoPanOnConnect:di,autoPanOnNodeDrag:st,autoPanSpeed:qo,onError:xu,connectionRadius:Hn,isValidConnection:hi,selectNodesOnDrag:Ge,nodeDragThreshold:Eu,connectionDragThreshold:Hs,onBeforeDelete:J,debug:sa,ariaLabelConfig:Us,zIndexMode:Go}),z.jsx(sM,{onInit:g,onNodeClick:m,onEdgeClick:h,onNodeMouseEnter:D,onNodeMouseMove:x,onNodeMouseLeave:T,onNodeContextMenu:L,onNodeDoubleClick:O,nodeTypes:c,edgeTypes:u,connectionLineType:$,connectionLineStyle:ee,connectionLineComponent:ie,connectionLineContainerStyle:re,selectionKeyCode:ce,selectionOnDrag:te,selectionMode:ue,deleteKeyCode:de,multiSelectionKeyCode:be,panActivationKeyCode:Se,zoomActivationKeyCode:ge,onlyRenderVisibleElements:De,defaultViewport:Ht,translateExtent:Wt,minZoom:Jt,maxZoom:Ft,preventScrolling:hu,zoomOnScroll:gu,zoomOnPinch:Ii,zoomOnDoubleClick:pu,panOnScroll:wt,panOnScrollSpeed:_n,panOnScrollMode:xt,panOnDrag:yu,autoPanOnSelection:Uo,onPaneClick:vu,onPaneMouseEnter:Ls,onPaneMouseMove:Rs,onPaneMouseLeave:Bs,onPaneScroll:jn,onPaneContextMenu:js,paneClickDistance:Ji,nodeClickDistance:bu,onSelectionContextMenu:H,onSelectionStart:G,onSelectionEnd:U,onReconnect:Pl,onReconnectStart:Fi,onReconnectEnd:Su,onEdgeContextMenu:Lo,onEdgeDoubleClick:Ro,onEdgeMouseEnter:Bo,onEdgeMouseMove:ea,onEdgeMouseLeave:ta,reconnectRadius:jo,defaultMarkerColor:mu,noDragClassName:ut,noWheelClassName:vt,noPanClassName:kn,rfId:qs,disableKeyboardA11y:fi,nodeExtent:Ds,viewport:$s,onViewportChange:fn}),z.jsx(DA,{onSelectionChange:oe}),Do,z.jsx(TA,{proOptions:Wi,position:$o}),z.jsx(AA,{rfId:qs,disableKeyboardA11y:fi})]})})}var uM=q1(cM);const fM=t=>t.domNode?.querySelector(".react-flow__edgelabel-renderer");function dM({children:t}){const i=ze(fM);return i?bA.createPortal(t,i):null}function hM({dimensions:t,lineWidth:i,variant:s,className:a}){return z.jsx("path",{strokeWidth:i,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:ct(["react-flow__background-pattern",s,a])})}function mM({radius:t,className:i}){return z.jsx("circle",{cx:t,cy:t,r:t,className:ct(["react-flow__background-pattern","dots",i])})}var Gi;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Gi||(Gi={}));const gM={[Gi.Dots]:1,[Gi.Lines]:1,[Gi.Cross]:6},pM=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function db({id:t,variant:i=Gi.Dots,gap:s=20,size:a,lineWidth:r=1,offset:c=0,color:u,bgColor:m,style:h,className:g,patternClassName:v}){const p=W.useRef(null),{transform:y,patternId:S}=ze(pM,Qe),E=a||gM[i],_=i===Gi.Dots,N=i===Gi.Cross,w=Array.isArray(s)?s:[s,s],D=[w[0]*y[2]||1,w[1]*y[2]||1],x=E*y[2],T=Array.isArray(c)?c:[c,c],L=N?[x,x]:D,O=[T[0]*y[2]||1+L[0]/2,T[1]*y[2]||1+L[1]/2],j=`${S}${t||""}`;return z.jsxs("svg",{className:ct(["react-flow__background",g]),style:{...h,...Fc,"--xy-background-color-props":m,"--xy-background-pattern-color-props":u},ref:p,"data-testid":"rf__background",children:[z.jsx("pattern",{id:j,x:y[0]%D[0],y:y[1]%D[1],width:D[0],height:D[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${O[0]},-${O[1]})`,children:_?z.jsx(mM,{radius:x/2,className:v}):z.jsx(hM,{dimensions:L,lineWidth:r,variant:i,className:v})}),z.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${j})`})]})}db.displayName="Background";const yM=W.memo(db);function vM(){return z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:z.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function bM(){return z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:z.jsx("path",{d:"M0 0h32v4.2H0z"})})}function SM(){return z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:z.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 wM(){return z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:z.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 xM(){return z.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:z.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 rc({children:t,className:i,...s}){return z.jsx("button",{type:"button",className:ct(["react-flow__controls-button",i]),...s,children:t})}const EM=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function hb({style:t,showZoom:i=!0,showFitView:s=!0,showInteractive:a=!0,fitViewOptions:r,onZoomIn:c,onZoomOut:u,onFitView:m,onInteractiveChange:h,className:g,children:v,position:p="bottom-left",orientation:y="vertical","aria-label":S}){const E=Je(),{isInteractive:_,minZoomReached:N,maxZoomReached:w,ariaLabelConfig:D}=ze(EM,Qe),{zoomIn:x,zoomOut:T,fitView:L}=Jc(),O=()=>{x(),c?.()},j=()=>{T(),u?.()},R=()=>{L(r),m?.()},V=()=>{E.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),h?.(!_)},le=y==="horizontal"?"horizontal":"vertical";return z.jsxs(Ic,{className:ct(["react-flow__controls",le,g]),position:p,style:t,"data-testid":"rf__controls","aria-label":S??D["controls.ariaLabel"],children:[i&&z.jsxs(z.Fragment,{children:[z.jsx(rc,{onClick:O,className:"react-flow__controls-zoomin",title:D["controls.zoomIn.ariaLabel"],"aria-label":D["controls.zoomIn.ariaLabel"],disabled:w,children:z.jsx(vM,{})}),z.jsx(rc,{onClick:j,className:"react-flow__controls-zoomout",title:D["controls.zoomOut.ariaLabel"],"aria-label":D["controls.zoomOut.ariaLabel"],disabled:N,children:z.jsx(bM,{})})]}),s&&z.jsx(rc,{className:"react-flow__controls-fitview",onClick:R,title:D["controls.fitView.ariaLabel"],"aria-label":D["controls.fitView.ariaLabel"],children:z.jsx(SM,{})}),a&&z.jsx(rc,{className:"react-flow__controls-interactive",onClick:V,title:D["controls.interactive.ariaLabel"],"aria-label":D["controls.interactive.ariaLabel"],children:_?z.jsx(xM,{}):z.jsx(wM,{})}),v]})}hb.displayName="Controls";const _M=W.memo(hb);function NM({id:t,x:i,y:s,width:a,height:r,style:c,color:u,strokeColor:m,strokeWidth:h,className:g,borderRadius:v,shapeRendering:p,selected:y,onClick:S}){const{background:E,backgroundColor:_}=c||{},N=u||E||_;return z.jsx("rect",{className:ct(["react-flow__minimap-node",{selected:y},g]),x:i,y:s,rx:v,ry:v,width:a,height:r,style:{fill:N,stroke:m,strokeWidth:h},shapeRendering:p,onClick:S?w=>S(w,t):void 0})}const AM=W.memo(NM),TM=t=>t.nodes.map(i=>i.id),Qd=t=>t instanceof Function?t:()=>t;function MM({nodeStrokeColor:t,nodeColor:i,nodeClassName:s="",nodeBorderRadius:a=5,nodeStrokeWidth:r,nodeComponent:c=AM,onClick:u}){const m=ze(TM,Qe),h=Qd(i),g=Qd(t),v=Qd(s),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return z.jsx(z.Fragment,{children:m.map(y=>z.jsx(OM,{id:y,nodeColorFunc:h,nodeStrokeColorFunc:g,nodeClassNameFunc:v,nodeBorderRadius:a,nodeStrokeWidth:r,NodeComponent:c,onClick:u,shapeRendering:p},y))})}function CM({id:t,nodeColorFunc:i,nodeStrokeColorFunc:s,nodeClassNameFunc:a,nodeBorderRadius:r,nodeStrokeWidth:c,shapeRendering:u,NodeComponent:m,onClick:h}){const{node:g,x:v,y:p,width:y,height:S}=ze(E=>{const _=E.nodeLookup.get(t);if(!_)return{node:void 0,x:0,y:0,width:0,height:0};const N=_.internals.userNode,{x:w,y:D}=_.internals.positionAbsolute,{width:x,height:T}=ri(N);return{node:N,x:w,y:D,width:x,height:T}},Qe);return!g||g.hidden||!g1(g)?null:z.jsx(m,{x:v,y:p,width:y,height:S,style:g.style,selected:!!g.selected,className:a(g),color:i(g),borderRadius:r,strokeColor:s(g),strokeWidth:c,shapeRendering:u,onClick:h,id:g.id})}const OM=W.memo(CM);var zM=W.memo(MM);const DM=200,LM=150,RM=t=>!t.hidden,BM=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?h1(Ao(t.nodeLookup,{filter:RM}),i):i,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},jM="react-flow__minimap-desc";function mb({style:t,className:i,nodeStrokeColor:s,nodeColor:a,nodeClassName:r="",nodeBorderRadius:c=5,nodeStrokeWidth:u,nodeComponent:m,bgColor:h,maskColor:g,maskStrokeColor:v,maskStrokeWidth:p,position:y="bottom-right",onClick:S,onNodeClick:E,pannable:_=!1,zoomable:N=!1,ariaLabel:w,inversePan:D,zoomStep:x=1,offsetScale:T=5}){const L=Je(),O=W.useRef(null),{boundingRect:j,viewBB:R,rfId:V,panZoom:le,translateExtent:K,flowWidth:Z,flowHeight:oe,ariaLabelConfig:B}=ze(BM,Qe),X=t?.width??DM,C=t?.height??LM,H=j.width/X,G=j.height/C,U=Math.max(H,G),J=U*X,M=U*C,$=T*U,ee=j.x-(J-j.width)/2-$,ie=j.y-(M-j.height)/2-$,re=J+$*2,de=M+$*2,ce=`${jM}-${V}`,te=W.useRef(0),ue=W.useRef();te.current=U,W.useEffect(()=>{if(O.current&&le)return ue.current=ZN({domNode:O.current,panZoom:le,getTransform:()=>L.getState().transform,getViewScale:()=>te.current}),()=>{ue.current?.destroy()}},[le]),W.useEffect(()=>{ue.current?.update({translateExtent:K,width:Z,height:oe,inversePan:D,pannable:_,zoomStep:x,zoomable:N})},[_,N,D,x,K,Z,oe]);const Se=S?ye=>{const[Ee,De]=ue.current?.pointer(ye)||[0,0];S(ye,{x:Ee,y:De})}:void 0,be=E?W.useCallback((ye,Ee)=>{const De=L.getState().nodeLookup.get(Ee).internals.userNode;E(ye,De)},[]):void 0,ge=w??B["minimap.ariaLabel"];return z.jsx(Ic,{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*U: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 u=="number"?u:void 0},className:ct(["react-flow__minimap",i]),"data-testid":"rf__minimap",children:z.jsxs("svg",{width:X,height:C,viewBox:`${ee} ${ie} ${re} ${de}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ce,ref:O,onClick:Se,children:[ge&&z.jsx("title",{id:ce,children:ge}),z.jsx(zM,{onClick:be,nodeColor:a,nodeStrokeColor:s,nodeBorderRadius:c,nodeClassName:r,nodeStrokeWidth:u,nodeComponent:m}),z.jsx("path",{className:"react-flow__minimap-mask",d:`M${ee-$},${ie-$}h${re+$*2}v${de+$*2}h${-re-$*2}z
|
|
15
|
+
M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}mb.displayName="MiniMap";W.memo(mb);const kM=t=>i=>t?`${Math.max(1/i.transform[2],1)}`:void 0,HM={[Yl.Line]:"right",[Yl.Handle]:"bottom-right"};function $M({nodeId:t,position:i,variant:s=Yl.Handle,className:a,style:r=void 0,children:c,color:u,minWidth:m=10,minHeight:h=10,maxWidth:g=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:p=!1,resizeDirection:y,autoScale:S=!0,shouldResize:E,onResizeStart:_,onResize:N,onResizeEnd:w}){const D=X1(),x=typeof t=="string"?t:D,T=Je(),L=W.useRef(null),O=s===Yl.Handle,j=ze(W.useCallback(kM(O&&S),[O,S]),Qe),R=W.useRef(null),V=i??HM[s];W.useEffect(()=>{if(!(!L.current||!x))return R.current||(R.current=aA({domNode:L.current,nodeId:x,getStoreItems:()=>{const{nodeLookup:K,transform:Z,snapGrid:oe,snapToGrid:B,nodeOrigin:X,domNode:C}=T.getState();return{nodeLookup:K,transform:Z,snapGrid:oe,snapToGrid:B,nodeOrigin:X,paneDomNode:C}},onChange:(K,Z)=>{const{triggerNodeChanges:oe,nodeLookup:B,parentLookup:X,nodeOrigin:C}=T.getState(),H=[],G={x:K.x,y:K.y},U=B.get(x);if(U&&U.expandParent&&U.parentId){const J=U.origin??C,M=K.width??U.measured.width??0,$=K.height??U.measured.height??0,ee={id:U.id,parentId:U.parentId,rect:{width:M,height:$,...p1({x:K.x??U.position.x,y:K.y??U.position.y},{width:M,height:$},U.parentId,B,J)}},ie=Kh([ee],B,X,C);H.push(...ie),G.x=K.x?Math.max(J[0]*M,K.x):void 0,G.y=K.y?Math.max(J[1]*$,K.y):void 0}if(G.x!==void 0&&G.y!==void 0){const J={id:x,type:"position",position:{...G}};H.push(J)}if(K.width!==void 0&&K.height!==void 0){const M={id:x,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:K.width,height:K.height}};H.push(M)}for(const J of Z){const M={...J,type:"position"};H.push(M)}oe(H)},onEnd:({width:K,height:Z})=>{const oe={id:x,type:"dimensions",resizing:!1,dimensions:{width:K,height:Z}};T.getState().triggerNodeChanges([oe])}})),R.current.update({controlPosition:V,boundaries:{minWidth:m,minHeight:h,maxWidth:g,maxHeight:v},keepAspectRatio:p,resizeDirection:y,onResizeStart:_,onResize:N,onResizeEnd:w,shouldResize:E}),()=>{R.current?.destroy()}},[V,m,h,g,v,p,_,N,w,E]);const le=V.split("-");return z.jsx("div",{className:ct(["react-flow__resize-control","nodrag",...le,s,a]),ref:L,style:{...r,scale:j,...u&&{[O?"backgroundColor":"borderColor"]:u}},children:c})}W.memo($M);const av=3,UM=new Set(["command-event","event-query"]);function gb(t){return[...new Set(t)]}function pb(t){return t?.trim()?gb(t.split(/\r?\n/).map(i=>qM(i)).filter(i=>!!i)):[]}function qM(t){const i=t.trim();return i?i.replace(/^[-*+]\s+/,"").replace(/^\d+[.)]\s+/,"").trim().match(/^`?([A-Za-z_][A-Za-z0-9_.-]*)`?(?=\s*(?::|-|=|\(|,|$))/)?.[1]:void 0}function VM(t){const i=new Map(t.nodes.map(r=>[r.id,r])),s=new Map(t.nodes.map(r=>[r.id,pb(r.fields)])),a=new Map;for(const r of t.edges){if(!UM.has(r.kind))continue;const c=i.get(r.source),u=i.get(r.target);if(!ov(c)||!ov(u))continue;const m=s.get(r.source)??[],h=s.get(r.target)??[],g=new Set(h),v=m.filter(S=>g.has(S)),p=r.kind==="event-query"?GM(c,h,v):[],y=gb([...v,...p]);a.set(r.id,{sourceFieldNames:m,targetFieldNames:h,sharedFieldNames:v,derivedFieldNames:p,visibleFieldNames:y.slice(0,av),remainingCount:Math.max(0,y.length-av),sourceMissingFields:m.length===0,targetMissingFields:h.length===0})}return a}function YM(t,i){if(!i)return;const s=[...t.entries()].filter(([,a])=>a.sharedFieldNames.includes(i)||a.derivedFieldNames.includes(i)).map(([a])=>a);return s.length>0?new Set(s):void 0}function ov(t){return t?.type==="command"||t?.type==="event"||t?.type==="query"}function GM(t,i,s){const a=rv(t.label),r=new Set(s);return i.filter(c=>!r.has(c)&&rv(c).includes(a))}function rv(t){return t.replace(/^(has|is|was|were)/i,"").replace(/been/gi,"").replace(/[^A-Za-z0-9]/g,"").toLowerCase()}const Ui=180,qi=80,yb=80,ii=430,Ll=390,vb=130,pn=178,XM=92,Sh=300,wh=170,Rc=18,xh=48,Id=30,Sc=92,bb=38,KM=42,cv=154,uv=278,Sb=408;function ZM(t){return t==="slice-screen"||t==="story-slice"?"#cbd5e1":"#64748b"}function QM(t){return t.type==="event"?{sourcePosition:fe.Right,targetPosition:fe.Left}:{sourcePosition:fe.Bottom,targetPosition:fe.Top}}function IM(t){return new Map(t.stories.map((i,s)=>[i.name,s]))}function ys(t,i){return t===0?0:t*i+(t-1)*Rc}function Jd(t,i,s){return t.nodes.filter(a=>a.sliceTitle===i&&a.type===s)}function JM(t,i,s){return[...new Set(t.edges.filter(r=>r.kind==="command-event"&&i.get(r.source)?.sliceTitle===s).map(r=>r.target))].map(r=>i.get(r)).filter(r=>!!r)}function FM(t,i){return new Map(t.slices.map(s=>{const a=Jd(t,s.title,"query"),r=Jd(t,s.title,"command"),c=JM(t,i,s.title),u=Jd(t,s.title,"gwt"),m=ys(a.length,pn),h=ys(r.length,pn),g=m+h+(m>0&&h>0?xh:0),v=ys(c.length,pn),p=ys(u.length,Sh),y=Math.max(ii,g+Id*2,v+Id*2,p+Id*2),S=u.length>0?Sb+wh+36:Ll;return[s.title,{width:y,height:S,queryIds:a.map(E=>E.id),commandIds:r.map(E=>E.id),eventIds:c.map(E=>E.id),gwtIds:u.map(E=>E.id)}]}))}function WM(t,i){const s=new Map;let a=qi;for(const r of t.stories){const c=t.slices.filter(v=>v.storyName===r.name),u=c.reduce((v,p)=>v+(i.get(p.title)?.width??ii),0),m=Math.max(u+Math.max(c.length-1,0)*vb,ii),h=Math.max(...c.map(v=>i.get(v.title)?.height??Ll),Ll),g=Sc+h+bb;s.set(r.name,{y:a,width:m,height:g}),a+=g+yb}return s}function fv(t,i,s,a,r,c){const u=ys(t.length,c),m=s.x+(a-u)/2;t.forEach((h,g)=>{i.set(h,{x:m+g*(c+Rc),y:s.y+r})})}function PM(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 eC(t,i,s="all"){if(!i||s==="all")return new Set(t.stories.map(u=>u.name));if(s==="story")return new Set([i]);const a=new Set([i]),r=new Set(t.nodes.filter(u=>u.storyName===i).map(u=>u.id)),c=new Set(t.edges.filter(u=>r.has(u.source)||r.has(u.target)).flatMap(u=>[u.source,u.target]).filter(u=>t.nodes.find(m=>m.id===u)?.type==="event"));for(const u of t.edges){if(!c.has(u.source)&&!c.has(u.target))continue;const m=t.nodes.find(g=>g.id===u.source),h=t.nodes.find(g=>g.id===u.target);m?.storyName&&a.add(m.storyName),h?.storyName&&a.add(h.storyName)}return a}function tC(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 nC(t,i,s,a,r){const c=tC(t),u=i?.sliceTitle&&i.sliceTitle===s?.sliceTitle;if(t==="event-query"&&u)return{...c,route:"same-slice-read"};if(!(t==="event-query"&&i?.sliceTitle!==s?.sliceTitle)||!a||!r)return{...c,route:"semantic"};const h=a.x+a.width/2,g=a.y+a.height/2,v=r.x+r.width/2,p=r.y+r.height/2;return{sourceSide:i?.storyName&&i.storyName===s?.storyName||p>=g?"bottom":"top",targetSide:v>=h?"left":"right",route:"event-read"}}function iC(t,i,s={}){const a=IM(t),r=new Map(t.nodes.map(w=>[w.id,w])),c=FM(t,r),u=WM(t,c),m=new Map,h=new Map,g=new Map,v=new Set,p=eC(t,s.focusedStory,s.scope??"all"),y=PM(s.edgeDetail??"normal");if(i){v.add(i);for(const w of t.edges)w.source===i&&v.add(w.target),w.target===i&&v.add(w.source)}const S=new Map;for(const w of t.stories)S.set(w.name,Ui);for(const w of t.stories)for(const D of w.slices){const x=t.slices.find(O=>O.path===D);if(!x)continue;const T=u.get(w.name)??{y:qi},L=S.get(w.name)??Ui;g.set(x.title,{x:L,y:T.y+Sc}),S.set(w.name,L+(c.get(x.title)?.width??ii)+vb)}for(const w of t.slices){if(g.has(w.title))continue;const D=qi+(a.get(w.storyName??"")??0)*(Ll+Sc+bb+yb),x=Ui;g.set(w.title,{x,y:D+Sc})}for(const w of t.nodes){if(w.type==="story"&&m.set(w.id,{x:Ui-20,y:u.get(w.label)?.y??qi}),w.type==="slice"){const D=g.get(w.label)??{x:Ui,y:qi};m.set(w.id,D)}if(w.type==="screen"||w.type==="processor"){const D=g.get(w.sliceTitle??"")??{x:Ui,y:qi},T=c.get(w.sliceTitle??"")?.width??ii;m.set(w.id,{x:D.x+(T-pn)/2,y:D.y+KM})}}for(const w of t.slices){const D=g.get(w.title)??{x:Ui,y:qi},x=c.get(w.title),T=x?.width??ii;if(!x)continue;const L=ys(x.queryIds.length,pn),O=ys(x.commandIds.length,pn),j=L+O+(L>0&&O>0?xh:0);let R=D.x+(T-j)/2;x.queryIds.forEach((V,le)=>{m.set(V,{x:R+le*(pn+Rc),y:D.y+cv})}),L>0&&(R+=L+(O>0?xh:0)),x.commandIds.forEach((V,le)=>{m.set(V,{x:R+le*(pn+Rc),y:D.y+cv})}),fv(x.eventIds,m,D,T,uv,pn),fv(x.gwtIds,m,D,T,Sb,Sh)}for(const w of t.nodes.filter(D=>D.type==="event")){const D=t.edges.find(T=>T.kind==="command-event"&&T.target===w.id),x=D?r.get(D.source):void 0;if(!m.has(w.id)){const T=g.get(x?.sliceTitle??"")??{x:Ui,y:qi},L=c.get(x?.sliceTitle??"");m.set(w.id,{x:T.x+((L?.width??ii)-pn)/2,y:T.y+uv})}w.storyName=x?.storyName}const E=t.nodes.map(w=>{const D=m.get(w.id)??{x:0,y:0},x=w.type==="story"||w.type==="slice",T=w.type==="story"?u.get(w.label)?.width??ii:c.get(w.label)?.width??ii,L=w.type==="story"?u.get(w.label)?.height??Ll:c.get(w.label)?.height??Ll,O=x?T:w.type==="gwt"?Sh:pn,j=x?L:w.type==="gwt"?wh:XM;return h.set(w.id,{x:D.x,y:D.y,width:O,height:j}),{id:w.id,type:x?"groupNode":"eventModelNode",position:D,selectable:!0,draggable:!1,data:{projectNode:w,selected:w.id===i,connected:v.has(w.id)},hidden:!!(w.storyName&&!p.has(w.storyName)),style:x?{width:T,height:L,zIndex:w.type==="story"?-20:-10,opacity:w.storyName&&!p.has(w.storyName)?.18:1}:{width:O,height:w.type==="gwt"?wh:void 0,opacity:w.storyName&&!p.has(w.storyName)?.18:1},...QM(w)}}),N=t.edges.filter(w=>y.has(w.kind)).filter(w=>{const D=r.get(w.source),x=r.get(w.target),T=!D?.storyName||p.has(D.storyName),L=!x?.storyName||p.has(x.storyName);return T&&L}).map(w=>{const D=r.get(w.source),x=r.get(w.target),T=!!s.focusedEdgeIds?.has(w.id),{sourceSide:L,targetSide:O,route:j}=nC(w.kind,D,x,h.get(w.source),h.get(w.target));return{id:w.id,source:w.source,target:w.target,type:"eventModelEdge",sourceHandle:`${L}-source`,targetHandle:`${O}-target`,data:{kind:w.kind,route:j,active:T,fieldFlow:s.edgeFieldFlows?.get(w.id),selectedFieldName:s.selectedFieldName,onSelectField:s.onSelectField},markerEnd:{type:go.ArrowClosed,color:T?"#111827":ZM(w.kind)},label:s.edgeDetail==="verbose"?w.label:void 0,className:T?"edge edge-active":"edge",animated:T}});return{nodes:E,edges:N}}const Qh=Symbol.for("yaml.alias"),Eh=Symbol.for("yaml.document"),Xi=Symbol.for("yaml.map"),wb=Symbol.for("yaml.pair"),Ln=Symbol.for("yaml.scalar"),Zl=Symbol.for("yaml.seq"),un=Symbol.for("yaml.node.type"),Cs=t=>!!t&&typeof t=="object"&&t[un]===Qh,Os=t=>!!t&&typeof t=="object"&&t[un]===Eh,Ql=t=>!!t&&typeof t=="object"&&t[un]===Xi,Ie=t=>!!t&&typeof t=="object"&&t[un]===wb,Ye=t=>!!t&&typeof t=="object"&&t[un]===Ln,Il=t=>!!t&&typeof t=="object"&&t[un]===Zl;function Fe(t){if(t&&typeof t=="object")switch(t[un]){case Xi:case Zl:return!0}return!1}function We(t){if(t&&typeof t=="object")switch(t[un]){case Qh:case Xi:case Ln:case Zl:return!0}return!1}const xb=t=>(Ye(t)||Fe(t))&&!!t.anchor,Bt=Symbol("break visit"),Eb=Symbol("skip children"),Dn=Symbol("remove node");function zs(t,i){const s=_b(i);Os(t)?Tl(null,t.contents,s,Object.freeze([t]))===Dn&&(t.contents=null):Tl(null,t,s,Object.freeze([]))}zs.BREAK=Bt;zs.SKIP=Eb;zs.REMOVE=Dn;function Tl(t,i,s,a){const r=Nb(t,i,s,a);if(We(r)||Ie(r))return Ab(t,a,r),Tl(t,r,s,a);if(typeof r!="symbol"){if(Fe(i)){a=Object.freeze(a.concat(i));for(let c=0;c<i.items.length;++c){const u=Tl(c,i.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===Bt)return Bt;u===Dn&&(i.items.splice(c,1),c-=1)}}}else if(Ie(i)){a=Object.freeze(a.concat(i));const c=Tl("key",i.key,s,a);if(c===Bt)return Bt;c===Dn&&(i.key=null);const u=Tl("value",i.value,s,a);if(u===Bt)return Bt;u===Dn&&(i.value=null)}}return r}async function Wc(t,i){const s=_b(i);Os(t)?await Ml(null,t.contents,s,Object.freeze([t]))===Dn&&(t.contents=null):await Ml(null,t,s,Object.freeze([]))}Wc.BREAK=Bt;Wc.SKIP=Eb;Wc.REMOVE=Dn;async function Ml(t,i,s,a){const r=await Nb(t,i,s,a);if(We(r)||Ie(r))return Ab(t,a,r),Ml(t,r,s,a);if(typeof r!="symbol"){if(Fe(i)){a=Object.freeze(a.concat(i));for(let c=0;c<i.items.length;++c){const u=await Ml(c,i.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===Bt)return Bt;u===Dn&&(i.items.splice(c,1),c-=1)}}}else if(Ie(i)){a=Object.freeze(a.concat(i));const c=await Ml("key",i.key,s,a);if(c===Bt)return Bt;c===Dn&&(i.key=null);const u=await Ml("value",i.value,s,a);if(u===Bt)return Bt;u===Dn&&(i.value=null)}}return r}function _b(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(Ql(i))return s.Map?.(t,i,a);if(Il(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(Cs(i))return s.Alias?.(t,i,a)}function Ab(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(Os(a))a.contents=s;else{const r=Cs(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const sC={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},lC=t=>t.replace(/[!,[\]{}]/g,i=>sC[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[c,u]=a;return this.tags[c]=u,!0}case"%YAML":{if(this.yaml.explicit=!0,a.length!==1)return s(0,"%YAML directive should contain exactly one part"),!1;const[c]=a;if(c==="1.1"||c==="1.2")return this.yaml.version=c,!0;{const u=/^\d+\.\d+$/.test(c);return s(6,`Unsupported YAML version ${c}`,u),!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 u=i.slice(2,-1);return u==="!"||u==="!!"?(s(`Verbatim tags aren't resolved, so ${i} is invalid.`),null):(i[i.length-1]!==">"&&s("Verbatim tags must end with a >"),u)}const[,a,r]=i.match(/^(.*!)([^!]*)$/s);r||s(`The ${i} tag has no suffix`);const c=this.tags[a];if(c)try{return c+decodeURIComponent(r)}catch(u){return s(String(u)),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+lC(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 c={};zs(i.contents,(u,m)=>{We(m)&&m.tag&&(c[m.tag]=!0)}),r=Object.keys(c)}else r=[];for(const[c,u]of a)c==="!!"&&u==="tag:yaml.org,2002:"||(!i||r.some(m=>m.startsWith(u)))&&s.push(`%TAG ${c} ${u}`);return s.join(`
|
|
16
|
+
`)}}_t.defaultYaml={explicit:!1,version:"1.2"};_t.defaultTags={"!!":"tag:yaml.org,2002:"};function Tb(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 Mb(t){const i=new Set;return zs(t,{Value(s,a){a.anchor&&i.add(a.anchor)}}),i}function Cb(t,i){for(let s=1;;++s){const a=`${t}${s}`;if(!i.has(a))return a}}function aC(t,i){const s=[],a=new Map;let r=null;return{onAnchor:c=>{s.push(c),r??(r=Mb(t));const u=Cb(i,r);return r.add(u),u},setAnchors:()=>{for(const c of s){const u=a.get(c);if(typeof u=="object"&&u.anchor&&(Ye(u.node)||Fe(u.node)))u.node.anchor=u.anchor;else{const m=new Error("Failed to resolve repeated object (this should not happen)");throw m.source=c,m}}},sourceObjects:a}}function Cl(t,i,s,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let r=0,c=a.length;r<c;++r){const u=a[r],m=Cl(t,a,String(r),u);m===void 0?delete a[r]:m!==u&&(a[r]=m)}else if(a instanceof Map)for(const r of Array.from(a.keys())){const c=a.get(r),u=Cl(t,a,r,c);u===void 0?a.delete(r):u!==c&&a.set(r,u)}else if(a instanceof Set)for(const r of Array.from(a)){const c=Cl(t,a,r,r);c===void 0?a.delete(r):c!==r&&(a.delete(r),a.add(c))}else for(const[r,c]of Object.entries(a)){const u=Cl(t,a,r,c);u===void 0?delete a[r]:u!==c&&(a[r]=u)}return t.call(i,s,a)}function cn(t,i,s){if(Array.isArray(t))return t.map((a,r)=>cn(a,String(r),s));if(t&&typeof t.toJSON=="function"){if(!s||!xb(t))return t.toJSON(i,s);const a={aliasCount:0,count:1,res:void 0};s.anchors.set(t,a),s.onCreate=c=>{a.res=c,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 Ih{constructor(i){Object.defineProperty(this,un,{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:c}={}){if(!Os(i))throw new TypeError("A document argument is required");const u={anchors:new Map,doc:i,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},m=cn(this,"",u);if(typeof r=="function")for(const{count:h,res:g}of u.anchors.values())r(g,h);return typeof c=="function"?Cl(c,{"":m},"",m):m}}class Pc extends Ih{constructor(i){super(Qh),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=[],zs(i,{Node:(c,u)=>{(Cs(u)||xb(u))&&a.push(u)}}),s&&(s.aliasResolveCache=a));let r;for(const c of a){if(c===this)break;c.anchor===this.source&&(r=c)}return r}toJSON(i,s){if(!s)return{source:this.source};const{anchors:a,doc:r,maxAliasCount:c}=s,u=this.resolve(r,s);if(!u){const h=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(h)}let m=a.get(u);if(m||(cn(u,null,s),m=a.get(u)),m?.res===void 0){const h="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(h)}if(c>=0&&(m.count+=1,m.aliasCount===0&&(m.aliasCount=wc(r,u,a)),m.count*m.aliasCount>c)){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(Tb(this.source),i.options.verifyAliasOrder&&!i.anchors.has(this.source)){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(c)}if(i.implicitKey)return`${r} `}return r}}function wc(t,i,s){if(Cs(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 c=wc(t,r,s);c>a&&(a=c)}return a}else if(Ie(i)){const a=wc(t,i.key,s),r=wc(t,i.value,s);return Math.max(a,r)}return 1}const Ob=t=>!t||typeof t!="function"&&typeof t!="object";class xe extends Ih{constructor(i){super(Ln),this.value=i}toJSON(i,s){return s?.keep?this.value:cn(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 oC="tag:yaml.org,2002:";function rC(t,i,s){if(i){const a=s.filter(c=>c.tag===i),r=a.find(c=>!c.format)??a[0];if(!r)throw new Error(`Tag ${i} not found`);return r}return s.find(a=>a.identify?.(t)&&!a.format)}function bo(t,i,s){if(Os(t)&&(t=t.contents),We(t))return t;if(Ie(t)){const p=s.schema[Xi].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:c,schema:u,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 Pc(h.anchor);h={anchor:null,node:null},m.set(t,h)}i?.startsWith("!!")&&(i=oC+i.slice(2));let g=rC(t,i,u.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?u[Xi]:Symbol.iterator in Object(t)?u[Zl]:u[Xi]}c&&(c(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 Bc(t,i,s){let a=s;for(let r=i.length-1;r>=0;--r){const c=i[r];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const u=[];u[c]=a,a=u}else a=new Map([[c,a]])}return bo(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 io=t=>t==null||typeof t=="object"&&!!t[Symbol.iterator]().next().done;class zb extends Ih{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(io(i))this.add(s);else{const[a,...r]=i,c=this.get(a,!0);if(Fe(c))c.addIn(r,s);else if(c===void 0&&this.schema)this.set(a,Bc(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,c=this.get(a,!0);return r.length===0?!s&&Ye(c)?c.value:c:Fe(c)?c.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 c=this.get(a,!0);if(Fe(c))c.setIn(r,s);else if(c===void 0&&this.schema)this.set(a,Bc(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}}const cC=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function li(t,i){return/^\n+$/.test(t)?t.substring(1):i?t.replace(/^(?! *$)/gm,i):t}const vs=(t,i,s)=>t.endsWith(`
|
|
17
|
+
`)?li(s,i):s.includes(`
|
|
18
|
+
`)?`
|
|
19
|
+
`+li(s,i):(t.endsWith(" ")?"":" ")+s,Db="flow",_h="block",xc="quoted";function eu(t,i,s="flow",{indentAtStart:a,lineWidth:r=80,minContentWidth:c=20,onFold:u,onOverflow:m}={}){if(!r||r<0)return t;r<c&&(c=0);const h=Math.max(1+c,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,c)?g.push(0):p=r-a);let y,S,E=!1,_=-1,N=-1,w=-1;s===_h&&(_=dv(t,_,i.length),_!==-1&&(p=_+h));for(let x;x=t[_+=1];){if(s===xc&&x==="\\"){switch(N=_,t[_+1]){case"x":_+=3;break;case"u":_+=5;break;case"U":_+=9;break;default:_+=1}w=_}if(x===`
|
|
20
|
+
`)s===_h&&(_=dv(t,_,i.length)),p=_+i.length+h,y=void 0;else{if(x===" "&&S&&S!==" "&&S!==`
|
|
21
|
+
`&&S!==" "){const T=t[_+1];T&&T!==" "&&T!==`
|
|
22
|
+
`&&T!==" "&&(y=_)}if(_>=p)if(y)g.push(y),p=y+h,y=void 0;else if(s===xc){for(;S===" "||S===" ";)S=x,x=t[_+=1],E=!0;const T=_>w+1?_-2:N-1;if(v[T])return t;g.push(T),v[T]=!0,p=T+h,y=void 0}else E=!0}S=x}if(E&&m&&m(),g.length===0)return t;u&&u();let D=t.slice(0,g[0]);for(let x=0;x<g.length;++x){const T=g[x],L=g[x+1]||t.length;T===0?D=`
|
|
23
|
+
${i}${t.slice(0,L)}`:(s===xc&&v[T]&&(D+=`${t[T]}\\`),D+=`
|
|
24
|
+
${i}${t.slice(T+1,L)}`)}return D}function dv(t,i,s){let a=i,r=i+1,c=t[r];for(;c===" "||c===" ";)if(i<r+s)c=t[++i];else{do c=t[++i];while(c&&c!==`
|
|
25
|
+
`);a=i,r=i+1,c=t[r]}return a}const tu=(t,i)=>({indentAtStart:i?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),nu=t=>/^(%|---|\.\.\.)/m.test(t);function uC(t,i,s){if(!i||i<0)return!1;const a=i-s,r=t.length;if(r<=a)return!1;for(let c=0,u=0;c<r;++c)if(t[c]===`
|
|
26
|
+
`){if(c-u>a)return!0;if(u=c+1,r-u<=a)return!1}return!0}function ao(t,i){const s=JSON.stringify(t);if(i.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=i,r=i.options.doubleQuotedMinMultiLineLength,c=i.indent||(nu(t)?" ":"");let u="",m=0;for(let h=0,g=s[h];g;g=s[++h])if(g===" "&&s[h+1]==="\\"&&s[h+2]==="n"&&(u+=s.slice(m,h)+"\\ ",h+=1,m=h,g="\\"),g==="\\")switch(s[h+1]){case"u":{u+=s.slice(m,h);const v=s.substr(h+2,4);switch(v){case"0000":u+="\\0";break;case"0007":u+="\\a";break;case"000b":u+="\\v";break;case"001b":u+="\\e";break;case"0085":u+="\\N";break;case"00a0":u+="\\_";break;case"2028":u+="\\L";break;case"2029":u+="\\P";break;default:v.substr(0,2)==="00"?u+="\\x"+v.substr(2):u+=s.substr(h,6)}h+=5,m=h+1}break;case"n":if(a||s[h+2]==='"'||s.length<r)h+=1;else{for(u+=s.slice(m,h)+`
|
|
27
|
+
|
|
28
|
+
`;s[h+2]==="\\"&&s[h+3]==="n"&&s[h+4]!=='"';)u+=`
|
|
29
|
+
`,h+=2;u+=c,s[h+2]===" "&&(u+="\\"),h+=1,m=h+1}break;default:h+=1}return u=m?u+s.slice(m):s,a?u:eu(u,c,xc,tu(i,!1))}function Nh(t,i){if(i.options.singleQuote===!1||i.implicitKey&&t.includes(`
|
|
30
|
+
`)||/[ \t]\n|\n[ \t]/.test(t))return ao(t,i);const s=i.indent||(nu(t)?" ":""),a="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
31
|
+
${s}`)+"'";return i.implicitKey?a:eu(a,s,Db,tu(i,!1))}function Ol(t,i){const{singleQuote:s}=i.options;let a;if(s===!1)a=ao;else{const r=t.includes('"'),c=t.includes("'");r&&!c?a=Nh:c&&!r?a=ao:a=s?Nh:ao}return a(t,i)}let Ah;try{Ah=new RegExp(`(^|(?<!
|
|
32
|
+
))
|
|
33
|
+
+(?!
|
|
34
|
+
|$)`,"g")}catch{Ah=/\n+(?!\n|$)/g}function Ec({comment:t,type:i,value:s},a,r,c){const{blockQuote:u,commentString:m,lineWidth:h}=a.options;if(!u||/\n[\t ]+$/.test(s))return Ol(s,a);const g=a.indent||(a.forceBlockIndent||nu(s)?" ":""),v=u==="literal"?!0:u==="folded"||i===xe.BLOCK_FOLDED?!1:i===xe.BLOCK_LITERAL?!0:!uC(s,h,g.length);if(!s)return v?`|
|
|
35
|
+
`:`>
|
|
36
|
+
`;let p,y;for(y=s.length;y>0;--y){const L=s[y-1];if(L!==`
|
|
37
|
+
`&&L!==" "&&L!==" ")break}let S=s.substring(y);const E=S.indexOf(`
|
|
38
|
+
`);E===-1?p="-":s===S||E!==S.length-1?(p="+",c&&c()):p="",S&&(s=s.slice(0,-S.length),S[S.length-1]===`
|
|
39
|
+
`&&(S=S.slice(0,-1)),S=S.replace(Ah,`$&${g}`));let _=!1,N,w=-1;for(N=0;N<s.length;++N){const L=s[N];if(L===" ")_=!0;else if(L===`
|
|
40
|
+
`)w=N;else break}let D=s.substring(0,w<N?w+1:N);D&&(s=s.substring(D.length),D=D.replace(/\n+/g,`$&${g}`));let T=(_?g?"2":"1":"")+p;if(t&&(T+=" "+m(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!v){const L=s.replace(/\n+/g,`
|
|
41
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${g}`);let O=!1;const j=tu(a,!0);u!=="folded"&&i!==xe.BLOCK_FOLDED&&(j.onOverflow=()=>{O=!0});const R=eu(`${D}${L}${S}`,g,_h,j);if(!O)return`>${T}
|
|
42
|
+
${g}${R}`}return s=s.replace(/\n+/g,`$&${g}`),`|${T}
|
|
43
|
+
${g}${D}${s}${S}`}function fC(t,i,s,a){const{type:r,value:c}=t,{actualString:u,implicitKey:m,indent:h,indentStep:g,inFlow:v}=i;if(m&&c.includes(`
|
|
44
|
+
`)||v&&/[[\]{},]/.test(c))return Ol(c,i);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return m||v||!c.includes(`
|
|
45
|
+
`)?Ol(c,i):Ec(t,i,s,a);if(!m&&!v&&r!==xe.PLAIN&&c.includes(`
|
|
46
|
+
`))return Ec(t,i,s,a);if(nu(c)){if(h==="")return i.forceBlockIndent=!0,Ec(t,i,s,a);if(m&&h===g)return Ol(c,i)}const p=c.replace(/\n+/g,`$&
|
|
47
|
+
${h}`);if(u){const y=_=>_.default&&_.tag!=="tag:yaml.org,2002:str"&&_.test?.test(p),{compat:S,tags:E}=i.doc.schema;if(E.some(y)||S?.some(y))return Ol(c,i)}return m?p:eu(p,h,Db,tu(i,!1))}function Co(t,i,s,a){const{implicitKey:r,inFlow:c}=i,u=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(u.value)&&(m=xe.QUOTE_DOUBLE);const h=v=>{switch(v){case xe.BLOCK_FOLDED:case xe.BLOCK_LITERAL:return r||c?Ol(u.value,i):Ec(u,i,s,a);case xe.QUOTE_DOUBLE:return ao(u.value,i);case xe.QUOTE_SINGLE:return Nh(u.value,i);case xe.PLAIN:return fC(u,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 Lb(t,i){const s=Object.assign({blockQuote:!0,commentString:cC,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 dC(t,i){if(i.tag){const r=t.filter(c=>c.tag===i.tag);if(r.length>0)return r.find(c=>c.format===i.format)??r[0]}let s,a;if(Ye(i)){a=i.value;let r=t.filter(c=>c.identify?.(a));if(r.length>1){const c=r.filter(u=>u.test);c.length>0&&(r=c)}s=r.find(c=>c.format===i.format)??r.find(c=>!c.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 hC(t,i,{anchors:s,doc:a}){if(!a.directives)return"";const r=[],c=(Ye(t)||Fe(t))&&t.anchor;c&&Tb(c)&&(s.add(c),r.push(`&${c}`));const u=t.tag??(i.default?null:i.tag);return u&&r.push(a.directives.tagString(u)),r.join(" ")}function Gl(t,i,s,a){if(Ie(t))return t.toString(i,s,a);if(Cs(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 c=We(t)?t:i.doc.createNode(t,{onTagObj:h=>r=h});r??(r=dC(i.doc.schema.tags,c));const u=hC(c,r,i);u.length>0&&(i.indentAtStart=(i.indentAtStart??0)+u.length+1);const m=typeof r.stringify=="function"?r.stringify(c,i,s,a):Ye(c)?Co(c,i,s,a):c.toString(i,s,a);return u?Ye(c)||m[0]==="{"||m[0]==="["?`${u} ${m}`:`${u}
|
|
48
|
+
${i.indent}${m}`:m}function mC({key:t,value:i},s,a,r){const{allNullValues:c,doc:u,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 j="With simple keys, collection cannot be used as a key value";throw new Error(j)}}let S=!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:!S&&(p||!c),indent:m+h});let E=!1,_=!1,N=Gl(t,s,()=>E=!0,()=>_=!0);if(!S&&!s.inFlow&&N.length>1024){if(p)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");S=!0}if(s.inFlow){if(c||i==null)return E&&a&&a(),N===""?"?":S?`? ${N}`:N}else if(c&&!p||i==null&&S)return N=`? ${N}`,y&&!E?N+=vs(N,s.indent,g(y)):_&&r&&r(),N;E&&(y=null),S?(y&&(N+=vs(N,s.indent,g(y))),N=`? ${N}
|
|
49
|
+
${m}:`):(N=`${N}:`,y&&(N+=vs(N,s.indent,g(y))));let w,D,x;We(i)?(w=!!i.spaceBefore,D=i.commentBefore,x=i.comment):(w=!1,D=null,x=null,i&&typeof i=="object"&&(i=u.createNode(i))),s.implicitKey=!1,!S&&!y&&Ye(i)&&(s.indentAtStart=N.length+1),_=!1,!v&&h.length>=2&&!s.inFlow&&!S&&Il(i)&&!i.flow&&!i.tag&&!i.anchor&&(s.indent=s.indent.substring(2));let T=!1;const L=Gl(i,s,()=>T=!0,()=>_=!0);let O=" ";if(y||w||D){if(O=w?`
|
|
50
|
+
`:"",D){const j=g(D);O+=`
|
|
51
|
+
${li(j,s.indent)}`}L===""&&!s.inFlow?O===`
|
|
52
|
+
`&&x&&(O=`
|
|
53
|
+
|
|
54
|
+
`):O+=`
|
|
55
|
+
${s.indent}`}else if(!S&&Fe(i)){const j=L[0],R=L.indexOf(`
|
|
56
|
+
`),V=R!==-1,le=s.inFlow??i.flow??i.items.length===0;if(V||!le){let K=!1;if(V&&(j==="&"||j==="!")){let Z=L.indexOf(" ");j==="&"&&Z!==-1&&Z<R&&L[Z+1]==="!"&&(Z=L.indexOf(" ",Z+1)),(Z===-1||R<Z)&&(K=!0)}K||(O=`
|
|
57
|
+
${s.indent}`)}}else(L===""||L[0]===`
|
|
58
|
+
`)&&(O="");return N+=O+L,s.inFlow?T&&a&&a():x&&!T?N+=vs(N,s.indent,g(x)):_&&r&&r(),N}function Rb(t,i){(t==="debug"||t==="warn")&&console.warn(i)}const cc="<<",ai={identify:t=>t===cc||typeof t=="symbol"&&t.description===cc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new xe(Symbol(cc)),{addToJSMap:Bb}),stringify:()=>cc},gC=(t,i)=>(ai.identify(i)||Ye(i)&&(!i.type||i.type===xe.PLAIN)&&ai.identify(i.value))&&t?.doc.schema.tags.some(s=>s.tag===ai.tag&&s.default);function Bb(t,i,s){const a=jb(t,s);if(Il(a))for(const r of a.items)Fd(t,i,r);else if(Array.isArray(a))for(const r of a)Fd(t,i,r);else Fd(t,i,a)}function Fd(t,i,s){const a=jb(t,s);if(!Ql(a))throw new Error("Merge sources must be maps or map aliases");const r=a.toJSON(null,t,Map);for(const[c,u]of r)i instanceof Map?i.has(c)||i.set(c,u):i instanceof Set?i.add(c):Object.prototype.hasOwnProperty.call(i,c)||Object.defineProperty(i,c,{value:u,writable:!0,enumerable:!0,configurable:!0});return i}function jb(t,i){return t&&Cs(i)?i.resolve(t.doc,t):i}function kb(t,i,{key:s,value:a}){if(We(s)&&s.addToJSMap)s.addToJSMap(t,i,a);else if(gC(t,s))Bb(t,i,a);else{const r=cn(s,"",t);if(i instanceof Map)i.set(r,cn(a,r,t));else if(i instanceof Set)i.add(r);else{const c=pC(s,r,t),u=cn(a,c,t);c in i?Object.defineProperty(i,c,{value:u,writable:!0,enumerable:!0,configurable:!0}):i[c]=u}}return i}function pC(t,i,s){if(i===null)return"";if(typeof i!="object")return String(i);if(We(t)&&s?.doc){const a=Lb(s.doc,{});a.anchors=new Set;for(const c of s.anchors.keys())a.anchors.add(c.anchor);a.inFlow=!0,a.inStringifyKey=!0;const r=t.toString(a);if(!s.mapKeyWarned){let c=JSON.stringify(r);c.length>40&&(c=c.substring(0,36)+'..."'),Rb(s.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${c}. Set mapAsMap: true to use object keys.`),s.mapKeyWarned=!0}return r}return JSON.stringify(i)}function Jh(t,i,s){const a=bo(t,void 0,s),r=bo(i,void 0,s);return new St(a,r)}class St{constructor(i,s=null){Object.defineProperty(this,un,{value:wb}),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 kb(s,a,this)}toString(i,s,a){return i?.doc?mC(this,i,s,a):JSON.stringify(this)}}function Hb(t,i,s){return(i.inFlow??t.flow?vC:yC)(t,i,s)}function yC({comment:t,items:i},s,{blockItemPrefix:a,flowChars:r,itemIndent:c,onChompKeep:u,onComment:m}){const{indent:h,options:{commentString:g}}=s,v=Object.assign({},s,{indent:c,type:null});let p=!1;const y=[];for(let E=0;E<i.length;++E){const _=i[E];let N=null;if(We(_))!p&&_.spaceBefore&&y.push(""),jc(s,y,_.commentBefore,p),_.comment&&(N=_.comment);else if(Ie(_)){const D=We(_.key)?_.key:null;D&&(!p&&D.spaceBefore&&y.push(""),jc(s,y,D.commentBefore,p))}p=!1;let w=Gl(_,v,()=>N=null,()=>p=!0);N&&(w+=vs(w,c,g(N))),p&&N&&(p=!1),y.push(a+w)}let S;if(y.length===0)S=r.start+r.end;else{S=y[0];for(let E=1;E<y.length;++E){const _=y[E];S+=_?`
|
|
59
|
+
${h}${_}`:`
|
|
60
|
+
`}}return t?(S+=`
|
|
61
|
+
`+li(g(t),h),m&&m()):p&&u&&u(),S}function vC({items:t},i,{flowChars:s,itemIndent:a}){const{indent:r,indentStep:c,flowCollectionPadding:u,options:{commentString:m}}=i;a+=c;const h=Object.assign({},i,{indent:a,inFlow:!0,type:null});let g=!1,v=0;const p=[];for(let E=0;E<t.length;++E){const _=t[E];let N=null;if(We(_))_.spaceBefore&&p.push(""),jc(i,p,_.commentBefore,!1),_.comment&&(N=_.comment);else if(Ie(_)){const D=We(_.key)?_.key:null;D&&(D.spaceBefore&&p.push(""),jc(i,p,D.commentBefore,!1),D.comment&&(g=!0));const x=We(_.value)?_.value:null;x?(x.comment&&(N=x.comment),x.commentBefore&&(g=!0)):_.value==null&&D?.comment&&(N=D.comment)}N&&(g=!0);let w=Gl(_,h,()=>N=null);g||(g=p.length>v||w.includes(`
|
|
62
|
+
`)),E<t.length-1?w+=",":i.options.trailingComma&&(i.options.lineWidth>0&&(g||(g=p.reduce((D,x)=>D+x.length+2,2)+(w.length+2)>i.options.lineWidth)),g&&(w+=",")),N&&(w+=vs(w,a,m(N))),p.push(w),v=p.length}const{start:y,end:S}=s;if(p.length===0)return y+S;if(!g){const E=p.reduce((_,N)=>_+N.length+2,2);g=i.options.lineWidth>0&&E>i.options.lineWidth}if(g){let E=y;for(const _ of p)E+=_?`
|
|
63
|
+
${c}${r}${_}`:`
|
|
64
|
+
`;return`${E}
|
|
65
|
+
${r}${S}`}else return`${y}${u}${p.join(" ")}${u}${S}`}function jc({indent:t,options:{commentString:i}},s,a,r){if(a&&r&&(a=a.replace(/^\n+/,"")),a){const c=li(i(a),t);s.push(c.trimStart())}}function bs(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 zb{static get tagName(){return"tag:yaml.org,2002:map"}constructor(i){super(Xi,i),this.items=[]}static from(i,s,a){const{keepUndefined:r,replacer:c}=a,u=new this(i),m=(h,g)=>{if(typeof c=="function")g=c.call(s,h,g);else if(Array.isArray(c)&&!c.includes(h))return;(g!==void 0||r)&&u.items.push(Jh(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"&&u.items.sort(i.sortMapEntries),u}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=bs(this.items,a.key),c=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(c){const u=this.items.findIndex(m=>c(a,m)<0);u===-1?this.items.push(a):this.items.splice(u,0,a)}else this.items.push(a)}delete(i){const s=bs(this.items,i);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(i,s){const r=bs(this.items,i)?.value;return(!s&&Ye(r)?r.value:r)??void 0}has(i){return!!bs(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 c of this.items)kb(s,r,c);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})),Hb(this,i,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:i.indent||"",onChompKeep:a,onComment:s})}}const Jl={collection:"map",default:!0,nodeClass:Zt,tag:"tag:yaml.org,2002:map",resolve(t,i){return Ql(t)||i("Expected a mapping for this tag"),t},createNode:(t,i,s)=>Zt.from(t,i,s)};class Ki extends zb{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(i){super(Zl,i),this.items=[]}add(i){this.items.push(i)}delete(i){const s=uc(i);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(i,s){const a=uc(i);if(typeof a!="number")return;const r=this.items[a];return!s&&Ye(r)?r.value:r}has(i){const s=uc(i);return typeof s=="number"&&s<this.items.length}set(i,s){const a=uc(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 c of this.items)a.push(cn(c,String(r++),s));return a}toString(i,s,a){return i?Hb(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,c=new this(i);if(s&&Symbol.iterator in Object(s)){let u=0;for(let m of s){if(typeof r=="function"){const h=s instanceof Set?m:String(u++);m=r.call(s,h,m)}c.items.push(bo(m,void 0,a))}}return c}}function uc(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 Fl={collection:"seq",default:!0,nodeClass:Ki,tag:"tag:yaml.org,2002:seq",resolve(t,i){return Il(t)||i("Expected a sequence for this tag"),t},createNode:(t,i,s)=>Ki.from(t,i,s)},iu={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),Co(t,i,s,a)}},su={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"&&su.test.test(t)?t:i.options.nullStr},Fh={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&&Fh.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 En({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 c=Object.is(a,-0)?"-0":JSON.stringify(a);if(!t&&i&&(!s||s==="tag:yaml.org,2002:float")&&/^-?\d/.test(c)&&!c.includes("e")){let u=c.indexOf(".");u<0&&(u=c.length,c+=".");let m=i-(c.length-u-1);for(;m-- >0;)c+="0"}return c}const $b={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:En},Ub={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():En(t)}},qb={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:En},lu=t=>typeof t=="bigint"||Number.isInteger(t),Wh=(t,i,s,{intAsBigInt:a})=>a?BigInt(t):parseInt(t.substring(i),s);function Vb(t,i,s){const{value:a}=t;return lu(a)&&a>=0?s+a.toString(i):En(t)}const Yb={identify:t=>lu(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(t,i,s)=>Wh(t,2,8,s),stringify:t=>Vb(t,8,"0o")},Gb={identify:lu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,i,s)=>Wh(t,0,10,s),stringify:En},Xb={identify:t=>lu(t)&&t>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(t,i,s)=>Wh(t,2,16,s),stringify:t=>Vb(t,16,"0x")},bC=[Jl,Fl,iu,su,Fh,Yb,Gb,Xb,$b,Ub,qb];function hv(t){return typeof t=="bigint"||Number.isInteger(t)}const fc=({value:t})=>JSON.stringify(t),SC=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:fc},{identify:t=>t==null,createNode:()=>new xe(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:fc},{identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:t=>t==="true",stringify:fc},{identify:hv,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})=>hv(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:fc}],wC={default:!0,tag:"",test:/^/,resolve(t,i){return i(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},xC=[Jl,Fl].concat(SC,wC),Ph={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,c){if(!s)return"";const u=s;let m;if(typeof btoa=="function"){let h="";for(let g=0;g<u.length;++g)h+=String.fromCharCode(u[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 Co({comment:t,type:i,value:m},a,r,c)}};function Kb(t,i){if(Il(t))for(let s=0;s<t.items.length;++s){let a=t.items[s];if(!Ie(a)){if(Ql(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 c=r.value??r.key;c.comment=c.comment?`${a.comment}
|
|
68
|
+
${c.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 Zb(t,i,s){const{replacer:a}=s,r=new Ki(t);r.tag="tag:yaml.org,2002:pairs";let c=0;if(i&&Symbol.iterator in Object(i))for(let u of i){typeof a=="function"&&(u=a.call(i,String(c++),u));let m,h;if(Array.isArray(u))if(u.length===2)m=u[0],h=u[1];else throw new TypeError(`Expected [key, value] tuple: ${u}`);else if(u&&u instanceof Object){const g=Object.keys(u);if(g.length===1)m=g[0],h=u[m];else throw new TypeError(`Expected tuple with one key, not ${g.length} keys`)}else m=u;r.items.push(Jh(m,h,s))}return r}const em={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Kb,createNode:Zb};class Rl extends Ki{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=Rl.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 c,u;if(Ie(r)?(c=cn(r.key,"",s),u=cn(r.value,c,s)):c=cn(r,"",s),a.has(c))throw new Error("Ordered maps must not include duplicate keys");a.set(c,u)}return a}static from(i,s,a){const r=Zb(i,s,a),c=new this;return c.items=r.items,c}}Rl.tag="tag:yaml.org,2002:omap";const tm={collection:"seq",identify:t=>t instanceof Map,nodeClass:Rl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,i){const s=Kb(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 Rl,s)},createNode:(t,i,s)=>Rl.from(t,i,s)};function Qb({value:t,source:i},s){return i&&(t?Ib:Jb).test.test(i)?i:t?s.options.trueStr:s.options.falseStr}const Ib={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:Qb},Jb={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:Qb},EC={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:En},_C={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():En(t)}},NC={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:En},Oo=t=>typeof t=="bigint"||Number.isInteger(t);function au(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 u=BigInt(t);return r==="-"?BigInt(-1)*u:u}const c=parseInt(t,s);return r==="-"?-1*c:c}function nm(t,i,s){const{value:a}=t;if(Oo(a)){const r=a.toString(i);return a<0?"-"+s+r.substr(1):s+r}return En(t)}const AC={identify:Oo,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,i,s)=>au(t,2,2,s),stringify:t=>nm(t,2,"0b")},TC={identify:Oo,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,i,s)=>au(t,1,8,s),stringify:t=>nm(t,8,"0")},MC={identify:Oo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,i,s)=>au(t,0,10,s),stringify:En},CC={identify:Oo,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,i,s)=>au(t,2,16,s),stringify:t=>nm(t,16,"0x")};class Bl extends Zt{constructor(i){super(i),this.tag=Bl.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),bs(this.items,s.key)||this.items.push(s)}get(i,s){const a=bs(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=bs(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,c=new this(i);if(s&&Symbol.iterator in Object(s))for(let u of s)typeof r=="function"&&(u=r.call(s,u,u)),c.items.push(Jh(u,null,a));return c}}Bl.tag="tag:yaml.org,2002:set";const im={collection:"map",identify:t=>t instanceof Set,nodeClass:Bl,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,i,s)=>Bl.from(t,i,s),resolve(t,i){if(Ql(t)){if(t.hasAllNullValues(!0))return Object.assign(new Bl,t);i("Set items must all have null values")}else i("Expected a mapping for this tag");return t}};function sm(t,i){const s=t[0],a=s==="-"||s==="+"?t.substring(1):t,r=u=>i?BigInt(u):Number(u),c=a.replace(/_/g,"").split(":").reduce((u,m)=>u*r(60)+r(m),r(0));return s==="-"?r(-1)*c:c}function Fb(t){let{value:i}=t,s=u=>u;if(typeof i=="bigint")s=u=>BigInt(u);else if(isNaN(i)||!isFinite(i))return En(t);let a="";i<0&&(a="-",i*=s(-1));const r=s(60),c=[i%r];return i<60?c.unshift(0):(i=(i-c[0])/r,c.unshift(i%r),i>=60&&(i=(i-c[0])/r,c.unshift(i))),a+c.map(u=>String(u).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Wb={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})=>sm(t,s),stringify:Fb},Pb={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=>sm(t,!1),stringify:Fb},ou={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(ou.test);if(!i)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,r,c,u,m]=i.map(Number),h=i[7]?Number((i[7]+"00").substr(1,3)):0;let g=Date.UTC(s,a-1,r,c||0,u||0,m||0,h);const v=i[8];if(v&&v!=="Z"){let p=sm(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$/,"")??""},mv=[Jl,Fl,iu,su,Ib,Jb,AC,TC,MC,CC,EC,_C,NC,Ph,ai,tm,em,im,Wb,Pb,ou],gv=new Map([["core",bC],["failsafe",[Jl,Fl,iu]],["json",xC],["yaml11",mv],["yaml-1.1",mv]]),pv={binary:Ph,bool:Fh,float:qb,floatExp:Ub,floatNaN:$b,floatTime:Pb,int:Gb,intHex:Xb,intOct:Yb,intTime:Wb,map:Jl,merge:ai,null:su,omap:tm,pairs:em,seq:Fl,set:im,timestamp:ou},OC={"tag:yaml.org,2002:binary":Ph,"tag:yaml.org,2002:merge":ai,"tag:yaml.org,2002:omap":tm,"tag:yaml.org,2002:pairs":em,"tag:yaml.org,2002:set":im,"tag:yaml.org,2002:timestamp":ou};function Wd(t,i,s){const a=gv.get(i);if(a&&!t)return s&&!a.includes(ai)?a.concat(ai):a.slice();let r=a;if(!r)if(Array.isArray(t))r=[];else{const c=Array.from(gv.keys()).filter(u=>u!=="yaml11").map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown schema "${i}"; use one of ${c} or define customTags array`)}if(Array.isArray(t))for(const c of t)r=r.concat(c);else typeof t=="function"&&(r=t(r.slice()));return s&&(r=r.concat(ai)),r.reduce((c,u)=>{const m=typeof u=="string"?pv[u]:u;if(!m){const h=JSON.stringify(u),g=Object.keys(pv).map(v=>JSON.stringify(v)).join(", ");throw new Error(`Unknown custom tag ${h}; use one of ${g}`)}return c.includes(m)||c.push(m),c},[])}const zC=(t,i)=>t.key<i.key?-1:t.key>i.key?1:0;class ru{constructor({compat:i,customTags:s,merge:a,resolveKnownTags:r,schema:c,sortMapEntries:u,toStringDefaults:m}){this.compat=Array.isArray(i)?Wd(i,"compat"):i?Wd(null,i):null,this.name=typeof c=="string"&&c||"core",this.knownTags=r?OC:{},this.tags=Wd(s,this.name,a),this.toStringOptions=m??null,Object.defineProperty(this,Xi,{value:Jl}),Object.defineProperty(this,Ln,{value:iu}),Object.defineProperty(this,Zl,{value:Fl}),this.sortMapEntries=typeof u=="function"?u:u===!0?zC:null}clone(){const i=Object.create(ru.prototype,Object.getOwnPropertyDescriptors(this));return i.tags=this.tags.slice(),i}}function DC(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=Lb(t,i),{commentString:c}=r.options;if(t.commentBefore){s.length!==1&&s.unshift("");const h=c(t.commentBefore);s.unshift(li(h,""))}let u=!1,m=null;if(t.contents){if(We(t.contents)){if(t.contents.spaceBefore&&a&&s.push(""),t.contents.commentBefore){const v=c(t.contents.commentBefore);s.push(li(v,""))}r.forceBlockIndent=!!t.comment,m=t.contents.comment}const h=m?void 0:()=>u=!0;let g=Gl(t.contents,r,()=>m=null,h);m&&(g+=vs(g,"",c(m))),(g[0]==="|"||g[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${g}`:s.push(g)}else s.push(Gl(t.contents,r));if(t.directives?.docEnd)if(t.comment){const h=c(t.comment);h.includes(`
|
|
69
|
+
`)?(s.push("..."),s.push(li(h,""))):s.push(`... ${h}`)}else s.push("...");else{let h=t.comment;h&&u&&(h=h.replace(/^\n+/,"")),h&&((!u||m)&&s[s.length-1]!==""&&s.push(""),s.push(li(c(h),"")))}return s.join(`
|
|
70
|
+
`)+`
|
|
71
|
+
`}class Wl{constructor(i,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,un,{value:Eh});let r=null;typeof s=="function"||Array.isArray(s)?r=s:a===void 0&&s&&(a=s,s=void 0);const c=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},a);this.options=c;let{version:u}=c;a?._directives?(this.directives=a._directives.atDocument(),this.directives.yaml.explicit&&(u=this.directives.yaml.version)):this.directives=new _t({version:u}),this.setSchema(u,a),this.contents=i===void 0?null:this.createNode(i,r,a)}clone(){const i=Object.create(Wl.prototype,{[un]:{value:Eh}});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){wl(this.contents)&&this.contents.add(i)}addIn(i,s){wl(this.contents)&&this.contents.addIn(i,s)}createAlias(i,s){if(!i.anchor){const a=Mb(this);i.anchor=!s||a.has(s)?Cb(s||"a",a):s}return new Pc(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 N=D=>typeof D=="number"||D instanceof String||D instanceof Number,w=s.filter(N).map(String);w.length>0&&(s=s.concat(w)),r=s}else a===void 0&&s&&(a=s,s=void 0);const{aliasDuplicateObjects:c,anchorPrefix:u,flow:m,keepUndefined:h,onTagObj:g,tag:v}=a??{},{onAnchor:p,setAnchors:y,sourceObjects:S}=aC(this,u||"a"),E={aliasDuplicateObjects:c??!0,keepUndefined:h??!1,onAnchor:p,onTagObj:g,replacer:r,schema:this.schema,sourceObjects:S},_=bo(i,v,E);return m&&Fe(_)&&(_.flow=!0),y(),_}createPair(i,s,a={}){const r=this.createNode(i,null,a),c=this.createNode(s,null,a);return new St(r,c)}delete(i){return wl(this.contents)?this.contents.delete(i):!1}deleteIn(i){return io(i)?this.contents==null?!1:(this.contents=null,!0):wl(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 io(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 io(i)?this.contents!==void 0:Fe(this.contents)?this.contents.hasIn(i):!1}set(i,s){this.contents==null?this.contents=Bc(this.schema,[i],s):wl(this.contents)&&this.contents.set(i,s)}setIn(i,s){io(i)?this.contents=s:this.contents==null?this.contents=Bc(this.schema,Array.from(i),s):wl(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 ru(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:c,reviver:u}={}){const m={anchors:new Map,doc:this,keep:!i,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},h=cn(this.contents,s??"",m);if(typeof c=="function")for(const{count:g,res:v}of m.anchors.values())c(v,g);return typeof u=="function"?Cl(u,{"":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 DC(this,i)}}function wl(t){if(Fe(t))return!0;throw new Error("Expected a YAML collection as document contents")}class lm extends Error{constructor(i,s,a,r){super(),this.name=i,this.code=a,this.message=r,this.pos=s}}class Ss extends lm{constructor(i,s,a){super("YAMLParseError",i,s,a)}}class eS extends lm{constructor(i,s,a){super("YAMLWarning",i,s,a)}}const kc=(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 c=r-1,u=t.substring(i.lineStarts[a-1],i.lineStarts[a]).replace(/[\n\r]+$/,"");if(c>=60&&u.length>80){const m=Math.min(c-39,u.length-79);u="…"+u.substring(m),c-=m-1}if(u.length>80&&(u=u.substring(0,79)+"…"),a>1&&/^ *$/.test(u.substring(0,c))){let m=t.substring(i.lineStarts[a-2],i.lineStarts[a-1]);m.length>80&&(m=m.substring(0,79)+`…
|
|
72
|
+
`),u=m+u}if(/[^ ]/.test(u)){let m=1;const h=s.linePos[1];h?.line===a&&h.col>r&&(m=Math.max(1,Math.min(h.col-r,80-c)));const g=" ".repeat(c)+"^".repeat(m);s.message+=`:
|
|
73
|
+
|
|
74
|
+
${u}
|
|
75
|
+
${g}
|
|
76
|
+
`}};function Xl(t,{flow:i,indicator:s,next:a,offset:r,onError:c,parentIndent:u,startOnNewline:m}){let h=!1,g=m,v=m,p="",y="",S=!1,E=!1,_=null,N=null,w=null,D=null,x=null,T=null,L=null;for(const R of t)switch(E&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&c(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),E=!1),_&&(g&&R.type!=="comment"&&R.type!=="newline"&&c(_,"TAB_AS_INDENT","Tabs are not allowed as indentation"),_=null),R.type){case"space":!i&&(s!=="doc-start"||a?.type!=="flow-collection")&&R.source.includes(" ")&&(_=R),v=!0;break;case"comment":{v||c(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const V=R.source.substring(1)||" ";p?p+=y+V:p=V,y="",g=!1;break}case"newline":g?p?p+=R.source:(!T||s!=="seq-item-ind")&&(h=!0):y+=R.source,g=!0,S=!0,(N||w)&&(D=R),v=!0;break;case"anchor":N&&c(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&c(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),N=R,L??(L=R.offset),g=!1,v=!1,E=!0;break;case"tag":{w&&c(R,"MULTIPLE_TAGS","A node can have at most one tag"),w=R,L??(L=R.offset),g=!1,v=!1,E=!0;break}case s:(N||w)&&c(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),T&&c(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${i??"collection"}`),T=R,g=s==="seq-item-ind"||s==="explicit-key-ind",v=!1;break;case"comma":if(i){x&&c(R,"UNEXPECTED_TOKEN",`Unexpected , in ${i}`),x=R,g=!1,v=!1;break}default:c(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),g=!1,v=!1}const O=t[t.length-1],j=O?O.offset+O.source.length:r;return E&&a&&a.type!=="space"&&a.type!=="newline"&&a.type!=="comma"&&(a.type!=="scalar"||a.source!=="")&&c(a.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),_&&(g&&_.indent<=u||a?.type==="block-map"||a?.type==="block-seq")&&c(_,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:x,found:T,spaceBefore:h,comment:p,hasNewline:S,anchor:N,tag:w,newlineAfterProp:D,end:j,start:L??j}}function So(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(So(i.key)||So(i.value))return!0}return!1;default:return!0}}function Th(t,i,s){if(i?.type==="flow-collection"){const a=i.end[0];a.indent===t&&(a.source==="]"||a.source==="}")&&So(i)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function tS(t,i,s){const{uniqueKeys:a}=t.options;if(a===!1)return!1;const r=typeof a=="function"?a:(c,u)=>c===u||Ye(c)&&Ye(u)&&c.value===u.value;return i.some(c=>r(c.key,s))}const yv="All mapping items must start at the same column";function LC({composeNode:t,composeEmptyNode:i},s,a,r,c){const u=c?.nodeClass??Zt,m=new u(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:S,value:E}=v,_=Xl(p,{indicator:"explicit-key-ind",next:y??S?.[0],offset:h,onError:r,parentIndent:a.indent,startOnNewline:!0}),N=!_.found;if(N){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",yv)),!_.anchor&&!_.tag&&!S){g=_.end,_.comment&&(m.comment?m.comment+=`
|
|
78
|
+
`+_.comment:m.comment=_.comment);continue}(_.newlineAfterProp||So(y))&&r(y??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else _.found?.indent!==a.indent&&r(h,"BAD_INDENT",yv);s.atKey=!0;const w=_.end,D=y?t(s,y,_,r):i(s,w,p,null,_,r);s.schema.compat&&Th(a.indent,y,r),s.atKey=!1,tS(s,m.items,D)&&r(w,"DUPLICATE_KEY","Map keys must be unique");const x=Xl(S??[],{indicator:"map-value-ind",next:E,offset:D.range[2],onError:r,parentIndent:a.indent,startOnNewline:!y||y.type==="block-scalar"});if(h=x.end,x.found){N&&(E?.type==="block-map"&&!x.hasNewline&&r(h,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&_.start<x.found.offset-1024&&r(D.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const T=E?t(s,E,x,r):i(s,h,S,null,x,r);s.schema.compat&&Th(a.indent,E,r),h=T.range[2];const L=new St(D,T);s.options.keepSourceTokens&&(L.srcToken=v),m.items.push(L)}else{N&&r(D.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),x.comment&&(D.comment?D.comment+=`
|
|
79
|
+
`+x.comment:D.comment=x.comment);const T=new St(D);s.options.keepSourceTokens&&(T.srcToken=v),m.items.push(T)}}return g&&g<h&&r(g,"IMPOSSIBLE","Map comment with trailing content"),m.range=[a.offset,h,g??h],m}function RC({composeNode:t,composeEmptyNode:i},s,a,r,c){const u=c?.nodeClass??Ki,m=new u(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=Xl(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 S=p?t(s,p,y,r):i(s,y.end,v,null,y,r);s.schema.compat&&Th(a.indent,p,r),h=S.range[2],m.items.push(S)}return m.range=[a.offset,h,g??h],m}function zo(t,i,s,a){let r="";if(t){let c=!1,u="";for(const m of t){const{source:h,type:g}=m;switch(g){case"space":c=!0;break;case"comment":{s&&!c&&a(m,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const v=h.substring(1)||" ";r?r+=u+v:r=v,u="";break}case"newline":r&&(u+=h),c=!0;break;default:a(m,"UNEXPECTED_TOKEN",`Unexpected ${g} at node end`)}i+=h.length}}return{comment:r,offset:i}}const Pd="Block collections are not allowed within flow collections",eh=t=>t&&(t.type==="block-map"||t.type==="block-seq");function BC({composeNode:t,composeEmptyNode:i},s,a,r,c){const u=a.start.source==="{",m=u?"flow map":"flow sequence",h=c?.nodeClass??(u?Zt:Ki),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 N=0;N<a.items.length;++N){const w=a.items[N],{start:D,key:x,sep:T,value:L}=w,O=Xl(D,{flow:m,indicator:"explicit-key-ind",next:x??T?.[0],offset:p,onError:r,parentIndent:a.indent,startOnNewline:!1});if(!O.found){if(!O.anchor&&!O.tag&&!T&&!L){N===0&&O.comma?r(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`):N<a.items.length-1&&r(O.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${m}`),O.comment&&(g.comment?g.comment+=`
|
|
80
|
+
`+O.comment:g.comment=O.comment),p=O.end;continue}!u&&s.options.strict&&So(x)&&r(x,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(N===0)O.comma&&r(O.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`);else if(O.comma||r(O.start,"MISSING_CHAR",`Missing , between ${m} items`),O.comment){let j="";e:for(const R of D)switch(R.type){case"comma":case"space":break;case"comment":j=R.source.substring(1);break e;default:break e}if(j){let R=g.items[g.items.length-1];Ie(R)&&(R=R.value??R.key),R.comment?R.comment+=`
|
|
81
|
+
`+j:R.comment=j,O.comment=O.comment.substring(j.length+1)}}if(!u&&!T&&!O.found){const j=L?t(s,L,O,r):i(s,O.end,T,null,O,r);g.items.push(j),p=j.range[2],eh(L)&&r(j.range,"BLOCK_IN_FLOW",Pd)}else{s.atKey=!0;const j=O.end,R=x?t(s,x,O,r):i(s,j,D,null,O,r);eh(x)&&r(R.range,"BLOCK_IN_FLOW",Pd),s.atKey=!1;const V=Xl(T??[],{flow:m,indicator:"map-value-ind",next:L,offset:R.range[2],onError:r,parentIndent:a.indent,startOnNewline:!1});if(V.found){if(!u&&!O.found&&s.options.strict){if(T)for(const Z of T){if(Z===V.found)break;if(Z.type==="newline"){r(Z,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}O.start<V.found.offset-1024&&r(V.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else L&&("source"in L&&L.source?.[0]===":"?r(L,"MISSING_CHAR",`Missing space after : in ${m}`):r(V.start,"MISSING_CHAR",`Missing , or : between ${m} items`));const le=L?t(s,L,V,r):V.found?i(s,V.end,T,null,V,r):null;le?eh(L)&&r(le.range,"BLOCK_IN_FLOW",Pd):V.comment&&(R.comment?R.comment+=`
|
|
82
|
+
`+V.comment:R.comment=V.comment);const K=new St(R,le);if(s.options.keepSourceTokens&&(K.srcToken=w),u){const Z=g;tS(s,Z.items,R)&&r(j,"DUPLICATE_KEY","Map keys must be unique"),Z.items.push(K)}else{const Z=new Zt(s.schema);Z.flow=!0,Z.items.push(K);const oe=(le??R).range;Z.range=[R.range[0],oe[1],oe[2]],g.items.push(Z)}p=le?le.range[2]:V.end}}const y=u?"}":"]",[S,...E]=a.end;let _=p;if(S?.source===y)_=S.offset+S.source.length;else{const N=m[0].toUpperCase()+m.substring(1),w=v?`${N} must end with a ${y}`:`${N} in block collection must be sufficiently indented and end with a ${y}`;r(p,v?"MISSING_CHAR":"BAD_INDENT",w),S&&S.source.length!==1&&E.unshift(S)}if(E.length>0){const N=zo(E,_,s.options.strict,r);N.comment&&(g.comment?g.comment+=`
|
|
83
|
+
`+N.comment:g.comment=N.comment),g.range=[a.offset,_,N.offset]}else g.range=[a.offset,_,_];return g}function th(t,i,s,a,r,c){const u=s.type==="block-map"?LC(t,i,s,a,c):s.type==="block-seq"?RC(t,i,s,a,c):BC(t,i,s,a,c),m=u.constructor;return r==="!"||r===m.tagName?(u.tag=m.tagName,u):(r&&(u.tag=r),u)}function jC(t,i,s,a,r){const c=a.tag,u=c?i.directives.tagName(c.source,y=>r(c,"TAG_RESOLVE_FAILED",y)):null;if(s.type==="block-seq"){const{anchor:y,newlineAfterProp:S}=a,E=y&&c?y.offset>c.offset?y:c:y??c;E&&(!S||S.offset<E.offset)&&r(E,"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(!c||!u||u==="!"||u===Zt.tagName&&m==="map"||u===Ki.tagName&&m==="seq")return th(t,i,s,r,u);let h=i.schema.tags.find(y=>y.tag===u&&y.collection===m);if(!h){const y=i.schema.knownTags[u];if(y?.collection===m)i.schema.tags.push(Object.assign({},y,{default:!1})),h=y;else return y?r(c,"BAD_COLLECTION_TYPE",`${y.tag} used for ${m} collection, but expects ${y.collection??"scalar"}`,!0):r(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${u}`,!0),th(t,i,s,r,u)}const g=th(t,i,s,r,u,h),v=h.resolve?.(g,y=>r(c,"TAG_RESOLVE_FAILED",y),i.options)??g,p=We(v)?v:new xe(v);return p.range=g.range,p.tag=u,h?.format&&(p.format=h.format),p}function nS(t,i,s){const a=i.offset,r=kC(i,t.options.strict,s);if(!r)return{value:"",type:null,comment:"",range:[a,a,a]};const c=r.mode===">"?xe.BLOCK_FOLDED:xe.BLOCK_LITERAL,u=i.source?HC(i.source):[];let m=u.length;for(let _=u.length-1;_>=0;--_){const N=u[_][1];if(N===""||N==="\r")m=_;else break}if(m===0){const _=r.chomp==="+"&&u.length>0?`
|
|
84
|
+
`.repeat(Math.max(1,u.length-1)):"";let N=a+r.length;return i.source&&(N+=i.source.length),{value:_,type:c,comment:r.comment,range:[a,N,N]}}let h=i.indent+r.indent,g=i.offset+r.length,v=0;for(let _=0;_<m;++_){const[N,w]=u[_];if(w===""||w==="\r")r.indent===0&&N.length>h&&(h=N.length);else{N.length<h&&s(g+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(h=N.length),v=_,h===0&&!t.atRoot&&s(g,"BAD_INDENT","Block scalar values in collections must be indented");break}g+=N.length+w.length+1}for(let _=u.length-1;_>=m;--_)u[_][0].length>h&&(m=_+1);let p="",y="",S=!1;for(let _=0;_<v;++_)p+=u[_][0].slice(h)+`
|
|
85
|
+
`;for(let _=v;_<m;++_){let[N,w]=u[_];g+=N.length+w.length+1;const D=w[w.length-1]==="\r";if(D&&(w=w.slice(0,-1)),w&&N.length<h){const T=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;s(g-w.length-(D?2:1),"BAD_INDENT",T),N=""}c===xe.BLOCK_LITERAL?(p+=y+N.slice(h)+w,y=`
|
|
86
|
+
`):N.length>h||w[0]===" "?(y===" "?y=`
|
|
87
|
+
`:!S&&y===`
|
|
88
|
+
`&&(y=`
|
|
89
|
+
|
|
90
|
+
`),p+=y+N.slice(h)+w,y=`
|
|
91
|
+
`,S=!0):w===""?y===`
|
|
92
|
+
`?p+=`
|
|
93
|
+
`:y=`
|
|
94
|
+
`:(p+=y+w,y=" ",S=!1)}switch(r.chomp){case"-":break;case"+":for(let _=m;_<u.length;++_)p+=`
|
|
95
|
+
`+u[_][0].slice(h);p[p.length-1]!==`
|
|
96
|
+
`&&(p+=`
|
|
97
|
+
`);break;default:p+=`
|
|
98
|
+
`}const E=a+r.length+i.source.length;return{value:p,type:c,comment:r.comment,range:[a,E,E]}}function kC({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],c=r[0];let u=0,m="",h=-1;for(let y=1;y<r.length;++y){const S=r[y];if(!m&&(S==="-"||S==="+"))m=S;else{const E=Number(S);!u&&E?u=E: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 S=i[y];switch(S.type){case"space":g=!0;case"newline":p+=S.source.length;break;case"comment":s&&!g&&a(S,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),p+=S.source.length,v=S.source.substring(1);break;case"error":a(S,"UNEXPECTED_TOKEN",S.message),p+=S.source.length;break;default:{const E=`Unexpected token in block scalar header: ${S.type}`;a(S,"UNEXPECTED_TOKEN",E);const _=S.source;_&&typeof _=="string"&&(p+=_.length)}}}return{mode:c,indent:u,chomp:m,comment:v,length:p}}function HC(t){const i=t.split(/\n( *)/),s=i[0],a=s.match(/^( *)/),c=[a?.[1]?[a[1],s.slice(a[1].length)]:["",s]];for(let u=1;u<i.length;u+=2)c.push([i[u],i[u+1]]);return c}function iS(t,i,s){const{offset:a,type:r,source:c,end:u}=t;let m,h;const g=(y,S,E)=>s(a+y,S,E);switch(r){case"scalar":m=xe.PLAIN,h=$C(c,g);break;case"single-quoted-scalar":m=xe.QUOTE_SINGLE,h=UC(c,g);break;case"double-quoted-scalar":m=xe.QUOTE_DOUBLE,h=qC(c,g);break;default:return s(t,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[a,a+c.length,a+c.length]}}const v=a+c.length,p=zo(u,v,i,s);return{value:h,type:m,comment:p.comment,range:[a,v,p.offset]}}function $C(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}`),sS(t)}function UC(t,i){return(t[t.length-1]!=="'"||t.length===1)&&i(t.length,"MISSING_CHAR","Missing closing 'quote"),sS(t.slice(1,-1)).replace(/''/g,"'")}function sS(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],c=" ",u=i.lastIndex;for(s.lastIndex=u;a=s.exec(t);)a[1]===""?c===`
|
|
101
|
+
`?r+=c:c=`
|
|
102
|
+
`:(r+=c+a[1],c=" "),u=s.lastIndex;const m=/[ \t]*(.*)/sy;return m.lastIndex=u,a=m.exec(t),r+c+(a?.[1]??"")}function qC(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:c,offset:u}=VC(t,a);s+=c,a=u}else if(r==="\\"){let c=t[++a];const u=YC[c];if(u)s+=u;else if(c===`
|
|
105
|
+
`)for(c=t[a+1];c===" "||c===" ";)c=t[++a+1];else if(c==="\r"&&t[a+1]===`
|
|
106
|
+
`)for(c=t[++a+1];c===" "||c===" ";)c=t[++a+1];else if(c==="x"||c==="u"||c==="U"){const m=c==="x"?2:c==="u"?4:8;s+=GC(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 c=a;let u=t[a+1];for(;u===" "||u===" ";)u=t[++a+1];u!==`
|
|
107
|
+
`&&!(u==="\r"&&t[a+2]===`
|
|
108
|
+
`)&&(s+=a>c?t.slice(c,a+1):r)}else s+=r}return(t[t.length-1]!=='"'||t.length===1)&&i(t.length,"MISSING_CHAR",'Missing closing "quote'),s}function VC(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 YC={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
113
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function GC(t,i,s,a){const r=t.substr(i,s),u=r.length===s&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;try{return String.fromCodePoint(u)}catch{const m=t.substr(i-2,s+2);return a(i-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${m}`),m}}function lS(t,i,s,a){const{value:r,type:c,comment:u,range:m}=i.type==="block-scalar"?nS(t,i,a):iS(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[Ln]:h?g=XC(t.schema,r,h,s,a):i.type==="scalar"?g=KC(t,r,i,a):g=t.schema[Ln];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,c&&(v.type=c),h&&(v.tag=h),g.format&&(v.format=g.format),u&&(v.comment=u),v}function XC(t,i,s,a,r){if(s==="!")return t[Ln];const c=[];for(const m of t.tags)if(!m.collection&&m.tag===s)if(m.default&&m.test)c.push(m);else return m;for(const m of c)if(m.test?.test(i))return m;const u=t.knownTags[s];return u&&!u.collection?(t.tags.push(Object.assign({},u,{default:!1,test:void 0})),u):(r(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),t[Ln])}function KC({atKey:t,directives:i,schema:s},a,r,c){const u=s.tags.find(m=>(m.default===!0||t&&m.default==="key")&&m.test?.test(a))||s[Ln];if(s.compat){const m=s.compat.find(h=>h.default&&h.test?.test(a))??s[Ln];if(u.tag!==m.tag){const h=i.tagString(u.tag),g=i.tagString(m.tag),v=`Value may be parsed as either ${h} or ${g}`;c(r,"TAG_RESOLVE_FAILED",v,!0)}}return u}function ZC(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 QC={composeNode:aS,composeEmptyNode:am};function aS(t,i,s,a){const r=t.atKey,{spaceBefore:c,comment:u,anchor:m,tag:h}=s;let g,v=!0;switch(i.type){case"alias":g=IC(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=lS(t,i,h,a),m&&(g.anchor=m.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{g=jC(QC,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=am(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"),c&&(g.spaceBefore=!0),u&&(i.type==="scalar"&&i.source===""?g.comment=u:g.commentBefore=u),t.options.keepSourceTokens&&v&&(g.srcToken=i),g}function am(t,i,s,a,{spaceBefore:r,comment:c,anchor:u,tag:m,end:h},g){const v={type:"scalar",offset:ZC(i,s,a),indent:-1,source:""},p=lS(t,v,m,g);return u&&(p.anchor=u.source.substring(1),p.anchor===""&&g(u,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(p.spaceBefore=!0),c&&(p.comment=c,p.range[2]=h),p}function IC({options:t},{offset:i,source:s,end:a},r){const c=new Pc(s.substring(1));c.source===""&&r(i,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&r(i+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const u=i+s.length,m=zo(a,u,t.strict,r);return c.range=[i,u,m.offset],m.comment&&(c.comment=m.comment),c}function JC(t,i,{offset:s,start:a,value:r,end:c},u){const m=Object.assign({_directives:i},t),h=new Wl(void 0,m),g={atKey:!1,atRoot:!0,directives:h.directives,options:h.options,schema:h.schema},v=Xl(a,{indicator:"doc-start",next:r??c?.[0],offset:s,onError:u,parentIndent:0,startOnNewline:!0});v.found&&(h.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!v.hasNewline&&u(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),h.contents=r?aS(g,r,v,u):am(g,v.end,a,null,v,u);const p=h.contents.range[2],y=zo(c,p,!1,u);return y.comment&&(h.comment=y.comment),h.range=[s,p,y.offset],h}function eo(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 vv(t){let i="",s=!1,a=!1;for(let r=0;r<t.length;++r){const c=t[r];switch(c[0]){case"#":i+=(i===""?"":a?`
|
|
114
|
+
|
|
115
|
+
`:`
|
|
116
|
+
`)+(c.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 om{constructor(i={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,r,c)=>{const u=eo(s);c?this.warnings.push(new eS(u,a,r)):this.errors.push(new Ss(u,a,r))},this.directives=new _t({version:i.version||"1.2"}),this.options=i}decorate(i,s){const{comment:a,afterEmptyLine:r}=vv(this.prelude);if(a){const c=i.contents;if(s)i.comment=i.comment?`${i.comment}
|
|
117
|
+
${a}`:a;else if(r||i.directives.docStart||!c)i.commentBefore=a;else if(Fe(c)&&!c.flow&&c.items.length>0){let u=c.items[0];Ie(u)&&(u=u.key);const m=u.commentBefore;u.commentBefore=m?`${a}
|
|
118
|
+
${m}`:a}else{const u=c.commentBefore;c.commentBefore=u?`${a}
|
|
119
|
+
${u}`:a}}if(s){for(let c=0;c<this.errors.length;++c)i.errors.push(this.errors[c]);for(let c=0;c<this.warnings.length;++c)i.warnings.push(this.warnings[c])}else i.errors=this.errors,i.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:vv(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 c=eo(i);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,r)}),this.prelude.push(i.source),this.atDirectives=!0;break;case"document":{const s=JC(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 Ss(eo(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 Ss(eo(i),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=zo(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 Ss(eo(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 Wl(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 FC(t,i=!0,s){if(t){const a=(r,c,u)=>{const m=typeof r=="number"?r:Array.isArray(r)?r[0]:r.offset;if(s)s(m,c,u);else throw new Ss([m,m+1],c,u)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return iS(t,i,a);case"block-scalar":return nS({options:{strict:i}},t,a)}}return null}function WC(t,i){const{implicitKey:s=!1,indent:a,inFlow:r=!1,offset:c=-1,type:u="PLAIN"}=i,m=Co({type:u,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:c,indent:a,source:v}];return oS(y,h)||y.push({type:"newline",offset:-1,indent:a,source:`
|
|
124
|
+
`}),{type:"block-scalar",offset:c,indent:a,props:y,source:p}}case'"':return{type:"double-quoted-scalar",offset:c,indent:a,source:m,end:h};case"'":return{type:"single-quoted-scalar",offset:c,indent:a,source:m,end:h};default:return{type:"scalar",offset:c,indent:a,source:m,end:h}}}function PC(t,i,s={}){let{afterKey:a=!1,implicitKey:r=!1,inFlow:c=!1,type:u}=s,m="indent"in t?t.indent:null;if(a&&typeof m=="number"&&(m+=2),!u)switch(t.type){case"single-quoted-scalar":u="QUOTE_SINGLE";break;case"double-quoted-scalar":u="QUOTE_DOUBLE";break;case"block-scalar":{const g=t.props[0];if(g.type!=="block-scalar-header")throw new Error("Invalid block scalar header");u=g.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:u="PLAIN"}const h=Co({type:u,value:i},{implicitKey:r||m===null,indent:m!==null&&m>0?" ".repeat(m):"",inFlow:c,options:{blockQuote:!0,lineWidth:-1}});switch(h[0]){case"|":case">":eO(t,h);break;case'"':nh(t,h,"double-quoted-scalar");break;case"'":nh(t,h,"single-quoted-scalar");break;default:nh(t,h,"scalar")}}function eO(t,i){const s=i.indexOf(`
|
|
125
|
+
`),a=i.substring(0,s),r=i.substring(s+1)+`
|
|
126
|
+
`;if(t.type==="block-scalar"){const c=t.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");c.source=a,t.source=r}else{const{offset:c}=t,u="indent"in t?t.indent:-1,m=[{type:"block-scalar-header",offset:c,indent:u,source:a}];oS(m,"end"in t?t.end:void 0)||m.push({type:"newline",offset:-1,indent:u,source:`
|
|
127
|
+
`});for(const h of Object.keys(t))h!=="type"&&h!=="offset"&&delete t[h];Object.assign(t,{type:"block-scalar",indent:u,props:m,source:r})}}function oS(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 nh(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 c of a)c.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(c=>c.type==="space"||c.type==="comment"||c.type==="newline"):[];for(const c of Object.keys(t))c!=="type"&&c!=="offset"&&delete t[c];Object.assign(t,{type:s,indent:a,source:i,end:r})}}}const tO=t=>"type"in t?Hc(t):_c(t);function Hc(t){switch(t.type){case"block-scalar":{let i="";for(const s of t.props)i+=Hc(s);return i+t.source}case"block-map":case"block-seq":{let i="";for(const s of t.items)i+=_c(s);return i}case"flow-collection":{let i=t.start.source;for(const s of t.items)i+=_c(s);for(const s of t.end)i+=s.source;return i}case"document":{let i=_c(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 _c({start:t,key:i,sep:s,value:a}){let r="";for(const c of t)r+=c.source;if(i&&(r+=Hc(i)),s)for(const c of s)r+=c.source;return a&&(r+=Hc(a)),r}const Mh=Symbol("break visit"),nO=Symbol("skip children"),rS=Symbol("remove item");function Ms(t,i){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),cS(Object.freeze([]),t,i)}Ms.BREAK=Mh;Ms.SKIP=nO;Ms.REMOVE=rS;Ms.itemAtPath=(t,i)=>{let s=t;for(const[a,r]of i){const c=s?.[a];if(c&&"items"in c)s=c.items[r];else return}return s};Ms.parentCollection=(t,i)=>{const s=Ms.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 cS(t,i,s){let a=s(i,t);if(typeof a=="symbol")return a;for(const r of["key","value"]){const c=i[r];if(c&&"items"in c){for(let u=0;u<c.items.length;++u){const m=cS(Object.freeze(t.concat([[r,u]])),c.items[u],s);if(typeof m=="number")u=m-1;else{if(m===Mh)return Mh;m===rS&&(c.items.splice(u,1),u-=1)}}typeof a=="function"&&r==="key"&&(a=a(i,t))}}return typeof a=="function"?a(i,t):a}const cu="\uFEFF",uu="",fu="",wo="",iO=t=>!!t&&"items"in t,sO=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function lO(t){switch(t){case cu:return"<BOM>";case uu:return"<DOC>";case fu:return"<FLOW_END>";case wo:return"<SCALAR>";default:return JSON.stringify(t)}}function uS(t){switch(t){case cu:return"byte-order-mark";case uu:return"doc-mode";case fu:return"flow-error-end";case wo: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 aO=Object.freeze(Object.defineProperty({__proto__:null,BOM:cu,DOCUMENT:uu,FLOW_END:fu,SCALAR:wo,createScalarToken:WC,isCollection:iO,isScalar:sO,prettyToken:lO,resolveAsScalar:FC,setScalarValue:PC,stringify:tO,tokenType:uS,visit:Ms},Symbol.toStringTag,{value:"Module"}));function gn(t){switch(t){case void 0:case" ":case`
|
|
131
|
+
`:case"\r":case" ":return!0;default:return!1}}const bv=new Set("0123456789ABCDEFabcdef"),oO=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),dc=new Set(",[]{}"),rO=new Set(` ,[]{}
|
|
132
|
+
\r `),ih=t=>!t||rO.has(t);class fS{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]===cu&&(yield*this.pushCount(1),i=i.substring(1)),i[0]==="%"){let s=i.length,a=i.indexOf("#");for(;a!==-1;){const c=i[a-1];if(c===" "||c===" "){s=a-1;break}else a=i.indexOf("#",a+1)}for(;;){const c=i[s-1];if(c===" "||c===" ")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 uu,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(ih),"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 fu,yield*this.parseLineStart();let c=0;for(;r[c]===",";)c+=yield*this.pushCount(1),c+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(c+=yield*this.pushIndicators(),r[c]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-c),"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(ih),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const u=this.charAt(1);if(this.flowKey||gn(u)||u===",")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 c=0;for(;this.buffer[s-1-c]==="\\";)c+=1;if(c%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 c=this.continueScalar(r+1);if(c===-1)break;r=a.indexOf(`
|
|
139
|
+
`,c)}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 c=this.pos;a=this.buffer[c];++c)switch(a){case" ":s+=1;break;case`
|
|
140
|
+
`:i=c,s=0;break;case"\r":{const u=this.buffer[c+1];if(!u&&!this.atEnd)return this.setNext("block-scalar");if(u===`
|
|
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 c=this.continueScalar(i+1);if(c===-1)break;i=this.buffer.indexOf(`
|
|
142
|
+
`,c)}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 c=i-1,u=this.buffer[c];u==="\r"&&(u=this.buffer[--c]);const m=c;for(;u===" ";)u=this.buffer[--c];if(u===`
|
|
144
|
+
`&&c>=this.pos&&c+1+s>m)i=c;else break}while(!0);return yield wo,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 c=this.buffer[a+1];if(gn(c)||i&&dc.has(c))break;s=a}else if(gn(r)){let c=this.buffer[a+1];if(r==="\r"&&(c===`
|
|
145
|
+
`?(a+=1,r=`
|
|
146
|
+
`,c=this.buffer[a+1]):s=a),c==="#"||i&&dc.has(c))break;if(r===`
|
|
147
|
+
`){const u=this.continueScalar(a+1);if(u===-1)break;a=Math.max(a,u-2)}}else{if(i&&dc.has(r))break;s=a}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield wo,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(ih),i+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const s=this.flowLevel>0,a=this.charAt(1);if(gn(a)||s&&dc.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(oO.has(s))s=this.buffer[++i];else if(s==="%"&&bv.has(this.buffer[i+1])&&bv.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 dS{constructor(){this.lineStarts=[],this.addNewLine=i=>this.lineStarts.push(i),this.linePos=i=>{let s=0,a=this.lineStarts.length;for(;s<a;){const c=s+a>>1;this.lineStarts[c]<i?s=c+1:a=c}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 Vi(t,i){for(let s=0;s<t.length;++s)if(t[s].type===i)return!0;return!1}function Sv(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 hS(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 hc(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 xl(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 $c(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 wv(t){if(t.start.type==="flow-seq-start")for(const i of t.items)i.sep&&!i.value&&!Vi(i.start,"explicit-key-ind")&&!Vi(i.sep,"map-value-ind")&&(i.key&&(i.value=i.key),delete i.key,hS(i.value)?i.value.end?$c(i.value.end,i.sep):i.value.end=i.sep:$c(i.start,i.sep),delete i.sep)}class rm{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 fS,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=uS(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"&&wv(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&&Sv(r.start)===-1&&(s.indent===0||r.start.every(c=>c.type!=="comment"||c.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":{Sv(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=hc(this.peek(2)),a=xl(s);let r;i.end?(r=i.end,r.push(this.sourceToken),delete i.end):r=[this.sourceToken];const c={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]=c}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)){$c(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 c=[];if(r&&s.sep&&!s.value){const u=[];for(let m=0;m<s.sep.length;++m){const h=s.sep[m];switch(h.type){case"newline":u.push(m);break;case"space":break;case"comment":h.indent>i.indent&&(u.length=0);break;default:u.length=0}}u.length>=2&&(c=s.sep.splice(u[1]))}switch(this.type){case"anchor":case"tag":r||s.value?(c.push(this.sourceToken),i.items.push({start:c}),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?(c.push(this.sourceToken),i.items.push({start:c,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(Vi(s.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(hS(s.key)&&!Vi(s.sep,"newline")){const u=xl(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:u,key:m,sep:h}]})}else c.length>0?s.sep=s.sep.concat(c,this.sourceToken):s.sep.push(this.sourceToken);else if(Vi(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const u=xl(s.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:u,key:null,sep:[this.sourceToken]}]})}else s.sep?s.value||r?i.items.push({start:c,key:null,sep:[this.sourceToken]}):Vi(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 u=this.flowScalar(this.type);r||s.value?(i.items.push({start:c,key:u,sep:[]}),this.onKeyLine=!0):s.sep?this.stack.push(u):(Object.assign(s,{key:u,sep:[]}),this.onKeyLine=!0);return}default:{const u=this.startBlockValue(i);if(u){if(u.type==="block-seq"){if(!s.explicitKey&&s.sep&&!Vi(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:c});this.stack.push(u);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)){$c(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||Vi(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=hc(a),c=xl(r);wv(i);const u=i.end.splice(1,i.end.length);u.push(this.sourceToken);const m={type:"block-map",offset:i.offset,indent:i.indent,items:[{start:c,key:i,sep:u}]};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=hc(i),a=xl(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=hc(i),a=xl(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 mS(t){const i=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||i&&new dS||null,prettyErrors:i}}function cO(t,i={}){const{lineCounter:s,prettyErrors:a}=mS(i),r=new rm(s?.addNewLine),c=new om(i),u=Array.from(c.compose(r.parse(t)));if(a&&s)for(const m of u)m.errors.forEach(kc(t,s)),m.warnings.forEach(kc(t,s));return u.length>0?u:Object.assign([],{empty:!0},c.streamInfo())}function gS(t,i={}){const{lineCounter:s,prettyErrors:a}=mS(i),r=new rm(s?.addNewLine),c=new om(i);let u=null;for(const m of c.compose(r.parse(t),!0,t.length))if(!u)u=m;else if(u.options.logLevel!=="silent"){u.errors.push(new Ss(m.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return a&&s&&(u.errors.forEach(kc(t,s)),u.warnings.forEach(kc(t,s))),u}function uO(t,i,s){let a;typeof i=="function"?a=i:s===void 0&&i&&typeof i=="object"&&(s=i);const r=gS(t,s);if(!r)return null;if(r.warnings.forEach(c=>Rb(r.options.logLevel,c)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:a},s))}function fO(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 Os(t)&&!a?t.toString(s):new Wl(t,a,s).toString(s)}const du=Object.freeze(Object.defineProperty({__proto__:null,Alias:Pc,CST:aO,Composer:om,Document:Wl,Lexer:fS,LineCounter:dS,Pair:St,Parser:rm,Scalar:xe,Schema:ru,YAMLError:lm,YAMLMap:Zt,YAMLParseError:Ss,YAMLSeq:Ki,YAMLWarning:eS,isAlias:Cs,isCollection:Fe,isDocument:Os,isMap:Ql,isNode:We,isPair:Ie,isScalar:Ye,isSeq:Il,parse:uO,parseAllDocuments:cO,parseDocument:gS,stringify:fO,visit:zs,visitAsync:Wc},Symbol.toStringTag,{value:"Module"}));function Zi(t){return t.normalize("NFKC").replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").toLowerCase()||"unnamed"}function xv(t){return`story_${Zi(t).replaceAll("-","_")}`}function dO(t){return`slc_${Zi(t).replaceAll("-","_")}`}function hO(t){return`scr_${Zi(t).replaceAll("-","_")}`}function mO(t){return`cmd_${Zi(t).replaceAll("-","_")}`}function gO(t){return`qry_${Zi(t).replaceAll("-","_")}`}function sh(t){return`evt_${Zi(t).replaceAll("-","_")}`}function pO(t,i,s){const a=s?Zi(s):`case-${i+1}`;return`gwt_${Zi(t).replaceAll("-","_")}_${a.replaceAll("-","_")}`}function El(t,i,s){return`${t}:${i}->${s}`}function oo(t){return t.replaceAll("\\","/").replace(/^\/+/,"")}function pS(t,i=""){const s=oo(t).split("/").at(-1)??t;return i&&s.endsWith(i)?s.slice(0,-i.length):s}function jl(t){return Array.isArray(t)?t.filter(i=>typeof i=="string"):[]}function yO(t,i){const s=du.parse(i),a=s?.events&&typeof s.events=="object"?s.events:s??{};return Object.entries(a).map(([r,c])=>({name:r,fields:typeof c?.fields=="string"?c.fields:void 0,description:typeof c?.description=="string"?c.description:void 0,sourcePath:t}))}function vO(t,i){const s=du.parse(i);return{name:typeof s?.name=="string"?s.name:pS(t,".yaml"),description:typeof s?.description=="string"?s.description:"",path:t,slices:jl(s?.slices).map(oo)}}function bO(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:jl(i.produces)})):[]}function SO(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:jl(i.from_events)})):[]}function wO(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 xO(t){return{type:t?.type==="system"?"system":"user",name:typeof t?.name=="string"?t.name:void 0,actors:jl(t?.actors),reads:jl(t?.reads),executes:jl(t?.executes)}}function EO(t,i,s){const a=du.parse(i);return{title:typeof a?.slice=="string"?a.slice:pS(t),path:t,storyName:s.get(t),screen:xO(a?.screen),commands:bO(a?.commands),queries:SO(a?.queries),gwt:wO(a?.gwt),raw:i}}function _O(t){const i=[],s=[],a=new Map,r=new Map;for(const c of t.stories){const u=xv(c.path);r.set(c.name,u),i.push({id:u,type:"story",label:c.name,sourcePath:c.path,description:c.description})}for(const c of t.events){const u=sh(c.name);a.set(c.name,u),i.push({id:u,type:"event",label:c.name,sourceName:c.name,sourcePath:c.sourcePath,fields:c.fields,description:c.description})}for(const c of t.slices){const u=dO(c.path),m=hO(c.path),h=c.screen.type==="system"?"processor":"screen";if(i.push({id:u,type:"slice",label:c.title,storyName:c.storyName,sliceTitle:c.title,sourcePath:c.path,raw:c.raw}),c.storyName){const g=r.get(c.storyName)??xv(c.storyName);s.push({id:El("story-slice",g,u),kind:"story-slice",source:g,target:u})}i.push({id:m,type:h,label:c.screen.name??(c.screen.type==="system"?"Processor":"Screen"),storyName:c.storyName,sliceTitle:c.title,sourcePath:c.path,actors:c.screen.actors,screenType:c.screen.type,raw:c.raw}),s.push({id:El("slice-screen",u,m),kind:"slice-screen",source:u,target:m});for(const g of c.queries){const v=gO(g.name);i.push({id:v,type:"query",label:g.name,storyName:c.storyName,sliceTitle:c.title,sourceName:g.name,sourcePath:c.path,fields:g.fields,raw:c.raw}),c.screen.reads.includes(g.name)&&s.push({id:El("query-screen",v,m),kind:"query-screen",source:v,target:m});for(const p of g.fromEvents){const y=a.get(p)??sh(p);s.push({id:El("event-query",y,v),kind:"event-query",source:y,target:v,label:p})}}for(const g of c.commands){const v=mO(g.name);i.push({id:v,type:"command",label:g.name,storyName:c.storyName,sliceTitle:c.title,sourceName:g.name,sourcePath:c.path,fields:g.fields,raw:c.raw}),c.screen.executes.includes(g.name)&&s.push({id:El("screen-command",m,v),kind:"screen-command",source:m,target:v});for(const p of g.produces){const y=a.get(p)??sh(p);s.push({id:El("command-event",v,y),kind:"command-event",source:v,target:y,label:p})}}c.gwt.forEach((g,v)=>{i.push({id:pO(c.path,v,g.name),type:"gwt",label:g.name??`Case ${v+1}`,storyName:c.storyName,sliceTitle:c.title,sourceName:g.name,sourcePath:c.path,description:g.description,given:g.given,when:g.when,then:g.then,raw:c.raw})})}return{nodes:i,edges:s}}function NO(t,i={}){const s=new Map(t.map(T=>[oo(T.path),T.content])),a=s.get(".event-modeling/config.yaml"),r=a?du.parse(a):null,c=r?.paths?.event_model_dir??"event-model",u=r?.paths?.features_dir??"event-model/features",m=r?.paths?.slice_extension??".slice.yaml",h=r?.paths?.events_file??`${c}/events.yaml`,g=r?.paths?.stories_dir??`${c}/stories`,v=s.get(h);if(!v)throw new Error(`Missing events file: ${h}`);const p=yO(h,v),y=[...s.entries()].filter(([T])=>T.startsWith(`${g}/`)&&T.endsWith(".yaml")).sort(([T],[L])=>T.localeCompare(L)).map(([T,L])=>vO(T,L)),S=new Map;for(const T of y)for(const L of T.slices)S.set(oo(L),T.name);const E=y.flatMap(T=>T.slices.map(oo)),_=[...s.keys()].filter(T=>T.startsWith(`${u}/`)&&T.endsWith(m)),w=[...new Set([...E,..._])].sort().filter(T=>s.has(T)).map(T=>EO(T,s.get(T)??"",S)),D={root:i.root??"browser-import",config:{language:r?.language,paths:{eventModelDir:c,featuresDir:u,sliceExtension:m,eventsFile:h,storiesDir:g}},events:p,stories:y,slices:w},x=_O(D);return{...D,...x}}function He(t,i,s,a,r){return{id:`${i}:${a??"project"}:${s}`,severity:t,check:i,message:s,path:a,nodeId:r}}function _l(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 AO(t){return/(ed|en|d|sent|built|made|booked|paid)$/i.test(t)}function Ev(t){return/(Requested|Triggered|Scheduled|Enqueued|Dispatched|Required)$/.test(t)}function TO(t){return["Selected","Shown","Viewed","Clicked","Opened","Closed","Ticked","Incremented","Reached","Displayed","Navigated"].find(i=>t.includes(i))}function MO(t){const i=new Set(t.nodes.map(c=>c.id)),s=new Map;for(const c of i)s.set(c,new Set);for(const c of t.edges)!i.has(c.source)||!i.has(c.target)||(s.get(c.source)?.add(c.target),s.get(c.target)?.add(c.source));let a=0;const r=new Set;for(const c of i){if(r.has(c))continue;a+=1;const u=[c];for(r.add(c);u.length>0;){const m=u.shift();if(m)for(const h of s.get(m)??[])r.has(h)||(r.add(h),u.push(h))}}return a}function CO(t){const i=[],s=new Set(t.events.map(h=>h.name)),a=new Set(t.slices.map(h=>h.path)),r=new Map,c=new Map;for(const h of t.stories){h.slices.length>15&&i.push(He("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(He("error","S2",`Story "${h.name}" lists missing slice "${g}".`,h.path))}for(const h of t.events){h.fields?.trim()||i.push(He("error","C4",`Event "${h.name}" has no fields block.`,h.sourcePath)),!AO(h.name)&&!Ev(h.name)&&i.push(He("warning","C3",`Event "${h.name}" does not obviously read as a past-tense domain event.`,h.sourcePath));const g=TO(h.name);g&&i.push(He("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 _l(g))i.push(He("error","L9",`Command "${p}" is duplicated within slice "${h.title}".`,h.path));for(const p of _l(v))i.push(He("error","L9",`Query "${p}" is duplicated within slice "${h.title}".`,h.path));for(const p of _l(h.screen.reads))i.push(He("error","L9",`screen.reads lists "${p}" more than once.`,h.path));for(const p of _l(h.screen.executes))i.push(He("error","L9",`screen.executes lists "${p}" more than once.`,h.path));for(const p of h.screen.reads)v.includes(p)||i.push(He("error","W2",`screen.reads references missing local query "${p}".`,h.path));for(const p of h.screen.executes)g.includes(p)||i.push(He("error","W1",`screen.executes references missing local command "${p}".`,h.path));h.screen.type==="system"&&h.screen.actors.length>0&&i.push(He("error","L5",`System slice "${h.title}" must not declare screen.actors.`,h.path)),h.storyName||i.push(He("warning","M2",`Slice "${h.title}" is not listed by any story.`,h.path)),h.commands.length>0&&h.gwt.length===0&&i.push(He("warning","M1",`Command slice "${h.title}" has no GWT scenarios.`,h.path));for(const p of h.commands){p.fields?.trim()||i.push(He("warning","L6",`Command "${p.name}" has no fields block.`,h.path));for(const y of p.produces)s.has(y)||i.push(He("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(He("warning","L7",`Query "${p.name}" has no fields block.`,h.path)),p.name.includes("For")||i.push(He("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(He("error","G2",`Query "${p.name}" reads unregistered event "${y}".`,h.path)),c.set(y,[...c.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(He("error","L8",`GWT scenario "${p.name??"Unnamed"}" has invalid item type "${y.type??""}".`,h.path)),y.name||i.push(He("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=c.get(h)??[];g.length===0&&i.push(He("error","G3",`Event "${h}" is registered but no command produces it.`)),g.length>1&&i.push(He("warning","G8",`Event "${h}" has multiple producers: ${g.join(", ")}.`)),g.length>0&&v.length===0&&i.push(He("warning",Ev(h)?"G4b":"G4a",`Event "${h}" is produced but no query consumes it.`))}for(const[h,g]of c.entries())(r.get(h)??[]).length===0&&i.push(He("error","G3",`Event "${h}" is read by ${g.join(", ")} but no command produces it.`));for(const h of _l(t.slices.flatMap(g=>g.commands.map(v=>v.name))))i.push(He("warning","M5",`Command name "${h}" is used in multiple slices; command names should be globally unique.`));for(const h of _l(t.slices.flatMap(g=>g.queries.map(v=>v.name))))i.push(He("warning","G7",`Query name "${h}" is used in multiple slices; query names should be globally unique.`));const u=t.slices.filter(h=>h.commands.length>0).length;u>0&&t.events.length/u>2&&i.push(He("warning","M4",`The model has ${(t.events.length/u).toFixed(1)} events per command slice; check for UI/runtime events leaking into the model.`));const m=MO(t);return m>1&&i.push(He("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 _v(){return z.jsxs(z.Fragment,{children:[z.jsx(rn,{id:"top-target",type:"target",position:fe.Top,style:{left:"46%"}}),z.jsx(rn,{id:"top-source",type:"source",position:fe.Top,style:{left:"54%"}}),z.jsx(rn,{id:"bottom-target",type:"target",position:fe.Bottom,style:{left:"46%"}}),z.jsx(rn,{id:"bottom-source",type:"source",position:fe.Bottom,style:{left:"54%"}}),z.jsx(rn,{id:"left-target",type:"target",position:fe.Left,style:{top:"46%"}}),z.jsx(rn,{id:"left-source",type:"source",position:fe.Left,style:{top:"54%"}}),z.jsx(rn,{id:"right-target",type:"target",position:fe.Right,style:{top:"46%"}}),z.jsx(rn,{id:"right-source",type:"source",position:fe.Right,style:{top:"54%"}})]})}function lh({title:t,items:i}){const s=i&&i.length>0?i:[{type:"empty",name:"empty"}];return z.jsxs("div",{className:"gwt-step",children:[z.jsx("div",{className:"gwt-step-title",children:t}),z.jsx("div",{className:"gwt-step-items",children:s.map((a,r)=>z.jsxs("div",{className:`gwt-step-item gwt-step-item-${a.type??"empty"}`,children:[z.jsx("span",{children:a.type??"empty"}),z.jsx("strong",{children:a.name??"empty"})]},`${a.type??"empty"}-${a.name??r}`))})]})}function OO({data:t}){const i=t,s=i.projectNode;return s.type==="gwt"?z.jsxs("div",{className:`em-node em-node-${s.type} ${i.selected?"selected":""} ${i.connected?"connected":""}`,children:[z.jsx(_v,{}),z.jsx("div",{className:"node-type",children:"GWT case"}),z.jsx("div",{className:"node-label",children:s.label}),s.description?z.jsx("div",{className:"gwt-description",children:s.description}):null,z.jsxs("div",{className:"gwt-steps",children:[z.jsx(lh,{title:"Given",items:s.given}),z.jsx(lh,{title:"When",items:s.when}),z.jsx(lh,{title:"Then",items:s.then})]})]}):z.jsxs("div",{className:`em-node em-node-${s.type} ${i.selected?"selected":""} ${i.connected?"connected":""}`,children:[z.jsx(_v,{}),z.jsx("div",{className:"node-type",children:s.type}),z.jsx("div",{className:"node-label",children:s.label}),s.actors&&s.actors.length>0?z.jsx("div",{className:"chips",children:s.actors.map(a=>z.jsx("span",{children:a},a))}):null]})}function zO({data:t}){const i=t,s=i.projectNode;return z.jsxs("div",{className:`group-node group-${s.type} ${i.selected?"selected":""}`,children:[z.jsx("div",{className:"group-title",children:s.label}),s.description?z.jsx("div",{className:"group-description",children:s.description}):null]})}const DO={eventModelNode:OO,groupNode:zO};function Nv(t){return t===fe.Top?{x:0,y:-1}:t===fe.Right?{x:1,y:0}:t===fe.Bottom?{x:0,y:1}:{x:-1,y:0}}function LO({sourceX:t,sourceY:i,targetX:s,targetY:a,sourcePosition:r,targetPosition:c,data:u}){const m=u,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)),y=Math.max(72,Math.min(180,Math.max(Math.abs(h),Math.abs(g))*.38));if(m?.route==="same-slice-read"){const _=r===fe.Top?-1:1,N=c===fe.Bottom?1:-1,w=Math.max(72,Math.min(150,Math.abs(g)*.65));return`M ${t},${i} C ${t},${i+_*w} ${s},${a+N*w} ${s},${a}`}if(m?.route==="event-read"){const _=Nv(r),N=Nv(c);return`M ${t},${i} C ${t+_.x*y},${i+_.y*y} ${s+N.x*y},${a+N.y*y} ${s},${a}`}if(r===fe.Bottom||r===fe.Top){const _=r===fe.Top?-1:1,N=c===fe.Top?-1:1;return`M ${t},${i} C ${t},${i+_*v} ${s},${a+N*v} ${s},${a}`}const S=r===fe.Left?-1:1,E=c===fe.Left?-1:1;return`M ${t},${i} C ${t+S*p},${i} ${s+E*p},${a} ${s},${a}`}function RO(t){const i=t.data,s=i?.active?"#111827":"#64748b",a=i?.fieldFlow,r=!!(i?.selectedFieldName&&(a?.sharedFieldNames.includes(i.selectedFieldName)||a?.derivedFieldNames.includes(i.selectedFieldName))),c=(t.sourceX+t.targetX)/2,u=(t.sourceY+t.targetY)/2;return z.jsxs(z.Fragment,{children:[z.jsx(Mo,{path:LO(t),markerEnd:t.markerEnd,style:{...t.style,stroke:s},className:i?.active?"edge-path-active":"edge-path"}),a&&a.visibleFieldNames.length>0&&(i?.active||r)?z.jsx(dM,{children:z.jsxs("div",{className:`edge-field-label nodrag nopan ${i?.active?"active":""} ${r?"field-selected":""}`,style:{transform:`translate(-50%, -50%) translate(${c}px, ${u}px)`},children:[a.visibleFieldNames.map(m=>z.jsx("button",{type:"button",onClick:()=>i?.onSelectField?.(m),children:m},m)),a.remainingCount>0?z.jsxs("span",{children:["+",a.remainingCount]}):null]})}):null]})}const BO={eventModelEdge:RO};function mc({label:t,description:i,value:s,copiedKey:a,onCopy:r}){return z.jsx("button",{type:"button",className:"copy-action",onClick:()=>r(a,s),children:z.jsxs("span",{children:[z.jsx("strong",{children:t}),z.jsx("small",{children:i})]})})}function Ch(t){return t==="query-screen"||t==="screen-command"||t==="command-event"||t==="event-query"}async function jO(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 kO(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 HO(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 $O(t){const i=t.graphSidecar?.nodes;return i?Object.entries(i).flatMap(([s,a])=>{const r=a,c=t.nodes.filter(u=>{if(r.type==="screen"&&u.type!=="screen"&&u.type!=="processor"||r.type!=="screen"&&r.type!==u.type)return!1;const m=HO(u);return Object.entries(r.selector??{}).every(([h,g])=>m[h]===g)});return c.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}]:c.length>1?[{id:`V2:.event-modeling/graph.json:${s}`,severity:"warning",check:"V2",message:`graph.json node "${s}" selector resolves to ${c.length} nodes.`,path:".event-modeling/graph.json",nodeId:s}]:[]}):[]}function Av({edge:t,flow:i,selectedNode:s,peer:a}){if(!i||!a)return[];const c=t.target===s.id?a:s;return[...i.sharedFieldNames.map(u=>({fieldName:u,source:`${c.label}.${u}`,kind:"field"})),...i.derivedFieldNames.map(u=>({fieldName:u,source:c.type==="event"?`${c.label} occurred`:c.label,kind:"event"}))]}function UO({onImport:t,error:i}){return z.jsx("div",{className:"import-panel",children:z.jsxs("div",{className:"import-card",children:[z.jsx("h1",{children:"emviz"}),z.jsx("p",{children:"Import an Event Modeling project folder or select YAML/JSON files to visualize the model."}),z.jsxs("div",{className:"import-actions",children:[z.jsxs("label",{children:["Import folder",z.jsx("input",{type:"file",multiple:!0,webkitdirectory:"",directory:"",onChange:s=>s.currentTarget.files&&t(s.currentTarget.files)})]}),z.jsxs("label",{children:["Import files",z.jsx("input",{type:"file",multiple:!0,accept:".yaml,.yml,.json",onChange:s=>s.currentTarget.files&&t(s.currentTarget.files)})]})]}),i?z.jsx("p",{className:"import-error",children:i}):null]})})}function qO({project:t,selectedNode:i,findings:s,fieldFlows:a,selectedFieldName:r,onSelect:c,onSelectField:u,onClearField:m,onPreviewConnection:h,onClearPreview:g}){const[v,p]=W.useState(),y=W.useCallback((O,j)=>{navigator.clipboard?.writeText(j).then(()=>{p(O),window.setTimeout(()=>p(R=>R===O?void 0:R),1400)})},[]);if(!i)return z.jsxs("aside",{className:"panel panel-right",children:[z.jsx("h2",{children:"Selection"}),z.jsx("p",{className:"muted",children:"Select a node to inspect source and connections."})]});const S=t.edges.filter(O=>O.target===i.id&&Ch(O.kind)),E=t.edges.filter(O=>O.source===i.id&&Ch(O.kind)),_=pb(i.fields),N=new Map(t.nodes.map(O=>[O.id,O])),D=`em://${t.graphSidecar?.model?.id??"event_model"}/${i.id}`,x=i.raw??i.fields??i.description??i.label,T=[`Reference: ${D}`,`Node: ${i.label} (${i.type})`,`Source: ${i.sourcePath??"unknown"}`,"","Incoming:",...S.length===0?["- none"]:S.map(O=>`- ${N.get(O.source)?.label??O.source} -> ${i.label}`),"","Outgoing:",...E.length===0?["- none"]:E.map(O=>`- ${i.label} -> ${N.get(O.target)?.label??O.target}`),"","Source excerpt:",x].join(`
|
|
154
|
+
`),L=`Please update this event model node.
|
|
155
|
+
|
|
156
|
+
Reference:
|
|
157
|
+
${D}
|
|
158
|
+
|
|
159
|
+
Source path:
|
|
160
|
+
${i.sourcePath??"unknown"}
|
|
161
|
+
|
|
162
|
+
Current context:
|
|
163
|
+
${x}
|
|
164
|
+
|
|
165
|
+
Goal:
|
|
166
|
+
`;return z.jsxs("aside",{className:"panel panel-right",children:[z.jsx("h2",{children:i.label}),z.jsxs("div",{className:"meta-row",children:[z.jsx("span",{children:"Type"}),z.jsx("strong",{children:i.type})]}),z.jsxs("div",{className:"meta-row",children:[z.jsx("span",{children:"Reference"}),z.jsx("code",{children:D})]}),i.sourcePath?z.jsxs("div",{className:"meta-row",children:[z.jsx("span",{children:"Source"}),z.jsx("code",{children:i.sourcePath})]}):null,z.jsxs("details",{className:"copy-section",children:[z.jsxs("summary",{children:[z.jsx("span",{children:"Copy for LLM"}),v?z.jsxs("strong",{className:"copy-feedback","aria-live":"polite",children:["Copied ",v]}):null]}),z.jsxs("div",{className:"copy-actions",children:[z.jsx(mc,{label:"Reference",description:"Stable em:// node handle",value:D,copiedKey:"reference",onCopy:y}),z.jsx(mc,{label:"YAML",description:"Source excerpt for this node",value:x,copiedKey:"YAML",onCopy:y}),z.jsx(mc,{label:"Context",description:"Reference plus incoming/outgoing links",value:T,copiedKey:"context",onCopy:y}),z.jsx(mc,{label:"Edit prompt",description:"Prompt scaffold for asking an LLM to edit",value:L,copiedKey:"prompt",onCopy:y})]})]}),z.jsx("h3",{children:"Connections"}),z.jsxs("div",{className:"connection-list",children:[z.jsx("strong",{children:"Incoming"}),S.length===0?z.jsx("p",{className:"muted",children:"None"}):S.map(O=>{const j=N.get(O.source),R=Av({edge:O,flow:a.get(O.id),selectedNode:i,peer:j});return z.jsxs("button",{type:"button",className:"connection-button",onClick:()=>c(O.source),onMouseEnter:()=>h(O.id),onMouseLeave:g,onFocus:()=>h(O.id),onBlur:g,children:[z.jsx("span",{children:j?.label??O.source}),R.length>0?z.jsx("span",{className:"provenance-rows",children:R.map(V=>z.jsxs("span",{className:r===V.fieldName?"selected":"",children:[z.jsx("b",{children:V.fieldName}),z.jsx("span",{"aria-hidden":"true",children:"←"}),z.jsx("em",{children:V.source})]},`${O.id}-${V.fieldName}-${V.source}`))}):null]},O.id)}),z.jsx("strong",{children:"Outgoing"}),E.length===0?z.jsx("p",{className:"muted",children:"None"}):E.map(O=>{const j=N.get(O.target),R=Av({edge:O,flow:a.get(O.id),selectedNode:i,peer:j});return z.jsxs("button",{type:"button",className:"connection-button",onClick:()=>c(O.target),onMouseEnter:()=>h(O.id),onMouseLeave:g,onFocus:()=>h(O.id),onBlur:g,children:[z.jsx("span",{children:j?.label??O.target}),R.length>0?z.jsx("span",{className:"provenance-rows",children:R.map(V=>z.jsxs("span",{className:r===V.fieldName?"selected":"",children:[z.jsx("b",{children:V.fieldName}),z.jsx("span",{"aria-hidden":"true",children:"←"}),z.jsx("em",{children:V.source})]},`${O.id}-${V.fieldName}-${V.source}`))}):null]},O.id)})]}),i.type==="command"||i.type==="event"||i.type==="query"?z.jsxs(z.Fragment,{children:[z.jsx("h3",{children:"Fields"}),z.jsxs("div",{className:"field-panel",children:[_.length===0?z.jsx("p",{className:"field-empty",children:"No fields documented."}):z.jsx("div",{className:"field-list",children:_.map(O=>z.jsx("button",{type:"button",className:r===O?"selected":"",onClick:()=>u(O),children:O},O))}),r?z.jsx("button",{type:"button",className:"clear-field",onClick:m,children:"Clear field focus"}):null]})]}):null,z.jsx("h3",{children:"Findings"}),s.length===0?z.jsx("p",{className:"muted",children:"No findings for this node."}):s.map(O=>z.jsxs("div",{className:`finding finding-${O.severity}`,children:[z.jsx("strong",{children:O.check}),z.jsx("span",{children:O.message})]},O.id)),z.jsx("h3",{children:"Source"}),z.jsx("pre",{children:x})]})}function VO({report:t,onSelect:i}){return z.jsxs("aside",{className:"panel panel-left",children:[z.jsx("h2",{children:"Validation"}),t?z.jsxs(z.Fragment,{children:[z.jsxs("div",{className:"status-row",children:[z.jsxs("span",{className:"status error",children:[t.errors," errors"]}),z.jsxs("span",{className:"status warning",children:[t.warnings," warnings"]})]}),z.jsx("div",{className:"findings-list",children:t.findings.length===0?z.jsx("p",{className:"muted",children:"No validation findings."}):t.findings.map(s=>z.jsxs("button",{type:"button",className:`finding finding-${s.severity}`,onClick:()=>s.nodeId&&i(s.nodeId),children:[z.jsx("strong",{children:s.check}),z.jsx("span",{children:s.message}),s.path?z.jsx("code",{children:s.path}):null]},s.id))})]}):z.jsx("p",{className:"muted",children:"Loading validation..."})]})}function YO(){const[t,i]=W.useState(),[s,a]=W.useState(),[r,c]=W.useState("loading"),[u,m]=W.useState(),[h,g]=W.useState(),[v,p]=W.useState([]),[y,S]=W.useState([]),[E,_]=W.useState(""),[N,w]=W.useState(),[D,x]=W.useState(),{setCenter:T,fitView:L}=Jc();W.useEffect(()=>{Promise.all([fetch("/api/model").then(U=>U.json()),fetch("/api/validation").then(U=>U.json())]).then(([U,J])=>{i(U),a(J),c("ready"),window.setTimeout(()=>{L({padding:.18,duration:300})},50)}).catch(()=>{c("import")})},[L]);const O=W.useMemo(()=>t?.nodes.find(U=>U.id===h),[t,h]),j=W.useMemo(()=>s?.findings.filter(U=>U.nodeId===h)??[],[s,h]),R=W.useMemo(()=>t?VM(t):new Map,[t]),V=W.useMemo(()=>{if(N)return new Set([N]);const U=YM(R,D);if(U)return U;if(!t||!h)return;const J=new Set;for(const M of t.edges)Ch(M.kind)&&(M.source===h||M.target===h)&&J.add(M.id);return J},[R,N,t,D,h]),le=W.useMemo(()=>t?iC(t,h,{focusedEdgeIds:V,edgeFieldFlows:R,selectedFieldName:D,onSelectField:x}):{nodes:[],edges:[]},[R,V,t,D,h]),K=W.useMemo(()=>{if(!t||E.trim().length<2)return[];const U=E.trim().toLowerCase();return t.nodes.filter(J=>`${J.label} ${J.type} ${J.sourcePath??""}`.toLowerCase().includes(U)).slice(0,8)},[t,E]),Z=W.useCallback((U,J=!0)=>{const M=le.nodes.find($=>$.id===U);w(void 0),J&&h&&h!==U&&(p($=>[...$,h]),S([])),g(U),M&&T(M.position.x+80,M.position.y+60,{zoom:1.2,duration:350})},[le.nodes,h,T]),oe=W.useCallback(()=>{g(void 0),w(void 0),x(void 0)},[]),B=W.useCallback(U=>{const J=t?.edges.find($=>$.id===U);if(!J)return;w(U);const M=le.nodes.filter($=>$.id===J.source||$.id===J.target);M.length>0&&L({nodes:M,padding:.36,duration:260,maxZoom:1.25})},[L,le.nodes,t?.edges]),X=W.useCallback(()=>{w(void 0)},[]);W.useEffect(()=>{const U=J=>{J.key==="Escape"&&oe()};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[oe]);const C=W.useCallback(()=>{const U=v.at(-1);U&&(p(J=>J.slice(0,-1)),h&&S(J=>[...J,h]),Z(U,!1))},[v,Z,h]),H=W.useCallback(()=>{const U=y.at(-1);U&&(S(J=>J.slice(0,-1)),h&&p(J=>[...J,h]),Z(U,!1))},[Z,y,h]),G=W.useCallback(U=>{jO(U).then(J=>{const M=NO(J),$=M;$.graphSidecar=kO(J)??{model:{id:"browser_import",name:"Browser Import"}},i($);const ee=CO(M),ie=$O($);a({errors:ee.errors,warnings:ee.warnings+ie.filter(re=>re.severity==="warning").length,findings:[...ee.findings,...ie]}),g(void 0),w(void 0),x(void 0),p([]),S([]),c("ready"),m(void 0),window.setTimeout(()=>{L({padding:.18,duration:300})},50)}).catch(J=>{m(J instanceof Error?J.message:String(J)),c("import")})},[L]);return r==="import"?z.jsx(UO,{onImport:G,error:u}):t?z.jsxs("div",{className:"app-shell",children:[z.jsxs("header",{className:"toolbar",children:[z.jsxs("div",{className:"model-summary",children:[z.jsx("strong",{children:"emviz"}),z.jsxs("span",{children:[t.stories.length," stories"]}),z.jsxs("span",{children:[t.slices.length," slices"]}),z.jsxs("span",{children:[t.nodes.filter(U=>U.type==="event").length," events"]})]}),z.jsxs("div",{className:"segmented toolbar-history","aria-label":"Selection history",children:[z.jsx("button",{type:"button",disabled:v.length===0,onClick:C,children:"Back"}),z.jsx("button",{type:"button",disabled:y.length===0,onClick:H,children:"Forward"})]}),z.jsxs("div",{className:"search-box",children:[z.jsx("input",{"aria-label":"Search event model",value:E,onChange:U=>_(U.target.value),placeholder:"Search nodes by name or type..."}),K.length>0?z.jsx("div",{className:"search-results",children:K.map(U=>z.jsxs("button",{type:"button",onClick:()=>Z(U.id),children:[z.jsx("span",{children:U.label}),z.jsx("small",{children:U.type})]},U.id))}):null]})]}),z.jsx(VO,{report:s,onSelect:Z}),z.jsx(qO,{project:t,selectedNode:O,findings:j,fieldFlows:R,selectedFieldName:D,onSelect:Z,onSelectField:x,onClearField:()=>x(void 0),onPreviewConnection:B,onClearPreview:X}),z.jsx("main",{className:"canvas",children:z.jsxs(uM,{nodes:le.nodes,edges:le.edges,nodeTypes:DO,edgeTypes:BO,onNodeClick:(U,J)=>Z(J.id),fitView:!0,minZoom:.2,maxZoom:1.8,nodesDraggable:!1,colorMode:"light",children:[z.jsx(yM,{gap:18,size:1}),z.jsx(_M,{})]})})]}):z.jsx("div",{className:"loading",children:"Loading event model..."})}function GO(){return z.jsx(fb,{children:z.jsx(YO,{})})}Ox.createRoot(document.getElementById("root")).render(z.jsx(Mv.StrictMode,{children:z.jsx(GO,{})}));
|