emviz 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,171 +0,0 @@
1
- (function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))a(o);new MutationObserver(o=>{for(const c of o)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(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(o){if(o.ep)return;o.ep=!0;const c=s(o);fetch(o.href,c)}})();function sb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Qd={exports:{}},wo={};var m0;function hE(){if(m0)return wo;m0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function s(a,o,c){var u=null;if(c!==void 0&&(u=""+c),o.key!==void 0&&(u=""+o.key),"key"in o){c={};for(var d in o)d!=="key"&&(c[d]=o[d])}else c=o;return o=c.ref,{$$typeof:e,type:a,key:u,ref:o!==void 0?o:null,props:c}}return wo.Fragment=n,wo.jsx=s,wo.jsxs=s,wo}var p0;function mE(){return p0||(p0=1,Qd.exports=hE()),Qd.exports}var S=mE(),Zd={exports:{}},_e={};var g0;function pE(){if(g0)return _e;g0=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),y=Symbol.iterator;function w(O){return O===null||typeof O!="object"?null:(O=y&&O[y]||O["@@iterator"],typeof O=="function"?O:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},N=Object.assign,A={};function C(O,I,ee){this.props=O,this.context=I,this.refs=A,this.updater=ee||E}C.prototype.isReactComponent={},C.prototype.setState=function(O,I){if(typeof O!="object"&&typeof O!="function"&&O!=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,O,I,"setState")},C.prototype.forceUpdate=function(O){this.updater.enqueueForceUpdate(this,O,"forceUpdate")};function z(){}z.prototype=C.prototype;function _(O,I,ee){this.props=O,this.context=I,this.refs=A,this.updater=ee||E}var x=_.prototype=new z;x.constructor=_,N(x,C.prototype),x.isPureReactComponent=!0;var B=Array.isArray;function j(){}var T={H:null,A:null,T:null,S:null},D=Object.prototype.hasOwnProperty;function R(O,I,ee){var ne=ee.ref;return{$$typeof:e,type:O,key:I,ref:ne!==void 0?ne:null,props:ee}}function Z(O,I){return R(O.type,I,O.props)}function Y(O){return typeof O=="object"&&O!==null&&O.$$typeof===e}function K(O){var I={"=":"=0",":":"=2"};return"$"+O.replace(/[=:]/g,function(ee){return I[ee]})}var le=/\/+/g;function L(O,I){return typeof O=="object"&&O!==null&&O.key!=null?K(""+O.key):I.toString(36)}function G(O){switch(O.status){case"fulfilled":return O.value;case"rejected":throw O.reason;default:switch(typeof O.status=="string"?O.then(j,j):(O.status="pending",O.then(function(I){O.status==="pending"&&(O.status="fulfilled",O.value=I)},function(I){O.status==="pending"&&(O.status="rejected",O.reason=I)})),O.status){case"fulfilled":return O.value;case"rejected":throw O.reason}}throw O}function k(O,I,ee,ne,fe){var de=typeof O;(de==="undefined"||de==="boolean")&&(O=null);var ae=!1;if(O===null)ae=!0;else switch(de){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(O.$$typeof){case e:case n:ae=!0;break;case v:return ae=O._init,k(ae(O._payload),I,ee,ne,fe)}}if(ae)return fe=fe(O),ae=ne===""?"."+L(O,0):ne,B(fe)?(ee="",ae!=null&&(ee=ae.replace(le,"$&/")+"/"),k(fe,I,ee,"",function(Se){return Se})):fe!=null&&(Y(fe)&&(fe=Z(fe,ee+(fe.key==null||O&&O.key===fe.key?"":(""+fe.key).replace(le,"$&/")+"/")+ae)),I.push(fe)),1;ae=0;var te=ne===""?".":ne+":";if(B(O))for(var ue=0;ue<O.length;ue++)ne=O[ue],de=te+L(ne,ue),ae+=k(ne,I,ee,de,fe);else if(ue=w(O),typeof ue=="function")for(O=ue.call(O),ue=0;!(ne=O.next()).done;)ne=ne.value,de=te+L(ne,ue++),ae+=k(ne,I,ee,de,fe);else if(de==="object"){if(typeof O.then=="function")return k(G(O),I,ee,ne,fe);throw I=String(O),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(O).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return ae}function $(O,I,ee){if(O==null)return O;var ne=[],fe=0;return k(O,ne,"","",function(de){return I.call(ee,de,fe++)}),ne}function H(O){if(O._status===-1){var I=O._result;I=I(),I.then(function(ee){(O._status===0||O._status===-1)&&(O._status=1,O._result=ee)},function(ee){(O._status===0||O._status===-1)&&(O._status=2,O._result=ee)}),O._status===-1&&(O._status=0,O._result=I)}if(O._status===1)return O._result.default;throw O._result}var X=typeof reportError=="function"?reportError:function(O){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof O=="object"&&O!==null&&typeof O.message=="string"?String(O.message):String(O),error:O});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",O);return}console.error(O)},W={map:$,forEach:function(O,I,ee){$(O,function(){I.apply(this,arguments)},ee)},count:function(O){var I=0;return $(O,function(){I++}),I},toArray:function(O){return $(O,function(I){return I})||[]},only:function(O){if(!Y(O))throw Error("React.Children.only expected to receive a single React element child.");return O}};return _e.Activity=g,_e.Children=W,_e.Component=C,_e.Fragment=s,_e.Profiler=o,_e.PureComponent=_,_e.StrictMode=a,_e.Suspense=h,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,_e.__COMPILER_RUNTIME={__proto__:null,c:function(O){return T.H.useMemoCache(O)}},_e.cache=function(O){return function(){return O.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(O,I,ee){if(O==null)throw Error("The argument must be a React element, but you passed "+O+".");var ne=N({},O.props),fe=O.key;if(I!=null)for(de in I.key!==void 0&&(fe=""+I.key),I)!D.call(I,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&I.ref===void 0||(ne[de]=I[de]);var de=arguments.length-2;if(de===1)ne.children=ee;else if(1<de){for(var ae=Array(de),te=0;te<de;te++)ae[te]=arguments[te+2];ne.children=ae}return R(O.type,fe,ne)},_e.createContext=function(O){return O={$$typeof:u,_currentValue:O,_currentValue2:O,_threadCount:0,Provider:null,Consumer:null},O.Provider=O,O.Consumer={$$typeof:c,_context:O},O},_e.createElement=function(O,I,ee){var ne,fe={},de=null;if(I!=null)for(ne in I.key!==void 0&&(de=""+I.key),I)D.call(I,ne)&&ne!=="key"&&ne!=="__self"&&ne!=="__source"&&(fe[ne]=I[ne]);var ae=arguments.length-2;if(ae===1)fe.children=ee;else if(1<ae){for(var te=Array(ae),ue=0;ue<ae;ue++)te[ue]=arguments[ue+2];fe.children=te}if(O&&O.defaultProps)for(ne in ae=O.defaultProps,ae)fe[ne]===void 0&&(fe[ne]=ae[ne]);return R(O,de,fe)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(O){return{$$typeof:d,render:O}},_e.isValidElement=Y,_e.lazy=function(O){return{$$typeof:v,_payload:{_status:-1,_result:O},_init:H}},_e.memo=function(O,I){return{$$typeof:p,type:O,compare:I===void 0?null:I}},_e.startTransition=function(O){var I=T.T,ee={};T.T=ee;try{var ne=O(),fe=T.S;fe!==null&&fe(ee,ne),typeof ne=="object"&&ne!==null&&typeof ne.then=="function"&&ne.then(j,X)}catch(de){X(de)}finally{I!==null&&ee.types!==null&&(I.types=ee.types),T.T=I}},_e.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},_e.use=function(O){return T.H.use(O)},_e.useActionState=function(O,I,ee){return T.H.useActionState(O,I,ee)},_e.useCallback=function(O,I){return T.H.useCallback(O,I)},_e.useContext=function(O){return T.H.useContext(O)},_e.useDebugValue=function(){},_e.useDeferredValue=function(O,I){return T.H.useDeferredValue(O,I)},_e.useEffect=function(O,I){return T.H.useEffect(O,I)},_e.useEffectEvent=function(O){return T.H.useEffectEvent(O)},_e.useId=function(){return T.H.useId()},_e.useImperativeHandle=function(O,I,ee){return T.H.useImperativeHandle(O,I,ee)},_e.useInsertionEffect=function(O,I){return T.H.useInsertionEffect(O,I)},_e.useLayoutEffect=function(O,I){return T.H.useLayoutEffect(O,I)},_e.useMemo=function(O,I){return T.H.useMemo(O,I)},_e.useOptimistic=function(O,I){return T.H.useOptimistic(O,I)},_e.useReducer=function(O,I,ee){return T.H.useReducer(O,I,ee)},_e.useRef=function(O){return T.H.useRef(O)},_e.useState=function(O){return T.H.useState(O)},_e.useSyncExternalStore=function(O,I,ee){return T.H.useSyncExternalStore(O,I,ee)},_e.useTransition=function(){return T.H.useTransition()},_e.version="19.2.7",_e}var y0;function Jo(){return y0||(y0=1,Zd.exports=pE()),Zd.exports}var q=Jo();const du=sb(q);var Fd={exports:{}},xo={},Jd={exports:{}},Wd={};var v0;function gE(){return v0||(v0=1,(function(e){function n(k,$){var H=k.length;k.push($);e:for(;0<H;){var X=H-1>>>1,W=k[X];if(0<o(W,$))k[X]=$,k[H]=W,H=X;else break e}}function s(k){return k.length===0?null:k[0]}function a(k){if(k.length===0)return null;var $=k[0],H=k.pop();if(H!==$){k[0]=H;e:for(var X=0,W=k.length,O=W>>>1;X<O;){var I=2*(X+1)-1,ee=k[I],ne=I+1,fe=k[ne];if(0>o(ee,H))ne<W&&0>o(fe,ee)?(k[X]=fe,k[ne]=H,X=ne):(k[X]=ee,k[I]=H,X=I);else if(ne<W&&0>o(fe,H))k[X]=fe,k[ne]=H,X=ne;else break e}}return $}function o(k,$){var H=k.sortIndex-$.sortIndex;return H!==0?H:k.id-$.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var h=[],p=[],v=1,g=null,y=3,w=!1,E=!1,N=!1,A=!1,C=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;function x(k){for(var $=s(p);$!==null;){if($.callback===null)a(p);else if($.startTime<=k)a(p),$.sortIndex=$.expirationTime,n(h,$);else break;$=s(p)}}function B(k){if(N=!1,x(k),!E)if(s(h)!==null)E=!0,j||(j=!0,K());else{var $=s(p);$!==null&&G(B,$.startTime-k)}}var j=!1,T=-1,D=5,R=-1;function Z(){return A?!0:!(e.unstable_now()-R<D)}function Y(){if(A=!1,j){var k=e.unstable_now();R=k;var $=!0;try{e:{E=!1,N&&(N=!1,z(T),T=-1),w=!0;var H=y;try{t:{for(x(k),g=s(h);g!==null&&!(g.expirationTime>k&&Z());){var X=g.callback;if(typeof X=="function"){g.callback=null,y=g.priorityLevel;var W=X(g.expirationTime<=k);if(k=e.unstable_now(),typeof W=="function"){g.callback=W,x(k),$=!0;break t}g===s(h)&&a(h),x(k)}else a(h);g=s(h)}if(g!==null)$=!0;else{var O=s(p);O!==null&&G(B,O.startTime-k),$=!1}}break e}finally{g=null,y=H,w=!1}$=void 0}}finally{$?K():j=!1}}}var K;if(typeof _=="function")K=function(){_(Y)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,L=le.port2;le.port1.onmessage=Y,K=function(){L.postMessage(null)}}else K=function(){C(Y,0)};function G(k,$){T=C(function(){k(e.unstable_now())},$)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(k){k.callback=null},e.unstable_forceFrameRate=function(k){0>k||125<k?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<k?Math.floor(1e3/k):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(k){switch(y){case 1:case 2:case 3:var $=3;break;default:$=y}var H=y;y=$;try{return k()}finally{y=H}},e.unstable_requestPaint=function(){A=!0},e.unstable_runWithPriority=function(k,$){switch(k){case 1:case 2:case 3:case 4:case 5:break;default:k=3}var H=y;y=k;try{return $()}finally{y=H}},e.unstable_scheduleCallback=function(k,$,H){var X=e.unstable_now();switch(typeof H=="object"&&H!==null?(H=H.delay,H=typeof H=="number"&&0<H?X+H:X):H=X,k){case 1:var W=-1;break;case 2:W=250;break;case 5:W=1073741823;break;case 4:W=1e4;break;default:W=5e3}return W=H+W,k={id:v++,callback:$,priorityLevel:k,startTime:H,expirationTime:W,sortIndex:-1},H>X?(k.sortIndex=H,n(p,k),s(h)===null&&k===s(p)&&(N?(z(T),T=-1):N=!0,G(B,H-X))):(k.sortIndex=W,n(h,k),E||w||(E=!0,j||(j=!0,K()))),k},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(k){var $=y;return function(){var H=y;y=$;try{return k.apply(this,arguments)}finally{y=H}}}})(Wd)),Wd}var b0;function yE(){return b0||(b0=1,Jd.exports=gE()),Jd.exports}var Pd={exports:{}},jt={};var S0;function vE(){if(S0)return jt;S0=1;var e=Jo();function n(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)p+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+h+"; visit "+p+" 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(n(522))},D:s,C:s,L:s,m:s,X:s,S:s,M:s},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(h,p,v){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:h,containerInfo:p,implementation:v}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,jt.createPortal=function(h,p){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(n(299));return c(h,p,null,v)},jt.flushSync=function(h){var p=u.T,v=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=p,a.p=v,a.d.f()}},jt.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(h,p))},jt.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},jt.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var v=p.as,g=d(v,p.crossOrigin),y=typeof p.integrity=="string"?p.integrity:void 0,w=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;v==="style"?a.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:y,fetchPriority:w}):v==="script"&&a.d.X(h,{crossOrigin:g,integrity:y,fetchPriority:w,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},jt.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var v=d(p.as,p.crossOrigin);a.d.M(h,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(h)},jt.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var v=p.as,g=d(v,p.crossOrigin);a.d.L(h,v,{crossOrigin:g,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},jt.preloadModule=function(h,p){if(typeof h=="string")if(p){var v=d(p.as,p.crossOrigin);a.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(h)},jt.requestFormReset=function(h){a.d.r(h)},jt.unstable_batchedUpdates=function(h,p){return h(p)},jt.useFormState=function(h,p,v){return u.H.useFormState(h,p,v)},jt.useFormStatus=function(){return u.H.useHostTransitionStatus()},jt.version="19.2.7",jt}var w0;function ab(){if(w0)return Pd.exports;w0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Pd.exports=vE(),Pd.exports}var x0;function bE(){if(x0)return xo;x0=1;var e=yE(),n=Jo(),s=ab();function a(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var i=t,l=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(l=i.return),t=i.return;while(t)}return i.tag===3?l:null}function u(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function d(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function h(t){if(c(t)!==t)throw Error(a(188))}function p(t){var i=t.alternate;if(!i){if(i=c(t),i===null)throw Error(a(188));return i!==t?null:t}for(var l=t,r=i;;){var f=l.return;if(f===null)break;var m=f.alternate;if(m===null){if(r=f.return,r!==null){l=r;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===l)return h(f),t;if(m===r)return h(f),i;m=m.sibling}throw Error(a(188))}if(l.return!==r.return)l=f,r=m;else{for(var b=!1,M=f.child;M;){if(M===l){b=!0,l=f,r=m;break}if(M===r){b=!0,r=f,l=m;break}M=M.sibling}if(!b){for(M=m.child;M;){if(M===l){b=!0,l=m,r=f;break}if(M===r){b=!0,r=m,l=f;break}M=M.sibling}if(!b)throw Error(a(189))}}if(l.alternate!==r)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?t:i}function v(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=v(t),i!==null)return i;t=t.sibling}return null}var g=Object.assign,y=Symbol.for("react.element"),w=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),A=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),_=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),D=Symbol.for("react.lazy"),R=Symbol.for("react.activity"),Z=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function K(t){return t===null||typeof t!="object"?null:(t=Y&&t[Y]||t["@@iterator"],typeof t=="function"?t:null)}var le=Symbol.for("react.client.reference");function L(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===le?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case N:return"Fragment";case C:return"Profiler";case A:return"StrictMode";case B:return"Suspense";case j:return"SuspenseList";case R:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case _:return t.displayName||"Context";case z:return(t._context.displayName||"Context")+".Consumer";case x:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case T:return i=t.displayName||null,i!==null?i:L(t.type)||"Memo";case D:i=t._payload,t=t._init;try{return L(t(i))}catch{}}return null}var G=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H={pending:!1,data:null,method:null,action:null},X=[],W=-1;function O(t){return{current:t}}function I(t){0>W||(t.current=X[W],X[W]=null,W--)}function ee(t,i){W++,X[W]=t.current,t.current=i}var ne=O(null),fe=O(null),de=O(null),ae=O(null);function te(t,i){switch(ee(de,i),ee(fe,t),ee(ne,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?Ly(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=Ly(i),t=$y(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}I(ne),ee(ne,t)}function ue(){I(ne),I(fe),I(de)}function Se(t){t.memoizedState!==null&&ee(ae,t);var i=ne.current,l=$y(i,t.type);i!==l&&(ee(fe,t),ee(ne,l))}function we(t){fe.current===t&&(I(ne),I(fe)),ae.current===t&&(I(ae),yo._currentValue=H)}var ge,ve;function Ee(t){if(ge===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);ge=i&&i[1]||"",ve=-1<l.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+ge+t+ve}var Me=!1;function Be(t,i){if(!t||Me)return"";Me=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(i){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(se){var P=se}Reflect.construct(t,[],ce)}else{try{ce.call()}catch(se){P=se}t.call(ce.prototype)}}else{try{throw Error()}catch(se){P=se}(ce=t())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(se){if(se&&P&&typeof se.stack=="string")return[se.stack,P.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var m=r.DetermineComponentFrameRoot(),b=m[0],M=m[1];if(b&&M){var U=b.split(`
4
- `),J=M.split(`
5
- `);for(f=r=0;r<U.length&&!U[r].includes("DetermineComponentFrameRoot");)r++;for(;f<J.length&&!J[f].includes("DetermineComponentFrameRoot");)f++;if(r===U.length||f===J.length)for(r=U.length-1,f=J.length-1;1<=r&&0<=f&&U[r]!==J[f];)f--;for(;1<=r&&0<=f;r--,f--)if(U[r]!==J[f]){if(r!==1||f!==1)do if(r--,f--,0>f||U[r]!==J[f]){var oe=`
6
- `+U[r].replace(" at new "," at ");return t.displayName&&oe.includes("<anonymous>")&&(oe=oe.replace("<anonymous>",t.displayName)),oe}while(1<=r&&0<=f);break}}}finally{Me=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?Ee(l):""}function Et(t,i){switch(t.tag){case 26:case 27:case 5:return Ee(t.type);case 16:return Ee("Lazy");case 13:return t.child!==i&&i!==null?Ee("Suspense Fallback"):Ee("Suspense");case 19:return Ee("SuspenseList");case 0:case 15:return Be(t.type,!1);case 11:return Be(t.type.render,!1);case 1:return Be(t.type,!0);case 31:return Ee("Activity");default:return""}}function Bt(t){try{var i="",l=null;do i+=Et(t,l),l=t,t=t.return;while(t);return i}catch(r){return`
7
- Error generating stack: `+r.message+`
8
- `+r.stack}}var Nt=Object.prototype.hasOwnProperty,We=e.unstable_scheduleCallback,St=e.unstable_cancelCallback,ti=e.unstable_shouldYield,He=e.unstable_requestPaint,Ye=e.unstable_now,_t=e.unstable_getCurrentPriorityLevel,Ht=e.unstable_ImmediatePriority,Ut=e.unstable_UserBlockingPriority,It=e.unstable_NormalPriority,dt=e.unstable_LowPriority,An=e.unstable_IdlePriority,ys=e.log,ta=e.unstable_setDisableYieldValue,ni=null,ht=null;function en(t){if(typeof ys=="function"&&ta(t),ht&&typeof ht.setStrictMode=="function")try{ht.setStrictMode(ni,t)}catch{}}var Qe=Math.clz32?Math.clz32:vs,na=Math.log,kt=Math.LN2;function vs(t){return t>>>=0,t===0?32:31-(na(t)/kt|0)|0}var Vn=256,ki=262144,qt=4194304;function Tn(t){var i=t&42;if(i!==0)return i;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function zi(t,i,l){var r=t.pendingLanes;if(r===0)return 0;var f=0,m=t.suspendedLanes,b=t.pingedLanes;t=t.warmLanes;var M=r&134217727;return M!==0?(r=M&~m,r!==0?f=Tn(r):(b&=M,b!==0?f=Tn(b):l||(l=M&~t,l!==0&&(f=Tn(l))))):(M=r&~m,M!==0?f=Tn(M):b!==0?f=Tn(b):l||(l=r&~t,l!==0&&(f=Tn(l)))),f===0?0:i!==0&&i!==f&&(i&m)===0&&(m=f&-f,l=i&-i,m>=l||m===32&&(l&4194048)!==0)?i:f}function ii(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function _l(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+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 i+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 ia(){var t=qt;return qt<<=1,(qt&62914560)===0&&(qt=4194304),t}function bs(t){for(var i=[],l=0;31>l;l++)i.push(t);return i}function si(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function ie(t,i,l,r,f,m){var b=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var M=t.entanglements,U=t.expirationTimes,J=t.hiddenUpdates;for(l=b&~l;0<l;){var oe=31-Qe(l),ce=1<<oe;M[oe]=0,U[oe]=-1;var P=J[oe];if(P!==null)for(J[oe]=null,oe=0;oe<P.length;oe++){var se=P[oe];se!==null&&(se.lane&=-536870913)}l&=~ce}r!==0&&me(t,r,0),m!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=m&~(b&~i))}function me(t,i,l){t.pendingLanes|=i,t.suspendedLanes&=~i;var r=31-Qe(i);t.entangledLanes|=i,t.entanglements[r]=t.entanglements[r]|1073741824|l&261930}function Ne(t,i){var l=t.entangledLanes|=i;for(t=t.entanglements;l;){var r=31-Qe(l),f=1<<r;f&i|t[r]&i&&(t[r]|=i),l&=~f}}function Je(t,i){var l=i&-i;return l=(l&42)!==0?1:Vt(l),(l&(t.suspendedLanes|i))!==0?0:l}function Vt(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function hn(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function at(){var t=$.p;return t!==0?t:(t=window.event,t===void 0?32:o0(t.type))}function or(t,i){var l=$.p;try{return $.p=t,i()}finally{$.p=l}}var Yn=Math.random().toString(36).slice(2),wt="__reactFiber$"+Yn,zt="__reactProps$"+Yn,ai="__reactContainer$"+Yn,sa="__reactEvents$"+Yn,rr="__reactListeners$"+Yn,Hu="__reactHandles$"+Yn,cr="__reactResources$"+Yn,Ss="__reactMarker$"+Yn;function Al(t){delete t[wt],delete t[zt],delete t[sa],delete t[rr],delete t[Hu]}function ji(t){var i=t[wt];if(i)return i;for(var l=t.parentNode;l;){if(i=l[ai]||l[wt]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(t=Gy(t);t!==null;){if(l=t[wt])return l;t=Gy(t)}return i}t=l,l=t.parentNode}return null}function Di(t){if(t=t[wt]||t[ai]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function Ri(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(a(33))}function Bi(t){var i=t[cr];return i||(i=t[cr]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function mt(t){t[Ss]=!0}var ur=new Set,fr={};function li(t,i){Li(t,i),Li(t+"Capture",i)}function Li(t,i){for(fr[t]=i,t=0;t<i.length;t++)ur.add(i[t])}var Uu=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]*$"),dr={},Tl={};function Iu(t){return Nt.call(Tl,t)?!0:Nt.call(dr,t)?!1:Uu.test(t)?Tl[t]=!0:(dr[t]=!0,!1)}function aa(t,i,l){if(Iu(i))if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var r=i.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+l)}}function la(t,i,l){if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+l)}}function Cn(t,i,l,r){if(r===null)t.removeAttribute(l);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(i,l,""+r)}}function Yt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function hr(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function qu(t,i,l){var r=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var f=r.get,m=r.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return f.call(this)},set:function(b){l=""+b,m.call(this,b)}}),Object.defineProperty(t,i,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(b){l=""+b},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function Cl(t){if(!t._valueTracker){var i=hr(t)?"checked":"value";t._valueTracker=qu(t,i,""+t[i])}}function Ml(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var l=i.getValue(),r="";return t&&(r=hr(t)?t.checked?"true":"false":t.value),t=r,t!==l?(i.setValue(t),!0):!1}function oa(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var mr=/[\n"\\]/g;function Gt(t){return t.replace(mr,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Ol(t,i,l,r,f,m,b,M){t.name="",b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?t.type=b:t.removeAttribute("type"),i!=null?b==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Yt(i)):t.value!==""+Yt(i)&&(t.value=""+Yt(i)):b!=="submit"&&b!=="reset"||t.removeAttribute("value"),i!=null?kl(t,b,Yt(i)):l!=null?kl(t,b,Yt(l)):r!=null&&t.removeAttribute("value"),f==null&&m!=null&&(t.defaultChecked=!!m),f!=null&&(t.checked=f&&typeof f!="function"&&typeof f!="symbol"),M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?t.name=""+Yt(M):t.removeAttribute("name")}function ra(t,i,l,r,f,m,b,M){if(m!=null&&typeof m!="function"&&typeof m!="symbol"&&typeof m!="boolean"&&(t.type=m),i!=null||l!=null){if(!(m!=="submit"&&m!=="reset"||i!=null)){Cl(t);return}l=l!=null?""+Yt(l):"",i=i!=null?""+Yt(i):l,M||i===t.value||(t.value=i),t.defaultValue=i}r=r??f,r=typeof r!="function"&&typeof r!="symbol"&&!!r,t.checked=M?t.checked:!!r,t.defaultChecked=!!r,b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(t.name=b),Cl(t)}function kl(t,i,l){i==="number"&&oa(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function $i(t,i,l,r){if(t=t.options,i){i={};for(var f=0;f<l.length;f++)i["$"+l[f]]=!0;for(l=0;l<t.length;l++)f=i.hasOwnProperty("$"+t[l].value),t[l].selected!==f&&(t[l].selected=f),f&&r&&(t[l].defaultSelected=!0)}else{for(l=""+Yt(l),i=null,f=0;f<t.length;f++){if(t[f].value===l){t[f].selected=!0,r&&(t[f].defaultSelected=!0);return}i!==null||t[f].disabled||(i=t[f])}i!==null&&(i.selected=!0)}}function zl(t,i,l){if(i!=null&&(i=""+Yt(i),i!==t.value&&(t.value=i),l==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=l!=null?""+Yt(l):""}function jm(t,i,l,r){if(i==null){if(r!=null){if(l!=null)throw Error(a(92));if(G(r)){if(1<r.length)throw Error(a(93));r=r[0]}l=r}l==null&&(l=""),i=l}l=Yt(i),t.defaultValue=l,r=t.textContent,r===l&&r!==""&&r!==null&&(t.value=r),Cl(t)}function ca(t,i){if(i){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=i;return}}t.textContent=i}var rw=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 Dm(t,i,l){var r=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?r?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":r?t.setProperty(i,l):typeof l!="number"||l===0||rw.has(i)?i==="float"?t.cssFloat=l:t[i]=(""+l).trim():t[i]=l+"px"}function Rm(t,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(t=t.style,l!=null){for(var r in l)!l.hasOwnProperty(r)||i!=null&&i.hasOwnProperty(r)||(r.indexOf("--")===0?t.setProperty(r,""):r==="float"?t.cssFloat="":t[r]="");for(var f in i)r=i[f],i.hasOwnProperty(f)&&l[f]!==r&&Dm(t,f,r)}else for(var m in i)i.hasOwnProperty(m)&&Dm(t,m,i[m])}function Vu(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var cw=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"]]),uw=/^[\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 pr(t){return uw.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function oi(){}var Yu=null;function Gu(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ua=null,fa=null;function Bm(t){var i=Di(t);if(i&&(t=i.stateNode)){var l=t[zt]||null;e:switch(t=i.stateNode,i.type){case"input":if(Ol(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Gt(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var r=l[i];if(r!==t&&r.form===t.form){var f=r[zt]||null;if(!f)throw Error(a(90));Ol(r,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(i=0;i<l.length;i++)r=l[i],r.form===t.form&&Ml(r)}break e;case"textarea":zl(t,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&$i(t,!!l.multiple,i,!1)}}}var Xu=!1;function Lm(t,i,l){if(Xu)return t(i,l);Xu=!0;try{var r=t(i);return r}finally{if(Xu=!1,(ua!==null||fa!==null)&&(nc(),ua&&(i=ua,t=fa,fa=ua=null,Bm(i),t)))for(i=0;i<t.length;i++)Bm(t[i])}}function jl(t,i){var l=t.stateNode;if(l===null)return null;var r=l[zt]||null;if(r===null)return null;l=r[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(t=t.type,r=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!r;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var ri=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ku=!1;if(ri)try{var Dl={};Object.defineProperty(Dl,"passive",{get:function(){Ku=!0}}),window.addEventListener("test",Dl,Dl),window.removeEventListener("test",Dl,Dl)}catch{Ku=!1}var Hi=null,Qu=null,gr=null;function $m(){if(gr)return gr;var t,i=Qu,l=i.length,r,f="value"in Hi?Hi.value:Hi.textContent,m=f.length;for(t=0;t<l&&i[t]===f[t];t++);var b=l-t;for(r=1;r<=b&&i[l-r]===f[m-r];r++);return gr=f.slice(t,1<r?1-r:void 0)}function yr(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function vr(){return!0}function Hm(){return!1}function Xt(t){function i(l,r,f,m,b){this._reactName=l,this._targetInst=f,this.type=r,this.nativeEvent=m,this.target=b,this.currentTarget=null;for(var M in t)t.hasOwnProperty(M)&&(l=t[M],this[M]=l?l(m):m[M]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?vr:Hm,this.isPropagationStopped=Hm,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=vr)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=vr)},persist:function(){},isPersistent:vr}),i}var ws={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},br=Xt(ws),Rl=g({},ws,{view:0,detail:0}),fw=Xt(Rl),Zu,Fu,Bl,Sr=g({},Rl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Wu,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Bl&&(Bl&&t.type==="mousemove"?(Zu=t.screenX-Bl.screenX,Fu=t.screenY-Bl.screenY):Fu=Zu=0,Bl=t),Zu)},movementY:function(t){return"movementY"in t?t.movementY:Fu}}),Um=Xt(Sr),dw=g({},Sr,{dataTransfer:0}),hw=Xt(dw),mw=g({},Rl,{relatedTarget:0}),Ju=Xt(mw),pw=g({},ws,{animationName:0,elapsedTime:0,pseudoElement:0}),gw=Xt(pw),yw=g({},ws,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),vw=Xt(yw),bw=g({},ws,{data:0}),Im=Xt(bw),Sw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ww={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"},xw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ew(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=xw[t])?!!i[t]:!1}function Wu(){return Ew}var Nw=g({},Rl,{key:function(t){if(t.key){var i=Sw[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=yr(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?ww[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Wu,charCode:function(t){return t.type==="keypress"?yr(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?yr(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),_w=Xt(Nw),Aw=g({},Sr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),qm=Xt(Aw),Tw=g({},Rl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Wu}),Cw=Xt(Tw),Mw=g({},ws,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ow=Xt(Mw),kw=g({},Sr,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),zw=Xt(kw),jw=g({},ws,{newState:0,oldState:0}),Dw=Xt(jw),Rw=[9,13,27,32],Pu=ri&&"CompositionEvent"in window,Ll=null;ri&&"documentMode"in document&&(Ll=document.documentMode);var Bw=ri&&"TextEvent"in window&&!Ll,Vm=ri&&(!Pu||Ll&&8<Ll&&11>=Ll),Ym=" ",Gm=!1;function Xm(t,i){switch(t){case"keyup":return Rw.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Km(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var da=!1;function Lw(t,i){switch(t){case"compositionend":return Km(i);case"keypress":return i.which!==32?null:(Gm=!0,Ym);case"textInput":return t=i.data,t===Ym&&Gm?null:t;default:return null}}function $w(t,i){if(da)return t==="compositionend"||!Pu&&Xm(t,i)?(t=$m(),gr=Qu=Hi=null,da=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Vm&&i.locale!=="ko"?null:i.data;default:return null}}var Hw={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 Qm(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!Hw[t.type]:i==="textarea"}function Zm(t,i,l,r){ua?fa?fa.push(r):fa=[r]:ua=r,i=cc(i,"onChange"),0<i.length&&(l=new br("onChange","change",null,l,r),t.push({event:l,listeners:i}))}var $l=null,Hl=null;function Uw(t){ky(t,0)}function wr(t){var i=Ri(t);if(Ml(i))return t}function Fm(t,i){if(t==="change")return i}var Jm=!1;if(ri){var ef;if(ri){var tf="oninput"in document;if(!tf){var Wm=document.createElement("div");Wm.setAttribute("oninput","return;"),tf=typeof Wm.oninput=="function"}ef=tf}else ef=!1;Jm=ef&&(!document.documentMode||9<document.documentMode)}function Pm(){$l&&($l.detachEvent("onpropertychange",ep),Hl=$l=null)}function ep(t){if(t.propertyName==="value"&&wr(Hl)){var i=[];Zm(i,Hl,t,Gu(t)),Lm(Uw,i)}}function Iw(t,i,l){t==="focusin"?(Pm(),$l=i,Hl=l,$l.attachEvent("onpropertychange",ep)):t==="focusout"&&Pm()}function qw(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return wr(Hl)}function Vw(t,i){if(t==="click")return wr(i)}function Yw(t,i){if(t==="input"||t==="change")return wr(i)}function Gw(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var tn=typeof Object.is=="function"?Object.is:Gw;function Ul(t,i){if(tn(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var l=Object.keys(t),r=Object.keys(i);if(l.length!==r.length)return!1;for(r=0;r<l.length;r++){var f=l[r];if(!Nt.call(i,f)||!tn(t[f],i[f]))return!1}return!0}function tp(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function np(t,i){var l=tp(t);t=0;for(var r;l;){if(l.nodeType===3){if(r=t+l.textContent.length,t<=i&&r>=i)return{node:l,offset:i-t};t=r}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=tp(l)}}function ip(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?ip(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function sp(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=oa(t.document);i instanceof t.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)t=i.contentWindow;else break;i=oa(t.document)}return i}function nf(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var Xw=ri&&"documentMode"in document&&11>=document.documentMode,ha=null,sf=null,Il=null,af=!1;function ap(t,i,l){var r=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;af||ha==null||ha!==oa(r)||(r=ha,"selectionStart"in r&&nf(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Il&&Ul(Il,r)||(Il=r,r=cc(sf,"onSelect"),0<r.length&&(i=new br("onSelect","select",null,i,l),t.push({event:i,listeners:r}),i.target=ha)))}function xs(t,i){var l={};return l[t.toLowerCase()]=i.toLowerCase(),l["Webkit"+t]="webkit"+i,l["Moz"+t]="moz"+i,l}var ma={animationend:xs("Animation","AnimationEnd"),animationiteration:xs("Animation","AnimationIteration"),animationstart:xs("Animation","AnimationStart"),transitionrun:xs("Transition","TransitionRun"),transitionstart:xs("Transition","TransitionStart"),transitioncancel:xs("Transition","TransitionCancel"),transitionend:xs("Transition","TransitionEnd")},lf={},lp={};ri&&(lp=document.createElement("div").style,"AnimationEvent"in window||(delete ma.animationend.animation,delete ma.animationiteration.animation,delete ma.animationstart.animation),"TransitionEvent"in window||delete ma.transitionend.transition);function Es(t){if(lf[t])return lf[t];if(!ma[t])return t;var i=ma[t],l;for(l in i)if(i.hasOwnProperty(l)&&l in lp)return lf[t]=i[l];return t}var op=Es("animationend"),rp=Es("animationiteration"),cp=Es("animationstart"),Kw=Es("transitionrun"),Qw=Es("transitionstart"),Zw=Es("transitioncancel"),up=Es("transitionend"),fp=new Map,of="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(" ");of.push("scrollEnd");function Mn(t,i){fp.set(t,i),li(i,[t])}var xr=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},mn=[],pa=0,rf=0;function Er(){for(var t=pa,i=rf=pa=0;i<t;){var l=mn[i];mn[i++]=null;var r=mn[i];mn[i++]=null;var f=mn[i];mn[i++]=null;var m=mn[i];if(mn[i++]=null,r!==null&&f!==null){var b=r.pending;b===null?f.next=f:(f.next=b.next,b.next=f),r.pending=f}m!==0&&dp(l,f,m)}}function Nr(t,i,l,r){mn[pa++]=t,mn[pa++]=i,mn[pa++]=l,mn[pa++]=r,rf|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function cf(t,i,l,r){return Nr(t,i,l,r),_r(t)}function Ns(t,i){return Nr(t,null,null,i),_r(t)}function dp(t,i,l){t.lanes|=l;var r=t.alternate;r!==null&&(r.lanes|=l);for(var f=!1,m=t.return;m!==null;)m.childLanes|=l,r=m.alternate,r!==null&&(r.childLanes|=l),m.tag===22&&(t=m.stateNode,t===null||t._visibility&1||(f=!0)),t=m,m=m.return;return t.tag===3?(m=t.stateNode,f&&i!==null&&(f=31-Qe(l),t=m.hiddenUpdates,r=t[f],r===null?t[f]=[i]:r.push(i),i.lane=l|536870912),m):null}function _r(t){if(50<co)throw co=0,vd=null,Error(a(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var ga={};function Fw(t,i,l,r){this.tag=t,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=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function nn(t,i,l,r){return new Fw(t,i,l,r)}function uf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function ci(t,i){var l=t.alternate;return l===null?(l=nn(t.tag,i,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=i,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,i=t.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function hp(t,i){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,i=l.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function Ar(t,i,l,r,f,m){var b=0;if(r=t,typeof t=="function")uf(t)&&(b=1);else if(typeof t=="string")b=tE(t,l,ne.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case R:return t=nn(31,l,i,f),t.elementType=R,t.lanes=m,t;case N:return _s(l.children,f,m,i);case A:b=8,f|=24;break;case C:return t=nn(12,l,i,f|2),t.elementType=C,t.lanes=m,t;case B:return t=nn(13,l,i,f),t.elementType=B,t.lanes=m,t;case j:return t=nn(19,l,i,f),t.elementType=j,t.lanes=m,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case _:b=10;break e;case z:b=9;break e;case x:b=11;break e;case T:b=14;break e;case D:b=16,r=null;break e}b=29,l=Error(a(130,t===null?"null":typeof t,"")),r=null}return i=nn(b,l,i,f),i.elementType=t,i.type=r,i.lanes=m,i}function _s(t,i,l,r){return t=nn(7,t,r,i),t.lanes=l,t}function ff(t,i,l){return t=nn(6,t,null,i),t.lanes=l,t}function mp(t){var i=nn(18,null,null,0);return i.stateNode=t,i}function df(t,i,l){return i=nn(4,t.children!==null?t.children:[],t.key,i),i.lanes=l,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var pp=new WeakMap;function pn(t,i){if(typeof t=="object"&&t!==null){var l=pp.get(t);return l!==void 0?l:(i={value:t,source:i,stack:Bt(i)},pp.set(t,i),i)}return{value:t,source:i,stack:Bt(i)}}var ya=[],va=0,Tr=null,ql=0,gn=[],yn=0,Ui=null,Gn=1,Xn="";function ui(t,i){ya[va++]=ql,ya[va++]=Tr,Tr=t,ql=i}function gp(t,i,l){gn[yn++]=Gn,gn[yn++]=Xn,gn[yn++]=Ui,Ui=t;var r=Gn;t=Xn;var f=32-Qe(r)-1;r&=~(1<<f),l+=1;var m=32-Qe(i)+f;if(30<m){var b=f-f%5;m=(r&(1<<b)-1).toString(32),r>>=b,f-=b,Gn=1<<32-Qe(i)+f|l<<f|r,Xn=m+t}else Gn=1<<m|l<<f|r,Xn=t}function hf(t){t.return!==null&&(ui(t,1),gp(t,1,0))}function mf(t){for(;t===Tr;)Tr=ya[--va],ya[va]=null,ql=ya[--va],ya[va]=null;for(;t===Ui;)Ui=gn[--yn],gn[yn]=null,Xn=gn[--yn],gn[yn]=null,Gn=gn[--yn],gn[yn]=null}function yp(t,i){gn[yn++]=Gn,gn[yn++]=Xn,gn[yn++]=Ui,Gn=i.id,Xn=i.overflow,Ui=t}var Tt=null,Pe=null,De=!1,Ii=null,vn=!1,pf=Error(a(519));function qi(t){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vl(pn(i,t)),pf}function vp(t){var i=t.stateNode,l=t.type,r=t.memoizedProps;switch(i[wt]=t,i[zt]=r,l){case"dialog":ke("cancel",i),ke("close",i);break;case"iframe":case"object":case"embed":ke("load",i);break;case"video":case"audio":for(l=0;l<fo.length;l++)ke(fo[l],i);break;case"source":ke("error",i);break;case"img":case"image":case"link":ke("error",i),ke("load",i);break;case"details":ke("toggle",i);break;case"input":ke("invalid",i),ra(i,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":ke("invalid",i);break;case"textarea":ke("invalid",i),jm(i,r.value,r.defaultValue,r.children)}l=r.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||r.suppressHydrationWarning===!0||Ry(i.textContent,l)?(r.popover!=null&&(ke("beforetoggle",i),ke("toggle",i)),r.onScroll!=null&&ke("scroll",i),r.onScrollEnd!=null&&ke("scrollend",i),r.onClick!=null&&(i.onclick=oi),i=!0):i=!1,i||qi(t,!0)}function bp(t){for(Tt=t.return;Tt;)switch(Tt.tag){case 5:case 31:case 13:vn=!1;return;case 27:case 3:vn=!0;return;default:Tt=Tt.return}}function ba(t){if(t!==Tt)return!1;if(!De)return bp(t),De=!0,!1;var i=t.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||jd(t.type,t.memoizedProps)),l=!l),l&&Pe&&qi(t),bp(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Pe=Yy(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));Pe=Yy(t)}else i===27?(i=Pe,ns(t.type)?(t=$d,$d=null,Pe=t):Pe=i):Pe=Tt?Sn(t.stateNode.nextSibling):null;return!0}function As(){Pe=Tt=null,De=!1}function gf(){var t=Ii;return t!==null&&(Ft===null?Ft=t:Ft.push.apply(Ft,t),Ii=null),t}function Vl(t){Ii===null?Ii=[t]:Ii.push(t)}var yf=O(null),Ts=null,fi=null;function Vi(t,i,l){ee(yf,i._currentValue),i._currentValue=l}function di(t){t._currentValue=yf.current,I(yf)}function vf(t,i,l){for(;t!==null;){var r=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,r!==null&&(r.childLanes|=i)):r!==null&&(r.childLanes&i)!==i&&(r.childLanes|=i),t===l)break;t=t.return}}function bf(t,i,l,r){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var m=f.dependencies;if(m!==null){var b=f.child;m=m.firstContext;e:for(;m!==null;){var M=m;m=f;for(var U=0;U<i.length;U++)if(M.context===i[U]){m.lanes|=l,M=m.alternate,M!==null&&(M.lanes|=l),vf(m.return,l,t),r||(b=null);break e}m=M.next}}else if(f.tag===18){if(b=f.return,b===null)throw Error(a(341));b.lanes|=l,m=b.alternate,m!==null&&(m.lanes|=l),vf(b,l,t),b=null}else b=f.child;if(b!==null)b.return=f;else for(b=f;b!==null;){if(b===t){b=null;break}if(f=b.sibling,f!==null){f.return=b.return,b=f;break}b=b.return}f=b}}function Sa(t,i,l,r){t=null;for(var f=i,m=!1;f!==null;){if(!m){if((f.flags&524288)!==0)m=!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;tn(f.pendingProps.value,b.value)||(t!==null?t.push(M):t=[M])}}else if(f===ae.current){if(b=f.alternate,b===null)throw Error(a(387));b.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(yo):t=[yo])}f=f.return}t!==null&&bf(i,t,l,r),i.flags|=262144}function Cr(t){for(t=t.firstContext;t!==null;){if(!tn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Cs(t){Ts=t,fi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ct(t){return Sp(Ts,t)}function Mr(t,i){return Ts===null&&Cs(t),Sp(t,i)}function Sp(t,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},fi===null){if(t===null)throw Error(a(308));fi=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else fi=fi.next=i;return l}var Jw=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(l,r){t.push(r)}};this.abort=function(){i.aborted=!0,t.forEach(function(l){return l()})}},Ww=e.unstable_scheduleCallback,Pw=e.unstable_NormalPriority,pt={$$typeof:_,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Sf(){return{controller:new Jw,data:new Map,refCount:0}}function Yl(t){t.refCount--,t.refCount===0&&Ww(Pw,function(){t.controller.abort()})}var Gl=null,wf=0,wa=0,xa=null;function ex(t,i){if(Gl===null){var l=Gl=[];wf=0,wa=Nd(),xa={status:"pending",value:void 0,then:function(r){l.push(r)}}}return wf++,i.then(wp,wp),i}function wp(){if(--wf===0&&Gl!==null){xa!==null&&(xa.status="fulfilled");var t=Gl;Gl=null,wa=0,xa=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function tx(t,i){var l=[],r={status:"pending",value:null,reason:null,then:function(f){l.push(f)}};return t.then(function(){r.status="fulfilled",r.value=i;for(var f=0;f<l.length;f++)(0,l[f])(i)},function(f){for(r.status="rejected",r.reason=f,f=0;f<l.length;f++)(0,l[f])(void 0)}),r}var xp=k.S;k.S=function(t,i){ay=Ye(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&ex(t,i),xp!==null&&xp(t,i)};var Ms=O(null);function xf(){var t=Ms.current;return t!==null?t:Ze.pooledCache}function Or(t,i){i===null?ee(Ms,Ms.current):ee(Ms,i.pool)}function Ep(){var t=xf();return t===null?null:{parent:pt._currentValue,pool:t}}var Ea=Error(a(460)),Ef=Error(a(474)),kr=Error(a(542)),zr={then:function(){}};function Np(t){return t=t.status,t==="fulfilled"||t==="rejected"}function _p(t,i,l){switch(l=t[l],l===void 0?t.push(i):l!==i&&(i.then(oi,oi),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,Tp(t),t;default:if(typeof i.status=="string")i.then(oi,oi);else{if(t=Ze,t!==null&&100<t.shellSuspendCounter)throw Error(a(482));t=i,t.status="pending",t.then(function(r){if(i.status==="pending"){var f=i;f.status="fulfilled",f.value=r}},function(r){if(i.status==="pending"){var f=i;f.status="rejected",f.reason=r}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,Tp(t),t}throw ks=i,Ea}}function Os(t){try{var i=t._init;return i(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ks=l,Ea):l}}var ks=null;function Ap(){if(ks===null)throw Error(a(459));var t=ks;return ks=null,t}function Tp(t){if(t===Ea||t===kr)throw Error(a(483))}var Na=null,Xl=0;function jr(t){var i=Xl;return Xl+=1,Na===null&&(Na=[]),_p(Na,t,i)}function Kl(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function Dr(t,i){throw i.$$typeof===y?Error(a(525)):(t=Object.prototype.toString.call(i),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function Cp(t){function i(Q,V){if(t){var F=Q.deletions;F===null?(Q.deletions=[V],Q.flags|=16):F.push(V)}}function l(Q,V){if(!t)return null;for(;V!==null;)i(Q,V),V=V.sibling;return null}function r(Q){for(var V=new Map;Q!==null;)Q.key!==null?V.set(Q.key,Q):V.set(Q.index,Q),Q=Q.sibling;return V}function f(Q,V){return Q=ci(Q,V),Q.index=0,Q.sibling=null,Q}function m(Q,V,F){return Q.index=F,t?(F=Q.alternate,F!==null?(F=F.index,F<V?(Q.flags|=67108866,V):F):(Q.flags|=67108866,V)):(Q.flags|=1048576,V)}function b(Q){return t&&Q.alternate===null&&(Q.flags|=67108866),Q}function M(Q,V,F,re){return V===null||V.tag!==6?(V=ff(F,Q.mode,re),V.return=Q,V):(V=f(V,F),V.return=Q,V)}function U(Q,V,F,re){var be=F.type;return be===N?oe(Q,V,F.props.children,re,F.key):V!==null&&(V.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===D&&Os(be)===V.type)?(V=f(V,F.props),Kl(V,F),V.return=Q,V):(V=Ar(F.type,F.key,F.props,null,Q.mode,re),Kl(V,F),V.return=Q,V)}function J(Q,V,F,re){return V===null||V.tag!==4||V.stateNode.containerInfo!==F.containerInfo||V.stateNode.implementation!==F.implementation?(V=df(F,Q.mode,re),V.return=Q,V):(V=f(V,F.children||[]),V.return=Q,V)}function oe(Q,V,F,re,be){return V===null||V.tag!==7?(V=_s(F,Q.mode,re,be),V.return=Q,V):(V=f(V,F),V.return=Q,V)}function ce(Q,V,F){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=ff(""+V,Q.mode,F),V.return=Q,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case w:return F=Ar(V.type,V.key,V.props,null,Q.mode,F),Kl(F,V),F.return=Q,F;case E:return V=df(V,Q.mode,F),V.return=Q,V;case D:return V=Os(V),ce(Q,V,F)}if(G(V)||K(V))return V=_s(V,Q.mode,F,null),V.return=Q,V;if(typeof V.then=="function")return ce(Q,jr(V),F);if(V.$$typeof===_)return ce(Q,Mr(Q,V),F);Dr(Q,V)}return null}function P(Q,V,F,re){var be=V!==null?V.key:null;if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return be!==null?null:M(Q,V,""+F,re);if(typeof F=="object"&&F!==null){switch(F.$$typeof){case w:return F.key===be?U(Q,V,F,re):null;case E:return F.key===be?J(Q,V,F,re):null;case D:return F=Os(F),P(Q,V,F,re)}if(G(F)||K(F))return be!==null?null:oe(Q,V,F,re,null);if(typeof F.then=="function")return P(Q,V,jr(F),re);if(F.$$typeof===_)return P(Q,V,Mr(Q,F),re);Dr(Q,F)}return null}function se(Q,V,F,re,be){if(typeof re=="string"&&re!==""||typeof re=="number"||typeof re=="bigint")return Q=Q.get(F)||null,M(V,Q,""+re,be);if(typeof re=="object"&&re!==null){switch(re.$$typeof){case w:return Q=Q.get(re.key===null?F:re.key)||null,U(V,Q,re,be);case E:return Q=Q.get(re.key===null?F:re.key)||null,J(V,Q,re,be);case D:return re=Os(re),se(Q,V,F,re,be)}if(G(re)||K(re))return Q=Q.get(F)||null,oe(V,Q,re,be,null);if(typeof re.then=="function")return se(Q,V,F,jr(re),be);if(re.$$typeof===_)return se(Q,V,F,Mr(V,re),be);Dr(V,re)}return null}function pe(Q,V,F,re){for(var be=null,Le=null,ye=V,Ce=V=0,je=null;ye!==null&&Ce<F.length;Ce++){ye.index>Ce?(je=ye,ye=null):je=ye.sibling;var $e=P(Q,ye,F[Ce],re);if($e===null){ye===null&&(ye=je);break}t&&ye&&$e.alternate===null&&i(Q,ye),V=m($e,V,Ce),Le===null?be=$e:Le.sibling=$e,Le=$e,ye=je}if(Ce===F.length)return l(Q,ye),De&&ui(Q,Ce),be;if(ye===null){for(;Ce<F.length;Ce++)ye=ce(Q,F[Ce],re),ye!==null&&(V=m(ye,V,Ce),Le===null?be=ye:Le.sibling=ye,Le=ye);return De&&ui(Q,Ce),be}for(ye=r(ye);Ce<F.length;Ce++)je=se(ye,Q,Ce,F[Ce],re),je!==null&&(t&&je.alternate!==null&&ye.delete(je.key===null?Ce:je.key),V=m(je,V,Ce),Le===null?be=je:Le.sibling=je,Le=je);return t&&ye.forEach(function(os){return i(Q,os)}),De&&ui(Q,Ce),be}function xe(Q,V,F,re){if(F==null)throw Error(a(151));for(var be=null,Le=null,ye=V,Ce=V=0,je=null,$e=F.next();ye!==null&&!$e.done;Ce++,$e=F.next()){ye.index>Ce?(je=ye,ye=null):je=ye.sibling;var os=P(Q,ye,$e.value,re);if(os===null){ye===null&&(ye=je);break}t&&ye&&os.alternate===null&&i(Q,ye),V=m(os,V,Ce),Le===null?be=os:Le.sibling=os,Le=os,ye=je}if($e.done)return l(Q,ye),De&&ui(Q,Ce),be;if(ye===null){for(;!$e.done;Ce++,$e=F.next())$e=ce(Q,$e.value,re),$e!==null&&(V=m($e,V,Ce),Le===null?be=$e:Le.sibling=$e,Le=$e);return De&&ui(Q,Ce),be}for(ye=r(ye);!$e.done;Ce++,$e=F.next())$e=se(ye,Q,Ce,$e.value,re),$e!==null&&(t&&$e.alternate!==null&&ye.delete($e.key===null?Ce:$e.key),V=m($e,V,Ce),Le===null?be=$e:Le.sibling=$e,Le=$e);return t&&ye.forEach(function(dE){return i(Q,dE)}),De&&ui(Q,Ce),be}function Ke(Q,V,F,re){if(typeof F=="object"&&F!==null&&F.type===N&&F.key===null&&(F=F.props.children),typeof F=="object"&&F!==null){switch(F.$$typeof){case w:e:{for(var be=F.key;V!==null;){if(V.key===be){if(be=F.type,be===N){if(V.tag===7){l(Q,V.sibling),re=f(V,F.props.children),re.return=Q,Q=re;break e}}else if(V.elementType===be||typeof be=="object"&&be!==null&&be.$$typeof===D&&Os(be)===V.type){l(Q,V.sibling),re=f(V,F.props),Kl(re,F),re.return=Q,Q=re;break e}l(Q,V);break}else i(Q,V);V=V.sibling}F.type===N?(re=_s(F.props.children,Q.mode,re,F.key),re.return=Q,Q=re):(re=Ar(F.type,F.key,F.props,null,Q.mode,re),Kl(re,F),re.return=Q,Q=re)}return b(Q);case E:e:{for(be=F.key;V!==null;){if(V.key===be)if(V.tag===4&&V.stateNode.containerInfo===F.containerInfo&&V.stateNode.implementation===F.implementation){l(Q,V.sibling),re=f(V,F.children||[]),re.return=Q,Q=re;break e}else{l(Q,V);break}else i(Q,V);V=V.sibling}re=df(F,Q.mode,re),re.return=Q,Q=re}return b(Q);case D:return F=Os(F),Ke(Q,V,F,re)}if(G(F))return pe(Q,V,F,re);if(K(F)){if(be=K(F),typeof be!="function")throw Error(a(150));return F=be.call(F),xe(Q,V,F,re)}if(typeof F.then=="function")return Ke(Q,V,jr(F),re);if(F.$$typeof===_)return Ke(Q,V,Mr(Q,F),re);Dr(Q,F)}return typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint"?(F=""+F,V!==null&&V.tag===6?(l(Q,V.sibling),re=f(V,F),re.return=Q,Q=re):(l(Q,V),re=ff(F,Q.mode,re),re.return=Q,Q=re),b(Q)):l(Q,V)}return function(Q,V,F,re){try{Xl=0;var be=Ke(Q,V,F,re);return Na=null,be}catch(ye){if(ye===Ea||ye===kr)throw ye;var Le=nn(29,ye,null,Q.mode);return Le.lanes=re,Le.return=Q,Le}}}var zs=Cp(!0),Mp=Cp(!1),Yi=!1;function Nf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _f(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Gi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Xi(t,i,l){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(Ue&2)!==0){var f=r.pending;return f===null?i.next=i:(i.next=f.next,f.next=i),r.pending=i,i=_r(t),dp(t,null,l),i}return Nr(t,r,i,l),_r(t)}function Ql(t,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var r=i.lanes;r&=t.pendingLanes,l|=r,i.lanes=l,Ne(t,l)}}function Af(t,i){var l=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,l===r)){var f=null,m=null;if(l=l.firstBaseUpdate,l!==null){do{var b={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};m===null?f=m=b:m=m.next=b,l=l.next}while(l!==null);m===null?f=m=i:m=m.next=i}else f=m=i;l={baseState:r.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:r.shared,callbacks:r.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=i:t.next=i,l.lastBaseUpdate=i}var Tf=!1;function Zl(){if(Tf){var t=xa;if(t!==null)throw t}}function Fl(t,i,l,r){Tf=!1;var f=t.updateQueue;Yi=!1;var m=f.firstBaseUpdate,b=f.lastBaseUpdate,M=f.shared.pending;if(M!==null){f.shared.pending=null;var U=M,J=U.next;U.next=null,b===null?m=J:b.next=J,b=U;var oe=t.alternate;oe!==null&&(oe=oe.updateQueue,M=oe.lastBaseUpdate,M!==b&&(M===null?oe.firstBaseUpdate=J:M.next=J,oe.lastBaseUpdate=U))}if(m!==null){var ce=f.baseState;b=0,oe=J=U=null,M=m;do{var P=M.lane&-536870913,se=P!==M.lane;if(se?(ze&P)===P:(r&P)===P){P!==0&&P===wa&&(Tf=!0),oe!==null&&(oe=oe.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var pe=t,xe=M;P=i;var Ke=l;switch(xe.tag){case 1:if(pe=xe.payload,typeof pe=="function"){ce=pe.call(Ke,ce,P);break e}ce=pe;break e;case 3:pe.flags=pe.flags&-65537|128;case 0:if(pe=xe.payload,P=typeof pe=="function"?pe.call(Ke,ce,P):pe,P==null)break e;ce=g({},ce,P);break e;case 2:Yi=!0}}P=M.callback,P!==null&&(t.flags|=64,se&&(t.flags|=8192),se=f.callbacks,se===null?f.callbacks=[P]:se.push(P))}else se={lane:P,tag:M.tag,payload:M.payload,callback:M.callback,next:null},oe===null?(J=oe=se,U=ce):oe=oe.next=se,b|=P;if(M=M.next,M===null){if(M=f.shared.pending,M===null)break;se=M,M=se.next,se.next=null,f.lastBaseUpdate=se,f.shared.pending=null}}while(!0);oe===null&&(U=ce),f.baseState=U,f.firstBaseUpdate=J,f.lastBaseUpdate=oe,m===null&&(f.shared.lanes=0),Ji|=b,t.lanes=b,t.memoizedState=ce}}function Op(t,i){if(typeof t!="function")throw Error(a(191,t));t.call(i)}function kp(t,i){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Op(l[t],i)}var _a=O(null),Rr=O(0);function zp(t,i){t=wi,ee(Rr,t),ee(_a,i),wi=t|i.baseLanes}function Cf(){ee(Rr,wi),ee(_a,_a.current)}function Mf(){wi=Rr.current,I(_a),I(Rr)}var sn=O(null),bn=null;function Ki(t){var i=t.alternate;ee(ut,ut.current&1),ee(sn,t),bn===null&&(i===null||_a.current!==null||i.memoizedState!==null)&&(bn=t)}function Of(t){ee(ut,ut.current),ee(sn,t),bn===null&&(bn=t)}function jp(t){t.tag===22?(ee(ut,ut.current),ee(sn,t),bn===null&&(bn=t)):Qi()}function Qi(){ee(ut,ut.current),ee(sn,sn.current)}function an(t){I(sn),bn===t&&(bn=null),I(ut)}var ut=O(0);function Br(t){for(var i=t;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Bd(l)||Ld(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var hi=0,Te=null,Ge=null,gt=null,Lr=!1,Aa=!1,js=!1,$r=0,Jl=0,Ta=null,nx=0;function rt(){throw Error(a(321))}function kf(t,i){if(i===null)return!1;for(var l=0;l<i.length&&l<t.length;l++)if(!tn(t[l],i[l]))return!1;return!0}function zf(t,i,l,r,f,m){return hi=m,Te=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,k.H=t===null||t.memoizedState===null?gg:Kf,js=!1,m=l(r,f),js=!1,Aa&&(m=Rp(i,l,r,f)),Dp(t),m}function Dp(t){k.H=eo;var i=Ge!==null&&Ge.next!==null;if(hi=0,gt=Ge=Te=null,Lr=!1,Jl=0,Ta=null,i)throw Error(a(300));t===null||yt||(t=t.dependencies,t!==null&&Cr(t)&&(yt=!0))}function Rp(t,i,l,r){Te=t;var f=0;do{if(Aa&&(Ta=null),Jl=0,Aa=!1,25<=f)throw Error(a(301));if(f+=1,gt=Ge=null,t.updateQueue!=null){var m=t.updateQueue;m.lastEffect=null,m.events=null,m.stores=null,m.memoCache!=null&&(m.memoCache.index=0)}k.H=yg,m=i(l,r)}while(Aa);return m}function ix(){var t=k.H,i=t.useState()[0];return i=typeof i.then=="function"?Wl(i):i,t=t.useState()[0],(Ge!==null?Ge.memoizedState:null)!==t&&(Te.flags|=1024),i}function jf(){var t=$r!==0;return $r=0,t}function Df(t,i,l){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~l}function Rf(t){if(Lr){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}Lr=!1}hi=0,gt=Ge=Te=null,Aa=!1,Jl=$r=0,Ta=null}function Lt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gt===null?Te.memoizedState=gt=t:gt=gt.next=t,gt}function ft(){if(Ge===null){var t=Te.alternate;t=t!==null?t.memoizedState:null}else t=Ge.next;var i=gt===null?Te.memoizedState:gt.next;if(i!==null)gt=i,Ge=t;else{if(t===null)throw Te.alternate===null?Error(a(467)):Error(a(310));Ge=t,t={memoizedState:Ge.memoizedState,baseState:Ge.baseState,baseQueue:Ge.baseQueue,queue:Ge.queue,next:null},gt===null?Te.memoizedState=gt=t:gt=gt.next=t}return gt}function Hr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wl(t){var i=Jl;return Jl+=1,Ta===null&&(Ta=[]),t=_p(Ta,t,i),i=Te,(gt===null?i.memoizedState:gt.next)===null&&(i=i.alternate,k.H=i===null||i.memoizedState===null?gg:Kf),t}function Ur(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Wl(t);if(t.$$typeof===_)return Ct(t)}throw Error(a(438,String(t)))}function Bf(t){var i=null,l=Te.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var r=Te.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(i={data:r.data.map(function(f){return f.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=Hr(),Te.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(t),r=0;r<t;r++)l[r]=Z;return i.index++,l}function mi(t,i){return typeof i=="function"?i(t):i}function Ir(t){var i=ft();return Lf(i,Ge,t)}function Lf(t,i,l){var r=t.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=l;var f=t.baseQueue,m=r.pending;if(m!==null){if(f!==null){var b=f.next;f.next=m.next,m.next=b}i.baseQueue=f=m,r.pending=null}if(m=t.baseState,f===null)t.memoizedState=m;else{i=f.next;var M=b=null,U=null,J=i,oe=!1;do{var ce=J.lane&-536870913;if(ce!==J.lane?(ze&ce)===ce:(hi&ce)===ce){var P=J.revertLane;if(P===0)U!==null&&(U=U.next={lane:0,revertLane:0,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),ce===wa&&(oe=!0);else if((hi&P)===P){J=J.next,P===wa&&(oe=!0);continue}else ce={lane:0,revertLane:J.revertLane,gesture:null,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},U===null?(M=U=ce,b=m):U=U.next=ce,Te.lanes|=P,Ji|=P;ce=J.action,js&&l(m,ce),m=J.hasEagerState?J.eagerState:l(m,ce)}else P={lane:ce,revertLane:J.revertLane,gesture:J.gesture,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},U===null?(M=U=P,b=m):U=U.next=P,Te.lanes|=ce,Ji|=ce;J=J.next}while(J!==null&&J!==i);if(U===null?b=m:U.next=M,!tn(m,t.memoizedState)&&(yt=!0,oe&&(l=xa,l!==null)))throw l;t.memoizedState=m,t.baseState=b,t.baseQueue=U,r.lastRenderedState=m}return f===null&&(r.lanes=0),[t.memoizedState,r.dispatch]}function $f(t){var i=ft(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=t;var r=l.dispatch,f=l.pending,m=i.memoizedState;if(f!==null){l.pending=null;var b=f=f.next;do m=t(m,b.action),b=b.next;while(b!==f);tn(m,i.memoizedState)||(yt=!0),i.memoizedState=m,i.baseQueue===null&&(i.baseState=m),l.lastRenderedState=m}return[m,r]}function Bp(t,i,l){var r=Te,f=ft(),m=De;if(m){if(l===void 0)throw Error(a(407));l=l()}else l=i();var b=!tn((Ge||f).memoizedState,l);if(b&&(f.memoizedState=l,yt=!0),f=f.queue,If(Hp.bind(null,r,f,t),[t]),f.getSnapshot!==i||b||gt!==null&&gt.memoizedState.tag&1){if(r.flags|=2048,Ca(9,{destroy:void 0},$p.bind(null,r,f,l,i),null),Ze===null)throw Error(a(349));m||(hi&127)!==0||Lp(r,i,l)}return l}function Lp(t,i,l){t.flags|=16384,t={getSnapshot:i,value:l},i=Te.updateQueue,i===null?(i=Hr(),Te.updateQueue=i,i.stores=[t]):(l=i.stores,l===null?i.stores=[t]:l.push(t))}function $p(t,i,l,r){i.value=l,i.getSnapshot=r,Up(i)&&Ip(t)}function Hp(t,i,l){return l(function(){Up(i)&&Ip(t)})}function Up(t){var i=t.getSnapshot;t=t.value;try{var l=i();return!tn(t,l)}catch{return!0}}function Ip(t){var i=Ns(t,2);i!==null&&Jt(i,t,2)}function Hf(t){var i=Lt();if(typeof t=="function"){var l=t;if(t=l(),js){en(!0);try{l()}finally{en(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mi,lastRenderedState:t},i}function qp(t,i,l,r){return t.baseState=l,Lf(t,Ge,typeof r=="function"?r:mi)}function sx(t,i,l,r,f){if(Yr(t))throw Error(a(485));if(t=i.action,t!==null){var m={payload:f,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(b){m.listeners.push(b)}};k.T!==null?l(!0):m.isTransition=!1,r(m),l=i.pending,l===null?(m.next=i.pending=m,Vp(i,m)):(m.next=l.next,i.pending=l.next=m)}}function Vp(t,i){var l=i.action,r=i.payload,f=t.state;if(i.isTransition){var m=k.T,b={};k.T=b;try{var M=l(f,r),U=k.S;U!==null&&U(b,M),Yp(t,i,M)}catch(J){Uf(t,i,J)}finally{m!==null&&b.types!==null&&(m.types=b.types),k.T=m}}else try{m=l(f,r),Yp(t,i,m)}catch(J){Uf(t,i,J)}}function Yp(t,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(r){Gp(t,i,r)},function(r){return Uf(t,i,r)}):Gp(t,i,l)}function Gp(t,i,l){i.status="fulfilled",i.value=l,Xp(i),t.state=l,i=t.pending,i!==null&&(l=i.next,l===i?t.pending=null:(l=l.next,i.next=l,Vp(t,l)))}function Uf(t,i,l){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do i.status="rejected",i.reason=l,Xp(i),i=i.next;while(i!==r)}t.action=null}function Xp(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function Kp(t,i){return i}function Qp(t,i){if(De){var l=Ze.formState;if(l!==null){e:{var r=Te;if(De){if(Pe){t:{for(var f=Pe,m=vn;f.nodeType!==8;){if(!m){f=null;break t}if(f=Sn(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){Pe=Sn(f.nextSibling),r=f.data==="F!";break e}}qi(r)}r=!1}r&&(i=l[0])}}return l=Lt(),l.memoizedState=l.baseState=i,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kp,lastRenderedState:i},l.queue=r,l=hg.bind(null,Te,r),r.dispatch=l,r=Hf(!1),m=Xf.bind(null,Te,!1,r.queue),r=Lt(),f={state:i,dispatch:null,action:t,pending:null},r.queue=f,l=sx.bind(null,Te,f,m,l),f.dispatch=l,r.memoizedState=t,[i,l,!1]}function Zp(t){var i=ft();return Fp(i,Ge,t)}function Fp(t,i,l){if(i=Lf(t,i,Kp)[0],t=Ir(mi)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var r=Wl(i)}catch(b){throw b===Ea?kr:b}else r=i;i=ft();var f=i.queue,m=f.dispatch;return l!==i.memoizedState&&(Te.flags|=2048,Ca(9,{destroy:void 0},ax.bind(null,f,l),null)),[r,m,t]}function ax(t,i){t.action=i}function Jp(t){var i=ft(),l=Ge;if(l!==null)return Fp(i,l,t);ft(),i=i.memoizedState,l=ft();var r=l.queue.dispatch;return l.memoizedState=t,[i,r,!1]}function Ca(t,i,l,r){return t={tag:t,create:l,deps:r,inst:i,next:null},i=Te.updateQueue,i===null&&(i=Hr(),Te.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=t.next=t:(r=l.next,l.next=t,t.next=r,i.lastEffect=t),t}function Wp(){return ft().memoizedState}function qr(t,i,l,r){var f=Lt();Te.flags|=t,f.memoizedState=Ca(1|i,{destroy:void 0},l,r===void 0?null:r)}function Vr(t,i,l,r){var f=ft();r=r===void 0?null:r;var m=f.memoizedState.inst;Ge!==null&&r!==null&&kf(r,Ge.memoizedState.deps)?f.memoizedState=Ca(i,m,l,r):(Te.flags|=t,f.memoizedState=Ca(1|i,m,l,r))}function Pp(t,i){qr(8390656,8,t,i)}function If(t,i){Vr(2048,8,t,i)}function lx(t){Te.flags|=4;var i=Te.updateQueue;if(i===null)i=Hr(),Te.updateQueue=i,i.events=[t];else{var l=i.events;l===null?i.events=[t]:l.push(t)}}function eg(t){var i=ft().memoizedState;return lx({ref:i,nextImpl:t}),function(){if((Ue&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function tg(t,i){return Vr(4,2,t,i)}function ng(t,i){return Vr(4,4,t,i)}function ig(t,i){if(typeof i=="function"){t=t();var l=i(t);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function sg(t,i,l){l=l!=null?l.concat([t]):null,Vr(4,4,ig.bind(null,i,t),l)}function qf(){}function ag(t,i){var l=ft();i=i===void 0?null:i;var r=l.memoizedState;return i!==null&&kf(i,r[1])?r[0]:(l.memoizedState=[t,i],t)}function lg(t,i){var l=ft();i=i===void 0?null:i;var r=l.memoizedState;if(i!==null&&kf(i,r[1]))return r[0];if(r=t(),js){en(!0);try{t()}finally{en(!1)}}return l.memoizedState=[r,i],r}function Vf(t,i,l){return l===void 0||(hi&1073741824)!==0&&(ze&261930)===0?t.memoizedState=i:(t.memoizedState=l,t=oy(),Te.lanes|=t,Ji|=t,l)}function og(t,i,l,r){return tn(l,i)?l:_a.current!==null?(t=Vf(t,l,r),tn(t,i)||(yt=!0),t):(hi&42)===0||(hi&1073741824)!==0&&(ze&261930)===0?(yt=!0,t.memoizedState=l):(t=oy(),Te.lanes|=t,Ji|=t,i)}function rg(t,i,l,r,f){var m=$.p;$.p=m!==0&&8>m?m:8;var b=k.T,M={};k.T=M,Xf(t,!1,i,l);try{var U=f(),J=k.S;if(J!==null&&J(M,U),U!==null&&typeof U=="object"&&typeof U.then=="function"){var oe=tx(U,r);Pl(t,i,oe,rn(t))}else Pl(t,i,r,rn(t))}catch(ce){Pl(t,i,{then:function(){},status:"rejected",reason:ce},rn())}finally{$.p=m,b!==null&&M.types!==null&&(b.types=M.types),k.T=b}}function ox(){}function Yf(t,i,l,r){if(t.tag!==5)throw Error(a(476));var f=cg(t).queue;rg(t,f,i,H,l===null?ox:function(){return ug(t),l(r)})}function cg(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mi,lastRenderedState:H},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mi,lastRenderedState:l},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function ug(t){var i=cg(t);i.next===null&&(i=t.alternate.memoizedState),Pl(t,i.next.queue,{},rn())}function Gf(){return Ct(yo)}function fg(){return ft().memoizedState}function dg(){return ft().memoizedState}function rx(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var l=rn();t=Gi(l);var r=Xi(i,t,l);r!==null&&(Jt(r,i,l),Ql(r,i,l)),i={cache:Sf()},t.payload=i;return}i=i.return}}function cx(t,i,l){var r=rn();l={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Yr(t)?mg(i,l):(l=cf(t,i,l,r),l!==null&&(Jt(l,t,r),pg(l,i,r)))}function hg(t,i,l){var r=rn();Pl(t,i,l,r)}function Pl(t,i,l,r){var f={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Yr(t))mg(i,f);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=i.lastRenderedReducer,m!==null))try{var b=i.lastRenderedState,M=m(b,l);if(f.hasEagerState=!0,f.eagerState=M,tn(M,b))return Nr(t,i,f,0),Ze===null&&Er(),!1}catch{}if(l=cf(t,i,f,r),l!==null)return Jt(l,t,r),pg(l,i,r),!0}return!1}function Xf(t,i,l,r){if(r={lane:2,revertLane:Nd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Yr(t)){if(i)throw Error(a(479))}else i=cf(t,l,r,2),i!==null&&Jt(i,t,2)}function Yr(t){var i=t.alternate;return t===Te||i!==null&&i===Te}function mg(t,i){Aa=Lr=!0;var l=t.pending;l===null?i.next=i:(i.next=l.next,l.next=i),t.pending=i}function pg(t,i,l){if((l&4194048)!==0){var r=i.lanes;r&=t.pendingLanes,l|=r,i.lanes=l,Ne(t,l)}}var eo={readContext:Ct,use:Ur,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useLayoutEffect:rt,useInsertionEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useSyncExternalStore:rt,useId:rt,useHostTransitionStatus:rt,useFormState:rt,useActionState:rt,useOptimistic:rt,useMemoCache:rt,useCacheRefresh:rt};eo.useEffectEvent=rt;var gg={readContext:Ct,use:Ur,useCallback:function(t,i){return Lt().memoizedState=[t,i===void 0?null:i],t},useContext:Ct,useEffect:Pp,useImperativeHandle:function(t,i,l){l=l!=null?l.concat([t]):null,qr(4194308,4,ig.bind(null,i,t),l)},useLayoutEffect:function(t,i){return qr(4194308,4,t,i)},useInsertionEffect:function(t,i){qr(4,2,t,i)},useMemo:function(t,i){var l=Lt();i=i===void 0?null:i;var r=t();if(js){en(!0);try{t()}finally{en(!1)}}return l.memoizedState=[r,i],r},useReducer:function(t,i,l){var r=Lt();if(l!==void 0){var f=l(i);if(js){en(!0);try{l(i)}finally{en(!1)}}}else f=i;return r.memoizedState=r.baseState=f,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:f},r.queue=t,t=t.dispatch=cx.bind(null,Te,t),[r.memoizedState,t]},useRef:function(t){var i=Lt();return t={current:t},i.memoizedState=t},useState:function(t){t=Hf(t);var i=t.queue,l=hg.bind(null,Te,i);return i.dispatch=l,[t.memoizedState,l]},useDebugValue:qf,useDeferredValue:function(t,i){var l=Lt();return Vf(l,t,i)},useTransition:function(){var t=Hf(!1);return t=rg.bind(null,Te,t.queue,!0,!1),Lt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,l){var r=Te,f=Lt();if(De){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),Ze===null)throw Error(a(349));(ze&127)!==0||Lp(r,i,l)}f.memoizedState=l;var m={value:l,getSnapshot:i};return f.queue=m,Pp(Hp.bind(null,r,m,t),[t]),r.flags|=2048,Ca(9,{destroy:void 0},$p.bind(null,r,m,l,i),null),l},useId:function(){var t=Lt(),i=Ze.identifierPrefix;if(De){var l=Xn,r=Gn;l=(r&~(1<<32-Qe(r)-1)).toString(32)+l,i="_"+i+"R_"+l,l=$r++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=nx++,i="_"+i+"r_"+l.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:Gf,useFormState:Qp,useActionState:Qp,useOptimistic:function(t){var i=Lt();i.memoizedState=i.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=Xf.bind(null,Te,!0,l),l.dispatch=i,[t,i]},useMemoCache:Bf,useCacheRefresh:function(){return Lt().memoizedState=rx.bind(null,Te)},useEffectEvent:function(t){var i=Lt(),l={impl:t};return i.memoizedState=l,function(){if((Ue&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Kf={readContext:Ct,use:Ur,useCallback:ag,useContext:Ct,useEffect:If,useImperativeHandle:sg,useInsertionEffect:tg,useLayoutEffect:ng,useMemo:lg,useReducer:Ir,useRef:Wp,useState:function(){return Ir(mi)},useDebugValue:qf,useDeferredValue:function(t,i){var l=ft();return og(l,Ge.memoizedState,t,i)},useTransition:function(){var t=Ir(mi)[0],i=ft().memoizedState;return[typeof t=="boolean"?t:Wl(t),i]},useSyncExternalStore:Bp,useId:fg,useHostTransitionStatus:Gf,useFormState:Zp,useActionState:Zp,useOptimistic:function(t,i){var l=ft();return qp(l,Ge,t,i)},useMemoCache:Bf,useCacheRefresh:dg};Kf.useEffectEvent=eg;var yg={readContext:Ct,use:Ur,useCallback:ag,useContext:Ct,useEffect:If,useImperativeHandle:sg,useInsertionEffect:tg,useLayoutEffect:ng,useMemo:lg,useReducer:$f,useRef:Wp,useState:function(){return $f(mi)},useDebugValue:qf,useDeferredValue:function(t,i){var l=ft();return Ge===null?Vf(l,t,i):og(l,Ge.memoizedState,t,i)},useTransition:function(){var t=$f(mi)[0],i=ft().memoizedState;return[typeof t=="boolean"?t:Wl(t),i]},useSyncExternalStore:Bp,useId:fg,useHostTransitionStatus:Gf,useFormState:Jp,useActionState:Jp,useOptimistic:function(t,i){var l=ft();return Ge!==null?qp(l,Ge,t,i):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Bf,useCacheRefresh:dg};yg.useEffectEvent=eg;function Qf(t,i,l,r){i=t.memoizedState,l=l(r,i),l=l==null?i:g({},i,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Zf={enqueueSetState:function(t,i,l){t=t._reactInternals;var r=rn(),f=Gi(r);f.payload=i,l!=null&&(f.callback=l),i=Xi(t,f,r),i!==null&&(Jt(i,t,r),Ql(i,t,r))},enqueueReplaceState:function(t,i,l){t=t._reactInternals;var r=rn(),f=Gi(r);f.tag=1,f.payload=i,l!=null&&(f.callback=l),i=Xi(t,f,r),i!==null&&(Jt(i,t,r),Ql(i,t,r))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var l=rn(),r=Gi(l);r.tag=2,i!=null&&(r.callback=i),i=Xi(t,r,l),i!==null&&(Jt(i,t,l),Ql(i,t,l))}};function vg(t,i,l,r,f,m,b){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,m,b):i.prototype&&i.prototype.isPureReactComponent?!Ul(l,r)||!Ul(f,m):!0}function bg(t,i,l,r){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,r),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,r),i.state!==t&&Zf.enqueueReplaceState(i,i.state,null)}function Ds(t,i){var l=i;if("ref"in i){l={};for(var r in i)r!=="ref"&&(l[r]=i[r])}if(t=t.defaultProps){l===i&&(l=g({},l));for(var f in t)l[f]===void 0&&(l[f]=t[f])}return l}function Sg(t){xr(t)}function wg(t){console.error(t)}function xg(t){xr(t)}function Gr(t,i){try{var l=t.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(r){setTimeout(function(){throw r})}}function Eg(t,i,l){try{var r=t.onCaughtError;r(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Ff(t,i,l){return l=Gi(l),l.tag=3,l.payload={element:null},l.callback=function(){Gr(t,i)},l}function Ng(t){return t=Gi(t),t.tag=3,t}function _g(t,i,l,r){var f=l.type.getDerivedStateFromError;if(typeof f=="function"){var m=r.value;t.payload=function(){return f(m)},t.callback=function(){Eg(i,l,r)}}var b=l.stateNode;b!==null&&typeof b.componentDidCatch=="function"&&(t.callback=function(){Eg(i,l,r),typeof f!="function"&&(Wi===null?Wi=new Set([this]):Wi.add(this));var M=r.stack;this.componentDidCatch(r.value,{componentStack:M!==null?M:""})})}function ux(t,i,l,r,f){if(l.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(i=l.alternate,i!==null&&Sa(i,l,f,!0),l=sn.current,l!==null){switch(l.tag){case 31:case 13:return bn===null?ic():l.alternate===null&&ct===0&&(ct=3),l.flags&=-257,l.flags|=65536,l.lanes=f,r===zr?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([r]):i.add(r),wd(t,r,f)),!1;case 22:return l.flags|=65536,r===zr?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([r])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([r]):l.add(r)),wd(t,r,f)),!1}throw Error(a(435,l.tag))}return wd(t,r,f),ic(),!1}if(De)return i=sn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=f,r!==pf&&(t=Error(a(422),{cause:r}),Vl(pn(t,l)))):(r!==pf&&(i=Error(a(423),{cause:r}),Vl(pn(i,l))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,r=pn(r,l),f=Ff(t.stateNode,r,f),Af(t,f),ct!==4&&(ct=2)),!1;var m=Error(a(520),{cause:r});if(m=pn(m,l),ro===null?ro=[m]:ro.push(m),ct!==4&&(ct=2),i===null)return!0;r=pn(r,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,t=f&-f,l.lanes|=t,t=Ff(l.stateNode,r,t),Af(l,t),!1;case 1:if(i=l.type,m=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||m!==null&&typeof m.componentDidCatch=="function"&&(Wi===null||!Wi.has(m))))return l.flags|=65536,f&=-f,l.lanes|=f,f=Ng(f),_g(f,t,l,r),Af(l,f),!1}l=l.return}while(l!==null);return!1}var Jf=Error(a(461)),yt=!1;function Mt(t,i,l,r){i.child=t===null?Mp(i,null,l,r):zs(i,t.child,l,r)}function Ag(t,i,l,r,f){l=l.render;var m=i.ref;if("ref"in r){var b={};for(var M in r)M!=="ref"&&(b[M]=r[M])}else b=r;return Cs(i),r=zf(t,i,l,b,m,f),M=jf(),t!==null&&!yt?(Df(t,i,f),pi(t,i,f)):(De&&M&&hf(i),i.flags|=1,Mt(t,i,r,f),i.child)}function Tg(t,i,l,r,f){if(t===null){var m=l.type;return typeof m=="function"&&!uf(m)&&m.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=m,Cg(t,i,m,r,f)):(t=Ar(l.type,null,r,i,i.mode,f),t.ref=i.ref,t.return=i,i.child=t)}if(m=t.child,!ad(t,f)){var b=m.memoizedProps;if(l=l.compare,l=l!==null?l:Ul,l(b,r)&&t.ref===i.ref)return pi(t,i,f)}return i.flags|=1,t=ci(m,r),t.ref=i.ref,t.return=i,i.child=t}function Cg(t,i,l,r,f){if(t!==null){var m=t.memoizedProps;if(Ul(m,r)&&t.ref===i.ref)if(yt=!1,i.pendingProps=r=m,ad(t,f))(t.flags&131072)!==0&&(yt=!0);else return i.lanes=t.lanes,pi(t,i,f)}return Wf(t,i,l,r,f)}function Mg(t,i,l,r){var f=r.children,m=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((i.flags&128)!==0){if(m=m!==null?m.baseLanes|l:l,t!==null){for(r=i.child=t.child,f=0;r!==null;)f=f|r.lanes|r.childLanes,r=r.sibling;r=f&~m}else r=0,i.child=null;return Og(t,i,m,l,r)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&Or(i,m!==null?m.cachePool:null),m!==null?zp(i,m):Cf(),jp(i);else return r=i.lanes=536870912,Og(t,i,m!==null?m.baseLanes|l:l,l,r)}else m!==null?(Or(i,m.cachePool),zp(i,m),Qi(),i.memoizedState=null):(t!==null&&Or(i,null),Cf(),Qi());return Mt(t,i,f,l),i.child}function to(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Og(t,i,l,r,f){var m=xf();return m=m===null?null:{parent:pt._currentValue,pool:m},i.memoizedState={baseLanes:l,cachePool:m},t!==null&&Or(i,null),Cf(),jp(i),t!==null&&Sa(t,i,r,!0),i.childLanes=f,null}function Xr(t,i){return i=Qr({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function kg(t,i,l){return zs(i,t.child,null,l),t=Xr(i,i.pendingProps),t.flags|=2,an(i),i.memoizedState=null,t}function fx(t,i,l){var r=i.pendingProps,f=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(De){if(r.mode==="hidden")return t=Xr(i,r),i.lanes=536870912,to(null,t);if(Of(i),(t=Pe)?(t=Vy(t,vn),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Ui!==null?{id:Gn,overflow:Xn}:null,retryLane:536870912,hydrationErrors:null},l=mp(t),l.return=i,i.child=l,Tt=i,Pe=null)):t=null,t===null)throw qi(i);return i.lanes=536870912,null}return Xr(i,r)}var m=t.memoizedState;if(m!==null){var b=m.dehydrated;if(Of(i),f)if(i.flags&256)i.flags&=-257,i=kg(t,i,l);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(a(558));else if(yt||Sa(t,i,l,!1),f=(l&t.childLanes)!==0,yt||f){if(r=Ze,r!==null&&(b=Je(r,l),b!==0&&b!==m.retryLane))throw m.retryLane=b,Ns(t,b),Jt(r,t,b),Jf;ic(),i=kg(t,i,l)}else t=m.treeContext,Pe=Sn(b.nextSibling),Tt=i,De=!0,Ii=null,vn=!1,t!==null&&yp(i,t),i=Xr(i,r),i.flags|=4096;return i}return t=ci(t.child,{mode:r.mode,children:r.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Kr(t,i){var l=i.ref;if(l===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(t===null||t.ref!==l)&&(i.flags|=4194816)}}function Wf(t,i,l,r,f){return Cs(i),l=zf(t,i,l,r,void 0,f),r=jf(),t!==null&&!yt?(Df(t,i,f),pi(t,i,f)):(De&&r&&hf(i),i.flags|=1,Mt(t,i,l,f),i.child)}function zg(t,i,l,r,f,m){return Cs(i),i.updateQueue=null,l=Rp(i,r,l,f),Dp(t),r=jf(),t!==null&&!yt?(Df(t,i,m),pi(t,i,m)):(De&&r&&hf(i),i.flags|=1,Mt(t,i,l,m),i.child)}function jg(t,i,l,r,f){if(Cs(i),i.stateNode===null){var m=ga,b=l.contextType;typeof b=="object"&&b!==null&&(m=Ct(b)),m=new l(r,m),i.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Zf,i.stateNode=m,m._reactInternals=i,m=i.stateNode,m.props=r,m.state=i.memoizedState,m.refs={},Nf(i),b=l.contextType,m.context=typeof b=="object"&&b!==null?Ct(b):ga,m.state=i.memoizedState,b=l.getDerivedStateFromProps,typeof b=="function"&&(Qf(i,l,b,r),m.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(b=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),b!==m.state&&Zf.enqueueReplaceState(m,m.state,null),Fl(i,r,m,f),Zl(),m.state=i.memoizedState),typeof m.componentDidMount=="function"&&(i.flags|=4194308),r=!0}else if(t===null){m=i.stateNode;var M=i.memoizedProps,U=Ds(l,M);m.props=U;var J=m.context,oe=l.contextType;b=ga,typeof oe=="object"&&oe!==null&&(b=Ct(oe));var ce=l.getDerivedStateFromProps;oe=typeof ce=="function"||typeof m.getSnapshotBeforeUpdate=="function",M=i.pendingProps!==M,oe||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(M||J!==b)&&bg(i,m,r,b),Yi=!1;var P=i.memoizedState;m.state=P,Fl(i,r,m,f),Zl(),J=i.memoizedState,M||P!==J||Yi?(typeof ce=="function"&&(Qf(i,l,ce,r),J=i.memoizedState),(U=Yi||vg(i,l,U,r,P,J,b))?(oe||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount()),typeof m.componentDidMount=="function"&&(i.flags|=4194308)):(typeof m.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=r,i.memoizedState=J),m.props=r,m.state=J,m.context=b,r=U):(typeof m.componentDidMount=="function"&&(i.flags|=4194308),r=!1)}else{m=i.stateNode,_f(t,i),b=i.memoizedProps,oe=Ds(l,b),m.props=oe,ce=i.pendingProps,P=m.context,J=l.contextType,U=ga,typeof J=="object"&&J!==null&&(U=Ct(J)),M=l.getDerivedStateFromProps,(J=typeof M=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(b!==ce||P!==U)&&bg(i,m,r,U),Yi=!1,P=i.memoizedState,m.state=P,Fl(i,r,m,f),Zl();var se=i.memoizedState;b!==ce||P!==se||Yi||t!==null&&t.dependencies!==null&&Cr(t.dependencies)?(typeof M=="function"&&(Qf(i,l,M,r),se=i.memoizedState),(oe=Yi||vg(i,l,oe,r,P,se,U)||t!==null&&t.dependencies!==null&&Cr(t.dependencies))?(J||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(r,se,U),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(r,se,U)),typeof m.componentDidUpdate=="function"&&(i.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof m.componentDidUpdate!="function"||b===t.memoizedProps&&P===t.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&P===t.memoizedState||(i.flags|=1024),i.memoizedProps=r,i.memoizedState=se),m.props=r,m.state=se,m.context=U,r=oe):(typeof m.componentDidUpdate!="function"||b===t.memoizedProps&&P===t.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||b===t.memoizedProps&&P===t.memoizedState||(i.flags|=1024),r=!1)}return m=r,Kr(t,i),r=(i.flags&128)!==0,m||r?(m=i.stateNode,l=r&&typeof l.getDerivedStateFromError!="function"?null:m.render(),i.flags|=1,t!==null&&r?(i.child=zs(i,t.child,null,f),i.child=zs(i,null,l,f)):Mt(t,i,l,f),i.memoizedState=m.state,t=i.child):t=pi(t,i,f),t}function Dg(t,i,l,r){return As(),i.flags|=256,Mt(t,i,l,r),i.child}var Pf={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ed(t){return{baseLanes:t,cachePool:Ep()}}function td(t,i,l){return t=t!==null?t.childLanes&~l:0,i&&(t|=on),t}function Rg(t,i,l){var r=i.pendingProps,f=!1,m=(i.flags&128)!==0,b;if((b=m)||(b=t!==null&&t.memoizedState===null?!1:(ut.current&2)!==0),b&&(f=!0,i.flags&=-129),b=(i.flags&32)!==0,i.flags&=-33,t===null){if(De){if(f?Ki(i):Qi(),(t=Pe)?(t=Vy(t,vn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Ui!==null?{id:Gn,overflow:Xn}:null,retryLane:536870912,hydrationErrors:null},l=mp(t),l.return=i,i.child=l,Tt=i,Pe=null)):t=null,t===null)throw qi(i);return Ld(t)?i.lanes=32:i.lanes=536870912,null}var M=r.children;return r=r.fallback,f?(Qi(),f=i.mode,M=Qr({mode:"hidden",children:M},f),r=_s(r,f,l,null),M.return=i,r.return=i,M.sibling=r,i.child=M,r=i.child,r.memoizedState=ed(l),r.childLanes=td(t,b,l),i.memoizedState=Pf,to(null,r)):(Ki(i),nd(i,M))}var U=t.memoizedState;if(U!==null&&(M=U.dehydrated,M!==null)){if(m)i.flags&256?(Ki(i),i.flags&=-257,i=id(t,i,l)):i.memoizedState!==null?(Qi(),i.child=t.child,i.flags|=128,i=null):(Qi(),M=r.fallback,f=i.mode,r=Qr({mode:"visible",children:r.children},f),M=_s(M,f,l,null),M.flags|=2,r.return=i,M.return=i,r.sibling=M,i.child=r,zs(i,t.child,null,l),r=i.child,r.memoizedState=ed(l),r.childLanes=td(t,b,l),i.memoizedState=Pf,i=to(null,r));else if(Ki(i),Ld(M)){if(b=M.nextSibling&&M.nextSibling.dataset,b)var J=b.dgst;b=J,r=Error(a(419)),r.stack="",r.digest=b,Vl({value:r,source:null,stack:null}),i=id(t,i,l)}else if(yt||Sa(t,i,l,!1),b=(l&t.childLanes)!==0,yt||b){if(b=Ze,b!==null&&(r=Je(b,l),r!==0&&r!==U.retryLane))throw U.retryLane=r,Ns(t,r),Jt(b,t,r),Jf;Bd(M)||ic(),i=id(t,i,l)}else Bd(M)?(i.flags|=192,i.child=t.child,i=null):(t=U.treeContext,Pe=Sn(M.nextSibling),Tt=i,De=!0,Ii=null,vn=!1,t!==null&&yp(i,t),i=nd(i,r.children),i.flags|=4096);return i}return f?(Qi(),M=r.fallback,f=i.mode,U=t.child,J=U.sibling,r=ci(U,{mode:"hidden",children:r.children}),r.subtreeFlags=U.subtreeFlags&65011712,J!==null?M=ci(J,M):(M=_s(M,f,l,null),M.flags|=2),M.return=i,r.return=i,r.sibling=M,i.child=r,to(null,r),r=i.child,M=t.child.memoizedState,M===null?M=ed(l):(f=M.cachePool,f!==null?(U=pt._currentValue,f=f.parent!==U?{parent:U,pool:U}:f):f=Ep(),M={baseLanes:M.baseLanes|l,cachePool:f}),r.memoizedState=M,r.childLanes=td(t,b,l),i.memoizedState=Pf,to(t.child,r)):(Ki(i),l=t.child,t=l.sibling,l=ci(l,{mode:"visible",children:r.children}),l.return=i,l.sibling=null,t!==null&&(b=i.deletions,b===null?(i.deletions=[t],i.flags|=16):b.push(t)),i.child=l,i.memoizedState=null,l)}function nd(t,i){return i=Qr({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function Qr(t,i){return t=nn(22,t,null,i),t.lanes=0,t}function id(t,i,l){return zs(i,t.child,null,l),t=nd(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function Bg(t,i,l){t.lanes|=i;var r=t.alternate;r!==null&&(r.lanes|=i),vf(t.return,i,l)}function sd(t,i,l,r,f,m){var b=t.memoizedState;b===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:r,tail:l,tailMode:f,treeForkCount:m}:(b.isBackwards=i,b.rendering=null,b.renderingStartTime=0,b.last=r,b.tail=l,b.tailMode=f,b.treeForkCount=m)}function Lg(t,i,l){var r=i.pendingProps,f=r.revealOrder,m=r.tail;r=r.children;var b=ut.current,M=(b&2)!==0;if(M?(b=b&1|2,i.flags|=128):b&=1,ee(ut,b),Mt(t,i,r,l),r=De?ql:0,!M&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Bg(t,l,i);else if(t.tag===19)Bg(t,l,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(f){case"forwards":for(l=i.child,f=null;l!==null;)t=l.alternate,t!==null&&Br(t)===null&&(f=l),l=l.sibling;l=f,l===null?(f=i.child,i.child=null):(f=l.sibling,l.sibling=null),sd(i,!1,f,l,m,r);break;case"backwards":case"unstable_legacy-backwards":for(l=null,f=i.child,i.child=null;f!==null;){if(t=f.alternate,t!==null&&Br(t)===null){i.child=f;break}t=f.sibling,f.sibling=l,l=f,f=t}sd(i,!0,l,null,m,r);break;case"together":sd(i,!1,null,null,void 0,r);break;default:i.memoizedState=null}return i.child}function pi(t,i,l){if(t!==null&&(i.dependencies=t.dependencies),Ji|=i.lanes,(l&i.childLanes)===0)if(t!==null){if(Sa(t,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(a(153));if(i.child!==null){for(t=i.child,l=ci(t,t.pendingProps),i.child=l,l.return=i;t.sibling!==null;)t=t.sibling,l=l.sibling=ci(t,t.pendingProps),l.return=i;l.sibling=null}return i.child}function ad(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&Cr(t)))}function dx(t,i,l){switch(i.tag){case 3:te(i,i.stateNode.containerInfo),Vi(i,pt,t.memoizedState.cache),As();break;case 27:case 5:Se(i);break;case 4:te(i,i.stateNode.containerInfo);break;case 10:Vi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,Of(i),null;break;case 13:var r=i.memoizedState;if(r!==null)return r.dehydrated!==null?(Ki(i),i.flags|=128,null):(l&i.child.childLanes)!==0?Rg(t,i,l):(Ki(i),t=pi(t,i,l),t!==null?t.sibling:null);Ki(i);break;case 19:var f=(t.flags&128)!==0;if(r=(l&i.childLanes)!==0,r||(Sa(t,i,l,!1),r=(l&i.childLanes)!==0),f){if(r)return Lg(t,i,l);i.flags|=128}if(f=i.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),ee(ut,ut.current),r)break;return null;case 22:return i.lanes=0,Mg(t,i,l,i.pendingProps);case 24:Vi(i,pt,t.memoizedState.cache)}return pi(t,i,l)}function $g(t,i,l){if(t!==null)if(t.memoizedProps!==i.pendingProps)yt=!0;else{if(!ad(t,l)&&(i.flags&128)===0)return yt=!1,dx(t,i,l);yt=(t.flags&131072)!==0}else yt=!1,De&&(i.flags&1048576)!==0&&gp(i,ql,i.index);switch(i.lanes=0,i.tag){case 16:e:{var r=i.pendingProps;if(t=Os(i.elementType),i.type=t,typeof t=="function")uf(t)?(r=Ds(t,r),i.tag=1,i=jg(null,i,t,r,l)):(i.tag=0,i=Wf(null,i,t,r,l));else{if(t!=null){var f=t.$$typeof;if(f===x){i.tag=11,i=Ag(null,i,t,r,l);break e}else if(f===T){i.tag=14,i=Tg(null,i,t,r,l);break e}}throw i=L(t)||t,Error(a(306,i,""))}}return i;case 0:return Wf(t,i,i.type,i.pendingProps,l);case 1:return r=i.type,f=Ds(r,i.pendingProps),jg(t,i,r,f,l);case 3:e:{if(te(i,i.stateNode.containerInfo),t===null)throw Error(a(387));r=i.pendingProps;var m=i.memoizedState;f=m.element,_f(t,i),Fl(i,r,null,l);var b=i.memoizedState;if(r=b.cache,Vi(i,pt,r),r!==m.cache&&bf(i,[pt],l,!0),Zl(),r=b.element,m.isDehydrated)if(m={element:r,isDehydrated:!1,cache:b.cache},i.updateQueue.baseState=m,i.memoizedState=m,i.flags&256){i=Dg(t,i,r,l);break e}else if(r!==f){f=pn(Error(a(424)),i),Vl(f),i=Dg(t,i,r,l);break e}else for(t=i.stateNode.containerInfo,t.nodeType===9?t=t.body:t=t.nodeName==="HTML"?t.ownerDocument.body:t,Pe=Sn(t.firstChild),Tt=i,De=!0,Ii=null,vn=!0,l=Mp(i,null,r,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(As(),r===f){i=pi(t,i,l);break e}Mt(t,i,r,l)}i=i.child}return i;case 26:return Kr(t,i),t===null?(l=Zy(i.type,null,i.pendingProps,null))?i.memoizedState=l:De||(l=i.type,t=i.pendingProps,r=uc(de.current).createElement(l),r[wt]=i,r[zt]=t,Ot(r,l,t),mt(r),i.stateNode=r):i.memoizedState=Zy(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return Se(i),t===null&&De&&(r=i.stateNode=Xy(i.type,i.pendingProps,de.current),Tt=i,vn=!0,f=Pe,ns(i.type)?($d=f,Pe=Sn(r.firstChild)):Pe=f),Mt(t,i,i.pendingProps.children,l),Kr(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&De&&((f=r=Pe)&&(r=qx(r,i.type,i.pendingProps,vn),r!==null?(i.stateNode=r,Tt=i,Pe=Sn(r.firstChild),vn=!1,f=!0):f=!1),f||qi(i)),Se(i),f=i.type,m=i.pendingProps,b=t!==null?t.memoizedProps:null,r=m.children,jd(f,m)?r=null:b!==null&&jd(f,b)&&(i.flags|=32),i.memoizedState!==null&&(f=zf(t,i,ix,null,null,l),yo._currentValue=f),Kr(t,i),Mt(t,i,r,l),i.child;case 6:return t===null&&De&&((t=l=Pe)&&(l=Vx(l,i.pendingProps,vn),l!==null?(i.stateNode=l,Tt=i,Pe=null,t=!0):t=!1),t||qi(i)),null;case 13:return Rg(t,i,l);case 4:return te(i,i.stateNode.containerInfo),r=i.pendingProps,t===null?i.child=zs(i,null,r,l):Mt(t,i,r,l),i.child;case 11:return Ag(t,i,i.type,i.pendingProps,l);case 7:return Mt(t,i,i.pendingProps,l),i.child;case 8:return Mt(t,i,i.pendingProps.children,l),i.child;case 12:return Mt(t,i,i.pendingProps.children,l),i.child;case 10:return r=i.pendingProps,Vi(i,i.type,r.value),Mt(t,i,r.children,l),i.child;case 9:return f=i.type._context,r=i.pendingProps.children,Cs(i),f=Ct(f),r=r(f),i.flags|=1,Mt(t,i,r,l),i.child;case 14:return Tg(t,i,i.type,i.pendingProps,l);case 15:return Cg(t,i,i.type,i.pendingProps,l);case 19:return Lg(t,i,l);case 31:return fx(t,i,l);case 22:return Mg(t,i,l,i.pendingProps);case 24:return Cs(i),r=Ct(pt),t===null?(f=xf(),f===null&&(f=Ze,m=Sf(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=l),f=m),i.memoizedState={parent:r,cache:f},Nf(i),Vi(i,pt,f)):((t.lanes&l)!==0&&(_f(t,i),Fl(i,null,null,l),Zl()),f=t.memoizedState,m=i.memoizedState,f.parent!==r?(f={parent:r,cache:r},i.memoizedState=f,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=f),Vi(i,pt,r)):(r=m.cache,Vi(i,pt,r),r!==f.cache&&bf(i,[pt],l,!0))),Mt(t,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function gi(t){t.flags|=4}function ld(t,i,l,r,f){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(f&335544128)===f)if(t.stateNode.complete)t.flags|=8192;else if(fy())t.flags|=8192;else throw ks=zr,Ef}else t.flags&=-16777217}function Hg(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!e0(i))if(fy())t.flags|=8192;else throw ks=zr,Ef}function Zr(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?ia():536870912,t.lanes|=i,za|=i)}function no(t,i){if(!De)switch(t.tailMode){case"hidden":i=t.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var r=null;l!==null;)l.alternate!==null&&(r=l),l=l.sibling;r===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:r.sibling=null}}function et(t){var i=t.alternate!==null&&t.alternate.child===t.child,l=0,r=0;if(i)for(var f=t.child;f!==null;)l|=f.lanes|f.childLanes,r|=f.subtreeFlags&65011712,r|=f.flags&65011712,f.return=t,f=f.sibling;else for(f=t.child;f!==null;)l|=f.lanes|f.childLanes,r|=f.subtreeFlags,r|=f.flags,f.return=t,f=f.sibling;return t.subtreeFlags|=r,t.childLanes=l,i}function hx(t,i,l){var r=i.pendingProps;switch(mf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return et(i),null;case 1:return et(i),null;case 3:return l=i.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),di(pt),ue(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(ba(i)?gi(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,gf())),et(i),null;case 26:var f=i.type,m=i.memoizedState;return t===null?(gi(i),m!==null?(et(i),Hg(i,m)):(et(i),ld(i,f,null,r,l))):m?m!==t.memoizedState?(gi(i),et(i),Hg(i,m)):(et(i),i.flags&=-16777217):(t=t.memoizedProps,t!==r&&gi(i),et(i),ld(i,f,t,r,l)),null;case 27:if(we(i),l=de.current,f=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==r&&gi(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return et(i),null}t=ne.current,ba(i)?vp(i):(t=Xy(f,r,l),i.stateNode=t,gi(i))}return et(i),null;case 5:if(we(i),f=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==r&&gi(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return et(i),null}if(m=ne.current,ba(i))vp(i);else{var b=uc(de.current);switch(m){case 1:m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=b.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=b.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=b.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof r.is=="string"?b.createElement("select",{is:r.is}):b.createElement("select"),r.multiple?m.multiple=!0:r.size&&(m.size=r.size);break;default:m=typeof r.is=="string"?b.createElement(f,{is:r.is}):b.createElement(f)}}m[wt]=i,m[zt]=r;e:for(b=i.child;b!==null;){if(b.tag===5||b.tag===6)m.appendChild(b.stateNode);else if(b.tag!==4&&b.tag!==27&&b.child!==null){b.child.return=b,b=b.child;continue}if(b===i)break e;for(;b.sibling===null;){if(b.return===null||b.return===i)break e;b=b.return}b.sibling.return=b.return,b=b.sibling}i.stateNode=m;e:switch(Ot(m,f,r),f){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&gi(i)}}return et(i),ld(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,l),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==r&&gi(i);else{if(typeof r!="string"&&i.stateNode===null)throw Error(a(166));if(t=de.current,ba(i)){if(t=i.stateNode,l=i.memoizedProps,r=null,f=Tt,f!==null)switch(f.tag){case 27:case 5:r=f.memoizedProps}t[wt]=i,t=!!(t.nodeValue===l||r!==null&&r.suppressHydrationWarning===!0||Ry(t.nodeValue,l)),t||qi(i,!0)}else t=uc(t).createTextNode(r),t[wt]=i,i.stateNode=t}return et(i),null;case 31:if(l=i.memoizedState,t===null||t.memoizedState!==null){if(r=ba(i),l!==null){if(t===null){if(!r)throw Error(a(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(557));t[wt]=i}else As(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;et(i),t=!1}else l=gf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return i.flags&256?(an(i),i):(an(i),null);if((i.flags&128)!==0)throw Error(a(558))}return et(i),null;case 13:if(r=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=ba(i),r!==null&&r.dehydrated!==null){if(t===null){if(!f)throw Error(a(318));if(f=i.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(a(317));f[wt]=i}else As(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;et(i),f=!1}else f=gf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return i.flags&256?(an(i),i):(an(i),null)}return an(i),(i.flags&128)!==0?(i.lanes=l,i):(l=r!==null,t=t!==null&&t.memoizedState!==null,l&&(r=i.child,f=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(f=r.alternate.memoizedState.cachePool.pool),m=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(m=r.memoizedState.cachePool.pool),m!==f&&(r.flags|=2048)),l!==t&&l&&(i.child.flags|=8192),Zr(i,i.updateQueue),et(i),null);case 4:return ue(),t===null&&Cd(i.stateNode.containerInfo),et(i),null;case 10:return di(i.type),et(i),null;case 19:if(I(ut),r=i.memoizedState,r===null)return et(i),null;if(f=(i.flags&128)!==0,m=r.rendering,m===null)if(f)no(r,!1);else{if(ct!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(m=Br(t),m!==null){for(i.flags|=128,no(r,!1),t=m.updateQueue,i.updateQueue=t,Zr(i,t),i.subtreeFlags=0,t=l,l=i.child;l!==null;)hp(l,t),l=l.sibling;return ee(ut,ut.current&1|2),De&&ui(i,r.treeForkCount),i.child}t=t.sibling}r.tail!==null&&Ye()>ec&&(i.flags|=128,f=!0,no(r,!1),i.lanes=4194304)}else{if(!f)if(t=Br(m),t!==null){if(i.flags|=128,f=!0,t=t.updateQueue,i.updateQueue=t,Zr(i,t),no(r,!0),r.tail===null&&r.tailMode==="hidden"&&!m.alternate&&!De)return et(i),null}else 2*Ye()-r.renderingStartTime>ec&&l!==536870912&&(i.flags|=128,f=!0,no(r,!1),i.lanes=4194304);r.isBackwards?(m.sibling=i.child,i.child=m):(t=r.last,t!==null?t.sibling=m:i.child=m,r.last=m)}return r.tail!==null?(t=r.tail,r.rendering=t,r.tail=t.sibling,r.renderingStartTime=Ye(),t.sibling=null,l=ut.current,ee(ut,f?l&1|2:l&1),De&&ui(i,r.treeForkCount),t):(et(i),null);case 22:case 23:return an(i),Mf(),r=i.memoizedState!==null,t!==null?t.memoizedState!==null!==r&&(i.flags|=8192):r&&(i.flags|=8192),r?(l&536870912)!==0&&(i.flags&128)===0&&(et(i),i.subtreeFlags&6&&(i.flags|=8192)):et(i),l=i.updateQueue,l!==null&&Zr(i,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==l&&(i.flags|=2048),t!==null&&I(Ms),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),di(pt),et(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function mx(t,i){switch(mf(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return di(pt),ue(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return we(i),null;case 31:if(i.memoizedState!==null){if(an(i),i.alternate===null)throw Error(a(340));As()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(an(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(a(340));As()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return I(ut),null;case 4:return ue(),null;case 10:return di(i.type),null;case 22:case 23:return an(i),Mf(),t!==null&&I(Ms),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return di(pt),null;case 25:return null;default:return null}}function Ug(t,i){switch(mf(i),i.tag){case 3:di(pt),ue();break;case 26:case 27:case 5:we(i);break;case 4:ue();break;case 31:i.memoizedState!==null&&an(i);break;case 13:an(i);break;case 19:I(ut);break;case 10:di(i.type);break;case 22:case 23:an(i),Mf(),t!==null&&I(Ms);break;case 24:di(pt)}}function io(t,i){try{var l=i.updateQueue,r=l!==null?l.lastEffect:null;if(r!==null){var f=r.next;l=f;do{if((l.tag&t)===t){r=void 0;var m=l.create,b=l.inst;r=m(),b.destroy=r}l=l.next}while(l!==f)}}catch(M){Ve(i,i.return,M)}}function Zi(t,i,l){try{var r=i.updateQueue,f=r!==null?r.lastEffect:null;if(f!==null){var m=f.next;r=m;do{if((r.tag&t)===t){var b=r.inst,M=b.destroy;if(M!==void 0){b.destroy=void 0,f=i;var U=l,J=M;try{J()}catch(oe){Ve(f,U,oe)}}}r=r.next}while(r!==m)}}catch(oe){Ve(i,i.return,oe)}}function Ig(t){var i=t.updateQueue;if(i!==null){var l=t.stateNode;try{kp(i,l)}catch(r){Ve(t,t.return,r)}}}function qg(t,i,l){l.props=Ds(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(r){Ve(t,i,r)}}function so(t,i){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var r=t.stateNode;break;case 30:r=t.stateNode;break;default:r=t.stateNode}typeof l=="function"?t.refCleanup=l(r):l.current=r}}catch(f){Ve(t,i,f)}}function Kn(t,i){var l=t.ref,r=t.refCleanup;if(l!==null)if(typeof r=="function")try{r()}catch(f){Ve(t,i,f)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(f){Ve(t,i,f)}else l.current=null}function Vg(t){var i=t.type,l=t.memoizedProps,r=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break e;case"img":l.src?r.src=l.src:l.srcSet&&(r.srcset=l.srcSet)}}catch(f){Ve(t,t.return,f)}}function od(t,i,l){try{var r=t.stateNode;Bx(r,t.type,l,i),r[zt]=i}catch(f){Ve(t,t.return,f)}}function Yg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&ns(t.type)||t.tag===4}function rd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Yg(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&ns(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function cd(t,i,l){var r=t.tag;if(r===5||r===6)t=t.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(t),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=oi));else if(r!==4&&(r===27&&ns(t.type)&&(l=t.stateNode,i=null),t=t.child,t!==null))for(cd(t,i,l),t=t.sibling;t!==null;)cd(t,i,l),t=t.sibling}function Fr(t,i,l){var r=t.tag;if(r===5||r===6)t=t.stateNode,i?l.insertBefore(t,i):l.appendChild(t);else if(r!==4&&(r===27&&ns(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(Fr(t,i,l),t=t.sibling;t!==null;)Fr(t,i,l),t=t.sibling}function Gg(t){var i=t.stateNode,l=t.memoizedProps;try{for(var r=t.type,f=i.attributes;f.length;)i.removeAttributeNode(f[0]);Ot(i,r,l),i[wt]=t,i[zt]=l}catch(m){Ve(t,t.return,m)}}var yi=!1,vt=!1,ud=!1,Xg=typeof WeakSet=="function"?WeakSet:Set,At=null;function px(t,i){if(t=t.containerInfo,kd=yc,t=sp(t),nf(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var r=l.getSelection&&l.getSelection();if(r&&r.rangeCount!==0){l=r.anchorNode;var f=r.anchorOffset,m=r.focusNode;r=r.focusOffset;try{l.nodeType,m.nodeType}catch{l=null;break e}var b=0,M=-1,U=-1,J=0,oe=0,ce=t,P=null;t:for(;;){for(var se;ce!==l||f!==0&&ce.nodeType!==3||(M=b+f),ce!==m||r!==0&&ce.nodeType!==3||(U=b+r),ce.nodeType===3&&(b+=ce.nodeValue.length),(se=ce.firstChild)!==null;)P=ce,ce=se;for(;;){if(ce===t)break t;if(P===l&&++J===f&&(M=b),P===m&&++oe===r&&(U=b),(se=ce.nextSibling)!==null)break;ce=P,P=ce.parentNode}ce=se}l=M===-1||U===-1?null:{start:M,end:U}}else l=null}l=l||{start:0,end:0}}else l=null;for(zd={focusedElem:t,selectionRange:l},yc=!1,At=i;At!==null;)if(i=At,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,At=t;else for(;At!==null;){switch(i=At,m=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)f=t[l],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&m!==null){t=void 0,l=i,f=m.memoizedProps,m=m.memoizedState,r=l.stateNode;try{var pe=Ds(l.type,f);t=r.getSnapshotBeforeUpdate(pe,m),r.__reactInternalSnapshotBeforeUpdate=t}catch(xe){Ve(l,l.return,xe)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,l=t.nodeType,l===9)Rd(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Rd(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(a(163))}if(t=i.sibling,t!==null){t.return=i.return,At=t;break}At=i.return}}function Kg(t,i,l){var r=l.flags;switch(l.tag){case 0:case 11:case 15:bi(t,l),r&4&&io(5,l);break;case 1:if(bi(t,l),r&4)if(t=l.stateNode,i===null)try{t.componentDidMount()}catch(b){Ve(l,l.return,b)}else{var f=Ds(l.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(f,i,t.__reactInternalSnapshotBeforeUpdate)}catch(b){Ve(l,l.return,b)}}r&64&&Ig(l),r&512&&so(l,l.return);break;case 3:if(bi(t,l),r&64&&(t=l.updateQueue,t!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{kp(t,i)}catch(b){Ve(l,l.return,b)}}break;case 27:i===null&&r&4&&Gg(l);case 26:case 5:bi(t,l),i===null&&r&4&&Vg(l),r&512&&so(l,l.return);break;case 12:bi(t,l);break;case 31:bi(t,l),r&4&&Fg(t,l);break;case 13:bi(t,l),r&4&&Jg(t,l),r&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=Nx.bind(null,l),Yx(t,l))));break;case 22:if(r=l.memoizedState!==null||yi,!r){i=i!==null&&i.memoizedState!==null||vt,f=yi;var m=vt;yi=r,(vt=i)&&!m?Si(t,l,(l.subtreeFlags&8772)!==0):bi(t,l),yi=f,vt=m}break;case 30:break;default:bi(t,l)}}function Qg(t){var i=t.alternate;i!==null&&(t.alternate=null,Qg(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&Al(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var tt=null,Kt=!1;function vi(t,i,l){for(l=l.child;l!==null;)Zg(t,i,l),l=l.sibling}function Zg(t,i,l){if(ht&&typeof ht.onCommitFiberUnmount=="function")try{ht.onCommitFiberUnmount(ni,l)}catch{}switch(l.tag){case 26:vt||Kn(l,i),vi(t,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:vt||Kn(l,i);var r=tt,f=Kt;ns(l.type)&&(tt=l.stateNode,Kt=!1),vi(t,i,l),mo(l.stateNode),tt=r,Kt=f;break;case 5:vt||Kn(l,i);case 6:if(r=tt,f=Kt,tt=null,vi(t,i,l),tt=r,Kt=f,tt!==null)if(Kt)try{(tt.nodeType===9?tt.body:tt.nodeName==="HTML"?tt.ownerDocument.body:tt).removeChild(l.stateNode)}catch(m){Ve(l,i,m)}else try{tt.removeChild(l.stateNode)}catch(m){Ve(l,i,m)}break;case 18:tt!==null&&(Kt?(t=tt,Iy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Ua(t)):Iy(tt,l.stateNode));break;case 4:r=tt,f=Kt,tt=l.stateNode.containerInfo,Kt=!0,vi(t,i,l),tt=r,Kt=f;break;case 0:case 11:case 14:case 15:Zi(2,l,i),vt||Zi(4,l,i),vi(t,i,l);break;case 1:vt||(Kn(l,i),r=l.stateNode,typeof r.componentWillUnmount=="function"&&qg(l,i,r)),vi(t,i,l);break;case 21:vi(t,i,l);break;case 22:vt=(r=vt)||l.memoizedState!==null,vi(t,i,l),vt=r;break;default:vi(t,i,l)}}function Fg(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ua(t)}catch(l){Ve(i,i.return,l)}}}function Jg(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ua(t)}catch(l){Ve(i,i.return,l)}}function gx(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Xg),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Xg),i;default:throw Error(a(435,t.tag))}}function Jr(t,i){var l=gx(t);i.forEach(function(r){if(!l.has(r)){l.add(r);var f=_x.bind(null,t,r);r.then(f,f)}})}function Qt(t,i){var l=i.deletions;if(l!==null)for(var r=0;r<l.length;r++){var f=l[r],m=t,b=i,M=b;e:for(;M!==null;){switch(M.tag){case 27:if(ns(M.type)){tt=M.stateNode,Kt=!1;break e}break;case 5:tt=M.stateNode,Kt=!1;break e;case 3:case 4:tt=M.stateNode.containerInfo,Kt=!0;break e}M=M.return}if(tt===null)throw Error(a(160));Zg(m,b,f),tt=null,Kt=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Wg(i,t),i=i.sibling}var On=null;function Wg(t,i){var l=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Qt(i,t),Zt(t),r&4&&(Zi(3,t,t.return),io(3,t),Zi(5,t,t.return));break;case 1:Qt(i,t),Zt(t),r&512&&(vt||l===null||Kn(l,l.return)),r&64&&yi&&(t=t.updateQueue,t!==null&&(r=t.callbacks,r!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?r:l.concat(r))));break;case 26:var f=On;if(Qt(i,t),Zt(t),r&512&&(vt||l===null||Kn(l,l.return)),r&4){var m=l!==null?l.memoizedState:null;if(r=t.memoizedState,l===null)if(r===null)if(t.stateNode===null){e:{r=t.type,l=t.memoizedProps,f=f.ownerDocument||f;t:switch(r){case"title":m=f.getElementsByTagName("title")[0],(!m||m[Ss]||m[wt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(r),f.head.insertBefore(m,f.querySelector("head > title"))),Ot(m,r,l),m[wt]=t,mt(m),r=m;break e;case"link":var b=Wy("link","href",f).get(r+(l.href||""));if(b){for(var M=0;M<b.length;M++)if(m=b[M],m.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&m.getAttribute("rel")===(l.rel==null?null:l.rel)&&m.getAttribute("title")===(l.title==null?null:l.title)&&m.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){b.splice(M,1);break t}}m=f.createElement(r),Ot(m,r,l),f.head.appendChild(m);break;case"meta":if(b=Wy("meta","content",f).get(r+(l.content||""))){for(M=0;M<b.length;M++)if(m=b[M],m.getAttribute("content")===(l.content==null?null:""+l.content)&&m.getAttribute("name")===(l.name==null?null:l.name)&&m.getAttribute("property")===(l.property==null?null:l.property)&&m.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&m.getAttribute("charset")===(l.charSet==null?null:l.charSet)){b.splice(M,1);break t}}m=f.createElement(r),Ot(m,r,l),f.head.appendChild(m);break;default:throw Error(a(468,r))}m[wt]=t,mt(m),r=m}t.stateNode=r}else Py(f,t.type,t.stateNode);else t.stateNode=Jy(f,r,t.memoizedProps);else m!==r?(m===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):m.count--,r===null?Py(f,t.type,t.stateNode):Jy(f,r,t.memoizedProps)):r===null&&t.stateNode!==null&&od(t,t.memoizedProps,l.memoizedProps)}break;case 27:Qt(i,t),Zt(t),r&512&&(vt||l===null||Kn(l,l.return)),l!==null&&r&4&&od(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Qt(i,t),Zt(t),r&512&&(vt||l===null||Kn(l,l.return)),t.flags&32){f=t.stateNode;try{ca(f,"")}catch(pe){Ve(t,t.return,pe)}}r&4&&t.stateNode!=null&&(f=t.memoizedProps,od(t,f,l!==null?l.memoizedProps:f)),r&1024&&(ud=!0);break;case 6:if(Qt(i,t),Zt(t),r&4){if(t.stateNode===null)throw Error(a(162));r=t.memoizedProps,l=t.stateNode;try{l.nodeValue=r}catch(pe){Ve(t,t.return,pe)}}break;case 3:if(hc=null,f=On,On=fc(i.containerInfo),Qt(i,t),On=f,Zt(t),r&4&&l!==null&&l.memoizedState.isDehydrated)try{Ua(i.containerInfo)}catch(pe){Ve(t,t.return,pe)}ud&&(ud=!1,Pg(t));break;case 4:r=On,On=fc(t.stateNode.containerInfo),Qt(i,t),Zt(t),On=r;break;case 12:Qt(i,t),Zt(t);break;case 31:Qt(i,t),Zt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Jr(t,r)));break;case 13:Qt(i,t),Zt(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Pr=Ye()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Jr(t,r)));break;case 22:f=t.memoizedState!==null;var U=l!==null&&l.memoizedState!==null,J=yi,oe=vt;if(yi=J||f,vt=oe||U,Qt(i,t),vt=oe,yi=J,Zt(t),r&8192)e:for(i=t.stateNode,i._visibility=f?i._visibility&-2:i._visibility|1,f&&(l===null||U||yi||vt||Rs(t)),l=null,i=t;;){if(i.tag===5||i.tag===26){if(l===null){U=l=i;try{if(m=U.stateNode,f)b=m.style,typeof b.setProperty=="function"?b.setProperty("display","none","important"):b.display="none";else{M=U.stateNode;var ce=U.memoizedProps.style,P=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;M.style.display=P==null||typeof P=="boolean"?"":(""+P).trim()}}catch(pe){Ve(U,U.return,pe)}}}else if(i.tag===6){if(l===null){U=i;try{U.stateNode.nodeValue=f?"":U.memoizedProps}catch(pe){Ve(U,U.return,pe)}}}else if(i.tag===18){if(l===null){U=i;try{var se=U.stateNode;f?qy(se,!0):qy(U.stateNode,!1)}catch(pe){Ve(U,U.return,pe)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}r&4&&(r=t.updateQueue,r!==null&&(l=r.retryQueue,l!==null&&(r.retryQueue=null,Jr(t,l))));break;case 19:Qt(i,t),Zt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,Jr(t,r)));break;case 30:break;case 21:break;default:Qt(i,t),Zt(t)}}function Zt(t){var i=t.flags;if(i&2){try{for(var l,r=t.return;r!==null;){if(Yg(r)){l=r;break}r=r.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var f=l.stateNode,m=rd(t);Fr(t,m,f);break;case 5:var b=l.stateNode;l.flags&32&&(ca(b,""),l.flags&=-33);var M=rd(t);Fr(t,M,b);break;case 3:case 4:var U=l.stateNode.containerInfo,J=rd(t);cd(t,J,U);break;default:throw Error(a(161))}}catch(oe){Ve(t,t.return,oe)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function Pg(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;Pg(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function bi(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Kg(t,i.alternate,i),i=i.sibling}function Rs(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:Zi(4,i,i.return),Rs(i);break;case 1:Kn(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&qg(i,i.return,l),Rs(i);break;case 27:mo(i.stateNode);case 26:case 5:Kn(i,i.return),Rs(i);break;case 22:i.memoizedState===null&&Rs(i);break;case 30:Rs(i);break;default:Rs(i)}t=t.sibling}}function Si(t,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var r=i.alternate,f=t,m=i,b=m.flags;switch(m.tag){case 0:case 11:case 15:Si(f,m,l),io(4,m);break;case 1:if(Si(f,m,l),r=m,f=r.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(J){Ve(r,r.return,J)}if(r=m,f=r.updateQueue,f!==null){var M=r.stateNode;try{var U=f.shared.hiddenCallbacks;if(U!==null)for(f.shared.hiddenCallbacks=null,f=0;f<U.length;f++)Op(U[f],M)}catch(J){Ve(r,r.return,J)}}l&&b&64&&Ig(m),so(m,m.return);break;case 27:Gg(m);case 26:case 5:Si(f,m,l),l&&r===null&&b&4&&Vg(m),so(m,m.return);break;case 12:Si(f,m,l);break;case 31:Si(f,m,l),l&&b&4&&Fg(f,m);break;case 13:Si(f,m,l),l&&b&4&&Jg(f,m);break;case 22:m.memoizedState===null&&Si(f,m,l),so(m,m.return);break;case 30:break;default:Si(f,m,l)}i=i.sibling}}function fd(t,i){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Yl(l))}function dd(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Yl(t))}function kn(t,i,l,r){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ey(t,i,l,r),i=i.sibling}function ey(t,i,l,r){var f=i.flags;switch(i.tag){case 0:case 11:case 15:kn(t,i,l,r),f&2048&&io(9,i);break;case 1:kn(t,i,l,r);break;case 3:kn(t,i,l,r),f&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Yl(t)));break;case 12:if(f&2048){kn(t,i,l,r),t=i.stateNode;try{var m=i.memoizedProps,b=m.id,M=m.onPostCommit;typeof M=="function"&&M(b,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(U){Ve(i,i.return,U)}}else kn(t,i,l,r);break;case 31:kn(t,i,l,r);break;case 13:kn(t,i,l,r);break;case 23:break;case 22:m=i.stateNode,b=i.alternate,i.memoizedState!==null?m._visibility&2?kn(t,i,l,r):ao(t,i):m._visibility&2?kn(t,i,l,r):(m._visibility|=2,Ma(t,i,l,r,(i.subtreeFlags&10256)!==0||!1)),f&2048&&fd(b,i);break;case 24:kn(t,i,l,r),f&2048&&dd(i.alternate,i);break;default:kn(t,i,l,r)}}function Ma(t,i,l,r,f){for(f=f&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var m=t,b=i,M=l,U=r,J=b.flags;switch(b.tag){case 0:case 11:case 15:Ma(m,b,M,U,f),io(8,b);break;case 23:break;case 22:var oe=b.stateNode;b.memoizedState!==null?oe._visibility&2?Ma(m,b,M,U,f):ao(m,b):(oe._visibility|=2,Ma(m,b,M,U,f)),f&&J&2048&&fd(b.alternate,b);break;case 24:Ma(m,b,M,U,f),f&&J&2048&&dd(b.alternate,b);break;default:Ma(m,b,M,U,f)}i=i.sibling}}function ao(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=t,r=i,f=r.flags;switch(r.tag){case 22:ao(l,r),f&2048&&fd(r.alternate,r);break;case 24:ao(l,r),f&2048&&dd(r.alternate,r);break;default:ao(l,r)}i=i.sibling}}var lo=8192;function Oa(t,i,l){if(t.subtreeFlags&lo)for(t=t.child;t!==null;)ty(t,i,l),t=t.sibling}function ty(t,i,l){switch(t.tag){case 26:Oa(t,i,l),t.flags&lo&&t.memoizedState!==null&&nE(l,On,t.memoizedState,t.memoizedProps);break;case 5:Oa(t,i,l);break;case 3:case 4:var r=On;On=fc(t.stateNode.containerInfo),Oa(t,i,l),On=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=lo,lo=16777216,Oa(t,i,l),lo=r):Oa(t,i,l));break;default:Oa(t,i,l)}}function ny(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function oo(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var r=i[l];At=r,sy(r,t)}ny(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)iy(t),t=t.sibling}function iy(t){switch(t.tag){case 0:case 11:case 15:oo(t),t.flags&2048&&Zi(9,t,t.return);break;case 3:oo(t);break;case 12:oo(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Wr(t)):oo(t);break;default:oo(t)}}function Wr(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var r=i[l];At=r,sy(r,t)}ny(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:Zi(8,i,i.return),Wr(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,Wr(i));break;default:Wr(i)}t=t.sibling}}function sy(t,i){for(;At!==null;){var l=At;switch(l.tag){case 0:case 11:case 15:Zi(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var r=l.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Yl(l.memoizedState.cache)}if(r=l.child,r!==null)r.return=l,At=r;else e:for(l=t;At!==null;){r=At;var f=r.sibling,m=r.return;if(Qg(r),r===l){At=null;break e}if(f!==null){f.return=m,At=f;break e}At=m}}}var yx={getCacheForType:function(t){var i=Ct(pt),l=i.data.get(t);return l===void 0&&(l=t(),i.data.set(t,l)),l},cacheSignal:function(){return Ct(pt).controller.signal}},vx=typeof WeakMap=="function"?WeakMap:Map,Ue=0,Ze=null,Oe=null,ze=0,qe=0,ln=null,Fi=!1,ka=!1,hd=!1,wi=0,ct=0,Ji=0,Bs=0,md=0,on=0,za=0,ro=null,Ft=null,pd=!1,Pr=0,ay=0,ec=1/0,tc=null,Wi=null,xt=0,Pi=null,ja=null,xi=0,gd=0,yd=null,ly=null,co=0,vd=null;function rn(){return(Ue&2)!==0&&ze!==0?ze&-ze:k.T!==null?Nd():at()}function oy(){if(on===0)if((ze&536870912)===0||De){var t=ki;ki<<=1,(ki&3932160)===0&&(ki=262144),on=t}else on=536870912;return t=sn.current,t!==null&&(t.flags|=32),on}function Jt(t,i,l){(t===Ze&&(qe===2||qe===9)||t.cancelPendingCommit!==null)&&(Da(t,0),es(t,ze,on,!1)),si(t,l),((Ue&2)===0||t!==Ze)&&(t===Ze&&((Ue&2)===0&&(Bs|=l),ct===4&&es(t,ze,on,!1)),Qn(t))}function ry(t,i,l){if((Ue&6)!==0)throw Error(a(327));var r=!l&&(i&127)===0&&(i&t.expiredLanes)===0||ii(t,i),f=r?wx(t,i):Sd(t,i,!0),m=r;do{if(f===0){ka&&!r&&es(t,i,0,!1);break}else{if(l=t.current.alternate,m&&!bx(l)){f=Sd(t,i,!1),m=!1;continue}if(f===2){if(m=i,t.errorRecoveryDisabledLanes&m)var b=0;else b=t.pendingLanes&-536870913,b=b!==0?b:b&536870912?536870912:0;if(b!==0){i=b;e:{var M=t;f=ro;var U=M.current.memoizedState.isDehydrated;if(U&&(Da(M,b).flags|=256),b=Sd(M,b,!1),b!==2){if(hd&&!U){M.errorRecoveryDisabledLanes|=m,Bs|=m,f=4;break e}m=Ft,Ft=f,m!==null&&(Ft===null?Ft=m:Ft.push.apply(Ft,m))}f=b}if(m=!1,f!==2)continue}}if(f===1){Da(t,0),es(t,i,0,!0);break}e:{switch(r=t,m=f,m){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:es(r,i,on,!Fi);break e;case 2:Ft=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(f=Pr+300-Ye(),10<f)){if(es(r,i,on,!Fi),zi(r,0,!0)!==0)break e;xi=i,r.timeoutHandle=Hy(cy.bind(null,r,l,Ft,tc,pd,i,on,Bs,za,Fi,m,"Throttled",-0,0),f);break e}cy(r,l,Ft,tc,pd,i,on,Bs,za,Fi,m,null,-0,0)}}break}while(!0);Qn(t)}function cy(t,i,l,r,f,m,b,M,U,J,oe,ce,P,se){if(t.timeoutHandle=-1,ce=i.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:oi},ty(i,m,ce);var pe=(m&62914560)===m?Pr-Ye():(m&4194048)===m?ay-Ye():0;if(pe=iE(ce,pe),pe!==null){xi=m,t.cancelPendingCommit=pe(yy.bind(null,t,i,m,l,r,f,b,M,U,oe,ce,null,P,se)),es(t,m,b,!J);return}}yy(t,i,m,l,r,f,b,M,U)}function bx(t){for(var i=t;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var r=0;r<l.length;r++){var f=l[r],m=f.getSnapshot;f=f.value;try{if(!tn(m(),f))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function es(t,i,l,r){i&=~md,i&=~Bs,t.suspendedLanes|=i,t.pingedLanes&=~i,r&&(t.warmLanes|=i),r=t.expirationTimes;for(var f=i;0<f;){var m=31-Qe(f),b=1<<m;r[m]=-1,f&=~b}l!==0&&me(t,l,i)}function nc(){return(Ue&6)===0?(uo(0),!1):!0}function bd(){if(Oe!==null){if(qe===0)var t=Oe.return;else t=Oe,fi=Ts=null,Rf(t),Na=null,Xl=0,t=Oe;for(;t!==null;)Ug(t.alternate,t),t=t.return;Oe=null}}function Da(t,i){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,Hx(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),xi=0,bd(),Ze=t,Oe=l=ci(t.current,null),ze=i,qe=0,ln=null,Fi=!1,ka=ii(t,i),hd=!1,za=on=md=Bs=Ji=ct=0,Ft=ro=null,pd=!1,(i&8)!==0&&(i|=i&32);var r=t.entangledLanes;if(r!==0)for(t=t.entanglements,r&=i;0<r;){var f=31-Qe(r),m=1<<f;i|=t[f],r&=~m}return wi=i,Er(),l}function uy(t,i){Te=null,k.H=eo,i===Ea||i===kr?(i=Ap(),qe=3):i===Ef?(i=Ap(),qe=4):qe=i===Jf?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,ln=i,Oe===null&&(ct=1,Gr(t,pn(i,t.current)))}function fy(){var t=sn.current;return t===null?!0:(ze&4194048)===ze?bn===null:(ze&62914560)===ze||(ze&536870912)!==0?t===bn:!1}function dy(){var t=k.H;return k.H=eo,t===null?eo:t}function hy(){var t=k.A;return k.A=yx,t}function ic(){ct=4,Fi||(ze&4194048)!==ze&&sn.current!==null||(ka=!0),(Ji&134217727)===0&&(Bs&134217727)===0||Ze===null||es(Ze,ze,on,!1)}function Sd(t,i,l){var r=Ue;Ue|=2;var f=dy(),m=hy();(Ze!==t||ze!==i)&&(tc=null,Da(t,i)),i=!1;var b=ct;e:do try{if(qe!==0&&Oe!==null){var M=Oe,U=ln;switch(qe){case 8:bd(),b=6;break e;case 3:case 2:case 9:case 6:sn.current===null&&(i=!0);var J=qe;if(qe=0,ln=null,Ra(t,M,U,J),l&&ka){b=0;break e}break;default:J=qe,qe=0,ln=null,Ra(t,M,U,J)}}Sx(),b=ct;break}catch(oe){uy(t,oe)}while(!0);return i&&t.shellSuspendCounter++,fi=Ts=null,Ue=r,k.H=f,k.A=m,Oe===null&&(Ze=null,ze=0,Er()),b}function Sx(){for(;Oe!==null;)my(Oe)}function wx(t,i){var l=Ue;Ue|=2;var r=dy(),f=hy();Ze!==t||ze!==i?(tc=null,ec=Ye()+500,Da(t,i)):ka=ii(t,i);e:do try{if(qe!==0&&Oe!==null){i=Oe;var m=ln;t:switch(qe){case 1:qe=0,ln=null,Ra(t,i,m,1);break;case 2:case 9:if(Np(m)){qe=0,ln=null,py(i);break}i=function(){qe!==2&&qe!==9||Ze!==t||(qe=7),Qn(t)},m.then(i,i);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:Np(m)?(qe=0,ln=null,py(i)):(qe=0,ln=null,Ra(t,i,m,7));break;case 5:var b=null;switch(Oe.tag){case 26:b=Oe.memoizedState;case 5:case 27:var M=Oe;if(b?e0(b):M.stateNode.complete){qe=0,ln=null;var U=M.sibling;if(U!==null)Oe=U;else{var J=M.return;J!==null?(Oe=J,sc(J)):Oe=null}break t}}qe=0,ln=null,Ra(t,i,m,5);break;case 6:qe=0,ln=null,Ra(t,i,m,6);break;case 8:bd(),ct=6;break e;default:throw Error(a(462))}}xx();break}catch(oe){uy(t,oe)}while(!0);return fi=Ts=null,k.H=r,k.A=f,Ue=l,Oe!==null?0:(Ze=null,ze=0,Er(),ct)}function xx(){for(;Oe!==null&&!ti();)my(Oe)}function my(t){var i=$g(t.alternate,t,wi);t.memoizedProps=t.pendingProps,i===null?sc(t):Oe=i}function py(t){var i=t,l=i.alternate;switch(i.tag){case 15:case 0:i=zg(l,i,i.pendingProps,i.type,void 0,ze);break;case 11:i=zg(l,i,i.pendingProps,i.type.render,i.ref,ze);break;case 5:Rf(i);default:Ug(l,i),i=Oe=hp(i,wi),i=$g(l,i,wi)}t.memoizedProps=t.pendingProps,i===null?sc(t):Oe=i}function Ra(t,i,l,r){fi=Ts=null,Rf(i),Na=null,Xl=0;var f=i.return;try{if(ux(t,f,i,l,ze)){ct=1,Gr(t,pn(l,t.current)),Oe=null;return}}catch(m){if(f!==null)throw Oe=f,m;ct=1,Gr(t,pn(l,t.current)),Oe=null;return}i.flags&32768?(De||r===1?t=!0:ka||(ze&536870912)!==0?t=!1:(Fi=t=!0,(r===2||r===9||r===3||r===6)&&(r=sn.current,r!==null&&r.tag===13&&(r.flags|=16384))),gy(i,t)):sc(i)}function sc(t){var i=t;do{if((i.flags&32768)!==0){gy(i,Fi);return}t=i.return;var l=hx(i.alternate,i,wi);if(l!==null){Oe=l;return}if(i=i.sibling,i!==null){Oe=i;return}Oe=i=t}while(i!==null);ct===0&&(ct=5)}function gy(t,i){do{var l=mx(t.alternate,t);if(l!==null){l.flags&=32767,Oe=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(t=t.sibling,t!==null)){Oe=t;return}Oe=t=l}while(t!==null);ct=6,Oe=null}function yy(t,i,l,r,f,m,b,M,U){t.cancelPendingCommit=null;do ac();while(xt!==0);if((Ue&6)!==0)throw Error(a(327));if(i!==null){if(i===t.current)throw Error(a(177));if(m=i.lanes|i.childLanes,m|=rf,ie(t,l,m,b,M,U),t===Ze&&(Oe=Ze=null,ze=0),ja=i,Pi=t,xi=l,gd=m,yd=f,ly=r,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Ax(It,function(){return xy(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||r){r=k.T,k.T=null,f=$.p,$.p=2,b=Ue,Ue|=4;try{px(t,i,l)}finally{Ue=b,$.p=f,k.T=r}}xt=1,vy(),by(),Sy()}}function vy(){if(xt===1){xt=0;var t=Pi,i=ja,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=k.T,k.T=null;var r=$.p;$.p=2;var f=Ue;Ue|=4;try{Wg(i,t);var m=zd,b=sp(t.containerInfo),M=m.focusedElem,U=m.selectionRange;if(b!==M&&M&&M.ownerDocument&&ip(M.ownerDocument.documentElement,M)){if(U!==null&&nf(M)){var J=U.start,oe=U.end;if(oe===void 0&&(oe=J),"selectionStart"in M)M.selectionStart=J,M.selectionEnd=Math.min(oe,M.value.length);else{var ce=M.ownerDocument||document,P=ce&&ce.defaultView||window;if(P.getSelection){var se=P.getSelection(),pe=M.textContent.length,xe=Math.min(U.start,pe),Ke=U.end===void 0?xe:Math.min(U.end,pe);!se.extend&&xe>Ke&&(b=Ke,Ke=xe,xe=b);var Q=np(M,xe),V=np(M,Ke);if(Q&&V&&(se.rangeCount!==1||se.anchorNode!==Q.node||se.anchorOffset!==Q.offset||se.focusNode!==V.node||se.focusOffset!==V.offset)){var F=ce.createRange();F.setStart(Q.node,Q.offset),se.removeAllRanges(),xe>Ke?(se.addRange(F),se.extend(V.node,V.offset)):(F.setEnd(V.node,V.offset),se.addRange(F))}}}}for(ce=[],se=M;se=se.parentNode;)se.nodeType===1&&ce.push({element:se,left:se.scrollLeft,top:se.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<ce.length;M++){var re=ce[M];re.element.scrollLeft=re.left,re.element.scrollTop=re.top}}yc=!!kd,zd=kd=null}finally{Ue=f,$.p=r,k.T=l}}t.current=i,xt=2}}function by(){if(xt===2){xt=0;var t=Pi,i=ja,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=k.T,k.T=null;var r=$.p;$.p=2;var f=Ue;Ue|=4;try{Kg(t,i.alternate,i)}finally{Ue=f,$.p=r,k.T=l}}xt=3}}function Sy(){if(xt===4||xt===3){xt=0,He();var t=Pi,i=ja,l=xi,r=ly;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?xt=5:(xt=0,ja=Pi=null,wy(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(Wi=null),hn(l),i=i.stateNode,ht&&typeof ht.onCommitFiberRoot=="function")try{ht.onCommitFiberRoot(ni,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=k.T,f=$.p,$.p=2,k.T=null;try{for(var m=t.onRecoverableError,b=0;b<r.length;b++){var M=r[b];m(M.value,{componentStack:M.stack})}}finally{k.T=i,$.p=f}}(xi&3)!==0&&ac(),Qn(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===vd?co++:(co=0,vd=t):co=0,uo(0)}}function wy(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,Yl(i)))}function ac(){return vy(),by(),Sy(),xy()}function xy(){if(xt!==5)return!1;var t=Pi,i=gd;gd=0;var l=hn(xi),r=k.T,f=$.p;try{$.p=32>l?32:l,k.T=null,l=yd,yd=null;var m=Pi,b=xi;if(xt=0,ja=Pi=null,xi=0,(Ue&6)!==0)throw Error(a(331));var M=Ue;if(Ue|=4,iy(m.current),ey(m,m.current,b,l),Ue=M,uo(0,!1),ht&&typeof ht.onPostCommitFiberRoot=="function")try{ht.onPostCommitFiberRoot(ni,m)}catch{}return!0}finally{$.p=f,k.T=r,wy(t,i)}}function Ey(t,i,l){i=pn(l,i),i=Ff(t.stateNode,i,2),t=Xi(t,i,2),t!==null&&(si(t,2),Qn(t))}function Ve(t,i,l){if(t.tag===3)Ey(t,t,l);else for(;i!==null;){if(i.tag===3){Ey(i,t,l);break}else if(i.tag===1){var r=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Wi===null||!Wi.has(r))){t=pn(l,t),l=Ng(2),r=Xi(i,l,2),r!==null&&(_g(l,r,i,t),si(r,2),Qn(r));break}}i=i.return}}function wd(t,i,l){var r=t.pingCache;if(r===null){r=t.pingCache=new vx;var f=new Set;r.set(i,f)}else f=r.get(i),f===void 0&&(f=new Set,r.set(i,f));f.has(l)||(hd=!0,f.add(l),t=Ex.bind(null,t,i,l),i.then(t,t))}function Ex(t,i,l){var r=t.pingCache;r!==null&&r.delete(i),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,Ze===t&&(ze&l)===l&&(ct===4||ct===3&&(ze&62914560)===ze&&300>Ye()-Pr?(Ue&2)===0&&Da(t,0):md|=l,za===ze&&(za=0)),Qn(t)}function Ny(t,i){i===0&&(i=ia()),t=Ns(t,i),t!==null&&(si(t,i),Qn(t))}function Nx(t){var i=t.memoizedState,l=0;i!==null&&(l=i.retryLane),Ny(t,l)}function _x(t,i){var l=0;switch(t.tag){case 31:case 13:var r=t.stateNode,f=t.memoizedState;f!==null&&(l=f.retryLane);break;case 19:r=t.stateNode;break;case 22:r=t.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(i),Ny(t,l)}function Ax(t,i){return We(t,i)}var lc=null,Ba=null,xd=!1,oc=!1,Ed=!1,ts=0;function Qn(t){t!==Ba&&t.next===null&&(Ba===null?lc=Ba=t:Ba=Ba.next=t),oc=!0,xd||(xd=!0,Cx())}function uo(t,i){if(!Ed&&oc){Ed=!0;do for(var l=!1,r=lc;r!==null;){if(t!==0){var f=r.pendingLanes;if(f===0)var m=0;else{var b=r.suspendedLanes,M=r.pingedLanes;m=(1<<31-Qe(42|t)+1)-1,m&=f&~(b&~M),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(l=!0,Cy(r,m))}else m=ze,m=zi(r,r===Ze?m:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(m&3)===0||ii(r,m)||(l=!0,Cy(r,m));r=r.next}while(l);Ed=!1}}function Tx(){_y()}function _y(){oc=xd=!1;var t=0;ts!==0&&$x()&&(t=ts);for(var i=Ye(),l=null,r=lc;r!==null;){var f=r.next,m=Ay(r,i);m===0?(r.next=null,l===null?lc=f:l.next=f,f===null&&(Ba=l)):(l=r,(t!==0||(m&3)!==0)&&(oc=!0)),r=f}xt!==0&&xt!==5||uo(t),ts!==0&&(ts=0)}function Ay(t,i){for(var l=t.suspendedLanes,r=t.pingedLanes,f=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var b=31-Qe(m),M=1<<b,U=f[b];U===-1?((M&l)===0||(M&r)!==0)&&(f[b]=_l(M,i)):U<=i&&(t.expiredLanes|=M),m&=~M}if(i=Ze,l=ze,l=zi(t,t===i?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r=t.callbackNode,l===0||t===i&&(qe===2||qe===9)||t.cancelPendingCommit!==null)return r!==null&&r!==null&&St(r),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||ii(t,l)){if(i=l&-l,i===t.callbackPriority)return i;switch(r!==null&&St(r),hn(l)){case 2:case 8:l=Ut;break;case 32:l=It;break;case 268435456:l=An;break;default:l=It}return r=Ty.bind(null,t),l=We(l,r),t.callbackPriority=i,t.callbackNode=l,i}return r!==null&&r!==null&&St(r),t.callbackPriority=2,t.callbackNode=null,2}function Ty(t,i){if(xt!==0&&xt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(ac()&&t.callbackNode!==l)return null;var r=ze;return r=zi(t,t===Ze?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(ry(t,r,i),Ay(t,Ye()),t.callbackNode!=null&&t.callbackNode===l?Ty.bind(null,t):null)}function Cy(t,i){if(ac())return null;ry(t,i,!0)}function Cx(){Ux(function(){(Ue&6)!==0?We(Ht,Tx):_y()})}function Nd(){if(ts===0){var t=wa;t===0&&(t=Vn,Vn<<=1,(Vn&261888)===0&&(Vn=256)),ts=t}return ts}function My(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:pr(""+t)}function Oy(t,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,t.id&&l.setAttribute("form",t.id),i.parentNode.insertBefore(l,i),t=new FormData(t),l.parentNode.removeChild(l),t}function Mx(t,i,l,r,f){if(i==="submit"&&l&&l.stateNode===f){var m=My((f[zt]||null).action),b=r.submitter;b&&(i=(i=b[zt]||null)?My(i.formAction):b.getAttribute("formAction"),i!==null&&(m=i,b=null));var M=new br("action","action",null,r,f);t.push({event:M,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(ts!==0){var U=b?Oy(f,b):new FormData(f);Yf(l,{pending:!0,data:U,method:f.method,action:m},null,U)}}else typeof m=="function"&&(M.preventDefault(),U=b?Oy(f,b):new FormData(f),Yf(l,{pending:!0,data:U,method:f.method,action:m},m,U))},currentTarget:f}]})}}for(var _d=0;_d<of.length;_d++){var Ad=of[_d],Ox=Ad.toLowerCase(),kx=Ad[0].toUpperCase()+Ad.slice(1);Mn(Ox,"on"+kx)}Mn(op,"onAnimationEnd"),Mn(rp,"onAnimationIteration"),Mn(cp,"onAnimationStart"),Mn("dblclick","onDoubleClick"),Mn("focusin","onFocus"),Mn("focusout","onBlur"),Mn(Kw,"onTransitionRun"),Mn(Qw,"onTransitionStart"),Mn(Zw,"onTransitionCancel"),Mn(up,"onTransitionEnd"),Li("onMouseEnter",["mouseout","mouseover"]),Li("onMouseLeave",["mouseout","mouseover"]),Li("onPointerEnter",["pointerout","pointerover"]),Li("onPointerLeave",["pointerout","pointerover"]),li("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),li("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),li("onBeforeInput",["compositionend","keypress","textInput","paste"]),li("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),li("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),li("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fo="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(" "),zx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fo));function ky(t,i){i=(i&4)!==0;for(var l=0;l<t.length;l++){var r=t[l],f=r.event;r=r.listeners;e:{var m=void 0;if(i)for(var b=r.length-1;0<=b;b--){var M=r[b],U=M.instance,J=M.currentTarget;if(M=M.listener,U!==m&&f.isPropagationStopped())break e;m=M,f.currentTarget=J;try{m(f)}catch(oe){xr(oe)}f.currentTarget=null,m=U}else for(b=0;b<r.length;b++){if(M=r[b],U=M.instance,J=M.currentTarget,M=M.listener,U!==m&&f.isPropagationStopped())break e;m=M,f.currentTarget=J;try{m(f)}catch(oe){xr(oe)}f.currentTarget=null,m=U}}}}function ke(t,i){var l=i[sa];l===void 0&&(l=i[sa]=new Set);var r=t+"__bubble";l.has(r)||(zy(i,t,2,!1),l.add(r))}function Td(t,i,l){var r=0;i&&(r|=4),zy(l,t,r,i)}var rc="_reactListening"+Math.random().toString(36).slice(2);function Cd(t){if(!t[rc]){t[rc]=!0,ur.forEach(function(l){l!=="selectionchange"&&(zx.has(l)||Td(l,!1,t),Td(l,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[rc]||(i[rc]=!0,Td("selectionchange",!1,i))}}function zy(t,i,l,r){switch(o0(i)){case 2:var f=lE;break;case 8:f=oE;break;default:f=Vd}l=f.bind(null,i,l,t),f=void 0,!Ku||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(f=!0),r?f!==void 0?t.addEventListener(i,l,{capture:!0,passive:f}):t.addEventListener(i,l,!0):f!==void 0?t.addEventListener(i,l,{passive:f}):t.addEventListener(i,l,!1)}function Md(t,i,l,r,f){var m=r;if((i&1)===0&&(i&2)===0&&r!==null)e:for(;;){if(r===null)return;var b=r.tag;if(b===3||b===4){var M=r.stateNode.containerInfo;if(M===f)break;if(b===4)for(b=r.return;b!==null;){var U=b.tag;if((U===3||U===4)&&b.stateNode.containerInfo===f)return;b=b.return}for(;M!==null;){if(b=ji(M),b===null)return;if(U=b.tag,U===5||U===6||U===26||U===27){r=m=b;continue e}M=M.parentNode}}r=r.return}Lm(function(){var J=m,oe=Gu(l),ce=[];e:{var P=fp.get(t);if(P!==void 0){var se=br,pe=t;switch(t){case"keypress":if(yr(l)===0)break e;case"keydown":case"keyup":se=_w;break;case"focusin":pe="focus",se=Ju;break;case"focusout":pe="blur",se=Ju;break;case"beforeblur":case"afterblur":se=Ju;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":se=Um;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":se=hw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":se=Cw;break;case op:case rp:case cp:se=gw;break;case up:se=Ow;break;case"scroll":case"scrollend":se=fw;break;case"wheel":se=zw;break;case"copy":case"cut":case"paste":se=vw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":se=qm;break;case"toggle":case"beforetoggle":se=Dw}var xe=(i&4)!==0,Ke=!xe&&(t==="scroll"||t==="scrollend"),Q=xe?P!==null?P+"Capture":null:P;xe=[];for(var V=J,F;V!==null;){var re=V;if(F=re.stateNode,re=re.tag,re!==5&&re!==26&&re!==27||F===null||Q===null||(re=jl(V,Q),re!=null&&xe.push(ho(V,re,F))),Ke)break;V=V.return}0<xe.length&&(P=new se(P,pe,null,l,oe),ce.push({event:P,listeners:xe}))}}if((i&7)===0){e:{if(P=t==="mouseover"||t==="pointerover",se=t==="mouseout"||t==="pointerout",P&&l!==Yu&&(pe=l.relatedTarget||l.fromElement)&&(ji(pe)||pe[ai]))break e;if((se||P)&&(P=oe.window===oe?oe:(P=oe.ownerDocument)?P.defaultView||P.parentWindow:window,se?(pe=l.relatedTarget||l.toElement,se=J,pe=pe?ji(pe):null,pe!==null&&(Ke=c(pe),xe=pe.tag,pe!==Ke||xe!==5&&xe!==27&&xe!==6)&&(pe=null)):(se=null,pe=J),se!==pe)){if(xe=Um,re="onMouseLeave",Q="onMouseEnter",V="mouse",(t==="pointerout"||t==="pointerover")&&(xe=qm,re="onPointerLeave",Q="onPointerEnter",V="pointer"),Ke=se==null?P:Ri(se),F=pe==null?P:Ri(pe),P=new xe(re,V+"leave",se,l,oe),P.target=Ke,P.relatedTarget=F,re=null,ji(oe)===J&&(xe=new xe(Q,V+"enter",pe,l,oe),xe.target=F,xe.relatedTarget=Ke,re=xe),Ke=re,se&&pe)t:{for(xe=jx,Q=se,V=pe,F=0,re=Q;re;re=xe(re))F++;re=0;for(var be=V;be;be=xe(be))re++;for(;0<F-re;)Q=xe(Q),F--;for(;0<re-F;)V=xe(V),re--;for(;F--;){if(Q===V||V!==null&&Q===V.alternate){xe=Q;break t}Q=xe(Q),V=xe(V)}xe=null}else xe=null;se!==null&&jy(ce,P,se,xe,!1),pe!==null&&Ke!==null&&jy(ce,Ke,pe,xe,!0)}}e:{if(P=J?Ri(J):window,se=P.nodeName&&P.nodeName.toLowerCase(),se==="select"||se==="input"&&P.type==="file")var Le=Fm;else if(Qm(P))if(Jm)Le=Yw;else{Le=qw;var ye=Iw}else se=P.nodeName,!se||se.toLowerCase()!=="input"||P.type!=="checkbox"&&P.type!=="radio"?J&&Vu(J.elementType)&&(Le=Fm):Le=Vw;if(Le&&(Le=Le(t,J))){Zm(ce,Le,l,oe);break e}ye&&ye(t,P,J),t==="focusout"&&J&&P.type==="number"&&J.memoizedProps.value!=null&&kl(P,"number",P.value)}switch(ye=J?Ri(J):window,t){case"focusin":(Qm(ye)||ye.contentEditable==="true")&&(ha=ye,sf=J,Il=null);break;case"focusout":Il=sf=ha=null;break;case"mousedown":af=!0;break;case"contextmenu":case"mouseup":case"dragend":af=!1,ap(ce,l,oe);break;case"selectionchange":if(Xw)break;case"keydown":case"keyup":ap(ce,l,oe)}var Ce;if(Pu)e:{switch(t){case"compositionstart":var je="onCompositionStart";break e;case"compositionend":je="onCompositionEnd";break e;case"compositionupdate":je="onCompositionUpdate";break e}je=void 0}else da?Xm(t,l)&&(je="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(je="onCompositionStart");je&&(Vm&&l.locale!=="ko"&&(da||je!=="onCompositionStart"?je==="onCompositionEnd"&&da&&(Ce=$m()):(Hi=oe,Qu="value"in Hi?Hi.value:Hi.textContent,da=!0)),ye=cc(J,je),0<ye.length&&(je=new Im(je,t,null,l,oe),ce.push({event:je,listeners:ye}),Ce?je.data=Ce:(Ce=Km(l),Ce!==null&&(je.data=Ce)))),(Ce=Bw?Lw(t,l):$w(t,l))&&(je=cc(J,"onBeforeInput"),0<je.length&&(ye=new Im("onBeforeInput","beforeinput",null,l,oe),ce.push({event:ye,listeners:je}),ye.data=Ce)),Mx(ce,t,J,l,oe)}ky(ce,i)})}function ho(t,i,l){return{instance:t,listener:i,currentTarget:l}}function cc(t,i){for(var l=i+"Capture",r=[];t!==null;){var f=t,m=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||m===null||(f=jl(t,l),f!=null&&r.unshift(ho(t,f,m)),f=jl(t,i),f!=null&&r.push(ho(t,f,m))),t.tag===3)return r;t=t.return}return[]}function jx(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function jy(t,i,l,r,f){for(var m=i._reactName,b=[];l!==null&&l!==r;){var M=l,U=M.alternate,J=M.stateNode;if(M=M.tag,U!==null&&U===r)break;M!==5&&M!==26&&M!==27||J===null||(U=J,f?(J=jl(l,m),J!=null&&b.unshift(ho(l,J,U))):f||(J=jl(l,m),J!=null&&b.push(ho(l,J,U)))),l=l.return}b.length!==0&&t.push({event:i,listeners:b})}var Dx=/\r\n?/g,Rx=/\u0000|\uFFFD/g;function Dy(t){return(typeof t=="string"?t:""+t).replace(Dx,`
9
- `).replace(Rx,"")}function Ry(t,i){return i=Dy(i),Dy(t)===i}function Xe(t,i,l,r,f,m){switch(l){case"children":typeof r=="string"?i==="body"||i==="textarea"&&r===""||ca(t,r):(typeof r=="number"||typeof r=="bigint")&&i!=="body"&&ca(t,""+r);break;case"className":la(t,"class",r);break;case"tabIndex":la(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":la(t,l,r);break;case"style":Rm(t,r,m);break;case"data":if(i!=="object"){la(t,"data",r);break}case"src":case"href":if(r===""&&(i!=="a"||l!=="href")){t.removeAttribute(l);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(l);break}r=pr(""+r),t.setAttribute(l,r);break;case"action":case"formAction":if(typeof r=="function"){t.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 m=="function"&&(l==="formAction"?(i!=="input"&&Xe(t,i,"name",f.name,f,null),Xe(t,i,"formEncType",f.formEncType,f,null),Xe(t,i,"formMethod",f.formMethod,f,null),Xe(t,i,"formTarget",f.formTarget,f,null)):(Xe(t,i,"encType",f.encType,f,null),Xe(t,i,"method",f.method,f,null),Xe(t,i,"target",f.target,f,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){t.removeAttribute(l);break}r=pr(""+r),t.setAttribute(l,r);break;case"onClick":r!=null&&(t.onclick=oi);break;case"onScroll":r!=null&&ke("scroll",t);break;case"onScrollEnd":r!=null&&ke("scrollend",t);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(a(61));if(l=r.__html,l!=null){if(f.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"multiple":t.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":t.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){t.removeAttribute("xlink:href");break}l=pr(""+r),t.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":r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(l,""+r):t.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":r&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":r===!0?t.setAttribute(l,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?t.setAttribute(l,r):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?t.setAttribute(l,r):t.removeAttribute(l);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?t.removeAttribute(l):t.setAttribute(l,r);break;case"popover":ke("beforetoggle",t),ke("toggle",t),aa(t,"popover",r);break;case"xlinkActuate":Cn(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Cn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Cn(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Cn(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Cn(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Cn(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Cn(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Cn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Cn(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":aa(t,"is",r);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=cw.get(l)||l,aa(t,l,r))}}function Od(t,i,l,r,f,m){switch(l){case"style":Rm(t,r,m);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(a(61));if(l=r.__html,l!=null){if(f.children!=null)throw Error(a(60));t.innerHTML=l}}break;case"children":typeof r=="string"?ca(t,r):(typeof r=="number"||typeof r=="bigint")&&ca(t,""+r);break;case"onScroll":r!=null&&ke("scroll",t);break;case"onScrollEnd":r!=null&&ke("scrollend",t);break;case"onClick":r!=null&&(t.onclick=oi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!fr.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(f=l.endsWith("Capture"),i=l.slice(2,f?l.length-7:void 0),m=t[zt]||null,m=m!=null?m[l]:null,typeof m=="function"&&t.removeEventListener(i,m,f),typeof r=="function")){typeof m!="function"&&m!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(i,r,f);break e}l in t?t[l]=r:r===!0?t.setAttribute(l,""):aa(t,l,r)}}}function Ot(t,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ke("error",t),ke("load",t);var r=!1,f=!1,m;for(m in l)if(l.hasOwnProperty(m)){var b=l[m];if(b!=null)switch(m){case"src":r=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Xe(t,i,m,b,l,null)}}f&&Xe(t,i,"srcSet",l.srcSet,l,null),r&&Xe(t,i,"src",l.src,l,null);return;case"input":ke("invalid",t);var M=m=b=f=null,U=null,J=null;for(r in l)if(l.hasOwnProperty(r)){var oe=l[r];if(oe!=null)switch(r){case"name":f=oe;break;case"type":b=oe;break;case"checked":U=oe;break;case"defaultChecked":J=oe;break;case"value":m=oe;break;case"defaultValue":M=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(a(137,i));break;default:Xe(t,i,r,oe,l,null)}}ra(t,m,M,U,J,b,f,!1);return;case"select":ke("invalid",t),r=b=m=null;for(f in l)if(l.hasOwnProperty(f)&&(M=l[f],M!=null))switch(f){case"value":m=M;break;case"defaultValue":b=M;break;case"multiple":r=M;default:Xe(t,i,f,M,l,null)}i=m,l=b,t.multiple=!!r,i!=null?$i(t,!!r,i,!1):l!=null&&$i(t,!!r,l,!0);return;case"textarea":ke("invalid",t),m=f=r=null;for(b in l)if(l.hasOwnProperty(b)&&(M=l[b],M!=null))switch(b){case"value":r=M;break;case"defaultValue":f=M;break;case"children":m=M;break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(a(91));break;default:Xe(t,i,b,M,l,null)}jm(t,r,f,m);return;case"option":for(U in l)l.hasOwnProperty(U)&&(r=l[U],r!=null)&&(U==="selected"?t.selected=r&&typeof r!="function"&&typeof r!="symbol":Xe(t,i,U,r,l,null));return;case"dialog":ke("beforetoggle",t),ke("toggle",t),ke("cancel",t),ke("close",t);break;case"iframe":case"object":ke("load",t);break;case"video":case"audio":for(r=0;r<fo.length;r++)ke(fo[r],t);break;case"image":ke("error",t),ke("load",t);break;case"details":ke("toggle",t);break;case"embed":case"source":case"link":ke("error",t),ke("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(J in l)if(l.hasOwnProperty(J)&&(r=l[J],r!=null))switch(J){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Xe(t,i,J,r,l,null)}return;default:if(Vu(i)){for(oe in l)l.hasOwnProperty(oe)&&(r=l[oe],r!==void 0&&Od(t,i,oe,r,l,void 0));return}}for(M in l)l.hasOwnProperty(M)&&(r=l[M],r!=null&&Xe(t,i,M,r,l,null))}function Bx(t,i,l,r){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,m=null,b=null,M=null,U=null,J=null,oe=null;for(se in l){var ce=l[se];if(l.hasOwnProperty(se)&&ce!=null)switch(se){case"checked":break;case"value":break;case"defaultValue":U=ce;default:r.hasOwnProperty(se)||Xe(t,i,se,null,r,ce)}}for(var P in r){var se=r[P];if(ce=l[P],r.hasOwnProperty(P)&&(se!=null||ce!=null))switch(P){case"type":m=se;break;case"name":f=se;break;case"checked":J=se;break;case"defaultChecked":oe=se;break;case"value":b=se;break;case"defaultValue":M=se;break;case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(a(137,i));break;default:se!==ce&&Xe(t,i,P,se,r,ce)}}Ol(t,b,M,U,J,oe,m,f);return;case"select":se=b=M=P=null;for(m in l)if(U=l[m],l.hasOwnProperty(m)&&U!=null)switch(m){case"value":break;case"multiple":se=U;default:r.hasOwnProperty(m)||Xe(t,i,m,null,r,U)}for(f in r)if(m=r[f],U=l[f],r.hasOwnProperty(f)&&(m!=null||U!=null))switch(f){case"value":P=m;break;case"defaultValue":M=m;break;case"multiple":b=m;default:m!==U&&Xe(t,i,f,m,r,U)}i=M,l=b,r=se,P!=null?$i(t,!!l,P,!1):!!r!=!!l&&(i!=null?$i(t,!!l,i,!0):$i(t,!!l,l?[]:"",!1));return;case"textarea":se=P=null;for(M in l)if(f=l[M],l.hasOwnProperty(M)&&f!=null&&!r.hasOwnProperty(M))switch(M){case"value":break;case"children":break;default:Xe(t,i,M,null,r,f)}for(b in r)if(f=r[b],m=l[b],r.hasOwnProperty(b)&&(f!=null||m!=null))switch(b){case"value":P=f;break;case"defaultValue":se=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==m&&Xe(t,i,b,f,r,m)}zl(t,P,se);return;case"option":for(var pe in l)P=l[pe],l.hasOwnProperty(pe)&&P!=null&&!r.hasOwnProperty(pe)&&(pe==="selected"?t.selected=!1:Xe(t,i,pe,null,r,P));for(U in r)P=r[U],se=l[U],r.hasOwnProperty(U)&&P!==se&&(P!=null||se!=null)&&(U==="selected"?t.selected=P&&typeof P!="function"&&typeof P!="symbol":Xe(t,i,U,P,r,se));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 xe in l)P=l[xe],l.hasOwnProperty(xe)&&P!=null&&!r.hasOwnProperty(xe)&&Xe(t,i,xe,null,r,P);for(J in r)if(P=r[J],se=l[J],r.hasOwnProperty(J)&&P!==se&&(P!=null||se!=null))switch(J){case"children":case"dangerouslySetInnerHTML":if(P!=null)throw Error(a(137,i));break;default:Xe(t,i,J,P,r,se)}return;default:if(Vu(i)){for(var Ke in l)P=l[Ke],l.hasOwnProperty(Ke)&&P!==void 0&&!r.hasOwnProperty(Ke)&&Od(t,i,Ke,void 0,r,P);for(oe in r)P=r[oe],se=l[oe],!r.hasOwnProperty(oe)||P===se||P===void 0&&se===void 0||Od(t,i,oe,P,r,se);return}}for(var Q in l)P=l[Q],l.hasOwnProperty(Q)&&P!=null&&!r.hasOwnProperty(Q)&&Xe(t,i,Q,null,r,P);for(ce in r)P=r[ce],se=l[ce],!r.hasOwnProperty(ce)||P===se||P==null&&se==null||Xe(t,i,ce,P,r,se)}function By(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Lx(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,l=performance.getEntriesByType("resource"),r=0;r<l.length;r++){var f=l[r],m=f.transferSize,b=f.initiatorType,M=f.duration;if(m&&M&&By(b)){for(b=0,M=f.responseEnd,r+=1;r<l.length;r++){var U=l[r],J=U.startTime;if(J>M)break;var oe=U.transferSize,ce=U.initiatorType;oe&&By(ce)&&(U=U.responseEnd,b+=oe*(U<M?1:(M-J)/(U-J)))}if(--r,i+=8*(m+b)/(f.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var kd=null,zd=null;function uc(t){return t.nodeType===9?t:t.ownerDocument}function Ly(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function $y(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function jd(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Dd=null;function $x(){var t=window.event;return t&&t.type==="popstate"?t===Dd?!1:(Dd=t,!0):(Dd=null,!1)}var Hy=typeof setTimeout=="function"?setTimeout:void 0,Hx=typeof clearTimeout=="function"?clearTimeout:void 0,Uy=typeof Promise=="function"?Promise:void 0,Ux=typeof queueMicrotask=="function"?queueMicrotask:typeof Uy<"u"?function(t){return Uy.resolve(null).then(t).catch(Ix)}:Hy;function Ix(t){setTimeout(function(){throw t})}function ns(t){return t==="head"}function Iy(t,i){var l=i,r=0;do{var f=l.nextSibling;if(t.removeChild(l),f&&f.nodeType===8)if(l=f.data,l==="/$"||l==="/&"){if(r===0){t.removeChild(f),Ua(i);return}r--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")r++;else if(l==="html")mo(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,mo(l);for(var m=l.firstChild;m;){var b=m.nextSibling,M=m.nodeName;m[Ss]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&m.rel.toLowerCase()==="stylesheet"||l.removeChild(m),m=b}}else l==="body"&&mo(t.ownerDocument.body);l=f}while(l);Ua(i)}function qy(t,i){var l=t;t=0;do{var r=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),r&&r.nodeType===8)if(l=r.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=r}while(l)}function Rd(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Rd(l),Al(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function qx(t,i,l,r){for(;t.nodeType===1;){var f=l;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!r&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(r){if(!t[Ss])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(m=t.getAttribute("rel"),m==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(m!==f.rel||t.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||t.getAttribute("title")!==(f.title==null?null:f.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(m=t.getAttribute("src"),(m!==(f.src==null?null:f.src)||t.getAttribute("type")!==(f.type==null?null:f.type)||t.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&m&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var m=f.name==null?null:""+f.name;if(f.type==="hidden"&&t.getAttribute("name")===m)return t}else return t;if(t=Sn(t.nextSibling),t===null)break}return null}function Vx(t,i,l){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Sn(t.nextSibling),t===null))return null;return t}function Vy(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Sn(t.nextSibling),t===null))return null;return t}function Bd(t){return t.data==="$?"||t.data==="$~"}function Ld(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function Yx(t,i){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||l.readyState!=="loading")i();else{var r=function(){i(),l.removeEventListener("DOMContentLoaded",r)};l.addEventListener("DOMContentLoaded",r),t._reactRetry=r}}function Sn(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var $d=null;function Yy(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(i===0)return Sn(t.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}t=t.nextSibling}return null}function Gy(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return t;i--}else l!=="/$"&&l!=="/&"||i++}t=t.previousSibling}return null}function Xy(t,i,l){switch(i=uc(l),t){case"html":if(t=i.documentElement,!t)throw Error(a(452));return t;case"head":if(t=i.head,!t)throw Error(a(453));return t;case"body":if(t=i.body,!t)throw Error(a(454));return t;default:throw Error(a(451))}}function mo(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Al(t)}var wn=new Map,Ky=new Set;function fc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ei=$.d;$.d={f:Gx,r:Xx,D:Kx,C:Qx,L:Zx,m:Fx,X:Wx,S:Jx,M:Px};function Gx(){var t=Ei.f(),i=nc();return t||i}function Xx(t){var i=Di(t);i!==null&&i.tag===5&&i.type==="form"?ug(i):Ei.r(t)}var La=typeof document>"u"?null:document;function Qy(t,i,l){var r=La;if(r&&typeof i=="string"&&i){var f=Gt(i);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),Ky.has(f)||(Ky.add(f),t={rel:t,crossOrigin:l,href:i},r.querySelector(f)===null&&(i=r.createElement("link"),Ot(i,"link",t),mt(i),r.head.appendChild(i)))}}function Kx(t){Ei.D(t),Qy("dns-prefetch",t,null)}function Qx(t,i){Ei.C(t,i),Qy("preconnect",t,i)}function Zx(t,i,l){Ei.L(t,i,l);var r=La;if(r&&t&&i){var f='link[rel="preload"][as="'+Gt(i)+'"]';i==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Gt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Gt(l.imageSizes)+'"]')):f+='[href="'+Gt(t)+'"]';var m=f;switch(i){case"style":m=$a(t);break;case"script":m=Ha(t)}wn.has(m)||(t=g({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:t,as:i},l),wn.set(m,t),r.querySelector(f)!==null||i==="style"&&r.querySelector(po(m))||i==="script"&&r.querySelector(go(m))||(i=r.createElement("link"),Ot(i,"link",t),mt(i),r.head.appendChild(i)))}}function Fx(t,i){Ei.m(t,i);var l=La;if(l&&t){var r=i&&typeof i.as=="string"?i.as:"script",f='link[rel="modulepreload"][as="'+Gt(r)+'"][href="'+Gt(t)+'"]',m=f;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Ha(t)}if(!wn.has(m)&&(t=g({rel:"modulepreload",href:t},i),wn.set(m,t),l.querySelector(f)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(go(m)))return}r=l.createElement("link"),Ot(r,"link",t),mt(r),l.head.appendChild(r)}}}function Jx(t,i,l){Ei.S(t,i,l);var r=La;if(r&&t){var f=Bi(r).hoistableStyles,m=$a(t);i=i||"default";var b=f.get(m);if(!b){var M={loading:0,preload:null};if(b=r.querySelector(po(m)))M.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":i},l),(l=wn.get(m))&&Hd(t,l);var U=b=r.createElement("link");mt(U),Ot(U,"link",t),U._p=new Promise(function(J,oe){U.onload=J,U.onerror=oe}),U.addEventListener("load",function(){M.loading|=1}),U.addEventListener("error",function(){M.loading|=2}),M.loading|=4,dc(b,i,r)}b={type:"stylesheet",instance:b,count:1,state:M},f.set(m,b)}}}function Wx(t,i){Ei.X(t,i);var l=La;if(l&&t){var r=Bi(l).hoistableScripts,f=Ha(t),m=r.get(f);m||(m=l.querySelector(go(f)),m||(t=g({src:t,async:!0},i),(i=wn.get(f))&&Ud(t,i),m=l.createElement("script"),mt(m),Ot(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},r.set(f,m))}}function Px(t,i){Ei.M(t,i);var l=La;if(l&&t){var r=Bi(l).hoistableScripts,f=Ha(t),m=r.get(f);m||(m=l.querySelector(go(f)),m||(t=g({src:t,async:!0,type:"module"},i),(i=wn.get(f))&&Ud(t,i),m=l.createElement("script"),mt(m),Ot(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},r.set(f,m))}}function Zy(t,i,l,r){var f=(f=de.current)?fc(f):null;if(!f)throw Error(a(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=$a(l.href),l=Bi(f).hoistableStyles,r=l.get(i),r||(r={type:"style",instance:null,count:0,state:null},l.set(i,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=$a(l.href);var m=Bi(f).hoistableStyles,b=m.get(t);if(b||(f=f.ownerDocument||f,b={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,b),(m=f.querySelector(po(t)))&&!m._p&&(b.instance=m,b.state.loading=5),wn.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},wn.set(t,l),m||eE(f,t,l,b.state))),i&&r===null)throw Error(a(528,""));return b}if(i&&r!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Ha(l),l=Bi(f).hoistableScripts,r=l.get(i),r||(r={type:"script",instance:null,count:0,state:null},l.set(i,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,t))}}function $a(t){return'href="'+Gt(t)+'"'}function po(t){return'link[rel="stylesheet"]['+t+"]"}function Fy(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function eE(t,i,l,r){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?r.loading=1:(i=t.createElement("link"),r.preload=i,i.addEventListener("load",function(){return r.loading|=1}),i.addEventListener("error",function(){return r.loading|=2}),Ot(i,"link",l),mt(i),t.head.appendChild(i))}function Ha(t){return'[src="'+Gt(t)+'"]'}function go(t){return"script[async]"+t}function Jy(t,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var r=t.querySelector('style[data-href~="'+Gt(l.href)+'"]');if(r)return i.instance=r,mt(r),r;var f=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return r=(t.ownerDocument||t).createElement("style"),mt(r),Ot(r,"style",f),dc(r,l.precedence,t),i.instance=r;case"stylesheet":f=$a(l.href);var m=t.querySelector(po(f));if(m)return i.state.loading|=4,i.instance=m,mt(m),m;r=Fy(l),(f=wn.get(f))&&Hd(r,f),m=(t.ownerDocument||t).createElement("link"),mt(m);var b=m;return b._p=new Promise(function(M,U){b.onload=M,b.onerror=U}),Ot(m,"link",r),i.state.loading|=4,dc(m,l.precedence,t),i.instance=m;case"script":return m=Ha(l.src),(f=t.querySelector(go(m)))?(i.instance=f,mt(f),f):(r=l,(f=wn.get(m))&&(r=g({},l),Ud(r,f)),t=t.ownerDocument||t,f=t.createElement("script"),mt(f),Ot(f,"link",r),t.head.appendChild(f),i.instance=f);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(r=i.instance,i.state.loading|=4,dc(r,l.precedence,t));return i.instance}function dc(t,i,l){for(var r=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=r.length?r[r.length-1]:null,m=f,b=0;b<r.length;b++){var M=r[b];if(M.dataset.precedence===i)m=M;else if(m!==f)break}m?m.parentNode.insertBefore(t,m.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(t,i.firstChild))}function Hd(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function Ud(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var hc=null;function Wy(t,i,l){if(hc===null){var r=new Map,f=hc=new Map;f.set(l,r)}else f=hc,r=f.get(l),r||(r=new Map,f.set(l,r));if(r.has(t))return r;for(r.set(t,null),l=l.getElementsByTagName(t),f=0;f<l.length;f++){var m=l[f];if(!(m[Ss]||m[wt]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var b=m.getAttribute(i)||"";b=t+b;var M=r.get(b);M?M.push(m):r.set(b,[m])}}return r}function Py(t,i,l){t=t.ownerDocument||t,t.head.insertBefore(l,i==="title"?t.querySelector("head > title"):null)}function tE(t,i,l){if(l===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;return i.rel==="stylesheet"?(t=i.disabled,typeof i.precedence=="string"&&t==null):!0;case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function e0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function nE(t,i,l,r){if(l.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var f=$a(r.href),m=i.querySelector(po(f));if(m){i=m._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=mc.bind(t),i.then(t,t)),l.state.loading|=4,l.instance=m,mt(m);return}m=i.ownerDocument||i,r=Fy(r),(f=wn.get(f))&&Hd(r,f),m=m.createElement("link"),mt(m);var b=m;b._p=new Promise(function(M,U){b.onload=M,b.onerror=U}),Ot(m,"link",r),l.instance=m}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=mc.bind(t),i.addEventListener("load",l),i.addEventListener("error",l))}}var Id=0;function iE(t,i){return t.stylesheets&&t.count===0&&gc(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var r=setTimeout(function(){if(t.stylesheets&&gc(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+i);0<t.imgBytes&&Id===0&&(Id=62500*Lx());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&gc(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>Id?50:800)+i);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(f)}}:null}function mc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)gc(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var pc=null;function gc(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,pc=new Map,i.forEach(sE,t),pc=null,mc.call(t))}function sE(t,i){if(!(i.state.loading&4)){var l=pc.get(t);if(l)var r=l.get(null);else{l=new Map,pc.set(t,l);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var b=f[m];(b.nodeName==="LINK"||b.getAttribute("media")!=="not all")&&(l.set(b.dataset.precedence,b),r=b)}r&&l.set(null,r)}f=i.instance,b=f.getAttribute("data-precedence"),m=l.get(b)||r,m===r&&l.set(null,f),l.set(b,f),this.count++,r=mc.bind(this),f.addEventListener("load",r),f.addEventListener("error",r),m?m.parentNode.insertBefore(f,m.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(f,t.firstChild)),i.state.loading|=4}}var yo={$$typeof:_,Provider:null,Consumer:null,_currentValue:H,_currentValue2:H,_threadCount:0};function aE(t,i,l,r,f,m,b,M,U){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=bs(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bs(0),this.hiddenUpdates=bs(null),this.identifierPrefix=r,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=b,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=U,this.incompleteTransitions=new Map}function t0(t,i,l,r,f,m,b,M,U,J,oe,ce){return t=new aE(t,i,l,b,U,J,oe,ce,M),i=1,m===!0&&(i|=24),m=nn(3,null,null,i),t.current=m,m.stateNode=t,i=Sf(),i.refCount++,t.pooledCache=i,i.refCount++,m.memoizedState={element:r,isDehydrated:l,cache:i},Nf(m),t}function n0(t){return t?(t=ga,t):ga}function i0(t,i,l,r,f,m){f=n0(f),r.context===null?r.context=f:r.pendingContext=f,r=Gi(i),r.payload={element:l},m=m===void 0?null:m,m!==null&&(r.callback=m),l=Xi(t,r,i),l!==null&&(Jt(l,t,i),Ql(l,t,i))}function s0(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<i?l:i}}function qd(t,i){s0(t,i),(t=t.alternate)&&s0(t,i)}function a0(t){if(t.tag===13||t.tag===31){var i=Ns(t,67108864);i!==null&&Jt(i,t,67108864),qd(t,67108864)}}function l0(t){if(t.tag===13||t.tag===31){var i=rn();i=Vt(i);var l=Ns(t,i);l!==null&&Jt(l,t,i),qd(t,i)}}var yc=!0;function lE(t,i,l,r){var f=k.T;k.T=null;var m=$.p;try{$.p=2,Vd(t,i,l,r)}finally{$.p=m,k.T=f}}function oE(t,i,l,r){var f=k.T;k.T=null;var m=$.p;try{$.p=8,Vd(t,i,l,r)}finally{$.p=m,k.T=f}}function Vd(t,i,l,r){if(yc){var f=Yd(r);if(f===null)Md(t,i,r,vc,l),r0(t,r);else if(cE(f,t,i,l,r))r.stopPropagation();else if(r0(t,r),i&4&&-1<rE.indexOf(t)){for(;f!==null;){var m=Di(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var b=Tn(m.pendingLanes);if(b!==0){var M=m;for(M.pendingLanes|=2,M.entangledLanes|=2;b;){var U=1<<31-Qe(b);M.entanglements[1]|=U,b&=~U}Qn(m),(Ue&6)===0&&(ec=Ye()+500,uo(0))}}break;case 31:case 13:M=Ns(m,2),M!==null&&Jt(M,m,2),nc(),qd(m,2)}if(m=Yd(r),m===null&&Md(t,i,r,vc,l),m===f)break;f=m}f!==null&&r.stopPropagation()}else Md(t,i,r,null,l)}}function Yd(t){return t=Gu(t),Gd(t)}var vc=null;function Gd(t){if(vc=null,t=ji(t),t!==null){var i=c(t);if(i===null)t=null;else{var l=i.tag;if(l===13){if(t=u(i),t!==null)return t;t=null}else if(l===31){if(t=d(i),t!==null)return t;t=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return vc=t,null}function o0(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(_t()){case Ht:return 2;case Ut:return 8;case It:case dt:return 32;case An:return 268435456;default:return 32}default:return 32}}var Xd=!1,is=null,ss=null,as=null,vo=new Map,bo=new Map,ls=[],rE="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 r0(t,i){switch(t){case"focusin":case"focusout":is=null;break;case"dragenter":case"dragleave":ss=null;break;case"mouseover":case"mouseout":as=null;break;case"pointerover":case"pointerout":vo.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":bo.delete(i.pointerId)}}function So(t,i,l,r,f,m){return t===null||t.nativeEvent!==m?(t={blockedOn:i,domEventName:l,eventSystemFlags:r,nativeEvent:m,targetContainers:[f]},i!==null&&(i=Di(i),i!==null&&a0(i)),t):(t.eventSystemFlags|=r,i=t.targetContainers,f!==null&&i.indexOf(f)===-1&&i.push(f),t)}function cE(t,i,l,r,f){switch(i){case"focusin":return is=So(is,t,i,l,r,f),!0;case"dragenter":return ss=So(ss,t,i,l,r,f),!0;case"mouseover":return as=So(as,t,i,l,r,f),!0;case"pointerover":var m=f.pointerId;return vo.set(m,So(vo.get(m)||null,t,i,l,r,f)),!0;case"gotpointercapture":return m=f.pointerId,bo.set(m,So(bo.get(m)||null,t,i,l,r,f)),!0}return!1}function c0(t){var i=ji(t.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=u(l),i!==null){t.blockedOn=i,or(t.priority,function(){l0(l)});return}}else if(i===31){if(i=d(l),i!==null){t.blockedOn=i,or(t.priority,function(){l0(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function bc(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var l=Yd(t.nativeEvent);if(l===null){l=t.nativeEvent;var r=new l.constructor(l.type,l);Yu=r,l.target.dispatchEvent(r),Yu=null}else return i=Di(l),i!==null&&a0(i),t.blockedOn=l,!1;i.shift()}return!0}function u0(t,i,l){bc(t)&&l.delete(i)}function uE(){Xd=!1,is!==null&&bc(is)&&(is=null),ss!==null&&bc(ss)&&(ss=null),as!==null&&bc(as)&&(as=null),vo.forEach(u0),bo.forEach(u0)}function Sc(t,i){t.blockedOn===i&&(t.blockedOn=null,Xd||(Xd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,uE)))}var wc=null;function f0(t){wc!==t&&(wc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){wc===t&&(wc=null);for(var i=0;i<t.length;i+=3){var l=t[i],r=t[i+1],f=t[i+2];if(typeof r!="function"){if(Gd(r||l)===null)continue;break}var m=Di(l);m!==null&&(t.splice(i,3),i-=3,Yf(m,{pending:!0,data:f,method:l.method,action:r},r,f))}}))}function Ua(t){function i(U){return Sc(U,t)}is!==null&&Sc(is,t),ss!==null&&Sc(ss,t),as!==null&&Sc(as,t),vo.forEach(i),bo.forEach(i);for(var l=0;l<ls.length;l++){var r=ls[l];r.blockedOn===t&&(r.blockedOn=null)}for(;0<ls.length&&(l=ls[0],l.blockedOn===null);)c0(l),l.blockedOn===null&&ls.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(r=0;r<l.length;r+=3){var f=l[r],m=l[r+1],b=f[zt]||null;if(typeof m=="function")b||f0(l);else if(b){var M=null;if(m&&m.hasAttribute("formAction")){if(f=m,b=m[zt]||null)M=b.formAction;else if(Gd(f)!==null)continue}else M=b.action;typeof M=="function"?l[r+1]=M:(l.splice(r,3),r-=3),f0(l)}}}function d0(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(b){return f=b})},focusReset:"manual",scroll:"manual"})}function i(){f!==null&&(f(),f=null),r||setTimeout(l,20)}function l(){if(!r&&!navigation.transition){var m=navigation.currentEntry;m&&m.url!=null&&navigation.navigate(m.url,{state:m.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,f=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){r=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),f!==null&&(f(),f=null)}}}function Kd(t){this._internalRoot=t}xc.prototype.render=Kd.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,r=rn();i0(l,r,t,i,null,null)},xc.prototype.unmount=Kd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;i0(t.current,2,null,t,null,null),nc(),i[ai]=null}};function xc(t){this._internalRoot=t}xc.prototype.unstable_scheduleHydration=function(t){if(t){var i=at();t={blockedOn:null,target:t,priority:i};for(var l=0;l<ls.length&&i!==0&&i<ls[l].priority;l++);ls.splice(l,0,t),l===0&&c0(t)}};var h0=n.version;if(h0!=="19.2.7")throw Error(a(527,h0,"19.2.7"));$.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(a(188)):(t=Object.keys(t).join(","),Error(a(268,t)));return t=p(i),t=t!==null?v(t):null,t=t===null?null:t.stateNode,t};var fE={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:k,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ec=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ec.isDisabled&&Ec.supportsFiber)try{ni=Ec.inject(fE),ht=Ec}catch{}}return xo.createRoot=function(t,i){if(!o(t))throw Error(a(299));var l=!1,r="",f=Sg,m=wg,b=xg;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(f=i.onUncaughtError),i.onCaughtError!==void 0&&(m=i.onCaughtError),i.onRecoverableError!==void 0&&(b=i.onRecoverableError)),i=t0(t,1,!1,null,null,l,r,null,f,m,b,d0),t[ai]=i.current,Cd(t),new Kd(i)},xo.hydrateRoot=function(t,i,l){if(!o(t))throw Error(a(299));var r=!1,f="",m=Sg,b=wg,M=xg,U=null;return l!=null&&(l.unstable_strictMode===!0&&(r=!0),l.identifierPrefix!==void 0&&(f=l.identifierPrefix),l.onUncaughtError!==void 0&&(m=l.onUncaughtError),l.onCaughtError!==void 0&&(b=l.onCaughtError),l.onRecoverableError!==void 0&&(M=l.onRecoverableError),l.formState!==void 0&&(U=l.formState)),i=t0(t,1,!0,i,l??null,r,f,U,m,b,M,d0),i.context=n0(null),l=i.current,r=rn(),r=Vt(r),f=Gi(r),f.callback=null,Xi(l,f,r),l=r,i.current.lanes=l,si(i,l),Qn(i),t[ai]=i.current,Cd(t),new xc(i)},xo.version="19.2.7",xo}var E0;function SE(){if(E0)return Fd.exports;E0=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(n){console.error(n)}}return e(),Fd.exports=bE(),Fd.exports}var wE=SE();function bt(e){if(typeof e=="string"||typeof e=="number")return""+e;let n="";if(Array.isArray(e))for(let s=0,a;s<e.length;s++)(a=bt(e[s]))!==""&&(n+=(n&&" ")+a);else for(let s in e)e[s]&&(n+=(n&&" ")+s);return n}var xE={value:()=>{}};function hu(){for(var e=0,n=arguments.length,s={},a;e<n;++e){if(!(a=arguments[e]+"")||a in s||/[\s.]/.test(a))throw new Error("illegal type: "+a);s[a]=[]}return new Hc(s)}function Hc(e){this._=e}function EE(e,n){return e.trim().split(/^|\s+/).map(function(s){var a="",o=s.indexOf(".");if(o>=0&&(a=s.slice(o+1),s=s.slice(0,o)),s&&!n.hasOwnProperty(s))throw new Error("unknown type: "+s);return{type:s,name:a}})}Hc.prototype=hu.prototype={constructor:Hc,on:function(e,n){var s=this._,a=EE(e+"",s),o,c=-1,u=a.length;if(arguments.length<2){for(;++c<u;)if((o=(e=a[c]).type)&&(o=NE(s[o],e.name)))return o;return}if(n!=null&&typeof n!="function")throw new Error("invalid callback: "+n);for(;++c<u;)if(o=(e=a[c]).type)s[o]=N0(s[o],e.name,n);else if(n==null)for(o in s)s[o]=N0(s[o],e.name,null);return this},copy:function(){var e={},n=this._;for(var s in n)e[s]=n[s].slice();return new Hc(e)},call:function(e,n){if((o=arguments.length-2)>0)for(var s=new Array(o),a=0,o,c;a<o;++a)s[a]=arguments[a+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(c=this._[e],a=0,o=c.length;a<o;++a)c[a].value.apply(n,s)},apply:function(e,n,s){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var a=this._[e],o=0,c=a.length;o<c;++o)a[o].value.apply(n,s)}};function NE(e,n){for(var s=0,a=e.length,o;s<a;++s)if((o=e[s]).name===n)return o.value}function N0(e,n,s){for(var a=0,o=e.length;a<o;++a)if(e[a].name===n){e[a]=xE,e=e.slice(0,a).concat(e.slice(a+1));break}return s!=null&&e.push({name:n,value:s}),e}var Eh="http://www.w3.org/1999/xhtml";const _0={svg:"http://www.w3.org/2000/svg",xhtml:Eh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function mu(e){var n=e+="",s=n.indexOf(":");return s>=0&&(n=e.slice(0,s))!=="xmlns"&&(e=e.slice(s+1)),_0.hasOwnProperty(n)?{space:_0[n],local:e}:e}function _E(e){return function(){var n=this.ownerDocument,s=this.namespaceURI;return s===Eh&&n.documentElement.namespaceURI===Eh?n.createElement(e):n.createElementNS(s,e)}}function AE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function lb(e){var n=mu(e);return(n.local?AE:_E)(n)}function TE(){}function Fh(e){return e==null?TE:function(){return this.querySelector(e)}}function CE(e){typeof e!="function"&&(e=Fh(e));for(var n=this._groups,s=n.length,a=new Array(s),o=0;o<s;++o)for(var c=n[o],u=c.length,d=a[o]=new Array(u),h,p,v=0;v<u;++v)(h=c[v])&&(p=e.call(h,h.__data__,v,c))&&("__data__"in h&&(p.__data__=h.__data__),d[v]=p);return new dn(a,this._parents)}function ME(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function OE(){return[]}function ob(e){return e==null?OE:function(){return this.querySelectorAll(e)}}function kE(e){return function(){return ME(e.apply(this,arguments))}}function zE(e){typeof e=="function"?e=kE(e):e=ob(e);for(var n=this._groups,s=n.length,a=[],o=[],c=0;c<s;++c)for(var u=n[c],d=u.length,h,p=0;p<d;++p)(h=u[p])&&(a.push(e.call(h,h.__data__,p,u)),o.push(h));return new dn(a,o)}function rb(e){return function(){return this.matches(e)}}function cb(e){return function(n){return n.matches(e)}}var jE=Array.prototype.find;function DE(e){return function(){return jE.call(this.children,e)}}function RE(){return this.firstElementChild}function BE(e){return this.select(e==null?RE:DE(typeof e=="function"?e:cb(e)))}var LE=Array.prototype.filter;function $E(){return Array.from(this.children)}function HE(e){return function(){return LE.call(this.children,e)}}function UE(e){return this.selectAll(e==null?$E:HE(typeof e=="function"?e:cb(e)))}function IE(e){typeof e!="function"&&(e=rb(e));for(var n=this._groups,s=n.length,a=new Array(s),o=0;o<s;++o)for(var c=n[o],u=c.length,d=a[o]=[],h,p=0;p<u;++p)(h=c[p])&&e.call(h,h.__data__,p,c)&&d.push(h);return new dn(a,this._parents)}function ub(e){return new Array(e.length)}function qE(){return new dn(this._enter||this._groups.map(ub),this._parents)}function Jc(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}Jc.prototype={constructor:Jc,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,n){return this._parent.insertBefore(e,n)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function VE(e){return function(){return e}}function YE(e,n,s,a,o,c){for(var u=0,d,h=n.length,p=c.length;u<p;++u)(d=n[u])?(d.__data__=c[u],a[u]=d):s[u]=new Jc(e,c[u]);for(;u<h;++u)(d=n[u])&&(o[u]=d)}function GE(e,n,s,a,o,c,u){var d,h,p=new Map,v=n.length,g=c.length,y=new Array(v),w;for(d=0;d<v;++d)(h=n[d])&&(y[d]=w=u.call(h,h.__data__,d,n)+"",p.has(w)?o[d]=h:p.set(w,h));for(d=0;d<g;++d)w=u.call(e,c[d],d,c)+"",(h=p.get(w))?(a[d]=h,h.__data__=c[d],p.delete(w)):s[d]=new Jc(e,c[d]);for(d=0;d<v;++d)(h=n[d])&&p.get(y[d])===h&&(o[d]=h)}function XE(e){return e.__data__}function KE(e,n){if(!arguments.length)return Array.from(this,XE);var s=n?GE:YE,a=this._parents,o=this._groups;typeof e!="function"&&(e=VE(e));for(var c=o.length,u=new Array(c),d=new Array(c),h=new Array(c),p=0;p<c;++p){var v=a[p],g=o[p],y=g.length,w=QE(e.call(v,v&&v.__data__,p,a)),E=w.length,N=d[p]=new Array(E),A=u[p]=new Array(E),C=h[p]=new Array(y);s(v,g,N,A,C,w,n);for(var z=0,_=0,x,B;z<E;++z)if(x=N[z]){for(z>=_&&(_=z+1);!(B=A[_])&&++_<E;);x._next=B||null}}return u=new dn(u,a),u._enter=d,u._exit=h,u}function QE(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function ZE(){return new dn(this._exit||this._groups.map(ub),this._parents)}function FE(e,n,s){var a=this.enter(),o=this,c=this.exit();return typeof e=="function"?(a=e(a),a&&(a=a.selection())):a=a.append(e+""),n!=null&&(o=n(o),o&&(o=o.selection())),s==null?c.remove():s(c),a&&o?a.merge(o).order():o}function JE(e){for(var n=e.selection?e.selection():e,s=this._groups,a=n._groups,o=s.length,c=a.length,u=Math.min(o,c),d=new Array(o),h=0;h<u;++h)for(var p=s[h],v=a[h],g=p.length,y=d[h]=new Array(g),w,E=0;E<g;++E)(w=p[E]||v[E])&&(y[E]=w);for(;h<o;++h)d[h]=s[h];return new dn(d,this._parents)}function WE(){for(var e=this._groups,n=-1,s=e.length;++n<s;)for(var a=e[n],o=a.length-1,c=a[o],u;--o>=0;)(u=a[o])&&(c&&u.compareDocumentPosition(c)^4&&c.parentNode.insertBefore(u,c),c=u);return this}function PE(e){e||(e=e2);function n(g,y){return g&&y?e(g.__data__,y.__data__):!g-!y}for(var s=this._groups,a=s.length,o=new Array(a),c=0;c<a;++c){for(var u=s[c],d=u.length,h=o[c]=new Array(d),p,v=0;v<d;++v)(p=u[v])&&(h[v]=p);h.sort(n)}return new dn(o,this._parents).order()}function e2(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function t2(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function n2(){return Array.from(this)}function i2(){for(var e=this._groups,n=0,s=e.length;n<s;++n)for(var a=e[n],o=0,c=a.length;o<c;++o){var u=a[o];if(u)return u}return null}function s2(){let e=0;for(const n of this)++e;return e}function a2(){return!this.node()}function l2(e){for(var n=this._groups,s=0,a=n.length;s<a;++s)for(var o=n[s],c=0,u=o.length,d;c<u;++c)(d=o[c])&&e.call(d,d.__data__,c,o);return this}function o2(e){return function(){this.removeAttribute(e)}}function r2(e){return function(){this.removeAttributeNS(e.space,e.local)}}function c2(e,n){return function(){this.setAttribute(e,n)}}function u2(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function f2(e,n){return function(){var s=n.apply(this,arguments);s==null?this.removeAttribute(e):this.setAttribute(e,s)}}function d2(e,n){return function(){var s=n.apply(this,arguments);s==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,s)}}function h2(e,n){var s=mu(e);if(arguments.length<2){var a=this.node();return s.local?a.getAttributeNS(s.space,s.local):a.getAttribute(s)}return this.each((n==null?s.local?r2:o2:typeof n=="function"?s.local?d2:f2:s.local?u2:c2)(s,n))}function fb(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function m2(e){return function(){this.style.removeProperty(e)}}function p2(e,n,s){return function(){this.style.setProperty(e,n,s)}}function g2(e,n,s){return function(){var a=n.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,s)}}function y2(e,n,s){return arguments.length>1?this.each((n==null?m2:typeof n=="function"?g2:p2)(e,n,s??"")):ol(this.node(),e)}function ol(e,n){return e.style.getPropertyValue(n)||fb(e).getComputedStyle(e,null).getPropertyValue(n)}function v2(e){return function(){delete this[e]}}function b2(e,n){return function(){this[e]=n}}function S2(e,n){return function(){var s=n.apply(this,arguments);s==null?delete this[e]:this[e]=s}}function w2(e,n){return arguments.length>1?this.each((n==null?v2:typeof n=="function"?S2:b2)(e,n)):this.node()[e]}function db(e){return e.trim().split(/^|\s+/)}function Jh(e){return e.classList||new hb(e)}function hb(e){this._node=e,this._names=db(e.getAttribute("class")||"")}hb.prototype={add:function(e){var n=this._names.indexOf(e);n<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var n=this._names.indexOf(e);n>=0&&(this._names.splice(n,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function mb(e,n){for(var s=Jh(e),a=-1,o=n.length;++a<o;)s.add(n[a])}function pb(e,n){for(var s=Jh(e),a=-1,o=n.length;++a<o;)s.remove(n[a])}function x2(e){return function(){mb(this,e)}}function E2(e){return function(){pb(this,e)}}function N2(e,n){return function(){(n.apply(this,arguments)?mb:pb)(this,e)}}function _2(e,n){var s=db(e+"");if(arguments.length<2){for(var a=Jh(this.node()),o=-1,c=s.length;++o<c;)if(!a.contains(s[o]))return!1;return!0}return this.each((typeof n=="function"?N2:n?x2:E2)(s,n))}function A2(){this.textContent=""}function T2(e){return function(){this.textContent=e}}function C2(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function M2(e){return arguments.length?this.each(e==null?A2:(typeof e=="function"?C2:T2)(e)):this.node().textContent}function O2(){this.innerHTML=""}function k2(e){return function(){this.innerHTML=e}}function z2(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function j2(e){return arguments.length?this.each(e==null?O2:(typeof e=="function"?z2:k2)(e)):this.node().innerHTML}function D2(){this.nextSibling&&this.parentNode.appendChild(this)}function R2(){return this.each(D2)}function B2(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function L2(){return this.each(B2)}function $2(e){var n=typeof e=="function"?e:lb(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function H2(){return null}function U2(e,n){var s=typeof e=="function"?e:lb(e),a=n==null?H2:typeof n=="function"?n:Fh(n);return this.select(function(){return this.insertBefore(s.apply(this,arguments),a.apply(this,arguments)||null)})}function I2(){var e=this.parentNode;e&&e.removeChild(this)}function q2(){return this.each(I2)}function V2(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function Y2(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function G2(e){return this.select(e?Y2:V2)}function X2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function K2(e){return function(n){e.call(this,n,this.__data__)}}function Q2(e){return e.trim().split(/^|\s+/).map(function(n){var s="",a=n.indexOf(".");return a>=0&&(s=n.slice(a+1),n=n.slice(0,a)),{type:n,name:s}})}function Z2(e){return function(){var n=this.__on;if(n){for(var s=0,a=-1,o=n.length,c;s<o;++s)c=n[s],(!e.type||c.type===e.type)&&c.name===e.name?this.removeEventListener(c.type,c.listener,c.options):n[++a]=c;++a?n.length=a:delete this.__on}}}function F2(e,n,s){return function(){var a=this.__on,o,c=K2(n);if(a){for(var u=0,d=a.length;u<d;++u)if((o=a[u]).type===e.type&&o.name===e.name){this.removeEventListener(o.type,o.listener,o.options),this.addEventListener(o.type,o.listener=c,o.options=s),o.value=n;return}}this.addEventListener(e.type,c,s),o={type:e.type,name:e.name,value:n,listener:c,options:s},a?a.push(o):this.__on=[o]}}function J2(e,n,s){var a=Q2(e+""),o,c=a.length,u;if(arguments.length<2){var d=this.node().__on;if(d){for(var h=0,p=d.length,v;h<p;++h)for(o=0,v=d[h];o<c;++o)if((u=a[o]).type===v.type&&u.name===v.name)return v.value}return}for(d=n?F2:Z2,o=0;o<c;++o)this.each(d(a[o],n,s));return this}function gb(e,n,s){var a=fb(e),o=a.CustomEvent;typeof o=="function"?o=new o(n,s):(o=a.document.createEvent("Event"),s?(o.initEvent(n,s.bubbles,s.cancelable),o.detail=s.detail):o.initEvent(n,!1,!1)),e.dispatchEvent(o)}function W2(e,n){return function(){return gb(this,e,n)}}function P2(e,n){return function(){return gb(this,e,n.apply(this,arguments))}}function eN(e,n){return this.each((typeof n=="function"?P2:W2)(e,n))}function*tN(){for(var e=this._groups,n=0,s=e.length;n<s;++n)for(var a=e[n],o=0,c=a.length,u;o<c;++o)(u=a[o])&&(yield u)}var yb=[null];function dn(e,n){this._groups=e,this._parents=n}function Wo(){return new dn([[document.documentElement]],yb)}function nN(){return this}dn.prototype=Wo.prototype={constructor:dn,select:CE,selectAll:zE,selectChild:BE,selectChildren:UE,filter:IE,data:KE,enter:qE,exit:ZE,join:FE,merge:JE,selection:nN,order:WE,sort:PE,call:t2,nodes:n2,node:i2,size:s2,empty:a2,each:l2,attr:h2,style:y2,property:w2,classed:_2,text:M2,html:j2,raise:R2,lower:L2,append:$2,insert:U2,remove:q2,clone:G2,datum:X2,on:J2,dispatch:eN,[Symbol.iterator]:tN};function cn(e){return typeof e=="string"?new dn([[document.querySelector(e)]],[document.documentElement]):new dn([[e]],yb)}function iN(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Rn(e,n){if(e=iN(e),n===void 0&&(n=e.currentTarget),n){var s=n.ownerSVGElement||n;if(s.createSVGPoint){var a=s.createSVGPoint();return a.x=e.clientX,a.y=e.clientY,a=a.matrixTransform(n.getScreenCTM().inverse()),[a.x,a.y]}if(n.getBoundingClientRect){var o=n.getBoundingClientRect();return[e.clientX-o.left-n.clientLeft,e.clientY-o.top-n.clientTop]}}return[e.pageX,e.pageY]}const sN={passive:!1},Bo={capture:!0,passive:!1};function eh(e){e.stopImmediatePropagation()}function Pa(e){e.preventDefault(),e.stopImmediatePropagation()}function vb(e){var n=e.document.documentElement,s=cn(e).on("dragstart.drag",Pa,Bo);"onselectstart"in n?s.on("selectstart.drag",Pa,Bo):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function bb(e,n){var s=e.document.documentElement,a=cn(e).on("dragstart.drag",null);n&&(a.on("click.drag",Pa,Bo),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 Nc=e=>()=>e;function Nh(e,{sourceEvent:n,subject:s,target:a,identifier:o,active:c,x:u,y:d,dx:h,dy:p,dispatch:v}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},subject:{value:s,enumerable:!0,configurable:!0},target:{value:a,enumerable:!0,configurable:!0},identifier:{value:o,enumerable:!0,configurable:!0},active:{value:c,enumerable:!0,configurable:!0},x:{value:u,enumerable:!0,configurable:!0},y:{value:d,enumerable:!0,configurable:!0},dx:{value:h,enumerable:!0,configurable:!0},dy:{value:p,enumerable:!0,configurable:!0},_:{value:v}})}Nh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function aN(e){return!e.ctrlKey&&!e.button}function lN(){return this.parentNode}function oN(e,n){return n??{x:e.x,y:e.y}}function rN(){return navigator.maxTouchPoints||"ontouchstart"in this}function Sb(){var e=aN,n=lN,s=oN,a=rN,o={},c=hu("start","drag","end"),u=0,d,h,p,v,g=0;function y(x){x.on("mousedown.drag",w).filter(a).on("touchstart.drag",A).on("touchmove.drag",C,sN).on("touchend.drag touchcancel.drag",z).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function w(x,B){if(!(v||!e.call(this,x,B))){var j=_(this,n.call(this,x,B),x,B,"mouse");j&&(cn(x.view).on("mousemove.drag",E,Bo).on("mouseup.drag",N,Bo),vb(x.view),eh(x),p=!1,d=x.clientX,h=x.clientY,j("start",x))}}function E(x){if(Pa(x),!p){var B=x.clientX-d,j=x.clientY-h;p=B*B+j*j>g}o.mouse("drag",x)}function N(x){cn(x.view).on("mousemove.drag mouseup.drag",null),bb(x.view,p),Pa(x),o.mouse("end",x)}function A(x,B){if(e.call(this,x,B)){var j=x.changedTouches,T=n.call(this,x,B),D=j.length,R,Z;for(R=0;R<D;++R)(Z=_(this,T,x,B,j[R].identifier,j[R]))&&(eh(x),Z("start",x,j[R]))}}function C(x){var B=x.changedTouches,j=B.length,T,D;for(T=0;T<j;++T)(D=o[B[T].identifier])&&(Pa(x),D("drag",x,B[T]))}function z(x){var B=x.changedTouches,j=B.length,T,D;for(v&&clearTimeout(v),v=setTimeout(function(){v=null},500),T=0;T<j;++T)(D=o[B[T].identifier])&&(eh(x),D("end",x,B[T]))}function _(x,B,j,T,D,R){var Z=c.copy(),Y=Rn(R||j,B),K,le,L;if((L=s.call(x,new Nh("beforestart",{sourceEvent:j,target:y,identifier:D,active:u,x:Y[0],y:Y[1],dx:0,dy:0,dispatch:Z}),T))!=null)return K=L.x-Y[0]||0,le=L.y-Y[1]||0,function G(k,$,H){var X=Y,W;switch(k){case"start":o[D]=G,W=u++;break;case"end":delete o[D],--u;case"drag":Y=Rn(H||$,B),W=u;break}Z.call(k,x,new Nh(k,{sourceEvent:$,subject:L,target:y,identifier:D,active:W,x:Y[0]+K,y:Y[1]+le,dx:Y[0]-X[0],dy:Y[1]-X[1],dispatch:Z}),T)}}return y.filter=function(x){return arguments.length?(e=typeof x=="function"?x:Nc(!!x),y):e},y.container=function(x){return arguments.length?(n=typeof x=="function"?x:Nc(x),y):n},y.subject=function(x){return arguments.length?(s=typeof x=="function"?x:Nc(x),y):s},y.touchable=function(x){return arguments.length?(a=typeof x=="function"?x:Nc(!!x),y):a},y.on=function(){var x=c.on.apply(c,arguments);return x===c?y:x},y.clickDistance=function(x){return arguments.length?(g=(x=+x)*x,y):Math.sqrt(g)},y}function Wh(e,n,s){e.prototype=n.prototype=s,s.constructor=e}function wb(e,n){var s=Object.create(e.prototype);for(var a in n)s[a]=n[a];return s}function Po(){}var Lo=.7,Wc=1/Lo,el="\\s*([+-]?\\d+)\\s*",$o="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Jn="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",cN=/^#([0-9a-f]{3,8})$/,uN=new RegExp(`^rgb\\(${el},${el},${el}\\)$`),fN=new RegExp(`^rgb\\(${Jn},${Jn},${Jn}\\)$`),dN=new RegExp(`^rgba\\(${el},${el},${el},${$o}\\)$`),hN=new RegExp(`^rgba\\(${Jn},${Jn},${Jn},${$o}\\)$`),mN=new RegExp(`^hsl\\(${$o},${Jn},${Jn}\\)$`),pN=new RegExp(`^hsla\\(${$o},${Jn},${Jn},${$o}\\)$`),A0={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};Wh(Po,Ys,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:T0,formatHex:T0,formatHex8:gN,formatHsl:yN,formatRgb:C0,toString:C0});function T0(){return this.rgb().formatHex()}function gN(){return this.rgb().formatHex8()}function yN(){return xb(this).formatHsl()}function C0(){return this.rgb().formatRgb()}function Ys(e){var n,s;return e=(e+"").trim().toLowerCase(),(n=cN.exec(e))?(s=n[1].length,n=parseInt(n[1],16),s===6?M0(n):s===3?new Pt(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):s===8?_c(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):s===4?_c(n>>12&15|n>>8&240,n>>8&15|n>>4&240,n>>4&15|n&240,((n&15)<<4|n&15)/255):null):(n=uN.exec(e))?new Pt(n[1],n[2],n[3],1):(n=fN.exec(e))?new Pt(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=dN.exec(e))?_c(n[1],n[2],n[3],n[4]):(n=hN.exec(e))?_c(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=mN.exec(e))?z0(n[1],n[2]/100,n[3]/100,1):(n=pN.exec(e))?z0(n[1],n[2]/100,n[3]/100,n[4]):A0.hasOwnProperty(e)?M0(A0[e]):e==="transparent"?new Pt(NaN,NaN,NaN,0):null}function M0(e){return new Pt(e>>16&255,e>>8&255,e&255,1)}function _c(e,n,s,a){return a<=0&&(e=n=s=NaN),new Pt(e,n,s,a)}function vN(e){return e instanceof Po||(e=Ys(e)),e?(e=e.rgb(),new Pt(e.r,e.g,e.b,e.opacity)):new Pt}function _h(e,n,s,a){return arguments.length===1?vN(e):new Pt(e,n,s,a??1)}function Pt(e,n,s,a){this.r=+e,this.g=+n,this.b=+s,this.opacity=+a}Wh(Pt,_h,wb(Po,{brighter(e){return e=e==null?Wc:Math.pow(Wc,e),new Pt(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Lo:Math.pow(Lo,e),new Pt(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new Pt(qs(this.r),qs(this.g),qs(this.b),Pc(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:O0,formatHex:O0,formatHex8:bN,formatRgb:k0,toString:k0}));function O0(){return`#${$s(this.r)}${$s(this.g)}${$s(this.b)}`}function bN(){return`#${$s(this.r)}${$s(this.g)}${$s(this.b)}${$s((isNaN(this.opacity)?1:this.opacity)*255)}`}function k0(){const e=Pc(this.opacity);return`${e===1?"rgb(":"rgba("}${qs(this.r)}, ${qs(this.g)}, ${qs(this.b)}${e===1?")":`, ${e})`}`}function Pc(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function qs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function $s(e){return e=qs(e),(e<16?"0":"")+e.toString(16)}function z0(e,n,s,a){return a<=0?e=n=s=NaN:s<=0||s>=1?e=n=NaN:n<=0&&(e=NaN),new Ln(e,n,s,a)}function xb(e){if(e instanceof Ln)return new Ln(e.h,e.s,e.l,e.opacity);if(e instanceof Po||(e=Ys(e)),!e)return new Ln;if(e instanceof Ln)return e;e=e.rgb();var n=e.r/255,s=e.g/255,a=e.b/255,o=Math.min(n,s,a),c=Math.max(n,s,a),u=NaN,d=c-o,h=(c+o)/2;return d?(n===c?u=(s-a)/d+(s<a)*6:s===c?u=(a-n)/d+2:u=(n-s)/d+4,d/=h<.5?c+o:2-c-o,u*=60):d=h>0&&h<1?0:u,new Ln(u,d,h,e.opacity)}function SN(e,n,s,a){return arguments.length===1?xb(e):new Ln(e,n,s,a??1)}function Ln(e,n,s,a){this.h=+e,this.s=+n,this.l=+s,this.opacity=+a}Wh(Ln,SN,wb(Po,{brighter(e){return e=e==null?Wc:Math.pow(Wc,e),new Ln(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Lo:Math.pow(Lo,e),new Ln(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,n=isNaN(e)||isNaN(this.s)?0:this.s,s=this.l,a=s+(s<.5?s:1-s)*n,o=2*s-a;return new Pt(th(e>=240?e-240:e+120,o,a),th(e,o,a),th(e<120?e+240:e-120,o,a),this.opacity)},clamp(){return new Ln(j0(this.h),Ac(this.s),Ac(this.l),Pc(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 e=Pc(this.opacity);return`${e===1?"hsl(":"hsla("}${j0(this.h)}, ${Ac(this.s)*100}%, ${Ac(this.l)*100}%${e===1?")":`, ${e})`}`}}));function j0(e){return e=(e||0)%360,e<0?e+360:e}function Ac(e){return Math.max(0,Math.min(1,e||0))}function th(e,n,s){return(e<60?n+(s-n)*e/60:e<180?s:e<240?n+(s-n)*(240-e)/60:n)*255}const Ph=e=>()=>e;function wN(e,n){return function(s){return e+s*n}}function xN(e,n,s){return e=Math.pow(e,s),n=Math.pow(n,s)-e,s=1/s,function(a){return Math.pow(e+a*n,s)}}function EN(e){return(e=+e)==1?Eb:function(n,s){return s-n?xN(n,s,e):Ph(isNaN(n)?s:n)}}function Eb(e,n){var s=n-e;return s?wN(e,s):Ph(isNaN(e)?n:e)}const eu=(function e(n){var s=EN(n);function a(o,c){var u=s((o=_h(o)).r,(c=_h(c)).r),d=s(o.g,c.g),h=s(o.b,c.b),p=Eb(o.opacity,c.opacity);return function(v){return o.r=u(v),o.g=d(v),o.b=h(v),o.opacity=p(v),o+""}}return a.gamma=e,a})(1);function NN(e,n){n||(n=[]);var s=e?Math.min(n.length,e.length):0,a=n.slice(),o;return function(c){for(o=0;o<s;++o)a[o]=e[o]*(1-c)+n[o]*c;return a}}function _N(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function AN(e,n){var s=n?n.length:0,a=e?Math.min(s,e.length):0,o=new Array(a),c=new Array(s),u;for(u=0;u<a;++u)o[u]=ko(e[u],n[u]);for(;u<s;++u)c[u]=n[u];return function(d){for(u=0;u<a;++u)c[u]=o[u](d);return c}}function TN(e,n){var s=new Date;return e=+e,n=+n,function(a){return s.setTime(e*(1-a)+n*a),s}}function Fn(e,n){return e=+e,n=+n,function(s){return e*(1-s)+n*s}}function CN(e,n){var s={},a={},o;(e===null||typeof e!="object")&&(e={}),(n===null||typeof n!="object")&&(n={});for(o in n)o in e?s[o]=ko(e[o],n[o]):a[o]=n[o];return function(c){for(o in s)a[o]=s[o](c);return a}}var Ah=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,nh=new RegExp(Ah.source,"g");function MN(e){return function(){return e}}function ON(e){return function(n){return e(n)+""}}function Nb(e,n){var s=Ah.lastIndex=nh.lastIndex=0,a,o,c,u=-1,d=[],h=[];for(e=e+"",n=n+"";(a=Ah.exec(e))&&(o=nh.exec(n));)(c=o.index)>s&&(c=n.slice(s,c),d[u]?d[u]+=c:d[++u]=c),(a=a[0])===(o=o[0])?d[u]?d[u]+=o:d[++u]=o:(d[++u]=null,h.push({i:u,x:Fn(a,o)})),s=nh.lastIndex;return s<n.length&&(c=n.slice(s),d[u]?d[u]+=c:d[++u]=c),d.length<2?h[0]?ON(h[0].x):MN(n):(n=h.length,function(p){for(var v=0,g;v<n;++v)d[(g=h[v]).i]=g.x(p);return d.join("")})}function ko(e,n){var s=typeof n,a;return n==null||s==="boolean"?Ph(n):(s==="number"?Fn:s==="string"?(a=Ys(n))?(n=a,eu):Nb:n instanceof Ys?eu:n instanceof Date?TN:_N(n)?NN:Array.isArray(n)?AN:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?CN:Fn)(e,n)}var D0=180/Math.PI,Th={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function _b(e,n,s,a,o,c){var u,d,h;return(u=Math.sqrt(e*e+n*n))&&(e/=u,n/=u),(h=e*s+n*a)&&(s-=e*h,a-=n*h),(d=Math.sqrt(s*s+a*a))&&(s/=d,a/=d,h/=d),e*a<n*s&&(e=-e,n=-n,h=-h,u=-u),{translateX:o,translateY:c,rotate:Math.atan2(n,e)*D0,skewX:Math.atan(h)*D0,scaleX:u,scaleY:d}}var Tc;function kN(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Th:_b(n.a,n.b,n.c,n.d,n.e,n.f)}function zN(e){return e==null||(Tc||(Tc=document.createElementNS("http://www.w3.org/2000/svg","g")),Tc.setAttribute("transform",e),!(e=Tc.transform.baseVal.consolidate()))?Th:(e=e.matrix,_b(e.a,e.b,e.c,e.d,e.e,e.f))}function Ab(e,n,s,a){function o(p){return p.length?p.pop()+" ":""}function c(p,v,g,y,w,E){if(p!==g||v!==y){var N=w.push("translate(",null,n,null,s);E.push({i:N-4,x:Fn(p,g)},{i:N-2,x:Fn(v,y)})}else(g||y)&&w.push("translate("+g+n+y+s)}function u(p,v,g,y){p!==v?(p-v>180?v+=360:v-p>180&&(p+=360),y.push({i:g.push(o(g)+"rotate(",null,a)-2,x:Fn(p,v)})):v&&g.push(o(g)+"rotate("+v+a)}function d(p,v,g,y){p!==v?y.push({i:g.push(o(g)+"skewX(",null,a)-2,x:Fn(p,v)}):v&&g.push(o(g)+"skewX("+v+a)}function h(p,v,g,y,w,E){if(p!==g||v!==y){var N=w.push(o(w)+"scale(",null,",",null,")");E.push({i:N-4,x:Fn(p,g)},{i:N-2,x:Fn(v,y)})}else(g!==1||y!==1)&&w.push(o(w)+"scale("+g+","+y+")")}return function(p,v){var g=[],y=[];return p=e(p),v=e(v),c(p.translateX,p.translateY,v.translateX,v.translateY,g,y),u(p.rotate,v.rotate,g,y),d(p.skewX,v.skewX,g,y),h(p.scaleX,p.scaleY,v.scaleX,v.scaleY,g,y),p=v=null,function(w){for(var E=-1,N=y.length,A;++E<N;)g[(A=y[E]).i]=A.x(w);return g.join("")}}}var jN=Ab(kN,"px, ","px)","deg)"),DN=Ab(zN,", ",")",")"),RN=1e-12;function R0(e){return((e=Math.exp(e))+1/e)/2}function BN(e){return((e=Math.exp(e))-1/e)/2}function LN(e){return((e=Math.exp(2*e))-1)/(e+1)}const Uc=(function e(n,s,a){function o(c,u){var d=c[0],h=c[1],p=c[2],v=u[0],g=u[1],y=u[2],w=v-d,E=g-h,N=w*w+E*E,A,C;if(N<RN)C=Math.log(y/p)/n,A=function(T){return[d+T*w,h+T*E,p*Math.exp(n*T*C)]};else{var z=Math.sqrt(N),_=(y*y-p*p+a*N)/(2*p*s*z),x=(y*y-p*p-a*N)/(2*y*s*z),B=Math.log(Math.sqrt(_*_+1)-_),j=Math.log(Math.sqrt(x*x+1)-x);C=(j-B)/n,A=function(T){var D=T*C,R=R0(B),Z=p/(s*z)*(R*LN(n*D+B)-BN(B));return[d+Z*w,h+Z*E,p*R/R0(n*D+B)]}}return A.duration=C*1e3*n/Math.SQRT2,A}return o.rho=function(c){var u=Math.max(.001,+c),d=u*u,h=d*d;return e(u,d,h)},o})(Math.SQRT2,2,4);var rl=0,Ao=0,Eo=0,Tb=1e3,tu,To,nu=0,Gs=0,pu=0,Ho=typeof performance=="object"&&performance.now?performance:Date,Cb=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function em(){return Gs||(Cb($N),Gs=Ho.now()+pu)}function $N(){Gs=0}function iu(){this._call=this._time=this._next=null}iu.prototype=Mb.prototype={constructor:iu,restart:function(e,n,s){if(typeof e!="function")throw new TypeError("callback is not a function");s=(s==null?em():+s)+(n==null?0:+n),!this._next&&To!==this&&(To?To._next=this:tu=this,To=this),this._call=e,this._time=s,Ch()},stop:function(){this._call&&(this._call=null,this._time=1/0,Ch())}};function Mb(e,n,s){var a=new iu;return a.restart(e,n,s),a}function HN(){em(),++rl;for(var e=tu,n;e;)(n=Gs-e._time)>=0&&e._call.call(void 0,n),e=e._next;--rl}function B0(){Gs=(nu=Ho.now())+pu,rl=Ao=0;try{HN()}finally{rl=0,IN(),Gs=0}}function UN(){var e=Ho.now(),n=e-nu;n>Tb&&(pu-=n,nu=e)}function IN(){for(var e,n=tu,s,a=1/0;n;)n._call?(a>n._time&&(a=n._time),e=n,n=n._next):(s=n._next,n._next=null,n=e?e._next=s:tu=s);To=e,Ch(a)}function Ch(e){if(!rl){Ao&&(Ao=clearTimeout(Ao));var n=e-Gs;n>24?(e<1/0&&(Ao=setTimeout(B0,e-Ho.now()-pu)),Eo&&(Eo=clearInterval(Eo))):(Eo||(nu=Ho.now(),Eo=setInterval(UN,Tb)),rl=1,Cb(B0))}}function L0(e,n,s){var a=new iu;return n=n==null?0:+n,a.restart(o=>{a.stop(),e(o+n)},n,s),a}var qN=hu("start","end","cancel","interrupt"),VN=[],Ob=0,$0=1,Mh=2,Ic=3,H0=4,Oh=5,qc=6;function gu(e,n,s,a,o,c){var u=e.__transition;if(!u)e.__transition={};else if(s in u)return;YN(e,s,{name:n,index:a,group:o,on:qN,tween:VN,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:Ob})}function tm(e,n){var s=In(e,n);if(s.state>Ob)throw new Error("too late; already scheduled");return s}function ei(e,n){var s=In(e,n);if(s.state>Ic)throw new Error("too late; already running");return s}function In(e,n){var s=e.__transition;if(!s||!(s=s[n]))throw new Error("transition not found");return s}function YN(e,n,s){var a=e.__transition,o;a[n]=s,s.timer=Mb(c,0,s.time);function c(p){s.state=$0,s.timer.restart(u,s.delay,s.time),s.delay<=p&&u(p-s.delay)}function u(p){var v,g,y,w;if(s.state!==$0)return h();for(v in a)if(w=a[v],w.name===s.name){if(w.state===Ic)return L0(u);w.state===H0?(w.state=qc,w.timer.stop(),w.on.call("interrupt",e,e.__data__,w.index,w.group),delete a[v]):+v<n&&(w.state=qc,w.timer.stop(),w.on.call("cancel",e,e.__data__,w.index,w.group),delete a[v])}if(L0(function(){s.state===Ic&&(s.state=H0,s.timer.restart(d,s.delay,s.time),d(p))}),s.state=Mh,s.on.call("start",e,e.__data__,s.index,s.group),s.state===Mh){for(s.state=Ic,o=new Array(y=s.tween.length),v=0,g=-1;v<y;++v)(w=s.tween[v].value.call(e,e.__data__,s.index,s.group))&&(o[++g]=w);o.length=g+1}}function d(p){for(var v=p<s.duration?s.ease.call(null,p/s.duration):(s.timer.restart(h),s.state=Oh,1),g=-1,y=o.length;++g<y;)o[g].call(e,v);s.state===Oh&&(s.on.call("end",e,e.__data__,s.index,s.group),h())}function h(){s.state=qc,s.timer.stop(),delete a[n];for(var p in a)return;delete e.__transition}}function Vc(e,n){var s=e.__transition,a,o,c=!0,u;if(s){n=n==null?null:n+"";for(u in s){if((a=s[u]).name!==n){c=!1;continue}o=a.state>Mh&&a.state<Oh,a.state=qc,a.timer.stop(),a.on.call(o?"interrupt":"cancel",e,e.__data__,a.index,a.group),delete s[u]}c&&delete e.__transition}}function GN(e){return this.each(function(){Vc(this,e)})}function XN(e,n){var s,a;return function(){var o=ei(this,e),c=o.tween;if(c!==s){a=s=c;for(var u=0,d=a.length;u<d;++u)if(a[u].name===n){a=a.slice(),a.splice(u,1);break}}o.tween=a}}function KN(e,n,s){var a,o;if(typeof s!="function")throw new Error;return function(){var c=ei(this,e),u=c.tween;if(u!==a){o=(a=u).slice();for(var d={name:n,value:s},h=0,p=o.length;h<p;++h)if(o[h].name===n){o[h]=d;break}h===p&&o.push(d)}c.tween=o}}function QN(e,n){var s=this._id;if(e+="",arguments.length<2){for(var a=In(this.node(),s).tween,o=0,c=a.length,u;o<c;++o)if((u=a[o]).name===e)return u.value;return null}return this.each((n==null?XN:KN)(s,e,n))}function nm(e,n,s){var a=e._id;return e.each(function(){var o=ei(this,a);(o.value||(o.value={}))[n]=s.apply(this,arguments)}),function(o){return In(o,a).value[n]}}function kb(e,n){var s;return(typeof n=="number"?Fn:n instanceof Ys?eu:(s=Ys(n))?(n=s,eu):Nb)(e,n)}function ZN(e){return function(){this.removeAttribute(e)}}function FN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function JN(e,n,s){var a,o=s+"",c;return function(){var u=this.getAttribute(e);return u===o?null:u===a?c:c=n(a=u,s)}}function WN(e,n,s){var a,o=s+"",c;return function(){var u=this.getAttributeNS(e.space,e.local);return u===o?null:u===a?c:c=n(a=u,s)}}function PN(e,n,s){var a,o,c;return function(){var u,d=s(this),h;return d==null?void this.removeAttribute(e):(u=this.getAttribute(e),h=d+"",u===h?null:u===a&&h===o?c:(o=h,c=n(a=u,d)))}}function e_(e,n,s){var a,o,c;return function(){var u,d=s(this),h;return d==null?void this.removeAttributeNS(e.space,e.local):(u=this.getAttributeNS(e.space,e.local),h=d+"",u===h?null:u===a&&h===o?c:(o=h,c=n(a=u,d)))}}function t_(e,n){var s=mu(e),a=s==="transform"?DN:kb;return this.attrTween(e,typeof n=="function"?(s.local?e_:PN)(s,a,nm(this,"attr."+e,n)):n==null?(s.local?FN:ZN)(s):(s.local?WN:JN)(s,a,n))}function n_(e,n){return function(s){this.setAttribute(e,n.call(this,s))}}function i_(e,n){return function(s){this.setAttributeNS(e.space,e.local,n.call(this,s))}}function s_(e,n){var s,a;function o(){var c=n.apply(this,arguments);return c!==a&&(s=(a=c)&&i_(e,c)),s}return o._value=n,o}function a_(e,n){var s,a;function o(){var c=n.apply(this,arguments);return c!==a&&(s=(a=c)&&n_(e,c)),s}return o._value=n,o}function l_(e,n){var s="attr."+e;if(arguments.length<2)return(s=this.tween(s))&&s._value;if(n==null)return this.tween(s,null);if(typeof n!="function")throw new Error;var a=mu(e);return this.tween(s,(a.local?s_:a_)(a,n))}function o_(e,n){return function(){tm(this,e).delay=+n.apply(this,arguments)}}function r_(e,n){return n=+n,function(){tm(this,e).delay=n}}function c_(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?o_:r_)(n,e)):In(this.node(),n).delay}function u_(e,n){return function(){ei(this,e).duration=+n.apply(this,arguments)}}function f_(e,n){return n=+n,function(){ei(this,e).duration=n}}function d_(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?u_:f_)(n,e)):In(this.node(),n).duration}function h_(e,n){if(typeof n!="function")throw new Error;return function(){ei(this,e).ease=n}}function m_(e){var n=this._id;return arguments.length?this.each(h_(n,e)):In(this.node(),n).ease}function p_(e,n){return function(){var s=n.apply(this,arguments);if(typeof s!="function")throw new Error;ei(this,e).ease=s}}function g_(e){if(typeof e!="function")throw new Error;return this.each(p_(this._id,e))}function y_(e){typeof e!="function"&&(e=rb(e));for(var n=this._groups,s=n.length,a=new Array(s),o=0;o<s;++o)for(var c=n[o],u=c.length,d=a[o]=[],h,p=0;p<u;++p)(h=c[p])&&e.call(h,h.__data__,p,c)&&d.push(h);return new Mi(a,this._parents,this._name,this._id)}function v_(e){if(e._id!==this._id)throw new Error;for(var n=this._groups,s=e._groups,a=n.length,o=s.length,c=Math.min(a,o),u=new Array(a),d=0;d<c;++d)for(var h=n[d],p=s[d],v=h.length,g=u[d]=new Array(v),y,w=0;w<v;++w)(y=h[w]||p[w])&&(g[w]=y);for(;d<a;++d)u[d]=n[d];return new Mi(u,this._parents,this._name,this._id)}function b_(e){return(e+"").trim().split(/^|\s+/).every(function(n){var s=n.indexOf(".");return s>=0&&(n=n.slice(0,s)),!n||n==="start"})}function S_(e,n,s){var a,o,c=b_(n)?tm:ei;return function(){var u=c(this,e),d=u.on;d!==a&&(o=(a=d).copy()).on(n,s),u.on=o}}function w_(e,n){var s=this._id;return arguments.length<2?In(this.node(),s).on.on(e):this.each(S_(s,e,n))}function x_(e){return function(){var n=this.parentNode;for(var s in this.__transition)if(+s!==e)return;n&&n.removeChild(this)}}function E_(){return this.on("end.remove",x_(this._id))}function N_(e){var n=this._name,s=this._id;typeof e!="function"&&(e=Fh(e));for(var a=this._groups,o=a.length,c=new Array(o),u=0;u<o;++u)for(var d=a[u],h=d.length,p=c[u]=new Array(h),v,g,y=0;y<h;++y)(v=d[y])&&(g=e.call(v,v.__data__,y,d))&&("__data__"in v&&(g.__data__=v.__data__),p[y]=g,gu(p[y],n,s,y,p,In(v,s)));return new Mi(c,this._parents,n,s)}function __(e){var n=this._name,s=this._id;typeof e!="function"&&(e=ob(e));for(var a=this._groups,o=a.length,c=[],u=[],d=0;d<o;++d)for(var h=a[d],p=h.length,v,g=0;g<p;++g)if(v=h[g]){for(var y=e.call(v,v.__data__,g,h),w,E=In(v,s),N=0,A=y.length;N<A;++N)(w=y[N])&&gu(w,n,s,N,y,E);c.push(y),u.push(v)}return new Mi(c,u,n,s)}var A_=Wo.prototype.constructor;function T_(){return new A_(this._groups,this._parents)}function C_(e,n){var s,a,o;return function(){var c=ol(this,e),u=(this.style.removeProperty(e),ol(this,e));return c===u?null:c===s&&u===a?o:o=n(s=c,a=u)}}function zb(e){return function(){this.style.removeProperty(e)}}function M_(e,n,s){var a,o=s+"",c;return function(){var u=ol(this,e);return u===o?null:u===a?c:c=n(a=u,s)}}function O_(e,n,s){var a,o,c;return function(){var u=ol(this,e),d=s(this),h=d+"";return d==null&&(h=d=(this.style.removeProperty(e),ol(this,e))),u===h?null:u===a&&h===o?c:(o=h,c=n(a=u,d))}}function k_(e,n){var s,a,o,c="style."+n,u="end."+c,d;return function(){var h=ei(this,e),p=h.on,v=h.value[c]==null?d||(d=zb(n)):void 0;(p!==s||o!==v)&&(a=(s=p).copy()).on(u,o=v),h.on=a}}function z_(e,n,s){var a=(e+="")=="transform"?jN:kb;return n==null?this.styleTween(e,C_(e,a)).on("end.style."+e,zb(e)):typeof n=="function"?this.styleTween(e,O_(e,a,nm(this,"style."+e,n))).each(k_(this._id,e)):this.styleTween(e,M_(e,a,n),s).on("end.style."+e,null)}function j_(e,n,s){return function(a){this.style.setProperty(e,n.call(this,a),s)}}function D_(e,n,s){var a,o;function c(){var u=n.apply(this,arguments);return u!==o&&(a=(o=u)&&j_(e,u,s)),a}return c._value=n,c}function R_(e,n,s){var a="style."+(e+="");if(arguments.length<2)return(a=this.tween(a))&&a._value;if(n==null)return this.tween(a,null);if(typeof n!="function")throw new Error;return this.tween(a,D_(e,n,s??""))}function B_(e){return function(){this.textContent=e}}function L_(e){return function(){var n=e(this);this.textContent=n??""}}function $_(e){return this.tween("text",typeof e=="function"?L_(nm(this,"text",e)):B_(e==null?"":e+""))}function H_(e){return function(n){this.textContent=e.call(this,n)}}function U_(e){var n,s;function a(){var o=e.apply(this,arguments);return o!==s&&(n=(s=o)&&H_(o)),n}return a._value=e,a}function I_(e){var n="text";if(arguments.length<1)return(n=this.tween(n))&&n._value;if(e==null)return this.tween(n,null);if(typeof e!="function")throw new Error;return this.tween(n,U_(e))}function q_(){for(var e=this._name,n=this._id,s=jb(),a=this._groups,o=a.length,c=0;c<o;++c)for(var u=a[c],d=u.length,h,p=0;p<d;++p)if(h=u[p]){var v=In(h,n);gu(h,e,s,p,u,{time:v.time+v.delay+v.duration,delay:0,duration:v.duration,ease:v.ease})}return new Mi(a,this._parents,e,s)}function V_(){var e,n,s=this,a=s._id,o=s.size();return new Promise(function(c,u){var d={value:u},h={value:function(){--o===0&&c()}};s.each(function(){var p=ei(this,a),v=p.on;v!==e&&(n=(e=v).copy(),n._.cancel.push(d),n._.interrupt.push(d),n._.end.push(h)),p.on=n}),o===0&&c()})}var Y_=0;function Mi(e,n,s,a){this._groups=e,this._parents=n,this._name=s,this._id=a}function jb(){return++Y_}var Ni=Wo.prototype;Mi.prototype={constructor:Mi,select:N_,selectAll:__,selectChild:Ni.selectChild,selectChildren:Ni.selectChildren,filter:y_,merge:v_,selection:T_,transition:q_,call:Ni.call,nodes:Ni.nodes,node:Ni.node,size:Ni.size,empty:Ni.empty,each:Ni.each,on:w_,attr:t_,attrTween:l_,style:z_,styleTween:R_,text:$_,textTween:I_,remove:E_,tween:QN,delay:c_,duration:d_,ease:m_,easeVarying:g_,end:V_,[Symbol.iterator]:Ni[Symbol.iterator]};function G_(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var X_={time:null,delay:0,duration:250,ease:G_};function K_(e,n){for(var s;!(s=e.__transition)||!(s=s[n]);)if(!(e=e.parentNode))throw new Error(`transition ${n} not found`);return s}function Q_(e){var n,s;e instanceof Mi?(n=e._id,e=e._name):(n=jb(),(s=X_).time=em(),e=e==null?null:e+"");for(var a=this._groups,o=a.length,c=0;c<o;++c)for(var u=a[c],d=u.length,h,p=0;p<d;++p)(h=u[p])&&gu(h,e,n,p,u,s||K_(h,n));return new Mi(a,this._parents,e,n)}Wo.prototype.interrupt=GN;Wo.prototype.transition=Q_;const Cc=e=>()=>e;function Z_(e,{sourceEvent:n,target:s,transform:a,dispatch:o}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:n,enumerable:!0,configurable:!0},target:{value:s,enumerable:!0,configurable:!0},transform:{value:a,enumerable:!0,configurable:!0},_:{value:o}})}function Ai(e,n,s){this.k=e,this.x=n,this.y=s}Ai.prototype={constructor:Ai,scale:function(e){return e===1?this:new Ai(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Ai(this.k,this.x+this.k*e,this.y+this.k*n)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var yu=new Ai(1,0,0);Db.prototype=Ai.prototype;function Db(e){for(;!e.__zoom;)if(!(e=e.parentNode))return yu;return e.__zoom}function ih(e){e.stopImmediatePropagation()}function No(e){e.preventDefault(),e.stopImmediatePropagation()}function F_(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function J_(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function U0(){return this.__zoom||yu}function W_(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function P_(){return navigator.maxTouchPoints||"ontouchstart"in this}function eA(e,n,s){var a=e.invertX(n[0][0])-s[0][0],o=e.invertX(n[1][0])-s[1][0],c=e.invertY(n[0][1])-s[0][1],u=e.invertY(n[1][1])-s[1][1];return e.translate(o>a?(a+o)/2:Math.min(0,a)||Math.max(0,o),u>c?(c+u)/2:Math.min(0,c)||Math.max(0,u))}function Rb(){var e=F_,n=J_,s=eA,a=W_,o=P_,c=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],d=250,h=Uc,p=hu("start","zoom","end"),v,g,y,w=500,E=150,N=0,A=10;function C(L){L.property("__zoom",U0).on("wheel.zoom",D,{passive:!1}).on("mousedown.zoom",R).on("dblclick.zoom",Z).filter(o).on("touchstart.zoom",Y).on("touchmove.zoom",K).on("touchend.zoom touchcancel.zoom",le).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(L,G,k,$){var H=L.selection?L.selection():L;H.property("__zoom",U0),L!==H?B(L,G,k,$):H.interrupt().each(function(){j(this,arguments).event($).start().zoom(null,typeof G=="function"?G.apply(this,arguments):G).end()})},C.scaleBy=function(L,G,k,$){C.scaleTo(L,function(){var H=this.__zoom.k,X=typeof G=="function"?G.apply(this,arguments):G;return H*X},k,$)},C.scaleTo=function(L,G,k,$){C.transform(L,function(){var H=n.apply(this,arguments),X=this.__zoom,W=k==null?x(H):typeof k=="function"?k.apply(this,arguments):k,O=X.invert(W),I=typeof G=="function"?G.apply(this,arguments):G;return s(_(z(X,I),W,O),H,u)},k,$)},C.translateBy=function(L,G,k,$){C.transform(L,function(){return s(this.__zoom.translate(typeof G=="function"?G.apply(this,arguments):G,typeof k=="function"?k.apply(this,arguments):k),n.apply(this,arguments),u)},null,$)},C.translateTo=function(L,G,k,$,H){C.transform(L,function(){var X=n.apply(this,arguments),W=this.__zoom,O=$==null?x(X):typeof $=="function"?$.apply(this,arguments):$;return s(yu.translate(O[0],O[1]).scale(W.k).translate(typeof G=="function"?-G.apply(this,arguments):-G,typeof k=="function"?-k.apply(this,arguments):-k),X,u)},$,H)};function z(L,G){return G=Math.max(c[0],Math.min(c[1],G)),G===L.k?L:new Ai(G,L.x,L.y)}function _(L,G,k){var $=G[0]-k[0]*L.k,H=G[1]-k[1]*L.k;return $===L.x&&H===L.y?L:new Ai(L.k,$,H)}function x(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function B(L,G,k,$){L.on("start.zoom",function(){j(this,arguments).event($).start()}).on("interrupt.zoom end.zoom",function(){j(this,arguments).event($).end()}).tween("zoom",function(){var H=this,X=arguments,W=j(H,X).event($),O=n.apply(H,X),I=k==null?x(O):typeof k=="function"?k.apply(H,X):k,ee=Math.max(O[1][0]-O[0][0],O[1][1]-O[0][1]),ne=H.__zoom,fe=typeof G=="function"?G.apply(H,X):G,de=h(ne.invert(I).concat(ee/ne.k),fe.invert(I).concat(ee/fe.k));return function(ae){if(ae===1)ae=fe;else{var te=de(ae),ue=ee/te[2];ae=new Ai(ue,I[0]-te[0]*ue,I[1]-te[1]*ue)}W.zoom(null,ae)}})}function j(L,G,k){return!k&&L.__zooming||new T(L,G)}function T(L,G){this.that=L,this.args=G,this.active=0,this.sourceEvent=null,this.extent=n.apply(L,G),this.taps=0}T.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,G){return this.mouse&&L!=="mouse"&&(this.mouse[1]=G.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=G.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=G.invert(this.touch1[0])),this.that.__zoom=G,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var G=cn(this.that).datum();p.call(L,this.that,new Z_(L,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:p}),G)}};function D(L,...G){if(!e.apply(this,arguments))return;var k=j(this,G).event(L),$=this.__zoom,H=Math.max(c[0],Math.min(c[1],$.k*Math.pow(2,a.apply(this,arguments)))),X=Rn(L);if(k.wheel)(k.mouse[0][0]!==X[0]||k.mouse[0][1]!==X[1])&&(k.mouse[1]=$.invert(k.mouse[0]=X)),clearTimeout(k.wheel);else{if($.k===H)return;k.mouse=[X,$.invert(X)],Vc(this),k.start()}No(L),k.wheel=setTimeout(W,E),k.zoom("mouse",s(_(z($,H),k.mouse[0],k.mouse[1]),k.extent,u));function W(){k.wheel=null,k.end()}}function R(L,...G){if(y||!e.apply(this,arguments))return;var k=L.currentTarget,$=j(this,G,!0).event(L),H=cn(L.view).on("mousemove.zoom",I,!0).on("mouseup.zoom",ee,!0),X=Rn(L,k),W=L.clientX,O=L.clientY;vb(L.view),ih(L),$.mouse=[X,this.__zoom.invert(X)],Vc(this),$.start();function I(ne){if(No(ne),!$.moved){var fe=ne.clientX-W,de=ne.clientY-O;$.moved=fe*fe+de*de>N}$.event(ne).zoom("mouse",s(_($.that.__zoom,$.mouse[0]=Rn(ne,k),$.mouse[1]),$.extent,u))}function ee(ne){H.on("mousemove.zoom mouseup.zoom",null),bb(ne.view,$.moved),No(ne),$.event(ne).end()}}function Z(L,...G){if(e.apply(this,arguments)){var k=this.__zoom,$=Rn(L.changedTouches?L.changedTouches[0]:L,this),H=k.invert($),X=k.k*(L.shiftKey?.5:2),W=s(_(z(k,X),$,H),n.apply(this,G),u);No(L),d>0?cn(this).transition().duration(d).call(B,W,$,L):cn(this).call(C.transform,W,$,L)}}function Y(L,...G){if(e.apply(this,arguments)){var k=L.touches,$=k.length,H=j(this,G,L.changedTouches.length===$).event(L),X,W,O,I;for(ih(L),W=0;W<$;++W)O=k[W],I=Rn(O,this),I=[I,this.__zoom.invert(I),O.identifier],H.touch0?!H.touch1&&H.touch0[2]!==I[2]&&(H.touch1=I,H.taps=0):(H.touch0=I,X=!0,H.taps=1+!!v);v&&(v=clearTimeout(v)),X&&(H.taps<2&&(g=I[0],v=setTimeout(function(){v=null},w)),Vc(this),H.start())}}function K(L,...G){if(this.__zooming){var k=j(this,G).event(L),$=L.changedTouches,H=$.length,X,W,O,I;for(No(L),X=0;X<H;++X)W=$[X],O=Rn(W,this),k.touch0&&k.touch0[2]===W.identifier?k.touch0[0]=O:k.touch1&&k.touch1[2]===W.identifier&&(k.touch1[0]=O);if(W=k.that.__zoom,k.touch1){var ee=k.touch0[0],ne=k.touch0[1],fe=k.touch1[0],de=k.touch1[1],ae=(ae=fe[0]-ee[0])*ae+(ae=fe[1]-ee[1])*ae,te=(te=de[0]-ne[0])*te+(te=de[1]-ne[1])*te;W=z(W,Math.sqrt(ae/te)),O=[(ee[0]+fe[0])/2,(ee[1]+fe[1])/2],I=[(ne[0]+de[0])/2,(ne[1]+de[1])/2]}else if(k.touch0)O=k.touch0[0],I=k.touch0[1];else return;k.zoom("touch",s(_(W,O,I),k.extent,u))}}function le(L,...G){if(this.__zooming){var k=j(this,G).event(L),$=L.changedTouches,H=$.length,X,W;for(ih(L),y&&clearTimeout(y),y=setTimeout(function(){y=null},w),X=0;X<H;++X)W=$[X],k.touch0&&k.touch0[2]===W.identifier?delete k.touch0:k.touch1&&k.touch1[2]===W.identifier&&delete k.touch1;if(k.touch1&&!k.touch0&&(k.touch0=k.touch1,delete k.touch1),k.touch0)k.touch0[1]=this.__zoom.invert(k.touch0[0]);else if(k.end(),k.taps===2&&(W=Rn(W,this),Math.hypot(g[0]-W[0],g[1]-W[1])<A)){var O=cn(this).on("dblclick.zoom");O&&O.apply(this,arguments)}}}return C.wheelDelta=function(L){return arguments.length?(a=typeof L=="function"?L:Cc(+L),C):a},C.filter=function(L){return arguments.length?(e=typeof L=="function"?L:Cc(!!L),C):e},C.touchable=function(L){return arguments.length?(o=typeof L=="function"?L:Cc(!!L),C):o},C.extent=function(L){return arguments.length?(n=typeof L=="function"?L:Cc([[+L[0][0],+L[0][1]],[+L[1][0],+L[1][1]]]),C):n},C.scaleExtent=function(L){return arguments.length?(c[0]=+L[0],c[1]=+L[1],C):[c[0],c[1]]},C.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],C):[[u[0][0],u[0][1]],[u[1][0],u[1][1]]]},C.constrain=function(L){return arguments.length?(s=L,C):s},C.duration=function(L){return arguments.length?(d=+L,C):d},C.interpolate=function(L){return arguments.length?(h=L,C):h},C.on=function(){var L=p.on.apply(p,arguments);return L===p?C:L},C.clickDistance=function(L){return arguments.length?(N=(L=+L)*L,C):Math.sqrt(N)},C.tapDistance=function(L){return arguments.length?(A=+L,C):A},C}const Un={error001:(e="react")=>`Seems like you have not used zustand provider as an ancestor. Help: https://${e}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:e=>`Node type "${e}" 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:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:n,sourceHandle:s,targetHandle:a})=>`Couldn't create edge for ${e} handle id: "${e==="source"?s:a}", edge id: ${n}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/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:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Uo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Bb=["Enter"," ","Escape"],Lb={"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:e,x:n,y:s})=>`Moved selected node ${e}. New position, x: ${n}, 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 cl;(function(e){e.Strict="strict",e.Loose="loose"})(cl||(cl={}));var Vs;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Vs||(Vs={}));var Io;(function(e){e.Partial="partial",e.Full="full"})(Io||(Io={}));const $b={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ds;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ds||(ds={}));var qo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(qo||(qo={}));var he;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(he||(he={}));const I0={[he.Left]:he.Right,[he.Right]:he.Left,[he.Top]:he.Bottom,[he.Bottom]:he.Top};function Hb(e){return e===null?null:e?"valid":"invalid"}const Ub=e=>"id"in e&&"source"in e&&"target"in e,tA=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),im=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),er=(e,n=[0,0])=>{const{width:s,height:a}=Oi(e),o=e.origin??n,c=s*o[0],u=a*o[1];return{x:e.position.x-c,y:e.position.y-u}},nA=(e,n={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const s=e.reduce((a,o)=>{const c=typeof o=="string";let u=!n.nodeLookup&&!c?o:void 0;n.nodeLookup&&(u=c?n.nodeLookup.get(o):im(o)?o:n.nodeLookup.get(o.id));const d=u?su(u,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return vu(a,d)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return bu(s)},tr=(e,n={})=>{let s={x:1/0,y:1/0,x2:-1/0,y2:-1/0},a=!1;return e.forEach(o=>{(n.filter===void 0||n.filter(o))&&(s=vu(s,su(o)),a=!0)}),a?bu(s):{x:0,y:0,width:0,height:0}},sm=(e,n,[s,a,o]=[0,0,1],c=!1,u=!1)=>{const d={...yl(n,[s,a,o]),width:n.width/o,height:n.height/o},h=[];for(const p of e.values()){const{measured:v,selectable:g=!0,hidden:y=!1}=p;if(u&&!g||y)continue;const w=v.width??p.width??p.initialWidth??null,E=v.height??p.height??p.initialHeight??null,N=Vo(d,fl(p)),A=(w??0)*(E??0),C=c&&N>0;(!p.internals.handleBounds||C||N>=A||p.dragging)&&h.push(p)}return h},iA=(e,n)=>{const s=new Set;return e.forEach(a=>{s.add(a.id)}),n.filter(a=>s.has(a.source)||s.has(a.target))};function sA(e,n){const s=new Map,a=n?.nodes?new Set(n.nodes.map(o=>o.id)):null;return e.forEach(o=>{o.measured.width&&o.measured.height&&(n?.includeHiddenNodes||!o.hidden)&&(!a||a.has(o.id))&&s.set(o.id,o)}),s}async function aA({nodes:e,width:n,height:s,panZoom:a,minZoom:o,maxZoom:c},u){if(e.size===0)return!0;const d=sA(e,u),h=tr(d),p=lm(h,n,s,u?.minZoom??o,u?.maxZoom??c,u?.padding??.1);return await a.setViewport(p,{duration:u?.duration,ease:u?.ease,interpolate:u?.interpolate}),!0}function Ib({nodeId:e,nextPosition:n,nodeLookup:s,nodeOrigin:a=[0,0],nodeExtent:o,onError:c}){const u=s.get(e),d=u.parentId?s.get(u.parentId):void 0,{x:h,y:p}=d?d.internals.positionAbsolute:{x:0,y:0},v=u.origin??a;let g=u.extent||o;if(u.extent==="parent"&&!u.expandParent)if(!d)c?.("005",Un.error005());else{const w=d.measured.width,E=d.measured.height;w&&E&&(g=[[h,p],[h+w,p+E]])}else d&&Ks(u.extent)&&(g=[[u.extent[0][0]+h,u.extent[0][1]+p],[u.extent[1][0]+h,u.extent[1][1]+p]]);const y=Ks(g)?Xs(n,g,u.measured):n;return(u.measured.width===void 0||u.measured.height===void 0)&&c?.("015",Un.error015()),{position:{x:y.x-h+(u.measured.width??0)*v[0],y:y.y-p+(u.measured.height??0)*v[1]},positionAbsolute:y}}async function lA({nodesToRemove:e=[],edgesToRemove:n=[],nodes:s,edges:a,onBeforeDelete:o}){const c=new Set(e.map(y=>y.id)),u=[];for(const y of s){if(y.deletable===!1)continue;const w=c.has(y.id),E=!w&&y.parentId&&u.find(N=>N.id===y.parentId);(w||E)&&u.push(y)}const d=new Set(n.map(y=>y.id)),h=a.filter(y=>y.deletable!==!1),v=iA(u,h);for(const y of h)d.has(y.id)&&!v.find(E=>E.id===y.id)&&v.push(y);if(!o)return{edges:v,nodes:u};const g=await o({nodes:u,edges:v});return typeof g=="boolean"?g?{edges:v,nodes:u}:{edges:[],nodes:[]}:g}const ul=(e,n=0,s=1)=>Math.min(Math.max(e,n),s),Xs=(e={x:0,y:0},n,s)=>({x:ul(e.x,n[0][0],n[1][0]-(s?.width??0)),y:ul(e.y,n[0][1],n[1][1]-(s?.height??0))});function qb(e,n,s){const{width:a,height:o}=Oi(s),{x:c,y:u}=s.internals.positionAbsolute;return Xs(e,[[c,u],[c+a,u+o]],n)}const q0=(e,n,s)=>e<n?ul(Math.abs(e-n),1,n)/n:e>s?-ul(Math.abs(e-s),1,n)/n:0,am=(e,n,s=15,a=40)=>{const o=q0(e.x,a,n.width-a)*s,c=q0(e.y,a,n.height-a)*s;return[o,c]},vu=(e,n)=>({x:Math.min(e.x,n.x),y:Math.min(e.y,n.y),x2:Math.max(e.x2,n.x2),y2:Math.max(e.y2,n.y2)}),kh=({x:e,y:n,width:s,height:a})=>({x:e,y:n,x2:e+s,y2:n+a}),bu=({x:e,y:n,x2:s,y2:a})=>({x:e,y:n,width:s-e,height:a-n}),fl=(e,n=[0,0])=>{const{x:s,y:a}=im(e)?e.internals.positionAbsolute:er(e,n);return{x:s,y:a,width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}},su=(e,n=[0,0])=>{const{x:s,y:a}=im(e)?e.internals.positionAbsolute:er(e,n);return{x:s,y:a,x2:s+(e.measured?.width??e.width??e.initialWidth??0),y2:a+(e.measured?.height??e.height??e.initialHeight??0)}},Vb=(e,n)=>bu(vu(kh(e),kh(n))),Vo=(e,n)=>{const s=Math.max(0,Math.min(e.x+e.width,n.x+n.width)-Math.max(e.x,n.x)),a=Math.max(0,Math.min(e.y+e.height,n.y+n.height)-Math.max(e.y,n.y));return Math.ceil(s*a)},V0=e=>$n(e.width)&&$n(e.height)&&$n(e.x)&&$n(e.y),$n=e=>!isNaN(e)&&isFinite(e),Yb=(e,n)=>(s,a)=>{},nr=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),yl=({x:e,y:n},[s,a,o],c=!1,u=[1,1])=>{const d={x:(e-s)/o,y:(n-a)/o};return c?nr(d,u):d},dl=({x:e,y:n},[s,a,o])=>({x:e*o+s,y:n*o+a});function Ia(e,n){if(typeof e=="number")return Math.floor((n-n/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const s=parseFloat(e);if(!Number.isNaN(s))return Math.floor(s)}if(typeof e=="string"&&e.endsWith("%")){const s=parseFloat(e);if(!Number.isNaN(s))return Math.floor(n*s*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function oA(e,n,s){if(typeof e=="string"||typeof e=="number"){const a=Ia(e,s),o=Ia(e,n);return{top:a,right:o,bottom:a,left:o,x:o*2,y:a*2}}if(typeof e=="object"){const a=Ia(e.top??e.y??0,s),o=Ia(e.bottom??e.y??0,s),c=Ia(e.left??e.x??0,n),u=Ia(e.right??e.x??0,n);return{top:a,right:u,bottom:o,left:c,x:c+u,y:a+o}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function rA(e,n,s,a,o,c){const{x:u,y:d}=dl(e,[n,s,a]),{x:h,y:p}=dl({x:e.x+e.width,y:e.y+e.height},[n,s,a]),v=o-h,g=c-p;return{left:Math.floor(u),top:Math.floor(d),right:Math.floor(v),bottom:Math.floor(g)}}const lm=(e,n,s,a,o,c)=>{const u=oA(c,n,s),d=(n-u.x)/e.width,h=(s-u.y)/e.height,p=Math.min(d,h),v=ul(p,a,o),g=e.x+e.width/2,y=e.y+e.height/2,w=n/2-g*v,E=s/2-y*v,N=rA(e,w,E,v,n,s),A={left:Math.min(N.left-u.left,0),top:Math.min(N.top-u.top,0),right:Math.min(N.right-u.right,0),bottom:Math.min(N.bottom-u.bottom,0)};return{x:w-A.left+A.right,y:E-A.top+A.bottom,zoom:v}},Yo=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Ks(e){return e!=null&&e!=="parent"}function Oi(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Gb(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function Xb(e,n={width:0,height:0},s,a,o){const c={...e},u=a.get(s);if(u){const d=u.origin||o;c.x+=u.internals.positionAbsolute.x-(n.width??0)*d[0],c.y+=u.internals.positionAbsolute.y-(n.height??0)*d[1]}return c}function Y0(e,n){if(e.size!==n.size)return!1;for(const s of e)if(!n.has(s))return!1;return!0}function cA(){let e,n;return{promise:new Promise((a,o)=>{e=a,n=o}),resolve:e,reject:n}}function uA(e){return{...Lb,...e||{}}}function zo(e,{snapGrid:n=[0,0],snapToGrid:s=!1,transform:a,containerBounds:o}){const{x:c,y:u}=Hn(e),d=yl({x:c-(o?.left??0),y:u-(o?.top??0)},a),{x:h,y:p}=s?nr(d,n):d;return{xSnapped:h,ySnapped:p,...d}}const om=e=>({width:e.offsetWidth,height:e.offsetHeight}),Kb=e=>e?.getRootNode?.()||window?.document,fA=["INPUT","SELECT","TEXTAREA"];function Qb(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:fA.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const Zb=e=>"clientX"in e,Hn=(e,n)=>{const s=Zb(e),a=s?e.clientX:e.touches?.[0].clientX,o=s?e.clientY:e.touches?.[0].clientY;return{x:a-(n?.left??0),y:o-(n?.top??0)}},G0=(e,n,s,a,o)=>{const c=n.querySelectorAll(`.${e}`);return!c||!c.length?null:Array.from(c).map(u=>{const d=u.getBoundingClientRect();return{id:u.getAttribute("data-handleid"),type:e,nodeId:o,position:u.getAttribute("data-handlepos"),x:(d.left-s.left)/a,y:(d.top-s.top)/a,...om(u)}})};function Fb({sourceX:e,sourceY:n,targetX:s,targetY:a,sourceControlX:o,sourceControlY:c,targetControlX:u,targetControlY:d}){const h=e*.125+o*.375+u*.375+s*.125,p=n*.125+c*.375+d*.375+a*.125,v=Math.abs(h-e),g=Math.abs(p-n);return[h,p,v,g]}function Mc(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function X0({pos:e,x1:n,y1:s,x2:a,y2:o,c}){switch(e){case he.Left:return[n-Mc(n-a,c),s];case he.Right:return[n+Mc(a-n,c),s];case he.Top:return[n,s-Mc(s-o,c)];case he.Bottom:return[n,s+Mc(o-s,c)]}}function Jb({sourceX:e,sourceY:n,sourcePosition:s=he.Bottom,targetX:a,targetY:o,targetPosition:c=he.Top,curvature:u=.25}){const[d,h]=X0({pos:s,x1:e,y1:n,x2:a,y2:o,c:u}),[p,v]=X0({pos:c,x1:a,y1:o,x2:e,y2:n,c:u}),[g,y,w,E]=Fb({sourceX:e,sourceY:n,targetX:a,targetY:o,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:v});return[`M${e},${n} C${d},${h} ${p},${v} ${a},${o}`,g,y,w,E]}function Wb({sourceX:e,sourceY:n,targetX:s,targetY:a}){const o=Math.abs(s-e)/2,c=s<e?s+o:s-o,u=Math.abs(a-n)/2,d=a<n?a+u:a-u;return[c,d,o,u]}function dA({sourceNode:e,targetNode:n,selected:s=!1,zIndex:a=0,elevateOnSelect:o=!1,zIndexMode:c="basic"}){if(c==="manual")return a;const u=o&&s?a+1e3:a,d=Math.max(e.parentId||o&&e.selected?e.internals.z:0,n.parentId||o&&n.selected?n.internals.z:0);return u+d}function hA({sourceNode:e,targetNode:n,width:s,height:a,transform:o}){const c=vu(su(e),su(n));c.x===c.x2&&(c.x2+=1),c.y===c.y2&&(c.y2+=1);const u={x:-o[0]/o[2],y:-o[1]/o[2],width:s/o[2],height:a/o[2]};return Vo(u,bu(c))>0}const mA=({source:e,sourceHandle:n,target:s,targetHandle:a})=>`xy-edge__${e}${n||""}-${s}${a||""}`,pA=(e,n)=>n.some(s=>s.source===e.source&&s.target===e.target&&(s.sourceHandle===e.sourceHandle||!s.sourceHandle&&!e.sourceHandle)&&(s.targetHandle===e.targetHandle||!s.targetHandle&&!e.targetHandle)),gA=(e,n,s={})=>{if(!e.source||!e.target)return s.onError?.("006",Un.error006()),n;const a=s.getEdgeId||mA;let o;return Ub(e)?o={...e}:o={...e,id:a(e)},pA(o,n)?n:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,n.concat(o))};function Pb({sourceX:e,sourceY:n,targetX:s,targetY:a}){const[o,c,u,d]=Wb({sourceX:e,sourceY:n,targetX:s,targetY:a});return[`M ${e},${n}L ${s},${a}`,o,c,u,d]}const K0={[he.Left]:{x:-1,y:0},[he.Right]:{x:1,y:0},[he.Top]:{x:0,y:-1},[he.Bottom]:{x:0,y:1}},yA=({source:e,sourcePosition:n=he.Bottom,target:s})=>n===he.Left||n===he.Right?e.x<s.x?{x:1,y:0}:{x:-1,y:0}:e.y<s.y?{x:0,y:1}:{x:0,y:-1},Q0=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function vA({source:e,sourcePosition:n=he.Bottom,target:s,targetPosition:a=he.Top,center:o,offset:c,stepPosition:u}){const d=K0[n],h=K0[a],p={x:e.x+d.x*c,y:e.y+d.y*c},v={x:s.x+h.x*c,y:s.y+h.y*c},g=yA({source:p,sourcePosition:n,target:v}),y=g.x!==0?"x":"y",w=g[y];let E=[],N,A;const C={x:0,y:0},z={x:0,y:0},[,,_,x]=Wb({sourceX:e.x,sourceY:e.y,targetX:s.x,targetY:s.y});if(d[y]*h[y]===-1){y==="x"?(N=o.x??p.x+(v.x-p.x)*u,A=o.y??(p.y+v.y)/2):(N=o.x??(p.x+v.x)/2,A=o.y??p.y+(v.y-p.y)*u);const D=[{x:N,y:p.y},{x:N,y:v.y}],R=[{x:p.x,y:A},{x:v.x,y:A}];d[y]===w?E=y==="x"?D:R:E=y==="x"?R:D}else{const D=[{x:p.x,y:v.y}],R=[{x:v.x,y:p.y}];if(y==="x"?E=d.x===w?R:D:E=d.y===w?D:R,n===a){const L=Math.abs(e[y]-s[y]);if(L<=c){const G=Math.min(c-1,c-L);d[y]===w?C[y]=(p[y]>e[y]?-1:1)*G:z[y]=(v[y]>s[y]?-1:1)*G}}if(n!==a){const L=y==="x"?"y":"x",G=d[y]===h[L],k=p[L]>v[L],$=p[L]<v[L];(d[y]===1&&(!G&&k||G&&$)||d[y]!==1&&(!G&&$||G&&k))&&(E=y==="x"?D:R)}const Z={x:p.x+C.x,y:p.y+C.y},Y={x:v.x+z.x,y:v.y+z.y},K=Math.max(Math.abs(Z.x-E[0].x),Math.abs(Y.x-E[0].x)),le=Math.max(Math.abs(Z.y-E[0].y),Math.abs(Y.y-E[0].y));K>=le?(N=(Z.x+Y.x)/2,A=E[0].y):(N=E[0].x,A=(Z.y+Y.y)/2)}const B={x:p.x+C.x,y:p.y+C.y},j={x:v.x+z.x,y:v.y+z.y};return[[e,...B.x!==E[0].x||B.y!==E[0].y?[B]:[],...E,...j.x!==E[E.length-1].x||j.y!==E[E.length-1].y?[j]:[],s],N,A,_,x]}function bA(e,n,s,a){const o=Math.min(Q0(e,n)/2,Q0(n,s)/2,a),{x:c,y:u}=n;if(e.x===c&&c===s.x||e.y===u&&u===s.y)return`L${c} ${u}`;if(e.y===u){const p=e.x<s.x?-1:1,v=e.y<s.y?1:-1;return`L ${c+o*p},${u}Q ${c},${u} ${c},${u+o*v}`}const d=e.x<s.x?1:-1,h=e.y<s.y?-1:1;return`L ${c},${u+o*h}Q ${c},${u} ${c+o*d},${u}`}function zh({sourceX:e,sourceY:n,sourcePosition:s=he.Bottom,targetX:a,targetY:o,targetPosition:c=he.Top,borderRadius:u=5,centerX:d,centerY:h,offset:p=20,stepPosition:v=.5}){const[g,y,w,E,N]=vA({source:{x:e,y:n},sourcePosition:s,target:{x:a,y:o},targetPosition:c,center:{x:d,y:h},offset:p,stepPosition:v});let A=`M${g[0].x} ${g[0].y}`;for(let C=1;C<g.length-1;C++)A+=bA(g[C-1],g[C],g[C+1],u);return A+=`L${g[g.length-1].x} ${g[g.length-1].y}`,[A,y,w,E,N]}function Z0(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function SA(e){const{sourceNode:n,targetNode:s}=e;if(!Z0(n)||!Z0(s))return null;const a=n.internals.handleBounds||F0(n.handles),o=s.internals.handleBounds||F0(s.handles),c=J0(a?.source??[],e.sourceHandle),u=J0(e.connectionMode===cl.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!c||!u)return e.onError?.("008",Un.error008(c?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const d=c?.position||he.Bottom,h=u?.position||he.Top,p=Qs(n,c,d),v=Qs(s,u,h);return{sourceX:p.x,sourceY:p.y,targetX:v.x,targetY:v.y,sourcePosition:d,targetPosition:h}}function F0(e){if(!e)return null;const n=[],s=[];for(const a of e)a.width=a.width??1,a.height=a.height??1,a.type==="source"?n.push(a):a.type==="target"&&s.push(a);return{source:n,target:s}}function Qs(e,n,s=he.Left,a=!1){const o=(n?.x??0)+e.internals.positionAbsolute.x,c=(n?.y??0)+e.internals.positionAbsolute.y,{width:u,height:d}=n??Oi(e);if(a)return{x:o+u/2,y:c+d/2};switch(n?.position??s){case he.Top:return{x:o+u/2,y:c};case he.Right:return{x:o+u,y:c+d/2};case he.Bottom:return{x:o+u/2,y:c+d};case he.Left:return{x:o,y:c+d/2}}}function J0(e,n){return e&&(n?e.find(s=>s.id===n):e[0])||null}function jh(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(a=>`${a}=${e[a]}`).join("&")}`:""}function wA(e,{id:n,defaultColor:s,defaultMarkerStart:a,defaultMarkerEnd:o}){const c=new Set;return e.reduce((u,d)=>([d.markerStart||a,d.markerEnd||o].forEach(h=>{if(h&&typeof h=="object"){const p=jh(h,n);c.has(p)||(u.push({id:p,color:h.color||s,...h}),c.add(p))}}),u),[]).sort((u,d)=>u.id.localeCompare(d.id))}const e1=1e3,xA=10,rm={nodeOrigin:[0,0],nodeExtent:Uo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},EA={...rm,checkEquality:!0};function cm(e,n){const s={...e};for(const a in n)n[a]!==void 0&&(s[a]=n[a]);return s}function NA(e,n,s){const a=cm(rm,s);for(const o of e.values())if(o.parentId)fm(o,e,n,a);else{const c=er(o,a.nodeOrigin),u=Ks(o.extent)?o.extent:a.nodeExtent,d=Xs(c,u,Oi(o));o.internals.positionAbsolute=d}}function _A(e,n){if(!e.handles)return e.measured?n?.internals.handleBounds:void 0;const s=[],a=[];for(const o of e.handles){const c={id:o.id,width:o.width??1,height:o.height??1,nodeId:e.id,x:o.x,y:o.y,position:o.position,type:o.type};o.type==="source"?s.push(c):o.type==="target"&&a.push(c)}return{source:s,target:a}}function um(e){return e==="manual"}function Dh(e,n,s,a={}){const o=cm(EA,a),c={i:0},u=new Map(n),d=o?.elevateNodesOnSelect&&!um(o.zIndexMode)?e1:0;let h=e.length>0,p=!1;n.clear(),s.clear();for(const v of e){let g=u.get(v.id);if(o.checkEquality&&v===g?.internals.userNode)n.set(v.id,g);else{const y=er(v,o.nodeOrigin),w=Ks(v.extent)?v.extent:o.nodeExtent,E=Xs(y,w,Oi(v));g={...o.defaults,...v,measured:{width:v.measured?.width,height:v.measured?.height},internals:{positionAbsolute:E,handleBounds:_A(v,g),z:t1(v,d,o.zIndexMode),userNode:v}},n.set(v.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),v.parentId&&fm(g,n,s,a,c),p||=v.selected??!1}return{nodesInitialized:h,hasSelectedNodes:p}}function AA(e,n){if(!e.parentId)return;const s=n.get(e.parentId);s?s.set(e.id,e):n.set(e.parentId,new Map([[e.id,e]]))}function fm(e,n,s,a,o){const{elevateNodesOnSelect:c,nodeOrigin:u,nodeExtent:d,zIndexMode:h}=cm(rm,a),p=e.parentId,v=n.get(p);if(!v){console.warn(`Parent node ${p} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}AA(e,s),o&&!v.parentId&&v.internals.rootParentIndex===void 0&&h==="auto"&&(v.internals.rootParentIndex=++o.i,v.internals.z=v.internals.z+o.i*xA),o&&v.internals.rootParentIndex!==void 0&&(o.i=v.internals.rootParentIndex);const g=c&&!um(h)?e1:0,{x:y,y:w,z:E}=TA(e,v,u,d,g,h),{positionAbsolute:N}=e.internals,A=y!==N.x||w!==N.y;(A||E!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:A?{x:y,y:w}:N,z:E}})}function t1(e,n,s){const a=$n(e.zIndex)?e.zIndex:0;return um(s)?a:a+(e.selected?n:0)}function TA(e,n,s,a,o,c){const{x:u,y:d}=n.internals.positionAbsolute,h=Oi(e),p=er(e,s),v=Ks(e.extent)?Xs(p,e.extent,h):p;let g=Xs({x:u+v.x,y:d+v.y},a,h);e.extent==="parent"&&(g=qb(g,h,n));const y=t1(e,o,c),w=n.internals.z??0;return{x:g.x,y:g.y,z:w>=y?w+1:y}}function dm(e,n,s,a=[0,0]){const o=[],c=new Map;for(const u of e){const d=n.get(u.parentId);if(!d)continue;const h=c.get(u.parentId)?.expandedRect??fl(d),p=Vb(h,u.rect);c.set(u.parentId,{expandedRect:p,parent:d})}return c.size>0&&c.forEach(({expandedRect:u,parent:d},h)=>{const p=d.internals.positionAbsolute,v=Oi(d),g=d.origin??a,y=u.x<p.x?Math.round(Math.abs(p.x-u.x)):0,w=u.y<p.y?Math.round(Math.abs(p.y-u.y)):0,E=Math.max(v.width,Math.round(u.width)),N=Math.max(v.height,Math.round(u.height)),A=(E-v.width)*g[0],C=(N-v.height)*g[1];(y>0||w>0||A||C)&&(o.push({id:h,type:"position",position:{x:d.position.x-y+A,y:d.position.y-w+C}}),s.get(h)?.forEach(z=>{e.some(_=>_.id===z.id)||o.push({id:z.id,type:"position",position:{x:z.position.x+y,y:z.position.y+w}})})),(v.width<u.width||v.height<u.height||y||w)&&o.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:E+(y?g[0]*y-A:0),height:N+(w?g[1]*w-C:0)}})}),o}function CA(e,n,s,a,o,c,u){const d=a?.querySelector(".xyflow__viewport");let h=!1;if(!d)return{changes:[],updatedInternals:h};const p=[],v=window.getComputedStyle(d),{m22:g}=new window.DOMMatrixReadOnly(v.transform),y=[];for(const w of e.values()){const E=n.get(w.id);if(!E)continue;if(E.hidden){n.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),h=!0;continue}const N=om(w.nodeElement),A=E.measured.width!==N.width||E.measured.height!==N.height;if(!!(N.width&&N.height&&(A||!E.internals.handleBounds||w.force))){const z=w.nodeElement.getBoundingClientRect(),_=Ks(E.extent)?E.extent:c;let{positionAbsolute:x}=E.internals;E.parentId&&E.extent==="parent"?x=qb(x,N,n.get(E.parentId)):_&&(x=Xs(x,_,N));const B={...E,measured:N,internals:{...E.internals,positionAbsolute:x,handleBounds:{source:G0("source",w.nodeElement,z,g,E.id),target:G0("target",w.nodeElement,z,g,E.id)}}};n.set(E.id,B),E.parentId&&fm(B,n,s,{nodeOrigin:o,zIndexMode:u}),h=!0,A&&(p.push({id:E.id,type:"dimensions",dimensions:N}),E.expandParent&&E.parentId&&y.push({id:E.id,parentId:E.parentId,rect:fl(B,o)}))}}if(y.length>0){const w=dm(y,n,s,o);p.push(...w)}return{changes:p,updatedInternals:h}}async function MA({delta:e,panZoom:n,transform:s,translateExtent:a,width:o,height:c}){if(!n||!e.x&&!e.y)return!1;const u=await n.setViewportConstrained({x:s[0]+e.x,y:s[1]+e.y,zoom:s[2]},[[0,0],[o,c]],a);return!!u&&(u.x!==s[0]||u.y!==s[1]||u.k!==s[2])}function W0(e,n,s,a,o,c){let u=o;const d=a.get(u)||new Map;a.set(u,d.set(s,n)),u=`${o}-${e}`;const h=a.get(u)||new Map;if(a.set(u,h.set(s,n)),c){u=`${o}-${e}-${c}`;const p=a.get(u)||new Map;a.set(u,p.set(s,n))}}function n1(e,n,s){e.clear(),n.clear();for(const a of s){const{source:o,target:c,sourceHandle:u=null,targetHandle:d=null}=a,h={edgeId:a.id,source:o,target:c,sourceHandle:u,targetHandle:d},p=`${o}-${u}--${c}-${d}`,v=`${c}-${d}--${o}-${u}`;W0("source",h,v,e,o,u),W0("target",h,p,e,c,d),n.set(a.id,a)}}function i1(e,n){if(!e.parentId)return!1;const s=n.get(e.parentId);return s?s.selected?!0:i1(s,n):!1}function P0(e,n,s){let a=e;do{if(a?.matches?.(n))return!0;if(a===s)return!1;a=a?.parentElement}while(a);return!1}function OA(e,n,s,a){const o=new Map;for(const[c,u]of e)if((u.selected||u.id===a)&&(!u.parentId||!i1(u,e))&&(u.draggable||n&&typeof u.draggable>"u")){const d=e.get(c);d&&o.set(c,{id:c,position:d.position||{x:0,y:0},distance:{x:s.x-d.internals.positionAbsolute.x,y:s.y-d.internals.positionAbsolute.y},extent:d.extent,parentId:d.parentId,origin:d.origin,expandParent:d.expandParent,internals:{positionAbsolute:d.internals.positionAbsolute||{x:0,y:0}},measured:{width:d.measured.width??0,height:d.measured.height??0}})}return o}function sh({nodeId:e,dragItems:n,nodeLookup:s,dragging:a=!0}){const o=[];for(const[u,d]of n){const h=s.get(u)?.internals.userNode;h&&o.push({...h,position:d.position,dragging:a})}if(!e)return[o[0],o];const c=s.get(e)?.internals.userNode;return[c?{...c,position:n.get(e)?.position||c.position,dragging:a}:o[0],o]}function kA({dragItems:e,snapGrid:n,x:s,y:a}){const o=e.values().next().value;if(!o)return null;const c={x:s-o.distance.x,y:a-o.distance.y},u=nr(c,n);return{x:u.x-c.x,y:u.y-c.y}}function zA({onNodeMouseDown:e,getStoreItems:n,onDragStart:s,onDrag:a,onDragStop:o}){let c={x:null,y:null},u=0,d=new Map,h=!1,p={x:0,y:0},v=null,g=!1,y=null,w=!1,E=!1,N=null;function A({noDragClassName:z,handleSelector:_,domNode:x,isSelectable:B,nodeId:j,nodeClickDistance:T=0}){y=cn(x);function D({x:K,y:le}){const{nodeLookup:L,nodeExtent:G,snapGrid:k,snapToGrid:$,nodeOrigin:H,onNodeDrag:X,onSelectionDrag:W,onError:O,updateNodePositions:I}=n();c={x:K,y:le};let ee=!1;const ne=d.size>1,fe=ne&&G?kh(tr(d)):null,de=ne&&$?kA({dragItems:d,snapGrid:k,x:K,y:le}):null;for(const[ae,te]of d){if(!L.has(ae))continue;let ue={x:K-te.distance.x,y:le-te.distance.y};$&&(ue=de?{x:Math.round(ue.x+de.x),y:Math.round(ue.y+de.y)}:nr(ue,k));let Se=null;if(ne&&G&&!te.extent&&fe){const{positionAbsolute:ve}=te.internals,Ee=ve.x-fe.x+G[0][0],Me=ve.x+te.measured.width-fe.x2+G[1][0],Be=ve.y-fe.y+G[0][1],Et=ve.y+te.measured.height-fe.y2+G[1][1];Se=[[Ee,Be],[Me,Et]]}const{position:we,positionAbsolute:ge}=Ib({nodeId:ae,nextPosition:ue,nodeLookup:L,nodeExtent:Se||G,nodeOrigin:H,onError:O});ee=ee||te.position.x!==we.x||te.position.y!==we.y,te.position=we,te.internals.positionAbsolute=ge}if(E=E||ee,!!ee&&(I(d,!0),N&&(a||X||!j&&W))){const[ae,te]=sh({nodeId:j,dragItems:d,nodeLookup:L});a?.(N,d,ae,te),X?.(N,ae,te),j||W?.(N,te)}}async function R(){if(!v)return;const{transform:K,panBy:le,autoPanSpeed:L,autoPanOnNodeDrag:G}=n();if(!G){h=!1,cancelAnimationFrame(u);return}const[k,$]=am(p,v,L);(k!==0||$!==0)&&(c.x=(c.x??0)-k/K[2],c.y=(c.y??0)-$/K[2],await le({x:k,y:$})&&D(c)),u=requestAnimationFrame(R)}function Z(K){const{nodeLookup:le,multiSelectionActive:L,nodesDraggable:G,transform:k,snapGrid:$,snapToGrid:H,selectNodesOnDrag:X,onNodeDragStart:W,onSelectionDragStart:O,unselectNodesAndEdges:I}=n();g=!0,(!X||!B)&&!L&&j&&(le.get(j)?.selected||I()),B&&X&&j&&e?.(j);const ee=zo(K.sourceEvent,{transform:k,snapGrid:$,snapToGrid:H,containerBounds:v});if(c=ee,d=OA(le,G,ee,j),d.size>0&&(s||W||!j&&O)){const[ne,fe]=sh({nodeId:j,dragItems:d,nodeLookup:le});s?.(K.sourceEvent,d,ne,fe),W?.(K.sourceEvent,ne,fe),j||O?.(K.sourceEvent,fe)}}const Y=Sb().clickDistance(T).on("start",K=>{const{domNode:le,nodeDragThreshold:L,transform:G,snapGrid:k,snapToGrid:$}=n();v=le?.getBoundingClientRect()||null,w=!1,E=!1,N=K.sourceEvent,L===0&&Z(K),c=zo(K.sourceEvent,{transform:G,snapGrid:k,snapToGrid:$,containerBounds:v}),p=Hn(K.sourceEvent,v)}).on("drag",K=>{const{autoPanOnNodeDrag:le,transform:L,snapGrid:G,snapToGrid:k,nodeDragThreshold:$,nodeLookup:H}=n(),X=zo(K.sourceEvent,{transform:L,snapGrid:G,snapToGrid:k,containerBounds:v});if(N=K.sourceEvent,(K.sourceEvent.type==="touchmove"&&K.sourceEvent.touches.length>1||j&&!H.has(j))&&(w=!0),!w){if(!h&&le&&g&&(h=!0,R()),!g){const W=Hn(K.sourceEvent,v),O=W.x-p.x,I=W.y-p.y;Math.sqrt(O*O+I*I)>$&&Z(K)}(c.x!==X.xSnapped||c.y!==X.ySnapped)&&d&&g&&(p=Hn(K.sourceEvent,v),D(X))}}).on("end",K=>{if(!g||w){w&&d.size>0&&n().updateNodePositions(d,!1);return}if(h=!1,g=!1,cancelAnimationFrame(u),d.size>0){const{nodeLookup:le,updateNodePositions:L,onNodeDragStop:G,onSelectionDragStop:k}=n();if(E&&(L(d,!1),E=!1),o||G||!j&&k){const[$,H]=sh({nodeId:j,dragItems:d,nodeLookup:le,dragging:!1});o?.(K.sourceEvent,d,$,H),G?.(K.sourceEvent,$,H),j||k?.(K.sourceEvent,H)}}}).filter(K=>{const le=K.target;return!K.button&&(!z||!P0(le,`.${z}`,x))&&(!_||P0(le,_,x))});y.call(Y)}function C(){y?.on(".drag",null)}return{update:A,destroy:C}}function jA(e,n,s){const a=[],o={x:e.x-s,y:e.y-s,width:s*2,height:s*2};for(const c of n.values())Vo(o,fl(c))>0&&a.push(c);return a}const DA=250;function RA(e,n,s,a){let o=[],c=1/0;const u=jA(e,s,n+DA);for(const d of u){const h=[...d.internals.handleBounds?.source??[],...d.internals.handleBounds?.target??[]];for(const p of h){if(a.nodeId===p.nodeId&&a.type===p.type&&a.id===p.id)continue;const{x:v,y:g}=Qs(d,p,p.position,!0),y=Math.sqrt(Math.pow(v-e.x,2)+Math.pow(g-e.y,2));y>n||(y<c?(o=[{...p,x:v,y:g}],c=y):y===c&&o.push({...p,x:v,y:g}))}}if(!o.length)return null;if(o.length>1){const d=a.type==="source"?"target":"source";return o.find(h=>h.type===d)??o[0]}return o[0]}function s1(e,n,s,a,o,c=!1){const u=a.get(e);if(!u)return null;const d=o==="strict"?u.internals.handleBounds?.[n]:[...u.internals.handleBounds?.source??[],...u.internals.handleBounds?.target??[]],h=(s?d?.find(p=>p.id===s):d?.[0])??null;return h&&c?{...h,...Qs(u,h,h.position,!0)}:h}function a1(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function BA(e,n){let s=null;return n?s=!0:e&&!n&&(s=!1),s}const l1=()=>!0;function LA(e,{connectionMode:n,connectionRadius:s,handleId:a,nodeId:o,edgeUpdaterType:c,isTarget:u,domNode:d,nodeLookup:h,lib:p,autoPanOnConnect:v,flowId:g,panBy:y,cancelConnection:w,onConnectStart:E,onConnect:N,onConnectEnd:A,isValidConnection:C=l1,onReconnectEnd:z,updateConnection:_,getTransform:x,getFromHandle:B,autoPanSpeed:j,dragThreshold:T=1,handleDomNode:D}){const R=Kb(e.target);let Z=0,Y;const{x:K,y:le}=Hn(e),L=a1(c,D),G=d?.getBoundingClientRect();let k=!1;if(!G||!L)return;const $=s1(o,L,a,h,n);if(!$)return;let H=Hn(e,G),X=!1,W=null,O=!1,I=null;function ee(){if(!v||!G)return;const[we,ge]=am(H,G,j);y({x:we,y:ge}),Z=requestAnimationFrame(ee)}const ne={...$,nodeId:o,type:L,position:$.position},fe=h.get(o);let ae={inProgress:!0,isValid:null,from:Qs(fe,ne,he.Left,!0),fromHandle:ne,fromPosition:ne.position,fromNode:fe,to:H,toHandle:null,toPosition:I0[ne.position],toNode:null,pointer:H};function te(){k=!0,_(ae),E?.(e,{nodeId:o,handleId:a,handleType:L})}T===0&&te();function ue(we){if(!k){const{x:Et,y:Bt}=Hn(we),Nt=Et-K,We=Bt-le;if(!(Nt*Nt+We*We>T*T))return;te()}if(!B()||!ne){Se(we);return}const ge=x();H=Hn(we,G),Y=RA(yl(H,ge,!1,[1,1]),s,h,ne),X||(ee(),X=!0);const ve=o1(we,{handle:Y,connectionMode:n,fromNodeId:o,fromHandleId:a,fromType:u?"target":"source",isValidConnection:C,doc:R,lib:p,flowId:g,nodeLookup:h});I=ve.handleDomNode,W=ve.connection,O=BA(!!Y,ve.isValid);const Ee=h.get(o),Me=Ee?Qs(Ee,ne,he.Left,!0):ae.from,Be={...ae,from:Me,isValid:O,to:ve.toHandle&&O?dl({x:ve.toHandle.x,y:ve.toHandle.y},ge):H,toHandle:ve.toHandle,toPosition:O&&ve.toHandle?ve.toHandle.position:I0[ne.position],toNode:ve.toHandle?h.get(ve.toHandle.nodeId):null,pointer:H};_(Be),ae=Be}function Se(we){if(!("touches"in we&&we.touches.length>0)){if(k){(Y||I)&&W&&O&&N?.(W);const{inProgress:ge,...ve}=ae,Ee={...ve,toPosition:ae.toHandle?ae.toPosition:null};A?.(we,Ee),c&&z?.(we,Ee)}w(),cancelAnimationFrame(Z),X=!1,O=!1,W=null,I=null,R.removeEventListener("mousemove",ue),R.removeEventListener("mouseup",Se),R.removeEventListener("touchmove",ue),R.removeEventListener("touchend",Se)}}R.addEventListener("mousemove",ue),R.addEventListener("mouseup",Se),R.addEventListener("touchmove",ue),R.addEventListener("touchend",Se)}function o1(e,{handle:n,connectionMode:s,fromNodeId:a,fromHandleId:o,fromType:c,doc:u,lib:d,flowId:h,isValidConnection:p=l1,nodeLookup:v}){const g=c==="target",y=n?u.querySelector(`.${d}-flow__handle[data-id="${h}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x:w,y:E}=Hn(e),N=u.elementFromPoint(w,E),A=N?.classList.contains(`${d}-flow__handle`)?N:y,C={handleDomNode:A,isValid:!1,connection:null,toHandle:null};if(A){const z=a1(void 0,A),_=A.getAttribute("data-nodeid"),x=A.getAttribute("data-handleid"),B=A.classList.contains("connectable"),j=A.classList.contains("connectableend");if(!_||!z)return C;const T={source:g?_:a,sourceHandle:g?x:o,target:g?a:_,targetHandle:g?o:x};C.connection=T;const R=B&&j&&(s===cl.Strict?g&&z==="source"||!g&&z==="target":_!==a||x!==o);C.isValid=R&&p(T),C.toHandle=s1(_,z,x,v,s,!0)}return C}const Rh={onPointerDown:LA,isValid:o1};function $A({domNode:e,panZoom:n,getTransform:s,getViewScale:a}){const o=cn(e);function c({translateExtent:d,width:h,height:p,zoomStep:v=1,pannable:g=!0,zoomable:y=!0,inversePan:w=!1}){const E=_=>{if(_.sourceEvent.type!=="wheel"||!n)return;const x=s(),B=_.sourceEvent.ctrlKey&&Yo()?10:1,j=-_.sourceEvent.deltaY*(_.sourceEvent.deltaMode===1?.05:_.sourceEvent.deltaMode?1:.002)*v,T=x[2]*Math.pow(2,j*B);n.scaleTo(T)};let N=[0,0];const A=_=>{(_.sourceEvent.type==="mousedown"||_.sourceEvent.type==="touchstart")&&(N=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY])},C=_=>{const x=s();if(_.sourceEvent.type!=="mousemove"&&_.sourceEvent.type!=="touchmove"||!n)return;const B=[_.sourceEvent.clientX??_.sourceEvent.touches[0].clientX,_.sourceEvent.clientY??_.sourceEvent.touches[0].clientY],j=[B[0]-N[0],B[1]-N[1]];N=B;const T=a()*Math.max(x[2],Math.log(x[2]))*(w?-1:1),D={x:x[0]-j[0]*T,y:x[1]-j[1]*T},R=[[0,0],[h,p]];n.setViewportConstrained({x:D.x,y:D.y,zoom:x[2]},R,d)},z=Rb().on("start",A).on("zoom",g?C:null).on("zoom.wheel",y?E:null);o.call(z,{})}function u(){o.on("zoom",null)}return{update:c,destroy:u,pointer:Rn}}const Su=e=>({x:e.x,y:e.y,zoom:e.k}),ah=({x:e,y:n,zoom:s})=>yu.translate(e,n).scale(s),Xa=(e,n)=>e.target.closest(`.${n}`),r1=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),HA=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,lh=(e,n=0,s=HA,a=()=>{})=>{const o=typeof n=="number"&&n>0;return o||a(),o?e.transition().duration(n).ease(s).on("end",a):e},c1=e=>{const n=e.ctrlKey&&Yo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function UA({zoomPanValues:e,noWheelClassName:n,d3Selection:s,d3Zoom:a,panOnScrollMode:o,panOnScrollSpeed:c,zoomOnPinch:u,onPanZoomStart:d,onPanZoom:h,onPanZoomEnd:p}){return v=>{if(Xa(v,n))return v.ctrlKey&&v.preventDefault(),!1;v.preventDefault(),v.stopImmediatePropagation();const g=s.property("__zoom").k||1;if(v.ctrlKey&&u){const A=Rn(v),C=c1(v),z=g*Math.pow(2,C);a.scaleTo(s,z,A,v);return}const y=v.deltaMode===1?20:1;let w=o===Vs.Vertical?0:v.deltaX*y,E=o===Vs.Horizontal?0:v.deltaY*y;!Yo()&&v.shiftKey&&o!==Vs.Vertical&&(w=v.deltaY*y,E=0),a.translateBy(s,-(w/g)*c,-(E/g)*c,{internal:!0});const N=Su(s.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(v,N),e.panScrollTimeout=setTimeout(()=>{p?.(v,N),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,d?.(v,N))}}function IA({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:s}){return function(a,o){const c=a.type==="wheel",u=!n&&c&&!a.ctrlKey,d=Xa(a,e);if(a.ctrlKey&&c&&d&&a.preventDefault(),u||d)return null;a.preventDefault(),s.call(this,a,o)}}function qA({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:s}){return a=>{if(a.sourceEvent?.internal)return;const o=Su(a.transform);e.mouseButton=a.sourceEvent?.button||0,e.isZoomingOrPanning=!0,e.prevViewport=o,a.sourceEvent?.type==="mousedown"&&n(!0),s&&s?.(a.sourceEvent,o)}}function VA({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:s,onTransformChange:a,onPanZoom:o}){return c=>{e.usedRightMouseButton=!!(s&&r1(n,e.mouseButton??0)),c.sourceEvent?.sync||a([c.transform.x,c.transform.y,c.transform.k]),o&&!c.sourceEvent?.internal&&o?.(c.sourceEvent,Su(c.transform))}}function YA({zoomPanValues:e,panOnDrag:n,panOnScroll:s,onDraggingChange:a,onPanZoomEnd:o,onPaneContextMenu:c}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,c&&r1(n,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&c(u.sourceEvent),e.usedRightMouseButton=!1,a(!1),o)){const d=Su(u.transform);e.prevViewport=d,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(u.sourceEvent,d)},s?150:0)}}}function GA({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:s,panOnDrag:a,panOnScroll:o,zoomOnDoubleClick:c,userSelectionActive:u,noWheelClassName:d,noPanClassName:h,lib:p,connectionInProgress:v}){return g=>{const y=e||n,w=s&&g.ctrlKey,E=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Xa(g,`${p}-flow__node`)||Xa(g,`${p}-flow__edge`)))return!0;if(!a&&!y&&!o&&!c&&!s||u||v&&!E||Xa(g,d)&&E||Xa(g,h)&&(!E||o&&E&&!e)||!s&&g.ctrlKey&&E)return!1;if(!s&&g.type==="touchstart"&&g.touches?.length>1)return g.preventDefault(),!1;if(!y&&!o&&!w&&E||!a&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(a)&&!a.includes(g.button)&&g.type==="mousedown")return!1;const N=Array.isArray(a)&&a.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||E)&&N}}function XA({domNode:e,minZoom:n,maxZoom:s,translateExtent:a,viewport:o,onPanZoom:c,onPanZoomStart:u,onPanZoomEnd:d,onDraggingChange:h}){const p={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},v=e.getBoundingClientRect(),g=Rb().scaleExtent([n,s]).translateExtent(a),y=cn(e).call(g);z({x:o.x,y:o.y,zoom:ul(o.zoom,n,s)},[[0,0],[v.width,v.height]],a);const w=y.on("wheel.zoom"),E=y.on("dblclick.zoom");g.wheelDelta(c1);async function N(Y,K){return y?new Promise(le=>{g?.interpolate(K?.interpolate==="linear"?ko:Uc).transform(lh(y,K?.duration,K?.ease,()=>le(!0)),Y)}):!1}function A({noWheelClassName:Y,noPanClassName:K,onPaneContextMenu:le,userSelectionActive:L,panOnScroll:G,panOnDrag:k,panOnScrollMode:$,panOnScrollSpeed:H,preventScrolling:X,zoomOnPinch:W,zoomOnScroll:O,zoomOnDoubleClick:I,zoomActivationKeyPressed:ee,lib:ne,onTransformChange:fe,connectionInProgress:de,paneClickDistance:ae,selectionOnDrag:te}){L&&!p.isZoomingOrPanning&&C();const ue=G&&!ee&&!L;g.clickDistance(te?1/0:!$n(ae)||ae<0?0:ae);const Se=ue?UA({zoomPanValues:p,noWheelClassName:Y,d3Selection:y,d3Zoom:g,panOnScrollMode:$,panOnScrollSpeed:H,zoomOnPinch:W,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:d}):IA({noWheelClassName:Y,preventScrolling:X,d3ZoomHandler:w});y.on("wheel.zoom",Se,{passive:!1});const we=qA({zoomPanValues:p,onDraggingChange:h,onPanZoomStart:u});g.on("start",we);const ge=VA({zoomPanValues:p,panOnDrag:k,onPaneContextMenu:!!le,onPanZoom:c,onTransformChange:fe});g.on("zoom",ge);const ve=YA({zoomPanValues:p,panOnDrag:k,panOnScroll:G,onPaneContextMenu:le,onPanZoomEnd:d,onDraggingChange:h});g.on("end",ve);const Ee=GA({zoomActivationKeyPressed:ee,panOnDrag:k,zoomOnScroll:O,panOnScroll:G,zoomOnDoubleClick:I,zoomOnPinch:W,userSelectionActive:L,noPanClassName:K,noWheelClassName:Y,lib:ne,connectionInProgress:de});g.filter(Ee),I?y.on("dblclick.zoom",E):y.on("dblclick.zoom",null)}function C(){g.on("zoom",null)}async function z(Y,K,le){const L=ah(Y),G=g?.constrain()(L,K,le);return G&&await N(G),G}async function _(Y,K){const le=ah(Y);return await N(le,K),le}function x(Y){if(y){const K=ah(Y),le=y.property("__zoom");(le.k!==Y.zoom||le.x!==Y.x||le.y!==Y.y)&&g?.transform(y,K,null,{sync:!0})}}function B(){const Y=y?Db(y.node()):{x:0,y:0,k:1};return{x:Y.x,y:Y.y,zoom:Y.k}}async function j(Y,K){return y?new Promise(le=>{g?.interpolate(K?.interpolate==="linear"?ko:Uc).scaleTo(lh(y,K?.duration,K?.ease,()=>le(!0)),Y)}):!1}async function T(Y,K){return y?new Promise(le=>{g?.interpolate(K?.interpolate==="linear"?ko:Uc).scaleBy(lh(y,K?.duration,K?.ease,()=>le(!0)),Y)}):!1}function D(Y){g?.scaleExtent(Y)}function R(Y){g?.translateExtent(Y)}function Z(Y){const K=!$n(Y)||Y<0?0:Y;g?.clickDistance(K)}return{update:A,destroy:C,setViewport:_,setViewportConstrained:z,getViewport:B,scaleTo:j,scaleBy:T,setScaleExtent:D,setTranslateExtent:R,syncViewport:x,setClickDistance:Z}}var hl;(function(e){e.Line="line",e.Handle="handle"})(hl||(hl={}));function KA({width:e,prevWidth:n,height:s,prevHeight:a,affectsX:o,affectsY:c}){const u=e-n,d=s-a,h=[u>0?1:u<0?-1:0,d>0?1:d<0?-1:0];return u&&o&&(h[0]=h[0]*-1),d&&c&&(h[1]=h[1]*-1),h}function ev(e){const n=e.includes("right")||e.includes("left"),s=e.includes("bottom")||e.includes("top"),a=e.includes("left"),o=e.includes("top");return{isHorizontal:n,isVertical:s,affectsX:a,affectsY:o}}function rs(e,n){return Math.max(0,n-e)}function cs(e,n){return Math.max(0,e-n)}function Oc(e,n,s){return Math.max(0,n-e,e-s)}function tv(e,n){return e?!n:n}function QA(e,n,s,a,o,c,u,d){let{affectsX:h,affectsY:p}=n;const{isHorizontal:v,isVertical:g}=n,y=v&&g,{xSnapped:w,ySnapped:E}=s,{minWidth:N,maxWidth:A,minHeight:C,maxHeight:z}=a,{x:_,y:x,width:B,height:j,aspectRatio:T}=e;let D=Math.floor(v?w-e.pointerX:0),R=Math.floor(g?E-e.pointerY:0);const Z=B+(h?-D:D),Y=j+(p?-R:R),K=-c[0]*B,le=-c[1]*j;let L=Oc(Z,N,A),G=Oc(Y,C,z);if(u){let H=0,X=0;h&&D<0?H=rs(_+D+K,u[0][0]):!h&&D>0&&(H=cs(_+Z+K,u[1][0])),p&&R<0?X=rs(x+R+le,u[0][1]):!p&&R>0&&(X=cs(x+Y+le,u[1][1])),L=Math.max(L,H),G=Math.max(G,X)}if(d){let H=0,X=0;h&&D>0?H=cs(_+D,d[0][0]):!h&&D<0&&(H=rs(_+Z,d[1][0])),p&&R>0?X=cs(x+R,d[0][1]):!p&&R<0&&(X=rs(x+Y,d[1][1])),L=Math.max(L,H),G=Math.max(G,X)}if(o){if(v){const H=Oc(Z/T,C,z)*T;if(L=Math.max(L,H),u){let X=0;!h&&!p||h&&!p&&y?X=cs(x+le+Z/T,u[1][1])*T:X=rs(x+le+(h?D:-D)/T,u[0][1])*T,L=Math.max(L,X)}if(d){let X=0;!h&&!p||h&&!p&&y?X=rs(x+Z/T,d[1][1])*T:X=cs(x+(h?D:-D)/T,d[0][1])*T,L=Math.max(L,X)}}if(g){const H=Oc(Y*T,N,A)/T;if(G=Math.max(G,H),u){let X=0;!h&&!p||p&&!h&&y?X=cs(_+Y*T+K,u[1][0])/T:X=rs(_+(p?R:-R)*T+K,u[0][0])/T,G=Math.max(G,X)}if(d){let X=0;!h&&!p||p&&!h&&y?X=rs(_+Y*T,d[1][0])/T:X=cs(_+(p?R:-R)*T,d[0][0])/T,G=Math.max(G,X)}}}R=R+(R<0?G:-G),D=D+(D<0?L:-L),o&&(y?Z>Y*T?R=(tv(h,p)?-D:D)/T:D=(tv(h,p)?-R:R)*T:v?(R=D/T,p=h):(D=R*T,h=p));const k=h?_+D:_,$=p?x+R:x;return{width:B+(h?-D:D),height:j+(p?-R:R),x:c[0]*D*(h?-1:1)+k,y:c[1]*R*(p?-1:1)+$}}const u1={width:0,height:0,x:0,y:0},ZA={...u1,pointerX:0,pointerY:0,aspectRatio:1};function FA(e,n,s){const a=n.position.x+e.position.x,o=n.position.y+e.position.y,c=e.measured.width??0,u=e.measured.height??0,d=s[0]*c,h=s[1]*u;return[[a-d,o-h],[a+c-d,o+u-h]]}function JA({domNode:e,nodeId:n,getStoreItems:s,onChange:a,onEnd:o}){const c=cn(e);let u={controlDirection:ev("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function d({controlPosition:p,boundaries:v,keepAspectRatio:g,resizeDirection:y,onResizeStart:w,onResize:E,onResizeEnd:N,shouldResize:A}){let C={...u1},z={...ZA};u={boundaries:v,resizeDirection:y,keepAspectRatio:g,controlDirection:ev(p)};let _,x=null,B=[],j,T,D,R=!1;const Z=Sb().on("start",Y=>{const{nodeLookup:K,transform:le,snapGrid:L,snapToGrid:G,nodeOrigin:k,paneDomNode:$}=s();if(_=K.get(n),!_)return;x=$?.getBoundingClientRect()??null;const{xSnapped:H,ySnapped:X}=zo(Y.sourceEvent,{transform:le,snapGrid:L,snapToGrid:G,containerBounds:x});C={width:_.measured.width??0,height:_.measured.height??0,x:_.position.x??0,y:_.position.y??0},z={...C,pointerX:H,pointerY:X,aspectRatio:C.width/C.height},j=void 0,T=Ks(_.extent)?_.extent:void 0,_.parentId&&(_.extent==="parent"||_.expandParent)&&(j=K.get(_.parentId)),j&&_.extent==="parent"&&(T=[[0,0],[j.measured.width,j.measured.height]]),B=[],D=void 0;for(const[W,O]of K)if(O.parentId===n&&(B.push({id:W,position:{...O.position},extent:O.extent}),O.extent==="parent"||O.expandParent)){const I=FA(O,_,O.origin??k);D?D=[[Math.min(I[0][0],D[0][0]),Math.min(I[0][1],D[0][1])],[Math.max(I[1][0],D[1][0]),Math.max(I[1][1],D[1][1])]]:D=I}w?.(Y,{...C})}).on("drag",Y=>{const{transform:K,snapGrid:le,snapToGrid:L,nodeOrigin:G}=s(),k=zo(Y.sourceEvent,{transform:K,snapGrid:le,snapToGrid:L,containerBounds:x}),$=[];if(!_)return;const{x:H,y:X,width:W,height:O}=C,I={},ee=_.origin??G,{width:ne,height:fe,x:de,y:ae}=QA(z,u.controlDirection,k,u.boundaries,u.keepAspectRatio,ee,T,D),te=ne!==W,ue=fe!==O,Se=de!==H&&te,we=ae!==X&&ue;if(!Se&&!we&&!te&&!ue)return;if((Se||we||ee[0]===1||ee[1]===1)&&(I.x=Se?de:C.x,I.y=we?ae:C.y,C.x=I.x,C.y=I.y,B.length>0)){const Me=de-H,Be=ae-X;for(const Et of B)Et.position={x:Et.position.x-Me+ee[0]*(ne-W),y:Et.position.y-Be+ee[1]*(fe-O)},$.push(Et)}if((te||ue)&&(I.width=te&&(!u.resizeDirection||u.resizeDirection==="horizontal")?ne:C.width,I.height=ue&&(!u.resizeDirection||u.resizeDirection==="vertical")?fe:C.height,C.width=I.width,C.height=I.height),j&&_.expandParent){const Me=ee[0]*(I.width??0);I.x&&I.x<Me&&(C.x=Me,z.x=z.x-(I.x-Me));const Be=ee[1]*(I.height??0);I.y&&I.y<Be&&(C.y=Be,z.y=z.y-(I.y-Be))}const ge=KA({width:C.width,prevWidth:W,height:C.height,prevHeight:O,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),ve={...C,direction:ge};A?.(Y,ve)!==!1&&(R=!0,E?.(Y,ve),a(I,$))}).on("end",Y=>{R&&(N?.(Y,{...C}),o?.({...C}),R=!1)});c.call(Z)}function h(){c.on(".drag",null)}return{update:d,destroy:h}}var oh={exports:{}},rh={},ch={exports:{}},uh={};var nv;function WA(){if(nv)return uh;nv=1;var e=Jo();function n(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var s=typeof Object.is=="function"?Object.is:n,a=e.useState,o=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function d(g,y){var w=y(),E=a({inst:{value:w,getSnapshot:y}}),N=E[0].inst,A=E[1];return c(function(){N.value=w,N.getSnapshot=y,h(N)&&A({inst:N})},[g,w,y]),o(function(){return h(N)&&A({inst:N}),g(function(){h(N)&&A({inst:N})})},[g]),u(w),w}function h(g){var y=g.getSnapshot;g=g.value;try{var w=y();return!s(g,w)}catch{return!0}}function p(g,y){return y()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:d;return uh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:v,uh}var iv;function PA(){return iv||(iv=1,ch.exports=WA()),ch.exports}var sv;function eT(){if(sv)return rh;sv=1;var e=Jo(),n=PA();function s(p,v){return p===v&&(p!==0||1/p===1/v)||p!==p&&v!==v}var a=typeof Object.is=="function"?Object.is:s,o=n.useSyncExternalStore,c=e.useRef,u=e.useEffect,d=e.useMemo,h=e.useDebugValue;return rh.useSyncExternalStoreWithSelector=function(p,v,g,y,w){var E=c(null);if(E.current===null){var N={hasValue:!1,value:null};E.current=N}else N=E.current;E=d(function(){function C(j){if(!z){if(z=!0,_=j,j=y(j),w!==void 0&&N.hasValue){var T=N.value;if(w(T,j))return x=T}return x=j}if(T=x,a(_,j))return T;var D=y(j);return w!==void 0&&w(T,D)?(_=j,T):(_=j,x=D)}var z=!1,_,x,B=g===void 0?null:g;return[function(){return C(v())},B===null?void 0:function(){return C(B())}]},[v,g,y,w]);var A=o(p,E[0],E[1]);return u(function(){N.hasValue=!0,N.value=A},[A]),h(A),A},rh}var av;function tT(){return av||(av=1,oh.exports=eT()),oh.exports}var nT=tT();const iT=sb(nT),sT={},lv=e=>{let n;const s=new Set,a=(v,g)=>{const y=typeof v=="function"?v(n):v;if(!Object.is(y,n)){const w=n;n=g??(typeof y!="object"||y===null)?y:Object.assign({},n,y),s.forEach(E=>E(n,w))}},o=()=>n,h={setState:a,getState:o,getInitialState:()=>p,subscribe:v=>(s.add(v),()=>s.delete(v)),destroy:()=>{(sT?"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()}},p=n=e(a,o,h);return h},aT=e=>e?lv(e):lv,{useDebugValue:lT}=du,{useSyncExternalStoreWithSelector:oT}=iT,rT=e=>e;function f1(e,n=rT,s){const a=oT(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,s);return lT(a),a}const ov=(e,n)=>{const s=aT(e),a=(o,c=n)=>f1(s,o,c);return Object.assign(a,s),a},cT=(e,n)=>e?ov(e,n):ov;function nt(e,n){if(Object.is(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;if(e instanceof Map&&n instanceof Map){if(e.size!==n.size)return!1;for(const[a,o]of e)if(!Object.is(o,n.get(a)))return!1;return!0}if(e instanceof Set&&n instanceof Set){if(e.size!==n.size)return!1;for(const a of e)if(!n.has(a))return!1;return!0}const s=Object.keys(e);if(s.length!==Object.keys(n).length)return!1;for(const a of s)if(!Object.prototype.hasOwnProperty.call(n,a)||!Object.is(e[a],n[a]))return!1;return!0}var uT=ab();const wu=q.createContext(null),fT=wu.Provider,d1=Un.error001("react");function Re(e,n){const s=q.useContext(wu);if(s===null)throw new Error(d1);return f1(s,e,n)}function st(){const e=q.useContext(wu);if(e===null)throw new Error(d1);return q.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const rv={display:"none"},dT={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},h1="react-flow__node-desc",m1="react-flow__edge-desc",hT="react-flow__aria-live",mT=e=>e.ariaLiveMessage,pT=e=>e.ariaLabelConfig;function gT({rfId:e}){const n=Re(mT);return S.jsx("div",{id:`${hT}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:dT,children:n})}function yT({rfId:e,disableKeyboardA11y:n}){const s=Re(pT);return S.jsxs(S.Fragment,{children:[S.jsx("div",{id:`${h1}-${e}`,style:rv,children:n?s["node.a11yDescription.default"]:s["node.a11yDescription.keyboardDisabled"]}),S.jsx("div",{id:`${m1}-${e}`,style:rv,children:s["edge.a11yDescription.default"]}),!n&&S.jsx(gT,{rfId:e})]})}const xu=q.forwardRef(({position:e="top-left",children:n,className:s,style:a,...o},c)=>{const u=`${e}`.split("-");return S.jsx("div",{className:bt(["react-flow__panel",s,...u]),style:a,ref:c,...o,children:n})});xu.displayName="Panel";function vT({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:S.jsx(xu,{position:n,className:"react-flow__attribution","data-message":"Please only hide this attribution when you are subscribed to React Flow Pro: https://pro.reactflow.dev",children:S.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const bT=e=>{const n=[],s=[];for(const[,a]of e.nodeLookup)a.selected&&n.push(a.internals.userNode);for(const[,a]of e.edgeLookup)a.selected&&s.push(a);return{selectedNodes:n,selectedEdges:s}},kc=e=>e.id;function ST(e,n){return nt(e.selectedNodes.map(kc),n.selectedNodes.map(kc))&&nt(e.selectedEdges.map(kc),n.selectedEdges.map(kc))}function wT({onSelectionChange:e}){const n=st(),{selectedNodes:s,selectedEdges:a}=Re(bT,ST);return q.useEffect(()=>{const o={nodes:s,edges:a};e?.(o),n.getState().onSelectionChangeHandlers.forEach(c=>c(o))},[s,a,e]),null}const xT=e=>!!e.onSelectionChangeHandlers;function ET({onSelectionChange:e}){const n=Re(xT);return e||n?S.jsx(wT,{onSelectionChange:e}):null}const p1=[0,0],NT={x:0,y:0,zoom:1},_T=["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"],cv=[..._T,"rfId"],AT=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),uv={translateExtent:Uo,nodeOrigin:p1,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function TT(e){const{setNodes:n,setEdges:s,setMinZoom:a,setMaxZoom:o,setTranslateExtent:c,setNodeExtent:u,reset:d,setDefaultNodesAndEdges:h}=Re(AT,nt),p=st();q.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{v.current=uv,d()}),[]);const v=q.useRef(uv);return q.useEffect(()=>{for(const g of cv){const y=e[g],w=v.current[g];y!==w&&(typeof e[g]>"u"||(g==="nodes"?n(y):g==="edges"?s(y):g==="minZoom"?a(y):g==="maxZoom"?o(y):g==="translateExtent"?c(y):g==="nodeExtent"?u(y):g==="ariaLabelConfig"?p.setState({ariaLabelConfig:uA(y)}):g==="fitView"?p.setState({fitViewQueued:y}):g==="fitViewOptions"?p.setState({fitViewOptions:y}):p.setState({[g]:y})))}v.current=e},cv.map(g=>e[g])),null}function fv(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function CT(e){const[n,s]=q.useState(e==="system"?null:e);return q.useEffect(()=>{if(e!=="system"){s(e);return}const a=fv(),o=()=>s(a?.matches?"dark":"light");return o(),a?.addEventListener("change",o),()=>{a?.removeEventListener("change",o)}},[e]),n!==null?n:fv()?.matches?"dark":"light"}const dv=typeof document<"u"?document:null;function Go(e=null,n={target:dv,actInsideInputWithModifier:!0}){const[s,a]=q.useState(!1),o=q.useRef(!1),c=q.useRef(new Set([])),[u,d]=q.useMemo(()=>{if(e!==null){const p=(Array.isArray(e)?e:[e]).filter(g=>typeof g=="string").map(g=>g.replace("+",`
10
- `).replace(`
11
-
12
- `,`
13
- +`).split(`
14
- `)),v=p.reduce((g,y)=>g.concat(...y),[]);return[p,v]}return[[],[]]},[e]);return q.useEffect(()=>{const h=n?.target??dv,p=n?.actInsideInputWithModifier??!0;if(e!==null){const v=w=>{if(o.current=w.ctrlKey||w.metaKey||w.shiftKey||w.altKey,(!o.current||o.current&&!p)&&Qb(w))return!1;const N=mv(w.code,d);if(c.current.add(w[N]),hv(u,c.current,!1)){const A=w.composedPath?.()?.[0]||w.target,C=A?.nodeName==="BUTTON"||A?.nodeName==="A";n.preventDefault!==!1&&(o.current||!C)&&w.preventDefault(),a(!0)}},g=w=>{const E=mv(w.code,d);hv(u,c.current,!0)?(a(!1),c.current.clear()):c.current.delete(w[E]),w.key==="Meta"&&c.current.clear(),o.current=!1},y=()=>{c.current.clear(),a(!1)};return h?.addEventListener("keydown",v),h?.addEventListener("keyup",g),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{h?.removeEventListener("keydown",v),h?.removeEventListener("keyup",g),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[e,a]),s}function hv(e,n,s){return e.filter(a=>s||a.length===n.size).some(a=>a.every(o=>n.has(o)))}function mv(e,n){return n.includes(e)?"code":"key"}const MT=()=>{const e=st();return q.useMemo(()=>({zoomIn:async n=>{const{panZoom:s}=e.getState();return s?s.scaleBy(1.2,n):!1},zoomOut:async n=>{const{panZoom:s}=e.getState();return s?s.scaleBy(1/1.2,n):!1},zoomTo:async(n,s)=>{const{panZoom:a}=e.getState();return a?a.scaleTo(n,s):!1},getZoom:()=>e.getState().transform[2],setViewport:async(n,s)=>{const{transform:[a,o,c],panZoom:u}=e.getState();return u?(await u.setViewport({x:n.x??a,y:n.y??o,zoom:n.zoom??c},s),!0):!1},getViewport:()=>{const[n,s,a]=e.getState().transform;return{x:n,y:s,zoom:a}},setCenter:async(n,s,a)=>e.getState().setCenter(n,s,a),fitBounds:async(n,s)=>{const{width:a,height:o,minZoom:c,maxZoom:u,panZoom:d}=e.getState(),h=lm(n,a,o,c,u,s?.padding??.1);return d?(await d.setViewport(h,{duration:s?.duration,ease:s?.ease,interpolate:s?.interpolate}),!0):!1},screenToFlowPosition:(n,s={})=>{const{transform:a,snapGrid:o,snapToGrid:c,domNode:u}=e.getState();if(!u)return n;const{x:d,y:h}=u.getBoundingClientRect(),p={x:n.x-d,y:n.y-h},v=s.snapGrid??o,g=s.snapToGrid??c;return yl(p,a,g,v)},flowToScreenPosition:n=>{const{transform:s,domNode:a}=e.getState();if(!a)return n;const{x:o,y:c}=a.getBoundingClientRect(),u=dl(n,s);return{x:u.x+o,y:u.y+c}}}),[])};function g1(e,n){const s=[],a=new Map,o=[];for(const c of e)if(c.type==="add"){o.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 n){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 d={...c};for(const h of u)OT(h,d);s.push(d)}return o.length&&o.forEach(c=>{c.index!==void 0?s.splice(c.index,0,{...c.item}):s.push({...c.item})}),s}function OT(e,n){switch(e.type){case"select":{n.selected=e.selected;break}case"position":{typeof e.position<"u"&&(n.position=e.position),typeof e.dragging<"u"&&(n.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(n.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(n.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(n.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(n.resizing=e.resizing);break}}}function kT(e,n){return g1(e,n)}function zT(e,n){return g1(e,n)}function Ls(e,n){return{id:e,type:"select",selected:n}}function Ka(e,n=new Set,s=!1){const a=[];for(const[o,c]of e){const u=n.has(o);!(c.selected===void 0&&!u)&&c.selected!==u&&(s&&(c.selected=u),a.push(Ls(c.id,u)))}return a}function pv({items:e=[],lookup:n}){const s=[],a=new Map(e.map(o=>[o.id,o]));for(const[o,c]of e.entries()){const u=n.get(c.id),d=u?.internals?.userNode??u;d!==void 0&&d!==c&&s.push({id:c.id,item:c,type:"replace"}),d===void 0&&s.push({item:c,type:"add",index:o})}for(const[o]of n)a.get(o)===void 0&&s.push({id:o,type:"remove"});return s}function gv(e){return{id:e.id,type:"remove"}}const jT=Yb();function DT(e,n,s={}){return gA(e,n,{...s,onError:s.onError??jT})}const yv=e=>tA(e),RT=e=>Ub(e);function y1(e){return q.forwardRef(e)}const BT=typeof window<"u"?q.useLayoutEffect:q.useEffect;function vv(e){const[n,s]=q.useState(BigInt(0)),[a]=q.useState(()=>LT(()=>s(o=>o+BigInt(1))));return BT(()=>{const o=a.get();o.length&&(e(o),a.reset())},[n]),a}function LT(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:s=>{n.push(s),e()}}}const v1=q.createContext(null);function $T({children:e}){const n=st(),s=q.useCallback(d=>{const{nodes:h=[],setNodes:p,hasDefaultNodes:v,onNodesChange:g,nodeLookup:y,fitViewQueued:w,onNodesChangeMiddlewareMap:E}=n.getState();let N=h;for(const C of d)N=typeof C=="function"?C(N):C;let A=pv({items:N,lookup:y});for(const C of E.values())A=C(A);v&&p(N),A.length>0?g?.(A):w&&window.requestAnimationFrame(()=>{const{fitViewQueued:C,nodes:z,setNodes:_}=n.getState();C&&_(z)})},[]),a=vv(s),o=q.useCallback(d=>{const{edges:h=[],setEdges:p,hasDefaultEdges:v,onEdgesChange:g,edgeLookup:y}=n.getState();let w=h;for(const E of d)w=typeof E=="function"?E(w):E;v?p(w):g&&g(pv({items:w,lookup:y}))},[]),c=vv(o),u=q.useMemo(()=>({nodeQueue:a,edgeQueue:c}),[]);return S.jsx(v1.Provider,{value:u,children:e})}function HT(){const e=q.useContext(v1);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const UT=e=>!!e.panZoom;function Eu(){const e=MT(),n=st(),s=HT(),a=Re(UT),o=q.useMemo(()=>{const c=g=>n.getState().nodeLookup.get(g),u=g=>{s.nodeQueue.push(g)},d=g=>{s.edgeQueue.push(g)},h=g=>{const{nodeLookup:y,nodeOrigin:w}=n.getState(),E=yv(g)?g:y.get(g.id),N=E.parentId?Xb(E.position,E.measured,E.parentId,y,w):E.position,A={...E,position:N,width:E.measured?.width??E.width,height:E.measured?.height??E.height};return fl(A)},p=(g,y,w={replace:!1})=>{u(E=>E.map(N=>{if(N.id===g){const A=typeof y=="function"?y(N):y;return w.replace&&yv(A)?A:{...N,...A}}return N}))},v=(g,y,w={replace:!1})=>{d(E=>E.map(N=>{if(N.id===g){const A=typeof y=="function"?y(N):y;return w.replace&&RT(A)?A:{...N,...A}}return N}))};return{getNodes:()=>n.getState().nodes.map(g=>({...g})),getNode:g=>c(g)?.internals.userNode,getInternalNode:c,getEdges:()=>{const{edges:g=[]}=n.getState();return g.map(y=>({...y}))},getEdge:g=>n.getState().edgeLookup.get(g),setNodes:u,setEdges:d,addNodes:g=>{const y=Array.isArray(g)?g:[g];s.nodeQueue.push(w=>[...w,...y])},addEdges:g=>{const y=Array.isArray(g)?g:[g];s.edgeQueue.push(w=>[...w,...y])},toObject:()=>{const{nodes:g=[],edges:y=[],transform:w}=n.getState(),[E,N,A]=w;return{nodes:g.map(C=>({...C})),edges:y.map(C=>({...C})),viewport:{x:E,y:N,zoom:A}}},deleteElements:async({nodes:g=[],edges:y=[]})=>{const{nodes:w,edges:E,onNodesDelete:N,onEdgesDelete:A,triggerNodeChanges:C,triggerEdgeChanges:z,onDelete:_,onBeforeDelete:x}=n.getState(),{nodes:B,edges:j}=await lA({nodesToRemove:g,edgesToRemove:y,nodes:w,edges:E,onBeforeDelete:x}),T=j.length>0,D=B.length>0;if(T){const R=j.map(gv);A?.(j),z(R)}if(D){const R=B.map(gv);N?.(B),C(R)}return(D||T)&&_?.({nodes:B,edges:j}),{deletedNodes:B,deletedEdges:j}},getIntersectingNodes:(g,y=!0,w)=>{const E=V0(g),N=E?g:h(g),A=w!==void 0;return N?(w||n.getState().nodes).filter(C=>{const z=n.getState().nodeLookup.get(C.id);if(z&&!E&&(C.id===g.id||!z.internals.positionAbsolute))return!1;const _=fl(A?C:z),x=Vo(_,N);return y&&x>0||x>=_.width*_.height||x>=N.width*N.height}):[]},isNodeIntersecting:(g,y,w=!0)=>{const N=V0(g)?g:h(g);if(!N)return!1;const A=Vo(N,y);return w&&A>0||A>=y.width*y.height||A>=N.width*N.height},updateNode:p,updateNodeData:(g,y,w={replace:!1})=>{p(g,E=>{const N=typeof y=="function"?y(E):y;return w.replace?{...E,data:N}:{...E,data:{...E.data,...N}}},w)},updateEdge:v,updateEdgeData:(g,y,w={replace:!1})=>{v(g,E=>{const N=typeof y=="function"?y(E):y;return w.replace?{...E,data:N}:{...E,data:{...E.data,...N}}},w)},getNodesBounds:g=>{const{nodeLookup:y,nodeOrigin:w}=n.getState();return nA(g,{nodeLookup:y,nodeOrigin:w})},getHandleConnections:({type:g,id:y,nodeId:w})=>Array.from(n.getState().connectionLookup.get(`${w}-${g}${y?`-${y}`:""}`)?.values()??[]),getNodeConnections:({type:g,handleId:y,nodeId:w})=>Array.from(n.getState().connectionLookup.get(`${w}${g?y?`-${g}-${y}`:`-${g}`:""}`)?.values()??[]),fitView:async g=>{const y=n.getState().fitViewResolver??cA();return n.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:y}),s.nodeQueue.push(w=>[...w]),y.promise}}},[]);return q.useMemo(()=>({...o,...e,viewportInitialized:a}),[a])}const bv=e=>e.selected,IT=typeof window<"u"?window:void 0;function qT({deleteKeyCode:e,multiSelectionKeyCode:n}){const s=st(),{deleteElements:a}=Eu(),o=Go(e,{actInsideInputWithModifier:!1}),c=Go(n,{target:IT});q.useEffect(()=>{if(o){const{edges:u,nodes:d}=s.getState();a({nodes:d.filter(bv),edges:u.filter(bv)}),s.setState({nodesSelectionActive:!1})}},[o]),q.useEffect(()=>{s.setState({multiSelectionActive:c})},[c])}function VT(e){const n=st();q.useEffect(()=>{const s=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const a=om(e.current);(a.height===0||a.width===0)&&n.getState().onError?.("004",Un.error004()),n.setState({width:a.width||500,height:a.height||500})};if(e.current){s(),window.addEventListener("resize",s);const a=new ResizeObserver(()=>s());return a.observe(e.current),()=>{window.removeEventListener("resize",s),a&&e.current&&a.unobserve(e.current)}}},[])}const Nu={position:"absolute",width:"100%",height:"100%",top:0,left:0},YT=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function GT({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:s=!0,panOnScroll:a=!1,panOnScrollSpeed:o=.5,panOnScrollMode:c=Vs.Free,zoomOnDoubleClick:u=!0,panOnDrag:d=!0,defaultViewport:h,translateExtent:p,minZoom:v,maxZoom:g,zoomActivationKeyCode:y,preventScrolling:w=!0,children:E,noWheelClassName:N,noPanClassName:A,onViewportChange:C,isControlledViewport:z,paneClickDistance:_,selectionOnDrag:x}){const B=st(),j=q.useRef(null),{userSelectionActive:T,lib:D,connectionInProgress:R}=Re(YT,nt),Z=Go(y),Y=q.useRef();VT(j);const K=q.useCallback(le=>{C?.({x:le[0],y:le[1],zoom:le[2]}),z||B.setState({transform:le})},[C,z]);return q.useEffect(()=>{if(j.current){Y.current=XA({domNode:j.current,minZoom:v,maxZoom:g,translateExtent:p,viewport:h,onDraggingChange:k=>B.setState($=>$.paneDragging===k?$:{paneDragging:k}),onPanZoomStart:(k,$)=>{const{onViewportChangeStart:H,onMoveStart:X}=B.getState();X?.(k,$),H?.($)},onPanZoom:(k,$)=>{const{onViewportChange:H,onMove:X}=B.getState();X?.(k,$),H?.($)},onPanZoomEnd:(k,$)=>{const{onViewportChangeEnd:H,onMoveEnd:X}=B.getState();X?.(k,$),H?.($)}});const{x:le,y:L,zoom:G}=Y.current.getViewport();return B.setState({panZoom:Y.current,transform:[le,L,G],domNode:j.current.closest(".react-flow")}),()=>{Y.current?.destroy()}}},[]),q.useEffect(()=>{Y.current?.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:s,panOnScroll:a,panOnScrollSpeed:o,panOnScrollMode:c,zoomOnDoubleClick:u,panOnDrag:d,zoomActivationKeyPressed:Z,preventScrolling:w,noPanClassName:A,userSelectionActive:T,noWheelClassName:N,lib:D,onTransformChange:K,connectionInProgress:R,selectionOnDrag:x,paneClickDistance:_})},[e,n,s,a,o,c,u,d,Z,w,A,T,N,D,K,R,x,_]),S.jsx("div",{className:"react-flow__renderer",ref:j,style:Nu,children:E})}const XT=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function KT(){const{userSelectionActive:e,userSelectionRect:n}=Re(XT,nt);return e&&n?S.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:n.width,height:n.height,transform:`translate(${n.x}px, ${n.y}px)`}}):null}const fh=(e,n)=>s=>{s.target===n.current&&e?.(s)},QT=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function ZT({isSelecting:e,selectionKeyPressed:n,selectionMode:s=Io.Full,panOnDrag:a,autoPanOnSelection:o,paneClickDistance:c,selectionOnDrag:u,onSelectionStart:d,onSelectionEnd:h,onPaneClick:p,onPaneContextMenu:v,onPaneScroll:g,onPaneMouseEnter:y,onPaneMouseMove:w,onPaneMouseLeave:E,children:N}){const A=q.useRef(0),C=st(),{userSelectionActive:z,elementsSelectable:_,dragging:x,connectionInProgress:B,panBy:j,autoPanSpeed:T}=Re(QT,nt),D=_&&(e||z),R=q.useRef(null),Z=q.useRef(),Y=q.useRef(new Set),K=q.useRef(new Set),le=q.useRef(!1),L=q.useRef({x:0,y:0}),G=q.useRef(!1),k=te=>{if(le.current||B){le.current=!1;return}p?.(te),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},$=te=>{if(Array.isArray(a)&&a?.includes(2)){te.preventDefault();return}v?.(te)},H=g?te=>g(te):void 0,X=te=>{le.current&&(te.stopPropagation(),le.current=!1)},W=te=>{const{domNode:ue,transform:Se}=C.getState();if(Z.current=ue?.getBoundingClientRect(),!Z.current)return;const we=te.target===R.current;if(!we&&!!te.target.closest(".nokey")||!e||!(u&&we||n)||te.button!==0||!te.isPrimary)return;te.target?.setPointerCapture?.(te.pointerId),le.current=!1;const{x:Ee,y:Me}=Hn(te.nativeEvent,Z.current),Be=yl({x:Ee,y:Me},Se);C.setState({userSelectionRect:{width:0,height:0,startX:Be.x,startY:Be.y,x:Ee,y:Me}}),we||(te.stopPropagation(),te.preventDefault())};function O(te,ue){const{userSelectionRect:Se}=C.getState();if(!Se)return;const{transform:we,nodeLookup:ge,edgeLookup:ve,connectionLookup:Ee,triggerNodeChanges:Me,triggerEdgeChanges:Be,defaultEdgeOptions:Et}=C.getState(),Bt={x:Se.startX,y:Se.startY},{x:Nt,y:We}=dl(Bt,we),St={startX:Bt.x,startY:Bt.y,x:te<Nt?te:Nt,y:ue<We?ue:We,width:Math.abs(te-Nt),height:Math.abs(ue-We)},ti=Y.current,He=K.current;Y.current=new Set(sm(ge,St,we,s===Io.Partial,!0).map(_t=>_t.id)),K.current=new Set;const Ye=Et?.selectable??!0;for(const _t of Y.current){const Ht=Ee.get(_t);if(Ht)for(const{edgeId:Ut}of Ht.values()){const It=ve.get(Ut);It&&(It.selectable??Ye)&&K.current.add(Ut)}}if(!Y0(ti,Y.current)){const _t=Ka(ge,Y.current,!0);Me(_t)}if(!Y0(He,K.current)){const _t=Ka(ve,K.current);Be(_t)}C.setState({userSelectionRect:St,userSelectionActive:!0,nodesSelectionActive:!1})}function I(){if(!o||!Z.current)return;const[te,ue]=am(L.current,Z.current,T);j({x:te,y:ue}).then(Se=>{if(!le.current||!Se){A.current=requestAnimationFrame(I);return}const{x:we,y:ge}=L.current;O(we,ge),A.current=requestAnimationFrame(I)})}const ee=()=>{cancelAnimationFrame(A.current),A.current=0,G.current=!1};q.useEffect(()=>()=>ee(),[]);const ne=te=>{const{userSelectionRect:ue,transform:Se,resetSelectedElements:we}=C.getState();if(!Z.current||!ue)return;const{x:ge,y:ve}=Hn(te.nativeEvent,Z.current);L.current={x:ge,y:ve};const Ee=dl({x:ue.startX,y:ue.startY},Se);if(!le.current){const Me=n?0:c;if(Math.hypot(ge-Ee.x,ve-Ee.y)<=Me)return;we(),d?.(te)}le.current=!0,G.current||(I(),G.current=!0),O(ge,ve)},fe=te=>{te.button===0&&(te.target?.releasePointerCapture?.(te.pointerId),!z&&te.target===R.current&&C.getState().userSelectionRect&&k?.(te),C.setState({userSelectionActive:!1,userSelectionRect:null}),le.current&&(h?.(te),C.setState({nodesSelectionActive:Y.current.size>0})),ee())},de=te=>{te.target?.releasePointerCapture?.(te.pointerId),ee()},ae=a===!0||Array.isArray(a)&&a.includes(0);return S.jsxs("div",{className:bt(["react-flow__pane",{draggable:ae,dragging:x,selection:e}]),onClick:D?void 0:fh(k,R),onContextMenu:fh($,R),onWheel:fh(H,R),onPointerEnter:D?void 0:y,onPointerMove:D?ne:w,onPointerUp:D?fe:void 0,onPointerCancel:D?de:void 0,onPointerDownCapture:D?W:void 0,onClickCapture:D?X:void 0,onPointerLeave:E,ref:R,style:Nu,children:[N,S.jsx(KT,{})]})}function Bh({id:e,store:n,unselect:s=!1,nodeRef:a}){const{addSelectedNodes:o,unselectNodesAndEdges:c,multiSelectionActive:u,nodeLookup:d,onError:h}=n.getState(),p=d.get(e);if(!p){h?.("012",Un.error012(e));return}n.setState({nodesSelectionActive:!1}),p.selected?(s||p.selected&&u)&&(c({nodes:[p],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):o([e])}function b1({nodeRef:e,disabled:n=!1,noDragClassName:s,handleSelector:a,nodeId:o,isSelectable:c,nodeClickDistance:u}){const d=st(),[h,p]=q.useState(!1),v=q.useRef();return q.useEffect(()=>{v.current=zA({getStoreItems:()=>d.getState(),onNodeMouseDown:g=>{Bh({id:g,store:d,nodeRef:e})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),q.useEffect(()=>{if(!(n||!e.current||!v.current))return v.current.update({noDragClassName:s,handleSelector:a,domNode:e.current,isSelectable:c,nodeId:o,nodeClickDistance:u}),()=>{v.current?.destroy()}},[s,a,n,c,e,o,u]),h}const FT=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function S1(){const e=st();return q.useCallback(s=>{const{nodeExtent:a,snapToGrid:o,snapGrid:c,nodesDraggable:u,onError:d,updateNodePositions:h,nodeLookup:p,nodeOrigin:v}=e.getState(),g=new Map,y=FT(u),w=o?c[0]:5,E=o?c[1]:5,N=s.direction.x*w*s.factor,A=s.direction.y*E*s.factor;for(const[,C]of p){if(!y(C))continue;let z={x:C.internals.positionAbsolute.x+N,y:C.internals.positionAbsolute.y+A};o&&(z=nr(z,c));const{position:_,positionAbsolute:x}=Ib({nodeId:C.id,nextPosition:z,nodeLookup:p,nodeExtent:a,nodeOrigin:v,onError:d});C.position=_,C.internals.positionAbsolute=x,g.set(C.id,C)}h(g)},[])}const hm=q.createContext(null),JT=hm.Provider;hm.Consumer;const w1=()=>q.useContext(hm),WT=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),PT=(e,n,s)=>a=>{const{connectionClickStartHandle:o,connectionMode:c,connection:u}=a,{fromHandle:d,toHandle:h,isValid:p}=u,v=h?.nodeId===e&&h?.id===n&&h?.type===s;return{connectingFrom:d?.nodeId===e&&d?.id===n&&d?.type===s,connectingTo:v,clickConnecting:o?.nodeId===e&&o?.id===n&&o?.type===s,isPossibleEndHandle:c===cl.Strict?d?.type!==s:e!==d?.nodeId||n!==d?.id,connectionInProcess:!!d,clickConnectionInProcess:!!o,valid:v&&p}};function eC({type:e="source",position:n=he.Top,isValidConnection:s,isConnectable:a=!0,isConnectableStart:o=!0,isConnectableEnd:c=!0,id:u,onConnect:d,children:h,className:p,onMouseDown:v,onTouchStart:g,...y},w){const E=u||null,N=e==="target",A=st(),C=w1(),{connectOnClick:z,noPanClassName:_,rfId:x}=Re(WT,nt),{connectingFrom:B,connectingTo:j,clickConnecting:T,isPossibleEndHandle:D,connectionInProcess:R,clickConnectionInProcess:Z,valid:Y}=Re(PT(C,E,e),nt);C||A.getState().onError?.("010",Un.error010());const K=G=>{const{defaultEdgeOptions:k,onConnect:$,hasDefaultEdges:H}=A.getState(),X={...k,...G};if(H){const{edges:W,setEdges:O,onError:I}=A.getState();O(DT(X,W,{onError:I}))}$?.(X),d?.(X)},le=G=>{if(!C)return;const k=Zb(G.nativeEvent);if(o&&(k&&G.button===0||!k)){const $=A.getState();Rh.onPointerDown(G.nativeEvent,{handleDomNode:G.currentTarget,autoPanOnConnect:$.autoPanOnConnect,connectionMode:$.connectionMode,connectionRadius:$.connectionRadius,domNode:$.domNode,nodeLookup:$.nodeLookup,lib:$.lib,isTarget:N,handleId:E,nodeId:C,flowId:$.rfId,panBy:$.panBy,cancelConnection:$.cancelConnection,onConnectStart:$.onConnectStart,onConnectEnd:(...H)=>A.getState().onConnectEnd?.(...H),updateConnection:$.updateConnection,onConnect:K,isValidConnection:s||((...H)=>A.getState().isValidConnection?.(...H)??!0),getTransform:()=>A.getState().transform,getFromHandle:()=>A.getState().connection.fromHandle,autoPanSpeed:$.autoPanSpeed,dragThreshold:$.connectionDragThreshold})}k?v?.(G):g?.(G)},L=G=>{const{onClickConnectStart:k,onClickConnectEnd:$,connectionClickStartHandle:H,connectionMode:X,isValidConnection:W,lib:O,rfId:I,nodeLookup:ee,connection:ne}=A.getState();if(!C||!H&&!o)return;if(!H){k?.(G.nativeEvent,{nodeId:C,handleId:E,handleType:e}),A.setState({connectionClickStartHandle:{nodeId:C,type:e,id:E}});return}const fe=Kb(G.target),de=s||W,{connection:ae,isValid:te}=Rh.isValid(G.nativeEvent,{handle:{nodeId:C,id:E,type:e},connectionMode:X,fromNodeId:H.nodeId,fromHandleId:H.id||null,fromType:H.type,isValidConnection:de,flowId:I,doc:fe,lib:O,nodeLookup:ee});te&&ae&&K(ae);const ue=structuredClone(ne);delete ue.inProgress,ue.toPosition=ue.toHandle?ue.toHandle.position:null,$?.(G,ue),A.setState({connectionClickStartHandle:null})};return S.jsx("div",{"data-handleid":E,"data-nodeid":C,"data-handlepos":n,"data-id":`${x}-${C}-${E}-${e}`,className:bt(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",_,p,{source:!N,target:N,connectable:a,connectablestart:o,connectableend:c,clickconnecting:T,connectingfrom:B,connectingto:j,valid:Y,connectionindicator:a&&(!R||D)&&(R||Z?c:o)}]),onMouseDown:le,onTouchStart:le,onClick:z?L:void 0,ref:w,...y,children:h})}const En=q.memo(y1(eC));function tC({data:e,isConnectable:n,sourcePosition:s=he.Bottom}){return S.jsxs(S.Fragment,{children:[e?.label,S.jsx(En,{type:"source",position:s,isConnectable:n})]})}function nC({data:e,isConnectable:n,targetPosition:s=he.Top,sourcePosition:a=he.Bottom}){return S.jsxs(S.Fragment,{children:[S.jsx(En,{type:"target",position:s,isConnectable:n}),e?.label,S.jsx(En,{type:"source",position:a,isConnectable:n})]})}function iC(){return null}function sC({data:e,isConnectable:n,targetPosition:s=he.Top}){return S.jsxs(S.Fragment,{children:[S.jsx(En,{type:"target",position:s,isConnectable:n}),e?.label]})}const au={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Sv={input:tC,default:nC,output:sC,group:iC};function aC(e){return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??e.style?.width,height:e.height??e.initialHeight??e.style?.height}:{width:e.width??e.style?.width,height:e.height??e.style?.height}}const lC=e=>{const{width:n,height:s,x:a,y:o}=tr(e.nodeLookup,{filter:c=>!!c.selected});return{width:$n(n)?n:null,height:$n(s)?s:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${a}px,${o}px)`}};function oC({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:s}){const a=st(),{width:o,height:c,transformString:u,userSelectionActive:d}=Re(lC,nt),h=S1(),p=q.useRef(null);q.useEffect(()=>{s||p.current?.focus({preventScroll:!0})},[s]);const v=!d&&o!==null&&c!==null;if(b1({nodeRef:p,disabled:!v}),!v)return null;const g=e?w=>{const E=a.getState().nodes.filter(N=>N.selected);e(w,E)}:void 0,y=w=>{Object.prototype.hasOwnProperty.call(au,w.key)&&(w.preventDefault(),h({direction:au[w.key],factor:w.shiftKey?4:1}))};return S.jsx("div",{className:bt(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u},children:S.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:s?void 0:-1,onKeyDown:s?void 0:y,style:{width:o,height:c}})})}const wv=typeof window<"u"?window:void 0,rC=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function x1({children:e,onPaneClick:n,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:c,onPaneScroll:u,paneClickDistance:d,deleteKeyCode:h,selectionKeyCode:p,selectionOnDrag:v,selectionMode:g,onSelectionStart:y,onSelectionEnd:w,multiSelectionKeyCode:E,panActivationKeyCode:N,zoomActivationKeyCode:A,elementsSelectable:C,zoomOnScroll:z,zoomOnPinch:_,panOnScroll:x,panOnScrollSpeed:B,panOnScrollMode:j,zoomOnDoubleClick:T,panOnDrag:D,autoPanOnSelection:R,defaultViewport:Z,translateExtent:Y,minZoom:K,maxZoom:le,preventScrolling:L,onSelectionContextMenu:G,noWheelClassName:k,noPanClassName:$,disableKeyboardA11y:H,onViewportChange:X,isControlledViewport:W}){const{nodesSelectionActive:O,userSelectionActive:I}=Re(rC,nt),ee=Go(p,{target:wv}),ne=Go(N,{target:wv}),fe=ne||D,de=ne||x,ae=v&&fe!==!0,te=ee||I||ae;return qT({deleteKeyCode:h,multiSelectionKeyCode:E}),S.jsx(GT,{onPaneContextMenu:c,elementsSelectable:C,zoomOnScroll:z,zoomOnPinch:_,panOnScroll:de,panOnScrollSpeed:B,panOnScrollMode:j,zoomOnDoubleClick:T,panOnDrag:!ee&&fe,defaultViewport:Z,translateExtent:Y,minZoom:K,maxZoom:le,zoomActivationKeyCode:A,preventScrolling:L,noWheelClassName:k,noPanClassName:$,onViewportChange:X,isControlledViewport:W,paneClickDistance:d,selectionOnDrag:ae,children:S.jsxs(ZT,{onSelectionStart:y,onSelectionEnd:w,onPaneClick:n,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:c,onPaneScroll:u,panOnDrag:fe,autoPanOnSelection:R,isSelecting:!!te,selectionMode:g,selectionKeyPressed:ee,paneClickDistance:d,selectionOnDrag:ae,children:[e,O&&S.jsx(oC,{onSelectionContextMenu:G,noPanClassName:$,disableKeyboardA11y:H})]})})}x1.displayName="FlowRenderer";const cC=q.memo(x1),uC=e=>n=>e?sm(n.nodeLookup,{x:0,y:0,width:n.width,height:n.height},n.transform,!0).map(s=>s.id):Array.from(n.nodeLookup.keys());function fC(e){return Re(q.useCallback(uC(e),[e]),nt)}const dC=e=>e.updateNodeInternals;function hC(){const e=Re(dC),[n]=q.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(s=>{const a=new Map;s.forEach(o=>{const c=o.target.getAttribute("data-id");a.set(c,{id:c,nodeElement:o.target,force:!0})}),e(a)}));return q.useEffect(()=>()=>{n?.disconnect()},[n]),n}function mC({node:e,nodeType:n,hasDimensions:s,resizeObserver:a}){const o=st(),c=q.useRef(null),u=q.useRef(null),d=q.useRef(e.sourcePosition),h=q.useRef(e.targetPosition),p=q.useRef(n),v=s&&!!e.internals.handleBounds;return q.useEffect(()=>{c.current&&!e.hidden&&(!v||u.current!==c.current)&&(u.current&&a?.unobserve(u.current),a?.observe(c.current),u.current=c.current)},[v,e.hidden]),q.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),q.useEffect(()=>{if(c.current){const g=p.current!==n,y=d.current!==e.sourcePosition,w=h.current!==e.targetPosition;(g||y||w)&&(p.current=n,d.current=e.sourcePosition,h.current=e.targetPosition,o.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:c.current,force:!0}]])))}},[e.id,n,e.sourcePosition,e.targetPosition]),c}function pC({id:e,onClick:n,onMouseEnter:s,onMouseMove:a,onMouseLeave:o,onContextMenu:c,onDoubleClick:u,nodesDraggable:d,elementsSelectable:h,nodesConnectable:p,nodesFocusable:v,resizeObserver:g,noDragClassName:y,noPanClassName:w,disableKeyboardA11y:E,rfId:N,nodeTypes:A,nodeClickDistance:C,onError:z}){const{node:_,internals:x,isParent:B}=Re(te=>{const ue=te.nodeLookup.get(e),Se=te.parentLookup.has(e);return{node:ue,internals:ue.internals,isParent:Se}},nt);let j=_.type||"default",T=A?.[j]||Sv[j];T===void 0&&(z?.("003",Un.error003(j)),j="default",T=A?.default||Sv.default);const D=!!(_.draggable||d&&typeof _.draggable>"u"),R=!!(_.selectable||h&&typeof _.selectable>"u"),Z=!!(_.connectable||p&&typeof _.connectable>"u"),Y=!!(_.focusable||v&&typeof _.focusable>"u"),K=st(),le=Gb(_),L=mC({node:_,nodeType:j,hasDimensions:le,resizeObserver:g}),G=b1({nodeRef:L,disabled:_.hidden||!D,noDragClassName:y,handleSelector:_.dragHandle,nodeId:e,isSelectable:R,nodeClickDistance:C}),k=S1();if(_.hidden)return null;const $=Oi(_),H=aC(_),X=R||D||n||s||a||o,W=s?te=>s(te,{...x.userNode}):void 0,O=a?te=>a(te,{...x.userNode}):void 0,I=o?te=>o(te,{...x.userNode}):void 0,ee=c?te=>c(te,{...x.userNode}):void 0,ne=u?te=>u(te,{...x.userNode}):void 0,fe=te=>{const{selectNodesOnDrag:ue,nodeDragThreshold:Se}=K.getState();R&&(!ue||!D||Se>0)&&Bh({id:e,store:K,nodeRef:L}),n&&n(te,{...x.userNode})},de=te=>{if(!(Qb(te.nativeEvent)||E)){if(Bb.includes(te.key)&&R){const ue=te.key==="Escape";Bh({id:e,store:K,unselect:ue,nodeRef:L})}else if(D&&_.selected&&Object.prototype.hasOwnProperty.call(au,te.key)){te.preventDefault();const{ariaLabelConfig:ue}=K.getState();K.setState({ariaLiveMessage:ue["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~x.positionAbsolute.x,y:~~x.positionAbsolute.y})}),k({direction:au[te.key],factor:te.shiftKey?4:1})}}},ae=()=>{if(E||!L.current?.matches(":focus-visible"))return;const{transform:te,width:ue,height:Se,autoPanOnNodeFocus:we,setCenter:ge}=K.getState();if(!we)return;sm(new Map([[e,_]]),{x:0,y:0,width:ue,height:Se},te,!0).length>0||ge(_.position.x+$.width/2,_.position.y+$.height/2,{zoom:te[2]})};return S.jsx("div",{className:bt(["react-flow__node",`react-flow__node-${j}`,{[w]:D},_.className,{selected:_.selected,selectable:R,parent:B,draggable:D,dragging:G}]),ref:L,style:{zIndex:x.z,transform:`translate(${x.positionAbsolute.x}px,${x.positionAbsolute.y}px)`,pointerEvents:X?"all":"none",visibility:le?"visible":"hidden",..._.style,...H},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:W,onMouseMove:O,onMouseLeave:I,onContextMenu:ee,onClick:fe,onDoubleClick:ne,onKeyDown:Y?de:void 0,tabIndex:Y?0:void 0,onFocus:Y?ae:void 0,role:_.ariaRole??(Y?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${h1}-${N}`,"aria-label":_.ariaLabel,..._.domAttributes,children:S.jsx(JT,{value:e,children:S.jsx(T,{id:e,data:_.data,type:j,positionAbsoluteX:x.positionAbsolute.x,positionAbsoluteY:x.positionAbsolute.y,selected:_.selected??!1,selectable:R,draggable:D,deletable:_.deletable??!0,isConnectable:Z,sourcePosition:_.sourcePosition,targetPosition:_.targetPosition,dragging:G,dragHandle:_.dragHandle,zIndex:x.z,parentId:_.parentId,...$})})})}var gC=q.memo(pC);const yC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function E1(e){const{nodesDraggable:n,nodesConnectable:s,nodesFocusable:a,elementsSelectable:o,onError:c}=Re(yC,nt),u=fC(e.onlyRenderVisibleElements),d=hC();return S.jsx("div",{className:"react-flow__nodes",style:Nu,children:u.map(h=>S.jsx(gC,{id:h,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:d,nodesDraggable:n,nodesConnectable:s,nodesFocusable:a,elementsSelectable:o,nodeClickDistance:e.nodeClickDistance,onError:c},h))})}E1.displayName="NodeRenderer";const vC=q.memo(E1);function bC(e){return Re(q.useCallback(s=>{if(!e)return s.edges.map(o=>o.id);const a=[];if(s.width&&s.height)for(const o of s.edges){const c=s.nodeLookup.get(o.source),u=s.nodeLookup.get(o.target);c&&u&&hA({sourceNode:c,targetNode:u,width:s.width,height:s.height,transform:s.transform})&&a.push(o.id)}return a},[e]),nt)}const SC=({color:e="none",strokeWidth:n=1})=>{const s={strokeWidth:n,...e&&{stroke:e}};return S.jsx("polyline",{className:"arrow",style:s,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},wC=({color:e="none",strokeWidth:n=1})=>{const s={strokeWidth:n,...e&&{stroke:e,fill:e}};return S.jsx("polyline",{className:"arrowclosed",style:s,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},xv={[qo.Arrow]:SC,[qo.ArrowClosed]:wC};function xC(e){const n=st();return q.useMemo(()=>Object.prototype.hasOwnProperty.call(xv,e)?xv[e]:(n.getState().onError?.("009",Un.error009(e)),null),[e])}const EC=({id:e,type:n,color:s,width:a=12.5,height:o=12.5,markerUnits:c="strokeWidth",strokeWidth:u,orient:d="auto-start-reverse"})=>{const h=xC(n);return h?S.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${a}`,markerHeight:`${o}`,viewBox:"-10 -10 20 20",markerUnits:c,orient:d,refX:"0",refY:"0",children:S.jsx(h,{color:s,strokeWidth:u})}):null},N1=({defaultColor:e,rfId:n})=>{const s=Re(c=>c.edges),a=Re(c=>c.defaultEdgeOptions),o=q.useMemo(()=>wA(s,{id:n,defaultColor:e,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[s,a,n,e]);return o.length?S.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:S.jsx("defs",{children:o.map(c=>S.jsx(EC,{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};N1.displayName="MarkerDefinitions";var NC=q.memo(N1);function _1({x:e,y:n,label:s,labelStyle:a,labelShowBg:o=!0,labelBgStyle:c,labelBgPadding:u=[2,4],labelBgBorderRadius:d=2,children:h,className:p,...v}){const[g,y]=q.useState({x:1,y:0,width:0,height:0}),w=bt(["react-flow__edge-textwrapper",p]),E=q.useRef(null);return q.useEffect(()=>{if(E.current){const N=E.current.getBBox();y({x:N.x,y:N.y,width:N.width,height:N.height})}},[s]),s?S.jsxs("g",{transform:`translate(${e-g.width/2} ${n-g.height/2})`,className:w,visibility:g.width?"visible":"hidden",...v,children:[o&&S.jsx("rect",{width:g.width+2*u[0],x:-u[0],y:-u[1],height:g.height+2*u[1],className:"react-flow__edge-textbg",style:c,rx:d,ry:d}),S.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:E,style:a,children:s}),h]}):null}_1.displayName="EdgeText";const _C=q.memo(_1);function ir({path:e,labelX:n,labelY:s,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,interactionWidth:p=20,...v}){return S.jsxs(S.Fragment,{children:[S.jsx("path",{...v,d:e,fill:"none",className:bt(["react-flow__edge-path",v.className])}),p?S.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,a&&$n(n)&&$n(s)?S.jsx(_C,{x:n,y:s,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h}):null]})}function Ev({pos:e,x1:n,y1:s,x2:a,y2:o}){return e===he.Left||e===he.Right?[.5*(n+a),s]:[n,.5*(s+o)]}function A1({sourceX:e,sourceY:n,sourcePosition:s=he.Bottom,targetX:a,targetY:o,targetPosition:c=he.Top}){const[u,d]=Ev({pos:s,x1:e,y1:n,x2:a,y2:o}),[h,p]=Ev({pos:c,x1:a,y1:o,x2:e,y2:n}),[v,g,y,w]=Fb({sourceX:e,sourceY:n,targetX:a,targetY:o,sourceControlX:u,sourceControlY:d,targetControlX:h,targetControlY:p});return[`M${e},${n} C${u},${d} ${h},${p} ${a},${o}`,v,g,y,w]}function T1(e){return q.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,sourcePosition:u,targetPosition:d,label:h,labelStyle:p,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:w,style:E,markerEnd:N,markerStart:A,interactionWidth:C})=>{const[z,_,x]=A1({sourceX:s,sourceY:a,sourcePosition:u,targetX:o,targetY:c,targetPosition:d}),B=e.isInternal?void 0:n;return S.jsx(ir,{id:B,path:z,labelX:_,labelY:x,label:h,labelStyle:p,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:w,style:E,markerEnd:N,markerStart:A,interactionWidth:C})})}const AC=T1({isInternal:!1}),C1=T1({isInternal:!0});AC.displayName="SimpleBezierEdge";C1.displayName="SimpleBezierEdgeInternal";function M1(e){return q.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:g,style:y,sourcePosition:w=he.Bottom,targetPosition:E=he.Top,markerEnd:N,markerStart:A,pathOptions:C,interactionWidth:z})=>{const[_,x,B]=zh({sourceX:s,sourceY:a,sourcePosition:w,targetX:o,targetY:c,targetPosition:E,borderRadius:C?.borderRadius,offset:C?.offset,stepPosition:C?.stepPosition}),j=e.isInternal?void 0:n;return S.jsx(ir,{id:j,path:_,labelX:x,labelY:B,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:g,style:y,markerEnd:N,markerStart:A,interactionWidth:z})})}const O1=M1({isInternal:!1}),k1=M1({isInternal:!0});O1.displayName="SmoothStepEdge";k1.displayName="SmoothStepEdgeInternal";function z1(e){return q.memo(({id:n,...s})=>{const a=e.isInternal?void 0:n;return S.jsx(O1,{...s,id:a,pathOptions:q.useMemo(()=>({borderRadius:0,offset:s.pathOptions?.offset}),[s.pathOptions?.offset])})})}const TC=z1({isInternal:!1}),j1=z1({isInternal:!0});TC.displayName="StepEdge";j1.displayName="StepEdgeInternal";function D1(e){return q.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:g,style:y,markerEnd:w,markerStart:E,interactionWidth:N})=>{const[A,C,z]=Pb({sourceX:s,sourceY:a,targetX:o,targetY:c}),_=e.isInternal?void 0:n;return S.jsx(ir,{id:_,path:A,labelX:C,labelY:z,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:v,labelBgBorderRadius:g,style:y,markerEnd:w,markerStart:E,interactionWidth:N})})}const CC=D1({isInternal:!1}),R1=D1({isInternal:!0});CC.displayName="StraightEdge";R1.displayName="StraightEdgeInternal";function B1(e){return q.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,sourcePosition:u=he.Bottom,targetPosition:d=he.Top,label:h,labelStyle:p,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:w,style:E,markerEnd:N,markerStart:A,pathOptions:C,interactionWidth:z})=>{const[_,x,B]=Jb({sourceX:s,sourceY:a,sourcePosition:u,targetX:o,targetY:c,targetPosition:d,curvature:C?.curvature}),j=e.isInternal?void 0:n;return S.jsx(ir,{id:j,path:_,labelX:x,labelY:B,label:h,labelStyle:p,labelShowBg:v,labelBgStyle:g,labelBgPadding:y,labelBgBorderRadius:w,style:E,markerEnd:N,markerStart:A,interactionWidth:z})})}const MC=B1({isInternal:!1}),L1=B1({isInternal:!0});MC.displayName="BezierEdge";L1.displayName="BezierEdgeInternal";const Nv={default:L1,straight:R1,step:j1,smoothstep:k1,simplebezier:C1},_v={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},OC=(e,n,s)=>s===he.Left?e-n:s===he.Right?e+n:e,kC=(e,n,s)=>s===he.Top?e-n:s===he.Bottom?e+n:e,Av="react-flow__edgeupdater";function Tv({position:e,centerX:n,centerY:s,radius:a=10,onMouseDown:o,onMouseEnter:c,onMouseOut:u,type:d}){return S.jsx("circle",{onMouseDown:o,onMouseEnter:c,onMouseOut:u,className:bt([Av,`${Av}-${d}`]),cx:OC(n,a,e),cy:kC(s,a,e),r:a,stroke:"transparent",fill:"transparent"})}function zC({isReconnectable:e,reconnectRadius:n,edge:s,sourceX:a,sourceY:o,targetX:c,targetY:u,sourcePosition:d,targetPosition:h,onReconnect:p,onReconnectStart:v,onReconnectEnd:g,setReconnecting:y,setUpdateHover:w}){const E=st(),N=(x,B)=>{if(x.button!==0)return;const{autoPanOnConnect:j,domNode:T,connectionMode:D,connectionRadius:R,lib:Z,onConnectStart:Y,cancelConnection:K,nodeLookup:le,rfId:L,panBy:G,updateConnection:k}=E.getState(),$=B.type==="target",H=(O,I)=>{y(!1),g?.(O,s,B.type,I)},X=O=>p?.(s,O),W=(O,I)=>{y(!0),v?.(x,s,B.type),Y?.(O,I)};Rh.onPointerDown(x.nativeEvent,{autoPanOnConnect:j,connectionMode:D,connectionRadius:R,domNode:T,handleId:B.id,nodeId:B.nodeId,nodeLookup:le,isTarget:$,edgeUpdaterType:B.type,lib:Z,flowId:L,cancelConnection:K,panBy:G,isValidConnection:(...O)=>E.getState().isValidConnection?.(...O)??!0,onConnect:X,onConnectStart:W,onConnectEnd:(...O)=>E.getState().onConnectEnd?.(...O),onReconnectEnd:H,updateConnection:k,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:x.currentTarget})},A=x=>N(x,{nodeId:s.target,id:s.targetHandle??null,type:"target"}),C=x=>N(x,{nodeId:s.source,id:s.sourceHandle??null,type:"source"}),z=()=>w(!0),_=()=>w(!1);return S.jsxs(S.Fragment,{children:[(e===!0||e==="source")&&S.jsx(Tv,{position:d,centerX:a,centerY:o,radius:n,onMouseDown:A,onMouseEnter:z,onMouseOut:_,type:"source"}),(e===!0||e==="target")&&S.jsx(Tv,{position:h,centerX:c,centerY:u,radius:n,onMouseDown:C,onMouseEnter:z,onMouseOut:_,type:"target"})]})}function jC({id:e,edgesFocusable:n,edgesReconnectable:s,elementsSelectable:a,onClick:o,onDoubleClick:c,onContextMenu:u,onMouseEnter:d,onMouseMove:h,onMouseLeave:p,reconnectRadius:v,onReconnect:g,onReconnectStart:y,onReconnectEnd:w,rfId:E,edgeTypes:N,noPanClassName:A,onError:C,disableKeyboardA11y:z}){let _=Re(ge=>ge.edgeLookup.get(e));const x=Re(ge=>ge.defaultEdgeOptions);_=x?{...x,..._}:_;let B=_.type||"default",j=N?.[B]||Nv[B];j===void 0&&(C?.("011",Un.error011(B)),B="default",j=N?.default||Nv.default);const T=!!(_.focusable||n&&typeof _.focusable>"u"),D=typeof g<"u"&&(_.reconnectable||s&&typeof _.reconnectable>"u"),R=!!(_.selectable||a&&typeof _.selectable>"u"),Z=q.useRef(null),[Y,K]=q.useState(!1),[le,L]=q.useState(!1),G=st(),{zIndex:k,sourceX:$,sourceY:H,targetX:X,targetY:W,sourcePosition:O,targetPosition:I}=Re(q.useCallback(ge=>{const ve=ge.nodeLookup.get(_.source),Ee=ge.nodeLookup.get(_.target);if(!ve||!Ee)return{zIndex:_.zIndex,..._v};const Me=SA({id:e,sourceNode:ve,targetNode:Ee,sourceHandle:_.sourceHandle||null,targetHandle:_.targetHandle||null,connectionMode:ge.connectionMode,onError:C});return{zIndex:dA({selected:_.selected,zIndex:_.zIndex,sourceNode:ve,targetNode:Ee,elevateOnSelect:ge.elevateEdgesOnSelect,zIndexMode:ge.zIndexMode}),...Me||_v}},[_.source,_.target,_.sourceHandle,_.targetHandle,_.selected,_.zIndex]),nt),ee=q.useMemo(()=>_.markerStart?`url('#${jh(_.markerStart,E)}')`:void 0,[_.markerStart,E]),ne=q.useMemo(()=>_.markerEnd?`url('#${jh(_.markerEnd,E)}')`:void 0,[_.markerEnd,E]);if(_.hidden||$===null||H===null||X===null||W===null)return null;const fe=ge=>{const{addSelectedEdges:ve,unselectNodesAndEdges:Ee,multiSelectionActive:Me}=G.getState();R&&(G.setState({nodesSelectionActive:!1}),_.selected&&Me?(Ee({nodes:[],edges:[_]}),Z.current?.blur()):ve([e])),o&&o(ge,_)},de=c?ge=>{c(ge,{..._})}:void 0,ae=u?ge=>{u(ge,{..._})}:void 0,te=d?ge=>{d(ge,{..._})}:void 0,ue=h?ge=>{h(ge,{..._})}:void 0,Se=p?ge=>{p(ge,{..._})}:void 0,we=ge=>{if(!z&&Bb.includes(ge.key)&&R){const{unselectNodesAndEdges:ve,addSelectedEdges:Ee}=G.getState();ge.key==="Escape"?(Z.current?.blur(),ve({edges:[_]})):Ee([e])}};return S.jsx("svg",{style:{zIndex:k},children:S.jsxs("g",{className:bt(["react-flow__edge",`react-flow__edge-${B}`,_.className,A,{selected:_.selected,animated:_.animated,inactive:!R&&!o,updating:Y,selectable:R}]),onClick:fe,onDoubleClick:de,onContextMenu:ae,onMouseEnter:te,onMouseMove:ue,onMouseLeave:Se,onKeyDown:T?we:void 0,tabIndex:T?0:void 0,role:_.ariaRole??(T?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":_.ariaLabel===null?void 0:_.ariaLabel||`Edge from ${_.source} to ${_.target}`,"aria-describedby":T?`${m1}-${E}`:void 0,ref:Z,..._.domAttributes,children:[!le&&S.jsx(j,{id:e,source:_.source,target:_.target,type:_.type,selected:_.selected,animated:_.animated,selectable:R,deletable:_.deletable??!0,label:_.label,labelStyle:_.labelStyle,labelShowBg:_.labelShowBg,labelBgStyle:_.labelBgStyle,labelBgPadding:_.labelBgPadding,labelBgBorderRadius:_.labelBgBorderRadius,sourceX:$,sourceY:H,targetX:X,targetY:W,sourcePosition:O,targetPosition:I,data:_.data,style:_.style,sourceHandleId:_.sourceHandle,targetHandleId:_.targetHandle,markerStart:ee,markerEnd:ne,pathOptions:"pathOptions"in _?_.pathOptions:void 0,interactionWidth:_.interactionWidth}),D&&S.jsx(zC,{edge:_,isReconnectable:D,reconnectRadius:v,onReconnect:g,onReconnectStart:y,onReconnectEnd:w,sourceX:$,sourceY:H,targetX:X,targetY:W,sourcePosition:O,targetPosition:I,setUpdateHover:K,setReconnecting:L})]})})}var DC=q.memo(jC);const RC=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function $1({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:s,edgeTypes:a,noPanClassName:o,onReconnect:c,onEdgeContextMenu:u,onEdgeMouseEnter:d,onEdgeMouseMove:h,onEdgeMouseLeave:p,onEdgeClick:v,reconnectRadius:g,onEdgeDoubleClick:y,onReconnectStart:w,onReconnectEnd:E,disableKeyboardA11y:N}){const{edgesFocusable:A,edgesReconnectable:C,elementsSelectable:z,onError:_}=Re(RC,nt),x=bC(n);return S.jsxs("div",{className:"react-flow__edges",children:[S.jsx(NC,{defaultColor:e,rfId:s}),x.map(B=>S.jsx(DC,{id:B,edgesFocusable:A,edgesReconnectable:C,elementsSelectable:z,noPanClassName:o,onReconnect:c,onContextMenu:u,onMouseEnter:d,onMouseMove:h,onMouseLeave:p,onClick:v,reconnectRadius:g,onDoubleClick:y,onReconnectStart:w,onReconnectEnd:E,rfId:s,onError:_,edgeTypes:a,disableKeyboardA11y:N},B))]})}$1.displayName="EdgeRenderer";const BC=q.memo($1),LC=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function $C({children:e}){const n=Re(LC);return S.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function HC(e){const n=Eu(),s=q.useRef(!1);q.useEffect(()=>{!s.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),s.current=!0)},[e,n.viewportInitialized])}const UC=e=>e.panZoom?.syncViewport;function IC(e){const n=Re(UC),s=st();return q.useEffect(()=>{e&&(n?.(e),s.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function qC(e){return e.connection.inProgress?{...e.connection,to:yl(e.connection.to,e.transform)}:{...e.connection}}function VC(e){return qC}function YC(e){const n=VC();return Re(n,nt)}const GC=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function XC({containerStyle:e,style:n,type:s,component:a}){const{nodesConnectable:o,width:c,height:u,isValid:d,inProgress:h}=Re(GC,nt);return!(c&&o&&h)?null:S.jsx("svg",{style:e,width:c,height:u,className:"react-flow__connectionline react-flow__container",children:S.jsx("g",{className:bt(["react-flow__connection",Hb(d)]),children:S.jsx(H1,{style:n,type:s,CustomComponent:a,isValid:d})})})}const H1=({style:e,type:n=ds.Bezier,CustomComponent:s,isValid:a})=>{const{inProgress:o,from:c,fromNode:u,fromHandle:d,fromPosition:h,to:p,toNode:v,toHandle:g,toPosition:y,pointer:w}=YC();if(!o)return;if(s)return S.jsx(s,{connectionLineType:n,connectionLineStyle:e,fromNode:u,fromHandle:d,fromX:c.x,fromY:c.y,toX:p.x,toY:p.y,fromPosition:h,toPosition:y,connectionStatus:Hb(a),toNode:v,toHandle:g,pointer:w});let E="";const N={sourceX:c.x,sourceY:c.y,sourcePosition:h,targetX:p.x,targetY:p.y,targetPosition:y};switch(n){case ds.Bezier:[E]=Jb(N);break;case ds.SimpleBezier:[E]=A1(N);break;case ds.Step:[E]=zh({...N,borderRadius:0});break;case ds.SmoothStep:[E]=zh(N);break;default:[E]=Pb(N)}return S.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:e})};H1.displayName="ConnectionLine";const KC={};function Cv(e=KC){q.useRef(e),st(),q.useEffect(()=>{},[e])}function QC(){st(),q.useRef(!1),q.useEffect(()=>{},[])}function U1({nodeTypes:e,edgeTypes:n,onInit:s,onNodeClick:a,onEdgeClick:o,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:v,onSelectionContextMenu:g,onSelectionStart:y,onSelectionEnd:w,connectionLineType:E,connectionLineStyle:N,connectionLineComponent:A,connectionLineContainerStyle:C,selectionKeyCode:z,selectionOnDrag:_,selectionMode:x,multiSelectionKeyCode:B,panActivationKeyCode:j,zoomActivationKeyCode:T,deleteKeyCode:D,onlyRenderVisibleElements:R,elementsSelectable:Z,defaultViewport:Y,translateExtent:K,minZoom:le,maxZoom:L,preventScrolling:G,defaultMarkerColor:k,zoomOnScroll:$,zoomOnPinch:H,panOnScroll:X,panOnScrollSpeed:W,panOnScrollMode:O,zoomOnDoubleClick:I,panOnDrag:ee,autoPanOnSelection:ne,onPaneClick:fe,onPaneMouseEnter:de,onPaneMouseMove:ae,onPaneMouseLeave:te,onPaneScroll:ue,onPaneContextMenu:Se,paneClickDistance:we,nodeClickDistance:ge,onEdgeContextMenu:ve,onEdgeMouseEnter:Ee,onEdgeMouseMove:Me,onEdgeMouseLeave:Be,reconnectRadius:Et,onReconnect:Bt,onReconnectStart:Nt,onReconnectEnd:We,noDragClassName:St,noWheelClassName:ti,noPanClassName:He,disableKeyboardA11y:Ye,nodeExtent:_t,rfId:Ht,viewport:Ut,onViewportChange:It}){return Cv(e),Cv(n),QC(),HC(s),IC(Ut),S.jsx(cC,{onPaneClick:fe,onPaneMouseEnter:de,onPaneMouseMove:ae,onPaneMouseLeave:te,onPaneContextMenu:Se,onPaneScroll:ue,paneClickDistance:we,deleteKeyCode:D,selectionKeyCode:z,selectionOnDrag:_,selectionMode:x,onSelectionStart:y,onSelectionEnd:w,multiSelectionKeyCode:B,panActivationKeyCode:j,zoomActivationKeyCode:T,elementsSelectable:Z,zoomOnScroll:$,zoomOnPinch:H,zoomOnDoubleClick:I,panOnScroll:X,panOnScrollSpeed:W,panOnScrollMode:O,panOnDrag:ee,autoPanOnSelection:ne,defaultViewport:Y,translateExtent:K,minZoom:le,maxZoom:L,onSelectionContextMenu:g,preventScrolling:G,noDragClassName:St,noWheelClassName:ti,noPanClassName:He,disableKeyboardA11y:Ye,onViewportChange:It,isControlledViewport:!!Ut,children:S.jsxs($C,{children:[S.jsx(BC,{edgeTypes:n,onEdgeClick:o,onEdgeDoubleClick:u,onReconnect:Bt,onReconnectStart:Nt,onReconnectEnd:We,onlyRenderVisibleElements:R,onEdgeContextMenu:ve,onEdgeMouseEnter:Ee,onEdgeMouseMove:Me,onEdgeMouseLeave:Be,reconnectRadius:Et,defaultMarkerColor:k,noPanClassName:He,disableKeyboardA11y:Ye,rfId:Ht}),S.jsx(XC,{style:N,type:E,component:A,containerStyle:C}),S.jsx("div",{className:"react-flow__edgelabel-renderer"}),S.jsx(vC,{nodeTypes:e,onNodeClick:a,onNodeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:v,nodeClickDistance:ge,onlyRenderVisibleElements:R,noPanClassName:He,noDragClassName:St,disableKeyboardA11y:Ye,nodeExtent:_t,rfId:Ht}),S.jsx("div",{className:"react-flow__viewport-portal"})]})})}U1.displayName="GraphView";const ZC=q.memo(U1),FC=Yb(),Mv=({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,width:o,height:c,fitView:u,fitViewOptions:d,minZoom:h=.5,maxZoom:p=2,nodeOrigin:v,nodeExtent:g,zIndexMode:y="basic"}={})=>{const w=new Map,E=new Map,N=new Map,A=new Map,C=a??n??[],z=s??e??[],_=v??[0,0],x=g??Uo;n1(N,A,C);const{nodesInitialized:B}=Dh(z,w,E,{nodeOrigin:_,nodeExtent:x,zIndexMode:y});let j=[0,0,1];if(u&&o&&c){const T=tr(w,{filter:Y=>!!((Y.width||Y.initialWidth)&&(Y.height||Y.initialHeight))}),{x:D,y:R,zoom:Z}=lm(T,o,c,h,p,d?.padding??.1);j=[D,R,Z]}return{rfId:"1",width:o??0,height:c??0,transform:j,nodes:z,nodesInitialized:B,nodeLookup:w,parentLookup:E,edges:C,edgeLookup:A,connectionLookup:N,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:s!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:p,translateExtent:Uo,nodeExtent:x,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:cl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:_,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:d,fitViewResolver:null,connection:{...$b},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:FC,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Lb,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},JC=({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,width:o,height:c,fitView:u,fitViewOptions:d,minZoom:h,maxZoom:p,nodeOrigin:v,nodeExtent:g,zIndexMode:y})=>cT((w,E)=>{async function N(){const{nodeLookup:A,panZoom:C,fitViewOptions:z,fitViewResolver:_,width:x,height:B,minZoom:j,maxZoom:T}=E();C&&(await aA({nodes:A,width:x,height:B,panZoom:C,minZoom:j,maxZoom:T},z),_?.resolve(!0),w({fitViewResolver:null}))}return{...Mv({nodes:e,edges:n,width:o,height:c,fitView:u,fitViewOptions:d,minZoom:h,maxZoom:p,nodeOrigin:v,nodeExtent:g,defaultNodes:s,defaultEdges:a,zIndexMode:y}),setNodes:A=>{const{nodeLookup:C,parentLookup:z,nodeOrigin:_,elevateNodesOnSelect:x,fitViewQueued:B,zIndexMode:j,nodesSelectionActive:T}=E(),{nodesInitialized:D,hasSelectedNodes:R}=Dh(A,C,z,{nodeOrigin:_,nodeExtent:g,elevateNodesOnSelect:x,checkEquality:!0,zIndexMode:j}),Z=T&&R;B&&D?(N(),w({nodes:A,nodesInitialized:D,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:Z})):w({nodes:A,nodesInitialized:D,nodesSelectionActive:Z})},setEdges:A=>{const{connectionLookup:C,edgeLookup:z}=E();n1(C,z,A),w({edges:A})},setDefaultNodesAndEdges:(A,C)=>{if(A){const{setNodes:z}=E();z(A),w({hasDefaultNodes:!0})}if(C){const{setEdges:z}=E();z(C),w({hasDefaultEdges:!0})}},updateNodeInternals:A=>{const{triggerNodeChanges:C,nodeLookup:z,parentLookup:_,domNode:x,nodeOrigin:B,nodeExtent:j,debug:T,fitViewQueued:D,zIndexMode:R}=E(),{changes:Z,updatedInternals:Y}=CA(A,z,_,x,B,j,R);Y&&(NA(z,_,{nodeOrigin:B,nodeExtent:j,zIndexMode:R}),D?(N(),w({fitViewQueued:!1,fitViewOptions:void 0})):w({}),Z?.length>0&&(T&&console.log("React Flow: trigger node changes",Z),C?.(Z)))},updateNodePositions:(A,C=!1)=>{const z=[];let _=[];const{nodeLookup:x,triggerNodeChanges:B,connection:j,updateConnection:T,onNodesChangeMiddlewareMap:D}=E();for(const[R,Z]of A){const Y=x.get(R),K=!!(Y?.expandParent&&Y?.parentId&&Z?.position),le={id:R,type:"position",position:K?{x:Math.max(0,Z.position.x),y:Math.max(0,Z.position.y)}:Z.position,dragging:C};if(Y&&j.inProgress&&j.fromNode.id===Y.id){const L=Qs(Y,j.fromHandle,he.Left,!0);T({...j,from:L})}K&&Y.parentId&&z.push({id:R,parentId:Y.parentId,rect:{...Z.internals.positionAbsolute,width:Z.measured.width??0,height:Z.measured.height??0}}),_.push(le)}if(z.length>0){const{parentLookup:R,nodeOrigin:Z}=E(),Y=dm(z,x,R,Z);_.push(...Y)}for(const R of D.values())_=R(_);B(_)},triggerNodeChanges:A=>{const{onNodesChange:C,setNodes:z,nodes:_,hasDefaultNodes:x,debug:B}=E();if(A?.length){if(x){const j=kT(A,_);z(j)}B&&console.log("React Flow: trigger node changes",A),C?.(A)}},triggerEdgeChanges:A=>{const{onEdgesChange:C,setEdges:z,edges:_,hasDefaultEdges:x,debug:B}=E();if(A?.length){if(x){const j=zT(A,_);z(j)}B&&console.log("React Flow: trigger edge changes",A),C?.(A)}},addSelectedNodes:A=>{const{multiSelectionActive:C,edgeLookup:z,nodeLookup:_,triggerNodeChanges:x,triggerEdgeChanges:B}=E();if(C){const j=A.map(T=>Ls(T,!0));x(j);return}x(Ka(_,new Set([...A]),!0)),B(Ka(z))},addSelectedEdges:A=>{const{multiSelectionActive:C,edgeLookup:z,nodeLookup:_,triggerNodeChanges:x,triggerEdgeChanges:B}=E();if(C){const j=A.map(T=>Ls(T,!0));B(j);return}B(Ka(z,new Set([...A]))),x(Ka(_,new Set,!0))},unselectNodesAndEdges:({nodes:A,edges:C}={})=>{const{edges:z,nodes:_,nodeLookup:x,triggerNodeChanges:B,triggerEdgeChanges:j}=E(),T=A||_,D=C||z,R=[];for(const Y of T){if(!Y.selected)continue;const K=x.get(Y.id);K&&(K.selected=!1),R.push(Ls(Y.id,!1))}const Z=[];for(const Y of D)Y.selected&&Z.push(Ls(Y.id,!1));B(R),j(Z)},setMinZoom:A=>{const{panZoom:C,maxZoom:z}=E();C?.setScaleExtent([A,z]),w({minZoom:A})},setMaxZoom:A=>{const{panZoom:C,minZoom:z}=E();C?.setScaleExtent([z,A]),w({maxZoom:A})},setTranslateExtent:A=>{E().panZoom?.setTranslateExtent(A),w({translateExtent:A})},resetSelectedElements:()=>{const{edges:A,nodes:C,triggerNodeChanges:z,triggerEdgeChanges:_,elementsSelectable:x}=E();if(!x)return;const B=C.reduce((T,D)=>D.selected?[...T,Ls(D.id,!1)]:T,[]),j=A.reduce((T,D)=>D.selected?[...T,Ls(D.id,!1)]:T,[]);z(B),_(j)},setNodeExtent:A=>{const{nodes:C,nodeLookup:z,parentLookup:_,nodeOrigin:x,elevateNodesOnSelect:B,nodeExtent:j,zIndexMode:T}=E();A[0][0]===j[0][0]&&A[0][1]===j[0][1]&&A[1][0]===j[1][0]&&A[1][1]===j[1][1]||(Dh(C,z,_,{nodeOrigin:x,nodeExtent:A,elevateNodesOnSelect:B,checkEquality:!1,zIndexMode:T}),w({nodeExtent:A}))},panBy:A=>{const{transform:C,width:z,height:_,panZoom:x,translateExtent:B}=E();return MA({delta:A,panZoom:x,transform:C,translateExtent:B,width:z,height:_})},setCenter:async(A,C,z)=>{const{width:_,height:x,maxZoom:B,panZoom:j}=E();if(!j)return!1;const T=typeof z?.zoom<"u"?z.zoom:B;return await j.setViewport({x:_/2-A*T,y:x/2-C*T,zoom:T},{duration:z?.duration,ease:z?.ease,interpolate:z?.interpolate}),!0},cancelConnection:()=>{w({connection:{...$b}})},updateConnection:A=>{w({connection:A})},reset:()=>w({...Mv()})}},Object.is);function I1({initialNodes:e,initialEdges:n,defaultNodes:s,defaultEdges:a,initialWidth:o,initialHeight:c,initialMinZoom:u,initialMaxZoom:d,initialFitViewOptions:h,fitView:p,nodeOrigin:v,nodeExtent:g,zIndexMode:y,children:w}){const[E]=q.useState(()=>JC({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,width:o,height:c,fitView:p,minZoom:u,maxZoom:d,fitViewOptions:h,nodeOrigin:v,nodeExtent:g,zIndexMode:y}));return S.jsx(fT,{value:E,children:S.jsx($T,{children:w})})}function WC({children:e,nodes:n,edges:s,defaultNodes:a,defaultEdges:o,width:c,height:u,fitView:d,fitViewOptions:h,minZoom:p,maxZoom:v,nodeOrigin:g,nodeExtent:y,zIndexMode:w}){return q.useContext(wu)?S.jsx(S.Fragment,{children:e}):S.jsx(I1,{initialNodes:n,initialEdges:s,defaultNodes:a,defaultEdges:o,initialWidth:c,initialHeight:u,fitView:d,initialFitViewOptions:h,initialMinZoom:p,initialMaxZoom:v,nodeOrigin:g,nodeExtent:y,zIndexMode:w,children:e})}const PC={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function eM({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,className:o,nodeTypes:c,edgeTypes:u,onNodeClick:d,onEdgeClick:h,onInit:p,onMove:v,onMoveStart:g,onMoveEnd:y,onConnect:w,onConnectStart:E,onConnectEnd:N,onClickConnectStart:A,onClickConnectEnd:C,onNodeMouseEnter:z,onNodeMouseMove:_,onNodeMouseLeave:x,onNodeContextMenu:B,onNodeDoubleClick:j,onNodeDragStart:T,onNodeDrag:D,onNodeDragStop:R,onNodesDelete:Z,onEdgesDelete:Y,onDelete:K,onSelectionChange:le,onSelectionDragStart:L,onSelectionDrag:G,onSelectionDragStop:k,onSelectionContextMenu:$,onSelectionStart:H,onSelectionEnd:X,onBeforeDelete:W,connectionMode:O,connectionLineType:I=ds.Bezier,connectionLineStyle:ee,connectionLineComponent:ne,connectionLineContainerStyle:fe,deleteKeyCode:de="Backspace",selectionKeyCode:ae="Shift",selectionOnDrag:te=!1,selectionMode:ue=Io.Full,panActivationKeyCode:Se="Space",multiSelectionKeyCode:we=Yo()?"Meta":"Control",zoomActivationKeyCode:ge=Yo()?"Meta":"Control",snapToGrid:ve,snapGrid:Ee,onlyRenderVisibleElements:Me=!1,selectNodesOnDrag:Be,nodesDraggable:Et,autoPanOnNodeFocus:Bt,nodesConnectable:Nt,nodesFocusable:We,nodeOrigin:St=p1,edgesFocusable:ti,edgesReconnectable:He,elementsSelectable:Ye=!0,defaultViewport:_t=NT,minZoom:Ht=.5,maxZoom:Ut=2,translateExtent:It=Uo,preventScrolling:dt=!0,nodeExtent:An,defaultMarkerColor:ys="#b1b1b7",zoomOnScroll:ta=!0,zoomOnPinch:ni=!0,panOnScroll:ht=!1,panOnScrollSpeed:en=.5,panOnScrollMode:Qe=Vs.Free,zoomOnDoubleClick:na=!0,panOnDrag:kt=!0,onPaneClick:vs,onPaneMouseEnter:Vn,onPaneMouseMove:ki,onPaneMouseLeave:qt,onPaneScroll:Tn,onPaneContextMenu:zi,paneClickDistance:ii=1,nodeClickDistance:_l=0,children:ia,onReconnect:bs,onReconnectStart:si,onReconnectEnd:ie,onEdgeContextMenu:me,onEdgeDoubleClick:Ne,onEdgeMouseEnter:Je,onEdgeMouseMove:Vt,onEdgeMouseLeave:hn,reconnectRadius:at=10,onNodesChange:or,onEdgesChange:Yn,noDragClassName:wt="nodrag",noWheelClassName:zt="nowheel",noPanClassName:ai="nopan",fitView:sa,fitViewOptions:rr,connectOnClick:Hu,attributionPosition:cr,proOptions:Ss,defaultEdgeOptions:Al,elevateNodesOnSelect:ji=!0,elevateEdgesOnSelect:Di=!1,disableKeyboardA11y:Ri=!1,autoPanOnConnect:Bi,autoPanOnNodeDrag:mt,autoPanOnSelection:ur=!0,autoPanSpeed:fr,connectionRadius:li,isValidConnection:Li,onError:Uu,style:dr,id:Tl,nodeDragThreshold:Iu,connectionDragThreshold:aa,viewport:la,onViewportChange:Cn,width:Yt,height:hr,colorMode:qu="light",debug:Cl,onScroll:Ml,ariaLabelConfig:oa,zIndexMode:mr="basic",...Gt},Ol){const ra=Tl||"1",kl=CT(qu),$i=q.useCallback(zl=>{zl.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Ml?.(zl)},[Ml]);return S.jsx("div",{"data-testid":"rf__wrapper",...Gt,onScroll:$i,style:{...dr,...PC},ref:Ol,className:bt(["react-flow",o,kl]),id:Tl,role:"application",children:S.jsxs(WC,{nodes:e,edges:n,width:Yt,height:hr,fitView:sa,fitViewOptions:rr,minZoom:Ht,maxZoom:Ut,nodeOrigin:St,nodeExtent:An,zIndexMode:mr,children:[S.jsx(TT,{nodes:e,edges:n,defaultNodes:s,defaultEdges:a,onConnect:w,onConnectStart:E,onConnectEnd:N,onClickConnectStart:A,onClickConnectEnd:C,nodesDraggable:Et,autoPanOnNodeFocus:Bt,nodesConnectable:Nt,nodesFocusable:We,edgesFocusable:ti,edgesReconnectable:He,elementsSelectable:Ye,elevateNodesOnSelect:ji,elevateEdgesOnSelect:Di,minZoom:Ht,maxZoom:Ut,nodeExtent:An,onNodesChange:or,onEdgesChange:Yn,snapToGrid:ve,snapGrid:Ee,connectionMode:O,translateExtent:It,connectOnClick:Hu,defaultEdgeOptions:Al,fitView:sa,fitViewOptions:rr,onNodesDelete:Z,onEdgesDelete:Y,onDelete:K,onNodeDragStart:T,onNodeDrag:D,onNodeDragStop:R,onSelectionDrag:G,onSelectionDragStart:L,onSelectionDragStop:k,onMove:v,onMoveStart:g,onMoveEnd:y,noPanClassName:ai,nodeOrigin:St,rfId:ra,autoPanOnConnect:Bi,autoPanOnNodeDrag:mt,autoPanSpeed:fr,onError:Uu,connectionRadius:li,isValidConnection:Li,selectNodesOnDrag:Be,nodeDragThreshold:Iu,connectionDragThreshold:aa,onBeforeDelete:W,debug:Cl,ariaLabelConfig:oa,zIndexMode:mr}),S.jsx(ZC,{onInit:p,onNodeClick:d,onEdgeClick:h,onNodeMouseEnter:z,onNodeMouseMove:_,onNodeMouseLeave:x,onNodeContextMenu:B,onNodeDoubleClick:j,nodeTypes:c,edgeTypes:u,connectionLineType:I,connectionLineStyle:ee,connectionLineComponent:ne,connectionLineContainerStyle:fe,selectionKeyCode:ae,selectionOnDrag:te,selectionMode:ue,deleteKeyCode:de,multiSelectionKeyCode:we,panActivationKeyCode:Se,zoomActivationKeyCode:ge,onlyRenderVisibleElements:Me,defaultViewport:_t,translateExtent:It,minZoom:Ht,maxZoom:Ut,preventScrolling:dt,zoomOnScroll:ta,zoomOnPinch:ni,zoomOnDoubleClick:na,panOnScroll:ht,panOnScrollSpeed:en,panOnScrollMode:Qe,panOnDrag:kt,autoPanOnSelection:ur,onPaneClick:vs,onPaneMouseEnter:Vn,onPaneMouseMove:ki,onPaneMouseLeave:qt,onPaneScroll:Tn,onPaneContextMenu:zi,paneClickDistance:ii,nodeClickDistance:_l,onSelectionContextMenu:$,onSelectionStart:H,onSelectionEnd:X,onReconnect:bs,onReconnectStart:si,onReconnectEnd:ie,onEdgeContextMenu:me,onEdgeDoubleClick:Ne,onEdgeMouseEnter:Je,onEdgeMouseMove:Vt,onEdgeMouseLeave:hn,reconnectRadius:at,defaultMarkerColor:ys,noDragClassName:wt,noWheelClassName:zt,noPanClassName:ai,rfId:ra,disableKeyboardA11y:Ri,nodeExtent:An,viewport:la,onViewportChange:Cn}),S.jsx(ET,{onSelectionChange:le}),ia,S.jsx(vT,{proOptions:Ss,position:cr}),S.jsx(yT,{rfId:ra,disableKeyboardA11y:Ri})]})})}var tM=y1(eM);const nM=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function iM({children:e}){const n=Re(nM);return n?uT.createPortal(e,n):null}function sM({dimensions:e,lineWidth:n,variant:s,className:a}){return S.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:bt(["react-flow__background-pattern",s,a])})}function aM({radius:e,className:n}){return S.jsx("circle",{cx:e,cy:e,r:e,className:bt(["react-flow__background-pattern","dots",n])})}var hs;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(hs||(hs={}));const lM={[hs.Dots]:1,[hs.Lines]:1,[hs.Cross]:6},oM=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function q1({id:e,variant:n=hs.Dots,gap:s=20,size:a,lineWidth:o=1,offset:c=0,color:u,bgColor:d,style:h,className:p,patternClassName:v}){const g=q.useRef(null),{transform:y,patternId:w}=Re(oM,nt),E=a||lM[n],N=n===hs.Dots,A=n===hs.Cross,C=Array.isArray(s)?s:[s,s],z=[C[0]*y[2]||1,C[1]*y[2]||1],_=E*y[2],x=Array.isArray(c)?c:[c,c],B=A?[_,_]:z,j=[x[0]*y[2]||1+B[0]/2,x[1]*y[2]||1+B[1]/2],T=`${w}${e||""}`;return S.jsxs("svg",{className:bt(["react-flow__background",p]),style:{...h,...Nu,"--xy-background-color-props":d,"--xy-background-pattern-color-props":u},ref:g,"data-testid":"rf__background",children:[S.jsx("pattern",{id:T,x:y[0]%z[0],y:y[1]%z[1],width:z[0],height:z[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${j[0]},-${j[1]})`,children:N?S.jsx(aM,{radius:_/2,className:v}):S.jsx(sM,{dimensions:B,lineWidth:o,variant:n,className:v})}),S.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${T})`})]})}q1.displayName="Background";const rM=q.memo(q1);function cM(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:S.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function uM(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:S.jsx("path",{d:"M0 0h32v4.2H0z"})})}function fM(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:S.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 dM(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:S.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 hM(){return S.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:S.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 zc({children:e,className:n,...s}){return S.jsx("button",{type:"button",className:bt(["react-flow__controls-button",n]),...s,children:e})}const mM=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function V1({style:e,showZoom:n=!0,showFitView:s=!0,showInteractive:a=!0,fitViewOptions:o,onZoomIn:c,onZoomOut:u,onFitView:d,onInteractiveChange:h,className:p,children:v,position:g="bottom-left",orientation:y="vertical","aria-label":w}){const E=st(),{isInteractive:N,minZoomReached:A,maxZoomReached:C,ariaLabelConfig:z}=Re(mM,nt),{zoomIn:_,zoomOut:x,fitView:B}=Eu(),j=()=>{_(),c?.()},T=()=>{x(),u?.()},D=()=>{B(o),d?.()},R=()=>{E.setState({nodesDraggable:!N,nodesConnectable:!N,elementsSelectable:!N}),h?.(!N)},Z=y==="horizontal"?"horizontal":"vertical";return S.jsxs(xu,{className:bt(["react-flow__controls",Z,p]),position:g,style:e,"data-testid":"rf__controls","aria-label":w??z["controls.ariaLabel"],children:[n&&S.jsxs(S.Fragment,{children:[S.jsx(zc,{onClick:j,className:"react-flow__controls-zoomin",title:z["controls.zoomIn.ariaLabel"],"aria-label":z["controls.zoomIn.ariaLabel"],disabled:C,children:S.jsx(cM,{})}),S.jsx(zc,{onClick:T,className:"react-flow__controls-zoomout",title:z["controls.zoomOut.ariaLabel"],"aria-label":z["controls.zoomOut.ariaLabel"],disabled:A,children:S.jsx(uM,{})})]}),s&&S.jsx(zc,{className:"react-flow__controls-fitview",onClick:D,title:z["controls.fitView.ariaLabel"],"aria-label":z["controls.fitView.ariaLabel"],children:S.jsx(fM,{})}),a&&S.jsx(zc,{className:"react-flow__controls-interactive",onClick:R,title:z["controls.interactive.ariaLabel"],"aria-label":z["controls.interactive.ariaLabel"],children:N?S.jsx(hM,{}):S.jsx(dM,{})}),v]})}V1.displayName="Controls";const pM=q.memo(V1);function gM({id:e,x:n,y:s,width:a,height:o,style:c,color:u,strokeColor:d,strokeWidth:h,className:p,borderRadius:v,shapeRendering:g,selected:y,onClick:w}){const{background:E,backgroundColor:N}=c||{},A=u||E||N;return S.jsx("rect",{className:bt(["react-flow__minimap-node",{selected:y},p]),x:n,y:s,rx:v,ry:v,width:a,height:o,style:{fill:A,stroke:d,strokeWidth:h},shapeRendering:g,onClick:w?C=>w(C,e):void 0})}const yM=q.memo(gM),vM=e=>e.nodes.map(n=>n.id),dh=e=>e instanceof Function?e:()=>e;function bM({nodeStrokeColor:e,nodeColor:n,nodeClassName:s="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:c=yM,onClick:u}){const d=Re(vM,nt),h=dh(n),p=dh(e),v=dh(s),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return S.jsx(S.Fragment,{children:d.map(y=>S.jsx(wM,{id:y,nodeColorFunc:h,nodeStrokeColorFunc:p,nodeClassNameFunc:v,nodeBorderRadius:a,nodeStrokeWidth:o,NodeComponent:c,onClick:u,shapeRendering:g},y))})}function SM({id:e,nodeColorFunc:n,nodeStrokeColorFunc:s,nodeClassNameFunc:a,nodeBorderRadius:o,nodeStrokeWidth:c,shapeRendering:u,NodeComponent:d,onClick:h}){const{node:p,x:v,y:g,width:y,height:w}=Re(E=>{const N=E.nodeLookup.get(e);if(!N)return{node:void 0,x:0,y:0,width:0,height:0};const A=N.internals.userNode,{x:C,y:z}=N.internals.positionAbsolute,{width:_,height:x}=Oi(A);return{node:A,x:C,y:z,width:_,height:x}},nt);return!p||p.hidden||!Gb(p)?null:S.jsx(d,{x:v,y:g,width:y,height:w,style:p.style,selected:!!p.selected,className:a(p),color:n(p),borderRadius:o,strokeColor:s(p),strokeWidth:c,shapeRendering:u,onClick:h,id:p.id})}const wM=q.memo(SM);var xM=q.memo(bM);const EM=200,NM=150,_M=e=>!e.hidden,AM=e=>{const n={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:n,boundingRect:e.nodeLookup.size>0?Vb(tr(e.nodeLookup,{filter:_M}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},TM="react-flow__minimap-desc";function Y1({style:e,className:n,nodeStrokeColor:s,nodeColor:a,nodeClassName:o="",nodeBorderRadius:c=5,nodeStrokeWidth:u,nodeComponent:d,bgColor:h,maskColor:p,maskStrokeColor:v,maskStrokeWidth:g,position:y="bottom-right",onClick:w,onNodeClick:E,pannable:N=!1,zoomable:A=!1,ariaLabel:C,inversePan:z,zoomStep:_=1,offsetScale:x=5}){const B=st(),j=q.useRef(null),{boundingRect:T,viewBB:D,rfId:R,panZoom:Z,translateExtent:Y,flowWidth:K,flowHeight:le,ariaLabelConfig:L}=Re(AM,nt),G=e?.width??EM,k=e?.height??NM,$=T.width/G,H=T.height/k,X=Math.max($,H),W=X*G,O=X*k,I=x*X,ee=T.x-(W-T.width)/2-I,ne=T.y-(O-T.height)/2-I,fe=W+I*2,de=O+I*2,ae=`${TM}-${R}`,te=q.useRef(0),ue=q.useRef();te.current=X,q.useEffect(()=>{if(j.current&&Z)return ue.current=$A({domNode:j.current,panZoom:Z,getTransform:()=>B.getState().transform,getViewScale:()=>te.current}),()=>{ue.current?.destroy()}},[Z]),q.useEffect(()=>{ue.current?.update({translateExtent:Y,width:K,height:le,inversePan:z,pannable:N,zoomStep:_,zoomable:A})},[N,A,z,_,Y,K,le]);const Se=w?ve=>{const[Ee,Me]=ue.current?.pointer(ve)||[0,0];w(ve,{x:Ee,y:Me})}:void 0,we=E?q.useCallback((ve,Ee)=>{const Me=B.getState().nodeLookup.get(Ee).internals.userNode;E(ve,Me)},[]):void 0,ge=C??L["minimap.ariaLabel"];return S.jsx(xu,{position:y,style:{...e,"--xy-minimap-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-color-props":typeof v=="string"?v:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*X:void 0,"--xy-minimap-node-background-color-props":typeof a=="string"?a:void 0,"--xy-minimap-node-stroke-color-props":typeof s=="string"?s:void 0,"--xy-minimap-node-stroke-width-props":typeof u=="number"?u:void 0},className:bt(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:S.jsxs("svg",{width:G,height:k,viewBox:`${ee} ${ne} ${fe} ${de}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ae,ref:j,onClick:Se,children:[ge&&S.jsx("title",{id:ae,children:ge}),S.jsx(xM,{onClick:we,nodeColor:a,nodeStrokeColor:s,nodeBorderRadius:c,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:d}),S.jsx("path",{className:"react-flow__minimap-mask",d:`M${ee-I},${ne-I}h${fe+I*2}v${de+I*2}h${-fe-I*2}z
15
- M${D.x},${D.y}h${D.width}v${D.height}h${-D.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Y1.displayName="MiniMap";q.memo(Y1);const CM=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,MM={[hl.Line]:"right",[hl.Handle]:"bottom-right"};function OM({nodeId:e,position:n,variant:s=hl.Handle,className:a,style:o=void 0,children:c,color:u,minWidth:d=10,minHeight:h=10,maxWidth:p=Number.MAX_VALUE,maxHeight:v=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:y,autoScale:w=!0,shouldResize:E,onResizeStart:N,onResize:A,onResizeEnd:C}){const z=w1(),_=typeof e=="string"?e:z,x=st(),B=q.useRef(null),j=s===hl.Handle,T=Re(q.useCallback(CM(j&&w),[j,w]),nt),D=q.useRef(null),R=n??MM[s];q.useEffect(()=>{if(!(!B.current||!_))return D.current||(D.current=JA({domNode:B.current,nodeId:_,getStoreItems:()=>{const{nodeLookup:Y,transform:K,snapGrid:le,snapToGrid:L,nodeOrigin:G,domNode:k}=x.getState();return{nodeLookup:Y,transform:K,snapGrid:le,snapToGrid:L,nodeOrigin:G,paneDomNode:k}},onChange:(Y,K)=>{const{triggerNodeChanges:le,nodeLookup:L,parentLookup:G,nodeOrigin:k}=x.getState(),$=[],H={x:Y.x,y:Y.y},X=L.get(_);if(X&&X.expandParent&&X.parentId){const W=X.origin??k,O=Y.width??X.measured.width??0,I=Y.height??X.measured.height??0,ee={id:X.id,parentId:X.parentId,rect:{width:O,height:I,...Xb({x:Y.x??X.position.x,y:Y.y??X.position.y},{width:O,height:I},X.parentId,L,W)}},ne=dm([ee],L,G,k);$.push(...ne),H.x=Y.x?Math.max(W[0]*O,Y.x):void 0,H.y=Y.y?Math.max(W[1]*I,Y.y):void 0}if(H.x!==void 0&&H.y!==void 0){const W={id:_,type:"position",position:{...H}};$.push(W)}if(Y.width!==void 0&&Y.height!==void 0){const O={id:_,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:Y.width,height:Y.height}};$.push(O)}for(const W of K){const O={...W,type:"position"};$.push(O)}le($)},onEnd:({width:Y,height:K})=>{const le={id:_,type:"dimensions",resizing:!1,dimensions:{width:Y,height:K}};x.getState().triggerNodeChanges([le])}})),D.current.update({controlPosition:R,boundaries:{minWidth:d,minHeight:h,maxWidth:p,maxHeight:v},keepAspectRatio:g,resizeDirection:y,onResizeStart:N,onResize:A,onResizeEnd:C,shouldResize:E}),()=>{D.current?.destroy()}},[R,d,h,p,v,g,N,A,C,E]);const Z=R.split("-");return S.jsx("div",{className:bt(["react-flow__resize-control","nodrag",...Z,s,a]),ref:B,style:{...o,scale:T,...u&&{[j?"backgroundColor":"borderColor"]:u}},children:c})}q.memo(OM);const hh="emviz.viewerToken";let qa;function kM(){const e=new URLSearchParams(window.location.hash.slice(1));if(e.has("token")){const n=e.get("token")??"";qa=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i.test(n)?n:void 0;try{qa?window.sessionStorage.setItem(hh,qa):window.sessionStorage.removeItem(hh)}catch{}window.history.replaceState(window.history.state,"",window.location.pathname+window.location.search)}if(!qa)try{qa=window.sessionStorage.getItem(hh)??void 0}catch{}return qa}function jo(e,n={}){const s=new URL(e,window.location.href);if(s.origin!==window.location.origin||s.username||s.password||!s.pathname.startsWith("/api/"))throw new Error("API requests must stay on this server.");const a=new Headers(n.headers),o=kM();return o&&!a.has("X-Emviz-Token")&&a.set("X-Emviz-Token",o),fetch(s.href,{...n,headers:a,redirect:"error"})}function Ov(){const e=crypto.getRandomValues(new Uint8Array(16));e[6]=e[6]&15|64,e[8]=e[8]&63|128;const n=Array.from(e,s=>s.toString(16).padStart(2,"0")).join("");return n.slice(0,8)+"-"+n.slice(8,12)+"-"+n.slice(12,16)+"-"+n.slice(16,20)+"-"+n.slice(20)}const kv=3,zM=new Set(["command-event","event-query"]);function G1(e){return[...new Set(e)]}function X1(e){return e?.trim()?G1(e.split(/\r?\n/).map(n=>jM(n)).filter(n=>!!n)):[]}function jM(e){const n=e.trim();return n?n.replace(/^[-*+]\s+/,"").replace(/^\d+[.)]\s+/,"").trim().match(/^`?([A-Za-z_][A-Za-z0-9_.-]*)`?(?=\s*(?::|-|=|\(|,|$))/)?.[1]:void 0}function DM(e){const n=new Map(e.nodes.map(o=>[o.id,o])),s=new Map(e.nodes.map(o=>[o.id,X1(o.fields)])),a=new Map;for(const o of e.edges){if(!zM.has(o.kind))continue;const c=n.get(o.source),u=n.get(o.target);if(!zv(c)||!zv(u))continue;const d=s.get(o.source)??[],h=s.get(o.target)??[],p=new Set(h),v=d.filter(w=>p.has(w)),g=o.kind==="event-query"?BM(c,h,v):[],y=G1([...v,...g]);a.set(o.id,{sourceFieldNames:d,targetFieldNames:h,sharedFieldNames:v,derivedFieldNames:g,visibleFieldNames:y.slice(0,kv),remainingCount:Math.max(0,y.length-kv),sourceMissingFields:d.length===0,targetMissingFields:h.length===0})}return a}function RM(e,n){if(!n)return;const s=[...e.entries()].filter(([,a])=>a.sharedFieldNames.includes(n)||a.derivedFieldNames.includes(n)).map(([a])=>a);return s.length>0?new Set(s):void 0}function zv(e){return e?.type==="command"||e?.type==="event"||e?.type==="query"}function BM(e,n,s){const a=jv(e.label),o=new Set(s);return n.filter(c=>!o.has(c)&&jv(c).includes(a))}function jv(e){return e.replace(/^(has|is|was|were)/i,"").replace(/been/gi,"").replace(/[^A-Za-z0-9]/g,"").toLowerCase()}const Dt=e=>e.id??e.name,un=e=>e.storyId??e.storyName;function LM(e,n){if(!n)return e;const s=new Map(e.stories.map(g=>[Dt(g),g])),a=n.steps.flatMap(g=>{const y=s.get(g.storyId);return y?[y]:[]}),o=new Set(a.map(Dt)),c=new Map(a.flatMap(g=>g.slices.map(y=>[y,g]))),u=e.slices.filter(g=>c.has(g.path)).map(g=>{const y=c.get(g.path);return{...g,storyName:y.name,storyId:Dt(y)}}),d=g=>g.sourcePath??e.slices.find(y=>y.title===(g.sliceTitle??g.label))?.path,h=e.nodes.filter(g=>g.type!=="event"&&(g.type==="story"?o.has(g.storyId??g.label):c.has(d(g)??""))),p=new Set(h.map(g=>g.id));for(const g of e.edges)g.kind==="command-event"&&p.has(g.source)&&p.add(g.target),g.kind==="event-query"&&p.has(g.target)&&p.add(g.source);const v=e.nodes.filter(g=>p.has(g.id)).map(g=>{if(g.type==="story"||g.type==="event")return g;const y=c.get(d(g)??"");return y?{...g,storyName:y.name,storyId:Dt(y)}:g});return{...e,stories:a,slices:u,nodes:v,edges:e.edges.filter(g=>p.has(g.source)&&p.has(g.target))}}function $M(e){const n=new Map(e.steps.map(o=>[o.id,o])),s=new Map,a=new Set(n.keys());for(;a.size;){let o=!1;for(const c of a){const u=n.get(c);u.after.some(d=>n.has(d)&&!s.has(d))||(s.set(c,Math.max(0,...u.after.map(d=>(s.get(d)??-1)+1))),a.delete(c),o=!0)}if(!o){for(const c of a)s.set(c,0);break}}return new Map(e.steps.map(o=>[o.storyId,s.get(o.id)??0]))}function Dv(e,n){return n?void 0:e}const mm=Symbol.for("yaml.alias"),Lh=Symbol.for("yaml.document"),ms=Symbol.for("yaml.map"),K1=Symbol.for("yaml.pair"),Pn=Symbol.for("yaml.scalar"),vl=Symbol.for("yaml.seq"),_n=Symbol.for("yaml.node.type"),Js=e=>!!e&&typeof e=="object"&&e[_n]===mm,Ws=e=>!!e&&typeof e=="object"&&e[_n]===Lh,bl=e=>!!e&&typeof e=="object"&&e[_n]===ms,it=e=>!!e&&typeof e=="object"&&e[_n]===K1,Fe=e=>!!e&&typeof e=="object"&&e[_n]===Pn,Sl=e=>!!e&&typeof e=="object"&&e[_n]===vl;function lt(e){if(e&&typeof e=="object")switch(e[_n]){case ms:case vl:return!0}return!1}function ot(e){if(e&&typeof e=="object")switch(e[_n]){case mm:case ms:case Pn:case vl:return!0}return!1}const Q1=e=>(Fe(e)||lt(e))&&!!e.anchor,Wt=Symbol("break visit"),Z1=Symbol("skip children"),Wn=Symbol("remove node");function Ps(e,n){const s=F1(n);Ws(e)?Qa(null,e.contents,s,Object.freeze([e]))===Wn&&(e.contents=null):Qa(null,e,s,Object.freeze([]))}Ps.BREAK=Wt;Ps.SKIP=Z1;Ps.REMOVE=Wn;function Qa(e,n,s,a){const o=J1(e,n,s,a);if(ot(o)||it(o))return W1(e,a,o),Qa(e,o,s,a);if(typeof o!="symbol"){if(lt(n)){a=Object.freeze(a.concat(n));for(let c=0;c<n.items.length;++c){const u=Qa(c,n.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===Wt)return Wt;u===Wn&&(n.items.splice(c,1),c-=1)}}}else if(it(n)){a=Object.freeze(a.concat(n));const c=Qa("key",n.key,s,a);if(c===Wt)return Wt;c===Wn&&(n.key=null);const u=Qa("value",n.value,s,a);if(u===Wt)return Wt;u===Wn&&(n.value=null)}}return o}async function _u(e,n){const s=F1(n);Ws(e)?await Za(null,e.contents,s,Object.freeze([e]))===Wn&&(e.contents=null):await Za(null,e,s,Object.freeze([]))}_u.BREAK=Wt;_u.SKIP=Z1;_u.REMOVE=Wn;async function Za(e,n,s,a){const o=await J1(e,n,s,a);if(ot(o)||it(o))return W1(e,a,o),Za(e,o,s,a);if(typeof o!="symbol"){if(lt(n)){a=Object.freeze(a.concat(n));for(let c=0;c<n.items.length;++c){const u=await Za(c,n.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===Wt)return Wt;u===Wn&&(n.items.splice(c,1),c-=1)}}}else if(it(n)){a=Object.freeze(a.concat(n));const c=await Za("key",n.key,s,a);if(c===Wt)return Wt;c===Wn&&(n.key=null);const u=await Za("value",n.value,s,a);if(u===Wt)return Wt;u===Wn&&(n.value=null)}}return o}function F1(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function J1(e,n,s,a){if(typeof s=="function")return s(e,n,a);if(bl(n))return s.Map?.(e,n,a);if(Sl(n))return s.Seq?.(e,n,a);if(it(n))return s.Pair?.(e,n,a);if(Fe(n))return s.Scalar?.(e,n,a);if(Js(n))return s.Alias?.(e,n,a)}function W1(e,n,s){const a=n[n.length-1];if(lt(a))a.items[e]=s;else if(it(a))e==="key"?a.key=s:a.value=s;else if(Ws(a))a.contents=s;else{const o=Js(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${o} parent`)}}const HM={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},UM=e=>e.replace(/[!,[\]{}]/g,n=>HM[n]);class $t{constructor(n,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},$t.defaultYaml,n),this.tags=Object.assign({},$t.defaultTags,s)}clone(){const n=new $t(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){const n=new $t(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:$t.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},$t.defaultTags);break}return n}add(n,s){this.atNextDocument&&(this.yaml={explicit:$t.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},$t.defaultTags),this.atNextDocument=!1);const a=n.trim().split(/[ \t]+/),o=a.shift();switch(o){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 ${o}`,!0),!1}}tagName(n,s){if(n==="!")return"!";if(n[0]!=="!")return s(`Not a valid tag: ${n}`),null;if(n[1]==="<"){const u=n.slice(2,-1);return u==="!"||u==="!!"?(s(`Verbatim tags aren't resolved, so ${n} is invalid.`),null):(n[n.length-1]!==">"&&s("Verbatim tags must end with a >"),u)}const[,a,o]=n.match(/^(.*!)([^!]*)$/s);o||s(`The ${n} tag has no suffix`);const c=this.tags[a];if(c)try{return c+decodeURIComponent(o)}catch(u){return s(String(u)),null}return a==="!"?n:(s(`Could not resolve tag: ${n}`),null)}tagString(n){for(const[s,a]of Object.entries(this.tags))if(n.startsWith(a))return s+UM(n.substring(a.length));return n[0]==="!"?n:`!<${n}>`}toString(n){const s=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],a=Object.entries(this.tags);let o;if(n&&a.length>0&&ot(n.contents)){const c={};Ps(n.contents,(u,d)=>{ot(d)&&d.tag&&(c[d.tag]=!0)}),o=Object.keys(c)}else o=[];for(const[c,u]of a)c==="!!"&&u==="tag:yaml.org,2002:"||(!n||o.some(d=>d.startsWith(u)))&&s.push(`%TAG ${c} ${u}`);return s.join(`
16
- `)}}$t.defaultYaml={explicit:!1,version:"1.2"};$t.defaultTags={"!!":"tag:yaml.org,2002:"};function P1(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const s=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(s)}return!0}function eS(e){const n=new Set;return Ps(e,{Value(s,a){a.anchor&&n.add(a.anchor)}}),n}function tS(e,n){for(let s=1;;++s){const a=`${e}${s}`;if(!n.has(a))return a}}function IM(e,n){const s=[],a=new Map;let o=null;return{onAnchor:c=>{s.push(c),o??(o=eS(e));const u=tS(n,o);return o.add(u),u},setAnchors:()=>{for(const c of s){const u=a.get(c);if(typeof u=="object"&&u.anchor&&(Fe(u.node)||lt(u.node)))u.node.anchor=u.anchor;else{const d=new Error("Failed to resolve repeated object (this should not happen)");throw d.source=c,d}}},sourceObjects:a}}function Fa(e,n,s,a){if(a&&typeof a=="object")if(Array.isArray(a))for(let o=0,c=a.length;o<c;++o){const u=a[o],d=Fa(e,a,String(o),u);d===void 0?delete a[o]:d!==u&&(a[o]=d)}else if(a instanceof Map)for(const o of Array.from(a.keys())){const c=a.get(o),u=Fa(e,a,o,c);u===void 0?a.delete(o):u!==c&&a.set(o,u)}else if(a instanceof Set)for(const o of Array.from(a)){const c=Fa(e,a,o,o);c===void 0?a.delete(o):c!==o&&(a.delete(o),a.add(c))}else for(const[o,c]of Object.entries(a)){const u=Fa(e,a,o,c);u===void 0?delete a[o]:u!==c&&(a[o]=u)}return e.call(n,s,a)}function Nn(e,n,s){if(Array.isArray(e))return e.map((a,o)=>Nn(a,String(o),s));if(e&&typeof e.toJSON=="function"){if(!s||!Q1(e))return e.toJSON(n,s);const a={aliasCount:0,count:1,res:void 0};s.anchors.set(e,a),s.onCreate=c=>{a.res=c,delete s.onCreate};const o=e.toJSON(n,s);return s.onCreate&&s.onCreate(o),o}return typeof e=="bigint"&&!s?.keep?Number(e):e}class pm{constructor(n){Object.defineProperty(this,_n,{value:n})}clone(){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(n.range=this.range.slice()),n}toJS(n,{mapAsMap:s,maxAliasCount:a,onAnchor:o,reviver:c}={}){if(!Ws(n))throw new TypeError("A document argument is required");const u={anchors:new Map,doc:n,keep:!0,mapAsMap:s===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},d=Nn(this,"",u);if(typeof o=="function")for(const{count:h,res:p}of u.anchors.values())o(p,h);return typeof c=="function"?Fa(c,{"":d},"",d):d}}class Au extends pm{constructor(n){super(mm),this.source=n,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(n,s){if(s?.maxAliasCount===0)throw new ReferenceError("Alias resolution is disabled");let a;s?.aliasResolveCache?a=s.aliasResolveCache:(a=[],Ps(n,{Node:(c,u)=>{(Js(u)||Q1(u))&&a.push(u)}}),s&&(s.aliasResolveCache=a));let o;for(const c of a){if(c===this)break;c.anchor===this.source&&(o=c)}return o}toJSON(n,s){if(!s)return{source:this.source};const{anchors:a,doc:o,maxAliasCount:c}=s,u=this.resolve(o,s);if(!u){const h=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(h)}let d=a.get(u);if(d||(Nn(u,null,s),d=a.get(u)),d?.res===void 0){const h="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(h)}if(c>=0&&(d.count+=1,d.aliasCount===0&&(d.aliasCount=Yc(o,u,a)),d.count*d.aliasCount>c)){const h="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(h)}return d.res}toString(n,s,a){const o=`*${this.source}`;if(n){if(P1(this.source),n.options.verifyAliasOrder&&!n.anchors.has(this.source)){const c=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(c)}if(n.implicitKey)return`${o} `}return o}}function Yc(e,n,s){if(Js(n)){const a=n.resolve(e),o=s&&a&&s.get(a);return o?o.count*o.aliasCount:0}else if(lt(n)){let a=0;for(const o of n.items){const c=Yc(e,o,s);c>a&&(a=c)}return a}else if(it(n)){const a=Yc(e,n.key,s),o=Yc(e,n.value,s);return Math.max(a,o)}return 1}const nS=e=>!e||typeof e!="function"&&typeof e!="object";class Ae extends pm{constructor(n){super(Pn),this.value=n}toJSON(n,s){return s?.keep?this.value:Nn(this.value,n,s)}toString(){return String(this.value)}}Ae.BLOCK_FOLDED="BLOCK_FOLDED";Ae.BLOCK_LITERAL="BLOCK_LITERAL";Ae.PLAIN="PLAIN";Ae.QUOTE_DOUBLE="QUOTE_DOUBLE";Ae.QUOTE_SINGLE="QUOTE_SINGLE";const qM="tag:yaml.org,2002:";function VM(e,n,s){if(n){const a=s.filter(c=>c.tag===n),o=a.find(c=>!c.format)??a[0];if(!o)throw new Error(`Tag ${n} not found`);return o}return s.find(a=>a.identify?.(e)&&!a.format)}function Xo(e,n,s){if(Ws(e)&&(e=e.contents),ot(e))return e;if(it(e)){const g=s.schema[ms].createNode?.(s.schema,null,s);return g.items.push(e),g}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:a,onAnchor:o,onTagObj:c,schema:u,sourceObjects:d}=s;let h;if(a&&e&&typeof e=="object"){if(h=d.get(e),h)return h.anchor??(h.anchor=o(e)),new Au(h.anchor);h={anchor:null,node:null},d.set(e,h)}n?.startsWith("!!")&&(n=qM+n.slice(2));let p=VM(e,n,u.tags);if(!p){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const g=new Ae(e);return h&&(h.node=g),g}p=e instanceof Map?u[ms]:Symbol.iterator in Object(e)?u[vl]:u[ms]}c&&(c(p),delete s.onTagObj);const v=p?.createNode?p.createNode(s.schema,e,s):typeof p?.nodeClass?.from=="function"?p.nodeClass.from(s.schema,e,s):new Ae(e);return n?v.tag=n:p.default||(v.tag=p.tag),h&&(h.node=v),v}function lu(e,n,s){let a=s;for(let o=n.length-1;o>=0;--o){const c=n[o];if(typeof c=="number"&&Number.isInteger(c)&&c>=0){const u=[];u[c]=a,a=u}else a=new Map([[c,a]])}return Xo(a,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const Co=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class iS extends pm{constructor(n,s){super(n),Object.defineProperty(this,"schema",{value:s,configurable:!0,enumerable:!1,writable:!0})}clone(n){const s=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return n&&(s.schema=n),s.items=s.items.map(a=>ot(a)||it(a)?a.clone(n):a),this.range&&(s.range=this.range.slice()),s}addIn(n,s){if(Co(n))this.add(s);else{const[a,...o]=n,c=this.get(a,!0);if(lt(c))c.addIn(o,s);else if(c===void 0&&this.schema)this.set(a,lu(this.schema,o,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${o}`)}}deleteIn(n){const[s,...a]=n;if(a.length===0)return this.delete(s);const o=this.get(s,!0);if(lt(o))return o.deleteIn(a);throw new Error(`Expected YAML collection at ${s}. Remaining path: ${a}`)}getIn(n,s){const[a,...o]=n,c=this.get(a,!0);return o.length===0?!s&&Fe(c)?c.value:c:lt(c)?c.getIn(o,s):void 0}hasAllNullValues(n){return this.items.every(s=>{if(!it(s))return!1;const a=s.value;return a==null||n&&Fe(a)&&a.value==null&&!a.commentBefore&&!a.comment&&!a.tag})}hasIn(n){const[s,...a]=n;if(a.length===0)return this.has(s);const o=this.get(s,!0);return lt(o)?o.hasIn(a):!1}setIn(n,s){const[a,...o]=n;if(o.length===0)this.set(a,s);else{const c=this.get(a,!0);if(lt(c))c.setIn(o,s);else if(c===void 0&&this.schema)this.set(a,lu(this.schema,o,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${o}`)}}}const YM=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function Ti(e,n){return/^\n+$/.test(e)?e.substring(1):n?e.replace(/^(?! *$)/gm,n):e}const Hs=(e,n,s)=>e.endsWith(`
17
- `)?Ti(s,n):s.includes(`
18
- `)?`
19
- `+Ti(s,n):(e.endsWith(" ")?"":" ")+s,sS="flow",$h="block",Gc="quoted";function Tu(e,n,s="flow",{indentAtStart:a,lineWidth:o=80,minContentWidth:c=20,onFold:u,onOverflow:d}={}){if(!o||o<0)return e;o<c&&(c=0);const h=Math.max(1+c,1+o-n.length);if(e.length<=h)return e;const p=[],v={};let g=o-n.length;typeof a=="number"&&(a>o-Math.max(2,c)?p.push(0):g=o-a);let y,w,E=!1,N=-1,A=-1,C=-1;s===$h&&(N=Rv(e,N,n.length),N!==-1&&(g=N+h));for(let _;_=e[N+=1];){if(s===Gc&&_==="\\"){switch(A=N,e[N+1]){case"x":N+=3;break;case"u":N+=5;break;case"U":N+=9;break;default:N+=1}C=N}if(_===`
20
- `)s===$h&&(N=Rv(e,N,n.length)),g=N+n.length+h,y=void 0;else{if(_===" "&&w&&w!==" "&&w!==`
21
- `&&w!==" "){const x=e[N+1];x&&x!==" "&&x!==`
22
- `&&x!==" "&&(y=N)}if(N>=g)if(y)p.push(y),g=y+h,y=void 0;else if(s===Gc){for(;w===" "||w===" ";)w=_,_=e[N+=1],E=!0;const x=N>C+1?N-2:A-1;if(v[x])return e;p.push(x),v[x]=!0,g=x+h,y=void 0}else E=!0}w=_}if(E&&d&&d(),p.length===0)return e;u&&u();let z=e.slice(0,p[0]);for(let _=0;_<p.length;++_){const x=p[_],B=p[_+1]||e.length;x===0?z=`
23
- ${n}${e.slice(0,B)}`:(s===Gc&&v[x]&&(z+=`${e[x]}\\`),z+=`
24
- ${n}${e.slice(x+1,B)}`)}return z}function Rv(e,n,s){let a=n,o=n+1,c=e[o];for(;c===" "||c===" ";)if(n<o+s)c=e[++n];else{do c=e[++n];while(c&&c!==`
25
- `);a=n,o=n+1,c=e[o]}return a}const Cu=(e,n)=>({indentAtStart:n?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Mu=e=>/^(%|---|\.\.\.)/m.test(e);function GM(e,n,s){if(!n||n<0)return!1;const a=n-s,o=e.length;if(o<=a)return!1;for(let c=0,u=0;c<o;++c)if(e[c]===`
26
- `){if(c-u>a)return!0;if(u=c+1,o-u<=a)return!1}return!0}function Do(e,n){const s=JSON.stringify(e);if(n.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=n,o=n.options.doubleQuotedMinMultiLineLength,c=n.indent||(Mu(e)?" ":"");let u="",d=0;for(let h=0,p=s[h];p;p=s[++h])if(p===" "&&s[h+1]==="\\"&&s[h+2]==="n"&&(u+=s.slice(d,h)+"\\ ",h+=1,d=h,p="\\"),p==="\\")switch(s[h+1]){case"u":{u+=s.slice(d,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,d=h+1}break;case"n":if(a||s[h+2]==='"'||s.length<o)h+=1;else{for(u+=s.slice(d,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,d=h+1}break;default:h+=1}return u=d?u+s.slice(d):s,a?u:Tu(u,c,Gc,Cu(n,!1))}function Hh(e,n){if(n.options.singleQuote===!1||n.implicitKey&&e.includes(`
30
- `)||/[ \t]\n|\n[ \t]/.test(e))return Do(e,n);const s=n.indent||(Mu(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
31
- ${s}`)+"'";return n.implicitKey?a:Tu(a,s,sS,Cu(n,!1))}function Ja(e,n){const{singleQuote:s}=n.options;let a;if(s===!1)a=Do;else{const o=e.includes('"'),c=e.includes("'");o&&!c?a=Hh:c&&!o?a=Do:a=s?Hh:Do}return a(e,n)}let Uh;try{Uh=new RegExp(`(^|(?<!
32
- ))
33
- +(?!
34
- |$)`,"g")}catch{Uh=/\n+(?!\n|$)/g}function Xc({comment:e,type:n,value:s},a,o,c){const{blockQuote:u,commentString:d,lineWidth:h}=a.options;if(!u||/\n[\t ]+$/.test(s))return Ja(s,a);const p=a.indent||(a.forceBlockIndent||Mu(s)?" ":""),v=u==="literal"?!0:u==="folded"||n===Ae.BLOCK_FOLDED?!1:n===Ae.BLOCK_LITERAL?!0:!GM(s,h,p.length);if(!s)return v?`|
35
- `:`>
36
- `;let g,y;for(y=s.length;y>0;--y){const B=s[y-1];if(B!==`
37
- `&&B!==" "&&B!==" ")break}let w=s.substring(y);const E=w.indexOf(`
38
- `);E===-1?g="-":s===w||E!==w.length-1?(g="+",c&&c()):g="",w&&(s=s.slice(0,-w.length),w[w.length-1]===`
39
- `&&(w=w.slice(0,-1)),w=w.replace(Uh,`$&${p}`));let N=!1,A,C=-1;for(A=0;A<s.length;++A){const B=s[A];if(B===" ")N=!0;else if(B===`
40
- `)C=A;else break}let z=s.substring(0,C<A?C+1:A);z&&(s=s.substring(z.length),z=z.replace(/\n+/g,`$&${p}`));let x=(N?p?"2":"1":"")+g;if(e&&(x+=" "+d(e.replace(/ ?[\r\n]+/g," ")),o&&o()),!v){const B=s.replace(/\n+/g,`
41
- $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${p}`);let j=!1;const T=Cu(a,!0);u!=="folded"&&n!==Ae.BLOCK_FOLDED&&(T.onOverflow=()=>{j=!0});const D=Tu(`${z}${B}${w}`,p,$h,T);if(!j)return`>${x}
42
- ${p}${D}`}return s=s.replace(/\n+/g,`$&${p}`),`|${x}
43
- ${p}${z}${s}${w}`}function XM(e,n,s,a){const{type:o,value:c}=e,{actualString:u,implicitKey:d,indent:h,indentStep:p,inFlow:v}=n;if(d&&c.includes(`
44
- `)||v&&/[[\]{},]/.test(c))return Ja(c,n);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return d||v||!c.includes(`
45
- `)?Ja(c,n):Xc(e,n,s,a);if(!d&&!v&&o!==Ae.PLAIN&&c.includes(`
46
- `))return Xc(e,n,s,a);if(Mu(c)){if(h==="")return n.forceBlockIndent=!0,Xc(e,n,s,a);if(d&&h===p)return Ja(c,n)}const g=c.replace(/\n+/g,`$&
47
- ${h}`);if(u){const y=N=>N.default&&N.tag!=="tag:yaml.org,2002:str"&&N.test?.test(g),{compat:w,tags:E}=n.doc.schema;if(E.some(y)||w?.some(y))return Ja(c,n)}return d?g:Tu(g,h,sS,Cu(n,!1))}function sr(e,n,s,a){const{implicitKey:o,inFlow:c}=n,u=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:d}=e;d!==Ae.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(u.value)&&(d=Ae.QUOTE_DOUBLE);const h=v=>{switch(v){case Ae.BLOCK_FOLDED:case Ae.BLOCK_LITERAL:return o||c?Ja(u.value,n):Xc(u,n,s,a);case Ae.QUOTE_DOUBLE:return Do(u.value,n);case Ae.QUOTE_SINGLE:return Hh(u.value,n);case Ae.PLAIN:return XM(u,n,s,a);default:return null}};let p=h(d);if(p===null){const{defaultKeyType:v,defaultStringType:g}=n.options,y=o&&v||g;if(p=h(y),p===null)throw new Error(`Unsupported default string type ${y}`)}return p}function aS(e,n){const s=Object.assign({blockQuote:!0,commentString:YM,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},e.schema.toStringOptions,n);let a;switch(s.collectionStyle){case"block":a=!1;break;case"flow":a=!0;break;default:a=null}return{anchors:new Set,doc:e,flowCollectionPadding:s.flowCollectionPadding?" ":"",indent:"",indentStep:typeof s.indent=="number"?" ".repeat(s.indent):" ",inFlow:a,options:s}}function KM(e,n){if(n.tag){const o=e.filter(c=>c.tag===n.tag);if(o.length>0)return o.find(c=>c.format===n.format)??o[0]}let s,a;if(Fe(n)){a=n.value;let o=e.filter(c=>c.identify?.(a));if(o.length>1){const c=o.filter(u=>u.test);c.length>0&&(o=c)}s=o.find(c=>c.format===n.format)??o.find(c=>!c.format)}else a=n,s=e.find(o=>o.nodeClass&&a instanceof o.nodeClass);if(!s){const o=a?.constructor?.name??(a===null?"null":typeof a);throw new Error(`Tag not resolved for ${o} value`)}return s}function QM(e,n,{anchors:s,doc:a}){if(!a.directives)return"";const o=[],c=(Fe(e)||lt(e))&&e.anchor;c&&P1(c)&&(s.add(c),o.push(`&${c}`));const u=e.tag??(n.default?null:n.tag);return u&&o.push(a.directives.tagString(u)),o.join(" ")}function ml(e,n,s,a){if(it(e))return e.toString(n,s,a);if(Js(e)){if(n.doc.directives)return e.toString(n);if(n.resolvedAliases?.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");n.resolvedAliases?n.resolvedAliases.add(e):n.resolvedAliases=new Set([e]),e=e.resolve(n.doc)}let o;const c=ot(e)?e:n.doc.createNode(e,{onTagObj:h=>o=h});o??(o=KM(n.doc.schema.tags,c));const u=QM(c,o,n);u.length>0&&(n.indentAtStart=(n.indentAtStart??0)+u.length+1);const d=typeof o.stringify=="function"?o.stringify(c,n,s,a):Fe(c)?sr(c,n,s,a):c.toString(n,s,a);return u?Fe(c)||d[0]==="{"||d[0]==="["?`${u} ${d}`:`${u}
48
- ${n.indent}${d}`:d}function ZM({key:e,value:n},s,a,o){const{allNullValues:c,doc:u,indent:d,indentStep:h,options:{commentString:p,indentSeq:v,simpleKeys:g}}=s;let y=ot(e)&&e.comment||null;if(g){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(lt(e)||!ot(e)&&typeof e=="object"){const T="With simple keys, collection cannot be used as a key value";throw new Error(T)}}let w=!g&&(!e||y&&n==null&&!s.inFlow||lt(e)||(Fe(e)?e.type===Ae.BLOCK_FOLDED||e.type===Ae.BLOCK_LITERAL:typeof e=="object"));s=Object.assign({},s,{allNullValues:!1,implicitKey:!w&&(g||!c),indent:d+h});let E=!1,N=!1,A=ml(e,s,()=>E=!0,()=>N=!0);if(!w&&!s.inFlow&&A.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");w=!0}if(s.inFlow){if(c||n==null)return E&&a&&a(),A===""?"?":w?`? ${A}`:A}else if(c&&!g||n==null&&w)return A=`? ${A}`,y&&!E?A+=Hs(A,s.indent,p(y)):N&&o&&o(),A;E&&(y=null),w?(y&&(A+=Hs(A,s.indent,p(y))),A=`? ${A}
49
- ${d}:`):(A=`${A}:`,y&&(A+=Hs(A,s.indent,p(y))));let C,z,_;ot(n)?(C=!!n.spaceBefore,z=n.commentBefore,_=n.comment):(C=!1,z=null,_=null,n&&typeof n=="object"&&(n=u.createNode(n))),s.implicitKey=!1,!w&&!y&&Fe(n)&&(s.indentAtStart=A.length+1),N=!1,!v&&h.length>=2&&!s.inFlow&&!w&&Sl(n)&&!n.flow&&!n.tag&&!n.anchor&&(s.indent=s.indent.substring(2));let x=!1;const B=ml(n,s,()=>x=!0,()=>N=!0);let j=" ";if(y||C||z){if(j=C?`
50
- `:"",z){const T=p(z);j+=`
51
- ${Ti(T,s.indent)}`}B===""&&!s.inFlow?j===`
52
- `&&_&&(j=`
53
-
54
- `):j+=`
55
- ${s.indent}`}else if(!w&&lt(n)){const T=B[0],D=B.indexOf(`
56
- `),R=D!==-1,Z=s.inFlow??n.flow??n.items.length===0;if(R||!Z){let Y=!1;if(R&&(T==="&"||T==="!")){let K=B.indexOf(" ");T==="&"&&K!==-1&&K<D&&B[K+1]==="!"&&(K=B.indexOf(" ",K+1)),(K===-1||D<K)&&(Y=!0)}Y||(j=`
57
- ${s.indent}`)}}else(B===""||B[0]===`
58
- `)&&(j="");return A+=j+B,s.inFlow?x&&a&&a():_&&!x?A+=Hs(A,s.indent,p(_)):N&&o&&o(),A}function lS(e,n){(e==="debug"||e==="warn")&&console.warn(n)}const jc="<<",Ci={identify:e=>e===jc||typeof e=="symbol"&&e.description===jc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ae(Symbol(jc)),{addToJSMap:oS}),stringify:()=>jc},FM=(e,n)=>(Ci.identify(n)||Fe(n)&&(!n.type||n.type===Ae.PLAIN)&&Ci.identify(n.value))&&e?.doc.schema.tags.some(s=>s.tag===Ci.tag&&s.default);function oS(e,n,s){const a=rS(e,s);if(Sl(a))for(const o of a.items)mh(e,n,o);else if(Array.isArray(a))for(const o of a)mh(e,n,o);else mh(e,n,a)}function mh(e,n,s){const a=rS(e,s);if(!bl(a))throw new Error("Merge sources must be maps or map aliases");const o=a.toJSON(null,e,Map);for(const[c,u]of o)n instanceof Map?n.has(c)||n.set(c,u):n instanceof Set?n.add(c):Object.prototype.hasOwnProperty.call(n,c)||Object.defineProperty(n,c,{value:u,writable:!0,enumerable:!0,configurable:!0});return n}function rS(e,n){return e&&Js(n)?n.resolve(e.doc,e):n}function cS(e,n,{key:s,value:a}){if(ot(s)&&s.addToJSMap)s.addToJSMap(e,n,a);else if(FM(e,s))oS(e,n,a);else{const o=Nn(s,"",e);if(n instanceof Map)n.set(o,Nn(a,o,e));else if(n instanceof Set)n.add(o);else{const c=JM(s,o,e),u=Nn(a,c,e);c in n?Object.defineProperty(n,c,{value:u,writable:!0,enumerable:!0,configurable:!0}):n[c]=u}}return n}function JM(e,n,s){if(n===null)return"";if(typeof n!="object")return String(n);if(ot(e)&&s?.doc){const a=aS(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 o=e.toString(a);if(!s.mapKeyWarned){let c=JSON.stringify(o);c.length>40&&(c=c.substring(0,36)+'..."'),lS(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 o}return JSON.stringify(n)}function gm(e,n,s){const a=Xo(e,void 0,s),o=Xo(n,void 0,s);return new Rt(a,o)}class Rt{constructor(n,s=null){Object.defineProperty(this,_n,{value:K1}),this.key=n,this.value=s}clone(n){let{key:s,value:a}=this;return ot(s)&&(s=s.clone(n)),ot(a)&&(a=a.clone(n)),new Rt(s,a)}toJSON(n,s){const a=s?.mapAsMap?new Map:{};return cS(s,a,this)}toString(n,s,a){return n?.doc?ZM(this,n,s,a):JSON.stringify(this)}}function uS(e,n,s){return(n.inFlow??e.flow?PM:WM)(e,n,s)}function WM({comment:e,items:n},s,{blockItemPrefix:a,flowChars:o,itemIndent:c,onChompKeep:u,onComment:d}){const{indent:h,options:{commentString:p}}=s,v=Object.assign({},s,{indent:c,type:null});let g=!1;const y=[];for(let E=0;E<n.length;++E){const N=n[E];let A=null;if(ot(N))!g&&N.spaceBefore&&y.push(""),ou(s,y,N.commentBefore,g),N.comment&&(A=N.comment);else if(it(N)){const z=ot(N.key)?N.key:null;z&&(!g&&z.spaceBefore&&y.push(""),ou(s,y,z.commentBefore,g))}g=!1;let C=ml(N,v,()=>A=null,()=>g=!0);A&&(C+=Hs(C,c,p(A))),g&&A&&(g=!1),y.push(a+C)}let w;if(y.length===0)w=o.start+o.end;else{w=y[0];for(let E=1;E<y.length;++E){const N=y[E];w+=N?`
59
- ${h}${N}`:`
60
- `}}return e?(w+=`
61
- `+Ti(p(e),h),d&&d()):g&&u&&u(),w}function PM({items:e},n,{flowChars:s,itemIndent:a}){const{indent:o,indentStep:c,flowCollectionPadding:u,options:{commentString:d}}=n;a+=c;const h=Object.assign({},n,{indent:a,inFlow:!0,type:null});let p=!1,v=0;const g=[];for(let E=0;E<e.length;++E){const N=e[E];let A=null;if(ot(N))N.spaceBefore&&g.push(""),ou(n,g,N.commentBefore,!1),N.comment&&(A=N.comment);else if(it(N)){const z=ot(N.key)?N.key:null;z&&(z.spaceBefore&&g.push(""),ou(n,g,z.commentBefore,!1),z.comment&&(p=!0));const _=ot(N.value)?N.value:null;_?(_.comment&&(A=_.comment),_.commentBefore&&(p=!0)):N.value==null&&z?.comment&&(A=z.comment)}A&&(p=!0);let C=ml(N,h,()=>A=null);p||(p=g.length>v||C.includes(`
62
- `)),E<e.length-1?C+=",":n.options.trailingComma&&(n.options.lineWidth>0&&(p||(p=g.reduce((z,_)=>z+_.length+2,2)+(C.length+2)>n.options.lineWidth)),p&&(C+=",")),A&&(C+=Hs(C,a,d(A))),g.push(C),v=g.length}const{start:y,end:w}=s;if(g.length===0)return y+w;if(!p){const E=g.reduce((N,A)=>N+A.length+2,2);p=n.options.lineWidth>0&&E>n.options.lineWidth}if(p){let E=y;for(const N of g)E+=N?`
63
- ${c}${o}${N}`:`
64
- `;return`${E}
65
- ${o}${w}`}else return`${y}${u}${g.join(" ")}${u}${w}`}function ou({indent:e,options:{commentString:n}},s,a,o){if(a&&o&&(a=a.replace(/^\n+/,"")),a){const c=Ti(n(a),e);s.push(c.trimStart())}}function Us(e,n){const s=Fe(n)?n.value:n;for(const a of e)if(it(a)&&(a.key===n||a.key===s||Fe(a.key)&&a.key.value===s))return a}class fn extends iS{static get tagName(){return"tag:yaml.org,2002:map"}constructor(n){super(ms,n),this.items=[]}static from(n,s,a){const{keepUndefined:o,replacer:c}=a,u=new this(n),d=(h,p)=>{if(typeof c=="function")p=c.call(s,h,p);else if(Array.isArray(c)&&!c.includes(h))return;(p!==void 0||o)&&u.items.push(gm(h,p,a))};if(s instanceof Map)for(const[h,p]of s)d(h,p);else if(s&&typeof s=="object")for(const h of Object.keys(s))d(h,s[h]);return typeof n.sortMapEntries=="function"&&u.items.sort(n.sortMapEntries),u}add(n,s){let a;it(n)?a=n:!n||typeof n!="object"||!("key"in n)?a=new Rt(n,n?.value):a=new Rt(n.key,n.value);const o=Us(this.items,a.key),c=this.schema?.sortMapEntries;if(o){if(!s)throw new Error(`Key ${a.key} already set`);Fe(o.value)&&nS(a.value)?o.value.value=a.value:o.value=a.value}else if(c){const u=this.items.findIndex(d=>c(a,d)<0);u===-1?this.items.push(a):this.items.splice(u,0,a)}else this.items.push(a)}delete(n){const s=Us(this.items,n);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(n,s){const o=Us(this.items,n)?.value;return(!s&&Fe(o)?o.value:o)??void 0}has(n){return!!Us(this.items,n)}set(n,s){this.add(new Rt(n,s),!0)}toJSON(n,s,a){const o=a?new a:s?.mapAsMap?new Map:{};s?.onCreate&&s.onCreate(o);for(const c of this.items)cS(s,o,c);return o}toString(n,s,a){if(!n)return JSON.stringify(this);for(const o of this.items)if(!it(o))throw new Error(`Map items must all be pairs; found ${JSON.stringify(o)} instead`);return!n.allNullValues&&this.hasAllNullValues(!1)&&(n=Object.assign({},n,{allNullValues:!0})),uS(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:a,onComment:s})}}const wl={collection:"map",default:!0,nodeClass:fn,tag:"tag:yaml.org,2002:map",resolve(e,n){return bl(e)||n("Expected a mapping for this tag"),e},createNode:(e,n,s)=>fn.from(e,n,s)};class ps extends iS{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(n){super(vl,n),this.items=[]}add(n){this.items.push(n)}delete(n){const s=Dc(n);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(n,s){const a=Dc(n);if(typeof a!="number")return;const o=this.items[a];return!s&&Fe(o)?o.value:o}has(n){const s=Dc(n);return typeof s=="number"&&s<this.items.length}set(n,s){const a=Dc(n);if(typeof a!="number")throw new Error(`Expected a valid index, not ${n}.`);const o=this.items[a];Fe(o)&&nS(s)?o.value=s:this.items[a]=s}toJSON(n,s){const a=[];s?.onCreate&&s.onCreate(a);let o=0;for(const c of this.items)a.push(Nn(c,String(o++),s));return a}toString(n,s,a){return n?uS(this,n,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(n.indent||"")+" ",onChompKeep:a,onComment:s}):JSON.stringify(this)}static from(n,s,a){const{replacer:o}=a,c=new this(n);if(s&&Symbol.iterator in Object(s)){let u=0;for(let d of s){if(typeof o=="function"){const h=s instanceof Set?d:String(u++);d=o.call(s,h,d)}c.items.push(Xo(d,void 0,a))}}return c}}function Dc(e){let n=Fe(e)?e.value:e;return n&&typeof n=="string"&&(n=Number(n)),typeof n=="number"&&Number.isInteger(n)&&n>=0?n:null}const xl={collection:"seq",default:!0,nodeClass:ps,tag:"tag:yaml.org,2002:seq",resolve(e,n){return Sl(e)||n("Expected a sequence for this tag"),e},createNode:(e,n,s)=>ps.from(e,n,s)},Ou={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,n,s,a){return n=Object.assign({actualString:!0},n),sr(e,n,s,a)}},ku={identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new Ae(null),stringify:({source:e},n)=>typeof e=="string"&&ku.test.test(e)?e:n.options.nullStr},ym={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new Ae(e[0]==="t"||e[0]==="T"),stringify({source:e,value:n},s){if(e&&ym.test.test(e)){const a=e[0]==="t"||e[0]==="T";if(n===a)return e}return n?s.options.trueStr:s.options.falseStr}};function qn({format:e,minFractionDigits:n,tag:s,value:a}){if(typeof a=="bigint")return String(a);const o=typeof a=="number"?a:Number(a);if(!isFinite(o))return isNaN(o)?".nan":o<0?"-.inf":".inf";let c=Object.is(a,-0)?"-0":JSON.stringify(a);if(!e&&n&&(!s||s==="tag:yaml.org,2002:float")&&/^-?\d/.test(c)&&!c.includes("e")){let u=c.indexOf(".");u<0&&(u=c.length,c+=".");let d=n-(c.length-u-1);for(;d-- >0;)c+="0"}return c}const fS={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:qn},dS={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():qn(e)}},hS={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const n=new Ae(parseFloat(e)),s=e.indexOf(".");return s!==-1&&e[e.length-1]==="0"&&(n.minFractionDigits=e.length-s-1),n},stringify:qn},zu=e=>typeof e=="bigint"||Number.isInteger(e),vm=(e,n,s,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(n),s);function mS(e,n,s){const{value:a}=e;return zu(a)&&a>=0?s+a.toString(n):qn(e)}const pS={identify:e=>zu(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,n,s)=>vm(e,2,8,s),stringify:e=>mS(e,8,"0o")},gS={identify:zu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,n,s)=>vm(e,0,10,s),stringify:qn},yS={identify:e=>zu(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,n,s)=>vm(e,2,16,s),stringify:e=>mS(e,16,"0x")},eO=[wl,xl,Ou,ku,ym,pS,gS,yS,fS,dS,hS];function Bv(e){return typeof e=="bigint"||Number.isInteger(e)}const Rc=({value:e})=>JSON.stringify(e),tO=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Rc},{identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Rc},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Rc},{identify:Bv,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,n,{intAsBigInt:s})=>s?BigInt(e):parseInt(e,10),stringify:({value:e})=>Bv(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Rc}],nO={default:!0,tag:"",test:/^/,resolve(e,n){return n(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},iO=[wl,xl].concat(tO,nO),bm={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,n){if(typeof atob=="function"){const s=atob(e.replace(/[\n\r]/g,"")),a=new Uint8Array(s.length);for(let o=0;o<s.length;++o)a[o]=s.charCodeAt(o);return a}else return n("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:n,value:s},a,o,c){if(!s)return"";const u=s;let d;if(typeof btoa=="function"){let h="";for(let p=0;p<u.length;++p)h+=String.fromCharCode(u[p]);d=btoa(h)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(n??(n=Ae.BLOCK_LITERAL),n!==Ae.QUOTE_DOUBLE){const h=Math.max(a.options.lineWidth-a.indent.length,a.options.minContentWidth),p=Math.ceil(d.length/h),v=new Array(p);for(let g=0,y=0;g<p;++g,y+=h)v[g]=d.substr(y,h);d=v.join(n===Ae.BLOCK_LITERAL?`
66
- `:" ")}return sr({comment:e,type:n,value:d},a,o,c)}};function vS(e,n){if(Sl(e))for(let s=0;s<e.items.length;++s){let a=e.items[s];if(!it(a)){if(bl(a)){a.items.length>1&&n("Each pair must have its own sequence indicator");const o=a.items[0]||new Rt(new Ae(null));if(a.commentBefore&&(o.key.commentBefore=o.key.commentBefore?`${a.commentBefore}
67
- ${o.key.commentBefore}`:a.commentBefore),a.comment){const c=o.value??o.key;c.comment=c.comment?`${a.comment}
68
- ${c.comment}`:a.comment}a=o}e.items[s]=it(a)?a:new Rt(a)}}else n("Expected a sequence for this tag");return e}function bS(e,n,s){const{replacer:a}=s,o=new ps(e);o.tag="tag:yaml.org,2002:pairs";let c=0;if(n&&Symbol.iterator in Object(n))for(let u of n){typeof a=="function"&&(u=a.call(n,String(c++),u));let d,h;if(Array.isArray(u))if(u.length===2)d=u[0],h=u[1];else throw new TypeError(`Expected [key, value] tuple: ${u}`);else if(u&&u instanceof Object){const p=Object.keys(u);if(p.length===1)d=p[0],h=u[d];else throw new TypeError(`Expected tuple with one key, not ${p.length} keys`)}else d=u;o.items.push(gm(d,h,s))}return o}const Sm={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:vS,createNode:bS};class tl extends ps{constructor(){super(),this.add=fn.prototype.add.bind(this),this.delete=fn.prototype.delete.bind(this),this.get=fn.prototype.get.bind(this),this.has=fn.prototype.has.bind(this),this.set=fn.prototype.set.bind(this),this.tag=tl.tag}toJSON(n,s){if(!s)return super.toJSON(n);const a=new Map;s?.onCreate&&s.onCreate(a);for(const o of this.items){let c,u;if(it(o)?(c=Nn(o.key,"",s),u=Nn(o.value,c,s)):c=Nn(o,"",s),a.has(c))throw new Error("Ordered maps must not include duplicate keys");a.set(c,u)}return a}static from(n,s,a){const o=bS(n,s,a),c=new this;return c.items=o.items,c}}tl.tag="tag:yaml.org,2002:omap";const wm={collection:"seq",identify:e=>e instanceof Map,nodeClass:tl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,n){const s=vS(e,n),a=[];for(const{key:o}of s.items)Fe(o)&&(a.includes(o.value)?n(`Ordered maps must not include duplicate keys: ${o.value}`):a.push(o.value));return Object.assign(new tl,s)},createNode:(e,n,s)=>tl.from(e,n,s)};function SS({value:e,source:n},s){return n&&(e?wS:xS).test.test(n)?n:e?s.options.trueStr:s.options.falseStr}const wS={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new Ae(!0),stringify:SS},xS={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new Ae(!1),stringify:SS},sO={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:qn},aO={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const n=Number(e.value);return isFinite(n)?n.toExponential():qn(e)}},lO={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const n=new Ae(parseFloat(e.replace(/_/g,""))),s=e.indexOf(".");if(s!==-1){const a=e.substring(s+1).replace(/_/g,"");a[a.length-1]==="0"&&(n.minFractionDigits=a.length)}return n},stringify:qn},ar=e=>typeof e=="bigint"||Number.isInteger(e);function ju(e,n,s,{intAsBigInt:a}){const o=e[0];if((o==="-"||o==="+")&&(n+=1),e=e.substring(n).replace(/_/g,""),a){switch(s){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const u=BigInt(e);return o==="-"?BigInt(-1)*u:u}const c=parseInt(e,s);return o==="-"?-1*c:c}function xm(e,n,s){const{value:a}=e;if(ar(a)){const o=a.toString(n);return a<0?"-"+s+o.substr(1):s+o}return qn(e)}const oO={identify:ar,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,n,s)=>ju(e,2,2,s),stringify:e=>xm(e,2,"0b")},rO={identify:ar,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,n,s)=>ju(e,1,8,s),stringify:e=>xm(e,8,"0")},cO={identify:ar,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,n,s)=>ju(e,0,10,s),stringify:qn},uO={identify:ar,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,n,s)=>ju(e,2,16,s),stringify:e=>xm(e,16,"0x")};class nl extends fn{constructor(n){super(n),this.tag=nl.tag}add(n){let s;it(n)?s=n:n&&typeof n=="object"&&"key"in n&&"value"in n&&n.value===null?s=new Rt(n.key,null):s=new Rt(n,null),Us(this.items,s.key)||this.items.push(s)}get(n,s){const a=Us(this.items,n);return!s&&it(a)?Fe(a.key)?a.key.value:a.key:a}set(n,s){if(typeof s!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof s}`);const a=Us(this.items,n);a&&!s?this.items.splice(this.items.indexOf(a),1):!a&&s&&this.items.push(new Rt(n))}toJSON(n,s){return super.toJSON(n,s,Set)}toString(n,s,a){if(!n)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},n,{allNullValues:!0}),s,a);throw new Error("Set items must all have null values")}static from(n,s,a){const{replacer:o}=a,c=new this(n);if(s&&Symbol.iterator in Object(s))for(let u of s)typeof o=="function"&&(u=o.call(s,u,u)),c.items.push(gm(u,null,a));return c}}nl.tag="tag:yaml.org,2002:set";const Em={collection:"map",identify:e=>e instanceof Set,nodeClass:nl,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,n,s)=>nl.from(e,n,s),resolve(e,n){if(bl(e)){if(e.hasAllNullValues(!0))return Object.assign(new nl,e);n("Set items must all have null values")}else n("Expected a mapping for this tag");return e}};function Nm(e,n){const s=e[0],a=s==="-"||s==="+"?e.substring(1):e,o=u=>n?BigInt(u):Number(u),c=a.replace(/_/g,"").split(":").reduce((u,d)=>u*o(60)+o(d),o(0));return s==="-"?o(-1)*c:c}function ES(e){let{value:n}=e,s=u=>u;if(typeof n=="bigint")s=u=>BigInt(u);else if(isNaN(n)||!isFinite(n))return qn(e);let a="";n<0&&(a="-",n*=s(-1));const o=s(60),c=[n%o];return n<60?c.unshift(0):(n=(n-c[0])/o,c.unshift(n%o),n>=60&&(n=(n-c[0])/o,c.unshift(n))),a+c.map(u=>String(u).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const NS={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,n,{intAsBigInt:s})=>Nm(e,s),stringify:ES},_S={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>Nm(e,!1),stringify:ES},Du={identify:e=>e 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(e){const n=e.match(Du.test);if(!n)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,s,a,o,c,u,d]=n.map(Number),h=n[7]?Number((n[7]+"00").substr(1,3)):0;let p=Date.UTC(s,a-1,o,c||0,u||0,d||0,h);const v=n[8];if(v&&v!=="Z"){let g=Nm(v,!1);Math.abs(g)<30&&(g*=60),p-=6e4*g}return new Date(p)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Lv=[wl,xl,Ou,ku,wS,xS,oO,rO,cO,uO,sO,aO,lO,bm,Ci,wm,Sm,Em,NS,_S,Du],$v=new Map([["core",eO],["failsafe",[wl,xl,Ou]],["json",iO],["yaml11",Lv],["yaml-1.1",Lv]]),Hv={binary:bm,bool:ym,float:hS,floatExp:dS,floatNaN:fS,floatTime:_S,int:gS,intHex:yS,intOct:pS,intTime:NS,map:wl,merge:Ci,null:ku,omap:wm,pairs:Sm,seq:xl,set:Em,timestamp:Du},fO={"tag:yaml.org,2002:binary":bm,"tag:yaml.org,2002:merge":Ci,"tag:yaml.org,2002:omap":wm,"tag:yaml.org,2002:pairs":Sm,"tag:yaml.org,2002:set":Em,"tag:yaml.org,2002:timestamp":Du};function ph(e,n,s){const a=$v.get(n);if(a&&!e)return s&&!a.includes(Ci)?a.concat(Ci):a.slice();let o=a;if(!o)if(Array.isArray(e))o=[];else{const c=Array.from($v.keys()).filter(u=>u!=="yaml11").map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown schema "${n}"; use one of ${c} or define customTags array`)}if(Array.isArray(e))for(const c of e)o=o.concat(c);else typeof e=="function"&&(o=e(o.slice()));return s&&(o=o.concat(Ci)),o.reduce((c,u)=>{const d=typeof u=="string"?Hv[u]:u;if(!d){const h=JSON.stringify(u),p=Object.keys(Hv).map(v=>JSON.stringify(v)).join(", ");throw new Error(`Unknown custom tag ${h}; use one of ${p}`)}return c.includes(d)||c.push(d),c},[])}const dO=(e,n)=>e.key<n.key?-1:e.key>n.key?1:0;class Ru{constructor({compat:n,customTags:s,merge:a,resolveKnownTags:o,schema:c,sortMapEntries:u,toStringDefaults:d}){this.compat=Array.isArray(n)?ph(n,"compat"):n?ph(null,n):null,this.name=typeof c=="string"&&c||"core",this.knownTags=o?fO:{},this.tags=ph(s,this.name,a),this.toStringOptions=d??null,Object.defineProperty(this,ms,{value:wl}),Object.defineProperty(this,Pn,{value:Ou}),Object.defineProperty(this,vl,{value:xl}),this.sortMapEntries=typeof u=="function"?u:u===!0?dO:null}clone(){const n=Object.create(Ru.prototype,Object.getOwnPropertyDescriptors(this));return n.tags=this.tags.slice(),n}}function hO(e,n){const s=[];let a=n.directives===!0;if(n.directives!==!1&&e.directives){const h=e.directives.toString(e);h?(s.push(h),a=!0):e.directives.docStart&&(a=!0)}a&&s.push("---");const o=aS(e,n),{commentString:c}=o.options;if(e.commentBefore){s.length!==1&&s.unshift("");const h=c(e.commentBefore);s.unshift(Ti(h,""))}let u=!1,d=null;if(e.contents){if(ot(e.contents)){if(e.contents.spaceBefore&&a&&s.push(""),e.contents.commentBefore){const v=c(e.contents.commentBefore);s.push(Ti(v,""))}o.forceBlockIndent=!!e.comment,d=e.contents.comment}const h=d?void 0:()=>u=!0;let p=ml(e.contents,o,()=>d=null,h);d&&(p+=Hs(p,"",c(d))),(p[0]==="|"||p[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${p}`:s.push(p)}else s.push(ml(e.contents,o));if(e.directives?.docEnd)if(e.comment){const h=c(e.comment);h.includes(`
69
- `)?(s.push("..."),s.push(Ti(h,""))):s.push(`... ${h}`)}else s.push("...");else{let h=e.comment;h&&u&&(h=h.replace(/^\n+/,"")),h&&((!u||d)&&s[s.length-1]!==""&&s.push(""),s.push(Ti(c(h),"")))}return s.join(`
70
- `)+`
71
- `}class El{constructor(n,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,_n,{value:Lh});let o=null;typeof s=="function"||Array.isArray(s)?o=s:a===void 0&&s&&(a=s,s=void 0);const c=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},a);this.options=c;let{version:u}=c;a?._directives?(this.directives=a._directives.atDocument(),this.directives.yaml.explicit&&(u=this.directives.yaml.version)):this.directives=new $t({version:u}),this.setSchema(u,a),this.contents=n===void 0?null:this.createNode(n,o,a)}clone(){const n=Object.create(El.prototype,{[_n]:{value:Lh}});return n.commentBefore=this.commentBefore,n.comment=this.comment,n.errors=this.errors.slice(),n.warnings=this.warnings.slice(),n.options=Object.assign({},this.options),this.directives&&(n.directives=this.directives.clone()),n.schema=this.schema.clone(),n.contents=ot(this.contents)?this.contents.clone(n.schema):this.contents,this.range&&(n.range=this.range.slice()),n}add(n){Va(this.contents)&&this.contents.add(n)}addIn(n,s){Va(this.contents)&&this.contents.addIn(n,s)}createAlias(n,s){if(!n.anchor){const a=eS(this);n.anchor=!s||a.has(s)?tS(s||"a",a):s}return new Au(n.anchor)}createNode(n,s,a){let o;if(typeof s=="function")n=s.call({"":n},"",n),o=s;else if(Array.isArray(s)){const A=z=>typeof z=="number"||z instanceof String||z instanceof Number,C=s.filter(A).map(String);C.length>0&&(s=s.concat(C)),o=s}else a===void 0&&s&&(a=s,s=void 0);const{aliasDuplicateObjects:c,anchorPrefix:u,flow:d,keepUndefined:h,onTagObj:p,tag:v}=a??{},{onAnchor:g,setAnchors:y,sourceObjects:w}=IM(this,u||"a"),E={aliasDuplicateObjects:c??!0,keepUndefined:h??!1,onAnchor:g,onTagObj:p,replacer:o,schema:this.schema,sourceObjects:w},N=Xo(n,v,E);return d&&lt(N)&&(N.flow=!0),y(),N}createPair(n,s,a={}){const o=this.createNode(n,null,a),c=this.createNode(s,null,a);return new Rt(o,c)}delete(n){return Va(this.contents)?this.contents.delete(n):!1}deleteIn(n){return Co(n)?this.contents==null?!1:(this.contents=null,!0):Va(this.contents)?this.contents.deleteIn(n):!1}get(n,s){return lt(this.contents)?this.contents.get(n,s):void 0}getIn(n,s){return Co(n)?!s&&Fe(this.contents)?this.contents.value:this.contents:lt(this.contents)?this.contents.getIn(n,s):void 0}has(n){return lt(this.contents)?this.contents.has(n):!1}hasIn(n){return Co(n)?this.contents!==void 0:lt(this.contents)?this.contents.hasIn(n):!1}set(n,s){this.contents==null?this.contents=lu(this.schema,[n],s):Va(this.contents)&&this.contents.set(n,s)}setIn(n,s){Co(n)?this.contents=s:this.contents==null?this.contents=lu(this.schema,Array.from(n),s):Va(this.contents)&&this.contents.setIn(n,s)}setSchema(n,s={}){typeof n=="number"&&(n=String(n));let a;switch(n){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new $t({version:"1.1"}),a={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=n:this.directives=new $t({version:n}),a={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,a=null;break;default:{const o=JSON.stringify(n);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${o}`)}}if(s.schema instanceof Object)this.schema=s.schema;else if(a)this.schema=new Ru(Object.assign(a,s));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:n,jsonArg:s,mapAsMap:a,maxAliasCount:o,onAnchor:c,reviver:u}={}){const d={anchors:new Map,doc:this,keep:!n,mapAsMap:a===!0,mapKeyWarned:!1,maxAliasCount:typeof o=="number"?o:100},h=Nn(this.contents,s??"",d);if(typeof c=="function")for(const{count:p,res:v}of d.anchors.values())c(v,p);return typeof u=="function"?Fa(u,{"":h},"",h):h}toJSON(n,s){return this.toJS({json:!0,jsonArg:n,mapAsMap:!1,onAnchor:s})}toString(n={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in n&&(!Number.isInteger(n.indent)||Number(n.indent)<=0)){const s=JSON.stringify(n.indent);throw new Error(`"indent" option must be a positive integer, not ${s}`)}return hO(this,n)}}function Va(e){if(lt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class _m extends Error{constructor(n,s,a,o){super(),this.name=n,this.code=a,this.message=o,this.pos=s}}class Is extends _m{constructor(n,s,a){super("YAMLParseError",n,s,a)}}class AS extends _m{constructor(n,s,a){super("YAMLWarning",n,s,a)}}const ru=(e,n)=>s=>{if(s.pos[0]===-1)return;s.linePos=s.pos.map(d=>n.linePos(d));const{line:a,col:o}=s.linePos[0];s.message+=` at line ${a}, column ${o}`;let c=o-1,u=e.substring(n.lineStarts[a-1],n.lineStarts[a]).replace(/[\n\r]+$/,"");if(c>=60&&u.length>80){const d=Math.min(c-39,u.length-79);u="…"+u.substring(d),c-=d-1}if(u.length>80&&(u=u.substring(0,79)+"…"),a>1&&/^ *$/.test(u.substring(0,c))){let d=e.substring(n.lineStarts[a-2],n.lineStarts[a-1]);d.length>80&&(d=d.substring(0,79)+`…
72
- `),u=d+u}if(/[^ ]/.test(u)){let d=1;const h=s.linePos[1];h?.line===a&&h.col>o&&(d=Math.max(1,Math.min(h.col-o,80-c)));const p=" ".repeat(c)+"^".repeat(d);s.message+=`:
73
-
74
- ${u}
75
- ${p}
76
- `}};function pl(e,{flow:n,indicator:s,next:a,offset:o,onError:c,parentIndent:u,startOnNewline:d}){let h=!1,p=d,v=d,g="",y="",w=!1,E=!1,N=null,A=null,C=null,z=null,_=null,x=null,B=null;for(const D of e)switch(E&&(D.type!=="space"&&D.type!=="newline"&&D.type!=="comma"&&c(D.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),E=!1),N&&(p&&D.type!=="comment"&&D.type!=="newline"&&c(N,"TAB_AS_INDENT","Tabs are not allowed as indentation"),N=null),D.type){case"space":!n&&(s!=="doc-start"||a?.type!=="flow-collection")&&D.source.includes(" ")&&(N=D),v=!0;break;case"comment":{v||c(D,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const R=D.source.substring(1)||" ";g?g+=y+R:g=R,y="",p=!1;break}case"newline":p?g?g+=D.source:(!x||s!=="seq-item-ind")&&(h=!0):y+=D.source,p=!0,w=!0,(A||C)&&(z=D),v=!0;break;case"anchor":A&&c(D,"MULTIPLE_ANCHORS","A node can have at most one anchor"),D.source.endsWith(":")&&c(D.offset+D.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),A=D,B??(B=D.offset),p=!1,v=!1,E=!0;break;case"tag":{C&&c(D,"MULTIPLE_TAGS","A node can have at most one tag"),C=D,B??(B=D.offset),p=!1,v=!1,E=!0;break}case s:(A||C)&&c(D,"BAD_PROP_ORDER",`Anchors and tags must be after the ${D.source} indicator`),x&&c(D,"UNEXPECTED_TOKEN",`Unexpected ${D.source} in ${n??"collection"}`),x=D,p=s==="seq-item-ind"||s==="explicit-key-ind",v=!1;break;case"comma":if(n){_&&c(D,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),_=D,p=!1,v=!1;break}default:c(D,"UNEXPECTED_TOKEN",`Unexpected ${D.type} token`),p=!1,v=!1}const j=e[e.length-1],T=j?j.offset+j.source.length:o;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"),N&&(p&&N.indent<=u||a?.type==="block-map"||a?.type==="block-seq")&&c(N,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:_,found:x,spaceBefore:h,comment:g,hasNewline:w,anchor:A,tag:C,newlineAfterProp:z,end:T,start:B??T}}function Ko(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
77
- `))return!0;if(e.end){for(const n of e.end)if(n.type==="newline")return!0}return!1;case"flow-collection":for(const n of e.items){for(const s of n.start)if(s.type==="newline")return!0;if(n.sep){for(const s of n.sep)if(s.type==="newline")return!0}if(Ko(n.key)||Ko(n.value))return!0}return!1;default:return!0}}function Ih(e,n,s){if(n?.type==="flow-collection"){const a=n.end[0];a.indent===e&&(a.source==="]"||a.source==="}")&&Ko(n)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function TS(e,n,s){const{uniqueKeys:a}=e.options;if(a===!1)return!1;const o=typeof a=="function"?a:(c,u)=>c===u||Fe(c)&&Fe(u)&&c.value===u.value;return n.some(c=>o(c.key,s))}const Uv="All mapping items must start at the same column";function mO({composeNode:e,composeEmptyNode:n},s,a,o,c){const u=c?.nodeClass??fn,d=new u(s.schema);s.atRoot&&(s.atRoot=!1);let h=a.offset,p=null;for(const v of a.items){const{start:g,key:y,sep:w,value:E}=v,N=pl(g,{indicator:"explicit-key-ind",next:y??w?.[0],offset:h,onError:o,parentIndent:a.indent,startOnNewline:!0}),A=!N.found;if(A){if(y&&(y.type==="block-seq"?o(h,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in y&&y.indent!==a.indent&&o(h,"BAD_INDENT",Uv)),!N.anchor&&!N.tag&&!w){p=N.end,N.comment&&(d.comment?d.comment+=`
78
- `+N.comment:d.comment=N.comment);continue}(N.newlineAfterProp||Ko(y))&&o(y??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else N.found?.indent!==a.indent&&o(h,"BAD_INDENT",Uv);s.atKey=!0;const C=N.end,z=y?e(s,y,N,o):n(s,C,g,null,N,o);s.schema.compat&&Ih(a.indent,y,o),s.atKey=!1,TS(s,d.items,z)&&o(C,"DUPLICATE_KEY","Map keys must be unique");const _=pl(w??[],{indicator:"map-value-ind",next:E,offset:z.range[2],onError:o,parentIndent:a.indent,startOnNewline:!y||y.type==="block-scalar"});if(h=_.end,_.found){A&&(E?.type==="block-map"&&!_.hasNewline&&o(h,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&N.start<_.found.offset-1024&&o(z.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const x=E?e(s,E,_,o):n(s,h,w,null,_,o);s.schema.compat&&Ih(a.indent,E,o),h=x.range[2];const B=new Rt(z,x);s.options.keepSourceTokens&&(B.srcToken=v),d.items.push(B)}else{A&&o(z.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(z.comment?z.comment+=`
79
- `+_.comment:z.comment=_.comment);const x=new Rt(z);s.options.keepSourceTokens&&(x.srcToken=v),d.items.push(x)}}return p&&p<h&&o(p,"IMPOSSIBLE","Map comment with trailing content"),d.range=[a.offset,h,p??h],d}function pO({composeNode:e,composeEmptyNode:n},s,a,o,c){const u=c?.nodeClass??ps,d=new u(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let h=a.offset,p=null;for(const{start:v,value:g}of a.items){const y=pl(v,{indicator:"seq-item-ind",next:g,offset:h,onError:o,parentIndent:a.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||g)g?.type==="block-seq"?o(y.end,"BAD_INDENT","All sequence items must start at the same column"):o(h,"MISSING_CHAR","Sequence item without - indicator");else{p=y.end,y.comment&&(d.comment=y.comment);continue}const w=g?e(s,g,y,o):n(s,y.end,v,null,y,o);s.schema.compat&&Ih(a.indent,g,o),h=w.range[2],d.items.push(w)}return d.range=[a.offset,h,p??h],d}function lr(e,n,s,a){let o="";if(e){let c=!1,u="";for(const d of e){const{source:h,type:p}=d;switch(p){case"space":c=!0;break;case"comment":{s&&!c&&a(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const v=h.substring(1)||" ";o?o+=u+v:o=v,u="";break}case"newline":o&&(u+=h),c=!0;break;default:a(d,"UNEXPECTED_TOKEN",`Unexpected ${p} at node end`)}n+=h.length}}return{comment:o,offset:n}}const gh="Block collections are not allowed within flow collections",yh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function gO({composeNode:e,composeEmptyNode:n},s,a,o,c){const u=a.start.source==="{",d=u?"flow map":"flow sequence",h=c?.nodeClass??(u?fn:ps),p=new h(s.schema);p.flow=!0;const v=s.atRoot;v&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let g=a.offset+a.start.source.length;for(let A=0;A<a.items.length;++A){const C=a.items[A],{start:z,key:_,sep:x,value:B}=C,j=pl(z,{flow:d,indicator:"explicit-key-ind",next:_??x?.[0],offset:g,onError:o,parentIndent:a.indent,startOnNewline:!1});if(!j.found){if(!j.anchor&&!j.tag&&!x&&!B){A===0&&j.comma?o(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`):A<a.items.length-1&&o(j.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${d}`),j.comment&&(p.comment?p.comment+=`
80
- `+j.comment:p.comment=j.comment),g=j.end;continue}!u&&s.options.strict&&Ko(_)&&o(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(A===0)j.comma&&o(j.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`);else if(j.comma||o(j.start,"MISSING_CHAR",`Missing , between ${d} items`),j.comment){let T="";e:for(const D of z)switch(D.type){case"comma":case"space":break;case"comment":T=D.source.substring(1);break e;default:break e}if(T){let D=p.items[p.items.length-1];it(D)&&(D=D.value??D.key),D.comment?D.comment+=`
81
- `+T:D.comment=T,j.comment=j.comment.substring(T.length+1)}}if(!u&&!x&&!j.found){const T=B?e(s,B,j,o):n(s,j.end,x,null,j,o);p.items.push(T),g=T.range[2],yh(B)&&o(T.range,"BLOCK_IN_FLOW",gh)}else{s.atKey=!0;const T=j.end,D=_?e(s,_,j,o):n(s,T,z,null,j,o);yh(_)&&o(D.range,"BLOCK_IN_FLOW",gh),s.atKey=!1;const R=pl(x??[],{flow:d,indicator:"map-value-ind",next:B,offset:D.range[2],onError:o,parentIndent:a.indent,startOnNewline:!1});if(R.found){if(!u&&!j.found&&s.options.strict){if(x)for(const K of x){if(K===R.found)break;if(K.type==="newline"){o(K,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}j.start<R.found.offset-1024&&o(R.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else B&&("source"in B&&B.source?.[0]===":"?o(B,"MISSING_CHAR",`Missing space after : in ${d}`):o(R.start,"MISSING_CHAR",`Missing , or : between ${d} items`));const Z=B?e(s,B,R,o):R.found?n(s,R.end,x,null,R,o):null;Z?yh(B)&&o(Z.range,"BLOCK_IN_FLOW",gh):R.comment&&(D.comment?D.comment+=`
82
- `+R.comment:D.comment=R.comment);const Y=new Rt(D,Z);if(s.options.keepSourceTokens&&(Y.srcToken=C),u){const K=p;TS(s,K.items,D)&&o(T,"DUPLICATE_KEY","Map keys must be unique"),K.items.push(Y)}else{const K=new fn(s.schema);K.flow=!0,K.items.push(Y);const le=(Z??D).range;K.range=[D.range[0],le[1],le[2]],p.items.push(K)}g=Z?Z.range[2]:R.end}}const y=u?"}":"]",[w,...E]=a.end;let N=g;if(w?.source===y)N=w.offset+w.source.length;else{const A=d[0].toUpperCase()+d.substring(1),C=v?`${A} must end with a ${y}`:`${A} in block collection must be sufficiently indented and end with a ${y}`;o(g,v?"MISSING_CHAR":"BAD_INDENT",C),w&&w.source.length!==1&&E.unshift(w)}if(E.length>0){const A=lr(E,N,s.options.strict,o);A.comment&&(p.comment?p.comment+=`
83
- `+A.comment:p.comment=A.comment),p.range=[a.offset,N,A.offset]}else p.range=[a.offset,N,N];return p}function vh(e,n,s,a,o,c){const u=s.type==="block-map"?mO(e,n,s,a,c):s.type==="block-seq"?pO(e,n,s,a,c):gO(e,n,s,a,c),d=u.constructor;return o==="!"||o===d.tagName?(u.tag=d.tagName,u):(o&&(u.tag=o),u)}function yO(e,n,s,a,o){const c=a.tag,u=c?n.directives.tagName(c.source,y=>o(c,"TAG_RESOLVE_FAILED",y)):null;if(s.type==="block-seq"){const{anchor:y,newlineAfterProp:w}=a,E=y&&c?y.offset>c.offset?y:c:y??c;E&&(!w||w.offset<E.offset)&&o(E,"MISSING_CHAR","Missing newline after block sequence props")}const d=s.type==="block-map"?"map":s.type==="block-seq"?"seq":s.start.source==="{"?"map":"seq";if(!c||!u||u==="!"||u===fn.tagName&&d==="map"||u===ps.tagName&&d==="seq")return vh(e,n,s,o,u);let h=n.schema.tags.find(y=>y.tag===u&&y.collection===d);if(!h){const y=n.schema.knownTags[u];if(y?.collection===d)n.schema.tags.push(Object.assign({},y,{default:!1})),h=y;else return y?o(c,"BAD_COLLECTION_TYPE",`${y.tag} used for ${d} collection, but expects ${y.collection??"scalar"}`,!0):o(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${u}`,!0),vh(e,n,s,o,u)}const p=vh(e,n,s,o,u,h),v=h.resolve?.(p,y=>o(c,"TAG_RESOLVE_FAILED",y),n.options)??p,g=ot(v)?v:new Ae(v);return g.range=p.range,g.tag=u,h?.format&&(g.format=h.format),g}function CS(e,n,s){const a=n.offset,o=vO(n,e.options.strict,s);if(!o)return{value:"",type:null,comment:"",range:[a,a,a]};const c=o.mode===">"?Ae.BLOCK_FOLDED:Ae.BLOCK_LITERAL,u=n.source?bO(n.source):[];let d=u.length;for(let N=u.length-1;N>=0;--N){const A=u[N][1];if(A===""||A==="\r")d=N;else break}if(d===0){const N=o.chomp==="+"&&u.length>0?`
84
- `.repeat(Math.max(1,u.length-1)):"";let A=a+o.length;return n.source&&(A+=n.source.length),{value:N,type:c,comment:o.comment,range:[a,A,A]}}let h=n.indent+o.indent,p=n.offset+o.length,v=0;for(let N=0;N<d;++N){const[A,C]=u[N];if(C===""||C==="\r")o.indent===0&&A.length>h&&(h=A.length);else{A.length<h&&s(p+A.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),o.indent===0&&(h=A.length),v=N,h===0&&!e.atRoot&&s(p,"BAD_INDENT","Block scalar values in collections must be indented");break}p+=A.length+C.length+1}for(let N=u.length-1;N>=d;--N)u[N][0].length>h&&(d=N+1);let g="",y="",w=!1;for(let N=0;N<v;++N)g+=u[N][0].slice(h)+`
85
- `;for(let N=v;N<d;++N){let[A,C]=u[N];p+=A.length+C.length+1;const z=C[C.length-1]==="\r";if(z&&(C=C.slice(0,-1)),C&&A.length<h){const x=`Block scalar lines must not be less indented than their ${o.indent?"explicit indentation indicator":"first line"}`;s(p-C.length-(z?2:1),"BAD_INDENT",x),A=""}c===Ae.BLOCK_LITERAL?(g+=y+A.slice(h)+C,y=`
86
- `):A.length>h||C[0]===" "?(y===" "?y=`
87
- `:!w&&y===`
88
- `&&(y=`
89
-
90
- `),g+=y+A.slice(h)+C,y=`
91
- `,w=!0):C===""?y===`
92
- `?g+=`
93
- `:y=`
94
- `:(g+=y+C,y=" ",w=!1)}switch(o.chomp){case"-":break;case"+":for(let N=d;N<u.length;++N)g+=`
95
- `+u[N][0].slice(h);g[g.length-1]!==`
96
- `&&(g+=`
97
- `);break;default:g+=`
98
- `}const E=a+o.length+n.source.length;return{value:g,type:c,comment:o.comment,range:[a,E,E]}}function vO({offset:e,props:n},s,a){if(n[0].type!=="block-scalar-header")return a(n[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:o}=n[0],c=o[0];let u=0,d="",h=-1;for(let y=1;y<o.length;++y){const w=o[y];if(!d&&(w==="-"||w==="+"))d=w;else{const E=Number(w);!u&&E?u=E:h===-1&&(h=e+y)}}h!==-1&&a(h,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${o}`);let p=!1,v="",g=o.length;for(let y=1;y<n.length;++y){const w=n[y];switch(w.type){case"space":p=!0;case"newline":g+=w.source.length;break;case"comment":s&&!p&&a(w,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=w.source.length,v=w.source.substring(1);break;case"error":a(w,"UNEXPECTED_TOKEN",w.message),g+=w.source.length;break;default:{const E=`Unexpected token in block scalar header: ${w.type}`;a(w,"UNEXPECTED_TOKEN",E);const N=w.source;N&&typeof N=="string"&&(g+=N.length)}}}return{mode:c,indent:u,chomp:d,comment:v,length:g}}function bO(e){const n=e.split(/\n( *)/),s=n[0],a=s.match(/^( *)/),c=[a?.[1]?[a[1],s.slice(a[1].length)]:["",s]];for(let u=1;u<n.length;u+=2)c.push([n[u],n[u+1]]);return c}function MS(e,n,s){const{offset:a,type:o,source:c,end:u}=e;let d,h;const p=(y,w,E)=>s(a+y,w,E);switch(o){case"scalar":d=Ae.PLAIN,h=SO(c,p);break;case"single-quoted-scalar":d=Ae.QUOTE_SINGLE,h=wO(c,p);break;case"double-quoted-scalar":d=Ae.QUOTE_DOUBLE,h=xO(c,p);break;default:return s(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${o}`),{value:"",type:null,comment:"",range:[a,a+c.length,a+c.length]}}const v=a+c.length,g=lr(u,v,n,s);return{value:h,type:d,comment:g.comment,range:[a,v,g.offset]}}function SO(e,n){let s="";switch(e[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 ${e[0]}`;break}case"@":case"`":{s=`reserved character ${e[0]}`;break}}return s&&n(0,"BAD_SCALAR_START",`Plain value cannot start with ${s}`),OS(e)}function wO(e,n){return(e[e.length-1]!=="'"||e.length===1)&&n(e.length,"MISSING_CHAR","Missing closing 'quote"),OS(e.slice(1,-1)).replace(/''/g,"'")}function OS(e){let n,s;try{n=new RegExp(`(.*?)(?<![ ])[ ]*\r?
99
- `,"sy"),s=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
100
- `,"sy")}catch{n=/(.*?)[ \t]*\r?\n/sy,s=/[ \t]*(.*?)[ \t]*\r?\n/sy}let a=n.exec(e);if(!a)return e;let o=a[1],c=" ",u=n.lastIndex;for(s.lastIndex=u;a=s.exec(e);)a[1]===""?c===`
101
- `?o+=c:c=`
102
- `:(o+=c+a[1],c=" "),u=s.lastIndex;const d=/[ \t]*(.*)/sy;return d.lastIndex=u,a=d.exec(e),o+c+(a?.[1]??"")}function xO(e,n){let s="";for(let a=1;a<e.length-1;++a){const o=e[a];if(!(o==="\r"&&e[a+1]===`
103
- `))if(o===`
104
- `){const{fold:c,offset:u}=EO(e,a);s+=c,a=u}else if(o==="\\"){let c=e[++a];const u=NO[c];if(u)s+=u;else if(c===`
105
- `)for(c=e[a+1];c===" "||c===" ";)c=e[++a+1];else if(c==="\r"&&e[a+1]===`
106
- `)for(c=e[++a+1];c===" "||c===" ";)c=e[++a+1];else if(c==="x"||c==="u"||c==="U"){const d=c==="x"?2:c==="u"?4:8;s+=_O(e,a+1,d,n),a+=d}else{const d=e.substr(a-1,2);n(a-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${d}`),s+=d}}else if(o===" "||o===" "){const c=a;let u=e[a+1];for(;u===" "||u===" ";)u=e[++a+1];u!==`
107
- `&&!(u==="\r"&&e[a+2]===`
108
- `)&&(s+=a>c?e.slice(c,a+1):o)}else s+=o}return(e[e.length-1]!=='"'||e.length===1)&&n(e.length,"MISSING_CHAR",'Missing closing "quote'),s}function EO(e,n){let s="",a=e[n+1];for(;(a===" "||a===" "||a===`
109
- `||a==="\r")&&!(a==="\r"&&e[n+2]!==`
110
- `);)a===`
111
- `&&(s+=`
112
- `),n+=1,a=e[n+1];return s||(s=" "),{fold:s,offset:n}}const NO={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
113
- `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function _O(e,n,s,a){const o=e.substr(n,s),u=o.length===s&&/^[0-9a-fA-F]+$/.test(o)?parseInt(o,16):NaN;try{return String.fromCodePoint(u)}catch{const d=e.substr(n-2,s+2);return a(n-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${d}`),d}}function kS(e,n,s,a){const{value:o,type:c,comment:u,range:d}=n.type==="block-scalar"?CS(e,n,a):MS(n,e.options.strict,a),h=s?e.directives.tagName(s.source,g=>a(s,"TAG_RESOLVE_FAILED",g)):null;let p;e.options.stringKeys&&e.atKey?p=e.schema[Pn]:h?p=AO(e.schema,o,h,s,a):n.type==="scalar"?p=TO(e,o,n,a):p=e.schema[Pn];let v;try{const g=p.resolve(o,y=>a(s??n,"TAG_RESOLVE_FAILED",y),e.options);v=Fe(g)?g:new Ae(g)}catch(g){const y=g instanceof Error?g.message:String(g);a(s??n,"TAG_RESOLVE_FAILED",y),v=new Ae(o)}return v.range=d,v.source=o,c&&(v.type=c),h&&(v.tag=h),p.format&&(v.format=p.format),u&&(v.comment=u),v}function AO(e,n,s,a,o){if(s==="!")return e[Pn];const c=[];for(const d of e.tags)if(!d.collection&&d.tag===s)if(d.default&&d.test)c.push(d);else return d;for(const d of c)if(d.test?.test(n))return d;const u=e.knownTags[s];return u&&!u.collection?(e.tags.push(Object.assign({},u,{default:!1,test:void 0})),u):(o(a,"TAG_RESOLVE_FAILED",`Unresolved tag: ${s}`,s!=="tag:yaml.org,2002:str"),e[Pn])}function TO({atKey:e,directives:n,schema:s},a,o,c){const u=s.tags.find(d=>(d.default===!0||e&&d.default==="key")&&d.test?.test(a))||s[Pn];if(s.compat){const d=s.compat.find(h=>h.default&&h.test?.test(a))??s[Pn];if(u.tag!==d.tag){const h=n.tagString(u.tag),p=n.tagString(d.tag),v=`Value may be parsed as either ${h} or ${p}`;c(o,"TAG_RESOLVE_FAILED",v,!0)}}return u}function CO(e,n,s){if(n){s??(s=n.length);for(let a=s-1;a>=0;--a){let o=n[a];switch(o.type){case"space":case"comment":case"newline":e-=o.source.length;continue}for(o=n[++a];o?.type==="space";)e+=o.source.length,o=n[++a];break}}return e}const MO={composeNode:zS,composeEmptyNode:Am};function zS(e,n,s,a){const o=e.atKey,{spaceBefore:c,comment:u,anchor:d,tag:h}=s;let p,v=!0;switch(n.type){case"alias":p=OO(e,n,a),(d||h)&&a(n,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":p=kS(e,n,h,a),d&&(p.anchor=d.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{p=yO(MO,e,n,s,a),d&&(p.anchor=d.source.substring(1))}catch(g){const y=g instanceof Error?g.message:String(g);a(n,"RESOURCE_EXHAUSTION",y)}break;default:{const g=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;a(n,"UNEXPECTED_TOKEN",g),v=!1}}return p??(p=Am(e,n.offset,void 0,null,s,a)),d&&p.anchor===""&&a(d,"BAD_ALIAS","Anchor cannot be an empty string"),o&&e.options.stringKeys&&(!Fe(p)||typeof p.value!="string"||p.tag&&p.tag!=="tag:yaml.org,2002:str")&&a(h??n,"NON_STRING_KEY","With stringKeys, all keys must be strings"),c&&(p.spaceBefore=!0),u&&(n.type==="scalar"&&n.source===""?p.comment=u:p.commentBefore=u),e.options.keepSourceTokens&&v&&(p.srcToken=n),p}function Am(e,n,s,a,{spaceBefore:o,comment:c,anchor:u,tag:d,end:h},p){const v={type:"scalar",offset:CO(n,s,a),indent:-1,source:""},g=kS(e,v,d,p);return u&&(g.anchor=u.source.substring(1),g.anchor===""&&p(u,"BAD_ALIAS","Anchor cannot be an empty string")),o&&(g.spaceBefore=!0),c&&(g.comment=c,g.range[2]=h),g}function OO({options:e},{offset:n,source:s,end:a},o){const c=new Au(s.substring(1));c.source===""&&o(n,"BAD_ALIAS","Alias cannot be an empty string"),c.source.endsWith(":")&&o(n+s.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const u=n+s.length,d=lr(a,u,e.strict,o);return c.range=[n,u,d.offset],d.comment&&(c.comment=d.comment),c}function kO(e,n,{offset:s,start:a,value:o,end:c},u){const d=Object.assign({_directives:n},e),h=new El(void 0,d),p={atKey:!1,atRoot:!0,directives:h.directives,options:h.options,schema:h.schema},v=pl(a,{indicator:"doc-start",next:o??c?.[0],offset:s,onError:u,parentIndent:0,startOnNewline:!0});v.found&&(h.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!v.hasNewline&&u(v.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),h.contents=o?zS(p,o,v,u):Am(p,v.end,a,null,v,u);const g=h.contents.range[2],y=lr(c,g,!1,u);return y.comment&&(h.comment=y.comment),h.range=[s,g,y.offset],h}function _o(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:n,source:s}=e;return[n,n+(typeof s=="string"?s.length:1)]}function Iv(e){let n="",s=!1,a=!1;for(let o=0;o<e.length;++o){const c=e[o];switch(c[0]){case"#":n+=(n===""?"":a?`
114
-
115
- `:`
116
- `)+(c.substring(1)||" "),s=!0,a=!1;break;case"%":e[o+1]?.[0]!=="#"&&(o+=1),s=!1;break;default:s||(a=!0),s=!1}}return{comment:n,afterEmptyLine:a}}class Tm{constructor(n={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,o,c)=>{const u=_o(s);c?this.warnings.push(new AS(u,a,o)):this.errors.push(new Is(u,a,o))},this.directives=new $t({version:n.version||"1.2"}),this.options=n}decorate(n,s){const{comment:a,afterEmptyLine:o}=Iv(this.prelude);if(a){const c=n.contents;if(s)n.comment=n.comment?`${n.comment}
117
- ${a}`:a;else if(o||n.directives.docStart||!c)n.commentBefore=a;else if(lt(c)&&!c.flow&&c.items.length>0){let u=c.items[0];it(u)&&(u=u.key);const d=u.commentBefore;u.commentBefore=d?`${a}
118
- ${d}`:a}else{const u=c.commentBefore;c.commentBefore=u?`${a}
119
- ${u}`:a}}if(s){for(let c=0;c<this.errors.length;++c)n.errors.push(this.errors[c]);for(let c=0;c<this.warnings.length;++c)n.warnings.push(this.warnings[c])}else n.errors=this.errors,n.warnings=this.warnings;this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Iv(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(n,s=!1,a=-1){for(const o of n)yield*this.next(o);yield*this.end(s,a)}*next(n){switch(n.type){case"directive":this.directives.add(n.source,(s,a,o)=>{const c=_o(n);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,o)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{const s=kO(this.options,this.directives,n,this.onError);this.atDirectives&&!s.directives.docStart&&this.onError(n,"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(n.source);break;case"error":{const s=n.source?`${n.message}: ${JSON.stringify(n.source)}`:n.message,a=new Is(_o(n),"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 Is(_o(n),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=lr(n.end,n.offset+n.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 Is(_o(n),"UNEXPECTED_TOKEN",`Unsupported token ${n.type}`))}}*end(n=!1,s=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(n){const a=Object.assign({_directives:this.directives},this.options),o=new El(void 0,a);this.atDirectives&&this.onError(s,"MISSING_CHAR","Missing directives-end indicator line"),o.range=[0,s,s],this.decorate(o,!1),yield o}}}function zO(e,n=!0,s){if(e){const a=(o,c,u)=>{const d=typeof o=="number"?o:Array.isArray(o)?o[0]:o.offset;if(s)s(d,c,u);else throw new Is([d,d+1],c,u)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return MS(e,n,a);case"block-scalar":return CS({options:{strict:n}},e,a)}}return null}function jO(e,n){const{implicitKey:s=!1,indent:a,inFlow:o=!1,offset:c=-1,type:u="PLAIN"}=n,d=sr({type:u,value:e},{implicitKey:s,indent:a>0?" ".repeat(a):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}}),h=n.end??[{type:"newline",offset:-1,indent:a,source:`
121
- `}];switch(d[0]){case"|":case">":{const p=d.indexOf(`
122
- `),v=d.substring(0,p),g=d.substring(p+1)+`
123
- `,y=[{type:"block-scalar-header",offset:c,indent:a,source:v}];return jS(y,h)||y.push({type:"newline",offset:-1,indent:a,source:`
124
- `}),{type:"block-scalar",offset:c,indent:a,props:y,source:g}}case'"':return{type:"double-quoted-scalar",offset:c,indent:a,source:d,end:h};case"'":return{type:"single-quoted-scalar",offset:c,indent:a,source:d,end:h};default:return{type:"scalar",offset:c,indent:a,source:d,end:h}}}function DO(e,n,s={}){let{afterKey:a=!1,implicitKey:o=!1,inFlow:c=!1,type:u}=s,d="indent"in e?e.indent:null;if(a&&typeof d=="number"&&(d+=2),!u)switch(e.type){case"single-quoted-scalar":u="QUOTE_SINGLE";break;case"double-quoted-scalar":u="QUOTE_DOUBLE";break;case"block-scalar":{const p=e.props[0];if(p.type!=="block-scalar-header")throw new Error("Invalid block scalar header");u=p.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:u="PLAIN"}const h=sr({type:u,value:n},{implicitKey:o||d===null,indent:d!==null&&d>0?" ".repeat(d):"",inFlow:c,options:{blockQuote:!0,lineWidth:-1}});switch(h[0]){case"|":case">":RO(e,h);break;case'"':bh(e,h,"double-quoted-scalar");break;case"'":bh(e,h,"single-quoted-scalar");break;default:bh(e,h,"scalar")}}function RO(e,n){const s=n.indexOf(`
125
- `),a=n.substring(0,s),o=n.substring(s+1)+`
126
- `;if(e.type==="block-scalar"){const c=e.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");c.source=a,e.source=o}else{const{offset:c}=e,u="indent"in e?e.indent:-1,d=[{type:"block-scalar-header",offset:c,indent:u,source:a}];jS(d,"end"in e?e.end:void 0)||d.push({type:"newline",offset:-1,indent:u,source:`
127
- `});for(const h of Object.keys(e))h!=="type"&&h!=="offset"&&delete e[h];Object.assign(e,{type:"block-scalar",indent:u,props:d,source:o})}}function jS(e,n){if(n)for(const s of n)switch(s.type){case"space":case"comment":e.push(s);break;case"newline":return e.push(s),!0}return!1}function bh(e,n,s){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=s,e.source=n;break;case"block-scalar":{const a=e.props.slice(1);let o=n.length;e.props[0].type==="block-scalar-header"&&(o-=e.props[0].source.length);for(const c of a)c.offset+=o;delete e.props,Object.assign(e,{type:s,source:n,end:a});break}case"block-map":case"block-seq":{const o={type:"newline",offset:e.offset+n.length,indent:e.indent,source:`
128
- `};delete e.items,Object.assign(e,{type:s,source:n,end:[o]});break}default:{const a="indent"in e?e.indent:-1,o="end"in e&&Array.isArray(e.end)?e.end.filter(c=>c.type==="space"||c.type==="comment"||c.type==="newline"):[];for(const c of Object.keys(e))c!=="type"&&c!=="offset"&&delete e[c];Object.assign(e,{type:s,indent:a,source:n,end:o})}}}const BO=e=>"type"in e?cu(e):Kc(e);function cu(e){switch(e.type){case"block-scalar":{let n="";for(const s of e.props)n+=cu(s);return n+e.source}case"block-map":case"block-seq":{let n="";for(const s of e.items)n+=Kc(s);return n}case"flow-collection":{let n=e.start.source;for(const s of e.items)n+=Kc(s);for(const s of e.end)n+=s.source;return n}case"document":{let n=Kc(e);if(e.end)for(const s of e.end)n+=s.source;return n}default:{let n=e.source;if("end"in e&&e.end)for(const s of e.end)n+=s.source;return n}}}function Kc({start:e,key:n,sep:s,value:a}){let o="";for(const c of e)o+=c.source;if(n&&(o+=cu(n)),s)for(const c of s)o+=c.source;return a&&(o+=cu(a)),o}const qh=Symbol("break visit"),LO=Symbol("skip children"),DS=Symbol("remove item");function Zs(e,n){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),RS(Object.freeze([]),e,n)}Zs.BREAK=qh;Zs.SKIP=LO;Zs.REMOVE=DS;Zs.itemAtPath=(e,n)=>{let s=e;for(const[a,o]of n){const c=s?.[a];if(c&&"items"in c)s=c.items[o];else return}return s};Zs.parentCollection=(e,n)=>{const s=Zs.itemAtPath(e,n.slice(0,-1)),a=n[n.length-1][0],o=s?.[a];if(o&&"items"in o)return o;throw new Error("Parent collection not found")};function RS(e,n,s){let a=s(n,e);if(typeof a=="symbol")return a;for(const o of["key","value"]){const c=n[o];if(c&&"items"in c){for(let u=0;u<c.items.length;++u){const d=RS(Object.freeze(e.concat([[o,u]])),c.items[u],s);if(typeof d=="number")u=d-1;else{if(d===qh)return qh;d===DS&&(c.items.splice(u,1),u-=1)}}typeof a=="function"&&o==="key"&&(a=a(n,e))}}return typeof a=="function"?a(n,e):a}const Bu="\uFEFF",Lu="",$u="",Qo="",$O=e=>!!e&&"items"in e,HO=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function UO(e){switch(e){case Bu:return"<BOM>";case Lu:return"<DOC>";case $u:return"<FLOW_END>";case Qo:return"<SCALAR>";default:return JSON.stringify(e)}}function BS(e){switch(e){case Bu:return"byte-order-mark";case Lu:return"doc-mode";case $u:return"flow-error-end";case Qo: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(e[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 IO=Object.freeze(Object.defineProperty({__proto__:null,BOM:Bu,DOCUMENT:Lu,FLOW_END:$u,SCALAR:Qo,createScalarToken:jO,isCollection:$O,isScalar:HO,prettyToken:UO,resolveAsScalar:zO,setScalarValue:DO,stringify:BO,tokenType:BS,visit:Zs},Symbol.toStringTag,{value:"Module"}));function zn(e){switch(e){case void 0:case" ":case`
131
- `:case"\r":case" ":return!0;default:return!1}}const qv=new Set("0123456789ABCDEFabcdef"),qO=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Bc=new Set(",[]{}"),VO=new Set(` ,[]{}
132
- \r `),Sh=e=>!e||VO.has(e);class LS{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(n,s=!1){if(n){if(typeof n!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+n:n,this.lineEndPos=null}this.atEnd=!s;let a=this.next??"stream";for(;a&&(s||this.hasChars(1));)a=yield*this.parseNext(a)}atLineEnd(){let n=this.pos,s=this.buffer[n];for(;s===" "||s===" ";)s=this.buffer[++n];return!s||s==="#"||s===`
133
- `?!0:s==="\r"?this.buffer[n+1]===`
134
- `:!1}charAt(n){return this.buffer[this.pos+n]}continueScalar(n){let s=this.buffer[n];if(this.indentNext>0){let a=0;for(;s===" ";)s=this.buffer[++a+n];if(s==="\r"){const o=this.buffer[a+n+1];if(o===`
135
- `||!o&&!this.atEnd)return n+a+1}return s===`
136
- `||a>=this.indentNext||!s&&!this.atEnd?n+a:-1}if(s==="-"||s==="."){const a=this.buffer.substr(n,3);if((a==="---"||a==="...")&&zn(this.buffer[n+3]))return-1}return n}getLine(){let n=this.lineEndPos;return(typeof n!="number"||n!==-1&&n<this.pos)&&(n=this.buffer.indexOf(`
137
- `,this.pos),this.lineEndPos=n),n===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[n-1]==="\r"&&(n-=1),this.buffer.substring(this.pos,n))}hasChars(n){return this.pos+n<=this.buffer.length}setNext(n){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=n,null}peek(n){return this.buffer.substr(this.pos,n)}*parseNext(n){switch(n){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 n=this.getLine();if(n===null)return this.setNext("stream");if(n[0]===Bu&&(yield*this.pushCount(1),n=n.substring(1)),n[0]==="%"){let s=n.length,a=n.indexOf("#");for(;a!==-1;){const c=n[a-1];if(c===" "||c===" "){s=a-1;break}else a=n.indexOf("#",a+1)}for(;;){const c=n[s-1];if(c===" "||c===" ")s-=1;else break}const o=(yield*this.pushCount(s))+(yield*this.pushSpaces(!0));return yield*this.pushCount(n.length-o),this.pushNewline(),"stream"}if(this.atLineEnd()){const s=yield*this.pushSpaces(!0);return yield*this.pushCount(n.length-s),yield*this.pushNewline(),"stream"}return yield Lu,yield*this.parseLineStart()}*parseLineStart(){const n=this.charAt(0);if(!n&&!this.atEnd)return this.setNext("line-start");if(n==="-"||n==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const s=this.peek(3);if((s==="---"||s==="...")&&zn(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&&!zn(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[n,s]=this.peek(2);if(!s&&!this.atEnd)return this.setNext("block-start");if((n==="-"||n==="?"||n===":")&&zn(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 n=this.getLine();if(n===null)return this.setNext("doc");let s=yield*this.pushIndicators();switch(n[s]){case"#":yield*this.pushCount(n.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(n.length-s),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let n,s,a=-1;do n=yield*this.pushNewline(),n>0?(s=yield*this.pushSpaces(!1),this.indentValue=a=s):s=0,s+=yield*this.pushSpaces(!0);while(n+s>0);const o=this.getLine();if(o===null)return this.setNext("flow");if((a!==-1&&a<this.indentNext&&o[0]!=="#"||a===0&&(o.startsWith("---")||o.startsWith("..."))&&zn(o[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(o[0]==="]"||o[0]==="}")))return this.flowLevel=0,yield $u,yield*this.parseLineStart();let c=0;for(;o[c]===",";)c+=yield*this.pushCount(1),c+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(c+=yield*this.pushIndicators(),o[c]){case void 0:return"flow";case"#":return yield*this.pushCount(o.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||zn(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 n=this.charAt(0);let s=this.buffer.indexOf(n,this.pos+1);if(n==="'")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 o=a.indexOf(`
138
- `,this.pos);if(o!==-1){for(;o!==-1;){const c=this.continueScalar(o+1);if(c===-1)break;o=a.indexOf(`
139
- `,c)}o!==-1&&(s=o-(a[o-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 n=this.pos;for(;;){const s=this.buffer[++n];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=>zn(s)||s==="#")}*parseBlockScalar(){let n=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
- `:n=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(n+1);if(c===-1)break;n=this.buffer.indexOf(`
142
- `,c)}while(n!==-1);if(n===-1){if(!this.atEnd)return this.setNext("block-scalar");n=this.buffer.length}}let o=n+1;for(a=this.buffer[o];a===" ";)a=this.buffer[++o];if(a===" "){for(;a===" "||a===" "||a==="\r"||a===`
143
- `;)a=this.buffer[++o];n=o-1}else if(!this.blockScalarKeep)do{let c=n-1,u=this.buffer[c];u==="\r"&&(u=this.buffer[--c]);const d=c;for(;u===" ";)u=this.buffer[--c];if(u===`
144
- `&&c>=this.pos&&c+1+s>d)n=c;else break}while(!0);return yield Qo,yield*this.pushToIndex(n+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const n=this.flowLevel>0;let s=this.pos-1,a=this.pos-1,o;for(;o=this.buffer[++a];)if(o===":"){const c=this.buffer[a+1];if(zn(c)||n&&Bc.has(c))break;s=a}else if(zn(o)){let c=this.buffer[a+1];if(o==="\r"&&(c===`
145
- `?(a+=1,o=`
146
- `,c=this.buffer[a+1]):s=a),c==="#"||n&&Bc.has(c))break;if(o===`
147
- `){const u=this.continueScalar(a+1);if(u===-1)break;a=Math.max(a,u-2)}}else{if(n&&Bc.has(o))break;s=a}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield Qo,yield*this.pushToIndex(s+1,!0),n?"flow":"doc")}*pushCount(n){return n>0?(yield this.buffer.substr(this.pos,n),this.pos+=n,n):0}*pushToIndex(n,s){const a=this.buffer.slice(this.pos,n);return a?(yield a,this.pos+=a.length,a.length):(s&&(yield""),0)}*pushIndicators(){let n=0;e:for(;;){switch(this.charAt(0)){case"!":n+=yield*this.pushTag(),n+=yield*this.pushSpaces(!0);continue e;case"&":n+=yield*this.pushUntil(Sh),n+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const s=this.flowLevel>0,a=this.charAt(1);if(zn(a)||s&&Bc.has(a)){s?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,n+=yield*this.pushCount(1),n+=yield*this.pushSpaces(!0);continue e}}}break e}return n}*pushTag(){if(this.charAt(1)==="<"){let n=this.pos+2,s=this.buffer[n];for(;!zn(s)&&s!==">";)s=this.buffer[++n];return yield*this.pushToIndex(s===">"?n+1:n,!1)}else{let n=this.pos+1,s=this.buffer[n];for(;s;)if(qO.has(s))s=this.buffer[++n];else if(s==="%"&&qv.has(this.buffer[n+1])&&qv.has(this.buffer[n+2]))s=this.buffer[n+=3];else break;return yield*this.pushToIndex(n,!1)}}*pushNewline(){const n=this.buffer[this.pos];return n===`
148
- `?yield*this.pushCount(1):n==="\r"&&this.charAt(1)===`
149
- `?yield*this.pushCount(2):0}*pushSpaces(n){let s=this.pos-1,a;do a=this.buffer[++s];while(a===" "||n&&a===" ");const o=s-this.pos;return o>0&&(yield this.buffer.substr(this.pos,o),this.pos=s),o}*pushUntil(n){let s=this.pos,a=this.buffer[s];for(;!n(a);)a=this.buffer[++s];return yield*this.pushToIndex(s,!1)}}class $S{constructor(){this.lineStarts=[],this.addNewLine=n=>this.lineStarts.push(n),this.linePos=n=>{let s=0,a=this.lineStarts.length;for(;s<a;){const c=s+a>>1;this.lineStarts[c]<n?s=c+1:a=c}if(this.lineStarts[s]===n)return{line:s+1,col:1};if(s===0)return{line:0,col:n};const o=this.lineStarts[s-1];return{line:s,col:n-o+1}}}}function fs(e,n){for(let s=0;s<e.length;++s)if(e[s].type===n)return!0;return!1}function Vv(e){for(let n=0;n<e.length;++n)switch(e[n].type){case"space":case"comment":case"newline":break;default:return n}return-1}function HS(e){switch(e?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function Lc(e){switch(e.type){case"document":return e.start;case"block-map":{const n=e.items[e.items.length-1];return n.sep??n.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function Ya(e){if(e.length===0)return[];let n=e.length;e:for(;--n>=0;)switch(e[n].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;e[++n]?.type==="space";);return e.splice(n,e.length)}function uu(e,n){if(n.length<1e5)Array.prototype.push.apply(e,n);else for(let s=0;s<n.length;++s)e.push(n[s])}function Yv(e){if(e.start.type==="flow-seq-start")for(const n of e.items)n.sep&&!n.value&&!fs(n.start,"explicit-key-ind")&&!fs(n.sep,"map-value-ind")&&(n.key&&(n.value=n.key),delete n.key,HS(n.value)?n.value.end?uu(n.value.end,n.sep):n.value.end=n.sep:uu(n.start,n.sep),delete n.sep)}class Cm{constructor(n){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new LS,this.onNewLine=n}*parse(n,s=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const a of this.lexer.lex(n,s))yield*this.next(a);s||(yield*this.end())}*next(n){if(this.source=n,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=n.length;return}const s=BS(n);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+n.length);break;case"space":this.atNewLine&&n[0]===" "&&(this.indent+=n.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=n.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=n.length}else{const a=`Not a YAML token: ${n}`;yield*this.pop({type:"error",offset:this.offset,message:a,source:n}),this.offset+=n.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 n=this.peek(1);if(this.type==="doc-end"&&n?.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(!n)return yield*this.stream();switch(n.type){case"document":return yield*this.document(n);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(n);case"block-scalar":return yield*this.blockScalar(n);case"block-map":return yield*this.blockMap(n);case"block-seq":return yield*this.blockSequence(n);case"flow-collection":return yield*this.flowCollection(n);case"doc-end":return yield*this.documentEnd(n)}yield*this.pop()}peek(n){return this.stack[this.stack.length-n]}*pop(n){const s=n??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"&&Yv(s),a.type){case"document":a.value=s;break;case"block-scalar":a.props.push(s);break;case"block-map":{const o=a.items[a.items.length-1];if(o.value){a.items.push({start:[],key:s,sep:[]}),this.onKeyLine=!0;return}else if(o.sep)o.value=s;else{Object.assign(o,{key:s,sep:[]}),this.onKeyLine=!o.explicitKey;return}break}case"block-seq":{const o=a.items[a.items.length-1];o.value?a.items.push({start:[],value:s}):o.value=s;break}case"flow-collection":{const o=a.items[a.items.length-1];!o||o.value?a.items.push({start:[],key:s,sep:[]}):o.sep?o.value=s:Object.assign(o,{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 o=s.items[s.items.length-1];o&&!o.sep&&!o.value&&o.start.length>0&&Vv(o.start)===-1&&(s.indent===0||o.start.every(c=>c.type!=="comment"||c.indent<s.indent))&&(a.type==="document"?a.end=o.start:a.items.push({start:o.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 n={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&n.start.push(this.sourceToken),this.stack.push(n);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(n){if(n.value)return yield*this.lineEnd(n);switch(this.type){case"doc-start":{Vv(n.start)!==-1?(yield*this.pop(),yield*this.step()):n.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":n.start.push(this.sourceToken);return}const s=this.startBlockValue(n);s?this.stack.push(s):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(n){if(this.type==="map-value-ind"){const s=Lc(this.peek(2)),a=Ya(s);let o;n.end?(o=n.end,o.push(this.sourceToken),delete n.end):o=[this.sourceToken];const c={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:a,key:n,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=c}else yield*this.lineEnd(n)}*blockScalar(n){switch(this.type){case"space":case"comment":case"newline":n.props.push(this.sourceToken);return;case"scalar":if(n.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(n){const s=n.items[n.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):n.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)n.items.push({start:[this.sourceToken]});else if(s.sep)s.sep.push(this.sourceToken);else{if(this.atIndentedComment(s.start,n.indent)){const o=n.items[n.items.length-2]?.value?.end;if(Array.isArray(o)){uu(o,s.start),o.push(this.sourceToken),n.items.pop();return}}s.start.push(this.sourceToken)}return}if(this.indent>=n.indent){const a=!this.onKeyLine&&this.indent===n.indent,o=a&&(s.sep||s.explicitKey)&&this.type!=="seq-item-ind";let c=[];if(o&&s.sep&&!s.value){const u=[];for(let d=0;d<s.sep.length;++d){const h=s.sep[d];switch(h.type){case"newline":u.push(d);break;case"space":break;case"comment":h.indent>n.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":o||s.value?(c.push(this.sourceToken),n.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):o||s.value?(c.push(this.sourceToken),n.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)n.items.push({start:[],key:null,sep:[this.sourceToken]});else if(fs(s.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:c,key:null,sep:[this.sourceToken]}]});else if(HS(s.key)&&!fs(s.sep,"newline")){const u=Ya(s.start),d=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:d,sep:h}]})}else c.length>0?s.sep=s.sep.concat(c,this.sourceToken):s.sep.push(this.sourceToken);else if(fs(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const u=Ya(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||o?n.items.push({start:c,key:null,sep:[this.sourceToken]}):fs(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);o||s.value?(n.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(n);if(u){if(u.type==="block-seq"){if(!s.explicitKey&&s.sep&&!fs(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&&n.items.push({start:c});this.stack.push(u);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(n){const s=n.items[n.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):n.items.push({start:[this.sourceToken]})}else s.start.push(this.sourceToken);return;case"space":case"comment":if(s.value)n.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(s.start,n.indent)){const o=n.items[n.items.length-2]?.value?.end;if(Array.isArray(o)){uu(o,s.start),o.push(this.sourceToken),n.items.pop();return}}s.start.push(this.sourceToken)}return;case"anchor":case"tag":if(s.value||this.indent<=n.indent)break;s.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==n.indent)break;s.value||fs(s.start,"seq-item-ind")?n.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return}if(this.indent>n.indent){const a=this.startBlockValue(n);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(n){const s=n.items[n.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(n.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!s||s.sep?n.items.push({start:[this.sourceToken]}):s.start.push(this.sourceToken);return;case"map-value-ind":!s||s.value?n.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?n.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 o=this.flowScalar(this.type);!s||s.value?n.items.push({start:[],key:o,sep:[]}):s.sep?this.stack.push(o):Object.assign(s,{key:o,sep:[]});return}case"flow-map-end":case"flow-seq-end":n.end.push(this.sourceToken);return}const a=this.startBlockValue(n);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===n.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 o=Lc(a),c=Ya(o);Yv(n);const u=n.end.splice(1,n.end.length);u.push(this.sourceToken);const d={type:"block-map",offset:n.offset,indent:n.indent,items:[{start:c,key:n,sep:u}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=d}else yield*this.lineEnd(n)}}flowScalar(n){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:n,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(n){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=Lc(n),a=Ya(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=Lc(n),a=Ya(s);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(n,s){return this.type!=="comment"||this.indent<=s?!1:n.every(a=>a.type==="newline"||a.type==="space")}*documentEnd(n){this.type!=="doc-mode"&&(n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(n){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:n.end?n.end.push(this.sourceToken):n.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function US(e){const n=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||n&&new $S||null,prettyErrors:n}}function YO(e,n={}){const{lineCounter:s,prettyErrors:a}=US(n),o=new Cm(s?.addNewLine),c=new Tm(n),u=Array.from(c.compose(o.parse(e)));if(a&&s)for(const d of u)d.errors.forEach(ru(e,s)),d.warnings.forEach(ru(e,s));return u.length>0?u:Object.assign([],{empty:!0},c.streamInfo())}function IS(e,n={}){const{lineCounter:s,prettyErrors:a}=US(n),o=new Cm(s?.addNewLine),c=new Tm(n);let u=null;for(const d of c.compose(o.parse(e),!0,e.length))if(!u)u=d;else if(u.options.logLevel!=="silent"){u.errors.push(new Is(d.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return a&&s&&(u.errors.forEach(ru(e,s)),u.warnings.forEach(ru(e,s))),u}function GO(e,n,s){let a;typeof n=="function"?a=n:s===void 0&&n&&typeof n=="object"&&(s=n);const o=IS(e,s);if(!o)return null;if(o.warnings.forEach(c=>lS(o.options.logLevel,c)),o.errors.length>0){if(o.options.logLevel!=="silent")throw o.errors[0];o.errors=[]}return o.toJS(Object.assign({reviver:a},s))}function XO(e,n,s){let a=null;if(typeof n=="function"||Array.isArray(n)?a=n:s===void 0&&n&&(s=n),typeof s=="string"&&(s=s.length),typeof s=="number"){const o=Math.round(s);s=o<1?void 0:o>8?{indent:8}:{indent:o}}if(e===void 0){const{keepUndefined:o}=s??n??{};if(!o)return}return Ws(e)&&!a?e.toString(s):new El(e,a,s).toString(s)}const ea=Object.freeze(Object.defineProperty({__proto__:null,Alias:Au,CST:IO,Composer:Tm,Document:El,Lexer:LS,LineCounter:$S,Pair:Rt,Parser:Cm,Scalar:Ae,Schema:Ru,YAMLError:_m,YAMLMap:fn,YAMLParseError:Is,YAMLSeq:ps,YAMLWarning:AS,isAlias:Js,isCollection:lt,isDocument:Ws,isMap:bl,isNode:ot,isPair:it,isScalar:Fe,isSeq:Sl,parse:GO,parseAllDocuments:YO,parseDocument:IS,stringify:XO,visit:Ps,visitAsync:_u},Symbol.toStringTag,{value:"Module"}));function Mo(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function jn(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function KO(e,n,s){let a;try{a=ea.parse(e)}catch(c){return[{check:"F1",path:n,message:`Invalid YAML: ${c instanceof Error?c.message:String(c)}`}]}if(!Mo(a))return[];const o=[];return a.kind!==void 0&&a.kind!==s&&o.push({check:"F1",path:n,message:`Expected kind "${s}", received "${String(a.kind)}".`}),a.schema_version!==void 0&&a.schema_version!==1&&o.push({check:"F1",path:n,message:`Unsupported schema_version "${String(a.schema_version)}". Supported version is 1.`}),a.kind===void 0!=(a.schema_version===void 0)&&o.push({check:"F1",path:n,message:"kind and schema_version must be supplied together."}),o}function QO(e){const n=[],s=[],a=[],o=new Set;for(const c of e){const u=y=>a.push({check:"F1",path:c.path,message:y});let d;try{d=ea.parse(c.content)}catch(y){u(`Invalid feature YAML: ${y instanceof Error?y.message:String(y)}`);continue}if(!Mo(d)){u("Feature document must be a mapping.");continue}if(d.kind!=="feature"||d.schema_version!==1){u('Feature document requires kind "feature" and schema_version 1.');continue}if(!jn(d.id)){u("Feature requires a nonempty string id.");continue}if(o.has(d.id)){u(`Duplicate feature id "${d.id}".`);continue}o.add(d.id);const h=a.length;jn(d.name)||u("Feature name must be a nonempty string without surrounding whitespace.");const p=jn(d.name)?d.name:c.path,v=new Map;if(!Array.isArray(d.stories))u("Feature stories must be an array.");else for(const y of d.stories){if(!Mo(y)||!jn(y.id)){u("Each story requires a nonempty string id.");continue}if(v.has(y.id)){u(`Duplicate story id "${y.id}".`);continue}jn(y.name)||u(`Story "${y.id}" requires a nonempty name.`);const w=[];if(!Array.isArray(y.slices))u(`Story "${y.id}" slices must be an array.`);else for(const N of y.slices){if(!jn(N)||N.startsWith("/")||/^[A-Za-z]:/.test(N)||N.includes("\\")||N.split("/").includes("..")){u(`Story "${y.id}" slice references must be project-relative paths without parent traversal.`);continue}const A=N.split("/").filter(C=>C&&C!==".").join("/");if(!A){u(`Story "${y.id}" slice reference must identify a file, not the project root.`);continue}w.includes(A)?u(`Story "${y.id}" repeats slice "${A}".`):w.push(A)}const E={id:JSON.stringify([d.id,y.id]),localId:y.id,featureName:p,name:jn(y.name)?y.name:y.id,description:typeof y.description=="string"?y.description:"",path:c.path,slices:w};v.set(y.id,E),n.push(E)}if(a.length>h)continue;if(!Array.isArray(d.timelines)){u("Feature timelines must be an array.");continue}const g=new Set;for(const y of d.timelines){const w=a.length;if(!Mo(y)||!jn(y.id)){u("Each timeline requires a nonempty string id.");continue}if(g.has(y.id)){u(`Duplicate timeline id "${y.id}".`);continue}if(g.add(y.id),jn(y.name)||u(`Timeline "${y.id}" requires a nonempty name.`),!Array.isArray(y.steps)||y.steps.length===0){u(`Timeline "${y.id}" steps must be a nonempty array.`);continue}const E=[],N=new Set,A=new Set,C=new Set;for(const _ of y.steps){if(!Mo(_)||!jn(_.id)){u(`Timeline "${y.id}" requires a string id for every step.`);continue}N.has(_.id)&&u(`Timeline "${y.id}" repeats step id "${_.id}".`),N.add(_.id);const x=typeof _.story=="string"?v.get(_.story):void 0;if(!x){u(`Timeline "${y.id}" step "${_.id}" references unknown story "${String(_.story)}".`);continue}A.has(x.id)&&u(`Timeline "${y.id}" repeats story "${_.story}". Use separate timelines for alternative presentations.`),A.add(x.id);for(const j of x.slices)C.has(j)&&u(`Timeline "${y.id}" repeats slice "${j}" across stories.`),C.add(j);const B=[];if(_.after!==void 0)if(!Array.isArray(_.after)||!_.after.every(jn))u(`Timeline "${y.id}" step "${_.id}" after must be an array of step ids.`);else for(const j of _.after)B.includes(j)?u(`Step "${_.id}" repeats predecessor "${j}".`):B.push(j);E.push({id:_.id,storyId:x.id,after:B})}for(const _ of E)for(const x of _.after)N.has(x)||u(`Step "${_.id}" references unknown predecessor "${x}".`);const z=new Set(E.map(_=>_.id));for(;z.size>0;){const _=E.filter(x=>z.has(x.id)&&x.after.every(B=>!z.has(B)));if(_.length===0){u(`Timeline "${y.id}" contains a layout cycle involving ${[...z].join(", ")}.`);break}for(const x of _)z.delete(x.id)}a.length===w&&s.push({id:JSON.stringify([d.id,y.id]),name:y.name,path:c.path,steps:E})}}return{stories:n,timelines:s,modelIssues:a}}const Gv=["#2563EB","#7C3AED","#0F766E","#B45309","#BE185D","#4338CA","#047857","#9F1239"];function Vh(e){let n=0;for(const s of e)n=Math.imul(n,31)+s.codePointAt(0)>>>0;return Gv[n%Gv.length]}function ZO(e){if(e===void 0)return{actors:[]};if(!Array.isArray(e))return{actors:[],actorIssues:["screen.actors must be an array of actor IDs."]};const n=[],s=[];for(const a of e)typeof a!="string"||!a.trim()||a!==a.trim()?s.push("screen.actors IDs must be nonempty strings without surrounding whitespace."):n.includes(a)?s.push(`screen.actors lists "${a}" more than once.`):n.push(a);return{actors:n,...s.length?{actorIssues:s}:{}}}function FO(e,n,s){const a=new Map,o=[],c=(d,h=n)=>o.push({message:d,path:h});if(e!==void 0){let d;try{d=ea.parse(e)}catch(h){c(`Invalid actor registry: ${h instanceof Error?h.message:String(h)}`)}if(!d||typeof d!="object"||Array.isArray(d)||!("actors"in d)||!d.actors||typeof d.actors!="object"||Array.isArray(d.actors))c("Actor registry must contain an actors mapping.");else for(const[h,p]of Object.entries(d.actors)){if(!h.trim()||h!==h.trim()){c("Actor IDs must be nonempty strings without surrounding whitespace.");continue}if(!p||typeof p!="object"||Array.isArray(p)){c(`Actor "${h}" must be a mapping with optional name and color.`);continue}const v=p;let g=h,y=Vh(h);v.name!==void 0&&(typeof v.name!="string"||!v.name.trim()?c(`Actor "${h}" name must be a nonempty string.`):g=v.name.trim()),v.color!==void 0&&(typeof v.color!="string"||!/^#[0-9a-f]{6}$/i.test(v.color)?c(`Actor "${h}" color must be a quoted #RRGGBB value.`):y=v.color.toUpperCase()),a.set(h,{id:h,name:g,color:y})}}const u=new Set(a.keys());for(const d of s){for(const h of d.screen.actorIssues??[])c(h,d.path);if(d.screen.type==="user")for(const h of d.screen.actors)e!==void 0&&!u.has(h)&&c(`screen.actors references undefined actor "${h}".`,d.path),a.has(h)||a.set(h,{id:h,name:h,color:Vh(h)})}return{actors:[...a.values()],actorIssues:o}}function gs(e){return e.normalize("NFKC").replace(/([a-z0-9])([A-Z])/g,"$1-$2").replace(/[^\p{L}\p{N}]+/gu,"-").replace(/^-+|-+$/g,"").toLowerCase()||"unnamed"}function qS(e){return`story_${gs(e).replaceAll("-","_")}`}function VS(e){return`slc_${gs(e).replaceAll("-","_")}`}function YS(e){return`scr_${gs(e).replaceAll("-","_")}`}function GS(e){return`cmd_${gs(e).replaceAll("-","_")}`}function XS(e){return`qry_${gs(e).replaceAll("-","_")}`}function Qc(e){return`evt_${gs(e).replaceAll("-","_")}`}function KS(e,n,s){const a=s?gs(s):`case-${n+1}`;return`gwt_${gs(e).replaceAll("-","_")}_${a.replaceAll("-","_")}`}function JO(e,n,s){return`${e}:${n}->${s}`}function WO(e){const n=new Map,s=(a,o)=>{const c=n.get(a)??new Set;c.add(JSON.stringify(o)),n.set(a,c)};for(const a of e.stories)s(qS(a.id??a.path),[a.id??a.path]);for(const a of e.events)s(Qc(a.name),[a.name]);for(const a of e.slices)s(VS(a.path),[a.path]),s(YS(a.path),[a.path]),a.commands.forEach((o,c)=>{s(GS(o.name),il(a.path,a.commands,c));for(const u of o.produces)s(Qc(u),[u])}),a.queries.forEach((o,c)=>{s(XS(o.name),il(a.path,a.queries,c));for(const u of o.fromEvents)s(Qc(u),[u])}),a.gwt.forEach((o,c)=>{s(KS(a.path,c,o.name),il(a.path,a.gwt,c))});return(a,o)=>n.get(a).size===1?a:`${a}~${encodeURIComponent(JSON.stringify(o))}`}function il(e,n,s){const a=n[s].name,o=n.slice(0,s).filter(c=>c.name===a).length;return[e,a??"",String(o)]}function PO(e){const n=[],s=new Map,a=WO(e),o=d=>a(Qc(d),[d]),c=new Map,u=(d,h,p,v)=>{const g=JO(d,h,p);s.set(g,{id:g,kind:d,source:h,target:p,...v===void 0?{}:{label:v}})};for(const d of e.stories){const h=a(qS(d.id??d.path),[d.id??d.path]);for(const p of new Set(d.slices))c.set(p,[...c.get(p)??[],h]);n.push({id:h,type:"story",label:d.name,storyId:d.id,sourceName:d.localId,sourcePath:d.path,description:d.description})}for(const d of e.events)n.push({id:o(d.name),type:"event",label:d.name,sourceName:d.name,sourcePath:d.sourcePath,fields:d.fields,description:d.description});for(const d of e.slices){const h=a(VS(d.path),[d.path]),p=a(YS(d.path),[d.path]),v={storyName:d.storyName,storyId:d.storyId,sliceTitle:d.title,sourcePath:d.path,raw:d.raw};n.push({...v,id:h,type:"slice",label:d.title});for(const g of c.get(d.path)??[])u("story-slice",g,h);n.push({...v,id:p,type:d.screen.type==="system"?"processor":"screen",label:d.screen.name??(d.screen.type==="system"?"Processor":"Screen"),actors:d.screen.actors,...d.screen.type==="user"?{actorDefinitions:d.screen.actors.map(g=>e.actors?.find(y=>y.id===g)).filter(g=>!!g)}:{},screenType:d.screen.type}),u("slice-screen",h,p),d.queries.forEach((g,y)=>{const w=a(XS(g.name),il(d.path,d.queries,y));n.push({...v,id:w,type:"query",label:g.name,sourceName:g.name,fields:g.fields}),d.screen.reads.includes(g.name)&&u("query-screen",w,p);for(const E of g.fromEvents)u("event-query",o(E),w,E)}),d.commands.forEach((g,y)=>{const w=a(GS(g.name),il(d.path,d.commands,y));n.push({...v,id:w,type:"command",label:g.name,sourceName:g.name,fields:g.fields}),d.screen.executes.includes(g.name)&&u("screen-command",p,w);for(const E of g.produces)u("command-event",w,o(E),E)}),d.gwt.forEach((g,y)=>{n.push({...v,id:a(KS(d.path,y,g.name),il(d.path,d.gwt,y)),type:"gwt",label:g.name??`Case ${y+1}`,sourceName:g.name,description:g.description,given:g.given,when:g.when,then:g.then})})}return{nodes:n,edges:[...s.values()]}}function Wa(e){const n=[];for(const s of e.replaceAll("\\","/").split("/"))!s||s==="."||(s===".."&&n.length>0&&n.at(-1)!==".."?n.pop():n.push(s));return n.join("/")}function QS(e,n=""){const s=Wa(e).split("/").at(-1)??e;return n&&s.endsWith(n)?s.slice(0,-n.length):s}function Zo(e){return Array.isArray(e)?e.filter(n=>typeof n=="string"):[]}function e3(e,n){const s=ea.parse(n),a=s?.events&&typeof s.events=="object"?s.events:s??{};return Object.entries(a).map(([o,c])=>({name:o,fields:typeof c?.fields=="string"?c.fields:void 0,description:typeof c?.description=="string"?c.description:void 0,sourcePath:e}))}function t3(e,n){const s=ea.parse(n);return{name:typeof s?.name=="string"?s.name:QS(e,".yaml"),description:typeof s?.description=="string"?s.description:"",path:e,slices:Zo(s?.slices).map(Wa)}}function n3(e){return Array.isArray(e)?e.filter(n=>!!n&&typeof n=="object").map(n=>({name:typeof n.name=="string"?n.name:"",fields:typeof n.fields=="string"?n.fields:void 0,notes:typeof n.notes=="string"?n.notes:void 0,produces:Zo(n.produces)})):[]}function i3(e){return Array.isArray(e)?e.filter(n=>!!n&&typeof n=="object").map(n=>({name:typeof n.name=="string"?n.name:"",fields:typeof n.fields=="string"?n.fields:void 0,notes:typeof n.notes=="string"?n.notes:void 0,fromEvents:Zo(n.from_events)})):[]}function s3(e){return Array.isArray(e)?e.filter(n=>!!n&&typeof n=="object").map(n=>({name:typeof n.name=="string"?n.name:void 0,description:typeof n.description=="string"?n.description:void 0,given:Array.isArray(n.given)?n.given:[],when:Array.isArray(n.when)?n.when:[],then:Array.isArray(n.then)?n.then:[]})):[]}function a3(e){return{type:e?.type==="system"?"system":"user",name:typeof e?.name=="string"?e.name:void 0,...ZO(e?.actors),reads:Zo(e?.reads),executes:Zo(e?.executes)}}function l3(e,n,s){const a=ea.parse(n);return{title:typeof a?.slice=="string"?a.slice:QS(e),path:e,storyName:s.get(e)?.name,storyId:s.get(e)?.id,screen:a3(a?.screen),commands:n3(a?.commands),queries:i3(a?.queries),gwt:s3(a?.gwt),raw:n}}function o3(e,n={}){const s=new Map(e.map(R=>[Wa(R.path),R.content])),a=s.get(".event-modeling/config.yaml"),o=a?ea.parse(a):null,c=o?.paths?.event_model_dir??"event-model",u=o?.paths?.features_dir??"event-model/features",d=o?.paths?.slice_extension??".slice.yaml",h=o?.paths?.events_file??`${c}/events.yaml`,p=Wa(o?.paths?.actors_file??`${c}/actors.yaml`),v=o?.paths?.stories_dir??`${c}/stories`,g=s.get(h);if(g===void 0)throw new Error(`Missing events file: ${h}`);const y=e3(h,g),w=QO([...s.entries()].filter(([R])=>(u===""||R.startsWith(`${u}/`))&&R.endsWith(".feature.yaml")).sort(([R],[Z])=>R<Z?-1:R>Z?1:0).map(([R,Z])=>({path:R,content:Z}))),E=[...s.entries()].filter(([R])=>R.split("/").slice(0,-1).join("/")===v&&R.endsWith(".yaml")).sort(([R],[Z])=>R.localeCompare(Z)).map(([R,Z])=>t3(R,Z));E.push(...w.stories);const N=new Map;for(const R of E)for(const Z of R.slices)N.set(Wa(Z),R);const A=E.flatMap(R=>R.slices.map(Wa)),C=[...s.keys()].filter(R=>(u===""||R.startsWith(`${u}/`))&&R.endsWith(d)),_=[...new Set([...A,...C])].sort().filter(R=>s.has(R)).map(R=>l3(R,s.get(R)??"",N)),x=FO(s.get(p),p,_),B=[{path:h,kind:"events"},...E.filter(R=>!R.id).map(R=>({path:R.path,kind:"story"})),..._.map(R=>({path:R.path,kind:"slice"})),...s.has(p)?[{path:p,kind:"actors"}]:[]],j=[...w.modelIssues,...B.flatMap(R=>KO(s.get(R.path)??"",R.path,R.kind))],T={root:n.root??"browser-import",config:{language:o?.language,paths:{eventModelDir:c,featuresDir:u,sliceExtension:d,eventsFile:h,actorsFile:p,storiesDir:v}},events:y,stories:E,timelines:w.timelines,modelIssues:j,slices:_,...x},D=PO(T);return{...T,...D}}function ZS(e){if(e.type!=="screen")return[];const n=new Map(e.actorDefinitions?.map(s=>[s.id,s]));return[...new Set(e.actors??[])].map(s=>n.get(s)??{id:s,name:s,color:Vh(s)})}function FS(e,n={}){const s=new Map(e.actors?.map(a=>[a.id,a]));for(const a of[...e.nodes,...Object.values(n)])for(const o of ZS(a))s.has(o.id)||s.set(o.id,o);return[...s.values()]}function r3(e,n,s={}){const a=new Set(FS(e,s).map(u=>u.id)),o=n.actorIds.filter(u=>a.has(u)),c=n.includeUnassigned&&[...e.nodes,...Object.values(s)].some(u=>u.type==="screen"&&!u.actors?.length);return o.length===n.actorIds.length&&c===n.includeUnassigned?n:{actorIds:o,includeUnassigned:c}}function c3(e,n,s={}){if(n.actorIds.length===0&&!n.includeUnassigned)return{nodeIds:new Set(e.nodes.map(x=>x.id)),relatedNodeIds:new Set};const a=new Set(n.actorIds),o=new Map(e.nodes.map(x=>[x.id,x])),c=new Map;for(const x of e.nodes)x.type==="story"||x.type==="event"||x.sourcePath&&c.set(x.id,x.sourcePath);const u=e.edges.filter(x=>["slice-screen","query-screen","screen-command"].includes(x.kind)),d=()=>{let x=!0;for(;x;){x=!1;for(const B of u){const j=c.get(B.source),T=c.get(B.target);j&&!T?(c.set(B.target,j),x=!0):T&&!j&&(c.set(B.source,T),x=!0)}}};d();for(const x of e.nodes)x.type==="slice"&&!c.has(x.id)&&c.set(x.id,x.id);d();for(const x of e.nodes)(x.type==="screen"||x.type==="processor")&&!c.has(x.id)&&c.set(x.id,x.id);d();const h=x=>x?.type==="screen"&&((x.actors??[]).some(B=>a.has(B))||n.includeUnassigned&&!x.actors?.length),p=e.nodes.filter(x=>h(x)||h(s[x.id])),v=new Set(p.flatMap(x=>{const B=c.get(x.id);return B?[B]:[]})),g=new Set(p.map(x=>x.id));for(const[x,B]of c)v.has(B)&&g.add(x);const y=e.edges.filter(x=>x.kind==="command-event"||x.kind==="event-query"),w=x=>{const B=new Set;for(const j of y)x.has(j.source)&&o.get(j.target)?.type==="event"&&B.add(j.target),x.has(j.target)&&o.get(j.source)?.type==="event"&&B.add(j.source);return B},E=w(g),N=new Set,A=new Set(e.nodes.filter(x=>x.type==="processor").map(x=>c.get(x.id)));for(const x of y){const B=E.has(x.source)?x.target:E.has(x.target)?x.source:void 0,j=B?c.get(B):void 0;j&&A.has(j)&&!v.has(j)&&N.add(j)}const C=new Set;for(const[x,B]of c)N.has(B)&&C.add(x);for(const x of w(C))E.has(x)||C.add(x);const z=new Set([...g,...E,...C]),_=new Set(e.nodes.filter(x=>z.has(x.id)&&x.type!=="event").map(un));for(const x of e.nodes)x.type==="story"&&_.has(x.storyId??x.label)&&z.add(x.id);return{nodeIds:z,relatedNodeIds:C}}const Dn=180,Zn=80,Yh=80,_i=430,sl=390,fu=130,xn=178,Xv=92,Gh=300,Xh=170,Ro=18,Kh=48,wh=30,Zc=92,JS=38,u3=42,Kv=154,Qv=278,WS=408;function f3(e){return e==="slice-screen"||e==="story-slice"?"#cbd5e1":"#64748b"}function d3(e){if(e==="added")return"#15803d";if(e==="removed")return"#b91c1c";if(e==="changed")return"#b45309"}function h3(e){return e.type==="event"?{sourcePosition:he.Right,targetPosition:he.Left}:{sourcePosition:he.Bottom,targetPosition:he.Top}}function m3(e){return new Map(e.stories.map((n,s)=>[Dt(n),s]))}function al(e,n){return e===0?0:e*n+(e-1)*Ro}function Fc(e,n,s){const a=e.slices.find(o=>o.path===n);return e.nodes.filter(o=>o.type===s&&(o.sourcePath?o.sourcePath===n:o.sliceTitle===a?.title))}function p3(e,n,s){const a=new Set(Fc(e,s,"command").map(c=>c.id));return[...new Set(e.edges.filter(c=>c.kind==="command-event"&&a.has(c.source)).map(c=>c.target))].map(c=>n.get(c)).filter(c=>!!c)}function g3(e,n){return new Map(e.slices.map(s=>{const a=Fc(e,s.path,"query"),o=Fc(e,s.path,"command"),c=p3(e,n,s.path),u=Fc(e,s.path,"gwt"),d=al(a.length,xn),h=al(o.length,xn),p=d+h+(d>0&&h>0?Kh:0),v=al(c.length,xn),g=u.length?Gh:0,y=Math.max(_i,p+wh*2,v+wh*2,g+wh*2),w=u.length>0?WS+Xh+36:sl;return[s.path,{width:y,height:w,queryIds:a.map(E=>E.id),commandIds:o.map(E=>E.id),eventIds:c.map(E=>E.id),gwtIds:u.map(E=>E.id)}]}))}function y3(e,n,s){const a=new Map;let o=Zn;for(const c of e.stories){const u=e.slices.filter(g=>(g.storyId??g.storyName)===Dt(c)),d=u.reduce((g,y)=>g+(n.get(y.path)?.width??_i),0),h=Math.max(d+Math.max(u.length-1,0)*fu,_i),p=Math.max(...u.map(g=>n.get(g.path)?.height??sl),sl),v=Zc+p+JS;a.set(Dt(c),{x:Dn,y:o,width:h,height:v}),o+=v+Yh}if(s){const c=$M(s);let u=Dn;const d=[...new Set(c.values())].sort((h,p)=>h-p);for(const h of d){let p=Zn,v=0;for(const g of e.stories.filter(y=>c.get(Dt(y))===h)){const y=a.get(Dt(g));y.x=u,y.y=p,p+=y.height+Yh,v=Math.max(v,y.width)}u+=v+fu}}return a}function v3(e,n,s,a,o,c){const u=al(e.length,c),d=s.x+(a-u)/2;e.forEach((h,p)=>{n.set(h,{x:d+p*(c+Ro),y:s.y+o})})}function b3(e){return e==="essential"?new Set(["command-event","event-query"]):e==="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 S3(e,n,s="all"){if(!n||s==="all")return new Set(e.stories.map(Dt));if(s==="story")return new Set([n]);const a=new Set([n]),o=new Set(e.nodes.filter(u=>un(u)===n).map(u=>u.id)),c=new Set(e.edges.filter(u=>o.has(u.source)||o.has(u.target)).flatMap(u=>[u.source,u.target]).filter(u=>e.nodes.find(d=>d.id===u)?.type==="event"));for(const u of e.edges){if(!c.has(u.source)&&!c.has(u.target))continue;const d=e.nodes.find(p=>p.id===u.source),h=e.nodes.find(p=>p.id===u.target);d&&un(d)&&a.add(un(d)),h&&un(h)&&a.add(un(h))}return a}function w3(e){return e==="event-query"?{sourceSide:"top",targetSide:"bottom"}:e==="query-screen"?{sourceSide:"top",targetSide:"bottom"}:e==="screen-command"?{sourceSide:"bottom",targetSide:"top"}:e==="command-event"?{sourceSide:"bottom",targetSide:"top"}:e==="slice-screen"?{sourceSide:"bottom",targetSide:"top"}:{sourceSide:"right",targetSide:"left"}}function x3(e,n,s,a,o){const c=w3(e),u=n?.sliceTitle&&n.sliceTitle===s?.sliceTitle;if(e==="event-query"&&u)return{...c,route:"same-slice-read"};if(!(e==="event-query"&&n?.sliceTitle!==s?.sliceTitle)||!a||!o)return{...c,route:"semantic"};const h=a.x+a.width/2,p=a.y+a.height/2,v=o.x+o.width/2,g=o.y+o.height/2;return{sourceSide:n&&s&&un(n)&&un(n)===un(s)||g>=p?"bottom":"top",targetSide:v>=h?"left":"right",route:"event-read"}}function Zv(e,n,s={}){const a=e.timelines?.find(T=>T.id===s.timelineId);e=LM(e,a);const o=new Map(e.nodes.map(T=>[T.id,T]));e={...e,nodes:e.nodes.map(T=>{if(T.type!=="event")return T;const D=e.edges.find(R=>R.kind==="command-event"&&R.target===T.id);return{...T,storyName:D?o.get(D.source)?.storyName:a?void 0:T.storyName,storyId:D?o.get(D.source)?.storyId:a?void 0:T.storyId}})};const c=m3(e),u=new Map(e.nodes.map(T=>[T.id,T])),d=g3(e,u),h=T=>T?.sourcePath??e.slices.find(D=>D.title===(T?.sliceTitle??T?.label))?.path??"",p=y3(e,d,a),v=new Map,g=new Map,y=new Map,w=new Set,E=S3(e,s.focusedStory,s.scope??"all"),N=b3(s.edgeDetail??"normal"),A=c3(e,s.actorFilter??{actorIds:[],includeUnassigned:!1},s.previousNodes);if(n){w.add(n);for(const T of e.edges)T.source===n&&w.add(T.target),T.target===n&&w.add(T.source)}const C=new Map;for(const T of e.stories)C.set(Dt(T),p.get(Dt(T))?.x??Dn);for(const T of e.stories)for(const D of T.slices){const R=e.slices.find(K=>K.path===D);if(!R||(R.storyId??R.storyName)!==Dt(T))continue;const Z=p.get(Dt(T))??{y:Zn},Y=C.get(Dt(T))??Dn;y.set(R.path,{x:Y,y:Z.y+Zc}),C.set(Dt(T),Y+(d.get(R.path)?.width??_i)+fu)}for(const T of e.slices){if(y.has(T.path))continue;const D=Zn+(c.get(T.storyId??T.storyName??"")??0)*(sl+Zc+JS+Yh),R=Dn;y.set(T.path,{x:R,y:D+Zc})}for(const T of e.nodes){if(T.type==="story"&&v.set(T.id,{x:(p.get(T.storyId??T.label)?.x??Dn)-20,y:p.get(T.storyId??T.label)?.y??Zn}),T.type==="slice"){const D=y.get(h(T))??{x:Dn,y:Zn};v.set(T.id,D)}if(T.type==="screen"||T.type==="processor"){const D=y.get(h(T))??{x:Dn,y:Zn},Z=d.get(h(T))?.width??_i;v.set(T.id,{x:D.x+(Z-xn)/2,y:D.y+u3})}}for(const T of e.slices){const D=y.get(T.path)??{x:Dn,y:Zn},R=d.get(T.path),Z=R?.width??_i;if(!R)continue;const Y=al(R.queryIds.length,xn),K=al(R.commandIds.length,xn),le=Y+K+(Y>0&&K>0?Kh:0);let L=D.x+(Z-le)/2;R.queryIds.forEach((G,k)=>{v.set(G,{x:L+k*(xn+Ro),y:D.y+Kv})}),Y>0&&(L+=Y+(K>0?Kh:0)),R.commandIds.forEach((G,k)=>{v.set(G,{x:L+k*(xn+Ro),y:D.y+Kv})}),v3(R.eventIds,v,D,Z,Qv,xn);for(const G of R.gwtIds)v.set(G,{x:D.x+(Z-Gh)/2,y:D.y+WS})}let z=0;for(const T of e.nodes.filter(D=>D.type==="event")){const D=e.edges.find(Z=>Z.kind==="command-event"&&Z.target===T.id),R=D?u.get(D.source):void 0;if(!v.has(T.id)){if(a&&!R){v.set(T.id,{x:Dn-xn-fu,y:Zn+z++*(Xv+Ro)});continue}const Z=y.get(h(R))??{x:Dn,y:Zn},Y=d.get(h(R));v.set(T.id,{x:Z.x+((Y?.width??_i)-xn)/2,y:Z.y+Qv})}}const _=e.nodes.map(T=>{const D=v.get(T.id)??{x:0,y:0},R=T.type==="story"||T.type==="slice",Z=T.type==="story"?p.get(T.storyId??T.label)?.width??_i:d.get(h(T))?.width??_i,Y=T.type==="story"?p.get(T.storyId??T.label)?.height??sl:d.get(h(T))?.height??sl,K=R?Z:T.type==="gwt"?Gh:xn,le=R?Y:T.type==="gwt"?Xh:Xv;g.set(T.id,{x:D.x,y:D.y,width:K,height:le});const L=T.type==="gwt"?e.nodes.filter(G=>G.type==="gwt"&&(T.sourcePath?G.sourcePath===T.sourcePath:G.sliceTitle===T.sliceTitle)).filter(G=>A.nodeIds.has(G.id)&&(!un(G)||E.has(un(G)))).filter(G=>!s.diffFilter||s.diffFilter==="all"||s.diffNodeStatus?.[G.id]===s.diffFilter):void 0;return{id:T.id,type:R?"groupNode":"eventModelNode",position:D,initialWidth:R||T.type==="gwt"?K:void 0,initialHeight:R||T.type==="gwt"?le:void 0,selectable:!0,draggable:!1,data:{projectNode:T,scenarios:L,scenarioStatus:s.diffNodeStatus,selectedScenarioId:n,selected:T.id===n||!!L?.some(G=>G.id===n),connected:w.has(T.id),actorRelated:A.relatedNodeIds.has(T.id),diffStatus:s.diffNodeStatus?.[T.id]},hidden:!A.nodeIds.has(T.id)||!!(L&&L[0]?.id!==T.id)||!!(un(T)&&!E.has(un(T)))||!!(!L&&s.diffFilter&&s.diffFilter!=="all"&&s.diffNodeStatus?.[T.id]!==s.diffFilter),style:R?{width:Z,height:Y,zIndex:T.type==="story"?-20:-10,opacity:A.relatedNodeIds.has(T.id)?.72:1}:{width:K,height:T.type==="gwt"?Xh:void 0,opacity:A.relatedNodeIds.has(T.id)?.72:1},...h3(T)}}),x=new Set(_.filter(T=>!T.hidden).map(T=>T.id)),j=e.edges.filter(T=>N.has(T.kind)).filter(T=>x.has(T.source)&&x.has(T.target)).map(T=>{const D=u.get(T.source),R=u.get(T.target),Z=!!s.focusedEdgeIds?.has(T.id),Y=s.diffEdgeStatus?.[T.id],K=d3(Y),{sourceSide:le,targetSide:L,route:G}=x3(T.kind,D,R,g.get(T.source),g.get(T.target));return{id:T.id,source:T.source,target:T.target,type:"eventModelEdge",sourceHandle:`${le}-source`,targetHandle:`${L}-target`,data:{kind:T.kind,route:G,active:Z,diffStatus:Y,fieldFlow:s.edgeFieldFlows?.get(T.id),selectedFieldName:s.selectedFieldName,onSelectField:s.onSelectField},markerEnd:{type:qo.ArrowClosed,color:Z?"#111827":K??f3(T.kind)},label:s.edgeDetail==="verbose"?T.label:void 0,className:`edge ${Z?"edge-active":""} ${Y?`edge-diff-${Y}`:""}`,hidden:!!(s.diffFilter&&s.diffFilter!=="all"&&Y!==s.diffFilter),animated:Z}});return{nodes:_,edges:j}}function Fs(e,n){return JSON.stringify([e,n.type,n.sourcePath,n.sourceName,n.label,n.sliceTitle])}function E3(e,n,s,a,o){const c=Fs(n,s);if(o!==void 0&&e[c]?.message!==o)return e;if(a)return{...e,[c]:{sessionId:n,identity:gl(s),message:a}};const u={...e};return delete u[c],u}function gl(e){return{type:e.type,sourcePath:e.sourcePath,sourceName:e.sourceName,label:e.label,sliceTitle:e.sliceTitle}}function Qh(e,n){return e.type===n.type&&e.sourcePath===n.sourcePath&&e.sourceName===n.sourceName&&e.label===n.label&&e.sliceTitle===n.sliceTitle}function Fv(e,n){const s=e.nodes.find(a=>a.id===n);return s?{identity:gl(s),nodeId:n,snapshotNodes:e.nodes}:void 0}function us(e,n){if(!e||!n)return;if(e.nodes===n.snapshotNodes)return e.nodes.find(a=>a.id===n.nodeId&&Qh(a,n.identity));const s=e.nodes.filter(a=>Qh(a,n.identity));return s.length===1?s[0]:void 0}function N3(e,n){return e.nodes.filter(s=>Qh(s,gl(n))).length===1}function Mm(e,n){if(!(!n||e?.nodeStatus[n.id]!=="changed"))return e.previousNodes?.[n.id]??e.previousGwtNodes?.[n.id]}function _3(e,n){if(!n)return e;const s=e.nodes.filter(c=>n.nodeStatus[c.id]!=="added").map(c=>{const u=Mm(n,c);return u?{...u,id:c.id}:c}),a=new Set(s.map(c=>c.id)),o=e.edges.filter(c=>n.edgeStatus[c.id]!=="added").map(c=>n.previousEdges?.[c.id]?{...n.previousEdges[c.id],id:c.id,source:c.source,target:c.target}:c).filter(c=>a.has(c.source)&&a.has(c.target));return{...e,nodes:s,edges:o}}function A3(e,n){if(!n)return e;const s=e.nodes.filter(c=>n.nodeStatus[c.id]!=="removed"),a=new Set(s.map(c=>c.id)),o=e.edges.filter(c=>n.edgeStatus[c.id]!=="removed"&&a.has(c.source)&&a.has(c.target));return{...e,nodes:s,edges:o}}function T3(e){if(!e||typeof e!="object")return!1;const n=e;return typeof n.sessionId=="string"&&typeof n.token=="string"&&typeof n.revision=="string"&&Array.isArray(n.project?.nodes)&&Array.isArray(n.project?.edges)&&Array.isArray(n.validation?.findings)&&typeof n.stale=="boolean"&&!!n.baseline&&!!(n.feedback&&["idle","queued","working","completed","stopped"].includes(n.feedback.status)&&Array.isArray(n.feedback.history)&&typeof n.feedback.agent?.connected=="boolean")}function C3(e,n,s,a,o,c=!1){if(!e)return"Feedback is available when a project session is running.";if(!s)return"Reconnect to the project server before adding feedback.";if(e.stale||e.error)return"The model is stale. Fix the model error before adding feedback.";if(n==="turn")return"Switch to Current or Session diff to add feedback about the current model.";if(o?.nodeStatus[a.id]==="removed")return"This node was removed. Select a current node to add feedback.";if(c)return"Switch to New version to add feedback about the current node. Your draft is preserved.";if(!N3(e.project,a))return"This node is ambiguous. Give same-named nodes distinct names before adding feedback.";if(n==="session"&&!e.currentNodeIds)return"Refresh the project server before adding feedback from Session diff.";if(e.currentNodeIds&&!e.currentNodeIds[a.id])return"This node has no unique current target. Select a current node to add feedback."}const Om=20,ll=4e3,M3=16e3,O3=128*1024;function km(){return{version:1,drafts:{},queue:{items:[]}}}function Jv(e,n,s,a){const o=e.currentNodeIds?.[n.id]??n.id;return{id:a,sessionId:e.sessionId,projectRoot:e.project.root,nodeId:o,reference:"em://"+(e.project.graphSidecar?.model?.id??"event_model")+"/"+o,revision:e.revision,identity:gl(n),message:s.trim()}}function Nl(e){if(e.length>Om)return"The Queue can hold up to 20 items. Send or remove an item first.";if(e.some(s=>!s.message.trim()||s.message.length>ll))return"Each queued message must contain 1 to 4000 characters.";if(e.reduce((s,a)=>s+a.message.length,0)>M3)return"The Queue can contain up to 16000 message characters.";if(e.some(s=>!Fo(s)))return"A captured target exceeds the server limits. Copy the feedback before removing it.";const n={clientBatchId:"0".repeat(100),items:e.map(({id:s,nodeId:a,reference:o,revision:c,message:u})=>({id:s,nodeId:a,reference:o,revision:c,message:u}))};if(new TextEncoder().encode(JSON.stringify(n)).byteLength>O3)return"This Queue exceeds the 128 KiB request limit. Remove an item before sending."}function zm(e,n){return!!e.submission?.body.items.some(s=>s.id===n)}function k3(e,n){if(e.items.some(o=>o.id===n.id))return e;const s=[...e.items,n],a=Nl(s);return a?{...e,error:a}:{...e,items:s,error:void 0,notice:void 0}}function z3(e,n,s){if(zm(e,n))return e;const a=e.items.map(c=>c.id===n?{...c,message:s.trim()}:c),o=Nl(a);return o?{...e,error:o}:{...e,items:a,editing:void 0,error:void 0,notice:void 0}}function j3(e,n){return zm(e,n)?e:{...e,items:e.items.filter(s=>s.id!==n),editing:e.editing?.id===n?void 0:e.editing,error:void 0,notice:void 0}}function PS(e,n){if(e.sessionId!==n.sessionId)return"This item belongs to a previous session. Copy it, then add feedback for a current node.";if(e.projectRoot!==n.project.root)return"This item belongs to another project. Copy it, then add feedback for the current project.";if(e.revision!==n.revision)return"The model changed after this item was added. Copy it, then review and add it again.";const s=n.project.nodes.filter(o=>Fs(n.sessionId,o)===Fs(e.sessionId,e.identity)&&n.diff?.nodeStatus[o.id]!=="removed");if(s.length!==1||(n.currentNodeIds?.[s[0].id]??s[0].id)!==e.nodeId)return"The original node is missing or ambiguous. Copy the text before removing this item.";const a="em://"+(n.project.graphSidecar?.model?.id??"event_model")+"/"+e.nodeId;if(e.reference!==a)return"The model reference changed. Review and add this feedback again."}function D3(e,n,s,a,o){if(!n||!a)return"Reconnect to the project server before sending the Queue.";if(e.submission?.sessionId!==void 0&&(e.submission.sessionId!==n.sessionId||e.submission.projectRoot!==n.project.root))return"The project changed or the server restarted before this batch could be confirmed.";if(o||e.submission?.phase==="sending")return"Waiting for the server to confirm this batch.";if(!e.submission)return e.editing?"Save or cancel the Queue edit before sending.":e.items.length?n.stale||n.error?"The model is stale. Fix the model error before sending.":s==="turn"?"Switch to Current or Session diff before sending.":n.feedback.status==="stopped"?"Resume the session before sending.":n.feedback.status==="queued"||n.feedback.status==="working"?"Wait for the current request to finish before sending.":e.items.some(c=>PS(c,n))?"Review the flagged Queue items before sending. Their captured targets have not been changed.":Nl(e.items):"Add feedback to the Queue before sending."}function R3(e,n){return e.submission?.phase==="sending"?e:e.submission?{...e,submission:{...e.submission,phase:"sending"},error:void 0}:!e.items.length||e.editing||Nl(e.items)?e:{...e,error:void 0,notice:void 0,submission:{sessionId:e.items[0].sessionId,projectRoot:e.items[0].projectRoot,phase:"sending",body:{clientBatchId:n,items:e.items.map(({id:s,nodeId:a,reference:o,revision:c,message:u})=>({id:s,nodeId:a,reference:o,revision:c,message:u}))}}}}function B3(e,n,s,a){return e.submission?.body.clientBatchId!==n?e:{...e,submission:a?{...e.submission,phase:"uncertain"}:void 0,error:s}}function ew(e,n){if(e.submission?.body.clientBatchId!==n)return e;const s=new Set(e.submission.body.items.map(a=>a.id));return{items:e.items.filter(a=>!s.has(a.id)),editing:e.editing&&!s.has(e.editing.id)?e.editing:void 0,notice:"Feedback sent as one request to your external agent."}}function L3(e,n){return!e.submission||e.submission.sessionId===n.sessionId&&e.submission.projectRoot===n.project.root?e:{...e,submission:void 0,error:"The previous send remains unconfirmed. Its Queue items are preserved for review and cannot be sent to the new session."}}function tw(e,n){if(!Bn(e)||typeof e.id!="string"||!e.id.trim()||typeof n.clientBatchId!="string"||e.clientBatchId!==n.clientBatchId||!Array.isArray(e.items)||!Array.isArray(n.items)||e.items.length!==n.items.length||!e.items.every(Fo)||!n.items.every(Fo))return!1;const s=n.items;return e.items.every((a,o)=>{const c=s[o];return a.id===c.id&&a.nodeId===c.nodeId&&a.reference===c.reference&&a.revision===c.revision&&a.message===c.message})}function $3(e,n){const s=e.submission;if(!s)return e;if(s.sessionId!==n.sessionId||s.projectRoot!==n.project.root){const c="The project changed or its server restarted. The previous send could not be confirmed. Release the previous-session batch to review its preserved items.";return e.error===c&&s.phase==="uncertain"?e:{...e,submission:{...s,phase:"uncertain"},error:c}}const o=[...n.feedback.history,...n.feedback.request?[n.feedback.request]:[]].find(c=>c.clientBatchId===s.body.clientBatchId);return o?tw(o,s.body)?ew(e,s.body.clientBatchId):{...e,submission:{...s,phase:"uncertain"},error:"The server returned different items for this batch ID. The original Queue is preserved."}:e}function Bn(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function nw(e){return Bn(e)&&typeof e.type=="string"&&["story","slice","screen","processor","command","event","query","gwt"].includes(e.type)&&typeof e.label=="string"&&["sourcePath","sourceName","sliceTitle"].every(n=>e[n]===void 0||typeof e[n]=="string")}function Fo(e){return Bn(e)&&typeof e.id=="string"&&e.id.length>0&&e.id.length<=100&&typeof e.nodeId=="string"&&e.nodeId.length>0&&e.nodeId.length<=500&&typeof e.reference=="string"&&e.reference.length>0&&e.reference.length<=1e3&&typeof e.revision=="string"&&e.revision.length>0&&e.revision.length<=100&&typeof e.message=="string"&&!!e.message.trim()&&e.message.length<=ll}function H3(e){return Bn(e)&&typeof e.sessionId=="string"&&typeof e.projectRoot=="string"&&nw(e.identity)&&Fo(e)}const iw="Some saved feedback could not be recovered. A previous send may already have arrived. The original saved data has been kept. Review the agent history before replacing the damaged saved copy and sending again.";function Wv(){return{...km(),recoveryWarning:iw}}function U3(e){if(!e)return km();try{const n=JSON.parse(e);if(!Bn(n)||n.version!==1||!Bn(n.drafts)||!Bn(n.queue)||!Array.isArray(n.queue.items))return Wv();const s={};for(const h of Object.values(n.drafts))!Bn(h)||typeof h.sessionId!="string"||!nw(h.identity)||typeof h.message!="string"||h.message.length>ll||(s[Fs(h.sessionId,h.identity)]={sessionId:h.sessionId,identity:gl(h.identity),message:h.message});const a=[];for(const h of n.queue.items)H3(h)&&(a.some(p=>p.id===h.id)||a.push({id:h.id,sessionId:h.sessionId,projectRoot:h.projectRoot,nodeId:h.nodeId,reference:h.reference,revision:h.revision,message:h.message,identity:gl(h.identity)}));const o={items:a},c=n.queue.editing;Bn(c)&&typeof c.id=="string"&&typeof c.message=="string"&&a.some(h=>h.id===c.id)&&(o.editing={id:c.id,message:c.message});const u=n.queue.submission;if(Bn(u)&&typeof u.sessionId=="string"&&typeof u.projectRoot=="string"&&Bn(u.body)&&typeof u.body.clientBatchId=="string"&&u.body.clientBatchId.length>0&&u.body.clientBatchId.length<=100&&Array.isArray(u.body.items)&&u.body.items.length>0&&u.body.items.length<=Om&&u.body.items.every(Fo)){const h=u.body.items.map(({id:p,nodeId:v,reference:g,revision:y,message:w})=>({id:p,nodeId:v,reference:g,revision:y,message:w}));new Set(h.map(p=>p.id)).size===h.length&&h.every(p=>a.some(v=>v.id===p.id&&v.sessionId===u.sessionId&&v.projectRoot===u.projectRoot&&v.nodeId===p.nodeId&&v.reference===p.reference&&v.revision===p.revision&&v.message===p.message))&&(o.editing=o.editing&&!h.some(p=>p.id===o.editing?.id)?o.editing:void 0,o.submission={sessionId:u.sessionId,projectRoot:u.projectRoot,phase:"uncertain",body:{clientBatchId:u.body.clientBatchId,items:h}},o.error="A previous send was not confirmed. Refresh to check its status, or retry the same batch.")}const d=Object.keys(s).length!==Object.keys(n.drafts).length||a.length!==n.queue.items.length||!!Nl(a)||u!==void 0&&!o.submission;return{version:1,drafts:s,queue:o,recoveryWarning:d?iw:void 0}}catch{return Wv()}}function I3(e){return JSON.stringify({version:1,drafts:e.drafts,queue:{items:e.queue.items,editing:e.queue.editing,submission:e.queue.submission}})}class Oo extends Error{constructor(n,s){super(n),this.uncertain=s,this.name="FeedbackCommandError"}uncertain}function Zh(e){return e instanceof Error?e.message:String(e)}async function Pv(e){const n=await e.json().catch(()=>{});return typeof n?.error=="string"?n.error:"Request failed ("+e.status+")."}function q3(e,n){const[s,a]=q.useState(),[o,c]=q.useState(),[u,d]=q.useState("checking"),[h,p]=q.useState(),[v,g]=q.useState(!1),[y,w]=q.useState(!1),[E,N]=q.useState(0),A=q.useRef(void 0),C=q.useRef(!1),z=q.useRef(!0),_=q.useRef(null),x=q.useCallback(()=>N(j=>j+1),[]);q.useEffect(()=>(z.current=!0,()=>{z.current=!1,_.current?.abort()}),[]),q.useEffect(()=>{if(!e)return;let j=!1,T,D;d("checking");const R=async()=>{const Z=new AbortController;D=Z;const Y=setTimeout(()=>Z.abort(),5e3);let K=!1;try{const le=await jo("/api/session?view="+n,{signal:Z.signal,cache:"no-store"});if(le.status===404&&!A.current){K=!0,j||d("unavailable");return}if(!le.ok)throw new Error(await Pv(le));if(!le.headers.get("content-type")?.includes("application/json")&&!A.current){K=!0,j||d("unavailable");return}const L=await le.json();if(!T3(L))throw new Error("The project server returned an invalid session snapshot.");if(j)return;A.current&&A.current!==L.sessionId&&(g(!0),_.current?.abort(),C.current=!1),A.current=L.sessionId,a(L),c(n),d("live"),p(void 0),C.current||w(!1)}catch(le){if(j)return;d("offline"),p(Z.signal.aborted?"The project server did not respond. Retrying...":Zh(le)),C.current||w(!1)}finally{clearTimeout(Y),!j&&!K&&(T=setTimeout(()=>{R()},1e3))}};return R(),()=>{j=!0,D?.abort(),T&&clearTimeout(T)}},[e,n,E]);const B=q.useCallback(async(j,T)=>{if(!s||!e||u!=="live"||o!==n)throw new Error("Wait for the current session to reconnect.");if(C.current||y)throw new Error("A request is already in progress.");const D=new AbortController;_.current=D;const R=setTimeout(()=>D.abort(),1e4);C.current=!0,w(!0);try{const Z=await jo("/api/feedback/"+j,{method:"POST",headers:{"Content-Type":"application/json","X-Emviz-Token":s.token},body:JSON.stringify(T),signal:D.signal});if(!Z.ok)throw new Oo(await Pv(Z),Z.status>=500);if(j==="batch"){const Y=await Z.json().catch(()=>{});if(!tw(Y,T))throw new Oo("The server did not return a matching batch confirmation. Refresh to check delivery, or retry the same batch.",!0)}}catch(Z){throw z.current&&w(!1),Z instanceof Oo?Z:new Oo("The server did not confirm the request. Refresh to check its status, or retry the same batch.",!0)}finally{clearTimeout(R),C.current=!1,z.current&&x()}},[u,e,y,x,s,o,n]);return{snapshot:s,snapshotView:o,connection:u,error:h,changedSession:v,pending:y,refresh:x,command:B}}const eb={idle:"Idle",queued:"Queued",working:"Working",completed:"Completed",stopped:"Stopped"};function V3({session:e,view:n,onView:s,node:a,diff:o,showingBefore:c,message:u,onMessageChange:d,onAdded:h,drafts:p,queue:v,onQueueChange:g,storageNeedsReview:y}){const[w,E]=q.useState(),[N,A]=q.useState(),C=q.useRef(!1),z=e.snapshot,_=e.connection==="live"&&e.snapshotView===n,x=a?C3(z,n,_,a,o,c):"Select a current node to write feedback.",B=y?"Review the damaged saved feedback before sending. A previous batch may already have arrived.":D3(v,z,n,_,e.pending),j=z&&a?Jv(z,a,u,"preview"):void 0,T=x??(j&&u.trim()?Nl([...v.items,j]):void 0),D=z?.feedback,R=_&&!z?.stale&&!z?.error,Z=R&&D?.agent.connected,Y=D?.request,K=D?.history.filter(H=>H.id!==Y?.id)??[],le=Y?[...K,Y]:K,L=H=>{E(void 0),e.command(H,{}).catch(X=>E(Zh(X)))},G=H=>{if(H.preventDefault(),T||!z||!a||!u.trim())return;const X=Jv(z,a,u,Ov());g(W=>k3(W,X)),h(u)},k=async()=>{if(B||C.current)return;const H=R3(v,v.submission?.body.clientBatchId??Ov()),X=H.submission;if(X){C.current=!0,g(H);try{await e.command("batch",X.body),g(W=>ew(W,X.body.clientBatchId))}catch(W){g(O=>B3(O,X.body.clientBatchId,Zh(W),W instanceof Oo&&W.uncertain))}finally{C.current=!1}}},$=async H=>{try{await navigator.clipboard.writeText(H),A("Copied queued feedback.")}catch{A("Copy is unavailable. Select the message text and copy it manually.")}};return S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"agent-content",children:[S.jsxs("section",{className:"feedback-session","aria-label":"Feedback session",children:[S.jsxs("div",{className:"feedback-session-heading",children:[S.jsx("h2",{children:"Agent"}),S.jsx("span",{className:"feedback-state feedback-state-"+(D?.status??"idle"),role:"status",children:D?eb[D.status]:"No session"})]}),S.jsxs("p",{className:"agent-presence",children:[S.jsx("span",{"aria-hidden":"true",className:Z?"presence-dot connected":"presence-dot"}),R?Z?"Agent connected":"Agent disconnected":"Agent status unavailable"]}),S.jsxs("div",{className:"feedback-session-actions",children:[S.jsx("button",{type:"button",onClick:e.refresh,disabled:e.pending,children:"Refresh"}),D?D.status==="stopped"?S.jsx("button",{type:"button",onClick:()=>L("start"),disabled:!_||e.pending,children:"Resume session"}):S.jsx("button",{type:"button",onClick:()=>L("stop"),disabled:!_||e.pending,children:"Stop session"}):null]}),z?S.jsxs(S.Fragment,{children:[S.jsx("div",{className:"segmented feedback-views",role:"group","aria-label":"Model view",children:[["current","Current"],["session","Session diff"],["turn","Turn diff"]].map(([H,X])=>S.jsx("button",{type:"button","aria-pressed":n===H,onClick:()=>s(H),children:X},H))}),S.jsxs("p",{className:"feedback-baseline",children:["Baseline ",z.baseline.kind==="startup"?"startup snapshot":"Git"," · ",z.baseline.label]})]}):S.jsx("p",{className:"muted",children:"Feedback is available when a project session is running."}),e.connection==="checking"?S.jsx("p",{role:"status",children:"Refreshing the model..."}):null,e.error||z?.error||D?.error||w?S.jsx("p",{className:"feedback-error",role:"alert",children:w??e.error??z?.error??D?.error}):null,z?.stale||e.connection==="offline"?S.jsx("p",{className:"feedback-warning",children:"Showing the last available model and agent status. Feedback stays local until the project reconnects and loads valid files."}):null,e.changedSession?S.jsx("p",{className:"feedback-warning",children:"The project server restarted. The previous session history is no longer available."}):null,D?.status==="stopped"?S.jsx("p",{className:"feedback-warning",children:"The session is stopped. Stop your external editor before resuming. Stop session cannot stop an external process or undo its file writes."}):D?S.jsx("p",{className:"feedback-note",children:"Stop session cancels feedback. It cannot stop an external agent process or its file writes."}):null]}),a&&z?S.jsxs("form",{className:"feedback-composer","aria-label":"Node feedback",onSubmit:G,children:[S.jsxs("h3",{children:["Feedback for ",a.label]}),S.jsxs("p",{className:"feedback-target",children:[S.jsx("span",{children:a.type}),S.jsx("code",{children:j?.reference})]}),S.jsx("label",{htmlFor:"feedback-message",children:"Feedback message"}),S.jsx("textarea",{id:"feedback-message",value:u,maxLength:ll,rows:4,disabled:!!x,"aria-describedby":"feedback-help",placeholder:"Describe the change you want for this node.",onChange:H=>d(H.target.value)}),S.jsx("p",{className:"muted",id:"feedback-help",children:T??"Add this note to your local Queue. Send to Agent sends the whole Queue as one request."}),S.jsxs("div",{className:"feedback-composer-actions",children:[S.jsxs("small",{children:[u.length,"/",ll]}),S.jsx("button",{type:"submit",disabled:!!T||!u.trim(),children:"Add to Queue"})]})]}):S.jsx("p",{className:"agent-empty",children:"Select a current node to write feedback. Your Queue stays here as you move around the model."}),S.jsxs("section",{className:"feedback-queue","aria-label":"Feedback Queue",children:[S.jsxs("div",{className:"feedback-queue-heading",children:[S.jsx("h3",{children:"Queue"}),S.jsxs("span",{children:[v.items.length,"/",Om," · Unsent"]})]}),v.items.length?S.jsx("ol",{children:v.items.map(H=>{const X=zm(v,H.id),W=z?PS(H,z):void 0,O=v.editing?.id===H.id;return S.jsxs("li",{"data-queue-id":H.id,className:W?"feedback-queue-item needs-review":"feedback-queue-item",children:[S.jsxs("div",{className:"feedback-queue-item-heading",children:[S.jsx("strong",{children:H.identity.label}),S.jsx("small",{children:X?v.submission?.phase==="sending"?"Sending...":"Awaiting confirmation":"Unsent"})]}),S.jsx("code",{children:H.reference}),S.jsxs("p",{className:"feedback-captured",children:[H.identity.type," · Revision ",H.revision.slice(0,12)]}),W?S.jsx("p",{className:"feedback-warning",children:W}):null,O?S.jsxs(S.Fragment,{children:[S.jsxs("label",{className:"sr-only",htmlFor:"queue-edit-"+H.id,children:["Edit queued feedback for ",H.identity.label]}),S.jsx("textarea",{id:"queue-edit-"+H.id,value:v.editing?.message??"",maxLength:ll,rows:4,onChange:I=>g(ee=>({...ee,editing:{id:H.id,message:I.target.value}}))}),S.jsxs("div",{className:"feedback-queue-actions",children:[S.jsx("button",{type:"button",onClick:()=>g(I=>z3(I,H.id,I.editing?.message??H.message)),disabled:!v.editing?.message.trim(),children:"Save"}),S.jsx("button",{type:"button",onClick:()=>g(I=>({...I,editing:void 0})),children:"Cancel"})]})]}):S.jsxs(S.Fragment,{children:[S.jsx("p",{className:"feedback-message",children:H.message}),S.jsxs("div",{className:"feedback-queue-actions",children:[S.jsx("button",{type:"button","aria-label":"Edit queued feedback for "+H.identity.label,disabled:X||!!v.editing,onClick:()=>g(I=>({...I,editing:{id:H.id,message:H.message}})),children:"Edit"}),S.jsx("button",{type:"button","aria-label":"Remove queued feedback for "+H.identity.label,disabled:X,onClick:()=>g(I=>j3(I,H.id)),children:"Remove"}),S.jsx("button",{type:"button","aria-label":"Copy queued feedback for "+H.identity.label,onClick:()=>{$(H.message)},children:"Copy"})]})]})]},H.id)})}):S.jsx("p",{className:"muted",children:"No queued feedback. Add notes from the nodes you want to change, then send them together."}),N?S.jsx("p",{role:"status",children:N}):null]}),z?S.jsx(Y3,{drafts:p,snapshot:z}):null,le.length?S.jsxs("details",{className:"feedback-history",children:[S.jsxs("summary",{children:["Feedback history (",le.length,")"]}),S.jsx("ol",{"aria-label":"Feedback history",children:le.map(H=>S.jsxs("li",{"data-request-id":H.id,children:[H.items?.length?S.jsx("ul",{className:"feedback-request-items",children:H.items.map(X=>S.jsxs("li",{children:[S.jsx("code",{children:X.reference}),S.jsx("p",{children:X.message})]},X.id))}):S.jsxs(S.Fragment,{children:[S.jsx("code",{children:H.reference}),S.jsx("p",{children:H.message})]}),H.reply?S.jsx("p",{className:"feedback-reply",children:H.reply}):S.jsx("p",{className:"muted",children:H.id===Y?.id&&D?eb[D.status]:"No reply recorded."})]},H.id))})]}):null]}),S.jsxs("footer",{className:"feedback-send",children:[v.submission?.phase==="uncertain"?S.jsx("p",{className:"feedback-warning",children:"The send is not confirmed. These items are locked so a retry uses the same batch ID and contents. Refresh can confirm delivery without sending again."}):null,v.error?S.jsx("p",{className:"feedback-error",role:"alert",children:v.error}):null,z&&v.submission&&(v.submission.sessionId!==z.sessionId||v.submission.projectRoot!==z.project.root)?S.jsx("button",{type:"button",onClick:()=>g(H=>L3(H,z)),children:"Release previous-session batch"}):null,v.notice?S.jsx("p",{role:"status",children:v.notice}):null,B&&v.items.length>0?S.jsx("p",{className:"muted",id:"feedback-send-help",children:B}):null,S.jsx("button",{type:"button",className:"feedback-send-button",onClick:()=>{k()},disabled:!!B,"aria-describedby":B&&v.items.length?"feedback-send-help":void 0,children:v.submission?.phase==="sending"?"Sending...":v.submission?"Retry same batch":"Send to Agent"}),S.jsxs("small",{children:[v.items.length," queued ",v.items.length===1?"item":"items"," · One agent request"]})]})]})}function Y3({drafts:e,snapshot:n}){const[s,a]=q.useState();if(!e.length)return null;const o=async c=>{try{await navigator.clipboard.writeText(c.message),a("Copied draft for "+c.identity.label+".")}catch{a("Copy is unavailable. Select the draft text below and copy it manually.")}};return S.jsxs("details",{className:"feedback-history",children:[S.jsxs("summary",{children:["Unsent feedback drafts (",e.length,")"]}),S.jsxs("ol",{"aria-label":"Unsent feedback drafts",children:[e.map(c=>{const u=Fs(c.sessionId,c.identity),d=n.project.nodes.filter(p=>Fs(n.sessionId,p)===u&&n.diff?.nodeStatus[p.id]!=="removed"),h=c.sessionId!==n.sessionId?"Saved from a previous session. Copy the text before starting new feedback.":d.length===1?"Saved for the original node. Select that node to continue, or copy the text.":"The original node is no longer available or is ambiguous. Copy this draft to recover it.";return S.jsxs("li",{children:[S.jsx("strong",{children:c.identity.label}),S.jsxs("p",{className:"muted",children:[c.identity.type," · ",c.identity.sourcePath??"No source path"]}),S.jsx("p",{className:"feedback-warning",children:h}),S.jsx("p",{children:c.message}),S.jsx("button",{type:"button",onClick:()=>{o(c)},children:"Copy draft"})]},u)}),s?S.jsx("li",{role:"status",children:s}):null]})]})}function Ie(e,n,s,a,o){return{id:`${n}:${a??"project"}:${s}`,severity:e,check:n,message:s,path:a,nodeId:o}}function Ga(e){const n=new Set,s=new Set;for(const a of e){const o=a.trim().toLowerCase();o&&(n.has(o)&&s.add(a),n.add(o))}return[...s]}const G3=new Set(["sent","built","made","paid","booked","cancelled","canceled","submitted","recorded","created","updated","deleted","placed","notified"]);function X3(e){return e.match(/[A-Z]+(?=[A-Z][a-z]|$)|[A-Z]?[a-z]+|\d+/g)??[e]}function K3(e){const n=e.toLowerCase();return G3.has(n)||/(ed|en|d)$/i.test(e)}function Q3(e){return X3(e).some(K3)}function tb(e){return/(Requested|Triggered|Scheduled|Enqueued|Dispatched|Required)$/.test(e)}function Z3(e){return["Selected","Shown","Viewed","Clicked","Opened","Closed","Ticked","Incremented","Reached","Displayed","Navigated"].find(n=>e.includes(n))}function F3(e){const n=new Set(e.nodes.map(c=>c.id)),s=new Map;for(const c of n)s.set(c,new Set);for(const c of e.edges)!n.has(c.source)||!n.has(c.target)||(s.get(c.source)?.add(c.target),s.get(c.target)?.add(c.source));let a=0;const o=new Set;for(const c of n){if(o.has(c))continue;a+=1;const u=[c];for(o.add(c);u.length>0;){const d=u.shift();if(d)for(const h of s.get(d)??[])o.has(h)||(o.add(h),u.push(h))}}return a}function J3(e){const n=[...(e.actorIssues??[]).map(h=>Ie("error","A1",h.message,h.path)),...(e.modelIssues??[]).map(h=>Ie("error",h.check,h.message,h.path))],s=new Set(e.events.map(h=>h.name)),a=new Set(e.slices.map(h=>h.path)),o=new Map,c=new Map;for(const h of e.stories){h.slices.length>15&&n.push(Ie("warning","S4",`Story "${h.name}" has ${h.slices.length} slices; consider splitting it.`,h.path));for(const p of h.slices)a.has(p)||n.push(Ie("error","S2",`Story "${h.name}" lists missing slice "${p}".`,h.path))}for(const h of e.events){h.fields?.trim()||n.push(Ie("error","C4",`Event "${h.name}" has no fields block.`,h.sourcePath)),!Q3(h.name)&&!tb(h.name)&&n.push(Ie("warning","C3",`Event "${h.name}" does not obviously read as a past-tense domain event.`,h.sourcePath));const p=Z3(h.name);p&&n.push(Ie("warning","D1",`Event "${h.name}" contains red-flag verb "${p}"; confirm this is persisted domain state.`,h.sourcePath))}for(const h of e.slices){const p=h.commands.map(g=>g.name),v=h.queries.map(g=>g.name);for(const g of Ga(p))n.push(Ie("error","L9",`Command "${g}" is duplicated within slice "${h.title}".`,h.path));for(const g of Ga(v))n.push(Ie("error","L9",`Query "${g}" is duplicated within slice "${h.title}".`,h.path));for(const g of Ga(h.screen.reads))n.push(Ie("error","L9",`screen.reads lists "${g}" more than once.`,h.path));for(const g of Ga(h.screen.executes))n.push(Ie("error","L9",`screen.executes lists "${g}" more than once.`,h.path));for(const g of h.screen.reads)v.includes(g)||n.push(Ie("error","W2",`screen.reads references missing local query "${g}".`,h.path));for(const g of h.screen.executes)p.includes(g)||n.push(Ie("error","W1",`screen.executes references missing local command "${g}".`,h.path));h.screen.type==="system"&&h.screen.actors.length>0&&n.push(Ie("error","L5",`System slice "${h.title}" must not declare screen.actors.`,h.path)),h.storyName||n.push(Ie("warning","M2",`Slice "${h.title}" is not listed by any story.`,h.path)),h.commands.length>0&&h.gwt.length===0&&n.push(Ie("warning","M1",`Command slice "${h.title}" has no GWT scenarios.`,h.path));for(const g of h.commands){g.fields?.trim()||n.push(Ie("warning","L6",`Command "${g.name}" has no fields block.`,h.path));for(const y of g.produces)s.has(y)||n.push(Ie("error","G1",`Command "${g.name}" produces unregistered event "${y}".`,h.path)),o.set(y,[...o.get(y)??[],`${h.title}.${g.name}`])}for(const g of h.queries){g.fields?.trim()||n.push(Ie("warning","L7",`Query "${g.name}" has no fields block.`,h.path)),g.name.includes("For")||n.push(Ie("warning","N1",`Query "${g.name}" should use a descriptive <Thing>For<UseCaseOrScreen> name.`,h.path));for(const y of g.fromEvents)s.has(y)||n.push(Ie("error","G2",`Query "${g.name}" reads unregistered event "${y}".`,h.path)),c.set(y,[...c.get(y)??[],`${h.title}.${g.name}`])}for(const g of h.gwt)for(const y of[...g.given,...g.when,...g.then])(!y.type||!["event","command","query","error"].includes(y.type))&&n.push(Ie("error","L8",`GWT scenario "${g.name??"Unnamed"}" has invalid item type "${y.type??""}".`,h.path)),y.name||n.push(Ie("error","L8",`GWT scenario "${g.name??"Unnamed"}" has an item without a name.`,h.path))}for(const h of s){const p=o.get(h)??[],v=c.get(h)??[];p.length===0&&n.push(Ie("error","G3",`Event "${h}" is registered but no command produces it.`)),p.length>1&&n.push(Ie("warning","G8",`Event "${h}" has multiple producers: ${p.join(", ")}.`)),p.length>0&&v.length===0&&n.push(Ie("warning",tb(h)?"G4b":"G4a",`Event "${h}" is produced but no query consumes it.`))}for(const[h,p]of c.entries())(o.get(h)??[]).length===0&&n.push(Ie("error","G3",`Event "${h}" is read by ${p.join(", ")} but no command produces it.`));for(const h of Ga(e.slices.flatMap(p=>p.commands.map(v=>v.name))))n.push(Ie("warning","M5",`Command name "${h}" is used in multiple slices; command names should be globally unique.`));for(const h of Ga(e.slices.flatMap(p=>p.queries.map(v=>v.name))))n.push(Ie("warning","G7",`Query name "${h}" is used in multiple slices; query names should be globally unique.`));const u=e.slices.filter(h=>h.commands.length>0).length;u>0&&e.events.length/u>2&&n.push(Ie("warning","M4",`The model has ${(e.events.length/u).toFixed(1)} events per command slice; check for UI/runtime events leaking into the model.`));const d=F3(e);return d>1&&n.push(Ie("info","I3",`The graph has ${d} disconnected islands.`)),{errors:n.filter(h=>h.severity==="error").length,warnings:n.filter(h=>h.severity==="warning").length,findings:n}}const sw=du.createContext({open:()=>{},list:()=>{}});function aw(){return S.jsxs(S.Fragment,{children:[S.jsx(En,{id:"top-target",type:"target",position:he.Top,style:{left:"46%"}}),S.jsx(En,{id:"top-source",type:"source",position:he.Top,style:{left:"54%"}}),S.jsx(En,{id:"bottom-target",type:"target",position:he.Bottom,style:{left:"46%"}}),S.jsx(En,{id:"bottom-source",type:"source",position:he.Bottom,style:{left:"54%"}}),S.jsx(En,{id:"left-target",type:"target",position:he.Left,style:{top:"46%"}}),S.jsx(En,{id:"left-source",type:"source",position:he.Left,style:{top:"54%"}}),S.jsx(En,{id:"right-target",type:"target",position:he.Right,style:{top:"46%"}}),S.jsx(En,{id:"right-source",type:"source",position:he.Right,style:{top:"54%"}})]})}function xh({title:e,items:n}){const s=n&&n.length>0?n:[{type:"empty",name:"empty"}];return S.jsxs("div",{className:"gwt-step",children:[S.jsx("div",{className:"gwt-step-title",children:e}),S.jsx("div",{className:"gwt-step-items",children:s.map((a,o)=>S.jsxs("div",{className:`gwt-step-item gwt-step-item-${a.type??"empty"}`,children:[S.jsx("span",{children:a.type??"empty"}),S.jsxs("div",{className:"gwt-item-content",children:[S.jsx("strong",{children:a.name??"empty"}),a.fields?S.jsx("pre",{children:a.fields}):null]})]},`${o}-${a.type??"empty"}-${a.name??""}`))})]})}function W3({nodeData:e}){const n=du.useContext(sw),s=e.scenarios??[];return S.jsxs("div",{className:`em-node em-node-gwt ${e.selected?"selected":""} ${e.diffStatus?`diff-node-${e.diffStatus}`:""}`,children:[S.jsx(aw,{}),S.jsxs("div",{className:"node-type",children:["GWT · ",s.length," cases"]}),e.scenarioStatus?S.jsx("div",{className:"gwt-diff-counts",children:["added","removed","changed"].map(a=>`${a}: ${s.filter(o=>e.scenarioStatus?.[o.id]===a).length}`).join(" · ")}):null,S.jsx("div",{className:"gwt-summary nodrag nopan nowheel",children:s.slice(0,3).map(a=>S.jsxs("button",{type:"button","aria-current":e.selectedScenarioId===a.id?"true":void 0,onClick:o=>{o.stopPropagation(),n.open(a.id)},children:[S.jsx("span",{className:"gwt-scenario-name",children:a.label}),e.scenarioStatus?S.jsx("span",{className:"gwt-scenario-status",children:` · ${e.scenarioStatus[a.id]??"unchanged"}`}):null]},a.id))}),S.jsx("div",{className:"gwt-more nodrag nopan nowheel",children:s.length>3?S.jsxs("button",{type:"button",onClick:a=>{a.stopPropagation(),n.list(e.projectNode.id)},children:["+",s.length-3," more"]}):null})]})}function lw({node:e}){const n=ZS(e);return n.length===0?null:S.jsx("div",{className:"chips actor-chips nodrag nopan nowheel","aria-label":"Actors",children:n.map(s=>S.jsxs("span",{className:"actor-chip","data-actor-id":s.id,title:s.name+" ("+s.id+")",style:{borderColor:s.color},children:[S.jsx("i",{className:"actor-swatch","aria-hidden":"true",style:{backgroundColor:s.color}}),S.jsx("span",{className:"actor-name",children:s.name})]},s.id))})}function P3({data:e}){const n=e,s=n.projectNode,a=n.diffStatus&&n.diffStatus!=="unchanged"?S.jsx("div",{className:`diff-badge diff-badge-${n.diffStatus}`,children:n.diffStatus}):null;return s.type==="gwt"?S.jsx(W3,{nodeData:n}):S.jsxs("div",{className:`em-node em-node-${s.type} ${n.selected?"selected":""} ${n.connected?"connected":""} ${n.diffStatus?`diff-node-${n.diffStatus}`:""}`,children:[S.jsx(aw,{}),a,S.jsx("div",{className:"node-type",children:s.type}),S.jsx("div",{className:"node-label",children:s.label}),S.jsx(lw,{node:s})]})}function ek({data:e}){const n=e,s=n.projectNode;return S.jsxs("div",{className:`group-node group-${s.type} ${n.selected?"selected":""} ${n.diffStatus?`diff-node-${n.diffStatus}`:""}`,children:[n.diffStatus&&n.diffStatus!=="unchanged"?S.jsx("div",{className:`diff-badge diff-badge-${n.diffStatus}`,children:n.diffStatus}):null,S.jsxs("div",{className:"group-title",children:[s.label,s.type==="slice"&&n.actorRelated?S.jsx("span",{className:"actor-related-badge",children:"Related"}):null]}),s.description?S.jsx("div",{className:"group-description",children:s.description}):null]})}const tk={eventModelNode:P3,groupNode:ek};function nb(e){return e===he.Top?{x:0,y:-1}:e===he.Right?{x:1,y:0}:e===he.Bottom?{x:0,y:1}:{x:-1,y:0}}function nk({sourceX:e,sourceY:n,targetX:s,targetY:a,sourcePosition:o,targetPosition:c,data:u}){const d=u,h=s-e,p=a-n,v=Math.max(56,Math.min(180,Math.abs(p)*.42)),g=Math.max(70,Math.min(180,Math.abs(h)*.38)),y=Math.max(72,Math.min(180,Math.max(Math.abs(h),Math.abs(p))*.38));if(d?.route==="same-slice-read"){const N=o===he.Top?-1:1,A=c===he.Bottom?1:-1,C=Math.max(72,Math.min(150,Math.abs(p)*.65));return`M ${e},${n} C ${e},${n+N*C} ${s},${a+A*C} ${s},${a}`}if(d?.route==="event-read"){const N=nb(o),A=nb(c);return`M ${e},${n} C ${e+N.x*y},${n+N.y*y} ${s+A.x*y},${a+A.y*y} ${s},${a}`}if(o===he.Bottom||o===he.Top){const N=o===he.Top?-1:1,A=c===he.Top?-1:1;return`M ${e},${n} C ${e},${n+N*v} ${s},${a+A*v} ${s},${a}`}const w=o===he.Left?-1:1,E=c===he.Left?-1:1;return`M ${e},${n} C ${e+w*g},${n} ${s+E*g},${a} ${s},${a}`}function ik(e){const n=e.data,s=n?.diffStatus==="added"?"#15803d":n?.diffStatus==="removed"?"#b91c1c":n?.diffStatus==="changed"?"#b45309":void 0,a=n?.active?"#111827":s??"#64748b",o=n?.fieldFlow,c=!!(n?.selectedFieldName&&(o?.sharedFieldNames.includes(n.selectedFieldName)||o?.derivedFieldNames.includes(n.selectedFieldName))),u=(e.sourceX+e.targetX)/2,d=(e.sourceY+e.targetY)/2;return S.jsxs(S.Fragment,{children:[S.jsx(ir,{path:nk(e),markerEnd:e.markerEnd,style:{...e.style,stroke:a,strokeDasharray:n?.diffStatus==="removed"?"7 5":void 0,strokeWidth:n?.diffStatus&&n.diffStatus!=="unchanged"?2.4:void 0},className:n?.active?"edge-path-active":"edge-path"}),o&&o.visibleFieldNames.length>0&&(n?.active||c)?S.jsx(iM,{children:S.jsxs("div",{className:`edge-field-label nodrag nopan ${n?.active?"active":""} ${c?"field-selected":""}`,style:{transform:`translate(-50%, -50%) translate(${u}px, ${d}px)`},children:[o.visibleFieldNames.map(h=>S.jsx("button",{type:"button",onClick:()=>n?.onSelectField?.(h),children:h},h)),o.remainingCount>0?S.jsxs("span",{children:["+",o.remainingCount]}):null]})}):null]})}const sk={eventModelEdge:ik};function $c({label:e,description:n,value:s,copiedKey:a,onCopy:o}){return S.jsx("button",{type:"button",className:"copy-action",onClick:()=>o(a,s),children:S.jsxs("span",{children:[S.jsx("strong",{children:e}),S.jsx("small",{children:n})]})})}function ow(e){return e==="query-screen"||e==="screen-command"||e==="command-event"||e==="event-query"}function ak(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function lk(e){return(e.graphSidecar?.model?.name??e.graphSidecar?.model?.id??"event-model").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"event-model"}async function ib(e){const n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch ${e}: ${n.status}`);return n.text()}async function ok(e,n,s,a){const o=Array.from(document.querySelectorAll('script[type="module"][src]')).map(v=>new URL(v.src,window.location.href)).filter(v=>!v.pathname.includes("/@vite/")&&!v.pathname.endsWith("/@react-refresh"));if(o.length===0||o.some(v=>v.pathname.includes("/src/")||v.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 c=Array.from(document.querySelectorAll('link[rel="stylesheet"][href]')).map(v=>new URL(v.href,window.location.href)),u=await Promise.all(c.map(v=>ib(v.href))),d=Array.from(document.querySelectorAll("style")).map(v=>v.textContent??"").filter(Boolean),h=await Promise.all(o.map(v=>ib(v.href))),p={project:e,report:n,diff:s,timelineId:a,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 - ${e.graphSidecar?.model?.name??"export"}</title>`,` <style>${[...u,...d].join(`
154
-
155
- `)}</style>`," </head>"," <body>",' <div id="root"></div>',` <script>window.__EMVIZ_EXPORT__ = ${ak(p)};<\/script>`,` <script type="module">${h.join(`
156
-
157
- `)}<\/script>`," </body>","</html>"].join(`
158
- `)}function rk({diff:e,filter:n,onFilter:s,onSelect:a}){const o=Object.entries(e.nodeStatus).filter(([,c])=>c!=="unchanged").slice(0,80);return S.jsxs("aside",{className:"panel diff-panel",children:[S.jsx("h2",{children:"Diff"}),S.jsx("p",{children:"All stories are shown in diff views so removed items remain accessible."}),e.timelinesChanged?S.jsx("p",{role:"status",children:"Timeline layout changed. Ordering does not add event dependencies."}):null,S.jsxs("div",{className:"diff-range",children:[S.jsx("code",{children:e.base.label}),S.jsx("span",{children:"to"}),S.jsx("code",{children:e.target.label})]}),S.jsxs("div",{className:"diff-counts",children:[S.jsxs("button",{type:"button",className:n==="added"?"active added":"added",onClick:()=>s(n==="added"?"all":"added"),children:[S.jsx("strong",{children:e.summary.nodes.added}),S.jsx("span",{children:"Added"})]}),S.jsxs("button",{type:"button",className:n==="removed"?"active removed":"removed",onClick:()=>s(n==="removed"?"all":"removed"),children:[S.jsx("strong",{children:e.summary.nodes.removed}),S.jsx("span",{children:"Removed"})]}),S.jsxs("button",{type:"button",className:n==="changed"?"active changed":"changed",onClick:()=>s(n==="changed"?"all":"changed"),children:[S.jsx("strong",{children:e.summary.nodes.changed}),S.jsx("span",{children:"Changed"})]})]}),n!=="all"?S.jsx("button",{type:"button",className:"clear-diff-filter",onClick:()=>s("all"),children:"Show full graph"}):null,S.jsx("h3",{children:"Changed Nodes"}),S.jsx("div",{className:"diff-list",children:o.length===0?S.jsx("p",{className:"muted",children:"No node changes."}):o.map(([c,u])=>S.jsxs("button",{type:"button",className:`diff-list-item ${u}`,onClick:()=>a(c),children:[S.jsx("span",{children:c}),S.jsx("strong",{children:u})]},c))})]})}function ck(e,n){const s=URL.createObjectURL(new Blob([n],{type:"text/html;charset=utf-8"})),a=document.createElement("a");a.href=s,a.download=e,a.click(),URL.revokeObjectURL(s)}async function uk(e){return await Promise.all(Array.from(e).filter(s=>/\.(ya?ml|json)$/i.test(s.name)).map(async s=>({path:s.webkitRelativePath||s.name,content:await s.text()})))}function fk(e){const n=e.find(s=>s.path===".event-modeling/graph.json"||s.path.endsWith("/.event-modeling/graph.json"));if(n)try{return JSON.parse(n.content)}catch{return}}function dk(e){return e.type==="story"?{name:e.label}:e.type==="slice"?{slice:e.label}:e.type==="screen"||e.type==="processor"?{slice:e.sliceTitle??e.label}:e.type==="command"||e.type==="query"?{slice:e.sliceTitle??"",name:e.sourceName??e.label}:{name:e.sourceName??e.label}}function hk(e){const n=e.graphSidecar?.nodes;return n?Object.entries(n).flatMap(([s,a])=>{const o=a,c=e.nodes.filter(u=>{if(o.type==="screen"&&u.type!=="screen"&&u.type!=="processor"||o.type!=="screen"&&o.type!==u.type)return!1;const d=dk(u);return Object.entries(o.selector??{}).every(([h,p])=>d[h]===p)});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 mk({onImport:e,error:n}){return S.jsx("div",{className:"import-panel",children:S.jsxs("div",{className:"import-card",children:[S.jsx("h1",{children:"emviz"}),S.jsx("p",{children:"Import an Event Modeling project folder or select YAML/JSON files to visualize the model."}),S.jsxs("div",{className:"import-actions",children:[S.jsxs("label",{children:["Import folder",S.jsx("input",{type:"file",multiple:!0,webkitdirectory:"",directory:"",onChange:s=>s.currentTarget.files&&e(s.currentTarget.files)})]}),S.jsxs("label",{children:["Import files",S.jsx("input",{type:"file",multiple:!0,accept:".yaml,.yml,.json",onChange:s=>s.currentTarget.files&&e(s.currentTarget.files)})]})]}),n?S.jsx("p",{className:"import-error",children:n}):null]})})}function pk({tab:e,onTab:n}){return S.jsx("div",{className:"inspector-tabs",role:"tablist","aria-label":"Inspector",children:["details","agent"].map(s=>S.jsx("button",{type:"button",id:"inspector-tab-"+s,role:"tab","aria-selected":e===s,"aria-controls":"inspector-"+s,tabIndex:e===s?0:-1,onClick:()=>n(s),onKeyDown:a=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(a.key))return;a.preventDefault();const o=a.key==="Home"?"details":a.key==="End"||s==="details"?"agent":"details";n(o),requestAnimationFrame(()=>document.getElementById("inspector-tab-"+o)?.focus())},children:s==="details"?"Details":"Agent"},s))})}function gk({project:e,selectedNode:n,diff:s,findings:a,selectedFieldName:o,onSelect:c,onSelectField:u,onClearField:d,onPreviewConnection:h,onClearPreview:p,gwtList:v,onGwtList:g,onClose:y,onFocusNode:w,tab:E,onTab:N,agentPanel:A,oldVersionId:C,onVersion:z}){const _=Mm(s,n),x=n&&_&&C===n?.id?{..._,id:n.id}:n,[B,j]=q.useState(),[T,D]=q.useState(""),R=q.useRef(null),Z=q.useRef(0),Y=!!v;q.useLayoutEffect(()=>{Y&&R.current&&(R.current.scrollTop=Z.current)},[Y,E]);const K=ae=>{ae.key!=="Escape"&&ae.stopPropagation()},le=q.useCallback((ae,te)=>{navigator.clipboard?.writeText(te).then(()=>{j(ae),window.setTimeout(()=>j(ue=>ue===ae?void 0:ue),1400)})},[]),L=S.jsx(pk,{tab:E,onTab:N});if(E==="agent")return S.jsxs("aside",{id:"inspector-agent",className:"panel panel-right agent-panel","aria-label":"Agent",onKeyDown:K,onKeyUp:K,children:[L,A]});if(v){const ae=T.trim().toLowerCase(),te=v.filter(ue=>ue.label.toLowerCase().includes(ae));return S.jsxs("aside",{ref:R,id:"inspector-details",className:"panel panel-right gwt-panel","aria-label":"GWT scenarios",onKeyDown:K,onKeyUp:K,onScroll:ue=>{Z.current=ue.currentTarget.scrollTop},children:[L,S.jsx("button",{type:"button",onClick:y,children:"Close"}),S.jsxs("h2",{children:[v[0]?.sliceTitle," · All scenarios (",v.length,")"]}),S.jsxs("div",{className:"gwt-filter",children:[S.jsx("label",{htmlFor:"gwt-name-filter",children:"Filter by scenario name"}),S.jsx("input",{id:"gwt-name-filter",type:"search",value:T,onChange:ue=>{D(ue.target.value),Z.current=0,R.current&&(R.current.scrollTop=0)}}),S.jsx("button",{type:"button",disabled:!T,onClick:()=>{D(""),Z.current=0,R.current&&(R.current.scrollTop=0),R.current?.querySelector("input")?.focus({preventScroll:!0})},children:"Clear filter"})]}),S.jsx("p",{role:"status",children:te.length?`${te.length} of ${v.length} scenarios`:"No scenarios match this name."}),S.jsx("div",{className:"gwt-all-list",children:te.map(ue=>S.jsxs("button",{type:"button","aria-current":x?.id===ue.id?"true":void 0,onClick:()=>{Z.current=R.current?.scrollTop??Z.current,c(ue.id)},children:[ue.label,s?` · ${s.nodeStatus[ue.id]??"unchanged"}`:""]},ue.id))})]})}if(!x)return S.jsxs("aside",{id:"inspector-details",className:"panel panel-right","aria-label":"Node details",children:[L,S.jsx("h2",{children:"Selection"}),S.jsx("p",{className:"muted",children:"Select a node to inspect source and connections."})]});const G=!!(_&&C===n?.id)||s?.nodeStatus[x.id]==="removed",k=G?_3(e,s):A3(e,s),$=new Map(k.nodes.map(ae=>[ae.id,ae])),H=k.edges.filter(ae=>{const te=$.get(ae.source),ue=$.get(ae.target);return ow(ae.kind)&&te&&ue&&te.type!=="gwt"&&ue.type!=="gwt"}),X=H.filter(ae=>ae.target===x.id),W=H.filter(ae=>ae.source===x.id),O=X1(x.fields),ee=`em://${e.graphSidecar?.model?.id??"event_model"}/${x.id}`,ne=x.raw??x.fields??x.description??x.label,fe=[`Reference: ${ee}`,`Node: ${x.label} (${x.type})`,`Source: ${x.sourcePath??"unknown"}`,"","Incoming:",...X.length===0?["- none"]:X.map(ae=>`- ${$.get(ae.source)?.label??ae.source} -> ${x.label}`),"","Outgoing:",...W.length===0?["- none"]:W.map(ae=>`- ${x.label} -> ${$.get(ae.target)?.label??ae.target}`),"","Source excerpt:",ne].join(`
159
- `),de=`Please update this event model node.
160
-
161
- Reference:
162
- ${ee}
163
-
164
- Source path:
165
- ${x.sourcePath??"unknown"}
166
-
167
- Current context:
168
- ${ne}
169
-
170
- Goal:
171
- `;return S.jsxs("aside",{id:"inspector-details",className:`panel panel-right ${x.type==="gwt"?"gwt-panel":""}`,"aria-label":"Node details",onKeyDown:K,onKeyUp:K,children:[L,x.type==="gwt"?S.jsxs("div",{className:"gwt-panel-actions",children:[S.jsx("button",{type:"button",onClick:()=>g(x.id),children:"All scenarios"}),S.jsx("button",{type:"button",onClick:y,children:"Close"})]}):null,S.jsxs("div",{className:"panel-heading",children:[S.jsx("h2",{children:x.label}),S.jsx("button",{type:"button",className:"icon-button",onClick:()=>w(x.id),"aria-label":"Focus selected node",title:"Focus selected node",children:S.jsx("span",{className:"target-icon","aria-hidden":"true"})})]}),s&&n?S.jsxs("p",{children:[s.nodeStatus[n.id]," · ",G?"Old version":"New version"]}):null,_?S.jsxs("div",{className:"gwt-panel-actions",role:"group","aria-label":"Node version",children:[S.jsx("button",{type:"button","aria-pressed":C!==n?.id,onClick:()=>z(void 0),children:"New version"}),S.jsx("button",{type:"button","aria-pressed":C===n?.id,onClick:()=>z(n?.id),children:"Old version"})]}):null,x.type==="gwt"?S.jsxs("section",{"aria-label":"Scenario details",children:[x.description?S.jsx("p",{children:x.description}):null,S.jsx(xh,{title:"Given",items:x.given}),S.jsx(xh,{title:"When",items:x.when}),S.jsx(xh,{title:"Then",items:x.then}),S.jsx("p",{className:"muted",children:"YAML below is the source slice, not an individual scenario excerpt."})]}):null,S.jsxs("div",{className:"meta-row",children:[S.jsx("span",{children:"Type"}),S.jsx("strong",{children:x.type})]}),S.jsx(lw,{node:x}),S.jsxs("div",{className:"meta-row",children:[S.jsx("span",{children:"Reference"}),S.jsx("code",{children:ee})]}),x.sourcePath?S.jsxs("div",{className:"meta-row",children:[S.jsx("span",{children:"Source"}),S.jsx("code",{children:x.sourcePath})]}):null,S.jsxs("details",{className:"copy-section",children:[S.jsxs("summary",{children:[S.jsx("span",{children:"Copy for LLM"}),B?S.jsxs("strong",{className:"copy-feedback","aria-live":"polite",children:["Copied ",B]}):null]}),S.jsxs("div",{className:"copy-actions",children:[S.jsx($c,{label:"Reference",description:"Stable em:// node handle",value:ee,copiedKey:"reference",onCopy:le}),S.jsx($c,{label:"YAML",description:x.type==="gwt"?"Source YAML for the whole slice":"Source excerpt for this node",value:ne,copiedKey:"YAML",onCopy:le}),S.jsx($c,{label:"Context",description:"Reference plus incoming/outgoing links",value:fe,copiedKey:"context",onCopy:le}),S.jsx($c,{label:"Edit prompt",description:"Prompt scaffold for asking an LLM to edit",value:de,copiedKey:"prompt",onCopy:le})]})]}),S.jsx("h3",{children:"Connections"}),S.jsxs("div",{className:"connection-list",children:[S.jsx("strong",{children:"Incoming"}),X.length===0?S.jsx("p",{className:"muted",children:"None"}):X.map(ae=>S.jsx("button",{type:"button",className:"connection-button",onClick:()=>c(ae.source),onMouseEnter:()=>h(ae.id),onMouseLeave:p,onFocus:()=>h(ae.id),onBlur:p,children:S.jsx("span",{children:$.get(ae.source)?.label??ae.source})},ae.id)),S.jsx("strong",{children:"Outgoing"}),W.length===0?S.jsx("p",{className:"muted",children:"None"}):W.map(ae=>S.jsx("button",{type:"button",className:"connection-button",onClick:()=>c(ae.target),onMouseEnter:()=>h(ae.id),onMouseLeave:p,onFocus:()=>h(ae.id),onBlur:p,children:S.jsx("span",{children:$.get(ae.target)?.label??ae.target})},ae.id))]}),x.type==="command"||x.type==="event"||x.type==="query"?S.jsxs(S.Fragment,{children:[S.jsx("h3",{children:"Fields"}),S.jsxs("div",{className:"field-panel",children:[O.length===0?S.jsx("p",{className:"field-empty",children:"No fields documented."}):S.jsx("div",{className:"field-list",children:O.map(ae=>S.jsx("button",{type:"button",className:o===ae?"selected":"",onClick:()=>u(ae),children:ae},ae))}),o?S.jsx("button",{type:"button",className:"clear-field",onClick:d,children:"Clear field focus"}):null]})]}):null,S.jsx("h3",{children:"Findings"}),a.length===0?S.jsx("p",{className:"muted",children:"No findings for this node."}):a.map(ae=>S.jsxs("div",{className:`finding finding-${ae.severity}`,children:[S.jsx("strong",{children:ae.check}),S.jsx("span",{children:ae.message})]},ae.id)),S.jsx("h3",{children:x.type==="gwt"?"Source slice YAML":"Source"}),S.jsx("pre",{children:ne})]})}function yk({report:e,onSelect:n,open:s,onOpen:a,onClose:o}){const c=e?.errors??0,u=e?.warnings??0,d=c+u;return S.jsxs(S.Fragment,{children:[S.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:[S.jsx("span",{"aria-hidden":"true",children:"!"}),d>0?S.jsx("strong",{"aria-label":`${d} validation findings`,children:d}):null]}),s?S.jsxs("aside",{className:"panel validation-drawer",id:"validation-panel",children:[S.jsxs("div",{className:"panel-heading",children:[S.jsx("h2",{children:"Validation"}),S.jsx("button",{type:"button",className:"panel-close",onClick:o,"aria-label":"Close validation",children:"Close"})]}),e?S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"status-row",children:[S.jsxs("span",{className:"status error",children:[e.errors," errors"]}),S.jsxs("span",{className:"status warning",children:[e.warnings," warnings"]})]}),S.jsx("div",{className:"findings-list",children:e.findings.length===0?S.jsx("p",{className:"muted",children:"No validation findings."}):e.findings.map(h=>S.jsxs("div",{className:`finding finding-${h.severity}`,children:[S.jsxs("div",{className:"finding-header",children:[S.jsx("strong",{children:h.check}),h.nodeId?S.jsx("button",{type:"button",onClick:()=>n(h.nodeId),children:"Focus"}):null]}),S.jsx("span",{children:h.message}),h.path?S.jsx("code",{children:h.path}):null]},h.id))})]}):S.jsx("p",{className:"muted",children:"Loading validation..."})]}):null]})}function vk(){const[e,n]=q.useState(),[s,a]=q.useState(),[o,c]=q.useState(),[u,d]=q.useState(()=>window.__EMVIZ_EXPORT__?.timelineId),[h,p]=q.useState("all"),[v,g]=q.useState({actorIds:[],includeUnassigned:!1}),y=q.useRef(void 0),[w,E]=q.useState("loading"),[N,A]=q.useState("remote"),[C,z]=q.useState(),[_,x]=q.useState(!1),[B,j]=q.useState("idle"),[T,D]=q.useState(),[R,Z]=q.useState(()=>{try{return U3(sessionStorage.getItem("emviz:feedback-workspace:v1"))}catch{return km()}}),{drafts:Y,queue:K}=R,[le,L]=q.useState(),[G,k]=q.useState("details"),[$,H]=q.useState(),X=q.useCallback(ie=>{Z(me=>{const Ne=typeof ie=="function"?ie(me.queue):ie;return Ne===me.queue?me:{...me,queue:Ne}})},[]);q.useEffect(()=>{if(R.recoveryWarning){L(R.recoveryWarning);return}try{sessionStorage.setItem("emviz:feedback-workspace:v1",I3(R)),L(void 0)}catch{L("Browser storage is unavailable. Your drafts and Queue are kept in this tab, but reloading the page may lose them.")}},[R]);const[W,O]=q.useState(),[I,ee]=q.useState(),ne=us(e,W)?.id,fe=us(e,I)?.id,de=q.useRef(null),[ae,te]=q.useState([]),[ue,Se]=q.useState([]),[we,ge]=q.useState(""),[ve,Ee]=q.useState(),[Me,Be]=q.useState(),[Et,Bt]=q.useState(!1),{setCenter:Nt,fitView:We}=Eu(),[St,ti]=q.useState("current"),He=q3(!window.__EMVIZ_EXPORT__&&N==="remote"&&w!=="import",St);q.useEffect(()=>{He.snapshot&&X(ie=>$3(ie,He.snapshot))},[He.snapshot,X]);const Ye=q.useRef(void 0),_t=He.snapshot?JSON.stringify([He.snapshot.sessionId,He.snapshot.revision,St,He.snapshot.feedback.request?.id,He.snapshot.feedback.status]):void 0,Ht={...He,connection:N!=="remote"||window.__EMVIZ_EXPORT__?"unavailable":He.connection==="live"&&_t&&Ye.current?.key!==_t?"checking":He.connection};q.useEffect(()=>{if(window.__EMVIZ_EXPORT__?.project){n(window.__EMVIZ_EXPORT__.project),a(window.__EMVIZ_EXPORT__.report),c(window.__EMVIZ_EXPORT__.diff),E("ready"),window.setTimeout(()=>{We({padding:.18,duration:300})},50);return}if(N==="local"||He.connection!=="unavailable")return;let ie=!1;return Promise.all([jo("/api/model").then(me=>me.json()),jo("/api/validation").then(me=>me.ok?me.json():void 0).catch(()=>{}),jo("/api/diff").then(me=>me.ok?me.json():void 0).catch(()=>{})]).then(([me,Ne,Je])=>{if(!ie){if(!me||!Array.isArray(me.nodes)||!Array.isArray(me.edges))throw new Error("No project server is available.");n(me),a(Ne),c(Je),E("ready"),window.setTimeout(()=>{We({padding:.18,duration:300})},50)}}).catch(()=>{ie||E("import")}),()=>{ie=!0}},[We,He.connection,N]),q.useEffect(()=>{const ie=He.snapshot;if(!ie||He.snapshotView!==St)return;const me=_t;if(Ye.current?.key===me)return;const Ne=!Ye.current;Ye.current&&Ye.current.sessionId!==ie.sessionId&&(O(void 0),ee(void 0),g({actorIds:[],includeUnassigned:!1}),te([]),Se([]),Be(void 0)),Ye.current={key:me,sessionId:ie.sessionId},n(ie.project),a(ie.validation),c(ie.diff),E("ready"),Ee(void 0),Ne&&window.setTimeout(()=>{We({padding:.18,duration:300})},50)},[We,He.snapshot,He.snapshotView,_t,St]);const Ut=q.useMemo(()=>e?FS(e,o?.previousNodes):[],[e,o?.previousNodes]),It=!!(e?.nodes.some(ie=>ie.type==="screen"&&!ie.actors?.length)||Object.values(o?.previousNodes??{}).some(ie=>ie.type==="screen"&&!ie.actors?.length));q.useEffect(()=>{if(!e)return;const ie=y.current!==e.root;y.current=e.root,g(me=>ie?{actorIds:[],includeUnassigned:!1}:r3(e,me,o?.previousNodes))},[e,o?.previousNodes]),q.useEffect(()=>{e&&(W&&!us(e,W)&&O(void 0),I&&!us(e,I)&&ee(void 0),te(ie=>ie.filter(me=>us(e,me))),Se(ie=>ie.filter(me=>us(e,me))))},[e,W,I]);const dt=q.useMemo(()=>e?.nodes.find(ie=>ie.id===ne),[e,ne]),An=He.snapshot?.sessionId,ys=An&&dt?Fs(An,dt):void 0;q.useEffect(()=>H(void 0),[ys]);const ta=(ie,me)=>{!An||!dt||Z(Ne=>({...Ne,drafts:E3(Ne.drafts,An,dt,ie,me)}))},ni=q.useMemo(()=>s?.findings.filter(ie=>ie.nodeId===ne)??[],[s,ne]),ht=q.useMemo(()=>e?DM(e):new Map,[e]),en=q.useMemo(()=>{if(ve)return new Set([ve]);const ie=RM(ht,Me);if(ie)return ie;if(!e||!ne)return;const me=new Set;for(const Ne of e.edges)ow(Ne.kind)&&(Ne.source===ne||Ne.target===ne)&&me.add(Ne.id);return me},[ht,ve,e,Me,ne]),Qe=q.useMemo(()=>e?Zv(e,ne,{timelineId:Dv(u,!!o),focusedEdgeIds:en,edgeFieldFlows:ht,selectedFieldName:Me,onSelectField:Be,diffNodeStatus:o?.nodeStatus,diffEdgeStatus:o?.edgeStatus,diffFilter:h,actorFilter:v,previousNodes:o?.previousNodes}):{nodes:[],edges:[]},[u,v,o?.previousNodes,o?.edgeStatus,o?.nodeStatus,h,ht,en,e,Me,ne]);q.useEffect(()=>{u&&e&&!e.timelines?.some(ie=>ie.id===u)&&d(void 0)},[e,u]),q.useEffect(()=>{if(!u||o)return;const ie=new Set(Qe.nodes.map(me=>me.id));ne&&!ie.has(ne)&&O(void 0),fe&&!ie.has(fe)&&ee(void 0)},[Qe.nodes,u,ne,fe,o]);const na=q.useMemo(()=>{if(!e||we.trim().length<2)return[];const ie=we.trim().toLowerCase(),me=new Set(Qe.nodes.map(Ne=>Ne.id));return e.nodes.filter(Ne=>me.has(Ne.id)&&`${Ne.label} ${Ne.type} ${Ne.sourcePath??""}`.toLowerCase().includes(ie)).slice(0,8)},[e,we,Qe.nodes]),kt=q.useCallback((ie,me=!0,Ne=!1)=>{let Je=Qe.nodes.find(at=>at.id===ie);const Vt=!!(!Je&&u&&e?.nodes.some(at=>at.id===ie));Vt&&e&&(d(void 0),Je=Zv(e).nodes.find(at=>at.id===ie)),Ee(void 0),me&&ne&&ne!==ie&&(W&&te(at=>[...at,W]),Se([]));const hn=Je?.data.projectNode.type==="gwt";if(hn&&!de.current){const at=document.activeElement;de.current=at?.closest(".search-results")?document.querySelector(".search-box input"):at instanceof HTMLElement?at:null}if(hn||(de.current=null),ee(void 0),e&&O(Fv(e,ie)),Je&&(!hn||Ne)){const at={x:Je.position.x+80,y:Je.position.y+60};Vt?window.setTimeout(()=>{Nt(at.x,at.y,{zoom:1.2,duration:350})},50):Nt(at.x,at.y,{zoom:1.2,duration:350})}},[Qe.nodes,e,W,ne,Nt,u]),vs=q.useCallback(()=>{O(void 0),Ee(void 0),Be(void 0),ee(void 0);const ie=de.current;de.current=null,ie&&requestAnimationFrame(()=>{ie?.isConnected?ie.focus({preventScroll:!0}):document.querySelector(".canvas")?.focus({preventScroll:!0})})},[]),Vn=q.useCallback(ie=>{de.current||(de.current=document.activeElement instanceof HTMLElement?document.activeElement:null),e&&ee(Fv(e,ie))},[e]),ki=q.useMemo(()=>({open:kt,list:Vn}),[kt,Vn]),qt=e?.nodes.find(ie=>ie.id===fe),Tn=qt?e?.nodes.filter(ie=>ie.type==="gwt"&&(qt.sourcePath?ie.sourcePath===qt.sourcePath:ie.sliceTitle===qt.sliceTitle)).filter(ie=>!o||h==="all"||o.nodeStatus[ie.id]===h):void 0;q.useEffect(()=>{(fe||dt?.type==="gwt")&&((fe?document.querySelector(".gwt-all-list button[aria-current]"):null)??document.querySelector('.gwt-panel button:not([role="tab"])'))?.focus({preventScroll:!0})},[fe,dt?.id,dt?.type]);const zi=q.useCallback(ie=>{const me=e?.edges.find(Je=>Je.id===ie);if(!me)return;Ee(ie);const Ne=Qe.nodes.filter(Je=>Je.id===me.source||Je.id===me.target);Ne.length>0&&We({nodes:Ne,padding:.36,duration:260,maxZoom:1.25})},[We,Qe.nodes,e?.edges]),ii=q.useCallback(()=>{Ee(void 0)},[]),_l=q.useCallback(()=>{e&&(j("exporting"),D(void 0),x(!1),ok(e,s,o,u).then(ie=>{ck(`${lk(e)}.emviz.html`,ie)}).catch(ie=>{D(ie instanceof Error?ie.message:String(ie))}).finally(()=>j("idle")))},[o,e,s,u]);q.useEffect(()=>{const ie=me=>{me.key==="Escape"&&(x(!1),vs())};return window.addEventListener("keydown",ie),()=>window.removeEventListener("keydown",ie)},[vs]);const ia=q.useCallback(()=>{const ie=ae.at(-1);if(!ie)return;te(Ne=>Ne.slice(0,-1)),W&&Se(Ne=>[...Ne,W]);const me=us(e,ie);me&&kt(me.id,!1)},[ae,kt,e,W]),bs=q.useCallback(()=>{const ie=ue.at(-1);if(!ie)return;Se(Ne=>Ne.slice(0,-1)),W&&te(Ne=>[...Ne,W]);const me=us(e,ie);me&&kt(me.id,!1)},[kt,ue,e,W]),si=q.useCallback(ie=>{uk(ie).then(me=>{const Ne=o3(me),Je=Ne;Je.graphSidecar=fk(me)??{model:{id:"browser_import",name:"Browser Import"}},d(void 0),A("local"),n(Je);const Vt=J3(Ne),hn=hk(Je);a({errors:Vt.errors,warnings:Vt.warnings+hn.filter(at=>at.severity==="warning").length,findings:[...Vt.findings,...hn]}),c(void 0),ee(void 0),p("all"),g({actorIds:[],includeUnassigned:!1}),O(void 0),Ee(void 0),Be(void 0),te([]),Se([]),E("ready"),z(void 0),window.setTimeout(()=>{We({padding:.18,duration:300})},50)}).catch(me=>{z(me instanceof Error?me.message:String(me)),E("import")})},[We]);return w==="import"?S.jsx(mk,{onImport:si,error:C}):e?S.jsxs("div",{className:`app-shell ${o?"diff-mode":""}`,children:[S.jsxs("header",{className:"toolbar",children:[S.jsxs("div",{className:"model-summary",children:[S.jsx("strong",{children:"emviz"}),S.jsxs("span",{children:[e.stories.length," stories"]}),S.jsxs("span",{children:[e.slices.length," slices"]}),S.jsxs("span",{children:[e.nodes.filter(ie=>ie.type==="event").length," events"]})]}),e.timelines?.length?S.jsxs("label",{className:"timeline-picker",children:[S.jsx("span",{children:"Timeline"}),S.jsxs("select",{"aria-label":"Timeline",disabled:!!o,title:o?"Diff shows all stories, including removed items.":void 0,value:Dv(u,!!o)??"",onChange:ie=>{d(ie.target.value||void 0),O(void 0),ee(void 0),te([]),Se([]),Ee(void 0),Be(void 0),window.setTimeout(()=>{We({padding:.18,duration:300})},50)},children:[S.jsx("option",{value:"",children:"All stories"}),e.timelines?.map(ie=>S.jsxs("option",{value:ie.id,children:[ie.name," · ",ie.path]},ie.id))]})]}):null,S.jsxs("div",{className:"segmented toolbar-history","aria-label":"Selection history",children:[S.jsx("button",{type:"button",disabled:ae.length===0,onClick:ia,"aria-label":"Back",title:"Back",children:"←"}),S.jsx("button",{type:"button",disabled:ue.length===0,onClick:bs,"aria-label":"Forward",title:"Forward",children:"→"})]}),S.jsxs("div",{className:"search-box",children:[S.jsx("input",{"aria-label":"Search event model",value:we,onChange:ie=>ge(ie.target.value),placeholder:"Search nodes by name or type..."}),na.length>0?S.jsx("div",{className:"search-results",children:na.map(ie=>S.jsxs("button",{type:"button",onClick:()=>{kt(ie.id),ge("")},children:[S.jsx("span",{children:ie.label}),S.jsx("small",{children:ie.type})]},ie.id))}):null]}),S.jsxs("details",{className:"actor-filter",onKeyDown:ie=>{ie.key==="Escape"&&(ie.preventDefault(),ie.stopPropagation(),ie.currentTarget.open=!1,ie.currentTarget.querySelector("summary")?.focus())},children:[S.jsxs("summary",{children:["Actors · ",v.actorIds.length+Number(v.includeUnassigned)||"All"]}),S.jsxs("div",{className:"actor-filter-popover",children:[S.jsx("p",{children:"Match any selected actor. Related system steps stay visible."}),S.jsxs("div",{className:"actor-filter-options",role:"group","aria-label":"Filter by actor",children:[Ut.map(ie=>S.jsxs("label",{children:[S.jsx("input",{type:"checkbox","aria-label":ie.name===ie.id?ie.name:ie.name+" ("+ie.id+")",checked:v.actorIds.includes(ie.id),onChange:me=>{const Ne=me.target.checked;g(Je=>({...Je,actorIds:Ne?[...Je.actorIds,ie.id]:Je.actorIds.filter(Vt=>Vt!==ie.id)}))}}),S.jsx("i",{className:"actor-swatch","aria-hidden":"true",style:{backgroundColor:ie.color}}),S.jsxs("span",{children:[ie.name,ie.name!==ie.id?S.jsx("small",{children:ie.id}):null]})]},ie.id)),It?S.jsxs("label",{children:[S.jsx("input",{type:"checkbox","aria-label":"Unassigned screens",checked:v.includeUnassigned,onChange:ie=>{const me=ie.target.checked;g(Ne=>({...Ne,includeUnassigned:me}))}}),S.jsx("span",{children:"Unassigned screens"})]}):null]}),S.jsx("button",{type:"button",disabled:v.actorIds.length===0&&!v.includeUnassigned,onClick:()=>g({actorIds:[],includeUnassigned:!1}),children:"Clear actors"})]})]}),S.jsxs("div",{className:"toolbar-menu",children:[S.jsx("button",{type:"button",className:"menu-trigger",onClick:()=>x(ie=>!ie),"aria-haspopup":"menu","aria-expanded":_,"aria-label":"Open menu",title:"Open menu",children:"..."}),_?S.jsx("div",{className:"menu-popover",role:"menu",children:S.jsx("button",{type:"button",role:"menuitem",onClick:_l,disabled:B==="exporting",children:B==="exporting"?"Exporting...":"Export"})}):null]}),T?S.jsx("div",{className:"toolbar-error",role:"alert",children:T}):null]}),S.jsx(yk,{report:s,onSelect:kt,open:Et,onOpen:()=>Bt(!0),onClose:()=>Bt(!1)}),o?S.jsx(rk,{diff:o,filter:h,onFilter:p,onSelect:kt}):null,S.jsx(gk,{diff:o,tab:G,onTab:k,oldVersionId:$,onVersion:H,agentPanel:S.jsxs(S.Fragment,{children:[le?S.jsxs("div",{className:"feedback-storage-warning",children:[S.jsx("p",{className:"feedback-warning",role:"alert",children:le}),R.recoveryWarning?S.jsx("button",{type:"button",onClick:()=>Z(ie=>({...ie,recoveryWarning:void 0})),children:"Replace damaged saved feedback"}):null]}):null,S.jsx(V3,{session:Ht,drafts:Object.values(Y),view:St,onView:ie=>{ti(ie),p("all")},node:dt,diff:o,showingBefore:!!(Mm(o,dt)&&$===dt?.id)||!!(dt&&o?.nodeStatus[dt.id]==="removed"),message:ys?Y[ys]?.message??"":"",onMessageChange:ta,onAdded:ie=>ta("",ie),queue:K,onQueueChange:X,storageNeedsReview:!!R.recoveryWarning})]}),gwtList:Tn,onGwtList:Vn,onClose:vs,onFocusNode:ie=>kt(ie,!0,!0),project:e,selectedNode:dt,findings:ni,selectedFieldName:Me,onSelect:kt,onSelectField:Be,onClearField:()=>Be(void 0),onPreviewConnection:zi,onClearPreview:ii},(qt??dt)?.type==="gwt"?`gwt:${(qt??dt)?.sourcePath??(qt??dt)?.sliceTitle}`:"selection"),S.jsxs("main",{className:"canvas",tabIndex:-1,"aria-label":"Event model diagram",children:[(v.actorIds.length>0||v.includeUnassigned)&&!Qe.nodes.some(ie=>!ie.hidden&&ie.data.projectNode.type!=="story"&&ie.data.projectNode.type!=="slice")?S.jsx("div",{className:"actor-empty",role:"status",children:"No screens match the selected actors and current filters."}):null,S.jsx(sw.Provider,{value:ki,children:S.jsxs(tM,{nodes:Qe.nodes,edges:Qe.edges,nodeTypes:tk,edgeTypes:sk,onNodeClick:(ie,me)=>kt(me.id),fitView:!0,minZoom:.2,maxZoom:1.8,nodesDraggable:!1,colorMode:"light",children:[S.jsx(rM,{gap:18,size:1}),S.jsx(pM,{})]})})]})]}):S.jsx("div",{className:"loading",children:S.jsx("div",{children:He.error?S.jsxs(S.Fragment,{children:[S.jsx("p",{role:"alert",children:He.error}),S.jsx("button",{type:"button",onClick:He.refresh,children:"Retry connection"})]}):"Loading event model..."})})}function bk(){return S.jsx(I1,{children:S.jsx(vk,{})})}wE.createRoot(document.getElementById("root")).render(S.jsx(du.StrictMode,{children:S.jsx(bk,{})}));