emviz 0.8.0 → 0.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,171 @@
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 db(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Wd={exports:{}},To={};var w0;function AE(){if(w0)return To;w0=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 To.Fragment=n,To.jsx=s,To.jsxs=s,To}var x0;function TE(){return x0||(x0=1,Wd.exports=AE()),Wd.exports}var b=TE(),Pd={exports:{}},_e={};var E0;function CE(){if(E0)return _e;E0=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"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),v=Symbol.iterator;function x(w){return w===null||typeof w!="object"?null:(w=v&&w[v]||w["@@iterator"],typeof w=="function"?w:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_=Object.assign,T={};function C(w,z,F){this.props=w,this.context=z,this.refs=T,this.updater=F||E}C.prototype.isReactComponent={},C.prototype.setState=function(w,z){if(typeof w!="object"&&typeof w!="function"&&w!=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,w,z,"setState")},C.prototype.forceUpdate=function(w){this.updater.enqueueForceUpdate(this,w,"forceUpdate")};function k(){}k.prototype=C.prototype;function A(w,z,F){this.props=w,this.context=z,this.refs=T,this.updater=F||E}var N=A.prototype=new k;N.constructor=A,_(N,C.prototype),N.isPureReactComponent=!0;var j=Array.isArray;function D(){}var B={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function U(w,z,F){var W=F.ref;return{$$typeof:e,type:w,key:z,ref:W!==void 0?W:null,props:F}}function q(w,z){return U(w.type,z,w.props)}function Y(w){return typeof w=="object"&&w!==null&&w.$$typeof===e}function Z(w){var z={"=":"=0",":":"=2"};return"$"+w.replace(/[=:]/g,function(F){return z[F]})}var le=/\/+/g;function L(w,z){return typeof w=="object"&&w!==null&&w.key!=null?Z(""+w.key):z.toString(36)}function K(w){switch(w.status){case"fulfilled":return w.value;case"rejected":throw w.reason;default:switch(typeof w.status=="string"?w.then(D,D):(w.status="pending",w.then(function(z){w.status==="pending"&&(w.status="fulfilled",w.value=z)},function(z){w.status==="pending"&&(w.status="rejected",w.reason=z)})),w.status){case"fulfilled":return w.value;case"rejected":throw w.reason}}throw w}function O(w,z,F,W,fe){var de=typeof w;(de==="undefined"||de==="boolean")&&(w=null);var ie=!1;if(w===null)ie=!0;else switch(de){case"bigint":case"string":case"number":ie=!0;break;case"object":switch(w.$$typeof){case e:case n:ie=!0;break;case y:return ie=w._init,O(ie(w._payload),z,F,W,fe)}}if(ie)return fe=fe(w),ie=W===""?"."+L(w,0):W,j(fe)?(F="",ie!=null&&(F=ie.replace(le,"$&/")+"/"),O(fe,z,F,"",function(ve){return ve})):fe!=null&&(Y(fe)&&(fe=q(fe,F+(fe.key==null||w&&w.key===fe.key?"":(""+fe.key).replace(le,"$&/")+"/")+ie)),z.push(fe)),1;ie=0;var te=W===""?".":W+":";if(j(w))for(var oe=0;oe<w.length;oe++)W=w[oe],de=te+L(W,oe),ie+=O(W,z,F,de,fe);else if(oe=x(w),typeof oe=="function")for(w=oe.call(w),oe=0;!(W=w.next()).done;)W=W.value,de=te+L(W,oe++),ie+=O(W,z,F,de,fe);else if(de==="object"){if(typeof w.then=="function")return O(K(w),z,F,W,fe);throw z=String(w),Error("Objects are not valid as a React child (found: "+(z==="[object Object]"?"object with keys {"+Object.keys(w).join(", ")+"}":z)+"). If you meant to render a collection of children, use an array instead.")}return ie}function H(w,z,F){if(w==null)return w;var W=[],fe=0;return O(w,W,"","",function(de){return z.call(F,de,fe++)}),W}function $(w){if(w._status===-1){var z=w._result;z=z(),z.then(function(F){(w._status===0||w._status===-1)&&(w._status=1,w._result=F)},function(F){(w._status===0||w._status===-1)&&(w._status=2,w._result=F)}),w._status===-1&&(w._status=0,w._result=z)}if(w._status===1)return w._result.default;throw w._result}var X=typeof reportError=="function"?reportError:function(w){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof w=="object"&&w!==null&&typeof w.message=="string"?String(w.message):String(w),error:w});if(!window.dispatchEvent(z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",w);return}console.error(w)},se={map:H,forEach:function(w,z,F){H(w,function(){z.apply(this,arguments)},F)},count:function(w){var z=0;return H(w,function(){z++}),z},toArray:function(w){return H(w,function(z){return z})||[]},only:function(w){if(!Y(w))throw Error("React.Children.only expected to receive a single React element child.");return w}};return _e.Activity=g,_e.Children=se,_e.Component=C,_e.Fragment=s,_e.Profiler=o,_e.PureComponent=A,_e.StrictMode=a,_e.Suspense=h,_e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,_e.__COMPILER_RUNTIME={__proto__:null,c:function(w){return B.H.useMemoCache(w)}},_e.cache=function(w){return function(){return w.apply(null,arguments)}},_e.cacheSignal=function(){return null},_e.cloneElement=function(w,z,F){if(w==null)throw Error("The argument must be a React element, but you passed "+w+".");var W=_({},w.props),fe=w.key;if(z!=null)for(de in z.key!==void 0&&(fe=""+z.key),z)!R.call(z,de)||de==="key"||de==="__self"||de==="__source"||de==="ref"&&z.ref===void 0||(W[de]=z[de]);var de=arguments.length-2;if(de===1)W.children=F;else if(1<de){for(var ie=Array(de),te=0;te<de;te++)ie[te]=arguments[te+2];W.children=ie}return U(w.type,fe,W)},_e.createContext=function(w){return w={$$typeof:u,_currentValue:w,_currentValue2:w,_threadCount:0,Provider:null,Consumer:null},w.Provider=w,w.Consumer={$$typeof:c,_context:w},w},_e.createElement=function(w,z,F){var W,fe={},de=null;if(z!=null)for(W in z.key!==void 0&&(de=""+z.key),z)R.call(z,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(fe[W]=z[W]);var ie=arguments.length-2;if(ie===1)fe.children=F;else if(1<ie){for(var te=Array(ie),oe=0;oe<ie;oe++)te[oe]=arguments[oe+2];fe.children=te}if(w&&w.defaultProps)for(W in ie=w.defaultProps,ie)fe[W]===void 0&&(fe[W]=ie[W]);return U(w,de,fe)},_e.createRef=function(){return{current:null}},_e.forwardRef=function(w){return{$$typeof:d,render:w}},_e.isValidElement=Y,_e.lazy=function(w){return{$$typeof:y,_payload:{_status:-1,_result:w},_init:$}},_e.memo=function(w,z){return{$$typeof:p,type:w,compare:z===void 0?null:z}},_e.startTransition=function(w){var z=B.T,F={};B.T=F;try{var W=w(),fe=B.S;fe!==null&&fe(F,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(D,X)}catch(de){X(de)}finally{z!==null&&F.types!==null&&(z.types=F.types),B.T=z}},_e.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},_e.use=function(w){return B.H.use(w)},_e.useActionState=function(w,z,F){return B.H.useActionState(w,z,F)},_e.useCallback=function(w,z){return B.H.useCallback(w,z)},_e.useContext=function(w){return B.H.useContext(w)},_e.useDebugValue=function(){},_e.useDeferredValue=function(w,z){return B.H.useDeferredValue(w,z)},_e.useEffect=function(w,z){return B.H.useEffect(w,z)},_e.useEffectEvent=function(w){return B.H.useEffectEvent(w)},_e.useId=function(){return B.H.useId()},_e.useImperativeHandle=function(w,z,F){return B.H.useImperativeHandle(w,z,F)},_e.useInsertionEffect=function(w,z){return B.H.useInsertionEffect(w,z)},_e.useLayoutEffect=function(w,z){return B.H.useLayoutEffect(w,z)},_e.useMemo=function(w,z){return B.H.useMemo(w,z)},_e.useOptimistic=function(w,z){return B.H.useOptimistic(w,z)},_e.useReducer=function(w,z,F){return B.H.useReducer(w,z,F)},_e.useRef=function(w){return B.H.useRef(w)},_e.useState=function(w){return B.H.useState(w)},_e.useSyncExternalStore=function(w,z,F){return B.H.useSyncExternalStore(w,z,F)},_e.useTransition=function(){return B.H.useTransition()},_e.version="19.2.7",_e}var N0;function lr(){return N0||(N0=1,Pd.exports=CE()),Pd.exports}var V=lr();const wl=db(V);var eh={exports:{}},Co={},th={exports:{}},nh={};var _0;function ME(){return _0||(_0=1,(function(e){function n(O,H){var $=O.length;O.push(H);e:for(;0<$;){var X=$-1>>>1,se=O[X];if(0<o(se,H))O[X]=H,O[$]=se,$=X;else break e}}function s(O){return O.length===0?null:O[0]}function a(O){if(O.length===0)return null;var H=O[0],$=O.pop();if($!==H){O[0]=$;e:for(var X=0,se=O.length,w=se>>>1;X<w;){var z=2*(X+1)-1,F=O[z],W=z+1,fe=O[W];if(0>o(F,$))W<se&&0>o(fe,F)?(O[X]=fe,O[W]=$,X=W):(O[X]=F,O[z]=$,X=z);else if(W<se&&0>o(fe,$))O[X]=fe,O[W]=$,X=W;else break e}}return H}function o(O,H){var $=O.sortIndex-H.sortIndex;return $!==0?$:O.id-H.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=[],y=1,g=null,v=3,x=!1,E=!1,_=!1,T=!1,C=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,A=typeof setImmediate<"u"?setImmediate:null;function N(O){for(var H=s(p);H!==null;){if(H.callback===null)a(p);else if(H.startTime<=O)a(p),H.sortIndex=H.expirationTime,n(h,H);else break;H=s(p)}}function j(O){if(_=!1,N(O),!E)if(s(h)!==null)E=!0,D||(D=!0,Z());else{var H=s(p);H!==null&&K(j,H.startTime-O)}}var D=!1,B=-1,R=5,U=-1;function q(){return T?!0:!(e.unstable_now()-U<R)}function Y(){if(T=!1,D){var O=e.unstable_now();U=O;var H=!0;try{e:{E=!1,_&&(_=!1,k(B),B=-1),x=!0;var $=v;try{t:{for(N(O),g=s(h);g!==null&&!(g.expirationTime>O&&q());){var X=g.callback;if(typeof X=="function"){g.callback=null,v=g.priorityLevel;var se=X(g.expirationTime<=O);if(O=e.unstable_now(),typeof se=="function"){g.callback=se,N(O),H=!0;break t}g===s(h)&&a(h),N(O)}else a(h);g=s(h)}if(g!==null)H=!0;else{var w=s(p);w!==null&&K(j,w.startTime-O),H=!1}}break e}finally{g=null,v=$,x=!1}H=void 0}}finally{H?Z():D=!1}}}var Z;if(typeof A=="function")Z=function(){A(Y)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,L=le.port2;le.port1.onmessage=Y,Z=function(){L.postMessage(null)}}else Z=function(){C(Y,0)};function K(O,H){B=C(function(){O(e.unstable_now())},H)}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(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_next=function(O){switch(v){case 1:case 2:case 3:var H=3;break;default:H=v}var $=v;v=H;try{return O()}finally{v=$}},e.unstable_requestPaint=function(){T=!0},e.unstable_runWithPriority=function(O,H){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var $=v;v=O;try{return H()}finally{v=$}},e.unstable_scheduleCallback=function(O,H,$){var X=e.unstable_now();switch(typeof $=="object"&&$!==null?($=$.delay,$=typeof $=="number"&&0<$?X+$:X):$=X,O){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=$+se,O={id:y++,callback:H,priorityLevel:O,startTime:$,expirationTime:se,sortIndex:-1},$>X?(O.sortIndex=$,n(p,O),s(h)===null&&O===s(p)&&(_?(k(B),B=-1):_=!0,K(j,$-X))):(O.sortIndex=se,n(h,O),E||x||(E=!0,D||(D=!0,Z()))),O},e.unstable_shouldYield=q,e.unstable_wrapCallback=function(O){var H=v;return function(){var $=v;v=H;try{return O.apply(this,arguments)}finally{v=$}}}})(nh)),nh}var A0;function OE(){return A0||(A0=1,th.exports=ME()),th.exports}var ih={exports:{}},$t={};var T0;function kE(){if(T0)return $t;T0=1;var e=lr();function n(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}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,y){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:y}}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 $t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,$t.createPortal=function(h,p){var y=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,y)},$t.flushSync=function(h){var p=u.T,y=a.p;try{if(u.T=null,a.p=2,h)return h()}finally{u.T=p,a.p=y,a.d.f()}},$t.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))},$t.prefetchDNS=function(h){typeof h=="string"&&a.d.D(h)},$t.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var y=p.as,g=d(y,p.crossOrigin),v=typeof p.integrity=="string"?p.integrity:void 0,x=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?a.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:g,integrity:v,fetchPriority:x}):y==="script"&&a.d.X(h,{crossOrigin:g,integrity:v,fetchPriority:x,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},$t.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=d(p.as,p.crossOrigin);a.d.M(h,{crossOrigin:y,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)},$t.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,g=d(y,p.crossOrigin);a.d.L(h,y,{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})}},$t.preloadModule=function(h,p){if(typeof h=="string")if(p){var y=d(p.as,p.crossOrigin);a.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(h)},$t.requestFormReset=function(h){a.d.r(h)},$t.unstable_batchedUpdates=function(h,p){return h(p)},$t.useFormState=function(h,p,y){return u.H.useFormState(h,p,y)},$t.useFormStatus=function(){return u.H.useHostTransitionStatus()},$t.version="19.2.7",$t}var C0;function hb(){if(C0)return ih.exports;C0=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(),ih.exports=kE(),ih.exports}var M0;function zE(){if(M0)return Co;M0=1;var e=OE(),n=lr(),s=hb();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 S=!1,M=f.child;M;){if(M===l){S=!0,l=f,r=m;break}if(M===r){S=!0,r=f,l=m;break}M=M.sibling}if(!S){for(M=m.child;M;){if(M===l){S=!0,l=m,r=f;break}if(M===r){S=!0,r=m,l=f;break}M=M.sibling}if(!S)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 y(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=y(t),i!==null)return i;t=t.sibling}return null}var g=Object.assign,v=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),E=Symbol.for("react.portal"),_=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),C=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),A=Symbol.for("react.context"),N=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),q=Symbol.for("react.memo_cache_sentinel"),Y=Symbol.iterator;function Z(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 _:return"Fragment";case C:return"Profiler";case T:return"StrictMode";case j:return"Suspense";case D:return"SuspenseList";case U:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case E:return"Portal";case A:return t.displayName||"Context";case k:return(t._context.displayName||"Context")+".Consumer";case N:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case B:return i=t.displayName||null,i!==null?i:L(t.type)||"Memo";case R:i=t._payload,t=t._init;try{return L(t(i))}catch{}}return null}var K=Array.isArray,O=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=s.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$={pending:!1,data:null,method:null,action:null},X=[],se=-1;function w(t){return{current:t}}function z(t){0>se||(t.current=X[se],X[se]=null,se--)}function F(t,i){se++,X[se]=t.current,t.current=i}var W=w(null),fe=w(null),de=w(null),ie=w(null);function te(t,i){switch(F(de,i),F(fe,t),F(W,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?Yy(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=Yy(i),t=Gy(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}z(W),F(W,t)}function oe(){z(W),z(fe),z(de)}function ve(t){t.memoizedState!==null&&F(ie,t);var i=W.current,l=Gy(i,t.type);i!==l&&(F(fe,t),F(W,l))}function Se(t){fe.current===t&&(z(W),z(fe)),ie.current===t&&(z(ie),Eo._currentValue=$)}var he,ge;function Ee(t){if(he===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);he=i&&i[1]||"",ge=-1<l.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+he+t+ge}var Ce=!1;function Ie(t,i){if(!t||Ce)return"";Ce=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(i){var ue=function(){throw Error()};if(Object.defineProperty(ue.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ue,[])}catch(ae){var ne=ae}Reflect.construct(t,[],ue)}else{try{ue.call()}catch(ae){ne=ae}t.call(ue.prototype)}}else{try{throw Error()}catch(ae){ne=ae}(ue=t())&&typeof ue.catch=="function"&&ue.catch(function(){})}}catch(ae){if(ae&&ne&&typeof ae.stack=="string")return[ae.stack,ne.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(),S=m[0],M=m[1];if(S&&M){var I=S.split(`
4
+ `),P=M.split(`
5
+ `);for(f=r=0;r<I.length&&!I[r].includes("DetermineComponentFrameRoot");)r++;for(;f<P.length&&!P[f].includes("DetermineComponentFrameRoot");)f++;if(r===I.length||f===P.length)for(r=I.length-1,f=P.length-1;1<=r&&0<=f&&I[r]!==P[f];)f--;for(;1<=r&&0<=f;r--,f--)if(I[r]!==P[f]){if(r!==1||f!==1)do if(r--,f--,0>f||I[r]!==P[f]){var re=`
6
+ `+I[r].replace(" at new "," at ");return t.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",t.displayName)),re}while(1<=r&&0<=f);break}}}finally{Ce=!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 Ie(t.type,!1);case 11:return Ie(t.type.render,!1);case 1:return Ie(t.type,!0);case 31:return Ee("Activity");default:return""}}function jt(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 rt=Object.prototype.hasOwnProperty,Et=e.unstable_scheduleCallback,Rt=e.unstable_cancelCallback,jn=e.unstable_shouldYield,Ct=e.unstable_requestPaint,Ze=e.unstable_now,ft=e.unstable_getCurrentPriorityLevel,Vt=e.unstable_ImmediatePriority,Ut=e.unstable_UserBlockingPriority,Bt=e.unstable_NormalPriority,vn=e.unstable_LowPriority,bn=e.unstable_IdlePriority,Ol=e.log,Je=e.unstable_setDisableYieldValue,Yt=null,pt=null;function Sn(t){if(typeof Ol=="function"&&Je(t),pt&&typeof pt.setStrictMode=="function")try{pt.setStrictMode(Yt,t)}catch{}}var Mt=Math.clz32?Math.clz32:$i,kl=Math.log,gt=Math.LN2;function $i(t){return t>>>=0,t===0?32:31-(kl(t)/gt|0)|0}var Wn=256,di=262144,Hi=4194304;function Gt(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 hi(t,i,l){var r=t.pendingLanes;if(r===0)return 0;var f=0,m=t.suspendedLanes,S=t.pingedLanes;t=t.warmLanes;var M=r&134217727;return M!==0?(r=M&~m,r!==0?f=Gt(r):(S&=M,S!==0?f=Gt(S):l||(l=M&~t,l!==0&&(f=Gt(l))))):(M=r&~m,M!==0?f=Gt(M):S!==0?f=Gt(S):l||(l=r&~t,l!==0&&(f=Gt(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 Pn(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function zl(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 aa(){var t=Hi;return Hi<<=1,(Hi&62914560)===0&&(Hi=4194304),t}function Nt(t){for(var i=[],l=0;31>l;l++)i.push(t);return i}function ei(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Lt(t,i,l,r,f,m){var S=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,I=t.expirationTimes,P=t.hiddenUpdates;for(l=S&~l;0<l;){var re=31-Mt(l),ue=1<<re;M[re]=0,I[re]=-1;var ne=P[re];if(ne!==null)for(P[re]=null,re=0;re<ne.length;re++){var ae=ne[re];ae!==null&&(ae.lane&=-536870913)}l&=~ue}r!==0&&Ui(t,r,0),m!==0&&f===0&&t.tag!==0&&(t.suspendedLanes|=m&~(S&~i))}function Ui(t,i,l){t.pendingLanes|=i,t.suspendedLanes&=~i;var r=31-Mt(i);t.entangledLanes|=i,t.entanglements[r]=t.entanglements[r]|1073741824|l&261930}function Ii(t,i){var l=t.entangledLanes|=i;for(t=t.entanglements;l;){var r=31-Mt(l),f=1<<r;f&i|t[r]&i&&(t[r]|=i),l&=~f}}function la(t,i){var l=i&-i;return l=(l&42)!==0?1:ln(l),(l&(t.suspendedLanes|i))!==0?0:l}function ln(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 Ns(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function oa(){var t=H.p;return t!==0?t:(t=window.event,t===void 0?32:m0(t.type))}function ra(t,i){var l=H.p;try{return H.p=t,i()}finally{H.p=l}}var wn=Math.random().toString(36).slice(2),dt="__reactFiber$"+wn,At="__reactProps$"+wn,Rn="__reactContainer$"+wn,ee="__reactEvents$"+wn,pe="__reactListeners$"+wn,xe="__reactHandles$"+wn,Be="__reactResources$"+wn,tt="__reactMarker$"+wn;function Xt(t){delete t[dt],delete t[At],delete t[ee],delete t[pe],delete t[xe]}function Ye(t){var i=t[dt];if(i)return i;for(var l=t.parentNode;l;){if(i=l[Rn]||l[dt]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(t=Wy(t);t!==null;){if(l=t[dt])return l;t=Wy(t)}return i}t=l,l=t.parentNode}return null}function on(t){if(t=t[dt]||t[Rn]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function qi(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(a(33))}function Vi(t){var i=t[Be];return i||(i=t[Be]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function yt(t){t[tt]=!0}var yr=new Set,vr={};function mi(t,i){Yi(t,i),Yi(t+"Capture",i)}function Yi(t,i){for(vr[t]=i,t=0;t<i.length;t++)yr.add(i[t])}var Yu=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]*$"),br={},Dl={};function Gu(t){return rt.call(Dl,t)?!0:rt.call(br,t)?!1:Yu.test(t)?Dl[t]=!0:(br[t]=!0,!1)}function ca(t,i,l){if(Gu(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 ua(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 Bn(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 Kt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Sr(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Xu(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(S){l=""+S,m.call(this,S)}}),Object.defineProperty(t,i,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(S){l=""+S},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function jl(t){if(!t._valueTracker){var i=Sr(t)?"checked":"value";t._valueTracker=Xu(t,i,""+t[i])}}function Rl(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var l=i.getValue(),r="";return t&&(r=Sr(t)?t.checked?"true":"false":t.value),t=r,t!==l?(i.setValue(t),!0):!1}function fa(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 wr=/[\n"\\]/g;function Zt(t){return t.replace(wr,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Bl(t,i,l,r,f,m,S,M){t.name="",S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?t.type=S:t.removeAttribute("type"),i!=null?S==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Kt(i)):t.value!==""+Kt(i)&&(t.value=""+Kt(i)):S!=="submit"&&S!=="reset"||t.removeAttribute("value"),i!=null?Ll(t,S,Kt(i)):l!=null?Ll(t,S,Kt(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=""+Kt(M):t.removeAttribute("name")}function da(t,i,l,r,f,m,S,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)){jl(t);return}l=l!=null?""+Kt(l):"",i=i!=null?""+Kt(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,S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"&&(t.name=S),jl(t)}function Ll(t,i,l){i==="number"&&fa(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function Gi(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=""+Kt(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 $l(t,i,l){if(i!=null&&(i=""+Kt(i),i!==t.value&&(t.value=i),l==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=l!=null?""+Kt(l):""}function Um(t,i,l,r){if(i==null){if(r!=null){if(l!=null)throw Error(a(92));if(K(r)){if(1<r.length)throw Error(a(93));r=r[0]}l=r}l==null&&(l=""),i=l}l=Kt(i),t.defaultValue=l,r=t.textContent,r===l&&r!==""&&r!==null&&(t.value=r),jl(t)}function ha(t,i){if(i){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=i;return}}t.textContent=i}var ww=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 Im(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||ww.has(i)?i==="float"?t.cssFloat=l:t[i]=(""+l).trim():t[i]=l+"px"}function qm(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&&Im(t,f,r)}else for(var m in i)i.hasOwnProperty(m)&&Im(t,m,i[m])}function Ku(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 xw=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"]]),Ew=/^[\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 xr(t){return Ew.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function pi(){}var Zu=null;function Qu(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var ma=null,pa=null;function Vm(t){var i=on(t);if(i&&(t=i.stateNode)){var l=t[At]||null;e:switch(t=i.stateNode,i.type){case"input":if(Bl(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="'+Zt(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var r=l[i];if(r!==t&&r.form===t.form){var f=r[At]||null;if(!f)throw Error(a(90));Bl(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&&Rl(r)}break e;case"textarea":$l(t,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&Gi(t,!!l.multiple,i,!1)}}}var Fu=!1;function Ym(t,i,l){if(Fu)return t(i,l);Fu=!0;try{var r=t(i);return r}finally{if(Fu=!1,(ma!==null||pa!==null)&&(cc(),ma&&(i=ma,t=pa,pa=ma=null,Vm(i),t)))for(i=0;i<t.length;i++)Vm(t[i])}}function Hl(t,i){var l=t.stateNode;if(l===null)return null;var r=l[At]||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 gi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ju=!1;if(gi)try{var Ul={};Object.defineProperty(Ul,"passive",{get:function(){Ju=!0}}),window.addEventListener("test",Ul,Ul),window.removeEventListener("test",Ul,Ul)}catch{Ju=!1}var Xi=null,Wu=null,Er=null;function Gm(){if(Er)return Er;var t,i=Wu,l=i.length,r,f="value"in Xi?Xi.value:Xi.textContent,m=f.length;for(t=0;t<l&&i[t]===f[t];t++);var S=l-t;for(r=1;r<=S&&i[l-r]===f[m-r];r++);return Er=f.slice(t,1<r?1-r:void 0)}function Nr(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 _r(){return!0}function Xm(){return!1}function Qt(t){function i(l,r,f,m,S){this._reactName=l,this._targetInst=f,this.type=r,this.nativeEvent=m,this.target=S,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)?_r:Xm,this.isPropagationStopped=Xm,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=_r)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=_r)},persist:function(){},isPersistent:_r}),i}var _s={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ar=Qt(_s),Il=g({},_s,{view:0,detail:0}),Nw=Qt(Il),Pu,ef,ql,Tr=g({},Il,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nf,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!==ql&&(ql&&t.type==="mousemove"?(Pu=t.screenX-ql.screenX,ef=t.screenY-ql.screenY):ef=Pu=0,ql=t),Pu)},movementY:function(t){return"movementY"in t?t.movementY:ef}}),Km=Qt(Tr),_w=g({},Tr,{dataTransfer:0}),Aw=Qt(_w),Tw=g({},Il,{relatedTarget:0}),tf=Qt(Tw),Cw=g({},_s,{animationName:0,elapsedTime:0,pseudoElement:0}),Mw=Qt(Cw),Ow=g({},_s,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),kw=Qt(Ow),zw=g({},_s,{data:0}),Zm=Qt(zw),Dw={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},jw={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"},Rw={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Bw(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=Rw[t])?!!i[t]:!1}function nf(){return Bw}var Lw=g({},Il,{key:function(t){if(t.key){var i=Dw[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=Nr(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?jw[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nf,charCode:function(t){return t.type==="keypress"?Nr(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Nr(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),$w=Qt(Lw),Hw=g({},Tr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qm=Qt(Hw),Uw=g({},Il,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nf}),Iw=Qt(Uw),qw=g({},_s,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vw=Qt(qw),Yw=g({},Tr,{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}),Gw=Qt(Yw),Xw=g({},_s,{newState:0,oldState:0}),Kw=Qt(Xw),Zw=[9,13,27,32],sf=gi&&"CompositionEvent"in window,Vl=null;gi&&"documentMode"in document&&(Vl=document.documentMode);var Qw=gi&&"TextEvent"in window&&!Vl,Fm=gi&&(!sf||Vl&&8<Vl&&11>=Vl),Jm=" ",Wm=!1;function Pm(t,i){switch(t){case"keyup":return Zw.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ep(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var ga=!1;function Fw(t,i){switch(t){case"compositionend":return ep(i);case"keypress":return i.which!==32?null:(Wm=!0,Jm);case"textInput":return t=i.data,t===Jm&&Wm?null:t;default:return null}}function Jw(t,i){if(ga)return t==="compositionend"||!sf&&Pm(t,i)?(t=Gm(),Er=Wu=Xi=null,ga=!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 Fm&&i.locale!=="ko"?null:i.data;default:return null}}var Ww={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 tp(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!Ww[t.type]:i==="textarea"}function np(t,i,l,r){ma?pa?pa.push(r):pa=[r]:ma=r,i=gc(i,"onChange"),0<i.length&&(l=new Ar("onChange","change",null,l,r),t.push({event:l,listeners:i}))}var Yl=null,Gl=null;function Pw(t){$y(t,0)}function Cr(t){var i=qi(t);if(Rl(i))return t}function ip(t,i){if(t==="change")return i}var sp=!1;if(gi){var af;if(gi){var lf="oninput"in document;if(!lf){var ap=document.createElement("div");ap.setAttribute("oninput","return;"),lf=typeof ap.oninput=="function"}af=lf}else af=!1;sp=af&&(!document.documentMode||9<document.documentMode)}function lp(){Yl&&(Yl.detachEvent("onpropertychange",op),Gl=Yl=null)}function op(t){if(t.propertyName==="value"&&Cr(Gl)){var i=[];np(i,Gl,t,Qu(t)),Ym(Pw,i)}}function ex(t,i,l){t==="focusin"?(lp(),Yl=i,Gl=l,Yl.attachEvent("onpropertychange",op)):t==="focusout"&&lp()}function tx(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Cr(Gl)}function nx(t,i){if(t==="click")return Cr(i)}function ix(t,i){if(t==="input"||t==="change")return Cr(i)}function sx(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var rn=typeof Object.is=="function"?Object.is:sx;function Xl(t,i){if(rn(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(!rt.call(i,f)||!rn(t[f],i[f]))return!1}return!0}function rp(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function cp(t,i){var l=rp(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=rp(l)}}function up(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?up(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function fp(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=fa(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=fa(t.document)}return i}function of(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 ax=gi&&"documentMode"in document&&11>=document.documentMode,ya=null,rf=null,Kl=null,cf=!1;function dp(t,i,l){var r=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;cf||ya==null||ya!==fa(r)||(r=ya,"selectionStart"in r&&of(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}),Kl&&Xl(Kl,r)||(Kl=r,r=gc(rf,"onSelect"),0<r.length&&(i=new Ar("onSelect","select",null,i,l),t.push({event:i,listeners:r}),i.target=ya)))}function As(t,i){var l={};return l[t.toLowerCase()]=i.toLowerCase(),l["Webkit"+t]="webkit"+i,l["Moz"+t]="moz"+i,l}var va={animationend:As("Animation","AnimationEnd"),animationiteration:As("Animation","AnimationIteration"),animationstart:As("Animation","AnimationStart"),transitionrun:As("Transition","TransitionRun"),transitionstart:As("Transition","TransitionStart"),transitioncancel:As("Transition","TransitionCancel"),transitionend:As("Transition","TransitionEnd")},uf={},hp={};gi&&(hp=document.createElement("div").style,"AnimationEvent"in window||(delete va.animationend.animation,delete va.animationiteration.animation,delete va.animationstart.animation),"TransitionEvent"in window||delete va.transitionend.transition);function Ts(t){if(uf[t])return uf[t];if(!va[t])return t;var i=va[t],l;for(l in i)if(i.hasOwnProperty(l)&&l in hp)return uf[t]=i[l];return t}var mp=Ts("animationend"),pp=Ts("animationiteration"),gp=Ts("animationstart"),lx=Ts("transitionrun"),ox=Ts("transitionstart"),rx=Ts("transitioncancel"),yp=Ts("transitionend"),vp=new Map,ff="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(" ");ff.push("scrollEnd");function Ln(t,i){vp.set(t,i),mi(i,[t])}var Mr=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)},xn=[],ba=0,df=0;function Or(){for(var t=ba,i=df=ba=0;i<t;){var l=xn[i];xn[i++]=null;var r=xn[i];xn[i++]=null;var f=xn[i];xn[i++]=null;var m=xn[i];if(xn[i++]=null,r!==null&&f!==null){var S=r.pending;S===null?f.next=f:(f.next=S.next,S.next=f),r.pending=f}m!==0&&bp(l,f,m)}}function kr(t,i,l,r){xn[ba++]=t,xn[ba++]=i,xn[ba++]=l,xn[ba++]=r,df|=r,t.lanes|=r,t=t.alternate,t!==null&&(t.lanes|=r)}function hf(t,i,l,r){return kr(t,i,l,r),zr(t)}function Cs(t,i){return kr(t,null,null,i),zr(t)}function bp(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-Mt(l),t=m.hiddenUpdates,r=t[f],r===null?t[f]=[i]:r.push(i),i.lane=l|536870912),m):null}function zr(t){if(50<go)throw go=0,xd=null,Error(a(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var Sa={};function cx(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 cn(t,i,l,r){return new cx(t,i,l,r)}function mf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function yi(t,i){var l=t.alternate;return l===null?(l=cn(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 Sp(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 Dr(t,i,l,r,f,m){var S=0;if(r=t,typeof t=="function")mf(t)&&(S=1);else if(typeof t=="string")S=mE(t,l,W.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case U:return t=cn(31,l,i,f),t.elementType=U,t.lanes=m,t;case _:return Ms(l.children,f,m,i);case T:S=8,f|=24;break;case C:return t=cn(12,l,i,f|2),t.elementType=C,t.lanes=m,t;case j:return t=cn(13,l,i,f),t.elementType=j,t.lanes=m,t;case D:return t=cn(19,l,i,f),t.elementType=D,t.lanes=m,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case A:S=10;break e;case k:S=9;break e;case N:S=11;break e;case B:S=14;break e;case R:S=16,r=null;break e}S=29,l=Error(a(130,t===null?"null":typeof t,"")),r=null}return i=cn(S,l,i,f),i.elementType=t,i.type=r,i.lanes=m,i}function Ms(t,i,l,r){return t=cn(7,t,r,i),t.lanes=l,t}function pf(t,i,l){return t=cn(6,t,null,i),t.lanes=l,t}function wp(t){var i=cn(18,null,null,0);return i.stateNode=t,i}function gf(t,i,l){return i=cn(4,t.children!==null?t.children:[],t.key,i),i.lanes=l,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var xp=new WeakMap;function En(t,i){if(typeof t=="object"&&t!==null){var l=xp.get(t);return l!==void 0?l:(i={value:t,source:i,stack:jt(i)},xp.set(t,i),i)}return{value:t,source:i,stack:jt(i)}}var wa=[],xa=0,jr=null,Zl=0,Nn=[],_n=0,Ki=null,ti=1,ni="";function vi(t,i){wa[xa++]=Zl,wa[xa++]=jr,jr=t,Zl=i}function Ep(t,i,l){Nn[_n++]=ti,Nn[_n++]=ni,Nn[_n++]=Ki,Ki=t;var r=ti;t=ni;var f=32-Mt(r)-1;r&=~(1<<f),l+=1;var m=32-Mt(i)+f;if(30<m){var S=f-f%5;m=(r&(1<<S)-1).toString(32),r>>=S,f-=S,ti=1<<32-Mt(i)+f|l<<f|r,ni=m+t}else ti=1<<m|l<<f|r,ni=t}function yf(t){t.return!==null&&(vi(t,1),Ep(t,1,0))}function vf(t){for(;t===jr;)jr=wa[--xa],wa[xa]=null,Zl=wa[--xa],wa[xa]=null;for(;t===Ki;)Ki=Nn[--_n],Nn[_n]=null,ni=Nn[--_n],Nn[_n]=null,ti=Nn[--_n],Nn[_n]=null}function Np(t,i){Nn[_n++]=ti,Nn[_n++]=ni,Nn[_n++]=Ki,ti=i.id,ni=i.overflow,Ki=t}var Ot=null,We=null,je=!1,Zi=null,An=!1,bf=Error(a(519));function Qi(t){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ql(En(i,t)),bf}function _p(t){var i=t.stateNode,l=t.type,r=t.memoizedProps;switch(i[dt]=t,i[At]=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<vo.length;l++)ke(vo[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),da(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),Um(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||qy(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=pi),i=!0):i=!1,i||Qi(t,!0)}function Ap(t){for(Ot=t.return;Ot;)switch(Ot.tag){case 5:case 31:case 13:An=!1;return;case 27:case 3:An=!0;return;default:Ot=Ot.return}}function Ea(t){if(t!==Ot)return!1;if(!je)return Ap(t),je=!0,!1;var i=t.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Ld(t.type,t.memoizedProps)),l=!l),l&&We&&Qi(t),Ap(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));We=Jy(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(a(317));We=Jy(t)}else i===27?(i=We,cs(t.type)?(t=qd,qd=null,We=t):We=i):We=Ot?Cn(t.stateNode.nextSibling):null;return!0}function Os(){We=Ot=null,je=!1}function Sf(){var t=Zi;return t!==null&&(Pt===null?Pt=t:Pt.push.apply(Pt,t),Zi=null),t}function Ql(t){Zi===null?Zi=[t]:Zi.push(t)}var wf=w(null),ks=null,bi=null;function Fi(t,i,l){F(wf,i._currentValue),i._currentValue=l}function Si(t){t._currentValue=wf.current,z(wf)}function xf(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 Ef(t,i,l,r){var f=t.child;for(f!==null&&(f.return=t);f!==null;){var m=f.dependencies;if(m!==null){var S=f.child;m=m.firstContext;e:for(;m!==null;){var M=m;m=f;for(var I=0;I<i.length;I++)if(M.context===i[I]){m.lanes|=l,M=m.alternate,M!==null&&(M.lanes|=l),xf(m.return,l,t),r||(S=null);break e}m=M.next}}else if(f.tag===18){if(S=f.return,S===null)throw Error(a(341));S.lanes|=l,m=S.alternate,m!==null&&(m.lanes|=l),xf(S,l,t),S=null}else S=f.child;if(S!==null)S.return=f;else for(S=f;S!==null;){if(S===t){S=null;break}if(f=S.sibling,f!==null){f.return=S.return,S=f;break}S=S.return}f=S}}function Na(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 S=f.alternate;if(S===null)throw Error(a(387));if(S=S.memoizedProps,S!==null){var M=f.type;rn(f.pendingProps.value,S.value)||(t!==null?t.push(M):t=[M])}}else if(f===ie.current){if(S=f.alternate,S===null)throw Error(a(387));S.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(t!==null?t.push(Eo):t=[Eo])}f=f.return}t!==null&&Ef(i,t,l,r),i.flags|=262144}function Rr(t){for(t=t.firstContext;t!==null;){if(!rn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function zs(t){ks=t,bi=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function kt(t){return Tp(ks,t)}function Br(t,i){return ks===null&&zs(t),Tp(t,i)}function Tp(t,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},bi===null){if(t===null)throw Error(a(308));bi=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else bi=bi.next=i;return l}var ux=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()})}},fx=e.unstable_scheduleCallback,dx=e.unstable_NormalPriority,vt={$$typeof:A,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Nf(){return{controller:new ux,data:new Map,refCount:0}}function Fl(t){t.refCount--,t.refCount===0&&fx(dx,function(){t.controller.abort()})}var Jl=null,_f=0,_a=0,Aa=null;function hx(t,i){if(Jl===null){var l=Jl=[];_f=0,_a=Cd(),Aa={status:"pending",value:void 0,then:function(r){l.push(r)}}}return _f++,i.then(Cp,Cp),i}function Cp(){if(--_f===0&&Jl!==null){Aa!==null&&(Aa.status="fulfilled");var t=Jl;Jl=null,_a=0,Aa=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function mx(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 Mp=O.S;O.S=function(t,i){dy=Ze(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&hx(t,i),Mp!==null&&Mp(t,i)};var Ds=w(null);function Af(){var t=Ds.current;return t!==null?t:Qe.pooledCache}function Lr(t,i){i===null?F(Ds,Ds.current):F(Ds,i.pool)}function Op(){var t=Af();return t===null?null:{parent:vt._currentValue,pool:t}}var Ta=Error(a(460)),Tf=Error(a(474)),$r=Error(a(542)),Hr={then:function(){}};function kp(t){return t=t.status,t==="fulfilled"||t==="rejected"}function zp(t,i,l){switch(l=t[l],l===void 0?t.push(i):l!==i&&(i.then(pi,pi),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,jp(t),t;default:if(typeof i.status=="string")i.then(pi,pi);else{if(t=Qe,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,jp(t),t}throw Rs=i,Ta}}function js(t){try{var i=t._init;return i(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Rs=l,Ta):l}}var Rs=null;function Dp(){if(Rs===null)throw Error(a(459));var t=Rs;return Rs=null,t}function jp(t){if(t===Ta||t===$r)throw Error(a(483))}var Ca=null,Wl=0;function Ur(t){var i=Wl;return Wl+=1,Ca===null&&(Ca=[]),zp(Ca,t,i)}function Pl(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function Ir(t,i){throw i.$$typeof===v?Error(a(525)):(t=Object.prototype.toString.call(i),Error(a(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function Rp(t){function i(Q,G){if(t){var J=Q.deletions;J===null?(Q.deletions=[G],Q.flags|=16):J.push(G)}}function l(Q,G){if(!t)return null;for(;G!==null;)i(Q,G),G=G.sibling;return null}function r(Q){for(var G=new Map;Q!==null;)Q.key!==null?G.set(Q.key,Q):G.set(Q.index,Q),Q=Q.sibling;return G}function f(Q,G){return Q=yi(Q,G),Q.index=0,Q.sibling=null,Q}function m(Q,G,J){return Q.index=J,t?(J=Q.alternate,J!==null?(J=J.index,J<G?(Q.flags|=67108866,G):J):(Q.flags|=67108866,G)):(Q.flags|=1048576,G)}function S(Q){return t&&Q.alternate===null&&(Q.flags|=67108866),Q}function M(Q,G,J,ce){return G===null||G.tag!==6?(G=pf(J,Q.mode,ce),G.return=Q,G):(G=f(G,J),G.return=Q,G)}function I(Q,G,J,ce){var we=J.type;return we===_?re(Q,G,J.props.children,ce,J.key):G!==null&&(G.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===R&&js(we)===G.type)?(G=f(G,J.props),Pl(G,J),G.return=Q,G):(G=Dr(J.type,J.key,J.props,null,Q.mode,ce),Pl(G,J),G.return=Q,G)}function P(Q,G,J,ce){return G===null||G.tag!==4||G.stateNode.containerInfo!==J.containerInfo||G.stateNode.implementation!==J.implementation?(G=gf(J,Q.mode,ce),G.return=Q,G):(G=f(G,J.children||[]),G.return=Q,G)}function re(Q,G,J,ce,we){return G===null||G.tag!==7?(G=Ms(J,Q.mode,ce,we),G.return=Q,G):(G=f(G,J),G.return=Q,G)}function ue(Q,G,J){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=pf(""+G,Q.mode,J),G.return=Q,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case x:return J=Dr(G.type,G.key,G.props,null,Q.mode,J),Pl(J,G),J.return=Q,J;case E:return G=gf(G,Q.mode,J),G.return=Q,G;case R:return G=js(G),ue(Q,G,J)}if(K(G)||Z(G))return G=Ms(G,Q.mode,J,null),G.return=Q,G;if(typeof G.then=="function")return ue(Q,Ur(G),J);if(G.$$typeof===A)return ue(Q,Br(Q,G),J);Ir(Q,G)}return null}function ne(Q,G,J,ce){var we=G!==null?G.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return we!==null?null:M(Q,G,""+J,ce);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case x:return J.key===we?I(Q,G,J,ce):null;case E:return J.key===we?P(Q,G,J,ce):null;case R:return J=js(J),ne(Q,G,J,ce)}if(K(J)||Z(J))return we!==null?null:re(Q,G,J,ce,null);if(typeof J.then=="function")return ne(Q,G,Ur(J),ce);if(J.$$typeof===A)return ne(Q,G,Br(Q,J),ce);Ir(Q,J)}return null}function ae(Q,G,J,ce,we){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return Q=Q.get(J)||null,M(G,Q,""+ce,we);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case x:return Q=Q.get(ce.key===null?J:ce.key)||null,I(G,Q,ce,we);case E:return Q=Q.get(ce.key===null?J:ce.key)||null,P(G,Q,ce,we);case R:return ce=js(ce),ae(Q,G,J,ce,we)}if(K(ce)||Z(ce))return Q=Q.get(J)||null,re(G,Q,ce,we,null);if(typeof ce.then=="function")return ae(Q,G,J,Ur(ce),we);if(ce.$$typeof===A)return ae(Q,G,J,Br(G,ce),we);Ir(G,ce)}return null}function ye(Q,G,J,ce){for(var we=null,Le=null,be=G,Me=G=0,De=null;be!==null&&Me<J.length;Me++){be.index>Me?(De=be,be=null):De=be.sibling;var $e=ne(Q,be,J[Me],ce);if($e===null){be===null&&(be=De);break}t&&be&&$e.alternate===null&&i(Q,be),G=m($e,G,Me),Le===null?we=$e:Le.sibling=$e,Le=$e,be=De}if(Me===J.length)return l(Q,be),je&&vi(Q,Me),we;if(be===null){for(;Me<J.length;Me++)be=ue(Q,J[Me],ce),be!==null&&(G=m(be,G,Me),Le===null?we=be:Le.sibling=be,Le=be);return je&&vi(Q,Me),we}for(be=r(be);Me<J.length;Me++)De=ae(be,Q,Me,J[Me],ce),De!==null&&(t&&De.alternate!==null&&be.delete(De.key===null?Me:De.key),G=m(De,G,Me),Le===null?we=De:Le.sibling=De,Le=De);return t&&be.forEach(function(ms){return i(Q,ms)}),je&&vi(Q,Me),we}function Ne(Q,G,J,ce){if(J==null)throw Error(a(151));for(var we=null,Le=null,be=G,Me=G=0,De=null,$e=J.next();be!==null&&!$e.done;Me++,$e=J.next()){be.index>Me?(De=be,be=null):De=be.sibling;var ms=ne(Q,be,$e.value,ce);if(ms===null){be===null&&(be=De);break}t&&be&&ms.alternate===null&&i(Q,be),G=m(ms,G,Me),Le===null?we=ms:Le.sibling=ms,Le=ms,be=De}if($e.done)return l(Q,be),je&&vi(Q,Me),we;if(be===null){for(;!$e.done;Me++,$e=J.next())$e=ue(Q,$e.value,ce),$e!==null&&(G=m($e,G,Me),Le===null?we=$e:Le.sibling=$e,Le=$e);return je&&vi(Q,Me),we}for(be=r(be);!$e.done;Me++,$e=J.next())$e=ae(be,Q,Me,$e.value,ce),$e!==null&&(t&&$e.alternate!==null&&be.delete($e.key===null?Me:$e.key),G=m($e,G,Me),Le===null?we=$e:Le.sibling=$e,Le=$e);return t&&be.forEach(function(_E){return i(Q,_E)}),je&&vi(Q,Me),we}function Ke(Q,G,J,ce){if(typeof J=="object"&&J!==null&&J.type===_&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case x:e:{for(var we=J.key;G!==null;){if(G.key===we){if(we=J.type,we===_){if(G.tag===7){l(Q,G.sibling),ce=f(G,J.props.children),ce.return=Q,Q=ce;break e}}else if(G.elementType===we||typeof we=="object"&&we!==null&&we.$$typeof===R&&js(we)===G.type){l(Q,G.sibling),ce=f(G,J.props),Pl(ce,J),ce.return=Q,Q=ce;break e}l(Q,G);break}else i(Q,G);G=G.sibling}J.type===_?(ce=Ms(J.props.children,Q.mode,ce,J.key),ce.return=Q,Q=ce):(ce=Dr(J.type,J.key,J.props,null,Q.mode,ce),Pl(ce,J),ce.return=Q,Q=ce)}return S(Q);case E:e:{for(we=J.key;G!==null;){if(G.key===we)if(G.tag===4&&G.stateNode.containerInfo===J.containerInfo&&G.stateNode.implementation===J.implementation){l(Q,G.sibling),ce=f(G,J.children||[]),ce.return=Q,Q=ce;break e}else{l(Q,G);break}else i(Q,G);G=G.sibling}ce=gf(J,Q.mode,ce),ce.return=Q,Q=ce}return S(Q);case R:return J=js(J),Ke(Q,G,J,ce)}if(K(J))return ye(Q,G,J,ce);if(Z(J)){if(we=Z(J),typeof we!="function")throw Error(a(150));return J=we.call(J),Ne(Q,G,J,ce)}if(typeof J.then=="function")return Ke(Q,G,Ur(J),ce);if(J.$$typeof===A)return Ke(Q,G,Br(Q,J),ce);Ir(Q,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,G!==null&&G.tag===6?(l(Q,G.sibling),ce=f(G,J),ce.return=Q,Q=ce):(l(Q,G),ce=pf(J,Q.mode,ce),ce.return=Q,Q=ce),S(Q)):l(Q,G)}return function(Q,G,J,ce){try{Wl=0;var we=Ke(Q,G,J,ce);return Ca=null,we}catch(be){if(be===Ta||be===$r)throw be;var Le=cn(29,be,null,Q.mode);return Le.lanes=ce,Le.return=Q,Le}}}var Bs=Rp(!0),Bp=Rp(!1),Ji=!1;function Cf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Mf(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 Wi(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function Pi(t,i,l){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,(He&2)!==0){var f=r.pending;return f===null?i.next=i:(i.next=f.next,f.next=i),r.pending=i,i=zr(t),bp(t,null,l),i}return kr(t,r,i,l),zr(t)}function eo(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,Ii(t,l)}}function Of(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 S={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};m===null?f=m=S:m=m.next=S,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 kf=!1;function to(){if(kf){var t=Aa;if(t!==null)throw t}}function no(t,i,l,r){kf=!1;var f=t.updateQueue;Ji=!1;var m=f.firstBaseUpdate,S=f.lastBaseUpdate,M=f.shared.pending;if(M!==null){f.shared.pending=null;var I=M,P=I.next;I.next=null,S===null?m=P:S.next=P,S=I;var re=t.alternate;re!==null&&(re=re.updateQueue,M=re.lastBaseUpdate,M!==S&&(M===null?re.firstBaseUpdate=P:M.next=P,re.lastBaseUpdate=I))}if(m!==null){var ue=f.baseState;S=0,re=P=I=null,M=m;do{var ne=M.lane&-536870913,ae=ne!==M.lane;if(ae?(ze&ne)===ne:(r&ne)===ne){ne!==0&&ne===_a&&(kf=!0),re!==null&&(re=re.next={lane:0,tag:M.tag,payload:M.payload,callback:null,next:null});e:{var ye=t,Ne=M;ne=i;var Ke=l;switch(Ne.tag){case 1:if(ye=Ne.payload,typeof ye=="function"){ue=ye.call(Ke,ue,ne);break e}ue=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=Ne.payload,ne=typeof ye=="function"?ye.call(Ke,ue,ne):ye,ne==null)break e;ue=g({},ue,ne);break e;case 2:Ji=!0}}ne=M.callback,ne!==null&&(t.flags|=64,ae&&(t.flags|=8192),ae=f.callbacks,ae===null?f.callbacks=[ne]:ae.push(ne))}else ae={lane:ne,tag:M.tag,payload:M.payload,callback:M.callback,next:null},re===null?(P=re=ae,I=ue):re=re.next=ae,S|=ne;if(M=M.next,M===null){if(M=f.shared.pending,M===null)break;ae=M,M=ae.next,ae.next=null,f.lastBaseUpdate=ae,f.shared.pending=null}}while(!0);re===null&&(I=ue),f.baseState=I,f.firstBaseUpdate=P,f.lastBaseUpdate=re,m===null&&(f.shared.lanes=0),ss|=S,t.lanes=S,t.memoizedState=ue}}function Lp(t,i){if(typeof t!="function")throw Error(a(191,t));t.call(i)}function $p(t,i){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Lp(l[t],i)}var Ma=w(null),qr=w(0);function Hp(t,i){t=Mi,F(qr,t),F(Ma,i),Mi=t|i.baseLanes}function zf(){F(qr,Mi),F(Ma,Ma.current)}function Df(){Mi=qr.current,z(Ma),z(qr)}var un=w(null),Tn=null;function es(t){var i=t.alternate;F(ht,ht.current&1),F(un,t),Tn===null&&(i===null||Ma.current!==null||i.memoizedState!==null)&&(Tn=t)}function jf(t){F(ht,ht.current),F(un,t),Tn===null&&(Tn=t)}function Up(t){t.tag===22?(F(ht,ht.current),F(un,t),Tn===null&&(Tn=t)):ts()}function ts(){F(ht,ht.current),F(un,un.current)}function fn(t){z(un),Tn===t&&(Tn=null),z(ht)}var ht=w(0);function Vr(t){for(var i=t;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Ud(l)||Id(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 wi=0,Te=null,Ge=null,bt=null,Yr=!1,Oa=!1,Ls=!1,Gr=0,io=0,ka=null,px=0;function ct(){throw Error(a(321))}function Rf(t,i){if(i===null)return!1;for(var l=0;l<i.length&&l<t.length;l++)if(!rn(t[l],i[l]))return!1;return!0}function Bf(t,i,l,r,f,m){return wi=m,Te=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,O.H=t===null||t.memoizedState===null?Eg:Jf,Ls=!1,m=l(r,f),Ls=!1,Oa&&(m=qp(i,l,r,f)),Ip(t),m}function Ip(t){O.H=lo;var i=Ge!==null&&Ge.next!==null;if(wi=0,bt=Ge=Te=null,Yr=!1,io=0,ka=null,i)throw Error(a(300));t===null||St||(t=t.dependencies,t!==null&&Rr(t)&&(St=!0))}function qp(t,i,l,r){Te=t;var f=0;do{if(Oa&&(ka=null),io=0,Oa=!1,25<=f)throw Error(a(301));if(f+=1,bt=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)}O.H=Ng,m=i(l,r)}while(Oa);return m}function gx(){var t=O.H,i=t.useState()[0];return i=typeof i.then=="function"?so(i):i,t=t.useState()[0],(Ge!==null?Ge.memoizedState:null)!==t&&(Te.flags|=1024),i}function Lf(){var t=Gr!==0;return Gr=0,t}function $f(t,i,l){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~l}function Hf(t){if(Yr){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}Yr=!1}wi=0,bt=Ge=Te=null,Oa=!1,io=Gr=0,ka=null}function It(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return bt===null?Te.memoizedState=bt=t:bt=bt.next=t,bt}function mt(){if(Ge===null){var t=Te.alternate;t=t!==null?t.memoizedState:null}else t=Ge.next;var i=bt===null?Te.memoizedState:bt.next;if(i!==null)bt=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},bt===null?Te.memoizedState=bt=t:bt=bt.next=t}return bt}function Xr(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function so(t){var i=io;return io+=1,ka===null&&(ka=[]),t=zp(ka,t,i),i=Te,(bt===null?i.memoizedState:bt.next)===null&&(i=i.alternate,O.H=i===null||i.memoizedState===null?Eg:Jf),t}function Kr(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return so(t);if(t.$$typeof===A)return kt(t)}throw Error(a(438,String(t)))}function Uf(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=Xr(),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]=q;return i.index++,l}function xi(t,i){return typeof i=="function"?i(t):i}function Zr(t){var i=mt();return If(i,Ge,t)}function If(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 S=f.next;f.next=m.next,m.next=S}i.baseQueue=f=m,r.pending=null}if(m=t.baseState,f===null)t.memoizedState=m;else{i=f.next;var M=S=null,I=null,P=i,re=!1;do{var ue=P.lane&-536870913;if(ue!==P.lane?(ze&ue)===ue:(wi&ue)===ue){var ne=P.revertLane;if(ne===0)I!==null&&(I=I.next={lane:0,revertLane:0,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null}),ue===_a&&(re=!0);else if((wi&ne)===ne){P=P.next,ne===_a&&(re=!0);continue}else ue={lane:0,revertLane:P.revertLane,gesture:null,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},I===null?(M=I=ue,S=m):I=I.next=ue,Te.lanes|=ne,ss|=ne;ue=P.action,Ls&&l(m,ue),m=P.hasEagerState?P.eagerState:l(m,ue)}else ne={lane:ue,revertLane:P.revertLane,gesture:P.gesture,action:P.action,hasEagerState:P.hasEagerState,eagerState:P.eagerState,next:null},I===null?(M=I=ne,S=m):I=I.next=ne,Te.lanes|=ue,ss|=ue;P=P.next}while(P!==null&&P!==i);if(I===null?S=m:I.next=M,!rn(m,t.memoizedState)&&(St=!0,re&&(l=Aa,l!==null)))throw l;t.memoizedState=m,t.baseState=S,t.baseQueue=I,r.lastRenderedState=m}return f===null&&(r.lanes=0),[t.memoizedState,r.dispatch]}function qf(t){var i=mt(),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 S=f=f.next;do m=t(m,S.action),S=S.next;while(S!==f);rn(m,i.memoizedState)||(St=!0),i.memoizedState=m,i.baseQueue===null&&(i.baseState=m),l.lastRenderedState=m}return[m,r]}function Vp(t,i,l){var r=Te,f=mt(),m=je;if(m){if(l===void 0)throw Error(a(407));l=l()}else l=i();var S=!rn((Ge||f).memoizedState,l);if(S&&(f.memoizedState=l,St=!0),f=f.queue,Gf(Xp.bind(null,r,f,t),[t]),f.getSnapshot!==i||S||bt!==null&&bt.memoizedState.tag&1){if(r.flags|=2048,za(9,{destroy:void 0},Gp.bind(null,r,f,l,i),null),Qe===null)throw Error(a(349));m||(wi&127)!==0||Yp(r,i,l)}return l}function Yp(t,i,l){t.flags|=16384,t={getSnapshot:i,value:l},i=Te.updateQueue,i===null?(i=Xr(),Te.updateQueue=i,i.stores=[t]):(l=i.stores,l===null?i.stores=[t]:l.push(t))}function Gp(t,i,l,r){i.value=l,i.getSnapshot=r,Kp(i)&&Zp(t)}function Xp(t,i,l){return l(function(){Kp(i)&&Zp(t)})}function Kp(t){var i=t.getSnapshot;t=t.value;try{var l=i();return!rn(t,l)}catch{return!0}}function Zp(t){var i=Cs(t,2);i!==null&&en(i,t,2)}function Vf(t){var i=It();if(typeof t=="function"){var l=t;if(t=l(),Ls){Sn(!0);try{l()}finally{Sn(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:t},i}function Qp(t,i,l,r){return t.baseState=l,If(t,Ge,typeof r=="function"?r:xi)}function yx(t,i,l,r,f){if(Jr(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(S){m.listeners.push(S)}};O.T!==null?l(!0):m.isTransition=!1,r(m),l=i.pending,l===null?(m.next=i.pending=m,Fp(i,m)):(m.next=l.next,i.pending=l.next=m)}}function Fp(t,i){var l=i.action,r=i.payload,f=t.state;if(i.isTransition){var m=O.T,S={};O.T=S;try{var M=l(f,r),I=O.S;I!==null&&I(S,M),Jp(t,i,M)}catch(P){Yf(t,i,P)}finally{m!==null&&S.types!==null&&(m.types=S.types),O.T=m}}else try{m=l(f,r),Jp(t,i,m)}catch(P){Yf(t,i,P)}}function Jp(t,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(r){Wp(t,i,r)},function(r){return Yf(t,i,r)}):Wp(t,i,l)}function Wp(t,i,l){i.status="fulfilled",i.value=l,Pp(i),t.state=l,i=t.pending,i!==null&&(l=i.next,l===i?t.pending=null:(l=l.next,i.next=l,Fp(t,l)))}function Yf(t,i,l){var r=t.pending;if(t.pending=null,r!==null){r=r.next;do i.status="rejected",i.reason=l,Pp(i),i=i.next;while(i!==r)}t.action=null}function Pp(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function eg(t,i){return i}function tg(t,i){if(je){var l=Qe.formState;if(l!==null){e:{var r=Te;if(je){if(We){t:{for(var f=We,m=An;f.nodeType!==8;){if(!m){f=null;break t}if(f=Cn(f.nextSibling),f===null){f=null;break t}}m=f.data,f=m==="F!"||m==="F"?f:null}if(f){We=Cn(f.nextSibling),r=f.data==="F!";break e}}Qi(r)}r=!1}r&&(i=l[0])}}return l=It(),l.memoizedState=l.baseState=i,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:eg,lastRenderedState:i},l.queue=r,l=Sg.bind(null,Te,r),r.dispatch=l,r=Vf(!1),m=Ff.bind(null,Te,!1,r.queue),r=It(),f={state:i,dispatch:null,action:t,pending:null},r.queue=f,l=yx.bind(null,Te,f,m,l),f.dispatch=l,r.memoizedState=t,[i,l,!1]}function ng(t){var i=mt();return ig(i,Ge,t)}function ig(t,i,l){if(i=If(t,i,eg)[0],t=Zr(xi)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var r=so(i)}catch(S){throw S===Ta?$r:S}else r=i;i=mt();var f=i.queue,m=f.dispatch;return l!==i.memoizedState&&(Te.flags|=2048,za(9,{destroy:void 0},vx.bind(null,f,l),null)),[r,m,t]}function vx(t,i){t.action=i}function sg(t){var i=mt(),l=Ge;if(l!==null)return ig(i,l,t);mt(),i=i.memoizedState,l=mt();var r=l.queue.dispatch;return l.memoizedState=t,[i,r,!1]}function za(t,i,l,r){return t={tag:t,create:l,deps:r,inst:i,next:null},i=Te.updateQueue,i===null&&(i=Xr(),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 ag(){return mt().memoizedState}function Qr(t,i,l,r){var f=It();Te.flags|=t,f.memoizedState=za(1|i,{destroy:void 0},l,r===void 0?null:r)}function Fr(t,i,l,r){var f=mt();r=r===void 0?null:r;var m=f.memoizedState.inst;Ge!==null&&r!==null&&Rf(r,Ge.memoizedState.deps)?f.memoizedState=za(i,m,l,r):(Te.flags|=t,f.memoizedState=za(1|i,m,l,r))}function lg(t,i){Qr(8390656,8,t,i)}function Gf(t,i){Fr(2048,8,t,i)}function bx(t){Te.flags|=4;var i=Te.updateQueue;if(i===null)i=Xr(),Te.updateQueue=i,i.events=[t];else{var l=i.events;l===null?i.events=[t]:l.push(t)}}function og(t){var i=mt().memoizedState;return bx({ref:i,nextImpl:t}),function(){if((He&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function rg(t,i){return Fr(4,2,t,i)}function cg(t,i){return Fr(4,4,t,i)}function ug(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 fg(t,i,l){l=l!=null?l.concat([t]):null,Fr(4,4,ug.bind(null,i,t),l)}function Xf(){}function dg(t,i){var l=mt();i=i===void 0?null:i;var r=l.memoizedState;return i!==null&&Rf(i,r[1])?r[0]:(l.memoizedState=[t,i],t)}function hg(t,i){var l=mt();i=i===void 0?null:i;var r=l.memoizedState;if(i!==null&&Rf(i,r[1]))return r[0];if(r=t(),Ls){Sn(!0);try{t()}finally{Sn(!1)}}return l.memoizedState=[r,i],r}function Kf(t,i,l){return l===void 0||(wi&1073741824)!==0&&(ze&261930)===0?t.memoizedState=i:(t.memoizedState=l,t=my(),Te.lanes|=t,ss|=t,l)}function mg(t,i,l,r){return rn(l,i)?l:Ma.current!==null?(t=Kf(t,l,r),rn(t,i)||(St=!0),t):(wi&42)===0||(wi&1073741824)!==0&&(ze&261930)===0?(St=!0,t.memoizedState=l):(t=my(),Te.lanes|=t,ss|=t,i)}function pg(t,i,l,r,f){var m=H.p;H.p=m!==0&&8>m?m:8;var S=O.T,M={};O.T=M,Ff(t,!1,i,l);try{var I=f(),P=O.S;if(P!==null&&P(M,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var re=mx(I,r);ao(t,i,re,mn(t))}else ao(t,i,r,mn(t))}catch(ue){ao(t,i,{then:function(){},status:"rejected",reason:ue},mn())}finally{H.p=m,S!==null&&M.types!==null&&(S.types=M.types),O.T=S}}function Sx(){}function Zf(t,i,l,r){if(t.tag!==5)throw Error(a(476));var f=gg(t).queue;pg(t,f,i,$,l===null?Sx:function(){return yg(t),l(r)})}function gg(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:$,baseState:$,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:$},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:l},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function yg(t){var i=gg(t);i.next===null&&(i=t.alternate.memoizedState),ao(t,i.next.queue,{},mn())}function Qf(){return kt(Eo)}function vg(){return mt().memoizedState}function bg(){return mt().memoizedState}function wx(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var l=mn();t=Wi(l);var r=Pi(i,t,l);r!==null&&(en(r,i,l),eo(r,i,l)),i={cache:Nf()},t.payload=i;return}i=i.return}}function xx(t,i,l){var r=mn();l={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Jr(t)?wg(i,l):(l=hf(t,i,l,r),l!==null&&(en(l,t,r),xg(l,i,r)))}function Sg(t,i,l){var r=mn();ao(t,i,l,r)}function ao(t,i,l,r){var f={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Jr(t))wg(i,f);else{var m=t.alternate;if(t.lanes===0&&(m===null||m.lanes===0)&&(m=i.lastRenderedReducer,m!==null))try{var S=i.lastRenderedState,M=m(S,l);if(f.hasEagerState=!0,f.eagerState=M,rn(M,S))return kr(t,i,f,0),Qe===null&&Or(),!1}catch{}if(l=hf(t,i,f,r),l!==null)return en(l,t,r),xg(l,i,r),!0}return!1}function Ff(t,i,l,r){if(r={lane:2,revertLane:Cd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Jr(t)){if(i)throw Error(a(479))}else i=hf(t,l,r,2),i!==null&&en(i,t,2)}function Jr(t){var i=t.alternate;return t===Te||i!==null&&i===Te}function wg(t,i){Oa=Yr=!0;var l=t.pending;l===null?i.next=i:(i.next=l.next,l.next=i),t.pending=i}function xg(t,i,l){if((l&4194048)!==0){var r=i.lanes;r&=t.pendingLanes,l|=r,i.lanes=l,Ii(t,l)}}var lo={readContext:kt,use:Kr,useCallback:ct,useContext:ct,useEffect:ct,useImperativeHandle:ct,useLayoutEffect:ct,useInsertionEffect:ct,useMemo:ct,useReducer:ct,useRef:ct,useState:ct,useDebugValue:ct,useDeferredValue:ct,useTransition:ct,useSyncExternalStore:ct,useId:ct,useHostTransitionStatus:ct,useFormState:ct,useActionState:ct,useOptimistic:ct,useMemoCache:ct,useCacheRefresh:ct};lo.useEffectEvent=ct;var Eg={readContext:kt,use:Kr,useCallback:function(t,i){return It().memoizedState=[t,i===void 0?null:i],t},useContext:kt,useEffect:lg,useImperativeHandle:function(t,i,l){l=l!=null?l.concat([t]):null,Qr(4194308,4,ug.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=It();i=i===void 0?null:i;var r=t();if(Ls){Sn(!0);try{t()}finally{Sn(!1)}}return l.memoizedState=[r,i],r},useReducer:function(t,i,l){var r=It();if(l!==void 0){var f=l(i);if(Ls){Sn(!0);try{l(i)}finally{Sn(!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=xx.bind(null,Te,t),[r.memoizedState,t]},useRef:function(t){var i=It();return t={current:t},i.memoizedState=t},useState:function(t){t=Vf(t);var i=t.queue,l=Sg.bind(null,Te,i);return i.dispatch=l,[t.memoizedState,l]},useDebugValue:Xf,useDeferredValue:function(t,i){var l=It();return Kf(l,t,i)},useTransition:function(){var t=Vf(!1);return t=pg.bind(null,Te,t.queue,!0,!1),It().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,l){var r=Te,f=It();if(je){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),Qe===null)throw Error(a(349));(ze&127)!==0||Yp(r,i,l)}f.memoizedState=l;var m={value:l,getSnapshot:i};return f.queue=m,lg(Xp.bind(null,r,m,t),[t]),r.flags|=2048,za(9,{destroy:void 0},Gp.bind(null,r,m,l,i),null),l},useId:function(){var t=It(),i=Qe.identifierPrefix;if(je){var l=ni,r=ti;l=(r&~(1<<32-Mt(r)-1)).toString(32)+l,i="_"+i+"R_"+l,l=Gr++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=px++,i="_"+i+"r_"+l.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:Qf,useFormState:tg,useActionState:tg,useOptimistic:function(t){var i=It();i.memoizedState=i.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=Ff.bind(null,Te,!0,l),l.dispatch=i,[t,i]},useMemoCache:Uf,useCacheRefresh:function(){return It().memoizedState=wx.bind(null,Te)},useEffectEvent:function(t){var i=It(),l={impl:t};return i.memoizedState=l,function(){if((He&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},Jf={readContext:kt,use:Kr,useCallback:dg,useContext:kt,useEffect:Gf,useImperativeHandle:fg,useInsertionEffect:rg,useLayoutEffect:cg,useMemo:hg,useReducer:Zr,useRef:ag,useState:function(){return Zr(xi)},useDebugValue:Xf,useDeferredValue:function(t,i){var l=mt();return mg(l,Ge.memoizedState,t,i)},useTransition:function(){var t=Zr(xi)[0],i=mt().memoizedState;return[typeof t=="boolean"?t:so(t),i]},useSyncExternalStore:Vp,useId:vg,useHostTransitionStatus:Qf,useFormState:ng,useActionState:ng,useOptimistic:function(t,i){var l=mt();return Qp(l,Ge,t,i)},useMemoCache:Uf,useCacheRefresh:bg};Jf.useEffectEvent=og;var Ng={readContext:kt,use:Kr,useCallback:dg,useContext:kt,useEffect:Gf,useImperativeHandle:fg,useInsertionEffect:rg,useLayoutEffect:cg,useMemo:hg,useReducer:qf,useRef:ag,useState:function(){return qf(xi)},useDebugValue:Xf,useDeferredValue:function(t,i){var l=mt();return Ge===null?Kf(l,t,i):mg(l,Ge.memoizedState,t,i)},useTransition:function(){var t=qf(xi)[0],i=mt().memoizedState;return[typeof t=="boolean"?t:so(t),i]},useSyncExternalStore:Vp,useId:vg,useHostTransitionStatus:Qf,useFormState:sg,useActionState:sg,useOptimistic:function(t,i){var l=mt();return Ge!==null?Qp(l,Ge,t,i):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:Uf,useCacheRefresh:bg};Ng.useEffectEvent=og;function Wf(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 Pf={enqueueSetState:function(t,i,l){t=t._reactInternals;var r=mn(),f=Wi(r);f.payload=i,l!=null&&(f.callback=l),i=Pi(t,f,r),i!==null&&(en(i,t,r),eo(i,t,r))},enqueueReplaceState:function(t,i,l){t=t._reactInternals;var r=mn(),f=Wi(r);f.tag=1,f.payload=i,l!=null&&(f.callback=l),i=Pi(t,f,r),i!==null&&(en(i,t,r),eo(i,t,r))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var l=mn(),r=Wi(l);r.tag=2,i!=null&&(r.callback=i),i=Pi(t,r,l),i!==null&&(en(i,t,l),eo(i,t,l))}};function _g(t,i,l,r,f,m,S){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(r,m,S):i.prototype&&i.prototype.isPureReactComponent?!Xl(l,r)||!Xl(f,m):!0}function Ag(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&&Pf.enqueueReplaceState(i,i.state,null)}function $s(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 Tg(t){Mr(t)}function Cg(t){console.error(t)}function Mg(t){Mr(t)}function Wr(t,i){try{var l=t.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(r){setTimeout(function(){throw r})}}function Og(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 ed(t,i,l){return l=Wi(l),l.tag=3,l.payload={element:null},l.callback=function(){Wr(t,i)},l}function kg(t){return t=Wi(t),t.tag=3,t}function zg(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(){Og(i,l,r)}}var S=l.stateNode;S!==null&&typeof S.componentDidCatch=="function"&&(t.callback=function(){Og(i,l,r),typeof f!="function"&&(as===null?as=new Set([this]):as.add(this));var M=r.stack;this.componentDidCatch(r.value,{componentStack:M!==null?M:""})})}function Ex(t,i,l,r,f){if(l.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(i=l.alternate,i!==null&&Na(i,l,f,!0),l=un.current,l!==null){switch(l.tag){case 31:case 13:return Tn===null?uc():l.alternate===null&&ut===0&&(ut=3),l.flags&=-257,l.flags|=65536,l.lanes=f,r===Hr?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([r]):i.add(r),_d(t,r,f)),!1;case 22:return l.flags|=65536,r===Hr?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)),_d(t,r,f)),!1}throw Error(a(435,l.tag))}return _d(t,r,f),uc(),!1}if(je)return i=un.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=f,r!==bf&&(t=Error(a(422),{cause:r}),Ql(En(t,l)))):(r!==bf&&(i=Error(a(423),{cause:r}),Ql(En(i,l))),t=t.current.alternate,t.flags|=65536,f&=-f,t.lanes|=f,r=En(r,l),f=ed(t.stateNode,r,f),Of(t,f),ut!==4&&(ut=2)),!1;var m=Error(a(520),{cause:r});if(m=En(m,l),po===null?po=[m]:po.push(m),ut!==4&&(ut=2),i===null)return!0;r=En(r,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,t=f&-f,l.lanes|=t,t=ed(l.stateNode,r,t),Of(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"&&(as===null||!as.has(m))))return l.flags|=65536,f&=-f,l.lanes|=f,f=kg(f),zg(f,t,l,r),Of(l,f),!1}l=l.return}while(l!==null);return!1}var td=Error(a(461)),St=!1;function zt(t,i,l,r){i.child=t===null?Bp(i,null,l,r):Bs(i,t.child,l,r)}function Dg(t,i,l,r,f){l=l.render;var m=i.ref;if("ref"in r){var S={};for(var M in r)M!=="ref"&&(S[M]=r[M])}else S=r;return zs(i),r=Bf(t,i,l,S,m,f),M=Lf(),t!==null&&!St?($f(t,i,f),Ei(t,i,f)):(je&&M&&yf(i),i.flags|=1,zt(t,i,r,f),i.child)}function jg(t,i,l,r,f){if(t===null){var m=l.type;return typeof m=="function"&&!mf(m)&&m.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=m,Rg(t,i,m,r,f)):(t=Dr(l.type,null,r,i,i.mode,f),t.ref=i.ref,t.return=i,i.child=t)}if(m=t.child,!cd(t,f)){var S=m.memoizedProps;if(l=l.compare,l=l!==null?l:Xl,l(S,r)&&t.ref===i.ref)return Ei(t,i,f)}return i.flags|=1,t=yi(m,r),t.ref=i.ref,t.return=i,i.child=t}function Rg(t,i,l,r,f){if(t!==null){var m=t.memoizedProps;if(Xl(m,r)&&t.ref===i.ref)if(St=!1,i.pendingProps=r=m,cd(t,f))(t.flags&131072)!==0&&(St=!0);else return i.lanes=t.lanes,Ei(t,i,f)}return nd(t,i,l,r,f)}function Bg(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 Lg(t,i,m,l,r)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&Lr(i,m!==null?m.cachePool:null),m!==null?Hp(i,m):zf(),Up(i);else return r=i.lanes=536870912,Lg(t,i,m!==null?m.baseLanes|l:l,l,r)}else m!==null?(Lr(i,m.cachePool),Hp(i,m),ts(),i.memoizedState=null):(t!==null&&Lr(i,null),zf(),ts());return zt(t,i,f,l),i.child}function oo(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Lg(t,i,l,r,f){var m=Af();return m=m===null?null:{parent:vt._currentValue,pool:m},i.memoizedState={baseLanes:l,cachePool:m},t!==null&&Lr(i,null),zf(),Up(i),t!==null&&Na(t,i,r,!0),i.childLanes=f,null}function Pr(t,i){return i=tc({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function $g(t,i,l){return Bs(i,t.child,null,l),t=Pr(i,i.pendingProps),t.flags|=2,fn(i),i.memoizedState=null,t}function Nx(t,i,l){var r=i.pendingProps,f=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(je){if(r.mode==="hidden")return t=Pr(i,r),i.lanes=536870912,oo(null,t);if(jf(i),(t=We)?(t=Fy(t,An),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Ki!==null?{id:ti,overflow:ni}:null,retryLane:536870912,hydrationErrors:null},l=wp(t),l.return=i,i.child=l,Ot=i,We=null)):t=null,t===null)throw Qi(i);return i.lanes=536870912,null}return Pr(i,r)}var m=t.memoizedState;if(m!==null){var S=m.dehydrated;if(jf(i),f)if(i.flags&256)i.flags&=-257,i=$g(t,i,l);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(a(558));else if(St||Na(t,i,l,!1),f=(l&t.childLanes)!==0,St||f){if(r=Qe,r!==null&&(S=la(r,l),S!==0&&S!==m.retryLane))throw m.retryLane=S,Cs(t,S),en(r,t,S),td;uc(),i=$g(t,i,l)}else t=m.treeContext,We=Cn(S.nextSibling),Ot=i,je=!0,Zi=null,An=!1,t!==null&&Np(i,t),i=Pr(i,r),i.flags|=4096;return i}return t=yi(t.child,{mode:r.mode,children:r.children}),t.ref=i.ref,i.child=t,t.return=i,t}function ec(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 nd(t,i,l,r,f){return zs(i),l=Bf(t,i,l,r,void 0,f),r=Lf(),t!==null&&!St?($f(t,i,f),Ei(t,i,f)):(je&&r&&yf(i),i.flags|=1,zt(t,i,l,f),i.child)}function Hg(t,i,l,r,f,m){return zs(i),i.updateQueue=null,l=qp(i,r,l,f),Ip(t),r=Lf(),t!==null&&!St?($f(t,i,m),Ei(t,i,m)):(je&&r&&yf(i),i.flags|=1,zt(t,i,l,m),i.child)}function Ug(t,i,l,r,f){if(zs(i),i.stateNode===null){var m=Sa,S=l.contextType;typeof S=="object"&&S!==null&&(m=kt(S)),m=new l(r,m),i.memoizedState=m.state!==null&&m.state!==void 0?m.state:null,m.updater=Pf,i.stateNode=m,m._reactInternals=i,m=i.stateNode,m.props=r,m.state=i.memoizedState,m.refs={},Cf(i),S=l.contextType,m.context=typeof S=="object"&&S!==null?kt(S):Sa,m.state=i.memoizedState,S=l.getDerivedStateFromProps,typeof S=="function"&&(Wf(i,l,S,r),m.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof m.getSnapshotBeforeUpdate=="function"||typeof m.UNSAFE_componentWillMount!="function"&&typeof m.componentWillMount!="function"||(S=m.state,typeof m.componentWillMount=="function"&&m.componentWillMount(),typeof m.UNSAFE_componentWillMount=="function"&&m.UNSAFE_componentWillMount(),S!==m.state&&Pf.enqueueReplaceState(m,m.state,null),no(i,r,m,f),to(),m.state=i.memoizedState),typeof m.componentDidMount=="function"&&(i.flags|=4194308),r=!0}else if(t===null){m=i.stateNode;var M=i.memoizedProps,I=$s(l,M);m.props=I;var P=m.context,re=l.contextType;S=Sa,typeof re=="object"&&re!==null&&(S=kt(re));var ue=l.getDerivedStateFromProps;re=typeof ue=="function"||typeof m.getSnapshotBeforeUpdate=="function",M=i.pendingProps!==M,re||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(M||P!==S)&&Ag(i,m,r,S),Ji=!1;var ne=i.memoizedState;m.state=ne,no(i,r,m,f),to(),P=i.memoizedState,M||ne!==P||Ji?(typeof ue=="function"&&(Wf(i,l,ue,r),P=i.memoizedState),(I=Ji||_g(i,l,I,r,ne,P,S))?(re||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=P),m.props=r,m.state=P,m.context=S,r=I):(typeof m.componentDidMount=="function"&&(i.flags|=4194308),r=!1)}else{m=i.stateNode,Mf(t,i),S=i.memoizedProps,re=$s(l,S),m.props=re,ue=i.pendingProps,ne=m.context,P=l.contextType,I=Sa,typeof P=="object"&&P!==null&&(I=kt(P)),M=l.getDerivedStateFromProps,(P=typeof M=="function"||typeof m.getSnapshotBeforeUpdate=="function")||typeof m.UNSAFE_componentWillReceiveProps!="function"&&typeof m.componentWillReceiveProps!="function"||(S!==ue||ne!==I)&&Ag(i,m,r,I),Ji=!1,ne=i.memoizedState,m.state=ne,no(i,r,m,f),to();var ae=i.memoizedState;S!==ue||ne!==ae||Ji||t!==null&&t.dependencies!==null&&Rr(t.dependencies)?(typeof M=="function"&&(Wf(i,l,M,r),ae=i.memoizedState),(re=Ji||_g(i,l,re,r,ne,ae,I)||t!==null&&t.dependencies!==null&&Rr(t.dependencies))?(P||typeof m.UNSAFE_componentWillUpdate!="function"&&typeof m.componentWillUpdate!="function"||(typeof m.componentWillUpdate=="function"&&m.componentWillUpdate(r,ae,I),typeof m.UNSAFE_componentWillUpdate=="function"&&m.UNSAFE_componentWillUpdate(r,ae,I)),typeof m.componentDidUpdate=="function"&&(i.flags|=4),typeof m.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof m.componentDidUpdate!="function"||S===t.memoizedProps&&ne===t.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ne===t.memoizedState||(i.flags|=1024),i.memoizedProps=r,i.memoizedState=ae),m.props=r,m.state=ae,m.context=I,r=re):(typeof m.componentDidUpdate!="function"||S===t.memoizedProps&&ne===t.memoizedState||(i.flags|=4),typeof m.getSnapshotBeforeUpdate!="function"||S===t.memoizedProps&&ne===t.memoizedState||(i.flags|=1024),r=!1)}return m=r,ec(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=Bs(i,t.child,null,f),i.child=Bs(i,null,l,f)):zt(t,i,l,f),i.memoizedState=m.state,t=i.child):t=Ei(t,i,f),t}function Ig(t,i,l,r){return Os(),i.flags|=256,zt(t,i,l,r),i.child}var id={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function sd(t){return{baseLanes:t,cachePool:Op()}}function ad(t,i,l){return t=t!==null?t.childLanes&~l:0,i&&(t|=hn),t}function qg(t,i,l){var r=i.pendingProps,f=!1,m=(i.flags&128)!==0,S;if((S=m)||(S=t!==null&&t.memoizedState===null?!1:(ht.current&2)!==0),S&&(f=!0,i.flags&=-129),S=(i.flags&32)!==0,i.flags&=-33,t===null){if(je){if(f?es(i):ts(),(t=We)?(t=Fy(t,An),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:Ki!==null?{id:ti,overflow:ni}:null,retryLane:536870912,hydrationErrors:null},l=wp(t),l.return=i,i.child=l,Ot=i,We=null)):t=null,t===null)throw Qi(i);return Id(t)?i.lanes=32:i.lanes=536870912,null}var M=r.children;return r=r.fallback,f?(ts(),f=i.mode,M=tc({mode:"hidden",children:M},f),r=Ms(r,f,l,null),M.return=i,r.return=i,M.sibling=r,i.child=M,r=i.child,r.memoizedState=sd(l),r.childLanes=ad(t,S,l),i.memoizedState=id,oo(null,r)):(es(i),ld(i,M))}var I=t.memoizedState;if(I!==null&&(M=I.dehydrated,M!==null)){if(m)i.flags&256?(es(i),i.flags&=-257,i=od(t,i,l)):i.memoizedState!==null?(ts(),i.child=t.child,i.flags|=128,i=null):(ts(),M=r.fallback,f=i.mode,r=tc({mode:"visible",children:r.children},f),M=Ms(M,f,l,null),M.flags|=2,r.return=i,M.return=i,r.sibling=M,i.child=r,Bs(i,t.child,null,l),r=i.child,r.memoizedState=sd(l),r.childLanes=ad(t,S,l),i.memoizedState=id,i=oo(null,r));else if(es(i),Id(M)){if(S=M.nextSibling&&M.nextSibling.dataset,S)var P=S.dgst;S=P,r=Error(a(419)),r.stack="",r.digest=S,Ql({value:r,source:null,stack:null}),i=od(t,i,l)}else if(St||Na(t,i,l,!1),S=(l&t.childLanes)!==0,St||S){if(S=Qe,S!==null&&(r=la(S,l),r!==0&&r!==I.retryLane))throw I.retryLane=r,Cs(t,r),en(S,t,r),td;Ud(M)||uc(),i=od(t,i,l)}else Ud(M)?(i.flags|=192,i.child=t.child,i=null):(t=I.treeContext,We=Cn(M.nextSibling),Ot=i,je=!0,Zi=null,An=!1,t!==null&&Np(i,t),i=ld(i,r.children),i.flags|=4096);return i}return f?(ts(),M=r.fallback,f=i.mode,I=t.child,P=I.sibling,r=yi(I,{mode:"hidden",children:r.children}),r.subtreeFlags=I.subtreeFlags&65011712,P!==null?M=yi(P,M):(M=Ms(M,f,l,null),M.flags|=2),M.return=i,r.return=i,r.sibling=M,i.child=r,oo(null,r),r=i.child,M=t.child.memoizedState,M===null?M=sd(l):(f=M.cachePool,f!==null?(I=vt._currentValue,f=f.parent!==I?{parent:I,pool:I}:f):f=Op(),M={baseLanes:M.baseLanes|l,cachePool:f}),r.memoizedState=M,r.childLanes=ad(t,S,l),i.memoizedState=id,oo(t.child,r)):(es(i),l=t.child,t=l.sibling,l=yi(l,{mode:"visible",children:r.children}),l.return=i,l.sibling=null,t!==null&&(S=i.deletions,S===null?(i.deletions=[t],i.flags|=16):S.push(t)),i.child=l,i.memoizedState=null,l)}function ld(t,i){return i=tc({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function tc(t,i){return t=cn(22,t,null,i),t.lanes=0,t}function od(t,i,l){return Bs(i,t.child,null,l),t=ld(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function Vg(t,i,l){t.lanes|=i;var r=t.alternate;r!==null&&(r.lanes|=i),xf(t.return,i,l)}function rd(t,i,l,r,f,m){var S=t.memoizedState;S===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:r,tail:l,tailMode:f,treeForkCount:m}:(S.isBackwards=i,S.rendering=null,S.renderingStartTime=0,S.last=r,S.tail=l,S.tailMode=f,S.treeForkCount=m)}function Yg(t,i,l){var r=i.pendingProps,f=r.revealOrder,m=r.tail;r=r.children;var S=ht.current,M=(S&2)!==0;if(M?(S=S&1|2,i.flags|=128):S&=1,F(ht,S),zt(t,i,r,l),r=je?Zl:0,!M&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Vg(t,l,i);else if(t.tag===19)Vg(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&&Vr(t)===null&&(f=l),l=l.sibling;l=f,l===null?(f=i.child,i.child=null):(f=l.sibling,l.sibling=null),rd(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&&Vr(t)===null){i.child=f;break}t=f.sibling,f.sibling=l,l=f,f=t}rd(i,!0,l,null,m,r);break;case"together":rd(i,!1,null,null,void 0,r);break;default:i.memoizedState=null}return i.child}function Ei(t,i,l){if(t!==null&&(i.dependencies=t.dependencies),ss|=i.lanes,(l&i.childLanes)===0)if(t!==null){if(Na(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=yi(t,t.pendingProps),i.child=l,l.return=i;t.sibling!==null;)t=t.sibling,l=l.sibling=yi(t,t.pendingProps),l.return=i;l.sibling=null}return i.child}function cd(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&Rr(t)))}function _x(t,i,l){switch(i.tag){case 3:te(i,i.stateNode.containerInfo),Fi(i,vt,t.memoizedState.cache),Os();break;case 27:case 5:ve(i);break;case 4:te(i,i.stateNode.containerInfo);break;case 10:Fi(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,jf(i),null;break;case 13:var r=i.memoizedState;if(r!==null)return r.dehydrated!==null?(es(i),i.flags|=128,null):(l&i.child.childLanes)!==0?qg(t,i,l):(es(i),t=Ei(t,i,l),t!==null?t.sibling:null);es(i);break;case 19:var f=(t.flags&128)!==0;if(r=(l&i.childLanes)!==0,r||(Na(t,i,l,!1),r=(l&i.childLanes)!==0),f){if(r)return Yg(t,i,l);i.flags|=128}if(f=i.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),F(ht,ht.current),r)break;return null;case 22:return i.lanes=0,Bg(t,i,l,i.pendingProps);case 24:Fi(i,vt,t.memoizedState.cache)}return Ei(t,i,l)}function Gg(t,i,l){if(t!==null)if(t.memoizedProps!==i.pendingProps)St=!0;else{if(!cd(t,l)&&(i.flags&128)===0)return St=!1,_x(t,i,l);St=(t.flags&131072)!==0}else St=!1,je&&(i.flags&1048576)!==0&&Ep(i,Zl,i.index);switch(i.lanes=0,i.tag){case 16:e:{var r=i.pendingProps;if(t=js(i.elementType),i.type=t,typeof t=="function")mf(t)?(r=$s(t,r),i.tag=1,i=Ug(null,i,t,r,l)):(i.tag=0,i=nd(null,i,t,r,l));else{if(t!=null){var f=t.$$typeof;if(f===N){i.tag=11,i=Dg(null,i,t,r,l);break e}else if(f===B){i.tag=14,i=jg(null,i,t,r,l);break e}}throw i=L(t)||t,Error(a(306,i,""))}}return i;case 0:return nd(t,i,i.type,i.pendingProps,l);case 1:return r=i.type,f=$s(r,i.pendingProps),Ug(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,Mf(t,i),no(i,r,null,l);var S=i.memoizedState;if(r=S.cache,Fi(i,vt,r),r!==m.cache&&Ef(i,[vt],l,!0),to(),r=S.element,m.isDehydrated)if(m={element:r,isDehydrated:!1,cache:S.cache},i.updateQueue.baseState=m,i.memoizedState=m,i.flags&256){i=Ig(t,i,r,l);break e}else if(r!==f){f=En(Error(a(424)),i),Ql(f),i=Ig(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,We=Cn(t.firstChild),Ot=i,je=!0,Zi=null,An=!0,l=Bp(i,null,r,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling;else{if(Os(),r===f){i=Ei(t,i,l);break e}zt(t,i,r,l)}i=i.child}return i;case 26:return ec(t,i),t===null?(l=n0(i.type,null,i.pendingProps,null))?i.memoizedState=l:je||(l=i.type,t=i.pendingProps,r=yc(de.current).createElement(l),r[dt]=i,r[At]=t,Dt(r,l,t),yt(r),i.stateNode=r):i.memoizedState=n0(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return ve(i),t===null&&je&&(r=i.stateNode=Py(i.type,i.pendingProps,de.current),Ot=i,An=!0,f=We,cs(i.type)?(qd=f,We=Cn(r.firstChild)):We=f),zt(t,i,i.pendingProps.children,l),ec(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&je&&((f=r=We)&&(r=tE(r,i.type,i.pendingProps,An),r!==null?(i.stateNode=r,Ot=i,We=Cn(r.firstChild),An=!1,f=!0):f=!1),f||Qi(i)),ve(i),f=i.type,m=i.pendingProps,S=t!==null?t.memoizedProps:null,r=m.children,Ld(f,m)?r=null:S!==null&&Ld(f,S)&&(i.flags|=32),i.memoizedState!==null&&(f=Bf(t,i,gx,null,null,l),Eo._currentValue=f),ec(t,i),zt(t,i,r,l),i.child;case 6:return t===null&&je&&((t=l=We)&&(l=nE(l,i.pendingProps,An),l!==null?(i.stateNode=l,Ot=i,We=null,t=!0):t=!1),t||Qi(i)),null;case 13:return qg(t,i,l);case 4:return te(i,i.stateNode.containerInfo),r=i.pendingProps,t===null?i.child=Bs(i,null,r,l):zt(t,i,r,l),i.child;case 11:return Dg(t,i,i.type,i.pendingProps,l);case 7:return zt(t,i,i.pendingProps,l),i.child;case 8:return zt(t,i,i.pendingProps.children,l),i.child;case 12:return zt(t,i,i.pendingProps.children,l),i.child;case 10:return r=i.pendingProps,Fi(i,i.type,r.value),zt(t,i,r.children,l),i.child;case 9:return f=i.type._context,r=i.pendingProps.children,zs(i),f=kt(f),r=r(f),i.flags|=1,zt(t,i,r,l),i.child;case 14:return jg(t,i,i.type,i.pendingProps,l);case 15:return Rg(t,i,i.type,i.pendingProps,l);case 19:return Yg(t,i,l);case 31:return Nx(t,i,l);case 22:return Bg(t,i,l,i.pendingProps);case 24:return zs(i),r=kt(vt),t===null?(f=Af(),f===null&&(f=Qe,m=Nf(),f.pooledCache=m,m.refCount++,m!==null&&(f.pooledCacheLanes|=l),f=m),i.memoizedState={parent:r,cache:f},Cf(i),Fi(i,vt,f)):((t.lanes&l)!==0&&(Mf(t,i),no(i,null,null,l),to()),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),Fi(i,vt,r)):(r=m.cache,Fi(i,vt,r),r!==f.cache&&Ef(i,[vt],l,!0))),zt(t,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Ni(t){t.flags|=4}function ud(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(vy())t.flags|=8192;else throw Rs=Hr,Tf}else t.flags&=-16777217}function Xg(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!o0(i))if(vy())t.flags|=8192;else throw Rs=Hr,Tf}function nc(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?aa():536870912,t.lanes|=i,Ba|=i)}function ro(t,i){if(!je)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 Pe(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 Ax(t,i,l){var r=i.pendingProps;switch(vf(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(i),null;case 1:return Pe(i),null;case 3:return l=i.stateNode,r=null,t!==null&&(r=t.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),Si(vt),oe(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(Ea(i)?Ni(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Sf())),Pe(i),null;case 26:var f=i.type,m=i.memoizedState;return t===null?(Ni(i),m!==null?(Pe(i),Xg(i,m)):(Pe(i),ud(i,f,null,r,l))):m?m!==t.memoizedState?(Ni(i),Pe(i),Xg(i,m)):(Pe(i),i.flags&=-16777217):(t=t.memoizedProps,t!==r&&Ni(i),Pe(i),ud(i,f,t,r,l)),null;case 27:if(Se(i),l=de.current,f=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==r&&Ni(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return Pe(i),null}t=W.current,Ea(i)?_p(i):(t=Py(f,r,l),i.stateNode=t,Ni(i))}return Pe(i),null;case 5:if(Se(i),f=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==r&&Ni(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return Pe(i),null}if(m=W.current,Ea(i))_p(i);else{var S=yc(de.current);switch(m){case 1:m=S.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:m=S.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":m=S.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":m=S.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":m=S.createElement("div"),m.innerHTML="<script><\/script>",m=m.removeChild(m.firstChild);break;case"select":m=typeof r.is=="string"?S.createElement("select",{is:r.is}):S.createElement("select"),r.multiple?m.multiple=!0:r.size&&(m.size=r.size);break;default:m=typeof r.is=="string"?S.createElement(f,{is:r.is}):S.createElement(f)}}m[dt]=i,m[At]=r;e:for(S=i.child;S!==null;){if(S.tag===5||S.tag===6)m.appendChild(S.stateNode);else if(S.tag!==4&&S.tag!==27&&S.child!==null){S.child.return=S,S=S.child;continue}if(S===i)break e;for(;S.sibling===null;){if(S.return===null||S.return===i)break e;S=S.return}S.sibling.return=S.return,S=S.sibling}i.stateNode=m;e:switch(Dt(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&&Ni(i)}}return Pe(i),ud(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,l),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==r&&Ni(i);else{if(typeof r!="string"&&i.stateNode===null)throw Error(a(166));if(t=de.current,Ea(i)){if(t=i.stateNode,l=i.memoizedProps,r=null,f=Ot,f!==null)switch(f.tag){case 27:case 5:r=f.memoizedProps}t[dt]=i,t=!!(t.nodeValue===l||r!==null&&r.suppressHydrationWarning===!0||qy(t.nodeValue,l)),t||Qi(i,!0)}else t=yc(t).createTextNode(r),t[dt]=i,i.stateNode=t}return Pe(i),null;case 31:if(l=i.memoizedState,t===null||t.memoizedState!==null){if(r=Ea(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[dt]=i}else Os(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Pe(i),t=!1}else l=Sf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return i.flags&256?(fn(i),i):(fn(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Pe(i),null;case 13:if(r=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(f=Ea(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[dt]=i}else Os(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Pe(i),f=!1}else f=Sf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=f),f=!0;if(!f)return i.flags&256?(fn(i),i):(fn(i),null)}return fn(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),nc(i,i.updateQueue),Pe(i),null);case 4:return oe(),t===null&&zd(i.stateNode.containerInfo),Pe(i),null;case 10:return Si(i.type),Pe(i),null;case 19:if(z(ht),r=i.memoizedState,r===null)return Pe(i),null;if(f=(i.flags&128)!==0,m=r.rendering,m===null)if(f)ro(r,!1);else{if(ut!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(m=Vr(t),m!==null){for(i.flags|=128,ro(r,!1),t=m.updateQueue,i.updateQueue=t,nc(i,t),i.subtreeFlags=0,t=l,l=i.child;l!==null;)Sp(l,t),l=l.sibling;return F(ht,ht.current&1|2),je&&vi(i,r.treeForkCount),i.child}t=t.sibling}r.tail!==null&&Ze()>oc&&(i.flags|=128,f=!0,ro(r,!1),i.lanes=4194304)}else{if(!f)if(t=Vr(m),t!==null){if(i.flags|=128,f=!0,t=t.updateQueue,i.updateQueue=t,nc(i,t),ro(r,!0),r.tail===null&&r.tailMode==="hidden"&&!m.alternate&&!je)return Pe(i),null}else 2*Ze()-r.renderingStartTime>oc&&l!==536870912&&(i.flags|=128,f=!0,ro(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=Ze(),t.sibling=null,l=ht.current,F(ht,f?l&1|2:l&1),je&&vi(i,r.treeForkCount),t):(Pe(i),null);case 22:case 23:return fn(i),Df(),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&&(Pe(i),i.subtreeFlags&6&&(i.flags|=8192)):Pe(i),l=i.updateQueue,l!==null&&nc(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&&z(Ds),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Si(vt),Pe(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function Tx(t,i){switch(vf(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return Si(vt),oe(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return Se(i),null;case 31:if(i.memoizedState!==null){if(fn(i),i.alternate===null)throw Error(a(340));Os()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(fn(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(a(340));Os()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return z(ht),null;case 4:return oe(),null;case 10:return Si(i.type),null;case 22:case 23:return fn(i),Df(),t!==null&&z(Ds),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return Si(vt),null;case 25:return null;default:return null}}function Kg(t,i){switch(vf(i),i.tag){case 3:Si(vt),oe();break;case 26:case 27:case 5:Se(i);break;case 4:oe();break;case 31:i.memoizedState!==null&&fn(i);break;case 13:fn(i);break;case 19:z(ht);break;case 10:Si(i.type);break;case 22:case 23:fn(i),Df(),t!==null&&z(Ds);break;case 24:Si(vt)}}function co(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,S=l.inst;r=m(),S.destroy=r}l=l.next}while(l!==f)}}catch(M){Ve(i,i.return,M)}}function ns(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 S=r.inst,M=S.destroy;if(M!==void 0){S.destroy=void 0,f=i;var I=l,P=M;try{P()}catch(re){Ve(f,I,re)}}}r=r.next}while(r!==m)}}catch(re){Ve(i,i.return,re)}}function Zg(t){var i=t.updateQueue;if(i!==null){var l=t.stateNode;try{$p(i,l)}catch(r){Ve(t,t.return,r)}}}function Qg(t,i,l){l.props=$s(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(r){Ve(t,i,r)}}function uo(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 ii(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 Fg(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 fd(t,i,l){try{var r=t.stateNode;Qx(r,t.type,l,i),r[At]=i}catch(f){Ve(t,t.return,f)}}function Jg(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&cs(t.type)||t.tag===4}function dd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Jg(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&&cs(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 hd(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=pi));else if(r!==4&&(r===27&&cs(t.type)&&(l=t.stateNode,i=null),t=t.child,t!==null))for(hd(t,i,l),t=t.sibling;t!==null;)hd(t,i,l),t=t.sibling}function ic(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&&cs(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(ic(t,i,l),t=t.sibling;t!==null;)ic(t,i,l),t=t.sibling}function Wg(t){var i=t.stateNode,l=t.memoizedProps;try{for(var r=t.type,f=i.attributes;f.length;)i.removeAttributeNode(f[0]);Dt(i,r,l),i[dt]=t,i[At]=l}catch(m){Ve(t,t.return,m)}}var _i=!1,wt=!1,md=!1,Pg=typeof WeakSet=="function"?WeakSet:Set,Tt=null;function Cx(t,i){if(t=t.containerInfo,Rd=Nc,t=fp(t),of(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 S=0,M=-1,I=-1,P=0,re=0,ue=t,ne=null;t:for(;;){for(var ae;ue!==l||f!==0&&ue.nodeType!==3||(M=S+f),ue!==m||r!==0&&ue.nodeType!==3||(I=S+r),ue.nodeType===3&&(S+=ue.nodeValue.length),(ae=ue.firstChild)!==null;)ne=ue,ue=ae;for(;;){if(ue===t)break t;if(ne===l&&++P===f&&(M=S),ne===m&&++re===r&&(I=S),(ae=ue.nextSibling)!==null)break;ue=ne,ne=ue.parentNode}ue=ae}l=M===-1||I===-1?null:{start:M,end:I}}else l=null}l=l||{start:0,end:0}}else l=null;for(Bd={focusedElem:t,selectionRange:l},Nc=!1,Tt=i;Tt!==null;)if(i=Tt,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Tt=t;else for(;Tt!==null;){switch(i=Tt,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 ye=$s(l.type,f);t=r.getSnapshotBeforeUpdate(ye,m),r.__reactInternalSnapshotBeforeUpdate=t}catch(Ne){Ve(l,l.return,Ne)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,l=t.nodeType,l===9)Hd(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Hd(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,Tt=t;break}Tt=i.return}}function ey(t,i,l){var r=l.flags;switch(l.tag){case 0:case 11:case 15:Ti(t,l),r&4&&co(5,l);break;case 1:if(Ti(t,l),r&4)if(t=l.stateNode,i===null)try{t.componentDidMount()}catch(S){Ve(l,l.return,S)}else{var f=$s(l.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(f,i,t.__reactInternalSnapshotBeforeUpdate)}catch(S){Ve(l,l.return,S)}}r&64&&Zg(l),r&512&&uo(l,l.return);break;case 3:if(Ti(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{$p(t,i)}catch(S){Ve(l,l.return,S)}}break;case 27:i===null&&r&4&&Wg(l);case 26:case 5:Ti(t,l),i===null&&r&4&&Fg(l),r&512&&uo(l,l.return);break;case 12:Ti(t,l);break;case 31:Ti(t,l),r&4&&iy(t,l);break;case 13:Ti(t,l),r&4&&sy(t,l),r&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=Lx.bind(null,l),iE(t,l))));break;case 22:if(r=l.memoizedState!==null||_i,!r){i=i!==null&&i.memoizedState!==null||wt,f=_i;var m=wt;_i=r,(wt=i)&&!m?Ci(t,l,(l.subtreeFlags&8772)!==0):Ti(t,l),_i=f,wt=m}break;case 30:break;default:Ti(t,l)}}function ty(t){var i=t.alternate;i!==null&&(t.alternate=null,ty(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&Xt(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 nt=null,Ft=!1;function Ai(t,i,l){for(l=l.child;l!==null;)ny(t,i,l),l=l.sibling}function ny(t,i,l){if(pt&&typeof pt.onCommitFiberUnmount=="function")try{pt.onCommitFiberUnmount(Yt,l)}catch{}switch(l.tag){case 26:wt||ii(l,i),Ai(t,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:wt||ii(l,i);var r=nt,f=Ft;cs(l.type)&&(nt=l.stateNode,Ft=!1),Ai(t,i,l),So(l.stateNode),nt=r,Ft=f;break;case 5:wt||ii(l,i);case 6:if(r=nt,f=Ft,nt=null,Ai(t,i,l),nt=r,Ft=f,nt!==null)if(Ft)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(l.stateNode)}catch(m){Ve(l,i,m)}else try{nt.removeChild(l.stateNode)}catch(m){Ve(l,i,m)}break;case 18:nt!==null&&(Ft?(t=nt,Zy(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Ya(t)):Zy(nt,l.stateNode));break;case 4:r=nt,f=Ft,nt=l.stateNode.containerInfo,Ft=!0,Ai(t,i,l),nt=r,Ft=f;break;case 0:case 11:case 14:case 15:ns(2,l,i),wt||ns(4,l,i),Ai(t,i,l);break;case 1:wt||(ii(l,i),r=l.stateNode,typeof r.componentWillUnmount=="function"&&Qg(l,i,r)),Ai(t,i,l);break;case 21:Ai(t,i,l);break;case 22:wt=(r=wt)||l.memoizedState!==null,Ai(t,i,l),wt=r;break;default:Ai(t,i,l)}}function iy(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Ya(t)}catch(l){Ve(i,i.return,l)}}}function sy(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Ya(t)}catch(l){Ve(i,i.return,l)}}function Mx(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Pg),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Pg),i;default:throw Error(a(435,t.tag))}}function sc(t,i){var l=Mx(t);i.forEach(function(r){if(!l.has(r)){l.add(r);var f=$x.bind(null,t,r);r.then(f,f)}})}function Jt(t,i){var l=i.deletions;if(l!==null)for(var r=0;r<l.length;r++){var f=l[r],m=t,S=i,M=S;e:for(;M!==null;){switch(M.tag){case 27:if(cs(M.type)){nt=M.stateNode,Ft=!1;break e}break;case 5:nt=M.stateNode,Ft=!1;break e;case 3:case 4:nt=M.stateNode.containerInfo,Ft=!0;break e}M=M.return}if(nt===null)throw Error(a(160));ny(m,S,f),nt=null,Ft=!1,m=f.alternate,m!==null&&(m.return=null),f.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)ay(i,t),i=i.sibling}var $n=null;function ay(t,i){var l=t.alternate,r=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Jt(i,t),Wt(t),r&4&&(ns(3,t,t.return),co(3,t),ns(5,t,t.return));break;case 1:Jt(i,t),Wt(t),r&512&&(wt||l===null||ii(l,l.return)),r&64&&_i&&(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=$n;if(Jt(i,t),Wt(t),r&512&&(wt||l===null||ii(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[tt]||m[dt]||m.namespaceURI==="http://www.w3.org/2000/svg"||m.hasAttribute("itemprop"))&&(m=f.createElement(r),f.head.insertBefore(m,f.querySelector("head > title"))),Dt(m,r,l),m[dt]=t,yt(m),r=m;break e;case"link":var S=a0("link","href",f).get(r+(l.href||""));if(S){for(var M=0;M<S.length;M++)if(m=S[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)){S.splice(M,1);break t}}m=f.createElement(r),Dt(m,r,l),f.head.appendChild(m);break;case"meta":if(S=a0("meta","content",f).get(r+(l.content||""))){for(M=0;M<S.length;M++)if(m=S[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)){S.splice(M,1);break t}}m=f.createElement(r),Dt(m,r,l),f.head.appendChild(m);break;default:throw Error(a(468,r))}m[dt]=t,yt(m),r=m}t.stateNode=r}else l0(f,t.type,t.stateNode);else t.stateNode=s0(f,r,t.memoizedProps);else m!==r?(m===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):m.count--,r===null?l0(f,t.type,t.stateNode):s0(f,r,t.memoizedProps)):r===null&&t.stateNode!==null&&fd(t,t.memoizedProps,l.memoizedProps)}break;case 27:Jt(i,t),Wt(t),r&512&&(wt||l===null||ii(l,l.return)),l!==null&&r&4&&fd(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Jt(i,t),Wt(t),r&512&&(wt||l===null||ii(l,l.return)),t.flags&32){f=t.stateNode;try{ha(f,"")}catch(ye){Ve(t,t.return,ye)}}r&4&&t.stateNode!=null&&(f=t.memoizedProps,fd(t,f,l!==null?l.memoizedProps:f)),r&1024&&(md=!0);break;case 6:if(Jt(i,t),Wt(t),r&4){if(t.stateNode===null)throw Error(a(162));r=t.memoizedProps,l=t.stateNode;try{l.nodeValue=r}catch(ye){Ve(t,t.return,ye)}}break;case 3:if(Sc=null,f=$n,$n=vc(i.containerInfo),Jt(i,t),$n=f,Wt(t),r&4&&l!==null&&l.memoizedState.isDehydrated)try{Ya(i.containerInfo)}catch(ye){Ve(t,t.return,ye)}md&&(md=!1,ly(t));break;case 4:r=$n,$n=vc(t.stateNode.containerInfo),Jt(i,t),Wt(t),$n=r;break;case 12:Jt(i,t),Wt(t);break;case 31:Jt(i,t),Wt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,sc(t,r)));break;case 13:Jt(i,t),Wt(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(lc=Ze()),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,sc(t,r)));break;case 22:f=t.memoizedState!==null;var I=l!==null&&l.memoizedState!==null,P=_i,re=wt;if(_i=P||f,wt=re||I,Jt(i,t),wt=re,_i=P,Wt(t),r&8192)e:for(i=t.stateNode,i._visibility=f?i._visibility&-2:i._visibility|1,f&&(l===null||I||_i||wt||Hs(t)),l=null,i=t;;){if(i.tag===5||i.tag===26){if(l===null){I=l=i;try{if(m=I.stateNode,f)S=m.style,typeof S.setProperty=="function"?S.setProperty("display","none","important"):S.display="none";else{M=I.stateNode;var ue=I.memoizedProps.style,ne=ue!=null&&ue.hasOwnProperty("display")?ue.display:null;M.style.display=ne==null||typeof ne=="boolean"?"":(""+ne).trim()}}catch(ye){Ve(I,I.return,ye)}}}else if(i.tag===6){if(l===null){I=i;try{I.stateNode.nodeValue=f?"":I.memoizedProps}catch(ye){Ve(I,I.return,ye)}}}else if(i.tag===18){if(l===null){I=i;try{var ae=I.stateNode;f?Qy(ae,!0):Qy(I.stateNode,!1)}catch(ye){Ve(I,I.return,ye)}}}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,sc(t,l))));break;case 19:Jt(i,t),Wt(t),r&4&&(r=t.updateQueue,r!==null&&(t.updateQueue=null,sc(t,r)));break;case 30:break;case 21:break;default:Jt(i,t),Wt(t)}}function Wt(t){var i=t.flags;if(i&2){try{for(var l,r=t.return;r!==null;){if(Jg(r)){l=r;break}r=r.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var f=l.stateNode,m=dd(t);ic(t,m,f);break;case 5:var S=l.stateNode;l.flags&32&&(ha(S,""),l.flags&=-33);var M=dd(t);ic(t,M,S);break;case 3:case 4:var I=l.stateNode.containerInfo,P=dd(t);hd(t,P,I);break;default:throw Error(a(161))}}catch(re){Ve(t,t.return,re)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function ly(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;ly(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Ti(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)ey(t,i.alternate,i),i=i.sibling}function Hs(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:ns(4,i,i.return),Hs(i);break;case 1:ii(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&Qg(i,i.return,l),Hs(i);break;case 27:So(i.stateNode);case 26:case 5:ii(i,i.return),Hs(i);break;case 22:i.memoizedState===null&&Hs(i);break;case 30:Hs(i);break;default:Hs(i)}t=t.sibling}}function Ci(t,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var r=i.alternate,f=t,m=i,S=m.flags;switch(m.tag){case 0:case 11:case 15:Ci(f,m,l),co(4,m);break;case 1:if(Ci(f,m,l),r=m,f=r.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(P){Ve(r,r.return,P)}if(r=m,f=r.updateQueue,f!==null){var M=r.stateNode;try{var I=f.shared.hiddenCallbacks;if(I!==null)for(f.shared.hiddenCallbacks=null,f=0;f<I.length;f++)Lp(I[f],M)}catch(P){Ve(r,r.return,P)}}l&&S&64&&Zg(m),uo(m,m.return);break;case 27:Wg(m);case 26:case 5:Ci(f,m,l),l&&r===null&&S&4&&Fg(m),uo(m,m.return);break;case 12:Ci(f,m,l);break;case 31:Ci(f,m,l),l&&S&4&&iy(f,m);break;case 13:Ci(f,m,l),l&&S&4&&sy(f,m);break;case 22:m.memoizedState===null&&Ci(f,m,l),uo(m,m.return);break;case 30:break;default:Ci(f,m,l)}i=i.sibling}}function pd(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&&Fl(l))}function gd(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Fl(t))}function Hn(t,i,l,r){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)oy(t,i,l,r),i=i.sibling}function oy(t,i,l,r){var f=i.flags;switch(i.tag){case 0:case 11:case 15:Hn(t,i,l,r),f&2048&&co(9,i);break;case 1:Hn(t,i,l,r);break;case 3:Hn(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&&Fl(t)));break;case 12:if(f&2048){Hn(t,i,l,r),t=i.stateNode;try{var m=i.memoizedProps,S=m.id,M=m.onPostCommit;typeof M=="function"&&M(S,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(I){Ve(i,i.return,I)}}else Hn(t,i,l,r);break;case 31:Hn(t,i,l,r);break;case 13:Hn(t,i,l,r);break;case 23:break;case 22:m=i.stateNode,S=i.alternate,i.memoizedState!==null?m._visibility&2?Hn(t,i,l,r):fo(t,i):m._visibility&2?Hn(t,i,l,r):(m._visibility|=2,Da(t,i,l,r,(i.subtreeFlags&10256)!==0||!1)),f&2048&&pd(S,i);break;case 24:Hn(t,i,l,r),f&2048&&gd(i.alternate,i);break;default:Hn(t,i,l,r)}}function Da(t,i,l,r,f){for(f=f&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var m=t,S=i,M=l,I=r,P=S.flags;switch(S.tag){case 0:case 11:case 15:Da(m,S,M,I,f),co(8,S);break;case 23:break;case 22:var re=S.stateNode;S.memoizedState!==null?re._visibility&2?Da(m,S,M,I,f):fo(m,S):(re._visibility|=2,Da(m,S,M,I,f)),f&&P&2048&&pd(S.alternate,S);break;case 24:Da(m,S,M,I,f),f&&P&2048&&gd(S.alternate,S);break;default:Da(m,S,M,I,f)}i=i.sibling}}function fo(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:fo(l,r),f&2048&&pd(r.alternate,r);break;case 24:fo(l,r),f&2048&&gd(r.alternate,r);break;default:fo(l,r)}i=i.sibling}}var ho=8192;function ja(t,i,l){if(t.subtreeFlags&ho)for(t=t.child;t!==null;)ry(t,i,l),t=t.sibling}function ry(t,i,l){switch(t.tag){case 26:ja(t,i,l),t.flags&ho&&t.memoizedState!==null&&pE(l,$n,t.memoizedState,t.memoizedProps);break;case 5:ja(t,i,l);break;case 3:case 4:var r=$n;$n=vc(t.stateNode.containerInfo),ja(t,i,l),$n=r;break;case 22:t.memoizedState===null&&(r=t.alternate,r!==null&&r.memoizedState!==null?(r=ho,ho=16777216,ja(t,i,l),ho=r):ja(t,i,l));break;default:ja(t,i,l)}}function cy(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 mo(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];Tt=r,fy(r,t)}cy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)uy(t),t=t.sibling}function uy(t){switch(t.tag){case 0:case 11:case 15:mo(t),t.flags&2048&&ns(9,t,t.return);break;case 3:mo(t);break;case 12:mo(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,ac(t)):mo(t);break;default:mo(t)}}function ac(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];Tt=r,fy(r,t)}cy(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:ns(8,i,i.return),ac(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,ac(i));break;default:ac(i)}t=t.sibling}}function fy(t,i){for(;Tt!==null;){var l=Tt;switch(l.tag){case 0:case 11:case 15:ns(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:Fl(l.memoizedState.cache)}if(r=l.child,r!==null)r.return=l,Tt=r;else e:for(l=t;Tt!==null;){r=Tt;var f=r.sibling,m=r.return;if(ty(r),r===l){Tt=null;break e}if(f!==null){f.return=m,Tt=f;break e}Tt=m}}}var Ox={getCacheForType:function(t){var i=kt(vt),l=i.data.get(t);return l===void 0&&(l=t(),i.data.set(t,l)),l},cacheSignal:function(){return kt(vt).controller.signal}},kx=typeof WeakMap=="function"?WeakMap:Map,He=0,Qe=null,Oe=null,ze=0,qe=0,dn=null,is=!1,Ra=!1,yd=!1,Mi=0,ut=0,ss=0,Us=0,vd=0,hn=0,Ba=0,po=null,Pt=null,bd=!1,lc=0,dy=0,oc=1/0,rc=null,as=null,_t=0,ls=null,La=null,Oi=0,Sd=0,wd=null,hy=null,go=0,xd=null;function mn(){return(He&2)!==0&&ze!==0?ze&-ze:O.T!==null?Cd():oa()}function my(){if(hn===0)if((ze&536870912)===0||je){var t=di;di<<=1,(di&3932160)===0&&(di=262144),hn=t}else hn=536870912;return t=un.current,t!==null&&(t.flags|=32),hn}function en(t,i,l){(t===Qe&&(qe===2||qe===9)||t.cancelPendingCommit!==null)&&($a(t,0),os(t,ze,hn,!1)),ei(t,l),((He&2)===0||t!==Qe)&&(t===Qe&&((He&2)===0&&(Us|=l),ut===4&&os(t,ze,hn,!1)),si(t))}function py(t,i,l){if((He&6)!==0)throw Error(a(327));var r=!l&&(i&127)===0&&(i&t.expiredLanes)===0||Pn(t,i),f=r?jx(t,i):Nd(t,i,!0),m=r;do{if(f===0){Ra&&!r&&os(t,i,0,!1);break}else{if(l=t.current.alternate,m&&!zx(l)){f=Nd(t,i,!1),m=!1;continue}if(f===2){if(m=i,t.errorRecoveryDisabledLanes&m)var S=0;else S=t.pendingLanes&-536870913,S=S!==0?S:S&536870912?536870912:0;if(S!==0){i=S;e:{var M=t;f=po;var I=M.current.memoizedState.isDehydrated;if(I&&($a(M,S).flags|=256),S=Nd(M,S,!1),S!==2){if(yd&&!I){M.errorRecoveryDisabledLanes|=m,Us|=m,f=4;break e}m=Pt,Pt=f,m!==null&&(Pt===null?Pt=m:Pt.push.apply(Pt,m))}f=S}if(m=!1,f!==2)continue}}if(f===1){$a(t,0),os(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:os(r,i,hn,!is);break e;case 2:Pt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(f=lc+300-Ze(),10<f)){if(os(r,i,hn,!is),hi(r,0,!0)!==0)break e;Oi=i,r.timeoutHandle=Xy(gy.bind(null,r,l,Pt,rc,bd,i,hn,Us,Ba,is,m,"Throttled",-0,0),f);break e}gy(r,l,Pt,rc,bd,i,hn,Us,Ba,is,m,null,-0,0)}}break}while(!0);si(t)}function gy(t,i,l,r,f,m,S,M,I,P,re,ue,ne,ae){if(t.timeoutHandle=-1,ue=i.subtreeFlags,ue&8192||(ue&16785408)===16785408){ue={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:pi},ry(i,m,ue);var ye=(m&62914560)===m?lc-Ze():(m&4194048)===m?dy-Ze():0;if(ye=gE(ue,ye),ye!==null){Oi=m,t.cancelPendingCommit=ye(Ny.bind(null,t,i,m,l,r,f,S,M,I,re,ue,null,ne,ae)),os(t,m,S,!P);return}}Ny(t,i,m,l,r,f,S,M,I)}function zx(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(!rn(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 os(t,i,l,r){i&=~vd,i&=~Us,t.suspendedLanes|=i,t.pingedLanes&=~i,r&&(t.warmLanes|=i),r=t.expirationTimes;for(var f=i;0<f;){var m=31-Mt(f),S=1<<m;r[m]=-1,f&=~S}l!==0&&Ui(t,l,i)}function cc(){return(He&6)===0?(yo(0),!1):!0}function Ed(){if(Oe!==null){if(qe===0)var t=Oe.return;else t=Oe,bi=ks=null,Hf(t),Ca=null,Wl=0,t=Oe;for(;t!==null;)Kg(t.alternate,t),t=t.return;Oe=null}}function $a(t,i){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,Wx(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Oi=0,Ed(),Qe=t,Oe=l=yi(t.current,null),ze=i,qe=0,dn=null,is=!1,Ra=Pn(t,i),yd=!1,Ba=hn=vd=Us=ss=ut=0,Pt=po=null,bd=!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-Mt(r),m=1<<f;i|=t[f],r&=~m}return Mi=i,Or(),l}function yy(t,i){Te=null,O.H=lo,i===Ta||i===$r?(i=Dp(),qe=3):i===Tf?(i=Dp(),qe=4):qe=i===td?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,dn=i,Oe===null&&(ut=1,Wr(t,En(i,t.current)))}function vy(){var t=un.current;return t===null?!0:(ze&4194048)===ze?Tn===null:(ze&62914560)===ze||(ze&536870912)!==0?t===Tn:!1}function by(){var t=O.H;return O.H=lo,t===null?lo:t}function Sy(){var t=O.A;return O.A=Ox,t}function uc(){ut=4,is||(ze&4194048)!==ze&&un.current!==null||(Ra=!0),(ss&134217727)===0&&(Us&134217727)===0||Qe===null||os(Qe,ze,hn,!1)}function Nd(t,i,l){var r=He;He|=2;var f=by(),m=Sy();(Qe!==t||ze!==i)&&(rc=null,$a(t,i)),i=!1;var S=ut;e:do try{if(qe!==0&&Oe!==null){var M=Oe,I=dn;switch(qe){case 8:Ed(),S=6;break e;case 3:case 2:case 9:case 6:un.current===null&&(i=!0);var P=qe;if(qe=0,dn=null,Ha(t,M,I,P),l&&Ra){S=0;break e}break;default:P=qe,qe=0,dn=null,Ha(t,M,I,P)}}Dx(),S=ut;break}catch(re){yy(t,re)}while(!0);return i&&t.shellSuspendCounter++,bi=ks=null,He=r,O.H=f,O.A=m,Oe===null&&(Qe=null,ze=0,Or()),S}function Dx(){for(;Oe!==null;)wy(Oe)}function jx(t,i){var l=He;He|=2;var r=by(),f=Sy();Qe!==t||ze!==i?(rc=null,oc=Ze()+500,$a(t,i)):Ra=Pn(t,i);e:do try{if(qe!==0&&Oe!==null){i=Oe;var m=dn;t:switch(qe){case 1:qe=0,dn=null,Ha(t,i,m,1);break;case 2:case 9:if(kp(m)){qe=0,dn=null,xy(i);break}i=function(){qe!==2&&qe!==9||Qe!==t||(qe=7),si(t)},m.then(i,i);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:kp(m)?(qe=0,dn=null,xy(i)):(qe=0,dn=null,Ha(t,i,m,7));break;case 5:var S=null;switch(Oe.tag){case 26:S=Oe.memoizedState;case 5:case 27:var M=Oe;if(S?o0(S):M.stateNode.complete){qe=0,dn=null;var I=M.sibling;if(I!==null)Oe=I;else{var P=M.return;P!==null?(Oe=P,fc(P)):Oe=null}break t}}qe=0,dn=null,Ha(t,i,m,5);break;case 6:qe=0,dn=null,Ha(t,i,m,6);break;case 8:Ed(),ut=6;break e;default:throw Error(a(462))}}Rx();break}catch(re){yy(t,re)}while(!0);return bi=ks=null,O.H=r,O.A=f,He=l,Oe!==null?0:(Qe=null,ze=0,Or(),ut)}function Rx(){for(;Oe!==null&&!jn();)wy(Oe)}function wy(t){var i=Gg(t.alternate,t,Mi);t.memoizedProps=t.pendingProps,i===null?fc(t):Oe=i}function xy(t){var i=t,l=i.alternate;switch(i.tag){case 15:case 0:i=Hg(l,i,i.pendingProps,i.type,void 0,ze);break;case 11:i=Hg(l,i,i.pendingProps,i.type.render,i.ref,ze);break;case 5:Hf(i);default:Kg(l,i),i=Oe=Sp(i,Mi),i=Gg(l,i,Mi)}t.memoizedProps=t.pendingProps,i===null?fc(t):Oe=i}function Ha(t,i,l,r){bi=ks=null,Hf(i),Ca=null,Wl=0;var f=i.return;try{if(Ex(t,f,i,l,ze)){ut=1,Wr(t,En(l,t.current)),Oe=null;return}}catch(m){if(f!==null)throw Oe=f,m;ut=1,Wr(t,En(l,t.current)),Oe=null;return}i.flags&32768?(je||r===1?t=!0:Ra||(ze&536870912)!==0?t=!1:(is=t=!0,(r===2||r===9||r===3||r===6)&&(r=un.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ey(i,t)):fc(i)}function fc(t){var i=t;do{if((i.flags&32768)!==0){Ey(i,is);return}t=i.return;var l=Ax(i.alternate,i,Mi);if(l!==null){Oe=l;return}if(i=i.sibling,i!==null){Oe=i;return}Oe=i=t}while(i!==null);ut===0&&(ut=5)}function Ey(t,i){do{var l=Tx(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);ut=6,Oe=null}function Ny(t,i,l,r,f,m,S,M,I){t.cancelPendingCommit=null;do dc();while(_t!==0);if((He&6)!==0)throw Error(a(327));if(i!==null){if(i===t.current)throw Error(a(177));if(m=i.lanes|i.childLanes,m|=df,Lt(t,l,m,S,M,I),t===Qe&&(Oe=Qe=null,ze=0),La=i,ls=t,Oi=l,Sd=m,wd=f,hy=r,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,Hx(Bt,function(){return My(),null})):(t.callbackNode=null,t.callbackPriority=0),r=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||r){r=O.T,O.T=null,f=H.p,H.p=2,S=He,He|=4;try{Cx(t,i,l)}finally{He=S,H.p=f,O.T=r}}_t=1,_y(),Ay(),Ty()}}function _y(){if(_t===1){_t=0;var t=ls,i=La,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=O.T,O.T=null;var r=H.p;H.p=2;var f=He;He|=4;try{ay(i,t);var m=Bd,S=fp(t.containerInfo),M=m.focusedElem,I=m.selectionRange;if(S!==M&&M&&M.ownerDocument&&up(M.ownerDocument.documentElement,M)){if(I!==null&&of(M)){var P=I.start,re=I.end;if(re===void 0&&(re=P),"selectionStart"in M)M.selectionStart=P,M.selectionEnd=Math.min(re,M.value.length);else{var ue=M.ownerDocument||document,ne=ue&&ue.defaultView||window;if(ne.getSelection){var ae=ne.getSelection(),ye=M.textContent.length,Ne=Math.min(I.start,ye),Ke=I.end===void 0?Ne:Math.min(I.end,ye);!ae.extend&&Ne>Ke&&(S=Ke,Ke=Ne,Ne=S);var Q=cp(M,Ne),G=cp(M,Ke);if(Q&&G&&(ae.rangeCount!==1||ae.anchorNode!==Q.node||ae.anchorOffset!==Q.offset||ae.focusNode!==G.node||ae.focusOffset!==G.offset)){var J=ue.createRange();J.setStart(Q.node,Q.offset),ae.removeAllRanges(),Ne>Ke?(ae.addRange(J),ae.extend(G.node,G.offset)):(J.setEnd(G.node,G.offset),ae.addRange(J))}}}}for(ue=[],ae=M;ae=ae.parentNode;)ae.nodeType===1&&ue.push({element:ae,left:ae.scrollLeft,top:ae.scrollTop});for(typeof M.focus=="function"&&M.focus(),M=0;M<ue.length;M++){var ce=ue[M];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Nc=!!Rd,Bd=Rd=null}finally{He=f,H.p=r,O.T=l}}t.current=i,_t=2}}function Ay(){if(_t===2){_t=0;var t=ls,i=La,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=O.T,O.T=null;var r=H.p;H.p=2;var f=He;He|=4;try{ey(t,i.alternate,i)}finally{He=f,H.p=r,O.T=l}}_t=3}}function Ty(){if(_t===4||_t===3){_t=0,Ct();var t=ls,i=La,l=Oi,r=hy;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?_t=5:(_t=0,La=ls=null,Cy(t,t.pendingLanes));var f=t.pendingLanes;if(f===0&&(as=null),Ns(l),i=i.stateNode,pt&&typeof pt.onCommitFiberRoot=="function")try{pt.onCommitFiberRoot(Yt,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=O.T,f=H.p,H.p=2,O.T=null;try{for(var m=t.onRecoverableError,S=0;S<r.length;S++){var M=r[S];m(M.value,{componentStack:M.stack})}}finally{O.T=i,H.p=f}}(Oi&3)!==0&&dc(),si(t),f=t.pendingLanes,(l&261930)!==0&&(f&42)!==0?t===xd?go++:(go=0,xd=t):go=0,yo(0)}}function Cy(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,Fl(i)))}function dc(){return _y(),Ay(),Ty(),My()}function My(){if(_t!==5)return!1;var t=ls,i=Sd;Sd=0;var l=Ns(Oi),r=O.T,f=H.p;try{H.p=32>l?32:l,O.T=null,l=wd,wd=null;var m=ls,S=Oi;if(_t=0,La=ls=null,Oi=0,(He&6)!==0)throw Error(a(331));var M=He;if(He|=4,uy(m.current),oy(m,m.current,S,l),He=M,yo(0,!1),pt&&typeof pt.onPostCommitFiberRoot=="function")try{pt.onPostCommitFiberRoot(Yt,m)}catch{}return!0}finally{H.p=f,O.T=r,Cy(t,i)}}function Oy(t,i,l){i=En(l,i),i=ed(t.stateNode,i,2),t=Pi(t,i,2),t!==null&&(ei(t,2),si(t))}function Ve(t,i,l){if(t.tag===3)Oy(t,t,l);else for(;i!==null;){if(i.tag===3){Oy(i,t,l);break}else if(i.tag===1){var r=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(as===null||!as.has(r))){t=En(l,t),l=kg(2),r=Pi(i,l,2),r!==null&&(zg(l,r,i,t),ei(r,2),si(r));break}}i=i.return}}function _d(t,i,l){var r=t.pingCache;if(r===null){r=t.pingCache=new kx;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)||(yd=!0,f.add(l),t=Bx.bind(null,t,i,l),i.then(t,t))}function Bx(t,i,l){var r=t.pingCache;r!==null&&r.delete(i),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,Qe===t&&(ze&l)===l&&(ut===4||ut===3&&(ze&62914560)===ze&&300>Ze()-lc?(He&2)===0&&$a(t,0):vd|=l,Ba===ze&&(Ba=0)),si(t)}function ky(t,i){i===0&&(i=aa()),t=Cs(t,i),t!==null&&(ei(t,i),si(t))}function Lx(t){var i=t.memoizedState,l=0;i!==null&&(l=i.retryLane),ky(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),ky(t,l)}function Hx(t,i){return Et(t,i)}var hc=null,Ua=null,Ad=!1,mc=!1,Td=!1,rs=0;function si(t){t!==Ua&&t.next===null&&(Ua===null?hc=Ua=t:Ua=Ua.next=t),mc=!0,Ad||(Ad=!0,Ix())}function yo(t,i){if(!Td&&mc){Td=!0;do for(var l=!1,r=hc;r!==null;){if(t!==0){var f=r.pendingLanes;if(f===0)var m=0;else{var S=r.suspendedLanes,M=r.pingedLanes;m=(1<<31-Mt(42|t)+1)-1,m&=f&~(S&~M),m=m&201326741?m&201326741|1:m?m|2:0}m!==0&&(l=!0,Ry(r,m))}else m=ze,m=hi(r,r===Qe?m:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(m&3)===0||Pn(r,m)||(l=!0,Ry(r,m));r=r.next}while(l);Td=!1}}function Ux(){zy()}function zy(){mc=Ad=!1;var t=0;rs!==0&&Jx()&&(t=rs);for(var i=Ze(),l=null,r=hc;r!==null;){var f=r.next,m=Dy(r,i);m===0?(r.next=null,l===null?hc=f:l.next=f,f===null&&(Ua=l)):(l=r,(t!==0||(m&3)!==0)&&(mc=!0)),r=f}_t!==0&&_t!==5||yo(t),rs!==0&&(rs=0)}function Dy(t,i){for(var l=t.suspendedLanes,r=t.pingedLanes,f=t.expirationTimes,m=t.pendingLanes&-62914561;0<m;){var S=31-Mt(m),M=1<<S,I=f[S];I===-1?((M&l)===0||(M&r)!==0)&&(f[S]=zl(M,i)):I<=i&&(t.expiredLanes|=M),m&=~M}if(i=Qe,l=ze,l=hi(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&&Rt(r),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||Pn(t,l)){if(i=l&-l,i===t.callbackPriority)return i;switch(r!==null&&Rt(r),Ns(l)){case 2:case 8:l=Ut;break;case 32:l=Bt;break;case 268435456:l=bn;break;default:l=Bt}return r=jy.bind(null,t),l=Et(l,r),t.callbackPriority=i,t.callbackNode=l,i}return r!==null&&r!==null&&Rt(r),t.callbackPriority=2,t.callbackNode=null,2}function jy(t,i){if(_t!==0&&_t!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(dc()&&t.callbackNode!==l)return null;var r=ze;return r=hi(t,t===Qe?r:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),r===0?null:(py(t,r,i),Dy(t,Ze()),t.callbackNode!=null&&t.callbackNode===l?jy.bind(null,t):null)}function Ry(t,i){if(dc())return null;py(t,i,!0)}function Ix(){Px(function(){(He&6)!==0?Et(Vt,Ux):zy()})}function Cd(){if(rs===0){var t=_a;t===0&&(t=Wn,Wn<<=1,(Wn&261888)===0&&(Wn=256)),rs=t}return rs}function By(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:xr(""+t)}function Ly(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 qx(t,i,l,r,f){if(i==="submit"&&l&&l.stateNode===f){var m=By((f[At]||null).action),S=r.submitter;S&&(i=(i=S[At]||null)?By(i.formAction):S.getAttribute("formAction"),i!==null&&(m=i,S=null));var M=new Ar("action","action",null,r,f);t.push({event:M,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(rs!==0){var I=S?Ly(f,S):new FormData(f);Zf(l,{pending:!0,data:I,method:f.method,action:m},null,I)}}else typeof m=="function"&&(M.preventDefault(),I=S?Ly(f,S):new FormData(f),Zf(l,{pending:!0,data:I,method:f.method,action:m},m,I))},currentTarget:f}]})}}for(var Md=0;Md<ff.length;Md++){var Od=ff[Md],Vx=Od.toLowerCase(),Yx=Od[0].toUpperCase()+Od.slice(1);Ln(Vx,"on"+Yx)}Ln(mp,"onAnimationEnd"),Ln(pp,"onAnimationIteration"),Ln(gp,"onAnimationStart"),Ln("dblclick","onDoubleClick"),Ln("focusin","onFocus"),Ln("focusout","onBlur"),Ln(lx,"onTransitionRun"),Ln(ox,"onTransitionStart"),Ln(rx,"onTransitionCancel"),Ln(yp,"onTransitionEnd"),Yi("onMouseEnter",["mouseout","mouseover"]),Yi("onMouseLeave",["mouseout","mouseover"]),Yi("onPointerEnter",["pointerout","pointerover"]),Yi("onPointerLeave",["pointerout","pointerover"]),mi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),mi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),mi("onBeforeInput",["compositionend","keypress","textInput","paste"]),mi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),mi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),mi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var vo="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(" "),Gx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(vo));function $y(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 S=r.length-1;0<=S;S--){var M=r[S],I=M.instance,P=M.currentTarget;if(M=M.listener,I!==m&&f.isPropagationStopped())break e;m=M,f.currentTarget=P;try{m(f)}catch(re){Mr(re)}f.currentTarget=null,m=I}else for(S=0;S<r.length;S++){if(M=r[S],I=M.instance,P=M.currentTarget,M=M.listener,I!==m&&f.isPropagationStopped())break e;m=M,f.currentTarget=P;try{m(f)}catch(re){Mr(re)}f.currentTarget=null,m=I}}}}function ke(t,i){var l=i[ee];l===void 0&&(l=i[ee]=new Set);var r=t+"__bubble";l.has(r)||(Hy(i,t,2,!1),l.add(r))}function kd(t,i,l){var r=0;i&&(r|=4),Hy(l,t,r,i)}var pc="_reactListening"+Math.random().toString(36).slice(2);function zd(t){if(!t[pc]){t[pc]=!0,yr.forEach(function(l){l!=="selectionchange"&&(Gx.has(l)||kd(l,!1,t),kd(l,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[pc]||(i[pc]=!0,kd("selectionchange",!1,i))}}function Hy(t,i,l,r){switch(m0(i)){case 2:var f=bE;break;case 8:f=SE;break;default:f=Kd}l=f.bind(null,i,l,t),f=void 0,!Ju||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 Dd(t,i,l,r,f){var m=r;if((i&1)===0&&(i&2)===0&&r!==null)e:for(;;){if(r===null)return;var S=r.tag;if(S===3||S===4){var M=r.stateNode.containerInfo;if(M===f)break;if(S===4)for(S=r.return;S!==null;){var I=S.tag;if((I===3||I===4)&&S.stateNode.containerInfo===f)return;S=S.return}for(;M!==null;){if(S=Ye(M),S===null)return;if(I=S.tag,I===5||I===6||I===26||I===27){r=m=S;continue e}M=M.parentNode}}r=r.return}Ym(function(){var P=m,re=Qu(l),ue=[];e:{var ne=vp.get(t);if(ne!==void 0){var ae=Ar,ye=t;switch(t){case"keypress":if(Nr(l)===0)break e;case"keydown":case"keyup":ae=$w;break;case"focusin":ye="focus",ae=tf;break;case"focusout":ye="blur",ae=tf;break;case"beforeblur":case"afterblur":ae=tf;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":ae=Km;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ae=Aw;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ae=Iw;break;case mp:case pp:case gp:ae=Mw;break;case yp:ae=Vw;break;case"scroll":case"scrollend":ae=Nw;break;case"wheel":ae=Gw;break;case"copy":case"cut":case"paste":ae=kw;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ae=Qm;break;case"toggle":case"beforetoggle":ae=Kw}var Ne=(i&4)!==0,Ke=!Ne&&(t==="scroll"||t==="scrollend"),Q=Ne?ne!==null?ne+"Capture":null:ne;Ne=[];for(var G=P,J;G!==null;){var ce=G;if(J=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||J===null||Q===null||(ce=Hl(G,Q),ce!=null&&Ne.push(bo(G,ce,J))),Ke)break;G=G.return}0<Ne.length&&(ne=new ae(ne,ye,null,l,re),ue.push({event:ne,listeners:Ne}))}}if((i&7)===0){e:{if(ne=t==="mouseover"||t==="pointerover",ae=t==="mouseout"||t==="pointerout",ne&&l!==Zu&&(ye=l.relatedTarget||l.fromElement)&&(Ye(ye)||ye[Rn]))break e;if((ae||ne)&&(ne=re.window===re?re:(ne=re.ownerDocument)?ne.defaultView||ne.parentWindow:window,ae?(ye=l.relatedTarget||l.toElement,ae=P,ye=ye?Ye(ye):null,ye!==null&&(Ke=c(ye),Ne=ye.tag,ye!==Ke||Ne!==5&&Ne!==27&&Ne!==6)&&(ye=null)):(ae=null,ye=P),ae!==ye)){if(Ne=Km,ce="onMouseLeave",Q="onMouseEnter",G="mouse",(t==="pointerout"||t==="pointerover")&&(Ne=Qm,ce="onPointerLeave",Q="onPointerEnter",G="pointer"),Ke=ae==null?ne:qi(ae),J=ye==null?ne:qi(ye),ne=new Ne(ce,G+"leave",ae,l,re),ne.target=Ke,ne.relatedTarget=J,ce=null,Ye(re)===P&&(Ne=new Ne(Q,G+"enter",ye,l,re),Ne.target=J,Ne.relatedTarget=Ke,ce=Ne),Ke=ce,ae&&ye)t:{for(Ne=Xx,Q=ae,G=ye,J=0,ce=Q;ce;ce=Ne(ce))J++;ce=0;for(var we=G;we;we=Ne(we))ce++;for(;0<J-ce;)Q=Ne(Q),J--;for(;0<ce-J;)G=Ne(G),ce--;for(;J--;){if(Q===G||G!==null&&Q===G.alternate){Ne=Q;break t}Q=Ne(Q),G=Ne(G)}Ne=null}else Ne=null;ae!==null&&Uy(ue,ne,ae,Ne,!1),ye!==null&&Ke!==null&&Uy(ue,Ke,ye,Ne,!0)}}e:{if(ne=P?qi(P):window,ae=ne.nodeName&&ne.nodeName.toLowerCase(),ae==="select"||ae==="input"&&ne.type==="file")var Le=ip;else if(tp(ne))if(sp)Le=ix;else{Le=tx;var be=ex}else ae=ne.nodeName,!ae||ae.toLowerCase()!=="input"||ne.type!=="checkbox"&&ne.type!=="radio"?P&&Ku(P.elementType)&&(Le=ip):Le=nx;if(Le&&(Le=Le(t,P))){np(ue,Le,l,re);break e}be&&be(t,ne,P),t==="focusout"&&P&&ne.type==="number"&&P.memoizedProps.value!=null&&Ll(ne,"number",ne.value)}switch(be=P?qi(P):window,t){case"focusin":(tp(be)||be.contentEditable==="true")&&(ya=be,rf=P,Kl=null);break;case"focusout":Kl=rf=ya=null;break;case"mousedown":cf=!0;break;case"contextmenu":case"mouseup":case"dragend":cf=!1,dp(ue,l,re);break;case"selectionchange":if(ax)break;case"keydown":case"keyup":dp(ue,l,re)}var Me;if(sf)e:{switch(t){case"compositionstart":var De="onCompositionStart";break e;case"compositionend":De="onCompositionEnd";break e;case"compositionupdate":De="onCompositionUpdate";break e}De=void 0}else ga?Pm(t,l)&&(De="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(De="onCompositionStart");De&&(Fm&&l.locale!=="ko"&&(ga||De!=="onCompositionStart"?De==="onCompositionEnd"&&ga&&(Me=Gm()):(Xi=re,Wu="value"in Xi?Xi.value:Xi.textContent,ga=!0)),be=gc(P,De),0<be.length&&(De=new Zm(De,t,null,l,re),ue.push({event:De,listeners:be}),Me?De.data=Me:(Me=ep(l),Me!==null&&(De.data=Me)))),(Me=Qw?Fw(t,l):Jw(t,l))&&(De=gc(P,"onBeforeInput"),0<De.length&&(be=new Zm("onBeforeInput","beforeinput",null,l,re),ue.push({event:be,listeners:De}),be.data=Me)),qx(ue,t,P,l,re)}$y(ue,i)})}function bo(t,i,l){return{instance:t,listener:i,currentTarget:l}}function gc(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=Hl(t,l),f!=null&&r.unshift(bo(t,f,m)),f=Hl(t,i),f!=null&&r.push(bo(t,f,m))),t.tag===3)return r;t=t.return}return[]}function Xx(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function Uy(t,i,l,r,f){for(var m=i._reactName,S=[];l!==null&&l!==r;){var M=l,I=M.alternate,P=M.stateNode;if(M=M.tag,I!==null&&I===r)break;M!==5&&M!==26&&M!==27||P===null||(I=P,f?(P=Hl(l,m),P!=null&&S.unshift(bo(l,P,I))):f||(P=Hl(l,m),P!=null&&S.push(bo(l,P,I)))),l=l.return}S.length!==0&&t.push({event:i,listeners:S})}var Kx=/\r\n?/g,Zx=/\u0000|\uFFFD/g;function Iy(t){return(typeof t=="string"?t:""+t).replace(Kx,`
9
+ `).replace(Zx,"")}function qy(t,i){return i=Iy(i),Iy(t)===i}function Xe(t,i,l,r,f,m){switch(l){case"children":typeof r=="string"?i==="body"||i==="textarea"&&r===""||ha(t,r):(typeof r=="number"||typeof r=="bigint")&&i!=="body"&&ha(t,""+r);break;case"className":ua(t,"class",r);break;case"tabIndex":ua(t,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":ua(t,l,r);break;case"style":qm(t,r,m);break;case"data":if(i!=="object"){ua(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=xr(""+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=xr(""+r),t.setAttribute(l,r);break;case"onClick":r!=null&&(t.onclick=pi);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=xr(""+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),ca(t,"popover",r);break;case"xlinkActuate":Bn(t,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Bn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Bn(t,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Bn(t,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Bn(t,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Bn(t,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Bn(t,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Bn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Bn(t,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":ca(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=xw.get(l)||l,ca(t,l,r))}}function jd(t,i,l,r,f,m){switch(l){case"style":qm(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"?ha(t,r):(typeof r=="number"||typeof r=="bigint")&&ha(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=pi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!vr.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[At]||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,""):ca(t,l,r)}}}function Dt(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 S=l[m];if(S!=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,S,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=S=f=null,I=null,P=null;for(r in l)if(l.hasOwnProperty(r)){var re=l[r];if(re!=null)switch(r){case"name":f=re;break;case"type":S=re;break;case"checked":I=re;break;case"defaultChecked":P=re;break;case"value":m=re;break;case"defaultValue":M=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(a(137,i));break;default:Xe(t,i,r,re,l,null)}}da(t,m,M,I,P,S,f,!1);return;case"select":ke("invalid",t),r=S=m=null;for(f in l)if(l.hasOwnProperty(f)&&(M=l[f],M!=null))switch(f){case"value":m=M;break;case"defaultValue":S=M;break;case"multiple":r=M;default:Xe(t,i,f,M,l,null)}i=m,l=S,t.multiple=!!r,i!=null?Gi(t,!!r,i,!1):l!=null&&Gi(t,!!r,l,!0);return;case"textarea":ke("invalid",t),m=f=r=null;for(S in l)if(l.hasOwnProperty(S)&&(M=l[S],M!=null))switch(S){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,S,M,l,null)}Um(t,r,f,m);return;case"option":for(I in l)l.hasOwnProperty(I)&&(r=l[I],r!=null)&&(I==="selected"?t.selected=r&&typeof r!="function"&&typeof r!="symbol":Xe(t,i,I,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<vo.length;r++)ke(vo[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(P in l)if(l.hasOwnProperty(P)&&(r=l[P],r!=null))switch(P){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Xe(t,i,P,r,l,null)}return;default:if(Ku(i)){for(re in l)l.hasOwnProperty(re)&&(r=l[re],r!==void 0&&jd(t,i,re,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 Qx(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,S=null,M=null,I=null,P=null,re=null;for(ae in l){var ue=l[ae];if(l.hasOwnProperty(ae)&&ue!=null)switch(ae){case"checked":break;case"value":break;case"defaultValue":I=ue;default:r.hasOwnProperty(ae)||Xe(t,i,ae,null,r,ue)}}for(var ne in r){var ae=r[ne];if(ue=l[ne],r.hasOwnProperty(ne)&&(ae!=null||ue!=null))switch(ne){case"type":m=ae;break;case"name":f=ae;break;case"checked":P=ae;break;case"defaultChecked":re=ae;break;case"value":S=ae;break;case"defaultValue":M=ae;break;case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(a(137,i));break;default:ae!==ue&&Xe(t,i,ne,ae,r,ue)}}Bl(t,S,M,I,P,re,m,f);return;case"select":ae=S=M=ne=null;for(m in l)if(I=l[m],l.hasOwnProperty(m)&&I!=null)switch(m){case"value":break;case"multiple":ae=I;default:r.hasOwnProperty(m)||Xe(t,i,m,null,r,I)}for(f in r)if(m=r[f],I=l[f],r.hasOwnProperty(f)&&(m!=null||I!=null))switch(f){case"value":ne=m;break;case"defaultValue":M=m;break;case"multiple":S=m;default:m!==I&&Xe(t,i,f,m,r,I)}i=M,l=S,r=ae,ne!=null?Gi(t,!!l,ne,!1):!!r!=!!l&&(i!=null?Gi(t,!!l,i,!0):Gi(t,!!l,l?[]:"",!1));return;case"textarea":ae=ne=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(S in r)if(f=r[S],m=l[S],r.hasOwnProperty(S)&&(f!=null||m!=null))switch(S){case"value":ne=f;break;case"defaultValue":ae=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(a(91));break;default:f!==m&&Xe(t,i,S,f,r,m)}$l(t,ne,ae);return;case"option":for(var ye in l)ne=l[ye],l.hasOwnProperty(ye)&&ne!=null&&!r.hasOwnProperty(ye)&&(ye==="selected"?t.selected=!1:Xe(t,i,ye,null,r,ne));for(I in r)ne=r[I],ae=l[I],r.hasOwnProperty(I)&&ne!==ae&&(ne!=null||ae!=null)&&(I==="selected"?t.selected=ne&&typeof ne!="function"&&typeof ne!="symbol":Xe(t,i,I,ne,r,ae));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 Ne in l)ne=l[Ne],l.hasOwnProperty(Ne)&&ne!=null&&!r.hasOwnProperty(Ne)&&Xe(t,i,Ne,null,r,ne);for(P in r)if(ne=r[P],ae=l[P],r.hasOwnProperty(P)&&ne!==ae&&(ne!=null||ae!=null))switch(P){case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(a(137,i));break;default:Xe(t,i,P,ne,r,ae)}return;default:if(Ku(i)){for(var Ke in l)ne=l[Ke],l.hasOwnProperty(Ke)&&ne!==void 0&&!r.hasOwnProperty(Ke)&&jd(t,i,Ke,void 0,r,ne);for(re in r)ne=r[re],ae=l[re],!r.hasOwnProperty(re)||ne===ae||ne===void 0&&ae===void 0||jd(t,i,re,ne,r,ae);return}}for(var Q in l)ne=l[Q],l.hasOwnProperty(Q)&&ne!=null&&!r.hasOwnProperty(Q)&&Xe(t,i,Q,null,r,ne);for(ue in r)ne=r[ue],ae=l[ue],!r.hasOwnProperty(ue)||ne===ae||ne==null&&ae==null||Xe(t,i,ue,ne,r,ae)}function Vy(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Fx(){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,S=f.initiatorType,M=f.duration;if(m&&M&&Vy(S)){for(S=0,M=f.responseEnd,r+=1;r<l.length;r++){var I=l[r],P=I.startTime;if(P>M)break;var re=I.transferSize,ue=I.initiatorType;re&&Vy(ue)&&(I=I.responseEnd,S+=re*(I<M?1:(M-P)/(I-P)))}if(--r,i+=8*(m+S)/(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 Rd=null,Bd=null;function yc(t){return t.nodeType===9?t:t.ownerDocument}function Yy(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 Gy(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 Ld(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 $d=null;function Jx(){var t=window.event;return t&&t.type==="popstate"?t===$d?!1:($d=t,!0):($d=null,!1)}var Xy=typeof setTimeout=="function"?setTimeout:void 0,Wx=typeof clearTimeout=="function"?clearTimeout:void 0,Ky=typeof Promise=="function"?Promise:void 0,Px=typeof queueMicrotask=="function"?queueMicrotask:typeof Ky<"u"?function(t){return Ky.resolve(null).then(t).catch(eE)}:Xy;function eE(t){setTimeout(function(){throw t})}function cs(t){return t==="head"}function Zy(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),Ya(i);return}r--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")r++;else if(l==="html")So(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,So(l);for(var m=l.firstChild;m;){var S=m.nextSibling,M=m.nodeName;m[tt]||M==="SCRIPT"||M==="STYLE"||M==="LINK"&&m.rel.toLowerCase()==="stylesheet"||l.removeChild(m),m=S}}else l==="body"&&So(t.ownerDocument.body);l=f}while(l);Ya(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 Hd(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":Hd(l),Xt(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function tE(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[tt])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=Cn(t.nextSibling),t===null)break}return null}function nE(t,i,l){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=Cn(t.nextSibling),t===null))return null;return t}function Fy(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=Cn(t.nextSibling),t===null))return null;return t}function Ud(t){return t.data==="$?"||t.data==="$~"}function Id(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function iE(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 Cn(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 qd=null;function Jy(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(i===0)return Cn(t.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}t=t.nextSibling}return null}function Wy(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 Py(t,i,l){switch(i=yc(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 So(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Xt(t)}var Mn=new Map,e0=new Set;function vc(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var ki=H.d;H.d={f:sE,r:aE,D:lE,C:oE,L:rE,m:cE,X:fE,S:uE,M:dE};function sE(){var t=ki.f(),i=cc();return t||i}function aE(t){var i=on(t);i!==null&&i.tag===5&&i.type==="form"?yg(i):ki.r(t)}var Ia=typeof document>"u"?null:document;function t0(t,i,l){var r=Ia;if(r&&typeof i=="string"&&i){var f=Zt(i);f='link[rel="'+t+'"][href="'+f+'"]',typeof l=="string"&&(f+='[crossorigin="'+l+'"]'),e0.has(f)||(e0.add(f),t={rel:t,crossOrigin:l,href:i},r.querySelector(f)===null&&(i=r.createElement("link"),Dt(i,"link",t),yt(i),r.head.appendChild(i)))}}function lE(t){ki.D(t),t0("dns-prefetch",t,null)}function oE(t,i){ki.C(t,i),t0("preconnect",t,i)}function rE(t,i,l){ki.L(t,i,l);var r=Ia;if(r&&t&&i){var f='link[rel="preload"][as="'+Zt(i)+'"]';i==="image"&&l&&l.imageSrcSet?(f+='[imagesrcset="'+Zt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(f+='[imagesizes="'+Zt(l.imageSizes)+'"]')):f+='[href="'+Zt(t)+'"]';var m=f;switch(i){case"style":m=qa(t);break;case"script":m=Va(t)}Mn.has(m)||(t=g({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:t,as:i},l),Mn.set(m,t),r.querySelector(f)!==null||i==="style"&&r.querySelector(wo(m))||i==="script"&&r.querySelector(xo(m))||(i=r.createElement("link"),Dt(i,"link",t),yt(i),r.head.appendChild(i)))}}function cE(t,i){ki.m(t,i);var l=Ia;if(l&&t){var r=i&&typeof i.as=="string"?i.as:"script",f='link[rel="modulepreload"][as="'+Zt(r)+'"][href="'+Zt(t)+'"]',m=f;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":m=Va(t)}if(!Mn.has(m)&&(t=g({rel:"modulepreload",href:t},i),Mn.set(m,t),l.querySelector(f)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(xo(m)))return}r=l.createElement("link"),Dt(r,"link",t),yt(r),l.head.appendChild(r)}}}function uE(t,i,l){ki.S(t,i,l);var r=Ia;if(r&&t){var f=Vi(r).hoistableStyles,m=qa(t);i=i||"default";var S=f.get(m);if(!S){var M={loading:0,preload:null};if(S=r.querySelector(wo(m)))M.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":i},l),(l=Mn.get(m))&&Vd(t,l);var I=S=r.createElement("link");yt(I),Dt(I,"link",t),I._p=new Promise(function(P,re){I.onload=P,I.onerror=re}),I.addEventListener("load",function(){M.loading|=1}),I.addEventListener("error",function(){M.loading|=2}),M.loading|=4,bc(S,i,r)}S={type:"stylesheet",instance:S,count:1,state:M},f.set(m,S)}}}function fE(t,i){ki.X(t,i);var l=Ia;if(l&&t){var r=Vi(l).hoistableScripts,f=Va(t),m=r.get(f);m||(m=l.querySelector(xo(f)),m||(t=g({src:t,async:!0},i),(i=Mn.get(f))&&Yd(t,i),m=l.createElement("script"),yt(m),Dt(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},r.set(f,m))}}function dE(t,i){ki.M(t,i);var l=Ia;if(l&&t){var r=Vi(l).hoistableScripts,f=Va(t),m=r.get(f);m||(m=l.querySelector(xo(f)),m||(t=g({src:t,async:!0,type:"module"},i),(i=Mn.get(f))&&Yd(t,i),m=l.createElement("script"),yt(m),Dt(m,"link",t),l.head.appendChild(m)),m={type:"script",instance:m,count:1,state:null},r.set(f,m))}}function n0(t,i,l,r){var f=(f=de.current)?vc(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=qa(l.href),l=Vi(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=qa(l.href);var m=Vi(f).hoistableStyles,S=m.get(t);if(S||(f=f.ownerDocument||f,S={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},m.set(t,S),(m=f.querySelector(wo(t)))&&!m._p&&(S.instance=m,S.state.loading=5),Mn.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},Mn.set(t,l),m||hE(f,t,l,S.state))),i&&r===null)throw Error(a(528,""));return S}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=Va(l),l=Vi(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 qa(t){return'href="'+Zt(t)+'"'}function wo(t){return'link[rel="stylesheet"]['+t+"]"}function i0(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function hE(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}),Dt(i,"link",l),yt(i),t.head.appendChild(i))}function Va(t){return'[src="'+Zt(t)+'"]'}function xo(t){return"script[async]"+t}function s0(t,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var r=t.querySelector('style[data-href~="'+Zt(l.href)+'"]');if(r)return i.instance=r,yt(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"),yt(r),Dt(r,"style",f),bc(r,l.precedence,t),i.instance=r;case"stylesheet":f=qa(l.href);var m=t.querySelector(wo(f));if(m)return i.state.loading|=4,i.instance=m,yt(m),m;r=i0(l),(f=Mn.get(f))&&Vd(r,f),m=(t.ownerDocument||t).createElement("link"),yt(m);var S=m;return S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),Dt(m,"link",r),i.state.loading|=4,bc(m,l.precedence,t),i.instance=m;case"script":return m=Va(l.src),(f=t.querySelector(xo(m)))?(i.instance=f,yt(f),f):(r=l,(f=Mn.get(m))&&(r=g({},l),Yd(r,f)),t=t.ownerDocument||t,f=t.createElement("script"),yt(f),Dt(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,bc(r,l.precedence,t));return i.instance}function bc(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,S=0;S<r.length;S++){var M=r[S];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 Vd(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function Yd(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var Sc=null;function a0(t,i,l){if(Sc===null){var r=new Map,f=Sc=new Map;f.set(l,r)}else f=Sc,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[tt]||m[dt]||t==="link"&&m.getAttribute("rel")==="stylesheet")&&m.namespaceURI!=="http://www.w3.org/2000/svg"){var S=m.getAttribute(i)||"";S=t+S;var M=r.get(S);M?M.push(m):r.set(S,[m])}}return r}function l0(t,i,l){t=t.ownerDocument||t,t.head.insertBefore(l,i==="title"?t.querySelector("head > title"):null)}function mE(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 o0(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function pE(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=qa(r.href),m=i.querySelector(wo(f));if(m){i=m._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=wc.bind(t),i.then(t,t)),l.state.loading|=4,l.instance=m,yt(m);return}m=i.ownerDocument||i,r=i0(r),(f=Mn.get(f))&&Vd(r,f),m=m.createElement("link"),yt(m);var S=m;S._p=new Promise(function(M,I){S.onload=M,S.onerror=I}),Dt(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=wc.bind(t),i.addEventListener("load",l),i.addEventListener("error",l))}}var Gd=0;function gE(t,i){return t.stylesheets&&t.count===0&&Ec(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var r=setTimeout(function(){if(t.stylesheets&&Ec(t,t.stylesheets),t.unsuspend){var m=t.unsuspend;t.unsuspend=null,m()}},6e4+i);0<t.imgBytes&&Gd===0&&(Gd=62500*Fx());var f=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Ec(t,t.stylesheets),t.unsuspend)){var m=t.unsuspend;t.unsuspend=null,m()}},(t.imgBytes>Gd?50:800)+i);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(r),clearTimeout(f)}}:null}function wc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Ec(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var xc=null;function Ec(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,xc=new Map,i.forEach(yE,t),xc=null,wc.call(t))}function yE(t,i){if(!(i.state.loading&4)){var l=xc.get(t);if(l)var r=l.get(null);else{l=new Map,xc.set(t,l);for(var f=t.querySelectorAll("link[data-precedence],style[data-precedence]"),m=0;m<f.length;m++){var S=f[m];(S.nodeName==="LINK"||S.getAttribute("media")!=="not all")&&(l.set(S.dataset.precedence,S),r=S)}r&&l.set(null,r)}f=i.instance,S=f.getAttribute("data-precedence"),m=l.get(S)||r,m===r&&l.set(null,f),l.set(S,f),this.count++,r=wc.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 Eo={$$typeof:A,Provider:null,Consumer:null,_currentValue:$,_currentValue2:$,_threadCount:0};function vE(t,i,l,r,f,m,S,M,I){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=Nt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Nt(0),this.hiddenUpdates=Nt(null),this.identifierPrefix=r,this.onUncaughtError=f,this.onCaughtError=m,this.onRecoverableError=S,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=I,this.incompleteTransitions=new Map}function r0(t,i,l,r,f,m,S,M,I,P,re,ue){return t=new vE(t,i,l,S,I,P,re,ue,M),i=1,m===!0&&(i|=24),m=cn(3,null,null,i),t.current=m,m.stateNode=t,i=Nf(),i.refCount++,t.pooledCache=i,i.refCount++,m.memoizedState={element:r,isDehydrated:l,cache:i},Cf(m),t}function c0(t){return t?(t=Sa,t):Sa}function u0(t,i,l,r,f,m){f=c0(f),r.context===null?r.context=f:r.pendingContext=f,r=Wi(i),r.payload={element:l},m=m===void 0?null:m,m!==null&&(r.callback=m),l=Pi(t,r,i),l!==null&&(en(l,t,i),eo(l,t,i))}function f0(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<i?l:i}}function Xd(t,i){f0(t,i),(t=t.alternate)&&f0(t,i)}function d0(t){if(t.tag===13||t.tag===31){var i=Cs(t,67108864);i!==null&&en(i,t,67108864),Xd(t,67108864)}}function h0(t){if(t.tag===13||t.tag===31){var i=mn();i=ln(i);var l=Cs(t,i);l!==null&&en(l,t,i),Xd(t,i)}}var Nc=!0;function bE(t,i,l,r){var f=O.T;O.T=null;var m=H.p;try{H.p=2,Kd(t,i,l,r)}finally{H.p=m,O.T=f}}function SE(t,i,l,r){var f=O.T;O.T=null;var m=H.p;try{H.p=8,Kd(t,i,l,r)}finally{H.p=m,O.T=f}}function Kd(t,i,l,r){if(Nc){var f=Zd(r);if(f===null)Dd(t,i,r,_c,l),p0(t,r);else if(xE(f,t,i,l,r))r.stopPropagation();else if(p0(t,r),i&4&&-1<wE.indexOf(t)){for(;f!==null;){var m=on(f);if(m!==null)switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var S=Gt(m.pendingLanes);if(S!==0){var M=m;for(M.pendingLanes|=2,M.entangledLanes|=2;S;){var I=1<<31-Mt(S);M.entanglements[1]|=I,S&=~I}si(m),(He&6)===0&&(oc=Ze()+500,yo(0))}}break;case 31:case 13:M=Cs(m,2),M!==null&&en(M,m,2),cc(),Xd(m,2)}if(m=Zd(r),m===null&&Dd(t,i,r,_c,l),m===f)break;f=m}f!==null&&r.stopPropagation()}else Dd(t,i,r,null,l)}}function Zd(t){return t=Qu(t),Qd(t)}var _c=null;function Qd(t){if(_c=null,t=Ye(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 _c=t,null}function m0(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(ft()){case Vt:return 2;case Ut:return 8;case Bt:case vn:return 32;case bn:return 268435456;default:return 32}default:return 32}}var Fd=!1,us=null,fs=null,ds=null,No=new Map,_o=new Map,hs=[],wE="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 p0(t,i){switch(t){case"focusin":case"focusout":us=null;break;case"dragenter":case"dragleave":fs=null;break;case"mouseover":case"mouseout":ds=null;break;case"pointerover":case"pointerout":No.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":_o.delete(i.pointerId)}}function Ao(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=on(i),i!==null&&d0(i)),t):(t.eventSystemFlags|=r,i=t.targetContainers,f!==null&&i.indexOf(f)===-1&&i.push(f),t)}function xE(t,i,l,r,f){switch(i){case"focusin":return us=Ao(us,t,i,l,r,f),!0;case"dragenter":return fs=Ao(fs,t,i,l,r,f),!0;case"mouseover":return ds=Ao(ds,t,i,l,r,f),!0;case"pointerover":var m=f.pointerId;return No.set(m,Ao(No.get(m)||null,t,i,l,r,f)),!0;case"gotpointercapture":return m=f.pointerId,_o.set(m,Ao(_o.get(m)||null,t,i,l,r,f)),!0}return!1}function g0(t){var i=Ye(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,ra(t.priority,function(){h0(l)});return}}else if(i===31){if(i=d(l),i!==null){t.blockedOn=i,ra(t.priority,function(){h0(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 Ac(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var l=Zd(t.nativeEvent);if(l===null){l=t.nativeEvent;var r=new l.constructor(l.type,l);Zu=r,l.target.dispatchEvent(r),Zu=null}else return i=on(l),i!==null&&d0(i),t.blockedOn=l,!1;i.shift()}return!0}function y0(t,i,l){Ac(t)&&l.delete(i)}function EE(){Fd=!1,us!==null&&Ac(us)&&(us=null),fs!==null&&Ac(fs)&&(fs=null),ds!==null&&Ac(ds)&&(ds=null),No.forEach(y0),_o.forEach(y0)}function Tc(t,i){t.blockedOn===i&&(t.blockedOn=null,Fd||(Fd=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,EE)))}var Cc=null;function v0(t){Cc!==t&&(Cc=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){Cc===t&&(Cc=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(Qd(r||l)===null)continue;break}var m=on(l);m!==null&&(t.splice(i,3),i-=3,Zf(m,{pending:!0,data:f,method:l.method,action:r},r,f))}}))}function Ya(t){function i(I){return Tc(I,t)}us!==null&&Tc(us,t),fs!==null&&Tc(fs,t),ds!==null&&Tc(ds,t),No.forEach(i),_o.forEach(i);for(var l=0;l<hs.length;l++){var r=hs[l];r.blockedOn===t&&(r.blockedOn=null)}for(;0<hs.length&&(l=hs[0],l.blockedOn===null);)g0(l),l.blockedOn===null&&hs.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],S=f[At]||null;if(typeof m=="function")S||v0(l);else if(S){var M=null;if(m&&m.hasAttribute("formAction")){if(f=m,S=m[At]||null)M=S.formAction;else if(Qd(f)!==null)continue}else M=S.action;typeof M=="function"?l[r+1]=M:(l.splice(r,3),r-=3),v0(l)}}}function b0(){function t(m){m.canIntercept&&m.info==="react-transition"&&m.intercept({handler:function(){return new Promise(function(S){return f=S})},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 Jd(t){this._internalRoot=t}Mc.prototype.render=Jd.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,r=mn();u0(l,r,t,i,null,null)},Mc.prototype.unmount=Jd.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;u0(t.current,2,null,t,null,null),cc(),i[Rn]=null}};function Mc(t){this._internalRoot=t}Mc.prototype.unstable_scheduleHydration=function(t){if(t){var i=oa();t={blockedOn:null,target:t,priority:i};for(var l=0;l<hs.length&&i!==0&&i<hs[l].priority;l++);hs.splice(l,0,t),l===0&&g0(t)}};var S0=n.version;if(S0!=="19.2.7")throw Error(a(527,S0,"19.2.7"));H.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?y(t):null,t=t===null?null:t.stateNode,t};var NE={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Oc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Oc.isDisabled&&Oc.supportsFiber)try{Yt=Oc.inject(NE),pt=Oc}catch{}}return Co.createRoot=function(t,i){if(!o(t))throw Error(a(299));var l=!1,r="",f=Tg,m=Cg,S=Mg;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&&(S=i.onRecoverableError)),i=r0(t,1,!1,null,null,l,r,null,f,m,S,b0),t[Rn]=i.current,zd(t),new Jd(i)},Co.hydrateRoot=function(t,i,l){if(!o(t))throw Error(a(299));var r=!1,f="",m=Tg,S=Cg,M=Mg,I=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&&(S=l.onCaughtError),l.onRecoverableError!==void 0&&(M=l.onRecoverableError),l.formState!==void 0&&(I=l.formState)),i=r0(t,1,!0,i,l??null,r,f,I,m,S,M,b0),i.context=c0(null),l=i.current,r=mn(),r=ln(r),f=Wi(r),f.callback=null,Pi(l,f,r),l=r,i.current.lanes=l,ei(i,l),si(i),t[Rn]=i.current,zd(t),new Mc(i)},Co.version="19.2.7",Co}var O0;function DE(){if(O0)return eh.exports;O0=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(),eh.exports=zE(),eh.exports}var jE=DE();function xt(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=xt(e[s]))!==""&&(n+=(n&&" ")+a);else for(let s in e)e[s]&&(n+=(n&&" ")+s);return n}var RE={value:()=>{}};function bu(){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 Xc(s)}function Xc(e){this._=e}function BE(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}})}Xc.prototype=bu.prototype={constructor:Xc,on:function(e,n){var s=this._,a=BE(e+"",s),o,c=-1,u=a.length;if(arguments.length<2){for(;++c<u;)if((o=(e=a[c]).type)&&(o=LE(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]=k0(s[o],e.name,n);else if(n==null)for(o in s)s[o]=k0(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 Xc(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 LE(e,n){for(var s=0,a=e.length,o;s<a;++s)if((o=e[s]).name===n)return o.value}function k0(e,n,s){for(var a=0,o=e.length;a<o;++a)if(e[a].name===n){e[a]=RE,e=e.slice(0,a).concat(e.slice(a+1));break}return s!=null&&e.push({name:n,value:s}),e}var Mh="http://www.w3.org/1999/xhtml";const z0={svg:"http://www.w3.org/2000/svg",xhtml:Mh,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function Su(e){var n=e+="",s=n.indexOf(":");return s>=0&&(n=e.slice(0,s))!=="xmlns"&&(e=e.slice(s+1)),z0.hasOwnProperty(n)?{space:z0[n],local:e}:e}function $E(e){return function(){var n=this.ownerDocument,s=this.namespaceURI;return s===Mh&&n.documentElement.namespaceURI===Mh?n.createElement(e):n.createElementNS(s,e)}}function HE(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function mb(e){var n=Su(e);return(n.local?HE:$E)(n)}function UE(){}function nm(e){return e==null?UE:function(){return this.querySelector(e)}}function IE(e){typeof e!="function"&&(e=nm(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,y=0;y<u;++y)(h=c[y])&&(p=e.call(h,h.__data__,y,c))&&("__data__"in h&&(p.__data__=h.__data__),d[y]=p);return new yn(a,this._parents)}function qE(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function VE(){return[]}function pb(e){return e==null?VE:function(){return this.querySelectorAll(e)}}function YE(e){return function(){return qE(e.apply(this,arguments))}}function GE(e){typeof e=="function"?e=YE(e):e=pb(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 yn(a,o)}function gb(e){return function(){return this.matches(e)}}function yb(e){return function(n){return n.matches(e)}}var XE=Array.prototype.find;function KE(e){return function(){return XE.call(this.children,e)}}function ZE(){return this.firstElementChild}function QE(e){return this.select(e==null?ZE:KE(typeof e=="function"?e:yb(e)))}var FE=Array.prototype.filter;function JE(){return Array.from(this.children)}function WE(e){return function(){return FE.call(this.children,e)}}function PE(e){return this.selectAll(e==null?JE:WE(typeof e=="function"?e:yb(e)))}function eN(e){typeof e!="function"&&(e=gb(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 yn(a,this._parents)}function vb(e){return new Array(e.length)}function tN(){return new yn(this._enter||this._groups.map(vb),this._parents)}function iu(e,n){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=n}iu.prototype={constructor:iu,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 nN(e){return function(){return e}}function iN(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 iu(e,c[u]);for(;u<h;++u)(d=n[u])&&(o[u]=d)}function sN(e,n,s,a,o,c,u){var d,h,p=new Map,y=n.length,g=c.length,v=new Array(y),x;for(d=0;d<y;++d)(h=n[d])&&(v[d]=x=u.call(h,h.__data__,d,n)+"",p.has(x)?o[d]=h:p.set(x,h));for(d=0;d<g;++d)x=u.call(e,c[d],d,c)+"",(h=p.get(x))?(a[d]=h,h.__data__=c[d],p.delete(x)):s[d]=new iu(e,c[d]);for(d=0;d<y;++d)(h=n[d])&&p.get(v[d])===h&&(o[d]=h)}function aN(e){return e.__data__}function lN(e,n){if(!arguments.length)return Array.from(this,aN);var s=n?sN:iN,a=this._parents,o=this._groups;typeof e!="function"&&(e=nN(e));for(var c=o.length,u=new Array(c),d=new Array(c),h=new Array(c),p=0;p<c;++p){var y=a[p],g=o[p],v=g.length,x=oN(e.call(y,y&&y.__data__,p,a)),E=x.length,_=d[p]=new Array(E),T=u[p]=new Array(E),C=h[p]=new Array(v);s(y,g,_,T,C,x,n);for(var k=0,A=0,N,j;k<E;++k)if(N=_[k]){for(k>=A&&(A=k+1);!(j=T[A])&&++A<E;);N._next=j||null}}return u=new yn(u,a),u._enter=d,u._exit=h,u}function oN(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function rN(){return new yn(this._exit||this._groups.map(vb),this._parents)}function cN(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 uN(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],y=a[h],g=p.length,v=d[h]=new Array(g),x,E=0;E<g;++E)(x=p[E]||y[E])&&(v[E]=x);for(;h<o;++h)d[h]=s[h];return new yn(d,this._parents)}function fN(){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 dN(e){e||(e=hN);function n(g,v){return g&&v?e(g.__data__,v.__data__):!g-!v}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,y=0;y<d;++y)(p=u[y])&&(h[y]=p);h.sort(n)}return new yn(o,this._parents).order()}function hN(e,n){return e<n?-1:e>n?1:e>=n?0:NaN}function mN(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function pN(){return Array.from(this)}function gN(){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 yN(){let e=0;for(const n of this)++e;return e}function vN(){return!this.node()}function bN(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 SN(e){return function(){this.removeAttribute(e)}}function wN(e){return function(){this.removeAttributeNS(e.space,e.local)}}function xN(e,n){return function(){this.setAttribute(e,n)}}function EN(e,n){return function(){this.setAttributeNS(e.space,e.local,n)}}function NN(e,n){return function(){var s=n.apply(this,arguments);s==null?this.removeAttribute(e):this.setAttribute(e,s)}}function _N(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 AN(e,n){var s=Su(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?wN:SN:typeof n=="function"?s.local?_N:NN:s.local?EN:xN)(s,n))}function bb(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function TN(e){return function(){this.style.removeProperty(e)}}function CN(e,n,s){return function(){this.style.setProperty(e,n,s)}}function MN(e,n,s){return function(){var a=n.apply(this,arguments);a==null?this.style.removeProperty(e):this.style.setProperty(e,a,s)}}function ON(e,n,s){return arguments.length>1?this.each((n==null?TN:typeof n=="function"?MN:CN)(e,n,s??"")):fl(this.node(),e)}function fl(e,n){return e.style.getPropertyValue(n)||bb(e).getComputedStyle(e,null).getPropertyValue(n)}function kN(e){return function(){delete this[e]}}function zN(e,n){return function(){this[e]=n}}function DN(e,n){return function(){var s=n.apply(this,arguments);s==null?delete this[e]:this[e]=s}}function jN(e,n){return arguments.length>1?this.each((n==null?kN:typeof n=="function"?DN:zN)(e,n)):this.node()[e]}function Sb(e){return e.trim().split(/^|\s+/)}function im(e){return e.classList||new wb(e)}function wb(e){this._node=e,this._names=Sb(e.getAttribute("class")||"")}wb.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 xb(e,n){for(var s=im(e),a=-1,o=n.length;++a<o;)s.add(n[a])}function Eb(e,n){for(var s=im(e),a=-1,o=n.length;++a<o;)s.remove(n[a])}function RN(e){return function(){xb(this,e)}}function BN(e){return function(){Eb(this,e)}}function LN(e,n){return function(){(n.apply(this,arguments)?xb:Eb)(this,e)}}function $N(e,n){var s=Sb(e+"");if(arguments.length<2){for(var a=im(this.node()),o=-1,c=s.length;++o<c;)if(!a.contains(s[o]))return!1;return!0}return this.each((typeof n=="function"?LN:n?RN:BN)(s,n))}function HN(){this.textContent=""}function UN(e){return function(){this.textContent=e}}function IN(e){return function(){var n=e.apply(this,arguments);this.textContent=n??""}}function qN(e){return arguments.length?this.each(e==null?HN:(typeof e=="function"?IN:UN)(e)):this.node().textContent}function VN(){this.innerHTML=""}function YN(e){return function(){this.innerHTML=e}}function GN(e){return function(){var n=e.apply(this,arguments);this.innerHTML=n??""}}function XN(e){return arguments.length?this.each(e==null?VN:(typeof e=="function"?GN:YN)(e)):this.node().innerHTML}function KN(){this.nextSibling&&this.parentNode.appendChild(this)}function ZN(){return this.each(KN)}function QN(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function FN(){return this.each(QN)}function JN(e){var n=typeof e=="function"?e:mb(e);return this.select(function(){return this.appendChild(n.apply(this,arguments))})}function WN(){return null}function PN(e,n){var s=typeof e=="function"?e:mb(e),a=n==null?WN:typeof n=="function"?n:nm(n);return this.select(function(){return this.insertBefore(s.apply(this,arguments),a.apply(this,arguments)||null)})}function e2(){var e=this.parentNode;e&&e.removeChild(this)}function t2(){return this.each(e2)}function n2(){var e=this.cloneNode(!1),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function i2(){var e=this.cloneNode(!0),n=this.parentNode;return n?n.insertBefore(e,this.nextSibling):e}function s2(e){return this.select(e?i2:n2)}function a2(e){return arguments.length?this.property("__data__",e):this.node().__data__}function l2(e){return function(n){e.call(this,n,this.__data__)}}function o2(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 r2(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 c2(e,n,s){return function(){var a=this.__on,o,c=l2(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 u2(e,n,s){var a=o2(e+""),o,c=a.length,u;if(arguments.length<2){var d=this.node().__on;if(d){for(var h=0,p=d.length,y;h<p;++h)for(o=0,y=d[h];o<c;++o)if((u=a[o]).type===y.type&&u.name===y.name)return y.value}return}for(d=n?c2:r2,o=0;o<c;++o)this.each(d(a[o],n,s));return this}function Nb(e,n,s){var a=bb(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 f2(e,n){return function(){return Nb(this,e,n)}}function d2(e,n){return function(){return Nb(this,e,n.apply(this,arguments))}}function h2(e,n){return this.each((typeof n=="function"?d2:f2)(e,n))}function*m2(){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 _b=[null];function yn(e,n){this._groups=e,this._parents=n}function or(){return new yn([[document.documentElement]],_b)}function p2(){return this}yn.prototype=or.prototype={constructor:yn,select:IE,selectAll:GE,selectChild:QE,selectChildren:PE,filter:eN,data:lN,enter:tN,exit:rN,join:cN,merge:uN,selection:p2,order:fN,sort:dN,call:mN,nodes:pN,node:gN,size:yN,empty:vN,each:bN,attr:AN,style:ON,property:jN,classed:$N,text:qN,html:XN,raise:ZN,lower:FN,append:JN,insert:PN,remove:t2,clone:s2,datum:a2,on:u2,dispatch:h2,[Symbol.iterator]:m2};function pn(e){return typeof e=="string"?new yn([[document.querySelector(e)]],[document.documentElement]):new yn([[e]],_b)}function g2(e){let n;for(;n=e.sourceEvent;)e=n;return e}function Vn(e,n){if(e=g2(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 y2={passive:!1},Yo={capture:!0,passive:!1};function sh(e){e.stopImmediatePropagation()}function il(e){e.preventDefault(),e.stopImmediatePropagation()}function Ab(e){var n=e.document.documentElement,s=pn(e).on("dragstart.drag",il,Yo);"onselectstart"in n?s.on("selectstart.drag",il,Yo):(n.__noselect=n.style.MozUserSelect,n.style.MozUserSelect="none")}function Tb(e,n){var s=e.document.documentElement,a=pn(e).on("dragstart.drag",null);n&&(a.on("click.drag",il,Yo),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 kc=e=>()=>e;function Oh(e,{sourceEvent:n,subject:s,target:a,identifier:o,active:c,x:u,y:d,dx:h,dy:p,dispatch:y}){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:y}})}Oh.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function v2(e){return!e.ctrlKey&&!e.button}function b2(){return this.parentNode}function S2(e,n){return n??{x:e.x,y:e.y}}function w2(){return navigator.maxTouchPoints||"ontouchstart"in this}function Cb(){var e=v2,n=b2,s=S2,a=w2,o={},c=bu("start","drag","end"),u=0,d,h,p,y,g=0;function v(N){N.on("mousedown.drag",x).filter(a).on("touchstart.drag",T).on("touchmove.drag",C,y2).on("touchend.drag touchcancel.drag",k).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function x(N,j){if(!(y||!e.call(this,N,j))){var D=A(this,n.call(this,N,j),N,j,"mouse");D&&(pn(N.view).on("mousemove.drag",E,Yo).on("mouseup.drag",_,Yo),Ab(N.view),sh(N),p=!1,d=N.clientX,h=N.clientY,D("start",N))}}function E(N){if(il(N),!p){var j=N.clientX-d,D=N.clientY-h;p=j*j+D*D>g}o.mouse("drag",N)}function _(N){pn(N.view).on("mousemove.drag mouseup.drag",null),Tb(N.view,p),il(N),o.mouse("end",N)}function T(N,j){if(e.call(this,N,j)){var D=N.changedTouches,B=n.call(this,N,j),R=D.length,U,q;for(U=0;U<R;++U)(q=A(this,B,N,j,D[U].identifier,D[U]))&&(sh(N),q("start",N,D[U]))}}function C(N){var j=N.changedTouches,D=j.length,B,R;for(B=0;B<D;++B)(R=o[j[B].identifier])&&(il(N),R("drag",N,j[B]))}function k(N){var j=N.changedTouches,D=j.length,B,R;for(y&&clearTimeout(y),y=setTimeout(function(){y=null},500),B=0;B<D;++B)(R=o[j[B].identifier])&&(sh(N),R("end",N,j[B]))}function A(N,j,D,B,R,U){var q=c.copy(),Y=Vn(U||D,j),Z,le,L;if((L=s.call(N,new Oh("beforestart",{sourceEvent:D,target:v,identifier:R,active:u,x:Y[0],y:Y[1],dx:0,dy:0,dispatch:q}),B))!=null)return Z=L.x-Y[0]||0,le=L.y-Y[1]||0,function K(O,H,$){var X=Y,se;switch(O){case"start":o[R]=K,se=u++;break;case"end":delete o[R],--u;case"drag":Y=Vn($||H,j),se=u;break}q.call(O,N,new Oh(O,{sourceEvent:H,subject:L,target:v,identifier:R,active:se,x:Y[0]+Z,y:Y[1]+le,dx:Y[0]-X[0],dy:Y[1]-X[1],dispatch:q}),B)}}return v.filter=function(N){return arguments.length?(e=typeof N=="function"?N:kc(!!N),v):e},v.container=function(N){return arguments.length?(n=typeof N=="function"?N:kc(N),v):n},v.subject=function(N){return arguments.length?(s=typeof N=="function"?N:kc(N),v):s},v.touchable=function(N){return arguments.length?(a=typeof N=="function"?N:kc(!!N),v):a},v.on=function(){var N=c.on.apply(c,arguments);return N===c?v:N},v.clickDistance=function(N){return arguments.length?(g=(N=+N)*N,v):Math.sqrt(g)},v}function sm(e,n,s){e.prototype=n.prototype=s,s.constructor=e}function Mb(e,n){var s=Object.create(e.prototype);for(var a in n)s[a]=n[a];return s}function rr(){}var Go=.7,su=1/Go,sl="\\s*([+-]?\\d+)\\s*",Xo="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",ri="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",x2=/^#([0-9a-f]{3,8})$/,E2=new RegExp(`^rgb\\(${sl},${sl},${sl}\\)$`),N2=new RegExp(`^rgb\\(${ri},${ri},${ri}\\)$`),_2=new RegExp(`^rgba\\(${sl},${sl},${sl},${Xo}\\)$`),A2=new RegExp(`^rgba\\(${ri},${ri},${ri},${Xo}\\)$`),T2=new RegExp(`^hsl\\(${Xo},${ri},${ri}\\)$`),C2=new RegExp(`^hsla\\(${Xo},${ri},${ri},${Xo}\\)$`),D0={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};sm(rr,Zs,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:j0,formatHex:j0,formatHex8:M2,formatHsl:O2,formatRgb:R0,toString:R0});function j0(){return this.rgb().formatHex()}function M2(){return this.rgb().formatHex8()}function O2(){return Ob(this).formatHsl()}function R0(){return this.rgb().formatRgb()}function Zs(e){var n,s;return e=(e+"").trim().toLowerCase(),(n=x2.exec(e))?(s=n[1].length,n=parseInt(n[1],16),s===6?B0(n):s===3?new sn(n>>8&15|n>>4&240,n>>4&15|n&240,(n&15)<<4|n&15,1):s===8?zc(n>>24&255,n>>16&255,n>>8&255,(n&255)/255):s===4?zc(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=E2.exec(e))?new sn(n[1],n[2],n[3],1):(n=N2.exec(e))?new sn(n[1]*255/100,n[2]*255/100,n[3]*255/100,1):(n=_2.exec(e))?zc(n[1],n[2],n[3],n[4]):(n=A2.exec(e))?zc(n[1]*255/100,n[2]*255/100,n[3]*255/100,n[4]):(n=T2.exec(e))?H0(n[1],n[2]/100,n[3]/100,1):(n=C2.exec(e))?H0(n[1],n[2]/100,n[3]/100,n[4]):D0.hasOwnProperty(e)?B0(D0[e]):e==="transparent"?new sn(NaN,NaN,NaN,0):null}function B0(e){return new sn(e>>16&255,e>>8&255,e&255,1)}function zc(e,n,s,a){return a<=0&&(e=n=s=NaN),new sn(e,n,s,a)}function k2(e){return e instanceof rr||(e=Zs(e)),e?(e=e.rgb(),new sn(e.r,e.g,e.b,e.opacity)):new sn}function kh(e,n,s,a){return arguments.length===1?k2(e):new sn(e,n,s,a??1)}function sn(e,n,s,a){this.r=+e,this.g=+n,this.b=+s,this.opacity=+a}sm(sn,kh,Mb(rr,{brighter(e){return e=e==null?su:Math.pow(su,e),new sn(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Go:Math.pow(Go,e),new sn(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new sn(Xs(this.r),Xs(this.g),Xs(this.b),au(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:L0,formatHex:L0,formatHex8:z2,formatRgb:$0,toString:$0}));function L0(){return`#${qs(this.r)}${qs(this.g)}${qs(this.b)}`}function z2(){return`#${qs(this.r)}${qs(this.g)}${qs(this.b)}${qs((isNaN(this.opacity)?1:this.opacity)*255)}`}function $0(){const e=au(this.opacity);return`${e===1?"rgb(":"rgba("}${Xs(this.r)}, ${Xs(this.g)}, ${Xs(this.b)}${e===1?")":`, ${e})`}`}function au(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function Xs(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function qs(e){return e=Xs(e),(e<16?"0":"")+e.toString(16)}function H0(e,n,s,a){return a<=0?e=n=s=NaN:s<=0||s>=1?e=n=NaN:n<=0&&(e=NaN),new Gn(e,n,s,a)}function Ob(e){if(e instanceof Gn)return new Gn(e.h,e.s,e.l,e.opacity);if(e instanceof rr||(e=Zs(e)),!e)return new Gn;if(e instanceof Gn)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 Gn(u,d,h,e.opacity)}function D2(e,n,s,a){return arguments.length===1?Ob(e):new Gn(e,n,s,a??1)}function Gn(e,n,s,a){this.h=+e,this.s=+n,this.l=+s,this.opacity=+a}sm(Gn,D2,Mb(rr,{brighter(e){return e=e==null?su:Math.pow(su,e),new Gn(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Go:Math.pow(Go,e),new Gn(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 sn(ah(e>=240?e-240:e+120,o,a),ah(e,o,a),ah(e<120?e+240:e-120,o,a),this.opacity)},clamp(){return new Gn(U0(this.h),Dc(this.s),Dc(this.l),au(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=au(this.opacity);return`${e===1?"hsl(":"hsla("}${U0(this.h)}, ${Dc(this.s)*100}%, ${Dc(this.l)*100}%${e===1?")":`, ${e})`}`}}));function U0(e){return e=(e||0)%360,e<0?e+360:e}function Dc(e){return Math.max(0,Math.min(1,e||0))}function ah(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 am=e=>()=>e;function j2(e,n){return function(s){return e+s*n}}function R2(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 B2(e){return(e=+e)==1?kb:function(n,s){return s-n?R2(n,s,e):am(isNaN(n)?s:n)}}function kb(e,n){var s=n-e;return s?j2(e,s):am(isNaN(e)?n:e)}const lu=(function e(n){var s=B2(n);function a(o,c){var u=s((o=kh(o)).r,(c=kh(c)).r),d=s(o.g,c.g),h=s(o.b,c.b),p=kb(o.opacity,c.opacity);return function(y){return o.r=u(y),o.g=d(y),o.b=h(y),o.opacity=p(y),o+""}}return a.gamma=e,a})(1);function L2(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 $2(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function H2(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]=$o(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 U2(e,n){var s=new Date;return e=+e,n=+n,function(a){return s.setTime(e*(1-a)+n*a),s}}function li(e,n){return e=+e,n=+n,function(s){return e*(1-s)+n*s}}function I2(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]=$o(e[o],n[o]):a[o]=n[o];return function(c){for(o in s)a[o]=s[o](c);return a}}var zh=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,lh=new RegExp(zh.source,"g");function q2(e){return function(){return e}}function V2(e){return function(n){return e(n)+""}}function zb(e,n){var s=zh.lastIndex=lh.lastIndex=0,a,o,c,u=-1,d=[],h=[];for(e=e+"",n=n+"";(a=zh.exec(e))&&(o=lh.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:li(a,o)})),s=lh.lastIndex;return s<n.length&&(c=n.slice(s),d[u]?d[u]+=c:d[++u]=c),d.length<2?h[0]?V2(h[0].x):q2(n):(n=h.length,function(p){for(var y=0,g;y<n;++y)d[(g=h[y]).i]=g.x(p);return d.join("")})}function $o(e,n){var s=typeof n,a;return n==null||s==="boolean"?am(n):(s==="number"?li:s==="string"?(a=Zs(n))?(n=a,lu):zb:n instanceof Zs?lu:n instanceof Date?U2:$2(n)?L2:Array.isArray(n)?H2:typeof n.valueOf!="function"&&typeof n.toString!="function"||isNaN(n)?I2:li)(e,n)}var I0=180/Math.PI,Dh={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function Db(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)*I0,skewX:Math.atan(h)*I0,scaleX:u,scaleY:d}}var jc;function Y2(e){const n=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return n.isIdentity?Dh:Db(n.a,n.b,n.c,n.d,n.e,n.f)}function G2(e){return e==null||(jc||(jc=document.createElementNS("http://www.w3.org/2000/svg","g")),jc.setAttribute("transform",e),!(e=jc.transform.baseVal.consolidate()))?Dh:(e=e.matrix,Db(e.a,e.b,e.c,e.d,e.e,e.f))}function jb(e,n,s,a){function o(p){return p.length?p.pop()+" ":""}function c(p,y,g,v,x,E){if(p!==g||y!==v){var _=x.push("translate(",null,n,null,s);E.push({i:_-4,x:li(p,g)},{i:_-2,x:li(y,v)})}else(g||v)&&x.push("translate("+g+n+v+s)}function u(p,y,g,v){p!==y?(p-y>180?y+=360:y-p>180&&(p+=360),v.push({i:g.push(o(g)+"rotate(",null,a)-2,x:li(p,y)})):y&&g.push(o(g)+"rotate("+y+a)}function d(p,y,g,v){p!==y?v.push({i:g.push(o(g)+"skewX(",null,a)-2,x:li(p,y)}):y&&g.push(o(g)+"skewX("+y+a)}function h(p,y,g,v,x,E){if(p!==g||y!==v){var _=x.push(o(x)+"scale(",null,",",null,")");E.push({i:_-4,x:li(p,g)},{i:_-2,x:li(y,v)})}else(g!==1||v!==1)&&x.push(o(x)+"scale("+g+","+v+")")}return function(p,y){var g=[],v=[];return p=e(p),y=e(y),c(p.translateX,p.translateY,y.translateX,y.translateY,g,v),u(p.rotate,y.rotate,g,v),d(p.skewX,y.skewX,g,v),h(p.scaleX,p.scaleY,y.scaleX,y.scaleY,g,v),p=y=null,function(x){for(var E=-1,_=v.length,T;++E<_;)g[(T=v[E]).i]=T.x(x);return g.join("")}}}var X2=jb(Y2,"px, ","px)","deg)"),K2=jb(G2,", ",")",")"),Z2=1e-12;function q0(e){return((e=Math.exp(e))+1/e)/2}function Q2(e){return((e=Math.exp(e))-1/e)/2}function F2(e){return((e=Math.exp(2*e))-1)/(e+1)}const Kc=(function e(n,s,a){function o(c,u){var d=c[0],h=c[1],p=c[2],y=u[0],g=u[1],v=u[2],x=y-d,E=g-h,_=x*x+E*E,T,C;if(_<Z2)C=Math.log(v/p)/n,T=function(B){return[d+B*x,h+B*E,p*Math.exp(n*B*C)]};else{var k=Math.sqrt(_),A=(v*v-p*p+a*_)/(2*p*s*k),N=(v*v-p*p-a*_)/(2*v*s*k),j=Math.log(Math.sqrt(A*A+1)-A),D=Math.log(Math.sqrt(N*N+1)-N);C=(D-j)/n,T=function(B){var R=B*C,U=q0(j),q=p/(s*k)*(U*F2(n*R+j)-Q2(j));return[d+q*x,h+q*E,p*U/q0(n*R+j)]}}return T.duration=C*1e3*n/Math.SQRT2,T}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 dl=0,zo=0,Mo=0,Rb=1e3,ou,Do,ru=0,Qs=0,wu=0,Ko=typeof performance=="object"&&performance.now?performance:Date,Bb=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function lm(){return Qs||(Bb(J2),Qs=Ko.now()+wu)}function J2(){Qs=0}function cu(){this._call=this._time=this._next=null}cu.prototype=Lb.prototype={constructor:cu,restart:function(e,n,s){if(typeof e!="function")throw new TypeError("callback is not a function");s=(s==null?lm():+s)+(n==null?0:+n),!this._next&&Do!==this&&(Do?Do._next=this:ou=this,Do=this),this._call=e,this._time=s,jh()},stop:function(){this._call&&(this._call=null,this._time=1/0,jh())}};function Lb(e,n,s){var a=new cu;return a.restart(e,n,s),a}function W2(){lm(),++dl;for(var e=ou,n;e;)(n=Qs-e._time)>=0&&e._call.call(void 0,n),e=e._next;--dl}function V0(){Qs=(ru=Ko.now())+wu,dl=zo=0;try{W2()}finally{dl=0,e_(),Qs=0}}function P2(){var e=Ko.now(),n=e-ru;n>Rb&&(wu-=n,ru=e)}function e_(){for(var e,n=ou,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:ou=s);Do=e,jh(a)}function jh(e){if(!dl){zo&&(zo=clearTimeout(zo));var n=e-Qs;n>24?(e<1/0&&(zo=setTimeout(V0,e-Ko.now()-wu)),Mo&&(Mo=clearInterval(Mo))):(Mo||(ru=Ko.now(),Mo=setInterval(P2,Rb)),dl=1,Bb(V0))}}function Y0(e,n,s){var a=new cu;return n=n==null?0:+n,a.restart(o=>{a.stop(),e(o+n)},n,s),a}var t_=bu("start","end","cancel","interrupt"),n_=[],$b=0,G0=1,Rh=2,Zc=3,X0=4,Bh=5,Qc=6;function xu(e,n,s,a,o,c){var u=e.__transition;if(!u)e.__transition={};else if(s in u)return;i_(e,s,{name:n,index:a,group:o,on:t_,tween:n_,time:c.time,delay:c.delay,duration:c.duration,ease:c.ease,timer:null,state:$b})}function om(e,n){var s=Fn(e,n);if(s.state>$b)throw new Error("too late; already scheduled");return s}function fi(e,n){var s=Fn(e,n);if(s.state>Zc)throw new Error("too late; already running");return s}function Fn(e,n){var s=e.__transition;if(!s||!(s=s[n]))throw new Error("transition not found");return s}function i_(e,n,s){var a=e.__transition,o;a[n]=s,s.timer=Lb(c,0,s.time);function c(p){s.state=G0,s.timer.restart(u,s.delay,s.time),s.delay<=p&&u(p-s.delay)}function u(p){var y,g,v,x;if(s.state!==G0)return h();for(y in a)if(x=a[y],x.name===s.name){if(x.state===Zc)return Y0(u);x.state===X0?(x.state=Qc,x.timer.stop(),x.on.call("interrupt",e,e.__data__,x.index,x.group),delete a[y]):+y<n&&(x.state=Qc,x.timer.stop(),x.on.call("cancel",e,e.__data__,x.index,x.group),delete a[y])}if(Y0(function(){s.state===Zc&&(s.state=X0,s.timer.restart(d,s.delay,s.time),d(p))}),s.state=Rh,s.on.call("start",e,e.__data__,s.index,s.group),s.state===Rh){for(s.state=Zc,o=new Array(v=s.tween.length),y=0,g=-1;y<v;++y)(x=s.tween[y].value.call(e,e.__data__,s.index,s.group))&&(o[++g]=x);o.length=g+1}}function d(p){for(var y=p<s.duration?s.ease.call(null,p/s.duration):(s.timer.restart(h),s.state=Bh,1),g=-1,v=o.length;++g<v;)o[g].call(e,y);s.state===Bh&&(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 Fc(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>Rh&&a.state<Bh,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 s_(e){return this.each(function(){Fc(this,e)})}function a_(e,n){var s,a;return function(){var o=fi(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 l_(e,n,s){var a,o;if(typeof s!="function")throw new Error;return function(){var c=fi(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 o_(e,n){var s=this._id;if(e+="",arguments.length<2){for(var a=Fn(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?a_:l_)(s,e,n))}function rm(e,n,s){var a=e._id;return e.each(function(){var o=fi(this,a);(o.value||(o.value={}))[n]=s.apply(this,arguments)}),function(o){return Fn(o,a).value[n]}}function Hb(e,n){var s;return(typeof n=="number"?li:n instanceof Zs?lu:(s=Zs(n))?(n=s,lu):zb)(e,n)}function r_(e){return function(){this.removeAttribute(e)}}function c_(e){return function(){this.removeAttributeNS(e.space,e.local)}}function u_(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 f_(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 d_(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 h_(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 m_(e,n){var s=Su(e),a=s==="transform"?K2:Hb;return this.attrTween(e,typeof n=="function"?(s.local?h_:d_)(s,a,rm(this,"attr."+e,n)):n==null?(s.local?c_:r_)(s):(s.local?f_:u_)(s,a,n))}function p_(e,n){return function(s){this.setAttribute(e,n.call(this,s))}}function g_(e,n){return function(s){this.setAttributeNS(e.space,e.local,n.call(this,s))}}function y_(e,n){var s,a;function o(){var c=n.apply(this,arguments);return c!==a&&(s=(a=c)&&g_(e,c)),s}return o._value=n,o}function v_(e,n){var s,a;function o(){var c=n.apply(this,arguments);return c!==a&&(s=(a=c)&&p_(e,c)),s}return o._value=n,o}function b_(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=Su(e);return this.tween(s,(a.local?y_:v_)(a,n))}function S_(e,n){return function(){om(this,e).delay=+n.apply(this,arguments)}}function w_(e,n){return n=+n,function(){om(this,e).delay=n}}function x_(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?S_:w_)(n,e)):Fn(this.node(),n).delay}function E_(e,n){return function(){fi(this,e).duration=+n.apply(this,arguments)}}function N_(e,n){return n=+n,function(){fi(this,e).duration=n}}function __(e){var n=this._id;return arguments.length?this.each((typeof e=="function"?E_:N_)(n,e)):Fn(this.node(),n).duration}function A_(e,n){if(typeof n!="function")throw new Error;return function(){fi(this,e).ease=n}}function T_(e){var n=this._id;return arguments.length?this.each(A_(n,e)):Fn(this.node(),n).ease}function C_(e,n){return function(){var s=n.apply(this,arguments);if(typeof s!="function")throw new Error;fi(this,e).ease=s}}function M_(e){if(typeof e!="function")throw new Error;return this.each(C_(this._id,e))}function O_(e){typeof e!="function"&&(e=gb(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 Bi(a,this._parents,this._name,this._id)}function k_(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],y=h.length,g=u[d]=new Array(y),v,x=0;x<y;++x)(v=h[x]||p[x])&&(g[x]=v);for(;d<a;++d)u[d]=n[d];return new Bi(u,this._parents,this._name,this._id)}function z_(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 D_(e,n,s){var a,o,c=z_(n)?om:fi;return function(){var u=c(this,e),d=u.on;d!==a&&(o=(a=d).copy()).on(n,s),u.on=o}}function j_(e,n){var s=this._id;return arguments.length<2?Fn(this.node(),s).on.on(e):this.each(D_(s,e,n))}function R_(e){return function(){var n=this.parentNode;for(var s in this.__transition)if(+s!==e)return;n&&n.removeChild(this)}}function B_(){return this.on("end.remove",R_(this._id))}function L_(e){var n=this._name,s=this._id;typeof e!="function"&&(e=nm(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),y,g,v=0;v<h;++v)(y=d[v])&&(g=e.call(y,y.__data__,v,d))&&("__data__"in y&&(g.__data__=y.__data__),p[v]=g,xu(p[v],n,s,v,p,Fn(y,s)));return new Bi(c,this._parents,n,s)}function $_(e){var n=this._name,s=this._id;typeof e!="function"&&(e=pb(e));for(var a=this._groups,o=a.length,c=[],u=[],d=0;d<o;++d)for(var h=a[d],p=h.length,y,g=0;g<p;++g)if(y=h[g]){for(var v=e.call(y,y.__data__,g,h),x,E=Fn(y,s),_=0,T=v.length;_<T;++_)(x=v[_])&&xu(x,n,s,_,v,E);c.push(v),u.push(y)}return new Bi(c,u,n,s)}var H_=or.prototype.constructor;function U_(){return new H_(this._groups,this._parents)}function I_(e,n){var s,a,o;return function(){var c=fl(this,e),u=(this.style.removeProperty(e),fl(this,e));return c===u?null:c===s&&u===a?o:o=n(s=c,a=u)}}function Ub(e){return function(){this.style.removeProperty(e)}}function q_(e,n,s){var a,o=s+"",c;return function(){var u=fl(this,e);return u===o?null:u===a?c:c=n(a=u,s)}}function V_(e,n,s){var a,o,c;return function(){var u=fl(this,e),d=s(this),h=d+"";return d==null&&(h=d=(this.style.removeProperty(e),fl(this,e))),u===h?null:u===a&&h===o?c:(o=h,c=n(a=u,d))}}function Y_(e,n){var s,a,o,c="style."+n,u="end."+c,d;return function(){var h=fi(this,e),p=h.on,y=h.value[c]==null?d||(d=Ub(n)):void 0;(p!==s||o!==y)&&(a=(s=p).copy()).on(u,o=y),h.on=a}}function G_(e,n,s){var a=(e+="")=="transform"?X2:Hb;return n==null?this.styleTween(e,I_(e,a)).on("end.style."+e,Ub(e)):typeof n=="function"?this.styleTween(e,V_(e,a,rm(this,"style."+e,n))).each(Y_(this._id,e)):this.styleTween(e,q_(e,a,n),s).on("end.style."+e,null)}function X_(e,n,s){return function(a){this.style.setProperty(e,n.call(this,a),s)}}function K_(e,n,s){var a,o;function c(){var u=n.apply(this,arguments);return u!==o&&(a=(o=u)&&X_(e,u,s)),a}return c._value=n,c}function Z_(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,K_(e,n,s??""))}function Q_(e){return function(){this.textContent=e}}function F_(e){return function(){var n=e(this);this.textContent=n??""}}function J_(e){return this.tween("text",typeof e=="function"?F_(rm(this,"text",e)):Q_(e==null?"":e+""))}function W_(e){return function(n){this.textContent=e.call(this,n)}}function P_(e){var n,s;function a(){var o=e.apply(this,arguments);return o!==s&&(n=(s=o)&&W_(o)),n}return a._value=e,a}function eA(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,P_(e))}function tA(){for(var e=this._name,n=this._id,s=Ib(),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 y=Fn(h,n);xu(h,e,s,p,u,{time:y.time+y.delay+y.duration,delay:0,duration:y.duration,ease:y.ease})}return new Bi(a,this._parents,e,s)}function nA(){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=fi(this,a),y=p.on;y!==e&&(n=(e=y).copy(),n._.cancel.push(d),n._.interrupt.push(d),n._.end.push(h)),p.on=n}),o===0&&c()})}var iA=0;function Bi(e,n,s,a){this._groups=e,this._parents=n,this._name=s,this._id=a}function Ib(){return++iA}var zi=or.prototype;Bi.prototype={constructor:Bi,select:L_,selectAll:$_,selectChild:zi.selectChild,selectChildren:zi.selectChildren,filter:O_,merge:k_,selection:U_,transition:tA,call:zi.call,nodes:zi.nodes,node:zi.node,size:zi.size,empty:zi.empty,each:zi.each,on:j_,attr:m_,attrTween:b_,style:G_,styleTween:Z_,text:J_,textTween:eA,remove:B_,tween:o_,delay:x_,duration:__,ease:T_,easeVarying:M_,end:nA,[Symbol.iterator]:zi[Symbol.iterator]};function sA(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var aA={time:null,delay:0,duration:250,ease:sA};function lA(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 oA(e){var n,s;e instanceof Bi?(n=e._id,e=e._name):(n=Ib(),(s=aA).time=lm(),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])&&xu(h,e,n,p,u,s||lA(h,n));return new Bi(a,this._parents,e,n)}or.prototype.interrupt=s_;or.prototype.transition=oA;const Rc=e=>()=>e;function rA(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 Di(e,n,s){this.k=e,this.x=n,this.y=s}Di.prototype={constructor:Di,scale:function(e){return e===1?this:new Di(this.k*e,this.x,this.y)},translate:function(e,n){return e===0&n===0?this:new Di(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 Eu=new Di(1,0,0);qb.prototype=Di.prototype;function qb(e){for(;!e.__zoom;)if(!(e=e.parentNode))return Eu;return e.__zoom}function oh(e){e.stopImmediatePropagation()}function Oo(e){e.preventDefault(),e.stopImmediatePropagation()}function cA(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function uA(){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 K0(){return this.__zoom||Eu}function fA(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function dA(){return navigator.maxTouchPoints||"ontouchstart"in this}function hA(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 Vb(){var e=cA,n=uA,s=hA,a=fA,o=dA,c=[0,1/0],u=[[-1/0,-1/0],[1/0,1/0]],d=250,h=Kc,p=bu("start","zoom","end"),y,g,v,x=500,E=150,_=0,T=10;function C(L){L.property("__zoom",K0).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",U).on("dblclick.zoom",q).filter(o).on("touchstart.zoom",Y).on("touchmove.zoom",Z).on("touchend.zoom touchcancel.zoom",le).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}C.transform=function(L,K,O,H){var $=L.selection?L.selection():L;$.property("__zoom",K0),L!==$?j(L,K,O,H):$.interrupt().each(function(){D(this,arguments).event(H).start().zoom(null,typeof K=="function"?K.apply(this,arguments):K).end()})},C.scaleBy=function(L,K,O,H){C.scaleTo(L,function(){var $=this.__zoom.k,X=typeof K=="function"?K.apply(this,arguments):K;return $*X},O,H)},C.scaleTo=function(L,K,O,H){C.transform(L,function(){var $=n.apply(this,arguments),X=this.__zoom,se=O==null?N($):typeof O=="function"?O.apply(this,arguments):O,w=X.invert(se),z=typeof K=="function"?K.apply(this,arguments):K;return s(A(k(X,z),se,w),$,u)},O,H)},C.translateBy=function(L,K,O,H){C.transform(L,function(){return s(this.__zoom.translate(typeof K=="function"?K.apply(this,arguments):K,typeof O=="function"?O.apply(this,arguments):O),n.apply(this,arguments),u)},null,H)},C.translateTo=function(L,K,O,H,$){C.transform(L,function(){var X=n.apply(this,arguments),se=this.__zoom,w=H==null?N(X):typeof H=="function"?H.apply(this,arguments):H;return s(Eu.translate(w[0],w[1]).scale(se.k).translate(typeof K=="function"?-K.apply(this,arguments):-K,typeof O=="function"?-O.apply(this,arguments):-O),X,u)},H,$)};function k(L,K){return K=Math.max(c[0],Math.min(c[1],K)),K===L.k?L:new Di(K,L.x,L.y)}function A(L,K,O){var H=K[0]-O[0]*L.k,$=K[1]-O[1]*L.k;return H===L.x&&$===L.y?L:new Di(L.k,H,$)}function N(L){return[(+L[0][0]+ +L[1][0])/2,(+L[0][1]+ +L[1][1])/2]}function j(L,K,O,H){L.on("start.zoom",function(){D(this,arguments).event(H).start()}).on("interrupt.zoom end.zoom",function(){D(this,arguments).event(H).end()}).tween("zoom",function(){var $=this,X=arguments,se=D($,X).event(H),w=n.apply($,X),z=O==null?N(w):typeof O=="function"?O.apply($,X):O,F=Math.max(w[1][0]-w[0][0],w[1][1]-w[0][1]),W=$.__zoom,fe=typeof K=="function"?K.apply($,X):K,de=h(W.invert(z).concat(F/W.k),fe.invert(z).concat(F/fe.k));return function(ie){if(ie===1)ie=fe;else{var te=de(ie),oe=F/te[2];ie=new Di(oe,z[0]-te[0]*oe,z[1]-te[1]*oe)}se.zoom(null,ie)}})}function D(L,K,O){return!O&&L.__zooming||new B(L,K)}function B(L,K){this.that=L,this.args=K,this.active=0,this.sourceEvent=null,this.extent=n.apply(L,K),this.taps=0}B.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,K){return this.mouse&&L!=="mouse"&&(this.mouse[1]=K.invert(this.mouse[0])),this.touch0&&L!=="touch"&&(this.touch0[1]=K.invert(this.touch0[0])),this.touch1&&L!=="touch"&&(this.touch1[1]=K.invert(this.touch1[0])),this.that.__zoom=K,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(L){var K=pn(this.that).datum();p.call(L,this.that,new rA(L,{sourceEvent:this.sourceEvent,target:C,transform:this.that.__zoom,dispatch:p}),K)}};function R(L,...K){if(!e.apply(this,arguments))return;var O=D(this,K).event(L),H=this.__zoom,$=Math.max(c[0],Math.min(c[1],H.k*Math.pow(2,a.apply(this,arguments)))),X=Vn(L);if(O.wheel)(O.mouse[0][0]!==X[0]||O.mouse[0][1]!==X[1])&&(O.mouse[1]=H.invert(O.mouse[0]=X)),clearTimeout(O.wheel);else{if(H.k===$)return;O.mouse=[X,H.invert(X)],Fc(this),O.start()}Oo(L),O.wheel=setTimeout(se,E),O.zoom("mouse",s(A(k(H,$),O.mouse[0],O.mouse[1]),O.extent,u));function se(){O.wheel=null,O.end()}}function U(L,...K){if(v||!e.apply(this,arguments))return;var O=L.currentTarget,H=D(this,K,!0).event(L),$=pn(L.view).on("mousemove.zoom",z,!0).on("mouseup.zoom",F,!0),X=Vn(L,O),se=L.clientX,w=L.clientY;Ab(L.view),oh(L),H.mouse=[X,this.__zoom.invert(X)],Fc(this),H.start();function z(W){if(Oo(W),!H.moved){var fe=W.clientX-se,de=W.clientY-w;H.moved=fe*fe+de*de>_}H.event(W).zoom("mouse",s(A(H.that.__zoom,H.mouse[0]=Vn(W,O),H.mouse[1]),H.extent,u))}function F(W){$.on("mousemove.zoom mouseup.zoom",null),Tb(W.view,H.moved),Oo(W),H.event(W).end()}}function q(L,...K){if(e.apply(this,arguments)){var O=this.__zoom,H=Vn(L.changedTouches?L.changedTouches[0]:L,this),$=O.invert(H),X=O.k*(L.shiftKey?.5:2),se=s(A(k(O,X),H,$),n.apply(this,K),u);Oo(L),d>0?pn(this).transition().duration(d).call(j,se,H,L):pn(this).call(C.transform,se,H,L)}}function Y(L,...K){if(e.apply(this,arguments)){var O=L.touches,H=O.length,$=D(this,K,L.changedTouches.length===H).event(L),X,se,w,z;for(oh(L),se=0;se<H;++se)w=O[se],z=Vn(w,this),z=[z,this.__zoom.invert(z),w.identifier],$.touch0?!$.touch1&&$.touch0[2]!==z[2]&&($.touch1=z,$.taps=0):($.touch0=z,X=!0,$.taps=1+!!y);y&&(y=clearTimeout(y)),X&&($.taps<2&&(g=z[0],y=setTimeout(function(){y=null},x)),Fc(this),$.start())}}function Z(L,...K){if(this.__zooming){var O=D(this,K).event(L),H=L.changedTouches,$=H.length,X,se,w,z;for(Oo(L),X=0;X<$;++X)se=H[X],w=Vn(se,this),O.touch0&&O.touch0[2]===se.identifier?O.touch0[0]=w:O.touch1&&O.touch1[2]===se.identifier&&(O.touch1[0]=w);if(se=O.that.__zoom,O.touch1){var F=O.touch0[0],W=O.touch0[1],fe=O.touch1[0],de=O.touch1[1],ie=(ie=fe[0]-F[0])*ie+(ie=fe[1]-F[1])*ie,te=(te=de[0]-W[0])*te+(te=de[1]-W[1])*te;se=k(se,Math.sqrt(ie/te)),w=[(F[0]+fe[0])/2,(F[1]+fe[1])/2],z=[(W[0]+de[0])/2,(W[1]+de[1])/2]}else if(O.touch0)w=O.touch0[0],z=O.touch0[1];else return;O.zoom("touch",s(A(se,w,z),O.extent,u))}}function le(L,...K){if(this.__zooming){var O=D(this,K).event(L),H=L.changedTouches,$=H.length,X,se;for(oh(L),v&&clearTimeout(v),v=setTimeout(function(){v=null},x),X=0;X<$;++X)se=H[X],O.touch0&&O.touch0[2]===se.identifier?delete O.touch0:O.touch1&&O.touch1[2]===se.identifier&&delete O.touch1;if(O.touch1&&!O.touch0&&(O.touch0=O.touch1,delete O.touch1),O.touch0)O.touch0[1]=this.__zoom.invert(O.touch0[0]);else if(O.end(),O.taps===2&&(se=Vn(se,this),Math.hypot(g[0]-se[0],g[1]-se[1])<T)){var w=pn(this).on("dblclick.zoom");w&&w.apply(this,arguments)}}}return C.wheelDelta=function(L){return arguments.length?(a=typeof L=="function"?L:Rc(+L),C):a},C.filter=function(L){return arguments.length?(e=typeof L=="function"?L:Rc(!!L),C):e},C.touchable=function(L){return arguments.length?(o=typeof L=="function"?L:Rc(!!L),C):o},C.extent=function(L){return arguments.length?(n=typeof L=="function"?L:Rc([[+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?(_=(L=+L)*L,C):Math.sqrt(_)},C.tapDistance=function(L){return arguments.length?(T=+L,C):T},C}const Qn={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.`},Zo=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],Yb=["Enter"," ","Escape"],Gb={"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 hl;(function(e){e.Strict="strict",e.Loose="loose"})(hl||(hl={}));var Ks;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(Ks||(Ks={}));var Qo;(function(e){e.Partial="partial",e.Full="full"})(Qo||(Qo={}));const Xb={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var bs;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(bs||(bs={}));var Fo;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Fo||(Fo={}));var me;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(me||(me={}));const Z0={[me.Left]:me.Right,[me.Right]:me.Left,[me.Top]:me.Bottom,[me.Bottom]:me.Top};function Kb(e){return e===null?null:e?"valid":"invalid"}const Zb=e=>"id"in e&&"source"in e&&"target"in e,mA=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),cm=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),cr=(e,n=[0,0])=>{const{width:s,height:a}=Li(e),o=e.origin??n,c=s*o[0],u=a*o[1];return{x:e.position.x-c,y:e.position.y-u}},pA=(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):cm(o)?o:n.nodeLookup.get(o.id));const d=u?uu(u,n.nodeOrigin):{x:0,y:0,x2:0,y2:0};return Nu(a,d)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return _u(s)},ur=(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=Nu(s,uu(o)),a=!0)}),a?_u(s):{x:0,y:0,width:0,height:0}},um=(e,n,[s,a,o]=[0,0,1],c=!1,u=!1)=>{const d={...xl(n,[s,a,o]),width:n.width/o,height:n.height/o},h=[];for(const p of e.values()){const{measured:y,selectable:g=!0,hidden:v=!1}=p;if(u&&!g||v)continue;const x=y.width??p.width??p.initialWidth??null,E=y.height??p.height??p.initialHeight??null,_=Jo(d,pl(p)),T=(x??0)*(E??0),C=c&&_>0;(!p.internals.handleBounds||C||_>=T||p.dragging)&&h.push(p)}return h},gA=(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 yA(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 vA({nodes:e,width:n,height:s,panZoom:a,minZoom:o,maxZoom:c},u){if(e.size===0)return!0;const d=yA(e,u),h=ur(d),p=dm(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 Qb({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},y=u.origin??a;let g=u.extent||o;if(u.extent==="parent"&&!u.expandParent)if(!d)c?.("005",Qn.error005());else{const x=d.measured.width,E=d.measured.height;x&&E&&(g=[[h,p],[h+x,p+E]])}else d&&Js(u.extent)&&(g=[[u.extent[0][0]+h,u.extent[0][1]+p],[u.extent[1][0]+h,u.extent[1][1]+p]]);const v=Js(g)?Fs(n,g,u.measured):n;return(u.measured.width===void 0||u.measured.height===void 0)&&c?.("015",Qn.error015()),{position:{x:v.x-h+(u.measured.width??0)*y[0],y:v.y-p+(u.measured.height??0)*y[1]},positionAbsolute:v}}async function bA({nodesToRemove:e=[],edgesToRemove:n=[],nodes:s,edges:a,onBeforeDelete:o}){const c=new Set(e.map(v=>v.id)),u=[];for(const v of s){if(v.deletable===!1)continue;const x=c.has(v.id),E=!x&&v.parentId&&u.find(_=>_.id===v.parentId);(x||E)&&u.push(v)}const d=new Set(n.map(v=>v.id)),h=a.filter(v=>v.deletable!==!1),y=gA(u,h);for(const v of h)d.has(v.id)&&!y.find(E=>E.id===v.id)&&y.push(v);if(!o)return{edges:y,nodes:u};const g=await o({nodes:u,edges:y});return typeof g=="boolean"?g?{edges:y,nodes:u}:{edges:[],nodes:[]}:g}const ml=(e,n=0,s=1)=>Math.min(Math.max(e,n),s),Fs=(e={x:0,y:0},n,s)=>({x:ml(e.x,n[0][0],n[1][0]-(s?.width??0)),y:ml(e.y,n[0][1],n[1][1]-(s?.height??0))});function Fb(e,n,s){const{width:a,height:o}=Li(s),{x:c,y:u}=s.internals.positionAbsolute;return Fs(e,[[c,u],[c+a,u+o]],n)}const Q0=(e,n,s)=>e<n?ml(Math.abs(e-n),1,n)/n:e>s?-ml(Math.abs(e-s),1,n)/n:0,fm=(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]},Nu=(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)}),Lh=({x:e,y:n,width:s,height:a})=>({x:e,y:n,x2:e+s,y2:n+a}),_u=({x:e,y:n,x2:s,y2:a})=>({x:e,y:n,width:s-e,height:a-n}),pl=(e,n=[0,0])=>{const{x:s,y:a}=cm(e)?e.internals.positionAbsolute:cr(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}},uu=(e,n=[0,0])=>{const{x:s,y:a}=cm(e)?e.internals.positionAbsolute:cr(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)}},Jb=(e,n)=>_u(Nu(Lh(e),Lh(n))),Jo=(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)},F0=e=>Xn(e.width)&&Xn(e.height)&&Xn(e.x)&&Xn(e.y),Xn=e=>!isNaN(e)&&isFinite(e),Wb=(e,n)=>(s,a)=>{},fr=(e,n=[1,1])=>({x:n[0]*Math.round(e.x/n[0]),y:n[1]*Math.round(e.y/n[1])}),xl=({x:e,y:n},[s,a,o],c=!1,u=[1,1])=>{const d={x:(e-s)/o,y:(n-a)/o};return c?fr(d,u):d},gl=({x:e,y:n},[s,a,o])=>({x:e*o+s,y:n*o+a});function Ga(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 SA(e,n,s){if(typeof e=="string"||typeof e=="number"){const a=Ga(e,s),o=Ga(e,n);return{top:a,right:o,bottom:a,left:o,x:o*2,y:a*2}}if(typeof e=="object"){const a=Ga(e.top??e.y??0,s),o=Ga(e.bottom??e.y??0,s),c=Ga(e.left??e.x??0,n),u=Ga(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 wA(e,n,s,a,o,c){const{x:u,y:d}=gl(e,[n,s,a]),{x:h,y:p}=gl({x:e.x+e.width,y:e.y+e.height},[n,s,a]),y=o-h,g=c-p;return{left:Math.floor(u),top:Math.floor(d),right:Math.floor(y),bottom:Math.floor(g)}}const dm=(e,n,s,a,o,c)=>{const u=SA(c,n,s),d=(n-u.x)/e.width,h=(s-u.y)/e.height,p=Math.min(d,h),y=ml(p,a,o),g=e.x+e.width/2,v=e.y+e.height/2,x=n/2-g*y,E=s/2-v*y,_=wA(e,x,E,y,n,s),T={left:Math.min(_.left-u.left,0),top:Math.min(_.top-u.top,0),right:Math.min(_.right-u.right,0),bottom:Math.min(_.bottom-u.bottom,0)};return{x:x-T.left+T.right,y:E-T.top+T.bottom,zoom:y}},Wo=()=>typeof navigator<"u"&&navigator?.userAgent?.indexOf("Mac")>=0;function Js(e){return e!=null&&e!=="parent"}function Li(e){return{width:e.measured?.width??e.width??e.initialWidth??0,height:e.measured?.height??e.height??e.initialHeight??0}}function Pb(e){return(e.measured?.width??e.width??e.initialWidth)!==void 0&&(e.measured?.height??e.height??e.initialHeight)!==void 0}function e1(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 J0(e,n){if(e.size!==n.size)return!1;for(const s of e)if(!n.has(s))return!1;return!0}function xA(){let e,n;return{promise:new Promise((a,o)=>{e=a,n=o}),resolve:e,reject:n}}function EA(e){return{...Gb,...e||{}}}function Ho(e,{snapGrid:n=[0,0],snapToGrid:s=!1,transform:a,containerBounds:o}){const{x:c,y:u}=Kn(e),d=xl({x:c-(o?.left??0),y:u-(o?.top??0)},a),{x:h,y:p}=s?fr(d,n):d;return{xSnapped:h,ySnapped:p,...d}}const hm=e=>({width:e.offsetWidth,height:e.offsetHeight}),t1=e=>e?.getRootNode?.()||window?.document,NA=["INPUT","SELECT","TEXTAREA"];function n1(e){const n=e.composedPath?.()?.[0]||e.target;return n?.nodeType!==1?!1:NA.includes(n.nodeName)||n.hasAttribute("contenteditable")||!!n.closest(".nokey")}const i1=e=>"clientX"in e,Kn=(e,n)=>{const s=i1(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)}},W0=(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,...hm(u)}})};function s1({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,y=Math.abs(h-e),g=Math.abs(p-n);return[h,p,y,g]}function Bc(e,n){return e>=0?.5*e:n*25*Math.sqrt(-e)}function P0({pos:e,x1:n,y1:s,x2:a,y2:o,c}){switch(e){case me.Left:return[n-Bc(n-a,c),s];case me.Right:return[n+Bc(a-n,c),s];case me.Top:return[n,s-Bc(s-o,c)];case me.Bottom:return[n,s+Bc(o-s,c)]}}function a1({sourceX:e,sourceY:n,sourcePosition:s=me.Bottom,targetX:a,targetY:o,targetPosition:c=me.Top,curvature:u=.25}){const[d,h]=P0({pos:s,x1:e,y1:n,x2:a,y2:o,c:u}),[p,y]=P0({pos:c,x1:a,y1:o,x2:e,y2:n,c:u}),[g,v,x,E]=s1({sourceX:e,sourceY:n,targetX:a,targetY:o,sourceControlX:d,sourceControlY:h,targetControlX:p,targetControlY:y});return[`M${e},${n} C${d},${h} ${p},${y} ${a},${o}`,g,v,x,E]}function l1({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 _A({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 AA({sourceNode:e,targetNode:n,width:s,height:a,transform:o}){const c=Nu(uu(e),uu(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 Jo(u,_u(c))>0}const TA=({source:e,sourceHandle:n,target:s,targetHandle:a})=>`xy-edge__${e}${n||""}-${s}${a||""}`,CA=(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)),MA=(e,n,s={})=>{if(!e.source||!e.target)return s.onError?.("006",Qn.error006()),n;const a=s.getEdgeId||TA;let o;return Zb(e)?o={...e}:o={...e,id:a(e)},CA(o,n)?n:(o.sourceHandle===null&&delete o.sourceHandle,o.targetHandle===null&&delete o.targetHandle,n.concat(o))};function o1({sourceX:e,sourceY:n,targetX:s,targetY:a}){const[o,c,u,d]=l1({sourceX:e,sourceY:n,targetX:s,targetY:a});return[`M ${e},${n}L ${s},${a}`,o,c,u,d]}const ev={[me.Left]:{x:-1,y:0},[me.Right]:{x:1,y:0},[me.Top]:{x:0,y:-1},[me.Bottom]:{x:0,y:1}},OA=({source:e,sourcePosition:n=me.Bottom,target:s})=>n===me.Left||n===me.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},tv=(e,n)=>Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2));function kA({source:e,sourcePosition:n=me.Bottom,target:s,targetPosition:a=me.Top,center:o,offset:c,stepPosition:u}){const d=ev[n],h=ev[a],p={x:e.x+d.x*c,y:e.y+d.y*c},y={x:s.x+h.x*c,y:s.y+h.y*c},g=OA({source:p,sourcePosition:n,target:y}),v=g.x!==0?"x":"y",x=g[v];let E=[],_,T;const C={x:0,y:0},k={x:0,y:0},[,,A,N]=l1({sourceX:e.x,sourceY:e.y,targetX:s.x,targetY:s.y});if(d[v]*h[v]===-1){v==="x"?(_=o.x??p.x+(y.x-p.x)*u,T=o.y??(p.y+y.y)/2):(_=o.x??(p.x+y.x)/2,T=o.y??p.y+(y.y-p.y)*u);const R=[{x:_,y:p.y},{x:_,y:y.y}],U=[{x:p.x,y:T},{x:y.x,y:T}];d[v]===x?E=v==="x"?R:U:E=v==="x"?U:R}else{const R=[{x:p.x,y:y.y}],U=[{x:y.x,y:p.y}];if(v==="x"?E=d.x===x?U:R:E=d.y===x?R:U,n===a){const L=Math.abs(e[v]-s[v]);if(L<=c){const K=Math.min(c-1,c-L);d[v]===x?C[v]=(p[v]>e[v]?-1:1)*K:k[v]=(y[v]>s[v]?-1:1)*K}}if(n!==a){const L=v==="x"?"y":"x",K=d[v]===h[L],O=p[L]>y[L],H=p[L]<y[L];(d[v]===1&&(!K&&O||K&&H)||d[v]!==1&&(!K&&H||K&&O))&&(E=v==="x"?R:U)}const q={x:p.x+C.x,y:p.y+C.y},Y={x:y.x+k.x,y:y.y+k.y},Z=Math.max(Math.abs(q.x-E[0].x),Math.abs(Y.x-E[0].x)),le=Math.max(Math.abs(q.y-E[0].y),Math.abs(Y.y-E[0].y));Z>=le?(_=(q.x+Y.x)/2,T=E[0].y):(_=E[0].x,T=(q.y+Y.y)/2)}const j={x:p.x+C.x,y:p.y+C.y},D={x:y.x+k.x,y:y.y+k.y};return[[e,...j.x!==E[0].x||j.y!==E[0].y?[j]:[],...E,...D.x!==E[E.length-1].x||D.y!==E[E.length-1].y?[D]:[],s],_,T,A,N]}function zA(e,n,s,a){const o=Math.min(tv(e,n)/2,tv(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,y=e.y<s.y?1:-1;return`L ${c+o*p},${u}Q ${c},${u} ${c},${u+o*y}`}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 $h({sourceX:e,sourceY:n,sourcePosition:s=me.Bottom,targetX:a,targetY:o,targetPosition:c=me.Top,borderRadius:u=5,centerX:d,centerY:h,offset:p=20,stepPosition:y=.5}){const[g,v,x,E,_]=kA({source:{x:e,y:n},sourcePosition:s,target:{x:a,y:o},targetPosition:c,center:{x:d,y:h},offset:p,stepPosition:y});let T=`M${g[0].x} ${g[0].y}`;for(let C=1;C<g.length-1;C++)T+=zA(g[C-1],g[C],g[C+1],u);return T+=`L${g[g.length-1].x} ${g[g.length-1].y}`,[T,v,x,E,_]}function nv(e){return e&&!!(e.internals.handleBounds||e.handles?.length)&&!!(e.measured.width||e.width||e.initialWidth)}function DA(e){const{sourceNode:n,targetNode:s}=e;if(!nv(n)||!nv(s))return null;const a=n.internals.handleBounds||iv(n.handles),o=s.internals.handleBounds||iv(s.handles),c=sv(a?.source??[],e.sourceHandle),u=sv(e.connectionMode===hl.Strict?o?.target??[]:(o?.target??[]).concat(o?.source??[]),e.targetHandle);if(!c||!u)return e.onError?.("008",Qn.error008(c?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const d=c?.position||me.Bottom,h=u?.position||me.Top,p=Ws(n,c,d),y=Ws(s,u,h);return{sourceX:p.x,sourceY:p.y,targetX:y.x,targetY:y.y,sourcePosition:d,targetPosition:h}}function iv(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 Ws(e,n,s=me.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??Li(e);if(a)return{x:o+u/2,y:c+d/2};switch(n?.position??s){case me.Top:return{x:o+u/2,y:c};case me.Right:return{x:o+u,y:c+d/2};case me.Bottom:return{x:o+u/2,y:c+d};case me.Left:return{x:o,y:c+d/2}}}function sv(e,n){return e&&(n?e.find(s=>s.id===n):e[0])||null}function Hh(e,n){return e?typeof e=="string"?e:`${n?`${n}__`:""}${Object.keys(e).sort().map(a=>`${a}=${e[a]}`).join("&")}`:""}function jA(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=Hh(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 r1=1e3,RA=10,mm={nodeOrigin:[0,0],nodeExtent:Zo,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},BA={...mm,checkEquality:!0};function pm(e,n){const s={...e};for(const a in n)n[a]!==void 0&&(s[a]=n[a]);return s}function LA(e,n,s){const a=pm(mm,s);for(const o of e.values())if(o.parentId)ym(o,e,n,a);else{const c=cr(o,a.nodeOrigin),u=Js(o.extent)?o.extent:a.nodeExtent,d=Fs(c,u,Li(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 gm(e){return e==="manual"}function Uh(e,n,s,a={}){const o=pm(BA,a),c={i:0},u=new Map(n),d=o?.elevateNodesOnSelect&&!gm(o.zIndexMode)?r1:0;let h=e.length>0,p=!1;n.clear(),s.clear();for(const y of e){let g=u.get(y.id);if(o.checkEquality&&y===g?.internals.userNode)n.set(y.id,g);else{const v=cr(y,o.nodeOrigin),x=Js(y.extent)?y.extent:o.nodeExtent,E=Fs(v,x,Li(y));g={...o.defaults,...y,measured:{width:y.measured?.width,height:y.measured?.height},internals:{positionAbsolute:E,handleBounds:$A(y,g),z:c1(y,d,o.zIndexMode),userNode:y}},n.set(y.id,g)}(g.measured===void 0||g.measured.width===void 0||g.measured.height===void 0)&&!g.hidden&&(h=!1),y.parentId&&ym(g,n,s,a,c),p||=y.selected??!1}return{nodesInitialized:h,hasSelectedNodes:p}}function HA(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 ym(e,n,s,a,o){const{elevateNodesOnSelect:c,nodeOrigin:u,nodeExtent:d,zIndexMode:h}=pm(mm,a),p=e.parentId,y=n.get(p);if(!y){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}HA(e,s),o&&!y.parentId&&y.internals.rootParentIndex===void 0&&h==="auto"&&(y.internals.rootParentIndex=++o.i,y.internals.z=y.internals.z+o.i*RA),o&&y.internals.rootParentIndex!==void 0&&(o.i=y.internals.rootParentIndex);const g=c&&!gm(h)?r1:0,{x:v,y:x,z:E}=UA(e,y,u,d,g,h),{positionAbsolute:_}=e.internals,T=v!==_.x||x!==_.y;(T||E!==e.internals.z)&&n.set(e.id,{...e,internals:{...e.internals,positionAbsolute:T?{x:v,y:x}:_,z:E}})}function c1(e,n,s){const a=Xn(e.zIndex)?e.zIndex:0;return gm(s)?a:a+(e.selected?n:0)}function UA(e,n,s,a,o,c){const{x:u,y:d}=n.internals.positionAbsolute,h=Li(e),p=cr(e,s),y=Js(e.extent)?Fs(p,e.extent,h):p;let g=Fs({x:u+y.x,y:d+y.y},a,h);e.extent==="parent"&&(g=Fb(g,h,n));const v=c1(e,o,c),x=n.internals.z??0;return{x:g.x,y:g.y,z:x>=v?x+1:v}}function vm(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??pl(d),p=Jb(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,y=Li(d),g=d.origin??a,v=u.x<p.x?Math.round(Math.abs(p.x-u.x)):0,x=u.y<p.y?Math.round(Math.abs(p.y-u.y)):0,E=Math.max(y.width,Math.round(u.width)),_=Math.max(y.height,Math.round(u.height)),T=(E-y.width)*g[0],C=(_-y.height)*g[1];(v>0||x>0||T||C)&&(o.push({id:h,type:"position",position:{x:d.position.x-v+T,y:d.position.y-x+C}}),s.get(h)?.forEach(k=>{e.some(A=>A.id===k.id)||o.push({id:k.id,type:"position",position:{x:k.position.x+v,y:k.position.y+x}})})),(y.width<u.width||y.height<u.height||v||x)&&o.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:E+(v?g[0]*v-T:0),height:_+(x?g[1]*x-C:0)}})}),o}function IA(e,n,s,a,o,c,u){const d=a?.querySelector(".xyflow__viewport");let h=!1;if(!d)return{changes:[],updatedInternals:h};const p=[],y=window.getComputedStyle(d),{m22:g}=new window.DOMMatrixReadOnly(y.transform),v=[];for(const x of e.values()){const E=n.get(x.id);if(!E)continue;if(E.hidden){n.set(E.id,{...E,internals:{...E.internals,handleBounds:void 0}}),h=!0;continue}const _=hm(x.nodeElement),T=E.measured.width!==_.width||E.measured.height!==_.height;if(!!(_.width&&_.height&&(T||!E.internals.handleBounds||x.force))){const k=x.nodeElement.getBoundingClientRect(),A=Js(E.extent)?E.extent:c;let{positionAbsolute:N}=E.internals;E.parentId&&E.extent==="parent"?N=Fb(N,_,n.get(E.parentId)):A&&(N=Fs(N,A,_));const j={...E,measured:_,internals:{...E.internals,positionAbsolute:N,handleBounds:{source:W0("source",x.nodeElement,k,g,E.id),target:W0("target",x.nodeElement,k,g,E.id)}}};n.set(E.id,j),E.parentId&&ym(j,n,s,{nodeOrigin:o,zIndexMode:u}),h=!0,T&&(p.push({id:E.id,type:"dimensions",dimensions:_}),E.expandParent&&E.parentId&&v.push({id:E.id,parentId:E.parentId,rect:pl(j,o)}))}}if(v.length>0){const x=vm(v,n,s,o);p.push(...x)}return{changes:p,updatedInternals:h}}async function qA({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 av(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 u1(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}`,y=`${c}-${d}--${o}-${u}`;av("source",h,y,e,o,u),av("target",h,p,e,c,d),n.set(a.id,a)}}function f1(e,n){if(!e.parentId)return!1;const s=n.get(e.parentId);return s?s.selected?!0:f1(s,n):!1}function lv(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 VA(e,n,s,a){const o=new Map;for(const[c,u]of e)if((u.selected||u.id===a)&&(!u.parentId||!f1(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 rh({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 YA({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=fr(c,n);return{x:u.x-c.x,y:u.y-c.y}}function GA({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},y=null,g=!1,v=null,x=!1,E=!1,_=null;function T({noDragClassName:k,handleSelector:A,domNode:N,isSelectable:j,nodeId:D,nodeClickDistance:B=0}){v=pn(N);function R({x:Z,y:le}){const{nodeLookup:L,nodeExtent:K,snapGrid:O,snapToGrid:H,nodeOrigin:$,onNodeDrag:X,onSelectionDrag:se,onError:w,updateNodePositions:z}=n();c={x:Z,y:le};let F=!1;const W=d.size>1,fe=W&&K?Lh(ur(d)):null,de=W&&H?YA({dragItems:d,snapGrid:O,x:Z,y:le}):null;for(const[ie,te]of d){if(!L.has(ie))continue;let oe={x:Z-te.distance.x,y:le-te.distance.y};H&&(oe=de?{x:Math.round(oe.x+de.x),y:Math.round(oe.y+de.y)}:fr(oe,O));let ve=null;if(W&&K&&!te.extent&&fe){const{positionAbsolute:ge}=te.internals,Ee=ge.x-fe.x+K[0][0],Ce=ge.x+te.measured.width-fe.x2+K[1][0],Ie=ge.y-fe.y+K[0][1],et=ge.y+te.measured.height-fe.y2+K[1][1];ve=[[Ee,Ie],[Ce,et]]}const{position:Se,positionAbsolute:he}=Qb({nodeId:ie,nextPosition:oe,nodeLookup:L,nodeExtent:ve||K,nodeOrigin:$,onError:w});F=F||te.position.x!==Se.x||te.position.y!==Se.y,te.position=Se,te.internals.positionAbsolute=he}if(E=E||F,!!F&&(z(d,!0),_&&(a||X||!D&&se))){const[ie,te]=rh({nodeId:D,dragItems:d,nodeLookup:L});a?.(_,d,ie,te),X?.(_,ie,te),D||se?.(_,te)}}async function U(){if(!y)return;const{transform:Z,panBy:le,autoPanSpeed:L,autoPanOnNodeDrag:K}=n();if(!K){h=!1,cancelAnimationFrame(u);return}const[O,H]=fm(p,y,L);(O!==0||H!==0)&&(c.x=(c.x??0)-O/Z[2],c.y=(c.y??0)-H/Z[2],await le({x:O,y:H})&&R(c)),u=requestAnimationFrame(U)}function q(Z){const{nodeLookup:le,multiSelectionActive:L,nodesDraggable:K,transform:O,snapGrid:H,snapToGrid:$,selectNodesOnDrag:X,onNodeDragStart:se,onSelectionDragStart:w,unselectNodesAndEdges:z}=n();g=!0,(!X||!j)&&!L&&D&&(le.get(D)?.selected||z()),j&&X&&D&&e?.(D);const F=Ho(Z.sourceEvent,{transform:O,snapGrid:H,snapToGrid:$,containerBounds:y});if(c=F,d=VA(le,K,F,D),d.size>0&&(s||se||!D&&w)){const[W,fe]=rh({nodeId:D,dragItems:d,nodeLookup:le});s?.(Z.sourceEvent,d,W,fe),se?.(Z.sourceEvent,W,fe),D||w?.(Z.sourceEvent,fe)}}const Y=Cb().clickDistance(B).on("start",Z=>{const{domNode:le,nodeDragThreshold:L,transform:K,snapGrid:O,snapToGrid:H}=n();y=le?.getBoundingClientRect()||null,x=!1,E=!1,_=Z.sourceEvent,L===0&&q(Z),c=Ho(Z.sourceEvent,{transform:K,snapGrid:O,snapToGrid:H,containerBounds:y}),p=Kn(Z.sourceEvent,y)}).on("drag",Z=>{const{autoPanOnNodeDrag:le,transform:L,snapGrid:K,snapToGrid:O,nodeDragThreshold:H,nodeLookup:$}=n(),X=Ho(Z.sourceEvent,{transform:L,snapGrid:K,snapToGrid:O,containerBounds:y});if(_=Z.sourceEvent,(Z.sourceEvent.type==="touchmove"&&Z.sourceEvent.touches.length>1||D&&!$.has(D))&&(x=!0),!x){if(!h&&le&&g&&(h=!0,U()),!g){const se=Kn(Z.sourceEvent,y),w=se.x-p.x,z=se.y-p.y;Math.sqrt(w*w+z*z)>H&&q(Z)}(c.x!==X.xSnapped||c.y!==X.ySnapped)&&d&&g&&(p=Kn(Z.sourceEvent,y),R(X))}}).on("end",Z=>{if(!g||x){x&&d.size>0&&n().updateNodePositions(d,!1);return}if(h=!1,g=!1,cancelAnimationFrame(u),d.size>0){const{nodeLookup:le,updateNodePositions:L,onNodeDragStop:K,onSelectionDragStop:O}=n();if(E&&(L(d,!1),E=!1),o||K||!D&&O){const[H,$]=rh({nodeId:D,dragItems:d,nodeLookup:le,dragging:!1});o?.(Z.sourceEvent,d,H,$),K?.(Z.sourceEvent,H,$),D||O?.(Z.sourceEvent,$)}}}).filter(Z=>{const le=Z.target;return!Z.button&&(!k||!lv(le,`.${k}`,N))&&(!A||lv(le,A,N))});v.call(Y)}function C(){v?.on(".drag",null)}return{update:T,destroy:C}}function XA(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())Jo(o,pl(c))>0&&a.push(c);return a}const KA=250;function ZA(e,n,s,a){let o=[],c=1/0;const u=XA(e,s,n+KA);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:y,y:g}=Ws(d,p,p.position,!0),v=Math.sqrt(Math.pow(y-e.x,2)+Math.pow(g-e.y,2));v>n||(v<c?(o=[{...p,x:y,y:g}],c=v):v===c&&o.push({...p,x:y,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 d1(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,...Ws(u,h,h.position,!0)}:h}function h1(e,n){return e||(n?.classList.contains("target")?"target":n?.classList.contains("source")?"source":null)}function QA(e,n){let s=null;return n?s=!0:e&&!n&&(s=!1),s}const m1=()=>!0;function FA(e,{connectionMode:n,connectionRadius:s,handleId:a,nodeId:o,edgeUpdaterType:c,isTarget:u,domNode:d,nodeLookup:h,lib:p,autoPanOnConnect:y,flowId:g,panBy:v,cancelConnection:x,onConnectStart:E,onConnect:_,onConnectEnd:T,isValidConnection:C=m1,onReconnectEnd:k,updateConnection:A,getTransform:N,getFromHandle:j,autoPanSpeed:D,dragThreshold:B=1,handleDomNode:R}){const U=t1(e.target);let q=0,Y;const{x:Z,y:le}=Kn(e),L=h1(c,R),K=d?.getBoundingClientRect();let O=!1;if(!K||!L)return;const H=d1(o,L,a,h,n);if(!H)return;let $=Kn(e,K),X=!1,se=null,w=!1,z=null;function F(){if(!y||!K)return;const[Se,he]=fm($,K,D);v({x:Se,y:he}),q=requestAnimationFrame(F)}const W={...H,nodeId:o,type:L,position:H.position},fe=h.get(o);let ie={inProgress:!0,isValid:null,from:Ws(fe,W,me.Left,!0),fromHandle:W,fromPosition:W.position,fromNode:fe,to:$,toHandle:null,toPosition:Z0[W.position],toNode:null,pointer:$};function te(){O=!0,A(ie),E?.(e,{nodeId:o,handleId:a,handleType:L})}B===0&&te();function oe(Se){if(!O){const{x:et,y:jt}=Kn(Se),rt=et-Z,Et=jt-le;if(!(rt*rt+Et*Et>B*B))return;te()}if(!j()||!W){ve(Se);return}const he=N();$=Kn(Se,K),Y=ZA(xl($,he,!1,[1,1]),s,h,W),X||(F(),X=!0);const ge=p1(Se,{handle:Y,connectionMode:n,fromNodeId:o,fromHandleId:a,fromType:u?"target":"source",isValidConnection:C,doc:U,lib:p,flowId:g,nodeLookup:h});z=ge.handleDomNode,se=ge.connection,w=QA(!!Y,ge.isValid);const Ee=h.get(o),Ce=Ee?Ws(Ee,W,me.Left,!0):ie.from,Ie={...ie,from:Ce,isValid:w,to:ge.toHandle&&w?gl({x:ge.toHandle.x,y:ge.toHandle.y},he):$,toHandle:ge.toHandle,toPosition:w&&ge.toHandle?ge.toHandle.position:Z0[W.position],toNode:ge.toHandle?h.get(ge.toHandle.nodeId):null,pointer:$};A(Ie),ie=Ie}function ve(Se){if(!("touches"in Se&&Se.touches.length>0)){if(O){(Y||z)&&se&&w&&_?.(se);const{inProgress:he,...ge}=ie,Ee={...ge,toPosition:ie.toHandle?ie.toPosition:null};T?.(Se,Ee),c&&k?.(Se,Ee)}x(),cancelAnimationFrame(q),X=!1,w=!1,se=null,z=null,U.removeEventListener("mousemove",oe),U.removeEventListener("mouseup",ve),U.removeEventListener("touchmove",oe),U.removeEventListener("touchend",ve)}}U.addEventListener("mousemove",oe),U.addEventListener("mouseup",ve),U.addEventListener("touchmove",oe),U.addEventListener("touchend",ve)}function p1(e,{handle:n,connectionMode:s,fromNodeId:a,fromHandleId:o,fromType:c,doc:u,lib:d,flowId:h,isValidConnection:p=m1,nodeLookup:y}){const g=c==="target",v=n?u.querySelector(`.${d}-flow__handle[data-id="${h}-${n?.nodeId}-${n?.id}-${n?.type}"]`):null,{x,y:E}=Kn(e),_=u.elementFromPoint(x,E),T=_?.classList.contains(`${d}-flow__handle`)?_:v,C={handleDomNode:T,isValid:!1,connection:null,toHandle:null};if(T){const k=h1(void 0,T),A=T.getAttribute("data-nodeid"),N=T.getAttribute("data-handleid"),j=T.classList.contains("connectable"),D=T.classList.contains("connectableend");if(!A||!k)return C;const B={source:g?A:a,sourceHandle:g?N:o,target:g?a:A,targetHandle:g?o:N};C.connection=B;const U=j&&D&&(s===hl.Strict?g&&k==="source"||!g&&k==="target":A!==a||N!==o);C.isValid=U&&p(B),C.toHandle=d1(A,k,N,y,s,!0)}return C}const Ih={onPointerDown:FA,isValid:p1};function JA({domNode:e,panZoom:n,getTransform:s,getViewScale:a}){const o=pn(e);function c({translateExtent:d,width:h,height:p,zoomStep:y=1,pannable:g=!0,zoomable:v=!0,inversePan:x=!1}){const E=A=>{if(A.sourceEvent.type!=="wheel"||!n)return;const N=s(),j=A.sourceEvent.ctrlKey&&Wo()?10:1,D=-A.sourceEvent.deltaY*(A.sourceEvent.deltaMode===1?.05:A.sourceEvent.deltaMode?1:.002)*y,B=N[2]*Math.pow(2,D*j);n.scaleTo(B)};let _=[0,0];const T=A=>{(A.sourceEvent.type==="mousedown"||A.sourceEvent.type==="touchstart")&&(_=[A.sourceEvent.clientX??A.sourceEvent.touches[0].clientX,A.sourceEvent.clientY??A.sourceEvent.touches[0].clientY])},C=A=>{const N=s();if(A.sourceEvent.type!=="mousemove"&&A.sourceEvent.type!=="touchmove"||!n)return;const j=[A.sourceEvent.clientX??A.sourceEvent.touches[0].clientX,A.sourceEvent.clientY??A.sourceEvent.touches[0].clientY],D=[j[0]-_[0],j[1]-_[1]];_=j;const B=a()*Math.max(N[2],Math.log(N[2]))*(x?-1:1),R={x:N[0]-D[0]*B,y:N[1]-D[1]*B},U=[[0,0],[h,p]];n.setViewportConstrained({x:R.x,y:R.y,zoom:N[2]},U,d)},k=Vb().on("start",T).on("zoom",g?C:null).on("zoom.wheel",v?E:null);o.call(k,{})}function u(){o.on("zoom",null)}return{update:c,destroy:u,pointer:Vn}}const Au=e=>({x:e.x,y:e.y,zoom:e.k}),ch=({x:e,y:n,zoom:s})=>Eu.translate(e,n).scale(s),Fa=(e,n)=>e.target.closest(`.${n}`),g1=(e,n)=>n===2&&Array.isArray(e)&&e.includes(2),WA=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,uh=(e,n=0,s=WA,a=()=>{})=>{const o=typeof n=="number"&&n>0;return o||a(),o?e.transition().duration(n).ease(s).on("end",a):e},y1=e=>{const n=e.ctrlKey&&Wo()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*n};function PA({zoomPanValues:e,noWheelClassName:n,d3Selection:s,d3Zoom:a,panOnScrollMode:o,panOnScrollSpeed:c,zoomOnPinch:u,onPanZoomStart:d,onPanZoom:h,onPanZoomEnd:p}){return y=>{if(Fa(y,n))return y.ctrlKey&&y.preventDefault(),!1;y.preventDefault(),y.stopImmediatePropagation();const g=s.property("__zoom").k||1;if(y.ctrlKey&&u){const T=Vn(y),C=y1(y),k=g*Math.pow(2,C);a.scaleTo(s,k,T,y);return}const v=y.deltaMode===1?20:1;let x=o===Ks.Vertical?0:y.deltaX*v,E=o===Ks.Horizontal?0:y.deltaY*v;!Wo()&&y.shiftKey&&o!==Ks.Vertical&&(x=y.deltaY*v,E=0),a.translateBy(s,-(x/g)*c,-(E/g)*c,{internal:!0});const _=Au(s.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(h?.(y,_),e.panScrollTimeout=setTimeout(()=>{p?.(y,_),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,d?.(y,_))}}function eT({noWheelClassName:e,preventScrolling:n,d3ZoomHandler:s}){return function(a,o){const c=a.type==="wheel",u=!n&&c&&!a.ctrlKey,d=Fa(a,e);if(a.ctrlKey&&c&&d&&a.preventDefault(),u||d)return null;a.preventDefault(),s.call(this,a,o)}}function tT({zoomPanValues:e,onDraggingChange:n,onPanZoomStart:s}){return a=>{if(a.sourceEvent?.internal)return;const o=Au(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 nT({zoomPanValues:e,panOnDrag:n,onPaneContextMenu:s,onTransformChange:a,onPanZoom:o}){return c=>{e.usedRightMouseButton=!!(s&&g1(n,e.mouseButton??0)),c.sourceEvent?.sync||a([c.transform.x,c.transform.y,c.transform.k]),o&&!c.sourceEvent?.internal&&o?.(c.sourceEvent,Au(c.transform))}}function iT({zoomPanValues:e,panOnDrag:n,panOnScroll:s,onDraggingChange:a,onPanZoomEnd:o,onPaneContextMenu:c}){return u=>{if(!u.sourceEvent?.internal&&(e.isZoomingOrPanning=!1,c&&g1(n,e.mouseButton??0)&&!e.usedRightMouseButton&&u.sourceEvent&&c(u.sourceEvent),e.usedRightMouseButton=!1,a(!1),o)){const d=Au(u.transform);e.prevViewport=d,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{o?.(u.sourceEvent,d)},s?150:0)}}}function sT({zoomActivationKeyPressed:e,zoomOnScroll:n,zoomOnPinch:s,panOnDrag:a,panOnScroll:o,zoomOnDoubleClick:c,userSelectionActive:u,noWheelClassName:d,noPanClassName:h,lib:p,connectionInProgress:y}){return g=>{const v=e||n,x=s&&g.ctrlKey,E=g.type==="wheel";if(g.button===1&&g.type==="mousedown"&&(Fa(g,`${p}-flow__node`)||Fa(g,`${p}-flow__edge`)))return!0;if(!a&&!v&&!o&&!c&&!s||u||y&&!E||Fa(g,d)&&E||Fa(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(!v&&!o&&!x&&E||!a&&(g.type==="mousedown"||g.type==="touchstart")||Array.isArray(a)&&!a.includes(g.button)&&g.type==="mousedown")return!1;const _=Array.isArray(a)&&a.includes(g.button)||!g.button||g.button<=1;return(!g.ctrlKey||E)&&_}}function aT({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},y=e.getBoundingClientRect(),g=Vb().scaleExtent([n,s]).translateExtent(a),v=pn(e).call(g);k({x:o.x,y:o.y,zoom:ml(o.zoom,n,s)},[[0,0],[y.width,y.height]],a);const x=v.on("wheel.zoom"),E=v.on("dblclick.zoom");g.wheelDelta(y1);async function _(Y,Z){return v?new Promise(le=>{g?.interpolate(Z?.interpolate==="linear"?$o:Kc).transform(uh(v,Z?.duration,Z?.ease,()=>le(!0)),Y)}):!1}function T({noWheelClassName:Y,noPanClassName:Z,onPaneContextMenu:le,userSelectionActive:L,panOnScroll:K,panOnDrag:O,panOnScrollMode:H,panOnScrollSpeed:$,preventScrolling:X,zoomOnPinch:se,zoomOnScroll:w,zoomOnDoubleClick:z,zoomActivationKeyPressed:F,lib:W,onTransformChange:fe,connectionInProgress:de,paneClickDistance:ie,selectionOnDrag:te}){L&&!p.isZoomingOrPanning&&C();const oe=K&&!F&&!L;g.clickDistance(te?1/0:!Xn(ie)||ie<0?0:ie);const ve=oe?PA({zoomPanValues:p,noWheelClassName:Y,d3Selection:v,d3Zoom:g,panOnScrollMode:H,panOnScrollSpeed:$,zoomOnPinch:se,onPanZoomStart:u,onPanZoom:c,onPanZoomEnd:d}):eT({noWheelClassName:Y,preventScrolling:X,d3ZoomHandler:x});v.on("wheel.zoom",ve,{passive:!1});const Se=tT({zoomPanValues:p,onDraggingChange:h,onPanZoomStart:u});g.on("start",Se);const he=nT({zoomPanValues:p,panOnDrag:O,onPaneContextMenu:!!le,onPanZoom:c,onTransformChange:fe});g.on("zoom",he);const ge=iT({zoomPanValues:p,panOnDrag:O,panOnScroll:K,onPaneContextMenu:le,onPanZoomEnd:d,onDraggingChange:h});g.on("end",ge);const Ee=sT({zoomActivationKeyPressed:F,panOnDrag:O,zoomOnScroll:w,panOnScroll:K,zoomOnDoubleClick:z,zoomOnPinch:se,userSelectionActive:L,noPanClassName:Z,noWheelClassName:Y,lib:W,connectionInProgress:de});g.filter(Ee),z?v.on("dblclick.zoom",E):v.on("dblclick.zoom",null)}function C(){g.on("zoom",null)}async function k(Y,Z,le){const L=ch(Y),K=g?.constrain()(L,Z,le);return K&&await _(K),K}async function A(Y,Z){const le=ch(Y);return await _(le,Z),le}function N(Y){if(v){const Z=ch(Y),le=v.property("__zoom");(le.k!==Y.zoom||le.x!==Y.x||le.y!==Y.y)&&g?.transform(v,Z,null,{sync:!0})}}function j(){const Y=v?qb(v.node()):{x:0,y:0,k:1};return{x:Y.x,y:Y.y,zoom:Y.k}}async function D(Y,Z){return v?new Promise(le=>{g?.interpolate(Z?.interpolate==="linear"?$o:Kc).scaleTo(uh(v,Z?.duration,Z?.ease,()=>le(!0)),Y)}):!1}async function B(Y,Z){return v?new Promise(le=>{g?.interpolate(Z?.interpolate==="linear"?$o:Kc).scaleBy(uh(v,Z?.duration,Z?.ease,()=>le(!0)),Y)}):!1}function R(Y){g?.scaleExtent(Y)}function U(Y){g?.translateExtent(Y)}function q(Y){const Z=!Xn(Y)||Y<0?0:Y;g?.clickDistance(Z)}return{update:T,destroy:C,setViewport:A,setViewportConstrained:k,getViewport:j,scaleTo:D,scaleBy:B,setScaleExtent:R,setTranslateExtent:U,syncViewport:N,setClickDistance:q}}var yl;(function(e){e.Line="line",e.Handle="handle"})(yl||(yl={}));function lT({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 ov(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 ps(e,n){return Math.max(0,n-e)}function gs(e,n){return Math.max(0,e-n)}function Lc(e,n,s){return Math.max(0,n-e,e-s)}function rv(e,n){return e?!n:n}function oT(e,n,s,a,o,c,u,d){let{affectsX:h,affectsY:p}=n;const{isHorizontal:y,isVertical:g}=n,v=y&&g,{xSnapped:x,ySnapped:E}=s,{minWidth:_,maxWidth:T,minHeight:C,maxHeight:k}=a,{x:A,y:N,width:j,height:D,aspectRatio:B}=e;let R=Math.floor(y?x-e.pointerX:0),U=Math.floor(g?E-e.pointerY:0);const q=j+(h?-R:R),Y=D+(p?-U:U),Z=-c[0]*j,le=-c[1]*D;let L=Lc(q,_,T),K=Lc(Y,C,k);if(u){let $=0,X=0;h&&R<0?$=ps(A+R+Z,u[0][0]):!h&&R>0&&($=gs(A+q+Z,u[1][0])),p&&U<0?X=ps(N+U+le,u[0][1]):!p&&U>0&&(X=gs(N+Y+le,u[1][1])),L=Math.max(L,$),K=Math.max(K,X)}if(d){let $=0,X=0;h&&R>0?$=gs(A+R,d[0][0]):!h&&R<0&&($=ps(A+q,d[1][0])),p&&U>0?X=gs(N+U,d[0][1]):!p&&U<0&&(X=ps(N+Y,d[1][1])),L=Math.max(L,$),K=Math.max(K,X)}if(o){if(y){const $=Lc(q/B,C,k)*B;if(L=Math.max(L,$),u){let X=0;!h&&!p||h&&!p&&v?X=gs(N+le+q/B,u[1][1])*B:X=ps(N+le+(h?R:-R)/B,u[0][1])*B,L=Math.max(L,X)}if(d){let X=0;!h&&!p||h&&!p&&v?X=ps(N+q/B,d[1][1])*B:X=gs(N+(h?R:-R)/B,d[0][1])*B,L=Math.max(L,X)}}if(g){const $=Lc(Y*B,_,T)/B;if(K=Math.max(K,$),u){let X=0;!h&&!p||p&&!h&&v?X=gs(A+Y*B+Z,u[1][0])/B:X=ps(A+(p?U:-U)*B+Z,u[0][0])/B,K=Math.max(K,X)}if(d){let X=0;!h&&!p||p&&!h&&v?X=ps(A+Y*B,d[1][0])/B:X=gs(A+(p?U:-U)*B,d[0][0])/B,K=Math.max(K,X)}}}U=U+(U<0?K:-K),R=R+(R<0?L:-L),o&&(v?q>Y*B?U=(rv(h,p)?-R:R)/B:R=(rv(h,p)?-U:U)*B:y?(U=R/B,p=h):(R=U*B,h=p));const O=h?A+R:A,H=p?N+U:N;return{width:j+(h?-R:R),height:D+(p?-U:U),x:c[0]*R*(h?-1:1)+O,y:c[1]*U*(p?-1:1)+H}}const v1={width:0,height:0,x:0,y:0},rT={...v1,pointerX:0,pointerY:0,aspectRatio:1};function cT(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 uT({domNode:e,nodeId:n,getStoreItems:s,onChange:a,onEnd:o}){const c=pn(e);let u={controlDirection:ov("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:y,keepAspectRatio:g,resizeDirection:v,onResizeStart:x,onResize:E,onResizeEnd:_,shouldResize:T}){let C={...v1},k={...rT};u={boundaries:y,resizeDirection:v,keepAspectRatio:g,controlDirection:ov(p)};let A,N=null,j=[],D,B,R,U=!1;const q=Cb().on("start",Y=>{const{nodeLookup:Z,transform:le,snapGrid:L,snapToGrid:K,nodeOrigin:O,paneDomNode:H}=s();if(A=Z.get(n),!A)return;N=H?.getBoundingClientRect()??null;const{xSnapped:$,ySnapped:X}=Ho(Y.sourceEvent,{transform:le,snapGrid:L,snapToGrid:K,containerBounds:N});C={width:A.measured.width??0,height:A.measured.height??0,x:A.position.x??0,y:A.position.y??0},k={...C,pointerX:$,pointerY:X,aspectRatio:C.width/C.height},D=void 0,B=Js(A.extent)?A.extent:void 0,A.parentId&&(A.extent==="parent"||A.expandParent)&&(D=Z.get(A.parentId)),D&&A.extent==="parent"&&(B=[[0,0],[D.measured.width,D.measured.height]]),j=[],R=void 0;for(const[se,w]of Z)if(w.parentId===n&&(j.push({id:se,position:{...w.position},extent:w.extent}),w.extent==="parent"||w.expandParent)){const z=cT(w,A,w.origin??O);R?R=[[Math.min(z[0][0],R[0][0]),Math.min(z[0][1],R[0][1])],[Math.max(z[1][0],R[1][0]),Math.max(z[1][1],R[1][1])]]:R=z}x?.(Y,{...C})}).on("drag",Y=>{const{transform:Z,snapGrid:le,snapToGrid:L,nodeOrigin:K}=s(),O=Ho(Y.sourceEvent,{transform:Z,snapGrid:le,snapToGrid:L,containerBounds:N}),H=[];if(!A)return;const{x:$,y:X,width:se,height:w}=C,z={},F=A.origin??K,{width:W,height:fe,x:de,y:ie}=oT(k,u.controlDirection,O,u.boundaries,u.keepAspectRatio,F,B,R),te=W!==se,oe=fe!==w,ve=de!==$&&te,Se=ie!==X&&oe;if(!ve&&!Se&&!te&&!oe)return;if((ve||Se||F[0]===1||F[1]===1)&&(z.x=ve?de:C.x,z.y=Se?ie:C.y,C.x=z.x,C.y=z.y,j.length>0)){const Ce=de-$,Ie=ie-X;for(const et of j)et.position={x:et.position.x-Ce+F[0]*(W-se),y:et.position.y-Ie+F[1]*(fe-w)},H.push(et)}if((te||oe)&&(z.width=te&&(!u.resizeDirection||u.resizeDirection==="horizontal")?W:C.width,z.height=oe&&(!u.resizeDirection||u.resizeDirection==="vertical")?fe:C.height,C.width=z.width,C.height=z.height),D&&A.expandParent){const Ce=F[0]*(z.width??0);z.x&&z.x<Ce&&(C.x=Ce,k.x=k.x-(z.x-Ce));const Ie=F[1]*(z.height??0);z.y&&z.y<Ie&&(C.y=Ie,k.y=k.y-(z.y-Ie))}const he=lT({width:C.width,prevWidth:se,height:C.height,prevHeight:w,affectsX:u.controlDirection.affectsX,affectsY:u.controlDirection.affectsY}),ge={...C,direction:he};T?.(Y,ge)!==!1&&(U=!0,E?.(Y,ge),a(z,H))}).on("end",Y=>{U&&(_?.(Y,{...C}),o?.({...C}),U=!1)});c.call(q)}function h(){c.on(".drag",null)}return{update:d,destroy:h}}var fh={exports:{}},dh={},hh={exports:{}},mh={};var cv;function fT(){if(cv)return mh;cv=1;var e=lr();function n(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var s=typeof Object.is=="function"?Object.is:n,a=e.useState,o=e.useEffect,c=e.useLayoutEffect,u=e.useDebugValue;function d(g,v){var x=v(),E=a({inst:{value:x,getSnapshot:v}}),_=E[0].inst,T=E[1];return c(function(){_.value=x,_.getSnapshot=v,h(_)&&T({inst:_})},[g,x,v]),o(function(){return h(_)&&T({inst:_}),g(function(){h(_)&&T({inst:_})})},[g]),u(x),x}function h(g){var v=g.getSnapshot;g=g.value;try{var x=v();return!s(g,x)}catch{return!0}}function p(g,v){return v()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:d;return mh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,mh}var uv;function dT(){return uv||(uv=1,hh.exports=fT()),hh.exports}var fv;function hT(){if(fv)return dh;fv=1;var e=lr(),n=dT();function s(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}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 dh.useSyncExternalStoreWithSelector=function(p,y,g,v,x){var E=c(null);if(E.current===null){var _={hasValue:!1,value:null};E.current=_}else _=E.current;E=d(function(){function C(D){if(!k){if(k=!0,A=D,D=v(D),x!==void 0&&_.hasValue){var B=_.value;if(x(B,D))return N=B}return N=D}if(B=N,a(A,D))return B;var R=v(D);return x!==void 0&&x(B,R)?(A=D,B):(A=D,N=R)}var k=!1,A,N,j=g===void 0?null:g;return[function(){return C(y())},j===null?void 0:function(){return C(j())}]},[y,g,v,x]);var T=o(p,E[0],E[1]);return u(function(){_.hasValue=!0,_.value=T},[T]),h(T),T},dh}var dv;function mT(){return dv||(dv=1,fh.exports=hT()),fh.exports}var pT=mT();const gT=db(pT),yT={},hv=e=>{let n;const s=new Set,a=(y,g)=>{const v=typeof y=="function"?y(n):y;if(!Object.is(v,n)){const x=n;n=g??(typeof v!="object"||v===null)?v:Object.assign({},n,v),s.forEach(E=>E(n,x))}},o=()=>n,h={setState:a,getState:o,getInitialState:()=>p,subscribe:y=>(s.add(y),()=>s.delete(y)),destroy:()=>{(yT?"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},vT=e=>e?hv(e):hv,{useDebugValue:bT}=wl,{useSyncExternalStoreWithSelector:ST}=gT,wT=e=>e;function b1(e,n=wT,s){const a=ST(e.subscribe,e.getState,e.getServerState||e.getInitialState,n,s);return bT(a),a}const mv=(e,n)=>{const s=vT(e),a=(o,c=n)=>b1(s,o,c);return Object.assign(a,s),a},xT=(e,n)=>e?mv(e,n):mv;function it(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 ET=hb();const Tu=V.createContext(null),NT=Tu.Provider,S1=Qn.error001("react");function Re(e,n){const s=V.useContext(Tu);if(s===null)throw new Error(S1);return b1(s,e,n)}function at(){const e=V.useContext(Tu);if(e===null)throw new Error(S1);return V.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const pv={display:"none"},_T={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},w1="react-flow__node-desc",x1="react-flow__edge-desc",AT="react-flow__aria-live",TT=e=>e.ariaLiveMessage,CT=e=>e.ariaLabelConfig;function MT({rfId:e}){const n=Re(TT);return b.jsx("div",{id:`${AT}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:_T,children:n})}function OT({rfId:e,disableKeyboardA11y:n}){const s=Re(CT);return b.jsxs(b.Fragment,{children:[b.jsx("div",{id:`${w1}-${e}`,style:pv,children:n?s["node.a11yDescription.default"]:s["node.a11yDescription.keyboardDisabled"]}),b.jsx("div",{id:`${x1}-${e}`,style:pv,children:s["edge.a11yDescription.default"]}),!n&&b.jsx(MT,{rfId:e})]})}const Cu=V.forwardRef(({position:e="top-left",children:n,className:s,style:a,...o},c)=>{const u=`${e}`.split("-");return b.jsx("div",{className:xt(["react-flow__panel",s,...u]),style:a,ref:c,...o,children:n})});Cu.displayName="Panel";function kT({proOptions:e,position:n="bottom-right"}){return e?.hideAttribution?null:b.jsx(Cu,{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:b.jsx("a",{href:"https://reactflow.dev",target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const zT=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}},$c=e=>e.id;function DT(e,n){return it(e.selectedNodes.map($c),n.selectedNodes.map($c))&&it(e.selectedEdges.map($c),n.selectedEdges.map($c))}function jT({onSelectionChange:e}){const n=at(),{selectedNodes:s,selectedEdges:a}=Re(zT,DT);return V.useEffect(()=>{const o={nodes:s,edges:a};e?.(o),n.getState().onSelectionChangeHandlers.forEach(c=>c(o))},[s,a,e]),null}const RT=e=>!!e.onSelectionChangeHandlers;function BT({onSelectionChange:e}){const n=Re(RT);return e||n?b.jsx(jT,{onSelectionChange:e}):null}const E1=[0,0],LT={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"],gv=[...$T,"rfId"],HT=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}),yv={translateExtent:Zo,nodeOrigin:E1,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function UT(e){const{setNodes:n,setEdges:s,setMinZoom:a,setMaxZoom:o,setTranslateExtent:c,setNodeExtent:u,reset:d,setDefaultNodesAndEdges:h}=Re(HT,it),p=at();V.useEffect(()=>(h(e.defaultNodes,e.defaultEdges),()=>{y.current=yv,d()}),[]);const y=V.useRef(yv);return V.useEffect(()=>{for(const g of gv){const v=e[g],x=y.current[g];v!==x&&(typeof e[g]>"u"||(g==="nodes"?n(v):g==="edges"?s(v):g==="minZoom"?a(v):g==="maxZoom"?o(v):g==="translateExtent"?c(v):g==="nodeExtent"?u(v):g==="ariaLabelConfig"?p.setState({ariaLabelConfig:EA(v)}):g==="fitView"?p.setState({fitViewQueued:v}):g==="fitViewOptions"?p.setState({fitViewOptions:v}):p.setState({[g]:v})))}y.current=e},gv.map(g=>e[g])),null}function vv(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function IT(e){const[n,s]=V.useState(e==="system"?null:e);return V.useEffect(()=>{if(e!=="system"){s(e);return}const a=vv(),o=()=>s(a?.matches?"dark":"light");return o(),a?.addEventListener("change",o),()=>{a?.removeEventListener("change",o)}},[e]),n!==null?n:vv()?.matches?"dark":"light"}const bv=typeof document<"u"?document:null;function Po(e=null,n={target:bv,actInsideInputWithModifier:!0}){const[s,a]=V.useState(!1),o=V.useRef(!1),c=V.useRef(new Set([])),[u,d]=V.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
+ `)),y=p.reduce((g,v)=>g.concat(...v),[]);return[p,y]}return[[],[]]},[e]);return V.useEffect(()=>{const h=n?.target??bv,p=n?.actInsideInputWithModifier??!0;if(e!==null){const y=x=>{if(o.current=x.ctrlKey||x.metaKey||x.shiftKey||x.altKey,(!o.current||o.current&&!p)&&n1(x))return!1;const _=wv(x.code,d);if(c.current.add(x[_]),Sv(u,c.current,!1)){const T=x.composedPath?.()?.[0]||x.target,C=T?.nodeName==="BUTTON"||T?.nodeName==="A";n.preventDefault!==!1&&(o.current||!C)&&x.preventDefault(),a(!0)}},g=x=>{const E=wv(x.code,d);Sv(u,c.current,!0)?(a(!1),c.current.clear()):c.current.delete(x[E]),x.key==="Meta"&&c.current.clear(),o.current=!1},v=()=>{c.current.clear(),a(!1)};return h?.addEventListener("keydown",y),h?.addEventListener("keyup",g),window.addEventListener("blur",v),window.addEventListener("contextmenu",v),()=>{h?.removeEventListener("keydown",y),h?.removeEventListener("keyup",g),window.removeEventListener("blur",v),window.removeEventListener("contextmenu",v)}}},[e,a]),s}function Sv(e,n,s){return e.filter(a=>s||a.length===n.size).some(a=>a.every(o=>n.has(o)))}function wv(e,n){return n.includes(e)?"code":"key"}const qT=()=>{const e=at();return V.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=dm(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},y=s.snapGrid??o,g=s.snapToGrid??c;return xl(p,a,g,y)},flowToScreenPosition:n=>{const{transform:s,domNode:a}=e.getState();if(!a)return n;const{x:o,y:c}=a.getBoundingClientRect(),u=gl(n,s);return{x:u.x+o,y:u.y+c}}}),[])};function N1(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)VT(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 VT(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 YT(e,n){return N1(e,n)}function GT(e,n){return N1(e,n)}function Is(e,n){return{id:e,type:"select",selected:n}}function Ja(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(Is(c.id,u)))}return a}function xv({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 Ev(e){return{id:e.id,type:"remove"}}const XT=Wb();function KT(e,n,s={}){return MA(e,n,{...s,onError:s.onError??XT})}const Nv=e=>mA(e),ZT=e=>Zb(e);function _1(e){return V.forwardRef(e)}const QT=typeof window<"u"?V.useLayoutEffect:V.useEffect;function _v(e){const[n,s]=V.useState(BigInt(0)),[a]=V.useState(()=>FT(()=>s(o=>o+BigInt(1))));return QT(()=>{const o=a.get();o.length&&(e(o),a.reset())},[n]),a}function FT(e){let n=[];return{get:()=>n,reset:()=>{n=[]},push:s=>{n.push(s),e()}}}const A1=V.createContext(null);function JT({children:e}){const n=at(),s=V.useCallback(d=>{const{nodes:h=[],setNodes:p,hasDefaultNodes:y,onNodesChange:g,nodeLookup:v,fitViewQueued:x,onNodesChangeMiddlewareMap:E}=n.getState();let _=h;for(const C of d)_=typeof C=="function"?C(_):C;let T=xv({items:_,lookup:v});for(const C of E.values())T=C(T);y&&p(_),T.length>0?g?.(T):x&&window.requestAnimationFrame(()=>{const{fitViewQueued:C,nodes:k,setNodes:A}=n.getState();C&&A(k)})},[]),a=_v(s),o=V.useCallback(d=>{const{edges:h=[],setEdges:p,hasDefaultEdges:y,onEdgesChange:g,edgeLookup:v}=n.getState();let x=h;for(const E of d)x=typeof E=="function"?E(x):E;y?p(x):g&&g(xv({items:x,lookup:v}))},[]),c=_v(o),u=V.useMemo(()=>({nodeQueue:a,edgeQueue:c}),[]);return b.jsx(A1.Provider,{value:u,children:e})}function WT(){const e=V.useContext(A1);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const PT=e=>!!e.panZoom;function dr(){const e=qT(),n=at(),s=WT(),a=Re(PT),o=V.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:v,nodeOrigin:x}=n.getState(),E=Nv(g)?g:v.get(g.id),_=E.parentId?e1(E.position,E.measured,E.parentId,v,x):E.position,T={...E,position:_,width:E.measured?.width??E.width,height:E.measured?.height??E.height};return pl(T)},p=(g,v,x={replace:!1})=>{u(E=>E.map(_=>{if(_.id===g){const T=typeof v=="function"?v(_):v;return x.replace&&Nv(T)?T:{..._,...T}}return _}))},y=(g,v,x={replace:!1})=>{d(E=>E.map(_=>{if(_.id===g){const T=typeof v=="function"?v(_):v;return x.replace&&ZT(T)?T:{..._,...T}}return _}))};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(v=>({...v}))},getEdge:g=>n.getState().edgeLookup.get(g),setNodes:u,setEdges:d,addNodes:g=>{const v=Array.isArray(g)?g:[g];s.nodeQueue.push(x=>[...x,...v])},addEdges:g=>{const v=Array.isArray(g)?g:[g];s.edgeQueue.push(x=>[...x,...v])},toObject:()=>{const{nodes:g=[],edges:v=[],transform:x}=n.getState(),[E,_,T]=x;return{nodes:g.map(C=>({...C})),edges:v.map(C=>({...C})),viewport:{x:E,y:_,zoom:T}}},deleteElements:async({nodes:g=[],edges:v=[]})=>{const{nodes:x,edges:E,onNodesDelete:_,onEdgesDelete:T,triggerNodeChanges:C,triggerEdgeChanges:k,onDelete:A,onBeforeDelete:N}=n.getState(),{nodes:j,edges:D}=await bA({nodesToRemove:g,edgesToRemove:v,nodes:x,edges:E,onBeforeDelete:N}),B=D.length>0,R=j.length>0;if(B){const U=D.map(Ev);T?.(D),k(U)}if(R){const U=j.map(Ev);_?.(j),C(U)}return(R||B)&&A?.({nodes:j,edges:D}),{deletedNodes:j,deletedEdges:D}},getIntersectingNodes:(g,v=!0,x)=>{const E=F0(g),_=E?g:h(g),T=x!==void 0;return _?(x||n.getState().nodes).filter(C=>{const k=n.getState().nodeLookup.get(C.id);if(k&&!E&&(C.id===g.id||!k.internals.positionAbsolute))return!1;const A=pl(T?C:k),N=Jo(A,_);return v&&N>0||N>=A.width*A.height||N>=_.width*_.height}):[]},isNodeIntersecting:(g,v,x=!0)=>{const _=F0(g)?g:h(g);if(!_)return!1;const T=Jo(_,v);return x&&T>0||T>=v.width*v.height||T>=_.width*_.height},updateNode:p,updateNodeData:(g,v,x={replace:!1})=>{p(g,E=>{const _=typeof v=="function"?v(E):v;return x.replace?{...E,data:_}:{...E,data:{...E.data,..._}}},x)},updateEdge:y,updateEdgeData:(g,v,x={replace:!1})=>{y(g,E=>{const _=typeof v=="function"?v(E):v;return x.replace?{...E,data:_}:{...E,data:{...E.data,..._}}},x)},getNodesBounds:g=>{const{nodeLookup:v,nodeOrigin:x}=n.getState();return pA(g,{nodeLookup:v,nodeOrigin:x})},getHandleConnections:({type:g,id:v,nodeId:x})=>Array.from(n.getState().connectionLookup.get(`${x}-${g}${v?`-${v}`:""}`)?.values()??[]),getNodeConnections:({type:g,handleId:v,nodeId:x})=>Array.from(n.getState().connectionLookup.get(`${x}${g?v?`-${g}-${v}`:`-${g}`:""}`)?.values()??[]),fitView:async g=>{const v=n.getState().fitViewResolver??xA();return n.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:v}),s.nodeQueue.push(x=>[...x]),v.promise}}},[]);return V.useMemo(()=>({...o,...e,viewportInitialized:a}),[a])}const Av=e=>e.selected,eC=typeof window<"u"?window:void 0;function tC({deleteKeyCode:e,multiSelectionKeyCode:n}){const s=at(),{deleteElements:a}=dr(),o=Po(e,{actInsideInputWithModifier:!1}),c=Po(n,{target:eC});V.useEffect(()=>{if(o){const{edges:u,nodes:d}=s.getState();a({nodes:d.filter(Av),edges:u.filter(Av)}),s.setState({nodesSelectionActive:!1})}},[o]),V.useEffect(()=>{s.setState({multiSelectionActive:c})},[c])}function nC(e){const n=at();V.useEffect(()=>{const s=()=>{if(!e.current||!(e.current.checkVisibility?.()??!0))return!1;const a=hm(e.current);(a.height===0||a.width===0)&&n.getState().onError?.("004",Qn.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 Mu={position:"absolute",width:"100%",height:"100%",top:0,left:0},iC=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function sC({onPaneContextMenu:e,zoomOnScroll:n=!0,zoomOnPinch:s=!0,panOnScroll:a=!1,panOnScrollSpeed:o=.5,panOnScrollMode:c=Ks.Free,zoomOnDoubleClick:u=!0,panOnDrag:d=!0,defaultViewport:h,translateExtent:p,minZoom:y,maxZoom:g,zoomActivationKeyCode:v,preventScrolling:x=!0,children:E,noWheelClassName:_,noPanClassName:T,onViewportChange:C,isControlledViewport:k,paneClickDistance:A,selectionOnDrag:N}){const j=at(),D=V.useRef(null),{userSelectionActive:B,lib:R,connectionInProgress:U}=Re(iC,it),q=Po(v),Y=V.useRef();nC(D);const Z=V.useCallback(le=>{C?.({x:le[0],y:le[1],zoom:le[2]}),k||j.setState({transform:le})},[C,k]);return V.useEffect(()=>{if(D.current){Y.current=aT({domNode:D.current,minZoom:y,maxZoom:g,translateExtent:p,viewport:h,onDraggingChange:O=>j.setState(H=>H.paneDragging===O?H:{paneDragging:O}),onPanZoomStart:(O,H)=>{const{onViewportChangeStart:$,onMoveStart:X}=j.getState();X?.(O,H),$?.(H)},onPanZoom:(O,H)=>{const{onViewportChange:$,onMove:X}=j.getState();X?.(O,H),$?.(H)},onPanZoomEnd:(O,H)=>{const{onViewportChangeEnd:$,onMoveEnd:X}=j.getState();X?.(O,H),$?.(H)}});const{x:le,y:L,zoom:K}=Y.current.getViewport();return j.setState({panZoom:Y.current,transform:[le,L,K],domNode:D.current.closest(".react-flow")}),()=>{Y.current?.destroy()}}},[]),V.useEffect(()=>{Y.current?.update({onPaneContextMenu:e,zoomOnScroll:n,zoomOnPinch:s,panOnScroll:a,panOnScrollSpeed:o,panOnScrollMode:c,zoomOnDoubleClick:u,panOnDrag:d,zoomActivationKeyPressed:q,preventScrolling:x,noPanClassName:T,userSelectionActive:B,noWheelClassName:_,lib:R,onTransformChange:Z,connectionInProgress:U,selectionOnDrag:N,paneClickDistance:A})},[e,n,s,a,o,c,u,d,q,x,T,B,_,R,Z,U,N,A]),b.jsx("div",{className:"react-flow__renderer",ref:D,style:Mu,children:E})}const aC=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function lC(){const{userSelectionActive:e,userSelectionRect:n}=Re(aC,it);return e&&n?b.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 ph=(e,n)=>s=>{s.target===n.current&&e?.(s)},oC=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,connectionInProgress:e.connection.inProgress,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function rC({isSelecting:e,selectionKeyPressed:n,selectionMode:s=Qo.Full,panOnDrag:a,autoPanOnSelection:o,paneClickDistance:c,selectionOnDrag:u,onSelectionStart:d,onSelectionEnd:h,onPaneClick:p,onPaneContextMenu:y,onPaneScroll:g,onPaneMouseEnter:v,onPaneMouseMove:x,onPaneMouseLeave:E,children:_}){const T=V.useRef(0),C=at(),{userSelectionActive:k,elementsSelectable:A,dragging:N,connectionInProgress:j,panBy:D,autoPanSpeed:B}=Re(oC,it),R=A&&(e||k),U=V.useRef(null),q=V.useRef(),Y=V.useRef(new Set),Z=V.useRef(new Set),le=V.useRef(!1),L=V.useRef({x:0,y:0}),K=V.useRef(!1),O=te=>{if(le.current||j){le.current=!1;return}p?.(te),C.getState().resetSelectedElements(),C.setState({nodesSelectionActive:!1})},H=te=>{if(Array.isArray(a)&&a?.includes(2)){te.preventDefault();return}y?.(te)},$=g?te=>g(te):void 0,X=te=>{le.current&&(te.stopPropagation(),le.current=!1)},se=te=>{const{domNode:oe,transform:ve}=C.getState();if(q.current=oe?.getBoundingClientRect(),!q.current)return;const Se=te.target===U.current;if(!Se&&!!te.target.closest(".nokey")||!e||!(u&&Se||n)||te.button!==0||!te.isPrimary)return;te.target?.setPointerCapture?.(te.pointerId),le.current=!1;const{x:Ee,y:Ce}=Kn(te.nativeEvent,q.current),Ie=xl({x:Ee,y:Ce},ve);C.setState({userSelectionRect:{width:0,height:0,startX:Ie.x,startY:Ie.y,x:Ee,y:Ce}}),Se||(te.stopPropagation(),te.preventDefault())};function w(te,oe){const{userSelectionRect:ve}=C.getState();if(!ve)return;const{transform:Se,nodeLookup:he,edgeLookup:ge,connectionLookup:Ee,triggerNodeChanges:Ce,triggerEdgeChanges:Ie,defaultEdgeOptions:et}=C.getState(),jt={x:ve.startX,y:ve.startY},{x:rt,y:Et}=gl(jt,Se),Rt={startX:jt.x,startY:jt.y,x:te<rt?te:rt,y:oe<Et?oe:Et,width:Math.abs(te-rt),height:Math.abs(oe-Et)},jn=Y.current,Ct=Z.current;Y.current=new Set(um(he,Rt,Se,s===Qo.Partial,!0).map(ft=>ft.id)),Z.current=new Set;const Ze=et?.selectable??!0;for(const ft of Y.current){const Vt=Ee.get(ft);if(Vt)for(const{edgeId:Ut}of Vt.values()){const Bt=ge.get(Ut);Bt&&(Bt.selectable??Ze)&&Z.current.add(Ut)}}if(!J0(jn,Y.current)){const ft=Ja(he,Y.current,!0);Ce(ft)}if(!J0(Ct,Z.current)){const ft=Ja(ge,Z.current);Ie(ft)}C.setState({userSelectionRect:Rt,userSelectionActive:!0,nodesSelectionActive:!1})}function z(){if(!o||!q.current)return;const[te,oe]=fm(L.current,q.current,B);D({x:te,y:oe}).then(ve=>{if(!le.current||!ve){T.current=requestAnimationFrame(z);return}const{x:Se,y:he}=L.current;w(Se,he),T.current=requestAnimationFrame(z)})}const F=()=>{cancelAnimationFrame(T.current),T.current=0,K.current=!1};V.useEffect(()=>()=>F(),[]);const W=te=>{const{userSelectionRect:oe,transform:ve,resetSelectedElements:Se}=C.getState();if(!q.current||!oe)return;const{x:he,y:ge}=Kn(te.nativeEvent,q.current);L.current={x:he,y:ge};const Ee=gl({x:oe.startX,y:oe.startY},ve);if(!le.current){const Ce=n?0:c;if(Math.hypot(he-Ee.x,ge-Ee.y)<=Ce)return;Se(),d?.(te)}le.current=!0,K.current||(z(),K.current=!0),w(he,ge)},fe=te=>{te.button===0&&(te.target?.releasePointerCapture?.(te.pointerId),!k&&te.target===U.current&&C.getState().userSelectionRect&&O?.(te),C.setState({userSelectionActive:!1,userSelectionRect:null}),le.current&&(h?.(te),C.setState({nodesSelectionActive:Y.current.size>0})),F())},de=te=>{te.target?.releasePointerCapture?.(te.pointerId),F()},ie=a===!0||Array.isArray(a)&&a.includes(0);return b.jsxs("div",{className:xt(["react-flow__pane",{draggable:ie,dragging:N,selection:e}]),onClick:R?void 0:ph(O,U),onContextMenu:ph(H,U),onWheel:ph($,U),onPointerEnter:R?void 0:v,onPointerMove:R?W:x,onPointerUp:R?fe:void 0,onPointerCancel:R?de:void 0,onPointerDownCapture:R?se:void 0,onClickCapture:R?X:void 0,onPointerLeave:E,ref:U,style:Mu,children:[_,b.jsx(lC,{})]})}function qh({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",Qn.error012(e));return}n.setState({nodesSelectionActive:!1}),p.selected?(s||p.selected&&u)&&(c({nodes:[p],edges:[]}),requestAnimationFrame(()=>a?.current?.blur())):o([e])}function T1({nodeRef:e,disabled:n=!1,noDragClassName:s,handleSelector:a,nodeId:o,isSelectable:c,nodeClickDistance:u}){const d=at(),[h,p]=V.useState(!1),y=V.useRef();return V.useEffect(()=>{y.current=GA({getStoreItems:()=>d.getState(),onNodeMouseDown:g=>{qh({id:g,store:d,nodeRef:e})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),V.useEffect(()=>{if(!(n||!e.current||!y.current))return y.current.update({noDragClassName:s,handleSelector:a,domNode:e.current,isSelectable:c,nodeId:o,nodeClickDistance:u}),()=>{y.current?.destroy()}},[s,a,n,c,e,o,u]),h}const cC=e=>n=>n.selected&&(n.draggable||e&&typeof n.draggable>"u");function C1(){const e=at();return V.useCallback(s=>{const{nodeExtent:a,snapToGrid:o,snapGrid:c,nodesDraggable:u,onError:d,updateNodePositions:h,nodeLookup:p,nodeOrigin:y}=e.getState(),g=new Map,v=cC(u),x=o?c[0]:5,E=o?c[1]:5,_=s.direction.x*x*s.factor,T=s.direction.y*E*s.factor;for(const[,C]of p){if(!v(C))continue;let k={x:C.internals.positionAbsolute.x+_,y:C.internals.positionAbsolute.y+T};o&&(k=fr(k,c));const{position:A,positionAbsolute:N}=Qb({nodeId:C.id,nextPosition:k,nodeLookup:p,nodeExtent:a,nodeOrigin:y,onError:d});C.position=A,C.internals.positionAbsolute=N,g.set(C.id,C)}h(g)},[])}const bm=V.createContext(null),uC=bm.Provider;bm.Consumer;const M1=()=>V.useContext(bm),fC=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),dC=(e,n,s)=>a=>{const{connectionClickStartHandle:o,connectionMode:c,connection:u}=a,{fromHandle:d,toHandle:h,isValid:p}=u,y=h?.nodeId===e&&h?.id===n&&h?.type===s;return{connectingFrom:d?.nodeId===e&&d?.id===n&&d?.type===s,connectingTo:y,clickConnecting:o?.nodeId===e&&o?.id===n&&o?.type===s,isPossibleEndHandle:c===hl.Strict?d?.type!==s:e!==d?.nodeId||n!==d?.id,connectionInProcess:!!d,clickConnectionInProcess:!!o,valid:y&&p}};function hC({type:e="source",position:n=me.Top,isValidConnection:s,isConnectable:a=!0,isConnectableStart:o=!0,isConnectableEnd:c=!0,id:u,onConnect:d,children:h,className:p,onMouseDown:y,onTouchStart:g,...v},x){const E=u||null,_=e==="target",T=at(),C=M1(),{connectOnClick:k,noPanClassName:A,rfId:N}=Re(fC,it),{connectingFrom:j,connectingTo:D,clickConnecting:B,isPossibleEndHandle:R,connectionInProcess:U,clickConnectionInProcess:q,valid:Y}=Re(dC(C,E,e),it);C||T.getState().onError?.("010",Qn.error010());const Z=K=>{const{defaultEdgeOptions:O,onConnect:H,hasDefaultEdges:$}=T.getState(),X={...O,...K};if($){const{edges:se,setEdges:w,onError:z}=T.getState();w(KT(X,se,{onError:z}))}H?.(X),d?.(X)},le=K=>{if(!C)return;const O=i1(K.nativeEvent);if(o&&(O&&K.button===0||!O)){const H=T.getState();Ih.onPointerDown(K.nativeEvent,{handleDomNode:K.currentTarget,autoPanOnConnect:H.autoPanOnConnect,connectionMode:H.connectionMode,connectionRadius:H.connectionRadius,domNode:H.domNode,nodeLookup:H.nodeLookup,lib:H.lib,isTarget:_,handleId:E,nodeId:C,flowId:H.rfId,panBy:H.panBy,cancelConnection:H.cancelConnection,onConnectStart:H.onConnectStart,onConnectEnd:(...$)=>T.getState().onConnectEnd?.(...$),updateConnection:H.updateConnection,onConnect:Z,isValidConnection:s||((...$)=>T.getState().isValidConnection?.(...$)??!0),getTransform:()=>T.getState().transform,getFromHandle:()=>T.getState().connection.fromHandle,autoPanSpeed:H.autoPanSpeed,dragThreshold:H.connectionDragThreshold})}O?y?.(K):g?.(K)},L=K=>{const{onClickConnectStart:O,onClickConnectEnd:H,connectionClickStartHandle:$,connectionMode:X,isValidConnection:se,lib:w,rfId:z,nodeLookup:F,connection:W}=T.getState();if(!C||!$&&!o)return;if(!$){O?.(K.nativeEvent,{nodeId:C,handleId:E,handleType:e}),T.setState({connectionClickStartHandle:{nodeId:C,type:e,id:E}});return}const fe=t1(K.target),de=s||se,{connection:ie,isValid:te}=Ih.isValid(K.nativeEvent,{handle:{nodeId:C,id:E,type:e},connectionMode:X,fromNodeId:$.nodeId,fromHandleId:$.id||null,fromType:$.type,isValidConnection:de,flowId:z,doc:fe,lib:w,nodeLookup:F});te&&ie&&Z(ie);const oe=structuredClone(W);delete oe.inProgress,oe.toPosition=oe.toHandle?oe.toHandle.position:null,H?.(K,oe),T.setState({connectionClickStartHandle:null})};return b.jsx("div",{"data-handleid":E,"data-nodeid":C,"data-handlepos":n,"data-id":`${N}-${C}-${E}-${e}`,className:xt(["react-flow__handle",`react-flow__handle-${n}`,"nodrag",A,p,{source:!_,target:_,connectable:a,connectablestart:o,connectableend:c,clickconnecting:B,connectingfrom:j,connectingto:D,valid:Y,connectionindicator:a&&(!U||R)&&(U||q?c:o)}]),onMouseDown:le,onTouchStart:le,onClick:k?L:void 0,ref:x,...v,children:h})}const kn=V.memo(_1(hC));function mC({data:e,isConnectable:n,sourcePosition:s=me.Bottom}){return b.jsxs(b.Fragment,{children:[e?.label,b.jsx(kn,{type:"source",position:s,isConnectable:n})]})}function pC({data:e,isConnectable:n,targetPosition:s=me.Top,sourcePosition:a=me.Bottom}){return b.jsxs(b.Fragment,{children:[b.jsx(kn,{type:"target",position:s,isConnectable:n}),e?.label,b.jsx(kn,{type:"source",position:a,isConnectable:n})]})}function gC(){return null}function yC({data:e,isConnectable:n,targetPosition:s=me.Top}){return b.jsxs(b.Fragment,{children:[b.jsx(kn,{type:"target",position:s,isConnectable:n}),e?.label]})}const fu={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},Tv={input:mC,default:pC,output:yC,group:gC};function vC(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 bC=e=>{const{width:n,height:s,x:a,y:o}=ur(e.nodeLookup,{filter:c=>!!c.selected});return{width:Xn(n)?n:null,height:Xn(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 SC({onSelectionContextMenu:e,noPanClassName:n,disableKeyboardA11y:s}){const a=at(),{width:o,height:c,transformString:u,userSelectionActive:d}=Re(bC,it),h=C1(),p=V.useRef(null);V.useEffect(()=>{s||p.current?.focus({preventScroll:!0})},[s]);const y=!d&&o!==null&&c!==null;if(T1({nodeRef:p,disabled:!y}),!y)return null;const g=e?x=>{const E=a.getState().nodes.filter(_=>_.selected);e(x,E)}:void 0,v=x=>{Object.prototype.hasOwnProperty.call(fu,x.key)&&(x.preventDefault(),h({direction:fu[x.key],factor:x.shiftKey?4:1}))};return b.jsx("div",{className:xt(["react-flow__nodesselection","react-flow__container",n]),style:{transform:u},children:b.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:s?void 0:-1,onKeyDown:s?void 0:v,style:{width:o,height:c}})})}const Cv=typeof window<"u"?window:void 0,wC=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function O1({children:e,onPaneClick:n,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:c,onPaneScroll:u,paneClickDistance:d,deleteKeyCode:h,selectionKeyCode:p,selectionOnDrag:y,selectionMode:g,onSelectionStart:v,onSelectionEnd:x,multiSelectionKeyCode:E,panActivationKeyCode:_,zoomActivationKeyCode:T,elementsSelectable:C,zoomOnScroll:k,zoomOnPinch:A,panOnScroll:N,panOnScrollSpeed:j,panOnScrollMode:D,zoomOnDoubleClick:B,panOnDrag:R,autoPanOnSelection:U,defaultViewport:q,translateExtent:Y,minZoom:Z,maxZoom:le,preventScrolling:L,onSelectionContextMenu:K,noWheelClassName:O,noPanClassName:H,disableKeyboardA11y:$,onViewportChange:X,isControlledViewport:se}){const{nodesSelectionActive:w,userSelectionActive:z}=Re(wC,it),F=Po(p,{target:Cv}),W=Po(_,{target:Cv}),fe=W||R,de=W||N,ie=y&&fe!==!0,te=F||z||ie;return tC({deleteKeyCode:h,multiSelectionKeyCode:E}),b.jsx(sC,{onPaneContextMenu:c,elementsSelectable:C,zoomOnScroll:k,zoomOnPinch:A,panOnScroll:de,panOnScrollSpeed:j,panOnScrollMode:D,zoomOnDoubleClick:B,panOnDrag:!F&&fe,defaultViewport:q,translateExtent:Y,minZoom:Z,maxZoom:le,zoomActivationKeyCode:T,preventScrolling:L,noWheelClassName:O,noPanClassName:H,onViewportChange:X,isControlledViewport:se,paneClickDistance:d,selectionOnDrag:ie,children:b.jsxs(rC,{onSelectionStart:v,onSelectionEnd:x,onPaneClick:n,onPaneMouseEnter:s,onPaneMouseMove:a,onPaneMouseLeave:o,onPaneContextMenu:c,onPaneScroll:u,panOnDrag:fe,autoPanOnSelection:U,isSelecting:!!te,selectionMode:g,selectionKeyPressed:F,paneClickDistance:d,selectionOnDrag:ie,children:[e,w&&b.jsx(SC,{onSelectionContextMenu:K,noPanClassName:H,disableKeyboardA11y:$})]})})}O1.displayName="FlowRenderer";const xC=V.memo(O1),EC=e=>n=>e?um(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 NC(e){return Re(V.useCallback(EC(e),[e]),it)}const _C=e=>e.updateNodeInternals;function AC(){const e=Re(_C),[n]=V.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 V.useEffect(()=>()=>{n?.disconnect()},[n]),n}function TC({node:e,nodeType:n,hasDimensions:s,resizeObserver:a}){const o=at(),c=V.useRef(null),u=V.useRef(null),d=V.useRef(e.sourcePosition),h=V.useRef(e.targetPosition),p=V.useRef(n),y=s&&!!e.internals.handleBounds;return V.useEffect(()=>{c.current&&!e.hidden&&(!y||u.current!==c.current)&&(u.current&&a?.unobserve(u.current),a?.observe(c.current),u.current=c.current)},[y,e.hidden]),V.useEffect(()=>()=>{u.current&&(a?.unobserve(u.current),u.current=null)},[]),V.useEffect(()=>{if(c.current){const g=p.current!==n,v=d.current!==e.sourcePosition,x=h.current!==e.targetPosition;(g||v||x)&&(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 CC({id:e,onClick:n,onMouseEnter:s,onMouseMove:a,onMouseLeave:o,onContextMenu:c,onDoubleClick:u,nodesDraggable:d,elementsSelectable:h,nodesConnectable:p,nodesFocusable:y,resizeObserver:g,noDragClassName:v,noPanClassName:x,disableKeyboardA11y:E,rfId:_,nodeTypes:T,nodeClickDistance:C,onError:k}){const{node:A,internals:N,isParent:j}=Re(te=>{const oe=te.nodeLookup.get(e),ve=te.parentLookup.has(e);return{node:oe,internals:oe.internals,isParent:ve}},it);let D=A.type||"default",B=T?.[D]||Tv[D];B===void 0&&(k?.("003",Qn.error003(D)),D="default",B=T?.default||Tv.default);const R=!!(A.draggable||d&&typeof A.draggable>"u"),U=!!(A.selectable||h&&typeof A.selectable>"u"),q=!!(A.connectable||p&&typeof A.connectable>"u"),Y=!!(A.focusable||y&&typeof A.focusable>"u"),Z=at(),le=Pb(A),L=TC({node:A,nodeType:D,hasDimensions:le,resizeObserver:g}),K=T1({nodeRef:L,disabled:A.hidden||!R,noDragClassName:v,handleSelector:A.dragHandle,nodeId:e,isSelectable:U,nodeClickDistance:C}),O=C1();if(A.hidden)return null;const H=Li(A),$=vC(A),X=U||R||n||s||a||o,se=s?te=>s(te,{...N.userNode}):void 0,w=a?te=>a(te,{...N.userNode}):void 0,z=o?te=>o(te,{...N.userNode}):void 0,F=c?te=>c(te,{...N.userNode}):void 0,W=u?te=>u(te,{...N.userNode}):void 0,fe=te=>{const{selectNodesOnDrag:oe,nodeDragThreshold:ve}=Z.getState();U&&(!oe||!R||ve>0)&&qh({id:e,store:Z,nodeRef:L}),n&&n(te,{...N.userNode})},de=te=>{if(!(n1(te.nativeEvent)||E)){if(Yb.includes(te.key)&&U){const oe=te.key==="Escape";qh({id:e,store:Z,unselect:oe,nodeRef:L})}else if(R&&A.selected&&Object.prototype.hasOwnProperty.call(fu,te.key)){te.preventDefault();const{ariaLabelConfig:oe}=Z.getState();Z.setState({ariaLiveMessage:oe["node.a11yDescription.ariaLiveMessage"]({direction:te.key.replace("Arrow","").toLowerCase(),x:~~N.positionAbsolute.x,y:~~N.positionAbsolute.y})}),O({direction:fu[te.key],factor:te.shiftKey?4:1})}}},ie=()=>{if(E||!L.current?.matches(":focus-visible"))return;const{transform:te,width:oe,height:ve,autoPanOnNodeFocus:Se,setCenter:he}=Z.getState();if(!Se)return;um(new Map([[e,A]]),{x:0,y:0,width:oe,height:ve},te,!0).length>0||he(A.position.x+H.width/2,A.position.y+H.height/2,{zoom:te[2]})};return b.jsx("div",{className:xt(["react-flow__node",`react-flow__node-${D}`,{[x]:R},A.className,{selected:A.selected,selectable:U,parent:j,draggable:R,dragging:K}]),ref:L,style:{zIndex:N.z,transform:`translate(${N.positionAbsolute.x}px,${N.positionAbsolute.y}px)`,pointerEvents:X?"all":"none",visibility:le?"visible":"hidden",...A.style,...$},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:se,onMouseMove:w,onMouseLeave:z,onContextMenu:F,onClick:fe,onDoubleClick:W,onKeyDown:Y?de:void 0,tabIndex:Y?0:void 0,onFocus:Y?ie:void 0,role:A.ariaRole??(Y?"group":void 0),"aria-roledescription":"node","aria-describedby":E?void 0:`${w1}-${_}`,"aria-label":A.ariaLabel,...A.domAttributes,children:b.jsx(uC,{value:e,children:b.jsx(B,{id:e,data:A.data,type:D,positionAbsoluteX:N.positionAbsolute.x,positionAbsoluteY:N.positionAbsolute.y,selected:A.selected??!1,selectable:U,draggable:R,deletable:A.deletable??!0,isConnectable:q,sourcePosition:A.sourcePosition,targetPosition:A.targetPosition,dragging:K,dragHandle:A.dragHandle,zIndex:N.z,parentId:A.parentId,...H})})})}var MC=V.memo(CC);const OC=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function k1(e){const{nodesDraggable:n,nodesConnectable:s,nodesFocusable:a,elementsSelectable:o,onError:c}=Re(OC,it),u=NC(e.onlyRenderVisibleElements),d=AC();return b.jsx("div",{className:"react-flow__nodes",style:Mu,children:u.map(h=>b.jsx(MC,{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))})}k1.displayName="NodeRenderer";const kC=V.memo(k1);function zC(e){return Re(V.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&&AA({sourceNode:c,targetNode:u,width:s.width,height:s.height,transform:s.transform})&&a.push(o.id)}return a},[e]),it)}const DC=({color:e="none",strokeWidth:n=1})=>{const s={strokeWidth:n,...e&&{stroke:e}};return b.jsx("polyline",{className:"arrow",style:s,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},jC=({color:e="none",strokeWidth:n=1})=>{const s={strokeWidth:n,...e&&{stroke:e,fill:e}};return b.jsx("polyline",{className:"arrowclosed",style:s,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},Mv={[Fo.Arrow]:DC,[Fo.ArrowClosed]:jC};function RC(e){const n=at();return V.useMemo(()=>Object.prototype.hasOwnProperty.call(Mv,e)?Mv[e]:(n.getState().onError?.("009",Qn.error009(e)),null),[e])}const BC=({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=RC(n);return h?b.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:b.jsx(h,{color:s,strokeWidth:u})}):null},z1=({defaultColor:e,rfId:n})=>{const s=Re(c=>c.edges),a=Re(c=>c.defaultEdgeOptions),o=V.useMemo(()=>jA(s,{id:n,defaultColor:e,defaultMarkerStart:a?.markerStart,defaultMarkerEnd:a?.markerEnd}),[s,a,n,e]);return o.length?b.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:b.jsx("defs",{children:o.map(c=>b.jsx(BC,{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};z1.displayName="MarkerDefinitions";var LC=V.memo(z1);function D1({x:e,y:n,label:s,labelStyle:a,labelShowBg:o=!0,labelBgStyle:c,labelBgPadding:u=[2,4],labelBgBorderRadius:d=2,children:h,className:p,...y}){const[g,v]=V.useState({x:1,y:0,width:0,height:0}),x=xt(["react-flow__edge-textwrapper",p]),E=V.useRef(null);return V.useEffect(()=>{if(E.current){const _=E.current.getBBox();v({x:_.x,y:_.y,width:_.width,height:_.height})}},[s]),s?b.jsxs("g",{transform:`translate(${e-g.width/2} ${n-g.height/2})`,className:x,visibility:g.width?"visible":"hidden",...y,children:[o&&b.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}),b.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:E,style:a,children:s}),h]}):null}D1.displayName="EdgeText";const $C=V.memo(D1);function hr({path:e,labelX:n,labelY:s,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h,interactionWidth:p=20,...y}){return b.jsxs(b.Fragment,{children:[b.jsx("path",{...y,d:e,fill:"none",className:xt(["react-flow__edge-path",y.className])}),p?b.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,a&&Xn(n)&&Xn(s)?b.jsx($C,{x:n,y:s,label:a,labelStyle:o,labelShowBg:c,labelBgStyle:u,labelBgPadding:d,labelBgBorderRadius:h}):null]})}function Ov({pos:e,x1:n,y1:s,x2:a,y2:o}){return e===me.Left||e===me.Right?[.5*(n+a),s]:[n,.5*(s+o)]}function j1({sourceX:e,sourceY:n,sourcePosition:s=me.Bottom,targetX:a,targetY:o,targetPosition:c=me.Top}){const[u,d]=Ov({pos:s,x1:e,y1:n,x2:a,y2:o}),[h,p]=Ov({pos:c,x1:a,y1:o,x2:e,y2:n}),[y,g,v,x]=s1({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}`,y,g,v,x]}function R1(e){return V.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,sourcePosition:u,targetPosition:d,label:h,labelStyle:p,labelShowBg:y,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:x,style:E,markerEnd:_,markerStart:T,interactionWidth:C})=>{const[k,A,N]=j1({sourceX:s,sourceY:a,sourcePosition:u,targetX:o,targetY:c,targetPosition:d}),j=e.isInternal?void 0:n;return b.jsx(hr,{id:j,path:k,labelX:A,labelY:N,label:h,labelStyle:p,labelShowBg:y,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:x,style:E,markerEnd:_,markerStart:T,interactionWidth:C})})}const HC=R1({isInternal:!1}),B1=R1({isInternal:!0});HC.displayName="SimpleBezierEdge";B1.displayName="SimpleBezierEdgeInternal";function L1(e){return V.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:g,style:v,sourcePosition:x=me.Bottom,targetPosition:E=me.Top,markerEnd:_,markerStart:T,pathOptions:C,interactionWidth:k})=>{const[A,N,j]=$h({sourceX:s,sourceY:a,sourcePosition:x,targetX:o,targetY:c,targetPosition:E,borderRadius:C?.borderRadius,offset:C?.offset,stepPosition:C?.stepPosition}),D=e.isInternal?void 0:n;return b.jsx(hr,{id:D,path:A,labelX:N,labelY:j,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:g,style:v,markerEnd:_,markerStart:T,interactionWidth:k})})}const $1=L1({isInternal:!1}),H1=L1({isInternal:!0});$1.displayName="SmoothStepEdge";H1.displayName="SmoothStepEdgeInternal";function U1(e){return V.memo(({id:n,...s})=>{const a=e.isInternal?void 0:n;return b.jsx($1,{...s,id:a,pathOptions:V.useMemo(()=>({borderRadius:0,offset:s.pathOptions?.offset}),[s.pathOptions?.offset])})})}const UC=U1({isInternal:!1}),I1=U1({isInternal:!0});UC.displayName="StepEdge";I1.displayName="StepEdgeInternal";function q1(e){return V.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:g,style:v,markerEnd:x,markerStart:E,interactionWidth:_})=>{const[T,C,k]=o1({sourceX:s,sourceY:a,targetX:o,targetY:c}),A=e.isInternal?void 0:n;return b.jsx(hr,{id:A,path:T,labelX:C,labelY:k,label:u,labelStyle:d,labelShowBg:h,labelBgStyle:p,labelBgPadding:y,labelBgBorderRadius:g,style:v,markerEnd:x,markerStart:E,interactionWidth:_})})}const IC=q1({isInternal:!1}),V1=q1({isInternal:!0});IC.displayName="StraightEdge";V1.displayName="StraightEdgeInternal";function Y1(e){return V.memo(({id:n,sourceX:s,sourceY:a,targetX:o,targetY:c,sourcePosition:u=me.Bottom,targetPosition:d=me.Top,label:h,labelStyle:p,labelShowBg:y,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:x,style:E,markerEnd:_,markerStart:T,pathOptions:C,interactionWidth:k})=>{const[A,N,j]=a1({sourceX:s,sourceY:a,sourcePosition:u,targetX:o,targetY:c,targetPosition:d,curvature:C?.curvature}),D=e.isInternal?void 0:n;return b.jsx(hr,{id:D,path:A,labelX:N,labelY:j,label:h,labelStyle:p,labelShowBg:y,labelBgStyle:g,labelBgPadding:v,labelBgBorderRadius:x,style:E,markerEnd:_,markerStart:T,interactionWidth:k})})}const qC=Y1({isInternal:!1}),G1=Y1({isInternal:!0});qC.displayName="BezierEdge";G1.displayName="BezierEdgeInternal";const kv={default:G1,straight:V1,step:I1,smoothstep:H1,simplebezier:B1},zv={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},VC=(e,n,s)=>s===me.Left?e-n:s===me.Right?e+n:e,YC=(e,n,s)=>s===me.Top?e-n:s===me.Bottom?e+n:e,Dv="react-flow__edgeupdater";function jv({position:e,centerX:n,centerY:s,radius:a=10,onMouseDown:o,onMouseEnter:c,onMouseOut:u,type:d}){return b.jsx("circle",{onMouseDown:o,onMouseEnter:c,onMouseOut:u,className:xt([Dv,`${Dv}-${d}`]),cx:VC(n,a,e),cy:YC(s,a,e),r:a,stroke:"transparent",fill:"transparent"})}function GC({isReconnectable:e,reconnectRadius:n,edge:s,sourceX:a,sourceY:o,targetX:c,targetY:u,sourcePosition:d,targetPosition:h,onReconnect:p,onReconnectStart:y,onReconnectEnd:g,setReconnecting:v,setUpdateHover:x}){const E=at(),_=(N,j)=>{if(N.button!==0)return;const{autoPanOnConnect:D,domNode:B,connectionMode:R,connectionRadius:U,lib:q,onConnectStart:Y,cancelConnection:Z,nodeLookup:le,rfId:L,panBy:K,updateConnection:O}=E.getState(),H=j.type==="target",$=(w,z)=>{v(!1),g?.(w,s,j.type,z)},X=w=>p?.(s,w),se=(w,z)=>{v(!0),y?.(N,s,j.type),Y?.(w,z)};Ih.onPointerDown(N.nativeEvent,{autoPanOnConnect:D,connectionMode:R,connectionRadius:U,domNode:B,handleId:j.id,nodeId:j.nodeId,nodeLookup:le,isTarget:H,edgeUpdaterType:j.type,lib:q,flowId:L,cancelConnection:Z,panBy:K,isValidConnection:(...w)=>E.getState().isValidConnection?.(...w)??!0,onConnect:X,onConnectStart:se,onConnectEnd:(...w)=>E.getState().onConnectEnd?.(...w),onReconnectEnd:$,updateConnection:O,getTransform:()=>E.getState().transform,getFromHandle:()=>E.getState().connection.fromHandle,dragThreshold:E.getState().connectionDragThreshold,handleDomNode:N.currentTarget})},T=N=>_(N,{nodeId:s.target,id:s.targetHandle??null,type:"target"}),C=N=>_(N,{nodeId:s.source,id:s.sourceHandle??null,type:"source"}),k=()=>x(!0),A=()=>x(!1);return b.jsxs(b.Fragment,{children:[(e===!0||e==="source")&&b.jsx(jv,{position:d,centerX:a,centerY:o,radius:n,onMouseDown:T,onMouseEnter:k,onMouseOut:A,type:"source"}),(e===!0||e==="target")&&b.jsx(jv,{position:h,centerX:c,centerY:u,radius:n,onMouseDown:C,onMouseEnter:k,onMouseOut:A,type:"target"})]})}function XC({id:e,edgesFocusable:n,edgesReconnectable:s,elementsSelectable:a,onClick:o,onDoubleClick:c,onContextMenu:u,onMouseEnter:d,onMouseMove:h,onMouseLeave:p,reconnectRadius:y,onReconnect:g,onReconnectStart:v,onReconnectEnd:x,rfId:E,edgeTypes:_,noPanClassName:T,onError:C,disableKeyboardA11y:k}){let A=Re(he=>he.edgeLookup.get(e));const N=Re(he=>he.defaultEdgeOptions);A=N?{...N,...A}:A;let j=A.type||"default",D=_?.[j]||kv[j];D===void 0&&(C?.("011",Qn.error011(j)),j="default",D=_?.default||kv.default);const B=!!(A.focusable||n&&typeof A.focusable>"u"),R=typeof g<"u"&&(A.reconnectable||s&&typeof A.reconnectable>"u"),U=!!(A.selectable||a&&typeof A.selectable>"u"),q=V.useRef(null),[Y,Z]=V.useState(!1),[le,L]=V.useState(!1),K=at(),{zIndex:O,sourceX:H,sourceY:$,targetX:X,targetY:se,sourcePosition:w,targetPosition:z}=Re(V.useCallback(he=>{const ge=he.nodeLookup.get(A.source),Ee=he.nodeLookup.get(A.target);if(!ge||!Ee)return{zIndex:A.zIndex,...zv};const Ce=DA({id:e,sourceNode:ge,targetNode:Ee,sourceHandle:A.sourceHandle||null,targetHandle:A.targetHandle||null,connectionMode:he.connectionMode,onError:C});return{zIndex:_A({selected:A.selected,zIndex:A.zIndex,sourceNode:ge,targetNode:Ee,elevateOnSelect:he.elevateEdgesOnSelect,zIndexMode:he.zIndexMode}),...Ce||zv}},[A.source,A.target,A.sourceHandle,A.targetHandle,A.selected,A.zIndex]),it),F=V.useMemo(()=>A.markerStart?`url('#${Hh(A.markerStart,E)}')`:void 0,[A.markerStart,E]),W=V.useMemo(()=>A.markerEnd?`url('#${Hh(A.markerEnd,E)}')`:void 0,[A.markerEnd,E]);if(A.hidden||H===null||$===null||X===null||se===null)return null;const fe=he=>{const{addSelectedEdges:ge,unselectNodesAndEdges:Ee,multiSelectionActive:Ce}=K.getState();U&&(K.setState({nodesSelectionActive:!1}),A.selected&&Ce?(Ee({nodes:[],edges:[A]}),q.current?.blur()):ge([e])),o&&o(he,A)},de=c?he=>{c(he,{...A})}:void 0,ie=u?he=>{u(he,{...A})}:void 0,te=d?he=>{d(he,{...A})}:void 0,oe=h?he=>{h(he,{...A})}:void 0,ve=p?he=>{p(he,{...A})}:void 0,Se=he=>{if(!k&&Yb.includes(he.key)&&U){const{unselectNodesAndEdges:ge,addSelectedEdges:Ee}=K.getState();he.key==="Escape"?(q.current?.blur(),ge({edges:[A]})):Ee([e])}};return b.jsx("svg",{style:{zIndex:O},children:b.jsxs("g",{className:xt(["react-flow__edge",`react-flow__edge-${j}`,A.className,T,{selected:A.selected,animated:A.animated,inactive:!U&&!o,updating:Y,selectable:U}]),onClick:fe,onDoubleClick:de,onContextMenu:ie,onMouseEnter:te,onMouseMove:oe,onMouseLeave:ve,onKeyDown:B?Se:void 0,tabIndex:B?0:void 0,role:A.ariaRole??(B?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":A.ariaLabel===null?void 0:A.ariaLabel||`Edge from ${A.source} to ${A.target}`,"aria-describedby":B?`${x1}-${E}`:void 0,ref:q,...A.domAttributes,children:[!le&&b.jsx(D,{id:e,source:A.source,target:A.target,type:A.type,selected:A.selected,animated:A.animated,selectable:U,deletable:A.deletable??!0,label:A.label,labelStyle:A.labelStyle,labelShowBg:A.labelShowBg,labelBgStyle:A.labelBgStyle,labelBgPadding:A.labelBgPadding,labelBgBorderRadius:A.labelBgBorderRadius,sourceX:H,sourceY:$,targetX:X,targetY:se,sourcePosition:w,targetPosition:z,data:A.data,style:A.style,sourceHandleId:A.sourceHandle,targetHandleId:A.targetHandle,markerStart:F,markerEnd:W,pathOptions:"pathOptions"in A?A.pathOptions:void 0,interactionWidth:A.interactionWidth}),R&&b.jsx(GC,{edge:A,isReconnectable:R,reconnectRadius:y,onReconnect:g,onReconnectStart:v,onReconnectEnd:x,sourceX:H,sourceY:$,targetX:X,targetY:se,sourcePosition:w,targetPosition:z,setUpdateHover:Z,setReconnecting:L})]})})}var KC=V.memo(XC);const ZC=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function X1({defaultMarkerColor:e,onlyRenderVisibleElements:n,rfId:s,edgeTypes:a,noPanClassName:o,onReconnect:c,onEdgeContextMenu:u,onEdgeMouseEnter:d,onEdgeMouseMove:h,onEdgeMouseLeave:p,onEdgeClick:y,reconnectRadius:g,onEdgeDoubleClick:v,onReconnectStart:x,onReconnectEnd:E,disableKeyboardA11y:_}){const{edgesFocusable:T,edgesReconnectable:C,elementsSelectable:k,onError:A}=Re(ZC,it),N=zC(n);return b.jsxs("div",{className:"react-flow__edges",children:[b.jsx(LC,{defaultColor:e,rfId:s}),N.map(j=>b.jsx(KC,{id:j,edgesFocusable:T,edgesReconnectable:C,elementsSelectable:k,noPanClassName:o,onReconnect:c,onContextMenu:u,onMouseEnter:d,onMouseMove:h,onMouseLeave:p,onClick:y,reconnectRadius:g,onDoubleClick:v,onReconnectStart:x,onReconnectEnd:E,rfId:s,onError:A,edgeTypes:a,disableKeyboardA11y:_},j))]})}X1.displayName="EdgeRenderer";const QC=V.memo(X1),FC=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function JC({children:e}){const n=Re(FC);return b.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:n},children:e})}function WC(e){const n=dr(),s=V.useRef(!1);V.useEffect(()=>{!s.current&&n.viewportInitialized&&e&&(setTimeout(()=>e(n),1),s.current=!0)},[e,n.viewportInitialized])}const PC=e=>e.panZoom?.syncViewport;function eM(e){const n=Re(PC),s=at();return V.useEffect(()=>{e&&(n?.(e),s.setState({transform:[e.x,e.y,e.zoom]}))},[e,n]),null}function tM(e){return e.connection.inProgress?{...e.connection,to:xl(e.connection.to,e.transform)}:{...e.connection}}function nM(e){return tM}function iM(e){const n=nM();return Re(n,it)}const sM=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function aM({containerStyle:e,style:n,type:s,component:a}){const{nodesConnectable:o,width:c,height:u,isValid:d,inProgress:h}=Re(sM,it);return!(c&&o&&h)?null:b.jsx("svg",{style:e,width:c,height:u,className:"react-flow__connectionline react-flow__container",children:b.jsx("g",{className:xt(["react-flow__connection",Kb(d)]),children:b.jsx(K1,{style:n,type:s,CustomComponent:a,isValid:d})})})}const K1=({style:e,type:n=bs.Bezier,CustomComponent:s,isValid:a})=>{const{inProgress:o,from:c,fromNode:u,fromHandle:d,fromPosition:h,to:p,toNode:y,toHandle:g,toPosition:v,pointer:x}=iM();if(!o)return;if(s)return b.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:v,connectionStatus:Kb(a),toNode:y,toHandle:g,pointer:x});let E="";const _={sourceX:c.x,sourceY:c.y,sourcePosition:h,targetX:p.x,targetY:p.y,targetPosition:v};switch(n){case bs.Bezier:[E]=a1(_);break;case bs.SimpleBezier:[E]=j1(_);break;case bs.Step:[E]=$h({..._,borderRadius:0});break;case bs.SmoothStep:[E]=$h(_);break;default:[E]=o1(_)}return b.jsx("path",{d:E,fill:"none",className:"react-flow__connection-path",style:e})};K1.displayName="ConnectionLine";const lM={};function Rv(e=lM){V.useRef(e),at(),V.useEffect(()=>{},[e])}function oM(){at(),V.useRef(!1),V.useEffect(()=>{},[])}function Z1({nodeTypes:e,edgeTypes:n,onInit:s,onNodeClick:a,onEdgeClick:o,onNodeDoubleClick:c,onEdgeDoubleClick:u,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:y,onSelectionContextMenu:g,onSelectionStart:v,onSelectionEnd:x,connectionLineType:E,connectionLineStyle:_,connectionLineComponent:T,connectionLineContainerStyle:C,selectionKeyCode:k,selectionOnDrag:A,selectionMode:N,multiSelectionKeyCode:j,panActivationKeyCode:D,zoomActivationKeyCode:B,deleteKeyCode:R,onlyRenderVisibleElements:U,elementsSelectable:q,defaultViewport:Y,translateExtent:Z,minZoom:le,maxZoom:L,preventScrolling:K,defaultMarkerColor:O,zoomOnScroll:H,zoomOnPinch:$,panOnScroll:X,panOnScrollSpeed:se,panOnScrollMode:w,zoomOnDoubleClick:z,panOnDrag:F,autoPanOnSelection:W,onPaneClick:fe,onPaneMouseEnter:de,onPaneMouseMove:ie,onPaneMouseLeave:te,onPaneScroll:oe,onPaneContextMenu:ve,paneClickDistance:Se,nodeClickDistance:he,onEdgeContextMenu:ge,onEdgeMouseEnter:Ee,onEdgeMouseMove:Ce,onEdgeMouseLeave:Ie,reconnectRadius:et,onReconnect:jt,onReconnectStart:rt,onReconnectEnd:Et,noDragClassName:Rt,noWheelClassName:jn,noPanClassName:Ct,disableKeyboardA11y:Ze,nodeExtent:ft,rfId:Vt,viewport:Ut,onViewportChange:Bt}){return Rv(e),Rv(n),oM(),WC(s),eM(Ut),b.jsx(xC,{onPaneClick:fe,onPaneMouseEnter:de,onPaneMouseMove:ie,onPaneMouseLeave:te,onPaneContextMenu:ve,onPaneScroll:oe,paneClickDistance:Se,deleteKeyCode:R,selectionKeyCode:k,selectionOnDrag:A,selectionMode:N,onSelectionStart:v,onSelectionEnd:x,multiSelectionKeyCode:j,panActivationKeyCode:D,zoomActivationKeyCode:B,elementsSelectable:q,zoomOnScroll:H,zoomOnPinch:$,zoomOnDoubleClick:z,panOnScroll:X,panOnScrollSpeed:se,panOnScrollMode:w,panOnDrag:F,autoPanOnSelection:W,defaultViewport:Y,translateExtent:Z,minZoom:le,maxZoom:L,onSelectionContextMenu:g,preventScrolling:K,noDragClassName:Rt,noWheelClassName:jn,noPanClassName:Ct,disableKeyboardA11y:Ze,onViewportChange:Bt,isControlledViewport:!!Ut,children:b.jsxs(JC,{children:[b.jsx(QC,{edgeTypes:n,onEdgeClick:o,onEdgeDoubleClick:u,onReconnect:jt,onReconnectStart:rt,onReconnectEnd:Et,onlyRenderVisibleElements:U,onEdgeContextMenu:ge,onEdgeMouseEnter:Ee,onEdgeMouseMove:Ce,onEdgeMouseLeave:Ie,reconnectRadius:et,defaultMarkerColor:O,noPanClassName:Ct,disableKeyboardA11y:Ze,rfId:Vt}),b.jsx(aM,{style:_,type:E,component:T,containerStyle:C}),b.jsx("div",{className:"react-flow__edgelabel-renderer"}),b.jsx(kC,{nodeTypes:e,onNodeClick:a,onNodeDoubleClick:c,onNodeMouseEnter:d,onNodeMouseMove:h,onNodeMouseLeave:p,onNodeContextMenu:y,nodeClickDistance:he,onlyRenderVisibleElements:U,noPanClassName:Ct,noDragClassName:Rt,disableKeyboardA11y:Ze,nodeExtent:ft,rfId:Vt}),b.jsx("div",{className:"react-flow__viewport-portal"})]})})}Z1.displayName="GraphView";const rM=V.memo(Z1),cM=Wb(),Bv=({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,width:o,height:c,fitView:u,fitViewOptions:d,minZoom:h=.5,maxZoom:p=2,nodeOrigin:y,nodeExtent:g,zIndexMode:v="basic"}={})=>{const x=new Map,E=new Map,_=new Map,T=new Map,C=a??n??[],k=s??e??[],A=y??[0,0],N=g??Zo;u1(_,T,C);const{nodesInitialized:j}=Uh(k,x,E,{nodeOrigin:A,nodeExtent:N,zIndexMode:v});let D=[0,0,1];if(u&&o&&c){const B=ur(x,{filter:Y=>!!((Y.width||Y.initialWidth)&&(Y.height||Y.initialHeight))}),{x:R,y:U,zoom:q}=dm(B,o,c,h,p,d?.padding??.1);D=[R,U,q]}return{rfId:"1",width:o??0,height:c??0,transform:D,nodes:k,nodesInitialized:j,nodeLookup:x,parentLookup:E,edges:C,edgeLookup:T,connectionLookup:_,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:s!==void 0,hasDefaultEdges:a!==void 0,panZoom:null,minZoom:h,maxZoom:p,translateExtent:Zo,nodeExtent:N,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:hl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:A,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:{...Xb},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:cM,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:Gb,zIndexMode:v,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},uM=({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,width:o,height:c,fitView:u,fitViewOptions:d,minZoom:h,maxZoom:p,nodeOrigin:y,nodeExtent:g,zIndexMode:v})=>xT((x,E)=>{async function _(){const{nodeLookup:T,panZoom:C,fitViewOptions:k,fitViewResolver:A,width:N,height:j,minZoom:D,maxZoom:B}=E();C&&(await vA({nodes:T,width:N,height:j,panZoom:C,minZoom:D,maxZoom:B},k),A?.resolve(!0),x({fitViewResolver:null}))}return{...Bv({nodes:e,edges:n,width:o,height:c,fitView:u,fitViewOptions:d,minZoom:h,maxZoom:p,nodeOrigin:y,nodeExtent:g,defaultNodes:s,defaultEdges:a,zIndexMode:v}),setNodes:T=>{const{nodeLookup:C,parentLookup:k,nodeOrigin:A,elevateNodesOnSelect:N,fitViewQueued:j,zIndexMode:D,nodesSelectionActive:B}=E(),{nodesInitialized:R,hasSelectedNodes:U}=Uh(T,C,k,{nodeOrigin:A,nodeExtent:g,elevateNodesOnSelect:N,checkEquality:!0,zIndexMode:D}),q=B&&U;j&&R?(_(),x({nodes:T,nodesInitialized:R,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:q})):x({nodes:T,nodesInitialized:R,nodesSelectionActive:q})},setEdges:T=>{const{connectionLookup:C,edgeLookup:k}=E();u1(C,k,T),x({edges:T})},setDefaultNodesAndEdges:(T,C)=>{if(T){const{setNodes:k}=E();k(T),x({hasDefaultNodes:!0})}if(C){const{setEdges:k}=E();k(C),x({hasDefaultEdges:!0})}},updateNodeInternals:T=>{const{triggerNodeChanges:C,nodeLookup:k,parentLookup:A,domNode:N,nodeOrigin:j,nodeExtent:D,debug:B,fitViewQueued:R,zIndexMode:U}=E(),{changes:q,updatedInternals:Y}=IA(T,k,A,N,j,D,U);Y&&(LA(k,A,{nodeOrigin:j,nodeExtent:D,zIndexMode:U}),R?(_(),x({fitViewQueued:!1,fitViewOptions:void 0})):x({}),q?.length>0&&(B&&console.log("React Flow: trigger node changes",q),C?.(q)))},updateNodePositions:(T,C=!1)=>{const k=[];let A=[];const{nodeLookup:N,triggerNodeChanges:j,connection:D,updateConnection:B,onNodesChangeMiddlewareMap:R}=E();for(const[U,q]of T){const Y=N.get(U),Z=!!(Y?.expandParent&&Y?.parentId&&q?.position),le={id:U,type:"position",position:Z?{x:Math.max(0,q.position.x),y:Math.max(0,q.position.y)}:q.position,dragging:C};if(Y&&D.inProgress&&D.fromNode.id===Y.id){const L=Ws(Y,D.fromHandle,me.Left,!0);B({...D,from:L})}Z&&Y.parentId&&k.push({id:U,parentId:Y.parentId,rect:{...q.internals.positionAbsolute,width:q.measured.width??0,height:q.measured.height??0}}),A.push(le)}if(k.length>0){const{parentLookup:U,nodeOrigin:q}=E(),Y=vm(k,N,U,q);A.push(...Y)}for(const U of R.values())A=U(A);j(A)},triggerNodeChanges:T=>{const{onNodesChange:C,setNodes:k,nodes:A,hasDefaultNodes:N,debug:j}=E();if(T?.length){if(N){const D=YT(T,A);k(D)}j&&console.log("React Flow: trigger node changes",T),C?.(T)}},triggerEdgeChanges:T=>{const{onEdgesChange:C,setEdges:k,edges:A,hasDefaultEdges:N,debug:j}=E();if(T?.length){if(N){const D=GT(T,A);k(D)}j&&console.log("React Flow: trigger edge changes",T),C?.(T)}},addSelectedNodes:T=>{const{multiSelectionActive:C,edgeLookup:k,nodeLookup:A,triggerNodeChanges:N,triggerEdgeChanges:j}=E();if(C){const D=T.map(B=>Is(B,!0));N(D);return}N(Ja(A,new Set([...T]),!0)),j(Ja(k))},addSelectedEdges:T=>{const{multiSelectionActive:C,edgeLookup:k,nodeLookup:A,triggerNodeChanges:N,triggerEdgeChanges:j}=E();if(C){const D=T.map(B=>Is(B,!0));j(D);return}j(Ja(k,new Set([...T]))),N(Ja(A,new Set,!0))},unselectNodesAndEdges:({nodes:T,edges:C}={})=>{const{edges:k,nodes:A,nodeLookup:N,triggerNodeChanges:j,triggerEdgeChanges:D}=E(),B=T||A,R=C||k,U=[];for(const Y of B){if(!Y.selected)continue;const Z=N.get(Y.id);Z&&(Z.selected=!1),U.push(Is(Y.id,!1))}const q=[];for(const Y of R)Y.selected&&q.push(Is(Y.id,!1));j(U),D(q)},setMinZoom:T=>{const{panZoom:C,maxZoom:k}=E();C?.setScaleExtent([T,k]),x({minZoom:T})},setMaxZoom:T=>{const{panZoom:C,minZoom:k}=E();C?.setScaleExtent([k,T]),x({maxZoom:T})},setTranslateExtent:T=>{E().panZoom?.setTranslateExtent(T),x({translateExtent:T})},resetSelectedElements:()=>{const{edges:T,nodes:C,triggerNodeChanges:k,triggerEdgeChanges:A,elementsSelectable:N}=E();if(!N)return;const j=C.reduce((B,R)=>R.selected?[...B,Is(R.id,!1)]:B,[]),D=T.reduce((B,R)=>R.selected?[...B,Is(R.id,!1)]:B,[]);k(j),A(D)},setNodeExtent:T=>{const{nodes:C,nodeLookup:k,parentLookup:A,nodeOrigin:N,elevateNodesOnSelect:j,nodeExtent:D,zIndexMode:B}=E();T[0][0]===D[0][0]&&T[0][1]===D[0][1]&&T[1][0]===D[1][0]&&T[1][1]===D[1][1]||(Uh(C,k,A,{nodeOrigin:N,nodeExtent:T,elevateNodesOnSelect:j,checkEquality:!1,zIndexMode:B}),x({nodeExtent:T}))},panBy:T=>{const{transform:C,width:k,height:A,panZoom:N,translateExtent:j}=E();return qA({delta:T,panZoom:N,transform:C,translateExtent:j,width:k,height:A})},setCenter:async(T,C,k)=>{const{width:A,height:N,maxZoom:j,panZoom:D}=E();if(!D)return!1;const B=typeof k?.zoom<"u"?k.zoom:j;return await D.setViewport({x:A/2-T*B,y:N/2-C*B,zoom:B},{duration:k?.duration,ease:k?.ease,interpolate:k?.interpolate}),!0},cancelConnection:()=>{x({connection:{...Xb}})},updateConnection:T=>{x({connection:T})},reset:()=>x({...Bv()})}},Object.is);function Q1({initialNodes:e,initialEdges:n,defaultNodes:s,defaultEdges:a,initialWidth:o,initialHeight:c,initialMinZoom:u,initialMaxZoom:d,initialFitViewOptions:h,fitView:p,nodeOrigin:y,nodeExtent:g,zIndexMode:v,children:x}){const[E]=V.useState(()=>uM({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,width:o,height:c,fitView:p,minZoom:u,maxZoom:d,fitViewOptions:h,nodeOrigin:y,nodeExtent:g,zIndexMode:v}));return b.jsx(NT,{value:E,children:b.jsx(JT,{children:x})})}function fM({children:e,nodes:n,edges:s,defaultNodes:a,defaultEdges:o,width:c,height:u,fitView:d,fitViewOptions:h,minZoom:p,maxZoom:y,nodeOrigin:g,nodeExtent:v,zIndexMode:x}){return V.useContext(Tu)?b.jsx(b.Fragment,{children:e}):b.jsx(Q1,{initialNodes:n,initialEdges:s,defaultNodes:a,defaultEdges:o,initialWidth:c,initialHeight:u,fitView:d,initialFitViewOptions:h,initialMinZoom:p,initialMaxZoom:y,nodeOrigin:g,nodeExtent:v,zIndexMode:x,children:e})}const dM={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function hM({nodes:e,edges:n,defaultNodes:s,defaultEdges:a,className:o,nodeTypes:c,edgeTypes:u,onNodeClick:d,onEdgeClick:h,onInit:p,onMove:y,onMoveStart:g,onMoveEnd:v,onConnect:x,onConnectStart:E,onConnectEnd:_,onClickConnectStart:T,onClickConnectEnd:C,onNodeMouseEnter:k,onNodeMouseMove:A,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:D,onNodeDragStart:B,onNodeDrag:R,onNodeDragStop:U,onNodesDelete:q,onEdgesDelete:Y,onDelete:Z,onSelectionChange:le,onSelectionDragStart:L,onSelectionDrag:K,onSelectionDragStop:O,onSelectionContextMenu:H,onSelectionStart:$,onSelectionEnd:X,onBeforeDelete:se,connectionMode:w,connectionLineType:z=bs.Bezier,connectionLineStyle:F,connectionLineComponent:W,connectionLineContainerStyle:fe,deleteKeyCode:de="Backspace",selectionKeyCode:ie="Shift",selectionOnDrag:te=!1,selectionMode:oe=Qo.Full,panActivationKeyCode:ve="Space",multiSelectionKeyCode:Se=Wo()?"Meta":"Control",zoomActivationKeyCode:he=Wo()?"Meta":"Control",snapToGrid:ge,snapGrid:Ee,onlyRenderVisibleElements:Ce=!1,selectNodesOnDrag:Ie,nodesDraggable:et,autoPanOnNodeFocus:jt,nodesConnectable:rt,nodesFocusable:Et,nodeOrigin:Rt=E1,edgesFocusable:jn,edgesReconnectable:Ct,elementsSelectable:Ze=!0,defaultViewport:ft=LT,minZoom:Vt=.5,maxZoom:Ut=2,translateExtent:Bt=Zo,preventScrolling:vn=!0,nodeExtent:bn,defaultMarkerColor:Ol="#b1b1b7",zoomOnScroll:Je=!0,zoomOnPinch:Yt=!0,panOnScroll:pt=!1,panOnScrollSpeed:Sn=.5,panOnScrollMode:Mt=Ks.Free,zoomOnDoubleClick:kl=!0,panOnDrag:gt=!0,onPaneClick:$i,onPaneMouseEnter:Wn,onPaneMouseMove:di,onPaneMouseLeave:Hi,onPaneScroll:Gt,onPaneContextMenu:hi,paneClickDistance:Pn=1,nodeClickDistance:zl=0,children:aa,onReconnect:Nt,onReconnectStart:ei,onReconnectEnd:Lt,onEdgeContextMenu:Ui,onEdgeDoubleClick:Ii,onEdgeMouseEnter:la,onEdgeMouseMove:ln,onEdgeMouseLeave:Ns,reconnectRadius:oa=10,onNodesChange:ra,onEdgesChange:wn,noDragClassName:dt="nodrag",noWheelClassName:At="nowheel",noPanClassName:Rn="nopan",fitView:ee,fitViewOptions:pe,connectOnClick:xe,attributionPosition:Be,proOptions:tt,defaultEdgeOptions:Xt,elevateNodesOnSelect:Ye=!0,elevateEdgesOnSelect:on=!1,disableKeyboardA11y:qi=!1,autoPanOnConnect:Vi,autoPanOnNodeDrag:yt,autoPanOnSelection:yr=!0,autoPanSpeed:vr,connectionRadius:mi,isValidConnection:Yi,onError:Yu,style:br,id:Dl,nodeDragThreshold:Gu,connectionDragThreshold:ca,viewport:ua,onViewportChange:Bn,width:Kt,height:Sr,colorMode:Xu="light",debug:jl,onScroll:Rl,ariaLabelConfig:fa,zIndexMode:wr="basic",...Zt},Bl){const da=Dl||"1",Ll=IT(Xu),Gi=V.useCallback($l=>{$l.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),Rl?.($l)},[Rl]);return b.jsx("div",{"data-testid":"rf__wrapper",...Zt,onScroll:Gi,style:{...br,...dM},ref:Bl,className:xt(["react-flow",o,Ll]),id:Dl,role:"application",children:b.jsxs(fM,{nodes:e,edges:n,width:Kt,height:Sr,fitView:ee,fitViewOptions:pe,minZoom:Vt,maxZoom:Ut,nodeOrigin:Rt,nodeExtent:bn,zIndexMode:wr,children:[b.jsx(UT,{nodes:e,edges:n,defaultNodes:s,defaultEdges:a,onConnect:x,onConnectStart:E,onConnectEnd:_,onClickConnectStart:T,onClickConnectEnd:C,nodesDraggable:et,autoPanOnNodeFocus:jt,nodesConnectable:rt,nodesFocusable:Et,edgesFocusable:jn,edgesReconnectable:Ct,elementsSelectable:Ze,elevateNodesOnSelect:Ye,elevateEdgesOnSelect:on,minZoom:Vt,maxZoom:Ut,nodeExtent:bn,onNodesChange:ra,onEdgesChange:wn,snapToGrid:ge,snapGrid:Ee,connectionMode:w,translateExtent:Bt,connectOnClick:xe,defaultEdgeOptions:Xt,fitView:ee,fitViewOptions:pe,onNodesDelete:q,onEdgesDelete:Y,onDelete:Z,onNodeDragStart:B,onNodeDrag:R,onNodeDragStop:U,onSelectionDrag:K,onSelectionDragStart:L,onSelectionDragStop:O,onMove:y,onMoveStart:g,onMoveEnd:v,noPanClassName:Rn,nodeOrigin:Rt,rfId:da,autoPanOnConnect:Vi,autoPanOnNodeDrag:yt,autoPanSpeed:vr,onError:Yu,connectionRadius:mi,isValidConnection:Yi,selectNodesOnDrag:Ie,nodeDragThreshold:Gu,connectionDragThreshold:ca,onBeforeDelete:se,debug:jl,ariaLabelConfig:fa,zIndexMode:wr}),b.jsx(rM,{onInit:p,onNodeClick:d,onEdgeClick:h,onNodeMouseEnter:k,onNodeMouseMove:A,onNodeMouseLeave:N,onNodeContextMenu:j,onNodeDoubleClick:D,nodeTypes:c,edgeTypes:u,connectionLineType:z,connectionLineStyle:F,connectionLineComponent:W,connectionLineContainerStyle:fe,selectionKeyCode:ie,selectionOnDrag:te,selectionMode:oe,deleteKeyCode:de,multiSelectionKeyCode:Se,panActivationKeyCode:ve,zoomActivationKeyCode:he,onlyRenderVisibleElements:Ce,defaultViewport:ft,translateExtent:Bt,minZoom:Vt,maxZoom:Ut,preventScrolling:vn,zoomOnScroll:Je,zoomOnPinch:Yt,zoomOnDoubleClick:kl,panOnScroll:pt,panOnScrollSpeed:Sn,panOnScrollMode:Mt,panOnDrag:gt,autoPanOnSelection:yr,onPaneClick:$i,onPaneMouseEnter:Wn,onPaneMouseMove:di,onPaneMouseLeave:Hi,onPaneScroll:Gt,onPaneContextMenu:hi,paneClickDistance:Pn,nodeClickDistance:zl,onSelectionContextMenu:H,onSelectionStart:$,onSelectionEnd:X,onReconnect:Nt,onReconnectStart:ei,onReconnectEnd:Lt,onEdgeContextMenu:Ui,onEdgeDoubleClick:Ii,onEdgeMouseEnter:la,onEdgeMouseMove:ln,onEdgeMouseLeave:Ns,reconnectRadius:oa,defaultMarkerColor:Ol,noDragClassName:dt,noWheelClassName:At,noPanClassName:Rn,rfId:da,disableKeyboardA11y:qi,nodeExtent:bn,viewport:ua,onViewportChange:Bn}),b.jsx(BT,{onSelectionChange:le}),aa,b.jsx(kT,{proOptions:tt,position:Be}),b.jsx(OT,{rfId:da,disableKeyboardA11y:qi})]})})}var mM=_1(hM);const pM=e=>e.domNode?.querySelector(".react-flow__edgelabel-renderer");function gM({children:e}){const n=Re(pM);return n?ET.createPortal(e,n):null}function yM({dimensions:e,lineWidth:n,variant:s,className:a}){return b.jsx("path",{strokeWidth:n,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:xt(["react-flow__background-pattern",s,a])})}function vM({radius:e,className:n}){return b.jsx("circle",{cx:e,cy:e,r:e,className:xt(["react-flow__background-pattern","dots",n])})}var Ss;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(Ss||(Ss={}));const bM={[Ss.Dots]:1,[Ss.Lines]:1,[Ss.Cross]:6},SM=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function F1({id:e,variant:n=Ss.Dots,gap:s=20,size:a,lineWidth:o=1,offset:c=0,color:u,bgColor:d,style:h,className:p,patternClassName:y}){const g=V.useRef(null),{transform:v,patternId:x}=Re(SM,it),E=a||bM[n],_=n===Ss.Dots,T=n===Ss.Cross,C=Array.isArray(s)?s:[s,s],k=[C[0]*v[2]||1,C[1]*v[2]||1],A=E*v[2],N=Array.isArray(c)?c:[c,c],j=T?[A,A]:k,D=[N[0]*v[2]||1+j[0]/2,N[1]*v[2]||1+j[1]/2],B=`${x}${e||""}`;return b.jsxs("svg",{className:xt(["react-flow__background",p]),style:{...h,...Mu,"--xy-background-color-props":d,"--xy-background-pattern-color-props":u},ref:g,"data-testid":"rf__background",children:[b.jsx("pattern",{id:B,x:v[0]%k[0],y:v[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${D[0]},-${D[1]})`,children:_?b.jsx(vM,{radius:A/2,className:y}):b.jsx(yM,{dimensions:j,lineWidth:o,variant:n,className:y})}),b.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${B})`})]})}F1.displayName="Background";const wM=V.memo(F1);function xM(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:b.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function EM(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:b.jsx("path",{d:"M0 0h32v4.2H0z"})})}function NM(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:b.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 _M(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.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 AM(){return b.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:b.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 Hc({children:e,className:n,...s}){return b.jsx("button",{type:"button",className:xt(["react-flow__controls-button",n]),...s,children:e})}const TM=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function J1({style:e,showZoom:n=!0,showFitView:s=!0,showInteractive:a=!0,fitViewOptions:o,onZoomIn:c,onZoomOut:u,onFitView:d,onInteractiveChange:h,className:p,children:y,position:g="bottom-left",orientation:v="vertical","aria-label":x}){const E=at(),{isInteractive:_,minZoomReached:T,maxZoomReached:C,ariaLabelConfig:k}=Re(TM,it),{zoomIn:A,zoomOut:N,fitView:j}=dr(),D=()=>{A(),c?.()},B=()=>{N(),u?.()},R=()=>{j(o),d?.()},U=()=>{E.setState({nodesDraggable:!_,nodesConnectable:!_,elementsSelectable:!_}),h?.(!_)},q=v==="horizontal"?"horizontal":"vertical";return b.jsxs(Cu,{className:xt(["react-flow__controls",q,p]),position:g,style:e,"data-testid":"rf__controls","aria-label":x??k["controls.ariaLabel"],children:[n&&b.jsxs(b.Fragment,{children:[b.jsx(Hc,{onClick:D,className:"react-flow__controls-zoomin",title:k["controls.zoomIn.ariaLabel"],"aria-label":k["controls.zoomIn.ariaLabel"],disabled:C,children:b.jsx(xM,{})}),b.jsx(Hc,{onClick:B,className:"react-flow__controls-zoomout",title:k["controls.zoomOut.ariaLabel"],"aria-label":k["controls.zoomOut.ariaLabel"],disabled:T,children:b.jsx(EM,{})})]}),s&&b.jsx(Hc,{className:"react-flow__controls-fitview",onClick:R,title:k["controls.fitView.ariaLabel"],"aria-label":k["controls.fitView.ariaLabel"],children:b.jsx(NM,{})}),a&&b.jsx(Hc,{className:"react-flow__controls-interactive",onClick:U,title:k["controls.interactive.ariaLabel"],"aria-label":k["controls.interactive.ariaLabel"],children:_?b.jsx(AM,{}):b.jsx(_M,{})}),y]})}J1.displayName="Controls";const CM=V.memo(J1);function MM({id:e,x:n,y:s,width:a,height:o,style:c,color:u,strokeColor:d,strokeWidth:h,className:p,borderRadius:y,shapeRendering:g,selected:v,onClick:x}){const{background:E,backgroundColor:_}=c||{},T=u||E||_;return b.jsx("rect",{className:xt(["react-flow__minimap-node",{selected:v},p]),x:n,y:s,rx:y,ry:y,width:a,height:o,style:{fill:T,stroke:d,strokeWidth:h},shapeRendering:g,onClick:x?C=>x(C,e):void 0})}const OM=V.memo(MM),kM=e=>e.nodes.map(n=>n.id),gh=e=>e instanceof Function?e:()=>e;function zM({nodeStrokeColor:e,nodeColor:n,nodeClassName:s="",nodeBorderRadius:a=5,nodeStrokeWidth:o,nodeComponent:c=OM,onClick:u}){const d=Re(kM,it),h=gh(n),p=gh(e),y=gh(s),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return b.jsx(b.Fragment,{children:d.map(v=>b.jsx(jM,{id:v,nodeColorFunc:h,nodeStrokeColorFunc:p,nodeClassNameFunc:y,nodeBorderRadius:a,nodeStrokeWidth:o,NodeComponent:c,onClick:u,shapeRendering:g},v))})}function DM({id:e,nodeColorFunc:n,nodeStrokeColorFunc:s,nodeClassNameFunc:a,nodeBorderRadius:o,nodeStrokeWidth:c,shapeRendering:u,NodeComponent:d,onClick:h}){const{node:p,x:y,y:g,width:v,height:x}=Re(E=>{const _=E.nodeLookup.get(e);if(!_)return{node:void 0,x:0,y:0,width:0,height:0};const T=_.internals.userNode,{x:C,y:k}=_.internals.positionAbsolute,{width:A,height:N}=Li(T);return{node:T,x:C,y:k,width:A,height:N}},it);return!p||p.hidden||!Pb(p)?null:b.jsx(d,{x:y,y:g,width:v,height:x,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 jM=V.memo(DM);var RM=V.memo(zM);const BM=200,LM=150,$M=e=>!e.hidden,HM=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?Jb(ur(e.nodeLookup,{filter:$M}),n):n,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},UM="react-flow__minimap-desc";function W1({style:e,className:n,nodeStrokeColor:s,nodeColor:a,nodeClassName:o="",nodeBorderRadius:c=5,nodeStrokeWidth:u,nodeComponent:d,bgColor:h,maskColor:p,maskStrokeColor:y,maskStrokeWidth:g,position:v="bottom-right",onClick:x,onNodeClick:E,pannable:_=!1,zoomable:T=!1,ariaLabel:C,inversePan:k,zoomStep:A=1,offsetScale:N=5}){const j=at(),D=V.useRef(null),{boundingRect:B,viewBB:R,rfId:U,panZoom:q,translateExtent:Y,flowWidth:Z,flowHeight:le,ariaLabelConfig:L}=Re(HM,it),K=e?.width??BM,O=e?.height??LM,H=B.width/K,$=B.height/O,X=Math.max(H,$),se=X*K,w=X*O,z=N*X,F=B.x-(se-B.width)/2-z,W=B.y-(w-B.height)/2-z,fe=se+z*2,de=w+z*2,ie=`${UM}-${U}`,te=V.useRef(0),oe=V.useRef();te.current=X,V.useEffect(()=>{if(D.current&&q)return oe.current=JA({domNode:D.current,panZoom:q,getTransform:()=>j.getState().transform,getViewScale:()=>te.current}),()=>{oe.current?.destroy()}},[q]),V.useEffect(()=>{oe.current?.update({translateExtent:Y,width:Z,height:le,inversePan:k,pannable:_,zoomStep:A,zoomable:T})},[_,T,k,A,Y,Z,le]);const ve=x?ge=>{const[Ee,Ce]=oe.current?.pointer(ge)||[0,0];x(ge,{x:Ee,y:Ce})}:void 0,Se=E?V.useCallback((ge,Ee)=>{const Ce=j.getState().nodeLookup.get(Ee).internals.userNode;E(ge,Ce)},[]):void 0,he=C??L["minimap.ariaLabel"];return b.jsx(Cu,{position:v,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 y=="string"?y: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:xt(["react-flow__minimap",n]),"data-testid":"rf__minimap",children:b.jsxs("svg",{width:K,height:O,viewBox:`${F} ${W} ${fe} ${de}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":ie,ref:D,onClick:ve,children:[he&&b.jsx("title",{id:ie,children:he}),b.jsx(RM,{onClick:Se,nodeColor:a,nodeStrokeColor:s,nodeBorderRadius:c,nodeClassName:o,nodeStrokeWidth:u,nodeComponent:d}),b.jsx("path",{className:"react-flow__minimap-mask",d:`M${F-z},${W-z}h${fe+z*2}v${de+z*2}h${-fe-z*2}z
15
+ M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}W1.displayName="MiniMap";V.memo(W1);const IM=e=>n=>e?`${Math.max(1/n.transform[2],1)}`:void 0,qM={[yl.Line]:"right",[yl.Handle]:"bottom-right"};function VM({nodeId:e,position:n,variant:s=yl.Handle,className:a,style:o=void 0,children:c,color:u,minWidth:d=10,minHeight:h=10,maxWidth:p=Number.MAX_VALUE,maxHeight:y=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:v,autoScale:x=!0,shouldResize:E,onResizeStart:_,onResize:T,onResizeEnd:C}){const k=M1(),A=typeof e=="string"?e:k,N=at(),j=V.useRef(null),D=s===yl.Handle,B=Re(V.useCallback(IM(D&&x),[D,x]),it),R=V.useRef(null),U=n??qM[s];V.useEffect(()=>{if(!(!j.current||!A))return R.current||(R.current=uT({domNode:j.current,nodeId:A,getStoreItems:()=>{const{nodeLookup:Y,transform:Z,snapGrid:le,snapToGrid:L,nodeOrigin:K,domNode:O}=N.getState();return{nodeLookup:Y,transform:Z,snapGrid:le,snapToGrid:L,nodeOrigin:K,paneDomNode:O}},onChange:(Y,Z)=>{const{triggerNodeChanges:le,nodeLookup:L,parentLookup:K,nodeOrigin:O}=N.getState(),H=[],$={x:Y.x,y:Y.y},X=L.get(A);if(X&&X.expandParent&&X.parentId){const se=X.origin??O,w=Y.width??X.measured.width??0,z=Y.height??X.measured.height??0,F={id:X.id,parentId:X.parentId,rect:{width:w,height:z,...e1({x:Y.x??X.position.x,y:Y.y??X.position.y},{width:w,height:z},X.parentId,L,se)}},W=vm([F],L,K,O);H.push(...W),$.x=Y.x?Math.max(se[0]*w,Y.x):void 0,$.y=Y.y?Math.max(se[1]*z,Y.y):void 0}if($.x!==void 0&&$.y!==void 0){const se={id:A,type:"position",position:{...$}};H.push(se)}if(Y.width!==void 0&&Y.height!==void 0){const w={id:A,type:"dimensions",resizing:!0,setAttributes:v?v==="horizontal"?"width":"height":!0,dimensions:{width:Y.width,height:Y.height}};H.push(w)}for(const se of Z){const w={...se,type:"position"};H.push(w)}le(H)},onEnd:({width:Y,height:Z})=>{const le={id:A,type:"dimensions",resizing:!1,dimensions:{width:Y,height:Z}};N.getState().triggerNodeChanges([le])}})),R.current.update({controlPosition:U,boundaries:{minWidth:d,minHeight:h,maxWidth:p,maxHeight:y},keepAspectRatio:g,resizeDirection:v,onResizeStart:_,onResize:T,onResizeEnd:C,shouldResize:E}),()=>{R.current?.destroy()}},[U,d,h,p,y,g,_,T,C,E]);const q=U.split("-");return b.jsx("div",{className:xt(["react-flow__resize-control","nodrag",...q,s,a]),ref:j,style:{...o,scale:B,...u&&{[D?"backgroundColor":"borderColor"]:u}},children:c})}V.memo(VM);const yh="emviz.viewerToken";let Xa;function YM(){const e=new URLSearchParams(window.location.hash.slice(1));if(e.has("token")){const n=e.get("token")??"";Xa=/^[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{Xa?window.sessionStorage.setItem(yh,Xa):window.sessionStorage.removeItem(yh)}catch{}window.history.replaceState(window.history.state,"",window.location.pathname+window.location.search)}if(!Xa)try{Xa=window.sessionStorage.getItem(yh)??void 0}catch{}return Xa}function Uo(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=YM();return o&&!a.has("X-Emviz-Token")&&a.set("X-Emviz-Token",o),fetch(s.href,{...n,headers:a,redirect:"error"})}function Lv(){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 $v=3,GM=new Set(["command-event","event-query"]);function P1(e){return[...new Set(e)]}function eS(e){return e?.trim()?P1(e.split(/\r?\n/).map(n=>XM(n)).filter(n=>!!n)):[]}function XM(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 KM(e){const n=new Map(e.nodes.map(o=>[o.id,o])),s=new Map(e.nodes.map(o=>[o.id,eS(o.fields)])),a=new Map;for(const o of e.edges){if(!GM.has(o.kind))continue;const c=n.get(o.source),u=n.get(o.target);if(!Hv(c)||!Hv(u))continue;const d=s.get(o.source)??[],h=s.get(o.target)??[],p=new Set(h),y=d.filter(x=>p.has(x)),g=o.kind==="event-query"?QM(c,h,y):[],v=P1([...y,...g]);a.set(o.id,{sourceFieldNames:d,targetFieldNames:h,sharedFieldNames:y,derivedFieldNames:g,visibleFieldNames:v.slice(0,$v),remainingCount:Math.max(0,v.length-$v),sourceMissingFields:d.length===0,targetMissingFields:h.length===0})}return a}function ZM(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 Hv(e){return e?.type==="command"||e?.type==="event"||e?.type==="query"}function QM(e,n,s){const a=Uv(e.label),o=new Set(s);return n.filter(c=>!o.has(c)&&Uv(c).includes(a))}function Uv(e){return e.replace(/^(has|is|was|were)/i,"").replace(/been/gi,"").replace(/[^A-Za-z0-9]/g,"").toLowerCase()}const Zn=e=>e.id??e.name,nn=e=>e.storyId??e.storyName;function FM(e,n){if(!n)return e;const s=new Map(e.stories.map(g=>[Zn(g),g])),a=n.steps.flatMap(g=>{const v=s.get(g.storyId);return v?[v]:[]}),o=new Set(a.map(Zn)),c=new Map(a.flatMap(g=>g.slices.map(v=>[v,g]))),u=e.slices.filter(g=>c.has(g.path)).map(g=>{const v=c.get(g.path);return{...g,storyName:v.name,storyId:Zn(v)}}),d=g=>g.sourcePath??e.slices.find(v=>v.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 y=e.nodes.filter(g=>p.has(g.id)).map(g=>{if(g.type==="story"||g.type==="event")return g;const v=c.get(d(g)??"");return v?{...g,storyName:v.name,storyId:Zn(v)}:g});return{...e,stories:a,slices:u,nodes:y,edges:e.edges.filter(g=>p.has(g.source)&&p.has(g.target))}}function JM(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 vh(e,n){return n?void 0:e}function an(e){return e.id??e.path}function WM(e,n=!1){const s=new Map,a=new Map,o=new Map,c=new Map,u=new Map(e.slices.map(y=>[y.path,y])),d=new Map(e.stories.map(y=>[an(y),y])),h=y=>{const g=y.storyId??(y.type==="story"?y.label:nn(y)),v=e.stories.filter(E=>Zn(E)===g);if(y.storyId&&v.length===1)return v[0];const x=e.stories.filter(E=>E.path===y.sourcePath);return x.length===1?x[0]:v.length===1?v[0]:void 0};for(const y of e.slices){const g=y.storyId??y.storyName,v=e.stories.filter(E=>Zn(E)===g),x=v.find(E=>E.slices.includes(y.path))??(v.length===1?v[0]:void 0)??e.stories.find(E=>E.slices.includes(y.path));x&&c.set(y.path,an(x))}const p=y=>{if(y.sourcePath&&u.has(y.sourcePath))return y.sourcePath;const g=y.sliceTitle??(y.type==="slice"?y.label:void 0);if(!g)return;const v=nn(y),x=e.slices.filter(E=>E.title===g&&(!v||(E.storyId??E.storyName)===v));return x.length===1?x[0].path:void 0};for(const y of e.nodes){if(y.type==="story"){const _=h(y);_&&(a.set(y.id,Zn(_)),o.set(y.id,an(_)));continue}if(y.type==="event")continue;const g=p(y);g&&s.set(y.id,g);const v=g?c.get(g):void 0,x=v?d.get(v):h(y),E=x?Zn(x):g?u.get(g)?.storyId??u.get(g)?.storyName:nn(y);E&&a.set(y.id,E),x&&o.set(y.id,an(x))}for(const y of e.nodes){if(y.type!=="event")continue;const g=e.edges.find(_=>_.kind==="command-event"&&_.target===y.id),v=g?s.get(g.source):n?void 0:p(y);v&&s.set(y.id,v);const x=g?a.get(g.source):v?u.get(v)?.storyId??u.get(v)?.storyName:void 0,E=g?o.get(g.source):v?c.get(v):void 0;x&&a.set(y.id,x),E&&o.set(y.id,E)}return{sliceByNode:s,storyByNode:a,stableStoryByNode:o,stableStoryBySlice:c}}function PM(e,n,s,a){if(n==="all")return!0;const o=a.sliceByNode.get(e.source),c=a.sliceByNode.get(e.target);if(o&&o===c)return!0;if(n==="intra-slice"||!s)return!1;if(s.type==="slice"){const u=a.sliceByNode.get(s.id);return!!(u&&(o===u||c===u))}return e.source===s.id||e.target===s.id}function eO(e,n){const s=e.graphSidecar?.model?.id,a=e.root&&e.root!=="browser-import"?["root",e.root,s??null]:s&&s!=="browser_import"?["model",s]:["sources",...new Set(e.stories.map(o=>o.path).sort())];return"emviz:collapsed-stories:v1:"+encodeURIComponent(JSON.stringify([a,n??null]))}function tO(e,n,s){try{const a=(s??window.localStorage).getItem(e);if(!a)return new Set;const o=JSON.parse(a);return!Array.isArray(o)||o.some(c=>typeof c!="string")?new Set:new Set(o.filter(c=>!n||n.has(c)))}catch{return new Set}}function nO(e,n,s){try{return(s??window.localStorage).setItem(e,JSON.stringify([...n].sort())),!0}catch{return!1}}function iO(e,n){return"browser-import:"+JSON.stringify(e&&e!=="browser_import"?["model",e]:["session",n])}const Sm=Symbol.for("yaml.alias"),Vh=Symbol.for("yaml.document"),ws=Symbol.for("yaml.map"),tS=Symbol.for("yaml.pair"),ui=Symbol.for("yaml.scalar"),El=Symbol.for("yaml.seq"),Dn=Symbol.for("yaml.node.type"),ta=e=>!!e&&typeof e=="object"&&e[Dn]===Sm,na=e=>!!e&&typeof e=="object"&&e[Dn]===Vh,Nl=e=>!!e&&typeof e=="object"&&e[Dn]===ws,st=e=>!!e&&typeof e=="object"&&e[Dn]===tS,Fe=e=>!!e&&typeof e=="object"&&e[Dn]===ui,_l=e=>!!e&&typeof e=="object"&&e[Dn]===El;function lt(e){if(e&&typeof e=="object")switch(e[Dn]){case ws:case El:return!0}return!1}function ot(e){if(e&&typeof e=="object")switch(e[Dn]){case Sm:case ws:case ui:case El:return!0}return!1}const nS=e=>(Fe(e)||lt(e))&&!!e.anchor,tn=Symbol("break visit"),iS=Symbol("skip children"),ci=Symbol("remove node");function ia(e,n){const s=sS(n);na(e)?Wa(null,e.contents,s,Object.freeze([e]))===ci&&(e.contents=null):Wa(null,e,s,Object.freeze([]))}ia.BREAK=tn;ia.SKIP=iS;ia.REMOVE=ci;function Wa(e,n,s,a){const o=aS(e,n,s,a);if(ot(o)||st(o))return lS(e,a,o),Wa(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=Wa(c,n.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===tn)return tn;u===ci&&(n.items.splice(c,1),c-=1)}}}else if(st(n)){a=Object.freeze(a.concat(n));const c=Wa("key",n.key,s,a);if(c===tn)return tn;c===ci&&(n.key=null);const u=Wa("value",n.value,s,a);if(u===tn)return tn;u===ci&&(n.value=null)}}return o}async function Ou(e,n){const s=sS(n);na(e)?await Pa(null,e.contents,s,Object.freeze([e]))===ci&&(e.contents=null):await Pa(null,e,s,Object.freeze([]))}Ou.BREAK=tn;Ou.SKIP=iS;Ou.REMOVE=ci;async function Pa(e,n,s,a){const o=await aS(e,n,s,a);if(ot(o)||st(o))return lS(e,a,o),Pa(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 Pa(c,n.items[c],s,a);if(typeof u=="number")c=u-1;else{if(u===tn)return tn;u===ci&&(n.items.splice(c,1),c-=1)}}}else if(st(n)){a=Object.freeze(a.concat(n));const c=await Pa("key",n.key,s,a);if(c===tn)return tn;c===ci&&(n.key=null);const u=await Pa("value",n.value,s,a);if(u===tn)return tn;u===ci&&(n.value=null)}}return o}function sS(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 aS(e,n,s,a){if(typeof s=="function")return s(e,n,a);if(Nl(n))return s.Map?.(e,n,a);if(_l(n))return s.Seq?.(e,n,a);if(st(n))return s.Pair?.(e,n,a);if(Fe(n))return s.Scalar?.(e,n,a);if(ta(n))return s.Alias?.(e,n,a)}function lS(e,n,s){const a=n[n.length-1];if(lt(a))a.items[e]=s;else if(st(a))e==="key"?a.key=s:a.value=s;else if(na(a))a.contents=s;else{const o=ta(a)?"alias":"scalar";throw new Error(`Cannot replace node with ${o} parent`)}}const sO={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},aO=e=>e.replace(/[!,[\]{}]/g,n=>sO[n]);class qt{constructor(n,s){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},qt.defaultYaml,n),this.tags=Object.assign({},qt.defaultTags,s)}clone(){const n=new qt(this.yaml,this.tags);return n.docStart=this.docStart,n}atDocument(){const n=new qt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:qt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},qt.defaultTags);break}return n}add(n,s){this.atNextDocument&&(this.yaml={explicit:qt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},qt.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+aO(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={};ia(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
+ `)}}qt.defaultYaml={explicit:!1,version:"1.2"};qt.defaultTags={"!!":"tag:yaml.org,2002:"};function oS(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 rS(e){const n=new Set;return ia(e,{Value(s,a){a.anchor&&n.add(a.anchor)}}),n}function cS(e,n){for(let s=1;;++s){const a=`${e}${s}`;if(!n.has(a))return a}}function lO(e,n){const s=[],a=new Map;let o=null;return{onAnchor:c=>{s.push(c),o??(o=rS(e));const u=cS(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 el(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=el(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=el(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=el(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=el(e,a,o,c);u===void 0?delete a[o]:u!==c&&(a[o]=u)}return e.call(n,s,a)}function zn(e,n,s){if(Array.isArray(e))return e.map((a,o)=>zn(a,String(o),s));if(e&&typeof e.toJSON=="function"){if(!s||!nS(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 wm{constructor(n){Object.defineProperty(this,Dn,{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(!na(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=zn(this,"",u);if(typeof o=="function")for(const{count:h,res:p}of u.anchors.values())o(p,h);return typeof c=="function"?el(c,{"":d},"",d):d}}class ku extends wm{constructor(n){super(Sm),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=[],ia(n,{Node:(c,u)=>{(ta(u)||nS(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||(zn(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=Jc(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(oS(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 Jc(e,n,s){if(ta(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=Jc(e,o,s);c>a&&(a=c)}return a}else if(st(n)){const a=Jc(e,n.key,s),o=Jc(e,n.value,s);return Math.max(a,o)}return 1}const uS=e=>!e||typeof e!="function"&&typeof e!="object";class Ae extends wm{constructor(n){super(ui),this.value=n}toJSON(n,s){return s?.keep?this.value:zn(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 oO="tag:yaml.org,2002:";function rO(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 er(e,n,s){if(na(e)&&(e=e.contents),ot(e))return e;if(st(e)){const g=s.schema[ws].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 ku(h.anchor);h={anchor:null,node:null},d.set(e,h)}n?.startsWith("!!")&&(n=oO+n.slice(2));let p=rO(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[ws]:Symbol.iterator in Object(e)?u[El]:u[ws]}c&&(c(p),delete s.onTagObj);const y=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?y.tag=n:p.default||(y.tag=p.tag),h&&(h.node=y),y}function du(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 er(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 jo=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class fS extends wm{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)||st(a)?a.clone(n):a),this.range&&(s.range=this.range.slice()),s}addIn(n,s){if(jo(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,du(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(!st(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,du(this.schema,o,s));else throw new Error(`Expected YAML collection at ${a}. Remaining path: ${o}`)}}}const cO=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function ji(e,n){return/^\n+$/.test(e)?e.substring(1):n?e.replace(/^(?! *$)/gm,n):e}const Vs=(e,n,s)=>e.endsWith(`
17
+ `)?ji(s,n):s.includes(`
18
+ `)?`
19
+ `+ji(s,n):(e.endsWith(" ")?"":" ")+s,dS="flow",Yh="block",Wc="quoted";function zu(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=[],y={};let g=o-n.length;typeof a=="number"&&(a>o-Math.max(2,c)?p.push(0):g=o-a);let v,x,E=!1,_=-1,T=-1,C=-1;s===Yh&&(_=Iv(e,_,n.length),_!==-1&&(g=_+h));for(let A;A=e[_+=1];){if(s===Wc&&A==="\\"){switch(T=_,e[_+1]){case"x":_+=3;break;case"u":_+=5;break;case"U":_+=9;break;default:_+=1}C=_}if(A===`
20
+ `)s===Yh&&(_=Iv(e,_,n.length)),g=_+n.length+h,v=void 0;else{if(A===" "&&x&&x!==" "&&x!==`
21
+ `&&x!==" "){const N=e[_+1];N&&N!==" "&&N!==`
22
+ `&&N!==" "&&(v=_)}if(_>=g)if(v)p.push(v),g=v+h,v=void 0;else if(s===Wc){for(;x===" "||x===" ";)x=A,A=e[_+=1],E=!0;const N=_>C+1?_-2:T-1;if(y[N])return e;p.push(N),y[N]=!0,g=N+h,v=void 0}else E=!0}x=A}if(E&&d&&d(),p.length===0)return e;u&&u();let k=e.slice(0,p[0]);for(let A=0;A<p.length;++A){const N=p[A],j=p[A+1]||e.length;N===0?k=`
23
+ ${n}${e.slice(0,j)}`:(s===Wc&&y[N]&&(k+=`${e[N]}\\`),k+=`
24
+ ${n}${e.slice(N+1,j)}`)}return k}function Iv(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 Du=(e,n)=>({indentAtStart:n?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),ju=e=>/^(%|---|\.\.\.)/m.test(e);function uO(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 Io(e,n){const s=JSON.stringify(e);if(n.options.doubleQuotedAsJSON)return s;const{implicitKey:a}=n,o=n.options.doubleQuotedMinMultiLineLength,c=n.indent||(ju(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 y=s.substr(h+2,4);switch(y){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:y.substr(0,2)==="00"?u+="\\x"+y.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:zu(u,c,Wc,Du(n,!1))}function Gh(e,n){if(n.options.singleQuote===!1||n.implicitKey&&e.includes(`
30
+ `)||/[ \t]\n|\n[ \t]/.test(e))return Io(e,n);const s=n.indent||(ju(e)?" ":""),a="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
31
+ ${s}`)+"'";return n.implicitKey?a:zu(a,s,dS,Du(n,!1))}function tl(e,n){const{singleQuote:s}=n.options;let a;if(s===!1)a=Io;else{const o=e.includes('"'),c=e.includes("'");o&&!c?a=Gh:c&&!o?a=Io:a=s?Gh:Io}return a(e,n)}let Xh;try{Xh=new RegExp(`(^|(?<!
32
+ ))
33
+ +(?!
34
+ |$)`,"g")}catch{Xh=/\n+(?!\n|$)/g}function Pc({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 tl(s,a);const p=a.indent||(a.forceBlockIndent||ju(s)?" ":""),y=u==="literal"?!0:u==="folded"||n===Ae.BLOCK_FOLDED?!1:n===Ae.BLOCK_LITERAL?!0:!uO(s,h,p.length);if(!s)return y?`|
35
+ `:`>
36
+ `;let g,v;for(v=s.length;v>0;--v){const j=s[v-1];if(j!==`
37
+ `&&j!==" "&&j!==" ")break}let x=s.substring(v);const E=x.indexOf(`
38
+ `);E===-1?g="-":s===x||E!==x.length-1?(g="+",c&&c()):g="",x&&(s=s.slice(0,-x.length),x[x.length-1]===`
39
+ `&&(x=x.slice(0,-1)),x=x.replace(Xh,`$&${p}`));let _=!1,T,C=-1;for(T=0;T<s.length;++T){const j=s[T];if(j===" ")_=!0;else if(j===`
40
+ `)C=T;else break}let k=s.substring(0,C<T?C+1:T);k&&(s=s.substring(k.length),k=k.replace(/\n+/g,`$&${p}`));let N=(_?p?"2":"1":"")+g;if(e&&(N+=" "+d(e.replace(/ ?[\r\n]+/g," ")),o&&o()),!y){const j=s.replace(/\n+/g,`
41
+ $&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${p}`);let D=!1;const B=Du(a,!0);u!=="folded"&&n!==Ae.BLOCK_FOLDED&&(B.onOverflow=()=>{D=!0});const R=zu(`${k}${j}${x}`,p,Yh,B);if(!D)return`>${N}
42
+ ${p}${R}`}return s=s.replace(/\n+/g,`$&${p}`),`|${N}
43
+ ${p}${k}${s}${x}`}function fO(e,n,s,a){const{type:o,value:c}=e,{actualString:u,implicitKey:d,indent:h,indentStep:p,inFlow:y}=n;if(d&&c.includes(`
44
+ `)||y&&/[[\]{},]/.test(c))return tl(c,n);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(c))return d||y||!c.includes(`
45
+ `)?tl(c,n):Pc(e,n,s,a);if(!d&&!y&&o!==Ae.PLAIN&&c.includes(`
46
+ `))return Pc(e,n,s,a);if(ju(c)){if(h==="")return n.forceBlockIndent=!0,Pc(e,n,s,a);if(d&&h===p)return tl(c,n)}const g=c.replace(/\n+/g,`$&
47
+ ${h}`);if(u){const v=_=>_.default&&_.tag!=="tag:yaml.org,2002:str"&&_.test?.test(g),{compat:x,tags:E}=n.doc.schema;if(E.some(v)||x?.some(v))return tl(c,n)}return d?g:zu(g,h,dS,Du(n,!1))}function mr(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=y=>{switch(y){case Ae.BLOCK_FOLDED:case Ae.BLOCK_LITERAL:return o||c?tl(u.value,n):Pc(u,n,s,a);case Ae.QUOTE_DOUBLE:return Io(u.value,n);case Ae.QUOTE_SINGLE:return Gh(u.value,n);case Ae.PLAIN:return fO(u,n,s,a);default:return null}};let p=h(d);if(p===null){const{defaultKeyType:y,defaultStringType:g}=n.options,v=o&&y||g;if(p=h(v),p===null)throw new Error(`Unsupported default string type ${v}`)}return p}function hS(e,n){const s=Object.assign({blockQuote:!0,commentString:cO,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 dO(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 hO(e,n,{anchors:s,doc:a}){if(!a.directives)return"";const o=[],c=(Fe(e)||lt(e))&&e.anchor;c&&oS(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 vl(e,n,s,a){if(st(e))return e.toString(n,s,a);if(ta(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=dO(n.doc.schema.tags,c));const u=hO(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)?mr(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 mO({key:e,value:n},s,a,o){const{allNullValues:c,doc:u,indent:d,indentStep:h,options:{commentString:p,indentSeq:y,simpleKeys:g}}=s;let v=ot(e)&&e.comment||null;if(g){if(v)throw new Error("With simple keys, key nodes cannot have comments");if(lt(e)||!ot(e)&&typeof e=="object"){const B="With simple keys, collection cannot be used as a key value";throw new Error(B)}}let x=!g&&(!e||v&&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:!x&&(g||!c),indent:d+h});let E=!1,_=!1,T=vl(e,s,()=>E=!0,()=>_=!0);if(!x&&!s.inFlow&&T.length>1024){if(g)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");x=!0}if(s.inFlow){if(c||n==null)return E&&a&&a(),T===""?"?":x?`? ${T}`:T}else if(c&&!g||n==null&&x)return T=`? ${T}`,v&&!E?T+=Vs(T,s.indent,p(v)):_&&o&&o(),T;E&&(v=null),x?(v&&(T+=Vs(T,s.indent,p(v))),T=`? ${T}
49
+ ${d}:`):(T=`${T}:`,v&&(T+=Vs(T,s.indent,p(v))));let C,k,A;ot(n)?(C=!!n.spaceBefore,k=n.commentBefore,A=n.comment):(C=!1,k=null,A=null,n&&typeof n=="object"&&(n=u.createNode(n))),s.implicitKey=!1,!x&&!v&&Fe(n)&&(s.indentAtStart=T.length+1),_=!1,!y&&h.length>=2&&!s.inFlow&&!x&&_l(n)&&!n.flow&&!n.tag&&!n.anchor&&(s.indent=s.indent.substring(2));let N=!1;const j=vl(n,s,()=>N=!0,()=>_=!0);let D=" ";if(v||C||k){if(D=C?`
50
+ `:"",k){const B=p(k);D+=`
51
+ ${ji(B,s.indent)}`}j===""&&!s.inFlow?D===`
52
+ `&&A&&(D=`
53
+
54
+ `):D+=`
55
+ ${s.indent}`}else if(!x&&lt(n)){const B=j[0],R=j.indexOf(`
56
+ `),U=R!==-1,q=s.inFlow??n.flow??n.items.length===0;if(U||!q){let Y=!1;if(U&&(B==="&"||B==="!")){let Z=j.indexOf(" ");B==="&"&&Z!==-1&&Z<R&&j[Z+1]==="!"&&(Z=j.indexOf(" ",Z+1)),(Z===-1||R<Z)&&(Y=!0)}Y||(D=`
57
+ ${s.indent}`)}}else(j===""||j[0]===`
58
+ `)&&(D="");return T+=D+j,s.inFlow?N&&a&&a():A&&!N?T+=Vs(T,s.indent,p(A)):_&&o&&o(),T}function mS(e,n){(e==="debug"||e==="warn")&&console.warn(n)}const Uc="<<",Ri={identify:e=>e===Uc||typeof e=="symbol"&&e.description===Uc,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new Ae(Symbol(Uc)),{addToJSMap:pS}),stringify:()=>Uc},pO=(e,n)=>(Ri.identify(n)||Fe(n)&&(!n.type||n.type===Ae.PLAIN)&&Ri.identify(n.value))&&e?.doc.schema.tags.some(s=>s.tag===Ri.tag&&s.default);function pS(e,n,s){const a=gS(e,s);if(_l(a))for(const o of a.items)bh(e,n,o);else if(Array.isArray(a))for(const o of a)bh(e,n,o);else bh(e,n,a)}function bh(e,n,s){const a=gS(e,s);if(!Nl(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 gS(e,n){return e&&ta(n)?n.resolve(e.doc,e):n}function yS(e,n,{key:s,value:a}){if(ot(s)&&s.addToJSMap)s.addToJSMap(e,n,a);else if(pO(e,s))pS(e,n,a);else{const o=zn(s,"",e);if(n instanceof Map)n.set(o,zn(a,o,e));else if(n instanceof Set)n.add(o);else{const c=gO(s,o,e),u=zn(a,c,e);c in n?Object.defineProperty(n,c,{value:u,writable:!0,enumerable:!0,configurable:!0}):n[c]=u}}return n}function gO(e,n,s){if(n===null)return"";if(typeof n!="object")return String(n);if(ot(e)&&s?.doc){const a=hS(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)+'..."'),mS(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 xm(e,n,s){const a=er(e,void 0,s),o=er(n,void 0,s);return new Ht(a,o)}class Ht{constructor(n,s=null){Object.defineProperty(this,Dn,{value:tS}),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 Ht(s,a)}toJSON(n,s){const a=s?.mapAsMap?new Map:{};return yS(s,a,this)}toString(n,s,a){return n?.doc?mO(this,n,s,a):JSON.stringify(this)}}function vS(e,n,s){return(n.inFlow??e.flow?vO:yO)(e,n,s)}function yO({comment:e,items:n},s,{blockItemPrefix:a,flowChars:o,itemIndent:c,onChompKeep:u,onComment:d}){const{indent:h,options:{commentString:p}}=s,y=Object.assign({},s,{indent:c,type:null});let g=!1;const v=[];for(let E=0;E<n.length;++E){const _=n[E];let T=null;if(ot(_))!g&&_.spaceBefore&&v.push(""),hu(s,v,_.commentBefore,g),_.comment&&(T=_.comment);else if(st(_)){const k=ot(_.key)?_.key:null;k&&(!g&&k.spaceBefore&&v.push(""),hu(s,v,k.commentBefore,g))}g=!1;let C=vl(_,y,()=>T=null,()=>g=!0);T&&(C+=Vs(C,c,p(T))),g&&T&&(g=!1),v.push(a+C)}let x;if(v.length===0)x=o.start+o.end;else{x=v[0];for(let E=1;E<v.length;++E){const _=v[E];x+=_?`
59
+ ${h}${_}`:`
60
+ `}}return e?(x+=`
61
+ `+ji(p(e),h),d&&d()):g&&u&&u(),x}function vO({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,y=0;const g=[];for(let E=0;E<e.length;++E){const _=e[E];let T=null;if(ot(_))_.spaceBefore&&g.push(""),hu(n,g,_.commentBefore,!1),_.comment&&(T=_.comment);else if(st(_)){const k=ot(_.key)?_.key:null;k&&(k.spaceBefore&&g.push(""),hu(n,g,k.commentBefore,!1),k.comment&&(p=!0));const A=ot(_.value)?_.value:null;A?(A.comment&&(T=A.comment),A.commentBefore&&(p=!0)):_.value==null&&k?.comment&&(T=k.comment)}T&&(p=!0);let C=vl(_,h,()=>T=null);p||(p=g.length>y||C.includes(`
62
+ `)),E<e.length-1?C+=",":n.options.trailingComma&&(n.options.lineWidth>0&&(p||(p=g.reduce((k,A)=>k+A.length+2,2)+(C.length+2)>n.options.lineWidth)),p&&(C+=",")),T&&(C+=Vs(C,a,d(T))),g.push(C),y=g.length}const{start:v,end:x}=s;if(g.length===0)return v+x;if(!p){const E=g.reduce((_,T)=>_+T.length+2,2);p=n.options.lineWidth>0&&E>n.options.lineWidth}if(p){let E=v;for(const _ of g)E+=_?`
63
+ ${c}${o}${_}`:`
64
+ `;return`${E}
65
+ ${o}${x}`}else return`${v}${u}${g.join(" ")}${u}${x}`}function hu({indent:e,options:{commentString:n}},s,a,o){if(a&&o&&(a=a.replace(/^\n+/,"")),a){const c=ji(n(a),e);s.push(c.trimStart())}}function Ys(e,n){const s=Fe(n)?n.value:n;for(const a of e)if(st(a)&&(a.key===n||a.key===s||Fe(a.key)&&a.key.value===s))return a}class gn extends fS{static get tagName(){return"tag:yaml.org,2002:map"}constructor(n){super(ws,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(xm(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;st(n)?a=n:!n||typeof n!="object"||!("key"in n)?a=new Ht(n,n?.value):a=new Ht(n.key,n.value);const o=Ys(this.items,a.key),c=this.schema?.sortMapEntries;if(o){if(!s)throw new Error(`Key ${a.key} already set`);Fe(o.value)&&uS(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=Ys(this.items,n);return s?this.items.splice(this.items.indexOf(s),1).length>0:!1}get(n,s){const o=Ys(this.items,n)?.value;return(!s&&Fe(o)?o.value:o)??void 0}has(n){return!!Ys(this.items,n)}set(n,s){this.add(new Ht(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)yS(s,o,c);return o}toString(n,s,a){if(!n)return JSON.stringify(this);for(const o of this.items)if(!st(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})),vS(this,n,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:n.indent||"",onChompKeep:a,onComment:s})}}const Al={collection:"map",default:!0,nodeClass:gn,tag:"tag:yaml.org,2002:map",resolve(e,n){return Nl(e)||n("Expected a mapping for this tag"),e},createNode:(e,n,s)=>gn.from(e,n,s)};class xs extends fS{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(n){super(El,n),this.items=[]}add(n){this.items.push(n)}delete(n){const s=Ic(n);return typeof s!="number"?!1:this.items.splice(s,1).length>0}get(n,s){const a=Ic(n);if(typeof a!="number")return;const o=this.items[a];return!s&&Fe(o)?o.value:o}has(n){const s=Ic(n);return typeof s=="number"&&s<this.items.length}set(n,s){const a=Ic(n);if(typeof a!="number")throw new Error(`Expected a valid index, not ${n}.`);const o=this.items[a];Fe(o)&&uS(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(zn(c,String(o++),s));return a}toString(n,s,a){return n?vS(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(er(d,void 0,a))}}return c}}function Ic(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 Tl={collection:"seq",default:!0,nodeClass:xs,tag:"tag:yaml.org,2002:seq",resolve(e,n){return _l(e)||n("Expected a sequence for this tag"),e},createNode:(e,n,s)=>xs.from(e,n,s)},Ru={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),mr(e,n,s,a)}},Bu={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"&&Bu.test.test(e)?e:n.options.nullStr},Em={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&&Em.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 Jn({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 bS={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:Jn},SS={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():Jn(e)}},wS={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:Jn},Lu=e=>typeof e=="bigint"||Number.isInteger(e),Nm=(e,n,s,{intAsBigInt:a})=>a?BigInt(e):parseInt(e.substring(n),s);function xS(e,n,s){const{value:a}=e;return Lu(a)&&a>=0?s+a.toString(n):Jn(e)}const ES={identify:e=>Lu(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,n,s)=>Nm(e,2,8,s),stringify:e=>xS(e,8,"0o")},NS={identify:Lu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,n,s)=>Nm(e,0,10,s),stringify:Jn},_S={identify:e=>Lu(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,n,s)=>Nm(e,2,16,s),stringify:e=>xS(e,16,"0x")},bO=[Al,Tl,Ru,Bu,Em,ES,NS,_S,bS,SS,wS];function qv(e){return typeof e=="bigint"||Number.isInteger(e)}const qc=({value:e})=>JSON.stringify(e),SO=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:qc},{identify:e=>e==null,createNode:()=>new Ae(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:qc},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:qc},{identify:qv,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})=>qv(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:qc}],wO={default:!0,tag:"",test:/^/,resolve(e,n){return n(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},xO=[Al,Tl].concat(SO,wO),_m={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),y=new Array(p);for(let g=0,v=0;g<p;++g,v+=h)y[g]=d.substr(v,h);d=y.join(n===Ae.BLOCK_LITERAL?`
66
+ `:" ")}return mr({comment:e,type:n,value:d},a,o,c)}};function AS(e,n){if(_l(e))for(let s=0;s<e.items.length;++s){let a=e.items[s];if(!st(a)){if(Nl(a)){a.items.length>1&&n("Each pair must have its own sequence indicator");const o=a.items[0]||new Ht(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]=st(a)?a:new Ht(a)}}else n("Expected a sequence for this tag");return e}function TS(e,n,s){const{replacer:a}=s,o=new xs(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(xm(d,h,s))}return o}const Am={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:AS,createNode:TS};class al extends xs{constructor(){super(),this.add=gn.prototype.add.bind(this),this.delete=gn.prototype.delete.bind(this),this.get=gn.prototype.get.bind(this),this.has=gn.prototype.has.bind(this),this.set=gn.prototype.set.bind(this),this.tag=al.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(st(o)?(c=zn(o.key,"",s),u=zn(o.value,c,s)):c=zn(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=TS(n,s,a),c=new this;return c.items=o.items,c}}al.tag="tag:yaml.org,2002:omap";const Tm={collection:"seq",identify:e=>e instanceof Map,nodeClass:al,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,n){const s=AS(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 al,s)},createNode:(e,n,s)=>al.from(e,n,s)};function CS({value:e,source:n},s){return n&&(e?MS:OS).test.test(n)?n:e?s.options.trueStr:s.options.falseStr}const MS={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:CS},OS={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:CS},EO={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:Jn},NO={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():Jn(e)}},_O={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:Jn},pr=e=>typeof e=="bigint"||Number.isInteger(e);function $u(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 Cm(e,n,s){const{value:a}=e;if(pr(a)){const o=a.toString(n);return a<0?"-"+s+o.substr(1):s+o}return Jn(e)}const AO={identify:pr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,n,s)=>$u(e,2,2,s),stringify:e=>Cm(e,2,"0b")},TO={identify:pr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,n,s)=>$u(e,1,8,s),stringify:e=>Cm(e,8,"0")},CO={identify:pr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,n,s)=>$u(e,0,10,s),stringify:Jn},MO={identify:pr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,n,s)=>$u(e,2,16,s),stringify:e=>Cm(e,16,"0x")};class ll extends gn{constructor(n){super(n),this.tag=ll.tag}add(n){let s;st(n)?s=n:n&&typeof n=="object"&&"key"in n&&"value"in n&&n.value===null?s=new Ht(n.key,null):s=new Ht(n,null),Ys(this.items,s.key)||this.items.push(s)}get(n,s){const a=Ys(this.items,n);return!s&&st(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=Ys(this.items,n);a&&!s?this.items.splice(this.items.indexOf(a),1):!a&&s&&this.items.push(new Ht(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(xm(u,null,a));return c}}ll.tag="tag:yaml.org,2002:set";const Mm={collection:"map",identify:e=>e instanceof Set,nodeClass:ll,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,n,s)=>ll.from(e,n,s),resolve(e,n){if(Nl(e)){if(e.hasAllNullValues(!0))return Object.assign(new ll,e);n("Set items must all have null values")}else n("Expected a mapping for this tag");return e}};function Om(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 kS(e){let{value:n}=e,s=u=>u;if(typeof n=="bigint")s=u=>BigInt(u);else if(isNaN(n)||!isFinite(n))return Jn(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 zS={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})=>Om(e,s),stringify:kS},DS={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=>Om(e,!1),stringify:kS},Hu={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(Hu.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 y=n[8];if(y&&y!=="Z"){let g=Om(y,!1);Math.abs(g)<30&&(g*=60),p-=6e4*g}return new Date(p)},stringify:({value:e})=>e?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Vv=[Al,Tl,Ru,Bu,MS,OS,AO,TO,CO,MO,EO,NO,_O,_m,Ri,Tm,Am,Mm,zS,DS,Hu],Yv=new Map([["core",bO],["failsafe",[Al,Tl,Ru]],["json",xO],["yaml11",Vv],["yaml-1.1",Vv]]),Gv={binary:_m,bool:Em,float:wS,floatExp:SS,floatNaN:bS,floatTime:DS,int:NS,intHex:_S,intOct:ES,intTime:zS,map:Al,merge:Ri,null:Bu,omap:Tm,pairs:Am,seq:Tl,set:Mm,timestamp:Hu},OO={"tag:yaml.org,2002:binary":_m,"tag:yaml.org,2002:merge":Ri,"tag:yaml.org,2002:omap":Tm,"tag:yaml.org,2002:pairs":Am,"tag:yaml.org,2002:set":Mm,"tag:yaml.org,2002:timestamp":Hu};function Sh(e,n,s){const a=Yv.get(n);if(a&&!e)return s&&!a.includes(Ri)?a.concat(Ri):a.slice();let o=a;if(!o)if(Array.isArray(e))o=[];else{const c=Array.from(Yv.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(Ri)),o.reduce((c,u)=>{const d=typeof u=="string"?Gv[u]:u;if(!d){const h=JSON.stringify(u),p=Object.keys(Gv).map(y=>JSON.stringify(y)).join(", ");throw new Error(`Unknown custom tag ${h}; use one of ${p}`)}return c.includes(d)||c.push(d),c},[])}const kO=(e,n)=>e.key<n.key?-1:e.key>n.key?1:0;class Uu{constructor({compat:n,customTags:s,merge:a,resolveKnownTags:o,schema:c,sortMapEntries:u,toStringDefaults:d}){this.compat=Array.isArray(n)?Sh(n,"compat"):n?Sh(null,n):null,this.name=typeof c=="string"&&c||"core",this.knownTags=o?OO:{},this.tags=Sh(s,this.name,a),this.toStringOptions=d??null,Object.defineProperty(this,ws,{value:Al}),Object.defineProperty(this,ui,{value:Ru}),Object.defineProperty(this,El,{value:Tl}),this.sortMapEntries=typeof u=="function"?u:u===!0?kO:null}clone(){const n=Object.create(Uu.prototype,Object.getOwnPropertyDescriptors(this));return n.tags=this.tags.slice(),n}}function zO(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=hS(e,n),{commentString:c}=o.options;if(e.commentBefore){s.length!==1&&s.unshift("");const h=c(e.commentBefore);s.unshift(ji(h,""))}let u=!1,d=null;if(e.contents){if(ot(e.contents)){if(e.contents.spaceBefore&&a&&s.push(""),e.contents.commentBefore){const y=c(e.contents.commentBefore);s.push(ji(y,""))}o.forceBlockIndent=!!e.comment,d=e.contents.comment}const h=d?void 0:()=>u=!0;let p=vl(e.contents,o,()=>d=null,h);d&&(p+=Vs(p,"",c(d))),(p[0]==="|"||p[0]===">")&&s[s.length-1]==="---"?s[s.length-1]=`--- ${p}`:s.push(p)}else s.push(vl(e.contents,o));if(e.directives?.docEnd)if(e.comment){const h=c(e.comment);h.includes(`
69
+ `)?(s.push("..."),s.push(ji(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(ji(c(h),"")))}return s.join(`
70
+ `)+`
71
+ `}class Cl{constructor(n,s,a){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Dn,{value:Vh});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 qt({version:u}),this.setSchema(u,a),this.contents=n===void 0?null:this.createNode(n,o,a)}clone(){const n=Object.create(Cl.prototype,{[Dn]:{value:Vh}});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){Ka(this.contents)&&this.contents.add(n)}addIn(n,s){Ka(this.contents)&&this.contents.addIn(n,s)}createAlias(n,s){if(!n.anchor){const a=rS(this);n.anchor=!s||a.has(s)?cS(s||"a",a):s}return new ku(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 T=k=>typeof k=="number"||k instanceof String||k instanceof Number,C=s.filter(T).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:y}=a??{},{onAnchor:g,setAnchors:v,sourceObjects:x}=lO(this,u||"a"),E={aliasDuplicateObjects:c??!0,keepUndefined:h??!1,onAnchor:g,onTagObj:p,replacer:o,schema:this.schema,sourceObjects:x},_=er(n,y,E);return d&&lt(_)&&(_.flow=!0),v(),_}createPair(n,s,a={}){const o=this.createNode(n,null,a),c=this.createNode(s,null,a);return new Ht(o,c)}delete(n){return Ka(this.contents)?this.contents.delete(n):!1}deleteIn(n){return jo(n)?this.contents==null?!1:(this.contents=null,!0):Ka(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 jo(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 jo(n)?this.contents!==void 0:lt(this.contents)?this.contents.hasIn(n):!1}set(n,s){this.contents==null?this.contents=du(this.schema,[n],s):Ka(this.contents)&&this.contents.set(n,s)}setIn(n,s){jo(n)?this.contents=s:this.contents==null?this.contents=du(this.schema,Array.from(n),s):Ka(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 qt({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 qt({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 Uu(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=zn(this.contents,s??"",d);if(typeof c=="function")for(const{count:p,res:y}of d.anchors.values())c(y,p);return typeof u=="function"?el(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 zO(this,n)}}function Ka(e){if(lt(e))return!0;throw new Error("Expected a YAML collection as document contents")}class km extends Error{constructor(n,s,a,o){super(),this.name=n,this.code=a,this.message=o,this.pos=s}}class Gs extends km{constructor(n,s,a){super("YAMLParseError",n,s,a)}}class jS extends km{constructor(n,s,a){super("YAMLWarning",n,s,a)}}const mu=(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 bl(e,{flow:n,indicator:s,next:a,offset:o,onError:c,parentIndent:u,startOnNewline:d}){let h=!1,p=d,y=d,g="",v="",x=!1,E=!1,_=null,T=null,C=null,k=null,A=null,N=null,j=null;for(const R of e)switch(E&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&c(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),E=!1),_&&(p&&R.type!=="comment"&&R.type!=="newline"&&c(_,"TAB_AS_INDENT","Tabs are not allowed as indentation"),_=null),R.type){case"space":!n&&(s!=="doc-start"||a?.type!=="flow-collection")&&R.source.includes(" ")&&(_=R),y=!0;break;case"comment":{y||c(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const U=R.source.substring(1)||" ";g?g+=v+U:g=U,v="",p=!1;break}case"newline":p?g?g+=R.source:(!N||s!=="seq-item-ind")&&(h=!0):v+=R.source,p=!0,x=!0,(T||C)&&(k=R),y=!0;break;case"anchor":T&&c(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&c(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),T=R,j??(j=R.offset),p=!1,y=!1,E=!0;break;case"tag":{C&&c(R,"MULTIPLE_TAGS","A node can have at most one tag"),C=R,j??(j=R.offset),p=!1,y=!1,E=!0;break}case s:(T||C)&&c(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),N&&c(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${n??"collection"}`),N=R,p=s==="seq-item-ind"||s==="explicit-key-ind",y=!1;break;case"comma":if(n){A&&c(R,"UNEXPECTED_TOKEN",`Unexpected , in ${n}`),A=R,p=!1,y=!1;break}default:c(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),p=!1,y=!1}const D=e[e.length-1],B=D?D.offset+D.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"),_&&(p&&_.indent<=u||a?.type==="block-map"||a?.type==="block-seq")&&c(_,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:A,found:N,spaceBefore:h,comment:g,hasNewline:x,anchor:T,tag:C,newlineAfterProp:k,end:B,start:j??B}}function tr(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(tr(n.key)||tr(n.value))return!0}return!1;default:return!0}}function Kh(e,n,s){if(n?.type==="flow-collection"){const a=n.end[0];a.indent===e&&(a.source==="]"||a.source==="}")&&tr(n)&&s(a,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function RS(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 Xv="All mapping items must start at the same column";function DO({composeNode:e,composeEmptyNode:n},s,a,o,c){const u=c?.nodeClass??gn,d=new u(s.schema);s.atRoot&&(s.atRoot=!1);let h=a.offset,p=null;for(const y of a.items){const{start:g,key:v,sep:x,value:E}=y,_=bl(g,{indicator:"explicit-key-ind",next:v??x?.[0],offset:h,onError:o,parentIndent:a.indent,startOnNewline:!0}),T=!_.found;if(T){if(v&&(v.type==="block-seq"?o(h,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in v&&v.indent!==a.indent&&o(h,"BAD_INDENT",Xv)),!_.anchor&&!_.tag&&!x){p=_.end,_.comment&&(d.comment?d.comment+=`
78
+ `+_.comment:d.comment=_.comment);continue}(_.newlineAfterProp||tr(v))&&o(v??g[g.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else _.found?.indent!==a.indent&&o(h,"BAD_INDENT",Xv);s.atKey=!0;const C=_.end,k=v?e(s,v,_,o):n(s,C,g,null,_,o);s.schema.compat&&Kh(a.indent,v,o),s.atKey=!1,RS(s,d.items,k)&&o(C,"DUPLICATE_KEY","Map keys must be unique");const A=bl(x??[],{indicator:"map-value-ind",next:E,offset:k.range[2],onError:o,parentIndent:a.indent,startOnNewline:!v||v.type==="block-scalar"});if(h=A.end,A.found){T&&(E?.type==="block-map"&&!A.hasNewline&&o(h,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),s.options.strict&&_.start<A.found.offset-1024&&o(k.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const N=E?e(s,E,A,o):n(s,h,x,null,A,o);s.schema.compat&&Kh(a.indent,E,o),h=N.range[2];const j=new Ht(k,N);s.options.keepSourceTokens&&(j.srcToken=y),d.items.push(j)}else{T&&o(k.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),A.comment&&(k.comment?k.comment+=`
79
+ `+A.comment:k.comment=A.comment);const N=new Ht(k);s.options.keepSourceTokens&&(N.srcToken=y),d.items.push(N)}}return p&&p<h&&o(p,"IMPOSSIBLE","Map comment with trailing content"),d.range=[a.offset,h,p??h],d}function jO({composeNode:e,composeEmptyNode:n},s,a,o,c){const u=c?.nodeClass??xs,d=new u(s.schema);s.atRoot&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let h=a.offset,p=null;for(const{start:y,value:g}of a.items){const v=bl(y,{indicator:"seq-item-ind",next:g,offset:h,onError:o,parentIndent:a.indent,startOnNewline:!0});if(!v.found)if(v.anchor||v.tag||g)g?.type==="block-seq"?o(v.end,"BAD_INDENT","All sequence items must start at the same column"):o(h,"MISSING_CHAR","Sequence item without - indicator");else{p=v.end,v.comment&&(d.comment=v.comment);continue}const x=g?e(s,g,v,o):n(s,v.end,y,null,v,o);s.schema.compat&&Kh(a.indent,g,o),h=x.range[2],d.items.push(x)}return d.range=[a.offset,h,p??h],d}function gr(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 y=h.substring(1)||" ";o?o+=u+y:o=y,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 wh="Block collections are not allowed within flow collections",xh=e=>e&&(e.type==="block-map"||e.type==="block-seq");function RO({composeNode:e,composeEmptyNode:n},s,a,o,c){const u=a.start.source==="{",d=u?"flow map":"flow sequence",h=c?.nodeClass??(u?gn:xs),p=new h(s.schema);p.flow=!0;const y=s.atRoot;y&&(s.atRoot=!1),s.atKey&&(s.atKey=!1);let g=a.offset+a.start.source.length;for(let T=0;T<a.items.length;++T){const C=a.items[T],{start:k,key:A,sep:N,value:j}=C,D=bl(k,{flow:d,indicator:"explicit-key-ind",next:A??N?.[0],offset:g,onError:o,parentIndent:a.indent,startOnNewline:!1});if(!D.found){if(!D.anchor&&!D.tag&&!N&&!j){T===0&&D.comma?o(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`):T<a.items.length-1&&o(D.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${d}`),D.comment&&(p.comment?p.comment+=`
80
+ `+D.comment:p.comment=D.comment),g=D.end;continue}!u&&s.options.strict&&tr(A)&&o(A,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(T===0)D.comma&&o(D.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`);else if(D.comma||o(D.start,"MISSING_CHAR",`Missing , between ${d} items`),D.comment){let B="";e:for(const R of k)switch(R.type){case"comma":case"space":break;case"comment":B=R.source.substring(1);break e;default:break e}if(B){let R=p.items[p.items.length-1];st(R)&&(R=R.value??R.key),R.comment?R.comment+=`
81
+ `+B:R.comment=B,D.comment=D.comment.substring(B.length+1)}}if(!u&&!N&&!D.found){const B=j?e(s,j,D,o):n(s,D.end,N,null,D,o);p.items.push(B),g=B.range[2],xh(j)&&o(B.range,"BLOCK_IN_FLOW",wh)}else{s.atKey=!0;const B=D.end,R=A?e(s,A,D,o):n(s,B,k,null,D,o);xh(A)&&o(R.range,"BLOCK_IN_FLOW",wh),s.atKey=!1;const U=bl(N??[],{flow:d,indicator:"map-value-ind",next:j,offset:R.range[2],onError:o,parentIndent:a.indent,startOnNewline:!1});if(U.found){if(!u&&!D.found&&s.options.strict){if(N)for(const Z of N){if(Z===U.found)break;if(Z.type==="newline"){o(Z,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}D.start<U.found.offset-1024&&o(U.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else j&&("source"in j&&j.source?.[0]===":"?o(j,"MISSING_CHAR",`Missing space after : in ${d}`):o(U.start,"MISSING_CHAR",`Missing , or : between ${d} items`));const q=j?e(s,j,U,o):U.found?n(s,U.end,N,null,U,o):null;q?xh(j)&&o(q.range,"BLOCK_IN_FLOW",wh):U.comment&&(R.comment?R.comment+=`
82
+ `+U.comment:R.comment=U.comment);const Y=new Ht(R,q);if(s.options.keepSourceTokens&&(Y.srcToken=C),u){const Z=p;RS(s,Z.items,R)&&o(B,"DUPLICATE_KEY","Map keys must be unique"),Z.items.push(Y)}else{const Z=new gn(s.schema);Z.flow=!0,Z.items.push(Y);const le=(q??R).range;Z.range=[R.range[0],le[1],le[2]],p.items.push(Z)}g=q?q.range[2]:U.end}}const v=u?"}":"]",[x,...E]=a.end;let _=g;if(x?.source===v)_=x.offset+x.source.length;else{const T=d[0].toUpperCase()+d.substring(1),C=y?`${T} must end with a ${v}`:`${T} in block collection must be sufficiently indented and end with a ${v}`;o(g,y?"MISSING_CHAR":"BAD_INDENT",C),x&&x.source.length!==1&&E.unshift(x)}if(E.length>0){const T=gr(E,_,s.options.strict,o);T.comment&&(p.comment?p.comment+=`
83
+ `+T.comment:p.comment=T.comment),p.range=[a.offset,_,T.offset]}else p.range=[a.offset,_,_];return p}function Eh(e,n,s,a,o,c){const u=s.type==="block-map"?DO(e,n,s,a,c):s.type==="block-seq"?jO(e,n,s,a,c):RO(e,n,s,a,c),d=u.constructor;return o==="!"||o===d.tagName?(u.tag=d.tagName,u):(o&&(u.tag=o),u)}function BO(e,n,s,a,o){const c=a.tag,u=c?n.directives.tagName(c.source,v=>o(c,"TAG_RESOLVE_FAILED",v)):null;if(s.type==="block-seq"){const{anchor:v,newlineAfterProp:x}=a,E=v&&c?v.offset>c.offset?v:c:v??c;E&&(!x||x.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===gn.tagName&&d==="map"||u===xs.tagName&&d==="seq")return Eh(e,n,s,o,u);let h=n.schema.tags.find(v=>v.tag===u&&v.collection===d);if(!h){const v=n.schema.knownTags[u];if(v?.collection===d)n.schema.tags.push(Object.assign({},v,{default:!1})),h=v;else return v?o(c,"BAD_COLLECTION_TYPE",`${v.tag} used for ${d} collection, but expects ${v.collection??"scalar"}`,!0):o(c,"TAG_RESOLVE_FAILED",`Unresolved tag: ${u}`,!0),Eh(e,n,s,o,u)}const p=Eh(e,n,s,o,u,h),y=h.resolve?.(p,v=>o(c,"TAG_RESOLVE_FAILED",v),n.options)??p,g=ot(y)?y:new Ae(y);return g.range=p.range,g.tag=u,h?.format&&(g.format=h.format),g}function BS(e,n,s){const a=n.offset,o=LO(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?$O(n.source):[];let d=u.length;for(let _=u.length-1;_>=0;--_){const T=u[_][1];if(T===""||T==="\r")d=_;else break}if(d===0){const _=o.chomp==="+"&&u.length>0?`
84
+ `.repeat(Math.max(1,u.length-1)):"";let T=a+o.length;return n.source&&(T+=n.source.length),{value:_,type:c,comment:o.comment,range:[a,T,T]}}let h=n.indent+o.indent,p=n.offset+o.length,y=0;for(let _=0;_<d;++_){const[T,C]=u[_];if(C===""||C==="\r")o.indent===0&&T.length>h&&(h=T.length);else{T.length<h&&s(p+T.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),o.indent===0&&(h=T.length),y=_,h===0&&!e.atRoot&&s(p,"BAD_INDENT","Block scalar values in collections must be indented");break}p+=T.length+C.length+1}for(let _=u.length-1;_>=d;--_)u[_][0].length>h&&(d=_+1);let g="",v="",x=!1;for(let _=0;_<y;++_)g+=u[_][0].slice(h)+`
85
+ `;for(let _=y;_<d;++_){let[T,C]=u[_];p+=T.length+C.length+1;const k=C[C.length-1]==="\r";if(k&&(C=C.slice(0,-1)),C&&T.length<h){const N=`Block scalar lines must not be less indented than their ${o.indent?"explicit indentation indicator":"first line"}`;s(p-C.length-(k?2:1),"BAD_INDENT",N),T=""}c===Ae.BLOCK_LITERAL?(g+=v+T.slice(h)+C,v=`
86
+ `):T.length>h||C[0]===" "?(v===" "?v=`
87
+ `:!x&&v===`
88
+ `&&(v=`
89
+
90
+ `),g+=v+T.slice(h)+C,v=`
91
+ `,x=!0):C===""?v===`
92
+ `?g+=`
93
+ `:v=`
94
+ `:(g+=v+C,v=" ",x=!1)}switch(o.chomp){case"-":break;case"+":for(let _=d;_<u.length;++_)g+=`
95
+ `+u[_][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 LO({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 v=1;v<o.length;++v){const x=o[v];if(!d&&(x==="-"||x==="+"))d=x;else{const E=Number(x);!u&&E?u=E:h===-1&&(h=e+v)}}h!==-1&&a(h,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${o}`);let p=!1,y="",g=o.length;for(let v=1;v<n.length;++v){const x=n[v];switch(x.type){case"space":p=!0;case"newline":g+=x.source.length;break;case"comment":s&&!p&&a(x,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),g+=x.source.length,y=x.source.substring(1);break;case"error":a(x,"UNEXPECTED_TOKEN",x.message),g+=x.source.length;break;default:{const E=`Unexpected token in block scalar header: ${x.type}`;a(x,"UNEXPECTED_TOKEN",E);const _=x.source;_&&typeof _=="string"&&(g+=_.length)}}}return{mode:c,indent:u,chomp:d,comment:y,length:g}}function $O(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 LS(e,n,s){const{offset:a,type:o,source:c,end:u}=e;let d,h;const p=(v,x,E)=>s(a+v,x,E);switch(o){case"scalar":d=Ae.PLAIN,h=HO(c,p);break;case"single-quoted-scalar":d=Ae.QUOTE_SINGLE,h=UO(c,p);break;case"double-quoted-scalar":d=Ae.QUOTE_DOUBLE,h=IO(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 y=a+c.length,g=gr(u,y,n,s);return{value:h,type:d,comment:g.comment,range:[a,y,g.offset]}}function HO(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}`),$S(e)}function UO(e,n){return(e[e.length-1]!=="'"||e.length===1)&&n(e.length,"MISSING_CHAR","Missing closing 'quote"),$S(e.slice(1,-1)).replace(/''/g,"'")}function $S(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 IO(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}=qO(e,a);s+=c,a=u}else if(o==="\\"){let c=e[++a];const u=VO[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+=YO(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 qO(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 VO={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
113
+ `,r:"\r",t:" ",v:"\v",N:"…",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function YO(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 HS(e,n,s,a){const{value:o,type:c,comment:u,range:d}=n.type==="block-scalar"?BS(e,n,a):LS(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[ui]:h?p=GO(e.schema,o,h,s,a):n.type==="scalar"?p=XO(e,o,n,a):p=e.schema[ui];let y;try{const g=p.resolve(o,v=>a(s??n,"TAG_RESOLVE_FAILED",v),e.options);y=Fe(g)?g:new Ae(g)}catch(g){const v=g instanceof Error?g.message:String(g);a(s??n,"TAG_RESOLVE_FAILED",v),y=new Ae(o)}return y.range=d,y.source=o,c&&(y.type=c),h&&(y.tag=h),p.format&&(y.format=p.format),u&&(y.comment=u),y}function GO(e,n,s,a,o){if(s==="!")return e[ui];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[ui])}function XO({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[ui];if(s.compat){const d=s.compat.find(h=>h.default&&h.test?.test(a))??s[ui];if(u.tag!==d.tag){const h=n.tagString(u.tag),p=n.tagString(d.tag),y=`Value may be parsed as either ${h} or ${p}`;c(o,"TAG_RESOLVE_FAILED",y,!0)}}return u}function KO(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 ZO={composeNode:US,composeEmptyNode:zm};function US(e,n,s,a){const o=e.atKey,{spaceBefore:c,comment:u,anchor:d,tag:h}=s;let p,y=!0;switch(n.type){case"alias":p=QO(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=HS(e,n,h,a),d&&(p.anchor=d.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{p=BO(ZO,e,n,s,a),d&&(p.anchor=d.source.substring(1))}catch(g){const v=g instanceof Error?g.message:String(g);a(n,"RESOURCE_EXHAUSTION",v)}break;default:{const g=n.type==="error"?n.message:`Unsupported token (type: ${n.type})`;a(n,"UNEXPECTED_TOKEN",g),y=!1}}return p??(p=zm(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&&y&&(p.srcToken=n),p}function zm(e,n,s,a,{spaceBefore:o,comment:c,anchor:u,tag:d,end:h},p){const y={type:"scalar",offset:KO(n,s,a),indent:-1,source:""},g=HS(e,y,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 QO({options:e},{offset:n,source:s,end:a},o){const c=new ku(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=gr(a,u,e.strict,o);return c.range=[n,u,d.offset],d.comment&&(c.comment=d.comment),c}function FO(e,n,{offset:s,start:a,value:o,end:c},u){const d=Object.assign({_directives:n},e),h=new Cl(void 0,d),p={atKey:!1,atRoot:!0,directives:h.directives,options:h.options,schema:h.schema},y=bl(a,{indicator:"doc-start",next:o??c?.[0],offset:s,onError:u,parentIndent:0,startOnNewline:!0});y.found&&(h.directives.docStart=!0,o&&(o.type==="block-map"||o.type==="block-seq")&&!y.hasNewline&&u(y.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),h.contents=o?US(p,o,y,u):zm(p,y.end,a,null,y,u);const g=h.contents.range[2],v=gr(c,g,!1,u);return v.comment&&(h.comment=v.comment),h.range=[s,g,v.offset],h}function ko(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 Kv(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 Dm{constructor(n={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(s,a,o,c)=>{const u=ko(s);c?this.warnings.push(new jS(u,a,o)):this.errors.push(new Gs(u,a,o))},this.directives=new qt({version:n.version||"1.2"}),this.options=n}decorate(n,s){const{comment:a,afterEmptyLine:o}=Kv(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];st(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:Kv(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=ko(n);c[0]+=s,this.onError(c,"BAD_DIRECTIVE",a,o)}),this.prelude.push(n.source),this.atDirectives=!0;break;case"document":{const s=FO(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 Gs(ko(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 Gs(ko(n),"UNEXPECTED_TOKEN",a));break}this.doc.directives.docEnd=!0;const s=gr(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 Gs(ko(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 Cl(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 JO(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 Gs([d,d+1],c,u)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return LS(e,n,a);case"block-scalar":return BS({options:{strict:n}},e,a)}}return null}function WO(e,n){const{implicitKey:s=!1,indent:a,inFlow:o=!1,offset:c=-1,type:u="PLAIN"}=n,d=mr({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
+ `),y=d.substring(0,p),g=d.substring(p+1)+`
123
+ `,v=[{type:"block-scalar-header",offset:c,indent:a,source:y}];return IS(v,h)||v.push({type:"newline",offset:-1,indent:a,source:`
124
+ `}),{type:"block-scalar",offset:c,indent:a,props:v,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 PO(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=mr({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">":e3(e,h);break;case'"':Nh(e,h,"double-quoted-scalar");break;case"'":Nh(e,h,"single-quoted-scalar");break;default:Nh(e,h,"scalar")}}function e3(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}];IS(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 IS(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 Nh(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 t3=e=>"type"in e?pu(e):eu(e);function pu(e){switch(e.type){case"block-scalar":{let n="";for(const s of e.props)n+=pu(s);return n+e.source}case"block-map":case"block-seq":{let n="";for(const s of e.items)n+=eu(s);return n}case"flow-collection":{let n=e.start.source;for(const s of e.items)n+=eu(s);for(const s of e.end)n+=s.source;return n}case"document":{let n=eu(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 eu({start:e,key:n,sep:s,value:a}){let o="";for(const c of e)o+=c.source;if(n&&(o+=pu(n)),s)for(const c of s)o+=c.source;return a&&(o+=pu(a)),o}const Zh=Symbol("break visit"),n3=Symbol("skip children"),qS=Symbol("remove item");function Ps(e,n){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),VS(Object.freeze([]),e,n)}Ps.BREAK=Zh;Ps.SKIP=n3;Ps.REMOVE=qS;Ps.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};Ps.parentCollection=(e,n)=>{const s=Ps.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 VS(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=VS(Object.freeze(e.concat([[o,u]])),c.items[u],s);if(typeof d=="number")u=d-1;else{if(d===Zh)return Zh;d===qS&&(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 Iu="\uFEFF",qu="",Vu="",nr="",i3=e=>!!e&&"items"in e,s3=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function a3(e){switch(e){case Iu:return"<BOM>";case qu:return"<DOC>";case Vu:return"<FLOW_END>";case nr:return"<SCALAR>";default:return JSON.stringify(e)}}function YS(e){switch(e){case Iu:return"byte-order-mark";case qu:return"doc-mode";case Vu:return"flow-error-end";case nr: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 l3=Object.freeze(Object.defineProperty({__proto__:null,BOM:Iu,DOCUMENT:qu,FLOW_END:Vu,SCALAR:nr,createScalarToken:WO,isCollection:i3,isScalar:s3,prettyToken:a3,resolveAsScalar:JO,setScalarValue:PO,stringify:t3,tokenType:YS,visit:Ps},Symbol.toStringTag,{value:"Module"}));function Un(e){switch(e){case void 0:case" ":case`
131
+ `:case"\r":case" ":return!0;default:return!1}}const Zv=new Set("0123456789ABCDEFabcdef"),o3=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),Vc=new Set(",[]{}"),r3=new Set(` ,[]{}
132
+ \r `),_h=e=>!e||r3.has(e);class GS{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==="...")&&Un(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]===Iu&&(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 qu,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==="...")&&Un(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&&!Un(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===":")&&Un(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(_h),"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("..."))&&Un(o[3]))&&!(a===this.indentNext-1&&this.flowLevel===1&&(o[0]==="]"||o[0]==="}")))return this.flowLevel=0,yield Vu,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(_h),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const u=this.charAt(1);if(this.flowKey||Un(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=>Un(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 nr,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(Un(c)||n&&Vc.has(c))break;s=a}else if(Un(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&&Vc.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&&Vc.has(o))break;s=a}return!o&&!this.atEnd?this.setNext("plain-scalar"):(yield nr,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(_h),n+=yield*this.pushSpaces(!0);continue e;case"-":case"?":case":":{const s=this.flowLevel>0,a=this.charAt(1);if(Un(a)||s&&Vc.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(;!Un(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(o3.has(s))s=this.buffer[++n];else if(s==="%"&&Zv.has(this.buffer[n+1])&&Zv.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 XS{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 vs(e,n){for(let s=0;s<e.length;++s)if(e[s].type===n)return!0;return!1}function Qv(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 KS(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 Yc(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 Za(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 gu(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 Fv(e){if(e.start.type==="flow-seq-start")for(const n of e.items)n.sep&&!n.value&&!vs(n.start,"explicit-key-ind")&&!vs(n.sep,"map-value-ind")&&(n.key&&(n.value=n.key),delete n.key,KS(n.value)?n.value.end?gu(n.value.end,n.sep):n.value.end=n.sep:gu(n.start,n.sep),delete n.sep)}class jm{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 GS,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=YS(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"&&Fv(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&&Qv(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":{Qv(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=Yc(this.peek(2)),a=Za(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)){gu(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(vs(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(KS(s.key)&&!vs(s.sep,"newline")){const u=Za(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(vs(s.start,"newline"))Object.assign(s,{key:null,sep:[this.sourceToken]});else{const u=Za(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]}):vs(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&&!vs(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)){gu(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||vs(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=Yc(a),c=Za(o);Fv(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=Yc(n),a=Za(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=Yc(n),a=Za(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 ZS(e){const n=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||n&&new XS||null,prettyErrors:n}}function c3(e,n={}){const{lineCounter:s,prettyErrors:a}=ZS(n),o=new jm(s?.addNewLine),c=new Dm(n),u=Array.from(c.compose(o.parse(e)));if(a&&s)for(const d of u)d.errors.forEach(mu(e,s)),d.warnings.forEach(mu(e,s));return u.length>0?u:Object.assign([],{empty:!0},c.streamInfo())}function QS(e,n={}){const{lineCounter:s,prettyErrors:a}=ZS(n),o=new jm(s?.addNewLine),c=new Dm(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 Gs(d.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return a&&s&&(u.errors.forEach(mu(e,s)),u.warnings.forEach(mu(e,s))),u}function u3(e,n,s){let a;typeof n=="function"?a=n:s===void 0&&n&&typeof n=="object"&&(s=n);const o=QS(e,s);if(!o)return null;if(o.warnings.forEach(c=>mS(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 f3(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 na(e)&&!a?e.toString(s):new Cl(e,a,s).toString(s)}const sa=Object.freeze(Object.defineProperty({__proto__:null,Alias:ku,CST:l3,Composer:Dm,Document:Cl,Lexer:GS,LineCounter:XS,Pair:Ht,Parser:jm,Scalar:Ae,Schema:Uu,YAMLError:km,YAMLMap:gn,YAMLParseError:Gs,YAMLSeq:xs,YAMLWarning:jS,isAlias:ta,isCollection:lt,isDocument:na,isMap:Nl,isNode:ot,isPair:st,isScalar:Fe,isSeq:_l,parse:u3,parseAllDocuments:c3,parseDocument:QS,stringify:f3,visit:ia,visitAsync:Ou},Symbol.toStringTag,{value:"Module"}));function FS(e){if(!(typeof e!="string"||!/^https?:\/\/[^/@]/i.test(e)||/[\s\u0000-\u001f\u007f\\]/u.test(e)))try{const n=new URL(e);return!["https:","http:"].includes(n.protocol)||!n.hostname||n.username||n.password||e.split(/[/?#]/)[2].includes("@")?void 0:e}catch{return}}function JS(e,n=""){if(!e||typeof e!="object"||Array.isArray(e)||!Object.hasOwn(e,"url"))return{link:{},issues:[]};const s=e,a=FS(s.url);if(s.type!=="system"&&a!==void 0)return{link:{url:a},issues:[]};const o=s.type==="system"?"screen.url is only supported on user screens.":"screen.url must be an absolute HTTP or HTTPS URL without credentials, whitespace, or control characters.";return{link:{},issues:[{check:"L10",path:n,message:o}]}}function Ro(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function In(e){return typeof e=="string"&&e.length>0&&e.trim()===e}function d3(e,n,s){let a;try{a=sa.parse(e)}catch(c){return[{check:"F1",path:n,message:`Invalid YAML: ${c instanceof Error?c.message:String(c)}`}]}if(!Ro(a))return[];const o=s==="slice"?JS(a.screen,n).issues:[];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 h3(e){const n=[],s=[],a=[],o=new Set;for(const c of e){const u=v=>a.push({check:"F1",path:c.path,message:v});let d;try{d=sa.parse(c.content)}catch(v){u(`Invalid feature YAML: ${v instanceof Error?v.message:String(v)}`);continue}if(!Ro(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(!In(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;In(d.name)||u("Feature name must be a nonempty string without surrounding whitespace.");const p=In(d.name)?d.name:c.path,y=new Map;if(!Array.isArray(d.stories))u("Feature stories must be an array.");else for(const v of d.stories){if(!Ro(v)||!In(v.id)){u("Each story requires a nonempty string id.");continue}if(y.has(v.id)){u(`Duplicate story id "${v.id}".`);continue}In(v.name)||u(`Story "${v.id}" requires a nonempty name.`);const x=[];if(!Array.isArray(v.slices))u(`Story "${v.id}" slices must be an array.`);else for(const _ of v.slices){if(!In(_)||_.startsWith("/")||/^[A-Za-z]:/.test(_)||_.includes("\\")||_.split("/").includes("..")){u(`Story "${v.id}" slice references must be project-relative paths without parent traversal.`);continue}const T=_.split("/").filter(C=>C&&C!==".").join("/");if(!T){u(`Story "${v.id}" slice reference must identify a file, not the project root.`);continue}x.includes(T)?u(`Story "${v.id}" repeats slice "${T}".`):x.push(T)}const E={id:JSON.stringify([d.id,v.id]),localId:v.id,featureName:p,name:In(v.name)?v.name:v.id,description:typeof v.description=="string"?v.description:"",path:c.path,slices:x};y.set(v.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 v of d.timelines){const x=a.length;if(!Ro(v)||!In(v.id)){u("Each timeline requires a nonempty string id.");continue}if(g.has(v.id)){u(`Duplicate timeline id "${v.id}".`);continue}if(g.add(v.id),In(v.name)||u(`Timeline "${v.id}" requires a nonempty name.`),!Array.isArray(v.steps)||v.steps.length===0){u(`Timeline "${v.id}" steps must be a nonempty array.`);continue}const E=[],_=new Set,T=new Set,C=new Set;for(const A of v.steps){if(!Ro(A)||!In(A.id)){u(`Timeline "${v.id}" requires a string id for every step.`);continue}_.has(A.id)&&u(`Timeline "${v.id}" repeats step id "${A.id}".`),_.add(A.id);const N=typeof A.story=="string"?y.get(A.story):void 0;if(!N){u(`Timeline "${v.id}" step "${A.id}" references unknown story "${String(A.story)}".`);continue}T.has(N.id)&&u(`Timeline "${v.id}" repeats story "${A.story}". Use separate timelines for alternative presentations.`),T.add(N.id);for(const D of N.slices)C.has(D)&&u(`Timeline "${v.id}" repeats slice "${D}" across stories.`),C.add(D);const j=[];if(A.after!==void 0)if(!Array.isArray(A.after)||!A.after.every(In))u(`Timeline "${v.id}" step "${A.id}" after must be an array of step ids.`);else for(const D of A.after)j.includes(D)?u(`Step "${A.id}" repeats predecessor "${D}".`):j.push(D);E.push({id:A.id,storyId:N.id,after:j})}for(const A of E)for(const N of A.after)_.has(N)||u(`Step "${A.id}" references unknown predecessor "${N}".`);const k=new Set(E.map(A=>A.id));for(;k.size>0;){const A=E.filter(N=>k.has(N.id)&&N.after.every(j=>!k.has(j)));if(A.length===0){u(`Timeline "${v.id}" contains a layout cycle involving ${[...k].join(", ")}.`);break}for(const N of A)k.delete(N.id)}a.length===x&&s.push({id:JSON.stringify([d.id,v.id]),name:v.name,path:c.path,steps:E})}}return{stories:n,timelines:s,modelIssues:a}}const Jv=["#2563EB","#7C3AED","#0F766E","#B45309","#BE185D","#4338CA","#047857","#9F1239"];function Qh(e){let n=0;for(const s of e)n=Math.imul(n,31)+s.codePointAt(0)>>>0;return Jv[n%Jv.length]}function m3(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 p3(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=sa.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 y=p;let g=h,v=Qh(h);y.name!==void 0&&(typeof y.name!="string"||!y.name.trim()?c(`Actor "${h}" name must be a nonempty string.`):g=y.name.trim()),y.color!==void 0&&(typeof y.color!="string"||!/^#[0-9a-f]{6}$/i.test(y.color)?c(`Actor "${h}" color must be a quoted #RRGGBB value.`):v=y.color.toUpperCase()),a.set(h,{id:h,name:g,color:v})}}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:Qh(h)})}return{actors:[...a.values()],actorIssues:o}}function Es(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 WS(e){return`story_${Es(e).replaceAll("-","_")}`}function PS(e){return`slc_${Es(e).replaceAll("-","_")}`}function ew(e){return`scr_${Es(e).replaceAll("-","_")}`}function tw(e){return`cmd_${Es(e).replaceAll("-","_")}`}function nw(e){return`qry_${Es(e).replaceAll("-","_")}`}function tu(e){return`evt_${Es(e).replaceAll("-","_")}`}function iw(e,n,s){const a=s?Es(s):`case-${n+1}`;return`gwt_${Es(e).replaceAll("-","_")}_${a.replaceAll("-","_")}`}function g3(e,n,s){return`${e}:${n}->${s}`}function y3(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(WS(a.id??a.path),[a.id??a.path]);for(const a of e.events)s(tu(a.name),[a.name]);for(const a of e.slices)s(PS(a.path),[a.path]),s(ew(a.path),[a.path]),a.commands.forEach((o,c)=>{s(tw(o.name),ol(a.path,a.commands,c));for(const u of o.produces)s(tu(u),[u])}),a.queries.forEach((o,c)=>{s(nw(o.name),ol(a.path,a.queries,c));for(const u of o.fromEvents)s(tu(u),[u])}),a.gwt.forEach((o,c)=>{s(iw(a.path,c,o.name),ol(a.path,a.gwt,c))});return(a,o)=>n.get(a).size===1?a:`${a}~${encodeURIComponent(JSON.stringify(o))}`}function ol(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 v3(e){const n=[],s=new Map,a=y3(e),o=d=>a(tu(d),[d]),c=new Map,u=(d,h,p,y)=>{const g=g3(d,h,p);s.set(g,{id:g,kind:d,source:h,target:p,...y===void 0?{}:{label:y}})};for(const d of e.stories){const h=a(WS(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(PS(d.path),[d.path]),p=a(ew(d.path),[d.path]),y={storyName:d.storyName,storyId:d.storyId,sliceTitle:d.title,sourcePath:d.path,raw:d.raw};n.push({...y,id:h,type:"slice",label:d.title});for(const g of c.get(d.path)??[])u("story-slice",g,h);n.push({...y,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(v=>v.id===g)).filter(g=>!!g)}:{},...d.screen.url===void 0?{}:{url:d.screen.url},screenType:d.screen.type}),u("slice-screen",h,p),d.queries.forEach((g,v)=>{const x=a(nw(g.name),ol(d.path,d.queries,v));n.push({...y,id:x,type:"query",label:g.name,sourceName:g.name,fields:g.fields}),d.screen.reads.includes(g.name)&&u("query-screen",x,p);for(const E of g.fromEvents)u("event-query",o(E),x,E)}),d.commands.forEach((g,v)=>{const x=a(tw(g.name),ol(d.path,d.commands,v));n.push({...y,id:x,type:"command",label:g.name,sourceName:g.name,fields:g.fields}),d.screen.executes.includes(g.name)&&u("screen-command",p,x);for(const E of g.produces)u("command-event",x,o(E),E)}),d.gwt.forEach((g,v)=>{n.push({...y,id:a(iw(d.path,v,g.name),ol(d.path,d.gwt,v)),type:"gwt",label:g.name??`Case ${v+1}`,sourceName:g.name,description:g.description,given:g.given,when:g.when,then:g.then})})}return{nodes:n,edges:[...s.values()]}}function nl(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 sw(e,n=""){const s=nl(e).split("/").at(-1)??e;return n&&s.endsWith(n)?s.slice(0,-n.length):s}function ir(e){return Array.isArray(e)?e.filter(n=>typeof n=="string"):[]}function b3(e,n){const s=sa.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 S3(e,n){const s=sa.parse(n);return{name:typeof s?.name=="string"?s.name:sw(e,".yaml"),description:typeof s?.description=="string"?s.description:"",path:e,slices:ir(s?.slices).map(nl)}}function w3(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:ir(n.produces)})):[]}function x3(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:ir(n.from_events)})):[]}function E3(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 N3(e){return{type:e?.type==="system"?"system":"user",name:typeof e?.name=="string"?e.name:void 0,...m3(e?.actors),...JS(e).link,reads:ir(e?.reads),executes:ir(e?.executes)}}function _3(e,n,s){const a=sa.parse(n);return{title:typeof a?.slice=="string"?a.slice:sw(e),path:e,storyName:s.get(e)?.name,storyId:s.get(e)?.id,screen:N3(a?.screen),commands:w3(a?.commands),queries:x3(a?.queries),gwt:E3(a?.gwt),raw:n}}function A3(e,n={}){const s=new Map(e.map(U=>[nl(U.path),U.content])),a=s.get(".event-modeling/config.yaml"),o=a?sa.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=nl(o?.paths?.actors_file??`${c}/actors.yaml`),y=o?.paths?.stories_dir??`${c}/stories`,g=s.get(h);if(g===void 0)throw new Error(`Missing events file: ${h}`);const v=b3(h,g),x=h3([...s.entries()].filter(([U])=>(u===""||U.startsWith(`${u}/`))&&U.endsWith(".feature.yaml")).sort(([U],[q])=>U<q?-1:U>q?1:0).map(([U,q])=>({path:U,content:q}))),E=[...s.entries()].filter(([U])=>U.split("/").slice(0,-1).join("/")===y&&U.endsWith(".yaml")).sort(([U],[q])=>U.localeCompare(q)).map(([U,q])=>S3(U,q));E.push(...x.stories);const _=new Map;for(const U of E)for(const q of U.slices)_.set(nl(q),U);const T=E.flatMap(U=>U.slices.map(nl)),C=[...s.keys()].filter(U=>(u===""||U.startsWith(`${u}/`))&&U.endsWith(d)),A=[...new Set([...T,...C])].sort().filter(U=>s.has(U)).map(U=>_3(U,s.get(U)??"",_)),N=p3(s.get(p),p,A),j=[{path:h,kind:"events"},...E.filter(U=>!U.id).map(U=>({path:U.path,kind:"story"})),...A.map(U=>({path:U.path,kind:"slice"})),...s.has(p)?[{path:p,kind:"actors"}]:[]],D=[...x.modelIssues,...j.flatMap(U=>d3(s.get(U.path)??"",U.path,U.kind))],B={root:n.root??"browser-import",config:{language:o?.language,paths:{eventModelDir:c,featuresDir:u,sliceExtension:d,eventsFile:h,actorsFile:p,storiesDir:y}},events:v,stories:E,timelines:x.timelines,modelIssues:D,slices:A,...N},R=v3(B);return{...B,...R}}function aw(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:Qh(s)})}function lw(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 aw(a))s.has(o.id)||s.set(o.id,o);return[...s.values()]}function T3(e,n,s={}){const a=new Set(lw(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(N=>N.id)),relatedNodeIds:new Set};const a=new Set(n.actorIds),o=new Map(e.nodes.map(N=>[N.id,N])),c=new Map;for(const N of e.nodes)N.type==="story"||N.type==="event"||N.sourcePath&&c.set(N.id,N.sourcePath);const u=e.edges.filter(N=>["slice-screen","query-screen","screen-command"].includes(N.kind)),d=()=>{let N=!0;for(;N;){N=!1;for(const j of u){const D=c.get(j.source),B=c.get(j.target);D&&!B?(c.set(j.target,D),N=!0):B&&!D&&(c.set(j.source,B),N=!0)}}};d();for(const N of e.nodes)N.type==="slice"&&!c.has(N.id)&&c.set(N.id,N.id);d();for(const N of e.nodes)(N.type==="screen"||N.type==="processor")&&!c.has(N.id)&&c.set(N.id,N.id);d();const h=N=>N?.type==="screen"&&((N.actors??[]).some(j=>a.has(j))||n.includeUnassigned&&!N.actors?.length),p=e.nodes.filter(N=>h(N)||h(s[N.id])),y=new Set(p.flatMap(N=>{const j=c.get(N.id);return j?[j]:[]})),g=new Set(p.map(N=>N.id));for(const[N,j]of c)y.has(j)&&g.add(N);const v=e.edges.filter(N=>N.kind==="command-event"||N.kind==="event-query"),x=N=>{const j=new Set;for(const D of v)N.has(D.source)&&o.get(D.target)?.type==="event"&&j.add(D.target),N.has(D.target)&&o.get(D.source)?.type==="event"&&j.add(D.source);return j},E=x(g),_=new Set,T=new Set(e.nodes.filter(N=>N.type==="processor").map(N=>c.get(N.id)));for(const N of v){const j=E.has(N.source)?N.target:E.has(N.target)?N.source:void 0,D=j?c.get(j):void 0;D&&T.has(D)&&!y.has(D)&&_.add(D)}const C=new Set;for(const[N,j]of c)_.has(j)&&C.add(N);for(const N of x(C))E.has(N)||C.add(N);const k=new Set([...g,...E,...C]),A=new Set(e.nodes.filter(N=>k.has(N.id)&&N.type!=="event").map(nn));for(const N of e.nodes)N.type==="story"&&A.has(N.storyId??N.label)&&k.add(N.id);return{nodeIds:k,relatedNodeIds:C}}const qn=180,ai=80,Fh=80,oi=430,rl=390,yu=130,On=178,vu=92,Jh=300,Wh=170,qo=18,Ph=48,Ah=30,Vo=92,ow=38,M3=42,Wv=154,Pv=278,rw=408;function O3(e){return e==="slice-screen"||e==="story-slice"?"#cbd5e1":"#64748b"}function k3(e){if(e==="added")return"#15803d";if(e==="removed")return"#b91c1c";if(e==="changed")return"#b45309"}function z3(e){return e.type==="event"?{sourcePosition:me.Right,targetPosition:me.Left}:{sourcePosition:me.Bottom,targetPosition:me.Top}}function D3(e){return new Map(e.stories.map((n,s)=>[an(n),s]))}function cl(e,n){return e===0?0:e*n+(e-1)*qo}function Bo(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 j3(e,n,s){const a=new Set(Bo(e,s,"command").map(c=>c.id));return[...new Set(e.edges.filter(c=>c.kind==="command-event"&&a.has(c.source)&&e.edges.find(u=>u.kind==="command-event"&&u.target===c.target)?.id===c.id).map(c=>c.target))].map(c=>n.get(c)).filter(c=>!!c)}function R3(e,n,s){return new Map(e.slices.map(a=>{const o=Bo(e,a.path,"query"),c=Bo(e,a.path,"command"),u=j3(e,n,a.path),d=Bo(e,a.path,"gwt"),h=cl(o.length,On),p=cl(c.length,On),y=h+p+(h>0&&p>0?Ph:0),g=cl(u.length,On),v=d.length?Jh:0,x=Math.max(oi,y+Ah*2,g+Ah*2,v+Ah*2),E=Math.max(0,...Bo(e,a.path,"screen").map(T=>(s.get(T.id)??vu)-vu)),_=(d.length>0?rw+Wh+36:rl)+E;return[a.path,{width:x,height:_,screenOffset:E,queryIds:o.map(T=>T.id),commandIds:c.map(T=>T.id),eventIds:u.map(T=>T.id),gwtIds:d.map(T=>T.id)}]}))}function B3(e,n,s,a,o=new Set){const c=new Map;let u=ai;for(const d of e.stories){const h=e.slices.filter(E=>s.get(E.path)===an(d)),p=h.reduce((E,_)=>E+(n.get(_.path)?.width??oi),0),y=o.has(an(d)),g=y?oi:Math.max(p+Math.max(h.length-1,0)*yu,oi),v=Math.max(...h.map(E=>n.get(E.path)?.height??rl),rl),x=y?Vo:Vo+v+ow;c.set(an(d),{x:qn,y:u,width:g,height:x}),u+=x+Fh}if(a){const d=JM(a);let h=qn;const p=[...new Set(e.stories.map(y=>d.get(Zn(y))??0))].sort((y,g)=>y-g);for(const y of p){let g=ai,v=0;for(const x of e.stories.filter(E=>d.get(Zn(E))===y)){const E=c.get(an(x));E.x=h,E.y=g,g+=E.height+Fh,v=Math.max(v,E.width)}h+=v+yu}}return c}function L3(e,n,s,a,o,c){const u=cl(e.length,c),d=s.x+(a-u)/2;e.forEach((h,p)=>{n.set(h,{x:d+p*(c+qo),y:s.y+o})})}function $3(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 H3(e,n,s="all"){if(!n||s==="all")return new Set(e.stories.map(Zn));if(s==="story")return new Set([n]);const a=new Set([n]),o=new Set(e.nodes.filter(u=>nn(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&&nn(d)&&a.add(nn(d)),h&&nn(h)&&a.add(nn(h))}return a}function U3(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 I3(e,n,s,a,o,c,u){const d=U3(e),h=c??!!(n?.sliceTitle&&n.sliceTitle===s?.sliceTitle);if(e==="event-query"&&h)return{...d,route:"same-slice-read"};if(!(e==="event-query"&&!h)||!a||!o)return{...d,route:"semantic"};const y=a.x+a.width/2,g=a.y+a.height/2,v=o.x+o.width/2,x=o.y+o.height/2;return{sourceSide:(u??!!(n&&s&&nn(n)&&nn(n)===nn(s)))||x>=g?"bottom":"top",targetSide:v>=y?"left":"right",route:"event-read"}}function eb(e,n,s={}){const a=e.timelines?.find(w=>w.id===s.timelineId);e=FM(e,a);const o=new Map(e.nodes.map(w=>[w.id,w]));e={...e,nodes:e.nodes.map(w=>{if(w.type!=="event")return w;const z=e.edges.find(F=>F.kind==="command-event"&&F.target===w.id);return{...w,storyName:z?o.get(z.source)?.storyName:a?void 0:w.storyName,storyId:z?o.get(z.source)?.storyId:a?void 0:w.storyId}})};const c=WM(e,!!a),u=s.actorFilter??{actorIds:[],includeUnassigned:!1},d=C3(e,u,s.previousNodes),h=u.actorIds.length>0||u.includeUnassigned,p=new Set(e.nodes.filter(w=>w.type==="slice"&&d.nodeIds.has(w.id)).map(w=>c.sliceByNode.get(w.id))),y=h?{...e,stories:e.stories.filter(w=>e.nodes.some(z=>z.type==="story"&&d.nodeIds.has(z.id)&&c.stableStoryByNode.get(z.id)===an(w))),slices:e.slices.filter(w=>p.has(w.path)),nodes:e.nodes.filter(w=>d.nodeIds.has(w.id)),edges:e.edges.filter(w=>d.nodeIds.has(w.source)&&d.nodeIds.has(w.target))}:e,g=D3(y),v=new Map(e.nodes.map(w=>[w.id,w])),x=new Map(y.nodes.map(w=>[w.id,w])),E=R3(y,x,s.screenHeights??new Map),_=new Set(e.slices.map(w=>w.path)),T=new Map(e.stories.map(w=>[an(w),new Set(w.slices.filter(z=>_.has(z))).size])),C=s.collapsedStoryIds??new Set,k=new Map;for(const w of e.nodes){const z=c.stableStoryByNode.get(w.id);w.type==="story"&&z&&k.set(z,w.id)}const A=w=>w?.sourcePath??e.slices.find(z=>z.title===(w?.sliceTitle??w?.label))?.path??"",N=B3(y,E,c.stableStoryBySlice,a,C),j=new Map,D=new Map,B=new Map,R=new Set,U=H3(e,s.focusedStory,s.scope??"all"),q=$3(s.edgeDetail??"normal");if(n){R.add(n);for(const w of e.edges)w.source===n&&R.add(w.target),w.target===n&&R.add(w.source)}const Y=new Map;for(const w of y.stories){const z=an(w);Y.set(z,N.get(z)?.x??qn)}for(const w of y.stories){const z=an(w);for(const F of new Set(w.slices)){const W=y.slices.find(ie=>ie.path===F);if(!W||c.stableStoryBySlice.get(W.path)!==z)continue;const fe=N.get(z)??{y:ai},de=Y.get(z)??qn;B.set(W.path,{x:de,y:fe.y+Vo}),Y.set(z,de+(E.get(W.path)?.width??oi)+yu)}}for(const w of y.slices){if(B.has(w.path))continue;const z=c.stableStoryBySlice.get(w.path)??"",F=N.get(z)?.y??ai+(g.get(z)??0)*(rl+Vo+ow+Fh),W=qn;B.set(w.path,{x:W,y:F+Vo})}for(const w of y.nodes){if(w.type==="story"){const z=N.get(c.stableStoryByNode.get(w.id)??"");j.set(w.id,{x:(z?.x??qn)-20,y:z?.y??ai})}if(w.type==="slice"){const z=B.get(A(w))??{x:qn,y:ai};j.set(w.id,z)}if(w.type==="screen"||w.type==="processor"){const z=B.get(A(w))??{x:qn,y:ai},W=E.get(A(w))?.width??oi;j.set(w.id,{x:z.x+(W-On)/2,y:z.y+M3})}}for(const w of y.slices){const z=B.get(w.path)??{x:qn,y:ai},F=E.get(w.path),W=F?.width??oi;if(!F)continue;const fe=cl(F.queryIds.length,On),de=cl(F.commandIds.length,On),ie=fe+de+(fe>0&&de>0?Ph:0);let te=z.x+(W-ie)/2;F.queryIds.forEach((oe,ve)=>{j.set(oe,{x:te+ve*(On+qo),y:z.y+Wv+F.screenOffset})}),fe>0&&(te+=fe+(de>0?Ph:0)),F.commandIds.forEach((oe,ve)=>{j.set(oe,{x:te+ve*(On+qo),y:z.y+Wv+F.screenOffset})}),L3(F.eventIds,j,z,W,Pv+F.screenOffset,On);for(const oe of F.gwtIds)j.set(oe,{x:z.x+(W-Jh)/2,y:z.y+rw+F.screenOffset})}let Z=0;for(const w of y.nodes.filter(z=>z.type==="event")){const z=y.edges.find(W=>W.kind==="command-event"&&W.target===w.id),F=z?x.get(z.source):void 0;if(!j.has(w.id)){if((a||h)&&!F){j.set(w.id,{x:qn-On-yu,y:ai+Z++*(vu+qo)});continue}const W=B.get(A(F))??{x:qn,y:ai},fe=E.get(A(F));j.set(w.id,{x:W.x+((fe?.width??oi)-On)/2,y:W.y+Pv+(fe?.screenOffset??0)})}}const le=new Set,L=e.nodes.map(w=>{const z=j.get(w.id)??{x:0,y:0},F=w.type==="story"||w.type==="slice",W=c.stableStoryByNode.get(w.id),fe=w.type==="story"?N.get(W??"")?.width??oi:E.get(A(w))?.width??oi,de=w.type==="story"?N.get(W??"")?.height??rl:E.get(A(w))?.height??rl,ie=F?fe:w.type==="gwt"?Jh:On,te=F?de:w.type==="gwt"?Wh:vu;D.set(w.id,{x:z.x,y:z.y,width:ie,height:te});const oe=w.type==="gwt"?e.nodes.filter(he=>he.type==="gwt"&&(w.sourcePath?he.sourcePath===w.sourcePath:he.sliceTitle===w.sliceTitle)).filter(he=>d.nodeIds.has(he.id)&&(!nn(he)||U.has(nn(he)))).filter(he=>!s.diffFilter||s.diffFilter==="all"||s.diffNodeStatus?.[he.id]===s.diffFilter):void 0,ve=!!(W&&C.has(W)),Se=!d.nodeIds.has(w.id)||!!(oe&&oe[0]?.id!==w.id)||!!(c.storyByNode.get(w.id)&&!U.has(c.storyByNode.get(w.id)))||!!(!oe&&s.diffFilter&&s.diffFilter!=="all"&&s.diffNodeStatus?.[w.id]!==s.diffFilter);return Se||le.add(w.id),{id:w.id,type:F?"groupNode":"eventModelNode",position:z,initialWidth:F||w.type==="gwt"?ie:void 0,initialHeight:F||w.type==="gwt"?te:void 0,selectable:!0,draggable:!1,data:{projectNode:w,storyId:W,collapsed:w.type==="story"?ve:void 0,sliceCount:w.type==="story"?T.get(W??"")??0:void 0,scenarios:oe,scenarioStatus:s.diffNodeStatus,selectedScenarioId:n,selected:w.id===n||!!oe?.some(he=>he.id===n),connected:R.has(w.id),actorRelated:d.relatedNodeIds.has(w.id),diffStatus:s.diffNodeStatus?.[w.id]},hidden:Se||w.type!=="story"&&ve,style:F?{width:fe,height:de,zIndex:w.type==="story"?-20:-10,opacity:d.relatedNodeIds.has(w.id)?.72:1}:{width:ie,height:w.type==="gwt"?Wh:void 0,opacity:d.relatedNodeIds.has(w.id)?.72:1},...z3(w)}});for(const w of L)w.data.projectNode.type!=="story"||!w.data.collapsed||e.nodes.some(z=>z.type!=="story"&&le.has(z.id)&&c.stableStoryByNode.get(z.id)===w.data.storyId)&&(w.hidden=!1);const K=new Set(L.filter(w=>!w.hidden).map(w=>w.id)),O=w=>{const z=c.stableStoryByNode.get(w);return z&&C.has(z)?k.get(z)??w:w},H=n?v.get(n):void 0,X=e.edges.filter(w=>q.has(w.kind)).filter(w=>PM(w,s.edgeVisibility??"auto",H,c)).filter(w=>le.has(w.source)&&le.has(w.target)).filter(w=>K.has(O(w.source))&&K.has(O(w.target))).filter(w=>O(w.source)!==O(w.target)||O(w.source)===w.source&&O(w.target)===w.target).map(w=>{const z=O(w.source),F=O(w.target),W=z!==w.source||F!==w.target,fe=v.get(w.source),de=v.get(w.target),ie=!!s.focusedEdgeIds?.has(w.id),te=s.diffEdgeStatus?.[w.id],oe=k3(te),ve=c.sliceByNode.get(w.source),Se=c.stableStoryByNode.get(w.source),{sourceSide:he,targetSide:ge,route:Ee}=W?{sourceSide:"right",targetSide:"left",route:"event-read"}:I3(w.kind,fe,de,D.get(z),D.get(F),!!(ve&&ve===c.sliceByNode.get(w.target)),!!(Se&&Se===c.stableStoryByNode.get(w.target)));return{id:w.id,source:z,target:F,type:"eventModelEdge",sourceHandle:`${he}-source`,targetHandle:`${ge}-target`,data:{kind:w.kind,sourceNodeId:w.source,targetNodeId:w.target,proxy:W,route:Ee,active:ie,diffStatus:te,fieldFlow:s.edgeFieldFlows?.get(w.id),selectedFieldName:s.selectedFieldName,onSelectField:s.onSelectField},markerEnd:{type:Fo.ArrowClosed,color:ie?"#111827":oe??O3(w.kind)},label:s.edgeDetail==="verbose"?w.label:void 0,className:`edge ${ie?"edge-active":""} ${te?`edge-diff-${te}`:""}`,hidden:!!(s.diffFilter&&s.diffFilter!=="all"&&te!==s.diffFilter),animated:ie}}),se={stories:0,slices:0,events:0};for(const w of L){const z=w.data.projectNode.type;z==="story"&&!w.hidden&&se.stories++,z==="slice"&&le.has(w.id)&&se.slices++,z==="event"&&le.has(w.id)&&se.events++}return{nodes:L,edges:X,counts:se}}const q3=.2,V3=1.8,tb=16,Y3=.0025;function G3(e,n){const s=e.deltaMode===1?tb:e.deltaMode===2?n.width:1,a=e.deltaMode===1?tb:e.deltaMode===2?n.height:1;return{x:e.deltaX*s,y:e.deltaY*a}}function cw(e,n){return{...e,x:e.x+n.x,y:e.y+n.y}}function uw(e,n,s){if(Number.isNaN(s)||e.zoom<=0)return e;const a=Math.min(V3,Math.max(q3,s)),o=a/e.zoom;return{x:n.x-(n.x-e.x)*o,y:n.y-(n.y-e.y)*o,zoom:a}}function X3(e,n,s,a){const o=G3(n,s);if(!Number.isFinite(o.x)||!Number.isFinite(o.y))return e;if(n.metaKey||n.ctrlKey){const d=Math.max(-1e3,Math.min(1e3,o.y||o.x));return uw(e,a,e.zoom*Math.exp(-d*Y3))}const c=n.shiftKey?o.x||o.y:o.x,u=n.shiftKey?0:o.y;return cw(e,{x:-c,y:-u})}function sr(e){return e instanceof Element?e:null}function nu(e){return!!sr(e)?.closest('input, textarea, select, [role="textbox"], [contenteditable]:not([contenteditable="false"])')}function Th(e){return!!sr(e)?.closest(".react-flow__controls, .react-flow__panel, [data-canvas-navigation-ignore]")}function nb(e){const n=sr(e)?.closest('button, a[href], summary, [role="button"], [role="tab"], [role="checkbox"], [role="switch"]');return nu(e)||!!(n&&!n.classList.contains("react-flow__node"))}function ib(e){return e.code==="Space"||e.key===" "||e.key==="Spacebar"}function K3({children:e}){const n=V.useRef(null),[s,a]=V.useState("idle"),{getViewport:o,setViewport:c}=dr();return V.useEffect(()=>{const u=n.current;if(!u)return;let d=!1,h=null,p=!1,y=null;const g=()=>{const q=h?.pointerId;h=null,q!==void 0&&u.hasPointerCapture(q)&&u.releasePointerCapture(q),a(d?"ready":"idle")},v=()=>{d=!1,y=null,g()},x=q=>{if(q.key==="Escape"){v();return}if(!ib(q)||q.isComposing||q.altKey||q.ctrlKey||q.metaKey||nb(q.target))return;const Y=sr(q.target);Y&&Y!==document.body&&Y!==document.documentElement&&!u.contains(Y)||(q.preventDefault(),q.stopPropagation(),d=!0,h||a("ready"))},E=q=>{ib(q)&&(d&&q.preventDefault(),v())},_=q=>{(!u.contains(sr(q.target))||nb(q.target))&&v()},T=()=>{document.hidden&&v()},C=q=>{if(h||(p=!1),!(!d||h||q.button!==0||q.isPrimary===!1||q.pointerType==="touch"||nu(q.target)||Th(q.target))){q.preventDefault(),q.stopImmediatePropagation(),h={pointerId:q.pointerId,x:q.clientX,y:q.clientY},p=!0,a("dragging");try{u.setPointerCapture(q.pointerId)}catch{}}},k=q=>{if(!h||h.pointerId!==q.pointerId)return;if(q.preventDefault(),q.stopImmediatePropagation(),(q.buttons&1)===0){g();return}const Y={x:q.clientX-h.x,y:q.clientY-h.y};h.x=q.clientX,h.y=q.clientY,c(cw(o(),Y))},A=q=>{!h||h.pointerId!==q.pointerId||(q.preventDefault(),q.stopImmediatePropagation(),g())},N=q=>{h?.pointerId===q.pointerId&&g()},j=q=>{!p||q.detail===0||(p=!1,q.preventDefault(),q.stopImmediatePropagation())},D=q=>{if(nu(q.target)||Th(q.target)||(q.preventDefault(),q.stopImmediatePropagation(),y!==null))return;const Y=u.getBoundingClientRect(),Z={x:q.clientX-Y.left,y:q.clientY-Y.top};c(X3(o(),q,Y,Z))},B=q=>{nu(q.target)||Th(q.target)||(q.preventDefault(),q.stopImmediatePropagation(),y=o().zoom)},R=q=>{if(y===null)return;q.preventDefault(),q.stopImmediatePropagation();const Y=q;if(!Number.isFinite(Y.scale)||!Y.scale||Y.scale<=0)return;const Z=u.getBoundingClientRect(),le={x:typeof Y.clientX=="number"?Y.clientX-Z.left:Z.width/2,y:typeof Y.clientY=="number"?Y.clientY-Z.top:Z.height/2};c(uw(o(),le,y*Y.scale))},U=q=>{y!==null&&(q.preventDefault(),q.stopImmediatePropagation(),y=null)};return window.addEventListener("keydown",x,!0),window.addEventListener("keyup",E,!0),window.addEventListener("blur",v),window.addEventListener("focusin",_),document.addEventListener("visibilitychange",T),u.addEventListener("pointerdown",C,!0),window.addEventListener("pointermove",k,{capture:!0,passive:!1}),window.addEventListener("pointerup",A,!0),window.addEventListener("pointercancel",A,!0),u.addEventListener("lostpointercapture",N),u.addEventListener("click",j,!0),u.addEventListener("wheel",D,{capture:!0,passive:!1}),u.addEventListener("gesturestart",B,{capture:!0,passive:!1}),u.addEventListener("gesturechange",R,{capture:!0,passive:!1}),u.addEventListener("gestureend",U,{capture:!0,passive:!1}),()=>{window.removeEventListener("keydown",x,!0),window.removeEventListener("keyup",E,!0),window.removeEventListener("blur",v),window.removeEventListener("focusin",_),document.removeEventListener("visibilitychange",T),u.removeEventListener("pointerdown",C,!0),window.removeEventListener("pointermove",k,!0),window.removeEventListener("pointerup",A,!0),window.removeEventListener("pointercancel",A,!0),u.removeEventListener("lostpointercapture",N),u.removeEventListener("click",j,!0),u.removeEventListener("wheel",D,!0),u.removeEventListener("gesturestart",B,!0),u.removeEventListener("gesturechange",R,!0),u.removeEventListener("gestureend",U,!0);const q=h?.pointerId;h=null,q!==void 0&&u.hasPointerCapture(q)&&u.releasePointerCapture(q)}},[o,c]),b.jsxs("main",{ref:n,className:"canvas",tabIndex:-1,"aria-label":"Event model diagram","aria-description":"Hold Space and drag to pan. Scroll to pan, Shift scroll to pan horizontally, Command on Mac or Control on Windows and Linux with scroll to zoom. Pinch to zoom.","data-navigation-mode":s,children:[e,b.jsx("div",{className:"canvas-navigation-help","aria-hidden":"true",children:"Space + drag to pan · Scroll to pan · Shift to pan sideways · ⌘/Ctrl + scroll to zoom"})]})}function fw({node:e,compact:n=!1}){if(e.type!=="screen"||e.screenType==="system")return null;const s=FS(e.url);return s?b.jsxs("a",{className:n?"screen-link screen-link-compact nodrag nopan":"screen-link screen-link-details",href:s,target:"_blank",rel:"noopener noreferrer","data-canvas-navigation-ignore":!0,"aria-label":`Open reference for ${e.label} in a new tab`,title:`Open reference in new tab: ${s}`,onPointerDown:a=>a.stopPropagation(),onClick:a=>a.stopPropagation(),onKeyDown:a=>a.stopPropagation(),onKeyUp:a=>a.stopPropagation(),children:[b.jsx("svg",{viewBox:"0 0 20 20",width:"16",height:"16",fill:"none",stroke:"currentColor",strokeWidth:"1.5","aria-hidden":"true",children:b.jsx("path",{d:"M11 3h6v6M17 3l-9 9M8 4H4a1 1 0 0 0-1 1v11a1 1 0 0 0 1 1h11a1 1 0 0 0 1-1v-4"})}),n?null:b.jsxs("span",{children:["Open reference · ",new URL(s).hostname]})]}):null}function ea(e,n){return JSON.stringify([e,n.type,n.sourcePath,n.sourceName,n.label,n.sliceTitle])}function Z3(e,n,s,a,o){const c=ea(n,s);if(o!==void 0&&e[c]?.message!==o)return e;if(a)return{...e,[c]:{sessionId:n,identity:Sl(s),message:a}};const u={...e};return delete u[c],u}function Sl(e){return{type:e.type,sourcePath:e.sourcePath,sourceName:e.sourceName,label:e.label,sliceTitle:e.sliceTitle}}function em(e,n){return e.type===n.type&&e.sourcePath===n.sourcePath&&e.sourceName===n.sourceName&&e.label===n.label&&e.sliceTitle===n.sliceTitle}function sb(e,n){const s=e.nodes.find(a=>a.id===n);return s?{identity:Sl(s),nodeId:n,snapshotNodes:e.nodes}:void 0}function ys(e,n){if(!e||!n)return;if(e.nodes===n.snapshotNodes)return e.nodes.find(a=>a.id===n.nodeId&&em(a,n.identity));const s=e.nodes.filter(a=>em(a,n.identity));return s.length===1?s[0]:void 0}function Q3(e,n){return e.nodes.filter(s=>em(s,Sl(n))).length===1}function Rm(e,n){if(!(!n||e?.nodeStatus[n.id]!=="changed"))return e.previousNodes?.[n.id]??e.previousGwtNodes?.[n.id]}function F3(e,n){if(!n)return e;const s=e.nodes.filter(c=>n.nodeStatus[c.id]!=="added").map(c=>{const u=Rm(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 J3(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 W3(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 P3(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(!Q3(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 Bm=20,ul=4e3,ek=16e3,tk=128*1024;function Lm(){return{version:1,drafts:{},queue:{items:[]}}}function ab(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:Sl(n),message:s.trim()}}function Ml(e){if(e.length>Bm)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>ul))return"Each queued message must contain 1 to 4000 characters.";if(e.reduce((s,a)=>s+a.message.length,0)>ek)return"The Queue can contain up to 16000 message characters.";if(e.some(s=>!ar(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>tk)return"This Queue exceeds the 128 KiB request limit. Remove an item before sending."}function $m(e,n){return!!e.submission?.body.items.some(s=>s.id===n)}function nk(e,n){if(e.items.some(o=>o.id===n.id))return e;const s=[...e.items,n],a=Ml(s);return a?{...e,error:a}:{...e,items:s,error:void 0,notice:void 0}}function ik(e,n,s){if($m(e,n))return e;const a=e.items.map(c=>c.id===n?{...c,message:s.trim()}:c),o=Ml(a);return o?{...e,error:o}:{...e,items:a,editing:void 0,error:void 0,notice:void 0}}function sk(e,n){return $m(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 dw(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=>ea(n.sessionId,o)===ea(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 ak(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=>dw(c,n))?"Review the flagged Queue items before sending. Their captured targets have not been changed.":Ml(e.items):"Add feedback to the Queue before sending."}function lk(e,n){return e.submission?.phase==="sending"?e:e.submission?{...e,submission:{...e.submission,phase:"sending"},error:void 0}:!e.items.length||e.editing||Ml(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 ok(e,n,s,a){return e.submission?.body.clientBatchId!==n?e:{...e,submission:a?{...e.submission,phase:"uncertain"}:void 0,error:s}}function hw(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 rk(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 mw(e,n){if(!Yn(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(ar)||!n.items.every(ar))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 ck(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?mw(o,s.body)?hw(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 Yn(e){return!!(e&&typeof e=="object"&&!Array.isArray(e))}function pw(e){return Yn(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 ar(e){return Yn(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<=ul}function uk(e){return Yn(e)&&typeof e.sessionId=="string"&&typeof e.projectRoot=="string"&&pw(e.identity)&&ar(e)}const gw="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 lb(){return{...Lm(),recoveryWarning:gw}}function fk(e){if(!e)return Lm();try{const n=JSON.parse(e);if(!Yn(n)||n.version!==1||!Yn(n.drafts)||!Yn(n.queue)||!Array.isArray(n.queue.items))return lb();const s={};for(const h of Object.values(n.drafts))!Yn(h)||typeof h.sessionId!="string"||!pw(h.identity)||typeof h.message!="string"||h.message.length>ul||(s[ea(h.sessionId,h.identity)]={sessionId:h.sessionId,identity:Sl(h.identity),message:h.message});const a=[];for(const h of n.queue.items)uk(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:Sl(h.identity)}));const o={items:a},c=n.queue.editing;Yn(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(Yn(u)&&typeof u.sessionId=="string"&&typeof u.projectRoot=="string"&&Yn(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<=Bm&&u.body.items.every(ar)){const h=u.body.items.map(({id:p,nodeId:y,reference:g,revision:v,message:x})=>({id:p,nodeId:y,reference:g,revision:v,message:x}));new Set(h.map(p=>p.id)).size===h.length&&h.every(p=>a.some(y=>y.id===p.id&&y.sessionId===u.sessionId&&y.projectRoot===u.projectRoot&&y.nodeId===p.nodeId&&y.reference===p.reference&&y.revision===p.revision&&y.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||!!Ml(a)||u!==void 0&&!o.submission;return{version:1,drafts:s,queue:o,recoveryWarning:d?gw:void 0}}catch{return lb()}}function dk(e){return JSON.stringify({version:1,drafts:e.drafts,queue:{items:e.queue.items,editing:e.queue.editing,submission:e.queue.submission}})}class Lo extends Error{constructor(n,s){super(n),this.uncertain=s,this.name="FeedbackCommandError"}uncertain}function tm(e){return e instanceof Error?e.message:String(e)}async function ob(e){const n=await e.json().catch(()=>{});return typeof n?.error=="string"?n.error:"Request failed ("+e.status+")."}function hk(e,n){const[s,a]=V.useState(),[o,c]=V.useState(),[u,d]=V.useState("checking"),[h,p]=V.useState(),[y,g]=V.useState(!1),[v,x]=V.useState(!1),[E,_]=V.useState(0),T=V.useRef(void 0),C=V.useRef(!1),k=V.useRef(!0),A=V.useRef(null),N=V.useCallback(()=>_(D=>D+1),[]);V.useEffect(()=>(k.current=!0,()=>{k.current=!1,A.current?.abort()}),[]),V.useEffect(()=>{if(!e)return;let D=!1,B,R;d("checking");const U=async()=>{const q=new AbortController;R=q;const Y=setTimeout(()=>q.abort(),5e3);let Z=!1;try{const le=await Uo("/api/session?view="+n,{signal:q.signal,cache:"no-store"});if(le.status===404&&!T.current){Z=!0,D||d("unavailable");return}if(!le.ok)throw new Error(await ob(le));if(!le.headers.get("content-type")?.includes("application/json")&&!T.current){Z=!0,D||d("unavailable");return}const L=await le.json();if(!W3(L))throw new Error("The project server returned an invalid session snapshot.");if(D)return;T.current&&T.current!==L.sessionId&&(g(!0),A.current?.abort(),C.current=!1),T.current=L.sessionId,a(L),c(n),d("live"),p(void 0),C.current||x(!1)}catch(le){if(D)return;d("offline"),p(q.signal.aborted?"The project server did not respond. Retrying...":tm(le)),C.current||x(!1)}finally{clearTimeout(Y),!D&&!Z&&(B=setTimeout(()=>{U()},1e3))}};return U(),()=>{D=!0,R?.abort(),B&&clearTimeout(B)}},[e,n,E]);const j=V.useCallback(async(D,B)=>{if(!s||!e||u!=="live"||o!==n)throw new Error("Wait for the current session to reconnect.");if(C.current||v)throw new Error("A request is already in progress.");const R=new AbortController;A.current=R;const U=setTimeout(()=>R.abort(),1e4);C.current=!0,x(!0);try{const q=await Uo("/api/feedback/"+D,{method:"POST",headers:{"Content-Type":"application/json","X-Emviz-Token":s.token},body:JSON.stringify(B),signal:R.signal});if(!q.ok)throw new Lo(await ob(q),q.status>=500);if(D==="batch"){const Y=await q.json().catch(()=>{});if(!mw(Y,B))throw new Lo("The server did not return a matching batch confirmation. Refresh to check delivery, or retry the same batch.",!0)}}catch(q){throw k.current&&x(!1),q instanceof Lo?q:new Lo("The server did not confirm the request. Refresh to check its status, or retry the same batch.",!0)}finally{clearTimeout(U),C.current=!1,k.current&&N()}},[u,e,v,N,s,o,n]);return{snapshot:s,snapshotView:o,connection:u,error:h,changedSession:y,pending:v,refresh:N,command:j}}const rb={idle:"Idle",queued:"Queued",working:"Working",completed:"Completed",stopped:"Stopped"};function mk({session:e,view:n,onView:s,node:a,diff:o,showingBefore:c,message:u,onMessageChange:d,onAdded:h,drafts:p,queue:y,onQueueChange:g,storageNeedsReview:v}){const[x,E]=V.useState(),[_,T]=V.useState(),C=V.useRef(!1),k=e.snapshot,A=e.connection==="live"&&e.snapshotView===n,N=a?P3(k,n,A,a,o,c):"Select a current node to write feedback.",j=v?"Review the damaged saved feedback before sending. A previous batch may already have arrived.":ak(y,k,n,A,e.pending),D=k&&a?ab(k,a,u,"preview"):void 0,B=N??(D&&u.trim()?Ml([...y.items,D]):void 0),R=k?.feedback,U=A&&!k?.stale&&!k?.error,q=U&&R?.agent.connected,Y=R?.request,Z=R?.history.filter($=>$.id!==Y?.id)??[],le=Y?[...Z,Y]:Z,L=$=>{E(void 0),e.command($,{}).catch(X=>E(tm(X)))},K=$=>{if($.preventDefault(),B||!k||!a||!u.trim())return;const X=ab(k,a,u,Lv());g(se=>nk(se,X)),h(u)},O=async()=>{if(j||C.current)return;const $=lk(y,y.submission?.body.clientBatchId??Lv()),X=$.submission;if(X){C.current=!0,g($);try{await e.command("batch",X.body),g(se=>hw(se,X.body.clientBatchId))}catch(se){g(w=>ok(w,X.body.clientBatchId,tm(se),se instanceof Lo&&se.uncertain))}finally{C.current=!1}}},H=async $=>{try{await navigator.clipboard.writeText($),T("Copied queued feedback.")}catch{T("Copy is unavailable. Select the message text and copy it manually.")}};return b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"agent-content",children:[b.jsxs("section",{className:"feedback-session","aria-label":"Feedback session",children:[b.jsxs("div",{className:"feedback-session-heading",children:[b.jsx("h2",{children:"Agent"}),b.jsx("span",{className:"feedback-state feedback-state-"+(R?.status??"idle"),role:"status",children:R?rb[R.status]:"No session"})]}),b.jsxs("p",{className:"agent-presence",children:[b.jsx("span",{"aria-hidden":"true",className:q?"presence-dot connected":"presence-dot"}),U?q?"Agent connected":"Agent disconnected":"Agent status unavailable"]}),b.jsxs("div",{className:"feedback-session-actions",children:[b.jsx("button",{type:"button",onClick:e.refresh,disabled:e.pending,children:"Refresh"}),R?R.status==="stopped"?b.jsx("button",{type:"button",onClick:()=>L("start"),disabled:!A||e.pending,children:"Resume session"}):b.jsx("button",{type:"button",onClick:()=>L("stop"),disabled:!A||e.pending,children:"Stop session"}):null]}),k?b.jsxs(b.Fragment,{children:[b.jsx("div",{className:"segmented feedback-views",role:"group","aria-label":"Model view",children:[["current","Current"],["session","Session diff"],["turn","Turn diff"]].map(([$,X])=>b.jsx("button",{type:"button","aria-pressed":n===$,onClick:()=>s($),children:X},$))}),b.jsxs("p",{className:"feedback-baseline",children:["Baseline ",k.baseline.kind==="startup"?"startup snapshot":"Git"," · ",k.baseline.label]})]}):b.jsx("p",{className:"muted",children:"Feedback is available when a project session is running."}),e.connection==="checking"?b.jsx("p",{role:"status",children:"Refreshing the model..."}):null,e.error||k?.error||R?.error||x?b.jsx("p",{className:"feedback-error",role:"alert",children:x??e.error??k?.error??R?.error}):null,k?.stale||e.connection==="offline"?b.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?b.jsx("p",{className:"feedback-warning",children:"The project server restarted. The previous session history is no longer available."}):null,R?.status==="stopped"?b.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."}):R?b.jsx("p",{className:"feedback-note",children:"Stop session cancels feedback. It cannot stop an external agent process or its file writes."}):null]}),a&&k?b.jsxs("form",{className:"feedback-composer","aria-label":"Node feedback",onSubmit:K,children:[b.jsxs("h3",{children:["Feedback for ",a.label]}),b.jsxs("p",{className:"feedback-target",children:[b.jsx("span",{children:a.type}),b.jsx("code",{children:D?.reference})]}),b.jsx("label",{htmlFor:"feedback-message",children:"Feedback message"}),b.jsx("textarea",{id:"feedback-message",value:u,maxLength:ul,rows:4,disabled:!!N,"aria-describedby":"feedback-help",placeholder:"Describe the change you want for this node.",onChange:$=>d($.target.value)}),b.jsx("p",{className:"muted",id:"feedback-help",children:B??"Add this note to your local Queue. Send to Agent sends the whole Queue as one request."}),b.jsxs("div",{className:"feedback-composer-actions",children:[b.jsxs("small",{children:[u.length,"/",ul]}),b.jsx("button",{type:"submit",disabled:!!B||!u.trim(),children:"Add to Queue"})]})]}):b.jsx("p",{className:"agent-empty",children:"Select a current node to write feedback. Your Queue stays here as you move around the model."}),b.jsxs("section",{className:"feedback-queue","aria-label":"Feedback Queue",children:[b.jsxs("div",{className:"feedback-queue-heading",children:[b.jsx("h3",{children:"Queue"}),b.jsxs("span",{children:[y.items.length,"/",Bm," · Unsent"]})]}),y.items.length?b.jsx("ol",{children:y.items.map($=>{const X=$m(y,$.id),se=k?dw($,k):void 0,w=y.editing?.id===$.id;return b.jsxs("li",{"data-queue-id":$.id,className:se?"feedback-queue-item needs-review":"feedback-queue-item",children:[b.jsxs("div",{className:"feedback-queue-item-heading",children:[b.jsx("strong",{children:$.identity.label}),b.jsx("small",{children:X?y.submission?.phase==="sending"?"Sending...":"Awaiting confirmation":"Unsent"})]}),b.jsx("code",{children:$.reference}),b.jsxs("p",{className:"feedback-captured",children:[$.identity.type," · Revision ",$.revision.slice(0,12)]}),se?b.jsx("p",{className:"feedback-warning",children:se}):null,w?b.jsxs(b.Fragment,{children:[b.jsxs("label",{className:"sr-only",htmlFor:"queue-edit-"+$.id,children:["Edit queued feedback for ",$.identity.label]}),b.jsx("textarea",{id:"queue-edit-"+$.id,value:y.editing?.message??"",maxLength:ul,rows:4,onChange:z=>g(F=>({...F,editing:{id:$.id,message:z.target.value}}))}),b.jsxs("div",{className:"feedback-queue-actions",children:[b.jsx("button",{type:"button",onClick:()=>g(z=>ik(z,$.id,z.editing?.message??$.message)),disabled:!y.editing?.message.trim(),children:"Save"}),b.jsx("button",{type:"button",onClick:()=>g(z=>({...z,editing:void 0})),children:"Cancel"})]})]}):b.jsxs(b.Fragment,{children:[b.jsx("p",{className:"feedback-message",children:$.message}),b.jsxs("div",{className:"feedback-queue-actions",children:[b.jsx("button",{type:"button","aria-label":"Edit queued feedback for "+$.identity.label,disabled:X||!!y.editing,onClick:()=>g(z=>({...z,editing:{id:$.id,message:$.message}})),children:"Edit"}),b.jsx("button",{type:"button","aria-label":"Remove queued feedback for "+$.identity.label,disabled:X,onClick:()=>g(z=>sk(z,$.id)),children:"Remove"}),b.jsx("button",{type:"button","aria-label":"Copy queued feedback for "+$.identity.label,onClick:()=>{H($.message)},children:"Copy"})]})]})]},$.id)})}):b.jsx("p",{className:"muted",children:"No queued feedback. Add notes from the nodes you want to change, then send them together."}),_?b.jsx("p",{role:"status",children:_}):null]}),k?b.jsx(pk,{drafts:p,snapshot:k}):null,le.length?b.jsxs("details",{className:"feedback-history",children:[b.jsxs("summary",{children:["Feedback history (",le.length,")"]}),b.jsx("ol",{"aria-label":"Feedback history",children:le.map($=>b.jsxs("li",{"data-request-id":$.id,children:[$.items?.length?b.jsx("ul",{className:"feedback-request-items",children:$.items.map(X=>b.jsxs("li",{children:[b.jsx("code",{children:X.reference}),b.jsx("p",{children:X.message})]},X.id))}):b.jsxs(b.Fragment,{children:[b.jsx("code",{children:$.reference}),b.jsx("p",{children:$.message})]}),$.reply?b.jsx("p",{className:"feedback-reply",children:$.reply}):b.jsx("p",{className:"muted",children:$.id===Y?.id&&R?rb[R.status]:"No reply recorded."})]},$.id))})]}):null]}),b.jsxs("footer",{className:"feedback-send",children:[y.submission?.phase==="uncertain"?b.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,y.error?b.jsx("p",{className:"feedback-error",role:"alert",children:y.error}):null,k&&y.submission&&(y.submission.sessionId!==k.sessionId||y.submission.projectRoot!==k.project.root)?b.jsx("button",{type:"button",onClick:()=>g($=>rk($,k)),children:"Release previous-session batch"}):null,y.notice?b.jsx("p",{role:"status",children:y.notice}):null,j&&y.items.length>0?b.jsx("p",{className:"muted",id:"feedback-send-help",children:j}):null,b.jsx("button",{type:"button",className:"feedback-send-button",onClick:()=>{O()},disabled:!!j,"aria-describedby":j&&y.items.length?"feedback-send-help":void 0,children:y.submission?.phase==="sending"?"Sending...":y.submission?"Retry same batch":"Send to Agent"}),b.jsxs("small",{children:[y.items.length," queued ",y.items.length===1?"item":"items"," · One agent request"]})]})]})}function pk({drafts:e,snapshot:n}){const[s,a]=V.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 b.jsxs("details",{className:"feedback-history",children:[b.jsxs("summary",{children:["Unsent feedback drafts (",e.length,")"]}),b.jsxs("ol",{"aria-label":"Unsent feedback drafts",children:[e.map(c=>{const u=ea(c.sessionId,c.identity),d=n.project.nodes.filter(p=>ea(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 b.jsxs("li",{children:[b.jsx("strong",{children:c.identity.label}),b.jsxs("p",{className:"muted",children:[c.identity.type," · ",c.identity.sourcePath??"No source path"]}),b.jsx("p",{className:"feedback-warning",children:h}),b.jsx("p",{children:c.message}),b.jsx("button",{type:"button",onClick:()=>{o(c)},children:"Copy draft"})]},u)}),s?b.jsx("li",{role:"status",children:s}):null]})]})}function Ue(e,n,s,a,o){return{id:`${n}:${a??"project"}:${s}`,severity:e,check:n,message:s,path:a,nodeId:o}}function Qa(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 gk=new Set(["sent","built","made","paid","booked","cancelled","canceled","submitted","recorded","created","updated","deleted","placed","notified"]);function yk(e){return e.match(/[A-Z]+(?=[A-Z][a-z]|$)|[A-Z]?[a-z]+|\d+/g)??[e]}function vk(e){const n=e.toLowerCase();return gk.has(n)||/(ed|en|d)$/i.test(e)}function bk(e){return yk(e).some(vk)}function cb(e){return/(Requested|Triggered|Scheduled|Enqueued|Dispatched|Required)$/.test(e)}function Sk(e){return["Selected","Shown","Viewed","Clicked","Opened","Closed","Ticked","Incremented","Reached","Displayed","Navigated"].find(n=>e.includes(n))}function wk(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 xk(e){const n=[...(e.actorIssues??[]).map(h=>Ue("error","A1",h.message,h.path)),...(e.modelIssues??[]).map(h=>Ue("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(Ue("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(Ue("error","S2",`Story "${h.name}" lists missing slice "${p}".`,h.path))}for(const h of e.events){h.fields?.trim()||n.push(Ue("error","C4",`Event "${h.name}" has no fields block.`,h.sourcePath)),!bk(h.name)&&!cb(h.name)&&n.push(Ue("warning","C3",`Event "${h.name}" does not obviously read as a past-tense domain event.`,h.sourcePath));const p=Sk(h.name);p&&n.push(Ue("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),y=h.queries.map(g=>g.name);for(const g of Qa(p))n.push(Ue("error","L9",`Command "${g}" is duplicated within slice "${h.title}".`,h.path));for(const g of Qa(y))n.push(Ue("error","L9",`Query "${g}" is duplicated within slice "${h.title}".`,h.path));for(const g of Qa(h.screen.reads))n.push(Ue("error","L9",`screen.reads lists "${g}" more than once.`,h.path));for(const g of Qa(h.screen.executes))n.push(Ue("error","L9",`screen.executes lists "${g}" more than once.`,h.path));for(const g of h.screen.reads)y.includes(g)||n.push(Ue("error","W2",`screen.reads references missing local query "${g}".`,h.path));for(const g of h.screen.executes)p.includes(g)||n.push(Ue("error","W1",`screen.executes references missing local command "${g}".`,h.path));h.screen.type==="system"&&h.screen.actors.length>0&&n.push(Ue("error","L5",`System slice "${h.title}" must not declare screen.actors.`,h.path)),h.storyName||n.push(Ue("warning","M2",`Slice "${h.title}" is not listed by any story.`,h.path)),h.commands.length>0&&h.gwt.length===0&&n.push(Ue("warning","M1",`Command slice "${h.title}" has no GWT scenarios.`,h.path));for(const g of h.commands){g.fields?.trim()||n.push(Ue("warning","L6",`Command "${g.name}" has no fields block.`,h.path));for(const v of g.produces)s.has(v)||n.push(Ue("error","G1",`Command "${g.name}" produces unregistered event "${v}".`,h.path)),o.set(v,[...o.get(v)??[],`${h.title}.${g.name}`])}for(const g of h.queries){g.fields?.trim()||n.push(Ue("warning","L7",`Query "${g.name}" has no fields block.`,h.path)),g.name.includes("For")||n.push(Ue("warning","N1",`Query "${g.name}" should use a descriptive <Thing>For<UseCaseOrScreen> name.`,h.path));for(const v of g.fromEvents)s.has(v)||n.push(Ue("error","G2",`Query "${g.name}" reads unregistered event "${v}".`,h.path)),c.set(v,[...c.get(v)??[],`${h.title}.${g.name}`])}for(const g of h.gwt)for(const v of[...g.given,...g.when,...g.then])(!v.type||!["event","command","query","error"].includes(v.type))&&n.push(Ue("error","L8",`GWT scenario "${g.name??"Unnamed"}" has invalid item type "${v.type??""}".`,h.path)),v.name||n.push(Ue("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)??[],y=c.get(h)??[];p.length===0&&n.push(Ue("error","G3",`Event "${h}" is registered but no command produces it.`)),p.length>1&&n.push(Ue("warning","G8",`Event "${h}" has multiple producers: ${p.join(", ")}.`)),p.length>0&&y.length===0&&n.push(Ue("warning",cb(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(Ue("error","G3",`Event "${h}" is read by ${p.join(", ")} but no command produces it.`));for(const h of Qa(e.slices.flatMap(p=>p.commands.map(y=>y.name))))n.push(Ue("warning","M5",`Command name "${h}" is used in multiple slices; command names should be globally unique.`));for(const h of Qa(e.slices.flatMap(p=>p.queries.map(y=>y.name))))n.push(Ue("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(Ue("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=wk(e);return d>1&&n.push(Ue("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 yw=wl.createContext(()=>{}),vw=wl.createContext({open:()=>{},list:()=>{}});function Hm(){return b.jsxs(b.Fragment,{children:[b.jsx(kn,{id:"top-target",type:"target",position:me.Top,style:{left:"46%"}}),b.jsx(kn,{id:"top-source",type:"source",position:me.Top,style:{left:"54%"}}),b.jsx(kn,{id:"bottom-target",type:"target",position:me.Bottom,style:{left:"46%"}}),b.jsx(kn,{id:"bottom-source",type:"source",position:me.Bottom,style:{left:"54%"}}),b.jsx(kn,{id:"left-target",type:"target",position:me.Left,style:{top:"46%"}}),b.jsx(kn,{id:"left-source",type:"source",position:me.Left,style:{top:"54%"}}),b.jsx(kn,{id:"right-target",type:"target",position:me.Right,style:{top:"46%"}}),b.jsx(kn,{id:"right-source",type:"source",position:me.Right,style:{top:"54%"}})]})}function Ch({title:e,items:n}){const s=n&&n.length>0?n:[{type:"empty",name:"empty"}];return b.jsxs("div",{className:"gwt-step",children:[b.jsx("div",{className:"gwt-step-title",children:e}),b.jsx("div",{className:"gwt-step-items",children:s.map((a,o)=>b.jsxs("div",{className:`gwt-step-item gwt-step-item-${a.type??"empty"}`,children:[b.jsx("span",{children:a.type??"empty"}),b.jsxs("div",{className:"gwt-item-content",children:[b.jsx("strong",{children:a.name??"empty"}),a.fields?b.jsx("pre",{children:a.fields}):null]})]},`${o}-${a.type??"empty"}-${a.name??""}`))})]})}function Ek({nodeData:e}){const n=wl.useContext(vw),s=e.scenarios??[];return b.jsxs("div",{className:`em-node em-node-gwt ${e.selected?"selected":""} ${e.diffStatus?`diff-node-${e.diffStatus}`:""}`,children:[b.jsx(Hm,{}),b.jsxs("div",{className:"node-type",children:["GWT · ",s.length," cases"]}),e.scenarioStatus?b.jsx("div",{className:"gwt-diff-counts",children:["added","removed","changed"].map(a=>`${a}: ${s.filter(o=>e.scenarioStatus?.[o.id]===a).length}`).join(" · ")}):null,b.jsx("div",{className:"gwt-summary nodrag nopan nowheel",children:s.slice(0,3).map(a=>b.jsxs("button",{type:"button","aria-current":e.selectedScenarioId===a.id?"true":void 0,onClick:o=>{o.stopPropagation(),n.open(a.id)},children:[b.jsx("span",{className:"gwt-scenario-name",children:a.label}),e.scenarioStatus?b.jsx("span",{className:"gwt-scenario-status",children:` · ${e.scenarioStatus[a.id]??"unchanged"}`}):null]},a.id))}),b.jsx("div",{className:"gwt-more nodrag nopan nowheel",children:s.length>3?b.jsxs("button",{type:"button",onClick:a=>{a.stopPropagation(),n.list(e.projectNode.id)},children:["+",s.length-3," more"]}):null})]})}function bw({node:e}){const n=aw(e);return n.length===0?null:b.jsx("div",{className:"chips actor-chips nodrag nopan nowheel","aria-label":"Actors",children:n.map(s=>b.jsxs("span",{className:"actor-chip","data-actor-id":s.id,title:s.name+" ("+s.id+")",style:{borderColor:s.color},children:[b.jsx("i",{className:"actor-swatch","aria-hidden":"true",style:{backgroundColor:s.color}}),b.jsx("span",{className:"actor-name",children:s.name})]},s.id))})}function Nk({data:e}){const n=e,s=n.projectNode,a=n.diffStatus&&n.diffStatus!=="unchanged"?b.jsx("div",{className:`diff-badge diff-badge-${n.diffStatus}`,children:n.diffStatus}):null;return s.type==="gwt"?b.jsx(Ek,{nodeData:n}):b.jsxs("div",{className:`em-node em-node-${s.type} ${n.selected?"selected":""} ${n.connected?"connected":""} ${n.diffStatus?`diff-node-${n.diffStatus}`:""}`,children:[b.jsx(Hm,{}),a,b.jsxs("div",{className:"node-heading",children:[b.jsx("div",{className:"node-type",children:s.type}),b.jsx(fw,{node:s,compact:!0})]}),b.jsx("div",{className:"node-label",children:s.label}),b.jsx(bw,{node:s})]})}function _k({data:e}){const n=wl.useContext(yw),s=e,a=s.projectNode;return b.jsxs("div",{className:`group-node group-${a.type} ${s.selected?"selected":""} ${s.diffStatus?`diff-node-${s.diffStatus}`:""}`,children:[s.diffStatus&&s.diffStatus!=="unchanged"?b.jsx("div",{className:`diff-badge diff-badge-${s.diffStatus}`,children:s.diffStatus}):null,a.type==="story"?b.jsx(Hm,{}):null,b.jsxs("div",{className:"group-title",children:[a.type==="story"&&s.storyId?b.jsxs("button",{type:"button",className:"story-toggle nodrag nopan","aria-label":`${s.collapsed?"Expand":"Collapse"} ${a.label}`,"aria-expanded":!s.collapsed,onClick:o=>{o.stopPropagation(),n(s.storyId)},children:[b.jsx("span",{"aria-hidden":"true",children:s.collapsed?"▸":"▾"})," ",a.label,b.jsxs("span",{className:"story-slice-count",children:[s.sliceCount??0," slices"]})]}):a.label,a.type==="slice"&&s.actorRelated?b.jsx("span",{className:"actor-related-badge",children:"Related"}):null]}),a.description&&!s.collapsed?b.jsx("div",{className:"group-description",children:a.description}):null]})}const Ak={eventModelNode:Nk,groupNode:_k};function ub(e){return e===me.Top?{x:0,y:-1}:e===me.Right?{x:1,y:0}:e===me.Bottom?{x:0,y:1}:{x:-1,y:0}}function Tk({sourceX:e,sourceY:n,targetX:s,targetY:a,sourcePosition:o,targetPosition:c,data:u}){const d=u,h=s-e,p=a-n,y=Math.max(56,Math.min(180,Math.abs(p)*.42)),g=Math.max(70,Math.min(180,Math.abs(h)*.38)),v=Math.max(72,Math.min(180,Math.max(Math.abs(h),Math.abs(p))*.38));if(d?.route==="same-slice-read"){const _=o===me.Top?-1:1,T=c===me.Bottom?1:-1,C=Math.max(72,Math.min(150,Math.abs(p)*.65));return`M ${e},${n} C ${e},${n+_*C} ${s},${a+T*C} ${s},${a}`}if(d?.route==="event-read"){const _=ub(o),T=ub(c);return`M ${e},${n} C ${e+_.x*v},${n+_.y*v} ${s+T.x*v},${a+T.y*v} ${s},${a}`}if(o===me.Bottom||o===me.Top){const _=o===me.Top?-1:1,T=c===me.Top?-1:1;return`M ${e},${n} C ${e},${n+_*y} ${s},${a+T*y} ${s},${a}`}const x=o===me.Left?-1:1,E=c===me.Left?-1:1;return`M ${e},${n} C ${e+x*g},${n} ${s+E*g},${a} ${s},${a}`}function Ck(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 b.jsxs(b.Fragment,{children:[b.jsx(hr,{path:Tk(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)?b.jsx(gM,{children:b.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=>b.jsx("button",{type:"button",onClick:()=>n?.onSelectField?.(h),children:h},h)),o.remainingCount>0?b.jsxs("span",{children:["+",o.remainingCount]}):null]})}):null]})}const Mk={eventModelEdge:Ck};function Gc({label:e,description:n,value:s,copiedKey:a,onCopy:o}){return b.jsx("button",{type:"button",className:"copy-action",onClick:()=>o(a,s),children:b.jsxs("span",{children:[b.jsx("strong",{children:e}),b.jsx("small",{children:n})]})})}function Sw(e){return e==="query-screen"||e==="screen-command"||e==="command-event"||e==="event-query"}function Ok(e){return JSON.stringify(e).replace(/</g,"\\u003c").replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function kk(e){return(e.graphSidecar?.model?.name??e.graphSidecar?.model?.id??"event-model").toLowerCase().replace(/[^a-z0-9_-]+/g,"-").replace(/^-+|-+$/g,"")||"event-model"}async function fb(e){const n=await fetch(e);if(!n.ok)throw new Error(`Failed to fetch ${e}: ${n.status}`);return n.text()}async function zk(e,n,s,a){const o=Array.from(document.querySelectorAll('script[type="module"][src]')).map(y=>new URL(y.src,window.location.href)).filter(y=>!y.pathname.includes("/@vite/")&&!y.pathname.endsWith("/@react-refresh"));if(o.length===0||o.some(y=>y.pathname.includes("/src/")||y.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(y=>new URL(y.href,window.location.href)),u=await Promise.all(c.map(y=>fb(y.href))),d=Array.from(document.querySelectorAll("style")).map(y=>y.textContent??"").filter(Boolean),h=await Promise.all(o.map(y=>fb(y.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__ = ${Ok(p)};<\/script>`,` <script type="module">${h.join(`
156
+
157
+ `)}<\/script>`," </body>","</html>"].join(`
158
+ `)}function Dk({diff:e,filter:n,onFilter:s,onSelect:a}){const o=Object.entries(e.nodeStatus).filter(([,c])=>c!=="unchanged").slice(0,80);return b.jsxs("aside",{className:"panel diff-panel",children:[b.jsx("h2",{children:"Diff"}),b.jsx("p",{children:"All stories are shown in diff views so removed items remain accessible."}),e.timelinesChanged?b.jsx("p",{role:"status",children:"Timeline layout changed. Ordering does not add event dependencies."}):null,b.jsxs("div",{className:"diff-range",children:[b.jsx("code",{children:e.base.label}),b.jsx("span",{children:"to"}),b.jsx("code",{children:e.target.label})]}),b.jsxs("div",{className:"diff-counts",children:[b.jsxs("button",{type:"button",className:n==="added"?"active added":"added",onClick:()=>s(n==="added"?"all":"added"),children:[b.jsx("strong",{children:e.summary.nodes.added}),b.jsx("span",{children:"Added"})]}),b.jsxs("button",{type:"button",className:n==="removed"?"active removed":"removed",onClick:()=>s(n==="removed"?"all":"removed"),children:[b.jsx("strong",{children:e.summary.nodes.removed}),b.jsx("span",{children:"Removed"})]}),b.jsxs("button",{type:"button",className:n==="changed"?"active changed":"changed",onClick:()=>s(n==="changed"?"all":"changed"),children:[b.jsx("strong",{children:e.summary.nodes.changed}),b.jsx("span",{children:"Changed"})]})]}),n!=="all"?b.jsx("button",{type:"button",className:"clear-diff-filter",onClick:()=>s("all"),children:"Show full graph"}):null,b.jsx("h3",{children:"Changed Nodes"}),b.jsx("div",{className:"diff-list",children:o.length===0?b.jsx("p",{className:"muted",children:"No node changes."}):o.map(([c,u])=>b.jsxs("button",{type:"button",className:`diff-list-item ${u}`,onClick:()=>a(c),children:[b.jsx("span",{children:c}),b.jsx("strong",{children:u})]},c))})]})}function jk(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 Rk(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 Bk(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 Lk(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 $k(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=Lk(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 Hk({onImport:e,error:n}){return b.jsx("div",{className:"import-panel",children:b.jsxs("div",{className:"import-card",children:[b.jsx("h1",{children:"emviz"}),b.jsx("p",{children:"Import an Event Modeling project folder or select YAML/JSON files to visualize the model."}),b.jsxs("div",{className:"import-actions",children:[b.jsxs("label",{children:["Import folder",b.jsx("input",{type:"file",multiple:!0,webkitdirectory:"",directory:"",onChange:s=>s.currentTarget.files&&e(s.currentTarget.files)})]}),b.jsxs("label",{children:["Import files",b.jsx("input",{type:"file",multiple:!0,accept:".yaml,.yml,.json",onChange:s=>s.currentTarget.files&&e(s.currentTarget.files)})]})]}),n?b.jsx("p",{className:"import-error",children:n}):null]})})}function Uk({tab:e,onTab:n}){return b.jsx("div",{className:"inspector-tabs",role:"tablist","aria-label":"Inspector",children:["details","agent"].map(s=>b.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 Ik({project:e,selectedNode:n,diff:s,findings:a,selectedFieldName:o,onSelect:c,onSelectField:u,onClearField:d,onPreviewConnection:h,onClearPreview:p,gwtList:y,onGwtList:g,onClose:v,onFocusNode:x,tab:E,onTab:_,agentPanel:T,oldVersionId:C,onVersion:k}){const A=Rm(s,n),N=n&&A&&C===n?.id?{...A,id:n.id}:n,[j,D]=V.useState(),[B,R]=V.useState(""),U=V.useRef(null),q=V.useRef(0),Y=!!y;V.useLayoutEffect(()=>{Y&&U.current&&(U.current.scrollTop=q.current)},[Y,E]);const Z=ie=>{ie.key!=="Escape"&&ie.stopPropagation()},le=V.useCallback((ie,te)=>{navigator.clipboard?.writeText(te).then(()=>{D(ie),window.setTimeout(()=>D(oe=>oe===ie?void 0:oe),1400)})},[]),L=b.jsx(Uk,{tab:E,onTab:_});if(E==="agent")return b.jsxs("aside",{id:"inspector-agent",className:"panel panel-right agent-panel","aria-label":"Agent",onKeyDown:Z,onKeyUp:Z,children:[L,T]});if(y){const ie=B.trim().toLowerCase(),te=y.filter(oe=>oe.label.toLowerCase().includes(ie));return b.jsxs("aside",{ref:U,id:"inspector-details",className:"panel panel-right gwt-panel","aria-label":"GWT scenarios",onKeyDown:Z,onKeyUp:Z,onScroll:oe=>{q.current=oe.currentTarget.scrollTop},children:[L,b.jsx("button",{type:"button",onClick:v,children:"Close"}),b.jsxs("h2",{children:[y[0]?.sliceTitle," · All scenarios (",y.length,")"]}),b.jsxs("div",{className:"gwt-filter",children:[b.jsx("label",{htmlFor:"gwt-name-filter",children:"Filter by scenario name"}),b.jsx("input",{id:"gwt-name-filter",type:"search",value:B,onChange:oe=>{R(oe.target.value),q.current=0,U.current&&(U.current.scrollTop=0)}}),b.jsx("button",{type:"button",disabled:!B,onClick:()=>{R(""),q.current=0,U.current&&(U.current.scrollTop=0),U.current?.querySelector("input")?.focus({preventScroll:!0})},children:"Clear filter"})]}),b.jsx("p",{role:"status",children:te.length?`${te.length} of ${y.length} scenarios`:"No scenarios match this name."}),b.jsx("div",{className:"gwt-all-list",children:te.map(oe=>b.jsxs("button",{type:"button","aria-current":N?.id===oe.id?"true":void 0,onClick:()=>{q.current=U.current?.scrollTop??q.current,c(oe.id)},children:[oe.label,s?` · ${s.nodeStatus[oe.id]??"unchanged"}`:""]},oe.id))})]})}if(!N)return b.jsxs("aside",{id:"inspector-details",className:"panel panel-right","aria-label":"Node details",children:[L,b.jsx("h2",{children:"Selection"}),b.jsx("p",{className:"muted",children:"Select a node to inspect source and connections."})]});const K=!!(A&&C===n?.id)||s?.nodeStatus[N.id]==="removed",O=K?F3(e,s):J3(e,s),H=new Map(O.nodes.map(ie=>[ie.id,ie])),$=O.edges.filter(ie=>{const te=H.get(ie.source),oe=H.get(ie.target);return Sw(ie.kind)&&te&&oe&&te.type!=="gwt"&&oe.type!=="gwt"}),X=$.filter(ie=>ie.target===N.id),se=$.filter(ie=>ie.source===N.id),w=eS(N.fields),F=`em://${e.graphSidecar?.model?.id??"event_model"}/${N.id}`,W=N.raw??N.fields??N.description??N.label,fe=[`Reference: ${F}`,`Node: ${N.label} (${N.type})`,`Source: ${N.sourcePath??"unknown"}`,"","Incoming:",...X.length===0?["- none"]:X.map(ie=>`- ${H.get(ie.source)?.label??ie.source} -> ${N.label}`),"","Outgoing:",...se.length===0?["- none"]:se.map(ie=>`- ${N.label} -> ${H.get(ie.target)?.label??ie.target}`),"","Source excerpt:",W].join(`
159
+ `),de=`Please update this event model node.
160
+
161
+ Reference:
162
+ ${F}
163
+
164
+ Source path:
165
+ ${N.sourcePath??"unknown"}
166
+
167
+ Current context:
168
+ ${W}
169
+
170
+ Goal:
171
+ `;return b.jsxs("aside",{id:"inspector-details",className:`panel panel-right ${N.type==="gwt"?"gwt-panel":""}`,"aria-label":"Node details",onKeyDown:Z,onKeyUp:Z,children:[L,N.type==="gwt"?b.jsxs("div",{className:"gwt-panel-actions",children:[b.jsx("button",{type:"button",onClick:()=>g(N.id),children:"All scenarios"}),b.jsx("button",{type:"button",onClick:v,children:"Close"})]}):null,b.jsxs("div",{className:"panel-heading",children:[b.jsx("h2",{children:N.label}),b.jsx("button",{type:"button",className:"icon-button",onClick:()=>x(N.id),"aria-label":"Focus selected node",title:"Focus selected node",children:b.jsx("span",{className:"target-icon","aria-hidden":"true"})})]}),s&&n?b.jsxs("p",{children:[s.nodeStatus[n.id]," · ",K?"Old version":"New version"]}):null,A?b.jsxs("div",{className:"gwt-panel-actions",role:"group","aria-label":"Node version",children:[b.jsx("button",{type:"button","aria-pressed":C!==n?.id,onClick:()=>k(void 0),children:"New version"}),b.jsx("button",{type:"button","aria-pressed":C===n?.id,onClick:()=>k(n?.id),children:"Old version"})]}):null,N.type==="gwt"?b.jsxs("section",{"aria-label":"Scenario details",children:[N.description?b.jsx("p",{children:N.description}):null,b.jsx(Ch,{title:"Given",items:N.given}),b.jsx(Ch,{title:"When",items:N.when}),b.jsx(Ch,{title:"Then",items:N.then}),b.jsx("p",{className:"muted",children:"YAML below is the source slice, not an individual scenario excerpt."})]}):null,b.jsxs("div",{className:"meta-row",children:[b.jsx("span",{children:"Type"}),b.jsx("strong",{children:N.type})]}),b.jsx(bw,{node:N}),b.jsx(fw,{node:N}),b.jsxs("div",{className:"meta-row",children:[b.jsx("span",{children:"Reference"}),b.jsx("code",{children:F})]}),N.sourcePath?b.jsxs("div",{className:"meta-row",children:[b.jsx("span",{children:"Source"}),b.jsx("code",{children:N.sourcePath})]}):null,b.jsxs("details",{className:"copy-section",children:[b.jsxs("summary",{children:[b.jsx("span",{children:"Copy for LLM"}),j?b.jsxs("strong",{className:"copy-feedback","aria-live":"polite",children:["Copied ",j]}):null]}),b.jsxs("div",{className:"copy-actions",children:[b.jsx(Gc,{label:"Reference",description:"Stable em:// node handle",value:F,copiedKey:"reference",onCopy:le}),b.jsx(Gc,{label:"YAML",description:N.type==="gwt"?"Source YAML for the whole slice":"Source excerpt for this node",value:W,copiedKey:"YAML",onCopy:le}),b.jsx(Gc,{label:"Context",description:"Reference plus incoming/outgoing links",value:fe,copiedKey:"context",onCopy:le}),b.jsx(Gc,{label:"Edit prompt",description:"Prompt scaffold for asking an LLM to edit",value:de,copiedKey:"prompt",onCopy:le})]})]}),b.jsx("h3",{children:"Connections"}),b.jsxs("div",{className:"connection-list",children:[b.jsx("strong",{children:"Incoming"}),X.length===0?b.jsx("p",{className:"muted",children:"None"}):X.map(ie=>b.jsx("button",{type:"button",className:"connection-button",onClick:()=>c(ie.source),onMouseEnter:()=>h(ie.id),onMouseLeave:p,onFocus:()=>h(ie.id),onBlur:p,children:b.jsx("span",{children:H.get(ie.source)?.label??ie.source})},ie.id)),b.jsx("strong",{children:"Outgoing"}),se.length===0?b.jsx("p",{className:"muted",children:"None"}):se.map(ie=>b.jsx("button",{type:"button",className:"connection-button",onClick:()=>c(ie.target),onMouseEnter:()=>h(ie.id),onMouseLeave:p,onFocus:()=>h(ie.id),onBlur:p,children:b.jsx("span",{children:H.get(ie.target)?.label??ie.target})},ie.id))]}),N.type==="command"||N.type==="event"||N.type==="query"?b.jsxs(b.Fragment,{children:[b.jsx("h3",{children:"Fields"}),b.jsxs("div",{className:"field-panel",children:[w.length===0?b.jsx("p",{className:"field-empty",children:"No fields documented."}):b.jsx("div",{className:"field-list",children:w.map(ie=>b.jsx("button",{type:"button",className:o===ie?"selected":"",onClick:()=>u(ie),children:ie},ie))}),o?b.jsx("button",{type:"button",className:"clear-field",onClick:d,children:"Clear field focus"}):null]})]}):null,b.jsx("h3",{children:"Findings"}),a.length===0?b.jsx("p",{className:"muted",children:"No findings for this node."}):a.map(ie=>b.jsxs("div",{className:`finding finding-${ie.severity}`,children:[b.jsx("strong",{children:ie.check}),b.jsx("span",{children:ie.message})]},ie.id)),b.jsx("h3",{children:N.type==="gwt"?"Source slice YAML":"Source"}),b.jsx("pre",{children:W})]})}function qk({report:e,onSelect:n,open:s,onOpen:a,onClose:o}){const c=e?.errors??0,u=e?.warnings??0,d=c+u;return b.jsxs(b.Fragment,{children:[b.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:[b.jsx("span",{"aria-hidden":"true",children:"!"}),d>0?b.jsx("strong",{"aria-label":`${d} validation findings`,children:d}):null]}),s?b.jsxs("aside",{className:"panel validation-drawer",id:"validation-panel",children:[b.jsxs("div",{className:"panel-heading",children:[b.jsx("h2",{children:"Validation"}),b.jsx("button",{type:"button",className:"panel-close",onClick:o,"aria-label":"Close validation",children:"Close"})]}),e?b.jsxs(b.Fragment,{children:[b.jsxs("div",{className:"status-row",children:[b.jsxs("span",{className:"status error",children:[e.errors," errors"]}),b.jsxs("span",{className:"status warning",children:[e.warnings," warnings"]})]}),b.jsx("div",{className:"findings-list",children:e.findings.length===0?b.jsx("p",{className:"muted",children:"No validation findings."}):e.findings.map(h=>b.jsxs("div",{className:`finding finding-${h.severity}`,children:[b.jsxs("div",{className:"finding-header",children:[b.jsx("strong",{children:h.check}),h.nodeId?b.jsx("button",{type:"button",onClick:()=>n(h.nodeId),children:"Focus"}):null]}),b.jsx("span",{children:h.message}),h.path?b.jsx("code",{children:h.path}):null]},h.id))})]}):b.jsx("p",{className:"muted",children:"Loading validation..."})]}):null]})}function Vk(){const[e,n]=V.useState(),[s,a]=V.useState(),[o,c]=V.useState(),[u,d]=V.useState(()=>window.__EMVIZ_EXPORT__?.timelineId),[h,p]=V.useState("auto"),[y,g]=V.useState(()=>new Map),v=e?eO(e,vh(u,!!o)):"",x=V.useMemo(()=>v?tO(v):new Set,[v]),E=y.get(v)??x,_=V.useCallback(ee=>{v&&(g(pe=>new Map(pe).set(v,ee)),nO(v,ee))},[v]),T=V.useCallback(ee=>{const pe=new Set(E);pe.has(ee)?pe.delete(ee):pe.add(ee),_(pe)},[_,E]),[C,k]=V.useState("all"),[A,N]=V.useState({actorIds:[],includeUnassigned:!1}),j=V.useRef(void 0),[D,B]=V.useState("loading"),[R,U]=V.useState("remote"),[q,Y]=V.useState(),[Z,le]=V.useState(!1),[L,K]=V.useState("idle"),[O,H]=V.useState(),[$,X]=V.useState(()=>{try{return fk(sessionStorage.getItem("emviz:feedback-workspace:v1"))}catch{return Lm()}}),{drafts:se,queue:w}=$,[z,F]=V.useState(),[W,fe]=V.useState("details"),[de,ie]=V.useState(),te=V.useCallback(ee=>{X(pe=>{const xe=typeof ee=="function"?ee(pe.queue):ee;return xe===pe.queue?pe:{...pe,queue:xe}})},[]);V.useEffect(()=>{if($.recoveryWarning){F($.recoveryWarning);return}try{sessionStorage.setItem("emviz:feedback-workspace:v1",dk($)),F(void 0)}catch{F("Browser storage is unavailable. Your drafts and Queue are kept in this tab, but reloading the page may lose them.")}},[$]);const[oe,ve]=V.useState(),[Se,he]=V.useState(),ge=ys(e,oe)?.id,Ee=ys(e,Se)?.id,Ce=V.useRef(null),[Ie,et]=V.useState([]),[jt,rt]=V.useState([]),[Et,Rt]=V.useState(""),[jn,Ct]=V.useState(),[Ze,ft]=V.useState(),[Vt,Ut]=V.useState(!1),{setCenter:Bt,fitView:vn}=dr(),[bn,Ol]=V.useState("current"),Je=hk(!window.__EMVIZ_EXPORT__&&R==="remote"&&D!=="import",bn);V.useEffect(()=>{Je.snapshot&&te(ee=>ck(ee,Je.snapshot))},[Je.snapshot,te]);const Yt=V.useRef(void 0),pt=Je.snapshot?JSON.stringify([Je.snapshot.sessionId,Je.snapshot.revision,bn,Je.snapshot.feedback.request?.id,Je.snapshot.feedback.status]):void 0,Sn={...Je,connection:R!=="remote"||window.__EMVIZ_EXPORT__?"unavailable":Je.connection==="live"&&pt&&Yt.current?.key!==pt?"checking":Je.connection};V.useEffect(()=>{if(window.__EMVIZ_EXPORT__?.project){n(window.__EMVIZ_EXPORT__.project),a(window.__EMVIZ_EXPORT__.report),c(window.__EMVIZ_EXPORT__.diff),B("ready"),window.setTimeout(()=>{vn({padding:.18,duration:300})},50);return}if(R==="local"||Je.connection!=="unavailable")return;let ee=!1;return Promise.all([Uo("/api/model").then(pe=>pe.json()),Uo("/api/validation").then(pe=>pe.ok?pe.json():void 0).catch(()=>{}),Uo("/api/diff").then(pe=>pe.ok?pe.json():void 0).catch(()=>{})]).then(([pe,xe,Be])=>{if(!ee){if(!pe||!Array.isArray(pe.nodes)||!Array.isArray(pe.edges))throw new Error("No project server is available.");n(pe),a(xe),c(Be),B("ready"),window.setTimeout(()=>{vn({padding:.18,duration:300})},50)}}).catch(()=>{ee||B("import")}),()=>{ee=!0}},[vn,Je.connection,R]),V.useEffect(()=>{const ee=Je.snapshot;if(!ee||Je.snapshotView!==bn)return;const pe=pt;if(Yt.current?.key===pe)return;const xe=!Yt.current;Yt.current&&Yt.current.sessionId!==ee.sessionId&&(ve(void 0),he(void 0),N({actorIds:[],includeUnassigned:!1}),et([]),rt([]),ft(void 0)),Yt.current={key:pe,sessionId:ee.sessionId},n(ee.project),a(ee.validation),c(ee.diff),B("ready"),Ct(void 0),xe&&window.setTimeout(()=>{vn({padding:.18,duration:300})},50)},[vn,Je.snapshot,Je.snapshotView,pt,bn]);const Mt=V.useMemo(()=>e?lw(e,o?.previousNodes):[],[e,o?.previousNodes]),kl=!!(e?.nodes.some(ee=>ee.type==="screen"&&!ee.actors?.length)||Object.values(o?.previousNodes??{}).some(ee=>ee.type==="screen"&&!ee.actors?.length));V.useEffect(()=>{if(!e)return;const ee=j.current!==e.root;j.current=e.root,N(pe=>ee?{actorIds:[],includeUnassigned:!1}:T3(e,pe,o?.previousNodes))},[e,o?.previousNodes]),V.useEffect(()=>{e&&(oe&&!ys(e,oe)&&ve(void 0),Se&&!ys(e,Se)&&he(void 0),et(ee=>ee.filter(pe=>ys(e,pe))),rt(ee=>ee.filter(pe=>ys(e,pe))))},[e,oe,Se]);const gt=V.useMemo(()=>e?.nodes.find(ee=>ee.id===ge),[e,ge]),$i=Je.snapshot?.sessionId,Wn=$i&&gt?ea($i,gt):void 0;V.useEffect(()=>ie(void 0),[Wn]);const di=(ee,pe)=>{!$i||!gt||X(xe=>({...xe,drafts:Z3(xe.drafts,$i,gt,ee,pe)}))},Hi=V.useMemo(()=>s?.findings.filter(ee=>ee.nodeId===ge)??[],[s,ge]),Gt=V.useMemo(()=>e?KM(e):new Map,[e]),hi=V.useMemo(()=>{if(jn)return new Set([jn]);const ee=ZM(Gt,Ze);if(ee)return ee;if(!e||!ge)return;const pe=new Set;for(const xe of e.edges)Sw(xe.kind)&&(xe.source===ge||xe.target===ge)&&pe.add(xe.id);return pe},[Gt,jn,e,Ze,ge]),[Pn,zl]=V.useState(new Map),aa=V.useCallback(ee=>{const pe=new Set(e?.nodes.filter(xe=>xe.type==="screen").map(xe=>xe.id));zl(xe=>{const Be=new Map(xe);for(const tt of ee)tt.type==="dimensions"&&tt.dimensions&&pe.has(tt.id)&&Be.set(tt.id,tt.dimensions.height);return Be.size===xe.size&&[...Be].every(([tt,Xt])=>xe.get(tt)===Xt)?xe:Be})},[e]),Nt=V.useMemo(()=>e?eb(e,ge,{screenHeights:Pn,timelineId:vh(u,!!o),edgeVisibility:h,collapsedStoryIds:E,focusedEdgeIds:hi,edgeFieldFlows:Gt,selectedFieldName:Ze,onSelectField:ft,diffNodeStatus:o?.nodeStatus,diffEdgeStatus:o?.edgeStatus,diffFilter:C,actorFilter:A,previousNodes:o?.previousNodes}):{nodes:[],edges:[],counts:{stories:0,slices:0,events:0}},[Pn,u,h,E,A,o?.previousNodes,o?.edgeStatus,o?.nodeStatus,C,Gt,hi,e,Ze,ge]);V.useEffect(()=>{u&&e&&!e.timelines?.some(ee=>ee.id===u)&&d(void 0)},[e,u]),V.useEffect(()=>{if(!u||o)return;const ee=new Set(Nt.nodes.map(pe=>pe.id));ge&&!ee.has(ge)&&ve(void 0),Ee&&!ee.has(Ee)&&he(void 0)},[Nt.nodes,u,ge,Ee,o]);const ei=V.useMemo(()=>{if(!e||Et.trim().length<2)return[];const ee=Et.trim().toLowerCase(),pe=new Set(Nt.nodes.map(xe=>xe.id));return e.nodes.filter(xe=>pe.has(xe.id)&&`${xe.label} ${xe.type} ${xe.sourcePath??""}`.toLowerCase().includes(ee)).slice(0,8)},[e,Et,Nt.nodes]),Lt=V.useCallback((ee,pe=!0,xe=!1)=>{let Be=Nt.nodes.find(Ye=>Ye.id===ee);const tt=!!(!Be&&u&&e?.nodes.some(Ye=>Ye.id===ee));tt&&e&&(d(void 0),Be=eb(e).nodes.find(Ye=>Ye.id===ee)),Ct(void 0),pe&&ge&&ge!==ee&&(oe&&et(Ye=>[...Ye,oe]),rt([]));const Xt=Be?.data.projectNode.type==="gwt";if(Xt&&!Ce.current){const Ye=document.activeElement;Ce.current=Ye?.closest(".search-results")?document.querySelector(".search-box input"):Ye instanceof HTMLElement?Ye:null}if(Xt||(Ce.current=null),he(void 0),e&&ve(sb(e,ee)),Be&&xe){Be.hidden&&Be.data.storyId&&(Be=Nt.nodes.find(on=>on.data.collapsed&&on.data.storyId===Be.data.storyId)??Be);const Ye={x:Be.position.x+(Be.initialWidth??178)/2,y:Be.position.y+(Be.initialHeight??92)/2};tt?window.setTimeout(()=>{Bt(Ye.x,Ye.y,{zoom:1.2,duration:350})},50):Bt(Ye.x,Ye.y,{zoom:1.2,duration:350})}},[Nt.nodes,e,oe,ge,Bt,u]),Ui=V.useCallback(()=>{ve(void 0),Ct(void 0),ft(void 0),he(void 0);const ee=Ce.current;Ce.current=null,ee&&requestAnimationFrame(()=>{ee?.isConnected?ee.focus({preventScroll:!0}):document.querySelector(".canvas")?.focus({preventScroll:!0})})},[]),Ii=V.useCallback(ee=>{Ce.current||(Ce.current=document.activeElement instanceof HTMLElement?document.activeElement:null),e&&he(sb(e,ee))},[e]),la=V.useMemo(()=>({open:Lt,list:Ii}),[Lt,Ii]),ln=e?.nodes.find(ee=>ee.id===Ee),Ns=ln?e?.nodes.filter(ee=>ee.type==="gwt"&&(ln.sourcePath?ee.sourcePath===ln.sourcePath:ee.sliceTitle===ln.sliceTitle)).filter(ee=>!o||C==="all"||o.nodeStatus[ee.id]===C):void 0;V.useEffect(()=>{(Ee||gt?.type==="gwt")&&((Ee?document.querySelector(".gwt-all-list button[aria-current]"):null)??document.querySelector('.gwt-panel button:not([role="tab"])'))?.focus({preventScroll:!0})},[Ee,gt?.id,gt?.type]);const oa=V.useCallback(ee=>{e?.edges.find(xe=>xe.id===ee)&&Ct(ee)},[e?.edges]),ra=V.useCallback(()=>{Ct(void 0)},[]),wn=V.useCallback(()=>{e&&(K("exporting"),H(void 0),le(!1),zk(e,s,o,u).then(ee=>{jk(`${kk(e)}.emviz.html`,ee)}).catch(ee=>{H(ee instanceof Error?ee.message:String(ee))}).finally(()=>K("idle")))},[o,e,s,u]);V.useEffect(()=>{const ee=pe=>{pe.key==="Escape"&&(le(!1),Ui())};return window.addEventListener("keydown",ee),()=>window.removeEventListener("keydown",ee)},[Ui]);const dt=V.useCallback(()=>{const ee=Ie.at(-1);if(!ee)return;et(xe=>xe.slice(0,-1)),oe&&rt(xe=>[...xe,oe]);const pe=ys(e,ee);pe&&Lt(pe.id,!1)},[Ie,Lt,e,oe]),At=V.useCallback(()=>{const ee=jt.at(-1);if(!ee)return;rt(xe=>xe.slice(0,-1)),oe&&et(xe=>[...xe,oe]);const pe=ys(e,ee);pe&&Lt(pe.id,!1)},[Lt,jt,e,oe]),Rn=V.useCallback(ee=>{Rk(ee).then(pe=>{const xe=Bk(pe),Be=A3(pe,{root:iO(xe?.model?.id,crypto.getRandomValues(new Uint32Array(4)).join("-"))}),tt=Be;tt.graphSidecar=xe??{model:{id:"browser_import",name:"Browser Import"}},d(void 0),U("local"),n(tt);const Xt=xk(Be),Ye=$k(tt);a({errors:Xt.errors,warnings:Xt.warnings+Ye.filter(on=>on.severity==="warning").length,findings:[...Xt.findings,...Ye]}),c(void 0),he(void 0),k("all"),N({actorIds:[],includeUnassigned:!1}),ve(void 0),Ct(void 0),ft(void 0),et([]),rt([]),B("ready"),Y(void 0),window.setTimeout(()=>{vn({padding:.18,duration:300})},50)}).catch(pe=>{Y(pe instanceof Error?pe.message:String(pe)),B("import")})},[vn]);return D==="import"?b.jsx(Hk,{onImport:Rn,error:q}):e?b.jsxs("div",{className:`app-shell ${o?"diff-mode":""}`,children:[b.jsxs("header",{className:"toolbar",children:[b.jsxs("div",{className:"model-summary",children:[b.jsx("strong",{children:"emviz"}),b.jsxs("span",{children:[Nt.counts.stories," stories"]}),b.jsxs("span",{children:[Nt.counts.slices," slices"]}),b.jsxs("span",{children:[Nt.counts.events," events"]})]}),e.timelines?.length?b.jsxs("label",{className:"timeline-picker",children:[b.jsx("span",{children:"Timeline"}),b.jsxs("select",{"aria-label":"Timeline",disabled:!!o,title:o?"Diff shows all stories, including removed items.":void 0,value:vh(u,!!o)??"",onChange:ee=>{d(ee.target.value||void 0),ve(void 0),he(void 0),et([]),rt([]),Ct(void 0),ft(void 0),window.setTimeout(()=>{vn({padding:.18,duration:300})},50)},children:[b.jsx("option",{value:"",children:"All stories"}),e.timelines?.map(ee=>b.jsxs("option",{value:ee.id,children:[ee.name," · ",ee.path]},ee.id))]})]}):null,b.jsxs("label",{className:"edge-visibility-picker",children:[b.jsx("span",{children:"Edges"}),b.jsxs("select",{"aria-label":"Edge visibility",value:h,onChange:ee=>p(ee.target.value),children:[b.jsx("option",{value:"auto",children:"Auto"}),b.jsx("option",{value:"intra-slice",children:"Intra-slice only"}),b.jsx("option",{value:"all",children:"All"})]})]}),b.jsxs("div",{className:"segmented story-controls","aria-label":"Story visibility",children:[b.jsx("button",{type:"button",onClick:()=>_(new Set),children:"Expand all stories"}),b.jsx("button",{type:"button",onClick:()=>_(new Set(e.stories.map(an))),children:"Collapse all stories"})]}),b.jsxs("div",{className:"segmented toolbar-history","aria-label":"Selection history",children:[b.jsx("button",{type:"button",disabled:Ie.length===0,onClick:dt,"aria-label":"Back",title:"Back",children:"←"}),b.jsx("button",{type:"button",disabled:jt.length===0,onClick:At,"aria-label":"Forward",title:"Forward",children:"→"})]}),b.jsxs("div",{className:"search-box",children:[b.jsx("input",{"aria-label":"Search event model",value:Et,onChange:ee=>Rt(ee.target.value),placeholder:"Search nodes by name or type..."}),ei.length>0?b.jsx("div",{className:"search-results",children:ei.map(ee=>b.jsxs("button",{type:"button",onClick:()=>{Lt(ee.id),Rt("")},children:[b.jsx("span",{children:ee.label}),b.jsx("small",{children:ee.type})]},ee.id))}):null]}),b.jsxs("details",{className:"actor-filter",onKeyDown:ee=>{ee.key==="Escape"&&(ee.preventDefault(),ee.stopPropagation(),ee.currentTarget.open=!1,ee.currentTarget.querySelector("summary")?.focus())},children:[b.jsxs("summary",{children:["Actors · ",A.actorIds.length+Number(A.includeUnassigned)||"All"]}),b.jsxs("div",{className:"actor-filter-popover",children:[b.jsx("p",{children:"Match any selected actor. Related system steps stay visible."}),b.jsxs("div",{className:"actor-filter-options",role:"group","aria-label":"Filter by actor",children:[Mt.map(ee=>b.jsxs("label",{children:[b.jsx("input",{type:"checkbox","aria-label":ee.name===ee.id?ee.name:ee.name+" ("+ee.id+")",checked:A.actorIds.includes(ee.id),onChange:pe=>{const xe=pe.target.checked;N(Be=>({...Be,actorIds:xe?[...Be.actorIds,ee.id]:Be.actorIds.filter(tt=>tt!==ee.id)}))}}),b.jsx("i",{className:"actor-swatch","aria-hidden":"true",style:{backgroundColor:ee.color}}),b.jsxs("span",{children:[ee.name,ee.name!==ee.id?b.jsx("small",{children:ee.id}):null]})]},ee.id)),kl?b.jsxs("label",{children:[b.jsx("input",{type:"checkbox","aria-label":"Unassigned screens",checked:A.includeUnassigned,onChange:ee=>{const pe=ee.target.checked;N(xe=>({...xe,includeUnassigned:pe}))}}),b.jsx("span",{children:"Unassigned screens"})]}):null]}),b.jsx("button",{type:"button",disabled:A.actorIds.length===0&&!A.includeUnassigned,onClick:()=>N({actorIds:[],includeUnassigned:!1}),children:"Clear actors"})]})]}),b.jsxs("div",{className:"toolbar-menu",children:[b.jsx("button",{type:"button",className:"menu-trigger",onClick:()=>le(ee=>!ee),"aria-haspopup":"menu","aria-expanded":Z,"aria-label":"Open menu",title:"Open menu",children:"..."}),Z?b.jsx("div",{className:"menu-popover",role:"menu",children:b.jsx("button",{type:"button",role:"menuitem",onClick:wn,disabled:L==="exporting",children:L==="exporting"?"Exporting...":"Export"})}):null]}),O?b.jsx("div",{className:"toolbar-error",role:"alert",children:O}):null]}),b.jsxs("div",{className:"workspace",children:[b.jsx(qk,{report:s,onSelect:Lt,open:Vt,onOpen:()=>Ut(!0),onClose:()=>Ut(!1)}),o?b.jsx(Dk,{diff:o,filter:C,onFilter:k,onSelect:Lt}):null,b.jsx(Ik,{diff:o,tab:W,onTab:fe,oldVersionId:de,onVersion:ie,agentPanel:b.jsxs(b.Fragment,{children:[z?b.jsxs("div",{className:"feedback-storage-warning",children:[b.jsx("p",{className:"feedback-warning",role:"alert",children:z}),$.recoveryWarning?b.jsx("button",{type:"button",onClick:()=>X(ee=>({...ee,recoveryWarning:void 0})),children:"Replace damaged saved feedback"}):null]}):null,b.jsx(mk,{session:Sn,drafts:Object.values(se),view:bn,onView:ee=>{Ol(ee),k("all")},node:gt,diff:o,showingBefore:!!(Rm(o,gt)&&de===gt?.id)||!!(gt&&o?.nodeStatus[gt.id]==="removed"),message:Wn?se[Wn]?.message??"":"",onMessageChange:di,onAdded:ee=>di("",ee),queue:w,onQueueChange:te,storageNeedsReview:!!$.recoveryWarning})]}),gwtList:Ns,onGwtList:Ii,onClose:Ui,onFocusNode:ee=>Lt(ee,!0,!0),project:e,selectedNode:gt,findings:Hi,selectedFieldName:Ze,onSelect:Lt,onSelectField:ft,onClearField:()=>ft(void 0),onPreviewConnection:oa,onClearPreview:ra},(ln??gt)?.type==="gwt"?`gwt:${(ln??gt)?.sourcePath??(ln??gt)?.sliceTitle}`:"selection"),b.jsxs(K3,{children:[(A.actorIds.length>0||A.includeUnassigned)&&!Nt.nodes.some(ee=>!ee.hidden&&(ee.data.projectNode.type!=="story"&&ee.data.projectNode.type!=="slice"||ee.data.collapsed&&(ee.data.sliceCount??0)>0))?b.jsx("div",{className:"actor-empty",role:"status",children:"No screens match the selected actors and current filters."}):null,b.jsx(yw.Provider,{value:T,children:b.jsx(vw.Provider,{value:la,children:b.jsxs(mM,{nodes:Nt.nodes,edges:Nt.edges,nodeTypes:Ak,edgeTypes:Mk,onNodesChange:aa,onNodeClick:(ee,pe)=>Lt(pe.id),fitView:!0,minZoom:.2,maxZoom:1.8,nodesDraggable:!1,panOnScroll:!1,zoomOnScroll:!1,zoomOnPinch:!1,zoomActivationKeyCode:null,panActivationKeyCode:null,zoomOnDoubleClick:!1,autoPanOnNodeFocus:!1,colorMode:"light",children:[b.jsx(wM,{gap:18,size:1}),b.jsx(CM,{})]})})})]})]})]}):b.jsx("div",{className:"loading",children:b.jsx("div",{children:Je.error?b.jsxs(b.Fragment,{children:[b.jsx("p",{role:"alert",children:Je.error}),b.jsx("button",{type:"button",onClick:Je.refresh,children:"Retry connection"})]}):"Loading event model..."})})}function Yk(){return b.jsx(Q1,{children:b.jsx(Vk,{})})}jE.createRoot(document.getElementById("root")).render(b.jsx(wl.StrictMode,{children:b.jsx(Yk,{})}));