emviz 0.2.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app/assets/index-BIgHba-B.js +171 -0
- package/dist/app/assets/index-CrgcGOJd.css +1 -0
- package/dist/app/index.html +2 -2
- package/dist/index.js +21 -6
- package/dist/index.js.map +2 -2
- package/package.json +3 -3
- package/dist/app/assets/index-BRyuPKFs.css +0 -1
- package/dist/app/assets/index-DzoC5xh1.js +0 -171
|
@@ -0,0 +1,171 @@
|
|
|
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 _v(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Dd={exports:{}},Fa={};var Gy;function xx(){if(Gy)return Fa;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 Fa.Fragment=i,Fa.jsx=s,Fa.jsxs=s,Fa}var Xy;function Ex(){return Xy||(Xy=1,Dd.exports=xx()),Dd.exports}var T=Ex(),jd={exports:{}},Ne={};var Ky;function Nx(){if(Ky)return Ne;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(C){return C===null||typeof C!="object"?null:(C=y&&C[y]||C["@@iterator"],typeof C=="function"?C:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},x=Object.assign,A={};function N(C,$,J){this.props=C,this.context=$,this.refs=A,this.updater=J||E}N.prototype.isReactComponent={},N.prototype.setState=function(C,$){if(typeof C!="object"&&typeof C!="function"&&C!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,C,$,"setState")},N.prototype.forceUpdate=function(C){this.updater.enqueueForceUpdate(this,C,"forceUpdate")};function _(){}_.prototype=N.prototype;function w(C,$,J){this.props=C,this.context=$,this.refs=A,this.updater=J||E}var O=w.prototype=new _;O.constructor=w,x(O,N.prototype),O.isPureReactComponent=!0;var j=Array.isArray;function D(){}var R={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function q(C,$,J){var se=J.ref;return{$$typeof:t,type:C,key:$,ref:se!==void 0?se:null,props:J}}function ee(C,$){return q(C.type,$,C.props)}function V(C){return typeof C=="object"&&C!==null&&C.$$typeof===t}function Q(C){var $={"=":"=0",":":"=2"};return"$"+C.replace(/[=:]/g,function(J){return $[J]})}var ae=/\/+/g;function L(C,$){return typeof C=="object"&&C!==null&&C.key!=null?Q(""+C.key):$.toString(36)}function Y(C){switch(C.status){case"fulfilled":return C.value;case"rejected":throw C.reason;default:switch(typeof C.status=="string"?C.then(D,D):(C.status="pending",C.then(function($){C.status==="pending"&&(C.status="fulfilled",C.value=$)},function($){C.status==="pending"&&(C.status="rejected",C.reason=$)})),C.status){case"fulfilled":return C.value;case"rejected":throw C.reason}}throw C}function z(C,$,J,se,re){var de=typeof C;(de==="undefined"||de==="boolean")&&(C=null);var ce=!1;if(C===null)ce=!0;else switch(de){case"bigint":case"string":case"number":ce=!0;break;case"object":switch(C.$$typeof){case t:case i:ce=!0;break;case v:return ce=C._init,z(ce(C._payload),$,J,se,re)}}if(ce)return re=re(C),ce=se===""?"."+L(C,0):se,j(re)?(J="",ce!=null&&(J=ce.replace(ae,"$&/")+"/"),z(re,$,J,"",function(xe){return xe})):re!=null&&(V(re)&&(re=ee(re,J+(re.key==null||C&&C.key===re.key?"":(""+re.key).replace(ae,"$&/")+"/")+ce)),$.push(re)),1;ce=0;var ne=se===""?".":se+":";if(j(C))for(var ue=0;ue<C.length;ue++)se=C[ue],de=ne+L(se,ue),ce+=z(se,$,J,de,re);else if(ue=S(C),typeof ue=="function")for(C=ue.call(C),ue=0;!(se=C.next()).done;)se=se.value,de=ne+L(se,ue++),ce+=z(se,$,J,de,re);else if(de==="object"){if(typeof C.then=="function")return z(Y(C),$,J,se,re);throw $=String(C),Error("Objects are not valid as a React child (found: "+($==="[object Object]"?"object with keys {"+Object.keys(C).join(", ")+"}":$)+"). If you meant to render a collection of children, use an array instead.")}return ce}function B(C,$,J){if(C==null)return C;var se=[],re=0;return z(C,se,"","",function(de){return $.call(J,de,re++)}),se}function G(C){if(C._status===-1){var $=C._result;$=$(),$.then(function(J){(C._status===0||C._status===-1)&&(C._status=1,C._result=J)},function(J){(C._status===0||C._status===-1)&&(C._status=2,C._result=J)}),C._status===-1&&(C._status=0,C._result=$)}if(C._status===1)return C._result.default;throw C._result}var Z=typeof reportError=="function"?reportError:function(C){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var $=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof C=="object"&&C!==null&&typeof C.message=="string"?String(C.message):String(C),error:C});if(!window.dispatchEvent($))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",C);return}console.error(C)},te={map:B,forEach:function(C,$,J){B(C,function(){$.apply(this,arguments)},J)},count:function(C){var $=0;return B(C,function(){$++}),$},toArray:function(C){return B(C,function($){return $})||[]},only:function(C){if(!V(C))throw Error("React.Children.only expected to receive a single React element child.");return C}};return Ne.Activity=p,Ne.Children=te,Ne.Component=N,Ne.Fragment=s,Ne.Profiler=r,Ne.PureComponent=w,Ne.StrictMode=a,Ne.Suspense=h,Ne.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=R,Ne.__COMPILER_RUNTIME={__proto__:null,c:function(C){return R.H.useMemoCache(C)}},Ne.cache=function(C){return function(){return C.apply(null,arguments)}},Ne.cacheSignal=function(){return null},Ne.cloneElement=function(C,$,J){if(C==null)throw Error("The argument must be a React element, but you passed "+C+".");var se=x({},C.props),re=C.key;if($!=null)for(de in $.key!==void 0&&(re=""+$.key),$)!k.call($,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&$.ref===void 0||(se[de]=$[de]);var de=arguments.length-2;if(de===1)se.children=J;else if(1<de){for(var ce=Array(de),ne=0;ne<de;ne++)ce[ne]=arguments[ne+2];se.children=ce}return q(C.type,re,se)},Ne.createContext=function(C){return C={$$typeof:u,_currentValue:C,_currentValue2:C,_threadCount:0,Provider:null,Consumer:null},C.Provider=C,C.Consumer={$$typeof:c,_context:C},C},Ne.createElement=function(C,$,J){var se,re={},de=null;if($!=null)for(se in $.key!==void 0&&(de=""+$.key),$)k.call($,se)&&se!=="key"&&se!=="__self"&&se!=="__source"&&(re[se]=$[se]);var ce=arguments.length-2;if(ce===1)re.children=J;else if(1<ce){for(var ne=Array(ce),ue=0;ue<ce;ue++)ne[ue]=arguments[ue+2];re.children=ne}if(C&&C.defaultProps)for(se in ce=C.defaultProps,ce)re[se]===void 0&&(re[se]=ce[se]);return q(C,de,re)},Ne.createRef=function(){return{current:null}},Ne.forwardRef=function(C){return{$$typeof:m,render:C}},Ne.isValidElement=V,Ne.lazy=function(C){return{$$typeof:v,_payload:{_status:-1,_result:C},_init:G}},Ne.memo=function(C,$){return{$$typeof:g,type:C,compare:$===void 0?null:$}},Ne.startTransition=function(C){var $=R.T,J={};R.T=J;try{var se=C(),re=R.S;re!==null&&re(J,se),typeof se=="object"&&se!==null&&typeof se.then=="function"&&se.then(D,Z)}catch(de){Z(de)}finally{$!==null&&J.types!==null&&($.types=J.types),R.T=$}},Ne.unstable_useCacheRefresh=function(){return R.H.useCacheRefresh()},Ne.use=function(C){return R.H.use(C)},Ne.useActionState=function(C,$,J){return R.H.useActionState(C,$,J)},Ne.useCallback=function(C,$){return R.H.useCallback(C,$)},Ne.useContext=function(C){return R.H.useContext(C)},Ne.useDebugValue=function(){},Ne.useDeferredValue=function(C,$){return R.H.useDeferredValue(C,$)},Ne.useEffect=function(C,$){return R.H.useEffect(C,$)},Ne.useEffectEvent=function(C){return R.H.useEffectEvent(C)},Ne.useId=function(){return R.H.useId()},Ne.useImperativeHandle=function(C,$,J){return R.H.useImperativeHandle(C,$,J)},Ne.useInsertionEffect=function(C,$){return R.H.useInsertionEffect(C,$)},Ne.useLayoutEffect=function(C,$){return R.H.useLayoutEffect(C,$)},Ne.useMemo=function(C,$){return R.H.useMemo(C,$)},Ne.useOptimistic=function(C,$){return R.H.useOptimistic(C,$)},Ne.useReducer=function(C,$,J){return R.H.useReducer(C,$,J)},Ne.useRef=function(C){return R.H.useRef(C)},Ne.useState=function(C){return R.H.useState(C)},Ne.useSyncExternalStore=function(C,$,J){return R.H.useSyncExternalStore(C,$,J)},Ne.useTransition=function(){return R.H.useTransition()},Ne.version="19.2.7",Ne}var Zy;function xo(){return Zy||(Zy=1,jd.exports=Nx()),jd.exports}var K=xo();const qc=_v(K);var Ld={exports:{}},Ja={},Rd={exports:{}},kd={};var Iy;function _x(){return Iy||(Iy=1,(function(t){function i(z,B){var G=z.length;z.push(B);e:for(;0<G;){var Z=G-1>>>1,te=z[Z];if(0<r(te,B))z[Z]=B,z[G]=te,G=Z;else break e}}function s(z){return z.length===0?null:z[0]}function a(z){if(z.length===0)return null;var B=z[0],G=z.pop();if(G!==B){z[0]=G;e:for(var Z=0,te=z.length,C=te>>>1;Z<C;){var $=2*(Z+1)-1,J=z[$],se=$+1,re=z[se];if(0>r(J,G))se<te&&0>r(re,J)?(z[Z]=re,z[se]=G,Z=se):(z[Z]=J,z[$]=G,Z=$);else if(se<te&&0>r(re,G))z[Z]=re,z[se]=G,Z=se;else break e}}return B}function r(z,B){var G=z.sortIndex-B.sortIndex;return G!==0?G:z.id-B.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,x=!1,A=!1,N=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function O(z){for(var B=s(g);B!==null;){if(B.callback===null)a(g);else if(B.startTime<=z)a(g),B.sortIndex=B.expirationTime,i(h,B);else break;B=s(g)}}function j(z){if(x=!1,O(z),!E)if(s(h)!==null)E=!0,D||(D=!0,Q());else{var B=s(g);B!==null&&Y(j,B.startTime-z)}}var D=!1,R=-1,k=5,q=-1;function ee(){return A?!0:!(t.unstable_now()-q<k)}function V(){if(A=!1,D){var z=t.unstable_now();q=z;var B=!0;try{e:{E=!1,x&&(x=!1,_(R),R=-1),S=!0;var G=y;try{t:{for(O(z),p=s(h);p!==null&&!(p.expirationTime>z&&ee());){var Z=p.callback;if(typeof Z=="function"){p.callback=null,y=p.priorityLevel;var te=Z(p.expirationTime<=z);if(z=t.unstable_now(),typeof te=="function"){p.callback=te,O(z),B=!0;break t}p===s(h)&&a(h),O(z)}else a(h);p=s(h)}if(p!==null)B=!0;else{var C=s(g);C!==null&&Y(j,C.startTime-z),B=!1}}break e}finally{p=null,y=G,S=!1}B=void 0}}finally{B?Q():D=!1}}}var Q;if(typeof w=="function")Q=function(){w(V)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,L=ae.port2;ae.port1.onmessage=V,Q=function(){L.postMessage(null)}}else Q=function(){N(V,0)};function Y(z,B){R=N(function(){z(t.unstable_now())},B)}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(z){z.callback=null},t.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<z?Math.floor(1e3/z):5},t.unstable_getCurrentPriorityLevel=function(){return y},t.unstable_next=function(z){switch(y){case 1:case 2:case 3:var B=3;break;default:B=y}var G=y;y=B;try{return z()}finally{y=G}},t.unstable_requestPaint=function(){A=!0},t.unstable_runWithPriority=function(z,B){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var G=y;y=z;try{return B()}finally{y=G}},t.unstable_scheduleCallback=function(z,B,G){var Z=t.unstable_now();switch(typeof G=="object"&&G!==null?(G=G.delay,G=typeof G=="number"&&0<G?Z+G:Z):G=Z,z){case 1:var te=-1;break;case 2:te=250;break;case 5:te=1073741823;break;case 4:te=1e4;break;default:te=5e3}return te=G+te,z={id:v++,callback:B,priorityLevel:z,startTime:G,expirationTime:te,sortIndex:-1},G>Z?(z.sortIndex=G,i(g,z),s(h)===null&&z===s(g)&&(x?(_(R),R=-1):x=!0,Y(j,G-Z))):(z.sortIndex=te,i(h,z),E||S||(E=!0,D||(D=!0,Q()))),z},t.unstable_shouldYield=ee,t.unstable_wrapCallback=function(z){var B=y;return function(){var G=y;y=B;try{return z.apply(this,arguments)}finally{y=G}}}})(kd)),kd}var Qy;function Ax(){return Qy||(Qy=1,Rd.exports=_x()),Rd.exports}var Bd={exports:{}},Nt={};var Fy;function Tx(){if(Fy)return Nt;Fy=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 Nt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Nt.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)},Nt.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()}},Nt.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))},Nt.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},Nt.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})}},Nt.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)},Nt.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})}},Nt.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)},Nt.requestFormReset=function(h){a.d.r(h)},Nt.unstable_batchedUpdates=function(h,g){return h(g)},Nt.useFormState=function(h,g,v){return u.H.useFormState(h,g,v)},Nt.useFormStatus=function(){return u.H.useHostTransitionStatus()},Nt.version="19.2.7",Nt}var Jy;function Av(){if(Jy)return Bd.exports;Jy=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 Ja;Wy=1;var t=Ax(),i=xo(),s=Av();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,M=f.child;M;){if(M===l){b=!0,l=f,o=d;break}if(M===o){b=!0,o=f,l=d;break}M=M.sibling}if(!b){for(M=d.child;M;){if(M===l){b=!0,l=d,o=f;break}if(M===o){b=!0,o=d,l=f;break}M=M.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"),x=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),N=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),w=Symbol.for("react.context"),O=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),ee=Symbol.for("react.memo_cache_sentinel"),V=Symbol.iterator;function Q(e){return e===null||typeof e!="object"?null:(e=V&&e[V]||e["@@iterator"],typeof e=="function"?e:null)}var ae=Symbol.for("react.client.reference");function L(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case x:return"Fragment";case N:return"Profiler";case A:return"StrictMode";case j:return"Suspense";case D:return"SuspenseList";case q:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case E:return"Portal";case w:return e.displayName||"Context";case _:return(e._context.displayName||"Context")+".Consumer";case O:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case R:return n=e.displayName||null,n!==null?n:L(e.type)||"Memo";case k:n=e._payload,e=e._init;try{return L(e(n))}catch{}}return null}var Y=Array.isArray,z=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,B=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,G={pending:!1,data:null,method:null,action:null},Z=[],te=-1;function C(e){return{current:e}}function $(e){0>te||(e.current=Z[te],Z[te]=null,te--)}function J(e,n){te++,Z[te]=e.current,e.current=n}var se=C(null),re=C(null),de=C(null),ce=C(null);function ne(e,n){switch(J(de,n),J(re,e),J(se,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}}$(se),J(se,e)}function ue(){$(se),$(re),$(de)}function xe(e){e.memoizedState!==null&&J(ce,e);var n=se.current,l=my(n,e.type);n!==l&&(J(re,e),J(se,l))}function ye(e){re.current===e&&($(se),$(re)),ce.current===e&&($(ce),Ka._currentValue=G)}var ge,be;function Ee(e){if(ge===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);ge=n&&n[1]||"",be=-1<l.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+ge+e+be}var De=!1;function Ke(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 oe=function(){throw Error()};if(Object.defineProperty(oe.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(oe,[])}catch(P){var W=P}Reflect.construct(e,[],oe)}else{try{oe.call()}catch(P){W=P}e.call(oe.prototype)}}else{try{throw Error()}catch(P){W=P}(oe=e())&&typeof oe.catch=="function"&&oe.catch(function(){})}}catch(P){if(P&&W&&typeof P.stack=="string")return[P.stack,W.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],M=d[1];if(b&&M){var H=b.split(`
|
|
4
|
+
`),F=M.split(`
|
|
5
|
+
`);for(f=o=0;o<H.length&&!H[o].includes("DetermineComponentFrameRoot");)o++;for(;f<F.length&&!F[f].includes("DetermineComponentFrameRoot");)f++;if(o===H.length||f===F.length)for(o=H.length-1,f=F.length-1;1<=o&&0<=f&&H[o]!==F[f];)f--;for(;1<=o&&0<=f;o--,f--)if(H[o]!==F[f]){if(o!==1||f!==1)do if(o--,f--,0>f||H[o]!==F[f]){var ie=`
|
|
6
|
+
`+H[o].replace(" at new "," at ");return e.displayName&&ie.includes("<anonymous>")&&(ie=ie.replace("<anonymous>",e.displayName)),ie}while(1<=o&&0<=f);break}}}finally{De=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?Ee(l):""}function pt(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 Ke(e.type,!1);case 11:return Ke(e.type.render,!1);case 1:return Ke(e.type,!0);case 31:return Ee("Activity");default:return""}}function zt(e){try{var n="",l=null;do n+=pt(e,l),l=e,e=e.return;while(e);return n}catch(o){return`
|
|
7
|
+
Error generating stack: `+o.message+`
|
|
8
|
+
`+o.stack}}var fe=Object.prototype.hasOwnProperty,we=t.unstable_scheduleCallback,Ve=t.unstable_cancelCallback,lt=t.unstable_shouldYield,vt=t.unstable_requestPaint,Re=t.unstable_now,At=t.unstable_getCurrentPriorityLevel,Wt=t.unstable_ImmediatePriority,Pt=t.unstable_UserBlockingPriority,en=t.unstable_NormalPriority,gu=t.unstable_LowPriority,zs=t.unstable_IdlePriority,pu=t.log,yu=t.unstable_setDisableYieldValue,Qi=null,Tt=null;function An(e){if(typeof pu=="function"&&yu(e),Tt&&typeof Tt.setStrictMode=="function")try{Tt.setStrictMode(Qi,e)}catch{}}var Mt=Math.clz32?Math.clz32:Su,vu=Math.log,bu=Math.LN2;function Su(e){return e>>>=0,e===0?32:31-(vu(e)/bu|0)|0}var Ds=256,js=262144,Ls=4194304;function Bn(e){var n=e&42;if(n!==0)return n;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Rs(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 M=o&134217727;return M!==0?(o=M&~d,o!==0?f=Bn(o):(b&=M,b!==0?f=Bn(b):l||(l=M&~e,l!==0&&(f=Bn(l))))):(M=o&~d,M!==0?f=Bn(M):b!==0?f=Bn(b):l||(l=o&~e,l!==0&&(f=Bn(l)))),f===0?0:n!==0&&n!==f&&(n&d)===0&&(d=f&-f,l=n&-n,d>=l||d===32&&(l&4194048)!==0)?n:f}function Fi(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function wu(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=Ls;return Ls<<=1,(Ls&62914560)===0&&(Ls=4194304),e}function Pl(e){for(var n=[],l=0;31>l;l++)n.push(e);return n}function Ji(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function xu(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 M=e.entanglements,H=e.expirationTimes,F=e.hiddenUpdates;for(l=b&~l;0<l;){var ie=31-Mt(l),oe=1<<ie;M[ie]=0,H[ie]=-1;var W=F[ie];if(W!==null)for(F[ie]=null,ie=0;ie<W.length;ie++){var P=W[ie];P!==null&&(P.lane&=-536870913)}l&=~oe}o!==0&&jo(e,o,0),d!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=d&~(b&~n))}function jo(e,n,l){e.pendingLanes|=n,e.suspendedLanes&=~n;var o=31-Mt(n);e.entangledLanes|=n,e.entanglements[o]=e.entanglements[o]|1073741824|l&261930}function Lo(e,n){var l=e.entangledLanes|=n;for(e=e.entanglements;l;){var o=31-Mt(l),f=1<<o;f&n|e[o]&n&&(e[o]|=n),l&=~f}}function Ro(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 ko(){var e=B.p;return e!==0?e:(e=window.event,e===void 0?32:By(e.type))}function Bo(e,n){var l=B.p;try{return B.p=e,n()}finally{B.p=l}}var Tn=Math.random().toString(36).slice(2),mt="__reactFiber$"+Tn,Et="__reactProps$"+Tn,Hn="__reactContainer$"+Tn,ks="__reactEvents$"+Tn,Ho="__reactListeners$"+Tn,Eu="__reactHandles$"+Tn,$o="__reactResources$"+Tn,Wi="__reactMarker$"+Tn;function na(e){delete e[mt],delete e[Et],delete e[ks],delete e[Ho],delete e[Eu]}function ui(e){var n=e[mt];if(n)return n;for(var l=e.parentNode;l;){if(n=l[Hn]||l[mt]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(e=wy(e);e!==null;){if(l=e[mt])return l;e=wy(e)}return n}e=l,l=e.parentNode}return null}function fi(e){if(e=e[mt]||e[Hn]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function di(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function hi(e){var n=e[$o];return n||(n=e[$o]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function rt(e){e[Wi]=!0}var Uo=new Set,qo={};function $n(e,n){mi(e,n),mi(e+"Capture",n)}function mi(e,n){for(qo[e]=n,e=0;e<n.length;e++)Uo.add(n[e])}var Nu=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 _u(e){return fe.call(ia,e)?!0:fe.call(Vo,e)?!1:Nu.test(e)?ia[e]=!0:(Vo[e]=!0,!1)}function Bs(e,n,l){if(_u(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 Hs(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 hn(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 Dt(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 Au(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=Au(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 $s(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 jt(e){return e.replace(Go,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function aa(e,n,l,o,f,d,b,M){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=""+Dt(n)):e.value!==""+Dt(n)&&(e.value=""+Dt(n)):b!=="submit"&&b!=="reset"||e.removeAttribute("value"),n!=null?oa(e,b,Dt(n)):l!=null?oa(e,b,Dt(l)):o!=null&&e.removeAttribute("value"),f==null&&d!=null&&(e.defaultChecked=!!d),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?e.name=""+Dt(M):e.removeAttribute("name")}function Us(e,n,l,o,f,d,b,M){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?""+Dt(l):"",n=n!=null?""+Dt(n):l,M||n===e.value||(e.value=n),e.defaultValue=n}o=o??f,o=typeof o!="function"&&typeof o!="symbol"&&!!o,e.checked=M?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"&&$s(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function gi(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=""+Dt(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=""+Dt(n),n!==e.value&&(e.value=n),l==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=l!=null?""+Dt(l):""}function cm(e,n,l,o){if(n==null){if(o!=null){if(l!=null)throw Error(a(92));if(Y(o)){if(1<o.length)throw Error(a(93));o=o[0]}l=o}l==null&&(l=""),n=l}l=Dt(n),e.defaultValue=l,o=e.textContent,o===l&&o!==""&&o!==null&&(e.value=o),sa(e)}function qs(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 Tu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var 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 Un(){}var Mu=null;function Cu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Vs=null,Ys=null;function dm(e){var n=fi(e);if(n&&(e=n.stateNode)){var l=e[Et]||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="'+jt(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var o=l[n];if(o!==e&&o.form===e.form){var f=o[Et]||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&&gi(e,!!l.multiple,n,!1)}}}var Ou=!1;function hm(e,n,l){if(Ou)return e(n,l);Ou=!0;try{var o=e(n);return o}finally{if(Ou=!1,(Vs!==null||Ys!==null)&&(Dr(),Vs&&(n=Vs,e=Ys,Ys=Vs=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[Et]||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 qn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),zu=!1;if(qn)try{var ua={};Object.defineProperty(ua,"passive",{get:function(){zu=!0}}),window.addEventListener("test",ua,ua),window.removeEventListener("test",ua,ua)}catch{zu=!1}var pi=null,Du=null,Ko=null;function mm(){if(Ko)return Ko;var e,n=Du,l=n.length,o,f="value"in pi?pi.value:pi.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 Io(){return!0}function gm(){return!1}function Lt(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 M in e)e.hasOwnProperty(M)&&(l=e[M],this[M]=l?l(d):d[M]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Io: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=Io)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Io)},persist:function(){},isPersistent:Io}),n}var Pi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qo=Lt(Pi),fa=p({},Pi,{view:0,detail:0}),SS=Lt(fa),ju,Lu,da,Fo=p({},fa,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:ku,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"?(ju=e.screenX-da.screenX,Lu=e.screenY-da.screenY):Lu=ju=0,da=e),ju)},movementY:function(e){return"movementY"in e?e.movementY:Lu}}),pm=Lt(Fo),wS=p({},Fo,{dataTransfer:0}),xS=Lt(wS),ES=p({},fa,{relatedTarget:0}),Ru=Lt(ES),NS=p({},Pi,{animationName:0,elapsedTime:0,pseudoElement:0}),_S=Lt(NS),AS=p({},Pi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),TS=Lt(AS),MS=p({},Pi,{data:0}),ym=Lt(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 ku(){return DS}var jS=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:ku,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}}),LS=Lt(jS),RS=p({},Fo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vm=Lt(RS),kS=p({},fa,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:ku}),BS=Lt(kS),HS=p({},Pi,{propertyName:0,elapsedTime:0,pseudoElement:0}),$S=Lt(HS),US=p({},Fo,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),qS=Lt(US),VS=p({},Pi,{newState:0,oldState:0}),YS=Lt(VS),GS=[9,13,27,32],Bu=qn&&"CompositionEvent"in window,ha=null;qn&&"documentMode"in document&&(ha=document.documentMode);var XS=qn&&"TextEvent"in window&&!ha,bm=qn&&(!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 Gs=!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(Gs)return e==="compositionend"||!Bu&&xm(e,n)?(e=mm(),Ko=Du=pi=null,Gs=!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 IS={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 Nm(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!IS[e.type]:n==="textarea"}function _m(e,n,l,o){Vs?Ys?Ys.push(o):Ys=[o]:Vs=o,n=$r(n,"onChange"),0<n.length&&(l=new Qo("onChange","change",null,l,o),e.push({event:l,listeners:n}))}var ma=null,ga=null;function QS(e){oy(e,0)}function Jo(e){var n=di(e);if(la(n))return e}function Am(e,n){if(e==="change")return n}var Tm=!1;if(qn){var Hu;if(qn){var $u="oninput"in document;if(!$u){var Mm=document.createElement("div");Mm.setAttribute("oninput","return;"),$u=typeof Mm.oninput=="function"}Hu=$u}else Hu=!1;Tm=Hu&&(!document.documentMode||9<document.documentMode)}function Cm(){ma&&(ma.detachEvent("onpropertychange",Om),ga=ma=null)}function Om(e){if(e.propertyName==="value"&&Jo(ga)){var n=[];_m(n,ga,e,Cu(e)),hm(QS,n)}}function FS(e,n,l){e==="focusin"?(Cm(),ma=n,ga=l,ma.attachEvent("onpropertychange",Om)):e==="focusout"&&Cm()}function JS(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Jo(ga)}function WS(e,n){if(e==="click")return Jo(n)}function PS(e,n){if(e==="input"||e==="change")return Jo(n)}function ew(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var Vt=typeof Object.is=="function"?Object.is:ew;function pa(e,n){if(Vt(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(!fe.call(n,f)||!Vt(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 jm(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?jm(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function Lm(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=$s(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=$s(e.document)}return n}function Uu(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=qn&&"documentMode"in document&&11>=document.documentMode,Xs=null,qu=null,ya=null,Vu=!1;function Rm(e,n,l){var o=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Vu||Xs==null||Xs!==$s(o)||(o=Xs,"selectionStart"in o&&Uu(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(qu,"onSelect"),0<o.length&&(n=new Qo("onSelect","select",null,n,l),e.push({event:n,listeners:o}),n.target=Xs)))}function es(e,n){var l={};return l[e.toLowerCase()]=n.toLowerCase(),l["Webkit"+e]="webkit"+n,l["Moz"+e]="moz"+n,l}var Ks={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")},Yu={},km={};qn&&(km=document.createElement("div").style,"AnimationEvent"in window||(delete Ks.animationend.animation,delete Ks.animationiteration.animation,delete Ks.animationstart.animation),"TransitionEvent"in window||delete Ks.transitionend.transition);function ts(e){if(Yu[e])return Yu[e];if(!Ks[e])return e;var n=Ks[e],l;for(l in n)if(n.hasOwnProperty(l)&&l in km)return Yu[e]=n[l];return e}var Bm=ts("animationend"),Hm=ts("animationiteration"),$m=ts("animationstart"),nw=ts("transitionrun"),iw=ts("transitionstart"),sw=ts("transitioncancel"),Um=ts("transitionend"),qm=new Map,Gu="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(" ");Gu.push("scrollEnd");function mn(e,n){qm.set(e,n),$n(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)},tn=[],Zs=0,Xu=0;function Po(){for(var e=Zs,n=Xu=Zs=0;n<e;){var l=tn[n];tn[n++]=null;var o=tn[n];tn[n++]=null;var f=tn[n];tn[n++]=null;var d=tn[n];if(tn[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){tn[Zs++]=e,tn[Zs++]=n,tn[Zs++]=l,tn[Zs++]=o,Xu|=o,e.lanes|=o,e=e.alternate,e!==null&&(e.lanes|=o)}function Ku(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-Mt(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,nd=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 Yt(e,n,l,o){return new lw(e,n,l,o)}function Zu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Vn(e,n){var l=e.alternate;return l===null?(l=Yt(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")Zu(e)&&(b=1);else if(typeof e=="string")b=ux(e,l,se.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case q:return e=Yt(31,l,n,f),e.elementType=q,e.lanes=d,e;case x:return is(l.children,f,d,n);case A:b=8,f|=24;break;case N:return e=Yt(12,l,n,f|2),e.elementType=N,e.lanes=d,e;case j:return e=Yt(13,l,n,f),e.elementType=j,e.lanes=d,e;case D:return e=Yt(19,l,n,f),e.elementType=D,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case w:b=10;break e;case _:b=9;break e;case O:b=11;break e;case R:b=14;break e;case k:b=16,o=null;break e}b=29,l=Error(a(130,e===null?"null":typeof e,"")),o=null}return n=Yt(b,l,n,f),n.elementType=e,n.type=o,n.lanes=d,n}function is(e,n,l,o){return e=Yt(7,e,o,n),e.lanes=l,e}function Iu(e,n,l){return e=Yt(6,e,null,n),e.lanes=l,e}function Gm(e){var n=Yt(18,null,null,0);return n.stateNode=e,n}function Qu(e,n,l){return n=Yt(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 nn(e,n){if(typeof e=="object"&&e!==null){var l=Xm.get(e);return l!==void 0?l:(n={value:e,source:n,stack:zt(n)},Xm.set(e,n),n)}return{value:e,source:n,stack:zt(n)}}var Qs=[],Fs=0,ir=null,va=0,sn=[],ln=0,yi=null,Mn=1,Cn="";function Yn(e,n){Qs[Fs++]=va,Qs[Fs++]=ir,ir=e,va=n}function Km(e,n,l){sn[ln++]=Mn,sn[ln++]=Cn,sn[ln++]=yi,yi=e;var o=Mn;e=Cn;var f=32-Mt(o)-1;o&=~(1<<f),l+=1;var d=32-Mt(n)+f;if(30<d){var b=f-f%5;d=(o&(1<<b)-1).toString(32),o>>=b,f-=b,Mn=1<<32-Mt(n)+f|l<<f|o,Cn=d+e}else Mn=1<<d|l<<f|o,Cn=e}function Fu(e){e.return!==null&&(Yn(e,1),Km(e,1,0))}function Ju(e){for(;e===ir;)ir=Qs[--Fs],Qs[Fs]=null,va=Qs[--Fs],Qs[Fs]=null;for(;e===yi;)yi=sn[--ln],sn[ln]=null,Cn=sn[--ln],sn[ln]=null,Mn=sn[--ln],sn[ln]=null}function Zm(e,n){sn[ln++]=Mn,sn[ln++]=Cn,sn[ln++]=yi,Mn=n.id,Cn=n.overflow,yi=e}var bt=null,Qe=null,je=!1,vi=null,an=!1,Wu=Error(a(519));function bi(e){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ba(nn(n,e)),Wu}function Im(e){var n=e.stateNode,l=e.type,o=e.memoizedProps;switch(n[mt]=e,n[Et]=o,l){case"dialog":Ce("cancel",n),Ce("close",n);break;case"iframe":case"object":case"embed":Ce("load",n);break;case"video":case"audio":for(l=0;l<qa.length;l++)Ce(qa[l],n);break;case"source":Ce("error",n);break;case"img":case"image":case"link":Ce("error",n),Ce("load",n);break;case"details":Ce("toggle",n);break;case"input":Ce("invalid",n),Us(n,o.value,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name,!0);break;case"select":Ce("invalid",n);break;case"textarea":Ce("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&&(Ce("beforetoggle",n),Ce("toggle",n)),o.onScroll!=null&&Ce("scroll",n),o.onScrollEnd!=null&&Ce("scrollend",n),o.onClick!=null&&(n.onclick=Un),n=!0):n=!1,n||bi(e,!0)}function Qm(e){for(bt=e.return;bt;)switch(bt.tag){case 5:case 31:case 13:an=!1;return;case 27:case 3:an=!0;return;default:bt=bt.return}}function Js(e){if(e!==bt)return!1;if(!je)return Qm(e),je=!0,!1;var n=e.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||yd(e.type,e.memoizedProps)),l=!l),l&&Qe&&bi(e),Qm(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Qe=Sy(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Qe=Sy(e)}else n===27?(n=Qe,ji(e.type)?(e=xd,xd=null,Qe=e):Qe=n):Qe=bt?rn(e.stateNode.nextSibling):null;return!0}function ss(){Qe=bt=null,je=!1}function Pu(){var e=vi;return e!==null&&(Ht===null?Ht=e:Ht.push.apply(Ht,e),vi=null),e}function ba(e){vi===null?vi=[e]:vi.push(e)}var ef=C(null),ls=null,Gn=null;function Si(e,n,l){J(ef,n._currentValue),n._currentValue=l}function Xn(e){e._currentValue=ef.current,$(ef)}function tf(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 nf(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 M=d;d=f;for(var H=0;H<n.length;H++)if(M.context===n[H]){d.lanes|=l,M=d.alternate,M!==null&&(M.lanes|=l),tf(d.return,l,e),o||(b=null);break e}d=M.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),tf(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 Ws(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 M=f.type;Vt(f.pendingProps.value,b.value)||(e!==null?e.push(M):e=[M])}}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&&nf(n,e,l,o),n.flags|=262144}function sr(e){for(e=e.firstContext;e!==null;){if(!Vt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function as(e){ls=e,Gn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function St(e){return Fm(ls,e)}function lr(e,n){return ls===null&&as(e),Fm(e,n)}function Fm(e,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Gn===null){if(e===null)throw Error(a(308));Gn=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else Gn=Gn.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,ct={$$typeof:w,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sf(){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,lf=0,Ps=0,el=null;function cw(e,n){if(wa===null){var l=wa=[];lf=0,Ps=rd(),el={status:"pending",value:void 0,then:function(o){l.push(o)}}}return lf++,n.then(Jm,Jm),n}function Jm(){if(--lf===0&&wa!==null){el!==null&&(el.status="fulfilled");var e=wa;wa=null,Ps=0,el=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=z.S;z.S=function(e,n){Rp=Re(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&cw(e,n),Wm!==null&&Wm(e,n)};var os=C(null);function af(){var e=os.current;return e!==null?e:Ze.pooledCache}function ar(e,n){n===null?J(os,os.current):J(os,n.pool)}function Pm(){var e=af();return e===null?null:{parent:ct._currentValue,pool:e}}var tl=Error(a(460)),of=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(Un,Un),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(Un,Un);else{if(e=Ze,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,tl}}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,tl):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===tl||e===or)throw Error(a(483))}var nl=null,xa=0;function cr(e){var n=xa;return xa+=1,nl===null&&(nl=[]),tg(nl,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(X,U){if(e){var I=X.deletions;I===null?(X.deletions=[U],X.flags|=16):I.push(U)}}function l(X,U){if(!e)return null;for(;U!==null;)n(X,U),U=U.sibling;return null}function o(X){for(var U=new Map;X!==null;)X.key!==null?U.set(X.key,X):U.set(X.index,X),X=X.sibling;return U}function f(X,U){return X=Vn(X,U),X.index=0,X.sibling=null,X}function d(X,U,I){return X.index=I,e?(I=X.alternate,I!==null?(I=I.index,I<U?(X.flags|=67108866,U):I):(X.flags|=67108866,U)):(X.flags|=1048576,U)}function b(X){return e&&X.alternate===null&&(X.flags|=67108866),X}function M(X,U,I,le){return U===null||U.tag!==6?(U=Iu(I,X.mode,le),U.return=X,U):(U=f(U,I),U.return=X,U)}function H(X,U,I,le){var ve=I.type;return ve===x?ie(X,U,I.props.children,le,I.key):U!==null&&(U.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===k&&rs(ve)===U.type)?(U=f(U,I.props),Ea(U,I),U.return=X,U):(U=nr(I.type,I.key,I.props,null,X.mode,le),Ea(U,I),U.return=X,U)}function F(X,U,I,le){return U===null||U.tag!==4||U.stateNode.containerInfo!==I.containerInfo||U.stateNode.implementation!==I.implementation?(U=Qu(I,X.mode,le),U.return=X,U):(U=f(U,I.children||[]),U.return=X,U)}function ie(X,U,I,le,ve){return U===null||U.tag!==7?(U=is(I,X.mode,le,ve),U.return=X,U):(U=f(U,I),U.return=X,U)}function oe(X,U,I){if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return U=Iu(""+U,X.mode,I),U.return=X,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case S:return I=nr(U.type,U.key,U.props,null,X.mode,I),Ea(I,U),I.return=X,I;case E:return U=Qu(U,X.mode,I),U.return=X,U;case k:return U=rs(U),oe(X,U,I)}if(Y(U)||Q(U))return U=is(U,X.mode,I,null),U.return=X,U;if(typeof U.then=="function")return oe(X,cr(U),I);if(U.$$typeof===w)return oe(X,lr(X,U),I);ur(X,U)}return null}function W(X,U,I,le){var ve=U!==null?U.key:null;if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return ve!==null?null:M(X,U,""+I,le);if(typeof I=="object"&&I!==null){switch(I.$$typeof){case S:return I.key===ve?H(X,U,I,le):null;case E:return I.key===ve?F(X,U,I,le):null;case k:return I=rs(I),W(X,U,I,le)}if(Y(I)||Q(I))return ve!==null?null:ie(X,U,I,le,null);if(typeof I.then=="function")return W(X,U,cr(I),le);if(I.$$typeof===w)return W(X,U,lr(X,I),le);ur(X,I)}return null}function P(X,U,I,le,ve){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return X=X.get(I)||null,M(U,X,""+le,ve);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case S:return X=X.get(le.key===null?I:le.key)||null,H(U,X,le,ve);case E:return X=X.get(le.key===null?I:le.key)||null,F(U,X,le,ve);case k:return le=rs(le),P(X,U,I,le,ve)}if(Y(le)||Q(le))return X=X.get(I)||null,ie(U,X,le,ve,null);if(typeof le.then=="function")return P(X,U,I,cr(le),ve);if(le.$$typeof===w)return P(X,U,I,lr(U,le),ve);ur(U,le)}return null}function me(X,U,I,le){for(var ve=null,ke=null,pe=U,Te=U=0,ze=null;pe!==null&&Te<I.length;Te++){pe.index>Te?(ze=pe,pe=null):ze=pe.sibling;var Be=W(X,pe,I[Te],le);if(Be===null){pe===null&&(pe=ze);break}e&&pe&&Be.alternate===null&&n(X,pe),U=d(Be,U,Te),ke===null?ve=Be:ke.sibling=Be,ke=Be,pe=ze}if(Te===I.length)return l(X,pe),je&&Yn(X,Te),ve;if(pe===null){for(;Te<I.length;Te++)pe=oe(X,I[Te],le),pe!==null&&(U=d(pe,U,Te),ke===null?ve=pe:ke.sibling=pe,ke=pe);return je&&Yn(X,Te),ve}for(pe=o(pe);Te<I.length;Te++)ze=P(pe,X,Te,I[Te],le),ze!==null&&(e&&ze.alternate!==null&&pe.delete(ze.key===null?Te:ze.key),U=d(ze,U,Te),ke===null?ve=ze:ke.sibling=ze,ke=ze);return e&&pe.forEach(function(Hi){return n(X,Hi)}),je&&Yn(X,Te),ve}function Se(X,U,I,le){if(I==null)throw Error(a(151));for(var ve=null,ke=null,pe=U,Te=U=0,ze=null,Be=I.next();pe!==null&&!Be.done;Te++,Be=I.next()){pe.index>Te?(ze=pe,pe=null):ze=pe.sibling;var Hi=W(X,pe,Be.value,le);if(Hi===null){pe===null&&(pe=ze);break}e&&pe&&Hi.alternate===null&&n(X,pe),U=d(Hi,U,Te),ke===null?ve=Hi:ke.sibling=Hi,ke=Hi,pe=ze}if(Be.done)return l(X,pe),je&&Yn(X,Te),ve;if(pe===null){for(;!Be.done;Te++,Be=I.next())Be=oe(X,Be.value,le),Be!==null&&(U=d(Be,U,Te),ke===null?ve=Be:ke.sibling=Be,ke=Be);return je&&Yn(X,Te),ve}for(pe=o(pe);!Be.done;Te++,Be=I.next())Be=P(pe,X,Te,Be.value,le),Be!==null&&(e&&Be.alternate!==null&&pe.delete(Be.key===null?Te:Be.key),U=d(Be,U,Te),ke===null?ve=Be:ke.sibling=Be,ke=Be);return e&&pe.forEach(function(wx){return n(X,wx)}),je&&Yn(X,Te),ve}function Xe(X,U,I,le){if(typeof I=="object"&&I!==null&&I.type===x&&I.key===null&&(I=I.props.children),typeof I=="object"&&I!==null){switch(I.$$typeof){case S:e:{for(var ve=I.key;U!==null;){if(U.key===ve){if(ve=I.type,ve===x){if(U.tag===7){l(X,U.sibling),le=f(U,I.props.children),le.return=X,X=le;break e}}else if(U.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===k&&rs(ve)===U.type){l(X,U.sibling),le=f(U,I.props),Ea(le,I),le.return=X,X=le;break e}l(X,U);break}else n(X,U);U=U.sibling}I.type===x?(le=is(I.props.children,X.mode,le,I.key),le.return=X,X=le):(le=nr(I.type,I.key,I.props,null,X.mode,le),Ea(le,I),le.return=X,X=le)}return b(X);case E:e:{for(ve=I.key;U!==null;){if(U.key===ve)if(U.tag===4&&U.stateNode.containerInfo===I.containerInfo&&U.stateNode.implementation===I.implementation){l(X,U.sibling),le=f(U,I.children||[]),le.return=X,X=le;break e}else{l(X,U);break}else n(X,U);U=U.sibling}le=Qu(I,X.mode,le),le.return=X,X=le}return b(X);case k:return I=rs(I),Xe(X,U,I,le)}if(Y(I))return me(X,U,I,le);if(Q(I)){if(ve=Q(I),typeof ve!="function")throw Error(a(150));return I=ve.call(I),Se(X,U,I,le)}if(typeof I.then=="function")return Xe(X,U,cr(I),le);if(I.$$typeof===w)return Xe(X,U,lr(X,I),le);ur(X,I)}return typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint"?(I=""+I,U!==null&&U.tag===6?(l(X,U.sibling),le=f(U,I),le.return=X,X=le):(l(X,U),le=Iu(I,X.mode,le),le.return=X,X=le),b(X)):l(X,U)}return function(X,U,I,le){try{xa=0;var ve=Xe(X,U,I,le);return nl=null,ve}catch(pe){if(pe===tl||pe===or)throw pe;var ke=Yt(29,pe,null,X.mode);return ke.lanes=le,ke.return=X,ke}}}var us=sg(!0),lg=sg(!1),wi=!1;function rf(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cf(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 xi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ei(e,n,l){var o=e.updateQueue;if(o===null)return null;if(o=o.shared,(He&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 Na(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,Lo(e,l)}}function uf(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 ff=!1;function _a(){if(ff){var e=el;if(e!==null)throw e}}function Aa(e,n,l,o){ff=!1;var f=e.updateQueue;wi=!1;var d=f.firstBaseUpdate,b=f.lastBaseUpdate,M=f.shared.pending;if(M!==null){f.shared.pending=null;var H=M,F=H.next;H.next=null,b===null?d=F:b.next=F,b=H;var ie=e.alternate;ie!==null&&(ie=ie.updateQueue,M=ie.lastBaseUpdate,M!==b&&(M===null?ie.firstBaseUpdate=F:M.next=F,ie.lastBaseUpdate=H))}if(d!==null){var oe=f.baseState;b=0,ie=F=H=null,M=d;do{var W=M.lane&-536870913,P=W!==M.lane;if(P?(Oe&W)===W:(o&W)===W){W!==0&&W===Ps&&(ff=!0),ie!==null&&(ie=ie.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var me=e,Se=M;W=n;var Xe=l;switch(Se.tag){case 1:if(me=Se.payload,typeof me=="function"){oe=me.call(Xe,oe,W);break e}oe=me;break e;case 3:me.flags=me.flags&-65537|128;case 0:if(me=Se.payload,W=typeof me=="function"?me.call(Xe,oe,W):me,W==null)break e;oe=p({},oe,W);break e;case 2:wi=!0}}W=M.callback,W!==null&&(e.flags|=64,P&&(e.flags|=8192),P=f.callbacks,P===null?f.callbacks=[W]:P.push(W))}else P={lane:W,tag:M.tag,payload:M.payload,callback:M.callback,next:null},ie===null?(F=ie=P,H=oe):ie=ie.next=P,b|=W;if(M=M.next,M===null){if(M=f.shared.pending,M===null)break;P=M,M=P.next,P.next=null,f.lastBaseUpdate=P,f.shared.pending=null}}while(!0);ie===null&&(H=oe),f.baseState=H,f.firstBaseUpdate=F,f.lastBaseUpdate=ie,d===null&&(f.shared.lanes=0),Mi|=b,e.lanes=b,e.memoizedState=oe}}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 il=C(null),fr=C(0);function rg(e,n){e=ei,J(fr,e),J(il,n),ei=e|n.baseLanes}function df(){J(fr,ei),J(il,il.current)}function hf(){ei=fr.current,$(il),$(fr)}var Gt=C(null),on=null;function Ni(e){var n=e.alternate;J(at,at.current&1),J(Gt,e),on===null&&(n===null||il.current!==null||n.memoizedState!==null)&&(on=e)}function mf(e){J(at,at.current),J(Gt,e),on===null&&(on=e)}function cg(e){e.tag===22?(J(at,at.current),J(Gt,e),on===null&&(on=e)):_i()}function _i(){J(at,at.current),J(Gt,Gt.current)}function Xt(e){$(Gt),on===e&&(on=null),$(at)}var at=C(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||Sd(l)||wd(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 Kn=0,Ae=null,Ye=null,ut=null,hr=!1,sl=!1,fs=!1,mr=0,Ta=0,ll=null,fw=0;function it(){throw Error(a(321))}function gf(e,n){if(n===null)return!1;for(var l=0;l<n.length&&l<e.length;l++)if(!Vt(e[l],n[l]))return!1;return!0}function pf(e,n,l,o,f,d){return Kn=d,Ae=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,z.H=e===null||e.memoizedState===null?Kg:zf,fs=!1,d=l(o,f),fs=!1,sl&&(d=fg(n,l,o,f)),ug(e),d}function ug(e){z.H=Oa;var n=Ye!==null&&Ye.next!==null;if(Kn=0,ut=Ye=Ae=null,hr=!1,Ta=0,ll=null,n)throw Error(a(300));e===null||ft||(e=e.dependencies,e!==null&&sr(e)&&(ft=!0))}function fg(e,n,l,o){Ae=e;var f=0;do{if(sl&&(ll=null),Ta=0,sl=!1,25<=f)throw Error(a(301));if(f+=1,ut=Ye=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}z.H=Zg,d=n(l,o)}while(sl);return d}function dw(){var e=z.H,n=e.useState()[0];return n=typeof n.then=="function"?Ma(n):n,e=e.useState()[0],(Ye!==null?Ye.memoizedState:null)!==e&&(Ae.flags|=1024),n}function yf(){var e=mr!==0;return mr=0,e}function vf(e,n,l){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l}function bf(e){if(hr){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}hr=!1}Kn=0,ut=Ye=Ae=null,sl=!1,Ta=mr=0,ll=null}function Ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?Ae.memoizedState=ut=e:ut=ut.next=e,ut}function ot(){if(Ye===null){var e=Ae.alternate;e=e!==null?e.memoizedState:null}else e=Ye.next;var n=ut===null?Ae.memoizedState:ut.next;if(n!==null)ut=n,Ye=e;else{if(e===null)throw Ae.alternate===null?Error(a(467)):Error(a(310));Ye=e,e={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},ut===null?Ae.memoizedState=ut=e:ut=ut.next=e}return ut}function gr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ma(e){var n=Ta;return Ta+=1,ll===null&&(ll=[]),e=tg(ll,e,n),n=Ae,(ut===null?n.memoizedState:ut.next)===null&&(n=n.alternate,z.H=n===null||n.memoizedState===null?Kg:zf),e}function pr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ma(e);if(e.$$typeof===w)return St(e)}throw Error(a(438,String(e)))}function Sf(e){var n=null,l=Ae.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var o=Ae.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(),Ae.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]=ee;return n.index++,l}function Zn(e,n){return typeof n=="function"?n(e):n}function yr(e){var n=ot();return wf(n,Ye,e)}function wf(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 M=b=null,H=null,F=n,ie=!1;do{var oe=F.lane&-536870913;if(oe!==F.lane?(Oe&oe)===oe:(Kn&oe)===oe){var W=F.revertLane;if(W===0)H!==null&&(H=H.next={lane:0,revertLane:0,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null}),oe===Ps&&(ie=!0);else if((Kn&W)===W){F=F.next,W===Ps&&(ie=!0);continue}else oe={lane:0,revertLane:F.revertLane,gesture:null,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},H===null?(M=H=oe,b=d):H=H.next=oe,Ae.lanes|=W,Mi|=W;oe=F.action,fs&&l(d,oe),d=F.hasEagerState?F.eagerState:l(d,oe)}else W={lane:oe,revertLane:F.revertLane,gesture:F.gesture,action:F.action,hasEagerState:F.hasEagerState,eagerState:F.eagerState,next:null},H===null?(M=H=W,b=d):H=H.next=W,Ae.lanes|=oe,Mi|=oe;F=F.next}while(F!==null&&F!==n);if(H===null?b=d:H.next=M,!Vt(d,e.memoizedState)&&(ft=!0,ie&&(l=el,l!==null)))throw l;e.memoizedState=d,e.baseState=b,e.baseQueue=H,o.lastRenderedState=d}return f===null&&(o.lanes=0),[e.memoizedState,o.dispatch]}function xf(e){var n=ot(),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);Vt(d,n.memoizedState)||(ft=!0),n.memoizedState=d,n.baseQueue===null&&(n.baseState=d),l.lastRenderedState=d}return[d,o]}function dg(e,n,l){var o=Ae,f=ot(),d=je;if(d){if(l===void 0)throw Error(a(407));l=l()}else l=n();var b=!Vt((Ye||f).memoizedState,l);if(b&&(f.memoizedState=l,ft=!0),f=f.queue,_f(gg.bind(null,o,f,e),[e]),f.getSnapshot!==n||b||ut!==null&&ut.memoizedState.tag&1){if(o.flags|=2048,al(9,{destroy:void 0},mg.bind(null,o,f,l,n),null),Ze===null)throw Error(a(349));d||(Kn&127)!==0||hg(o,n,l)}return l}function hg(e,n,l){e.flags|=16384,e={getSnapshot:n,value:l},n=Ae.updateQueue,n===null?(n=gr(),Ae.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!Vt(e,l)}catch{return!0}}function yg(e){var n=ns(e,2);n!==null&&$t(n,e,2)}function Ef(e){var n=Ct();if(typeof e=="function"){var l=e;if(e=l(),fs){An(!0);try{l()}finally{An(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,lastRenderedState:e},n}function vg(e,n,l,o){return e.baseState=l,wf(e,Ye,typeof o=="function"?o:Zn)}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)}};z.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=z.T,b={};z.T=b;try{var M=l(f,o),H=z.S;H!==null&&H(b,M),Sg(e,n,M)}catch(F){Nf(e,n,F)}finally{d!==null&&b.types!==null&&(d.types=b.types),z.T=d}}else try{d=l(f,o),Sg(e,n,d)}catch(F){Nf(e,n,F)}}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 Nf(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 Nf(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 Ng(e,n){if(je){var l=Ze.formState;if(l!==null){e:{var o=Ae;if(je){if(Qe){t:{for(var f=Qe,d=an;f.nodeType!==8;){if(!d){f=null;break t}if(f=rn(f.nextSibling),f===null){f=null;break t}}d=f.data,f=d==="F!"||d==="F"?f:null}if(f){Qe=rn(f.nextSibling),o=f.data==="F!";break e}}bi(o)}o=!1}o&&(n=l[0])}}return l=Ct(),l.memoizedState=l.baseState=n,o={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Eg,lastRenderedState:n},l.queue=o,l=Yg.bind(null,Ae,o),o.dispatch=l,o=Ef(!1),d=Of.bind(null,Ae,!1,o.queue),o=Ct(),f={state:n,dispatch:null,action:e,pending:null},o.queue=f,l=hw.bind(null,Ae,f,d,l),f.dispatch=l,o.memoizedState=e,[n,l,!1]}function _g(e){var n=ot();return Ag(n,Ye,e)}function Ag(e,n,l){if(n=wf(e,n,Eg)[0],e=yr(Zn)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var o=Ma(n)}catch(b){throw b===tl?or:b}else o=n;n=ot();var f=n.queue,d=f.dispatch;return l!==n.memoizedState&&(Ae.flags|=2048,al(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=ot(),l=Ye;if(l!==null)return Ag(n,l,e);ot(),n=n.memoizedState,l=ot();var o=l.queue.dispatch;return l.memoizedState=e,[n,o,!1]}function al(e,n,l,o){return e={tag:e,create:l,deps:o,inst:n,next:null},n=Ae.updateQueue,n===null&&(n=gr(),Ae.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 ot().memoizedState}function vr(e,n,l,o){var f=Ct();Ae.flags|=e,f.memoizedState=al(1|n,{destroy:void 0},l,o===void 0?null:o)}function br(e,n,l,o){var f=ot();o=o===void 0?null:o;var d=f.memoizedState.inst;Ye!==null&&o!==null&&gf(o,Ye.memoizedState.deps)?f.memoizedState=al(n,d,l,o):(Ae.flags|=e,f.memoizedState=al(1|n,d,l,o))}function Cg(e,n){vr(8390656,8,e,n)}function _f(e,n){br(2048,8,e,n)}function gw(e){Ae.flags|=4;var n=Ae.updateQueue;if(n===null)n=gr(),Ae.updateQueue=n,n.events=[e];else{var l=n.events;l===null?n.events=[e]:l.push(e)}}function Og(e){var n=ot().memoizedState;return gw({ref:n,nextImpl:e}),function(){if((He&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 jg(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 Lg(e,n,l){l=l!=null?l.concat([e]):null,br(4,4,jg.bind(null,n,e),l)}function Af(){}function Rg(e,n){var l=ot();n=n===void 0?null:n;var o=l.memoizedState;return n!==null&&gf(n,o[1])?o[0]:(l.memoizedState=[e,n],e)}function kg(e,n){var l=ot();n=n===void 0?null:n;var o=l.memoizedState;if(n!==null&&gf(n,o[1]))return o[0];if(o=e(),fs){An(!0);try{e()}finally{An(!1)}}return l.memoizedState=[o,n],o}function Tf(e,n,l){return l===void 0||(Kn&1073741824)!==0&&(Oe&261930)===0?e.memoizedState=n:(e.memoizedState=l,e=Bp(),Ae.lanes|=e,Mi|=e,l)}function Bg(e,n,l,o){return Vt(l,n)?l:il.current!==null?(e=Tf(e,l,o),Vt(e,n)||(ft=!0),e):(Kn&42)===0||(Kn&1073741824)!==0&&(Oe&261930)===0?(ft=!0,e.memoizedState=l):(e=Bp(),Ae.lanes|=e,Mi|=e,n)}function Hg(e,n,l,o,f){var d=B.p;B.p=d!==0&&8>d?d:8;var b=z.T,M={};z.T=M,Of(e,!1,n,l);try{var H=f(),F=z.S;if(F!==null&&F(M,H),H!==null&&typeof H=="object"&&typeof H.then=="function"){var ie=uw(H,o);Ca(e,n,ie,It(e))}else Ca(e,n,o,It(e))}catch(oe){Ca(e,n,{then:function(){},status:"rejected",reason:oe},It())}finally{B.p=d,b!==null&&M.types!==null&&(b.types=M.types),z.T=b}}function pw(){}function Mf(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:Zn,lastRenderedState:G},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zn,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,{},It())}function Cf(){return St(Ka)}function qg(){return ot().memoizedState}function Vg(){return ot().memoizedState}function yw(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var l=It();e=xi(l);var o=Ei(n,e,l);o!==null&&($t(o,n,l),Na(o,n,l)),n={cache:sf()},e.payload=n;return}n=n.return}}function vw(e,n,l){var o=It();l={lane:o,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Sr(e)?Gg(n,l):(l=Ku(e,n,l,o),l!==null&&($t(l,e,o),Xg(l,n,o)))}function Yg(e,n,l){var o=It();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,M=d(b,l);if(f.hasEagerState=!0,f.eagerState=M,Vt(M,b))return er(e,n,f,0),Ze===null&&Po(),!1}catch{}if(l=Ku(e,n,f,o),l!==null)return $t(l,e,o),Xg(l,n,o),!0}return!1}function Of(e,n,l,o){if(o={lane:2,revertLane:rd(),gesture:null,action:o,hasEagerState:!1,eagerState:null,next:null},Sr(e)){if(n)throw Error(a(479))}else n=Ku(e,l,o,2),n!==null&&$t(n,e,2)}function Sr(e){var n=e.alternate;return e===Ae||n!==null&&n===Ae}function Gg(e,n){sl=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,Lo(e,l)}}var Oa={readContext:St,use:pr,useCallback:it,useContext:it,useEffect:it,useImperativeHandle:it,useLayoutEffect:it,useInsertionEffect:it,useMemo:it,useReducer:it,useRef:it,useState:it,useDebugValue:it,useDeferredValue:it,useTransition:it,useSyncExternalStore:it,useId:it,useHostTransitionStatus:it,useFormState:it,useActionState:it,useOptimistic:it,useMemoCache:it,useCacheRefresh:it};Oa.useEffectEvent=it;var Kg={readContext:St,use:pr,useCallback:function(e,n){return Ct().memoizedState=[e,n===void 0?null:n],e},useContext:St,useEffect:Cg,useImperativeHandle:function(e,n,l){l=l!=null?l.concat([e]):null,vr(4194308,4,jg.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=Ct();n=n===void 0?null:n;var o=e();if(fs){An(!0);try{e()}finally{An(!1)}}return l.memoizedState=[o,n],o},useReducer:function(e,n,l){var o=Ct();if(l!==void 0){var f=l(n);if(fs){An(!0);try{l(n)}finally{An(!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,Ae,e),[o.memoizedState,e]},useRef:function(e){var n=Ct();return e={current:e},n.memoizedState=e},useState:function(e){e=Ef(e);var n=e.queue,l=Yg.bind(null,Ae,n);return n.dispatch=l,[e.memoizedState,l]},useDebugValue:Af,useDeferredValue:function(e,n){var l=Ct();return Tf(l,e,n)},useTransition:function(){var e=Ef(!1);return e=Hg.bind(null,Ae,e.queue,!0,!1),Ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,l){var o=Ae,f=Ct();if(je){if(l===void 0)throw Error(a(407));l=l()}else{if(l=n(),Ze===null)throw Error(a(349));(Oe&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,al(9,{destroy:void 0},mg.bind(null,o,d,l,n),null),l},useId:function(){var e=Ct(),n=Ze.identifierPrefix;if(je){var l=Cn,o=Mn;l=(o&~(1<<32-Mt(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:Cf,useFormState:Ng,useActionState:Ng,useOptimistic:function(e){var n=Ct();n.memoizedState=n.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=Of.bind(null,Ae,!0,l),l.dispatch=n,[e,n]},useMemoCache:Sf,useCacheRefresh:function(){return Ct().memoizedState=yw.bind(null,Ae)},useEffectEvent:function(e){var n=Ct(),l={impl:e};return n.memoizedState=l,function(){if((He&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},zf={readContext:St,use:pr,useCallback:Rg,useContext:St,useEffect:_f,useImperativeHandle:Lg,useInsertionEffect:zg,useLayoutEffect:Dg,useMemo:kg,useReducer:yr,useRef:Mg,useState:function(){return yr(Zn)},useDebugValue:Af,useDeferredValue:function(e,n){var l=ot();return Bg(l,Ye.memoizedState,e,n)},useTransition:function(){var e=yr(Zn)[0],n=ot().memoizedState;return[typeof e=="boolean"?e:Ma(e),n]},useSyncExternalStore:dg,useId:qg,useHostTransitionStatus:Cf,useFormState:_g,useActionState:_g,useOptimistic:function(e,n){var l=ot();return vg(l,Ye,e,n)},useMemoCache:Sf,useCacheRefresh:Vg};zf.useEffectEvent=Og;var Zg={readContext:St,use:pr,useCallback:Rg,useContext:St,useEffect:_f,useImperativeHandle:Lg,useInsertionEffect:zg,useLayoutEffect:Dg,useMemo:kg,useReducer:xf,useRef:Mg,useState:function(){return xf(Zn)},useDebugValue:Af,useDeferredValue:function(e,n){var l=ot();return Ye===null?Tf(l,e,n):Bg(l,Ye.memoizedState,e,n)},useTransition:function(){var e=xf(Zn)[0],n=ot().memoizedState;return[typeof e=="boolean"?e:Ma(e),n]},useSyncExternalStore:dg,useId:qg,useHostTransitionStatus:Cf,useFormState:Tg,useActionState:Tg,useOptimistic:function(e,n){var l=ot();return Ye!==null?vg(l,Ye,e,n):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Sf,useCacheRefresh:Vg};Zg.useEffectEvent=Og;function Df(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 jf={enqueueSetState:function(e,n,l){e=e._reactInternals;var o=It(),f=xi(o);f.payload=n,l!=null&&(f.callback=l),n=Ei(e,f,o),n!==null&&($t(n,e,o),Na(n,e,o))},enqueueReplaceState:function(e,n,l){e=e._reactInternals;var o=It(),f=xi(o);f.tag=1,f.payload=n,l!=null&&(f.callback=l),n=Ei(e,f,o),n!==null&&($t(n,e,o),Na(n,e,o))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var l=It(),o=xi(l);o.tag=2,n!=null&&(o.callback=n),n=Ei(e,o,l),n!==null&&($t(n,e,l),Na(n,e,l))}};function Ig(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 Qg(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&&jf.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 Fg(e){Wo(e)}function Jg(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 Lf(e,n,l){return l=xi(l),l.tag=3,l.payload={element:null},l.callback=function(){wr(e,n)},l}function ep(e){return e=xi(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"&&(Ci===null?Ci=new Set([this]):Ci.add(this));var M=o.stack;this.componentDidCatch(o.value,{componentStack:M!==null?M:""})})}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&&Ws(n,l,f,!0),l=Gt.current,l!==null){switch(l.tag){case 31:case 13:return on===null?jr():l.alternate===null&&st===0&&(st=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),ld(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)),ld(e,o,f)),!1}throw Error(a(435,l.tag))}return ld(e,o,f),jr(),!1}if(je)return n=Gt.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=f,o!==Wu&&(e=Error(a(422),{cause:o}),ba(nn(e,l)))):(o!==Wu&&(n=Error(a(423),{cause:o}),ba(nn(n,l))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,o=nn(o,l),f=Lf(e.stateNode,o,f),uf(e,f),st!==4&&(st=2)),!1;var d=Error(a(520),{cause:o});if(d=nn(d,l),Ha===null?Ha=[d]:Ha.push(d),st!==4&&(st=2),n===null)return!0;o=nn(o,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,e=f&-f,l.lanes|=e,e=Lf(l.stateNode,o,e),uf(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"&&(Ci===null||!Ci.has(d))))return l.flags|=65536,f&=-f,l.lanes|=f,f=ep(f),tp(f,e,l,o),uf(l,f),!1}l=l.return}while(l!==null);return!1}var Rf=Error(a(461)),ft=!1;function wt(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 M in o)M!=="ref"&&(b[M]=o[M])}else b=o;return as(n),o=pf(e,n,l,b,d,f),M=yf(),e!==null&&!ft?(vf(e,n,f),In(e,n,f)):(je&&M&&Fu(n),n.flags|=1,wt(e,n,o,f),n.child)}function ip(e,n,l,o,f){if(e===null){var d=l.type;return typeof d=="function"&&!Zu(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,!Yf(e,f)){var b=d.memoizedProps;if(l=l.compare,l=l!==null?l:pa,l(b,o)&&e.ref===n.ref)return In(e,n,f)}return n.flags|=1,e=Vn(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(ft=!1,n.pendingProps=o=d,Yf(e,f))(e.flags&131072)!==0&&(ft=!0);else return n.lanes=e.lanes,In(e,n,f)}return kf(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):df(),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),df(),_i());return wt(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=af();return d=d===null?null:{parent:ct._currentValue,pool:d},n.memoizedState={baseLanes:l,cachePool:d},e!==null&&ar(n,null),df(),cg(n),e!==null&&Ws(e,n,o,!0),n.childLanes=f,null}function xr(e,n){return n=Nr({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,Xt(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(je){if(o.mode==="hidden")return e=xr(n,o),n.lanes=536870912,za(null,e);if(mf(n),(e=Qe)?(e=by(e,an),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:yi!==null?{id:Mn,overflow:Cn}:null,retryLane:536870912,hydrationErrors:null},l=Gm(e),l.return=n,n.child=l,bt=n,Qe=null)):e=null,e===null)throw bi(n);return n.lanes=536870912,null}return xr(n,o)}var d=e.memoizedState;if(d!==null){var b=d.dehydrated;if(mf(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(ft||Ws(e,n,l,!1),f=(l&e.childLanes)!==0,ft||f){if(o=Ze,o!==null&&(b=Ro(o,l),b!==0&&b!==d.retryLane))throw d.retryLane=b,ns(e,b),$t(o,e,b),Rf;jr(),n=op(e,n,l)}else e=d.treeContext,Qe=rn(b.nextSibling),bt=n,je=!0,vi=null,an=!1,e!==null&&Zm(n,e),n=xr(n,o),n.flags|=4096;return n}return e=Vn(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 kf(e,n,l,o,f){return as(n),l=pf(e,n,l,o,void 0,f),o=yf(),e!==null&&!ft?(vf(e,n,f),In(e,n,f)):(je&&o&&Fu(n),n.flags|=1,wt(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=yf(),e!==null&&!ft?(vf(e,n,d),In(e,n,d)):(je&&o&&Fu(n),n.flags|=1,wt(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=St(b)),d=new l(o,d),n.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=jf,n.stateNode=d,d._reactInternals=n,d=n.stateNode,d.props=o,d.state=n.memoizedState,d.refs={},rf(n),b=l.contextType,d.context=typeof b=="object"&&b!==null?St(b):Is,d.state=n.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(Df(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&&jf.enqueueReplaceState(d,d.state,null),Aa(n,o,d,f),_a(),d.state=n.memoizedState),typeof d.componentDidMount=="function"&&(n.flags|=4194308),o=!0}else if(e===null){d=n.stateNode;var M=n.memoizedProps,H=ds(l,M);d.props=H;var F=d.context,ie=l.contextType;b=Is,typeof ie=="object"&&ie!==null&&(b=St(ie));var oe=l.getDerivedStateFromProps;ie=typeof oe=="function"||typeof d.getSnapshotBeforeUpdate=="function",M=n.pendingProps!==M,ie||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(M||F!==b)&&Qg(n,d,o,b),wi=!1;var W=n.memoizedState;d.state=W,Aa(n,o,d,f),_a(),F=n.memoizedState,M||W!==F||wi?(typeof oe=="function"&&(Df(n,l,oe,o),F=n.memoizedState),(H=wi||Ig(n,l,H,o,W,F,b))?(ie||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=F),d.props=o,d.state=F,d.context=b,o=H):(typeof d.componentDidMount=="function"&&(n.flags|=4194308),o=!1)}else{d=n.stateNode,cf(e,n),b=n.memoizedProps,ie=ds(l,b),d.props=ie,oe=n.pendingProps,W=d.context,F=l.contextType,H=Is,typeof F=="object"&&F!==null&&(H=St(F)),M=l.getDerivedStateFromProps,(F=typeof M=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(b!==oe||W!==H)&&Qg(n,d,o,H),wi=!1,W=n.memoizedState,d.state=W,Aa(n,o,d,f),_a();var P=n.memoizedState;b!==oe||W!==P||wi||e!==null&&e.dependencies!==null&&sr(e.dependencies)?(typeof M=="function"&&(Df(n,l,M,o),P=n.memoizedState),(ie=wi||Ig(n,l,ie,o,W,P,H)||e!==null&&e.dependencies!==null&&sr(e.dependencies))?(F||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(o,P,H),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(o,P,H)),typeof d.componentDidUpdate=="function"&&(n.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&W===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&W===e.memoizedState||(n.flags|=1024),n.memoizedProps=o,n.memoizedState=P),d.props=o,d.state=P,d.context=H,o=ie):(typeof d.componentDidUpdate!="function"||b===e.memoizedProps&&W===e.memoizedState||(n.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||b===e.memoizedProps&&W===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)):wt(e,n,l,f),n.memoizedState=d.state,e=n.child):e=In(e,n,f),e}function up(e,n,l,o){return ss(),n.flags|=256,wt(e,n,l,o),n.child}var Bf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Hf(e){return{baseLanes:e,cachePool:Pm()}}function $f(e,n,l){return e=e!==null?e.childLanes&~l:0,n&&(e|=Zt),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:(at.current&2)!==0),b&&(f=!0,n.flags&=-129),b=(n.flags&32)!==0,n.flags&=-33,e===null){if(je){if(f?Ni(n):_i(),(e=Qe)?(e=by(e,an),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:yi!==null?{id:Mn,overflow:Cn}:null,retryLane:536870912,hydrationErrors:null},l=Gm(e),l.return=n,n.child=l,bt=n,Qe=null)):e=null,e===null)throw bi(n);return wd(e)?n.lanes=32:n.lanes=536870912,null}var M=o.children;return o=o.fallback,f?(_i(),f=n.mode,M=Nr({mode:"hidden",children:M},f),o=is(o,f,l,null),M.return=n,o.return=n,M.sibling=o,n.child=M,o=n.child,o.memoizedState=Hf(l),o.childLanes=$f(e,b,l),n.memoizedState=Bf,za(null,o)):(Ni(n),Uf(n,M))}var H=e.memoizedState;if(H!==null&&(M=H.dehydrated,M!==null)){if(d)n.flags&256?(Ni(n),n.flags&=-257,n=qf(e,n,l)):n.memoizedState!==null?(_i(),n.child=e.child,n.flags|=128,n=null):(_i(),M=o.fallback,f=n.mode,o=Nr({mode:"visible",children:o.children},f),M=is(M,f,l,null),M.flags|=2,o.return=n,M.return=n,o.sibling=M,n.child=o,us(n,e.child,null,l),o=n.child,o.memoizedState=Hf(l),o.childLanes=$f(e,b,l),n.memoizedState=Bf,n=za(null,o));else if(Ni(n),wd(M)){if(b=M.nextSibling&&M.nextSibling.dataset,b)var F=b.dgst;b=F,o=Error(a(419)),o.stack="",o.digest=b,ba({value:o,source:null,stack:null}),n=qf(e,n,l)}else if(ft||Ws(e,n,l,!1),b=(l&e.childLanes)!==0,ft||b){if(b=Ze,b!==null&&(o=Ro(b,l),o!==0&&o!==H.retryLane))throw H.retryLane=o,ns(e,o),$t(b,e,o),Rf;Sd(M)||jr(),n=qf(e,n,l)}else Sd(M)?(n.flags|=192,n.child=e.child,n=null):(e=H.treeContext,Qe=rn(M.nextSibling),bt=n,je=!0,vi=null,an=!1,e!==null&&Zm(n,e),n=Uf(n,o.children),n.flags|=4096);return n}return f?(_i(),M=o.fallback,f=n.mode,H=e.child,F=H.sibling,o=Vn(H,{mode:"hidden",children:o.children}),o.subtreeFlags=H.subtreeFlags&65011712,F!==null?M=Vn(F,M):(M=is(M,f,l,null),M.flags|=2),M.return=n,o.return=n,o.sibling=M,n.child=o,za(null,o),o=n.child,M=e.child.memoizedState,M===null?M=Hf(l):(f=M.cachePool,f!==null?(H=ct._currentValue,f=f.parent!==H?{parent:H,pool:H}:f):f=Pm(),M={baseLanes:M.baseLanes|l,cachePool:f}),o.memoizedState=M,o.childLanes=$f(e,b,l),n.memoizedState=Bf,za(e.child,o)):(Ni(n),l=e.child,e=l.sibling,l=Vn(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 Uf(e,n){return n=Nr({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Nr(e,n){return e=Yt(22,e,null,n),e.lanes=0,e}function qf(e,n,l){return us(n,e.child,null,l),e=Uf(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),tf(e.return,n,l)}function Vf(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=at.current,M=(b&2)!==0;if(M?(b=b&1|2,n.flags|=128):b&=1,J(at,b),wt(e,n,o,l),o=je?va:0,!M&&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),Vf(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}Vf(n,!0,l,null,d,o);break;case"together":Vf(n,!1,null,null,void 0,o);break;default:n.memoizedState=null}return n.child}function In(e,n,l){if(e!==null&&(n.dependencies=e.dependencies),Mi|=n.lanes,(l&n.childLanes)===0)if(e!==null){if(Ws(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=Vn(e,e.pendingProps),n.child=l,l.return=n;e.sibling!==null;)e=e.sibling,l=l.sibling=Vn(e,e.pendingProps),l.return=n;l.sibling=null}return n.child}function Yf(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:ne(n,n.stateNode.containerInfo),Si(n,ct,e.memoizedState.cache),ss();break;case 27:case 5:xe(n);break;case 4:ne(n,n.stateNode.containerInfo);break;case 10:Si(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,mf(n),null;break;case 13:var o=n.memoizedState;if(o!==null)return o.dehydrated!==null?(Ni(n),n.flags|=128,null):(l&n.child.childLanes)!==0?fp(e,n,l):(Ni(n),e=In(e,n,l),e!==null?e.sibling:null);Ni(n);break;case 19:var f=(e.flags&128)!==0;if(o=(l&n.childLanes)!==0,o||(Ws(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),J(at,at.current),o)break;return null;case 22:return n.lanes=0,lp(e,n,l,n.pendingProps);case 24:Si(n,ct,e.memoizedState.cache)}return In(e,n,l)}function mp(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps)ft=!0;else{if(!Yf(e,l)&&(n.flags&128)===0)return ft=!1,ww(e,n,l);ft=(e.flags&131072)!==0}else ft=!1,je&&(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")Zu(e)?(o=ds(e,o),n.tag=1,n=cp(null,n,e,o,l)):(n.tag=0,n=kf(null,n,e,o,l));else{if(e!=null){var f=e.$$typeof;if(f===O){n.tag=11,n=np(null,n,e,o,l);break e}else if(f===R){n.tag=14,n=ip(null,n,e,o,l);break e}}throw n=L(e)||e,Error(a(306,n,""))}}return n;case 0:return kf(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(ne(n,n.stateNode.containerInfo),e===null)throw Error(a(387));o=n.pendingProps;var d=n.memoizedState;f=d.element,cf(e,n),Aa(n,o,null,l);var b=n.memoizedState;if(o=b.cache,Si(n,ct,o),o!==d.cache&&nf(n,[ct],l,!0),_a(),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=nn(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,Qe=rn(e.firstChild),bt=n,je=!0,vi=null,an=!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=In(e,n,l);break e}wt(e,n,o,l)}n=n.child}return n;case 26:return Er(e,n),e===null?(l=_y(n.type,null,n.pendingProps,null))?n.memoizedState=l:je||(l=n.type,e=n.pendingProps,o=Ur(de.current).createElement(l),o[mt]=n,o[Et]=e,xt(o,l,e),rt(o),n.stateNode=o):n.memoizedState=_y(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return xe(n),e===null&&je&&(o=n.stateNode=xy(n.type,n.pendingProps,de.current),bt=n,an=!0,f=Qe,ji(n.type)?(xd=f,Qe=rn(o.firstChild)):Qe=f),wt(e,n,n.pendingProps.children,l),Er(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&je&&((f=o=Qe)&&(o=Jw(o,n.type,n.pendingProps,an),o!==null?(n.stateNode=o,bt=n,Qe=rn(o.firstChild),an=!1,f=!0):f=!1),f||bi(n)),xe(n),f=n.type,d=n.pendingProps,b=e!==null?e.memoizedProps:null,o=d.children,yd(f,d)?o=null:b!==null&&yd(f,b)&&(n.flags|=32),n.memoizedState!==null&&(f=pf(e,n,dw,null,null,l),Ka._currentValue=f),Er(e,n),wt(e,n,o,l),n.child;case 6:return e===null&&je&&((e=l=Qe)&&(l=Ww(l,n.pendingProps,an),l!==null?(n.stateNode=l,bt=n,Qe=null,e=!0):e=!1),e||bi(n)),null;case 13:return fp(e,n,l);case 4:return ne(n,n.stateNode.containerInfo),o=n.pendingProps,e===null?n.child=us(n,null,o,l):wt(e,n,o,l),n.child;case 11:return np(e,n,n.type,n.pendingProps,l);case 7:return wt(e,n,n.pendingProps,l),n.child;case 8:return wt(e,n,n.pendingProps.children,l),n.child;case 12:return wt(e,n,n.pendingProps.children,l),n.child;case 10:return o=n.pendingProps,Si(n,n.type,o.value),wt(e,n,o.children,l),n.child;case 9:return f=n.type._context,o=n.pendingProps.children,as(n),f=St(f),o=o(f),n.flags|=1,wt(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=St(ct),e===null?(f=af(),f===null&&(f=Ze,d=sf(),f.pooledCache=d,d.refCount++,d!==null&&(f.pooledCacheLanes|=l),f=d),n.memoizedState={parent:o,cache:f},rf(n),Si(n,ct,f)):((e.lanes&l)!==0&&(cf(e,n),Aa(n,null,null,l),_a()),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),Si(n,ct,o)):(o=d.cache,Si(n,ct,o),o!==f.cache&&nf(n,[ct],l,!0))),wt(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 Gf(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,of}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,of}function _r(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Do():536870912,e.lanes|=n,ul|=n)}function Da(e,n){if(!je)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 Fe(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(Ju(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Fe(n),null;case 1:return Fe(n),null;case 3:return l=n.stateNode,o=null,e!==null&&(o=e.memoizedState.cache),n.memoizedState.cache!==o&&(n.flags|=2048),Xn(ct),ue(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Js(n)?Qn(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,Pu())),Fe(n),null;case 26:var f=n.type,d=n.memoizedState;return e===null?(Qn(n),d!==null?(Fe(n),gp(n,d)):(Fe(n),Gf(n,f,null,o,l))):d?d!==e.memoizedState?(Qn(n),Fe(n),gp(n,d)):(Fe(n),n.flags&=-16777217):(e=e.memoizedProps,e!==o&&Qn(n),Fe(n),Gf(n,f,e,o,l)),null;case 27:if(ye(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 Fe(n),null}e=se.current,Js(n)?Im(n):(e=xy(f,o,l),n.stateNode=e,Qn(n))}return Fe(n),null;case 5:if(ye(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 Fe(n),null}if(d=se.current,Js(n))Im(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[mt]=n,d[Et]=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(xt(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 Fe(n),Gf(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,Js(n)){if(e=n.stateNode,l=n.memoizedProps,o=null,f=bt,f!==null)switch(f.tag){case 27:case 5:o=f.memoizedProps}e[mt]=n,e=!!(e.nodeValue===l||o!==null&&o.suppressHydrationWarning===!0||fy(e.nodeValue,l)),e||bi(n,!0)}else e=Ur(e).createTextNode(o),e[mt]=n,n.stateNode=e}return Fe(n),null;case 31:if(l=n.memoizedState,e===null||e.memoizedState!==null){if(o=Js(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[mt]=n}else ss(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Fe(n),e=!1}else l=Pu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return n.flags&256?(Xt(n),n):(Xt(n),null);if((n.flags&128)!==0)throw Error(a(558))}return Fe(n),null;case 13:if(o=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=Js(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[mt]=n}else ss(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Fe(n),f=!1}else f=Pu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return n.flags&256?(Xt(n),n):(Xt(n),null)}return Xt(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),_r(n,n.updateQueue),Fe(n),null);case 4:return ue(),e===null&&dd(n.stateNode.containerInfo),Fe(n),null;case 10:return Xn(n.type),Fe(n),null;case 19:if($(at),o=n.memoizedState,o===null)return Fe(n),null;if(f=(n.flags&128)!==0,d=o.rendering,d===null)if(f)Da(o,!1);else{if(st!==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,_r(n,e),n.subtreeFlags=0,e=l,l=n.child;l!==null;)Ym(l,e),l=l.sibling;return J(at,at.current&1|2),je&&Yn(n,o.treeForkCount),n.child}e=e.sibling}o.tail!==null&&Re()>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,_r(n,e),Da(o,!0),o.tail===null&&o.tailMode==="hidden"&&!d.alternate&&!je)return Fe(n),null}else 2*Re()-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=Re(),e.sibling=null,l=at.current,J(at,f?l&1|2:l&1),je&&Yn(n,o.treeForkCount),e):(Fe(n),null);case 22:case 23:return Xt(n),hf(),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&&(Fe(n),n.subtreeFlags&6&&(n.flags|=8192)):Fe(n),l=n.updateQueue,l!==null&&_r(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),Xn(ct),Fe(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function Ew(e,n){switch(Ju(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Xn(ct),ue(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return ye(n),null;case 31:if(n.memoizedState!==null){if(Xt(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(Xt(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 $(at),null;case 4:return ue(),null;case 10:return Xn(n.type),null;case 22:case 23:return Xt(n),hf(),e!==null&&$(os),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Xn(ct),null;case 25:return null;default:return null}}function pp(e,n){switch(Ju(n),n.tag){case 3:Xn(ct),ue();break;case 26:case 27:case 5:ye(n);break;case 4:ue();break;case 31:n.memoizedState!==null&&Xt(n);break;case 13:Xt(n);break;case 19:$(at);break;case 10:Xn(n.type);break;case 22:case 23:Xt(n),hf(),e!==null&&$(os);break;case 24:Xn(ct)}}function ja(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(M){Ue(n,n.return,M)}}function Ai(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,M=b.destroy;if(M!==void 0){b.destroy=void 0,f=n;var H=l,F=M;try{F()}catch(ie){Ue(f,H,ie)}}}o=o.next}while(o!==d)}}catch(ie){Ue(n,n.return,ie)}}function yp(e){var n=e.updateQueue;if(n!==null){var l=e.stateNode;try{og(n,l)}catch(o){Ue(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){Ue(e,n,o)}}function La(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){Ue(e,n,f)}}function On(e,n){var l=e.ref,o=e.refCleanup;if(l!==null)if(typeof o=="function")try{o()}catch(f){Ue(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){Ue(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){Ue(e,e.return,f)}}function Xf(e,n,l){try{var o=e.stateNode;Xw(o,e.type,l,n),o[Et]=n}catch(f){Ue(e,e.return,f)}}function Sp(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&ji(e.type)||e.tag===4}function Kf(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&&ji(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 Zf(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=Un));else if(o!==4&&(o===27&&ji(e.type)&&(l=e.stateNode,n=null),e=e.child,e!==null))for(Zf(e,n,l),e=e.sibling;e!==null;)Zf(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&&ji(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]);xt(n,o,l),n[mt]=e,n[Et]=l}catch(d){Ue(e,e.return,d)}}var Fn=!1,dt=!1,If=!1,xp=typeof WeakSet=="function"?WeakSet:Set,yt=null;function Nw(e,n){if(e=e.containerInfo,gd=Zr,e=Lm(e),Uu(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,M=-1,H=-1,F=0,ie=0,oe=e,W=null;t:for(;;){for(var P;oe!==l||f!==0&&oe.nodeType!==3||(M=b+f),oe!==d||o!==0&&oe.nodeType!==3||(H=b+o),oe.nodeType===3&&(b+=oe.nodeValue.length),(P=oe.firstChild)!==null;)W=oe,oe=P;for(;;){if(oe===e)break t;if(W===l&&++F===f&&(M=b),W===d&&++ie===o&&(H=b),(P=oe.nextSibling)!==null)break;oe=W,W=oe.parentNode}oe=P}l=M===-1||H===-1?null:{start:M,end:H}}else l=null}l=l||{start:0,end:0}}else l=null;for(pd={focusedElem:e,selectionRange:l},Zr=!1,yt=n;yt!==null;)if(n=yt,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,yt=e;else for(;yt!==null;){switch(n=yt,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 me=ds(l.type,f);e=o.getSnapshotBeforeUpdate(me,d),o.__reactInternalSnapshotBeforeUpdate=e}catch(Se){Ue(l,l.return,Se)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,l=e.nodeType,l===9)bd(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":bd(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,yt=e;break}yt=n.return}}function Ep(e,n,l){var o=l.flags;switch(l.tag){case 0:case 11:case 15:Wn(e,l),o&4&&ja(5,l);break;case 1:if(Wn(e,l),o&4)if(e=l.stateNode,n===null)try{e.componentDidMount()}catch(b){Ue(l,l.return,b)}else{var f=ds(l.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(f,n,e.__reactInternalSnapshotBeforeUpdate)}catch(b){Ue(l,l.return,b)}}o&64&&yp(l),o&512&&La(l,l.return);break;case 3:if(Wn(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){Ue(l,l.return,b)}}break;case 27:n===null&&o&4&&wp(l);case 26:case 5:Wn(e,l),n===null&&o&4&&bp(l),o&512&&La(l,l.return);break;case 12:Wn(e,l);break;case 31:Wn(e,l),o&4&&Ap(e,l);break;case 13:Wn(e,l),o&4&&Tp(e,l),o&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=jw.bind(null,l),Pw(e,l))));break;case 22:if(o=l.memoizedState!==null||Fn,!o){n=n!==null&&n.memoizedState!==null||dt,f=Fn;var d=dt;Fn=o,(dt=n)&&!d?Pn(e,l,(l.subtreeFlags&8772)!==0):Wn(e,l),Fn=f,dt=d}break;case 30:break;default:Wn(e,l)}}function Np(e){var n=e.alternate;n!==null&&(e.alternate=null,Np(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 Je=null,Rt=!1;function Jn(e,n,l){for(l=l.child;l!==null;)_p(e,n,l),l=l.sibling}function _p(e,n,l){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(Qi,l)}catch{}switch(l.tag){case 26:dt||On(l,n),Jn(e,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:dt||On(l,n);var o=Je,f=Rt;ji(l.type)&&(Je=l.stateNode,Rt=!1),Jn(e,n,l),Ya(l.stateNode),Je=o,Rt=f;break;case 5:dt||On(l,n);case 6:if(o=Je,f=Rt,Je=null,Jn(e,n,l),Je=o,Rt=f,Je!==null)if(Rt)try{(Je.nodeType===9?Je.body:Je.nodeName==="HTML"?Je.ownerDocument.body:Je).removeChild(l.stateNode)}catch(d){Ue(l,n,d)}else try{Je.removeChild(l.stateNode)}catch(d){Ue(l,n,d)}break;case 18:Je!==null&&(Rt?(e=Je,yy(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),vl(e)):yy(Je,l.stateNode));break;case 4:o=Je,f=Rt,Je=l.stateNode.containerInfo,Rt=!0,Jn(e,n,l),Je=o,Rt=f;break;case 0:case 11:case 14:case 15:Ai(2,l,n),dt||Ai(4,l,n),Jn(e,n,l);break;case 1:dt||(On(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:dt=(o=dt)||l.memoizedState!==null,Jn(e,n,l),dt=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{vl(e)}catch(l){Ue(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{vl(e)}catch(l){Ue(n,n.return,l)}}function _w(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=_w(e);n.forEach(function(o){if(!l.has(o)){l.add(o);var f=Lw.bind(null,e,o);o.then(f,f)}})}function kt(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,M=b;e:for(;M!==null;){switch(M.tag){case 27:if(ji(M.type)){Je=M.stateNode,Rt=!1;break e}break;case 5:Je=M.stateNode,Rt=!1;break e;case 3:case 4:Je=M.stateNode.containerInfo,Rt=!0;break e}M=M.return}if(Je===null)throw Error(a(160));_p(d,b,f),Je=null,Rt=!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 gn=null;function Mp(e,n){var l=e.alternate,o=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:kt(n,e),Bt(e),o&4&&(Ai(3,e,e.return),ja(3,e),Ai(5,e,e.return));break;case 1:kt(n,e),Bt(e),o&512&&(dt||l===null||On(l,l.return)),o&64&&Fn&&(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=gn;if(kt(n,e),Bt(e),o&512&&(dt||l===null||On(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[mt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=f.createElement(o),f.head.insertBefore(d,f.querySelector("head > title"))),xt(d,o,l),d[mt]=e,rt(d),o=d;break e;case"link":var b=My("link","href",f).get(o+(l.href||""));if(b){for(var M=0;M<b.length;M++)if(d=b[M],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(M,1);break t}}d=f.createElement(o),xt(d,o,l),f.head.appendChild(d);break;case"meta":if(b=My("meta","content",f).get(o+(l.content||""))){for(M=0;M<b.length;M++)if(d=b[M],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(M,1);break t}}d=f.createElement(o),xt(d,o,l),f.head.appendChild(d);break;default:throw Error(a(468,o))}d[mt]=e,rt(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&&Xf(e,e.memoizedProps,l.memoizedProps)}break;case 27:kt(n,e),Bt(e),o&512&&(dt||l===null||On(l,l.return)),l!==null&&o&4&&Xf(e,e.memoizedProps,l.memoizedProps);break;case 5:if(kt(n,e),Bt(e),o&512&&(dt||l===null||On(l,l.return)),e.flags&32){f=e.stateNode;try{qs(f,"")}catch(me){Ue(e,e.return,me)}}o&4&&e.stateNode!=null&&(f=e.memoizedProps,Xf(e,f,l!==null?l.memoizedProps:f)),o&1024&&(If=!0);break;case 6:if(kt(n,e),Bt(e),o&4){if(e.stateNode===null)throw Error(a(162));o=e.memoizedProps,l=e.stateNode;try{l.nodeValue=o}catch(me){Ue(e,e.return,me)}}break;case 3:if(Yr=null,f=gn,gn=qr(n.containerInfo),kt(n,e),gn=f,Bt(e),o&4&&l!==null&&l.memoizedState.isDehydrated)try{vl(n.containerInfo)}catch(me){Ue(e,e.return,me)}If&&(If=!1,Cp(e));break;case 4:o=gn,gn=qr(e.stateNode.containerInfo),kt(n,e),Bt(e),gn=o;break;case 12:kt(n,e),Bt(e);break;case 31:kt(n,e),Bt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Tr(e,o)));break;case 13:kt(n,e),Bt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Cr=Re()),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Tr(e,o)));break;case 22:f=e.memoizedState!==null;var H=l!==null&&l.memoizedState!==null,F=Fn,ie=dt;if(Fn=F||f,dt=ie||H,kt(n,e),dt=ie,Fn=F,Bt(e),o&8192)e:for(n=e.stateNode,n._visibility=f?n._visibility&-2:n._visibility|1,f&&(l===null||H||Fn||dt||hs(e)),l=null,n=e;;){if(n.tag===5||n.tag===26){if(l===null){H=l=n;try{if(d=H.stateNode,f)b=d.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{M=H.stateNode;var oe=H.memoizedProps.style,W=oe!=null&&oe.hasOwnProperty("display")?oe.display:null;M.style.display=W==null||typeof W=="boolean"?"":(""+W).trim()}}catch(me){Ue(H,H.return,me)}}}else if(n.tag===6){if(l===null){H=n;try{H.stateNode.nodeValue=f?"":H.memoizedProps}catch(me){Ue(H,H.return,me)}}}else if(n.tag===18){if(l===null){H=n;try{var P=H.stateNode;f?vy(P,!0):vy(H.stateNode,!1)}catch(me){Ue(H,H.return,me)}}}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:kt(n,e),Bt(e),o&4&&(o=e.updateQueue,o!==null&&(e.updateQueue=null,Tr(e,o)));break;case 30:break;case 21:break;default:kt(n,e),Bt(e)}}function Bt(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=Kf(e);Ar(e,d,f);break;case 5:var b=l.stateNode;l.flags&32&&(qs(b,""),l.flags&=-33);var M=Kf(e);Ar(e,M,b);break;case 3:case 4:var H=l.stateNode.containerInfo,F=Kf(e);Zf(e,F,H);break;default:throw Error(a(161))}}catch(ie){Ue(e,e.return,ie)}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 Wn(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:Ai(4,n,n.return),hs(n);break;case 1:On(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:On(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 Pn(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:Pn(f,d,l),ja(4,d);break;case 1:if(Pn(f,d,l),o=d,f=o.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(F){Ue(o,o.return,F)}if(o=d,f=o.updateQueue,f!==null){var M=o.stateNode;try{var H=f.shared.hiddenCallbacks;if(H!==null)for(f.shared.hiddenCallbacks=null,f=0;f<H.length;f++)ag(H[f],M)}catch(F){Ue(o,o.return,F)}}l&&b&64&&yp(d),La(d,d.return);break;case 27:wp(d);case 26:case 5:Pn(f,d,l),l&&o===null&&b&4&&bp(d),La(d,d.return);break;case 12:Pn(f,d,l);break;case 31:Pn(f,d,l),l&&b&4&&Ap(f,d);break;case 13:Pn(f,d,l),l&&b&4&&Tp(f,d);break;case 22:d.memoizedState===null&&Pn(f,d,l),La(d,d.return);break;case 30:break;default:Pn(f,d,l)}n=n.sibling}}function Qf(e,n){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&Sa(l))}function Ff(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 pn(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:pn(e,n,l,o),f&2048&&ja(9,n);break;case 1:pn(e,n,l,o);break;case 3:pn(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){pn(e,n,l,o),e=n.stateNode;try{var d=n.memoizedProps,b=d.id,M=d.onPostCommit;typeof M=="function"&&M(b,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(H){Ue(n,n.return,H)}}else pn(e,n,l,o);break;case 31:pn(e,n,l,o);break;case 13:pn(e,n,l,o);break;case 23:break;case 22:d=n.stateNode,b=n.alternate,n.memoizedState!==null?d._visibility&2?pn(e,n,l,o):Ra(e,n):d._visibility&2?pn(e,n,l,o):(d._visibility|=2,ol(e,n,l,o,(n.subtreeFlags&10256)!==0||!1)),f&2048&&Qf(b,n);break;case 24:pn(e,n,l,o),f&2048&&Ff(n.alternate,n);break;default:pn(e,n,l,o)}}function ol(e,n,l,o,f){for(f=f&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var d=e,b=n,M=l,H=o,F=b.flags;switch(b.tag){case 0:case 11:case 15:ol(d,b,M,H,f),ja(8,b);break;case 23:break;case 22:var ie=b.stateNode;b.memoizedState!==null?ie._visibility&2?ol(d,b,M,H,f):Ra(d,b):(ie._visibility|=2,ol(d,b,M,H,f)),f&&F&2048&&Qf(b.alternate,b);break;case 24:ol(d,b,M,H,f),f&&F&2048&&Ff(b.alternate,b);break;default:ol(d,b,M,H,f)}n=n.sibling}}function Ra(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:Ra(l,o),f&2048&&Qf(o.alternate,o);break;case 24:Ra(l,o),f&2048&&Ff(o.alternate,o);break;default:Ra(l,o)}n=n.sibling}}var ka=8192;function rl(e,n,l){if(e.subtreeFlags&ka)for(e=e.child;e!==null;)zp(e,n,l),e=e.sibling}function zp(e,n,l){switch(e.tag){case 26:rl(e,n,l),e.flags&ka&&e.memoizedState!==null&&fx(l,gn,e.memoizedState,e.memoizedProps);break;case 5:rl(e,n,l);break;case 3:case 4:var o=gn;gn=qr(e.stateNode.containerInfo),rl(e,n,l),gn=o;break;case 22:e.memoizedState===null&&(o=e.alternate,o!==null&&o.memoizedState!==null?(o=ka,ka=16777216,rl(e,n,l),ka=o):rl(e,n,l));break;default:rl(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 Ba(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];yt=o,Lp(o,e)}Dp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)jp(e),e=e.sibling}function jp(e){switch(e.tag){case 0:case 11:case 15:Ba(e),e.flags&2048&&Ai(9,e,e.return);break;case 3:Ba(e);break;case 12:Ba(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)):Ba(e);break;default:Ba(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];yt=o,Lp(o,e)}Dp(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Ai(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 Lp(e,n){for(;yt!==null;){var l=yt;switch(l.tag){case 0:case 11:case 15:Ai(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,yt=o;else e:for(l=e;yt!==null;){o=yt;var f=o.sibling,d=o.return;if(Np(o),o===l){yt=null;break e}if(f!==null){f.return=d,yt=f;break e}yt=d}}}var Aw={getCacheForType:function(e){var n=St(ct),l=n.data.get(e);return l===void 0&&(l=e(),n.data.set(e,l)),l},cacheSignal:function(){return St(ct).controller.signal}},Tw=typeof WeakMap=="function"?WeakMap:Map,He=0,Ze=null,Me=null,Oe=0,$e=0,Kt=null,Ti=!1,cl=!1,Jf=!1,ei=0,st=0,Mi=0,ms=0,Wf=0,Zt=0,ul=0,Ha=null,Ht=null,Pf=!1,Cr=0,Rp=0,Or=1/0,zr=null,Ci=null,gt=0,Oi=null,fl=null,ti=0,ed=0,td=null,kp=null,$a=0,nd=null;function It(){return(He&2)!==0&&Oe!==0?Oe&-Oe:z.T!==null?rd():ko()}function Bp(){if(Zt===0)if((Oe&536870912)===0||je){var e=js;js<<=1,(js&3932160)===0&&(js=262144),Zt=e}else Zt=536870912;return e=Gt.current,e!==null&&(e.flags|=32),Zt}function $t(e,n,l){(e===Ze&&($e===2||$e===9)||e.cancelPendingCommit!==null)&&(dl(e,0),zi(e,Oe,Zt,!1)),Ji(e,l),((He&2)===0||e!==Ze)&&(e===Ze&&((He&2)===0&&(ms|=l),st===4&&zi(e,Oe,Zt,!1)),zn(e))}function Hp(e,n,l){if((He&6)!==0)throw Error(a(327));var o=!l&&(n&127)===0&&(n&e.expiredLanes)===0||Fi(e,n),f=o?Ow(e,n):sd(e,n,!0),d=o;do{if(f===0){cl&&!o&&zi(e,n,0,!1);break}else{if(l=e.current.alternate,d&&!Mw(l)){f=sd(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 M=e;f=Ha;var H=M.current.memoizedState.isDehydrated;if(H&&(dl(M,b).flags|=256),b=sd(M,b,!1),b!==2){if(Jf&&!H){M.errorRecoveryDisabledLanes|=d,ms|=d,f=4;break e}d=Ht,Ht=f,d!==null&&(Ht===null?Ht=d:Ht.push.apply(Ht,d))}f=b}if(d=!1,f!==2)continue}}if(f===1){dl(e,0),zi(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:zi(o,n,Zt,!Ti);break e;case 2:Ht=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(f=Cr+300-Re(),10<f)){if(zi(o,n,Zt,!Ti),Rs(o,0,!0)!==0)break e;ti=n,o.timeoutHandle=gy($p.bind(null,o,l,Ht,zr,Pf,n,Zt,ms,ul,Ti,d,"Throttled",-0,0),f);break e}$p(o,l,Ht,zr,Pf,n,Zt,ms,ul,Ti,d,null,-0,0)}}break}while(!0);zn(e)}function $p(e,n,l,o,f,d,b,M,H,F,ie,oe,W,P){if(e.timeoutHandle=-1,oe=n.subtreeFlags,oe&8192||(oe&16785408)===16785408){oe={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Un},zp(n,d,oe);var me=(d&62914560)===d?Cr-Re():(d&4194048)===d?Rp-Re():0;if(me=dx(oe,me),me!==null){ti=d,e.cancelPendingCommit=me(Zp.bind(null,e,n,d,l,o,f,b,M,H,ie,oe,null,W,P)),zi(e,d,b,!F);return}}Zp(e,n,d,l,o,f,b,M,H)}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(!Vt(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 zi(e,n,l,o){n&=~Wf,n&=~ms,e.suspendedLanes|=n,e.pingedLanes&=~n,o&&(e.warmLanes|=n),o=e.expirationTimes;for(var f=n;0<f;){var d=31-Mt(f),b=1<<d;o[d]=-1,f&=~b}l!==0&&jo(e,l,n)}function Dr(){return(He&6)===0?(Ua(0),!1):!0}function id(){if(Me!==null){if($e===0)var e=Me.return;else e=Me,Gn=ls=null,bf(e),nl=null,xa=0,e=Me;for(;e!==null;)pp(e.alternate,e),e=e.return;Me=null}}function dl(e,n){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Iw(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),ti=0,id(),Ze=e,Me=l=Vn(e.current,null),Oe=n,$e=0,Kt=null,Ti=!1,cl=Fi(e,n),Jf=!1,ul=Zt=Wf=ms=Mi=st=0,Ht=Ha=null,Pf=!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-Mt(o),d=1<<f;n|=e[f],o&=~d}return ei=n,Po(),l}function Up(e,n){Ae=null,z.H=Oa,n===tl||n===or?(n=ng(),$e=3):n===of?(n=ng(),$e=4):$e=n===Rf?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,Kt=n,Me===null&&(st=1,wr(e,nn(n,e.current)))}function qp(){var e=Gt.current;return e===null?!0:(Oe&4194048)===Oe?on===null:(Oe&62914560)===Oe||(Oe&536870912)!==0?e===on:!1}function Vp(){var e=z.H;return z.H=Oa,e===null?Oa:e}function Yp(){var e=z.A;return z.A=Aw,e}function jr(){st=4,Ti||(Oe&4194048)!==Oe&&Gt.current!==null||(cl=!0),(Mi&134217727)===0&&(ms&134217727)===0||Ze===null||zi(Ze,Oe,Zt,!1)}function sd(e,n,l){var o=He;He|=2;var f=Vp(),d=Yp();(Ze!==e||Oe!==n)&&(zr=null,dl(e,n)),n=!1;var b=st;e:do try{if($e!==0&&Me!==null){var M=Me,H=Kt;switch($e){case 8:id(),b=6;break e;case 3:case 2:case 9:case 6:Gt.current===null&&(n=!0);var F=$e;if($e=0,Kt=null,hl(e,M,H,F),l&&cl){b=0;break e}break;default:F=$e,$e=0,Kt=null,hl(e,M,H,F)}}Cw(),b=st;break}catch(ie){Up(e,ie)}while(!0);return n&&e.shellSuspendCounter++,Gn=ls=null,He=o,z.H=f,z.A=d,Me===null&&(Ze=null,Oe=0,Po()),b}function Cw(){for(;Me!==null;)Gp(Me)}function Ow(e,n){var l=He;He|=2;var o=Vp(),f=Yp();Ze!==e||Oe!==n?(zr=null,Or=Re()+500,dl(e,n)):cl=Fi(e,n);e:do try{if($e!==0&&Me!==null){n=Me;var d=Kt;t:switch($e){case 1:$e=0,Kt=null,hl(e,n,d,1);break;case 2:case 9:if(eg(d)){$e=0,Kt=null,Xp(n);break}n=function(){$e!==2&&$e!==9||Ze!==e||($e=7),zn(e)},d.then(n,n);break e;case 3:$e=7;break e;case 4:$e=5;break e;case 7:eg(d)?($e=0,Kt=null,Xp(n)):($e=0,Kt=null,hl(e,n,d,7));break;case 5:var b=null;switch(Me.tag){case 26:b=Me.memoizedState;case 5:case 27:var M=Me;if(b?Oy(b):M.stateNode.complete){$e=0,Kt=null;var H=M.sibling;if(H!==null)Me=H;else{var F=M.return;F!==null?(Me=F,Lr(F)):Me=null}break t}}$e=0,Kt=null,hl(e,n,d,5);break;case 6:$e=0,Kt=null,hl(e,n,d,6);break;case 8:id(),st=6;break e;default:throw Error(a(462))}}zw();break}catch(ie){Up(e,ie)}while(!0);return Gn=ls=null,z.H=o,z.A=f,He=l,Me!==null?0:(Ze=null,Oe=0,Po(),st)}function zw(){for(;Me!==null&&!lt();)Gp(Me)}function Gp(e){var n=mp(e.alternate,e,ei);e.memoizedProps=e.pendingProps,n===null?Lr(e):Me=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,Oe);break;case 11:n=rp(l,n,n.pendingProps,n.type.render,n.ref,Oe);break;case 5:bf(n);default:pp(l,n),n=Me=Ym(n,ei),n=mp(l,n,ei)}e.memoizedProps=e.pendingProps,n===null?Lr(e):Me=n}function hl(e,n,l,o){Gn=ls=null,bf(n),nl=null,xa=0;var f=n.return;try{if(bw(e,f,n,l,Oe)){st=1,wr(e,nn(l,e.current)),Me=null;return}}catch(d){if(f!==null)throw Me=f,d;st=1,wr(e,nn(l,e.current)),Me=null;return}n.flags&32768?(je||o===1?e=!0:cl||(Oe&536870912)!==0?e=!1:(Ti=e=!0,(o===2||o===9||o===3||o===6)&&(o=Gt.current,o!==null&&o.tag===13&&(o.flags|=16384))),Kp(n,e)):Lr(n)}function Lr(e){var n=e;do{if((n.flags&32768)!==0){Kp(n,Ti);return}e=n.return;var l=xw(n.alternate,n,ei);if(l!==null){Me=l;return}if(n=n.sibling,n!==null){Me=n;return}Me=n=e}while(n!==null);st===0&&(st=5)}function Kp(e,n){do{var l=Ew(e.alternate,e);if(l!==null){l.flags&=32767,Me=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(e=e.sibling,e!==null)){Me=e;return}Me=e=l}while(e!==null);st=6,Me=null}function Zp(e,n,l,o,f,d,b,M,H){e.cancelPendingCommit=null;do Rr();while(gt!==0);if((He&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));if(d=n.lanes|n.childLanes,d|=Xu,xu(e,l,d,b,M,H),e===Ze&&(Me=Ze=null,Oe=0),fl=n,Oi=e,ti=l,ed=d,td=f,kp=o,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Rw(en,function(){return Wp(),null})):(e.callbackNode=null,e.callbackPriority=0),o=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||o){o=z.T,z.T=null,f=B.p,B.p=2,b=He,He|=4;try{Nw(e,n,l)}finally{He=b,B.p=f,z.T=o}}gt=1,Ip(),Qp(),Fp()}}function Ip(){if(gt===1){gt=0;var e=Oi,n=fl,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=z.T,z.T=null;var o=B.p;B.p=2;var f=He;He|=4;try{Mp(n,e);var d=pd,b=Lm(e.containerInfo),M=d.focusedElem,H=d.selectionRange;if(b!==M&&M&&M.ownerDocument&&jm(M.ownerDocument.documentElement,M)){if(H!==null&&Uu(M)){var F=H.start,ie=H.end;if(ie===void 0&&(ie=F),"selectionStart"in M)M.selectionStart=F,M.selectionEnd=Math.min(ie,M.value.length);else{var oe=M.ownerDocument||document,W=oe&&oe.defaultView||window;if(W.getSelection){var P=W.getSelection(),me=M.textContent.length,Se=Math.min(H.start,me),Xe=H.end===void 0?Se:Math.min(H.end,me);!P.extend&&Se>Xe&&(b=Xe,Xe=Se,Se=b);var X=Dm(M,Se),U=Dm(M,Xe);if(X&&U&&(P.rangeCount!==1||P.anchorNode!==X.node||P.anchorOffset!==X.offset||P.focusNode!==U.node||P.focusOffset!==U.offset)){var I=oe.createRange();I.setStart(X.node,X.offset),P.removeAllRanges(),Se>Xe?(P.addRange(I),P.extend(U.node,U.offset)):(I.setEnd(U.node,U.offset),P.addRange(I))}}}}for(oe=[],P=M;P=P.parentNode;)P.nodeType===1&&oe.push({element:P,left:P.scrollLeft,top:P.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<oe.length;M++){var le=oe[M];le.element.scrollLeft=le.left,le.element.scrollTop=le.top}}Zr=!!gd,pd=gd=null}finally{He=f,B.p=o,z.T=l}}e.current=n,gt=2}}function Qp(){if(gt===2){gt=0;var e=Oi,n=fl,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=z.T,z.T=null;var o=B.p;B.p=2;var f=He;He|=4;try{Ep(e,n.alternate,n)}finally{He=f,B.p=o,z.T=l}}gt=3}}function Fp(){if(gt===4||gt===3){gt=0,vt();var e=Oi,n=fl,l=ti,o=kp;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?gt=5:(gt=0,fl=Oi=null,Jp(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(Ci=null),ta(l),n=n.stateNode,Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(Qi,n,void 0,(n.current.flags&128)===128)}catch{}if(o!==null){n=z.T,f=B.p,B.p=2,z.T=null;try{for(var d=e.onRecoverableError,b=0;b<o.length;b++){var M=o[b];d(M.value,{componentStack:M.stack})}}finally{z.T=n,B.p=f}}(ti&3)!==0&&Rr(),zn(e),f=e.pendingLanes,(l&261930)!==0&&(f&42)!==0?e===nd?$a++:($a=0,nd=e):$a=0,Ua(0)}}function Jp(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,Sa(n)))}function Rr(){return Ip(),Qp(),Fp(),Wp()}function Wp(){if(gt!==5)return!1;var e=Oi,n=ed;ed=0;var l=ta(ti),o=z.T,f=B.p;try{B.p=32>l?32:l,z.T=null,l=td,td=null;var d=Oi,b=ti;if(gt=0,fl=Oi=null,ti=0,(He&6)!==0)throw Error(a(331));var M=He;if(He|=4,jp(d.current),Op(d,d.current,b,l),He=M,Ua(0,!1),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(Qi,d)}catch{}return!0}finally{B.p=f,z.T=o,Jp(e,n)}}function Pp(e,n,l){n=nn(l,n),n=Lf(e.stateNode,n,2),e=Ei(e,n,2),e!==null&&(Ji(e,2),zn(e))}function Ue(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"&&(Ci===null||!Ci.has(o))){e=nn(l,e),l=ep(2),o=Ei(n,l,2),o!==null&&(tp(l,o,n,e),Ji(o,2),zn(o));break}}n=n.return}}function ld(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)||(Jf=!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,Ze===e&&(Oe&l)===l&&(st===4||st===3&&(Oe&62914560)===Oe&&300>Re()-Cr?(He&2)===0&&dl(e,0):Wf|=l,ul===Oe&&(ul=0)),zn(e)}function ey(e,n){n===0&&(n=Do()),e=ns(e,n),e!==null&&(Ji(e,n),zn(e))}function jw(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),ey(e,l)}function Lw(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 Rw(e,n){return we(e,n)}var kr=null,ml=null,ad=!1,Br=!1,od=!1,Di=0;function zn(e){e!==ml&&e.next===null&&(ml===null?kr=ml=e:ml=ml.next=e),Br=!0,ad||(ad=!0,Bw())}function Ua(e,n){if(!od&&Br){od=!0;do for(var l=!1,o=kr;o!==null;){if(e!==0){var f=o.pendingLanes;if(f===0)var d=0;else{var b=o.suspendedLanes,M=o.pingedLanes;d=(1<<31-Mt(42|e)+1)-1,d&=f&~(b&~M),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(l=!0,sy(o,d))}else d=Oe,d=Rs(o,o===Ze?d:0,o.cancelPendingCommit!==null||o.timeoutHandle!==-1),(d&3)===0||Fi(o,d)||(l=!0,sy(o,d));o=o.next}while(l);od=!1}}function kw(){ty()}function ty(){Br=ad=!1;var e=0;Di!==0&&Zw()&&(e=Di);for(var n=Re(),l=null,o=kr;o!==null;){var f=o.next,d=ny(o,n);d===0?(o.next=null,l===null?kr=f:l.next=f,f===null&&(ml=l)):(l=o,(e!==0||(d&3)!==0)&&(Br=!0)),o=f}gt!==0&>!==5||Ua(e),Di!==0&&(Di=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-Mt(d),M=1<<b,H=f[b];H===-1?((M&l)===0||(M&o)!==0)&&(f[b]=wu(M,n)):H<=n&&(e.expiredLanes|=M),d&=~M}if(n=Ze,l=Oe,l=Rs(e,e===n?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o=e.callbackNode,l===0||e===n&&($e===2||$e===9)||e.cancelPendingCommit!==null)return o!==null&&o!==null&&Ve(o),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Fi(e,l)){if(n=l&-l,n===e.callbackPriority)return n;switch(o!==null&&Ve(o),ta(l)){case 2:case 8:l=Pt;break;case 32:l=en;break;case 268435456:l=zs;break;default:l=en}return o=iy.bind(null,e),l=we(l,o),e.callbackPriority=n,e.callbackNode=l,n}return o!==null&&o!==null&&Ve(o),e.callbackPriority=2,e.callbackNode=null,2}function iy(e,n){if(gt!==0&>!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(Rr()&&e.callbackNode!==l)return null;var o=Oe;return o=Rs(e,e===Ze?o:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),o===0?null:(Hp(e,o,n),ny(e,Re()),e.callbackNode!=null&&e.callbackNode===l?iy.bind(null,e):null)}function sy(e,n){if(Rr())return null;Hp(e,n,!0)}function Bw(){Qw(function(){(He&6)!==0?we(Wt,kw):ty()})}function rd(){if(Di===0){var e=Ps;e===0&&(e=Ds,Ds<<=1,(Ds&261888)===0&&(Ds=256)),Di=e}return Di}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[Et]||null).action),b=o.submitter;b&&(n=(n=b[Et]||null)?ly(n.formAction):b.getAttribute("formAction"),n!==null&&(d=n,b=null));var M=new Qo("action","action",null,o,f);e.push({event:M,listeners:[{instance:null,listener:function(){if(o.defaultPrevented){if(Di!==0){var H=b?ay(f,b):new FormData(f);Mf(l,{pending:!0,data:H,method:f.method,action:d},null,H)}}else typeof d=="function"&&(M.preventDefault(),H=b?ay(f,b):new FormData(f),Mf(l,{pending:!0,data:H,method:f.method,action:d},d,H))},currentTarget:f}]})}}for(var cd=0;cd<Gu.length;cd++){var ud=Gu[cd],$w=ud.toLowerCase(),Uw=ud[0].toUpperCase()+ud.slice(1);mn($w,"on"+Uw)}mn(Bm,"onAnimationEnd"),mn(Hm,"onAnimationIteration"),mn($m,"onAnimationStart"),mn("dblclick","onDoubleClick"),mn("focusin","onFocus"),mn("focusout","onBlur"),mn(nw,"onTransitionRun"),mn(iw,"onTransitionStart"),mn(sw,"onTransitionCancel"),mn(Um,"onTransitionEnd"),mi("onMouseEnter",["mouseout","mouseover"]),mi("onMouseLeave",["mouseout","mouseover"]),mi("onPointerEnter",["pointerout","pointerover"]),mi("onPointerLeave",["pointerout","pointerover"]),$n("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),$n("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),$n("onBeforeInput",["compositionend","keypress","textInput","paste"]),$n("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),$n("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),$n("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 M=o[b],H=M.instance,F=M.currentTarget;if(M=M.listener,H!==d&&f.isPropagationStopped())break e;d=M,f.currentTarget=F;try{d(f)}catch(ie){Wo(ie)}f.currentTarget=null,d=H}else for(b=0;b<o.length;b++){if(M=o[b],H=M.instance,F=M.currentTarget,M=M.listener,H!==d&&f.isPropagationStopped())break e;d=M,f.currentTarget=F;try{d(f)}catch(ie){Wo(ie)}f.currentTarget=null,d=H}}}}function Ce(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 fd(e,n,l){var o=0;n&&(o|=4),ry(l,e,o,n)}var Hr="_reactListening"+Math.random().toString(36).slice(2);function dd(e){if(!e[Hr]){e[Hr]=!0,Uo.forEach(function(l){l!=="selectionchange"&&(qw.has(l)||fd(l,!1,e),fd(l,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[Hr]||(n[Hr]=!0,fd("selectionchange",!1,n))}}function ry(e,n,l,o){switch(By(n)){case 2:var f=gx;break;case 8:f=px;break;default:f=Td}l=f.bind(null,n,l,e),f=void 0,!zu||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 hd(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 M=o.stateNode.containerInfo;if(M===f)break;if(b===4)for(b=o.return;b!==null;){var H=b.tag;if((H===3||H===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;M!==null;){if(b=ui(M),b===null)return;if(H=b.tag,H===5||H===6||H===26||H===27){o=d=b;continue e}M=M.parentNode}}o=o.return}hm(function(){var F=d,ie=Cu(l),oe=[];e:{var W=qm.get(e);if(W!==void 0){var P=Qo,me=e;switch(e){case"keypress":if(Zo(l)===0)break e;case"keydown":case"keyup":P=LS;break;case"focusin":me="focus",P=Ru;break;case"focusout":me="blur",P=Ru;break;case"beforeblur":case"afterblur":P=Ru;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=BS;break;case Bm:case Hm:case $m:P=_S;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 Se=(n&4)!==0,Xe=!Se&&(e==="scroll"||e==="scrollend"),X=Se?W!==null?W+"Capture":null:W;Se=[];for(var U=F,I;U!==null;){var le=U;if(I=le.stateNode,le=le.tag,le!==5&&le!==26&&le!==27||I===null||X===null||(le=ca(U,X),le!=null&&Se.push(Va(U,le,I))),Xe)break;U=U.return}0<Se.length&&(W=new P(W,me,null,l,ie),oe.push({event:W,listeners:Se}))}}if((n&7)===0){e:{if(W=e==="mouseover"||e==="pointerover",P=e==="mouseout"||e==="pointerout",W&&l!==Mu&&(me=l.relatedTarget||l.fromElement)&&(ui(me)||me[Hn]))break e;if((P||W)&&(W=ie.window===ie?ie:(W=ie.ownerDocument)?W.defaultView||W.parentWindow:window,P?(me=l.relatedTarget||l.toElement,P=F,me=me?ui(me):null,me!==null&&(Xe=c(me),Se=me.tag,me!==Xe||Se!==5&&Se!==27&&Se!==6)&&(me=null)):(P=null,me=F),P!==me)){if(Se=pm,le="onMouseLeave",X="onMouseEnter",U="mouse",(e==="pointerout"||e==="pointerover")&&(Se=vm,le="onPointerLeave",X="onPointerEnter",U="pointer"),Xe=P==null?W:di(P),I=me==null?W:di(me),W=new Se(le,U+"leave",P,l,ie),W.target=Xe,W.relatedTarget=I,le=null,ui(ie)===F&&(Se=new Se(X,U+"enter",me,l,ie),Se.target=I,Se.relatedTarget=Xe,le=Se),Xe=le,P&&me)t:{for(Se=Vw,X=P,U=me,I=0,le=X;le;le=Se(le))I++;le=0;for(var ve=U;ve;ve=Se(ve))le++;for(;0<I-le;)X=Se(X),I--;for(;0<le-I;)U=Se(U),le--;for(;I--;){if(X===U||U!==null&&X===U.alternate){Se=X;break t}X=Se(X),U=Se(U)}Se=null}else Se=null;P!==null&&cy(oe,W,P,Se,!1),me!==null&&Xe!==null&&cy(oe,Xe,me,Se,!0)}}e:{if(W=F?di(F):window,P=W.nodeName&&W.nodeName.toLowerCase(),P==="select"||P==="input"&&W.type==="file")var ke=Am;else if(Nm(W))if(Tm)ke=PS;else{ke=JS;var pe=FS}else P=W.nodeName,!P||P.toLowerCase()!=="input"||W.type!=="checkbox"&&W.type!=="radio"?F&&Tu(F.elementType)&&(ke=Am):ke=WS;if(ke&&(ke=ke(e,F))){_m(oe,ke,l,ie);break e}pe&&pe(e,W,F),e==="focusout"&&F&&W.type==="number"&&F.memoizedProps.value!=null&&oa(W,"number",W.value)}switch(pe=F?di(F):window,e){case"focusin":(Nm(pe)||pe.contentEditable==="true")&&(Xs=pe,qu=F,ya=null);break;case"focusout":ya=qu=Xs=null;break;case"mousedown":Vu=!0;break;case"contextmenu":case"mouseup":case"dragend":Vu=!1,Rm(oe,l,ie);break;case"selectionchange":if(tw)break;case"keydown":case"keyup":Rm(oe,l,ie)}var Te;if(Bu)e:{switch(e){case"compositionstart":var ze="onCompositionStart";break e;case"compositionend":ze="onCompositionEnd";break e;case"compositionupdate":ze="onCompositionUpdate";break e}ze=void 0}else Gs?xm(e,l)&&(ze="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(ze="onCompositionStart");ze&&(bm&&l.locale!=="ko"&&(Gs||ze!=="onCompositionStart"?ze==="onCompositionEnd"&&Gs&&(Te=mm()):(pi=ie,Du="value"in pi?pi.value:pi.textContent,Gs=!0)),pe=$r(F,ze),0<pe.length&&(ze=new ym(ze,e,null,l,ie),oe.push({event:ze,listeners:pe}),Te?ze.data=Te:(Te=Em(l),Te!==null&&(ze.data=Te)))),(Te=XS?KS(e,l):ZS(e,l))&&(ze=$r(F,"onBeforeInput"),0<ze.length&&(pe=new ym("onBeforeInput","beforeinput",null,l,ie),oe.push({event:pe,listeners:ze}),pe.data=Te)),Hw(oe,e,F,l,ie)}oy(oe,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 M=l,H=M.alternate,F=M.stateNode;if(M=M.tag,H!==null&&H===o)break;M!==5&&M!==26&&M!==27||F===null||(H=F,f?(F=ca(l,d),F!=null&&b.unshift(Va(l,F,H))):f||(F=ca(l,d),F!=null&&b.push(Va(l,F,H)))),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 Ge(e,n,l,o,f,d){switch(l){case"children":typeof o=="string"?n==="body"||n==="textarea"&&o===""||qs(e,o):(typeof o=="number"||typeof o=="bigint")&&n!=="body"&&qs(e,""+o);break;case"className":Hs(e,"class",o);break;case"tabIndex":Hs(e,"tabindex",o);break;case"dir":case"role":case"viewBox":case"width":case"height":Hs(e,l,o);break;case"style":fm(e,o,d);break;case"data":if(n!=="object"){Hs(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"&&Ge(e,n,"name",f.name,f,null),Ge(e,n,"formEncType",f.formEncType,f,null),Ge(e,n,"formMethod",f.formMethod,f,null),Ge(e,n,"formTarget",f.formTarget,f,null)):(Ge(e,n,"encType",f.encType,f,null),Ge(e,n,"method",f.method,f,null),Ge(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=Un);break;case"onScroll":o!=null&&Ce("scroll",e);break;case"onScrollEnd":o!=null&&Ce("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":Ce("beforetoggle",e),Ce("toggle",e),Bs(e,"popover",o);break;case"xlinkActuate":hn(e,"http://www.w3.org/1999/xlink","xlink:actuate",o);break;case"xlinkArcrole":hn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",o);break;case"xlinkRole":hn(e,"http://www.w3.org/1999/xlink","xlink:role",o);break;case"xlinkShow":hn(e,"http://www.w3.org/1999/xlink","xlink:show",o);break;case"xlinkTitle":hn(e,"http://www.w3.org/1999/xlink","xlink:title",o);break;case"xlinkType":hn(e,"http://www.w3.org/1999/xlink","xlink:type",o);break;case"xmlBase":hn(e,"http://www.w3.org/XML/1998/namespace","xml:base",o);break;case"xmlLang":hn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",o);break;case"xmlSpace":hn(e,"http://www.w3.org/XML/1998/namespace","xml:space",o);break;case"is":Bs(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,Bs(e,l,o))}}function md(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"?qs(e,o):(typeof o=="number"||typeof o=="bigint")&&qs(e,""+o);break;case"onScroll":o!=null&&Ce("scroll",e);break;case"onScrollEnd":o!=null&&Ce("scrollend",e);break;case"onClick":o!=null&&(e.onclick=Un);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[Et]||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,""):Bs(e,l,o)}}}function xt(e,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ce("error",e),Ce("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:Ge(e,n,d,b,l,null)}}f&&Ge(e,n,"srcSet",l.srcSet,l,null),o&&Ge(e,n,"src",l.src,l,null);return;case"input":Ce("invalid",e);var M=d=b=f=null,H=null,F=null;for(o in l)if(l.hasOwnProperty(o)){var ie=l[o];if(ie!=null)switch(o){case"name":f=ie;break;case"type":b=ie;break;case"checked":H=ie;break;case"defaultChecked":F=ie;break;case"value":d=ie;break;case"defaultValue":M=ie;break;case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(a(137,n));break;default:Ge(e,n,o,ie,l,null)}}Us(e,d,M,H,F,b,f,!1);return;case"select":Ce("invalid",e),o=b=d=null;for(f in l)if(l.hasOwnProperty(f)&&(M=l[f],M!=null))switch(f){case"value":d=M;break;case"defaultValue":b=M;break;case"multiple":o=M;default:Ge(e,n,f,M,l,null)}n=d,l=b,e.multiple=!!o,n!=null?gi(e,!!o,n,!1):l!=null&&gi(e,!!o,l,!0);return;case"textarea":Ce("invalid",e),d=f=o=null;for(b in l)if(l.hasOwnProperty(b)&&(M=l[b],M!=null))switch(b){case"value":o=M;break;case"defaultValue":f=M;break;case"children":d=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(a(91));break;default:Ge(e,n,b,M,l,null)}cm(e,o,f,d);return;case"option":for(H in l)l.hasOwnProperty(H)&&(o=l[H],o!=null)&&(H==="selected"?e.selected=o&&typeof o!="function"&&typeof o!="symbol":Ge(e,n,H,o,l,null));return;case"dialog":Ce("beforetoggle",e),Ce("toggle",e),Ce("cancel",e),Ce("close",e);break;case"iframe":case"object":Ce("load",e);break;case"video":case"audio":for(o=0;o<qa.length;o++)Ce(qa[o],e);break;case"image":Ce("error",e),Ce("load",e);break;case"details":Ce("toggle",e);break;case"embed":case"source":case"link":Ce("error",e),Ce("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(F in l)if(l.hasOwnProperty(F)&&(o=l[F],o!=null))switch(F){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Ge(e,n,F,o,l,null)}return;default:if(Tu(n)){for(ie in l)l.hasOwnProperty(ie)&&(o=l[ie],o!==void 0&&md(e,n,ie,o,l,void 0));return}}for(M in l)l.hasOwnProperty(M)&&(o=l[M],o!=null&&Ge(e,n,M,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,M=null,H=null,F=null,ie=null;for(P in l){var oe=l[P];if(l.hasOwnProperty(P)&&oe!=null)switch(P){case"checked":break;case"value":break;case"defaultValue":H=oe;default:o.hasOwnProperty(P)||Ge(e,n,P,null,o,oe)}}for(var W in o){var P=o[W];if(oe=l[W],o.hasOwnProperty(W)&&(P!=null||oe!=null))switch(W){case"type":d=P;break;case"name":f=P;break;case"checked":F=P;break;case"defaultChecked":ie=P;break;case"value":b=P;break;case"defaultValue":M=P;break;case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(a(137,n));break;default:P!==oe&&Ge(e,n,W,P,o,oe)}}aa(e,b,M,H,F,ie,d,f);return;case"select":P=b=M=W=null;for(d in l)if(H=l[d],l.hasOwnProperty(d)&&H!=null)switch(d){case"value":break;case"multiple":P=H;default:o.hasOwnProperty(d)||Ge(e,n,d,null,o,H)}for(f in o)if(d=o[f],H=l[f],o.hasOwnProperty(f)&&(d!=null||H!=null))switch(f){case"value":W=d;break;case"defaultValue":M=d;break;case"multiple":b=d;default:d!==H&&Ge(e,n,f,d,o,H)}n=M,l=b,o=P,W!=null?gi(e,!!l,W,!1):!!o!=!!l&&(n!=null?gi(e,!!l,n,!0):gi(e,!!l,l?[]:"",!1));return;case"textarea":P=W=null;for(M in l)if(f=l[M],l.hasOwnProperty(M)&&f!=null&&!o.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Ge(e,n,M,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":W=f;break;case"defaultValue":P=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==d&&Ge(e,n,b,f,o,d)}ra(e,W,P);return;case"option":for(var me in l)W=l[me],l.hasOwnProperty(me)&&W!=null&&!o.hasOwnProperty(me)&&(me==="selected"?e.selected=!1:Ge(e,n,me,null,o,W));for(H in o)W=o[H],P=l[H],o.hasOwnProperty(H)&&W!==P&&(W!=null||P!=null)&&(H==="selected"?e.selected=W&&typeof W!="function"&&typeof W!="symbol":Ge(e,n,H,W,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 Se in l)W=l[Se],l.hasOwnProperty(Se)&&W!=null&&!o.hasOwnProperty(Se)&&Ge(e,n,Se,null,o,W);for(F in o)if(W=o[F],P=l[F],o.hasOwnProperty(F)&&W!==P&&(W!=null||P!=null))switch(F){case"children":case"dangerouslySetInnerHTML":if(W!=null)throw Error(a(137,n));break;default:Ge(e,n,F,W,o,P)}return;default:if(Tu(n)){for(var Xe in l)W=l[Xe],l.hasOwnProperty(Xe)&&W!==void 0&&!o.hasOwnProperty(Xe)&&md(e,n,Xe,void 0,o,W);for(ie in o)W=o[ie],P=l[ie],!o.hasOwnProperty(ie)||W===P||W===void 0&&P===void 0||md(e,n,ie,W,o,P);return}}for(var X in l)W=l[X],l.hasOwnProperty(X)&&W!=null&&!o.hasOwnProperty(X)&&Ge(e,n,X,null,o,W);for(oe in o)W=o[oe],P=l[oe],!o.hasOwnProperty(oe)||W===P||W==null&&P==null||Ge(e,n,oe,W,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,M=f.duration;if(d&&M&&dy(b)){for(b=0,M=f.responseEnd,o+=1;o<l.length;o++){var H=l[o],F=H.startTime;if(F>M)break;var ie=H.transferSize,oe=H.initiatorType;ie&&dy(oe)&&(H=H.responseEnd,b+=ie*(H<M?1:(M-F)/(H-F)))}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 gd=null,pd=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 yd(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 vd=null;function Zw(){var e=window.event;return e&&e.type==="popstate"?e===vd?!1:(vd=e,!0):(vd=null,!1)}var gy=typeof setTimeout=="function"?setTimeout:void 0,Iw=typeof clearTimeout=="function"?clearTimeout:void 0,py=typeof Promise=="function"?Promise:void 0,Qw=typeof queueMicrotask=="function"?queueMicrotask:typeof py<"u"?function(e){return py.resolve(null).then(e).catch(Fw)}:gy;function Fw(e){setTimeout(function(){throw e})}function ji(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),vl(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,M=d.nodeName;d[Wi]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&d.rel.toLowerCase()==="stylesheet"||l.removeChild(d),d=b}}else l==="body"&&Ya(e.ownerDocument.body);l=f}while(l);vl(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 bd(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":bd(l),na(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Jw(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=rn(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=rn(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=rn(e.nextSibling),e===null))return null;return e}function Sd(e){return e.data==="$?"||e.data==="$~"}function wd(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 rn(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 xd=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 rn(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 cn=new Map,Ey=new Set;function qr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ni=B.d;B.d={f:ex,r:tx,D:nx,C:ix,L:sx,m:lx,X:ox,S:ax,M:rx};function ex(){var e=ni.f(),n=Dr();return e||n}function tx(e){var n=fi(e);n!==null&&n.tag===5&&n.type==="form"?Ug(n):ni.r(e)}var gl=typeof document>"u"?null:document;function Ny(e,n,l){var o=gl;if(o&&typeof n=="string"&&n){var f=jt(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"),xt(n,"link",e),rt(n),o.head.appendChild(n)))}}function nx(e){ni.D(e),Ny("dns-prefetch",e,null)}function ix(e,n){ni.C(e,n),Ny("preconnect",e,n)}function sx(e,n,l){ni.L(e,n,l);var o=gl;if(o&&e&&n){var f='link[rel="preload"][as="'+jt(n)+'"]';n==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+jt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+jt(l.imageSizes)+'"]')):f+='[href="'+jt(e)+'"]';var d=f;switch(n){case"style":d=pl(e);break;case"script":d=yl(e)}cn.has(d)||(e=p({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:e,as:n},l),cn.set(d,e),o.querySelector(f)!==null||n==="style"&&o.querySelector(Ga(d))||n==="script"&&o.querySelector(Xa(d))||(n=o.createElement("link"),xt(n,"link",e),rt(n),o.head.appendChild(n)))}}function lx(e,n){ni.m(e,n);var l=gl;if(l&&e){var o=n&&typeof n.as=="string"?n.as:"script",f='link[rel="modulepreload"][as="'+jt(o)+'"][href="'+jt(e)+'"]',d=f;switch(o){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=yl(e)}if(!cn.has(d)&&(e=p({rel:"modulepreload",href:e},n),cn.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"),xt(o,"link",e),rt(o),l.head.appendChild(o)}}}function ax(e,n,l){ni.S(e,n,l);var o=gl;if(o&&e){var f=hi(o).hoistableStyles,d=pl(e);n=n||"default";var b=f.get(d);if(!b){var M={loading:0,preload:null};if(b=o.querySelector(Ga(d)))M.loading=5;else{e=p({rel:"stylesheet",href:e,"data-precedence":n},l),(l=cn.get(d))&&Ed(e,l);var H=b=o.createElement("link");rt(H),xt(H,"link",e),H._p=new Promise(function(F,ie){H.onload=F,H.onerror=ie}),H.addEventListener("load",function(){M.loading|=1}),H.addEventListener("error",function(){M.loading|=2}),M.loading|=4,Vr(b,n,o)}b={type:"stylesheet",instance:b,count:1,state:M},f.set(d,b)}}}function ox(e,n){ni.X(e,n);var l=gl;if(l&&e){var o=hi(l).hoistableScripts,f=yl(e),d=o.get(f);d||(d=l.querySelector(Xa(f)),d||(e=p({src:e,async:!0},n),(n=cn.get(f))&&Nd(e,n),d=l.createElement("script"),rt(d),xt(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(f,d))}}function rx(e,n){ni.M(e,n);var l=gl;if(l&&e){var o=hi(l).hoistableScripts,f=yl(e),d=o.get(f);d||(d=l.querySelector(Xa(f)),d||(e=p({src:e,async:!0,type:"module"},n),(n=cn.get(f))&&Nd(e,n),d=l.createElement("script"),rt(d),xt(d,"link",e),l.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},o.set(f,d))}}function _y(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=pl(l.href),l=hi(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=pl(l.href);var d=hi(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),cn.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},cn.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=yl(l),l=hi(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 pl(e){return'href="'+jt(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}),xt(n,"link",l),rt(n),e.head.appendChild(n))}function yl(e){return'[src="'+jt(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~="'+jt(l.href)+'"]');if(o)return n.instance=o,rt(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"),rt(o),xt(o,"style",f),Vr(o,l.precedence,e),n.instance=o;case"stylesheet":f=pl(l.href);var d=e.querySelector(Ga(f));if(d)return n.state.loading|=4,n.instance=d,rt(d),d;o=Ay(l),(f=cn.get(f))&&Ed(o,f),d=(e.ownerDocument||e).createElement("link"),rt(d);var b=d;return b._p=new Promise(function(M,H){b.onload=M,b.onerror=H}),xt(d,"link",o),n.state.loading|=4,Vr(d,l.precedence,e),n.instance=d;case"script":return d=yl(l.src),(f=e.querySelector(Xa(d)))?(n.instance=f,rt(f),f):(o=l,(f=cn.get(d))&&(o=p({},l),Nd(o,f)),e=e.ownerDocument||e,f=e.createElement("script"),rt(f),xt(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 M=o[b];if(M.dataset.precedence===n)d=M;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 Ed(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Nd(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[mt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var b=d.getAttribute(n)||"";b=e+b;var M=o.get(b);M?M.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=pl(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,rt(d);return}d=n.ownerDocument||n,o=Ay(o),(f=cn.get(f))&&Ed(o,f),d=d.createElement("link"),rt(d);var b=d;b._p=new Promise(function(M,H){b.onload=M,b.onerror=H}),xt(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 _d=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&&_d===0&&(_d=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>_d?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:w,Provider:null,Consumer:null,_currentValue:G,_currentValue2:G,_threadCount:0};function mx(e,n,l,o,f,d,b,M,H){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=H,this.incompleteTransitions=new Map}function zy(e,n,l,o,f,d,b,M,H,F,ie,oe){return e=new mx(e,n,l,b,H,F,ie,oe,M),n=1,d===!0&&(n|=24),d=Yt(3,null,null,n),e.current=d,d.stateNode=e,n=sf(),n.refCount++,e.pooledCache=n,n.refCount++,d.memoizedState={element:o,isDehydrated:l,cache:n},rf(d),e}function Dy(e){return e?(e=Is,e):Is}function jy(e,n,l,o,f,d){f=Dy(f),o.context===null?o.context=f:o.pendingContext=f,o=xi(n),o.payload={element:l},d=d===void 0?null:d,d!==null&&(o.callback=d),l=Ei(e,o,n),l!==null&&($t(l,e,n),Na(l,e,n))}function Ly(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<n?l:n}}function Ad(e,n){Ly(e,n),(e=e.alternate)&&Ly(e,n)}function Ry(e){if(e.tag===13||e.tag===31){var n=ns(e,67108864);n!==null&&$t(n,e,67108864),Ad(e,67108864)}}function ky(e){if(e.tag===13||e.tag===31){var n=It();n=ea(n);var l=ns(e,n);l!==null&&$t(l,e,n),Ad(e,n)}}var Zr=!0;function gx(e,n,l,o){var f=z.T;z.T=null;var d=B.p;try{B.p=2,Td(e,n,l,o)}finally{B.p=d,z.T=f}}function px(e,n,l,o){var f=z.T;z.T=null;var d=B.p;try{B.p=8,Td(e,n,l,o)}finally{B.p=d,z.T=f}}function Td(e,n,l,o){if(Zr){var f=Md(o);if(f===null)hd(e,n,o,Ir,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=fi(f);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var b=Bn(d.pendingLanes);if(b!==0){var M=d;for(M.pendingLanes|=2,M.entangledLanes|=2;b;){var H=1<<31-Mt(b);M.entanglements[1]|=H,b&=~H}zn(d),(He&6)===0&&(Or=Re()+500,Ua(0))}}break;case 31:case 13:M=ns(d,2),M!==null&&$t(M,d,2),Dr(),Ad(d,2)}if(d=Md(o),d===null&&hd(e,n,o,Ir,l),d===f)break;f=d}f!==null&&o.stopPropagation()}else hd(e,n,o,null,l)}}function Md(e){return e=Cu(e),Cd(e)}var Ir=null;function Cd(e){if(Ir=null,e=ui(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 Ir=e,null}function By(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(At()){case Wt:return 2;case Pt:return 8;case en:case gu:return 32;case zs:return 268435456;default:return 32}default:return 32}}var Od=!1,Li=null,Ri=null,ki=null,Za=new Map,Ia=new Map,Bi=[],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":ki=null;break;case"pointerover":case"pointerout":Za.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ia.delete(n.pointerId)}}function Qa(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=fi(n),n!==null&&Ry(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=Qa(Li,e,n,l,o,f),!0;case"dragenter":return Ri=Qa(Ri,e,n,l,o,f),!0;case"mouseover":return ki=Qa(ki,e,n,l,o,f),!0;case"pointerover":var d=f.pointerId;return Za.set(d,Qa(Za.get(d)||null,e,n,l,o,f)),!0;case"gotpointercapture":return d=f.pointerId,Ia.set(d,Qa(Ia.get(d)||null,e,n,l,o,f)),!0}return!1}function $y(e){var n=ui(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,Bo(e.priority,function(){ky(l)});return}}else if(n===31){if(n=m(l),n!==null){e.blockedOn=n,Bo(e.priority,function(){ky(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 Qr(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var l=Md(e.nativeEvent);if(l===null){l=e.nativeEvent;var o=new l.constructor(l.type,l);Mu=o,l.target.dispatchEvent(o),Mu=null}else return n=fi(l),n!==null&&Ry(n),e.blockedOn=l,!1;n.shift()}return!0}function Uy(e,n,l){Qr(e)&&l.delete(n)}function bx(){Od=!1,Li!==null&&Qr(Li)&&(Li=null),Ri!==null&&Qr(Ri)&&(Ri=null),ki!==null&&Qr(ki)&&(ki=null),Za.forEach(Uy),Ia.forEach(Uy)}function Fr(e,n){e.blockedOn===n&&(e.blockedOn=null,Od||(Od=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,bx)))}var Jr=null;function qy(e){Jr!==e&&(Jr=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Jr===e&&(Jr=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(Cd(o||l)===null)continue;break}var d=fi(l);d!==null&&(e.splice(n,3),n-=3,Mf(d,{pending:!0,data:f,method:l.method,action:o},o,f))}}))}function vl(e){function n(H){return Fr(H,e)}Li!==null&&Fr(Li,e),Ri!==null&&Fr(Ri,e),ki!==null&&Fr(ki,e),Za.forEach(n),Ia.forEach(n);for(var l=0;l<Bi.length;l++){var o=Bi[l];o.blockedOn===e&&(o.blockedOn=null)}for(;0<Bi.length&&(l=Bi[0],l.blockedOn===null);)$y(l),l.blockedOn===null&&Bi.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[Et]||null;if(typeof d=="function")b||qy(l);else if(b){var M=null;if(d&&d.hasAttribute("formAction")){if(f=d,b=d[Et]||null)M=b.formAction;else if(Cd(f)!==null)continue}else M=b.action;typeof M=="function"?l[o+1]=M:(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 zd(e){this._internalRoot=e}Wr.prototype.render=zd.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var l=n.current,o=It();jy(l,o,e,n,null,null)},Wr.prototype.unmount=zd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;jy(e.current,2,null,e,null,null),Dr(),n[Hn]=null}};function Wr(e){this._internalRoot=e}Wr.prototype.unstable_scheduleHydration=function(e){if(e){var n=ko();e={blockedOn:null,target:e,priority:n};for(var l=0;l<Bi.length&&n!==0&&n<Bi[l].priority;l++);Bi.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"));B.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:z,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Pr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Pr.isDisabled&&Pr.supportsFiber)try{Qi=Pr.inject(Sx),Tt=Pr}catch{}}return Ja.createRoot=function(e,n){if(!r(e))throw Error(a(299));var l=!1,o="",f=Fg,d=Jg,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[Hn]=n.current,dd(e),new zd(n)},Ja.hydrateRoot=function(e,n,l){if(!r(e))throw Error(a(299));var o=!1,f="",d=Fg,b=Jg,M=Wg,H=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&&(M=l.onRecoverableError),l.formState!==void 0&&(H=l.formState)),n=zy(e,1,!0,n,l??null,o,f,H,d,b,M,Vy),n.context=Dy(null),l=n.current,o=It(),o=ea(o),f=xi(o),f.callback=null,Ei(l,f,o),l=o,n.current.lanes=l,Ji(n,l),zn(n),e[Hn]=n.current,dd(e),new Wr(n)},Ja.version="19.2.7",Ja}var Py;function Cx(){if(Py)return Ld.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(),Ld.exports=Mx(),Ld.exports}var Ox=Cx();function ht(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=ht(t[s]))!==""&&(i+=(i&&" ")+a);else for(let s in t)t[s]&&(i+=(i&&" ")+s);return i}var zx={value:()=>{}};function Vc(){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=Vc.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=jx(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 jx(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 oh="http://www.w3.org/1999/xhtml";const t0={svg:"http://www.w3.org/2000/svg",xhtml:oh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Yc(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 Lx(t){return function(){var i=this.ownerDocument,s=this.namespaceURI;return s===oh&&i.documentElement.namespaceURI===oh?i.createElement(t):i.createElementNS(s,t)}}function Rx(t){return function(){return this.ownerDocument.createElementNS(t.space,t.local)}}function Tv(t){var i=Yc(t);return(i.local?Rx:Lx)(i)}function kx(){}function Oh(t){return t==null?kx:function(){return this.querySelector(t)}}function Bx(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 Jt(a,this._parents)}function Hx(t){return t==null?[]:Array.isArray(t)?t:Array.from(t)}function $x(){return[]}function Mv(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=Mv(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 Jt(a,r)}function Cv(t){return function(){return this.matches(t)}}function Ov(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:Ov(t)))}var Kx=Array.prototype.filter;function Zx(){return Array.from(this.children)}function Ix(t){return function(){return Kx.call(this.children,t)}}function Qx(t){return this.selectAll(t==null?Zx:Ix(typeof t=="function"?t:Ov(t)))}function Fx(t){typeof t!="function"&&(t=Cv(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 Jt(a,this._parents)}function zv(t){return new Array(t.length)}function Jx(){return new Jt(this._enter||this._groups.map(zv),this._parents)}function Ac(t,i){this.ownerDocument=t.ownerDocument,this.namespaceURI=t.namespaceURI,this._next=null,this._parent=t,this.__data__=i}Ac.prototype={constructor:Ac,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 Ac(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 Ac(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,x=m[g]=new Array(E),A=u[g]=new Array(E),N=h[g]=new Array(y);s(v,p,x,A,N,S,i);for(var _=0,w=0,O,j;_<E;++_)if(O=x[_]){for(_>=w&&(w=_+1);!(j=A[w])&&++w<E;);O._next=j||null}}return u=new Jt(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 Jt(this._exit||this._groups.map(zv),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 Jt(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 Jt(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=Yc(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 Dv(t){return t.ownerDocument&&t.ownerDocument.defaultView||t.document&&t||t.defaultView}function EE(t){return function(){this.style.removeProperty(t)}}function NE(t,i,s){return function(){this.style.setProperty(t,i,s)}}function _E(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"?_E:NE)(t,i,s??"")):Bl(this.node(),t)}function Bl(t,i){return t.style.getPropertyValue(i)||Dv(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 Lv(t)}function Lv(t){this._node=t,this._names=jv(t.getAttribute("class")||"")}Lv.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 Rv(t,i){for(var s=zh(t),a=-1,r=i.length;++a<r;)s.add(i[a])}function kv(t,i){for(var s=zh(t),a=-1,r=i.length;++a<r;)s.remove(i[a])}function zE(t){return function(){Rv(this,t)}}function DE(t){return function(){kv(this,t)}}function jE(t,i){return function(){(i.apply(this,arguments)?Rv:kv)(this,t)}}function LE(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"?jE:i?zE:DE)(s,i))}function RE(){this.textContent=""}function kE(t){return function(){this.textContent=t}}function BE(t){return function(){var i=t.apply(this,arguments);this.textContent=i??""}}function HE(t){return arguments.length?this.each(t==null?RE:(typeof t=="function"?BE:kE)(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:Tv(t);return this.select(function(){return this.appendChild(i.apply(this,arguments))})}function IE(){return null}function QE(t,i){var s=typeof t=="function"?t:Tv(t),a=i==null?IE:typeof i=="function"?i:Oh(i);return this.select(function(){return this.insertBefore(s.apply(this,arguments),a.apply(this,arguments)||null)})}function FE(){var t=this.parentNode;t&&t.removeChild(this)}function JE(){return this.each(FE)}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 Bv(t,i,s){var a=Dv(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 Bv(this,t,i)}}function r2(t,i){return function(){return Bv(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 Hv=[null];function Jt(t,i){this._groups=t,this._parents=i}function Eo(){return new Jt([[document.documentElement]],Hv)}function f2(){return this}Jt.prototype=Eo.prototype={constructor:Jt,select:Bx,selectAll:qx,selectChild:Xx,selectChildren:Qx,filter:Fx,data:nE,enter:Jx,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:LE,text:HE,html:VE,raise:GE,lower:KE,append:ZE,insert:QE,remove:JE,clone:e2,datum:t2,on:a2,dispatch:c2,[Symbol.iterator]:u2};function Qt(t){return typeof t=="string"?new Jt([[document.querySelector(t)]],[document.documentElement]):new Jt([[t]],Hv)}function d2(t){let i;for(;i=t.sourceEvent;)t=i;return t}function bn(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 Hd(t){t.stopImmediatePropagation()}function Ol(t){t.preventDefault(),t.stopImmediatePropagation()}function $v(t){var i=t.document.documentElement,s=Qt(t).on("dragstart.drag",Ol,ro);"onselectstart"in i?s.on("selectstart.drag",Ol,ro):(i.__noselect=i.style.MozUserSelect,i.style.MozUserSelect="none")}function Uv(t,i){var s=t.document.documentElement,a=Qt(t).on("dragstart.drag",null);i&&(a.on("click.drag",Ol,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 rh(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}})}rh.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 qv(){var t=m2,i=g2,s=p2,a=y2,r={},c=Vc("start","drag","end"),u=0,m,h,g,v,p=0;function y(O){O.on("mousedown.drag",S).filter(a).on("touchstart.drag",A).on("touchmove.drag",N,h2).on("touchend.drag touchcancel.drag",_).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function S(O,j){if(!(v||!t.call(this,O,j))){var D=w(this,i.call(this,O,j),O,j,"mouse");D&&(Qt(O.view).on("mousemove.drag",E,ro).on("mouseup.drag",x,ro),$v(O.view),Hd(O),g=!1,m=O.clientX,h=O.clientY,D("start",O))}}function E(O){if(Ol(O),!g){var j=O.clientX-m,D=O.clientY-h;g=j*j+D*D>p}r.mouse("drag",O)}function x(O){Qt(O.view).on("mousemove.drag mouseup.drag",null),Uv(O.view,g),Ol(O),r.mouse("end",O)}function A(O,j){if(t.call(this,O,j)){var D=O.changedTouches,R=i.call(this,O,j),k=D.length,q,ee;for(q=0;q<k;++q)(ee=w(this,R,O,j,D[q].identifier,D[q]))&&(Hd(O),ee("start",O,D[q]))}}function N(O){var j=O.changedTouches,D=j.length,R,k;for(R=0;R<D;++R)(k=r[j[R].identifier])&&(Ol(O),k("drag",O,j[R]))}function _(O){var j=O.changedTouches,D=j.length,R,k;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),R=0;R<D;++R)(k=r[j[R].identifier])&&(Hd(O),k("end",O,j[R]))}function w(O,j,D,R,k,q){var ee=c.copy(),V=bn(q||D,j),Q,ae,L;if((L=s.call(O,new rh("beforestart",{sourceEvent:D,target:y,identifier:k,active:u,x:V[0],y:V[1],dx:0,dy:0,dispatch:ee}),R))!=null)return Q=L.x-V[0]||0,ae=L.y-V[1]||0,function Y(z,B,G){var Z=V,te;switch(z){case"start":r[k]=Y,te=u++;break;case"end":delete r[k],--u;case"drag":V=bn(G||B,j),te=u;break}ee.call(z,O,new rh(z,{sourceEvent:B,subject:L,target:y,identifier:k,active:te,x:V[0]+Q,y:V[1]+ae,dx:V[0]-Z[0],dy:V[1]-Z[1],dispatch:ee}),R)}}return y.filter=function(O){return arguments.length?(t=typeof O=="function"?O:ec(!!O),y):t},y.container=function(O){return arguments.length?(i=typeof O=="function"?O:ec(O),y):i},y.subject=function(O){return arguments.length?(s=typeof O=="function"?O:ec(O),y):s},y.touchable=function(O){return arguments.length?(a=typeof O=="function"?O:ec(!!O),y):a},y.on=function(){var O=c.on.apply(c,arguments);return O===c?y:O},y.clickDistance=function(O){return arguments.length?(p=(O=+O)*O,y):Math.sqrt(p)},y}function Dh(t,i,s){t.prototype=i.prototype=s,s.constructor=t}function Vv(t,i){var s=Object.create(t.prototype);for(var a in i)s[a]=i[a];return s}function No(){}var co=.7,Tc=1/co,zl="\\s*([+-]?\\d+)\\s*",uo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",jn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",v2=/^#([0-9a-f]{3,8})$/,b2=new RegExp(`^rgb\\(${zl},${zl},${zl}\\)$`),S2=new RegExp(`^rgb\\(${jn},${jn},${jn}\\)$`),w2=new RegExp(`^rgba\\(${zl},${zl},${zl},${uo}\\)$`),x2=new RegExp(`^rgba\\(${jn},${jn},${jn},${uo}\\)$`),E2=new RegExp(`^hsl\\(${uo},${jn},${jn}\\)$`),N2=new RegExp(`^hsla\\(${uo},${jn},${jn},${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(No,xs,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:i0,formatHex:i0,formatHex8:_2,formatHsl:A2,formatRgb:s0,toString:s0});function i0(){return this.rgb().formatHex()}function _2(){return this.rgb().formatHex8()}function A2(){return Yv(this).formatHsl()}function s0(){return this.rgb().formatRgb()}function xs(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 qt(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 qt(i[1],i[2],i[3],1):(i=S2.exec(t))?new qt(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=N2.exec(t))?r0(i[1],i[2]/100,i[3]/100,i[4]):n0.hasOwnProperty(t)?l0(n0[t]):t==="transparent"?new qt(NaN,NaN,NaN,0):null}function l0(t){return new qt(t>>16&255,t>>8&255,t&255,1)}function tc(t,i,s,a){return a<=0&&(t=i=s=NaN),new qt(t,i,s,a)}function T2(t){return t instanceof No||(t=xs(t)),t?(t=t.rgb(),new qt(t.r,t.g,t.b,t.opacity)):new qt}function ch(t,i,s,a){return arguments.length===1?T2(t):new qt(t,i,s,a??1)}function qt(t,i,s,a){this.r=+t,this.g=+i,this.b=+s,this.opacity=+a}Dh(qt,ch,Vv(No,{brighter(t){return t=t==null?Tc:Math.pow(Tc,t),new qt(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?co:Math.pow(co,t),new qt(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new qt(Ss(this.r),Ss(this.g),Ss(this.b),Mc(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=Mc(this.opacity);return`${t===1?"rgb(":"rgba("}${Ss(this.r)}, ${Ss(this.g)}, ${Ss(this.b)}${t===1?")":`, ${t})`}`}function Mc(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Ss(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function ps(t){return t=Ss(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 Sn(t,i,s,a)}function Yv(t){if(t instanceof Sn)return new Sn(t.h,t.s,t.l,t.opacity);if(t instanceof No||(t=xs(t)),!t)return new Sn;if(t instanceof Sn)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 Sn(u,m,h,t.opacity)}function C2(t,i,s,a){return arguments.length===1?Yv(t):new Sn(t,i,s,a??1)}function Sn(t,i,s,a){this.h=+t,this.s=+i,this.l=+s,this.opacity=+a}Dh(Sn,C2,Vv(No,{brighter(t){return t=t==null?Tc:Math.pow(Tc,t),new Sn(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?co:Math.pow(co,t),new Sn(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 qt($d(t>=240?t-240:t+120,r,a),$d(t,r,a),$d(t<120?t+240:t-120,r,a),this.opacity)},clamp(){return new Sn(c0(this.h),nc(this.s),nc(this.l),Mc(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=Mc(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 $d(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 jh=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?Gv:function(i,s){return s-i?z2(i,s,t):jh(isNaN(i)?s:i)}}function Gv(t,i){var s=i-t;return s?O2(t,s):jh(isNaN(t)?i:t)}const Cc=(function t(i){var s=D2(i);function a(r,c){var u=s((r=ch(r)).r,(c=ch(c)).r),m=s(r.g,c.g),h=s(r.b,c.b),g=Gv(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 j2(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 L2(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function R2(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 k2(t,i){var s=new Date;return t=+t,i=+i,function(a){return s.setTime(t*(1-a)+i*a),s}}function Dn(t,i){return t=+t,i=+i,function(s){return t*(1-s)+i*s}}function B2(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 uh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,Ud=new RegExp(uh.source,"g");function H2(t){return function(){return t}}function $2(t){return function(i){return t(i)+""}}function Xv(t,i){var s=uh.lastIndex=Ud.lastIndex=0,a,r,c,u=-1,m=[],h=[];for(t=t+"",i=i+"";(a=uh.exec(t))&&(r=Ud.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:Dn(a,r)})),s=Ud.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"?jh(i):(s==="number"?Dn:s==="string"?(a=xs(i))?(i=a,Cc):Xv:i instanceof xs?Cc:i instanceof Date?k2:L2(i)?j2:Array.isArray(i)?R2:typeof i.valueOf!="function"&&typeof i.toString!="function"||isNaN(i)?B2:Dn)(t,i)}var u0=180/Math.PI,fh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Kv(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?fh:Kv(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()))?fh:(t=t.matrix,Kv(t.a,t.b,t.c,t.d,t.e,t.f))}function Zv(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 x=S.push("translate(",null,i,null,s);E.push({i:x-4,x:Dn(g,p)},{i:x-2,x:Dn(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:Dn(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:Dn(g,v)}):v&&p.push(r(p)+"skewX("+v+a)}function h(g,v,p,y,S,E){if(g!==p||v!==y){var x=S.push(r(S)+"scale(",null,",",null,")");E.push({i:x-4,x:Dn(g,p)},{i:x-2,x:Dn(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,x=y.length,A;++E<x;)p[(A=y[E]).i]=A.x(S);return p.join("")}}}var V2=Zv(U2,"px, ","px)","deg)"),Y2=Zv(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,x=S*S+E*E,A,N;if(x<G2)N=Math.log(y/g)/i,A=function(R){return[m+R*S,h+R*E,g*Math.exp(i*R*N)]};else{var _=Math.sqrt(x),w=(y*y-g*g+a*x)/(2*g*s*_),O=(y*y-g*g-a*x)/(2*y*s*_),j=Math.log(Math.sqrt(w*w+1)-w),D=Math.log(Math.sqrt(O*O+1)-O);N=(D-j)/i,A=function(R){var k=R*N,q=f0(j),ee=g/(s*_)*(q*K2(i*k+j)-X2(j));return[m+ee*S,h+ee*E,g*q/f0(i*k+j)]}}return A.duration=N*1e3*i/Math.SQRT2,A}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,Iv=1e3,Oc,no,zc=0,Es=0,Gc=0,fo=typeof performance=="object"&&performance.now?performance:Date,Qv=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(t){setTimeout(t,17)};function Lh(){return Es||(Qv(Z2),Es=fo.now()+Gc)}function Z2(){Es=0}function Dc(){this._call=this._time=this._next=null}Dc.prototype=Fv.prototype={constructor:Dc,restart:function(t,i,s){if(typeof t!="function")throw new TypeError("callback is not a function");s=(s==null?Lh():+s)+(i==null?0:+i),!this._next&&no!==this&&(no?no._next=this:Oc=this,no=this),this._call=t,this._time=s,dh()},stop:function(){this._call&&(this._call=null,this._time=1/0,dh())}};function Fv(t,i,s){var a=new Dc;return a.restart(t,i,s),a}function I2(){Lh(),++Hl;for(var t=Oc,i;t;)(i=Es-t._time)>=0&&t._call.call(void 0,i),t=t._next;--Hl}function d0(){Es=(zc=fo.now())+Gc,Hl=to=0;try{I2()}finally{Hl=0,F2(),Es=0}}function Q2(){var t=fo.now(),i=t-zc;i>Iv&&(Gc-=i,zc=t)}function F2(){for(var t,i=Oc,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:Oc=s);no=t,dh(a)}function dh(t){if(!Hl){to&&(to=clearTimeout(to));var i=t-Es;i>24?(t<1/0&&(to=setTimeout(d0,t-fo.now()-Gc)),Wa&&(Wa=clearInterval(Wa))):(Wa||(zc=fo.now(),Wa=setInterval(Q2,Iv)),Hl=1,Qv(d0))}}function h0(t,i,s){var a=new Dc;return i=i==null?0:+i,a.restart(r=>{a.stop(),t(r+i)},i,s),a}var J2=Vc("start","end","cancel","interrupt"),W2=[],Jv=0,m0=1,hh=2,yc=3,g0=4,mh=5,vc=6;function Xc(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:J2,tween:W2,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:Jv})}function Rh(t,i){var s=Nn(t,i);if(s.state>Jv)throw new Error("too late; already scheduled");return s}function kn(t,i){var s=Nn(t,i);if(s.state>yc)throw new Error("too late; already running");return s}function Nn(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=Fv(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=hh,s.on.call("start",t,t.__data__,s.index,s.group),s.state===hh){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=mh,1),p=-1,y=r.length;++p<y;)r[p].call(t,v);s.state===mh&&(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>hh&&a.state<mh,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 eN(t){return this.each(function(){bc(this,t)})}function tN(t,i){var s,a;return function(){var r=kn(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 nN(t,i,s){var a,r;if(typeof s!="function")throw new Error;return function(){var c=kn(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 iN(t,i){var s=this._id;if(t+="",arguments.length<2){for(var a=Nn(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?tN:nN)(s,t,i))}function kh(t,i,s){var a=t._id;return t.each(function(){var r=kn(this,a);(r.value||(r.value={}))[i]=s.apply(this,arguments)}),function(r){return Nn(r,a).value[i]}}function Wv(t,i){var s;return(typeof i=="number"?Dn:i instanceof xs?Cc:(s=xs(i))?(i=s,Cc):Xv)(t,i)}function sN(t){return function(){this.removeAttribute(t)}}function lN(t){return function(){this.removeAttributeNS(t.space,t.local)}}function aN(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 oN(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 rN(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 cN(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 uN(t,i){var s=Yc(t),a=s==="transform"?Y2:Wv;return this.attrTween(t,typeof i=="function"?(s.local?cN:rN)(s,a,kh(this,"attr."+t,i)):i==null?(s.local?lN:sN)(s):(s.local?oN:aN)(s,a,i))}function fN(t,i){return function(s){this.setAttribute(t,i.call(this,s))}}function dN(t,i){return function(s){this.setAttributeNS(t.space,t.local,i.call(this,s))}}function hN(t,i){var s,a;function r(){var c=i.apply(this,arguments);return c!==a&&(s=(a=c)&&dN(t,c)),s}return r._value=i,r}function mN(t,i){var s,a;function r(){var c=i.apply(this,arguments);return c!==a&&(s=(a=c)&&fN(t,c)),s}return r._value=i,r}function gN(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=Yc(t);return this.tween(s,(a.local?hN:mN)(a,i))}function pN(t,i){return function(){Rh(this,t).delay=+i.apply(this,arguments)}}function yN(t,i){return i=+i,function(){Rh(this,t).delay=i}}function vN(t){var i=this._id;return arguments.length?this.each((typeof t=="function"?pN:yN)(i,t)):Nn(this.node(),i).delay}function bN(t,i){return function(){kn(this,t).duration=+i.apply(this,arguments)}}function SN(t,i){return i=+i,function(){kn(this,t).duration=i}}function wN(t){var i=this._id;return arguments.length?this.each((typeof t=="function"?bN:SN)(i,t)):Nn(this.node(),i).duration}function xN(t,i){if(typeof i!="function")throw new Error;return function(){kn(this,t).ease=i}}function EN(t){var i=this._id;return arguments.length?this.each(xN(i,t)):Nn(this.node(),i).ease}function NN(t,i){return function(){var s=i.apply(this,arguments);if(typeof s!="function")throw new Error;kn(this,t).ease=s}}function _N(t){if(typeof t!="function")throw new Error;return this.each(NN(this._id,t))}function AN(t){typeof t!="function"&&(t=Cv(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 ri(a,this._parents,this._name,this._id)}function TN(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 ri(u,this._parents,this._name,this._id)}function MN(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 CN(t,i,s){var a,r,c=MN(i)?Rh:kn;return function(){var u=c(this,t),m=u.on;m!==a&&(r=(a=m).copy()).on(i,s),u.on=r}}function ON(t,i){var s=this._id;return arguments.length<2?Nn(this.node(),s).on.on(t):this.each(CN(s,t,i))}function zN(t){return function(){var i=this.parentNode;for(var s in this.__transition)if(+s!==t)return;i&&i.removeChild(this)}}function DN(){return this.on("end.remove",zN(this._id))}function jN(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,Xc(g[y],i,s,y,g,Nn(v,s)));return new ri(c,this._parents,i,s)}function LN(t){var i=this._name,s=this._id;typeof t!="function"&&(t=Mv(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=Nn(v,s),x=0,A=y.length;x<A;++x)(S=y[x])&&Xc(S,i,s,x,y,E);c.push(y),u.push(v)}return new ri(c,u,i,s)}var RN=Eo.prototype.constructor;function kN(){return new RN(this._groups,this._parents)}function BN(t,i){var s,a,r;return function(){var c=Bl(this,t),u=(this.style.removeProperty(t),Bl(this,t));return c===u?null:c===s&&u===a?r:r=i(s=c,a=u)}}function Pv(t){return function(){this.style.removeProperty(t)}}function HN(t,i,s){var a,r=s+"",c;return function(){var u=Bl(this,t);return u===r?null:u===a?c:c=i(a=u,s)}}function $N(t,i,s){var a,r,c;return function(){var u=Bl(this,t),m=s(this),h=m+"";return m==null&&(h=m=(this.style.removeProperty(t),Bl(this,t))),u===h?null:u===a&&h===r?c:(r=h,c=i(a=u,m))}}function UN(t,i){var s,a,r,c="style."+i,u="end."+c,m;return function(){var h=kn(this,t),g=h.on,v=h.value[c]==null?m||(m=Pv(i)):void 0;(g!==s||r!==v)&&(a=(s=g).copy()).on(u,r=v),h.on=a}}function qN(t,i,s){var a=(t+="")=="transform"?V2:Wv;return i==null?this.styleTween(t,BN(t,a)).on("end.style."+t,Pv(t)):typeof i=="function"?this.styleTween(t,$N(t,a,kh(this,"style."+t,i))).each(UN(this._id,t)):this.styleTween(t,HN(t,a,i),s).on("end.style."+t,null)}function VN(t,i,s){return function(a){this.style.setProperty(t,i.call(this,a),s)}}function YN(t,i,s){var a,r;function c(){var u=i.apply(this,arguments);return u!==r&&(a=(r=u)&&VN(t,u,s)),a}return c._value=i,c}function GN(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,YN(t,i,s??""))}function XN(t){return function(){this.textContent=t}}function KN(t){return function(){var i=t(this);this.textContent=i??""}}function ZN(t){return this.tween("text",typeof t=="function"?KN(kh(this,"text",t)):XN(t==null?"":t+""))}function IN(t){return function(i){this.textContent=t.call(this,i)}}function QN(t){var i,s;function a(){var r=t.apply(this,arguments);return r!==s&&(i=(s=r)&&IN(r)),i}return a._value=t,a}function FN(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,QN(t))}function JN(){for(var t=this._name,i=this._id,s=eb(),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=Nn(h,i);Xc(h,t,s,g,u,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new ri(a,this._parents,t,s)}function WN(){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=kn(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 PN=0;function ri(t,i,s,a){this._groups=t,this._parents=i,this._name=s,this._id=a}function eb(){return++PN}var ii=Eo.prototype;ri.prototype={constructor:ri,select:jN,selectAll:LN,selectChild:ii.selectChild,selectChildren:ii.selectChildren,filter:AN,merge:TN,selection:kN,transition:JN,call:ii.call,nodes:ii.nodes,node:ii.node,size:ii.size,empty:ii.empty,each:ii.each,on:ON,attr:uN,attrTween:gN,style:qN,styleTween:GN,text:ZN,textTween:FN,remove:DN,tween:iN,delay:vN,duration:wN,ease:EN,easeVarying:_N,end:WN,[Symbol.iterator]:ii[Symbol.iterator]};function e_(t){return((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2}var t_={time:null,delay:0,duration:250,ease:e_};function n_(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 i_(t){var i,s;t instanceof ri?(i=t._id,t=t._name):(i=eb(),(s=t_).time=Lh(),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])&&Xc(h,t,i,g,u,s||n_(h,i));return new ri(a,this._parents,t,i)}Eo.prototype.interrupt=eN;Eo.prototype.transition=i_;const sc=t=>()=>t;function s_(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 li(t,i,s){this.k=t,this.x=i,this.y=s}li.prototype={constructor:li,scale:function(t){return t===1?this:new li(this.k*t,this.x,this.y)},translate:function(t,i){return t===0&i===0?this:new li(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 Kc=new li(1,0,0);tb.prototype=li.prototype;function tb(t){for(;!t.__zoom;)if(!(t=t.parentNode))return Kc;return t.__zoom}function qd(t){t.stopImmediatePropagation()}function Pa(t){t.preventDefault(),t.stopImmediatePropagation()}function l_(t){return(!t.ctrlKey||t.type==="wheel")&&!t.button}function a_(){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||Kc}function o_(t){return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*(t.ctrlKey?10:1)}function r_(){return navigator.maxTouchPoints||"ontouchstart"in this}function c_(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 nb(){var t=l_,i=a_,s=c_,a=o_,r=r_,c=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],m=250,h=pc,g=Vc("start","zoom","end"),v,p,y,S=500,E=150,x=0,A=10;function N(L){L.property("__zoom",p0).on("wheel.zoom",k,{passive:!1}).on("mousedown.zoom",q).on("dblclick.zoom",ee).filter(r).on("touchstart.zoom",V).on("touchmove.zoom",Q).on("touchend.zoom touchcancel.zoom",ae).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}N.transform=function(L,Y,z,B){var G=L.selection?L.selection():L;G.property("__zoom",p0),L!==G?j(L,Y,z,B):G.interrupt().each(function(){D(this,arguments).event(B).start().zoom(null,typeof Y=="function"?Y.apply(this,arguments):Y).end()})},N.scaleBy=function(L,Y,z,B){N.scaleTo(L,function(){var G=this.__zoom.k,Z=typeof Y=="function"?Y.apply(this,arguments):Y;return G*Z},z,B)},N.scaleTo=function(L,Y,z,B){N.transform(L,function(){var G=i.apply(this,arguments),Z=this.__zoom,te=z==null?O(G):typeof z=="function"?z.apply(this,arguments):z,C=Z.invert(te),$=typeof Y=="function"?Y.apply(this,arguments):Y;return s(w(_(Z,$),te,C),G,u)},z,B)},N.translateBy=function(L,Y,z,B){N.transform(L,function(){return s(this.__zoom.translate(typeof Y=="function"?Y.apply(this,arguments):Y,typeof z=="function"?z.apply(this,arguments):z),i.apply(this,arguments),u)},null,B)},N.translateTo=function(L,Y,z,B,G){N.transform(L,function(){var Z=i.apply(this,arguments),te=this.__zoom,C=B==null?O(Z):typeof B=="function"?B.apply(this,arguments):B;return s(Kc.translate(C[0],C[1]).scale(te.k).translate(typeof Y=="function"?-Y.apply(this,arguments):-Y,typeof z=="function"?-z.apply(this,arguments):-z),Z,u)},B,G)};function _(L,Y){return Y=Math.max(c[0],Math.min(c[1],Y)),Y===L.k?L:new li(Y,L.x,L.y)}function w(L,Y,z){var B=Y[0]-z[0]*L.k,G=Y[1]-z[1]*L.k;return B===L.x&&G===L.y?L:new li(L.k,B,G)}function O(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function j(L,Y,z,B){L.on("start.zoom",function(){D(this,arguments).event(B).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).event(B).end()}).tween("zoom",function(){var G=this,Z=arguments,te=D(G,Z).event(B),C=i.apply(G,Z),$=z==null?O(C):typeof z=="function"?z.apply(G,Z):z,J=Math.max(C[1][0]-C[0][0],C[1][1]-C[0][1]),se=G.__zoom,re=typeof Y=="function"?Y.apply(G,Z):Y,de=h(se.invert($).concat(J/se.k),re.invert($).concat(J/re.k));return function(ce){if(ce===1)ce=re;else{var ne=de(ce),ue=J/ne[2];ce=new li(ue,$[0]-ne[0]*ue,$[1]-ne[1]*ue)}te.zoom(null,ce)}})}function D(L,Y,z){return!z&&L.__zooming||new R(L,Y)}function R(L,Y){this.that=L,this.args=Y,this.active=0,this.sourceEvent=null,this.extent=i.apply(L,Y),this.taps=0}R.prototype={event:function(L){return L&&(this.sourceEvent=L),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(L,Y){return this.mouse&&L!=="mouse"&&(this.mouse[1]=Y.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=Y.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=Y.invert(this.touch1[0])),this.that.__zoom=Y,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var Y=Qt(this.that).datum();g.call(L,this.that,new s_(L,{sourceEvent:this.sourceEvent,target:N,transform:this.that.__zoom,dispatch:g}),Y)}};function k(L,...Y){if(!t.apply(this,arguments))return;var z=D(this,Y).event(L),B=this.__zoom,G=Math.max(c[0],Math.min(c[1],B.k*Math.pow(2,a.apply(this,arguments)))),Z=bn(L);if(z.wheel)(z.mouse[0][0]!==Z[0]||z.mouse[0][1]!==Z[1])&&(z.mouse[1]=B.invert(z.mouse[0]=Z)),clearTimeout(z.wheel);else{if(B.k===G)return;z.mouse=[Z,B.invert(Z)],bc(this),z.start()}Pa(L),z.wheel=setTimeout(te,E),z.zoom("mouse",s(w(_(B,G),z.mouse[0],z.mouse[1]),z.extent,u));function te(){z.wheel=null,z.end()}}function q(L,...Y){if(y||!t.apply(this,arguments))return;var z=L.currentTarget,B=D(this,Y,!0).event(L),G=Qt(L.view).on("mousemove.zoom",$,!0).on("mouseup.zoom",J,!0),Z=bn(L,z),te=L.clientX,C=L.clientY;$v(L.view),qd(L),B.mouse=[Z,this.__zoom.invert(Z)],bc(this),B.start();function $(se){if(Pa(se),!B.moved){var re=se.clientX-te,de=se.clientY-C;B.moved=re*re+de*de>x}B.event(se).zoom("mouse",s(w(B.that.__zoom,B.mouse[0]=bn(se,z),B.mouse[1]),B.extent,u))}function J(se){G.on("mousemove.zoom mouseup.zoom",null),Uv(se.view,B.moved),Pa(se),B.event(se).end()}}function ee(L,...Y){if(t.apply(this,arguments)){var z=this.__zoom,B=bn(L.changedTouches?L.changedTouches[0]:L,this),G=z.invert(B),Z=z.k*(L.shiftKey?.5:2),te=s(w(_(z,Z),B,G),i.apply(this,Y),u);Pa(L),m>0?Qt(this).transition().duration(m).call(j,te,B,L):Qt(this).call(N.transform,te,B,L)}}function V(L,...Y){if(t.apply(this,arguments)){var z=L.touches,B=z.length,G=D(this,Y,L.changedTouches.length===B).event(L),Z,te,C,$;for(qd(L),te=0;te<B;++te)C=z[te],$=bn(C,this),$=[$,this.__zoom.invert($),C.identifier],G.touch0?!G.touch1&&G.touch0[2]!==$[2]&&(G.touch1=$,G.taps=0):(G.touch0=$,Z=!0,G.taps=1+!!v);v&&(v=clearTimeout(v)),Z&&(G.taps<2&&(p=$[0],v=setTimeout(function(){v=null},S)),bc(this),G.start())}}function Q(L,...Y){if(this.__zooming){var z=D(this,Y).event(L),B=L.changedTouches,G=B.length,Z,te,C,$;for(Pa(L),Z=0;Z<G;++Z)te=B[Z],C=bn(te,this),z.touch0&&z.touch0[2]===te.identifier?z.touch0[0]=C:z.touch1&&z.touch1[2]===te.identifier&&(z.touch1[0]=C);if(te=z.that.__zoom,z.touch1){var J=z.touch0[0],se=z.touch0[1],re=z.touch1[0],de=z.touch1[1],ce=(ce=re[0]-J[0])*ce+(ce=re[1]-J[1])*ce,ne=(ne=de[0]-se[0])*ne+(ne=de[1]-se[1])*ne;te=_(te,Math.sqrt(ce/ne)),C=[(J[0]+re[0])/2,(J[1]+re[1])/2],$=[(se[0]+de[0])/2,(se[1]+de[1])/2]}else if(z.touch0)C=z.touch0[0],$=z.touch0[1];else return;z.zoom("touch",s(w(te,C,$),z.extent,u))}}function ae(L,...Y){if(this.__zooming){var z=D(this,Y).event(L),B=L.changedTouches,G=B.length,Z,te;for(qd(L),y&&clearTimeout(y),y=setTimeout(function(){y=null},S),Z=0;Z<G;++Z)te=B[Z],z.touch0&&z.touch0[2]===te.identifier?delete z.touch0:z.touch1&&z.touch1[2]===te.identifier&&delete z.touch1;if(z.touch1&&!z.touch0&&(z.touch0=z.touch1,delete z.touch1),z.touch0)z.touch0[1]=this.__zoom.invert(z.touch0[0]);else if(z.end(),z.taps===2&&(te=bn(te,this),Math.hypot(p[0]-te[0],p[1]-te[1])<A)){var C=Qt(this).on("dblclick.zoom");C&&C.apply(this,arguments)}}}return N.wheelDelta=function(L){return arguments.length?(a=typeof L=="function"?L:sc(+L),N):a},N.filter=function(L){return arguments.length?(t=typeof L=="function"?L:sc(!!L),N):t},N.touchable=function(L){return arguments.length?(r=typeof L=="function"?L:sc(!!L),N):r},N.extent=function(L){return arguments.length?(i=typeof L=="function"?L:sc([[+L[0][0],+L[0][1]],[+L[1][0],+L[1][1]]]),N):i},N.scaleExtent=function(L){return arguments.length?(c[0]=+L[0],c[1]=+L[1],N):[c[0],c[1]]},N.translateExtent=function(L){return arguments.length?(u[0][0]=+L[0][0],u[1][0]=+L[1][0],u[0][1]=+L[0][1],u[1][1]=+L[1][1],N):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},N.constrain=function(L){return arguments.length?(s=L,N):s},N.duration=function(L){return arguments.length?(m=+L,N):m},N.interpolate=function(L){return arguments.length?(h=L,N):h},N.on=function(){var L=g.on.apply(g,arguments);return L===g?N:L},N.clickDistance=function(L){return arguments.length?(x=(L=+L)*L,N):Math.sqrt(x)},N.tapDistance=function(L){return arguments.length?(A=+L,N):A},N}const En={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]],ib=["Enter"," ","Escape"],sb={"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 ws;(function(t){t.Free="free",t.Vertical="vertical",t.Horizontal="horizontal"})(ws||(ws={}));var mo;(function(t){t.Partial="partial",t.Full="full"})(mo||(mo={}));const lb={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var Gi;(function(t){t.Bezier="default",t.Straight="straight",t.Step="step",t.SmoothStep="smoothstep",t.SimpleBezier="simplebezier"})(Gi||(Gi={}));var go;(function(t){t.Arrow="arrow",t.ArrowClosed="arrowclosed"})(go||(go={}));var he;(function(t){t.Left="left",t.Top="top",t.Right="right",t.Bottom="bottom"})(he||(he={}));const y0={[he.Left]:he.Right,[he.Right]:he.Left,[he.Top]:he.Bottom,[he.Bottom]:he.Top};function ab(t){return t===null?null:t?"valid":"invalid"}const ob=t=>"id"in t&&"source"in t&&"target"in t,u_=t=>"id"in t&&"position"in t&&!("source"in t)&&!("target"in t),Bh=t=>"id"in t&&"internals"in t&&!("source"in t)&&!("target"in t),_o=(t,i=[0,0])=>{const{width:s,height:a}=ci(t),r=t.origin??i,c=s*r[0],u=a*r[1];return{x:t.position.x-c,y:t.position.y-u}},f_=(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):Bh(r)?r:i.nodeLookup.get(r.id));const m=u?jc(u,i.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Zc(a,m)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return Ic(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=Zc(s,jc(r)),a=!0)}),a?Ic(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,x=po(m,ql(g)),A=(S??0)*(E??0),N=c&&x>0;(!g.internals.handleBounds||N||x>=A||g.dragging)&&h.push(g)}return h},d_=(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 h_(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 m_({nodes:t,width:i,height:s,panZoom:a,minZoom:r,maxZoom:c},u){if(t.size===0)return!0;const m=h_(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 rb({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",En.error005());else{const S=m.measured.width,E=m.measured.height;S&&E&&(p=[[h,g],[h+S,g+E]])}else m&&_s(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=_s(p)?Ns(i,p,u.measured):i;return(u.measured.width===void 0||u.measured.height===void 0)&&c?.("015",En.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 g_({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(x=>x.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=d_(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 cb(t,i,s){const{width:a,height:r}=ci(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]},Zc=(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)}),gh=({x:t,y:i,width:s,height:a})=>({x:t,y:i,x2:t+s,y2:i+a}),Ic=({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}=Bh(t)?t.internals.positionAbsolute:_o(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}},jc=(t,i=[0,0])=>{const{x:s,y:a}=Bh(t)?t.internals.positionAbsolute:_o(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)}},ub=(t,i)=>Ic(Zc(gh(t),gh(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=>wn(t.width)&&wn(t.height)&&wn(t.x)&&wn(t.y),wn=t=>!isNaN(t)&&isFinite(t),fb=(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 bl(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 p_(t,i,s){if(typeof t=="string"||typeof t=="number"){const a=bl(t,s),r=bl(t,i);return{top:a,right:r,bottom:a,left:r,x:r*2,y:a*2}}if(typeof t=="object"){const a=bl(t.top??t.y??0,s),r=bl(t.bottom??t.y??0,s),c=bl(t.left??t.x??0,i),u=bl(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 y_(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=p_(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,x=y_(t,S,E,v,i,s),A={left:Math.min(x.left-u.left,0),top:Math.min(x.top-u.top,0),right:Math.min(x.right-u.right,0),bottom:Math.min(x.bottom-u.bottom,0)};return{x:S-A.left+A.right,y:E-A.top+A.bottom,zoom:v}},yo=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function _s(t){return t!=null&&t!=="parent"}function ci(t){return{width:t.measured?.width??t.width??t.initialWidth??0,height:t.measured?.height??t.height??t.initialHeight??0}}function db(t){return(t.measured?.width??t.width??t.initialWidth)!==void 0&&(t.measured?.height??t.height??t.initialHeight)!==void 0}function hb(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 v_(){let t,i;return{promise:new Promise((a,r)=>{t=a,i=r}),resolve:t,reject:i}}function b_(t){return{...sb,...t||{}}}function lo(t,{snapGrid:i=[0,0],snapToGrid:s=!1,transform:a,containerBounds:r}){const{x:c,y:u}=xn(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}),mb=t=>t?.getRootNode?.()||window?.document,S_=["INPUT","SELECT","TEXTAREA"];function gb(t){const i=t.composedPath?.()?.[0]||t.target;return i?.nodeType!==1?!1:S_.includes(i.nodeName)||i.hasAttribute("contenteditable")||!!i.closest(".nokey")}const pb=t=>"clientX"in t,xn=(t,i)=>{const s=pb(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 yb({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 he.Left:return[i-lc(i-a,c),s];case he.Right:return[i+lc(a-i,c),s];case he.Top:return[i,s-lc(s-r,c)];case he.Bottom:return[i,s+lc(r-s,c)]}}function vb({sourceX:t,sourceY:i,sourcePosition:s=he.Bottom,targetX:a,targetY:r,targetPosition:c=he.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]=yb({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 bb({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 w_({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 x_({sourceNode:t,targetNode:i,width:s,height:a,transform:r}){const c=Zc(jc(t),jc(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,Ic(c))>0}const E_=({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)),__=(t,i,s={})=>{if(!t.source||!t.target)return s.onError?.("006",En.error006()),i;const a=s.getEdgeId||E_;let r;return ob(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 Sb({sourceX:t,sourceY:i,targetX:s,targetY:a}){const[r,c,u,m]=bb({sourceX:t,sourceY:i,targetX:s,targetY:a});return[`M ${t},${i}L ${s},${a}`,r,c,u,m]}const E0={[he.Left]:{x:-1,y:0},[he.Right]:{x:1,y:0},[he.Top]:{x:0,y:-1},[he.Bottom]:{x:0,y:1}},A_=({source:t,sourcePosition:i=he.Bottom,target:s})=>i===he.Left||i===he.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},N0=(t,i)=>Math.sqrt(Math.pow(i.x-t.x,2)+Math.pow(i.y-t.y,2));function T_({source:t,sourcePosition:i=he.Bottom,target:s,targetPosition:a=he.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=A_({source:g,sourcePosition:i,target:v}),y=p.x!==0?"x":"y",S=p[y];let E=[],x,A;const N={x:0,y:0},_={x:0,y:0},[,,w,O]=bb({sourceX:t.x,sourceY:t.y,targetX:s.x,targetY:s.y});if(m[y]*h[y]===-1){y==="x"?(x=r.x??g.x+(v.x-g.x)*u,A=r.y??(g.y+v.y)/2):(x=r.x??(g.x+v.x)/2,A=r.y??g.y+(v.y-g.y)*u);const k=[{x,y:g.y},{x,y:v.y}],q=[{x:g.x,y:A},{x:v.x,y:A}];m[y]===S?E=y==="x"?k:q:E=y==="x"?q:k}else{const k=[{x:g.x,y:v.y}],q=[{x:v.x,y:g.y}];if(y==="x"?E=m.x===S?q:k:E=m.y===S?k:q,i===a){const L=Math.abs(t[y]-s[y]);if(L<=c){const Y=Math.min(c-1,c-L);m[y]===S?N[y]=(g[y]>t[y]?-1:1)*Y:_[y]=(v[y]>s[y]?-1:1)*Y}}if(i!==a){const L=y==="x"?"y":"x",Y=m[y]===h[L],z=g[L]>v[L],B=g[L]<v[L];(m[y]===1&&(!Y&&z||Y&&B)||m[y]!==1&&(!Y&&B||Y&&z))&&(E=y==="x"?k:q)}const ee={x:g.x+N.x,y:g.y+N.y},V={x:v.x+_.x,y:v.y+_.y},Q=Math.max(Math.abs(ee.x-E[0].x),Math.abs(V.x-E[0].x)),ae=Math.max(Math.abs(ee.y-E[0].y),Math.abs(V.y-E[0].y));Q>=ae?(x=(ee.x+V.x)/2,A=E[0].y):(x=E[0].x,A=(ee.y+V.y)/2)}const j={x:g.x+N.x,y:g.y+N.y},D={x:v.x+_.x,y:v.y+_.y};return[[t,...j.x!==E[0].x||j.y!==E[0].y?[j]:[],...E,...D.x!==E[E.length-1].x||D.y!==E[E.length-1].y?[D]:[],s],x,A,w,O]}function M_(t,i,s,a){const r=Math.min(N0(t,i)/2,N0(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 ph({sourceX:t,sourceY:i,sourcePosition:s=he.Bottom,targetX:a,targetY:r,targetPosition:c=he.Top,borderRadius:u=5,centerX:m,centerY:h,offset:g=20,stepPosition:v=.5}){const[p,y,S,E,x]=T_({source:{x:t,y:i},sourcePosition:s,target:{x:a,y:r},targetPosition:c,center:{x:m,y:h},offset:g,stepPosition:v});let A=`M${p[0].x} ${p[0].y}`;for(let N=1;N<p.length-1;N++)A+=M_(p[N-1],p[N],p[N+1],u);return A+=`L${p[p.length-1].x} ${p[p.length-1].y}`,[A,y,S,E,x]}function _0(t){return t&&!!(t.internals.handleBounds||t.handles?.length)&&!!(t.measured.width||t.width||t.initialWidth)}function C_(t){const{sourceNode:i,targetNode:s}=t;if(!_0(i)||!_0(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",En.error008(c?"target":"source",{id:t.id,sourceHandle:t.sourceHandle,targetHandle:t.targetHandle})),null;const m=c?.position||he.Bottom,h=u?.position||he.Top,g=As(i,c,m),v=As(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 As(t,i,s=he.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??ci(t);if(a)return{x:r+u/2,y:c+m/2};switch(i?.position??s){case he.Top:return{x:r+u/2,y:c};case he.Right:return{x:r+u,y:c+m/2};case he.Bottom:return{x:r+u/2,y:c+m};case he.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 yh(t,i){return t?typeof t=="string"?t:`${i?`${i}__`:""}${Object.keys(t).sort().map(a=>`${a}=${t[a]}`).join("&")}`:""}function O_(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=yh(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 wb=1e3,z_=10,Vh={nodeOrigin:[0,0],nodeExtent:ho,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},D_={...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 j_(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=_o(r,a.nodeOrigin),u=_s(r.extent)?r.extent:a.nodeExtent,m=Ns(c,u,ci(r));r.internals.positionAbsolute=m}}function L_(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 vh(t,i,s,a={}){const r=Yh(D_,a),c={i:0},u=new Map(i),m=r?.elevateNodesOnSelect&&!Gh(r.zIndexMode)?wb: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=_o(v,r.nodeOrigin),S=_s(v.extent)?v.extent:r.nodeExtent,E=Ns(y,S,ci(v));p={...r.defaults,...v,measured:{width:v.measured?.width,height:v.measured?.height},internals:{positionAbsolute:E,handleBounds:L_(v,p),z:xb(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 R_(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}R_(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*z_),r&&v.internals.rootParentIndex!==void 0&&(r.i=v.internals.rootParentIndex);const p=c&&!Gh(h)?wb:0,{x:y,y:S,z:E}=k_(t,v,u,m,p,h),{positionAbsolute:x}=t.internals,A=y!==x.x||S!==x.y;(A||E!==t.internals.z)&&i.set(t.id,{...t,internals:{...t.internals,positionAbsolute:A?{x:y,y:S}:x,z:E}})}function xb(t,i,s){const a=wn(t.zIndex)?t.zIndex:0;return Gh(s)?a:a+(t.selected?i:0)}function k_(t,i,s,a,r,c){const{x:u,y:m}=i.internals.positionAbsolute,h=ci(t),g=_o(t,s),v=_s(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=cb(p,h,i));const y=xb(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=ub(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=ci(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)),x=Math.max(v.height,Math.round(u.height)),A=(E-v.width)*p[0],N=(x-v.height)*p[1];(y>0||S>0||A||N)&&(r.push({id:h,type:"position",position:{x:m.position.x-y+A,y:m.position.y-S+N}}),s.get(h)?.forEach(_=>{t.some(w=>w.id===_.id)||r.push({id:_.id,type:"position",position:{x:_.position.x+y,y:_.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-A:0),height:x+(S?p[1]*S-N:0)}})}),r}function B_(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 x=qh(S.nodeElement),A=E.measured.width!==x.width||E.measured.height!==x.height;if(!!(x.width&&x.height&&(A||!E.internals.handleBounds||S.force))){const _=S.nodeElement.getBoundingClientRect(),w=_s(E.extent)?E.extent:c;let{positionAbsolute:O}=E.internals;E.parentId&&E.extent==="parent"?O=cb(O,x,i.get(E.parentId)):w&&(O=Ns(O,w,x));const j={...E,measured:x,internals:{...E.internals,positionAbsolute:O,handleBounds:{source:w0("source",S.nodeElement,_,p,E.id),target:w0("target",S.nodeElement,_,p,E.id)}}};i.set(E.id,j),E.parentId&&Xh(j,i,s,{nodeOrigin:r,zIndexMode:u}),h=!0,A&&(g.push({id:E.id,type:"dimensions",dimensions:x}),E.expandParent&&E.parentId&&y.push({id:E.id,parentId:E.parentId,rect:ql(j,r)}))}}if(y.length>0){const S=Kh(y,i,s,r);g.push(...S)}return{changes:g,updatedInternals:h}}async function H_({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 Eb(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 Nb(t,i){if(!t.parentId)return!1;const s=i.get(t.parentId);return s?s.selected?!0:Nb(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 $_(t,i,s,a){const r=new Map;for(const[c,u]of t)if((u.selected||u.id===a)&&(!u.parentId||!Nb(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 Vd({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 U_({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 q_({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,x=null;function A({noDragClassName:_,handleSelector:w,domNode:O,isSelectable:j,nodeId:D,nodeClickDistance:R=0}){y=Qt(O);function k({x:Q,y:ae}){const{nodeLookup:L,nodeExtent:Y,snapGrid:z,snapToGrid:B,nodeOrigin:G,onNodeDrag:Z,onSelectionDrag:te,onError:C,updateNodePositions:$}=i();c={x:Q,y:ae};let J=!1;const se=m.size>1,re=se&&Y?gh(Ao(m)):null,de=se&&B?U_({dragItems:m,snapGrid:z,x:Q,y:ae}):null;for(const[ce,ne]of m){if(!L.has(ce))continue;let ue={x:Q-ne.distance.x,y:ae-ne.distance.y};B&&(ue=de?{x:Math.round(ue.x+de.x),y:Math.round(ue.y+de.y)}:To(ue,z));let xe=null;if(se&&Y&&!ne.extent&&re){const{positionAbsolute:be}=ne.internals,Ee=be.x-re.x+Y[0][0],De=be.x+ne.measured.width-re.x2+Y[1][0],Ke=be.y-re.y+Y[0][1],pt=be.y+ne.measured.height-re.y2+Y[1][1];xe=[[Ee,Ke],[De,pt]]}const{position:ye,positionAbsolute:ge}=rb({nodeId:ce,nextPosition:ue,nodeLookup:L,nodeExtent:xe||Y,nodeOrigin:G,onError:C});J=J||ne.position.x!==ye.x||ne.position.y!==ye.y,ne.position=ye,ne.internals.positionAbsolute=ge}if(E=E||J,!!J&&($(m,!0),x&&(a||Z||!D&&te))){const[ce,ne]=Vd({nodeId:D,dragItems:m,nodeLookup:L});a?.(x,m,ce,ne),Z?.(x,ce,ne),D||te?.(x,ne)}}async function q(){if(!v)return;const{transform:Q,panBy:ae,autoPanSpeed:L,autoPanOnNodeDrag:Y}=i();if(!Y){h=!1,cancelAnimationFrame(u);return}const[z,B]=$h(g,v,L);(z!==0||B!==0)&&(c.x=(c.x??0)-z/Q[2],c.y=(c.y??0)-B/Q[2],await ae({x:z,y:B})&&k(c)),u=requestAnimationFrame(q)}function ee(Q){const{nodeLookup:ae,multiSelectionActive:L,nodesDraggable:Y,transform:z,snapGrid:B,snapToGrid:G,selectNodesOnDrag:Z,onNodeDragStart:te,onSelectionDragStart:C,unselectNodesAndEdges:$}=i();p=!0,(!Z||!j)&&!L&&D&&(ae.get(D)?.selected||$()),j&&Z&&D&&t?.(D);const J=lo(Q.sourceEvent,{transform:z,snapGrid:B,snapToGrid:G,containerBounds:v});if(c=J,m=$_(ae,Y,J,D),m.size>0&&(s||te||!D&&C)){const[se,re]=Vd({nodeId:D,dragItems:m,nodeLookup:ae});s?.(Q.sourceEvent,m,se,re),te?.(Q.sourceEvent,se,re),D||C?.(Q.sourceEvent,re)}}const V=qv().clickDistance(R).on("start",Q=>{const{domNode:ae,nodeDragThreshold:L,transform:Y,snapGrid:z,snapToGrid:B}=i();v=ae?.getBoundingClientRect()||null,S=!1,E=!1,x=Q.sourceEvent,L===0&&ee(Q),c=lo(Q.sourceEvent,{transform:Y,snapGrid:z,snapToGrid:B,containerBounds:v}),g=xn(Q.sourceEvent,v)}).on("drag",Q=>{const{autoPanOnNodeDrag:ae,transform:L,snapGrid:Y,snapToGrid:z,nodeDragThreshold:B,nodeLookup:G}=i(),Z=lo(Q.sourceEvent,{transform:L,snapGrid:Y,snapToGrid:z,containerBounds:v});if(x=Q.sourceEvent,(Q.sourceEvent.type==="touchmove"&&Q.sourceEvent.touches.length>1||D&&!G.has(D))&&(S=!0),!S){if(!h&&ae&&p&&(h=!0,q()),!p){const te=xn(Q.sourceEvent,v),C=te.x-g.x,$=te.y-g.y;Math.sqrt(C*C+$*$)>B&&ee(Q)}(c.x!==Z.xSnapped||c.y!==Z.ySnapped)&&m&&p&&(g=xn(Q.sourceEvent,v),k(Z))}}).on("end",Q=>{if(!p||S){S&&m.size>0&&i().updateNodePositions(m,!1);return}if(h=!1,p=!1,cancelAnimationFrame(u),m.size>0){const{nodeLookup:ae,updateNodePositions:L,onNodeDragStop:Y,onSelectionDragStop:z}=i();if(E&&(L(m,!1),E=!1),r||Y||!D&&z){const[B,G]=Vd({nodeId:D,dragItems:m,nodeLookup:ae,dragging:!1});r?.(Q.sourceEvent,m,B,G),Y?.(Q.sourceEvent,B,G),D||z?.(Q.sourceEvent,G)}}}).filter(Q=>{const ae=Q.target;return!Q.button&&(!_||!C0(ae,`.${_}`,O))&&(!w||C0(ae,w,O))});y.call(V)}function N(){y?.on(".drag",null)}return{update:A,destroy:N}}function V_(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 Y_=250;function G_(t,i,s,a){let r=[],c=1/0;const u=V_(t,s,i+Y_);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}=As(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 _b(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,...As(u,h,h.position,!0)}:h}function Ab(t,i){return t||(i?.classList.contains("target")?"target":i?.classList.contains("source")?"source":null)}function X_(t,i){let s=null;return i?s=!0:t&&!i&&(s=!1),s}const Tb=()=>!0;function K_(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:x,onConnectEnd:A,isValidConnection:N=Tb,onReconnectEnd:_,updateConnection:w,getTransform:O,getFromHandle:j,autoPanSpeed:D,dragThreshold:R=1,handleDomNode:k}){const q=mb(t.target);let ee=0,V;const{x:Q,y:ae}=xn(t),L=Ab(c,k),Y=m?.getBoundingClientRect();let z=!1;if(!Y||!L)return;const B=_b(r,L,a,h,i);if(!B)return;let G=xn(t,Y),Z=!1,te=null,C=!1,$=null;function J(){if(!v||!Y)return;const[ye,ge]=$h(G,Y,D);y({x:ye,y:ge}),ee=requestAnimationFrame(J)}const se={...B,nodeId:r,type:L,position:B.position},re=h.get(r);let ce={inProgress:!0,isValid:null,from:As(re,se,he.Left,!0),fromHandle:se,fromPosition:se.position,fromNode:re,to:G,toHandle:null,toPosition:y0[se.position],toNode:null,pointer:G};function ne(){z=!0,w(ce),E?.(t,{nodeId:r,handleId:a,handleType:L})}R===0&&ne();function ue(ye){if(!z){const{x:pt,y:zt}=xn(ye),fe=pt-Q,we=zt-ae;if(!(fe*fe+we*we>R*R))return;ne()}if(!j()||!se){xe(ye);return}const ge=O();G=xn(ye,Y),V=G_(Kl(G,ge,!1,[1,1]),s,h,se),Z||(J(),Z=!0);const be=Mb(ye,{handle:V,connectionMode:i,fromNodeId:r,fromHandleId:a,fromType:u?"target":"source",isValidConnection:N,doc:q,lib:g,flowId:p,nodeLookup:h});$=be.handleDomNode,te=be.connection,C=X_(!!V,be.isValid);const Ee=h.get(r),De=Ee?As(Ee,se,he.Left,!0):ce.from,Ke={...ce,from:De,isValid:C,to:be.toHandle&&C?Vl({x:be.toHandle.x,y:be.toHandle.y},ge):G,toHandle:be.toHandle,toPosition:C&&be.toHandle?be.toHandle.position:y0[se.position],toNode:be.toHandle?h.get(be.toHandle.nodeId):null,pointer:G};w(Ke),ce=Ke}function xe(ye){if(!("touches"in ye&&ye.touches.length>0)){if(z){(V||$)&&te&&C&&x?.(te);const{inProgress:ge,...be}=ce,Ee={...be,toPosition:ce.toHandle?ce.toPosition:null};A?.(ye,Ee),c&&_?.(ye,Ee)}S(),cancelAnimationFrame(ee),Z=!1,C=!1,te=null,$=null,q.removeEventListener("mousemove",ue),q.removeEventListener("mouseup",xe),q.removeEventListener("touchmove",ue),q.removeEventListener("touchend",xe)}}q.addEventListener("mousemove",ue),q.addEventListener("mouseup",xe),q.addEventListener("touchmove",ue),q.addEventListener("touchend",xe)}function Mb(t,{handle:i,connectionMode:s,fromNodeId:a,fromHandleId:r,fromType:c,doc:u,lib:m,flowId:h,isValidConnection:g=Tb,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}=xn(t),x=u.elementFromPoint(S,E),A=x?.classList.contains(`${m}-flow__handle`)?x:y,N={handleDomNode:A,isValid:!1,connection:null,toHandle:null};if(A){const _=Ab(void 0,A),w=A.getAttribute("data-nodeid"),O=A.getAttribute("data-handleid"),j=A.classList.contains("connectable"),D=A.classList.contains("connectableend");if(!w||!_)return N;const R={source:p?w:a,sourceHandle:p?O:r,target:p?a:w,targetHandle:p?r:O};N.connection=R;const q=j&&D&&(s===$l.Strict?p&&_==="source"||!p&&_==="target":w!==a||O!==r);N.isValid=q&&g(R),N.toHandle=_b(w,_,O,v,s,!0)}return N}const bh={onPointerDown:K_,isValid:Mb};function Z_({domNode:t,panZoom:i,getTransform:s,getViewScale:a}){const r=Qt(t);function c({translateExtent:m,width:h,height:g,zoomStep:v=1,pannable:p=!0,zoomable:y=!0,inversePan:S=!1}){const E=w=>{if(w.sourceEvent.type!=="wheel"||!i)return;const O=s(),j=w.sourceEvent.ctrlKey&&yo()?10:1,D=-w.sourceEvent.deltaY*(w.sourceEvent.deltaMode===1?.05:w.sourceEvent.deltaMode?1:.002)*v,R=O[2]*Math.pow(2,D*j);i.scaleTo(R)};let x=[0,0];const A=w=>{(w.sourceEvent.type==="mousedown"||w.sourceEvent.type==="touchstart")&&(x=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY])},N=w=>{const O=s();if(w.sourceEvent.type!=="mousemove"&&w.sourceEvent.type!=="touchmove"||!i)return;const j=[w.sourceEvent.clientX??w.sourceEvent.touches[0].clientX,w.sourceEvent.clientY??w.sourceEvent.touches[0].clientY],D=[j[0]-x[0],j[1]-x[1]];x=j;const R=a()*Math.max(O[2],Math.log(O[2]))*(S?-1:1),k={x:O[0]-D[0]*R,y:O[1]-D[1]*R},q=[[0,0],[h,g]];i.setViewportConstrained({x:k.x,y:k.y,zoom:O[2]},q,m)},_=nb().on("start",A).on("zoom",p?N:null).on("zoom.wheel",y?E:null);r.call(_,{})}function u(){r.on("zoom",null)}return{update:c,destroy:u,pointer:bn}}const Qc=t=>({x:t.x,y:t.y,zoom:t.k}),Yd=({x:t,y:i,zoom:s})=>Kc.translate(t,i).scale(s),Nl=(t,i)=>t.target.closest(`.${i}`),Cb=(t,i)=>i===2&&Array.isArray(t)&&t.includes(2),I_=t=>((t*=2)<=1?t*t*t:(t-=2)*t*t+2)/2,Gd=(t,i=0,s=I_,a=()=>{})=>{const r=typeof i=="number"&&i>0;return r||a(),r?t.transition().duration(i).ease(s).on("end",a):t},Ob=t=>{const i=t.ctrlKey&&yo()?10:1;return-t.deltaY*(t.deltaMode===1?.05:t.deltaMode?1:.002)*i};function Q_({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 A=bn(v),N=Ob(v),_=p*Math.pow(2,N);a.scaleTo(s,_,A,v);return}const y=v.deltaMode===1?20:1;let S=r===ws.Vertical?0:v.deltaX*y,E=r===ws.Horizontal?0:v.deltaY*y;!yo()&&v.shiftKey&&r!==ws.Vertical&&(S=v.deltaY*y,E=0),a.translateBy(s,-(S/p)*c,-(E/p)*c,{internal:!0});const x=Qc(s.property("__zoom"));clearTimeout(t.panScrollTimeout),t.isPanScrolling?(h?.(v,x),t.panScrollTimeout=setTimeout(()=>{g?.(v,x),t.isPanScrolling=!1},150)):(t.isPanScrolling=!0,m?.(v,x))}}function F_({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 J_({zoomPanValues:t,onDraggingChange:i,onPanZoomStart:s}){return a=>{if(a.sourceEvent?.internal)return;const r=Qc(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 W_({zoomPanValues:t,panOnDrag:i,onPaneContextMenu:s,onTransformChange:a,onPanZoom:r}){return c=>{t.usedRightMouseButton=!!(s&&Cb(i,t.mouseButton??0)),c.sourceEvent?.sync||a([c.transform.x,c.transform.y,c.transform.k]),r&&!c.sourceEvent?.internal&&r?.(c.sourceEvent,Qc(c.transform))}}function P_({zoomPanValues:t,panOnDrag:i,panOnScroll:s,onDraggingChange:a,onPanZoomEnd:r,onPaneContextMenu:c}){return u=>{if(!u.sourceEvent?.internal&&(t.isZoomingOrPanning=!1,c&&Cb(i,t.mouseButton??0)&&!t.usedRightMouseButton&&u.sourceEvent&&c(u.sourceEvent),t.usedRightMouseButton=!1,a(!1),r)){const m=Qc(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 x=Array.isArray(a)&&a.includes(p.button)||!p.button||p.button<=1;return(!p.ctrlKey||E)&&x}}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=nb().scaleExtent([i,s]).translateExtent(a),y=Qt(t).call(p);_({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(Ob);async function x(V,Q){return y?new Promise(ae=>{p?.interpolate(Q?.interpolate==="linear"?so:pc).transform(Gd(y,Q?.duration,Q?.ease,()=>ae(!0)),V)}):!1}function A({noWheelClassName:V,noPanClassName:Q,onPaneContextMenu:ae,userSelectionActive:L,panOnScroll:Y,panOnDrag:z,panOnScrollMode:B,panOnScrollSpeed:G,preventScrolling:Z,zoomOnPinch:te,zoomOnScroll:C,zoomOnDoubleClick:$,zoomActivationKeyPressed:J,lib:se,onTransformChange:re,connectionInProgress:de,paneClickDistance:ce,selectionOnDrag:ne}){L&&!g.isZoomingOrPanning&&N();const ue=Y&&!J&&!L;p.clickDistance(ne?1/0:!wn(ce)||ce<0?0:ce);const xe=ue?Q_({zoomPanValues:g,noWheelClassName:V,d3Selection:y,d3Zoom:p,panOnScrollMode:B,panOnScrollSpeed:G,zoomOnPinch:te,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:m}):F_({noWheelClassName:V,preventScrolling:Z,d3ZoomHandler:S});y.on("wheel.zoom",xe,{passive:!1});const ye=J_({zoomPanValues:g,onDraggingChange:h,onPanZoomStart:u});p.on("start",ye);const ge=W_({zoomPanValues:g,panOnDrag:z,onPaneContextMenu:!!ae,onPanZoom:c,onTransformChange:re});p.on("zoom",ge);const be=P_({zoomPanValues:g,panOnDrag:z,panOnScroll:Y,onPaneContextMenu:ae,onPanZoomEnd:m,onDraggingChange:h});p.on("end",be);const Ee=eA({zoomActivationKeyPressed:J,panOnDrag:z,zoomOnScroll:C,panOnScroll:Y,zoomOnDoubleClick:$,zoomOnPinch:te,userSelectionActive:L,noPanClassName:Q,noWheelClassName:V,lib:se,connectionInProgress:de});p.filter(Ee),$?y.on("dblclick.zoom",E):y.on("dblclick.zoom",null)}function N(){p.on("zoom",null)}async function _(V,Q,ae){const L=Yd(V),Y=p?.constrain()(L,Q,ae);return Y&&await x(Y),Y}async function w(V,Q){const ae=Yd(V);return await x(ae,Q),ae}function O(V){if(y){const Q=Yd(V),ae=y.property("__zoom");(ae.k!==V.zoom||ae.x!==V.x||ae.y!==V.y)&&p?.transform(y,Q,null,{sync:!0})}}function j(){const V=y?tb(y.node()):{x:0,y:0,k:1};return{x:V.x,y:V.y,zoom:V.k}}async function D(V,Q){return y?new Promise(ae=>{p?.interpolate(Q?.interpolate==="linear"?so:pc).scaleTo(Gd(y,Q?.duration,Q?.ease,()=>ae(!0)),V)}):!1}async function R(V,Q){return y?new Promise(ae=>{p?.interpolate(Q?.interpolate==="linear"?so:pc).scaleBy(Gd(y,Q?.duration,Q?.ease,()=>ae(!0)),V)}):!1}function k(V){p?.scaleExtent(V)}function q(V){p?.translateExtent(V)}function ee(V){const Q=!wn(V)||V<0?0:V;p?.clickDistance(Q)}return{update:A,destroy:N,setViewport:w,setViewportConstrained:_,getViewport:j,scaleTo:D,scaleBy:R,setScaleExtent:k,setTranslateExtent:q,syncViewport:O,setClickDistance:ee}}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 $i(t,i){return Math.max(0,i-t)}function Ui(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:x,maxWidth:A,minHeight:N,maxHeight:_}=a,{x:w,y:O,width:j,height:D,aspectRatio:R}=t;let k=Math.floor(v?S-t.pointerX:0),q=Math.floor(p?E-t.pointerY:0);const ee=j+(h?-k:k),V=D+(g?-q:q),Q=-c[0]*j,ae=-c[1]*D;let L=ac(ee,x,A),Y=ac(V,N,_);if(u){let G=0,Z=0;h&&k<0?G=$i(w+k+Q,u[0][0]):!h&&k>0&&(G=Ui(w+ee+Q,u[1][0])),g&&q<0?Z=$i(O+q+ae,u[0][1]):!g&&q>0&&(Z=Ui(O+V+ae,u[1][1])),L=Math.max(L,G),Y=Math.max(Y,Z)}if(m){let G=0,Z=0;h&&k>0?G=Ui(w+k,m[0][0]):!h&&k<0&&(G=$i(w+ee,m[1][0])),g&&q>0?Z=Ui(O+q,m[0][1]):!g&&q<0&&(Z=$i(O+V,m[1][1])),L=Math.max(L,G),Y=Math.max(Y,Z)}if(r){if(v){const G=ac(ee/R,N,_)*R;if(L=Math.max(L,G),u){let Z=0;!h&&!g||h&&!g&&y?Z=Ui(O+ae+ee/R,u[1][1])*R:Z=$i(O+ae+(h?k:-k)/R,u[0][1])*R,L=Math.max(L,Z)}if(m){let Z=0;!h&&!g||h&&!g&&y?Z=$i(O+ee/R,m[1][1])*R:Z=Ui(O+(h?k:-k)/R,m[0][1])*R,L=Math.max(L,Z)}}if(p){const G=ac(V*R,x,A)/R;if(Y=Math.max(Y,G),u){let Z=0;!h&&!g||g&&!h&&y?Z=Ui(w+V*R+Q,u[1][0])/R:Z=$i(w+(g?q:-q)*R+Q,u[0][0])/R,Y=Math.max(Y,Z)}if(m){let Z=0;!h&&!g||g&&!h&&y?Z=$i(w+V*R,m[1][0])/R:Z=Ui(w+(g?q:-q)*R,m[0][0])/R,Y=Math.max(Y,Z)}}}q=q+(q<0?Y:-Y),k=k+(k<0?L:-L),r&&(y?ee>V*R?q=(z0(h,g)?-k:k)/R:k=(z0(h,g)?-q:q)*R:v?(q=k/R,g=h):(k=q*R,h=g));const z=h?w+k:w,B=g?O+q:O;return{width:j+(h?-k:k),height:D+(g?-q:q),x:c[0]*k*(h?-1:1)+z,y:c[1]*q*(g?-1:1)+B}}const zb={width:0,height:0,x:0,y:0},sA={...zb,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=Qt(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:x,shouldResize:A}){let N={...zb},_={...sA};u={boundaries:v,resizeDirection:y,keepAspectRatio:p,controlDirection:O0(g)};let w,O=null,j=[],D,R,k,q=!1;const ee=qv().on("start",V=>{const{nodeLookup:Q,transform:ae,snapGrid:L,snapToGrid:Y,nodeOrigin:z,paneDomNode:B}=s();if(w=Q.get(i),!w)return;O=B?.getBoundingClientRect()??null;const{xSnapped:G,ySnapped:Z}=lo(V.sourceEvent,{transform:ae,snapGrid:L,snapToGrid:Y,containerBounds:O});N={width:w.measured.width??0,height:w.measured.height??0,x:w.position.x??0,y:w.position.y??0},_={...N,pointerX:G,pointerY:Z,aspectRatio:N.width/N.height},D=void 0,R=_s(w.extent)?w.extent:void 0,w.parentId&&(w.extent==="parent"||w.expandParent)&&(D=Q.get(w.parentId)),D&&w.extent==="parent"&&(R=[[0,0],[D.measured.width,D.measured.height]]),j=[],k=void 0;for(const[te,C]of Q)if(C.parentId===i&&(j.push({id:te,position:{...C.position},extent:C.extent}),C.extent==="parent"||C.expandParent)){const $=lA(C,w,C.origin??z);k?k=[[Math.min($[0][0],k[0][0]),Math.min($[0][1],k[0][1])],[Math.max($[1][0],k[1][0]),Math.max($[1][1],k[1][1])]]:k=$}S?.(V,{...N})}).on("drag",V=>{const{transform:Q,snapGrid:ae,snapToGrid:L,nodeOrigin:Y}=s(),z=lo(V.sourceEvent,{transform:Q,snapGrid:ae,snapToGrid:L,containerBounds:O}),B=[];if(!w)return;const{x:G,y:Z,width:te,height:C}=N,$={},J=w.origin??Y,{width:se,height:re,x:de,y:ce}=iA(_,u.controlDirection,z,u.boundaries,u.keepAspectRatio,J,R,k),ne=se!==te,ue=re!==C,xe=de!==G&&ne,ye=ce!==Z&&ue;if(!xe&&!ye&&!ne&&!ue)return;if((xe||ye||J[0]===1||J[1]===1)&&($.x=xe?de:N.x,$.y=ye?ce:N.y,N.x=$.x,N.y=$.y,j.length>0)){const De=de-G,Ke=ce-Z;for(const pt of j)pt.position={x:pt.position.x-De+J[0]*(se-te),y:pt.position.y-Ke+J[1]*(re-C)},B.push(pt)}if((ne||ue)&&($.width=ne&&(!u.resizeDirection||u.resizeDirection==="horizontal")?se:N.width,$.height=ue&&(!u.resizeDirection||u.resizeDirection==="vertical")?re:N.height,N.width=$.width,N.height=$.height),D&&w.expandParent){const De=J[0]*($.width??0);$.x&&$.x<De&&(N.x=De,_.x=_.x-($.x-De));const Ke=J[1]*($.height??0);$.y&&$.y<Ke&&(N.y=Ke,_.y=_.y-($.y-Ke))}const ge=nA({width:N.width,prevWidth:te,height:N.height,prevHeight:C,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),be={...N,direction:ge};A?.(V,be)!==!1&&(q=!0,E?.(V,be),a($,B))}).on("end",V=>{q&&(x?.(V,{...N}),r?.({...N}),q=!1)});c.call(ee)}function h(){c.on(".drag",null)}return{update:m,destroy:h}}var Xd={exports:{}},Kd={},Zd={exports:{}},Id={};var D0;function oA(){if(D0)return Id;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}}),x=E[0].inst,A=E[1];return c(function(){x.value=S,x.getSnapshot=y,h(x)&&A({inst:x})},[p,S,y]),r(function(){return h(x)&&A({inst:x}),p(function(){h(x)&&A({inst:x})})},[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 Id.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:v,Id}var j0;function rA(){return j0||(j0=1,Zd.exports=oA()),Zd.exports}var L0;function cA(){if(L0)return Kd;L0=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 Kd.useSyncExternalStoreWithSelector=function(g,v,p,y,S){var E=c(null);if(E.current===null){var x={hasValue:!1,value:null};E.current=x}else x=E.current;E=m(function(){function N(D){if(!_){if(_=!0,w=D,D=y(D),S!==void 0&&x.hasValue){var R=x.value;if(S(R,D))return O=R}return O=D}if(R=O,a(w,D))return R;var k=y(D);return S!==void 0&&S(R,k)?(w=D,R):(w=D,O=k)}var _=!1,w,O,j=p===void 0?null:p;return[function(){return N(v())},j===null?void 0:function(){return N(j())}]},[v,p,y,S]);var A=r(g,E[0],E[1]);return u(function(){x.hasValue=!0,x.value=A},[A]),h(A),A},Kd}var R0;function uA(){return R0||(R0=1,Xd.exports=cA()),Xd.exports}var fA=uA();const dA=_v(fA),hA={},k0=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?k0(t):k0,{useDebugValue:gA}=qc,{useSyncExternalStoreWithSelector:pA}=dA,yA=t=>t;function Db(t,i=yA,s){const a=pA(t.subscribe,t.getState,t.getServerState||t.getInitialState,i,s);return gA(a),a}const B0=(t,i)=>{const s=mA(t),a=(r,c=i)=>Db(s,r,c);return Object.assign(a,s),a},vA=(t,i)=>t?B0(t,i):B0;function We(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=Av();const Fc=K.createContext(null),SA=Fc.Provider,jb=En.error001("react");function Le(t,i){const s=K.useContext(Fc);if(s===null)throw new Error(jb);return Db(s,t,i)}function et(){const t=K.useContext(Fc);if(t===null)throw new Error(jb);return K.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%)"},Lb="react-flow__node-desc",Rb="react-flow__edge-desc",xA="react-flow__aria-live",EA=t=>t.ariaLiveMessage,NA=t=>t.ariaLabelConfig;function _A({rfId:t}){const i=Le(EA);return T.jsx("div",{id:`${xA}-${t}`,"aria-live":"assertive","aria-atomic":"true",style:wA,children:i})}function AA({rfId:t,disableKeyboardA11y:i}){const s=Le(NA);return T.jsxs(T.Fragment,{children:[T.jsx("div",{id:`${Lb}-${t}`,style:H0,children:i?s["node.a11yDescription.default"]:s["node.a11yDescription.keyboardDisabled"]}),T.jsx("div",{id:`${Rb}-${t}`,style:H0,children:s["edge.a11yDescription.default"]}),!i&&T.jsx(_A,{rfId:t})]})}const Jc=K.forwardRef(({position:t="top-left",children:i,className:s,style:a,...r},c)=>{const u=`${t}`.split("-");return T.jsx("div",{className:ht(["react-flow__panel",s,...u]),style:a,ref:c,...r,children:i})});Jc.displayName="Panel";function TA({proOptions:t,position:i="bottom-right"}){return t?.hideAttribution?null:T.jsx(Jc,{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:T.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 We(t.selectedNodes.map(oc),i.selectedNodes.map(oc))&&We(t.selectedEdges.map(oc),i.selectedEdges.map(oc))}function OA({onSelectionChange:t}){const i=et(),{selectedNodes:s,selectedEdges:a}=Le(MA,CA);return K.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=Le(zA);return t||i?T.jsx(OA,{onSelectionChange:t}):null}const kb=[0,0],jA={x:0,y:0,zoom:1},LA=["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=[...LA,"rfId"],RA=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:kb,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function kA(t){const{setNodes:i,setEdges:s,setMinZoom:a,setMaxZoom:r,setTranslateExtent:c,setNodeExtent:u,reset:m,setDefaultNodesAndEdges:h}=Le(RA,We),g=et();K.useEffect(()=>(h(t.defaultNodes,t.defaultEdges),()=>{v.current=U0,m()}),[]);const v=K.useRef(U0);return K.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:b_(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 BA(t){const[i,s]=K.useState(t==="system"?null:t);return K.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]=K.useState(!1),r=K.useRef(!1),c=K.useRef(new Set([])),[u,m]=K.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 K.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)&&gb(S))return!1;const x=G0(S.code,m);if(c.current.add(S[x]),Y0(u,c.current,!1)){const A=S.composedPath?.()?.[0]||S.target,N=A?.nodeName==="BUTTON"||A?.nodeName==="A";i.preventDefault!==!1&&(r.current||!N)&&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=et();return K.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 Bb(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 Bb(t,i)}function qA(t,i){return Bb(t,i)}function gs(t,i){return{id:t,type:"select",selected:i}}function _l(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=fb();function YA(t,i,s={}){return __(t,i,{...s,onError:s.onError??VA})}const Z0=t=>u_(t),GA=t=>ob(t);function Hb(t){return K.forwardRef(t)}const XA=typeof window<"u"?K.useLayoutEffect:K.useEffect;function I0(t){const[i,s]=K.useState(BigInt(0)),[a]=K.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 $b=K.createContext(null);function ZA({children:t}){const i=et(),s=K.useCallback(m=>{const{nodes:h=[],setNodes:g,hasDefaultNodes:v,onNodesChange:p,nodeLookup:y,fitViewQueued:S,onNodesChangeMiddlewareMap:E}=i.getState();let x=h;for(const N of m)x=typeof N=="function"?N(x):N;let A=X0({items:x,lookup:y});for(const N of E.values())A=N(A);v&&g(x),A.length>0?p?.(A):S&&window.requestAnimationFrame(()=>{const{fitViewQueued:N,nodes:_,setNodes:w}=i.getState();N&&w(_)})},[]),a=I0(s),r=K.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=I0(r),u=K.useMemo(()=>({nodeQueue:a,edgeQueue:c}),[]);return T.jsx($b.Provider,{value:u,children:t})}function IA(){const t=K.useContext($b);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const QA=t=>!!t.panZoom;function Wc(){const t=HA(),i=et(),s=IA(),a=Le(QA),r=K.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),x=E.parentId?hb(E.position,E.measured,E.parentId,y,S):E.position,A={...E,position:x,width:E.measured?.width??E.width,height:E.measured?.height??E.height};return ql(A)},g=(p,y,S={replace:!1})=>{u(E=>E.map(x=>{if(x.id===p){const A=typeof y=="function"?y(x):y;return S.replace&&Z0(A)?A:{...x,...A}}return x}))},v=(p,y,S={replace:!1})=>{m(E=>E.map(x=>{if(x.id===p){const A=typeof y=="function"?y(x):y;return S.replace&&GA(A)?A:{...x,...A}}return x}))};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,x,A]=S;return{nodes:p.map(N=>({...N})),edges:y.map(N=>({...N})),viewport:{x:E,y:x,zoom:A}}},deleteElements:async({nodes:p=[],edges:y=[]})=>{const{nodes:S,edges:E,onNodesDelete:x,onEdgesDelete:A,triggerNodeChanges:N,triggerEdgeChanges:_,onDelete:w,onBeforeDelete:O}=i.getState(),{nodes:j,edges:D}=await g_({nodesToRemove:p,edgesToRemove:y,nodes:S,edges:E,onBeforeDelete:O}),R=D.length>0,k=j.length>0;if(R){const q=D.map(K0);A?.(D),_(q)}if(k){const q=j.map(K0);x?.(j),N(q)}return(k||R)&&w?.({nodes:j,edges:D}),{deletedNodes:j,deletedEdges:D}},getIntersectingNodes:(p,y=!0,S)=>{const E=b0(p),x=E?p:h(p),A=S!==void 0;return x?(S||i.getState().nodes).filter(N=>{const _=i.getState().nodeLookup.get(N.id);if(_&&!E&&(N.id===p.id||!_.internals.positionAbsolute))return!1;const w=ql(A?N:_),O=po(w,x);return y&&O>0||O>=w.width*w.height||O>=x.width*x.height}):[]},isNodeIntersecting:(p,y,S=!0)=>{const x=b0(p)?p:h(p);if(!x)return!1;const A=po(x,y);return S&&A>0||A>=y.width*y.height||A>=x.width*x.height},updateNode:g,updateNodeData:(p,y,S={replace:!1})=>{g(p,E=>{const x=typeof y=="function"?y(E):y;return S.replace?{...E,data:x}:{...E,data:{...E.data,...x}}},S)},updateEdge:v,updateEdgeData:(p,y,S={replace:!1})=>{v(p,E=>{const x=typeof y=="function"?y(E):y;return S.replace?{...E,data:x}:{...E,data:{...E.data,...x}}},S)},getNodesBounds:p=>{const{nodeLookup:y,nodeOrigin:S}=i.getState();return f_(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??v_();return i.setState({fitViewQueued:!0,fitViewOptions:p,fitViewResolver:y}),s.nodeQueue.push(S=>[...S]),y.promise}}},[]);return K.useMemo(()=>({...r,...t,viewportInitialized:a}),[a])}const Q0=t=>t.selected,FA=typeof window<"u"?window:void 0;function JA({deleteKeyCode:t,multiSelectionKeyCode:i}){const s=et(),{deleteElements:a}=Wc(),r=vo(t,{actInsideInputWithModifier:!1}),c=vo(i,{target:FA});K.useEffect(()=>{if(r){const{edges:u,nodes:m}=s.getState();a({nodes:m.filter(Q0),edges:u.filter(Q0)}),s.setState({nodesSelectionActive:!1})}},[r]),K.useEffect(()=>{s.setState({multiSelectionActive:c})},[c])}function WA(t){const i=et();K.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",En.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 Pc={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=ws.Free,zoomOnDoubleClick:u=!0,panOnDrag:m=!0,defaultViewport:h,translateExtent:g,minZoom:v,maxZoom:p,zoomActivationKeyCode:y,preventScrolling:S=!0,children:E,noWheelClassName:x,noPanClassName:A,onViewportChange:N,isControlledViewport:_,paneClickDistance:w,selectionOnDrag:O}){const j=et(),D=K.useRef(null),{userSelectionActive:R,lib:k,connectionInProgress:q}=Le(PA,We),ee=vo(y),V=K.useRef();WA(D);const Q=K.useCallback(ae=>{N?.({x:ae[0],y:ae[1],zoom:ae[2]}),_||j.setState({transform:ae})},[N,_]);return K.useEffect(()=>{if(D.current){V.current=tA({domNode:D.current,minZoom:v,maxZoom:p,translateExtent:g,viewport:h,onDraggingChange:z=>j.setState(B=>B.paneDragging===z?B:{paneDragging:z}),onPanZoomStart:(z,B)=>{const{onViewportChangeStart:G,onMoveStart:Z}=j.getState();Z?.(z,B),G?.(B)},onPanZoom:(z,B)=>{const{onViewportChange:G,onMove:Z}=j.getState();Z?.(z,B),G?.(B)},onPanZoomEnd:(z,B)=>{const{onViewportChangeEnd:G,onMoveEnd:Z}=j.getState();Z?.(z,B),G?.(B)}});const{x:ae,y:L,zoom:Y}=V.current.getViewport();return j.setState({panZoom:V.current,transform:[ae,L,Y],domNode:D.current.closest(".react-flow")}),()=>{V.current?.destroy()}}},[]),K.useEffect(()=>{V.current?.update({onPaneContextMenu:t,zoomOnScroll:i,zoomOnPinch:s,panOnScroll:a,panOnScrollSpeed:r,panOnScrollMode:c,zoomOnDoubleClick:u,panOnDrag:m,zoomActivationKeyPressed:ee,preventScrolling:S,noPanClassName:A,userSelectionActive:R,noWheelClassName:x,lib:k,onTransformChange:Q,connectionInProgress:q,selectionOnDrag:O,paneClickDistance:w})},[t,i,s,a,r,c,u,m,ee,S,A,R,x,k,Q,q,O,w]),T.jsx("div",{className:"react-flow__renderer",ref:D,style:Pc,children:E})}const tT=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function nT(){const{userSelectionActive:t,userSelectionRect:i}=Le(tT,We);return t&&i?T.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:i.width,height:i.height,transform:`translate(${i.x}px, ${i.y}px)`}}):null}const Qd=(t,i)=>s=>{s.target===i.current&&t?.(s)},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:x}){const A=K.useRef(0),N=et(),{userSelectionActive:_,elementsSelectable:w,dragging:O,connectionInProgress:j,panBy:D,autoPanSpeed:R}=Le(iT,We),k=w&&(t||_),q=K.useRef(null),ee=K.useRef(),V=K.useRef(new Set),Q=K.useRef(new Set),ae=K.useRef(!1),L=K.useRef({x:0,y:0}),Y=K.useRef(!1),z=ne=>{if(ae.current||j){ae.current=!1;return}g?.(ne),N.getState().resetSelectedElements(),N.setState({nodesSelectionActive:!1})},B=ne=>{if(Array.isArray(a)&&a?.includes(2)){ne.preventDefault();return}v?.(ne)},G=p?ne=>p(ne):void 0,Z=ne=>{ae.current&&(ne.stopPropagation(),ae.current=!1)},te=ne=>{const{domNode:ue,transform:xe}=N.getState();if(ee.current=ue?.getBoundingClientRect(),!ee.current)return;const ye=ne.target===q.current;if(!ye&&!!ne.target.closest(".nokey")||!t||!(u&&ye||i)||ne.button!==0||!ne.isPrimary)return;ne.target?.setPointerCapture?.(ne.pointerId),ae.current=!1;const{x:Ee,y:De}=xn(ne.nativeEvent,ee.current),Ke=Kl({x:Ee,y:De},xe);N.setState({userSelectionRect:{width:0,height:0,startX:Ke.x,startY:Ke.y,x:Ee,y:De}}),ye||(ne.stopPropagation(),ne.preventDefault())};function C(ne,ue){const{userSelectionRect:xe}=N.getState();if(!xe)return;const{transform:ye,nodeLookup:ge,edgeLookup:be,connectionLookup:Ee,triggerNodeChanges:De,triggerEdgeChanges:Ke,defaultEdgeOptions:pt}=N.getState(),zt={x:xe.startX,y:xe.startY},{x:fe,y:we}=Vl(zt,ye),Ve={startX:zt.x,startY:zt.y,x:ne<fe?ne:fe,y:ue<we?ue:we,width:Math.abs(ne-fe),height:Math.abs(ue-we)},lt=V.current,vt=Q.current;V.current=new Set(Hh(ge,Ve,ye,s===mo.Partial,!0).map(At=>At.id)),Q.current=new Set;const Re=pt?.selectable??!0;for(const At of V.current){const Wt=Ee.get(At);if(Wt)for(const{edgeId:Pt}of Wt.values()){const en=be.get(Pt);en&&(en.selectable??Re)&&Q.current.add(Pt)}}if(!S0(lt,V.current)){const At=_l(ge,V.current,!0);De(At)}if(!S0(vt,Q.current)){const At=_l(be,Q.current);Ke(At)}N.setState({userSelectionRect:Ve,userSelectionActive:!0,nodesSelectionActive:!1})}function $(){if(!r||!ee.current)return;const[ne,ue]=$h(L.current,ee.current,R);D({x:ne,y:ue}).then(xe=>{if(!ae.current||!xe){A.current=requestAnimationFrame($);return}const{x:ye,y:ge}=L.current;C(ye,ge),A.current=requestAnimationFrame($)})}const J=()=>{cancelAnimationFrame(A.current),A.current=0,Y.current=!1};K.useEffect(()=>()=>J(),[]);const se=ne=>{const{userSelectionRect:ue,transform:xe,resetSelectedElements:ye}=N.getState();if(!ee.current||!ue)return;const{x:ge,y:be}=xn(ne.nativeEvent,ee.current);L.current={x:ge,y:be};const Ee=Vl({x:ue.startX,y:ue.startY},xe);if(!ae.current){const De=i?0:c;if(Math.hypot(ge-Ee.x,be-Ee.y)<=De)return;ye(),m?.(ne)}ae.current=!0,Y.current||($(),Y.current=!0),C(ge,be)},re=ne=>{ne.button===0&&(ne.target?.releasePointerCapture?.(ne.pointerId),!_&&ne.target===q.current&&N.getState().userSelectionRect&&z?.(ne),N.setState({userSelectionActive:!1,userSelectionRect:null}),ae.current&&(h?.(ne),N.setState({nodesSelectionActive:V.current.size>0})),J())},de=ne=>{ne.target?.releasePointerCapture?.(ne.pointerId),J()},ce=a===!0||Array.isArray(a)&&a.includes(0);return T.jsxs("div",{className:ht(["react-flow__pane",{draggable:ce,dragging:O,selection:t}]),onClick:k?void 0:Qd(z,q),onContextMenu:Qd(B,q),onWheel:Qd(G,q),onPointerEnter:k?void 0:y,onPointerMove:k?se:S,onPointerUp:k?re:void 0,onPointerCancel:k?de:void 0,onPointerDownCapture:k?te:void 0,onClickCapture:k?Z:void 0,onPointerLeave:E,ref:q,style:Pc,children:[x,T.jsx(nT,{})]})}function Sh({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",En.error012(t));return}i.setState({nodesSelectionActive:!1}),g.selected?(s||g.selected&&u)&&(c({nodes:[g],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):r([t])}function Ub({nodeRef:t,disabled:i=!1,noDragClassName:s,handleSelector:a,nodeId:r,isSelectable:c,nodeClickDistance:u}){const m=et(),[h,g]=K.useState(!1),v=K.useRef();return K.useEffect(()=>{v.current=q_({getStoreItems:()=>m.getState(),onNodeMouseDown:p=>{Sh({id:p,store:m,nodeRef:t})},onDragStart:()=>{g(!0)},onDragStop:()=>{g(!1)}})},[]),K.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 qb(){const t=et();return K.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,x=s.direction.x*S*s.factor,A=s.direction.y*E*s.factor;for(const[,N]of g){if(!y(N))continue;let _={x:N.internals.positionAbsolute.x+x,y:N.internals.positionAbsolute.y+A};r&&(_=To(_,c));const{position:w,positionAbsolute:O}=rb({nodeId:N.id,nextPosition:_,nodeLookup:g,nodeExtent:a,nodeOrigin:v,onError:m});N.position=w,N.internals.positionAbsolute=O,p.set(N.id,N)}h(p)},[])}const Zh=K.createContext(null),aT=Zh.Provider;Zh.Consumer;const Vb=()=>K.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=he.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,x=t==="target",A=et(),N=Vb(),{connectOnClick:_,noPanClassName:w,rfId:O}=Le(oT,We),{connectingFrom:j,connectingTo:D,clickConnecting:R,isPossibleEndHandle:k,connectionInProcess:q,clickConnectionInProcess:ee,valid:V}=Le(rT(N,E,t),We);N||A.getState().onError?.("010",En.error010());const Q=Y=>{const{defaultEdgeOptions:z,onConnect:B,hasDefaultEdges:G}=A.getState(),Z={...z,...Y};if(G){const{edges:te,setEdges:C,onError:$}=A.getState();C(YA(Z,te,{onError:$}))}B?.(Z),m?.(Z)},ae=Y=>{if(!N)return;const z=pb(Y.nativeEvent);if(r&&(z&&Y.button===0||!z)){const B=A.getState();bh.onPointerDown(Y.nativeEvent,{handleDomNode:Y.currentTarget,autoPanOnConnect:B.autoPanOnConnect,connectionMode:B.connectionMode,connectionRadius:B.connectionRadius,domNode:B.domNode,nodeLookup:B.nodeLookup,lib:B.lib,isTarget:x,handleId:E,nodeId:N,flowId:B.rfId,panBy:B.panBy,cancelConnection:B.cancelConnection,onConnectStart:B.onConnectStart,onConnectEnd:(...G)=>A.getState().onConnectEnd?.(...G),updateConnection:B.updateConnection,onConnect:Q,isValidConnection:s||((...G)=>A.getState().isValidConnection?.(...G)??!0),getTransform:()=>A.getState().transform,getFromHandle:()=>A.getState().connection.fromHandle,autoPanSpeed:B.autoPanSpeed,dragThreshold:B.connectionDragThreshold})}z?v?.(Y):p?.(Y)},L=Y=>{const{onClickConnectStart:z,onClickConnectEnd:B,connectionClickStartHandle:G,connectionMode:Z,isValidConnection:te,lib:C,rfId:$,nodeLookup:J,connection:se}=A.getState();if(!N||!G&&!r)return;if(!G){z?.(Y.nativeEvent,{nodeId:N,handleId:E,handleType:t}),A.setState({connectionClickStartHandle:{nodeId:N,type:t,id:E}});return}const re=mb(Y.target),de=s||te,{connection:ce,isValid:ne}=bh.isValid(Y.nativeEvent,{handle:{nodeId:N,id:E,type:t},connectionMode:Z,fromNodeId:G.nodeId,fromHandleId:G.id||null,fromType:G.type,isValidConnection:de,flowId:$,doc:re,lib:C,nodeLookup:J});ne&&ce&&Q(ce);const ue=structuredClone(se);delete ue.inProgress,ue.toPosition=ue.toHandle?ue.toHandle.position:null,B?.(Y,ue),A.setState({connectionClickStartHandle:null})};return T.jsx("div",{"data-handleid":E,"data-nodeid":N,"data-handlepos":i,"data-id":`${O}-${N}-${E}-${t}`,className:ht(["react-flow__handle",`react-flow__handle-${i}`,"nodrag",w,g,{source:!x,target:x,connectable:a,connectablestart:r,connectableend:c,clickconnecting:R,connectingfrom:j,connectingto:D,valid:V,connectionindicator:a&&(!q||k)&&(q||ee?c:r)}]),onMouseDown:ae,onTouchStart:ae,onClick:_?L:void 0,ref:S,...y,children:h})}const un=K.memo(Hb(cT));function uT({data:t,isConnectable:i,sourcePosition:s=he.Bottom}){return T.jsxs(T.Fragment,{children:[t?.label,T.jsx(un,{type:"source",position:s,isConnectable:i})]})}function fT({data:t,isConnectable:i,targetPosition:s=he.Top,sourcePosition:a=he.Bottom}){return T.jsxs(T.Fragment,{children:[T.jsx(un,{type:"target",position:s,isConnectable:i}),t?.label,T.jsx(un,{type:"source",position:a,isConnectable:i})]})}function dT(){return null}function hT({data:t,isConnectable:i,targetPosition:s=he.Top}){return T.jsxs(T.Fragment,{children:[T.jsx(un,{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}},F0={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:wn(i)?i:null,height:wn(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=et(),{width:r,height:c,transformString:u,userSelectionActive:m}=Le(gT,We),h=qb(),g=K.useRef(null);K.useEffect(()=>{s||g.current?.focus({preventScroll:!0})},[s]);const v=!m&&r!==null&&c!==null;if(Ub({nodeRef:g,disabled:!v}),!v)return null;const p=t?S=>{const E=a.getState().nodes.filter(x=>x.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 T.jsx("div",{className:ht(["react-flow__nodesselection","react-flow__container",i]),style:{transform:u},children:T.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 J0=typeof window<"u"?window:void 0,yT=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function Yb({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:x,zoomActivationKeyCode:A,elementsSelectable:N,zoomOnScroll:_,zoomOnPinch:w,panOnScroll:O,panOnScrollSpeed:j,panOnScrollMode:D,zoomOnDoubleClick:R,panOnDrag:k,autoPanOnSelection:q,defaultViewport:ee,translateExtent:V,minZoom:Q,maxZoom:ae,preventScrolling:L,onSelectionContextMenu:Y,noWheelClassName:z,noPanClassName:B,disableKeyboardA11y:G,onViewportChange:Z,isControlledViewport:te}){const{nodesSelectionActive:C,userSelectionActive:$}=Le(yT,We),J=vo(g,{target:J0}),se=vo(x,{target:J0}),re=se||k,de=se||O,ce=v&&re!==!0,ne=J||$||ce;return JA({deleteKeyCode:h,multiSelectionKeyCode:E}),T.jsx(eT,{onPaneContextMenu:c,elementsSelectable:N,zoomOnScroll:_,zoomOnPinch:w,panOnScroll:de,panOnScrollSpeed:j,panOnScrollMode:D,zoomOnDoubleClick:R,panOnDrag:!J&&re,defaultViewport:ee,translateExtent:V,minZoom:Q,maxZoom:ae,zoomActivationKeyCode:A,preventScrolling:L,noWheelClassName:z,noPanClassName:B,onViewportChange:Z,isControlledViewport:te,paneClickDistance:m,selectionOnDrag:ce,children:T.jsxs(sT,{onSelectionStart:y,onSelectionEnd:S,onPaneClick:i,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:r,onPaneContextMenu:c,onPaneScroll:u,panOnDrag:re,autoPanOnSelection:q,isSelecting:!!ne,selectionMode:p,selectionKeyPressed:J,paneClickDistance:m,selectionOnDrag:ce,children:[t,C&&T.jsx(pT,{onSelectionContextMenu:Y,noPanClassName:B,disableKeyboardA11y:G})]})})}Yb.displayName="FlowRenderer";const vT=K.memo(Yb),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 Le(K.useCallback(bT(t),[t]),We)}const wT=t=>t.updateNodeInternals;function xT(){const t=Le(wT),[i]=K.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 K.useEffect(()=>()=>{i?.disconnect()},[i]),i}function ET({node:t,nodeType:i,hasDimensions:s,resizeObserver:a}){const r=et(),c=K.useRef(null),u=K.useRef(null),m=K.useRef(t.sourcePosition),h=K.useRef(t.targetPosition),g=K.useRef(i),v=s&&!!t.internals.handleBounds;return K.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]),K.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),K.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 NT({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:x,nodeTypes:A,nodeClickDistance:N,onError:_}){const{node:w,internals:O,isParent:j}=Le(ne=>{const ue=ne.nodeLookup.get(t),xe=ne.parentLookup.has(t);return{node:ue,internals:ue.internals,isParent:xe}},We);let D=w.type||"default",R=A?.[D]||F0[D];R===void 0&&(_?.("003",En.error003(D)),D="default",R=A?.default||F0.default);const k=!!(w.draggable||m&&typeof w.draggable>"u"),q=!!(w.selectable||h&&typeof w.selectable>"u"),ee=!!(w.connectable||g&&typeof w.connectable>"u"),V=!!(w.focusable||v&&typeof w.focusable>"u"),Q=et(),ae=db(w),L=ET({node:w,nodeType:D,hasDimensions:ae,resizeObserver:p}),Y=Ub({nodeRef:L,disabled:w.hidden||!k,noDragClassName:y,handleSelector:w.dragHandle,nodeId:t,isSelectable:q,nodeClickDistance:N}),z=qb();if(w.hidden)return null;const B=ci(w),G=mT(w),Z=q||k||i||s||a||r,te=s?ne=>s(ne,{...O.userNode}):void 0,C=a?ne=>a(ne,{...O.userNode}):void 0,$=r?ne=>r(ne,{...O.userNode}):void 0,J=c?ne=>c(ne,{...O.userNode}):void 0,se=u?ne=>u(ne,{...O.userNode}):void 0,re=ne=>{const{selectNodesOnDrag:ue,nodeDragThreshold:xe}=Q.getState();q&&(!ue||!k||xe>0)&&Sh({id:t,store:Q,nodeRef:L}),i&&i(ne,{...O.userNode})},de=ne=>{if(!(gb(ne.nativeEvent)||E)){if(ib.includes(ne.key)&&q){const ue=ne.key==="Escape";Sh({id:t,store:Q,unselect:ue,nodeRef:L})}else if(k&&w.selected&&Object.prototype.hasOwnProperty.call(Lc,ne.key)){ne.preventDefault();const{ariaLabelConfig:ue}=Q.getState();Q.setState({ariaLiveMessage:ue["node.a11yDescription.ariaLiveMessage"]({direction:ne.key.replace("Arrow","").toLowerCase(),x:~~O.positionAbsolute.x,y:~~O.positionAbsolute.y})}),z({direction:Lc[ne.key],factor:ne.shiftKey?4:1})}}},ce=()=>{if(E||!L.current?.matches(":focus-visible"))return;const{transform:ne,width:ue,height:xe,autoPanOnNodeFocus:ye,setCenter:ge}=Q.getState();if(!ye)return;Hh(new Map([[t,w]]),{x:0,y:0,width:ue,height:xe},ne,!0).length>0||ge(w.position.x+B.width/2,w.position.y+B.height/2,{zoom:ne[2]})};return T.jsx("div",{className:ht(["react-flow__node",`react-flow__node-${D}`,{[S]:k},w.className,{selected:w.selected,selectable:q,parent:j,draggable:k,dragging:Y}]),ref:L,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:Z?"all":"none",visibility:ae?"visible":"hidden",...w.style,...G},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:te,onMouseMove:C,onMouseLeave:$,onContextMenu:J,onClick:re,onDoubleClick:se,onKeyDown:V?de:void 0,tabIndex:V?0:void 0,onFocus:V?ce:void 0,role:w.ariaRole??(V?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${Lb}-${x}`,"aria-label":w.ariaLabel,...w.domAttributes,children:T.jsx(aT,{value:t,children:T.jsx(R,{id:t,data:w.data,type:D,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:w.selected??!1,selectable:q,draggable:k,deletable:w.deletable??!0,isConnectable:ee,sourcePosition:w.sourcePosition,targetPosition:w.targetPosition,dragging:Y,dragHandle:w.dragHandle,zIndex:O.z,parentId:w.parentId,...B})})})}var _T=K.memo(NT);const AT=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function Gb(t){const{nodesDraggable:i,nodesConnectable:s,nodesFocusable:a,elementsSelectable:r,onError:c}=Le(AT,We),u=ST(t.onlyRenderVisibleElements),m=xT();return T.jsx("div",{className:"react-flow__nodes",style:Pc,children:u.map(h=>T.jsx(_T,{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))})}Gb.displayName="NodeRenderer";const TT=K.memo(Gb);function MT(t){return Le(K.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&&x_({sourceNode:c,targetNode:u,width:s.width,height:s.height,transform:s.transform})&&a.push(r.id)}return a},[t]),We)}const CT=({color:t="none",strokeWidth:i=1})=>{const s={strokeWidth:i,...t&&{stroke:t}};return T.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 T.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=et();return K.useMemo(()=>Object.prototype.hasOwnProperty.call(W0,t)?W0[t]:(i.getState().onError?.("009",En.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?T.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:T.jsx(h,{color:s,strokeWidth:u})}):null},Xb=({defaultColor:t,rfId:i})=>{const s=Le(c=>c.edges),a=Le(c=>c.defaultEdgeOptions),r=K.useMemo(()=>O_(s,{id:i,defaultColor:t,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[s,a,i,t]);return r.length?T.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:T.jsx("defs",{children:r.map(c=>T.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};Xb.displayName="MarkerDefinitions";var jT=K.memo(Xb);function Kb({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]=K.useState({x:1,y:0,width:0,height:0}),S=ht(["react-flow__edge-textwrapper",g]),E=K.useRef(null);return K.useEffect(()=>{if(E.current){const x=E.current.getBBox();y({x:x.x,y:x.y,width:x.width,height:x.height})}},[s]),s?T.jsxs("g",{transform:`translate(${t-p.width/2} ${i-p.height/2})`,className:S,visibility:p.width?"visible":"hidden",...v,children:[r&&T.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}),T.jsx("text",{className:"react-flow__edge-text",y:p.height/2,dy:"0.3em",ref:E,style:a,children:s}),h]}):null}Kb.displayName="EdgeText";const LT=K.memo(Kb);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 T.jsxs(T.Fragment,{children:[T.jsx("path",{...v,d:t,fill:"none",className:ht(["react-flow__edge-path",v.className])}),g?T.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:g,className:"react-flow__edge-interaction"}):null,a&&wn(i)&&wn(s)?T.jsx(LT,{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===he.Left||t===he.Right?[.5*(i+a),s]:[i,.5*(s+r)]}function Zb({sourceX:t,sourceY:i,sourcePosition:s=he.Bottom,targetX:a,targetY:r,targetPosition:c=he.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]=yb({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 Ib(t){return K.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:x,markerStart:A,interactionWidth:N})=>{const[_,w,O]=Zb({sourceX:s,sourceY:a,sourcePosition:u,targetX:r,targetY:c,targetPosition:m}),j=t.isInternal?void 0:i;return T.jsx(Mo,{id:j,path:_,labelX:w,labelY:O,label:h,labelStyle:g,labelShowBg:v,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:S,style:E,markerEnd:x,markerStart:A,interactionWidth:N})})}const RT=Ib({isInternal:!1}),Qb=Ib({isInternal:!0});RT.displayName="SimpleBezierEdge";Qb.displayName="SimpleBezierEdgeInternal";function Fb(t){return K.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=he.Bottom,targetPosition:E=he.Top,markerEnd:x,markerStart:A,pathOptions:N,interactionWidth:_})=>{const[w,O,j]=ph({sourceX:s,sourceY:a,sourcePosition:S,targetX:r,targetY:c,targetPosition:E,borderRadius:N?.borderRadius,offset:N?.offset,stepPosition:N?.stepPosition}),D=t.isInternal?void 0:i;return T.jsx(Mo,{id:D,path:w,labelX:O,labelY:j,label:u,labelStyle:m,labelShowBg:h,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:p,style:y,markerEnd:x,markerStart:A,interactionWidth:_})})}const Jb=Fb({isInternal:!1}),Wb=Fb({isInternal:!0});Jb.displayName="SmoothStepEdge";Wb.displayName="SmoothStepEdgeInternal";function Pb(t){return K.memo(({id:i,...s})=>{const a=t.isInternal?void 0:i;return T.jsx(Jb,{...s,id:a,pathOptions:K.useMemo(()=>({borderRadius:0,offset:s.pathOptions?.offset}),[s.pathOptions?.offset])})})}const kT=Pb({isInternal:!1}),e1=Pb({isInternal:!0});kT.displayName="StepEdge";e1.displayName="StepEdgeInternal";function t1(t){return K.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:x})=>{const[A,N,_]=Sb({sourceX:s,sourceY:a,targetX:r,targetY:c}),w=t.isInternal?void 0:i;return T.jsx(Mo,{id:w,path:A,labelX:N,labelY:_,label:u,labelStyle:m,labelShowBg:h,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:p,style:y,markerEnd:S,markerStart:E,interactionWidth:x})})}const BT=t1({isInternal:!1}),n1=t1({isInternal:!0});BT.displayName="StraightEdge";n1.displayName="StraightEdgeInternal";function i1(t){return K.memo(({id:i,sourceX:s,sourceY:a,targetX:r,targetY:c,sourcePosition:u=he.Bottom,targetPosition:m=he.Top,label:h,labelStyle:g,labelShowBg:v,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:S,style:E,markerEnd:x,markerStart:A,pathOptions:N,interactionWidth:_})=>{const[w,O,j]=vb({sourceX:s,sourceY:a,sourcePosition:u,targetX:r,targetY:c,targetPosition:m,curvature:N?.curvature}),D=t.isInternal?void 0:i;return T.jsx(Mo,{id:D,path:w,labelX:O,labelY:j,label:h,labelStyle:g,labelShowBg:v,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:S,style:E,markerEnd:x,markerStart:A,interactionWidth:_})})}const HT=i1({isInternal:!1}),s1=i1({isInternal:!0});HT.displayName="BezierEdge";s1.displayName="BezierEdgeInternal";const ev={default:s1,straight:n1,step:e1,smoothstep:Wb,simplebezier:Qb},tv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},$T=(t,i,s)=>s===he.Left?t-i:s===he.Right?t+i:t,UT=(t,i,s)=>s===he.Top?t-i:s===he.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 T.jsx("circle",{onMouseDown:r,onMouseEnter:c,onMouseOut:u,className:ht([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=et(),x=(O,j)=>{if(O.button!==0)return;const{autoPanOnConnect:D,domNode:R,connectionMode:k,connectionRadius:q,lib:ee,onConnectStart:V,cancelConnection:Q,nodeLookup:ae,rfId:L,panBy:Y,updateConnection:z}=E.getState(),B=j.type==="target",G=(C,$)=>{y(!1),p?.(C,s,j.type,$)},Z=C=>g?.(s,C),te=(C,$)=>{y(!0),v?.(O,s,j.type),V?.(C,$)};bh.onPointerDown(O.nativeEvent,{autoPanOnConnect:D,connectionMode:k,connectionRadius:q,domNode:R,handleId:j.id,nodeId:j.nodeId,nodeLookup:ae,isTarget:B,edgeUpdaterType:j.type,lib:ee,flowId:L,cancelConnection:Q,panBy:Y,isValidConnection:(...C)=>E.getState().isValidConnection?.(...C)??!0,onConnect:Z,onConnectStart:te,onConnectEnd:(...C)=>E.getState().onConnectEnd?.(...C),onReconnectEnd:G,updateConnection:z,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:O.currentTarget})},A=O=>x(O,{nodeId:s.target,id:s.targetHandle??null,type:"target"}),N=O=>x(O,{nodeId:s.source,id:s.sourceHandle??null,type:"source"}),_=()=>S(!0),w=()=>S(!1);return T.jsxs(T.Fragment,{children:[(t===!0||t==="source")&&T.jsx(iv,{position:m,centerX:a,centerY:r,radius:i,onMouseDown:A,onMouseEnter:_,onMouseOut:w,type:"source"}),(t===!0||t==="target")&&T.jsx(iv,{position:h,centerX:c,centerY:u,radius:i,onMouseDown:N,onMouseEnter:_,onMouseOut:w,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:x,noPanClassName:A,onError:N,disableKeyboardA11y:_}){let w=Le(ge=>ge.edgeLookup.get(t));const O=Le(ge=>ge.defaultEdgeOptions);w=O?{...O,...w}:w;let j=w.type||"default",D=x?.[j]||ev[j];D===void 0&&(N?.("011",En.error011(j)),j="default",D=x?.default||ev.default);const R=!!(w.focusable||i&&typeof w.focusable>"u"),k=typeof p<"u"&&(w.reconnectable||s&&typeof w.reconnectable>"u"),q=!!(w.selectable||a&&typeof w.selectable>"u"),ee=K.useRef(null),[V,Q]=K.useState(!1),[ae,L]=K.useState(!1),Y=et(),{zIndex:z,sourceX:B,sourceY:G,targetX:Z,targetY:te,sourcePosition:C,targetPosition:$}=Le(K.useCallback(ge=>{const be=ge.nodeLookup.get(w.source),Ee=ge.nodeLookup.get(w.target);if(!be||!Ee)return{zIndex:w.zIndex,...tv};const De=C_({id:t,sourceNode:be,targetNode:Ee,sourceHandle:w.sourceHandle||null,targetHandle:w.targetHandle||null,connectionMode:ge.connectionMode,onError:N});return{zIndex:w_({selected:w.selected,zIndex:w.zIndex,sourceNode:be,targetNode:Ee,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...De||tv}},[w.source,w.target,w.sourceHandle,w.targetHandle,w.selected,w.zIndex]),We),J=K.useMemo(()=>w.markerStart?`url('#${yh(w.markerStart,E)}')`:void 0,[w.markerStart,E]),se=K.useMemo(()=>w.markerEnd?`url('#${yh(w.markerEnd,E)}')`:void 0,[w.markerEnd,E]);if(w.hidden||B===null||G===null||Z===null||te===null)return null;const re=ge=>{const{addSelectedEdges:be,unselectNodesAndEdges:Ee,multiSelectionActive:De}=Y.getState();q&&(Y.setState({nodesSelectionActive:!1}),w.selected&&De?(Ee({nodes:[],edges:[w]}),ee.current?.blur()):be([t])),r&&r(ge,w)},de=c?ge=>{c(ge,{...w})}:void 0,ce=u?ge=>{u(ge,{...w})}:void 0,ne=m?ge=>{m(ge,{...w})}:void 0,ue=h?ge=>{h(ge,{...w})}:void 0,xe=g?ge=>{g(ge,{...w})}:void 0,ye=ge=>{if(!_&&ib.includes(ge.key)&&q){const{unselectNodesAndEdges:be,addSelectedEdges:Ee}=Y.getState();ge.key==="Escape"?(ee.current?.blur(),be({edges:[w]})):Ee([t])}};return T.jsx("svg",{style:{zIndex:z},children:T.jsxs("g",{className:ht(["react-flow__edge",`react-flow__edge-${j}`,w.className,A,{selected:w.selected,animated:w.animated,inactive:!q&&!r,updating:V,selectable:q}]),onClick:re,onDoubleClick:de,onContextMenu:ce,onMouseEnter:ne,onMouseMove:ue,onMouseLeave:xe,onKeyDown:R?ye:void 0,tabIndex:R?0:void 0,role:w.ariaRole??(R?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":w.ariaLabel===null?void 0:w.ariaLabel||`Edge from ${w.source} to ${w.target}`,"aria-describedby":R?`${Rb}-${E}`:void 0,ref:ee,...w.domAttributes,children:[!ae&&T.jsx(D,{id:t,source:w.source,target:w.target,type:w.type,selected:w.selected,animated:w.animated,selectable:q,deletable:w.deletable??!0,label:w.label,labelStyle:w.labelStyle,labelShowBg:w.labelShowBg,labelBgStyle:w.labelBgStyle,labelBgPadding:w.labelBgPadding,labelBgBorderRadius:w.labelBgBorderRadius,sourceX:B,sourceY:G,targetX:Z,targetY:te,sourcePosition:C,targetPosition:$,data:w.data,style:w.style,sourceHandleId:w.sourceHandle,targetHandleId:w.targetHandle,markerStart:J,markerEnd:se,pathOptions:"pathOptions"in w?w.pathOptions:void 0,interactionWidth:w.interactionWidth}),k&&T.jsx(qT,{edge:w,isReconnectable:k,reconnectRadius:v,onReconnect:p,onReconnectStart:y,onReconnectEnd:S,sourceX:B,sourceY:G,targetX:Z,targetY:te,sourcePosition:C,targetPosition:$,setUpdateHover:Q,setReconnecting:L})]})})}var YT=K.memo(VT);const GT=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function l1({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:x}){const{edgesFocusable:A,edgesReconnectable:N,elementsSelectable:_,onError:w}=Le(GT,We),O=MT(i);return T.jsxs("div",{className:"react-flow__edges",children:[T.jsx(jT,{defaultColor:t,rfId:s}),O.map(j=>T.jsx(YT,{id:j,edgesFocusable:A,edgesReconnectable:N,elementsSelectable:_,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:w,edgeTypes:a,disableKeyboardA11y:x},j))]})}l1.displayName="EdgeRenderer";const XT=K.memo(l1),KT=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function ZT({children:t}){const i=Le(KT);return T.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:i},children:t})}function IT(t){const i=Wc(),s=K.useRef(!1);K.useEffect(()=>{!s.current&&i.viewportInitialized&&t&&(setTimeout(()=>t(i),1),s.current=!0)},[t,i.viewportInitialized])}const QT=t=>t.panZoom?.syncViewport;function FT(t){const i=Le(QT),s=et();return K.useEffect(()=>{t&&(i?.(t),s.setState({transform:[t.x,t.y,t.zoom]}))},[t,i]),null}function JT(t){return t.connection.inProgress?{...t.connection,to:Kl(t.connection.to,t.transform)}:{...t.connection}}function WT(t){return JT}function PT(t){const i=WT();return Le(i,We)}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}=Le(eM,We);return!(c&&r&&h)?null:T.jsx("svg",{style:t,width:c,height:u,className:"react-flow__connectionline react-flow__container",children:T.jsx("g",{className:ht(["react-flow__connection",ab(m)]),children:T.jsx(a1,{style:i,type:s,CustomComponent:a,isValid:m})})})}const a1=({style:t,type:i=Gi.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 T.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:ab(a),toNode:v,toHandle:p,pointer:S});let E="";const x={sourceX:c.x,sourceY:c.y,sourcePosition:h,targetX:g.x,targetY:g.y,targetPosition:y};switch(i){case Gi.Bezier:[E]=vb(x);break;case Gi.SimpleBezier:[E]=Zb(x);break;case Gi.Step:[E]=ph({...x,borderRadius:0});break;case Gi.SmoothStep:[E]=ph(x);break;default:[E]=Sb(x)}return T.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:t})};a1.displayName="ConnectionLine";const nM={};function sv(t=nM){K.useRef(t),et(),K.useEffect(()=>{},[t])}function iM(){et(),K.useRef(!1),K.useEffect(()=>{},[])}function o1({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:x,connectionLineComponent:A,connectionLineContainerStyle:N,selectionKeyCode:_,selectionOnDrag:w,selectionMode:O,multiSelectionKeyCode:j,panActivationKeyCode:D,zoomActivationKeyCode:R,deleteKeyCode:k,onlyRenderVisibleElements:q,elementsSelectable:ee,defaultViewport:V,translateExtent:Q,minZoom:ae,maxZoom:L,preventScrolling:Y,defaultMarkerColor:z,zoomOnScroll:B,zoomOnPinch:G,panOnScroll:Z,panOnScrollSpeed:te,panOnScrollMode:C,zoomOnDoubleClick:$,panOnDrag:J,autoPanOnSelection:se,onPaneClick:re,onPaneMouseEnter:de,onPaneMouseMove:ce,onPaneMouseLeave:ne,onPaneScroll:ue,onPaneContextMenu:xe,paneClickDistance:ye,nodeClickDistance:ge,onEdgeContextMenu:be,onEdgeMouseEnter:Ee,onEdgeMouseMove:De,onEdgeMouseLeave:Ke,reconnectRadius:pt,onReconnect:zt,onReconnectStart:fe,onReconnectEnd:we,noDragClassName:Ve,noWheelClassName:lt,noPanClassName:vt,disableKeyboardA11y:Re,nodeExtent:At,rfId:Wt,viewport:Pt,onViewportChange:en}){return sv(t),sv(i),iM(),IT(s),FT(Pt),T.jsx(vT,{onPaneClick:re,onPaneMouseEnter:de,onPaneMouseMove:ce,onPaneMouseLeave:ne,onPaneContextMenu:xe,onPaneScroll:ue,paneClickDistance:ye,deleteKeyCode:k,selectionKeyCode:_,selectionOnDrag:w,selectionMode:O,onSelectionStart:y,onSelectionEnd:S,multiSelectionKeyCode:j,panActivationKeyCode:D,zoomActivationKeyCode:R,elementsSelectable:ee,zoomOnScroll:B,zoomOnPinch:G,zoomOnDoubleClick:$,panOnScroll:Z,panOnScrollSpeed:te,panOnScrollMode:C,panOnDrag:J,autoPanOnSelection:se,defaultViewport:V,translateExtent:Q,minZoom:ae,maxZoom:L,onSelectionContextMenu:p,preventScrolling:Y,noDragClassName:Ve,noWheelClassName:lt,noPanClassName:vt,disableKeyboardA11y:Re,onViewportChange:en,isControlledViewport:!!Pt,children:T.jsxs(ZT,{children:[T.jsx(XT,{edgeTypes:i,onEdgeClick:r,onEdgeDoubleClick:u,onReconnect:zt,onReconnectStart:fe,onReconnectEnd:we,onlyRenderVisibleElements:q,onEdgeContextMenu:be,onEdgeMouseEnter:Ee,onEdgeMouseMove:De,onEdgeMouseLeave:Ke,reconnectRadius:pt,defaultMarkerColor:z,noPanClassName:vt,disableKeyboardA11y:Re,rfId:Wt}),T.jsx(tM,{style:x,type:E,component:A,containerStyle:N}),T.jsx("div",{className:"react-flow__edgelabel-renderer"}),T.jsx(TT,{nodeTypes:t,onNodeClick:a,onNodeDoubleClick:c,onNodeMouseEnter:m,onNodeMouseMove:h,onNodeMouseLeave:g,onNodeContextMenu:v,nodeClickDistance:ge,onlyRenderVisibleElements:q,noPanClassName:vt,noDragClassName:Ve,disableKeyboardA11y:Re,nodeExtent:At,rfId:Wt}),T.jsx("div",{className:"react-flow__viewport-portal"})]})})}o1.displayName="GraphView";const sM=K.memo(o1),lM=fb(),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,x=new Map,A=new Map,N=a??i??[],_=s??t??[],w=v??[0,0],O=p??ho;Eb(x,A,N);const{nodesInitialized:j}=vh(_,S,E,{nodeOrigin:w,nodeExtent:O,zIndexMode:y});let D=[0,0,1];if(u&&r&&c){const R=Ao(S,{filter:V=>!!((V.width||V.initialWidth)&&(V.height||V.initialHeight))}),{x:k,y:q,zoom:ee}=Uh(R,r,c,h,g,m?.padding??.1);D=[k,q,ee]}return{rfId:"1",width:r??0,height:c??0,transform:D,nodes:_,nodesInitialized:j,nodeLookup:S,parentLookup:E,edges:N,edgeLookup:A,connectionLookup:x,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:s!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:g,translateExtent:ho,nodeExtent:O,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:$l.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:w,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:{...lb},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:sb,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 x(){const{nodeLookup:A,panZoom:N,fitViewOptions:_,fitViewResolver:w,width:O,height:j,minZoom:D,maxZoom:R}=E();N&&(await m_({nodes:A,width:O,height:j,panZoom:N,minZoom:D,maxZoom:R},_),w?.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:A=>{const{nodeLookup:N,parentLookup:_,nodeOrigin:w,elevateNodesOnSelect:O,fitViewQueued:j,zIndexMode:D,nodesSelectionActive:R}=E(),{nodesInitialized:k,hasSelectedNodes:q}=vh(A,N,_,{nodeOrigin:w,nodeExtent:p,elevateNodesOnSelect:O,checkEquality:!0,zIndexMode:D}),ee=R&&q;j&&k?(x(),S({nodes:A,nodesInitialized:k,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:ee})):S({nodes:A,nodesInitialized:k,nodesSelectionActive:ee})},setEdges:A=>{const{connectionLookup:N,edgeLookup:_}=E();Eb(N,_,A),S({edges:A})},setDefaultNodesAndEdges:(A,N)=>{if(A){const{setNodes:_}=E();_(A),S({hasDefaultNodes:!0})}if(N){const{setEdges:_}=E();_(N),S({hasDefaultEdges:!0})}},updateNodeInternals:A=>{const{triggerNodeChanges:N,nodeLookup:_,parentLookup:w,domNode:O,nodeOrigin:j,nodeExtent:D,debug:R,fitViewQueued:k,zIndexMode:q}=E(),{changes:ee,updatedInternals:V}=B_(A,_,w,O,j,D,q);V&&(j_(_,w,{nodeOrigin:j,nodeExtent:D,zIndexMode:q}),k?(x(),S({fitViewQueued:!1,fitViewOptions:void 0})):S({}),ee?.length>0&&(R&&console.log("React Flow: trigger node changes",ee),N?.(ee)))},updateNodePositions:(A,N=!1)=>{const _=[];let w=[];const{nodeLookup:O,triggerNodeChanges:j,connection:D,updateConnection:R,onNodesChangeMiddlewareMap:k}=E();for(const[q,ee]of A){const V=O.get(q),Q=!!(V?.expandParent&&V?.parentId&&ee?.position),ae={id:q,type:"position",position:Q?{x:Math.max(0,ee.position.x),y:Math.max(0,ee.position.y)}:ee.position,dragging:N};if(V&&D.inProgress&&D.fromNode.id===V.id){const L=As(V,D.fromHandle,he.Left,!0);R({...D,from:L})}Q&&V.parentId&&_.push({id:q,parentId:V.parentId,rect:{...ee.internals.positionAbsolute,width:ee.measured.width??0,height:ee.measured.height??0}}),w.push(ae)}if(_.length>0){const{parentLookup:q,nodeOrigin:ee}=E(),V=Kh(_,O,q,ee);w.push(...V)}for(const q of k.values())w=q(w);j(w)},triggerNodeChanges:A=>{const{onNodesChange:N,setNodes:_,nodes:w,hasDefaultNodes:O,debug:j}=E();if(A?.length){if(O){const D=UA(A,w);_(D)}j&&console.log("React Flow: trigger node changes",A),N?.(A)}},triggerEdgeChanges:A=>{const{onEdgesChange:N,setEdges:_,edges:w,hasDefaultEdges:O,debug:j}=E();if(A?.length){if(O){const D=qA(A,w);_(D)}j&&console.log("React Flow: trigger edge changes",A),N?.(A)}},addSelectedNodes:A=>{const{multiSelectionActive:N,edgeLookup:_,nodeLookup:w,triggerNodeChanges:O,triggerEdgeChanges:j}=E();if(N){const D=A.map(R=>gs(R,!0));O(D);return}O(_l(w,new Set([...A]),!0)),j(_l(_))},addSelectedEdges:A=>{const{multiSelectionActive:N,edgeLookup:_,nodeLookup:w,triggerNodeChanges:O,triggerEdgeChanges:j}=E();if(N){const D=A.map(R=>gs(R,!0));j(D);return}j(_l(_,new Set([...A]))),O(_l(w,new Set,!0))},unselectNodesAndEdges:({nodes:A,edges:N}={})=>{const{edges:_,nodes:w,nodeLookup:O,triggerNodeChanges:j,triggerEdgeChanges:D}=E(),R=A||w,k=N||_,q=[];for(const V of R){if(!V.selected)continue;const Q=O.get(V.id);Q&&(Q.selected=!1),q.push(gs(V.id,!1))}const ee=[];for(const V of k)V.selected&&ee.push(gs(V.id,!1));j(q),D(ee)},setMinZoom:A=>{const{panZoom:N,maxZoom:_}=E();N?.setScaleExtent([A,_]),S({minZoom:A})},setMaxZoom:A=>{const{panZoom:N,minZoom:_}=E();N?.setScaleExtent([_,A]),S({maxZoom:A})},setTranslateExtent:A=>{E().panZoom?.setTranslateExtent(A),S({translateExtent:A})},resetSelectedElements:()=>{const{edges:A,nodes:N,triggerNodeChanges:_,triggerEdgeChanges:w,elementsSelectable:O}=E();if(!O)return;const j=N.reduce((R,k)=>k.selected?[...R,gs(k.id,!1)]:R,[]),D=A.reduce((R,k)=>k.selected?[...R,gs(k.id,!1)]:R,[]);_(j),w(D)},setNodeExtent:A=>{const{nodes:N,nodeLookup:_,parentLookup:w,nodeOrigin:O,elevateNodesOnSelect:j,nodeExtent:D,zIndexMode:R}=E();A[0][0]===D[0][0]&&A[0][1]===D[0][1]&&A[1][0]===D[1][0]&&A[1][1]===D[1][1]||(vh(N,_,w,{nodeOrigin:O,nodeExtent:A,elevateNodesOnSelect:j,checkEquality:!1,zIndexMode:R}),S({nodeExtent:A}))},panBy:A=>{const{transform:N,width:_,height:w,panZoom:O,translateExtent:j}=E();return H_({delta:A,panZoom:O,transform:N,translateExtent:j,width:_,height:w})},setCenter:async(A,N,_)=>{const{width:w,height:O,maxZoom:j,panZoom:D}=E();if(!D)return!1;const R=typeof _?.zoom<"u"?_.zoom:j;return await D.setViewport({x:w/2-A*R,y:O/2-N*R,zoom:R},{duration:_?.duration,ease:_?.ease,interpolate:_?.interpolate}),!0},cancelConnection:()=>{S({connection:{...lb}})},updateConnection:A=>{S({connection:A})},reset:()=>S({...lv()})}},Object.is);function r1({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]=K.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 T.jsx(SA,{value:E,children:T.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 K.useContext(Fc)?T.jsx(T.Fragment,{children:t}):T.jsx(r1,{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:x,onClickConnectStart:A,onClickConnectEnd:N,onNodeMouseEnter:_,onNodeMouseMove:w,onNodeMouseLeave:O,onNodeContextMenu:j,onNodeDoubleClick:D,onNodeDragStart:R,onNodeDrag:k,onNodeDragStop:q,onNodesDelete:ee,onEdgesDelete:V,onDelete:Q,onSelectionChange:ae,onSelectionDragStart:L,onSelectionDrag:Y,onSelectionDragStop:z,onSelectionContextMenu:B,onSelectionStart:G,onSelectionEnd:Z,onBeforeDelete:te,connectionMode:C,connectionLineType:$=Gi.Bezier,connectionLineStyle:J,connectionLineComponent:se,connectionLineContainerStyle:re,deleteKeyCode:de="Backspace",selectionKeyCode:ce="Shift",selectionOnDrag:ne=!1,selectionMode:ue=mo.Full,panActivationKeyCode:xe="Space",multiSelectionKeyCode:ye=yo()?"Meta":"Control",zoomActivationKeyCode:ge=yo()?"Meta":"Control",snapToGrid:be,snapGrid:Ee,onlyRenderVisibleElements:De=!1,selectNodesOnDrag:Ke,nodesDraggable:pt,autoPanOnNodeFocus:zt,nodesConnectable:fe,nodesFocusable:we,nodeOrigin:Ve=kb,edgesFocusable:lt,edgesReconnectable:vt,elementsSelectable:Re=!0,defaultViewport:At=jA,minZoom:Wt=.5,maxZoom:Pt=2,translateExtent:en=ho,preventScrolling:gu=!0,nodeExtent:zs,defaultMarkerColor:pu="#b1b1b7",zoomOnScroll:yu=!0,zoomOnPinch:Qi=!0,panOnScroll:Tt=!1,panOnScrollSpeed:An=.5,panOnScrollMode:Mt=ws.Free,zoomOnDoubleClick:vu=!0,panOnDrag:bu=!0,onPaneClick:Su,onPaneMouseEnter:Ds,onPaneMouseMove:js,onPaneMouseLeave:Ls,onPaneScroll:Bn,onPaneContextMenu:Rs,paneClickDistance:Fi=1,nodeClickDistance:wu=0,children:Do,onReconnect:Pl,onReconnectStart:Ji,onReconnectEnd:xu,onEdgeContextMenu:jo,onEdgeDoubleClick:Lo,onEdgeMouseEnter:Ro,onEdgeMouseMove:ea,onEdgeMouseLeave:ta,reconnectRadius:ko=10,onNodesChange:Bo,onEdgesChange:Tn,noDragClassName:mt="nodrag",noWheelClassName:Et="nowheel",noPanClassName:Hn="nopan",fitView:ks,fitViewOptions:Ho,connectOnClick:Eu,attributionPosition:$o,proOptions:Wi,defaultEdgeOptions:na,elevateNodesOnSelect:ui=!0,elevateEdgesOnSelect:fi=!1,disableKeyboardA11y:di=!1,autoPanOnConnect:hi,autoPanOnNodeDrag:rt,autoPanOnSelection:Uo=!0,autoPanSpeed:qo,connectionRadius:$n,isValidConnection:mi,onError:Nu,style:Vo,id:ia,nodeDragThreshold:_u,connectionDragThreshold:Bs,viewport:Hs,onViewportChange:hn,width:Dt,height:Yo,colorMode:Au="light",debug:sa,onScroll:la,ariaLabelConfig:$s,zIndexMode:Go="basic",...jt},aa){const Us=ia||"1",oa=BA(Au),gi=K.useCallback(ra=>{ra.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),la?.(ra)},[la]);return T.jsx("div",{"data-testid":"rf__wrapper",...jt,onScroll:gi,style:{...Vo,...rM},ref:aa,className:ht(["react-flow",r,oa]),id:ia,role:"application",children:T.jsxs(oM,{nodes:t,edges:i,width:Dt,height:Yo,fitView:ks,fitViewOptions:Ho,minZoom:Wt,maxZoom:Pt,nodeOrigin:Ve,nodeExtent:zs,zIndexMode:Go,children:[T.jsx(kA,{nodes:t,edges:i,defaultNodes:s,defaultEdges:a,onConnect:S,onConnectStart:E,onConnectEnd:x,onClickConnectStart:A,onClickConnectEnd:N,nodesDraggable:pt,autoPanOnNodeFocus:zt,nodesConnectable:fe,nodesFocusable:we,edgesFocusable:lt,edgesReconnectable:vt,elementsSelectable:Re,elevateNodesOnSelect:ui,elevateEdgesOnSelect:fi,minZoom:Wt,maxZoom:Pt,nodeExtent:zs,onNodesChange:Bo,onEdgesChange:Tn,snapToGrid:be,snapGrid:Ee,connectionMode:C,translateExtent:en,connectOnClick:Eu,defaultEdgeOptions:na,fitView:ks,fitViewOptions:Ho,onNodesDelete:ee,onEdgesDelete:V,onDelete:Q,onNodeDragStart:R,onNodeDrag:k,onNodeDragStop:q,onSelectionDrag:Y,onSelectionDragStart:L,onSelectionDragStop:z,onMove:v,onMoveStart:p,onMoveEnd:y,noPanClassName:Hn,nodeOrigin:Ve,rfId:Us,autoPanOnConnect:hi,autoPanOnNodeDrag:rt,autoPanSpeed:qo,onError:Nu,connectionRadius:$n,isValidConnection:mi,selectNodesOnDrag:Ke,nodeDragThreshold:_u,connectionDragThreshold:Bs,onBeforeDelete:te,debug:sa,ariaLabelConfig:$s,zIndexMode:Go}),T.jsx(sM,{onInit:g,onNodeClick:m,onEdgeClick:h,onNodeMouseEnter:_,onNodeMouseMove:w,onNodeMouseLeave:O,onNodeContextMenu:j,onNodeDoubleClick:D,nodeTypes:c,edgeTypes:u,connectionLineType:$,connectionLineStyle:J,connectionLineComponent:se,connectionLineContainerStyle:re,selectionKeyCode:ce,selectionOnDrag:ne,selectionMode:ue,deleteKeyCode:de,multiSelectionKeyCode:ye,panActivationKeyCode:xe,zoomActivationKeyCode:ge,onlyRenderVisibleElements:De,defaultViewport:At,translateExtent:en,minZoom:Wt,maxZoom:Pt,preventScrolling:gu,zoomOnScroll:yu,zoomOnPinch:Qi,zoomOnDoubleClick:vu,panOnScroll:Tt,panOnScrollSpeed:An,panOnScrollMode:Mt,panOnDrag:bu,autoPanOnSelection:Uo,onPaneClick:Su,onPaneMouseEnter:Ds,onPaneMouseMove:js,onPaneMouseLeave:Ls,onPaneScroll:Bn,onPaneContextMenu:Rs,paneClickDistance:Fi,nodeClickDistance:wu,onSelectionContextMenu:B,onSelectionStart:G,onSelectionEnd:Z,onReconnect:Pl,onReconnectStart:Ji,onReconnectEnd:xu,onEdgeContextMenu:jo,onEdgeDoubleClick:Lo,onEdgeMouseEnter:Ro,onEdgeMouseMove:ea,onEdgeMouseLeave:ta,reconnectRadius:ko,defaultMarkerColor:pu,noDragClassName:mt,noWheelClassName:Et,noPanClassName:Hn,rfId:Us,disableKeyboardA11y:di,nodeExtent:zs,viewport:Hs,onViewportChange:hn}),T.jsx(DA,{onSelectionChange:ae}),Do,T.jsx(TA,{proOptions:Wi,position:$o}),T.jsx(AA,{rfId:Us,disableKeyboardA11y:di})]})})}var uM=Hb(cM);const fM=t=>t.domNode?.querySelector(".react-flow__edgelabel-renderer");function dM({children:t}){const i=Le(fM);return i?bA.createPortal(t,i):null}function hM({dimensions:t,lineWidth:i,variant:s,className:a}){return T.jsx("path",{strokeWidth:i,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:ht(["react-flow__background-pattern",s,a])})}function mM({radius:t,className:i}){return T.jsx("circle",{cx:t,cy:t,r:t,className:ht(["react-flow__background-pattern","dots",i])})}var Xi;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(Xi||(Xi={}));const gM={[Xi.Dots]:1,[Xi.Lines]:1,[Xi.Cross]:6},pM=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function c1({id:t,variant:i=Xi.Dots,gap:s=20,size:a,lineWidth:r=1,offset:c=0,color:u,bgColor:m,style:h,className:g,patternClassName:v}){const p=K.useRef(null),{transform:y,patternId:S}=Le(pM,We),E=a||gM[i],x=i===Xi.Dots,A=i===Xi.Cross,N=Array.isArray(s)?s:[s,s],_=[N[0]*y[2]||1,N[1]*y[2]||1],w=E*y[2],O=Array.isArray(c)?c:[c,c],j=A?[w,w]:_,D=[O[0]*y[2]||1+j[0]/2,O[1]*y[2]||1+j[1]/2],R=`${S}${t||""}`;return T.jsxs("svg",{className:ht(["react-flow__background",g]),style:{...h,...Pc,"--xy-background-color-props":m,"--xy-background-pattern-color-props":u},ref:p,"data-testid":"rf__background",children:[T.jsx("pattern",{id:R,x:y[0]%_[0],y:y[1]%_[1],width:_[0],height:_[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${D[0]},-${D[1]})`,children:x?T.jsx(mM,{radius:w/2,className:v}):T.jsx(hM,{dimensions:j,lineWidth:r,variant:i,className:v})}),T.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${R})`})]})}c1.displayName="Background";const yM=K.memo(c1);function vM(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:T.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function bM(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:T.jsx("path",{d:"M0 0h32v4.2H0z"})})}function SM(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:T.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 T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:T.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 T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:T.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 T.jsx("button",{type:"button",className:ht(["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 u1({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=et(),{isInteractive:x,minZoomReached:A,maxZoomReached:N,ariaLabelConfig:_}=Le(EM,We),{zoomIn:w,zoomOut:O,fitView:j}=Wc(),D=()=>{w(),c?.()},R=()=>{O(),u?.()},k=()=>{j(r),m?.()},q=()=>{E.setState({nodesDraggable:!x,nodesConnectable:!x,elementsSelectable:!x}),h?.(!x)},ee=y==="horizontal"?"horizontal":"vertical";return T.jsxs(Jc,{className:ht(["react-flow__controls",ee,g]),position:p,style:t,"data-testid":"rf__controls","aria-label":S??_["controls.ariaLabel"],children:[i&&T.jsxs(T.Fragment,{children:[T.jsx(rc,{onClick:D,className:"react-flow__controls-zoomin",title:_["controls.zoomIn.ariaLabel"],"aria-label":_["controls.zoomIn.ariaLabel"],disabled:N,children:T.jsx(vM,{})}),T.jsx(rc,{onClick:R,className:"react-flow__controls-zoomout",title:_["controls.zoomOut.ariaLabel"],"aria-label":_["controls.zoomOut.ariaLabel"],disabled:A,children:T.jsx(bM,{})})]}),s&&T.jsx(rc,{className:"react-flow__controls-fitview",onClick:k,title:_["controls.fitView.ariaLabel"],"aria-label":_["controls.fitView.ariaLabel"],children:T.jsx(SM,{})}),a&&T.jsx(rc,{className:"react-flow__controls-interactive",onClick:q,title:_["controls.interactive.ariaLabel"],"aria-label":_["controls.interactive.ariaLabel"],children:x?T.jsx(xM,{}):T.jsx(wM,{})}),v]})}u1.displayName="Controls";const NM=K.memo(u1);function _M({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:x}=c||{},A=u||E||x;return T.jsx("rect",{className:ht(["react-flow__minimap-node",{selected:y},g]),x:i,y:s,rx:v,ry:v,width:a,height:r,style:{fill:A,stroke:m,strokeWidth:h},shapeRendering:p,onClick:S?N=>S(N,t):void 0})}const AM=K.memo(_M),TM=t=>t.nodes.map(i=>i.id),Fd=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=Le(TM,We),h=Fd(i),g=Fd(t),v=Fd(s),p=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return T.jsx(T.Fragment,{children:m.map(y=>T.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}=Le(E=>{const x=E.nodeLookup.get(t);if(!x)return{node:void 0,x:0,y:0,width:0,height:0};const A=x.internals.userNode,{x:N,y:_}=x.internals.positionAbsolute,{width:w,height:O}=ci(A);return{node:A,x:N,y:_,width:w,height:O}},We);return!g||g.hidden||!db(g)?null:T.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=K.memo(CM);var zM=K.memo(MM);const DM=200,jM=150,LM=t=>!t.hidden,RM=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?ub(Ao(t.nodeLookup,{filter:LM}),i):i,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},kM="react-flow__minimap-desc";function f1({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:x=!1,zoomable:A=!1,ariaLabel:N,inversePan:_,zoomStep:w=1,offsetScale:O=5}){const j=et(),D=K.useRef(null),{boundingRect:R,viewBB:k,rfId:q,panZoom:ee,translateExtent:V,flowWidth:Q,flowHeight:ae,ariaLabelConfig:L}=Le(RM,We),Y=t?.width??DM,z=t?.height??jM,B=R.width/Y,G=R.height/z,Z=Math.max(B,G),te=Z*Y,C=Z*z,$=O*Z,J=R.x-(te-R.width)/2-$,se=R.y-(C-R.height)/2-$,re=te+$*2,de=C+$*2,ce=`${kM}-${q}`,ne=K.useRef(0),ue=K.useRef();ne.current=Z,K.useEffect(()=>{if(D.current&&ee)return ue.current=Z_({domNode:D.current,panZoom:ee,getTransform:()=>j.getState().transform,getViewScale:()=>ne.current}),()=>{ue.current?.destroy()}},[ee]),K.useEffect(()=>{ue.current?.update({translateExtent:V,width:Q,height:ae,inversePan:_,pannable:x,zoomStep:w,zoomable:A})},[x,A,_,w,V,Q,ae]);const xe=S?be=>{const[Ee,De]=ue.current?.pointer(be)||[0,0];S(be,{x:Ee,y:De})}:void 0,ye=E?K.useCallback((be,Ee)=>{const De=j.getState().nodeLookup.get(Ee).internals.userNode;E(be,De)},[]):void 0,ge=N??L["minimap.ariaLabel"];return T.jsx(Jc,{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*Z: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:ht(["react-flow__minimap",i]),"data-testid":"rf__minimap",children:T.jsxs("svg",{width:Y,height:z,viewBox:`${J} ${se} ${re} ${de}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ce,ref:D,onClick:xe,children:[ge&&T.jsx("title",{id:ce,children:ge}),T.jsx(zM,{onClick:ye,nodeColor:a,nodeStrokeColor:s,nodeBorderRadius:c,nodeClassName:r,nodeStrokeWidth:u,nodeComponent:m}),T.jsx("path",{className:"react-flow__minimap-mask",d:`M${J-$},${se-$}h${re+$*2}v${de+$*2}h${-re-$*2}z
|
|
15
|
+
M${k.x},${k.y}h${k.width}v${k.height}h${-k.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}f1.displayName="MiniMap";K.memo(f1);const BM=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:x,onResize:A,onResizeEnd:N}){const _=Vb(),w=typeof t=="string"?t:_,O=et(),j=K.useRef(null),D=s===Yl.Handle,R=Le(K.useCallback(BM(D&&S),[D,S]),We),k=K.useRef(null),q=i??HM[s];K.useEffect(()=>{if(!(!j.current||!w))return k.current||(k.current=aA({domNode:j.current,nodeId:w,getStoreItems:()=>{const{nodeLookup:V,transform:Q,snapGrid:ae,snapToGrid:L,nodeOrigin:Y,domNode:z}=O.getState();return{nodeLookup:V,transform:Q,snapGrid:ae,snapToGrid:L,nodeOrigin:Y,paneDomNode:z}},onChange:(V,Q)=>{const{triggerNodeChanges:ae,nodeLookup:L,parentLookup:Y,nodeOrigin:z}=O.getState(),B=[],G={x:V.x,y:V.y},Z=L.get(w);if(Z&&Z.expandParent&&Z.parentId){const te=Z.origin??z,C=V.width??Z.measured.width??0,$=V.height??Z.measured.height??0,J={id:Z.id,parentId:Z.parentId,rect:{width:C,height:$,...hb({x:V.x??Z.position.x,y:V.y??Z.position.y},{width:C,height:$},Z.parentId,L,te)}},se=Kh([J],L,Y,z);B.push(...se),G.x=V.x?Math.max(te[0]*C,V.x):void 0,G.y=V.y?Math.max(te[1]*$,V.y):void 0}if(G.x!==void 0&&G.y!==void 0){const te={id:w,type:"position",position:{...G}};B.push(te)}if(V.width!==void 0&&V.height!==void 0){const C={id:w,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:V.width,height:V.height}};B.push(C)}for(const te of Q){const C={...te,type:"position"};B.push(C)}ae(B)},onEnd:({width:V,height:Q})=>{const ae={id:w,type:"dimensions",resizing:!1,dimensions:{width:V,height:Q}};O.getState().triggerNodeChanges([ae])}})),k.current.update({controlPosition:q,boundaries:{minWidth:m,minHeight:h,maxWidth:g,maxHeight:v},keepAspectRatio:p,resizeDirection:y,onResizeStart:x,onResize:A,onResizeEnd:N,shouldResize:E}),()=>{k.current?.destroy()}},[q,m,h,g,v,p,x,A,N,E]);const ee=q.split("-");return T.jsx("div",{className:ht(["react-flow__resize-control","nodrag",...ee,s,a]),ref:j,style:{...r,scale:R,...u&&{[D?"backgroundColor":"borderColor"]:u}},children:c})}K.memo($M);const av=3,UM=new Set(["command-event","event-query"]);function d1(t){return[...new Set(t)]}function h1(t){return t?.trim()?d1(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,h1(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=d1([...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 qi=180,Vi=80,m1=80,si=430,Dl=390,g1=130,vn=178,XM=92,wh=300,xh=170,Rc=18,Eh=48,Jd=30,Sc=92,p1=38,KM=42,cv=154,uv=278,y1=408;function ZM(t){return t==="slice-screen"||t==="story-slice"?"#cbd5e1":"#64748b"}function IM(t){if(t==="added")return"#15803d";if(t==="removed")return"#b91c1c";if(t==="changed")return"#b45309"}function QM(t){return t.type==="event"?{sourcePosition:he.Right,targetPosition:he.Left}:{sourcePosition:he.Bottom,targetPosition:he.Top}}function FM(t){return new Map(t.stories.map((i,s)=>[i.name,s]))}function jl(t,i){return t===0?0:t*i+(t-1)*Rc}function wc(t,i,s){const a=t.slices.find(r=>r.path===i);return t.nodes.filter(r=>r.type===s&&(r.sourcePath?r.sourcePath===i:r.sliceTitle===a?.title))}function JM(t,i,s){const a=new Set(wc(t,s,"command").map(c=>c.id));return[...new Set(t.edges.filter(c=>c.kind==="command-event"&&a.has(c.source)).map(c=>c.target))].map(c=>i.get(c)).filter(c=>!!c)}function WM(t,i){return new Map(t.slices.map(s=>{const a=wc(t,s.path,"query"),r=wc(t,s.path,"command"),c=JM(t,i,s.path),u=wc(t,s.path,"gwt"),m=jl(a.length,vn),h=jl(r.length,vn),g=m+h+(m>0&&h>0?Eh:0),v=jl(c.length,vn),p=u.length?wh:0,y=Math.max(si,g+Jd*2,v+Jd*2,p+Jd*2),S=u.length>0?y1+xh+36:Dl;return[s.path,{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 PM(t,i){const s=new Map;let a=Vi;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.path)?.width??si),0),m=Math.max(u+Math.max(c.length-1,0)*g1,si),h=Math.max(...c.map(v=>i.get(v.path)?.height??Dl),Dl),g=Sc+h+p1;s.set(r.name,{y:a,width:m,height:g}),a+=g+m1}return s}function eC(t,i,s,a,r,c){const u=jl(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 tC(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 nC(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 iC(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 sC(t,i,s,a,r){const c=iC(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 lC(t,i,s={}){const a=FM(t),r=new Map(t.nodes.map(_=>[_.id,_])),c=WM(t,r),u=_=>_?.sourcePath??t.slices.find(w=>w.title===(_?.sliceTitle??_?.label))?.path??"",m=PM(t,c),h=new Map,g=new Map,v=new Map,p=new Set,y=nC(t,s.focusedStory,s.scope??"all"),S=tC(s.edgeDetail??"normal");if(i){p.add(i);for(const _ of t.edges)_.source===i&&p.add(_.target),_.target===i&&p.add(_.source)}const E=new Map;for(const _ of t.stories)E.set(_.name,qi);for(const _ of t.stories)for(const w of _.slices){const O=t.slices.find(R=>R.path===w);if(!O)continue;const j=m.get(_.name)??{y:Vi},D=E.get(_.name)??qi;v.set(O.path,{x:D,y:j.y+Sc}),E.set(_.name,D+(c.get(O.path)?.width??si)+g1)}for(const _ of t.slices){if(v.has(_.path))continue;const w=Vi+(a.get(_.storyName??"")??0)*(Dl+Sc+p1+m1),O=qi;v.set(_.path,{x:O,y:w+Sc})}for(const _ of t.nodes){if(_.type==="story"&&h.set(_.id,{x:qi-20,y:m.get(_.label)?.y??Vi}),_.type==="slice"){const w=v.get(u(_))??{x:qi,y:Vi};h.set(_.id,w)}if(_.type==="screen"||_.type==="processor"){const w=v.get(u(_))??{x:qi,y:Vi},j=c.get(u(_))?.width??si;h.set(_.id,{x:w.x+(j-vn)/2,y:w.y+KM})}}for(const _ of t.slices){const w=v.get(_.path)??{x:qi,y:Vi},O=c.get(_.path),j=O?.width??si;if(!O)continue;const D=jl(O.queryIds.length,vn),R=jl(O.commandIds.length,vn),k=D+R+(D>0&&R>0?Eh:0);let q=w.x+(j-k)/2;O.queryIds.forEach((ee,V)=>{h.set(ee,{x:q+V*(vn+Rc),y:w.y+cv})}),D>0&&(q+=D+(R>0?Eh:0)),O.commandIds.forEach((ee,V)=>{h.set(ee,{x:q+V*(vn+Rc),y:w.y+cv})}),eC(O.eventIds,h,w,j,uv,vn);for(const ee of O.gwtIds)h.set(ee,{x:w.x+(j-wh)/2,y:w.y+y1})}for(const _ of t.nodes.filter(w=>w.type==="event")){const w=t.edges.find(j=>j.kind==="command-event"&&j.target===_.id),O=w?r.get(w.source):void 0;if(!h.has(_.id)){const j=v.get(u(O))??{x:qi,y:Vi},D=c.get(u(O));h.set(_.id,{x:j.x+((D?.width??si)-vn)/2,y:j.y+uv})}_.storyName=O?.storyName}const x=t.nodes.map(_=>{const w=h.get(_.id)??{x:0,y:0},O=_.type==="story"||_.type==="slice",j=_.type==="story"?m.get(_.label)?.width??si:c.get(u(_))?.width??si,D=_.type==="story"?m.get(_.label)?.height??Dl:c.get(u(_))?.height??Dl,R=O?j:_.type==="gwt"?wh:vn,k=O?D:_.type==="gwt"?xh:XM;g.set(_.id,{x:w.x,y:w.y,width:R,height:k});const q=_.type==="gwt"?t.nodes.filter(ee=>ee.type==="gwt"&&(_.sourcePath?ee.sourcePath===_.sourcePath:ee.sliceTitle===_.sliceTitle)).filter(ee=>!s.diffFilter||s.diffFilter==="all"||s.diffNodeStatus?.[ee.id]===s.diffFilter):void 0;return{id:_.id,type:O?"groupNode":"eventModelNode",position:w,initialWidth:O||_.type==="gwt"?R:void 0,initialHeight:O||_.type==="gwt"?k:void 0,selectable:!0,draggable:!1,data:{projectNode:_,scenarios:q,scenarioStatus:s.diffNodeStatus,selectedScenarioId:i,selected:_.id===i||!!q?.some(ee=>ee.id===i),connected:p.has(_.id),diffStatus:s.diffNodeStatus?.[_.id]},hidden:!!(q&&q[0]?.id!==_.id)||!!(_.storyName&&!y.has(_.storyName))||!!(!q&&s.diffFilter&&s.diffFilter!=="all"&&s.diffNodeStatus?.[_.id]!==s.diffFilter),style:O?{width:j,height:D,zIndex:_.type==="story"?-20:-10,opacity:_.storyName&&!y.has(_.storyName)?.18:1}:{width:R,height:_.type==="gwt"?xh:void 0,opacity:_.storyName&&!y.has(_.storyName)?.18:1},...QM(_)}}),N=t.edges.filter(_=>S.has(_.kind)).filter(_=>{const w=r.get(_.source),O=r.get(_.target),j=!w?.storyName||y.has(w.storyName),D=!O?.storyName||y.has(O.storyName);return j&&D}).map(_=>{const w=r.get(_.source),O=r.get(_.target),j=!!s.focusedEdgeIds?.has(_.id),D=s.diffEdgeStatus?.[_.id],R=IM(D),{sourceSide:k,targetSide:q,route:ee}=sC(_.kind,w,O,g.get(_.source),g.get(_.target));return{id:_.id,source:_.source,target:_.target,type:"eventModelEdge",sourceHandle:`${k}-source`,targetHandle:`${q}-target`,data:{kind:_.kind,route:ee,active:j,diffStatus:D,fieldFlow:s.edgeFieldFlows?.get(_.id),selectedFieldName:s.selectedFieldName,onSelectField:s.onSelectField},markerEnd:{type:go.ArrowClosed,color:j?"#111827":R??ZM(_.kind)},label:s.edgeDetail==="verbose"?_.label:void 0,className:`edge ${j?"edge-active":""} ${D?`edge-diff-${D}`:""}`,hidden:!!(s.diffFilter&&s.diffFilter!=="all"&&D!==s.diffFilter),animated:j}});return{nodes:x,edges:N}}const Ih=Symbol.for("yaml.alias"),Nh=Symbol.for("yaml.document"),Ki=Symbol.for("yaml.map"),v1=Symbol.for("yaml.pair"),Rn=Symbol.for("yaml.scalar"),Zl=Symbol.for("yaml.seq"),dn=Symbol.for("yaml.node.type"),Ms=t=>!!t&&typeof t=="object"&&t[dn]===Ih,Cs=t=>!!t&&typeof t=="object"&&t[dn]===Nh,Il=t=>!!t&&typeof t=="object"&&t[dn]===Ki,Pe=t=>!!t&&typeof t=="object"&&t[dn]===v1,Ie=t=>!!t&&typeof t=="object"&&t[dn]===Rn,Ql=t=>!!t&&typeof t=="object"&&t[dn]===Zl;function tt(t){if(t&&typeof t=="object")switch(t[dn]){case Ki:case Zl:return!0}return!1}function nt(t){if(t&&typeof t=="object")switch(t[dn]){case Ih:case Ki:case Rn:case Zl:return!0}return!1}const b1=t=>(Ie(t)||tt(t))&&!!t.anchor,Ut=Symbol("break visit"),S1=Symbol("skip children"),Ln=Symbol("remove node");function Os(t,i){const s=w1(i);Cs(t)?Al(null,t.contents,s,Object.freeze([t]))===Ln&&(t.contents=null):Al(null,t,s,Object.freeze([]))}Os.BREAK=Ut;Os.SKIP=S1;Os.REMOVE=Ln;function Al(t,i,s,a){const r=x1(t,i,s,a);if(nt(r)||Pe(r))return E1(t,a,r),Al(t,r,s,a);if(typeof r!="symbol"){if(tt(i)){a=Object.freeze(a.concat(i));for(let c=0;c<i.items.length;++c){const u=Al(c,i.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===Ut)return Ut;u===Ln&&(i.items.splice(c,1),c-=1)}}}else if(Pe(i)){a=Object.freeze(a.concat(i));const c=Al("key",i.key,s,a);if(c===Ut)return Ut;c===Ln&&(i.key=null);const u=Al("value",i.value,s,a);if(u===Ut)return Ut;u===Ln&&(i.value=null)}}return r}async function eu(t,i){const s=w1(i);Cs(t)?await Tl(null,t.contents,s,Object.freeze([t]))===Ln&&(t.contents=null):await Tl(null,t,s,Object.freeze([]))}eu.BREAK=Ut;eu.SKIP=S1;eu.REMOVE=Ln;async function Tl(t,i,s,a){const r=await x1(t,i,s,a);if(nt(r)||Pe(r))return E1(t,a,r),Tl(t,r,s,a);if(typeof r!="symbol"){if(tt(i)){a=Object.freeze(a.concat(i));for(let c=0;c<i.items.length;++c){const u=await Tl(c,i.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===Ut)return Ut;u===Ln&&(i.items.splice(c,1),c-=1)}}}else if(Pe(i)){a=Object.freeze(a.concat(i));const c=await Tl("key",i.key,s,a);if(c===Ut)return Ut;c===Ln&&(i.key=null);const u=await Tl("value",i.value,s,a);if(u===Ut)return Ut;u===Ln&&(i.value=null)}}return r}function w1(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 x1(t,i,s,a){if(typeof s=="function")return s(t,i,a);if(Il(i))return s.Map?.(t,i,a);if(Ql(i))return s.Seq?.(t,i,a);if(Pe(i))return s.Pair?.(t,i,a);if(Ie(i))return s.Scalar?.(t,i,a);if(Ms(i))return s.Alias?.(t,i,a)}function E1(t,i,s){const a=i[i.length-1];if(tt(a))a.items[t]=s;else if(Pe(a))t==="key"?a.key=s:a.value=s;else if(Cs(a))a.contents=s;else{const r=Ms(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const aC={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},oC=t=>t.replace(/[!,[\]{}]/g,i=>aC[i]);class Ot{constructor(i,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},Ot.defaultYaml,i),this.tags=Object.assign({},Ot.defaultTags,s)}clone(){const i=new Ot(this.yaml,this.tags);return i.docStart=this.docStart,i}atDocument(){const i=new Ot(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:Ot.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},Ot.defaultTags);break}return i}add(i,s){this.atNextDocument&&(this.yaml={explicit:Ot.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},Ot.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+oC(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&&nt(i.contents)){const c={};Os(i.contents,(u,m)=>{nt(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
|
+
`)}}Ot.defaultYaml={explicit:!1,version:"1.2"};Ot.defaultTags={"!!":"tag:yaml.org,2002:"};function N1(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 _1(t){const i=new Set;return Os(t,{Value(s,a){a.anchor&&i.add(a.anchor)}}),i}function A1(t,i){for(let s=1;;++s){const a=`${t}${s}`;if(!i.has(a))return a}}function rC(t,i){const s=[],a=new Map;let r=null;return{onAnchor:c=>{s.push(c),r??(r=_1(t));const u=A1(i,r);return r.add(u),u},setAnchors:()=>{for(const c of s){const u=a.get(c);if(typeof u=="object"&&u.anchor&&(Ie(u.node)||tt(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 Ml(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=Ml(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=Ml(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=Ml(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=Ml(t,a,r,c);u===void 0?delete a[r]:u!==c&&(a[r]=u)}return t.call(i,s,a)}function fn(t,i,s){if(Array.isArray(t))return t.map((a,r)=>fn(a,String(r),s));if(t&&typeof t.toJSON=="function"){if(!s||!b1(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 Qh{constructor(i){Object.defineProperty(this,dn,{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(!Cs(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=fn(this,"",u);if(typeof r=="function")for(const{count:h,res:g}of u.anchors.values())r(g,h);return typeof c=="function"?Ml(c,{"":m},"",m):m}}class tu extends Qh{constructor(i){super(Ih),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=[],Os(i,{Node:(c,u)=>{(Ms(u)||b1(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||(fn(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=xc(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(N1(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 xc(t,i,s){if(Ms(i)){const a=i.resolve(t),r=s&&a&&s.get(a);return r?r.count*r.aliasCount:0}else if(tt(i)){let a=0;for(const r of i.items){const c=xc(t,r,s);c>a&&(a=c)}return a}else if(Pe(i)){const a=xc(t,i.key,s),r=xc(t,i.value,s);return Math.max(a,r)}return 1}const T1=t=>!t||typeof t!="function"&&typeof t!="object";class _e extends Qh{constructor(i){super(Rn),this.value=i}toJSON(i,s){return s?.keep?this.value:fn(this.value,i,s)}toString(){return String(this.value)}}_e.BLOCK_FOLDED="BLOCK_FOLDED";_e.BLOCK_LITERAL="BLOCK_LITERAL";_e.PLAIN="PLAIN";_e.QUOTE_DOUBLE="QUOTE_DOUBLE";_e.QUOTE_SINGLE="QUOTE_SINGLE";const cC="tag:yaml.org,2002:";function uC(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(Cs(t)&&(t=t.contents),nt(t))return t;if(Pe(t)){const p=s.schema[Ki].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 tu(h.anchor);h={anchor:null,node:null},m.set(t,h)}i?.startsWith("!!")&&(i=cC+i.slice(2));let g=uC(t,i,u.tags);if(!g){if(t&&typeof t.toJSON=="function"&&(t=t.toJSON()),!t||typeof t!="object"){const p=new _e(t);return h&&(h.node=p),p}g=t instanceof Map?u[Ki]:Symbol.iterator in Object(t)?u[Zl]:u[Ki]}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 _e(t);return i?v.tag=i:g.default||(v.tag=g.tag),h&&(h.node=v),v}function kc(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 M1 extends Qh{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=>nt(a)||Pe(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(tt(c))c.addIn(r,s);else if(c===void 0&&this.schema)this.set(a,kc(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(tt(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&&Ie(c)?c.value:c:tt(c)?c.getIn(r,s):void 0}hasAllNullValues(i){return this.items.every(s=>{if(!Pe(s))return!1;const a=s.value;return a==null||i&&Ie(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 tt(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(tt(c))c.setIn(r,s);else if(c===void 0&&this.schema)this.set(a,kc(this.schema,r,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${r}`)}}}const fC=t=>t.replace(/^(?!$)(?: $)?/gm,"#");function ai(t,i){return/^\n+$/.test(t)?t.substring(1):i?t.replace(/^(?! *$)/gm,i):t}const ys=(t,i,s)=>t.endsWith(`
|
|
17
|
+
`)?ai(s,i):s.includes(`
|
|
18
|
+
`)?`
|
|
19
|
+
`+ai(s,i):(t.endsWith(" ")?"":" ")+s,C1="flow",_h="block",Ec="quoted";function nu(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,x=-1,A=-1,N=-1;s===_h&&(x=fv(t,x,i.length),x!==-1&&(p=x+h));for(let w;w=t[x+=1];){if(s===Ec&&w==="\\"){switch(A=x,t[x+1]){case"x":x+=3;break;case"u":x+=5;break;case"U":x+=9;break;default:x+=1}N=x}if(w===`
|
|
20
|
+
`)s===_h&&(x=fv(t,x,i.length)),p=x+i.length+h,y=void 0;else{if(w===" "&&S&&S!==" "&&S!==`
|
|
21
|
+
`&&S!==" "){const O=t[x+1];O&&O!==" "&&O!==`
|
|
22
|
+
`&&O!==" "&&(y=x)}if(x>=p)if(y)g.push(y),p=y+h,y=void 0;else if(s===Ec){for(;S===" "||S===" ";)S=w,w=t[x+=1],E=!0;const O=x>N+1?x-2:A-1;if(v[O])return t;g.push(O),v[O]=!0,p=O+h,y=void 0}else E=!0}S=w}if(E&&m&&m(),g.length===0)return t;u&&u();let _=t.slice(0,g[0]);for(let w=0;w<g.length;++w){const O=g[w],j=g[w+1]||t.length;O===0?_=`
|
|
23
|
+
${i}${t.slice(0,j)}`:(s===Ec&&v[O]&&(_+=`${t[O]}\\`),_+=`
|
|
24
|
+
${i}${t.slice(O+1,j)}`)}return _}function fv(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 iu=(t,i)=>({indentAtStart:i?t.indent.length:t.indentAtStart,lineWidth:t.options.lineWidth,minContentWidth:t.options.minContentWidth}),su=t=>/^(%|---|\.\.\.)/m.test(t);function dC(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||(su(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:nu(u,c,Ec,iu(i,!1))}function Ah(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||(su(t)?" ":""),a="'"+t.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
31
|
+
${s}`)+"'";return i.implicitKey?a:nu(a,s,C1,iu(i,!1))}function Cl(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=Ah:c&&!r?a=ao:a=s?Ah:ao}return a(t,i)}let Th;try{Th=new RegExp(`(^|(?<!
|
|
32
|
+
))
|
|
33
|
+
+(?!
|
|
34
|
+
|$)`,"g")}catch{Th=/\n+(?!\n|$)/g}function Nc({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 Cl(s,a);const g=a.indent||(a.forceBlockIndent||su(s)?" ":""),v=u==="literal"?!0:u==="folded"||i===_e.BLOCK_FOLDED?!1:i===_e.BLOCK_LITERAL?!0:!dC(s,h,g.length);if(!s)return v?`|
|
|
35
|
+
`:`>
|
|
36
|
+
`;let p,y;for(y=s.length;y>0;--y){const j=s[y-1];if(j!==`
|
|
37
|
+
`&&j!==" "&&j!==" ")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(Th,`$&${g}`));let x=!1,A,N=-1;for(A=0;A<s.length;++A){const j=s[A];if(j===" ")x=!0;else if(j===`
|
|
40
|
+
`)N=A;else break}let _=s.substring(0,N<A?N+1:A);_&&(s=s.substring(_.length),_=_.replace(/\n+/g,`$&${g}`));let O=(x?g?"2":"1":"")+p;if(t&&(O+=" "+m(t.replace(/ ?[\r\n]+/g," ")),r&&r()),!v){const j=s.replace(/\n+/g,`
|
|
41
|
+
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${g}`);let D=!1;const R=iu(a,!0);u!=="folded"&&i!==_e.BLOCK_FOLDED&&(R.onOverflow=()=>{D=!0});const k=nu(`${_}${j}${S}`,g,_h,R);if(!D)return`>${O}
|
|
42
|
+
${g}${k}`}return s=s.replace(/\n+/g,`$&${g}`),`|${O}
|
|
43
|
+
${g}${_}${s}${S}`}function hC(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 Cl(c,i);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return m||v||!c.includes(`
|
|
45
|
+
`)?Cl(c,i):Nc(t,i,s,a);if(!m&&!v&&r!==_e.PLAIN&&c.includes(`
|
|
46
|
+
`))return Nc(t,i,s,a);if(su(c)){if(h==="")return i.forceBlockIndent=!0,Nc(t,i,s,a);if(m&&h===g)return Cl(c,i)}const p=c.replace(/\n+/g,`$&
|
|
47
|
+
${h}`);if(u){const y=x=>x.default&&x.tag!=="tag:yaml.org,2002:str"&&x.test?.test(p),{compat:S,tags:E}=i.doc.schema;if(E.some(y)||S?.some(y))return Cl(c,i)}return m?p:nu(p,h,C1,iu(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!==_e.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(u.value)&&(m=_e.QUOTE_DOUBLE);const h=v=>{switch(v){case _e.BLOCK_FOLDED:case _e.BLOCK_LITERAL:return r||c?Cl(u.value,i):Nc(u,i,s,a);case _e.QUOTE_DOUBLE:return ao(u.value,i);case _e.QUOTE_SINGLE:return Ah(u.value,i);case _e.PLAIN:return hC(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 O1(t,i){const s=Object.assign({blockQuote:!0,commentString:fC,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 mC(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(Ie(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 gC(t,i,{anchors:s,doc:a}){if(!a.directives)return"";const r=[],c=(Ie(t)||tt(t))&&t.anchor;c&&N1(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(Pe(t))return t.toString(i,s,a);if(Ms(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=nt(t)?t:i.doc.createNode(t,{onTagObj:h=>r=h});r??(r=mC(i.doc.schema.tags,c));const u=gC(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):Ie(c)?Co(c,i,s,a):c.toString(i,s,a);return u?Ie(c)||m[0]==="{"||m[0]==="["?`${u} ${m}`:`${u}
|
|
48
|
+
${i.indent}${m}`:m}function pC({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=nt(t)&&t.comment||null;if(p){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(tt(t)||!nt(t)&&typeof t=="object"){const R="With simple keys, collection cannot be used as a key value";throw new Error(R)}}let S=!p&&(!t||y&&i==null&&!s.inFlow||tt(t)||(Ie(t)?t.type===_e.BLOCK_FOLDED||t.type===_e.BLOCK_LITERAL:typeof t=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!S&&(p||!c),indent:m+h});let E=!1,x=!1,A=Gl(t,s,()=>E=!0,()=>x=!0);if(!S&&!s.inFlow&&A.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(),A===""?"?":S?`? ${A}`:A}else if(c&&!p||i==null&&S)return A=`? ${A}`,y&&!E?A+=ys(A,s.indent,g(y)):x&&r&&r(),A;E&&(y=null),S?(y&&(A+=ys(A,s.indent,g(y))),A=`? ${A}
|
|
49
|
+
${m}:`):(A=`${A}:`,y&&(A+=ys(A,s.indent,g(y))));let N,_,w;nt(i)?(N=!!i.spaceBefore,_=i.commentBefore,w=i.comment):(N=!1,_=null,w=null,i&&typeof i=="object"&&(i=u.createNode(i))),s.implicitKey=!1,!S&&!y&&Ie(i)&&(s.indentAtStart=A.length+1),x=!1,!v&&h.length>=2&&!s.inFlow&&!S&&Ql(i)&&!i.flow&&!i.tag&&!i.anchor&&(s.indent=s.indent.substring(2));let O=!1;const j=Gl(i,s,()=>O=!0,()=>x=!0);let D=" ";if(y||N||_){if(D=N?`
|
|
50
|
+
`:"",_){const R=g(_);D+=`
|
|
51
|
+
${ai(R,s.indent)}`}j===""&&!s.inFlow?D===`
|
|
52
|
+
`&&w&&(D=`
|
|
53
|
+
|
|
54
|
+
`):D+=`
|
|
55
|
+
${s.indent}`}else if(!S&&tt(i)){const R=j[0],k=j.indexOf(`
|
|
56
|
+
`),q=k!==-1,ee=s.inFlow??i.flow??i.items.length===0;if(q||!ee){let V=!1;if(q&&(R==="&"||R==="!")){let Q=j.indexOf(" ");R==="&"&&Q!==-1&&Q<k&&j[Q+1]==="!"&&(Q=j.indexOf(" ",Q+1)),(Q===-1||k<Q)&&(V=!0)}V||(D=`
|
|
57
|
+
${s.indent}`)}}else(j===""||j[0]===`
|
|
58
|
+
`)&&(D="");return A+=D+j,s.inFlow?O&&a&&a():w&&!O?A+=ys(A,s.indent,g(w)):x&&r&&r(),A}function z1(t,i){(t==="debug"||t==="warn")&&console.warn(i)}const cc="<<",oi={identify:t=>t===cc||typeof t=="symbol"&&t.description===cc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new _e(Symbol(cc)),{addToJSMap:D1}),stringify:()=>cc},yC=(t,i)=>(oi.identify(i)||Ie(i)&&(!i.type||i.type===_e.PLAIN)&&oi.identify(i.value))&&t?.doc.schema.tags.some(s=>s.tag===oi.tag&&s.default);function D1(t,i,s){const a=j1(t,s);if(Ql(a))for(const r of a.items)Wd(t,i,r);else if(Array.isArray(a))for(const r of a)Wd(t,i,r);else Wd(t,i,a)}function Wd(t,i,s){const a=j1(t,s);if(!Il(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 j1(t,i){return t&&Ms(i)?i.resolve(t.doc,t):i}function L1(t,i,{key:s,value:a}){if(nt(s)&&s.addToJSMap)s.addToJSMap(t,i,a);else if(yC(t,s))D1(t,i,a);else{const r=fn(s,"",t);if(i instanceof Map)i.set(r,fn(a,r,t));else if(i instanceof Set)i.add(r);else{const c=vC(s,r,t),u=fn(a,c,t);c in i?Object.defineProperty(i,c,{value:u,writable:!0,enumerable:!0,configurable:!0}):i[c]=u}}return i}function vC(t,i,s){if(i===null)return"";if(typeof i!="object")return String(i);if(nt(t)&&s?.doc){const a=O1(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)+'..."'),z1(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 Fh(t,i,s){const a=bo(t,void 0,s),r=bo(i,void 0,s);return new _t(a,r)}class _t{constructor(i,s=null){Object.defineProperty(this,dn,{value:v1}),this.key=i,this.value=s}clone(i){let{key:s,value:a}=this;return nt(s)&&(s=s.clone(i)),nt(a)&&(a=a.clone(i)),new _t(s,a)}toJSON(i,s){const a=s?.mapAsMap?new Map:{};return L1(s,a,this)}toString(i,s,a){return i?.doc?pC(this,i,s,a):JSON.stringify(this)}}function R1(t,i,s){return(i.inFlow??t.flow?SC:bC)(t,i,s)}function bC({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 x=i[E];let A=null;if(nt(x))!p&&x.spaceBefore&&y.push(""),Bc(s,y,x.commentBefore,p),x.comment&&(A=x.comment);else if(Pe(x)){const _=nt(x.key)?x.key:null;_&&(!p&&_.spaceBefore&&y.push(""),Bc(s,y,_.commentBefore,p))}p=!1;let N=Gl(x,v,()=>A=null,()=>p=!0);A&&(N+=ys(N,c,g(A))),p&&A&&(p=!1),y.push(a+N)}let S;if(y.length===0)S=r.start+r.end;else{S=y[0];for(let E=1;E<y.length;++E){const x=y[E];S+=x?`
|
|
59
|
+
${h}${x}`:`
|
|
60
|
+
`}}return t?(S+=`
|
|
61
|
+
`+ai(g(t),h),m&&m()):p&&u&&u(),S}function SC({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 x=t[E];let A=null;if(nt(x))x.spaceBefore&&p.push(""),Bc(i,p,x.commentBefore,!1),x.comment&&(A=x.comment);else if(Pe(x)){const _=nt(x.key)?x.key:null;_&&(_.spaceBefore&&p.push(""),Bc(i,p,_.commentBefore,!1),_.comment&&(g=!0));const w=nt(x.value)?x.value:null;w?(w.comment&&(A=w.comment),w.commentBefore&&(g=!0)):x.value==null&&_?.comment&&(A=_.comment)}A&&(g=!0);let N=Gl(x,h,()=>A=null);g||(g=p.length>v||N.includes(`
|
|
62
|
+
`)),E<t.length-1?N+=",":i.options.trailingComma&&(i.options.lineWidth>0&&(g||(g=p.reduce((_,w)=>_+w.length+2,2)+(N.length+2)>i.options.lineWidth)),g&&(N+=",")),A&&(N+=ys(N,a,m(A))),p.push(N),v=p.length}const{start:y,end:S}=s;if(p.length===0)return y+S;if(!g){const E=p.reduce((x,A)=>x+A.length+2,2);g=i.options.lineWidth>0&&E>i.options.lineWidth}if(g){let E=y;for(const x of p)E+=x?`
|
|
63
|
+
${c}${r}${x}`:`
|
|
64
|
+
`;return`${E}
|
|
65
|
+
${r}${S}`}else return`${y}${u}${p.join(" ")}${u}${S}`}function Bc({indent:t,options:{commentString:i}},s,a,r){if(a&&r&&(a=a.replace(/^\n+/,"")),a){const c=ai(i(a),t);s.push(c.trimStart())}}function vs(t,i){const s=Ie(i)?i.value:i;for(const a of t)if(Pe(a)&&(a.key===i||a.key===s||Ie(a.key)&&a.key.value===s))return a}class Ft extends M1{static get tagName(){return"tag:yaml.org,2002:map"}constructor(i){super(Ki,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(Fh(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;Pe(i)?a=i:!i||typeof i!="object"||!("key"in i)?a=new _t(i,i?.value):a=new _t(i.key,i.value);const r=vs(this.items,a.key),c=this.schema?.sortMapEntries;if(r){if(!s)throw new Error(`Key ${a.key} already set`);Ie(r.value)&&T1(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=vs(this.items,i);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(i,s){const r=vs(this.items,i)?.value;return(!s&&Ie(r)?r.value:r)??void 0}has(i){return!!vs(this.items,i)}set(i,s){this.add(new _t(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)L1(s,r,c);return r}toString(i,s,a){if(!i)return JSON.stringify(this);for(const r of this.items)if(!Pe(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})),R1(this,i,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:i.indent||"",onChompKeep:a,onComment:s})}}const Fl={collection:"map",default:!0,nodeClass:Ft,tag:"tag:yaml.org,2002:map",resolve(t,i){return Il(t)||i("Expected a mapping for this tag"),t},createNode:(t,i,s)=>Ft.from(t,i,s)};class Zi extends M1{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&&Ie(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];Ie(r)&&T1(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(fn(c,String(r++),s));return a}toString(i,s,a){return i?R1(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=Ie(t)?t.value:t;return i&&typeof i=="string"&&(i=Number(i)),typeof i=="number"&&Number.isInteger(i)&&i>=0?i:null}const Jl={collection:"seq",default:!0,nodeClass:Zi,tag:"tag:yaml.org,2002:seq",resolve(t,i){return Ql(t)||i("Expected a sequence for this tag"),t},createNode:(t,i,s)=>Zi.from(t,i,s)},lu={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)}},au={identify:t=>t==null,createNode:()=>new _e(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new _e(null),stringify:({source:t},i)=>typeof t=="string"&&au.test.test(t)?t:i.options.nullStr},Jh={identify:t=>typeof t=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:t=>new _e(t[0]==="t"||t[0]==="T"),stringify({source:t,value:i},s){if(t&&Jh.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 _n({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 k1={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:_n},B1={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():_n(t)}},H1={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 _e(parseFloat(t)),s=t.indexOf(".");return s!==-1&&t[t.length-1]==="0"&&(i.minFractionDigits=t.length-s-1),i},stringify:_n},ou=t=>typeof t=="bigint"||Number.isInteger(t),Wh=(t,i,s,{intAsBigInt:a})=>a?BigInt(t):parseInt(t.substring(i),s);function $1(t,i,s){const{value:a}=t;return ou(a)&&a>=0?s+a.toString(i):_n(t)}const U1={identify:t=>ou(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=>$1(t,8,"0o")},q1={identify:ou,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(t,i,s)=>Wh(t,0,10,s),stringify:_n},V1={identify:t=>ou(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=>$1(t,16,"0x")},wC=[Fl,Jl,lu,au,Jh,U1,q1,V1,k1,B1,H1];function dv(t){return typeof t=="bigint"||Number.isInteger(t)}const fc=({value:t})=>JSON.stringify(t),xC=[{identify:t=>typeof t=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:t=>t,stringify:fc},{identify:t=>t==null,createNode:()=>new _e(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:dv,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})=>dv(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}],EC={default:!0,tag:"",test:/^/,resolve(t,i){return i(`Unresolved plain scalar ${JSON.stringify(t)}`),t}},NC=[Fl,Jl].concat(xC,EC),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=_e.BLOCK_LITERAL),i!==_e.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===_e.BLOCK_LITERAL?`
|
|
66
|
+
`:" ")}return Co({comment:t,type:i,value:m},a,r,c)}};function Y1(t,i){if(Ql(t))for(let s=0;s<t.items.length;++s){let a=t.items[s];if(!Pe(a)){if(Il(a)){a.items.length>1&&i("Each pair must have its own sequence indicator");const r=a.items[0]||new _t(new _e(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]=Pe(a)?a:new _t(a)}}else i("Expected a sequence for this tag");return t}function G1(t,i,s){const{replacer:a}=s,r=new Zi(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(Fh(m,h,s))}return r}const em={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Y1,createNode:G1};class Ll extends Zi{constructor(){super(),this.add=Ft.prototype.add.bind(this),this.delete=Ft.prototype.delete.bind(this),this.get=Ft.prototype.get.bind(this),this.has=Ft.prototype.has.bind(this),this.set=Ft.prototype.set.bind(this),this.tag=Ll.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(Pe(r)?(c=fn(r.key,"",s),u=fn(r.value,c,s)):c=fn(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=G1(i,s,a),c=new this;return c.items=r.items,c}}Ll.tag="tag:yaml.org,2002:omap";const tm={collection:"seq",identify:t=>t instanceof Map,nodeClass:Ll,default:!1,tag:"tag:yaml.org,2002:omap",resolve(t,i){const s=Y1(t,i),a=[];for(const{key:r}of s.items)Ie(r)&&(a.includes(r.value)?i(`Ordered maps must not include duplicate keys: ${r.value}`):a.push(r.value));return Object.assign(new Ll,s)},createNode:(t,i,s)=>Ll.from(t,i,s)};function X1({value:t,source:i},s){return i&&(t?K1:Z1).test.test(i)?i:t?s.options.trueStr:s.options.falseStr}const K1={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 _e(!0),stringify:X1},Z1={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 _e(!1),stringify:X1},_C={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:_n},AC={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():_n(t)}},TC={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 _e(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:_n},Oo=t=>typeof t=="bigint"||Number.isInteger(t);function ru(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 _n(t)}const MC={identify:Oo,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(t,i,s)=>ru(t,2,2,s),stringify:t=>nm(t,2,"0b")},CC={identify:Oo,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(t,i,s)=>ru(t,1,8,s),stringify:t=>nm(t,8,"0")},OC={identify:Oo,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(t,i,s)=>ru(t,0,10,s),stringify:_n},zC={identify:Oo,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(t,i,s)=>ru(t,2,16,s),stringify:t=>nm(t,16,"0x")};class Rl extends Ft{constructor(i){super(i),this.tag=Rl.tag}add(i){let s;Pe(i)?s=i:i&&typeof i=="object"&&"key"in i&&"value"in i&&i.value===null?s=new _t(i.key,null):s=new _t(i,null),vs(this.items,s.key)||this.items.push(s)}get(i,s){const a=vs(this.items,i);return!s&&Pe(a)?Ie(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=vs(this.items,i);a&&!s?this.items.splice(this.items.indexOf(a),1):!a&&s&&this.items.push(new _t(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(Fh(u,null,a));return c}}Rl.tag="tag:yaml.org,2002:set";const im={collection:"map",identify:t=>t instanceof Set,nodeClass:Rl,default:!1,tag:"tag:yaml.org,2002:set",createNode:(t,i,s)=>Rl.from(t,i,s),resolve(t,i){if(Il(t)){if(t.hasAllNullValues(!0))return Object.assign(new Rl,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 I1(t){let{value:i}=t,s=u=>u;if(typeof i=="bigint")s=u=>BigInt(u);else if(isNaN(i)||!isFinite(i))return _n(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 Q1={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:I1},F1={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:I1},cu={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(cu.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$/,"")??""},hv=[Fl,Jl,lu,au,K1,Z1,MC,CC,OC,zC,_C,AC,TC,Ph,oi,tm,em,im,Q1,F1,cu],mv=new Map([["core",wC],["failsafe",[Fl,Jl,lu]],["json",NC],["yaml11",hv],["yaml-1.1",hv]]),gv={binary:Ph,bool:Jh,float:H1,floatExp:B1,floatNaN:k1,floatTime:F1,int:q1,intHex:V1,intOct:U1,intTime:Q1,map:Fl,merge:oi,null:au,omap:tm,pairs:em,seq:Jl,set:im,timestamp:cu},DC={"tag:yaml.org,2002:binary":Ph,"tag:yaml.org,2002:merge":oi,"tag:yaml.org,2002:omap":tm,"tag:yaml.org,2002:pairs":em,"tag:yaml.org,2002:set":im,"tag:yaml.org,2002:timestamp":cu};function Pd(t,i,s){const a=mv.get(i);if(a&&!t)return s&&!a.includes(oi)?a.concat(oi):a.slice();let r=a;if(!r)if(Array.isArray(t))r=[];else{const c=Array.from(mv.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(oi)),r.reduce((c,u)=>{const m=typeof u=="string"?gv[u]:u;if(!m){const h=JSON.stringify(u),g=Object.keys(gv).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 jC=(t,i)=>t.key<i.key?-1:t.key>i.key?1:0;class uu{constructor({compat:i,customTags:s,merge:a,resolveKnownTags:r,schema:c,sortMapEntries:u,toStringDefaults:m}){this.compat=Array.isArray(i)?Pd(i,"compat"):i?Pd(null,i):null,this.name=typeof c=="string"&&c||"core",this.knownTags=r?DC:{},this.tags=Pd(s,this.name,a),this.toStringOptions=m??null,Object.defineProperty(this,Ki,{value:Fl}),Object.defineProperty(this,Rn,{value:lu}),Object.defineProperty(this,Zl,{value:Jl}),this.sortMapEntries=typeof u=="function"?u:u===!0?jC:null}clone(){const i=Object.create(uu.prototype,Object.getOwnPropertyDescriptors(this));return i.tags=this.tags.slice(),i}}function LC(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=O1(t,i),{commentString:c}=r.options;if(t.commentBefore){s.length!==1&&s.unshift("");const h=c(t.commentBefore);s.unshift(ai(h,""))}let u=!1,m=null;if(t.contents){if(nt(t.contents)){if(t.contents.spaceBefore&&a&&s.push(""),t.contents.commentBefore){const v=c(t.contents.commentBefore);s.push(ai(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+=ys(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(ai(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(ai(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,dn,{value:Nh});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 Ot({version:u}),this.setSchema(u,a),this.contents=i===void 0?null:this.createNode(i,r,a)}clone(){const i=Object.create(Wl.prototype,{[dn]:{value:Nh}});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=nt(this.contents)?this.contents.clone(i.schema):this.contents,this.range&&(i.range=this.range.slice()),i}add(i){Sl(this.contents)&&this.contents.add(i)}addIn(i,s){Sl(this.contents)&&this.contents.addIn(i,s)}createAlias(i,s){if(!i.anchor){const a=_1(this);i.anchor=!s||a.has(s)?A1(s||"a",a):s}return new tu(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 A=_=>typeof _=="number"||_ instanceof String||_ instanceof Number,N=s.filter(A).map(String);N.length>0&&(s=s.concat(N)),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}=rC(this,u||"a"),E={aliasDuplicateObjects:c??!0,keepUndefined:h??!1,onAnchor:p,onTagObj:g,replacer:r,schema:this.schema,sourceObjects:S},x=bo(i,v,E);return m&&tt(x)&&(x.flow=!0),y(),x}createPair(i,s,a={}){const r=this.createNode(i,null,a),c=this.createNode(s,null,a);return new _t(r,c)}delete(i){return Sl(this.contents)?this.contents.delete(i):!1}deleteIn(i){return io(i)?this.contents==null?!1:(this.contents=null,!0):Sl(this.contents)?this.contents.deleteIn(i):!1}get(i,s){return tt(this.contents)?this.contents.get(i,s):void 0}getIn(i,s){return io(i)?!s&&Ie(this.contents)?this.contents.value:this.contents:tt(this.contents)?this.contents.getIn(i,s):void 0}has(i){return tt(this.contents)?this.contents.has(i):!1}hasIn(i){return io(i)?this.contents!==void 0:tt(this.contents)?this.contents.hasIn(i):!1}set(i,s){this.contents==null?this.contents=kc(this.schema,[i],s):Sl(this.contents)&&this.contents.set(i,s)}setIn(i,s){io(i)?this.contents=s:this.contents==null?this.contents=kc(this.schema,Array.from(i),s):Sl(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 Ot({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 Ot({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 uu(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=fn(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"?Ml(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 LC(this,i)}}function Sl(t){if(tt(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 bs extends lm{constructor(i,s,a){super("YAMLParseError",i,s,a)}}class J1 extends lm{constructor(i,s,a){super("YAMLWarning",i,s,a)}}const Hc=(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,x=null,A=null,N=null,_=null,w=null,O=null,j=null;for(const k of t)switch(E&&(k.type!=="space"&&k.type!=="newline"&&k.type!=="comma"&&c(k.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),E=!1),x&&(g&&k.type!=="comment"&&k.type!=="newline"&&c(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),x=null),k.type){case"space":!i&&(s!=="doc-start"||a?.type!=="flow-collection")&&k.source.includes(" ")&&(x=k),v=!0;break;case"comment":{v||c(k,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const q=k.source.substring(1)||" ";p?p+=y+q:p=q,y="",g=!1;break}case"newline":g?p?p+=k.source:(!O||s!=="seq-item-ind")&&(h=!0):y+=k.source,g=!0,S=!0,(A||N)&&(_=k),v=!0;break;case"anchor":A&&c(k,"MULTIPLE_ANCHORS","A node can have at most one anchor"),k.source.endsWith(":")&&c(k.offset+k.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),A=k,j??(j=k.offset),g=!1,v=!1,E=!0;break;case"tag":{N&&c(k,"MULTIPLE_TAGS","A node can have at most one tag"),N=k,j??(j=k.offset),g=!1,v=!1,E=!0;break}case s:(A||N)&&c(k,"BAD_PROP_ORDER",`Anchors and tags must be after the ${k.source} indicator`),O&&c(k,"UNEXPECTED_TOKEN",`Unexpected ${k.source} in ${i??"collection"}`),O=k,g=s==="seq-item-ind"||s==="explicit-key-ind",v=!1;break;case"comma":if(i){w&&c(k,"UNEXPECTED_TOKEN",`Unexpected , in ${i}`),w=k,g=!1,v=!1;break}default:c(k,"UNEXPECTED_TOKEN",`Unexpected ${k.type} token`),g=!1,v=!1}const D=t[t.length-1],R=D?D.offset+D.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"),x&&(g&&x.indent<=u||a?.type==="block-map"||a?.type==="block-seq")&&c(x,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:w,found:O,spaceBefore:h,comment:p,hasNewline:S,anchor:A,tag:N,newlineAfterProp:_,end:R,start:j??R}}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 Mh(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 W1(t,i,s){const{uniqueKeys:a}=t.options;if(a===!1)return!1;const r=typeof a=="function"?a:(c,u)=>c===u||Ie(c)&&Ie(u)&&c.value===u.value;return i.some(c=>r(c.key,s))}const pv="All mapping items must start at the same column";function RC({composeNode:t,composeEmptyNode:i},s,a,r,c){const u=c?.nodeClass??Ft,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,x=Xl(p,{indicator:"explicit-key-ind",next:y??S?.[0],offset:h,onError:r,parentIndent:a.indent,startOnNewline:!0}),A=!x.found;if(A){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",pv)),!x.anchor&&!x.tag&&!S){g=x.end,x.comment&&(m.comment?m.comment+=`
|
|
78
|
+
`+x.comment:m.comment=x.comment);continue}(x.newlineAfterProp||So(y))&&r(y??p[p.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else x.found?.indent!==a.indent&&r(h,"BAD_INDENT",pv);s.atKey=!0;const N=x.end,_=y?t(s,y,x,r):i(s,N,p,null,x,r);s.schema.compat&&Mh(a.indent,y,r),s.atKey=!1,W1(s,m.items,_)&&r(N,"DUPLICATE_KEY","Map keys must be unique");const w=Xl(S??[],{indicator:"map-value-ind",next:E,offset:_.range[2],onError:r,parentIndent:a.indent,startOnNewline:!y||y.type==="block-scalar"});if(h=w.end,w.found){A&&(E?.type==="block-map"&&!w.hasNewline&&r(h,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&x.start<w.found.offset-1024&&r(_.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const O=E?t(s,E,w,r):i(s,h,S,null,w,r);s.schema.compat&&Mh(a.indent,E,r),h=O.range[2];const j=new _t(_,O);s.options.keepSourceTokens&&(j.srcToken=v),m.items.push(j)}else{A&&r(_.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),w.comment&&(_.comment?_.comment+=`
|
|
79
|
+
`+w.comment:_.comment=w.comment);const O=new _t(_);s.options.keepSourceTokens&&(O.srcToken=v),m.items.push(O)}}return g&&g<h&&r(g,"IMPOSSIBLE","Map comment with trailing content"),m.range=[a.offset,h,g??h],m}function kC({composeNode:t,composeEmptyNode:i},s,a,r,c){const u=c?.nodeClass??Zi,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&&Mh(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 eh="Block collections are not allowed within flow collections",th=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?Ft:Zi),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 A=0;A<a.items.length;++A){const N=a.items[A],{start:_,key:w,sep:O,value:j}=N,D=Xl(_,{flow:m,indicator:"explicit-key-ind",next:w??O?.[0],offset:p,onError:r,parentIndent:a.indent,startOnNewline:!1});if(!D.found){if(!D.anchor&&!D.tag&&!O&&!j){A===0&&D.comma?r(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`):A<a.items.length-1&&r(D.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${m}`),D.comment&&(g.comment?g.comment+=`
|
|
80
|
+
`+D.comment:g.comment=D.comment),p=D.end;continue}!u&&s.options.strict&&So(w)&&r(w,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(A===0)D.comma&&r(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${m}`);else if(D.comma||r(D.start,"MISSING_CHAR",`Missing , between ${m} items`),D.comment){let R="";e:for(const k of _)switch(k.type){case"comma":case"space":break;case"comment":R=k.source.substring(1);break e;default:break e}if(R){let k=g.items[g.items.length-1];Pe(k)&&(k=k.value??k.key),k.comment?k.comment+=`
|
|
81
|
+
`+R:k.comment=R,D.comment=D.comment.substring(R.length+1)}}if(!u&&!O&&!D.found){const R=j?t(s,j,D,r):i(s,D.end,O,null,D,r);g.items.push(R),p=R.range[2],th(j)&&r(R.range,"BLOCK_IN_FLOW",eh)}else{s.atKey=!0;const R=D.end,k=w?t(s,w,D,r):i(s,R,_,null,D,r);th(w)&&r(k.range,"BLOCK_IN_FLOW",eh),s.atKey=!1;const q=Xl(O??[],{flow:m,indicator:"map-value-ind",next:j,offset:k.range[2],onError:r,parentIndent:a.indent,startOnNewline:!1});if(q.found){if(!u&&!D.found&&s.options.strict){if(O)for(const Q of O){if(Q===q.found)break;if(Q.type==="newline"){r(Q,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}D.start<q.found.offset-1024&&r(q.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else j&&("source"in j&&j.source?.[0]===":"?r(j,"MISSING_CHAR",`Missing space after : in ${m}`):r(q.start,"MISSING_CHAR",`Missing , or : between ${m} items`));const ee=j?t(s,j,q,r):q.found?i(s,q.end,O,null,q,r):null;ee?th(j)&&r(ee.range,"BLOCK_IN_FLOW",eh):q.comment&&(k.comment?k.comment+=`
|
|
82
|
+
`+q.comment:k.comment=q.comment);const V=new _t(k,ee);if(s.options.keepSourceTokens&&(V.srcToken=N),u){const Q=g;W1(s,Q.items,k)&&r(R,"DUPLICATE_KEY","Map keys must be unique"),Q.items.push(V)}else{const Q=new Ft(s.schema);Q.flow=!0,Q.items.push(V);const ae=(ee??k).range;Q.range=[k.range[0],ae[1],ae[2]],g.items.push(Q)}p=ee?ee.range[2]:q.end}}const y=u?"}":"]",[S,...E]=a.end;let x=p;if(S?.source===y)x=S.offset+S.source.length;else{const A=m[0].toUpperCase()+m.substring(1),N=v?`${A} must end with a ${y}`:`${A} in block collection must be sufficiently indented and end with a ${y}`;r(p,v?"MISSING_CHAR":"BAD_INDENT",N),S&&S.source.length!==1&&E.unshift(S)}if(E.length>0){const A=zo(E,x,s.options.strict,r);A.comment&&(g.comment?g.comment+=`
|
|
83
|
+
`+A.comment:g.comment=A.comment),g.range=[a.offset,x,A.offset]}else g.range=[a.offset,x,x];return g}function nh(t,i,s,a,r,c){const u=s.type==="block-map"?RC(t,i,s,a,c):s.type==="block-seq"?kC(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 HC(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===Ft.tagName&&m==="map"||u===Zi.tagName&&m==="seq")return nh(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),nh(t,i,s,r,u)}const g=nh(t,i,s,r,u,h),v=h.resolve?.(g,y=>r(c,"TAG_RESOLVE_FAILED",y),i.options)??g,p=nt(v)?v:new _e(v);return p.range=g.range,p.tag=u,h?.format&&(p.format=h.format),p}function P1(t,i,s){const a=i.offset,r=$C(i,t.options.strict,s);if(!r)return{value:"",type:null,comment:"",range:[a,a,a]};const c=r.mode===">"?_e.BLOCK_FOLDED:_e.BLOCK_LITERAL,u=i.source?UC(i.source):[];let m=u.length;for(let x=u.length-1;x>=0;--x){const A=u[x][1];if(A===""||A==="\r")m=x;else break}if(m===0){const x=r.chomp==="+"&&u.length>0?`
|
|
84
|
+
`.repeat(Math.max(1,u.length-1)):"";let A=a+r.length;return i.source&&(A+=i.source.length),{value:x,type:c,comment:r.comment,range:[a,A,A]}}let h=i.indent+r.indent,g=i.offset+r.length,v=0;for(let x=0;x<m;++x){const[A,N]=u[x];if(N===""||N==="\r")r.indent===0&&A.length>h&&(h=A.length);else{A.length<h&&s(g+A.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(h=A.length),v=x,h===0&&!t.atRoot&&s(g,"BAD_INDENT","Block scalar values in collections must be indented");break}g+=A.length+N.length+1}for(let x=u.length-1;x>=m;--x)u[x][0].length>h&&(m=x+1);let p="",y="",S=!1;for(let x=0;x<v;++x)p+=u[x][0].slice(h)+`
|
|
85
|
+
`;for(let x=v;x<m;++x){let[A,N]=u[x];g+=A.length+N.length+1;const _=N[N.length-1]==="\r";if(_&&(N=N.slice(0,-1)),N&&A.length<h){const O=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;s(g-N.length-(_?2:1),"BAD_INDENT",O),A=""}c===_e.BLOCK_LITERAL?(p+=y+A.slice(h)+N,y=`
|
|
86
|
+
`):A.length>h||N[0]===" "?(y===" "?y=`
|
|
87
|
+
`:!S&&y===`
|
|
88
|
+
`&&(y=`
|
|
89
|
+
|
|
90
|
+
`),p+=y+A.slice(h)+N,y=`
|
|
91
|
+
`,S=!0):N===""?y===`
|
|
92
|
+
`?p+=`
|
|
93
|
+
`:y=`
|
|
94
|
+
`:(p+=y+N,y=" ",S=!1)}switch(r.chomp){case"-":break;case"+":for(let x=m;x<u.length;++x)p+=`
|
|
95
|
+
`+u[x][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 $C({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 x=S.source;x&&typeof x=="string"&&(p+=x.length)}}}return{mode:c,indent:u,chomp:m,comment:v,length:p}}function UC(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 eS(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=_e.PLAIN,h=qC(c,g);break;case"single-quoted-scalar":m=_e.QUOTE_SINGLE,h=VC(c,g);break;case"double-quoted-scalar":m=_e.QUOTE_DOUBLE,h=YC(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 qC(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}`),tS(t)}function VC(t,i){return(t[t.length-1]!=="'"||t.length===1)&&i(t.length,"MISSING_CHAR","Missing closing 'quote"),tS(t.slice(1,-1)).replace(/''/g,"'")}function tS(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 YC(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}=GC(t,a);s+=c,a=u}else if(r==="\\"){let c=t[++a];const u=XC[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+=KC(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 GC(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 XC={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
113
|
+
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function KC(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 nS(t,i,s,a){const{value:r,type:c,comment:u,range:m}=i.type==="block-scalar"?P1(t,i,a):eS(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[Rn]:h?g=ZC(t.schema,r,h,s,a):i.type==="scalar"?g=IC(t,r,i,a):g=t.schema[Rn];let v;try{const p=g.resolve(r,y=>a(s??i,"TAG_RESOLVE_FAILED",y),t.options);v=Ie(p)?p:new _e(p)}catch(p){const y=p instanceof Error?p.message:String(p);a(s??i,"TAG_RESOLVE_FAILED",y),v=new _e(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 ZC(t,i,s,a,r){if(s==="!")return t[Rn];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[Rn])}function IC({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[Rn];if(s.compat){const m=s.compat.find(h=>h.default&&h.test?.test(a))??s[Rn];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 QC(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 FC={composeNode:iS,composeEmptyNode:am};function iS(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=JC(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=nS(t,i,h,a),m&&(g.anchor=m.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{g=HC(FC,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&&(!Ie(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:QC(i,s,a),indent:-1,source:""},p=nS(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 JC({options:t},{offset:i,source:s,end:a},r){const c=new tu(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 WC(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?iS(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 yv(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 J1(u,a,r)):this.errors.push(new bs(u,a,r))},this.directives=new Ot({version:i.version||"1.2"}),this.options=i}decorate(i,s){const{comment:a,afterEmptyLine:r}=yv(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(tt(c)&&!c.flow&&c.items.length>0){let u=c.items[0];Pe(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:yv(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=WC(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 bs(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 bs(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 bs(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 PC(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 bs([m,m+1],c,u)};switch(t.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return eS(t,i,a);case"block-scalar":return P1({options:{strict:i}},t,a)}}return null}function eO(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 sS(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 tO(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">":nO(t,h);break;case'"':ih(t,h,"double-quoted-scalar");break;case"'":ih(t,h,"single-quoted-scalar");break;default:ih(t,h,"scalar")}}function nO(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}];sS(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 sS(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 ih(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 iO=t=>"type"in t?$c(t):_c(t);function $c(t){switch(t.type){case"block-scalar":{let i="";for(const s of t.props)i+=$c(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+=$c(i)),s)for(const c of s)r+=c.source;return a&&(r+=$c(a)),r}const Ch=Symbol("break visit"),sO=Symbol("skip children"),lS=Symbol("remove item");function Ts(t,i){"type"in t&&t.type==="document"&&(t={start:t.start,value:t.value}),aS(Object.freeze([]),t,i)}Ts.BREAK=Ch;Ts.SKIP=sO;Ts.REMOVE=lS;Ts.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};Ts.parentCollection=(t,i)=>{const s=Ts.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 aS(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=aS(Object.freeze(t.concat([[r,u]])),c.items[u],s);if(typeof m=="number")u=m-1;else{if(m===Ch)return Ch;m===lS&&(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 fu="\uFEFF",du="",hu="",wo="",lO=t=>!!t&&"items"in t,aO=t=>!!t&&(t.type==="scalar"||t.type==="single-quoted-scalar"||t.type==="double-quoted-scalar"||t.type==="block-scalar");function oO(t){switch(t){case fu:return"<BOM>";case du:return"<DOC>";case hu:return"<FLOW_END>";case wo:return"<SCALAR>";default:return JSON.stringify(t)}}function oS(t){switch(t){case fu:return"byte-order-mark";case du:return"doc-mode";case hu: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 rO=Object.freeze(Object.defineProperty({__proto__:null,BOM:fu,DOCUMENT:du,FLOW_END:hu,SCALAR:wo,createScalarToken:eO,isCollection:lO,isScalar:aO,prettyToken:oO,resolveAsScalar:PC,setScalarValue:tO,stringify:iO,tokenType:oS,visit:Ts},Symbol.toStringTag,{value:"Module"}));function yn(t){switch(t){case void 0:case" ":case`
|
|
131
|
+
`:case"\r":case" ":return!0;default:return!1}}const vv=new Set("0123456789ABCDEFabcdef"),cO=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),dc=new Set(",[]{}"),uO=new Set(` ,[]{}
|
|
132
|
+
\r `),sh=t=>!t||uO.has(t);class rS{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==="...")&&yn(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]===fu&&(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 du,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==="...")&&yn(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&&!yn(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===":")&&yn(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(sh),"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("..."))&&yn(r[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield hu,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(sh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const u=this.charAt(1);if(this.flowKey||yn(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=>yn(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(yn(c)||i&&dc.has(c))break;s=a}else if(yn(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(sh),i+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const s=this.flowLevel>0,a=this.charAt(1);if(yn(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(;!yn(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(cO.has(s))s=this.buffer[++i];else if(s==="%"&&vv.has(this.buffer[i+1])&&vv.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 cS{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 Yi(t,i){for(let s=0;s<t.length;++s)if(t[s].type===i)return!0;return!1}function bv(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 uS(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 wl(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 Uc(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 Sv(t){if(t.start.type==="flow-seq-start")for(const i of t.items)i.sep&&!i.value&&!Yi(i.start,"explicit-key-ind")&&!Yi(i.sep,"map-value-ind")&&(i.key&&(i.value=i.key),delete i.key,uS(i.value)?i.value.end?Uc(i.value.end,i.sep):i.value.end=i.sep:Uc(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 rS,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=oS(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"&&Sv(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&&bv(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":{bv(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=wl(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)){Uc(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(Yi(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(uS(s.key)&&!Yi(s.sep,"newline")){const u=wl(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(Yi(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const u=wl(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]}):Yi(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&&!Yi(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)){Uc(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||Yi(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=wl(r);Sv(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=wl(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=wl(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 fS(t){const i=t.prettyErrors!==!1;return{lineCounter:t.lineCounter||i&&new cS||null,prettyErrors:i}}function fO(t,i={}){const{lineCounter:s,prettyErrors:a}=fS(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(Hc(t,s)),m.warnings.forEach(Hc(t,s));return u.length>0?u:Object.assign([],{empty:!0},c.streamInfo())}function dS(t,i={}){const{lineCounter:s,prettyErrors:a}=fS(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 bs(m.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return a&&s&&(u.errors.forEach(Hc(t,s)),u.warnings.forEach(Hc(t,s))),u}function dO(t,i,s){let a;typeof i=="function"?a=i:s===void 0&&i&&typeof i=="object"&&(s=i);const r=dS(t,s);if(!r)return null;if(r.warnings.forEach(c=>z1(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 hO(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 Cs(t)&&!a?t.toString(s):new Wl(t,a,s).toString(s)}const mu=Object.freeze(Object.defineProperty({__proto__:null,Alias:tu,CST:rO,Composer:om,Document:Wl,Lexer:rS,LineCounter:cS,Pair:_t,Parser:rm,Scalar:_e,Schema:uu,YAMLError:lm,YAMLMap:Ft,YAMLParseError:bs,YAMLSeq:Zi,YAMLWarning:J1,isAlias:Ms,isCollection:tt,isDocument:Cs,isMap:Il,isNode:nt,isPair:Pe,isScalar:Ie,isSeq:Ql,parse:dO,parseAllDocuments:fO,parseDocument:dS,stringify:hO,visit:Os,visitAsync:eu},Symbol.toStringTag,{value:"Module"}));function Ii(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 wv(t){return`story_${Ii(t).replaceAll("-","_")}`}function mO(t){return`slc_${Ii(t).replaceAll("-","_")}`}function gO(t){return`scr_${Ii(t).replaceAll("-","_")}`}function pO(t){return`cmd_${Ii(t).replaceAll("-","_")}`}function yO(t){return`qry_${Ii(t).replaceAll("-","_")}`}function lh(t){return`evt_${Ii(t).replaceAll("-","_")}`}function vO(t,i,s){const a=s?Ii(s):`case-${i+1}`;return`gwt_${Ii(t).replaceAll("-","_")}_${a.replaceAll("-","_")}`}function xl(t,i,s){return`${t}:${i}->${s}`}function oo(t){return t.replaceAll("\\","/").replace(/^\/+/,"")}function hS(t,i=""){const s=oo(t).split("/").at(-1)??t;return i&&s.endsWith(i)?s.slice(0,-i.length):s}function kl(t){return Array.isArray(t)?t.filter(i=>typeof i=="string"):[]}function bO(t,i){const s=mu.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 SO(t,i){const s=mu.parse(i);return{name:typeof s?.name=="string"?s.name:hS(t,".yaml"),description:typeof s?.description=="string"?s.description:"",path:t,slices:kl(s?.slices).map(oo)}}function wO(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:kl(i.produces)})):[]}function xO(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:kl(i.from_events)})):[]}function EO(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 NO(t){return{type:t?.type==="system"?"system":"user",name:typeof t?.name=="string"?t.name:void 0,actors:kl(t?.actors),reads:kl(t?.reads),executes:kl(t?.executes)}}function _O(t,i,s){const a=mu.parse(i);return{title:typeof a?.slice=="string"?a.slice:hS(t),path:t,storyName:s.get(t),screen:NO(a?.screen),commands:wO(a?.commands),queries:xO(a?.queries),gwt:EO(a?.gwt),raw:i}}function AO(t){const i=[],s=[],a=new Map,r=new Map;for(const c of t.stories){const u=wv(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=lh(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=mO(c.path),m=gO(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)??wv(c.storyName);s.push({id:xl("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:xl("slice-screen",u,m),kind:"slice-screen",source:u,target:m});for(const g of c.queries){const v=yO(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:xl("query-screen",v,m),kind:"query-screen",source:v,target:m});for(const p of g.fromEvents){const y=a.get(p)??lh(p);s.push({id:xl("event-query",y,v),kind:"event-query",source:y,target:v,label:p})}}for(const g of c.commands){const v=pO(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:xl("screen-command",m,v),kind:"screen-command",source:m,target:v});for(const p of g.produces){const y=a.get(p)??lh(p);s.push({id:xl("command-event",v,y),kind:"command-event",source:v,target:y,label:p})}}c.gwt.forEach((g,v)=>{i.push({id:vO(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 TO(t,i={}){const s=new Map(t.map(O=>[oo(O.path),O.content])),a=s.get(".event-modeling/config.yaml"),r=a?mu.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=bO(h,v),y=[...s.entries()].filter(([O])=>O.startsWith(`${g}/`)&&O.endsWith(".yaml")).sort(([O],[j])=>O.localeCompare(j)).map(([O,j])=>SO(O,j)),S=new Map;for(const O of y)for(const j of O.slices)S.set(oo(j),O.name);const E=y.flatMap(O=>O.slices.map(oo)),x=[...s.keys()].filter(O=>O.startsWith(`${u}/`)&&O.endsWith(m)),N=[...new Set([...E,...x])].sort().filter(O=>s.has(O)).map(O=>_O(O,s.get(O)??"",S)),_={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:N},w=AO(_);return{..._,...w}}function qe(t,i,s,a,r){return{id:`${i}:${a??"project"}:${s}`,severity:t,check:i,message:s,path:a,nodeId:r}}function El(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]}const MO=new Set(["sent","built","made","paid","booked","cancelled","canceled","submitted","recorded","created","updated","deleted","placed","notified"]);function CO(t){return t.match(/[A-Z]+(?=[A-Z][a-z]|$)|[A-Z]?[a-z]+|\d+/g)??[t]}function OO(t){const i=t.toLowerCase();return MO.has(i)||/(ed|en|d)$/i.test(t)}function zO(t){return CO(t).some(OO)}function xv(t){return/(Requested|Triggered|Scheduled|Enqueued|Dispatched|Required)$/.test(t)}function DO(t){return["Selected","Shown","Viewed","Clicked","Opened","Closed","Ticked","Incremented","Reached","Displayed","Navigated"].find(i=>t.includes(i))}function jO(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 LO(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(qe("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(qe("error","S2",`Story "${h.name}" lists missing slice "${g}".`,h.path))}for(const h of t.events){h.fields?.trim()||i.push(qe("error","C4",`Event "${h.name}" has no fields block.`,h.sourcePath)),!zO(h.name)&&!xv(h.name)&&i.push(qe("warning","C3",`Event "${h.name}" does not obviously read as a past-tense domain event.`,h.sourcePath));const g=DO(h.name);g&&i.push(qe("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 El(g))i.push(qe("error","L9",`Command "${p}" is duplicated within slice "${h.title}".`,h.path));for(const p of El(v))i.push(qe("error","L9",`Query "${p}" is duplicated within slice "${h.title}".`,h.path));for(const p of El(h.screen.reads))i.push(qe("error","L9",`screen.reads lists "${p}" more than once.`,h.path));for(const p of El(h.screen.executes))i.push(qe("error","L9",`screen.executes lists "${p}" more than once.`,h.path));for(const p of h.screen.reads)v.includes(p)||i.push(qe("error","W2",`screen.reads references missing local query "${p}".`,h.path));for(const p of h.screen.executes)g.includes(p)||i.push(qe("error","W1",`screen.executes references missing local command "${p}".`,h.path));h.screen.type==="system"&&h.screen.actors.length>0&&i.push(qe("error","L5",`System slice "${h.title}" must not declare screen.actors.`,h.path)),h.storyName||i.push(qe("warning","M2",`Slice "${h.title}" is not listed by any story.`,h.path)),h.commands.length>0&&h.gwt.length===0&&i.push(qe("warning","M1",`Command slice "${h.title}" has no GWT scenarios.`,h.path));for(const p of h.commands){p.fields?.trim()||i.push(qe("warning","L6",`Command "${p.name}" has no fields block.`,h.path));for(const y of p.produces)s.has(y)||i.push(qe("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(qe("warning","L7",`Query "${p.name}" has no fields block.`,h.path)),p.name.includes("For")||i.push(qe("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(qe("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(qe("error","L8",`GWT scenario "${p.name??"Unnamed"}" has invalid item type "${y.type??""}".`,h.path)),y.name||i.push(qe("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(qe("error","G3",`Event "${h}" is registered but no command produces it.`)),g.length>1&&i.push(qe("warning","G8",`Event "${h}" has multiple producers: ${g.join(", ")}.`)),g.length>0&&v.length===0&&i.push(qe("warning",xv(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(qe("error","G3",`Event "${h}" is read by ${g.join(", ")} but no command produces it.`));for(const h of El(t.slices.flatMap(g=>g.commands.map(v=>v.name))))i.push(qe("warning","M5",`Command name "${h}" is used in multiple slices; command names should be globally unique.`));for(const h of El(t.slices.flatMap(g=>g.queries.map(v=>v.name))))i.push(qe("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(qe("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=jO(t);return m>1&&i.push(qe("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}}const mS=qc.createContext({open:()=>{},list:()=>{}});function gS(){return T.jsxs(T.Fragment,{children:[T.jsx(un,{id:"top-target",type:"target",position:he.Top,style:{left:"46%"}}),T.jsx(un,{id:"top-source",type:"source",position:he.Top,style:{left:"54%"}}),T.jsx(un,{id:"bottom-target",type:"target",position:he.Bottom,style:{left:"46%"}}),T.jsx(un,{id:"bottom-source",type:"source",position:he.Bottom,style:{left:"54%"}}),T.jsx(un,{id:"left-target",type:"target",position:he.Left,style:{top:"46%"}}),T.jsx(un,{id:"left-source",type:"source",position:he.Left,style:{top:"54%"}}),T.jsx(un,{id:"right-target",type:"target",position:he.Right,style:{top:"46%"}}),T.jsx(un,{id:"right-source",type:"source",position:he.Right,style:{top:"54%"}})]})}function ah({title:t,items:i}){const s=i&&i.length>0?i:[{type:"empty",name:"empty"}];return T.jsxs("div",{className:"gwt-step",children:[T.jsx("div",{className:"gwt-step-title",children:t}),T.jsx("div",{className:"gwt-step-items",children:s.map((a,r)=>T.jsxs("div",{className:`gwt-step-item gwt-step-item-${a.type??"empty"}`,children:[T.jsx("span",{children:a.type??"empty"}),T.jsxs("div",{className:"gwt-item-content",children:[T.jsx("strong",{children:a.name??"empty"}),a.fields?T.jsx("pre",{children:a.fields}):null]})]},`${r}-${a.type??"empty"}-${a.name??""}`))})]})}function RO({nodeData:t}){const i=qc.useContext(mS),s=t.scenarios??[];return T.jsxs("div",{className:`em-node em-node-gwt ${t.selected?"selected":""} ${t.diffStatus?`diff-node-${t.diffStatus}`:""}`,children:[T.jsx(gS,{}),T.jsxs("div",{className:"node-type",children:["GWT · ",s.length," cases"]}),t.scenarioStatus?T.jsx("div",{className:"gwt-diff-counts",children:["added","removed","changed"].map(a=>`${a}: ${s.filter(r=>t.scenarioStatus?.[r.id]===a).length}`).join(" · ")}):null,T.jsx("div",{className:"gwt-summary nodrag nopan nowheel",children:s.slice(0,3).map(a=>T.jsxs("button",{type:"button","aria-current":t.selectedScenarioId===a.id?"true":void 0,onClick:r=>{r.stopPropagation(),i.open(a.id)},children:[T.jsx("span",{className:"gwt-scenario-name",children:a.label}),t.scenarioStatus?T.jsx("span",{className:"gwt-scenario-status",children:` · ${t.scenarioStatus[a.id]??"unchanged"}`}):null]},a.id))}),T.jsx("div",{className:"gwt-more nodrag nopan nowheel",children:s.length>3?T.jsxs("button",{type:"button",onClick:a=>{a.stopPropagation(),i.list(t.projectNode.id)},children:["+",s.length-3," more"]}):null})]})}function kO({data:t}){const i=t,s=i.projectNode,a=i.diffStatus&&i.diffStatus!=="unchanged"?T.jsx("div",{className:`diff-badge diff-badge-${i.diffStatus}`,children:i.diffStatus}):null;return s.type==="gwt"?T.jsx(RO,{nodeData:i}):T.jsxs("div",{className:`em-node em-node-${s.type} ${i.selected?"selected":""} ${i.connected?"connected":""} ${i.diffStatus?`diff-node-${i.diffStatus}`:""}`,children:[T.jsx(gS,{}),a,T.jsx("div",{className:"node-type",children:s.type}),T.jsx("div",{className:"node-label",children:s.label}),s.actors&&s.actors.length>0?T.jsx("div",{className:"chips",children:s.actors.map(r=>T.jsx("span",{children:r},r))}):null]})}function BO({data:t}){const i=t,s=i.projectNode;return T.jsxs("div",{className:`group-node group-${s.type} ${i.selected?"selected":""} ${i.diffStatus?`diff-node-${i.diffStatus}`:""}`,children:[i.diffStatus&&i.diffStatus!=="unchanged"?T.jsx("div",{className:`diff-badge diff-badge-${i.diffStatus}`,children:i.diffStatus}):null,T.jsx("div",{className:"group-title",children:s.label}),s.description?T.jsx("div",{className:"group-description",children:s.description}):null]})}const HO={eventModelNode:kO,groupNode:BO};function Ev(t){return t===he.Top?{x:0,y:-1}:t===he.Right?{x:1,y:0}:t===he.Bottom?{x:0,y:1}:{x:-1,y:0}}function $O({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 x=r===he.Top?-1:1,A=c===he.Bottom?1:-1,N=Math.max(72,Math.min(150,Math.abs(g)*.65));return`M ${t},${i} C ${t},${i+x*N} ${s},${a+A*N} ${s},${a}`}if(m?.route==="event-read"){const x=Ev(r),A=Ev(c);return`M ${t},${i} C ${t+x.x*y},${i+x.y*y} ${s+A.x*y},${a+A.y*y} ${s},${a}`}if(r===he.Bottom||r===he.Top){const x=r===he.Top?-1:1,A=c===he.Top?-1:1;return`M ${t},${i} C ${t},${i+x*v} ${s},${a+A*v} ${s},${a}`}const S=r===he.Left?-1:1,E=c===he.Left?-1:1;return`M ${t},${i} C ${t+S*p},${i} ${s+E*p},${a} ${s},${a}`}function UO(t){const i=t.data,s=i?.diffStatus==="added"?"#15803d":i?.diffStatus==="removed"?"#b91c1c":i?.diffStatus==="changed"?"#b45309":void 0,a=i?.active?"#111827":s??"#64748b",r=i?.fieldFlow,c=!!(i?.selectedFieldName&&(r?.sharedFieldNames.includes(i.selectedFieldName)||r?.derivedFieldNames.includes(i.selectedFieldName))),u=(t.sourceX+t.targetX)/2,m=(t.sourceY+t.targetY)/2;return T.jsxs(T.Fragment,{children:[T.jsx(Mo,{path:$O(t),markerEnd:t.markerEnd,style:{...t.style,stroke:a,strokeDasharray:i?.diffStatus==="removed"?"7 5":void 0,strokeWidth:i?.diffStatus&&i.diffStatus!=="unchanged"?2.4:void 0},className:i?.active?"edge-path-active":"edge-path"}),r&&r.visibleFieldNames.length>0&&(i?.active||c)?T.jsx(dM,{children:T.jsxs("div",{className:`edge-field-label nodrag nopan ${i?.active?"active":""} ${c?"field-selected":""}`,style:{transform:`translate(-50%, -50%) translate(${u}px, ${m}px)`},children:[r.visibleFieldNames.map(h=>T.jsx("button",{type:"button",onClick:()=>i?.onSelectField?.(h),children:h},h)),r.remainingCount>0?T.jsxs("span",{children:["+",r.remainingCount]}):null]})}):null]})}const qO={eventModelEdge:UO};function mc({label:t,description:i,value:s,copiedKey:a,onCopy:r}){return T.jsx("button",{type:"button",className:"copy-action",onClick:()=>r(a,s),children:T.jsxs("span",{children:[T.jsx("strong",{children:t}),T.jsx("small",{children:i})]})})}function pS(t){return t==="query-screen"||t==="screen-command"||t==="command-event"||t==="event-query"}function VO(t){return JSON.stringify(t).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function YO(t){return(t.graphSidecar?.model?.name??t.graphSidecar?.model?.id??"event-model").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"event-model"}async function Nv(t){const i=await fetch(t);if(!i.ok)throw new Error(`Failed to fetch ${t}: ${i.status}`);return i.text()}async function GO(t,i,s){const a=Array.from(document.querySelectorAll('script[type="module"][src]')).map(g=>new URL(g.src,window.location.href)).filter(g=>!g.pathname.includes("/@vite/")&&!g.pathname.endsWith("/@react-refresh"));if(a.length===0||a.some(g=>g.pathname.includes("/src/")||g.pathname.endsWith(".tsx")))throw new Error("Standalone export requires a built emviz app. Run the packaged CLI or `pnpm --filter @emviz/app build` and open the built app.");const r=Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).map(g=>new URL(g.href,window.location.href)),c=await Promise.all(r.map(g=>Nv(g.href))),u=Array.from(document.querySelectorAll("style")).map(g=>g.textContent??"").filter(Boolean),m=await Promise.all(a.map(g=>Nv(g.href))),h={project:t,report:i,diff:s,exportedAt:new Date().toISOString()};return["<!doctype html>",'<html lang="en">'," <head>",' <meta charset="UTF-8" />',' <meta name="viewport" content="width=device-width, initial-scale=1.0" />',` <title>emviz - ${t.graphSidecar?.model?.name??"export"}</title>`,` <style>${[...c,...u].join(`
|
|
154
|
+
|
|
155
|
+
`)}</style>`," </head>"," <body>",' <div id="root"></div>',` <script>window.__EMVIZ_EXPORT__ = ${VO(h)};<\/script>`,` <script type="module">${m.join(`
|
|
156
|
+
|
|
157
|
+
`)}<\/script>`," </body>","</html>"].join(`
|
|
158
|
+
`)}function XO({diff:t,filter:i,onFilter:s,onSelect:a}){const r=Object.entries(t.nodeStatus).filter(([,c])=>c!=="unchanged").slice(0,80);return T.jsxs("aside",{className:"panel diff-panel",children:[T.jsx("h2",{children:"Diff"}),T.jsxs("div",{className:"diff-range",children:[T.jsx("code",{children:t.base.label}),T.jsx("span",{children:"to"}),T.jsx("code",{children:t.target.label})]}),T.jsxs("div",{className:"diff-counts",children:[T.jsxs("button",{type:"button",className:i==="added"?"active added":"added",onClick:()=>s(i==="added"?"all":"added"),children:[T.jsx("strong",{children:t.summary.nodes.added}),T.jsx("span",{children:"Added"})]}),T.jsxs("button",{type:"button",className:i==="removed"?"active removed":"removed",onClick:()=>s(i==="removed"?"all":"removed"),children:[T.jsx("strong",{children:t.summary.nodes.removed}),T.jsx("span",{children:"Removed"})]}),T.jsxs("button",{type:"button",className:i==="changed"?"active changed":"changed",onClick:()=>s(i==="changed"?"all":"changed"),children:[T.jsx("strong",{children:t.summary.nodes.changed}),T.jsx("span",{children:"Changed"})]})]}),i!=="all"?T.jsx("button",{type:"button",className:"clear-diff-filter",onClick:()=>s("all"),children:"Show full graph"}):null,T.jsx("h3",{children:"Changed Nodes"}),T.jsx("div",{className:"diff-list",children:r.length===0?T.jsx("p",{className:"muted",children:"No node changes."}):r.map(([c,u])=>T.jsxs("button",{type:"button",className:`diff-list-item ${u}`,onClick:()=>a(c),children:[T.jsx("span",{children:c}),T.jsx("strong",{children:u})]},c))})]})}function KO(t,i){const s=URL.createObjectURL(new Blob([i],{type:"text/html;charset=utf-8"})),a=document.createElement("a");a.href=s,a.download=t,a.click(),URL.revokeObjectURL(s)}async function ZO(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 IO(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 QO(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 FO(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=QO(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 JO({onImport:t,error:i}){return T.jsx("div",{className:"import-panel",children:T.jsxs("div",{className:"import-card",children:[T.jsx("h1",{children:"emviz"}),T.jsx("p",{children:"Import an Event Modeling project folder or select YAML/JSON files to visualize the model."}),T.jsxs("div",{className:"import-actions",children:[T.jsxs("label",{children:["Import folder",T.jsx("input",{type:"file",multiple:!0,webkitdirectory:"",directory:"",onChange:s=>s.currentTarget.files&&t(s.currentTarget.files)})]}),T.jsxs("label",{children:["Import files",T.jsx("input",{type:"file",multiple:!0,accept:".yaml,.yml,.json",onChange:s=>s.currentTarget.files&&t(s.currentTarget.files)})]})]}),i?T.jsx("p",{className:"import-error",children:i}):null]})})}function WO({project:t,selectedNode:i,diff:s,findings:a,selectedFieldName:r,onSelect:c,onSelectField:u,onClearField:m,onPreviewConnection:h,onClearPreview:g,gwtList:v,onGwtList:p,onClose:y,onFocusNode:S}){const[E,x]=K.useState(),A=i&&s?.nodeStatus[i.id]==="changed"?s.previousGwtNodes?.[i.id]:void 0,N=i&&A&&E===i?.id?{...A,id:i.id}:i,[_,w]=K.useState(),[O,j]=K.useState(""),D=K.useRef(null),R=K.useRef(0),k=!!v;K.useLayoutEffect(()=>{k&&D.current&&(D.current.scrollTop=R.current)},[k]);const q=C=>{C.key!=="Escape"&&C.stopPropagation()},ee=K.useCallback((C,$)=>{navigator.clipboard?.writeText($).then(()=>{w(C),window.setTimeout(()=>w(J=>J===C?void 0:J),1400)})},[]);if(v){const C=O.trim().toLowerCase(),$=v.filter(J=>J.label.toLowerCase().includes(C));return T.jsxs("aside",{ref:D,className:"panel panel-right gwt-panel","aria-label":"GWT scenarios",onKeyDown:q,onKeyUp:q,onScroll:J=>{R.current=J.currentTarget.scrollTop},children:[T.jsx("button",{type:"button",onClick:y,children:"Close"}),T.jsxs("h2",{children:[v[0]?.sliceTitle," · All scenarios (",v.length,")"]}),T.jsxs("div",{className:"gwt-filter",children:[T.jsx("label",{htmlFor:"gwt-name-filter",children:"Filter by scenario name"}),T.jsx("input",{id:"gwt-name-filter",type:"search",value:O,onChange:J=>{j(J.target.value),R.current=0,D.current&&(D.current.scrollTop=0)}}),T.jsx("button",{type:"button",disabled:!O,onClick:()=>{j(""),R.current=0,D.current&&(D.current.scrollTop=0),D.current?.querySelector("input")?.focus({preventScroll:!0})},children:"Clear filter"})]}),T.jsx("p",{role:"status",children:$.length?`${$.length} of ${v.length} scenarios`:"No scenarios match this name."}),T.jsx("div",{className:"gwt-all-list",children:$.map(J=>T.jsxs("button",{type:"button","aria-current":N?.id===J.id?"true":void 0,onClick:()=>{R.current=D.current?.scrollTop??R.current,c(J.id)},children:[J.label,s?` · ${s.nodeStatus[J.id]??"unchanged"}`:""]},J.id))})]})}if(!N)return T.jsxs("aside",{className:"panel panel-right",children:[T.jsx("h2",{children:"Selection"}),T.jsx("p",{className:"muted",children:"Select a node to inspect source and connections."})]});const V=new Map(t.nodes.map(C=>[C.id,C])),Q=t.edges.filter(C=>{const $=V.get(C.source),J=V.get(C.target);return pS(C.kind)&&$&&J&&$.type!=="gwt"&&J.type!=="gwt"}),ae=Q.filter(C=>C.target===N.id),L=Q.filter(C=>C.source===N.id),Y=h1(N.fields),B=`em://${t.graphSidecar?.model?.id??"event_model"}/${N.id}`,G=N.raw??N.fields??N.description??N.label,Z=[`Reference: ${B}`,`Node: ${N.label} (${N.type})`,`Source: ${N.sourcePath??"unknown"}`,"","Incoming:",...ae.length===0?["- none"]:ae.map(C=>`- ${V.get(C.source)?.label??C.source} -> ${N.label}`),"","Outgoing:",...L.length===0?["- none"]:L.map(C=>`- ${N.label} -> ${V.get(C.target)?.label??C.target}`),"","Source excerpt:",G].join(`
|
|
159
|
+
`),te=`Please update this event model node.
|
|
160
|
+
|
|
161
|
+
Reference:
|
|
162
|
+
${B}
|
|
163
|
+
|
|
164
|
+
Source path:
|
|
165
|
+
${N.sourcePath??"unknown"}
|
|
166
|
+
|
|
167
|
+
Current context:
|
|
168
|
+
${G}
|
|
169
|
+
|
|
170
|
+
Goal:
|
|
171
|
+
`;return T.jsxs("aside",{className:`panel panel-right ${N.type==="gwt"?"gwt-panel":""}`,"aria-label":"Node details",onKeyDown:N.type==="gwt"?q:void 0,onKeyUp:N.type==="gwt"?q:void 0,children:[N.type==="gwt"?T.jsxs("div",{className:"gwt-panel-actions",children:[T.jsx("button",{type:"button",onClick:()=>p(N.id),children:"All scenarios"}),T.jsx("button",{type:"button",onClick:y,children:"Close"})]}):null,T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:N.label}),T.jsx("button",{type:"button",className:"icon-button",onClick:()=>S(N.id),"aria-label":"Focus selected node",title:"Focus selected node",children:T.jsx("span",{className:"target-icon","aria-hidden":"true"})})]}),N.type==="gwt"?T.jsxs("section",{"aria-label":"Scenario details",children:[s&&i?T.jsxs("p",{children:[s.nodeStatus[i.id]," · ",s.nodeStatus[i.id]==="removed"||E===i.id?"Old version":"New version"]}):null,A?T.jsxs("div",{className:"gwt-panel-actions",children:[T.jsx("button",{type:"button","aria-pressed":E!==i?.id,onClick:()=>x(void 0),children:"New version"}),T.jsx("button",{type:"button","aria-pressed":E===i?.id,onClick:()=>x(i?.id),children:"Old version"})]}):null,N.description?T.jsx("p",{children:N.description}):null,T.jsx(ah,{title:"Given",items:N.given}),T.jsx(ah,{title:"When",items:N.when}),T.jsx(ah,{title:"Then",items:N.then}),T.jsx("p",{className:"muted",children:"YAML below is the source slice, not an individual scenario excerpt."})]}):null,T.jsxs("div",{className:"meta-row",children:[T.jsx("span",{children:"Type"}),T.jsx("strong",{children:N.type})]}),T.jsxs("div",{className:"meta-row",children:[T.jsx("span",{children:"Reference"}),T.jsx("code",{children:B})]}),N.sourcePath?T.jsxs("div",{className:"meta-row",children:[T.jsx("span",{children:"Source"}),T.jsx("code",{children:N.sourcePath})]}):null,T.jsxs("details",{className:"copy-section",children:[T.jsxs("summary",{children:[T.jsx("span",{children:"Copy for LLM"}),_?T.jsxs("strong",{className:"copy-feedback","aria-live":"polite",children:["Copied ",_]}):null]}),T.jsxs("div",{className:"copy-actions",children:[T.jsx(mc,{label:"Reference",description:"Stable em:// node handle",value:B,copiedKey:"reference",onCopy:ee}),T.jsx(mc,{label:"YAML",description:N.type==="gwt"?"Source YAML for the whole slice":"Source excerpt for this node",value:G,copiedKey:"YAML",onCopy:ee}),T.jsx(mc,{label:"Context",description:"Reference plus incoming/outgoing links",value:Z,copiedKey:"context",onCopy:ee}),T.jsx(mc,{label:"Edit prompt",description:"Prompt scaffold for asking an LLM to edit",value:te,copiedKey:"prompt",onCopy:ee})]})]}),T.jsx("h3",{children:"Connections"}),T.jsxs("div",{className:"connection-list",children:[T.jsx("strong",{children:"Incoming"}),ae.length===0?T.jsx("p",{className:"muted",children:"None"}):ae.map(C=>T.jsx("button",{type:"button",className:"connection-button",onClick:()=>c(C.source),onMouseEnter:()=>h(C.id),onMouseLeave:g,onFocus:()=>h(C.id),onBlur:g,children:T.jsx("span",{children:V.get(C.source)?.label??C.source})},C.id)),T.jsx("strong",{children:"Outgoing"}),L.length===0?T.jsx("p",{className:"muted",children:"None"}):L.map(C=>T.jsx("button",{type:"button",className:"connection-button",onClick:()=>c(C.target),onMouseEnter:()=>h(C.id),onMouseLeave:g,onFocus:()=>h(C.id),onBlur:g,children:T.jsx("span",{children:V.get(C.target)?.label??C.target})},C.id))]}),N.type==="command"||N.type==="event"||N.type==="query"?T.jsxs(T.Fragment,{children:[T.jsx("h3",{children:"Fields"}),T.jsxs("div",{className:"field-panel",children:[Y.length===0?T.jsx("p",{className:"field-empty",children:"No fields documented."}):T.jsx("div",{className:"field-list",children:Y.map(C=>T.jsx("button",{type:"button",className:r===C?"selected":"",onClick:()=>u(C),children:C},C))}),r?T.jsx("button",{type:"button",className:"clear-field",onClick:m,children:"Clear field focus"}):null]})]}):null,T.jsx("h3",{children:"Findings"}),a.length===0?T.jsx("p",{className:"muted",children:"No findings for this node."}):a.map(C=>T.jsxs("div",{className:`finding finding-${C.severity}`,children:[T.jsx("strong",{children:C.check}),T.jsx("span",{children:C.message})]},C.id)),T.jsx("h3",{children:N.type==="gwt"?"Source slice YAML":"Source"}),T.jsx("pre",{children:G})]})}function PO({report:t,onSelect:i,open:s,onOpen:a,onClose:r}){const c=t?.errors??0,u=t?.warnings??0,m=c+u;return T.jsxs(T.Fragment,{children:[T.jsxs("button",{type:"button",className:`validation-fab ${c>0?"has-errors":u>0?"has-warnings":""}`,onClick:a,"aria-expanded":s,"aria-controls":"validation-panel",title:"Open validation",children:[T.jsx("span",{"aria-hidden":"true",children:"!"}),m>0?T.jsx("strong",{"aria-label":`${m} validation findings`,children:m}):null]}),s?T.jsxs("aside",{className:"panel validation-drawer",id:"validation-panel",children:[T.jsxs("div",{className:"panel-heading",children:[T.jsx("h2",{children:"Validation"}),T.jsx("button",{type:"button",className:"panel-close",onClick:r,"aria-label":"Close validation",children:"Close"})]}),t?T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"status-row",children:[T.jsxs("span",{className:"status error",children:[t.errors," errors"]}),T.jsxs("span",{className:"status warning",children:[t.warnings," warnings"]})]}),T.jsx("div",{className:"findings-list",children:t.findings.length===0?T.jsx("p",{className:"muted",children:"No validation findings."}):t.findings.map(h=>T.jsxs("div",{className:`finding finding-${h.severity}`,children:[T.jsxs("div",{className:"finding-header",children:[T.jsx("strong",{children:h.check}),h.nodeId?T.jsx("button",{type:"button",onClick:()=>i(h.nodeId),children:"Focus"}):null]}),T.jsx("span",{children:h.message}),h.path?T.jsx("code",{children:h.path}):null]},h.id))})]}):T.jsx("p",{className:"muted",children:"Loading validation..."})]}):null]})}function e3(){const[t,i]=K.useState(),[s,a]=K.useState(),[r,c]=K.useState(),[u,m]=K.useState("all"),[h,g]=K.useState("loading"),[v,p]=K.useState(),[y,S]=K.useState(!1),[E,x]=K.useState("idle"),[A,N]=K.useState(),[_,w]=K.useState(),[O,j]=K.useState(),D=K.useRef(null),[R,k]=K.useState([]),[q,ee]=K.useState([]),[V,Q]=K.useState(""),[ae,L]=K.useState(),[Y,z]=K.useState(),[B,G]=K.useState(!1),{setCenter:Z,fitView:te}=Wc();K.useEffect(()=>{if(window.__EMVIZ_EXPORT__?.project){i(window.__EMVIZ_EXPORT__.project),a(window.__EMVIZ_EXPORT__.report),c(window.__EMVIZ_EXPORT__.diff),g("ready"),window.setTimeout(()=>{te({padding:.18,duration:300})},50);return}Promise.all([fetch("/api/model").then(fe=>fe.json()),fetch("/api/validation").then(fe=>fe.ok?fe.json():void 0).catch(()=>{}),fetch("/api/diff").then(fe=>fe.ok?fe.json():void 0).catch(()=>{})]).then(([fe,we,Ve])=>{i(fe),a(we),c(Ve),g("ready"),window.setTimeout(()=>{te({padding:.18,duration:300})},50)}).catch(()=>{g("import")})},[te]);const C=K.useMemo(()=>t?.nodes.find(fe=>fe.id===_),[t,_]),$=K.useMemo(()=>s?.findings.filter(fe=>fe.nodeId===_)??[],[s,_]),J=K.useMemo(()=>t?VM(t):new Map,[t]),se=K.useMemo(()=>{if(ae)return new Set([ae]);const fe=YM(J,Y);if(fe)return fe;if(!t||!_)return;const we=new Set;for(const Ve of t.edges)pS(Ve.kind)&&(Ve.source===_||Ve.target===_)&&we.add(Ve.id);return we},[J,ae,t,Y,_]),re=K.useMemo(()=>t?lC(t,_,{focusedEdgeIds:se,edgeFieldFlows:J,selectedFieldName:Y,onSelectField:z,diffNodeStatus:r?.nodeStatus,diffEdgeStatus:r?.edgeStatus,diffFilter:u}):{nodes:[],edges:[]},[r?.edgeStatus,r?.nodeStatus,u,J,se,t,Y,_]),de=K.useMemo(()=>{if(!t||V.trim().length<2)return[];const fe=V.trim().toLowerCase();return t.nodes.filter(we=>`${we.label} ${we.type} ${we.sourcePath??""}`.toLowerCase().includes(fe)).slice(0,8)},[t,V]),ce=K.useCallback((fe,we=!0,Ve=!1)=>{const lt=re.nodes.find(Re=>Re.id===fe);L(void 0),we&&_&&_!==fe&&(k(Re=>[...Re,_]),ee([]));const vt=lt?.data.projectNode.type==="gwt";if(vt&&!D.current){const Re=document.activeElement;D.current=Re?.closest(".search-results")?document.querySelector(".search-box input"):Re instanceof HTMLElement?Re:null}vt||(D.current=null),j(void 0),w(fe),lt&&(!vt||Ve)&&Z(lt.position.x+80,lt.position.y+60,{zoom:1.2,duration:350})},[re.nodes,_,Z]),ne=K.useCallback(()=>{w(void 0),L(void 0),z(void 0),j(void 0);const fe=D.current;D.current=null,fe&&requestAnimationFrame(()=>{fe?.isConnected?fe.focus({preventScroll:!0}):document.querySelector(".canvas")?.focus({preventScroll:!0})})},[]),ue=K.useCallback(fe=>{D.current||(D.current=document.activeElement instanceof HTMLElement?document.activeElement:null),j(fe)},[]),xe=K.useMemo(()=>({open:ce,list:ue}),[ce,ue]),ye=t?.nodes.find(fe=>fe.id===O),ge=ye?t?.nodes.filter(fe=>fe.type==="gwt"&&(ye.sourcePath?fe.sourcePath===ye.sourcePath:fe.sliceTitle===ye.sliceTitle)).filter(fe=>!r||u==="all"||r.nodeStatus[fe.id]===u):void 0;K.useEffect(()=>{(O||C?.type==="gwt")&&((O?document.querySelector(".gwt-all-list button[aria-current]"):null)??document.querySelector(".gwt-panel button"))?.focus({preventScroll:!0})},[O,C?.id,C?.type]);const be=K.useCallback(fe=>{const we=t?.edges.find(lt=>lt.id===fe);if(!we)return;L(fe);const Ve=re.nodes.filter(lt=>lt.id===we.source||lt.id===we.target);Ve.length>0&&te({nodes:Ve,padding:.36,duration:260,maxZoom:1.25})},[te,re.nodes,t?.edges]),Ee=K.useCallback(()=>{L(void 0)},[]),De=K.useCallback(()=>{t&&(x("exporting"),N(void 0),S(!1),GO(t,s,r).then(fe=>{KO(`${YO(t)}.emviz.html`,fe)}).catch(fe=>{N(fe instanceof Error?fe.message:String(fe))}).finally(()=>x("idle")))},[r,t,s]);K.useEffect(()=>{const fe=we=>{we.key==="Escape"&&(S(!1),ne())};return window.addEventListener("keydown",fe),()=>window.removeEventListener("keydown",fe)},[ne]);const Ke=K.useCallback(()=>{const fe=R.at(-1);fe&&(k(we=>we.slice(0,-1)),_&&ee(we=>[...we,_]),ce(fe,!1))},[R,ce,_]),pt=K.useCallback(()=>{const fe=q.at(-1);fe&&(ee(we=>we.slice(0,-1)),_&&k(we=>[...we,_]),ce(fe,!1))},[ce,q,_]),zt=K.useCallback(fe=>{ZO(fe).then(we=>{const Ve=TO(we),lt=Ve;lt.graphSidecar=IO(we)??{model:{id:"browser_import",name:"Browser Import"}},i(lt);const vt=LO(Ve),Re=FO(lt);a({errors:vt.errors,warnings:vt.warnings+Re.filter(At=>At.severity==="warning").length,findings:[...vt.findings,...Re]}),c(void 0),m("all"),w(void 0),L(void 0),z(void 0),k([]),ee([]),g("ready"),p(void 0),window.setTimeout(()=>{te({padding:.18,duration:300})},50)}).catch(we=>{p(we instanceof Error?we.message:String(we)),g("import")})},[te]);return h==="import"?T.jsx(JO,{onImport:zt,error:v}):t?T.jsxs("div",{className:`app-shell ${r?"diff-mode":""}`,children:[T.jsxs("header",{className:"toolbar",children:[T.jsxs("div",{className:"model-summary",children:[T.jsx("strong",{children:"emviz"}),T.jsxs("span",{children:[t.stories.length," stories"]}),T.jsxs("span",{children:[t.slices.length," slices"]}),T.jsxs("span",{children:[t.nodes.filter(fe=>fe.type==="event").length," events"]})]}),T.jsxs("div",{className:"segmented toolbar-history","aria-label":"Selection history",children:[T.jsx("button",{type:"button",disabled:R.length===0,onClick:Ke,"aria-label":"Back",title:"Back",children:"←"}),T.jsx("button",{type:"button",disabled:q.length===0,onClick:pt,"aria-label":"Forward",title:"Forward",children:"→"})]}),T.jsxs("div",{className:"search-box",children:[T.jsx("input",{"aria-label":"Search event model",value:V,onChange:fe=>Q(fe.target.value),placeholder:"Search nodes by name or type..."}),de.length>0?T.jsx("div",{className:"search-results",children:de.map(fe=>T.jsxs("button",{type:"button",onClick:()=>{ce(fe.id),Q("")},children:[T.jsx("span",{children:fe.label}),T.jsx("small",{children:fe.type})]},fe.id))}):null]}),T.jsxs("div",{className:"toolbar-menu",children:[T.jsx("button",{type:"button",className:"menu-trigger",onClick:()=>S(fe=>!fe),"aria-haspopup":"menu","aria-expanded":y,"aria-label":"Open menu",title:"Open menu",children:"..."}),y?T.jsx("div",{className:"menu-popover",role:"menu",children:T.jsx("button",{type:"button",role:"menuitem",onClick:De,disabled:E==="exporting",children:E==="exporting"?"Exporting...":"Export"})}):null]}),A?T.jsx("div",{className:"toolbar-error",role:"alert",children:A}):null]}),T.jsx(PO,{report:s,onSelect:ce,open:B,onOpen:()=>G(!0),onClose:()=>G(!1)}),r?T.jsx(XO,{diff:r,filter:u,onFilter:m,onSelect:ce}):null,T.jsx(WO,{diff:r,gwtList:ge,onGwtList:ue,onClose:ne,onFocusNode:fe=>ce(fe,!0,!0),project:t,selectedNode:C,findings:$,selectedFieldName:Y,onSelect:ce,onSelectField:z,onClearField:()=>z(void 0),onPreviewConnection:be,onClearPreview:Ee},(ye??C)?.type==="gwt"?`gwt:${(ye??C)?.sourcePath??(ye??C)?.sliceTitle}`:"selection"),T.jsx("main",{className:"canvas",tabIndex:-1,"aria-label":"Event model diagram",children:T.jsx(mS.Provider,{value:xe,children:T.jsxs(uM,{nodes:re.nodes,edges:re.edges,nodeTypes:HO,edgeTypes:qO,onNodeClick:(fe,we)=>ce(we.id),fitView:!0,minZoom:.2,maxZoom:1.8,nodesDraggable:!1,colorMode:"light",children:[T.jsx(yM,{gap:18,size:1}),T.jsx(NM,{})]})})})]}):T.jsx("div",{className:"loading",children:"Loading event model..."})}function t3(){return T.jsx(r1,{children:T.jsx(e3,{})})}Ox.createRoot(document.getElementById("root")).render(T.jsx(qc.StrictMode,{children:T.jsx(t3,{})}));
|